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/v4.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	// HighAvailabilityReplicaCount - The number of secondary replicas associated with the database that are used to provide high availability.
2073	HighAvailabilityReplicaCount *int32 `json:"highAvailabilityReplicaCount,omitempty"`
2074	// SecondaryType - The secondary type of the database if it is a secondary.  Valid values are Geo and Named. Possible values include: 'Geo', 'Named'
2075	SecondaryType SecondaryType `json:"secondaryType,omitempty"`
2076	// CurrentSku - READ-ONLY; The name and tier of the SKU.
2077	CurrentSku *Sku `json:"currentSku,omitempty"`
2078	// AutoPauseDelay - Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
2079	AutoPauseDelay *int32 `json:"autoPauseDelay,omitempty"`
2080	// StorageAccountType - The storage account type used to store backups for this database. Possible values include: 'GRS', 'LRS', 'ZRS'
2081	StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"`
2082	// MinCapacity - Minimal capacity that database will always have allocated, if not paused
2083	MinCapacity *float64 `json:"minCapacity,omitempty"`
2084	// PausedDate - READ-ONLY; The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
2085	PausedDate *date.Time `json:"pausedDate,omitempty"`
2086	// ResumedDate - READ-ONLY; The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
2087	ResumedDate *date.Time `json:"resumedDate,omitempty"`
2088	// MaintenanceConfigurationID - Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
2089	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`
2090}
2091
2092// MarshalJSON is the custom marshaler for DatabaseProperties.
2093func (dp DatabaseProperties) MarshalJSON() ([]byte, error) {
2094	objectMap := make(map[string]interface{})
2095	if dp.CreateMode != "" {
2096		objectMap["createMode"] = dp.CreateMode
2097	}
2098	if dp.Collation != nil {
2099		objectMap["collation"] = dp.Collation
2100	}
2101	if dp.MaxSizeBytes != nil {
2102		objectMap["maxSizeBytes"] = dp.MaxSizeBytes
2103	}
2104	if dp.SampleName != "" {
2105		objectMap["sampleName"] = dp.SampleName
2106	}
2107	if dp.ElasticPoolID != nil {
2108		objectMap["elasticPoolId"] = dp.ElasticPoolID
2109	}
2110	if dp.SourceDatabaseID != nil {
2111		objectMap["sourceDatabaseId"] = dp.SourceDatabaseID
2112	}
2113	if dp.RestorePointInTime != nil {
2114		objectMap["restorePointInTime"] = dp.RestorePointInTime
2115	}
2116	if dp.SourceDatabaseDeletionDate != nil {
2117		objectMap["sourceDatabaseDeletionDate"] = dp.SourceDatabaseDeletionDate
2118	}
2119	if dp.RecoveryServicesRecoveryPointID != nil {
2120		objectMap["recoveryServicesRecoveryPointId"] = dp.RecoveryServicesRecoveryPointID
2121	}
2122	if dp.LongTermRetentionBackupResourceID != nil {
2123		objectMap["longTermRetentionBackupResourceId"] = dp.LongTermRetentionBackupResourceID
2124	}
2125	if dp.RecoverableDatabaseID != nil {
2126		objectMap["recoverableDatabaseId"] = dp.RecoverableDatabaseID
2127	}
2128	if dp.RestorableDroppedDatabaseID != nil {
2129		objectMap["restorableDroppedDatabaseId"] = dp.RestorableDroppedDatabaseID
2130	}
2131	if dp.CatalogCollation != "" {
2132		objectMap["catalogCollation"] = dp.CatalogCollation
2133	}
2134	if dp.ZoneRedundant != nil {
2135		objectMap["zoneRedundant"] = dp.ZoneRedundant
2136	}
2137	if dp.LicenseType != "" {
2138		objectMap["licenseType"] = dp.LicenseType
2139	}
2140	if dp.ReadScale != "" {
2141		objectMap["readScale"] = dp.ReadScale
2142	}
2143	if dp.HighAvailabilityReplicaCount != nil {
2144		objectMap["highAvailabilityReplicaCount"] = dp.HighAvailabilityReplicaCount
2145	}
2146	if dp.SecondaryType != "" {
2147		objectMap["secondaryType"] = dp.SecondaryType
2148	}
2149	if dp.AutoPauseDelay != nil {
2150		objectMap["autoPauseDelay"] = dp.AutoPauseDelay
2151	}
2152	if dp.StorageAccountType != "" {
2153		objectMap["storageAccountType"] = dp.StorageAccountType
2154	}
2155	if dp.MinCapacity != nil {
2156		objectMap["minCapacity"] = dp.MinCapacity
2157	}
2158	if dp.MaintenanceConfigurationID != nil {
2159		objectMap["maintenanceConfigurationId"] = dp.MaintenanceConfigurationID
2160	}
2161	return json.Marshal(objectMap)
2162}
2163
2164// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
2165// operation.
2166type DatabasesCreateOrUpdateFuture struct {
2167	azure.FutureAPI
2168	// Result returns the result of the asynchronous operation.
2169	// If the operation has not completed it will return an error.
2170	Result func(DatabasesClient) (Database, error)
2171}
2172
2173// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2174func (future *DatabasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2175	var azFuture azure.Future
2176	if err := json.Unmarshal(body, &azFuture); err != nil {
2177		return err
2178	}
2179	future.FutureAPI = &azFuture
2180	future.Result = future.result
2181	return nil
2182}
2183
2184// result is the default implementation for DatabasesCreateOrUpdateFuture.Result.
2185func (future *DatabasesCreateOrUpdateFuture) result(client DatabasesClient) (d Database, err error) {
2186	var done bool
2187	done, err = future.DoneWithContext(context.Background(), client)
2188	if err != nil {
2189		err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2190		return
2191	}
2192	if !done {
2193		d.Response.Response = future.Response()
2194		err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateOrUpdateFuture")
2195		return
2196	}
2197	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2198	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2199		d, err = client.CreateOrUpdateResponder(d.Response.Response)
2200		if err != nil {
2201			err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
2202		}
2203	}
2204	return
2205}
2206
2207// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
2208// operation.
2209type DatabasesDeleteFuture struct {
2210	azure.FutureAPI
2211	// Result returns the result of the asynchronous operation.
2212	// If the operation has not completed it will return an error.
2213	Result func(DatabasesClient) (autorest.Response, error)
2214}
2215
2216// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2217func (future *DatabasesDeleteFuture) UnmarshalJSON(body []byte) error {
2218	var azFuture azure.Future
2219	if err := json.Unmarshal(body, &azFuture); err != nil {
2220		return err
2221	}
2222	future.FutureAPI = &azFuture
2223	future.Result = future.result
2224	return nil
2225}
2226
2227// result is the default implementation for DatabasesDeleteFuture.Result.
2228func (future *DatabasesDeleteFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
2229	var done bool
2230	done, err = future.DoneWithContext(context.Background(), client)
2231	if err != nil {
2232		err = autorest.NewErrorWithError(err, "sql.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure")
2233		return
2234	}
2235	if !done {
2236		ar.Response = future.Response()
2237		err = azure.NewAsyncOpIncompleteError("sql.DatabasesDeleteFuture")
2238		return
2239	}
2240	ar.Response = future.Response()
2241	return
2242}
2243
2244// DatabaseSecurityAlertPolicy contains information about a database Threat Detection policy.
2245type DatabaseSecurityAlertPolicy struct {
2246	autorest.Response `json:"-"`
2247	// Location - The geo-location where the resource lives
2248	Location *string `json:"location,omitempty"`
2249	// Kind - READ-ONLY; Resource kind.
2250	Kind *string `json:"kind,omitempty"`
2251	// DatabaseSecurityAlertPolicyProperties - Properties of the security alert policy.
2252	*DatabaseSecurityAlertPolicyProperties `json:"properties,omitempty"`
2253	// ID - READ-ONLY; Resource ID.
2254	ID *string `json:"id,omitempty"`
2255	// Name - READ-ONLY; Resource name.
2256	Name *string `json:"name,omitempty"`
2257	// Type - READ-ONLY; Resource type.
2258	Type *string `json:"type,omitempty"`
2259}
2260
2261// MarshalJSON is the custom marshaler for DatabaseSecurityAlertPolicy.
2262func (dsap DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
2263	objectMap := make(map[string]interface{})
2264	if dsap.Location != nil {
2265		objectMap["location"] = dsap.Location
2266	}
2267	if dsap.DatabaseSecurityAlertPolicyProperties != nil {
2268		objectMap["properties"] = dsap.DatabaseSecurityAlertPolicyProperties
2269	}
2270	return json.Marshal(objectMap)
2271}
2272
2273// UnmarshalJSON is the custom unmarshaler for DatabaseSecurityAlertPolicy struct.
2274func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
2275	var m map[string]*json.RawMessage
2276	err := json.Unmarshal(body, &m)
2277	if err != nil {
2278		return err
2279	}
2280	for k, v := range m {
2281		switch k {
2282		case "location":
2283			if v != nil {
2284				var location string
2285				err = json.Unmarshal(*v, &location)
2286				if err != nil {
2287					return err
2288				}
2289				dsap.Location = &location
2290			}
2291		case "kind":
2292			if v != nil {
2293				var kind string
2294				err = json.Unmarshal(*v, &kind)
2295				if err != nil {
2296					return err
2297				}
2298				dsap.Kind = &kind
2299			}
2300		case "properties":
2301			if v != nil {
2302				var databaseSecurityAlertPolicyProperties DatabaseSecurityAlertPolicyProperties
2303				err = json.Unmarshal(*v, &databaseSecurityAlertPolicyProperties)
2304				if err != nil {
2305					return err
2306				}
2307				dsap.DatabaseSecurityAlertPolicyProperties = &databaseSecurityAlertPolicyProperties
2308			}
2309		case "id":
2310			if v != nil {
2311				var ID string
2312				err = json.Unmarshal(*v, &ID)
2313				if err != nil {
2314					return err
2315				}
2316				dsap.ID = &ID
2317			}
2318		case "name":
2319			if v != nil {
2320				var name string
2321				err = json.Unmarshal(*v, &name)
2322				if err != nil {
2323					return err
2324				}
2325				dsap.Name = &name
2326			}
2327		case "type":
2328			if v != nil {
2329				var typeVar string
2330				err = json.Unmarshal(*v, &typeVar)
2331				if err != nil {
2332					return err
2333				}
2334				dsap.Type = &typeVar
2335			}
2336		}
2337	}
2338
2339	return nil
2340}
2341
2342// DatabaseSecurityAlertPolicyProperties properties for a database Threat Detection policy.
2343type DatabaseSecurityAlertPolicyProperties struct {
2344	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled'
2345	State SecurityAlertPolicyState `json:"state,omitempty"`
2346	// 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.
2347	DisabledAlerts *string `json:"disabledAlerts,omitempty"`
2348	// EmailAddresses - Specifies the semicolon-separated list of e-mail addresses to which the alert is sent.
2349	EmailAddresses *string `json:"emailAddresses,omitempty"`
2350	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators. Possible values include: 'SecurityAlertPolicyEmailAccountAdminsEnabled', 'SecurityAlertPolicyEmailAccountAdminsDisabled'
2351	EmailAccountAdmins SecurityAlertPolicyEmailAccountAdmins `json:"emailAccountAdmins,omitempty"`
2352	// 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.
2353	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
2354	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. If state is Enabled, storageAccountAccessKey is required.
2355	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
2356	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
2357	RetentionDays *int32 `json:"retentionDays,omitempty"`
2358	// UseServerDefault - Specifies whether to use the default server policy. Possible values include: 'SecurityAlertPolicyUseServerDefaultEnabled', 'SecurityAlertPolicyUseServerDefaultDisabled'
2359	UseServerDefault SecurityAlertPolicyUseServerDefault `json:"useServerDefault,omitempty"`
2360}
2361
2362// DatabasesExportFuture an abstraction for monitoring and retrieving the results of a long-running
2363// operation.
2364type DatabasesExportFuture struct {
2365	azure.FutureAPI
2366	// Result returns the result of the asynchronous operation.
2367	// If the operation has not completed it will return an error.
2368	Result func(DatabasesClient) (ImportExportOperationResult, error)
2369}
2370
2371// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2372func (future *DatabasesExportFuture) UnmarshalJSON(body []byte) error {
2373	var azFuture azure.Future
2374	if err := json.Unmarshal(body, &azFuture); err != nil {
2375		return err
2376	}
2377	future.FutureAPI = &azFuture
2378	future.Result = future.result
2379	return nil
2380}
2381
2382// result is the default implementation for DatabasesExportFuture.Result.
2383func (future *DatabasesExportFuture) result(client DatabasesClient) (ieor ImportExportOperationResult, err error) {
2384	var done bool
2385	done, err = future.DoneWithContext(context.Background(), client)
2386	if err != nil {
2387		err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", future.Response(), "Polling failure")
2388		return
2389	}
2390	if !done {
2391		ieor.Response.Response = future.Response()
2392		err = azure.NewAsyncOpIncompleteError("sql.DatabasesExportFuture")
2393		return
2394	}
2395	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2396	if ieor.Response.Response, err = future.GetResult(sender); err == nil && ieor.Response.Response.StatusCode != http.StatusNoContent {
2397		ieor, err = client.ExportResponder(ieor.Response.Response)
2398		if err != nil {
2399			err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", ieor.Response.Response, "Failure responding to request")
2400		}
2401	}
2402	return
2403}
2404
2405// DatabasesFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
2406// operation.
2407type DatabasesFailoverFuture struct {
2408	azure.FutureAPI
2409	// Result returns the result of the asynchronous operation.
2410	// If the operation has not completed it will return an error.
2411	Result func(DatabasesClient) (autorest.Response, error)
2412}
2413
2414// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2415func (future *DatabasesFailoverFuture) UnmarshalJSON(body []byte) error {
2416	var azFuture azure.Future
2417	if err := json.Unmarshal(body, &azFuture); err != nil {
2418		return err
2419	}
2420	future.FutureAPI = &azFuture
2421	future.Result = future.result
2422	return nil
2423}
2424
2425// result is the default implementation for DatabasesFailoverFuture.Result.
2426func (future *DatabasesFailoverFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
2427	var done bool
2428	done, err = future.DoneWithContext(context.Background(), client)
2429	if err != nil {
2430		err = autorest.NewErrorWithError(err, "sql.DatabasesFailoverFuture", "Result", future.Response(), "Polling failure")
2431		return
2432	}
2433	if !done {
2434		ar.Response = future.Response()
2435		err = azure.NewAsyncOpIncompleteError("sql.DatabasesFailoverFuture")
2436		return
2437	}
2438	ar.Response = future.Response()
2439	return
2440}
2441
2442// DatabasesPauseFuture an abstraction for monitoring and retrieving the results of a long-running
2443// operation.
2444type DatabasesPauseFuture struct {
2445	azure.FutureAPI
2446	// Result returns the result of the asynchronous operation.
2447	// If the operation has not completed it will return an error.
2448	Result func(DatabasesClient) (Database, error)
2449}
2450
2451// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2452func (future *DatabasesPauseFuture) UnmarshalJSON(body []byte) error {
2453	var azFuture azure.Future
2454	if err := json.Unmarshal(body, &azFuture); err != nil {
2455		return err
2456	}
2457	future.FutureAPI = &azFuture
2458	future.Result = future.result
2459	return nil
2460}
2461
2462// result is the default implementation for DatabasesPauseFuture.Result.
2463func (future *DatabasesPauseFuture) result(client DatabasesClient) (d Database, err error) {
2464	var done bool
2465	done, err = future.DoneWithContext(context.Background(), client)
2466	if err != nil {
2467		err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", future.Response(), "Polling failure")
2468		return
2469	}
2470	if !done {
2471		d.Response.Response = future.Response()
2472		err = azure.NewAsyncOpIncompleteError("sql.DatabasesPauseFuture")
2473		return
2474	}
2475	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2476	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2477		d, err = client.PauseResponder(d.Response.Response)
2478		if err != nil {
2479			err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", d.Response.Response, "Failure responding to request")
2480		}
2481	}
2482	return
2483}
2484
2485// DatabasesResumeFuture an abstraction for monitoring and retrieving the results of a long-running
2486// operation.
2487type DatabasesResumeFuture struct {
2488	azure.FutureAPI
2489	// Result returns the result of the asynchronous operation.
2490	// If the operation has not completed it will return an error.
2491	Result func(DatabasesClient) (Database, error)
2492}
2493
2494// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2495func (future *DatabasesResumeFuture) UnmarshalJSON(body []byte) error {
2496	var azFuture azure.Future
2497	if err := json.Unmarshal(body, &azFuture); err != nil {
2498		return err
2499	}
2500	future.FutureAPI = &azFuture
2501	future.Result = future.result
2502	return nil
2503}
2504
2505// result is the default implementation for DatabasesResumeFuture.Result.
2506func (future *DatabasesResumeFuture) result(client DatabasesClient) (d Database, err error) {
2507	var done bool
2508	done, err = future.DoneWithContext(context.Background(), client)
2509	if err != nil {
2510		err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", future.Response(), "Polling failure")
2511		return
2512	}
2513	if !done {
2514		d.Response.Response = future.Response()
2515		err = azure.NewAsyncOpIncompleteError("sql.DatabasesResumeFuture")
2516		return
2517	}
2518	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2519	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2520		d, err = client.ResumeResponder(d.Response.Response)
2521		if err != nil {
2522			err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", d.Response.Response, "Failure responding to request")
2523		}
2524	}
2525	return
2526}
2527
2528// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
2529// operation.
2530type DatabasesUpdateFuture struct {
2531	azure.FutureAPI
2532	// Result returns the result of the asynchronous operation.
2533	// If the operation has not completed it will return an error.
2534	Result func(DatabasesClient) (Database, error)
2535}
2536
2537// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2538func (future *DatabasesUpdateFuture) UnmarshalJSON(body []byte) error {
2539	var azFuture azure.Future
2540	if err := json.Unmarshal(body, &azFuture); err != nil {
2541		return err
2542	}
2543	future.FutureAPI = &azFuture
2544	future.Result = future.result
2545	return nil
2546}
2547
2548// result is the default implementation for DatabasesUpdateFuture.Result.
2549func (future *DatabasesUpdateFuture) result(client DatabasesClient) (d Database, err error) {
2550	var done bool
2551	done, err = future.DoneWithContext(context.Background(), client)
2552	if err != nil {
2553		err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure")
2554		return
2555	}
2556	if !done {
2557		d.Response.Response = future.Response()
2558		err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpdateFuture")
2559		return
2560	}
2561	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2562	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2563		d, err = client.UpdateResponder(d.Response.Response)
2564		if err != nil {
2565			err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
2566		}
2567	}
2568	return
2569}
2570
2571// DatabasesUpgradeDataWarehouseFuture an abstraction for monitoring and retrieving the results of a
2572// long-running operation.
2573type DatabasesUpgradeDataWarehouseFuture struct {
2574	azure.FutureAPI
2575	// Result returns the result of the asynchronous operation.
2576	// If the operation has not completed it will return an error.
2577	Result func(DatabasesClient) (autorest.Response, error)
2578}
2579
2580// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2581func (future *DatabasesUpgradeDataWarehouseFuture) UnmarshalJSON(body []byte) error {
2582	var azFuture azure.Future
2583	if err := json.Unmarshal(body, &azFuture); err != nil {
2584		return err
2585	}
2586	future.FutureAPI = &azFuture
2587	future.Result = future.result
2588	return nil
2589}
2590
2591// result is the default implementation for DatabasesUpgradeDataWarehouseFuture.Result.
2592func (future *DatabasesUpgradeDataWarehouseFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
2593	var done bool
2594	done, err = future.DoneWithContext(context.Background(), client)
2595	if err != nil {
2596		err = autorest.NewErrorWithError(err, "sql.DatabasesUpgradeDataWarehouseFuture", "Result", future.Response(), "Polling failure")
2597		return
2598	}
2599	if !done {
2600		ar.Response = future.Response()
2601		err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpgradeDataWarehouseFuture")
2602		return
2603	}
2604	ar.Response = future.Response()
2605	return
2606}
2607
2608// DatabaseUpdate a database resource.
2609type DatabaseUpdate struct {
2610	// Sku - The name and tier of the SKU.
2611	Sku *Sku `json:"sku,omitempty"`
2612	// DatabaseProperties - Resource properties.
2613	*DatabaseProperties `json:"properties,omitempty"`
2614	// Tags - Resource tags.
2615	Tags map[string]*string `json:"tags"`
2616}
2617
2618// MarshalJSON is the custom marshaler for DatabaseUpdate.
2619func (du DatabaseUpdate) MarshalJSON() ([]byte, error) {
2620	objectMap := make(map[string]interface{})
2621	if du.Sku != nil {
2622		objectMap["sku"] = du.Sku
2623	}
2624	if du.DatabaseProperties != nil {
2625		objectMap["properties"] = du.DatabaseProperties
2626	}
2627	if du.Tags != nil {
2628		objectMap["tags"] = du.Tags
2629	}
2630	return json.Marshal(objectMap)
2631}
2632
2633// UnmarshalJSON is the custom unmarshaler for DatabaseUpdate struct.
2634func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error {
2635	var m map[string]*json.RawMessage
2636	err := json.Unmarshal(body, &m)
2637	if err != nil {
2638		return err
2639	}
2640	for k, v := range m {
2641		switch k {
2642		case "sku":
2643			if v != nil {
2644				var sku Sku
2645				err = json.Unmarshal(*v, &sku)
2646				if err != nil {
2647					return err
2648				}
2649				du.Sku = &sku
2650			}
2651		case "properties":
2652			if v != nil {
2653				var databaseProperties DatabaseProperties
2654				err = json.Unmarshal(*v, &databaseProperties)
2655				if err != nil {
2656					return err
2657				}
2658				du.DatabaseProperties = &databaseProperties
2659			}
2660		case "tags":
2661			if v != nil {
2662				var tags map[string]*string
2663				err = json.Unmarshal(*v, &tags)
2664				if err != nil {
2665					return err
2666				}
2667				du.Tags = tags
2668			}
2669		}
2670	}
2671
2672	return nil
2673}
2674
2675// DatabaseUsage the database usages.
2676type DatabaseUsage struct {
2677	// Name - READ-ONLY; The name of the usage metric.
2678	Name *string `json:"name,omitempty"`
2679	// ResourceName - READ-ONLY; The name of the resource.
2680	ResourceName *string `json:"resourceName,omitempty"`
2681	// DisplayName - READ-ONLY; The usage metric display name.
2682	DisplayName *string `json:"displayName,omitempty"`
2683	// CurrentValue - READ-ONLY; The current value of the usage metric.
2684	CurrentValue *float64 `json:"currentValue,omitempty"`
2685	// Limit - READ-ONLY; The current limit of the usage metric.
2686	Limit *float64 `json:"limit,omitempty"`
2687	// Unit - READ-ONLY; The units of the usage metric.
2688	Unit *string `json:"unit,omitempty"`
2689	// NextResetTime - READ-ONLY; The next reset time for the usage metric (ISO8601 format).
2690	NextResetTime *date.Time `json:"nextResetTime,omitempty"`
2691}
2692
2693// MarshalJSON is the custom marshaler for DatabaseUsage.
2694func (du DatabaseUsage) MarshalJSON() ([]byte, error) {
2695	objectMap := make(map[string]interface{})
2696	return json.Marshal(objectMap)
2697}
2698
2699// DatabaseUsageListResult the response to a list database metrics request.
2700type DatabaseUsageListResult struct {
2701	autorest.Response `json:"-"`
2702	// Value - The list of database usages for the database.
2703	Value *[]DatabaseUsage `json:"value,omitempty"`
2704}
2705
2706// DatabaseVulnerabilityAssessment a database vulnerability assessment.
2707type DatabaseVulnerabilityAssessment struct {
2708	autorest.Response `json:"-"`
2709	// DatabaseVulnerabilityAssessmentProperties - Resource properties.
2710	*DatabaseVulnerabilityAssessmentProperties `json:"properties,omitempty"`
2711	// ID - READ-ONLY; Resource ID.
2712	ID *string `json:"id,omitempty"`
2713	// Name - READ-ONLY; Resource name.
2714	Name *string `json:"name,omitempty"`
2715	// Type - READ-ONLY; Resource type.
2716	Type *string `json:"type,omitempty"`
2717}
2718
2719// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessment.
2720func (dva DatabaseVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
2721	objectMap := make(map[string]interface{})
2722	if dva.DatabaseVulnerabilityAssessmentProperties != nil {
2723		objectMap["properties"] = dva.DatabaseVulnerabilityAssessmentProperties
2724	}
2725	return json.Marshal(objectMap)
2726}
2727
2728// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessment struct.
2729func (dva *DatabaseVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
2730	var m map[string]*json.RawMessage
2731	err := json.Unmarshal(body, &m)
2732	if err != nil {
2733		return err
2734	}
2735	for k, v := range m {
2736		switch k {
2737		case "properties":
2738			if v != nil {
2739				var databaseVulnerabilityAssessmentProperties DatabaseVulnerabilityAssessmentProperties
2740				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentProperties)
2741				if err != nil {
2742					return err
2743				}
2744				dva.DatabaseVulnerabilityAssessmentProperties = &databaseVulnerabilityAssessmentProperties
2745			}
2746		case "id":
2747			if v != nil {
2748				var ID string
2749				err = json.Unmarshal(*v, &ID)
2750				if err != nil {
2751					return err
2752				}
2753				dva.ID = &ID
2754			}
2755		case "name":
2756			if v != nil {
2757				var name string
2758				err = json.Unmarshal(*v, &name)
2759				if err != nil {
2760					return err
2761				}
2762				dva.Name = &name
2763			}
2764		case "type":
2765			if v != nil {
2766				var typeVar string
2767				err = json.Unmarshal(*v, &typeVar)
2768				if err != nil {
2769					return err
2770				}
2771				dva.Type = &typeVar
2772			}
2773		}
2774	}
2775
2776	return nil
2777}
2778
2779// DatabaseVulnerabilityAssessmentListResult a list of the database's vulnerability assessments.
2780type DatabaseVulnerabilityAssessmentListResult struct {
2781	autorest.Response `json:"-"`
2782	// Value - READ-ONLY; Array of results.
2783	Value *[]DatabaseVulnerabilityAssessment `json:"value,omitempty"`
2784	// NextLink - READ-ONLY; Link to retrieve next page of results.
2785	NextLink *string `json:"nextLink,omitempty"`
2786}
2787
2788// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentListResult.
2789func (dvalr DatabaseVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) {
2790	objectMap := make(map[string]interface{})
2791	return json.Marshal(objectMap)
2792}
2793
2794// DatabaseVulnerabilityAssessmentListResultIterator provides access to a complete listing of
2795// DatabaseVulnerabilityAssessment values.
2796type DatabaseVulnerabilityAssessmentListResultIterator struct {
2797	i    int
2798	page DatabaseVulnerabilityAssessmentListResultPage
2799}
2800
2801// NextWithContext advances to the next value.  If there was an error making
2802// the request the iterator does not advance and the error is returned.
2803func (iter *DatabaseVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
2804	if tracing.IsEnabled() {
2805		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentListResultIterator.NextWithContext")
2806		defer func() {
2807			sc := -1
2808			if iter.Response().Response.Response != nil {
2809				sc = iter.Response().Response.Response.StatusCode
2810			}
2811			tracing.EndSpan(ctx, sc, err)
2812		}()
2813	}
2814	iter.i++
2815	if iter.i < len(iter.page.Values()) {
2816		return nil
2817	}
2818	err = iter.page.NextWithContext(ctx)
2819	if err != nil {
2820		iter.i--
2821		return err
2822	}
2823	iter.i = 0
2824	return nil
2825}
2826
2827// Next advances to the next value.  If there was an error making
2828// the request the iterator does not advance and the error is returned.
2829// Deprecated: Use NextWithContext() instead.
2830func (iter *DatabaseVulnerabilityAssessmentListResultIterator) Next() error {
2831	return iter.NextWithContext(context.Background())
2832}
2833
2834// NotDone returns true if the enumeration should be started or is not yet complete.
2835func (iter DatabaseVulnerabilityAssessmentListResultIterator) NotDone() bool {
2836	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2837}
2838
2839// Response returns the raw server response from the last page request.
2840func (iter DatabaseVulnerabilityAssessmentListResultIterator) Response() DatabaseVulnerabilityAssessmentListResult {
2841	return iter.page.Response()
2842}
2843
2844// Value returns the current value or a zero-initialized value if the
2845// iterator has advanced beyond the end of the collection.
2846func (iter DatabaseVulnerabilityAssessmentListResultIterator) Value() DatabaseVulnerabilityAssessment {
2847	if !iter.page.NotDone() {
2848		return DatabaseVulnerabilityAssessment{}
2849	}
2850	return iter.page.Values()[iter.i]
2851}
2852
2853// Creates a new instance of the DatabaseVulnerabilityAssessmentListResultIterator type.
2854func NewDatabaseVulnerabilityAssessmentListResultIterator(page DatabaseVulnerabilityAssessmentListResultPage) DatabaseVulnerabilityAssessmentListResultIterator {
2855	return DatabaseVulnerabilityAssessmentListResultIterator{page: page}
2856}
2857
2858// IsEmpty returns true if the ListResult contains no values.
2859func (dvalr DatabaseVulnerabilityAssessmentListResult) IsEmpty() bool {
2860	return dvalr.Value == nil || len(*dvalr.Value) == 0
2861}
2862
2863// hasNextLink returns true if the NextLink is not empty.
2864func (dvalr DatabaseVulnerabilityAssessmentListResult) hasNextLink() bool {
2865	return dvalr.NextLink != nil && len(*dvalr.NextLink) != 0
2866}
2867
2868// databaseVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
2869// It returns nil if no more results exist.
2870func (dvalr DatabaseVulnerabilityAssessmentListResult) databaseVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
2871	if !dvalr.hasNextLink() {
2872		return nil, nil
2873	}
2874	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2875		autorest.AsJSON(),
2876		autorest.AsGet(),
2877		autorest.WithBaseURL(to.String(dvalr.NextLink)))
2878}
2879
2880// DatabaseVulnerabilityAssessmentListResultPage contains a page of DatabaseVulnerabilityAssessment values.
2881type DatabaseVulnerabilityAssessmentListResultPage struct {
2882	fn    func(context.Context, DatabaseVulnerabilityAssessmentListResult) (DatabaseVulnerabilityAssessmentListResult, error)
2883	dvalr DatabaseVulnerabilityAssessmentListResult
2884}
2885
2886// NextWithContext advances to the next page of values.  If there was an error making
2887// the request the page does not advance and the error is returned.
2888func (page *DatabaseVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
2889	if tracing.IsEnabled() {
2890		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentListResultPage.NextWithContext")
2891		defer func() {
2892			sc := -1
2893			if page.Response().Response.Response != nil {
2894				sc = page.Response().Response.Response.StatusCode
2895			}
2896			tracing.EndSpan(ctx, sc, err)
2897		}()
2898	}
2899	for {
2900		next, err := page.fn(ctx, page.dvalr)
2901		if err != nil {
2902			return err
2903		}
2904		page.dvalr = next
2905		if !next.hasNextLink() || !next.IsEmpty() {
2906			break
2907		}
2908	}
2909	return nil
2910}
2911
2912// Next advances to the next page of values.  If there was an error making
2913// the request the page does not advance and the error is returned.
2914// Deprecated: Use NextWithContext() instead.
2915func (page *DatabaseVulnerabilityAssessmentListResultPage) Next() error {
2916	return page.NextWithContext(context.Background())
2917}
2918
2919// NotDone returns true if the page enumeration should be started or is not yet complete.
2920func (page DatabaseVulnerabilityAssessmentListResultPage) NotDone() bool {
2921	return !page.dvalr.IsEmpty()
2922}
2923
2924// Response returns the raw server response from the last page request.
2925func (page DatabaseVulnerabilityAssessmentListResultPage) Response() DatabaseVulnerabilityAssessmentListResult {
2926	return page.dvalr
2927}
2928
2929// Values returns the slice of values for the current page or nil if there are no values.
2930func (page DatabaseVulnerabilityAssessmentListResultPage) Values() []DatabaseVulnerabilityAssessment {
2931	if page.dvalr.IsEmpty() {
2932		return nil
2933	}
2934	return *page.dvalr.Value
2935}
2936
2937// Creates a new instance of the DatabaseVulnerabilityAssessmentListResultPage type.
2938func NewDatabaseVulnerabilityAssessmentListResultPage(cur DatabaseVulnerabilityAssessmentListResult, getNextPage func(context.Context, DatabaseVulnerabilityAssessmentListResult) (DatabaseVulnerabilityAssessmentListResult, error)) DatabaseVulnerabilityAssessmentListResultPage {
2939	return DatabaseVulnerabilityAssessmentListResultPage{
2940		fn:    getNextPage,
2941		dvalr: cur,
2942	}
2943}
2944
2945// DatabaseVulnerabilityAssessmentProperties properties of a database Vulnerability Assessment.
2946type DatabaseVulnerabilityAssessmentProperties struct {
2947	// 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
2948	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
2949	// 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.
2950	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
2951	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
2952	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
2953	// RecurringScans - The recurring scans settings
2954	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
2955}
2956
2957// DatabaseVulnerabilityAssessmentRuleBaseline a database vulnerability assessment rule baseline.
2958type DatabaseVulnerabilityAssessmentRuleBaseline struct {
2959	autorest.Response `json:"-"`
2960	// DatabaseVulnerabilityAssessmentRuleBaselineProperties - Resource properties.
2961	*DatabaseVulnerabilityAssessmentRuleBaselineProperties `json:"properties,omitempty"`
2962	// ID - READ-ONLY; Resource ID.
2963	ID *string `json:"id,omitempty"`
2964	// Name - READ-ONLY; Resource name.
2965	Name *string `json:"name,omitempty"`
2966	// Type - READ-ONLY; Resource type.
2967	Type *string `json:"type,omitempty"`
2968}
2969
2970// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentRuleBaseline.
2971func (dvarb DatabaseVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) {
2972	objectMap := make(map[string]interface{})
2973	if dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties != nil {
2974		objectMap["properties"] = dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties
2975	}
2976	return json.Marshal(objectMap)
2977}
2978
2979// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessmentRuleBaseline struct.
2980func (dvarb *DatabaseVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(body []byte) error {
2981	var m map[string]*json.RawMessage
2982	err := json.Unmarshal(body, &m)
2983	if err != nil {
2984		return err
2985	}
2986	for k, v := range m {
2987		switch k {
2988		case "properties":
2989			if v != nil {
2990				var databaseVulnerabilityAssessmentRuleBaselineProperties DatabaseVulnerabilityAssessmentRuleBaselineProperties
2991				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentRuleBaselineProperties)
2992				if err != nil {
2993					return err
2994				}
2995				dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties = &databaseVulnerabilityAssessmentRuleBaselineProperties
2996			}
2997		case "id":
2998			if v != nil {
2999				var ID string
3000				err = json.Unmarshal(*v, &ID)
3001				if err != nil {
3002					return err
3003				}
3004				dvarb.ID = &ID
3005			}
3006		case "name":
3007			if v != nil {
3008				var name string
3009				err = json.Unmarshal(*v, &name)
3010				if err != nil {
3011					return err
3012				}
3013				dvarb.Name = &name
3014			}
3015		case "type":
3016			if v != nil {
3017				var typeVar string
3018				err = json.Unmarshal(*v, &typeVar)
3019				if err != nil {
3020					return err
3021				}
3022				dvarb.Type = &typeVar
3023			}
3024		}
3025	}
3026
3027	return nil
3028}
3029
3030// DatabaseVulnerabilityAssessmentRuleBaselineItem properties for an Azure SQL Database Vulnerability
3031// Assessment rule baseline's result.
3032type DatabaseVulnerabilityAssessmentRuleBaselineItem struct {
3033	// Result - The rule baseline result
3034	Result *[]string `json:"result,omitempty"`
3035}
3036
3037// DatabaseVulnerabilityAssessmentRuleBaselineProperties properties of a database Vulnerability Assessment
3038// rule baseline.
3039type DatabaseVulnerabilityAssessmentRuleBaselineProperties struct {
3040	// BaselineResults - The rule baseline result
3041	BaselineResults *[]DatabaseVulnerabilityAssessmentRuleBaselineItem `json:"baselineResults,omitempty"`
3042}
3043
3044// DatabaseVulnerabilityAssessmentScanExportProperties properties of the export operation's result.
3045type DatabaseVulnerabilityAssessmentScanExportProperties struct {
3046	// ExportedReportLocation - READ-ONLY; Location of the exported report (e.g. https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx).
3047	ExportedReportLocation *string `json:"exportedReportLocation,omitempty"`
3048}
3049
3050// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentScanExportProperties.
3051func (dvasep DatabaseVulnerabilityAssessmentScanExportProperties) MarshalJSON() ([]byte, error) {
3052	objectMap := make(map[string]interface{})
3053	return json.Marshal(objectMap)
3054}
3055
3056// DatabaseVulnerabilityAssessmentScansExport a database Vulnerability Assessment scan export resource.
3057type DatabaseVulnerabilityAssessmentScansExport struct {
3058	autorest.Response `json:"-"`
3059	// DatabaseVulnerabilityAssessmentScanExportProperties - Resource properties.
3060	*DatabaseVulnerabilityAssessmentScanExportProperties `json:"properties,omitempty"`
3061	// ID - READ-ONLY; Resource ID.
3062	ID *string `json:"id,omitempty"`
3063	// Name - READ-ONLY; Resource name.
3064	Name *string `json:"name,omitempty"`
3065	// Type - READ-ONLY; Resource type.
3066	Type *string `json:"type,omitempty"`
3067}
3068
3069// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentScansExport.
3070func (dvase DatabaseVulnerabilityAssessmentScansExport) MarshalJSON() ([]byte, error) {
3071	objectMap := make(map[string]interface{})
3072	if dvase.DatabaseVulnerabilityAssessmentScanExportProperties != nil {
3073		objectMap["properties"] = dvase.DatabaseVulnerabilityAssessmentScanExportProperties
3074	}
3075	return json.Marshal(objectMap)
3076}
3077
3078// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessmentScansExport struct.
3079func (dvase *DatabaseVulnerabilityAssessmentScansExport) UnmarshalJSON(body []byte) error {
3080	var m map[string]*json.RawMessage
3081	err := json.Unmarshal(body, &m)
3082	if err != nil {
3083		return err
3084	}
3085	for k, v := range m {
3086		switch k {
3087		case "properties":
3088			if v != nil {
3089				var databaseVulnerabilityAssessmentScanExportProperties DatabaseVulnerabilityAssessmentScanExportProperties
3090				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentScanExportProperties)
3091				if err != nil {
3092					return err
3093				}
3094				dvase.DatabaseVulnerabilityAssessmentScanExportProperties = &databaseVulnerabilityAssessmentScanExportProperties
3095			}
3096		case "id":
3097			if v != nil {
3098				var ID string
3099				err = json.Unmarshal(*v, &ID)
3100				if err != nil {
3101					return err
3102				}
3103				dvase.ID = &ID
3104			}
3105		case "name":
3106			if v != nil {
3107				var name string
3108				err = json.Unmarshal(*v, &name)
3109				if err != nil {
3110					return err
3111				}
3112				dvase.Name = &name
3113			}
3114		case "type":
3115			if v != nil {
3116				var typeVar string
3117				err = json.Unmarshal(*v, &typeVar)
3118				if err != nil {
3119					return err
3120				}
3121				dvase.Type = &typeVar
3122			}
3123		}
3124	}
3125
3126	return nil
3127}
3128
3129// DatabaseVulnerabilityAssessmentScansInitiateScanFuture an abstraction for monitoring and retrieving the
3130// results of a long-running operation.
3131type DatabaseVulnerabilityAssessmentScansInitiateScanFuture struct {
3132	azure.FutureAPI
3133	// Result returns the result of the asynchronous operation.
3134	// If the operation has not completed it will return an error.
3135	Result func(DatabaseVulnerabilityAssessmentScansClient) (autorest.Response, error)
3136}
3137
3138// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3139func (future *DatabaseVulnerabilityAssessmentScansInitiateScanFuture) UnmarshalJSON(body []byte) error {
3140	var azFuture azure.Future
3141	if err := json.Unmarshal(body, &azFuture); err != nil {
3142		return err
3143	}
3144	future.FutureAPI = &azFuture
3145	future.Result = future.result
3146	return nil
3147}
3148
3149// result is the default implementation for DatabaseVulnerabilityAssessmentScansInitiateScanFuture.Result.
3150func (future *DatabaseVulnerabilityAssessmentScansInitiateScanFuture) result(client DatabaseVulnerabilityAssessmentScansClient) (ar autorest.Response, err error) {
3151	var done bool
3152	done, err = future.DoneWithContext(context.Background(), client)
3153	if err != nil {
3154		err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansInitiateScanFuture", "Result", future.Response(), "Polling failure")
3155		return
3156	}
3157	if !done {
3158		ar.Response = future.Response()
3159		err = azure.NewAsyncOpIncompleteError("sql.DatabaseVulnerabilityAssessmentScansInitiateScanFuture")
3160		return
3161	}
3162	ar.Response = future.Response()
3163	return
3164}
3165
3166// DataMaskingPolicy represents a database data masking policy.
3167type DataMaskingPolicy struct {
3168	autorest.Response `json:"-"`
3169	// DataMaskingPolicyProperties - The properties of the data masking policy.
3170	*DataMaskingPolicyProperties `json:"properties,omitempty"`
3171	// Location - READ-ONLY; The location of the data masking policy.
3172	Location *string `json:"location,omitempty"`
3173	// Kind - READ-ONLY; The kind of data masking policy. Metadata, used for Azure portal.
3174	Kind *string `json:"kind,omitempty"`
3175	// ID - READ-ONLY; Resource ID.
3176	ID *string `json:"id,omitempty"`
3177	// Name - READ-ONLY; Resource name.
3178	Name *string `json:"name,omitempty"`
3179	// Type - READ-ONLY; Resource type.
3180	Type *string `json:"type,omitempty"`
3181}
3182
3183// MarshalJSON is the custom marshaler for DataMaskingPolicy.
3184func (dmp DataMaskingPolicy) MarshalJSON() ([]byte, error) {
3185	objectMap := make(map[string]interface{})
3186	if dmp.DataMaskingPolicyProperties != nil {
3187		objectMap["properties"] = dmp.DataMaskingPolicyProperties
3188	}
3189	return json.Marshal(objectMap)
3190}
3191
3192// UnmarshalJSON is the custom unmarshaler for DataMaskingPolicy struct.
3193func (dmp *DataMaskingPolicy) UnmarshalJSON(body []byte) error {
3194	var m map[string]*json.RawMessage
3195	err := json.Unmarshal(body, &m)
3196	if err != nil {
3197		return err
3198	}
3199	for k, v := range m {
3200		switch k {
3201		case "properties":
3202			if v != nil {
3203				var dataMaskingPolicyProperties DataMaskingPolicyProperties
3204				err = json.Unmarshal(*v, &dataMaskingPolicyProperties)
3205				if err != nil {
3206					return err
3207				}
3208				dmp.DataMaskingPolicyProperties = &dataMaskingPolicyProperties
3209			}
3210		case "location":
3211			if v != nil {
3212				var location string
3213				err = json.Unmarshal(*v, &location)
3214				if err != nil {
3215					return err
3216				}
3217				dmp.Location = &location
3218			}
3219		case "kind":
3220			if v != nil {
3221				var kind string
3222				err = json.Unmarshal(*v, &kind)
3223				if err != nil {
3224					return err
3225				}
3226				dmp.Kind = &kind
3227			}
3228		case "id":
3229			if v != nil {
3230				var ID string
3231				err = json.Unmarshal(*v, &ID)
3232				if err != nil {
3233					return err
3234				}
3235				dmp.ID = &ID
3236			}
3237		case "name":
3238			if v != nil {
3239				var name string
3240				err = json.Unmarshal(*v, &name)
3241				if err != nil {
3242					return err
3243				}
3244				dmp.Name = &name
3245			}
3246		case "type":
3247			if v != nil {
3248				var typeVar string
3249				err = json.Unmarshal(*v, &typeVar)
3250				if err != nil {
3251					return err
3252				}
3253				dmp.Type = &typeVar
3254			}
3255		}
3256	}
3257
3258	return nil
3259}
3260
3261// DataMaskingPolicyProperties the properties of a database data masking policy.
3262type DataMaskingPolicyProperties struct {
3263	// DataMaskingState - The state of the data masking policy. Possible values include: 'DataMaskingStateDisabled', 'DataMaskingStateEnabled'
3264	DataMaskingState DataMaskingState `json:"dataMaskingState,omitempty"`
3265	// 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.
3266	ExemptPrincipals *string `json:"exemptPrincipals,omitempty"`
3267	// ApplicationPrincipals - READ-ONLY; The list of the application principals. This is a legacy parameter and is no longer used.
3268	ApplicationPrincipals *string `json:"applicationPrincipals,omitempty"`
3269	// MaskingLevel - READ-ONLY; The masking level. This is a legacy parameter and is no longer used.
3270	MaskingLevel *string `json:"maskingLevel,omitempty"`
3271}
3272
3273// MarshalJSON is the custom marshaler for DataMaskingPolicyProperties.
3274func (dmpp DataMaskingPolicyProperties) MarshalJSON() ([]byte, error) {
3275	objectMap := make(map[string]interface{})
3276	if dmpp.DataMaskingState != "" {
3277		objectMap["dataMaskingState"] = dmpp.DataMaskingState
3278	}
3279	if dmpp.ExemptPrincipals != nil {
3280		objectMap["exemptPrincipals"] = dmpp.ExemptPrincipals
3281	}
3282	return json.Marshal(objectMap)
3283}
3284
3285// DataMaskingRule represents a database data masking rule.
3286type DataMaskingRule struct {
3287	autorest.Response `json:"-"`
3288	// DataMaskingRuleProperties - The properties of the resource.
3289	*DataMaskingRuleProperties `json:"properties,omitempty"`
3290	// Location - READ-ONLY; The location of the data masking rule.
3291	Location *string `json:"location,omitempty"`
3292	// Kind - READ-ONLY; The kind of Data Masking Rule. Metadata, used for Azure portal.
3293	Kind *string `json:"kind,omitempty"`
3294	// ID - READ-ONLY; Resource ID.
3295	ID *string `json:"id,omitempty"`
3296	// Name - READ-ONLY; Resource name.
3297	Name *string `json:"name,omitempty"`
3298	// Type - READ-ONLY; Resource type.
3299	Type *string `json:"type,omitempty"`
3300}
3301
3302// MarshalJSON is the custom marshaler for DataMaskingRule.
3303func (dmr DataMaskingRule) MarshalJSON() ([]byte, error) {
3304	objectMap := make(map[string]interface{})
3305	if dmr.DataMaskingRuleProperties != nil {
3306		objectMap["properties"] = dmr.DataMaskingRuleProperties
3307	}
3308	return json.Marshal(objectMap)
3309}
3310
3311// UnmarshalJSON is the custom unmarshaler for DataMaskingRule struct.
3312func (dmr *DataMaskingRule) UnmarshalJSON(body []byte) error {
3313	var m map[string]*json.RawMessage
3314	err := json.Unmarshal(body, &m)
3315	if err != nil {
3316		return err
3317	}
3318	for k, v := range m {
3319		switch k {
3320		case "properties":
3321			if v != nil {
3322				var dataMaskingRuleProperties DataMaskingRuleProperties
3323				err = json.Unmarshal(*v, &dataMaskingRuleProperties)
3324				if err != nil {
3325					return err
3326				}
3327				dmr.DataMaskingRuleProperties = &dataMaskingRuleProperties
3328			}
3329		case "location":
3330			if v != nil {
3331				var location string
3332				err = json.Unmarshal(*v, &location)
3333				if err != nil {
3334					return err
3335				}
3336				dmr.Location = &location
3337			}
3338		case "kind":
3339			if v != nil {
3340				var kind string
3341				err = json.Unmarshal(*v, &kind)
3342				if err != nil {
3343					return err
3344				}
3345				dmr.Kind = &kind
3346			}
3347		case "id":
3348			if v != nil {
3349				var ID string
3350				err = json.Unmarshal(*v, &ID)
3351				if err != nil {
3352					return err
3353				}
3354				dmr.ID = &ID
3355			}
3356		case "name":
3357			if v != nil {
3358				var name string
3359				err = json.Unmarshal(*v, &name)
3360				if err != nil {
3361					return err
3362				}
3363				dmr.Name = &name
3364			}
3365		case "type":
3366			if v != nil {
3367				var typeVar string
3368				err = json.Unmarshal(*v, &typeVar)
3369				if err != nil {
3370					return err
3371				}
3372				dmr.Type = &typeVar
3373			}
3374		}
3375	}
3376
3377	return nil
3378}
3379
3380// DataMaskingRuleListResult the response to a list data masking rules request.
3381type DataMaskingRuleListResult struct {
3382	autorest.Response `json:"-"`
3383	// Value - The list of database data masking rules.
3384	Value *[]DataMaskingRule `json:"value,omitempty"`
3385}
3386
3387// DataMaskingRuleProperties the properties of a database data masking rule.
3388type DataMaskingRuleProperties struct {
3389	// ID - READ-ONLY; The rule Id.
3390	ID *string `json:"id,omitempty"`
3391	// AliasName - The alias name. This is a legacy parameter and is no longer used.
3392	AliasName *string `json:"aliasName,omitempty"`
3393	// 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'
3394	RuleState DataMaskingRuleState `json:"ruleState,omitempty"`
3395	// SchemaName - The schema name on which the data masking rule is applied.
3396	SchemaName *string `json:"schemaName,omitempty"`
3397	// TableName - The table name on which the data masking rule is applied.
3398	TableName *string `json:"tableName,omitempty"`
3399	// ColumnName - The column name on which the data masking rule is applied.
3400	ColumnName *string `json:"columnName,omitempty"`
3401	// MaskingFunction - The masking function that is used for the data masking rule. Possible values include: 'DataMaskingFunctionDefault', 'DataMaskingFunctionCCN', 'DataMaskingFunctionEmail', 'DataMaskingFunctionNumber', 'DataMaskingFunctionSSN', 'DataMaskingFunctionText'
3402	MaskingFunction DataMaskingFunction `json:"maskingFunction,omitempty"`
3403	// NumberFrom - The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
3404	NumberFrom *string `json:"numberFrom,omitempty"`
3405	// NumberTo - The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
3406	NumberTo *string `json:"numberTo,omitempty"`
3407	// 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.
3408	PrefixSize *string `json:"prefixSize,omitempty"`
3409	// 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.
3410	SuffixSize *string `json:"suffixSize,omitempty"`
3411	// 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.
3412	ReplacementString *string `json:"replacementString,omitempty"`
3413}
3414
3415// MarshalJSON is the custom marshaler for DataMaskingRuleProperties.
3416func (dmrp DataMaskingRuleProperties) MarshalJSON() ([]byte, error) {
3417	objectMap := make(map[string]interface{})
3418	if dmrp.AliasName != nil {
3419		objectMap["aliasName"] = dmrp.AliasName
3420	}
3421	if dmrp.RuleState != "" {
3422		objectMap["ruleState"] = dmrp.RuleState
3423	}
3424	if dmrp.SchemaName != nil {
3425		objectMap["schemaName"] = dmrp.SchemaName
3426	}
3427	if dmrp.TableName != nil {
3428		objectMap["tableName"] = dmrp.TableName
3429	}
3430	if dmrp.ColumnName != nil {
3431		objectMap["columnName"] = dmrp.ColumnName
3432	}
3433	if dmrp.MaskingFunction != "" {
3434		objectMap["maskingFunction"] = dmrp.MaskingFunction
3435	}
3436	if dmrp.NumberFrom != nil {
3437		objectMap["numberFrom"] = dmrp.NumberFrom
3438	}
3439	if dmrp.NumberTo != nil {
3440		objectMap["numberTo"] = dmrp.NumberTo
3441	}
3442	if dmrp.PrefixSize != nil {
3443		objectMap["prefixSize"] = dmrp.PrefixSize
3444	}
3445	if dmrp.SuffixSize != nil {
3446		objectMap["suffixSize"] = dmrp.SuffixSize
3447	}
3448	if dmrp.ReplacementString != nil {
3449		objectMap["replacementString"] = dmrp.ReplacementString
3450	}
3451	return json.Marshal(objectMap)
3452}
3453
3454// EditionCapability the edition capability.
3455type EditionCapability struct {
3456	// Name - READ-ONLY; The database edition name.
3457	Name *string `json:"name,omitempty"`
3458	// SupportedServiceLevelObjectives - READ-ONLY; The list of supported service objectives for the edition.
3459	SupportedServiceLevelObjectives *[]ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty"`
3460	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition.
3461	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
3462	// ReadScale - READ-ONLY; The read scale capability for the edition.
3463	ReadScale *ReadScaleCapability `json:"readScale,omitempty"`
3464	// SupportedStorageCapabilities - READ-ONLY; The list of supported storage capabilities for this edition
3465	SupportedStorageCapabilities *[]StorageCapability `json:"supportedStorageCapabilities,omitempty"`
3466	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3467	Status CapabilityStatus `json:"status,omitempty"`
3468	// Reason - The reason for the capability not being available.
3469	Reason *string `json:"reason,omitempty"`
3470}
3471
3472// MarshalJSON is the custom marshaler for EditionCapability.
3473func (ec EditionCapability) MarshalJSON() ([]byte, error) {
3474	objectMap := make(map[string]interface{})
3475	if ec.Reason != nil {
3476		objectMap["reason"] = ec.Reason
3477	}
3478	return json.Marshal(objectMap)
3479}
3480
3481// ElasticPool an elastic pool.
3482type ElasticPool struct {
3483	autorest.Response `json:"-"`
3484	// Sku - The elastic pool SKU.
3485	//
3486	// 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:
3487	//
3488	// ```azurecli
3489	// az sql elastic-pool list-editions -l <location> -o table
3490	// ````
3491	Sku *Sku `json:"sku,omitempty"`
3492	// Kind - READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience.
3493	Kind *string `json:"kind,omitempty"`
3494	// ElasticPoolProperties - Resource properties.
3495	*ElasticPoolProperties `json:"properties,omitempty"`
3496	// Location - Resource location.
3497	Location *string `json:"location,omitempty"`
3498	// Tags - Resource tags.
3499	Tags map[string]*string `json:"tags"`
3500	// ID - READ-ONLY; Resource ID.
3501	ID *string `json:"id,omitempty"`
3502	// Name - READ-ONLY; Resource name.
3503	Name *string `json:"name,omitempty"`
3504	// Type - READ-ONLY; Resource type.
3505	Type *string `json:"type,omitempty"`
3506}
3507
3508// MarshalJSON is the custom marshaler for ElasticPool.
3509func (ep ElasticPool) MarshalJSON() ([]byte, error) {
3510	objectMap := make(map[string]interface{})
3511	if ep.Sku != nil {
3512		objectMap["sku"] = ep.Sku
3513	}
3514	if ep.ElasticPoolProperties != nil {
3515		objectMap["properties"] = ep.ElasticPoolProperties
3516	}
3517	if ep.Location != nil {
3518		objectMap["location"] = ep.Location
3519	}
3520	if ep.Tags != nil {
3521		objectMap["tags"] = ep.Tags
3522	}
3523	return json.Marshal(objectMap)
3524}
3525
3526// UnmarshalJSON is the custom unmarshaler for ElasticPool struct.
3527func (ep *ElasticPool) UnmarshalJSON(body []byte) error {
3528	var m map[string]*json.RawMessage
3529	err := json.Unmarshal(body, &m)
3530	if err != nil {
3531		return err
3532	}
3533	for k, v := range m {
3534		switch k {
3535		case "sku":
3536			if v != nil {
3537				var sku Sku
3538				err = json.Unmarshal(*v, &sku)
3539				if err != nil {
3540					return err
3541				}
3542				ep.Sku = &sku
3543			}
3544		case "kind":
3545			if v != nil {
3546				var kind string
3547				err = json.Unmarshal(*v, &kind)
3548				if err != nil {
3549					return err
3550				}
3551				ep.Kind = &kind
3552			}
3553		case "properties":
3554			if v != nil {
3555				var elasticPoolProperties ElasticPoolProperties
3556				err = json.Unmarshal(*v, &elasticPoolProperties)
3557				if err != nil {
3558					return err
3559				}
3560				ep.ElasticPoolProperties = &elasticPoolProperties
3561			}
3562		case "location":
3563			if v != nil {
3564				var location string
3565				err = json.Unmarshal(*v, &location)
3566				if err != nil {
3567					return err
3568				}
3569				ep.Location = &location
3570			}
3571		case "tags":
3572			if v != nil {
3573				var tags map[string]*string
3574				err = json.Unmarshal(*v, &tags)
3575				if err != nil {
3576					return err
3577				}
3578				ep.Tags = tags
3579			}
3580		case "id":
3581			if v != nil {
3582				var ID string
3583				err = json.Unmarshal(*v, &ID)
3584				if err != nil {
3585					return err
3586				}
3587				ep.ID = &ID
3588			}
3589		case "name":
3590			if v != nil {
3591				var name string
3592				err = json.Unmarshal(*v, &name)
3593				if err != nil {
3594					return err
3595				}
3596				ep.Name = &name
3597			}
3598		case "type":
3599			if v != nil {
3600				var typeVar string
3601				err = json.Unmarshal(*v, &typeVar)
3602				if err != nil {
3603					return err
3604				}
3605				ep.Type = &typeVar
3606			}
3607		}
3608	}
3609
3610	return nil
3611}
3612
3613// ElasticPoolActivity represents the activity on an elastic pool.
3614type ElasticPoolActivity struct {
3615	// Location - The geo-location where the resource lives
3616	Location *string `json:"location,omitempty"`
3617	// ElasticPoolActivityProperties - The properties representing the resource.
3618	*ElasticPoolActivityProperties `json:"properties,omitempty"`
3619	// ID - READ-ONLY; Resource ID.
3620	ID *string `json:"id,omitempty"`
3621	// Name - READ-ONLY; Resource name.
3622	Name *string `json:"name,omitempty"`
3623	// Type - READ-ONLY; Resource type.
3624	Type *string `json:"type,omitempty"`
3625}
3626
3627// MarshalJSON is the custom marshaler for ElasticPoolActivity.
3628func (epa ElasticPoolActivity) MarshalJSON() ([]byte, error) {
3629	objectMap := make(map[string]interface{})
3630	if epa.Location != nil {
3631		objectMap["location"] = epa.Location
3632	}
3633	if epa.ElasticPoolActivityProperties != nil {
3634		objectMap["properties"] = epa.ElasticPoolActivityProperties
3635	}
3636	return json.Marshal(objectMap)
3637}
3638
3639// UnmarshalJSON is the custom unmarshaler for ElasticPoolActivity struct.
3640func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error {
3641	var m map[string]*json.RawMessage
3642	err := json.Unmarshal(body, &m)
3643	if err != nil {
3644		return err
3645	}
3646	for k, v := range m {
3647		switch k {
3648		case "location":
3649			if v != nil {
3650				var location string
3651				err = json.Unmarshal(*v, &location)
3652				if err != nil {
3653					return err
3654				}
3655				epa.Location = &location
3656			}
3657		case "properties":
3658			if v != nil {
3659				var elasticPoolActivityProperties ElasticPoolActivityProperties
3660				err = json.Unmarshal(*v, &elasticPoolActivityProperties)
3661				if err != nil {
3662					return err
3663				}
3664				epa.ElasticPoolActivityProperties = &elasticPoolActivityProperties
3665			}
3666		case "id":
3667			if v != nil {
3668				var ID string
3669				err = json.Unmarshal(*v, &ID)
3670				if err != nil {
3671					return err
3672				}
3673				epa.ID = &ID
3674			}
3675		case "name":
3676			if v != nil {
3677				var name string
3678				err = json.Unmarshal(*v, &name)
3679				if err != nil {
3680					return err
3681				}
3682				epa.Name = &name
3683			}
3684		case "type":
3685			if v != nil {
3686				var typeVar string
3687				err = json.Unmarshal(*v, &typeVar)
3688				if err != nil {
3689					return err
3690				}
3691				epa.Type = &typeVar
3692			}
3693		}
3694	}
3695
3696	return nil
3697}
3698
3699// ElasticPoolActivityListResult represents the response to a list elastic pool activity request.
3700type ElasticPoolActivityListResult struct {
3701	autorest.Response `json:"-"`
3702	// Value - The list of elastic pool activities.
3703	Value *[]ElasticPoolActivity `json:"value,omitempty"`
3704}
3705
3706// ElasticPoolActivityProperties represents the properties of an elastic pool.
3707type ElasticPoolActivityProperties struct {
3708	// EndTime - READ-ONLY; The time the operation finished (ISO8601 format).
3709	EndTime *date.Time `json:"endTime,omitempty"`
3710	// ErrorCode - READ-ONLY; The error code if available.
3711	ErrorCode *int32 `json:"errorCode,omitempty"`
3712	// ErrorMessage - READ-ONLY; The error message if available.
3713	ErrorMessage *string `json:"errorMessage,omitempty"`
3714	// ErrorSeverity - READ-ONLY; The error severity if available.
3715	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
3716	// Operation - READ-ONLY; The operation name.
3717	Operation *string `json:"operation,omitempty"`
3718	// OperationID - READ-ONLY; The unique operation ID.
3719	OperationID *uuid.UUID `json:"operationId,omitempty"`
3720	// PercentComplete - READ-ONLY; The percentage complete if available.
3721	PercentComplete *int32 `json:"percentComplete,omitempty"`
3722	// RequestedDatabaseDtuMax - READ-ONLY; The requested max DTU per database if available.
3723	RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty"`
3724	// RequestedDatabaseDtuMin - READ-ONLY; The requested min DTU per database if available.
3725	RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty"`
3726	// RequestedDtu - READ-ONLY; The requested DTU for the pool if available.
3727	RequestedDtu *int32 `json:"requestedDtu,omitempty"`
3728	// RequestedElasticPoolName - READ-ONLY; The requested name for the elastic pool if available.
3729	RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"`
3730	// RequestedStorageLimitInGB - READ-ONLY; The requested storage limit for the pool in GB if available.
3731	RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty"`
3732	// ElasticPoolName - READ-ONLY; The name of the elastic pool.
3733	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
3734	// ServerName - READ-ONLY; The name of the server the elastic pool is in.
3735	ServerName *string `json:"serverName,omitempty"`
3736	// StartTime - READ-ONLY; The time the operation started (ISO8601 format).
3737	StartTime *date.Time `json:"startTime,omitempty"`
3738	// State - READ-ONLY; The current state of the operation.
3739	State *string `json:"state,omitempty"`
3740	// RequestedStorageLimitInMB - READ-ONLY; The requested storage limit in MB.
3741	RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty"`
3742	// RequestedDatabaseDtuGuarantee - READ-ONLY; The requested per database DTU guarantee.
3743	RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty"`
3744	// RequestedDatabaseDtuCap - READ-ONLY; The requested per database DTU cap.
3745	RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty"`
3746	// RequestedDtuGuarantee - READ-ONLY; The requested DTU guarantee.
3747	RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty"`
3748}
3749
3750// MarshalJSON is the custom marshaler for ElasticPoolActivityProperties.
3751func (epap ElasticPoolActivityProperties) MarshalJSON() ([]byte, error) {
3752	objectMap := make(map[string]interface{})
3753	return json.Marshal(objectMap)
3754}
3755
3756// ElasticPoolDatabaseActivity represents the activity on an elastic pool.
3757type ElasticPoolDatabaseActivity struct {
3758	// Location - The geo-location where the resource lives
3759	Location *string `json:"location,omitempty"`
3760	// ElasticPoolDatabaseActivityProperties - The properties representing the resource.
3761	*ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"`
3762	// ID - READ-ONLY; Resource ID.
3763	ID *string `json:"id,omitempty"`
3764	// Name - READ-ONLY; Resource name.
3765	Name *string `json:"name,omitempty"`
3766	// Type - READ-ONLY; Resource type.
3767	Type *string `json:"type,omitempty"`
3768}
3769
3770// MarshalJSON is the custom marshaler for ElasticPoolDatabaseActivity.
3771func (epda ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) {
3772	objectMap := make(map[string]interface{})
3773	if epda.Location != nil {
3774		objectMap["location"] = epda.Location
3775	}
3776	if epda.ElasticPoolDatabaseActivityProperties != nil {
3777		objectMap["properties"] = epda.ElasticPoolDatabaseActivityProperties
3778	}
3779	return json.Marshal(objectMap)
3780}
3781
3782// UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct.
3783func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error {
3784	var m map[string]*json.RawMessage
3785	err := json.Unmarshal(body, &m)
3786	if err != nil {
3787		return err
3788	}
3789	for k, v := range m {
3790		switch k {
3791		case "location":
3792			if v != nil {
3793				var location string
3794				err = json.Unmarshal(*v, &location)
3795				if err != nil {
3796					return err
3797				}
3798				epda.Location = &location
3799			}
3800		case "properties":
3801			if v != nil {
3802				var elasticPoolDatabaseActivityProperties ElasticPoolDatabaseActivityProperties
3803				err = json.Unmarshal(*v, &elasticPoolDatabaseActivityProperties)
3804				if err != nil {
3805					return err
3806				}
3807				epda.ElasticPoolDatabaseActivityProperties = &elasticPoolDatabaseActivityProperties
3808			}
3809		case "id":
3810			if v != nil {
3811				var ID string
3812				err = json.Unmarshal(*v, &ID)
3813				if err != nil {
3814					return err
3815				}
3816				epda.ID = &ID
3817			}
3818		case "name":
3819			if v != nil {
3820				var name string
3821				err = json.Unmarshal(*v, &name)
3822				if err != nil {
3823					return err
3824				}
3825				epda.Name = &name
3826			}
3827		case "type":
3828			if v != nil {
3829				var typeVar string
3830				err = json.Unmarshal(*v, &typeVar)
3831				if err != nil {
3832					return err
3833				}
3834				epda.Type = &typeVar
3835			}
3836		}
3837	}
3838
3839	return nil
3840}
3841
3842// ElasticPoolDatabaseActivityListResult represents the response to a list elastic pool database activity
3843// request.
3844type ElasticPoolDatabaseActivityListResult struct {
3845	autorest.Response `json:"-"`
3846	// Value - The list of elastic pool database activities.
3847	Value *[]ElasticPoolDatabaseActivity `json:"value,omitempty"`
3848}
3849
3850// ElasticPoolDatabaseActivityProperties represents the properties of an elastic pool database activity.
3851type ElasticPoolDatabaseActivityProperties struct {
3852	// DatabaseName - READ-ONLY; The database name.
3853	DatabaseName *string `json:"databaseName,omitempty"`
3854	// EndTime - READ-ONLY; The time the operation finished (ISO8601 format).
3855	EndTime *date.Time `json:"endTime,omitempty"`
3856	// ErrorCode - READ-ONLY; The error code if available.
3857	ErrorCode *int32 `json:"errorCode,omitempty"`
3858	// ErrorMessage - READ-ONLY; The error message if available.
3859	ErrorMessage *string `json:"errorMessage,omitempty"`
3860	// ErrorSeverity - READ-ONLY; The error severity if available.
3861	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
3862	// Operation - READ-ONLY; The operation name.
3863	Operation *string `json:"operation,omitempty"`
3864	// OperationID - READ-ONLY; The unique operation ID.
3865	OperationID *uuid.UUID `json:"operationId,omitempty"`
3866	// PercentComplete - READ-ONLY; The percentage complete if available.
3867	PercentComplete *int32 `json:"percentComplete,omitempty"`
3868	// RequestedElasticPoolName - READ-ONLY; The name for the elastic pool the database is moving into if available.
3869	RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"`
3870	// CurrentElasticPoolName - READ-ONLY; The name of the current elastic pool the database is in if available.
3871	CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty"`
3872	// CurrentServiceObjective - READ-ONLY; The name of the current service objective if available.
3873	CurrentServiceObjective *string `json:"currentServiceObjective,omitempty"`
3874	// RequestedServiceObjective - READ-ONLY; The name of the requested service objective if available.
3875	RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty"`
3876	// ServerName - READ-ONLY; The name of the server the elastic pool is in.
3877	ServerName *string `json:"serverName,omitempty"`
3878	// StartTime - READ-ONLY; The time the operation started (ISO8601 format).
3879	StartTime *date.Time `json:"startTime,omitempty"`
3880	// State - READ-ONLY; The current state of the operation.
3881	State *string `json:"state,omitempty"`
3882}
3883
3884// MarshalJSON is the custom marshaler for ElasticPoolDatabaseActivityProperties.
3885func (epdap ElasticPoolDatabaseActivityProperties) MarshalJSON() ([]byte, error) {
3886	objectMap := make(map[string]interface{})
3887	return json.Marshal(objectMap)
3888}
3889
3890// ElasticPoolEditionCapability the elastic pool edition capability.
3891type ElasticPoolEditionCapability struct {
3892	// Name - READ-ONLY; The elastic pool edition name.
3893	Name *string `json:"name,omitempty"`
3894	// SupportedElasticPoolPerformanceLevels - READ-ONLY; The list of supported elastic pool DTU levels for the edition.
3895	SupportedElasticPoolPerformanceLevels *[]ElasticPoolPerformanceLevelCapability `json:"supportedElasticPoolPerformanceLevels,omitempty"`
3896	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition.
3897	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
3898	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3899	Status CapabilityStatus `json:"status,omitempty"`
3900	// Reason - The reason for the capability not being available.
3901	Reason *string `json:"reason,omitempty"`
3902}
3903
3904// MarshalJSON is the custom marshaler for ElasticPoolEditionCapability.
3905func (epec ElasticPoolEditionCapability) MarshalJSON() ([]byte, error) {
3906	objectMap := make(map[string]interface{})
3907	if epec.Reason != nil {
3908		objectMap["reason"] = epec.Reason
3909	}
3910	return json.Marshal(objectMap)
3911}
3912
3913// ElasticPoolListResult the result of an elastic pool list request.
3914type ElasticPoolListResult struct {
3915	autorest.Response `json:"-"`
3916	// Value - READ-ONLY; Array of results.
3917	Value *[]ElasticPool `json:"value,omitempty"`
3918	// NextLink - READ-ONLY; Link to retrieve next page of results.
3919	NextLink *string `json:"nextLink,omitempty"`
3920}
3921
3922// MarshalJSON is the custom marshaler for ElasticPoolListResult.
3923func (eplr ElasticPoolListResult) MarshalJSON() ([]byte, error) {
3924	objectMap := make(map[string]interface{})
3925	return json.Marshal(objectMap)
3926}
3927
3928// ElasticPoolListResultIterator provides access to a complete listing of ElasticPool values.
3929type ElasticPoolListResultIterator struct {
3930	i    int
3931	page ElasticPoolListResultPage
3932}
3933
3934// NextWithContext advances to the next value.  If there was an error making
3935// the request the iterator does not advance and the error is returned.
3936func (iter *ElasticPoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
3937	if tracing.IsEnabled() {
3938		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolListResultIterator.NextWithContext")
3939		defer func() {
3940			sc := -1
3941			if iter.Response().Response.Response != nil {
3942				sc = iter.Response().Response.Response.StatusCode
3943			}
3944			tracing.EndSpan(ctx, sc, err)
3945		}()
3946	}
3947	iter.i++
3948	if iter.i < len(iter.page.Values()) {
3949		return nil
3950	}
3951	err = iter.page.NextWithContext(ctx)
3952	if err != nil {
3953		iter.i--
3954		return err
3955	}
3956	iter.i = 0
3957	return nil
3958}
3959
3960// Next advances to the next value.  If there was an error making
3961// the request the iterator does not advance and the error is returned.
3962// Deprecated: Use NextWithContext() instead.
3963func (iter *ElasticPoolListResultIterator) Next() error {
3964	return iter.NextWithContext(context.Background())
3965}
3966
3967// NotDone returns true if the enumeration should be started or is not yet complete.
3968func (iter ElasticPoolListResultIterator) NotDone() bool {
3969	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3970}
3971
3972// Response returns the raw server response from the last page request.
3973func (iter ElasticPoolListResultIterator) Response() ElasticPoolListResult {
3974	return iter.page.Response()
3975}
3976
3977// Value returns the current value or a zero-initialized value if the
3978// iterator has advanced beyond the end of the collection.
3979func (iter ElasticPoolListResultIterator) Value() ElasticPool {
3980	if !iter.page.NotDone() {
3981		return ElasticPool{}
3982	}
3983	return iter.page.Values()[iter.i]
3984}
3985
3986// Creates a new instance of the ElasticPoolListResultIterator type.
3987func NewElasticPoolListResultIterator(page ElasticPoolListResultPage) ElasticPoolListResultIterator {
3988	return ElasticPoolListResultIterator{page: page}
3989}
3990
3991// IsEmpty returns true if the ListResult contains no values.
3992func (eplr ElasticPoolListResult) IsEmpty() bool {
3993	return eplr.Value == nil || len(*eplr.Value) == 0
3994}
3995
3996// hasNextLink returns true if the NextLink is not empty.
3997func (eplr ElasticPoolListResult) hasNextLink() bool {
3998	return eplr.NextLink != nil && len(*eplr.NextLink) != 0
3999}
4000
4001// elasticPoolListResultPreparer prepares a request to retrieve the next set of results.
4002// It returns nil if no more results exist.
4003func (eplr ElasticPoolListResult) elasticPoolListResultPreparer(ctx context.Context) (*http.Request, error) {
4004	if !eplr.hasNextLink() {
4005		return nil, nil
4006	}
4007	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4008		autorest.AsJSON(),
4009		autorest.AsGet(),
4010		autorest.WithBaseURL(to.String(eplr.NextLink)))
4011}
4012
4013// ElasticPoolListResultPage contains a page of ElasticPool values.
4014type ElasticPoolListResultPage struct {
4015	fn   func(context.Context, ElasticPoolListResult) (ElasticPoolListResult, error)
4016	eplr ElasticPoolListResult
4017}
4018
4019// NextWithContext advances to the next page of values.  If there was an error making
4020// the request the page does not advance and the error is returned.
4021func (page *ElasticPoolListResultPage) NextWithContext(ctx context.Context) (err error) {
4022	if tracing.IsEnabled() {
4023		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolListResultPage.NextWithContext")
4024		defer func() {
4025			sc := -1
4026			if page.Response().Response.Response != nil {
4027				sc = page.Response().Response.Response.StatusCode
4028			}
4029			tracing.EndSpan(ctx, sc, err)
4030		}()
4031	}
4032	for {
4033		next, err := page.fn(ctx, page.eplr)
4034		if err != nil {
4035			return err
4036		}
4037		page.eplr = next
4038		if !next.hasNextLink() || !next.IsEmpty() {
4039			break
4040		}
4041	}
4042	return nil
4043}
4044
4045// Next advances to the next page of values.  If there was an error making
4046// the request the page does not advance and the error is returned.
4047// Deprecated: Use NextWithContext() instead.
4048func (page *ElasticPoolListResultPage) Next() error {
4049	return page.NextWithContext(context.Background())
4050}
4051
4052// NotDone returns true if the page enumeration should be started or is not yet complete.
4053func (page ElasticPoolListResultPage) NotDone() bool {
4054	return !page.eplr.IsEmpty()
4055}
4056
4057// Response returns the raw server response from the last page request.
4058func (page ElasticPoolListResultPage) Response() ElasticPoolListResult {
4059	return page.eplr
4060}
4061
4062// Values returns the slice of values for the current page or nil if there are no values.
4063func (page ElasticPoolListResultPage) Values() []ElasticPool {
4064	if page.eplr.IsEmpty() {
4065		return nil
4066	}
4067	return *page.eplr.Value
4068}
4069
4070// Creates a new instance of the ElasticPoolListResultPage type.
4071func NewElasticPoolListResultPage(cur ElasticPoolListResult, getNextPage func(context.Context, ElasticPoolListResult) (ElasticPoolListResult, error)) ElasticPoolListResultPage {
4072	return ElasticPoolListResultPage{
4073		fn:   getNextPage,
4074		eplr: cur,
4075	}
4076}
4077
4078// ElasticPoolOperation a elastic pool operation.
4079type ElasticPoolOperation struct {
4080	// ElasticPoolOperationProperties - Resource properties.
4081	*ElasticPoolOperationProperties `json:"properties,omitempty"`
4082	// ID - READ-ONLY; Resource ID.
4083	ID *string `json:"id,omitempty"`
4084	// Name - READ-ONLY; Resource name.
4085	Name *string `json:"name,omitempty"`
4086	// Type - READ-ONLY; Resource type.
4087	Type *string `json:"type,omitempty"`
4088}
4089
4090// MarshalJSON is the custom marshaler for ElasticPoolOperation.
4091func (epo ElasticPoolOperation) MarshalJSON() ([]byte, error) {
4092	objectMap := make(map[string]interface{})
4093	if epo.ElasticPoolOperationProperties != nil {
4094		objectMap["properties"] = epo.ElasticPoolOperationProperties
4095	}
4096	return json.Marshal(objectMap)
4097}
4098
4099// UnmarshalJSON is the custom unmarshaler for ElasticPoolOperation struct.
4100func (epo *ElasticPoolOperation) UnmarshalJSON(body []byte) error {
4101	var m map[string]*json.RawMessage
4102	err := json.Unmarshal(body, &m)
4103	if err != nil {
4104		return err
4105	}
4106	for k, v := range m {
4107		switch k {
4108		case "properties":
4109			if v != nil {
4110				var elasticPoolOperationProperties ElasticPoolOperationProperties
4111				err = json.Unmarshal(*v, &elasticPoolOperationProperties)
4112				if err != nil {
4113					return err
4114				}
4115				epo.ElasticPoolOperationProperties = &elasticPoolOperationProperties
4116			}
4117		case "id":
4118			if v != nil {
4119				var ID string
4120				err = json.Unmarshal(*v, &ID)
4121				if err != nil {
4122					return err
4123				}
4124				epo.ID = &ID
4125			}
4126		case "name":
4127			if v != nil {
4128				var name string
4129				err = json.Unmarshal(*v, &name)
4130				if err != nil {
4131					return err
4132				}
4133				epo.Name = &name
4134			}
4135		case "type":
4136			if v != nil {
4137				var typeVar string
4138				err = json.Unmarshal(*v, &typeVar)
4139				if err != nil {
4140					return err
4141				}
4142				epo.Type = &typeVar
4143			}
4144		}
4145	}
4146
4147	return nil
4148}
4149
4150// ElasticPoolOperationListResult the response to a list elastic pool operations request
4151type ElasticPoolOperationListResult struct {
4152	autorest.Response `json:"-"`
4153	// Value - READ-ONLY; Array of results.
4154	Value *[]ElasticPoolOperation `json:"value,omitempty"`
4155	// NextLink - READ-ONLY; Link to retrieve next page of results.
4156	NextLink *string `json:"nextLink,omitempty"`
4157}
4158
4159// MarshalJSON is the custom marshaler for ElasticPoolOperationListResult.
4160func (epolr ElasticPoolOperationListResult) MarshalJSON() ([]byte, error) {
4161	objectMap := make(map[string]interface{})
4162	return json.Marshal(objectMap)
4163}
4164
4165// ElasticPoolOperationListResultIterator provides access to a complete listing of ElasticPoolOperation
4166// values.
4167type ElasticPoolOperationListResultIterator struct {
4168	i    int
4169	page ElasticPoolOperationListResultPage
4170}
4171
4172// NextWithContext advances to the next value.  If there was an error making
4173// the request the iterator does not advance and the error is returned.
4174func (iter *ElasticPoolOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
4175	if tracing.IsEnabled() {
4176		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationListResultIterator.NextWithContext")
4177		defer func() {
4178			sc := -1
4179			if iter.Response().Response.Response != nil {
4180				sc = iter.Response().Response.Response.StatusCode
4181			}
4182			tracing.EndSpan(ctx, sc, err)
4183		}()
4184	}
4185	iter.i++
4186	if iter.i < len(iter.page.Values()) {
4187		return nil
4188	}
4189	err = iter.page.NextWithContext(ctx)
4190	if err != nil {
4191		iter.i--
4192		return err
4193	}
4194	iter.i = 0
4195	return nil
4196}
4197
4198// Next advances to the next value.  If there was an error making
4199// the request the iterator does not advance and the error is returned.
4200// Deprecated: Use NextWithContext() instead.
4201func (iter *ElasticPoolOperationListResultIterator) Next() error {
4202	return iter.NextWithContext(context.Background())
4203}
4204
4205// NotDone returns true if the enumeration should be started or is not yet complete.
4206func (iter ElasticPoolOperationListResultIterator) NotDone() bool {
4207	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4208}
4209
4210// Response returns the raw server response from the last page request.
4211func (iter ElasticPoolOperationListResultIterator) Response() ElasticPoolOperationListResult {
4212	return iter.page.Response()
4213}
4214
4215// Value returns the current value or a zero-initialized value if the
4216// iterator has advanced beyond the end of the collection.
4217func (iter ElasticPoolOperationListResultIterator) Value() ElasticPoolOperation {
4218	if !iter.page.NotDone() {
4219		return ElasticPoolOperation{}
4220	}
4221	return iter.page.Values()[iter.i]
4222}
4223
4224// Creates a new instance of the ElasticPoolOperationListResultIterator type.
4225func NewElasticPoolOperationListResultIterator(page ElasticPoolOperationListResultPage) ElasticPoolOperationListResultIterator {
4226	return ElasticPoolOperationListResultIterator{page: page}
4227}
4228
4229// IsEmpty returns true if the ListResult contains no values.
4230func (epolr ElasticPoolOperationListResult) IsEmpty() bool {
4231	return epolr.Value == nil || len(*epolr.Value) == 0
4232}
4233
4234// hasNextLink returns true if the NextLink is not empty.
4235func (epolr ElasticPoolOperationListResult) hasNextLink() bool {
4236	return epolr.NextLink != nil && len(*epolr.NextLink) != 0
4237}
4238
4239// elasticPoolOperationListResultPreparer prepares a request to retrieve the next set of results.
4240// It returns nil if no more results exist.
4241func (epolr ElasticPoolOperationListResult) elasticPoolOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
4242	if !epolr.hasNextLink() {
4243		return nil, nil
4244	}
4245	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4246		autorest.AsJSON(),
4247		autorest.AsGet(),
4248		autorest.WithBaseURL(to.String(epolr.NextLink)))
4249}
4250
4251// ElasticPoolOperationListResultPage contains a page of ElasticPoolOperation values.
4252type ElasticPoolOperationListResultPage struct {
4253	fn    func(context.Context, ElasticPoolOperationListResult) (ElasticPoolOperationListResult, error)
4254	epolr ElasticPoolOperationListResult
4255}
4256
4257// NextWithContext advances to the next page of values.  If there was an error making
4258// the request the page does not advance and the error is returned.
4259func (page *ElasticPoolOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
4260	if tracing.IsEnabled() {
4261		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationListResultPage.NextWithContext")
4262		defer func() {
4263			sc := -1
4264			if page.Response().Response.Response != nil {
4265				sc = page.Response().Response.Response.StatusCode
4266			}
4267			tracing.EndSpan(ctx, sc, err)
4268		}()
4269	}
4270	for {
4271		next, err := page.fn(ctx, page.epolr)
4272		if err != nil {
4273			return err
4274		}
4275		page.epolr = next
4276		if !next.hasNextLink() || !next.IsEmpty() {
4277			break
4278		}
4279	}
4280	return nil
4281}
4282
4283// Next advances to the next page of values.  If there was an error making
4284// the request the page does not advance and the error is returned.
4285// Deprecated: Use NextWithContext() instead.
4286func (page *ElasticPoolOperationListResultPage) Next() error {
4287	return page.NextWithContext(context.Background())
4288}
4289
4290// NotDone returns true if the page enumeration should be started or is not yet complete.
4291func (page ElasticPoolOperationListResultPage) NotDone() bool {
4292	return !page.epolr.IsEmpty()
4293}
4294
4295// Response returns the raw server response from the last page request.
4296func (page ElasticPoolOperationListResultPage) Response() ElasticPoolOperationListResult {
4297	return page.epolr
4298}
4299
4300// Values returns the slice of values for the current page or nil if there are no values.
4301func (page ElasticPoolOperationListResultPage) Values() []ElasticPoolOperation {
4302	if page.epolr.IsEmpty() {
4303		return nil
4304	}
4305	return *page.epolr.Value
4306}
4307
4308// Creates a new instance of the ElasticPoolOperationListResultPage type.
4309func NewElasticPoolOperationListResultPage(cur ElasticPoolOperationListResult, getNextPage func(context.Context, ElasticPoolOperationListResult) (ElasticPoolOperationListResult, error)) ElasticPoolOperationListResultPage {
4310	return ElasticPoolOperationListResultPage{
4311		fn:    getNextPage,
4312		epolr: cur,
4313	}
4314}
4315
4316// ElasticPoolOperationProperties the properties of a elastic pool operation.
4317type ElasticPoolOperationProperties struct {
4318	// ElasticPoolName - READ-ONLY; The name of the elastic pool the operation is being performed on.
4319	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
4320	// Operation - READ-ONLY; The name of operation.
4321	Operation *string `json:"operation,omitempty"`
4322	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
4323	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
4324	// PercentComplete - READ-ONLY; The percentage of the operation completed.
4325	PercentComplete *int32 `json:"percentComplete,omitempty"`
4326	// ServerName - READ-ONLY; The name of the server.
4327	ServerName *string `json:"serverName,omitempty"`
4328	// StartTime - READ-ONLY; The operation start time.
4329	StartTime *date.Time `json:"startTime,omitempty"`
4330	// State - READ-ONLY; The operation state.
4331	State *string `json:"state,omitempty"`
4332	// ErrorCode - READ-ONLY; The operation error code.
4333	ErrorCode *int32 `json:"errorCode,omitempty"`
4334	// ErrorDescription - READ-ONLY; The operation error description.
4335	ErrorDescription *string `json:"errorDescription,omitempty"`
4336	// ErrorSeverity - READ-ONLY; The operation error severity.
4337	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
4338	// IsUserError - READ-ONLY; Whether or not the error is a user error.
4339	IsUserError *bool `json:"isUserError,omitempty"`
4340	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
4341	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
4342	// Description - READ-ONLY; The operation description.
4343	Description *string `json:"description,omitempty"`
4344	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
4345	IsCancellable *bool `json:"isCancellable,omitempty"`
4346}
4347
4348// MarshalJSON is the custom marshaler for ElasticPoolOperationProperties.
4349func (epop ElasticPoolOperationProperties) MarshalJSON() ([]byte, error) {
4350	objectMap := make(map[string]interface{})
4351	return json.Marshal(objectMap)
4352}
4353
4354// ElasticPoolPerDatabaseMaxPerformanceLevelCapability the max per-database performance level capability.
4355type ElasticPoolPerDatabaseMaxPerformanceLevelCapability struct {
4356	// Limit - READ-ONLY; The maximum performance level per database.
4357	Limit *float64 `json:"limit,omitempty"`
4358	// Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'DTU', 'VCores'
4359	Unit PerformanceLevelUnit `json:"unit,omitempty"`
4360	// SupportedPerDatabaseMinPerformanceLevels - READ-ONLY; The list of supported min database performance levels.
4361	SupportedPerDatabaseMinPerformanceLevels *[]ElasticPoolPerDatabaseMinPerformanceLevelCapability `json:"supportedPerDatabaseMinPerformanceLevels,omitempty"`
4362	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
4363	Status CapabilityStatus `json:"status,omitempty"`
4364	// Reason - The reason for the capability not being available.
4365	Reason *string `json:"reason,omitempty"`
4366}
4367
4368// MarshalJSON is the custom marshaler for ElasticPoolPerDatabaseMaxPerformanceLevelCapability.
4369func (eppdmplc ElasticPoolPerDatabaseMaxPerformanceLevelCapability) MarshalJSON() ([]byte, error) {
4370	objectMap := make(map[string]interface{})
4371	if eppdmplc.Reason != nil {
4372		objectMap["reason"] = eppdmplc.Reason
4373	}
4374	return json.Marshal(objectMap)
4375}
4376
4377// ElasticPoolPerDatabaseMinPerformanceLevelCapability the minimum per-database performance level
4378// capability.
4379type ElasticPoolPerDatabaseMinPerformanceLevelCapability struct {
4380	// Limit - READ-ONLY; The minimum performance level per database.
4381	Limit *float64 `json:"limit,omitempty"`
4382	// Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'DTU', 'VCores'
4383	Unit PerformanceLevelUnit `json:"unit,omitempty"`
4384	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
4385	Status CapabilityStatus `json:"status,omitempty"`
4386	// Reason - The reason for the capability not being available.
4387	Reason *string `json:"reason,omitempty"`
4388}
4389
4390// MarshalJSON is the custom marshaler for ElasticPoolPerDatabaseMinPerformanceLevelCapability.
4391func (eppdmplc ElasticPoolPerDatabaseMinPerformanceLevelCapability) MarshalJSON() ([]byte, error) {
4392	objectMap := make(map[string]interface{})
4393	if eppdmplc.Reason != nil {
4394		objectMap["reason"] = eppdmplc.Reason
4395	}
4396	return json.Marshal(objectMap)
4397}
4398
4399// ElasticPoolPerDatabaseSettings per database settings of an elastic pool.
4400type ElasticPoolPerDatabaseSettings struct {
4401	// MinCapacity - The minimum capacity all databases are guaranteed.
4402	MinCapacity *float64 `json:"minCapacity,omitempty"`
4403	// MaxCapacity - The maximum capacity any one database can consume.
4404	MaxCapacity *float64 `json:"maxCapacity,omitempty"`
4405}
4406
4407// ElasticPoolPerformanceLevelCapability the Elastic Pool performance level capability.
4408type ElasticPoolPerformanceLevelCapability struct {
4409	// PerformanceLevel - READ-ONLY; The performance level for the pool.
4410	PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty"`
4411	// Sku - READ-ONLY; The sku.
4412	Sku *Sku `json:"sku,omitempty"`
4413	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
4414	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
4415	// MaxDatabaseCount - READ-ONLY; The maximum number of databases supported.
4416	MaxDatabaseCount *int32 `json:"maxDatabaseCount,omitempty"`
4417	// IncludedMaxSize - READ-ONLY; The included (free) max size for this performance level.
4418	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
4419	// SupportedMaxSizes - READ-ONLY; The list of supported max sizes.
4420	SupportedMaxSizes *[]MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty"`
4421	// SupportedPerDatabaseMaxSizes - READ-ONLY; The list of supported per database max sizes.
4422	SupportedPerDatabaseMaxSizes *[]MaxSizeRangeCapability `json:"supportedPerDatabaseMaxSizes,omitempty"`
4423	// SupportedPerDatabaseMaxPerformanceLevels - READ-ONLY; The list of supported per database max performance levels.
4424	SupportedPerDatabaseMaxPerformanceLevels *[]ElasticPoolPerDatabaseMaxPerformanceLevelCapability `json:"supportedPerDatabaseMaxPerformanceLevels,omitempty"`
4425	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the performance level.
4426	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
4427	// SupportedMaintenanceConfigurations - READ-ONLY; List of supported maintenance configurations
4428	SupportedMaintenanceConfigurations *[]MaintenanceConfigurationCapability `json:"supportedMaintenanceConfigurations,omitempty"`
4429	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
4430	Status CapabilityStatus `json:"status,omitempty"`
4431	// Reason - The reason for the capability not being available.
4432	Reason *string `json:"reason,omitempty"`
4433}
4434
4435// MarshalJSON is the custom marshaler for ElasticPoolPerformanceLevelCapability.
4436func (epplc ElasticPoolPerformanceLevelCapability) MarshalJSON() ([]byte, error) {
4437	objectMap := make(map[string]interface{})
4438	if epplc.Reason != nil {
4439		objectMap["reason"] = epplc.Reason
4440	}
4441	return json.Marshal(objectMap)
4442}
4443
4444// ElasticPoolProperties properties of an elastic pool
4445type ElasticPoolProperties struct {
4446	// State - READ-ONLY; The state of the elastic pool. Possible values include: 'ElasticPoolStateCreating', 'ElasticPoolStateReady', 'ElasticPoolStateDisabled'
4447	State ElasticPoolState `json:"state,omitempty"`
4448	// CreationDate - READ-ONLY; The creation date of the elastic pool (ISO8601 format).
4449	CreationDate *date.Time `json:"creationDate,omitempty"`
4450	// MaxSizeBytes - The storage limit for the database elastic pool in bytes.
4451	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
4452	// PerDatabaseSettings - The per database settings for the elastic pool.
4453	PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"`
4454	// 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.
4455	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
4456	// LicenseType - The license type to apply for this elastic pool. Possible values include: 'ElasticPoolLicenseTypeLicenseIncluded', 'ElasticPoolLicenseTypeBasePrice'
4457	LicenseType ElasticPoolLicenseType `json:"licenseType,omitempty"`
4458	// MaintenanceConfigurationID - Maintenance configuration id assigned to the elastic pool. This configuration defines the period when the maintenance updates will will occur.
4459	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`
4460}
4461
4462// MarshalJSON is the custom marshaler for ElasticPoolProperties.
4463func (epp ElasticPoolProperties) MarshalJSON() ([]byte, error) {
4464	objectMap := make(map[string]interface{})
4465	if epp.MaxSizeBytes != nil {
4466		objectMap["maxSizeBytes"] = epp.MaxSizeBytes
4467	}
4468	if epp.PerDatabaseSettings != nil {
4469		objectMap["perDatabaseSettings"] = epp.PerDatabaseSettings
4470	}
4471	if epp.ZoneRedundant != nil {
4472		objectMap["zoneRedundant"] = epp.ZoneRedundant
4473	}
4474	if epp.LicenseType != "" {
4475		objectMap["licenseType"] = epp.LicenseType
4476	}
4477	if epp.MaintenanceConfigurationID != nil {
4478		objectMap["maintenanceConfigurationId"] = epp.MaintenanceConfigurationID
4479	}
4480	return json.Marshal(objectMap)
4481}
4482
4483// ElasticPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
4484// long-running operation.
4485type ElasticPoolsCreateOrUpdateFuture struct {
4486	azure.FutureAPI
4487	// Result returns the result of the asynchronous operation.
4488	// If the operation has not completed it will return an error.
4489	Result func(ElasticPoolsClient) (ElasticPool, error)
4490}
4491
4492// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4493func (future *ElasticPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
4494	var azFuture azure.Future
4495	if err := json.Unmarshal(body, &azFuture); err != nil {
4496		return err
4497	}
4498	future.FutureAPI = &azFuture
4499	future.Result = future.result
4500	return nil
4501}
4502
4503// result is the default implementation for ElasticPoolsCreateOrUpdateFuture.Result.
4504func (future *ElasticPoolsCreateOrUpdateFuture) result(client ElasticPoolsClient) (ep ElasticPool, err error) {
4505	var done bool
4506	done, err = future.DoneWithContext(context.Background(), client)
4507	if err != nil {
4508		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
4509		return
4510	}
4511	if !done {
4512		ep.Response.Response = future.Response()
4513		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsCreateOrUpdateFuture")
4514		return
4515	}
4516	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4517	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
4518		ep, err = client.CreateOrUpdateResponder(ep.Response.Response)
4519		if err != nil {
4520			err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
4521		}
4522	}
4523	return
4524}
4525
4526// ElasticPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
4527// operation.
4528type ElasticPoolsDeleteFuture struct {
4529	azure.FutureAPI
4530	// Result returns the result of the asynchronous operation.
4531	// If the operation has not completed it will return an error.
4532	Result func(ElasticPoolsClient) (autorest.Response, error)
4533}
4534
4535// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4536func (future *ElasticPoolsDeleteFuture) UnmarshalJSON(body []byte) error {
4537	var azFuture azure.Future
4538	if err := json.Unmarshal(body, &azFuture); err != nil {
4539		return err
4540	}
4541	future.FutureAPI = &azFuture
4542	future.Result = future.result
4543	return nil
4544}
4545
4546// result is the default implementation for ElasticPoolsDeleteFuture.Result.
4547func (future *ElasticPoolsDeleteFuture) result(client ElasticPoolsClient) (ar autorest.Response, err error) {
4548	var done bool
4549	done, err = future.DoneWithContext(context.Background(), client)
4550	if err != nil {
4551		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsDeleteFuture", "Result", future.Response(), "Polling failure")
4552		return
4553	}
4554	if !done {
4555		ar.Response = future.Response()
4556		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsDeleteFuture")
4557		return
4558	}
4559	ar.Response = future.Response()
4560	return
4561}
4562
4563// ElasticPoolsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
4564// operation.
4565type ElasticPoolsFailoverFuture struct {
4566	azure.FutureAPI
4567	// Result returns the result of the asynchronous operation.
4568	// If the operation has not completed it will return an error.
4569	Result func(ElasticPoolsClient) (autorest.Response, error)
4570}
4571
4572// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4573func (future *ElasticPoolsFailoverFuture) UnmarshalJSON(body []byte) error {
4574	var azFuture azure.Future
4575	if err := json.Unmarshal(body, &azFuture); err != nil {
4576		return err
4577	}
4578	future.FutureAPI = &azFuture
4579	future.Result = future.result
4580	return nil
4581}
4582
4583// result is the default implementation for ElasticPoolsFailoverFuture.Result.
4584func (future *ElasticPoolsFailoverFuture) result(client ElasticPoolsClient) (ar autorest.Response, err error) {
4585	var done bool
4586	done, err = future.DoneWithContext(context.Background(), client)
4587	if err != nil {
4588		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsFailoverFuture", "Result", future.Response(), "Polling failure")
4589		return
4590	}
4591	if !done {
4592		ar.Response = future.Response()
4593		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsFailoverFuture")
4594		return
4595	}
4596	ar.Response = future.Response()
4597	return
4598}
4599
4600// ElasticPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
4601// operation.
4602type ElasticPoolsUpdateFuture struct {
4603	azure.FutureAPI
4604	// Result returns the result of the asynchronous operation.
4605	// If the operation has not completed it will return an error.
4606	Result func(ElasticPoolsClient) (ElasticPool, error)
4607}
4608
4609// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4610func (future *ElasticPoolsUpdateFuture) UnmarshalJSON(body []byte) error {
4611	var azFuture azure.Future
4612	if err := json.Unmarshal(body, &azFuture); err != nil {
4613		return err
4614	}
4615	future.FutureAPI = &azFuture
4616	future.Result = future.result
4617	return nil
4618}
4619
4620// result is the default implementation for ElasticPoolsUpdateFuture.Result.
4621func (future *ElasticPoolsUpdateFuture) result(client ElasticPoolsClient) (ep ElasticPool, err error) {
4622	var done bool
4623	done, err = future.DoneWithContext(context.Background(), client)
4624	if err != nil {
4625		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", future.Response(), "Polling failure")
4626		return
4627	}
4628	if !done {
4629		ep.Response.Response = future.Response()
4630		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsUpdateFuture")
4631		return
4632	}
4633	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4634	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
4635		ep, err = client.UpdateResponder(ep.Response.Response)
4636		if err != nil {
4637			err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
4638		}
4639	}
4640	return
4641}
4642
4643// ElasticPoolUpdate an elastic pool update.
4644type ElasticPoolUpdate struct {
4645	Sku *Sku `json:"sku,omitempty"`
4646	// ElasticPoolUpdateProperties - Resource properties.
4647	*ElasticPoolUpdateProperties `json:"properties,omitempty"`
4648	// Tags - Resource tags.
4649	Tags map[string]*string `json:"tags"`
4650}
4651
4652// MarshalJSON is the custom marshaler for ElasticPoolUpdate.
4653func (epu ElasticPoolUpdate) MarshalJSON() ([]byte, error) {
4654	objectMap := make(map[string]interface{})
4655	if epu.Sku != nil {
4656		objectMap["sku"] = epu.Sku
4657	}
4658	if epu.ElasticPoolUpdateProperties != nil {
4659		objectMap["properties"] = epu.ElasticPoolUpdateProperties
4660	}
4661	if epu.Tags != nil {
4662		objectMap["tags"] = epu.Tags
4663	}
4664	return json.Marshal(objectMap)
4665}
4666
4667// UnmarshalJSON is the custom unmarshaler for ElasticPoolUpdate struct.
4668func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error {
4669	var m map[string]*json.RawMessage
4670	err := json.Unmarshal(body, &m)
4671	if err != nil {
4672		return err
4673	}
4674	for k, v := range m {
4675		switch k {
4676		case "sku":
4677			if v != nil {
4678				var sku Sku
4679				err = json.Unmarshal(*v, &sku)
4680				if err != nil {
4681					return err
4682				}
4683				epu.Sku = &sku
4684			}
4685		case "properties":
4686			if v != nil {
4687				var elasticPoolUpdateProperties ElasticPoolUpdateProperties
4688				err = json.Unmarshal(*v, &elasticPoolUpdateProperties)
4689				if err != nil {
4690					return err
4691				}
4692				epu.ElasticPoolUpdateProperties = &elasticPoolUpdateProperties
4693			}
4694		case "tags":
4695			if v != nil {
4696				var tags map[string]*string
4697				err = json.Unmarshal(*v, &tags)
4698				if err != nil {
4699					return err
4700				}
4701				epu.Tags = tags
4702			}
4703		}
4704	}
4705
4706	return nil
4707}
4708
4709// ElasticPoolUpdateProperties properties of an elastic pool
4710type ElasticPoolUpdateProperties struct {
4711	// MaxSizeBytes - The storage limit for the database elastic pool in bytes.
4712	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
4713	// PerDatabaseSettings - The per database settings for the elastic pool.
4714	PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"`
4715	// 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.
4716	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
4717	// LicenseType - The license type to apply for this elastic pool. Possible values include: 'ElasticPoolLicenseTypeLicenseIncluded', 'ElasticPoolLicenseTypeBasePrice'
4718	LicenseType ElasticPoolLicenseType `json:"licenseType,omitempty"`
4719	// MaintenanceConfigurationID - Maintenance configuration id assigned to the elastic pool. This configuration defines the period when the maintenance updates will will occur.
4720	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`
4721}
4722
4723// EncryptionProtector the server encryption protector.
4724type EncryptionProtector struct {
4725	autorest.Response `json:"-"`
4726	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
4727	Kind *string `json:"kind,omitempty"`
4728	// Location - READ-ONLY; Resource location.
4729	Location *string `json:"location,omitempty"`
4730	// EncryptionProtectorProperties - Resource properties.
4731	*EncryptionProtectorProperties `json:"properties,omitempty"`
4732	// ID - READ-ONLY; Resource ID.
4733	ID *string `json:"id,omitempty"`
4734	// Name - READ-ONLY; Resource name.
4735	Name *string `json:"name,omitempty"`
4736	// Type - READ-ONLY; Resource type.
4737	Type *string `json:"type,omitempty"`
4738}
4739
4740// MarshalJSON is the custom marshaler for EncryptionProtector.
4741func (ep EncryptionProtector) MarshalJSON() ([]byte, error) {
4742	objectMap := make(map[string]interface{})
4743	if ep.EncryptionProtectorProperties != nil {
4744		objectMap["properties"] = ep.EncryptionProtectorProperties
4745	}
4746	return json.Marshal(objectMap)
4747}
4748
4749// UnmarshalJSON is the custom unmarshaler for EncryptionProtector struct.
4750func (ep *EncryptionProtector) UnmarshalJSON(body []byte) error {
4751	var m map[string]*json.RawMessage
4752	err := json.Unmarshal(body, &m)
4753	if err != nil {
4754		return err
4755	}
4756	for k, v := range m {
4757		switch k {
4758		case "kind":
4759			if v != nil {
4760				var kind string
4761				err = json.Unmarshal(*v, &kind)
4762				if err != nil {
4763					return err
4764				}
4765				ep.Kind = &kind
4766			}
4767		case "location":
4768			if v != nil {
4769				var location string
4770				err = json.Unmarshal(*v, &location)
4771				if err != nil {
4772					return err
4773				}
4774				ep.Location = &location
4775			}
4776		case "properties":
4777			if v != nil {
4778				var encryptionProtectorProperties EncryptionProtectorProperties
4779				err = json.Unmarshal(*v, &encryptionProtectorProperties)
4780				if err != nil {
4781					return err
4782				}
4783				ep.EncryptionProtectorProperties = &encryptionProtectorProperties
4784			}
4785		case "id":
4786			if v != nil {
4787				var ID string
4788				err = json.Unmarshal(*v, &ID)
4789				if err != nil {
4790					return err
4791				}
4792				ep.ID = &ID
4793			}
4794		case "name":
4795			if v != nil {
4796				var name string
4797				err = json.Unmarshal(*v, &name)
4798				if err != nil {
4799					return err
4800				}
4801				ep.Name = &name
4802			}
4803		case "type":
4804			if v != nil {
4805				var typeVar string
4806				err = json.Unmarshal(*v, &typeVar)
4807				if err != nil {
4808					return err
4809				}
4810				ep.Type = &typeVar
4811			}
4812		}
4813	}
4814
4815	return nil
4816}
4817
4818// EncryptionProtectorListResult a list of server encryption protectors.
4819type EncryptionProtectorListResult struct {
4820	autorest.Response `json:"-"`
4821	// Value - READ-ONLY; Array of results.
4822	Value *[]EncryptionProtector `json:"value,omitempty"`
4823	// NextLink - READ-ONLY; Link to retrieve next page of results.
4824	NextLink *string `json:"nextLink,omitempty"`
4825}
4826
4827// MarshalJSON is the custom marshaler for EncryptionProtectorListResult.
4828func (eplr EncryptionProtectorListResult) MarshalJSON() ([]byte, error) {
4829	objectMap := make(map[string]interface{})
4830	return json.Marshal(objectMap)
4831}
4832
4833// EncryptionProtectorListResultIterator provides access to a complete listing of EncryptionProtector
4834// values.
4835type EncryptionProtectorListResultIterator struct {
4836	i    int
4837	page EncryptionProtectorListResultPage
4838}
4839
4840// NextWithContext advances to the next value.  If there was an error making
4841// the request the iterator does not advance and the error is returned.
4842func (iter *EncryptionProtectorListResultIterator) NextWithContext(ctx context.Context) (err error) {
4843	if tracing.IsEnabled() {
4844		ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultIterator.NextWithContext")
4845		defer func() {
4846			sc := -1
4847			if iter.Response().Response.Response != nil {
4848				sc = iter.Response().Response.Response.StatusCode
4849			}
4850			tracing.EndSpan(ctx, sc, err)
4851		}()
4852	}
4853	iter.i++
4854	if iter.i < len(iter.page.Values()) {
4855		return nil
4856	}
4857	err = iter.page.NextWithContext(ctx)
4858	if err != nil {
4859		iter.i--
4860		return err
4861	}
4862	iter.i = 0
4863	return nil
4864}
4865
4866// Next advances to the next value.  If there was an error making
4867// the request the iterator does not advance and the error is returned.
4868// Deprecated: Use NextWithContext() instead.
4869func (iter *EncryptionProtectorListResultIterator) Next() error {
4870	return iter.NextWithContext(context.Background())
4871}
4872
4873// NotDone returns true if the enumeration should be started or is not yet complete.
4874func (iter EncryptionProtectorListResultIterator) NotDone() bool {
4875	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4876}
4877
4878// Response returns the raw server response from the last page request.
4879func (iter EncryptionProtectorListResultIterator) Response() EncryptionProtectorListResult {
4880	return iter.page.Response()
4881}
4882
4883// Value returns the current value or a zero-initialized value if the
4884// iterator has advanced beyond the end of the collection.
4885func (iter EncryptionProtectorListResultIterator) Value() EncryptionProtector {
4886	if !iter.page.NotDone() {
4887		return EncryptionProtector{}
4888	}
4889	return iter.page.Values()[iter.i]
4890}
4891
4892// Creates a new instance of the EncryptionProtectorListResultIterator type.
4893func NewEncryptionProtectorListResultIterator(page EncryptionProtectorListResultPage) EncryptionProtectorListResultIterator {
4894	return EncryptionProtectorListResultIterator{page: page}
4895}
4896
4897// IsEmpty returns true if the ListResult contains no values.
4898func (eplr EncryptionProtectorListResult) IsEmpty() bool {
4899	return eplr.Value == nil || len(*eplr.Value) == 0
4900}
4901
4902// hasNextLink returns true if the NextLink is not empty.
4903func (eplr EncryptionProtectorListResult) hasNextLink() bool {
4904	return eplr.NextLink != nil && len(*eplr.NextLink) != 0
4905}
4906
4907// encryptionProtectorListResultPreparer prepares a request to retrieve the next set of results.
4908// It returns nil if no more results exist.
4909func (eplr EncryptionProtectorListResult) encryptionProtectorListResultPreparer(ctx context.Context) (*http.Request, error) {
4910	if !eplr.hasNextLink() {
4911		return nil, nil
4912	}
4913	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4914		autorest.AsJSON(),
4915		autorest.AsGet(),
4916		autorest.WithBaseURL(to.String(eplr.NextLink)))
4917}
4918
4919// EncryptionProtectorListResultPage contains a page of EncryptionProtector values.
4920type EncryptionProtectorListResultPage struct {
4921	fn   func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)
4922	eplr EncryptionProtectorListResult
4923}
4924
4925// NextWithContext advances to the next page of values.  If there was an error making
4926// the request the page does not advance and the error is returned.
4927func (page *EncryptionProtectorListResultPage) NextWithContext(ctx context.Context) (err error) {
4928	if tracing.IsEnabled() {
4929		ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultPage.NextWithContext")
4930		defer func() {
4931			sc := -1
4932			if page.Response().Response.Response != nil {
4933				sc = page.Response().Response.Response.StatusCode
4934			}
4935			tracing.EndSpan(ctx, sc, err)
4936		}()
4937	}
4938	for {
4939		next, err := page.fn(ctx, page.eplr)
4940		if err != nil {
4941			return err
4942		}
4943		page.eplr = next
4944		if !next.hasNextLink() || !next.IsEmpty() {
4945			break
4946		}
4947	}
4948	return nil
4949}
4950
4951// Next advances to the next page of values.  If there was an error making
4952// the request the page does not advance and the error is returned.
4953// Deprecated: Use NextWithContext() instead.
4954func (page *EncryptionProtectorListResultPage) Next() error {
4955	return page.NextWithContext(context.Background())
4956}
4957
4958// NotDone returns true if the page enumeration should be started or is not yet complete.
4959func (page EncryptionProtectorListResultPage) NotDone() bool {
4960	return !page.eplr.IsEmpty()
4961}
4962
4963// Response returns the raw server response from the last page request.
4964func (page EncryptionProtectorListResultPage) Response() EncryptionProtectorListResult {
4965	return page.eplr
4966}
4967
4968// Values returns the slice of values for the current page or nil if there are no values.
4969func (page EncryptionProtectorListResultPage) Values() []EncryptionProtector {
4970	if page.eplr.IsEmpty() {
4971		return nil
4972	}
4973	return *page.eplr.Value
4974}
4975
4976// Creates a new instance of the EncryptionProtectorListResultPage type.
4977func NewEncryptionProtectorListResultPage(cur EncryptionProtectorListResult, getNextPage func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)) EncryptionProtectorListResultPage {
4978	return EncryptionProtectorListResultPage{
4979		fn:   getNextPage,
4980		eplr: cur,
4981	}
4982}
4983
4984// EncryptionProtectorProperties properties for an encryption protector execution.
4985type EncryptionProtectorProperties struct {
4986	// Subregion - READ-ONLY; Subregion of the encryption protector.
4987	Subregion *string `json:"subregion,omitempty"`
4988	// ServerKeyName - The name of the server key.
4989	ServerKeyName *string `json:"serverKeyName,omitempty"`
4990	// ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
4991	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
4992	// URI - READ-ONLY; The URI of the server key.
4993	URI *string `json:"uri,omitempty"`
4994	// Thumbprint - READ-ONLY; Thumbprint of the server key.
4995	Thumbprint *string `json:"thumbprint,omitempty"`
4996}
4997
4998// MarshalJSON is the custom marshaler for EncryptionProtectorProperties.
4999func (epp EncryptionProtectorProperties) MarshalJSON() ([]byte, error) {
5000	objectMap := make(map[string]interface{})
5001	if epp.ServerKeyName != nil {
5002		objectMap["serverKeyName"] = epp.ServerKeyName
5003	}
5004	if epp.ServerKeyType != "" {
5005		objectMap["serverKeyType"] = epp.ServerKeyType
5006	}
5007	return json.Marshal(objectMap)
5008}
5009
5010// EncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
5011// long-running operation.
5012type EncryptionProtectorsCreateOrUpdateFuture struct {
5013	azure.FutureAPI
5014	// Result returns the result of the asynchronous operation.
5015	// If the operation has not completed it will return an error.
5016	Result func(EncryptionProtectorsClient) (EncryptionProtector, error)
5017}
5018
5019// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5020func (future *EncryptionProtectorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
5021	var azFuture azure.Future
5022	if err := json.Unmarshal(body, &azFuture); err != nil {
5023		return err
5024	}
5025	future.FutureAPI = &azFuture
5026	future.Result = future.result
5027	return nil
5028}
5029
5030// result is the default implementation for EncryptionProtectorsCreateOrUpdateFuture.Result.
5031func (future *EncryptionProtectorsCreateOrUpdateFuture) result(client EncryptionProtectorsClient) (ep EncryptionProtector, err error) {
5032	var done bool
5033	done, err = future.DoneWithContext(context.Background(), client)
5034	if err != nil {
5035		err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
5036		return
5037	}
5038	if !done {
5039		ep.Response.Response = future.Response()
5040		err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsCreateOrUpdateFuture")
5041		return
5042	}
5043	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5044	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
5045		ep, err = client.CreateOrUpdateResponder(ep.Response.Response)
5046		if err != nil {
5047			err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
5048		}
5049	}
5050	return
5051}
5052
5053// EncryptionProtectorsRevalidateFuture an abstraction for monitoring and retrieving the results of a
5054// long-running operation.
5055type EncryptionProtectorsRevalidateFuture struct {
5056	azure.FutureAPI
5057	// Result returns the result of the asynchronous operation.
5058	// If the operation has not completed it will return an error.
5059	Result func(EncryptionProtectorsClient) (autorest.Response, error)
5060}
5061
5062// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5063func (future *EncryptionProtectorsRevalidateFuture) UnmarshalJSON(body []byte) error {
5064	var azFuture azure.Future
5065	if err := json.Unmarshal(body, &azFuture); err != nil {
5066		return err
5067	}
5068	future.FutureAPI = &azFuture
5069	future.Result = future.result
5070	return nil
5071}
5072
5073// result is the default implementation for EncryptionProtectorsRevalidateFuture.Result.
5074func (future *EncryptionProtectorsRevalidateFuture) result(client EncryptionProtectorsClient) (ar autorest.Response, err error) {
5075	var done bool
5076	done, err = future.DoneWithContext(context.Background(), client)
5077	if err != nil {
5078		err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsRevalidateFuture", "Result", future.Response(), "Polling failure")
5079		return
5080	}
5081	if !done {
5082		ar.Response = future.Response()
5083		err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsRevalidateFuture")
5084		return
5085	}
5086	ar.Response = future.Response()
5087	return
5088}
5089
5090// ExportDatabaseDefinition contains the information necessary to perform export database operation.
5091type ExportDatabaseDefinition struct {
5092	// StorageKeyType - Storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey'
5093	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
5094	// StorageKey - Storage key.
5095	StorageKey *string `json:"storageKey,omitempty"`
5096	// StorageURI - Storage Uri.
5097	StorageURI *string `json:"storageUri,omitempty"`
5098	// AdministratorLogin - Administrator login name.
5099	AdministratorLogin *string `json:"administratorLogin,omitempty"`
5100	// AdministratorLoginPassword - Administrator login password.
5101	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
5102	// AuthenticationType - Authentication type.
5103	AuthenticationType *string `json:"authenticationType,omitempty"`
5104	// NetworkIsolation - Optional resource information to enable network isolation for request.
5105	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
5106}
5107
5108// ExtendedDatabaseBlobAuditingPolicy an extended database blob auditing policy.
5109type ExtendedDatabaseBlobAuditingPolicy struct {
5110	autorest.Response `json:"-"`
5111	// ExtendedDatabaseBlobAuditingPolicyProperties - Resource properties.
5112	*ExtendedDatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"`
5113	// ID - READ-ONLY; Resource ID.
5114	ID *string `json:"id,omitempty"`
5115	// Name - READ-ONLY; Resource name.
5116	Name *string `json:"name,omitempty"`
5117	// Type - READ-ONLY; Resource type.
5118	Type *string `json:"type,omitempty"`
5119}
5120
5121// MarshalJSON is the custom marshaler for ExtendedDatabaseBlobAuditingPolicy.
5122func (edbap ExtendedDatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
5123	objectMap := make(map[string]interface{})
5124	if edbap.ExtendedDatabaseBlobAuditingPolicyProperties != nil {
5125		objectMap["properties"] = edbap.ExtendedDatabaseBlobAuditingPolicyProperties
5126	}
5127	return json.Marshal(objectMap)
5128}
5129
5130// UnmarshalJSON is the custom unmarshaler for ExtendedDatabaseBlobAuditingPolicy struct.
5131func (edbap *ExtendedDatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
5132	var m map[string]*json.RawMessage
5133	err := json.Unmarshal(body, &m)
5134	if err != nil {
5135		return err
5136	}
5137	for k, v := range m {
5138		switch k {
5139		case "properties":
5140			if v != nil {
5141				var extendedDatabaseBlobAuditingPolicyProperties ExtendedDatabaseBlobAuditingPolicyProperties
5142				err = json.Unmarshal(*v, &extendedDatabaseBlobAuditingPolicyProperties)
5143				if err != nil {
5144					return err
5145				}
5146				edbap.ExtendedDatabaseBlobAuditingPolicyProperties = &extendedDatabaseBlobAuditingPolicyProperties
5147			}
5148		case "id":
5149			if v != nil {
5150				var ID string
5151				err = json.Unmarshal(*v, &ID)
5152				if err != nil {
5153					return err
5154				}
5155				edbap.ID = &ID
5156			}
5157		case "name":
5158			if v != nil {
5159				var name string
5160				err = json.Unmarshal(*v, &name)
5161				if err != nil {
5162					return err
5163				}
5164				edbap.Name = &name
5165			}
5166		case "type":
5167			if v != nil {
5168				var typeVar string
5169				err = json.Unmarshal(*v, &typeVar)
5170				if err != nil {
5171					return err
5172				}
5173				edbap.Type = &typeVar
5174			}
5175		}
5176	}
5177
5178	return nil
5179}
5180
5181// ExtendedDatabaseBlobAuditingPolicyListResult a list of database extended auditing settings.
5182type ExtendedDatabaseBlobAuditingPolicyListResult struct {
5183	autorest.Response `json:"-"`
5184	// Value - READ-ONLY; Array of results.
5185	Value *[]ExtendedDatabaseBlobAuditingPolicy `json:"value,omitempty"`
5186	// NextLink - READ-ONLY; Link to retrieve next page of results.
5187	NextLink *string `json:"nextLink,omitempty"`
5188}
5189
5190// MarshalJSON is the custom marshaler for ExtendedDatabaseBlobAuditingPolicyListResult.
5191func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
5192	objectMap := make(map[string]interface{})
5193	return json.Marshal(objectMap)
5194}
5195
5196// ExtendedDatabaseBlobAuditingPolicyListResultIterator provides access to a complete listing of
5197// ExtendedDatabaseBlobAuditingPolicy values.
5198type ExtendedDatabaseBlobAuditingPolicyListResultIterator struct {
5199	i    int
5200	page ExtendedDatabaseBlobAuditingPolicyListResultPage
5201}
5202
5203// NextWithContext advances to the next value.  If there was an error making
5204// the request the iterator does not advance and the error is returned.
5205func (iter *ExtendedDatabaseBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
5206	if tracing.IsEnabled() {
5207		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPolicyListResultIterator.NextWithContext")
5208		defer func() {
5209			sc := -1
5210			if iter.Response().Response.Response != nil {
5211				sc = iter.Response().Response.Response.StatusCode
5212			}
5213			tracing.EndSpan(ctx, sc, err)
5214		}()
5215	}
5216	iter.i++
5217	if iter.i < len(iter.page.Values()) {
5218		return nil
5219	}
5220	err = iter.page.NextWithContext(ctx)
5221	if err != nil {
5222		iter.i--
5223		return err
5224	}
5225	iter.i = 0
5226	return nil
5227}
5228
5229// Next advances to the next value.  If there was an error making
5230// the request the iterator does not advance and the error is returned.
5231// Deprecated: Use NextWithContext() instead.
5232func (iter *ExtendedDatabaseBlobAuditingPolicyListResultIterator) Next() error {
5233	return iter.NextWithContext(context.Background())
5234}
5235
5236// NotDone returns true if the enumeration should be started or is not yet complete.
5237func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) NotDone() bool {
5238	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5239}
5240
5241// Response returns the raw server response from the last page request.
5242func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) Response() ExtendedDatabaseBlobAuditingPolicyListResult {
5243	return iter.page.Response()
5244}
5245
5246// Value returns the current value or a zero-initialized value if the
5247// iterator has advanced beyond the end of the collection.
5248func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) Value() ExtendedDatabaseBlobAuditingPolicy {
5249	if !iter.page.NotDone() {
5250		return ExtendedDatabaseBlobAuditingPolicy{}
5251	}
5252	return iter.page.Values()[iter.i]
5253}
5254
5255// Creates a new instance of the ExtendedDatabaseBlobAuditingPolicyListResultIterator type.
5256func NewExtendedDatabaseBlobAuditingPolicyListResultIterator(page ExtendedDatabaseBlobAuditingPolicyListResultPage) ExtendedDatabaseBlobAuditingPolicyListResultIterator {
5257	return ExtendedDatabaseBlobAuditingPolicyListResultIterator{page: page}
5258}
5259
5260// IsEmpty returns true if the ListResult contains no values.
5261func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) IsEmpty() bool {
5262	return edbaplr.Value == nil || len(*edbaplr.Value) == 0
5263}
5264
5265// hasNextLink returns true if the NextLink is not empty.
5266func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) hasNextLink() bool {
5267	return edbaplr.NextLink != nil && len(*edbaplr.NextLink) != 0
5268}
5269
5270// extendedDatabaseBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
5271// It returns nil if no more results exist.
5272func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) extendedDatabaseBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
5273	if !edbaplr.hasNextLink() {
5274		return nil, nil
5275	}
5276	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5277		autorest.AsJSON(),
5278		autorest.AsGet(),
5279		autorest.WithBaseURL(to.String(edbaplr.NextLink)))
5280}
5281
5282// ExtendedDatabaseBlobAuditingPolicyListResultPage contains a page of ExtendedDatabaseBlobAuditingPolicy
5283// values.
5284type ExtendedDatabaseBlobAuditingPolicyListResultPage struct {
5285	fn      func(context.Context, ExtendedDatabaseBlobAuditingPolicyListResult) (ExtendedDatabaseBlobAuditingPolicyListResult, error)
5286	edbaplr ExtendedDatabaseBlobAuditingPolicyListResult
5287}
5288
5289// NextWithContext advances to the next page of values.  If there was an error making
5290// the request the page does not advance and the error is returned.
5291func (page *ExtendedDatabaseBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
5292	if tracing.IsEnabled() {
5293		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPolicyListResultPage.NextWithContext")
5294		defer func() {
5295			sc := -1
5296			if page.Response().Response.Response != nil {
5297				sc = page.Response().Response.Response.StatusCode
5298			}
5299			tracing.EndSpan(ctx, sc, err)
5300		}()
5301	}
5302	for {
5303		next, err := page.fn(ctx, page.edbaplr)
5304		if err != nil {
5305			return err
5306		}
5307		page.edbaplr = next
5308		if !next.hasNextLink() || !next.IsEmpty() {
5309			break
5310		}
5311	}
5312	return nil
5313}
5314
5315// Next advances to the next page of values.  If there was an error making
5316// the request the page does not advance and the error is returned.
5317// Deprecated: Use NextWithContext() instead.
5318func (page *ExtendedDatabaseBlobAuditingPolicyListResultPage) Next() error {
5319	return page.NextWithContext(context.Background())
5320}
5321
5322// NotDone returns true if the page enumeration should be started or is not yet complete.
5323func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) NotDone() bool {
5324	return !page.edbaplr.IsEmpty()
5325}
5326
5327// Response returns the raw server response from the last page request.
5328func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) Response() ExtendedDatabaseBlobAuditingPolicyListResult {
5329	return page.edbaplr
5330}
5331
5332// Values returns the slice of values for the current page or nil if there are no values.
5333func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) Values() []ExtendedDatabaseBlobAuditingPolicy {
5334	if page.edbaplr.IsEmpty() {
5335		return nil
5336	}
5337	return *page.edbaplr.Value
5338}
5339
5340// Creates a new instance of the ExtendedDatabaseBlobAuditingPolicyListResultPage type.
5341func NewExtendedDatabaseBlobAuditingPolicyListResultPage(cur ExtendedDatabaseBlobAuditingPolicyListResult, getNextPage func(context.Context, ExtendedDatabaseBlobAuditingPolicyListResult) (ExtendedDatabaseBlobAuditingPolicyListResult, error)) ExtendedDatabaseBlobAuditingPolicyListResultPage {
5342	return ExtendedDatabaseBlobAuditingPolicyListResultPage{
5343		fn:      getNextPage,
5344		edbaplr: cur,
5345	}
5346}
5347
5348// ExtendedDatabaseBlobAuditingPolicyProperties properties of an extended database blob auditing policy.
5349type ExtendedDatabaseBlobAuditingPolicyProperties struct {
5350	// PredicateExpression - Specifies condition of where clause when creating an audit.
5351	PredicateExpression *string `json:"predicateExpression,omitempty"`
5352	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
5353	State BlobAuditingPolicyState `json:"state,omitempty"`
5354	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
5355	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
5356	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
5357	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
5358	// Prerequisites for using managed identity authentication:
5359	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
5360	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
5361	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
5362	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
5363	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
5364	RetentionDays *int32 `json:"retentionDays,omitempty"`
5365	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
5366	//
5367	// 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:
5368	//
5369	// BATCH_COMPLETED_GROUP,
5370	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
5371	// FAILED_DATABASE_AUTHENTICATION_GROUP.
5372	//
5373	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
5374	//
5375	// 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):
5376	//
5377	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
5378	// BACKUP_RESTORE_GROUP
5379	// DATABASE_LOGOUT_GROUP
5380	// DATABASE_OBJECT_CHANGE_GROUP
5381	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
5382	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
5383	// DATABASE_OPERATION_GROUP
5384	// DATABASE_PERMISSION_CHANGE_GROUP
5385	// DATABASE_PRINCIPAL_CHANGE_GROUP
5386	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
5387	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
5388	// FAILED_DATABASE_AUTHENTICATION_GROUP
5389	// SCHEMA_OBJECT_ACCESS_GROUP
5390	// SCHEMA_OBJECT_CHANGE_GROUP
5391	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
5392	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
5393	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
5394	// USER_CHANGE_PASSWORD_GROUP
5395	// BATCH_STARTED_GROUP
5396	// BATCH_COMPLETED_GROUP
5397	//
5398	// 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.
5399	//
5400	// 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).
5401	//
5402	// 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:
5403	// SELECT
5404	// UPDATE
5405	// INSERT
5406	// DELETE
5407	// EXECUTE
5408	// RECEIVE
5409	// REFERENCES
5410	//
5411	// The general form for defining an action to be audited is:
5412	// {action} ON {object} BY {principal}
5413	//
5414	// 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.
5415	//
5416	// For example:
5417	// SELECT on dbo.myTable by public
5418	// SELECT on DATABASE::myDatabase by public
5419	// SELECT on SCHEMA::mySchema by public
5420	//
5421	// 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)
5422	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
5423	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
5424	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
5425	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
5426	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
5427	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
5428	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
5429	//
5430	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
5431	// Note that for server level audit you should use the 'master' database as {databaseName}.
5432	//
5433	// Diagnostic Settings URI format:
5434	// 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
5435	//
5436	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
5437	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
5438	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
5439	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
5440	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
5441	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
5442}
5443
5444// ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
5445// results of a long-running operation.
5446type ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture struct {
5447	azure.FutureAPI
5448	// Result returns the result of the asynchronous operation.
5449	// If the operation has not completed it will return an error.
5450	Result func(ExtendedServerBlobAuditingPoliciesClient) (ExtendedServerBlobAuditingPolicy, error)
5451}
5452
5453// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5454func (future *ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
5455	var azFuture azure.Future
5456	if err := json.Unmarshal(body, &azFuture); err != nil {
5457		return err
5458	}
5459	future.FutureAPI = &azFuture
5460	future.Result = future.result
5461	return nil
5462}
5463
5464// result is the default implementation for ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture.Result.
5465func (future *ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture) result(client ExtendedServerBlobAuditingPoliciesClient) (esbap ExtendedServerBlobAuditingPolicy, err error) {
5466	var done bool
5467	done, err = future.DoneWithContext(context.Background(), client)
5468	if err != nil {
5469		err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
5470		return
5471	}
5472	if !done {
5473		esbap.Response.Response = future.Response()
5474		err = azure.NewAsyncOpIncompleteError("sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture")
5475		return
5476	}
5477	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5478	if esbap.Response.Response, err = future.GetResult(sender); err == nil && esbap.Response.Response.StatusCode != http.StatusNoContent {
5479		esbap, err = client.CreateOrUpdateResponder(esbap.Response.Response)
5480		if err != nil {
5481			err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", esbap.Response.Response, "Failure responding to request")
5482		}
5483	}
5484	return
5485}
5486
5487// ExtendedServerBlobAuditingPolicy an extended server blob auditing policy.
5488type ExtendedServerBlobAuditingPolicy struct {
5489	autorest.Response `json:"-"`
5490	// ExtendedServerBlobAuditingPolicyProperties - Resource properties.
5491	*ExtendedServerBlobAuditingPolicyProperties `json:"properties,omitempty"`
5492	// ID - READ-ONLY; Resource ID.
5493	ID *string `json:"id,omitempty"`
5494	// Name - READ-ONLY; Resource name.
5495	Name *string `json:"name,omitempty"`
5496	// Type - READ-ONLY; Resource type.
5497	Type *string `json:"type,omitempty"`
5498}
5499
5500// MarshalJSON is the custom marshaler for ExtendedServerBlobAuditingPolicy.
5501func (esbap ExtendedServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
5502	objectMap := make(map[string]interface{})
5503	if esbap.ExtendedServerBlobAuditingPolicyProperties != nil {
5504		objectMap["properties"] = esbap.ExtendedServerBlobAuditingPolicyProperties
5505	}
5506	return json.Marshal(objectMap)
5507}
5508
5509// UnmarshalJSON is the custom unmarshaler for ExtendedServerBlobAuditingPolicy struct.
5510func (esbap *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
5511	var m map[string]*json.RawMessage
5512	err := json.Unmarshal(body, &m)
5513	if err != nil {
5514		return err
5515	}
5516	for k, v := range m {
5517		switch k {
5518		case "properties":
5519			if v != nil {
5520				var extendedServerBlobAuditingPolicyProperties ExtendedServerBlobAuditingPolicyProperties
5521				err = json.Unmarshal(*v, &extendedServerBlobAuditingPolicyProperties)
5522				if err != nil {
5523					return err
5524				}
5525				esbap.ExtendedServerBlobAuditingPolicyProperties = &extendedServerBlobAuditingPolicyProperties
5526			}
5527		case "id":
5528			if v != nil {
5529				var ID string
5530				err = json.Unmarshal(*v, &ID)
5531				if err != nil {
5532					return err
5533				}
5534				esbap.ID = &ID
5535			}
5536		case "name":
5537			if v != nil {
5538				var name string
5539				err = json.Unmarshal(*v, &name)
5540				if err != nil {
5541					return err
5542				}
5543				esbap.Name = &name
5544			}
5545		case "type":
5546			if v != nil {
5547				var typeVar string
5548				err = json.Unmarshal(*v, &typeVar)
5549				if err != nil {
5550					return err
5551				}
5552				esbap.Type = &typeVar
5553			}
5554		}
5555	}
5556
5557	return nil
5558}
5559
5560// ExtendedServerBlobAuditingPolicyListResult a list of server extended auditing settings.
5561type ExtendedServerBlobAuditingPolicyListResult struct {
5562	autorest.Response `json:"-"`
5563	// Value - READ-ONLY; Array of results.
5564	Value *[]ExtendedServerBlobAuditingPolicy `json:"value,omitempty"`
5565	// NextLink - READ-ONLY; Link to retrieve next page of results.
5566	NextLink *string `json:"nextLink,omitempty"`
5567}
5568
5569// MarshalJSON is the custom marshaler for ExtendedServerBlobAuditingPolicyListResult.
5570func (esbaplr ExtendedServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
5571	objectMap := make(map[string]interface{})
5572	return json.Marshal(objectMap)
5573}
5574
5575// ExtendedServerBlobAuditingPolicyListResultIterator provides access to a complete listing of
5576// ExtendedServerBlobAuditingPolicy values.
5577type ExtendedServerBlobAuditingPolicyListResultIterator struct {
5578	i    int
5579	page ExtendedServerBlobAuditingPolicyListResultPage
5580}
5581
5582// NextWithContext advances to the next value.  If there was an error making
5583// the request the iterator does not advance and the error is returned.
5584func (iter *ExtendedServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
5585	if tracing.IsEnabled() {
5586		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultIterator.NextWithContext")
5587		defer func() {
5588			sc := -1
5589			if iter.Response().Response.Response != nil {
5590				sc = iter.Response().Response.Response.StatusCode
5591			}
5592			tracing.EndSpan(ctx, sc, err)
5593		}()
5594	}
5595	iter.i++
5596	if iter.i < len(iter.page.Values()) {
5597		return nil
5598	}
5599	err = iter.page.NextWithContext(ctx)
5600	if err != nil {
5601		iter.i--
5602		return err
5603	}
5604	iter.i = 0
5605	return nil
5606}
5607
5608// Next advances to the next value.  If there was an error making
5609// the request the iterator does not advance and the error is returned.
5610// Deprecated: Use NextWithContext() instead.
5611func (iter *ExtendedServerBlobAuditingPolicyListResultIterator) Next() error {
5612	return iter.NextWithContext(context.Background())
5613}
5614
5615// NotDone returns true if the enumeration should be started or is not yet complete.
5616func (iter ExtendedServerBlobAuditingPolicyListResultIterator) NotDone() bool {
5617	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5618}
5619
5620// Response returns the raw server response from the last page request.
5621func (iter ExtendedServerBlobAuditingPolicyListResultIterator) Response() ExtendedServerBlobAuditingPolicyListResult {
5622	return iter.page.Response()
5623}
5624
5625// Value returns the current value or a zero-initialized value if the
5626// iterator has advanced beyond the end of the collection.
5627func (iter ExtendedServerBlobAuditingPolicyListResultIterator) Value() ExtendedServerBlobAuditingPolicy {
5628	if !iter.page.NotDone() {
5629		return ExtendedServerBlobAuditingPolicy{}
5630	}
5631	return iter.page.Values()[iter.i]
5632}
5633
5634// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultIterator type.
5635func NewExtendedServerBlobAuditingPolicyListResultIterator(page ExtendedServerBlobAuditingPolicyListResultPage) ExtendedServerBlobAuditingPolicyListResultIterator {
5636	return ExtendedServerBlobAuditingPolicyListResultIterator{page: page}
5637}
5638
5639// IsEmpty returns true if the ListResult contains no values.
5640func (esbaplr ExtendedServerBlobAuditingPolicyListResult) IsEmpty() bool {
5641	return esbaplr.Value == nil || len(*esbaplr.Value) == 0
5642}
5643
5644// hasNextLink returns true if the NextLink is not empty.
5645func (esbaplr ExtendedServerBlobAuditingPolicyListResult) hasNextLink() bool {
5646	return esbaplr.NextLink != nil && len(*esbaplr.NextLink) != 0
5647}
5648
5649// extendedServerBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
5650// It returns nil if no more results exist.
5651func (esbaplr ExtendedServerBlobAuditingPolicyListResult) extendedServerBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
5652	if !esbaplr.hasNextLink() {
5653		return nil, nil
5654	}
5655	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5656		autorest.AsJSON(),
5657		autorest.AsGet(),
5658		autorest.WithBaseURL(to.String(esbaplr.NextLink)))
5659}
5660
5661// ExtendedServerBlobAuditingPolicyListResultPage contains a page of ExtendedServerBlobAuditingPolicy
5662// values.
5663type ExtendedServerBlobAuditingPolicyListResultPage struct {
5664	fn      func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)
5665	esbaplr ExtendedServerBlobAuditingPolicyListResult
5666}
5667
5668// NextWithContext advances to the next page of values.  If there was an error making
5669// the request the page does not advance and the error is returned.
5670func (page *ExtendedServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
5671	if tracing.IsEnabled() {
5672		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultPage.NextWithContext")
5673		defer func() {
5674			sc := -1
5675			if page.Response().Response.Response != nil {
5676				sc = page.Response().Response.Response.StatusCode
5677			}
5678			tracing.EndSpan(ctx, sc, err)
5679		}()
5680	}
5681	for {
5682		next, err := page.fn(ctx, page.esbaplr)
5683		if err != nil {
5684			return err
5685		}
5686		page.esbaplr = next
5687		if !next.hasNextLink() || !next.IsEmpty() {
5688			break
5689		}
5690	}
5691	return nil
5692}
5693
5694// Next advances to the next page of values.  If there was an error making
5695// the request the page does not advance and the error is returned.
5696// Deprecated: Use NextWithContext() instead.
5697func (page *ExtendedServerBlobAuditingPolicyListResultPage) Next() error {
5698	return page.NextWithContext(context.Background())
5699}
5700
5701// NotDone returns true if the page enumeration should be started or is not yet complete.
5702func (page ExtendedServerBlobAuditingPolicyListResultPage) NotDone() bool {
5703	return !page.esbaplr.IsEmpty()
5704}
5705
5706// Response returns the raw server response from the last page request.
5707func (page ExtendedServerBlobAuditingPolicyListResultPage) Response() ExtendedServerBlobAuditingPolicyListResult {
5708	return page.esbaplr
5709}
5710
5711// Values returns the slice of values for the current page or nil if there are no values.
5712func (page ExtendedServerBlobAuditingPolicyListResultPage) Values() []ExtendedServerBlobAuditingPolicy {
5713	if page.esbaplr.IsEmpty() {
5714		return nil
5715	}
5716	return *page.esbaplr.Value
5717}
5718
5719// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultPage type.
5720func NewExtendedServerBlobAuditingPolicyListResultPage(cur ExtendedServerBlobAuditingPolicyListResult, getNextPage func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)) ExtendedServerBlobAuditingPolicyListResultPage {
5721	return ExtendedServerBlobAuditingPolicyListResultPage{
5722		fn:      getNextPage,
5723		esbaplr: cur,
5724	}
5725}
5726
5727// ExtendedServerBlobAuditingPolicyProperties properties of an extended server blob auditing policy.
5728type ExtendedServerBlobAuditingPolicyProperties struct {
5729	// PredicateExpression - Specifies condition of where clause when creating an audit.
5730	PredicateExpression *string `json:"predicateExpression,omitempty"`
5731	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
5732	State BlobAuditingPolicyState `json:"state,omitempty"`
5733	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
5734	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
5735	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
5736	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
5737	// Prerequisites for using managed identity authentication:
5738	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
5739	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
5740	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
5741	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
5742	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
5743	RetentionDays *int32 `json:"retentionDays,omitempty"`
5744	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
5745	//
5746	// 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:
5747	//
5748	// BATCH_COMPLETED_GROUP,
5749	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
5750	// FAILED_DATABASE_AUTHENTICATION_GROUP.
5751	//
5752	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
5753	//
5754	// 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):
5755	//
5756	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
5757	// BACKUP_RESTORE_GROUP
5758	// DATABASE_LOGOUT_GROUP
5759	// DATABASE_OBJECT_CHANGE_GROUP
5760	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
5761	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
5762	// DATABASE_OPERATION_GROUP
5763	// DATABASE_PERMISSION_CHANGE_GROUP
5764	// DATABASE_PRINCIPAL_CHANGE_GROUP
5765	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
5766	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
5767	// FAILED_DATABASE_AUTHENTICATION_GROUP
5768	// SCHEMA_OBJECT_ACCESS_GROUP
5769	// SCHEMA_OBJECT_CHANGE_GROUP
5770	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
5771	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
5772	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
5773	// USER_CHANGE_PASSWORD_GROUP
5774	// BATCH_STARTED_GROUP
5775	// BATCH_COMPLETED_GROUP
5776	//
5777	// 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.
5778	//
5779	// 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).
5780	//
5781	// 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:
5782	// SELECT
5783	// UPDATE
5784	// INSERT
5785	// DELETE
5786	// EXECUTE
5787	// RECEIVE
5788	// REFERENCES
5789	//
5790	// The general form for defining an action to be audited is:
5791	// {action} ON {object} BY {principal}
5792	//
5793	// 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.
5794	//
5795	// For example:
5796	// SELECT on dbo.myTable by public
5797	// SELECT on DATABASE::myDatabase by public
5798	// SELECT on SCHEMA::mySchema by public
5799	//
5800	// 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)
5801	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
5802	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
5803	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
5804	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
5805	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
5806	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
5807	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
5808	//
5809	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
5810	// Note that for server level audit you should use the 'master' database as {databaseName}.
5811	//
5812	// Diagnostic Settings URI format:
5813	// 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
5814	//
5815	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
5816	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
5817	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
5818	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
5819	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
5820	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
5821}
5822
5823// FailoverGroup a failover group.
5824type FailoverGroup struct {
5825	autorest.Response `json:"-"`
5826	// Location - READ-ONLY; Resource location.
5827	Location *string `json:"location,omitempty"`
5828	// Tags - Resource tags.
5829	Tags map[string]*string `json:"tags"`
5830	// FailoverGroupProperties - Resource properties.
5831	*FailoverGroupProperties `json:"properties,omitempty"`
5832	// ID - READ-ONLY; Resource ID.
5833	ID *string `json:"id,omitempty"`
5834	// Name - READ-ONLY; Resource name.
5835	Name *string `json:"name,omitempty"`
5836	// Type - READ-ONLY; Resource type.
5837	Type *string `json:"type,omitempty"`
5838}
5839
5840// MarshalJSON is the custom marshaler for FailoverGroup.
5841func (fg FailoverGroup) MarshalJSON() ([]byte, error) {
5842	objectMap := make(map[string]interface{})
5843	if fg.Tags != nil {
5844		objectMap["tags"] = fg.Tags
5845	}
5846	if fg.FailoverGroupProperties != nil {
5847		objectMap["properties"] = fg.FailoverGroupProperties
5848	}
5849	return json.Marshal(objectMap)
5850}
5851
5852// UnmarshalJSON is the custom unmarshaler for FailoverGroup struct.
5853func (fg *FailoverGroup) UnmarshalJSON(body []byte) error {
5854	var m map[string]*json.RawMessage
5855	err := json.Unmarshal(body, &m)
5856	if err != nil {
5857		return err
5858	}
5859	for k, v := range m {
5860		switch k {
5861		case "location":
5862			if v != nil {
5863				var location string
5864				err = json.Unmarshal(*v, &location)
5865				if err != nil {
5866					return err
5867				}
5868				fg.Location = &location
5869			}
5870		case "tags":
5871			if v != nil {
5872				var tags map[string]*string
5873				err = json.Unmarshal(*v, &tags)
5874				if err != nil {
5875					return err
5876				}
5877				fg.Tags = tags
5878			}
5879		case "properties":
5880			if v != nil {
5881				var failoverGroupProperties FailoverGroupProperties
5882				err = json.Unmarshal(*v, &failoverGroupProperties)
5883				if err != nil {
5884					return err
5885				}
5886				fg.FailoverGroupProperties = &failoverGroupProperties
5887			}
5888		case "id":
5889			if v != nil {
5890				var ID string
5891				err = json.Unmarshal(*v, &ID)
5892				if err != nil {
5893					return err
5894				}
5895				fg.ID = &ID
5896			}
5897		case "name":
5898			if v != nil {
5899				var name string
5900				err = json.Unmarshal(*v, &name)
5901				if err != nil {
5902					return err
5903				}
5904				fg.Name = &name
5905			}
5906		case "type":
5907			if v != nil {
5908				var typeVar string
5909				err = json.Unmarshal(*v, &typeVar)
5910				if err != nil {
5911					return err
5912				}
5913				fg.Type = &typeVar
5914			}
5915		}
5916	}
5917
5918	return nil
5919}
5920
5921// FailoverGroupListResult a list of failover groups.
5922type FailoverGroupListResult struct {
5923	autorest.Response `json:"-"`
5924	// Value - READ-ONLY; Array of results.
5925	Value *[]FailoverGroup `json:"value,omitempty"`
5926	// NextLink - READ-ONLY; Link to retrieve next page of results.
5927	NextLink *string `json:"nextLink,omitempty"`
5928}
5929
5930// MarshalJSON is the custom marshaler for FailoverGroupListResult.
5931func (fglr FailoverGroupListResult) MarshalJSON() ([]byte, error) {
5932	objectMap := make(map[string]interface{})
5933	return json.Marshal(objectMap)
5934}
5935
5936// FailoverGroupListResultIterator provides access to a complete listing of FailoverGroup values.
5937type FailoverGroupListResultIterator struct {
5938	i    int
5939	page FailoverGroupListResultPage
5940}
5941
5942// NextWithContext advances to the next value.  If there was an error making
5943// the request the iterator does not advance and the error is returned.
5944func (iter *FailoverGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
5945	if tracing.IsEnabled() {
5946		ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupListResultIterator.NextWithContext")
5947		defer func() {
5948			sc := -1
5949			if iter.Response().Response.Response != nil {
5950				sc = iter.Response().Response.Response.StatusCode
5951			}
5952			tracing.EndSpan(ctx, sc, err)
5953		}()
5954	}
5955	iter.i++
5956	if iter.i < len(iter.page.Values()) {
5957		return nil
5958	}
5959	err = iter.page.NextWithContext(ctx)
5960	if err != nil {
5961		iter.i--
5962		return err
5963	}
5964	iter.i = 0
5965	return nil
5966}
5967
5968// Next advances to the next value.  If there was an error making
5969// the request the iterator does not advance and the error is returned.
5970// Deprecated: Use NextWithContext() instead.
5971func (iter *FailoverGroupListResultIterator) Next() error {
5972	return iter.NextWithContext(context.Background())
5973}
5974
5975// NotDone returns true if the enumeration should be started or is not yet complete.
5976func (iter FailoverGroupListResultIterator) NotDone() bool {
5977	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5978}
5979
5980// Response returns the raw server response from the last page request.
5981func (iter FailoverGroupListResultIterator) Response() FailoverGroupListResult {
5982	return iter.page.Response()
5983}
5984
5985// Value returns the current value or a zero-initialized value if the
5986// iterator has advanced beyond the end of the collection.
5987func (iter FailoverGroupListResultIterator) Value() FailoverGroup {
5988	if !iter.page.NotDone() {
5989		return FailoverGroup{}
5990	}
5991	return iter.page.Values()[iter.i]
5992}
5993
5994// Creates a new instance of the FailoverGroupListResultIterator type.
5995func NewFailoverGroupListResultIterator(page FailoverGroupListResultPage) FailoverGroupListResultIterator {
5996	return FailoverGroupListResultIterator{page: page}
5997}
5998
5999// IsEmpty returns true if the ListResult contains no values.
6000func (fglr FailoverGroupListResult) IsEmpty() bool {
6001	return fglr.Value == nil || len(*fglr.Value) == 0
6002}
6003
6004// hasNextLink returns true if the NextLink is not empty.
6005func (fglr FailoverGroupListResult) hasNextLink() bool {
6006	return fglr.NextLink != nil && len(*fglr.NextLink) != 0
6007}
6008
6009// failoverGroupListResultPreparer prepares a request to retrieve the next set of results.
6010// It returns nil if no more results exist.
6011func (fglr FailoverGroupListResult) failoverGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
6012	if !fglr.hasNextLink() {
6013		return nil, nil
6014	}
6015	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6016		autorest.AsJSON(),
6017		autorest.AsGet(),
6018		autorest.WithBaseURL(to.String(fglr.NextLink)))
6019}
6020
6021// FailoverGroupListResultPage contains a page of FailoverGroup values.
6022type FailoverGroupListResultPage struct {
6023	fn   func(context.Context, FailoverGroupListResult) (FailoverGroupListResult, error)
6024	fglr FailoverGroupListResult
6025}
6026
6027// NextWithContext advances to the next page of values.  If there was an error making
6028// the request the page does not advance and the error is returned.
6029func (page *FailoverGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
6030	if tracing.IsEnabled() {
6031		ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupListResultPage.NextWithContext")
6032		defer func() {
6033			sc := -1
6034			if page.Response().Response.Response != nil {
6035				sc = page.Response().Response.Response.StatusCode
6036			}
6037			tracing.EndSpan(ctx, sc, err)
6038		}()
6039	}
6040	for {
6041		next, err := page.fn(ctx, page.fglr)
6042		if err != nil {
6043			return err
6044		}
6045		page.fglr = next
6046		if !next.hasNextLink() || !next.IsEmpty() {
6047			break
6048		}
6049	}
6050	return nil
6051}
6052
6053// Next advances to the next page of values.  If there was an error making
6054// the request the page does not advance and the error is returned.
6055// Deprecated: Use NextWithContext() instead.
6056func (page *FailoverGroupListResultPage) Next() error {
6057	return page.NextWithContext(context.Background())
6058}
6059
6060// NotDone returns true if the page enumeration should be started or is not yet complete.
6061func (page FailoverGroupListResultPage) NotDone() bool {
6062	return !page.fglr.IsEmpty()
6063}
6064
6065// Response returns the raw server response from the last page request.
6066func (page FailoverGroupListResultPage) Response() FailoverGroupListResult {
6067	return page.fglr
6068}
6069
6070// Values returns the slice of values for the current page or nil if there are no values.
6071func (page FailoverGroupListResultPage) Values() []FailoverGroup {
6072	if page.fglr.IsEmpty() {
6073		return nil
6074	}
6075	return *page.fglr.Value
6076}
6077
6078// Creates a new instance of the FailoverGroupListResultPage type.
6079func NewFailoverGroupListResultPage(cur FailoverGroupListResult, getNextPage func(context.Context, FailoverGroupListResult) (FailoverGroupListResult, error)) FailoverGroupListResultPage {
6080	return FailoverGroupListResultPage{
6081		fn:   getNextPage,
6082		fglr: cur,
6083	}
6084}
6085
6086// FailoverGroupProperties properties of a failover group.
6087type FailoverGroupProperties struct {
6088	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
6089	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
6090	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
6091	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
6092	// ReplicationRole - READ-ONLY; Local replication role of the failover group instance. Possible values include: 'Primary', 'Secondary'
6093	ReplicationRole FailoverGroupReplicationRole `json:"replicationRole,omitempty"`
6094	// ReplicationState - READ-ONLY; Replication state of the failover group instance.
6095	ReplicationState *string `json:"replicationState,omitempty"`
6096	// PartnerServers - List of partner server information for the failover group.
6097	PartnerServers *[]PartnerInfo `json:"partnerServers,omitempty"`
6098	// Databases - List of databases in the failover group.
6099	Databases *[]string `json:"databases,omitempty"`
6100}
6101
6102// MarshalJSON is the custom marshaler for FailoverGroupProperties.
6103func (fgp FailoverGroupProperties) MarshalJSON() ([]byte, error) {
6104	objectMap := make(map[string]interface{})
6105	if fgp.ReadWriteEndpoint != nil {
6106		objectMap["readWriteEndpoint"] = fgp.ReadWriteEndpoint
6107	}
6108	if fgp.ReadOnlyEndpoint != nil {
6109		objectMap["readOnlyEndpoint"] = fgp.ReadOnlyEndpoint
6110	}
6111	if fgp.PartnerServers != nil {
6112		objectMap["partnerServers"] = fgp.PartnerServers
6113	}
6114	if fgp.Databases != nil {
6115		objectMap["databases"] = fgp.Databases
6116	}
6117	return json.Marshal(objectMap)
6118}
6119
6120// FailoverGroupReadOnlyEndpoint read-only endpoint of the failover group instance.
6121type FailoverGroupReadOnlyEndpoint struct {
6122	// FailoverPolicy - Failover policy of the read-only endpoint for the failover group. Possible values include: 'ReadOnlyEndpointFailoverPolicyDisabled', 'ReadOnlyEndpointFailoverPolicyEnabled'
6123	FailoverPolicy ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
6124}
6125
6126// FailoverGroupReadWriteEndpoint read-write endpoint of the failover group instance.
6127type FailoverGroupReadWriteEndpoint struct {
6128	// 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'
6129	FailoverPolicy ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
6130	// FailoverWithDataLossGracePeriodMinutes - Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
6131	FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
6132}
6133
6134// FailoverGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
6135// long-running operation.
6136type FailoverGroupsCreateOrUpdateFuture struct {
6137	azure.FutureAPI
6138	// Result returns the result of the asynchronous operation.
6139	// If the operation has not completed it will return an error.
6140	Result func(FailoverGroupsClient) (FailoverGroup, error)
6141}
6142
6143// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6144func (future *FailoverGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
6145	var azFuture azure.Future
6146	if err := json.Unmarshal(body, &azFuture); err != nil {
6147		return err
6148	}
6149	future.FutureAPI = &azFuture
6150	future.Result = future.result
6151	return nil
6152}
6153
6154// result is the default implementation for FailoverGroupsCreateOrUpdateFuture.Result.
6155func (future *FailoverGroupsCreateOrUpdateFuture) result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
6156	var done bool
6157	done, err = future.DoneWithContext(context.Background(), client)
6158	if err != nil {
6159		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
6160		return
6161	}
6162	if !done {
6163		fg.Response.Response = future.Response()
6164		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsCreateOrUpdateFuture")
6165		return
6166	}
6167	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6168	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
6169		fg, err = client.CreateOrUpdateResponder(fg.Response.Response)
6170		if err != nil {
6171			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", fg.Response.Response, "Failure responding to request")
6172		}
6173	}
6174	return
6175}
6176
6177// FailoverGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
6178// operation.
6179type FailoverGroupsDeleteFuture struct {
6180	azure.FutureAPI
6181	// Result returns the result of the asynchronous operation.
6182	// If the operation has not completed it will return an error.
6183	Result func(FailoverGroupsClient) (autorest.Response, error)
6184}
6185
6186// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6187func (future *FailoverGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
6188	var azFuture azure.Future
6189	if err := json.Unmarshal(body, &azFuture); err != nil {
6190		return err
6191	}
6192	future.FutureAPI = &azFuture
6193	future.Result = future.result
6194	return nil
6195}
6196
6197// result is the default implementation for FailoverGroupsDeleteFuture.Result.
6198func (future *FailoverGroupsDeleteFuture) result(client FailoverGroupsClient) (ar autorest.Response, err error) {
6199	var done bool
6200	done, err = future.DoneWithContext(context.Background(), client)
6201	if err != nil {
6202		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
6203		return
6204	}
6205	if !done {
6206		ar.Response = future.Response()
6207		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsDeleteFuture")
6208		return
6209	}
6210	ar.Response = future.Response()
6211	return
6212}
6213
6214// FailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
6215// operation.
6216type FailoverGroupsFailoverFuture struct {
6217	azure.FutureAPI
6218	// Result returns the result of the asynchronous operation.
6219	// If the operation has not completed it will return an error.
6220	Result func(FailoverGroupsClient) (FailoverGroup, error)
6221}
6222
6223// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6224func (future *FailoverGroupsFailoverFuture) UnmarshalJSON(body []byte) error {
6225	var azFuture azure.Future
6226	if err := json.Unmarshal(body, &azFuture); err != nil {
6227		return err
6228	}
6229	future.FutureAPI = &azFuture
6230	future.Result = future.result
6231	return nil
6232}
6233
6234// result is the default implementation for FailoverGroupsFailoverFuture.Result.
6235func (future *FailoverGroupsFailoverFuture) result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
6236	var done bool
6237	done, err = future.DoneWithContext(context.Background(), client)
6238	if err != nil {
6239		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", future.Response(), "Polling failure")
6240		return
6241	}
6242	if !done {
6243		fg.Response.Response = future.Response()
6244		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsFailoverFuture")
6245		return
6246	}
6247	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6248	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
6249		fg, err = client.FailoverResponder(fg.Response.Response)
6250		if err != nil {
6251			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", fg.Response.Response, "Failure responding to request")
6252		}
6253	}
6254	return
6255}
6256
6257// FailoverGroupsForceFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results
6258// of a long-running operation.
6259type FailoverGroupsForceFailoverAllowDataLossFuture struct {
6260	azure.FutureAPI
6261	// Result returns the result of the asynchronous operation.
6262	// If the operation has not completed it will return an error.
6263	Result func(FailoverGroupsClient) (FailoverGroup, error)
6264}
6265
6266// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6267func (future *FailoverGroupsForceFailoverAllowDataLossFuture) UnmarshalJSON(body []byte) error {
6268	var azFuture azure.Future
6269	if err := json.Unmarshal(body, &azFuture); err != nil {
6270		return err
6271	}
6272	future.FutureAPI = &azFuture
6273	future.Result = future.result
6274	return nil
6275}
6276
6277// result is the default implementation for FailoverGroupsForceFailoverAllowDataLossFuture.Result.
6278func (future *FailoverGroupsForceFailoverAllowDataLossFuture) result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
6279	var done bool
6280	done, err = future.DoneWithContext(context.Background(), client)
6281	if err != nil {
6282		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure")
6283		return
6284	}
6285	if !done {
6286		fg.Response.Response = future.Response()
6287		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsForceFailoverAllowDataLossFuture")
6288		return
6289	}
6290	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6291	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
6292		fg, err = client.ForceFailoverAllowDataLossResponder(fg.Response.Response)
6293		if err != nil {
6294			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", fg.Response.Response, "Failure responding to request")
6295		}
6296	}
6297	return
6298}
6299
6300// FailoverGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
6301// operation.
6302type FailoverGroupsUpdateFuture struct {
6303	azure.FutureAPI
6304	// Result returns the result of the asynchronous operation.
6305	// If the operation has not completed it will return an error.
6306	Result func(FailoverGroupsClient) (FailoverGroup, error)
6307}
6308
6309// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6310func (future *FailoverGroupsUpdateFuture) UnmarshalJSON(body []byte) error {
6311	var azFuture azure.Future
6312	if err := json.Unmarshal(body, &azFuture); err != nil {
6313		return err
6314	}
6315	future.FutureAPI = &azFuture
6316	future.Result = future.result
6317	return nil
6318}
6319
6320// result is the default implementation for FailoverGroupsUpdateFuture.Result.
6321func (future *FailoverGroupsUpdateFuture) result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
6322	var done bool
6323	done, err = future.DoneWithContext(context.Background(), client)
6324	if err != nil {
6325		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", future.Response(), "Polling failure")
6326		return
6327	}
6328	if !done {
6329		fg.Response.Response = future.Response()
6330		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsUpdateFuture")
6331		return
6332	}
6333	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6334	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
6335		fg, err = client.UpdateResponder(fg.Response.Response)
6336		if err != nil {
6337			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", fg.Response.Response, "Failure responding to request")
6338		}
6339	}
6340	return
6341}
6342
6343// FailoverGroupUpdate a failover group update request.
6344type FailoverGroupUpdate struct {
6345	// FailoverGroupUpdateProperties - Resource properties.
6346	*FailoverGroupUpdateProperties `json:"properties,omitempty"`
6347	// Tags - Resource tags.
6348	Tags map[string]*string `json:"tags"`
6349}
6350
6351// MarshalJSON is the custom marshaler for FailoverGroupUpdate.
6352func (fgu FailoverGroupUpdate) MarshalJSON() ([]byte, error) {
6353	objectMap := make(map[string]interface{})
6354	if fgu.FailoverGroupUpdateProperties != nil {
6355		objectMap["properties"] = fgu.FailoverGroupUpdateProperties
6356	}
6357	if fgu.Tags != nil {
6358		objectMap["tags"] = fgu.Tags
6359	}
6360	return json.Marshal(objectMap)
6361}
6362
6363// UnmarshalJSON is the custom unmarshaler for FailoverGroupUpdate struct.
6364func (fgu *FailoverGroupUpdate) UnmarshalJSON(body []byte) error {
6365	var m map[string]*json.RawMessage
6366	err := json.Unmarshal(body, &m)
6367	if err != nil {
6368		return err
6369	}
6370	for k, v := range m {
6371		switch k {
6372		case "properties":
6373			if v != nil {
6374				var failoverGroupUpdateProperties FailoverGroupUpdateProperties
6375				err = json.Unmarshal(*v, &failoverGroupUpdateProperties)
6376				if err != nil {
6377					return err
6378				}
6379				fgu.FailoverGroupUpdateProperties = &failoverGroupUpdateProperties
6380			}
6381		case "tags":
6382			if v != nil {
6383				var tags map[string]*string
6384				err = json.Unmarshal(*v, &tags)
6385				if err != nil {
6386					return err
6387				}
6388				fgu.Tags = tags
6389			}
6390		}
6391	}
6392
6393	return nil
6394}
6395
6396// FailoverGroupUpdateProperties properties of a failover group update.
6397type FailoverGroupUpdateProperties struct {
6398	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
6399	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
6400	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
6401	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
6402	// Databases - List of databases in the failover group.
6403	Databases *[]string `json:"databases,omitempty"`
6404}
6405
6406// FirewallRule represents a server firewall rule.
6407type FirewallRule struct {
6408	autorest.Response `json:"-"`
6409	// Kind - READ-ONLY; Kind of server that contains this firewall rule.
6410	Kind *string `json:"kind,omitempty"`
6411	// Location - READ-ONLY; Location of the server that contains this firewall rule.
6412	Location *string `json:"location,omitempty"`
6413	// FirewallRuleProperties - The properties representing the resource.
6414	*FirewallRuleProperties `json:"properties,omitempty"`
6415	// ID - READ-ONLY; Resource ID.
6416	ID *string `json:"id,omitempty"`
6417	// Name - READ-ONLY; Resource name.
6418	Name *string `json:"name,omitempty"`
6419	// Type - READ-ONLY; Resource type.
6420	Type *string `json:"type,omitempty"`
6421}
6422
6423// MarshalJSON is the custom marshaler for FirewallRule.
6424func (fr FirewallRule) MarshalJSON() ([]byte, error) {
6425	objectMap := make(map[string]interface{})
6426	if fr.FirewallRuleProperties != nil {
6427		objectMap["properties"] = fr.FirewallRuleProperties
6428	}
6429	return json.Marshal(objectMap)
6430}
6431
6432// UnmarshalJSON is the custom unmarshaler for FirewallRule struct.
6433func (fr *FirewallRule) UnmarshalJSON(body []byte) error {
6434	var m map[string]*json.RawMessage
6435	err := json.Unmarshal(body, &m)
6436	if err != nil {
6437		return err
6438	}
6439	for k, v := range m {
6440		switch k {
6441		case "kind":
6442			if v != nil {
6443				var kind string
6444				err = json.Unmarshal(*v, &kind)
6445				if err != nil {
6446					return err
6447				}
6448				fr.Kind = &kind
6449			}
6450		case "location":
6451			if v != nil {
6452				var location string
6453				err = json.Unmarshal(*v, &location)
6454				if err != nil {
6455					return err
6456				}
6457				fr.Location = &location
6458			}
6459		case "properties":
6460			if v != nil {
6461				var firewallRuleProperties FirewallRuleProperties
6462				err = json.Unmarshal(*v, &firewallRuleProperties)
6463				if err != nil {
6464					return err
6465				}
6466				fr.FirewallRuleProperties = &firewallRuleProperties
6467			}
6468		case "id":
6469			if v != nil {
6470				var ID string
6471				err = json.Unmarshal(*v, &ID)
6472				if err != nil {
6473					return err
6474				}
6475				fr.ID = &ID
6476			}
6477		case "name":
6478			if v != nil {
6479				var name string
6480				err = json.Unmarshal(*v, &name)
6481				if err != nil {
6482					return err
6483				}
6484				fr.Name = &name
6485			}
6486		case "type":
6487			if v != nil {
6488				var typeVar string
6489				err = json.Unmarshal(*v, &typeVar)
6490				if err != nil {
6491					return err
6492				}
6493				fr.Type = &typeVar
6494			}
6495		}
6496	}
6497
6498	return nil
6499}
6500
6501// FirewallRuleListResult represents the response to a List Firewall Rules request.
6502type FirewallRuleListResult struct {
6503	autorest.Response `json:"-"`
6504	// Value - The list of server firewall rules.
6505	Value *[]FirewallRule `json:"value,omitempty"`
6506}
6507
6508// FirewallRuleProperties represents the properties of a server firewall rule.
6509type FirewallRuleProperties struct {
6510	// 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.
6511	StartIPAddress *string `json:"startIpAddress,omitempty"`
6512	// 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.
6513	EndIPAddress *string `json:"endIpAddress,omitempty"`
6514}
6515
6516// GeoBackupPolicy a database geo backup policy.
6517type GeoBackupPolicy struct {
6518	autorest.Response `json:"-"`
6519	// GeoBackupPolicyProperties - The properties of the geo backup policy.
6520	*GeoBackupPolicyProperties `json:"properties,omitempty"`
6521	// Kind - READ-ONLY; Kind of geo backup policy.  This is metadata used for the Azure portal experience.
6522	Kind *string `json:"kind,omitempty"`
6523	// Location - READ-ONLY; Backup policy location.
6524	Location *string `json:"location,omitempty"`
6525	// ID - READ-ONLY; Resource ID.
6526	ID *string `json:"id,omitempty"`
6527	// Name - READ-ONLY; Resource name.
6528	Name *string `json:"name,omitempty"`
6529	// Type - READ-ONLY; Resource type.
6530	Type *string `json:"type,omitempty"`
6531}
6532
6533// MarshalJSON is the custom marshaler for GeoBackupPolicy.
6534func (gbp GeoBackupPolicy) MarshalJSON() ([]byte, error) {
6535	objectMap := make(map[string]interface{})
6536	if gbp.GeoBackupPolicyProperties != nil {
6537		objectMap["properties"] = gbp.GeoBackupPolicyProperties
6538	}
6539	return json.Marshal(objectMap)
6540}
6541
6542// UnmarshalJSON is the custom unmarshaler for GeoBackupPolicy struct.
6543func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error {
6544	var m map[string]*json.RawMessage
6545	err := json.Unmarshal(body, &m)
6546	if err != nil {
6547		return err
6548	}
6549	for k, v := range m {
6550		switch k {
6551		case "properties":
6552			if v != nil {
6553				var geoBackupPolicyProperties GeoBackupPolicyProperties
6554				err = json.Unmarshal(*v, &geoBackupPolicyProperties)
6555				if err != nil {
6556					return err
6557				}
6558				gbp.GeoBackupPolicyProperties = &geoBackupPolicyProperties
6559			}
6560		case "kind":
6561			if v != nil {
6562				var kind string
6563				err = json.Unmarshal(*v, &kind)
6564				if err != nil {
6565					return err
6566				}
6567				gbp.Kind = &kind
6568			}
6569		case "location":
6570			if v != nil {
6571				var location string
6572				err = json.Unmarshal(*v, &location)
6573				if err != nil {
6574					return err
6575				}
6576				gbp.Location = &location
6577			}
6578		case "id":
6579			if v != nil {
6580				var ID string
6581				err = json.Unmarshal(*v, &ID)
6582				if err != nil {
6583					return err
6584				}
6585				gbp.ID = &ID
6586			}
6587		case "name":
6588			if v != nil {
6589				var name string
6590				err = json.Unmarshal(*v, &name)
6591				if err != nil {
6592					return err
6593				}
6594				gbp.Name = &name
6595			}
6596		case "type":
6597			if v != nil {
6598				var typeVar string
6599				err = json.Unmarshal(*v, &typeVar)
6600				if err != nil {
6601					return err
6602				}
6603				gbp.Type = &typeVar
6604			}
6605		}
6606	}
6607
6608	return nil
6609}
6610
6611// GeoBackupPolicyListResult the response to a list geo backup policies request.
6612type GeoBackupPolicyListResult struct {
6613	autorest.Response `json:"-"`
6614	// Value - The list of geo backup policies.
6615	Value *[]GeoBackupPolicy `json:"value,omitempty"`
6616}
6617
6618// GeoBackupPolicyProperties the properties of the geo backup policy.
6619type GeoBackupPolicyProperties struct {
6620	// State - The state of the geo backup policy. Possible values include: 'GeoBackupPolicyStateDisabled', 'GeoBackupPolicyStateEnabled'
6621	State GeoBackupPolicyState `json:"state,omitempty"`
6622	// StorageType - READ-ONLY; The storage type of the geo backup policy.
6623	StorageType *string `json:"storageType,omitempty"`
6624}
6625
6626// MarshalJSON is the custom marshaler for GeoBackupPolicyProperties.
6627func (gbpp GeoBackupPolicyProperties) MarshalJSON() ([]byte, error) {
6628	objectMap := make(map[string]interface{})
6629	if gbpp.State != "" {
6630		objectMap["state"] = gbpp.State
6631	}
6632	return json.Marshal(objectMap)
6633}
6634
6635// ImportExistingDatabaseDefinition contains the information necessary to perform import operation for
6636// existing database.
6637type ImportExistingDatabaseDefinition struct {
6638	// StorageKeyType - Storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey'
6639	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
6640	// StorageKey - Storage key.
6641	StorageKey *string `json:"storageKey,omitempty"`
6642	// StorageURI - Storage Uri.
6643	StorageURI *string `json:"storageUri,omitempty"`
6644	// AdministratorLogin - Administrator login name.
6645	AdministratorLogin *string `json:"administratorLogin,omitempty"`
6646	// AdministratorLoginPassword - Administrator login password.
6647	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
6648	// AuthenticationType - Authentication type.
6649	AuthenticationType *string `json:"authenticationType,omitempty"`
6650	// NetworkIsolation - Optional resource information to enable network isolation for request.
6651	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
6652}
6653
6654// ImportExportImportFuture an abstraction for monitoring and retrieving the results of a long-running
6655// operation.
6656type ImportExportImportFuture struct {
6657	azure.FutureAPI
6658	// Result returns the result of the asynchronous operation.
6659	// If the operation has not completed it will return an error.
6660	Result func(ImportExportClient) (ImportExportOperationResult, error)
6661}
6662
6663// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6664func (future *ImportExportImportFuture) UnmarshalJSON(body []byte) error {
6665	var azFuture azure.Future
6666	if err := json.Unmarshal(body, &azFuture); err != nil {
6667		return err
6668	}
6669	future.FutureAPI = &azFuture
6670	future.Result = future.result
6671	return nil
6672}
6673
6674// result is the default implementation for ImportExportImportFuture.Result.
6675func (future *ImportExportImportFuture) result(client ImportExportClient) (ieor ImportExportOperationResult, err error) {
6676	var done bool
6677	done, err = future.DoneWithContext(context.Background(), client)
6678	if err != nil {
6679		err = autorest.NewErrorWithError(err, "sql.ImportExportImportFuture", "Result", future.Response(), "Polling failure")
6680		return
6681	}
6682	if !done {
6683		ieor.Response.Response = future.Response()
6684		err = azure.NewAsyncOpIncompleteError("sql.ImportExportImportFuture")
6685		return
6686	}
6687	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6688	if ieor.Response.Response, err = future.GetResult(sender); err == nil && ieor.Response.Response.StatusCode != http.StatusNoContent {
6689		ieor, err = client.ImportResponder(ieor.Response.Response)
6690		if err != nil {
6691			err = autorest.NewErrorWithError(err, "sql.ImportExportImportFuture", "Result", ieor.Response.Response, "Failure responding to request")
6692		}
6693	}
6694	return
6695}
6696
6697// ImportExportOperationResult an ImportExport operation result resource.
6698type ImportExportOperationResult struct {
6699	autorest.Response `json:"-"`
6700	// ImportExportOperationResultProperties - Resource properties.
6701	*ImportExportOperationResultProperties `json:"properties,omitempty"`
6702	// ID - READ-ONLY; Resource ID.
6703	ID *string `json:"id,omitempty"`
6704	// Name - READ-ONLY; Resource name.
6705	Name *string `json:"name,omitempty"`
6706	// Type - READ-ONLY; Resource type.
6707	Type *string `json:"type,omitempty"`
6708}
6709
6710// MarshalJSON is the custom marshaler for ImportExportOperationResult.
6711func (ieor ImportExportOperationResult) MarshalJSON() ([]byte, error) {
6712	objectMap := make(map[string]interface{})
6713	if ieor.ImportExportOperationResultProperties != nil {
6714		objectMap["properties"] = ieor.ImportExportOperationResultProperties
6715	}
6716	return json.Marshal(objectMap)
6717}
6718
6719// UnmarshalJSON is the custom unmarshaler for ImportExportOperationResult struct.
6720func (ieor *ImportExportOperationResult) UnmarshalJSON(body []byte) error {
6721	var m map[string]*json.RawMessage
6722	err := json.Unmarshal(body, &m)
6723	if err != nil {
6724		return err
6725	}
6726	for k, v := range m {
6727		switch k {
6728		case "properties":
6729			if v != nil {
6730				var importExportOperationResultProperties ImportExportOperationResultProperties
6731				err = json.Unmarshal(*v, &importExportOperationResultProperties)
6732				if err != nil {
6733					return err
6734				}
6735				ieor.ImportExportOperationResultProperties = &importExportOperationResultProperties
6736			}
6737		case "id":
6738			if v != nil {
6739				var ID string
6740				err = json.Unmarshal(*v, &ID)
6741				if err != nil {
6742					return err
6743				}
6744				ieor.ID = &ID
6745			}
6746		case "name":
6747			if v != nil {
6748				var name string
6749				err = json.Unmarshal(*v, &name)
6750				if err != nil {
6751					return err
6752				}
6753				ieor.Name = &name
6754			}
6755		case "type":
6756			if v != nil {
6757				var typeVar string
6758				err = json.Unmarshal(*v, &typeVar)
6759				if err != nil {
6760					return err
6761				}
6762				ieor.Type = &typeVar
6763			}
6764		}
6765	}
6766
6767	return nil
6768}
6769
6770// ImportExportOperationResultProperties contains the operation result properties for import/export
6771// operation.
6772type ImportExportOperationResultProperties struct {
6773	// RequestID - READ-ONLY; Request Id.
6774	RequestID *uuid.UUID `json:"requestId,omitempty"`
6775	// RequestType - READ-ONLY; Request type.
6776	RequestType *string `json:"requestType,omitempty"`
6777	// QueuedTime - READ-ONLY; Queued time.
6778	QueuedTime *string `json:"queuedTime,omitempty"`
6779	// LastModifiedTime - READ-ONLY; Last modified time.
6780	LastModifiedTime *string `json:"lastModifiedTime,omitempty"`
6781	// BlobURI - READ-ONLY; Blob Uri.
6782	BlobURI *string `json:"blobUri,omitempty"`
6783	// ServerName - READ-ONLY; Server name.
6784	ServerName *string `json:"serverName,omitempty"`
6785	// DatabaseName - READ-ONLY; Database name.
6786	DatabaseName *string `json:"databaseName,omitempty"`
6787	// Status - READ-ONLY; Operation status.
6788	Status *string `json:"status,omitempty"`
6789	// ErrorMessage - READ-ONLY; Error message.
6790	ErrorMessage *string `json:"errorMessage,omitempty"`
6791	// PrivateEndpointConnections - READ-ONLY; Gets the status of private endpoints associated with this request.
6792	PrivateEndpointConnections *[]PrivateEndpointConnectionRequestStatus `json:"privateEndpointConnections,omitempty"`
6793}
6794
6795// MarshalJSON is the custom marshaler for ImportExportOperationResultProperties.
6796func (ieorp ImportExportOperationResultProperties) MarshalJSON() ([]byte, error) {
6797	objectMap := make(map[string]interface{})
6798	return json.Marshal(objectMap)
6799}
6800
6801// ImportNewDatabaseDefinition contains the information necessary to perform import operation for new
6802// database.
6803type ImportNewDatabaseDefinition struct {
6804	// DatabaseName - Name of the import database.
6805	DatabaseName *string `json:"databaseName,omitempty"`
6806	// Edition - Edition of the import database.
6807	Edition *string `json:"edition,omitempty"`
6808	// ServiceObjectiveName - Service level objective name of the import database.
6809	ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"`
6810	// MaxSizeBytes - Max size in bytes for the import database.
6811	MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`
6812	// StorageKeyType - Storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey'
6813	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
6814	// StorageKey - Storage key.
6815	StorageKey *string `json:"storageKey,omitempty"`
6816	// StorageURI - Storage Uri.
6817	StorageURI *string `json:"storageUri,omitempty"`
6818	// AdministratorLogin - Administrator login name.
6819	AdministratorLogin *string `json:"administratorLogin,omitempty"`
6820	// AdministratorLoginPassword - Administrator login password.
6821	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
6822	// AuthenticationType - Authentication type.
6823	AuthenticationType *string `json:"authenticationType,omitempty"`
6824	// NetworkIsolation - Optional resource information to enable network isolation for request.
6825	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
6826}
6827
6828// InstanceFailoverGroup an instance failover group.
6829type InstanceFailoverGroup struct {
6830	autorest.Response `json:"-"`
6831	// InstanceFailoverGroupProperties - Resource properties.
6832	*InstanceFailoverGroupProperties `json:"properties,omitempty"`
6833	// ID - READ-ONLY; Resource ID.
6834	ID *string `json:"id,omitempty"`
6835	// Name - READ-ONLY; Resource name.
6836	Name *string `json:"name,omitempty"`
6837	// Type - READ-ONLY; Resource type.
6838	Type *string `json:"type,omitempty"`
6839}
6840
6841// MarshalJSON is the custom marshaler for InstanceFailoverGroup.
6842func (ifg InstanceFailoverGroup) MarshalJSON() ([]byte, error) {
6843	objectMap := make(map[string]interface{})
6844	if ifg.InstanceFailoverGroupProperties != nil {
6845		objectMap["properties"] = ifg.InstanceFailoverGroupProperties
6846	}
6847	return json.Marshal(objectMap)
6848}
6849
6850// UnmarshalJSON is the custom unmarshaler for InstanceFailoverGroup struct.
6851func (ifg *InstanceFailoverGroup) UnmarshalJSON(body []byte) error {
6852	var m map[string]*json.RawMessage
6853	err := json.Unmarshal(body, &m)
6854	if err != nil {
6855		return err
6856	}
6857	for k, v := range m {
6858		switch k {
6859		case "properties":
6860			if v != nil {
6861				var instanceFailoverGroupProperties InstanceFailoverGroupProperties
6862				err = json.Unmarshal(*v, &instanceFailoverGroupProperties)
6863				if err != nil {
6864					return err
6865				}
6866				ifg.InstanceFailoverGroupProperties = &instanceFailoverGroupProperties
6867			}
6868		case "id":
6869			if v != nil {
6870				var ID string
6871				err = json.Unmarshal(*v, &ID)
6872				if err != nil {
6873					return err
6874				}
6875				ifg.ID = &ID
6876			}
6877		case "name":
6878			if v != nil {
6879				var name string
6880				err = json.Unmarshal(*v, &name)
6881				if err != nil {
6882					return err
6883				}
6884				ifg.Name = &name
6885			}
6886		case "type":
6887			if v != nil {
6888				var typeVar string
6889				err = json.Unmarshal(*v, &typeVar)
6890				if err != nil {
6891					return err
6892				}
6893				ifg.Type = &typeVar
6894			}
6895		}
6896	}
6897
6898	return nil
6899}
6900
6901// InstanceFailoverGroupListResult a list of instance failover groups.
6902type InstanceFailoverGroupListResult struct {
6903	autorest.Response `json:"-"`
6904	// Value - READ-ONLY; Array of results.
6905	Value *[]InstanceFailoverGroup `json:"value,omitempty"`
6906	// NextLink - READ-ONLY; Link to retrieve next page of results.
6907	NextLink *string `json:"nextLink,omitempty"`
6908}
6909
6910// MarshalJSON is the custom marshaler for InstanceFailoverGroupListResult.
6911func (ifglr InstanceFailoverGroupListResult) MarshalJSON() ([]byte, error) {
6912	objectMap := make(map[string]interface{})
6913	return json.Marshal(objectMap)
6914}
6915
6916// InstanceFailoverGroupListResultIterator provides access to a complete listing of InstanceFailoverGroup
6917// values.
6918type InstanceFailoverGroupListResultIterator struct {
6919	i    int
6920	page InstanceFailoverGroupListResultPage
6921}
6922
6923// NextWithContext advances to the next value.  If there was an error making
6924// the request the iterator does not advance and the error is returned.
6925func (iter *InstanceFailoverGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
6926	if tracing.IsEnabled() {
6927		ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupListResultIterator.NextWithContext")
6928		defer func() {
6929			sc := -1
6930			if iter.Response().Response.Response != nil {
6931				sc = iter.Response().Response.Response.StatusCode
6932			}
6933			tracing.EndSpan(ctx, sc, err)
6934		}()
6935	}
6936	iter.i++
6937	if iter.i < len(iter.page.Values()) {
6938		return nil
6939	}
6940	err = iter.page.NextWithContext(ctx)
6941	if err != nil {
6942		iter.i--
6943		return err
6944	}
6945	iter.i = 0
6946	return nil
6947}
6948
6949// Next advances to the next value.  If there was an error making
6950// the request the iterator does not advance and the error is returned.
6951// Deprecated: Use NextWithContext() instead.
6952func (iter *InstanceFailoverGroupListResultIterator) Next() error {
6953	return iter.NextWithContext(context.Background())
6954}
6955
6956// NotDone returns true if the enumeration should be started or is not yet complete.
6957func (iter InstanceFailoverGroupListResultIterator) NotDone() bool {
6958	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6959}
6960
6961// Response returns the raw server response from the last page request.
6962func (iter InstanceFailoverGroupListResultIterator) Response() InstanceFailoverGroupListResult {
6963	return iter.page.Response()
6964}
6965
6966// Value returns the current value or a zero-initialized value if the
6967// iterator has advanced beyond the end of the collection.
6968func (iter InstanceFailoverGroupListResultIterator) Value() InstanceFailoverGroup {
6969	if !iter.page.NotDone() {
6970		return InstanceFailoverGroup{}
6971	}
6972	return iter.page.Values()[iter.i]
6973}
6974
6975// Creates a new instance of the InstanceFailoverGroupListResultIterator type.
6976func NewInstanceFailoverGroupListResultIterator(page InstanceFailoverGroupListResultPage) InstanceFailoverGroupListResultIterator {
6977	return InstanceFailoverGroupListResultIterator{page: page}
6978}
6979
6980// IsEmpty returns true if the ListResult contains no values.
6981func (ifglr InstanceFailoverGroupListResult) IsEmpty() bool {
6982	return ifglr.Value == nil || len(*ifglr.Value) == 0
6983}
6984
6985// hasNextLink returns true if the NextLink is not empty.
6986func (ifglr InstanceFailoverGroupListResult) hasNextLink() bool {
6987	return ifglr.NextLink != nil && len(*ifglr.NextLink) != 0
6988}
6989
6990// instanceFailoverGroupListResultPreparer prepares a request to retrieve the next set of results.
6991// It returns nil if no more results exist.
6992func (ifglr InstanceFailoverGroupListResult) instanceFailoverGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
6993	if !ifglr.hasNextLink() {
6994		return nil, nil
6995	}
6996	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6997		autorest.AsJSON(),
6998		autorest.AsGet(),
6999		autorest.WithBaseURL(to.String(ifglr.NextLink)))
7000}
7001
7002// InstanceFailoverGroupListResultPage contains a page of InstanceFailoverGroup values.
7003type InstanceFailoverGroupListResultPage struct {
7004	fn    func(context.Context, InstanceFailoverGroupListResult) (InstanceFailoverGroupListResult, error)
7005	ifglr InstanceFailoverGroupListResult
7006}
7007
7008// NextWithContext advances to the next page of values.  If there was an error making
7009// the request the page does not advance and the error is returned.
7010func (page *InstanceFailoverGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
7011	if tracing.IsEnabled() {
7012		ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupListResultPage.NextWithContext")
7013		defer func() {
7014			sc := -1
7015			if page.Response().Response.Response != nil {
7016				sc = page.Response().Response.Response.StatusCode
7017			}
7018			tracing.EndSpan(ctx, sc, err)
7019		}()
7020	}
7021	for {
7022		next, err := page.fn(ctx, page.ifglr)
7023		if err != nil {
7024			return err
7025		}
7026		page.ifglr = next
7027		if !next.hasNextLink() || !next.IsEmpty() {
7028			break
7029		}
7030	}
7031	return nil
7032}
7033
7034// Next advances to the next page of values.  If there was an error making
7035// the request the page does not advance and the error is returned.
7036// Deprecated: Use NextWithContext() instead.
7037func (page *InstanceFailoverGroupListResultPage) Next() error {
7038	return page.NextWithContext(context.Background())
7039}
7040
7041// NotDone returns true if the page enumeration should be started or is not yet complete.
7042func (page InstanceFailoverGroupListResultPage) NotDone() bool {
7043	return !page.ifglr.IsEmpty()
7044}
7045
7046// Response returns the raw server response from the last page request.
7047func (page InstanceFailoverGroupListResultPage) Response() InstanceFailoverGroupListResult {
7048	return page.ifglr
7049}
7050
7051// Values returns the slice of values for the current page or nil if there are no values.
7052func (page InstanceFailoverGroupListResultPage) Values() []InstanceFailoverGroup {
7053	if page.ifglr.IsEmpty() {
7054		return nil
7055	}
7056	return *page.ifglr.Value
7057}
7058
7059// Creates a new instance of the InstanceFailoverGroupListResultPage type.
7060func NewInstanceFailoverGroupListResultPage(cur InstanceFailoverGroupListResult, getNextPage func(context.Context, InstanceFailoverGroupListResult) (InstanceFailoverGroupListResult, error)) InstanceFailoverGroupListResultPage {
7061	return InstanceFailoverGroupListResultPage{
7062		fn:    getNextPage,
7063		ifglr: cur,
7064	}
7065}
7066
7067// InstanceFailoverGroupProperties properties of a instance failover group.
7068type InstanceFailoverGroupProperties struct {
7069	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
7070	ReadWriteEndpoint *InstanceFailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
7071	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
7072	ReadOnlyEndpoint *InstanceFailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
7073	// ReplicationRole - READ-ONLY; Local replication role of the failover group instance. Possible values include: 'InstanceFailoverGroupReplicationRolePrimary', 'InstanceFailoverGroupReplicationRoleSecondary'
7074	ReplicationRole InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty"`
7075	// ReplicationState - READ-ONLY; Replication state of the failover group instance.
7076	ReplicationState *string `json:"replicationState,omitempty"`
7077	// PartnerRegions - Partner region information for the failover group.
7078	PartnerRegions *[]PartnerRegionInfo `json:"partnerRegions,omitempty"`
7079	// ManagedInstancePairs - List of managed instance pairs in the failover group.
7080	ManagedInstancePairs *[]ManagedInstancePairInfo `json:"managedInstancePairs,omitempty"`
7081}
7082
7083// MarshalJSON is the custom marshaler for InstanceFailoverGroupProperties.
7084func (ifgp InstanceFailoverGroupProperties) MarshalJSON() ([]byte, error) {
7085	objectMap := make(map[string]interface{})
7086	if ifgp.ReadWriteEndpoint != nil {
7087		objectMap["readWriteEndpoint"] = ifgp.ReadWriteEndpoint
7088	}
7089	if ifgp.ReadOnlyEndpoint != nil {
7090		objectMap["readOnlyEndpoint"] = ifgp.ReadOnlyEndpoint
7091	}
7092	if ifgp.PartnerRegions != nil {
7093		objectMap["partnerRegions"] = ifgp.PartnerRegions
7094	}
7095	if ifgp.ManagedInstancePairs != nil {
7096		objectMap["managedInstancePairs"] = ifgp.ManagedInstancePairs
7097	}
7098	return json.Marshal(objectMap)
7099}
7100
7101// InstanceFailoverGroupReadOnlyEndpoint read-only endpoint of the failover group instance.
7102type InstanceFailoverGroupReadOnlyEndpoint struct {
7103	// FailoverPolicy - Failover policy of the read-only endpoint for the failover group. Possible values include: 'ReadOnlyEndpointFailoverPolicyDisabled', 'ReadOnlyEndpointFailoverPolicyEnabled'
7104	FailoverPolicy ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
7105}
7106
7107// InstanceFailoverGroupReadWriteEndpoint read-write endpoint of the failover group instance.
7108type InstanceFailoverGroupReadWriteEndpoint struct {
7109	// 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'
7110	FailoverPolicy ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
7111	// FailoverWithDataLossGracePeriodMinutes - Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
7112	FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
7113}
7114
7115// InstanceFailoverGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
7116// long-running operation.
7117type InstanceFailoverGroupsCreateOrUpdateFuture struct {
7118	azure.FutureAPI
7119	// Result returns the result of the asynchronous operation.
7120	// If the operation has not completed it will return an error.
7121	Result func(InstanceFailoverGroupsClient) (InstanceFailoverGroup, error)
7122}
7123
7124// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7125func (future *InstanceFailoverGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
7126	var azFuture azure.Future
7127	if err := json.Unmarshal(body, &azFuture); err != nil {
7128		return err
7129	}
7130	future.FutureAPI = &azFuture
7131	future.Result = future.result
7132	return nil
7133}
7134
7135// result is the default implementation for InstanceFailoverGroupsCreateOrUpdateFuture.Result.
7136func (future *InstanceFailoverGroupsCreateOrUpdateFuture) result(client InstanceFailoverGroupsClient) (ifg InstanceFailoverGroup, err error) {
7137	var done bool
7138	done, err = future.DoneWithContext(context.Background(), client)
7139	if err != nil {
7140		err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
7141		return
7142	}
7143	if !done {
7144		ifg.Response.Response = future.Response()
7145		err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsCreateOrUpdateFuture")
7146		return
7147	}
7148	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7149	if ifg.Response.Response, err = future.GetResult(sender); err == nil && ifg.Response.Response.StatusCode != http.StatusNoContent {
7150		ifg, err = client.CreateOrUpdateResponder(ifg.Response.Response)
7151		if err != nil {
7152			err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsCreateOrUpdateFuture", "Result", ifg.Response.Response, "Failure responding to request")
7153		}
7154	}
7155	return
7156}
7157
7158// InstanceFailoverGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a
7159// long-running operation.
7160type InstanceFailoverGroupsDeleteFuture struct {
7161	azure.FutureAPI
7162	// Result returns the result of the asynchronous operation.
7163	// If the operation has not completed it will return an error.
7164	Result func(InstanceFailoverGroupsClient) (autorest.Response, error)
7165}
7166
7167// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7168func (future *InstanceFailoverGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
7169	var azFuture azure.Future
7170	if err := json.Unmarshal(body, &azFuture); err != nil {
7171		return err
7172	}
7173	future.FutureAPI = &azFuture
7174	future.Result = future.result
7175	return nil
7176}
7177
7178// result is the default implementation for InstanceFailoverGroupsDeleteFuture.Result.
7179func (future *InstanceFailoverGroupsDeleteFuture) result(client InstanceFailoverGroupsClient) (ar autorest.Response, err error) {
7180	var done bool
7181	done, err = future.DoneWithContext(context.Background(), client)
7182	if err != nil {
7183		err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
7184		return
7185	}
7186	if !done {
7187		ar.Response = future.Response()
7188		err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsDeleteFuture")
7189		return
7190	}
7191	ar.Response = future.Response()
7192	return
7193}
7194
7195// InstanceFailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a
7196// long-running operation.
7197type InstanceFailoverGroupsFailoverFuture struct {
7198	azure.FutureAPI
7199	// Result returns the result of the asynchronous operation.
7200	// If the operation has not completed it will return an error.
7201	Result func(InstanceFailoverGroupsClient) (InstanceFailoverGroup, error)
7202}
7203
7204// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7205func (future *InstanceFailoverGroupsFailoverFuture) UnmarshalJSON(body []byte) error {
7206	var azFuture azure.Future
7207	if err := json.Unmarshal(body, &azFuture); err != nil {
7208		return err
7209	}
7210	future.FutureAPI = &azFuture
7211	future.Result = future.result
7212	return nil
7213}
7214
7215// result is the default implementation for InstanceFailoverGroupsFailoverFuture.Result.
7216func (future *InstanceFailoverGroupsFailoverFuture) result(client InstanceFailoverGroupsClient) (ifg InstanceFailoverGroup, err error) {
7217	var done bool
7218	done, err = future.DoneWithContext(context.Background(), client)
7219	if err != nil {
7220		err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsFailoverFuture", "Result", future.Response(), "Polling failure")
7221		return
7222	}
7223	if !done {
7224		ifg.Response.Response = future.Response()
7225		err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsFailoverFuture")
7226		return
7227	}
7228	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7229	if ifg.Response.Response, err = future.GetResult(sender); err == nil && ifg.Response.Response.StatusCode != http.StatusNoContent {
7230		ifg, err = client.FailoverResponder(ifg.Response.Response)
7231		if err != nil {
7232			err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsFailoverFuture", "Result", ifg.Response.Response, "Failure responding to request")
7233		}
7234	}
7235	return
7236}
7237
7238// InstanceFailoverGroupsForceFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the
7239// results of a long-running operation.
7240type InstanceFailoverGroupsForceFailoverAllowDataLossFuture struct {
7241	azure.FutureAPI
7242	// Result returns the result of the asynchronous operation.
7243	// If the operation has not completed it will return an error.
7244	Result func(InstanceFailoverGroupsClient) (InstanceFailoverGroup, error)
7245}
7246
7247// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7248func (future *InstanceFailoverGroupsForceFailoverAllowDataLossFuture) UnmarshalJSON(body []byte) error {
7249	var azFuture azure.Future
7250	if err := json.Unmarshal(body, &azFuture); err != nil {
7251		return err
7252	}
7253	future.FutureAPI = &azFuture
7254	future.Result = future.result
7255	return nil
7256}
7257
7258// result is the default implementation for InstanceFailoverGroupsForceFailoverAllowDataLossFuture.Result.
7259func (future *InstanceFailoverGroupsForceFailoverAllowDataLossFuture) result(client InstanceFailoverGroupsClient) (ifg InstanceFailoverGroup, err error) {
7260	var done bool
7261	done, err = future.DoneWithContext(context.Background(), client)
7262	if err != nil {
7263		err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure")
7264		return
7265	}
7266	if !done {
7267		ifg.Response.Response = future.Response()
7268		err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture")
7269		return
7270	}
7271	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7272	if ifg.Response.Response, err = future.GetResult(sender); err == nil && ifg.Response.Response.StatusCode != http.StatusNoContent {
7273		ifg, err = client.ForceFailoverAllowDataLossResponder(ifg.Response.Response)
7274		if err != nil {
7275			err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture", "Result", ifg.Response.Response, "Failure responding to request")
7276		}
7277	}
7278	return
7279}
7280
7281// InstancePool an Azure SQL instance pool.
7282type InstancePool struct {
7283	autorest.Response `json:"-"`
7284	// Sku - The name and tier of the SKU.
7285	Sku *Sku `json:"sku,omitempty"`
7286	// InstancePoolProperties - Resource properties.
7287	*InstancePoolProperties `json:"properties,omitempty"`
7288	// Location - Resource location.
7289	Location *string `json:"location,omitempty"`
7290	// Tags - Resource tags.
7291	Tags map[string]*string `json:"tags"`
7292	// ID - READ-ONLY; Resource ID.
7293	ID *string `json:"id,omitempty"`
7294	// Name - READ-ONLY; Resource name.
7295	Name *string `json:"name,omitempty"`
7296	// Type - READ-ONLY; Resource type.
7297	Type *string `json:"type,omitempty"`
7298}
7299
7300// MarshalJSON is the custom marshaler for InstancePool.
7301func (IP InstancePool) MarshalJSON() ([]byte, error) {
7302	objectMap := make(map[string]interface{})
7303	if IP.Sku != nil {
7304		objectMap["sku"] = IP.Sku
7305	}
7306	if IP.InstancePoolProperties != nil {
7307		objectMap["properties"] = IP.InstancePoolProperties
7308	}
7309	if IP.Location != nil {
7310		objectMap["location"] = IP.Location
7311	}
7312	if IP.Tags != nil {
7313		objectMap["tags"] = IP.Tags
7314	}
7315	return json.Marshal(objectMap)
7316}
7317
7318// UnmarshalJSON is the custom unmarshaler for InstancePool struct.
7319func (IP *InstancePool) UnmarshalJSON(body []byte) error {
7320	var m map[string]*json.RawMessage
7321	err := json.Unmarshal(body, &m)
7322	if err != nil {
7323		return err
7324	}
7325	for k, v := range m {
7326		switch k {
7327		case "sku":
7328			if v != nil {
7329				var sku Sku
7330				err = json.Unmarshal(*v, &sku)
7331				if err != nil {
7332					return err
7333				}
7334				IP.Sku = &sku
7335			}
7336		case "properties":
7337			if v != nil {
7338				var instancePoolProperties InstancePoolProperties
7339				err = json.Unmarshal(*v, &instancePoolProperties)
7340				if err != nil {
7341					return err
7342				}
7343				IP.InstancePoolProperties = &instancePoolProperties
7344			}
7345		case "location":
7346			if v != nil {
7347				var location string
7348				err = json.Unmarshal(*v, &location)
7349				if err != nil {
7350					return err
7351				}
7352				IP.Location = &location
7353			}
7354		case "tags":
7355			if v != nil {
7356				var tags map[string]*string
7357				err = json.Unmarshal(*v, &tags)
7358				if err != nil {
7359					return err
7360				}
7361				IP.Tags = tags
7362			}
7363		case "id":
7364			if v != nil {
7365				var ID string
7366				err = json.Unmarshal(*v, &ID)
7367				if err != nil {
7368					return err
7369				}
7370				IP.ID = &ID
7371			}
7372		case "name":
7373			if v != nil {
7374				var name string
7375				err = json.Unmarshal(*v, &name)
7376				if err != nil {
7377					return err
7378				}
7379				IP.Name = &name
7380			}
7381		case "type":
7382			if v != nil {
7383				var typeVar string
7384				err = json.Unmarshal(*v, &typeVar)
7385				if err != nil {
7386					return err
7387				}
7388				IP.Type = &typeVar
7389			}
7390		}
7391	}
7392
7393	return nil
7394}
7395
7396// InstancePoolEditionCapability the instance pool capability
7397type InstancePoolEditionCapability struct {
7398	// Name - READ-ONLY; The instance pool version name.
7399	Name *string `json:"name,omitempty"`
7400	// SupportedFamilies - READ-ONLY; The supported families.
7401	SupportedFamilies *[]InstancePoolFamilyCapability `json:"supportedFamilies,omitempty"`
7402	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
7403	Status CapabilityStatus `json:"status,omitempty"`
7404	// Reason - The reason for the capability not being available.
7405	Reason *string `json:"reason,omitempty"`
7406}
7407
7408// MarshalJSON is the custom marshaler for InstancePoolEditionCapability.
7409func (ipec InstancePoolEditionCapability) MarshalJSON() ([]byte, error) {
7410	objectMap := make(map[string]interface{})
7411	if ipec.Reason != nil {
7412		objectMap["reason"] = ipec.Reason
7413	}
7414	return json.Marshal(objectMap)
7415}
7416
7417// InstancePoolFamilyCapability the instance pool family capability.
7418type InstancePoolFamilyCapability struct {
7419	// Name - READ-ONLY; Family name.
7420	Name *string `json:"name,omitempty"`
7421	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
7422	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
7423	// SupportedVcoresValues - READ-ONLY; List of supported virtual cores values.
7424	SupportedVcoresValues *[]InstancePoolVcoresCapability `json:"supportedVcoresValues,omitempty"`
7425	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
7426	Status CapabilityStatus `json:"status,omitempty"`
7427	// Reason - The reason for the capability not being available.
7428	Reason *string `json:"reason,omitempty"`
7429}
7430
7431// MarshalJSON is the custom marshaler for InstancePoolFamilyCapability.
7432func (ipfc InstancePoolFamilyCapability) MarshalJSON() ([]byte, error) {
7433	objectMap := make(map[string]interface{})
7434	if ipfc.Reason != nil {
7435		objectMap["reason"] = ipfc.Reason
7436	}
7437	return json.Marshal(objectMap)
7438}
7439
7440// InstancePoolListResult a list of Azure SQL instance pools.
7441type InstancePoolListResult struct {
7442	autorest.Response `json:"-"`
7443	// Value - READ-ONLY; Array of results.
7444	Value *[]InstancePool `json:"value,omitempty"`
7445	// NextLink - READ-ONLY; Link to retrieve next page of results.
7446	NextLink *string `json:"nextLink,omitempty"`
7447}
7448
7449// MarshalJSON is the custom marshaler for InstancePoolListResult.
7450func (iplr InstancePoolListResult) MarshalJSON() ([]byte, error) {
7451	objectMap := make(map[string]interface{})
7452	return json.Marshal(objectMap)
7453}
7454
7455// InstancePoolListResultIterator provides access to a complete listing of InstancePool values.
7456type InstancePoolListResultIterator struct {
7457	i    int
7458	page InstancePoolListResultPage
7459}
7460
7461// NextWithContext advances to the next value.  If there was an error making
7462// the request the iterator does not advance and the error is returned.
7463func (iter *InstancePoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
7464	if tracing.IsEnabled() {
7465		ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolListResultIterator.NextWithContext")
7466		defer func() {
7467			sc := -1
7468			if iter.Response().Response.Response != nil {
7469				sc = iter.Response().Response.Response.StatusCode
7470			}
7471			tracing.EndSpan(ctx, sc, err)
7472		}()
7473	}
7474	iter.i++
7475	if iter.i < len(iter.page.Values()) {
7476		return nil
7477	}
7478	err = iter.page.NextWithContext(ctx)
7479	if err != nil {
7480		iter.i--
7481		return err
7482	}
7483	iter.i = 0
7484	return nil
7485}
7486
7487// Next advances to the next value.  If there was an error making
7488// the request the iterator does not advance and the error is returned.
7489// Deprecated: Use NextWithContext() instead.
7490func (iter *InstancePoolListResultIterator) Next() error {
7491	return iter.NextWithContext(context.Background())
7492}
7493
7494// NotDone returns true if the enumeration should be started or is not yet complete.
7495func (iter InstancePoolListResultIterator) NotDone() bool {
7496	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7497}
7498
7499// Response returns the raw server response from the last page request.
7500func (iter InstancePoolListResultIterator) Response() InstancePoolListResult {
7501	return iter.page.Response()
7502}
7503
7504// Value returns the current value or a zero-initialized value if the
7505// iterator has advanced beyond the end of the collection.
7506func (iter InstancePoolListResultIterator) Value() InstancePool {
7507	if !iter.page.NotDone() {
7508		return InstancePool{}
7509	}
7510	return iter.page.Values()[iter.i]
7511}
7512
7513// Creates a new instance of the InstancePoolListResultIterator type.
7514func NewInstancePoolListResultIterator(page InstancePoolListResultPage) InstancePoolListResultIterator {
7515	return InstancePoolListResultIterator{page: page}
7516}
7517
7518// IsEmpty returns true if the ListResult contains no values.
7519func (iplr InstancePoolListResult) IsEmpty() bool {
7520	return iplr.Value == nil || len(*iplr.Value) == 0
7521}
7522
7523// hasNextLink returns true if the NextLink is not empty.
7524func (iplr InstancePoolListResult) hasNextLink() bool {
7525	return iplr.NextLink != nil && len(*iplr.NextLink) != 0
7526}
7527
7528// instancePoolListResultPreparer prepares a request to retrieve the next set of results.
7529// It returns nil if no more results exist.
7530func (iplr InstancePoolListResult) instancePoolListResultPreparer(ctx context.Context) (*http.Request, error) {
7531	if !iplr.hasNextLink() {
7532		return nil, nil
7533	}
7534	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7535		autorest.AsJSON(),
7536		autorest.AsGet(),
7537		autorest.WithBaseURL(to.String(iplr.NextLink)))
7538}
7539
7540// InstancePoolListResultPage contains a page of InstancePool values.
7541type InstancePoolListResultPage struct {
7542	fn   func(context.Context, InstancePoolListResult) (InstancePoolListResult, error)
7543	iplr InstancePoolListResult
7544}
7545
7546// NextWithContext advances to the next page of values.  If there was an error making
7547// the request the page does not advance and the error is returned.
7548func (page *InstancePoolListResultPage) NextWithContext(ctx context.Context) (err error) {
7549	if tracing.IsEnabled() {
7550		ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolListResultPage.NextWithContext")
7551		defer func() {
7552			sc := -1
7553			if page.Response().Response.Response != nil {
7554				sc = page.Response().Response.Response.StatusCode
7555			}
7556			tracing.EndSpan(ctx, sc, err)
7557		}()
7558	}
7559	for {
7560		next, err := page.fn(ctx, page.iplr)
7561		if err != nil {
7562			return err
7563		}
7564		page.iplr = next
7565		if !next.hasNextLink() || !next.IsEmpty() {
7566			break
7567		}
7568	}
7569	return nil
7570}
7571
7572// Next advances to the next page of values.  If there was an error making
7573// the request the page does not advance and the error is returned.
7574// Deprecated: Use NextWithContext() instead.
7575func (page *InstancePoolListResultPage) Next() error {
7576	return page.NextWithContext(context.Background())
7577}
7578
7579// NotDone returns true if the page enumeration should be started or is not yet complete.
7580func (page InstancePoolListResultPage) NotDone() bool {
7581	return !page.iplr.IsEmpty()
7582}
7583
7584// Response returns the raw server response from the last page request.
7585func (page InstancePoolListResultPage) Response() InstancePoolListResult {
7586	return page.iplr
7587}
7588
7589// Values returns the slice of values for the current page or nil if there are no values.
7590func (page InstancePoolListResultPage) Values() []InstancePool {
7591	if page.iplr.IsEmpty() {
7592		return nil
7593	}
7594	return *page.iplr.Value
7595}
7596
7597// Creates a new instance of the InstancePoolListResultPage type.
7598func NewInstancePoolListResultPage(cur InstancePoolListResult, getNextPage func(context.Context, InstancePoolListResult) (InstancePoolListResult, error)) InstancePoolListResultPage {
7599	return InstancePoolListResultPage{
7600		fn:   getNextPage,
7601		iplr: cur,
7602	}
7603}
7604
7605// InstancePoolProperties properties of an instance pool.
7606type InstancePoolProperties struct {
7607	// SubnetID - Resource ID of the subnet to place this instance pool in.
7608	SubnetID *string `json:"subnetId,omitempty"`
7609	// VCores - Count of vCores belonging to this instance pool.
7610	VCores *int32 `json:"vCores,omitempty"`
7611	// 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'
7612	LicenseType InstancePoolLicenseType `json:"licenseType,omitempty"`
7613}
7614
7615// InstancePoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
7616// long-running operation.
7617type InstancePoolsCreateOrUpdateFuture struct {
7618	azure.FutureAPI
7619	// Result returns the result of the asynchronous operation.
7620	// If the operation has not completed it will return an error.
7621	Result func(InstancePoolsClient) (InstancePool, error)
7622}
7623
7624// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7625func (future *InstancePoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
7626	var azFuture azure.Future
7627	if err := json.Unmarshal(body, &azFuture); err != nil {
7628		return err
7629	}
7630	future.FutureAPI = &azFuture
7631	future.Result = future.result
7632	return nil
7633}
7634
7635// result is the default implementation for InstancePoolsCreateOrUpdateFuture.Result.
7636func (future *InstancePoolsCreateOrUpdateFuture) result(client InstancePoolsClient) (IP InstancePool, err error) {
7637	var done bool
7638	done, err = future.DoneWithContext(context.Background(), client)
7639	if err != nil {
7640		err = autorest.NewErrorWithError(err, "sql.InstancePoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
7641		return
7642	}
7643	if !done {
7644		IP.Response.Response = future.Response()
7645		err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsCreateOrUpdateFuture")
7646		return
7647	}
7648	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7649	if IP.Response.Response, err = future.GetResult(sender); err == nil && IP.Response.Response.StatusCode != http.StatusNoContent {
7650		IP, err = client.CreateOrUpdateResponder(IP.Response.Response)
7651		if err != nil {
7652			err = autorest.NewErrorWithError(err, "sql.InstancePoolsCreateOrUpdateFuture", "Result", IP.Response.Response, "Failure responding to request")
7653		}
7654	}
7655	return
7656}
7657
7658// InstancePoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
7659// operation.
7660type InstancePoolsDeleteFuture struct {
7661	azure.FutureAPI
7662	// Result returns the result of the asynchronous operation.
7663	// If the operation has not completed it will return an error.
7664	Result func(InstancePoolsClient) (autorest.Response, error)
7665}
7666
7667// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7668func (future *InstancePoolsDeleteFuture) UnmarshalJSON(body []byte) error {
7669	var azFuture azure.Future
7670	if err := json.Unmarshal(body, &azFuture); err != nil {
7671		return err
7672	}
7673	future.FutureAPI = &azFuture
7674	future.Result = future.result
7675	return nil
7676}
7677
7678// result is the default implementation for InstancePoolsDeleteFuture.Result.
7679func (future *InstancePoolsDeleteFuture) result(client InstancePoolsClient) (ar autorest.Response, err error) {
7680	var done bool
7681	done, err = future.DoneWithContext(context.Background(), client)
7682	if err != nil {
7683		err = autorest.NewErrorWithError(err, "sql.InstancePoolsDeleteFuture", "Result", future.Response(), "Polling failure")
7684		return
7685	}
7686	if !done {
7687		ar.Response = future.Response()
7688		err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsDeleteFuture")
7689		return
7690	}
7691	ar.Response = future.Response()
7692	return
7693}
7694
7695// InstancePoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
7696// operation.
7697type InstancePoolsUpdateFuture struct {
7698	azure.FutureAPI
7699	// Result returns the result of the asynchronous operation.
7700	// If the operation has not completed it will return an error.
7701	Result func(InstancePoolsClient) (InstancePool, error)
7702}
7703
7704// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7705func (future *InstancePoolsUpdateFuture) UnmarshalJSON(body []byte) error {
7706	var azFuture azure.Future
7707	if err := json.Unmarshal(body, &azFuture); err != nil {
7708		return err
7709	}
7710	future.FutureAPI = &azFuture
7711	future.Result = future.result
7712	return nil
7713}
7714
7715// result is the default implementation for InstancePoolsUpdateFuture.Result.
7716func (future *InstancePoolsUpdateFuture) result(client InstancePoolsClient) (IP InstancePool, err error) {
7717	var done bool
7718	done, err = future.DoneWithContext(context.Background(), client)
7719	if err != nil {
7720		err = autorest.NewErrorWithError(err, "sql.InstancePoolsUpdateFuture", "Result", future.Response(), "Polling failure")
7721		return
7722	}
7723	if !done {
7724		IP.Response.Response = future.Response()
7725		err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsUpdateFuture")
7726		return
7727	}
7728	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7729	if IP.Response.Response, err = future.GetResult(sender); err == nil && IP.Response.Response.StatusCode != http.StatusNoContent {
7730		IP, err = client.UpdateResponder(IP.Response.Response)
7731		if err != nil {
7732			err = autorest.NewErrorWithError(err, "sql.InstancePoolsUpdateFuture", "Result", IP.Response.Response, "Failure responding to request")
7733		}
7734	}
7735	return
7736}
7737
7738// InstancePoolUpdate an update to an Instance pool.
7739type InstancePoolUpdate struct {
7740	// Tags - Resource tags.
7741	Tags map[string]*string `json:"tags"`
7742}
7743
7744// MarshalJSON is the custom marshaler for InstancePoolUpdate.
7745func (ipu InstancePoolUpdate) MarshalJSON() ([]byte, error) {
7746	objectMap := make(map[string]interface{})
7747	if ipu.Tags != nil {
7748		objectMap["tags"] = ipu.Tags
7749	}
7750	return json.Marshal(objectMap)
7751}
7752
7753// InstancePoolVcoresCapability the managed instance virtual cores capability.
7754type InstancePoolVcoresCapability struct {
7755	// Name - READ-ONLY; The virtual cores identifier.
7756	Name *string `json:"name,omitempty"`
7757	// Value - READ-ONLY; The virtual cores value.
7758	Value *int32 `json:"value,omitempty"`
7759	// StorageLimit - READ-ONLY; Storage limit.
7760	StorageLimit *MaxSizeCapability `json:"storageLimit,omitempty"`
7761	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
7762	Status CapabilityStatus `json:"status,omitempty"`
7763	// Reason - The reason for the capability not being available.
7764	Reason *string `json:"reason,omitempty"`
7765}
7766
7767// MarshalJSON is the custom marshaler for InstancePoolVcoresCapability.
7768func (ipvc InstancePoolVcoresCapability) MarshalJSON() ([]byte, error) {
7769	objectMap := make(map[string]interface{})
7770	if ipvc.Reason != nil {
7771		objectMap["reason"] = ipvc.Reason
7772	}
7773	return json.Marshal(objectMap)
7774}
7775
7776// Job a job.
7777type Job struct {
7778	autorest.Response `json:"-"`
7779	// JobProperties - Resource properties.
7780	*JobProperties `json:"properties,omitempty"`
7781	// ID - READ-ONLY; Resource ID.
7782	ID *string `json:"id,omitempty"`
7783	// Name - READ-ONLY; Resource name.
7784	Name *string `json:"name,omitempty"`
7785	// Type - READ-ONLY; Resource type.
7786	Type *string `json:"type,omitempty"`
7787}
7788
7789// MarshalJSON is the custom marshaler for Job.
7790func (j Job) MarshalJSON() ([]byte, error) {
7791	objectMap := make(map[string]interface{})
7792	if j.JobProperties != nil {
7793		objectMap["properties"] = j.JobProperties
7794	}
7795	return json.Marshal(objectMap)
7796}
7797
7798// UnmarshalJSON is the custom unmarshaler for Job struct.
7799func (j *Job) UnmarshalJSON(body []byte) error {
7800	var m map[string]*json.RawMessage
7801	err := json.Unmarshal(body, &m)
7802	if err != nil {
7803		return err
7804	}
7805	for k, v := range m {
7806		switch k {
7807		case "properties":
7808			if v != nil {
7809				var jobProperties JobProperties
7810				err = json.Unmarshal(*v, &jobProperties)
7811				if err != nil {
7812					return err
7813				}
7814				j.JobProperties = &jobProperties
7815			}
7816		case "id":
7817			if v != nil {
7818				var ID string
7819				err = json.Unmarshal(*v, &ID)
7820				if err != nil {
7821					return err
7822				}
7823				j.ID = &ID
7824			}
7825		case "name":
7826			if v != nil {
7827				var name string
7828				err = json.Unmarshal(*v, &name)
7829				if err != nil {
7830					return err
7831				}
7832				j.Name = &name
7833			}
7834		case "type":
7835			if v != nil {
7836				var typeVar string
7837				err = json.Unmarshal(*v, &typeVar)
7838				if err != nil {
7839					return err
7840				}
7841				j.Type = &typeVar
7842			}
7843		}
7844	}
7845
7846	return nil
7847}
7848
7849// JobAgent an Azure SQL job agent.
7850type JobAgent struct {
7851	autorest.Response `json:"-"`
7852	// Sku - The name and tier of the SKU.
7853	Sku *Sku `json:"sku,omitempty"`
7854	// JobAgentProperties - Resource properties.
7855	*JobAgentProperties `json:"properties,omitempty"`
7856	// Location - Resource location.
7857	Location *string `json:"location,omitempty"`
7858	// Tags - Resource tags.
7859	Tags map[string]*string `json:"tags"`
7860	// ID - READ-ONLY; Resource ID.
7861	ID *string `json:"id,omitempty"`
7862	// Name - READ-ONLY; Resource name.
7863	Name *string `json:"name,omitempty"`
7864	// Type - READ-ONLY; Resource type.
7865	Type *string `json:"type,omitempty"`
7866}
7867
7868// MarshalJSON is the custom marshaler for JobAgent.
7869func (ja JobAgent) MarshalJSON() ([]byte, error) {
7870	objectMap := make(map[string]interface{})
7871	if ja.Sku != nil {
7872		objectMap["sku"] = ja.Sku
7873	}
7874	if ja.JobAgentProperties != nil {
7875		objectMap["properties"] = ja.JobAgentProperties
7876	}
7877	if ja.Location != nil {
7878		objectMap["location"] = ja.Location
7879	}
7880	if ja.Tags != nil {
7881		objectMap["tags"] = ja.Tags
7882	}
7883	return json.Marshal(objectMap)
7884}
7885
7886// UnmarshalJSON is the custom unmarshaler for JobAgent struct.
7887func (ja *JobAgent) UnmarshalJSON(body []byte) error {
7888	var m map[string]*json.RawMessage
7889	err := json.Unmarshal(body, &m)
7890	if err != nil {
7891		return err
7892	}
7893	for k, v := range m {
7894		switch k {
7895		case "sku":
7896			if v != nil {
7897				var sku Sku
7898				err = json.Unmarshal(*v, &sku)
7899				if err != nil {
7900					return err
7901				}
7902				ja.Sku = &sku
7903			}
7904		case "properties":
7905			if v != nil {
7906				var jobAgentProperties JobAgentProperties
7907				err = json.Unmarshal(*v, &jobAgentProperties)
7908				if err != nil {
7909					return err
7910				}
7911				ja.JobAgentProperties = &jobAgentProperties
7912			}
7913		case "location":
7914			if v != nil {
7915				var location string
7916				err = json.Unmarshal(*v, &location)
7917				if err != nil {
7918					return err
7919				}
7920				ja.Location = &location
7921			}
7922		case "tags":
7923			if v != nil {
7924				var tags map[string]*string
7925				err = json.Unmarshal(*v, &tags)
7926				if err != nil {
7927					return err
7928				}
7929				ja.Tags = tags
7930			}
7931		case "id":
7932			if v != nil {
7933				var ID string
7934				err = json.Unmarshal(*v, &ID)
7935				if err != nil {
7936					return err
7937				}
7938				ja.ID = &ID
7939			}
7940		case "name":
7941			if v != nil {
7942				var name string
7943				err = json.Unmarshal(*v, &name)
7944				if err != nil {
7945					return err
7946				}
7947				ja.Name = &name
7948			}
7949		case "type":
7950			if v != nil {
7951				var typeVar string
7952				err = json.Unmarshal(*v, &typeVar)
7953				if err != nil {
7954					return err
7955				}
7956				ja.Type = &typeVar
7957			}
7958		}
7959	}
7960
7961	return nil
7962}
7963
7964// JobAgentListResult a list of Azure SQL job agents.
7965type JobAgentListResult struct {
7966	autorest.Response `json:"-"`
7967	// Value - READ-ONLY; Array of results.
7968	Value *[]JobAgent `json:"value,omitempty"`
7969	// NextLink - READ-ONLY; Link to retrieve next page of results.
7970	NextLink *string `json:"nextLink,omitempty"`
7971}
7972
7973// MarshalJSON is the custom marshaler for JobAgentListResult.
7974func (jalr JobAgentListResult) MarshalJSON() ([]byte, error) {
7975	objectMap := make(map[string]interface{})
7976	return json.Marshal(objectMap)
7977}
7978
7979// JobAgentListResultIterator provides access to a complete listing of JobAgent values.
7980type JobAgentListResultIterator struct {
7981	i    int
7982	page JobAgentListResultPage
7983}
7984
7985// NextWithContext advances to the next value.  If there was an error making
7986// the request the iterator does not advance and the error is returned.
7987func (iter *JobAgentListResultIterator) NextWithContext(ctx context.Context) (err error) {
7988	if tracing.IsEnabled() {
7989		ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentListResultIterator.NextWithContext")
7990		defer func() {
7991			sc := -1
7992			if iter.Response().Response.Response != nil {
7993				sc = iter.Response().Response.Response.StatusCode
7994			}
7995			tracing.EndSpan(ctx, sc, err)
7996		}()
7997	}
7998	iter.i++
7999	if iter.i < len(iter.page.Values()) {
8000		return nil
8001	}
8002	err = iter.page.NextWithContext(ctx)
8003	if err != nil {
8004		iter.i--
8005		return err
8006	}
8007	iter.i = 0
8008	return nil
8009}
8010
8011// Next advances to the next value.  If there was an error making
8012// the request the iterator does not advance and the error is returned.
8013// Deprecated: Use NextWithContext() instead.
8014func (iter *JobAgentListResultIterator) Next() error {
8015	return iter.NextWithContext(context.Background())
8016}
8017
8018// NotDone returns true if the enumeration should be started or is not yet complete.
8019func (iter JobAgentListResultIterator) NotDone() bool {
8020	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8021}
8022
8023// Response returns the raw server response from the last page request.
8024func (iter JobAgentListResultIterator) Response() JobAgentListResult {
8025	return iter.page.Response()
8026}
8027
8028// Value returns the current value or a zero-initialized value if the
8029// iterator has advanced beyond the end of the collection.
8030func (iter JobAgentListResultIterator) Value() JobAgent {
8031	if !iter.page.NotDone() {
8032		return JobAgent{}
8033	}
8034	return iter.page.Values()[iter.i]
8035}
8036
8037// Creates a new instance of the JobAgentListResultIterator type.
8038func NewJobAgentListResultIterator(page JobAgentListResultPage) JobAgentListResultIterator {
8039	return JobAgentListResultIterator{page: page}
8040}
8041
8042// IsEmpty returns true if the ListResult contains no values.
8043func (jalr JobAgentListResult) IsEmpty() bool {
8044	return jalr.Value == nil || len(*jalr.Value) == 0
8045}
8046
8047// hasNextLink returns true if the NextLink is not empty.
8048func (jalr JobAgentListResult) hasNextLink() bool {
8049	return jalr.NextLink != nil && len(*jalr.NextLink) != 0
8050}
8051
8052// jobAgentListResultPreparer prepares a request to retrieve the next set of results.
8053// It returns nil if no more results exist.
8054func (jalr JobAgentListResult) jobAgentListResultPreparer(ctx context.Context) (*http.Request, error) {
8055	if !jalr.hasNextLink() {
8056		return nil, nil
8057	}
8058	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8059		autorest.AsJSON(),
8060		autorest.AsGet(),
8061		autorest.WithBaseURL(to.String(jalr.NextLink)))
8062}
8063
8064// JobAgentListResultPage contains a page of JobAgent values.
8065type JobAgentListResultPage struct {
8066	fn   func(context.Context, JobAgentListResult) (JobAgentListResult, error)
8067	jalr JobAgentListResult
8068}
8069
8070// NextWithContext advances to the next page of values.  If there was an error making
8071// the request the page does not advance and the error is returned.
8072func (page *JobAgentListResultPage) NextWithContext(ctx context.Context) (err error) {
8073	if tracing.IsEnabled() {
8074		ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentListResultPage.NextWithContext")
8075		defer func() {
8076			sc := -1
8077			if page.Response().Response.Response != nil {
8078				sc = page.Response().Response.Response.StatusCode
8079			}
8080			tracing.EndSpan(ctx, sc, err)
8081		}()
8082	}
8083	for {
8084		next, err := page.fn(ctx, page.jalr)
8085		if err != nil {
8086			return err
8087		}
8088		page.jalr = next
8089		if !next.hasNextLink() || !next.IsEmpty() {
8090			break
8091		}
8092	}
8093	return nil
8094}
8095
8096// Next advances to the next page of values.  If there was an error making
8097// the request the page does not advance and the error is returned.
8098// Deprecated: Use NextWithContext() instead.
8099func (page *JobAgentListResultPage) Next() error {
8100	return page.NextWithContext(context.Background())
8101}
8102
8103// NotDone returns true if the page enumeration should be started or is not yet complete.
8104func (page JobAgentListResultPage) NotDone() bool {
8105	return !page.jalr.IsEmpty()
8106}
8107
8108// Response returns the raw server response from the last page request.
8109func (page JobAgentListResultPage) Response() JobAgentListResult {
8110	return page.jalr
8111}
8112
8113// Values returns the slice of values for the current page or nil if there are no values.
8114func (page JobAgentListResultPage) Values() []JobAgent {
8115	if page.jalr.IsEmpty() {
8116		return nil
8117	}
8118	return *page.jalr.Value
8119}
8120
8121// Creates a new instance of the JobAgentListResultPage type.
8122func NewJobAgentListResultPage(cur JobAgentListResult, getNextPage func(context.Context, JobAgentListResult) (JobAgentListResult, error)) JobAgentListResultPage {
8123	return JobAgentListResultPage{
8124		fn:   getNextPage,
8125		jalr: cur,
8126	}
8127}
8128
8129// JobAgentProperties properties of a job agent.
8130type JobAgentProperties struct {
8131	// DatabaseID - Resource ID of the database to store job metadata in.
8132	DatabaseID *string `json:"databaseId,omitempty"`
8133	// State - READ-ONLY; The state of the job agent. Possible values include: 'JobAgentStateCreating', 'JobAgentStateReady', 'JobAgentStateUpdating', 'JobAgentStateDeleting', 'JobAgentStateDisabled'
8134	State JobAgentState `json:"state,omitempty"`
8135}
8136
8137// MarshalJSON is the custom marshaler for JobAgentProperties.
8138func (jap JobAgentProperties) MarshalJSON() ([]byte, error) {
8139	objectMap := make(map[string]interface{})
8140	if jap.DatabaseID != nil {
8141		objectMap["databaseId"] = jap.DatabaseID
8142	}
8143	return json.Marshal(objectMap)
8144}
8145
8146// JobAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
8147// operation.
8148type JobAgentsCreateOrUpdateFuture struct {
8149	azure.FutureAPI
8150	// Result returns the result of the asynchronous operation.
8151	// If the operation has not completed it will return an error.
8152	Result func(JobAgentsClient) (JobAgent, error)
8153}
8154
8155// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8156func (future *JobAgentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8157	var azFuture azure.Future
8158	if err := json.Unmarshal(body, &azFuture); err != nil {
8159		return err
8160	}
8161	future.FutureAPI = &azFuture
8162	future.Result = future.result
8163	return nil
8164}
8165
8166// result is the default implementation for JobAgentsCreateOrUpdateFuture.Result.
8167func (future *JobAgentsCreateOrUpdateFuture) result(client JobAgentsClient) (ja JobAgent, err error) {
8168	var done bool
8169	done, err = future.DoneWithContext(context.Background(), client)
8170	if err != nil {
8171		err = autorest.NewErrorWithError(err, "sql.JobAgentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8172		return
8173	}
8174	if !done {
8175		ja.Response.Response = future.Response()
8176		err = azure.NewAsyncOpIncompleteError("sql.JobAgentsCreateOrUpdateFuture")
8177		return
8178	}
8179	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8180	if ja.Response.Response, err = future.GetResult(sender); err == nil && ja.Response.Response.StatusCode != http.StatusNoContent {
8181		ja, err = client.CreateOrUpdateResponder(ja.Response.Response)
8182		if err != nil {
8183			err = autorest.NewErrorWithError(err, "sql.JobAgentsCreateOrUpdateFuture", "Result", ja.Response.Response, "Failure responding to request")
8184		}
8185	}
8186	return
8187}
8188
8189// JobAgentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
8190// operation.
8191type JobAgentsDeleteFuture struct {
8192	azure.FutureAPI
8193	// Result returns the result of the asynchronous operation.
8194	// If the operation has not completed it will return an error.
8195	Result func(JobAgentsClient) (autorest.Response, error)
8196}
8197
8198// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8199func (future *JobAgentsDeleteFuture) UnmarshalJSON(body []byte) error {
8200	var azFuture azure.Future
8201	if err := json.Unmarshal(body, &azFuture); err != nil {
8202		return err
8203	}
8204	future.FutureAPI = &azFuture
8205	future.Result = future.result
8206	return nil
8207}
8208
8209// result is the default implementation for JobAgentsDeleteFuture.Result.
8210func (future *JobAgentsDeleteFuture) result(client JobAgentsClient) (ar autorest.Response, err error) {
8211	var done bool
8212	done, err = future.DoneWithContext(context.Background(), client)
8213	if err != nil {
8214		err = autorest.NewErrorWithError(err, "sql.JobAgentsDeleteFuture", "Result", future.Response(), "Polling failure")
8215		return
8216	}
8217	if !done {
8218		ar.Response = future.Response()
8219		err = azure.NewAsyncOpIncompleteError("sql.JobAgentsDeleteFuture")
8220		return
8221	}
8222	ar.Response = future.Response()
8223	return
8224}
8225
8226// JobAgentsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
8227// operation.
8228type JobAgentsUpdateFuture struct {
8229	azure.FutureAPI
8230	// Result returns the result of the asynchronous operation.
8231	// If the operation has not completed it will return an error.
8232	Result func(JobAgentsClient) (JobAgent, error)
8233}
8234
8235// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8236func (future *JobAgentsUpdateFuture) UnmarshalJSON(body []byte) error {
8237	var azFuture azure.Future
8238	if err := json.Unmarshal(body, &azFuture); err != nil {
8239		return err
8240	}
8241	future.FutureAPI = &azFuture
8242	future.Result = future.result
8243	return nil
8244}
8245
8246// result is the default implementation for JobAgentsUpdateFuture.Result.
8247func (future *JobAgentsUpdateFuture) result(client JobAgentsClient) (ja JobAgent, err error) {
8248	var done bool
8249	done, err = future.DoneWithContext(context.Background(), client)
8250	if err != nil {
8251		err = autorest.NewErrorWithError(err, "sql.JobAgentsUpdateFuture", "Result", future.Response(), "Polling failure")
8252		return
8253	}
8254	if !done {
8255		ja.Response.Response = future.Response()
8256		err = azure.NewAsyncOpIncompleteError("sql.JobAgentsUpdateFuture")
8257		return
8258	}
8259	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8260	if ja.Response.Response, err = future.GetResult(sender); err == nil && ja.Response.Response.StatusCode != http.StatusNoContent {
8261		ja, err = client.UpdateResponder(ja.Response.Response)
8262		if err != nil {
8263			err = autorest.NewErrorWithError(err, "sql.JobAgentsUpdateFuture", "Result", ja.Response.Response, "Failure responding to request")
8264		}
8265	}
8266	return
8267}
8268
8269// JobAgentUpdate an update to an Azure SQL job agent.
8270type JobAgentUpdate struct {
8271	// Tags - Resource tags.
8272	Tags map[string]*string `json:"tags"`
8273}
8274
8275// MarshalJSON is the custom marshaler for JobAgentUpdate.
8276func (jau JobAgentUpdate) MarshalJSON() ([]byte, error) {
8277	objectMap := make(map[string]interface{})
8278	if jau.Tags != nil {
8279		objectMap["tags"] = jau.Tags
8280	}
8281	return json.Marshal(objectMap)
8282}
8283
8284// JobCredential a stored credential that can be used by a job to connect to target databases.
8285type JobCredential struct {
8286	autorest.Response `json:"-"`
8287	// JobCredentialProperties - Resource properties.
8288	*JobCredentialProperties `json:"properties,omitempty"`
8289	// ID - READ-ONLY; Resource ID.
8290	ID *string `json:"id,omitempty"`
8291	// Name - READ-ONLY; Resource name.
8292	Name *string `json:"name,omitempty"`
8293	// Type - READ-ONLY; Resource type.
8294	Type *string `json:"type,omitempty"`
8295}
8296
8297// MarshalJSON is the custom marshaler for JobCredential.
8298func (jc JobCredential) MarshalJSON() ([]byte, error) {
8299	objectMap := make(map[string]interface{})
8300	if jc.JobCredentialProperties != nil {
8301		objectMap["properties"] = jc.JobCredentialProperties
8302	}
8303	return json.Marshal(objectMap)
8304}
8305
8306// UnmarshalJSON is the custom unmarshaler for JobCredential struct.
8307func (jc *JobCredential) UnmarshalJSON(body []byte) error {
8308	var m map[string]*json.RawMessage
8309	err := json.Unmarshal(body, &m)
8310	if err != nil {
8311		return err
8312	}
8313	for k, v := range m {
8314		switch k {
8315		case "properties":
8316			if v != nil {
8317				var jobCredentialProperties JobCredentialProperties
8318				err = json.Unmarshal(*v, &jobCredentialProperties)
8319				if err != nil {
8320					return err
8321				}
8322				jc.JobCredentialProperties = &jobCredentialProperties
8323			}
8324		case "id":
8325			if v != nil {
8326				var ID string
8327				err = json.Unmarshal(*v, &ID)
8328				if err != nil {
8329					return err
8330				}
8331				jc.ID = &ID
8332			}
8333		case "name":
8334			if v != nil {
8335				var name string
8336				err = json.Unmarshal(*v, &name)
8337				if err != nil {
8338					return err
8339				}
8340				jc.Name = &name
8341			}
8342		case "type":
8343			if v != nil {
8344				var typeVar string
8345				err = json.Unmarshal(*v, &typeVar)
8346				if err != nil {
8347					return err
8348				}
8349				jc.Type = &typeVar
8350			}
8351		}
8352	}
8353
8354	return nil
8355}
8356
8357// JobCredentialListResult a list of job credentials.
8358type JobCredentialListResult struct {
8359	autorest.Response `json:"-"`
8360	// Value - READ-ONLY; Array of results.
8361	Value *[]JobCredential `json:"value,omitempty"`
8362	// NextLink - READ-ONLY; Link to retrieve next page of results.
8363	NextLink *string `json:"nextLink,omitempty"`
8364}
8365
8366// MarshalJSON is the custom marshaler for JobCredentialListResult.
8367func (jclr JobCredentialListResult) MarshalJSON() ([]byte, error) {
8368	objectMap := make(map[string]interface{})
8369	return json.Marshal(objectMap)
8370}
8371
8372// JobCredentialListResultIterator provides access to a complete listing of JobCredential values.
8373type JobCredentialListResultIterator struct {
8374	i    int
8375	page JobCredentialListResultPage
8376}
8377
8378// NextWithContext advances to the next value.  If there was an error making
8379// the request the iterator does not advance and the error is returned.
8380func (iter *JobCredentialListResultIterator) NextWithContext(ctx context.Context) (err error) {
8381	if tracing.IsEnabled() {
8382		ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialListResultIterator.NextWithContext")
8383		defer func() {
8384			sc := -1
8385			if iter.Response().Response.Response != nil {
8386				sc = iter.Response().Response.Response.StatusCode
8387			}
8388			tracing.EndSpan(ctx, sc, err)
8389		}()
8390	}
8391	iter.i++
8392	if iter.i < len(iter.page.Values()) {
8393		return nil
8394	}
8395	err = iter.page.NextWithContext(ctx)
8396	if err != nil {
8397		iter.i--
8398		return err
8399	}
8400	iter.i = 0
8401	return nil
8402}
8403
8404// Next advances to the next value.  If there was an error making
8405// the request the iterator does not advance and the error is returned.
8406// Deprecated: Use NextWithContext() instead.
8407func (iter *JobCredentialListResultIterator) Next() error {
8408	return iter.NextWithContext(context.Background())
8409}
8410
8411// NotDone returns true if the enumeration should be started or is not yet complete.
8412func (iter JobCredentialListResultIterator) NotDone() bool {
8413	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8414}
8415
8416// Response returns the raw server response from the last page request.
8417func (iter JobCredentialListResultIterator) Response() JobCredentialListResult {
8418	return iter.page.Response()
8419}
8420
8421// Value returns the current value or a zero-initialized value if the
8422// iterator has advanced beyond the end of the collection.
8423func (iter JobCredentialListResultIterator) Value() JobCredential {
8424	if !iter.page.NotDone() {
8425		return JobCredential{}
8426	}
8427	return iter.page.Values()[iter.i]
8428}
8429
8430// Creates a new instance of the JobCredentialListResultIterator type.
8431func NewJobCredentialListResultIterator(page JobCredentialListResultPage) JobCredentialListResultIterator {
8432	return JobCredentialListResultIterator{page: page}
8433}
8434
8435// IsEmpty returns true if the ListResult contains no values.
8436func (jclr JobCredentialListResult) IsEmpty() bool {
8437	return jclr.Value == nil || len(*jclr.Value) == 0
8438}
8439
8440// hasNextLink returns true if the NextLink is not empty.
8441func (jclr JobCredentialListResult) hasNextLink() bool {
8442	return jclr.NextLink != nil && len(*jclr.NextLink) != 0
8443}
8444
8445// jobCredentialListResultPreparer prepares a request to retrieve the next set of results.
8446// It returns nil if no more results exist.
8447func (jclr JobCredentialListResult) jobCredentialListResultPreparer(ctx context.Context) (*http.Request, error) {
8448	if !jclr.hasNextLink() {
8449		return nil, nil
8450	}
8451	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8452		autorest.AsJSON(),
8453		autorest.AsGet(),
8454		autorest.WithBaseURL(to.String(jclr.NextLink)))
8455}
8456
8457// JobCredentialListResultPage contains a page of JobCredential values.
8458type JobCredentialListResultPage struct {
8459	fn   func(context.Context, JobCredentialListResult) (JobCredentialListResult, error)
8460	jclr JobCredentialListResult
8461}
8462
8463// NextWithContext advances to the next page of values.  If there was an error making
8464// the request the page does not advance and the error is returned.
8465func (page *JobCredentialListResultPage) NextWithContext(ctx context.Context) (err error) {
8466	if tracing.IsEnabled() {
8467		ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialListResultPage.NextWithContext")
8468		defer func() {
8469			sc := -1
8470			if page.Response().Response.Response != nil {
8471				sc = page.Response().Response.Response.StatusCode
8472			}
8473			tracing.EndSpan(ctx, sc, err)
8474		}()
8475	}
8476	for {
8477		next, err := page.fn(ctx, page.jclr)
8478		if err != nil {
8479			return err
8480		}
8481		page.jclr = next
8482		if !next.hasNextLink() || !next.IsEmpty() {
8483			break
8484		}
8485	}
8486	return nil
8487}
8488
8489// Next advances to the next page of values.  If there was an error making
8490// the request the page does not advance and the error is returned.
8491// Deprecated: Use NextWithContext() instead.
8492func (page *JobCredentialListResultPage) Next() error {
8493	return page.NextWithContext(context.Background())
8494}
8495
8496// NotDone returns true if the page enumeration should be started or is not yet complete.
8497func (page JobCredentialListResultPage) NotDone() bool {
8498	return !page.jclr.IsEmpty()
8499}
8500
8501// Response returns the raw server response from the last page request.
8502func (page JobCredentialListResultPage) Response() JobCredentialListResult {
8503	return page.jclr
8504}
8505
8506// Values returns the slice of values for the current page or nil if there are no values.
8507func (page JobCredentialListResultPage) Values() []JobCredential {
8508	if page.jclr.IsEmpty() {
8509		return nil
8510	}
8511	return *page.jclr.Value
8512}
8513
8514// Creates a new instance of the JobCredentialListResultPage type.
8515func NewJobCredentialListResultPage(cur JobCredentialListResult, getNextPage func(context.Context, JobCredentialListResult) (JobCredentialListResult, error)) JobCredentialListResultPage {
8516	return JobCredentialListResultPage{
8517		fn:   getNextPage,
8518		jclr: cur,
8519	}
8520}
8521
8522// JobCredentialProperties properties of a job credential.
8523type JobCredentialProperties struct {
8524	// Username - The credential user name.
8525	Username *string `json:"username,omitempty"`
8526	// Password - The credential password.
8527	Password *string `json:"password,omitempty"`
8528}
8529
8530// JobExecution an execution of a job
8531type JobExecution struct {
8532	autorest.Response `json:"-"`
8533	// JobExecutionProperties - Resource properties.
8534	*JobExecutionProperties `json:"properties,omitempty"`
8535	// ID - READ-ONLY; Resource ID.
8536	ID *string `json:"id,omitempty"`
8537	// Name - READ-ONLY; Resource name.
8538	Name *string `json:"name,omitempty"`
8539	// Type - READ-ONLY; Resource type.
8540	Type *string `json:"type,omitempty"`
8541}
8542
8543// MarshalJSON is the custom marshaler for JobExecution.
8544func (je JobExecution) MarshalJSON() ([]byte, error) {
8545	objectMap := make(map[string]interface{})
8546	if je.JobExecutionProperties != nil {
8547		objectMap["properties"] = je.JobExecutionProperties
8548	}
8549	return json.Marshal(objectMap)
8550}
8551
8552// UnmarshalJSON is the custom unmarshaler for JobExecution struct.
8553func (je *JobExecution) UnmarshalJSON(body []byte) error {
8554	var m map[string]*json.RawMessage
8555	err := json.Unmarshal(body, &m)
8556	if err != nil {
8557		return err
8558	}
8559	for k, v := range m {
8560		switch k {
8561		case "properties":
8562			if v != nil {
8563				var jobExecutionProperties JobExecutionProperties
8564				err = json.Unmarshal(*v, &jobExecutionProperties)
8565				if err != nil {
8566					return err
8567				}
8568				je.JobExecutionProperties = &jobExecutionProperties
8569			}
8570		case "id":
8571			if v != nil {
8572				var ID string
8573				err = json.Unmarshal(*v, &ID)
8574				if err != nil {
8575					return err
8576				}
8577				je.ID = &ID
8578			}
8579		case "name":
8580			if v != nil {
8581				var name string
8582				err = json.Unmarshal(*v, &name)
8583				if err != nil {
8584					return err
8585				}
8586				je.Name = &name
8587			}
8588		case "type":
8589			if v != nil {
8590				var typeVar string
8591				err = json.Unmarshal(*v, &typeVar)
8592				if err != nil {
8593					return err
8594				}
8595				je.Type = &typeVar
8596			}
8597		}
8598	}
8599
8600	return nil
8601}
8602
8603// JobExecutionListResult a list of job executions.
8604type JobExecutionListResult struct {
8605	autorest.Response `json:"-"`
8606	// Value - READ-ONLY; Array of results.
8607	Value *[]JobExecution `json:"value,omitempty"`
8608	// NextLink - READ-ONLY; Link to retrieve next page of results.
8609	NextLink *string `json:"nextLink,omitempty"`
8610}
8611
8612// MarshalJSON is the custom marshaler for JobExecutionListResult.
8613func (jelr JobExecutionListResult) MarshalJSON() ([]byte, error) {
8614	objectMap := make(map[string]interface{})
8615	return json.Marshal(objectMap)
8616}
8617
8618// JobExecutionListResultIterator provides access to a complete listing of JobExecution values.
8619type JobExecutionListResultIterator struct {
8620	i    int
8621	page JobExecutionListResultPage
8622}
8623
8624// NextWithContext advances to the next value.  If there was an error making
8625// the request the iterator does not advance and the error is returned.
8626func (iter *JobExecutionListResultIterator) NextWithContext(ctx context.Context) (err error) {
8627	if tracing.IsEnabled() {
8628		ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionListResultIterator.NextWithContext")
8629		defer func() {
8630			sc := -1
8631			if iter.Response().Response.Response != nil {
8632				sc = iter.Response().Response.Response.StatusCode
8633			}
8634			tracing.EndSpan(ctx, sc, err)
8635		}()
8636	}
8637	iter.i++
8638	if iter.i < len(iter.page.Values()) {
8639		return nil
8640	}
8641	err = iter.page.NextWithContext(ctx)
8642	if err != nil {
8643		iter.i--
8644		return err
8645	}
8646	iter.i = 0
8647	return nil
8648}
8649
8650// Next advances to the next value.  If there was an error making
8651// the request the iterator does not advance and the error is returned.
8652// Deprecated: Use NextWithContext() instead.
8653func (iter *JobExecutionListResultIterator) Next() error {
8654	return iter.NextWithContext(context.Background())
8655}
8656
8657// NotDone returns true if the enumeration should be started or is not yet complete.
8658func (iter JobExecutionListResultIterator) NotDone() bool {
8659	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8660}
8661
8662// Response returns the raw server response from the last page request.
8663func (iter JobExecutionListResultIterator) Response() JobExecutionListResult {
8664	return iter.page.Response()
8665}
8666
8667// Value returns the current value or a zero-initialized value if the
8668// iterator has advanced beyond the end of the collection.
8669func (iter JobExecutionListResultIterator) Value() JobExecution {
8670	if !iter.page.NotDone() {
8671		return JobExecution{}
8672	}
8673	return iter.page.Values()[iter.i]
8674}
8675
8676// Creates a new instance of the JobExecutionListResultIterator type.
8677func NewJobExecutionListResultIterator(page JobExecutionListResultPage) JobExecutionListResultIterator {
8678	return JobExecutionListResultIterator{page: page}
8679}
8680
8681// IsEmpty returns true if the ListResult contains no values.
8682func (jelr JobExecutionListResult) IsEmpty() bool {
8683	return jelr.Value == nil || len(*jelr.Value) == 0
8684}
8685
8686// hasNextLink returns true if the NextLink is not empty.
8687func (jelr JobExecutionListResult) hasNextLink() bool {
8688	return jelr.NextLink != nil && len(*jelr.NextLink) != 0
8689}
8690
8691// jobExecutionListResultPreparer prepares a request to retrieve the next set of results.
8692// It returns nil if no more results exist.
8693func (jelr JobExecutionListResult) jobExecutionListResultPreparer(ctx context.Context) (*http.Request, error) {
8694	if !jelr.hasNextLink() {
8695		return nil, nil
8696	}
8697	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8698		autorest.AsJSON(),
8699		autorest.AsGet(),
8700		autorest.WithBaseURL(to.String(jelr.NextLink)))
8701}
8702
8703// JobExecutionListResultPage contains a page of JobExecution values.
8704type JobExecutionListResultPage struct {
8705	fn   func(context.Context, JobExecutionListResult) (JobExecutionListResult, error)
8706	jelr JobExecutionListResult
8707}
8708
8709// NextWithContext advances to the next page of values.  If there was an error making
8710// the request the page does not advance and the error is returned.
8711func (page *JobExecutionListResultPage) NextWithContext(ctx context.Context) (err error) {
8712	if tracing.IsEnabled() {
8713		ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionListResultPage.NextWithContext")
8714		defer func() {
8715			sc := -1
8716			if page.Response().Response.Response != nil {
8717				sc = page.Response().Response.Response.StatusCode
8718			}
8719			tracing.EndSpan(ctx, sc, err)
8720		}()
8721	}
8722	for {
8723		next, err := page.fn(ctx, page.jelr)
8724		if err != nil {
8725			return err
8726		}
8727		page.jelr = next
8728		if !next.hasNextLink() || !next.IsEmpty() {
8729			break
8730		}
8731	}
8732	return nil
8733}
8734
8735// Next advances to the next page of values.  If there was an error making
8736// the request the page does not advance and the error is returned.
8737// Deprecated: Use NextWithContext() instead.
8738func (page *JobExecutionListResultPage) Next() error {
8739	return page.NextWithContext(context.Background())
8740}
8741
8742// NotDone returns true if the page enumeration should be started or is not yet complete.
8743func (page JobExecutionListResultPage) NotDone() bool {
8744	return !page.jelr.IsEmpty()
8745}
8746
8747// Response returns the raw server response from the last page request.
8748func (page JobExecutionListResultPage) Response() JobExecutionListResult {
8749	return page.jelr
8750}
8751
8752// Values returns the slice of values for the current page or nil if there are no values.
8753func (page JobExecutionListResultPage) Values() []JobExecution {
8754	if page.jelr.IsEmpty() {
8755		return nil
8756	}
8757	return *page.jelr.Value
8758}
8759
8760// Creates a new instance of the JobExecutionListResultPage type.
8761func NewJobExecutionListResultPage(cur JobExecutionListResult, getNextPage func(context.Context, JobExecutionListResult) (JobExecutionListResult, error)) JobExecutionListResultPage {
8762	return JobExecutionListResultPage{
8763		fn:   getNextPage,
8764		jelr: cur,
8765	}
8766}
8767
8768// JobExecutionProperties properties for an Azure SQL Database Elastic job execution.
8769type JobExecutionProperties struct {
8770	// JobVersion - READ-ONLY; The job version number.
8771	JobVersion *int32 `json:"jobVersion,omitempty"`
8772	// StepName - READ-ONLY; The job step name.
8773	StepName *string `json:"stepName,omitempty"`
8774	// StepID - READ-ONLY; The job step id.
8775	StepID *int32 `json:"stepId,omitempty"`
8776	// JobExecutionID - READ-ONLY; The unique identifier of the job execution.
8777	JobExecutionID *uuid.UUID `json:"jobExecutionId,omitempty"`
8778	// Lifecycle - READ-ONLY; The detailed state of the job execution. Possible values include: 'Created', 'InProgress', 'WaitingForChildJobExecutions', 'WaitingForRetry', 'Succeeded', 'SucceededWithSkipped', 'Failed', 'TimedOut', 'Canceled', 'Skipped'
8779	Lifecycle JobExecutionLifecycle `json:"lifecycle,omitempty"`
8780	// ProvisioningState - READ-ONLY; The ARM provisioning state of the job execution. Possible values include: 'ProvisioningStateCreated', 'ProvisioningStateInProgress', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
8781	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
8782	// CreateTime - READ-ONLY; The time that the job execution was created.
8783	CreateTime *date.Time `json:"createTime,omitempty"`
8784	// StartTime - READ-ONLY; The time that the job execution started.
8785	StartTime *date.Time `json:"startTime,omitempty"`
8786	// EndTime - READ-ONLY; The time that the job execution completed.
8787	EndTime *date.Time `json:"endTime,omitempty"`
8788	// CurrentAttempts - Number of times the job execution has been attempted.
8789	CurrentAttempts *int32 `json:"currentAttempts,omitempty"`
8790	// CurrentAttemptStartTime - READ-ONLY; Start time of the current attempt.
8791	CurrentAttemptStartTime *date.Time `json:"currentAttemptStartTime,omitempty"`
8792	// LastMessage - READ-ONLY; The last status or error message.
8793	LastMessage *string `json:"lastMessage,omitempty"`
8794	// Target - READ-ONLY; The target that this execution is executed on.
8795	Target *JobExecutionTarget `json:"target,omitempty"`
8796}
8797
8798// MarshalJSON is the custom marshaler for JobExecutionProperties.
8799func (jep JobExecutionProperties) MarshalJSON() ([]byte, error) {
8800	objectMap := make(map[string]interface{})
8801	if jep.CurrentAttempts != nil {
8802		objectMap["currentAttempts"] = jep.CurrentAttempts
8803	}
8804	return json.Marshal(objectMap)
8805}
8806
8807// JobExecutionsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
8808// operation.
8809type JobExecutionsCreateFuture struct {
8810	azure.FutureAPI
8811	// Result returns the result of the asynchronous operation.
8812	// If the operation has not completed it will return an error.
8813	Result func(JobExecutionsClient) (JobExecution, error)
8814}
8815
8816// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8817func (future *JobExecutionsCreateFuture) UnmarshalJSON(body []byte) error {
8818	var azFuture azure.Future
8819	if err := json.Unmarshal(body, &azFuture); err != nil {
8820		return err
8821	}
8822	future.FutureAPI = &azFuture
8823	future.Result = future.result
8824	return nil
8825}
8826
8827// result is the default implementation for JobExecutionsCreateFuture.Result.
8828func (future *JobExecutionsCreateFuture) result(client JobExecutionsClient) (je JobExecution, err error) {
8829	var done bool
8830	done, err = future.DoneWithContext(context.Background(), client)
8831	if err != nil {
8832		err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateFuture", "Result", future.Response(), "Polling failure")
8833		return
8834	}
8835	if !done {
8836		je.Response.Response = future.Response()
8837		err = azure.NewAsyncOpIncompleteError("sql.JobExecutionsCreateFuture")
8838		return
8839	}
8840	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8841	if je.Response.Response, err = future.GetResult(sender); err == nil && je.Response.Response.StatusCode != http.StatusNoContent {
8842		je, err = client.CreateResponder(je.Response.Response)
8843		if err != nil {
8844			err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateFuture", "Result", je.Response.Response, "Failure responding to request")
8845		}
8846	}
8847	return
8848}
8849
8850// JobExecutionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
8851// long-running operation.
8852type JobExecutionsCreateOrUpdateFuture struct {
8853	azure.FutureAPI
8854	// Result returns the result of the asynchronous operation.
8855	// If the operation has not completed it will return an error.
8856	Result func(JobExecutionsClient) (JobExecution, error)
8857}
8858
8859// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8860func (future *JobExecutionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8861	var azFuture azure.Future
8862	if err := json.Unmarshal(body, &azFuture); err != nil {
8863		return err
8864	}
8865	future.FutureAPI = &azFuture
8866	future.Result = future.result
8867	return nil
8868}
8869
8870// result is the default implementation for JobExecutionsCreateOrUpdateFuture.Result.
8871func (future *JobExecutionsCreateOrUpdateFuture) result(client JobExecutionsClient) (je JobExecution, err error) {
8872	var done bool
8873	done, err = future.DoneWithContext(context.Background(), client)
8874	if err != nil {
8875		err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8876		return
8877	}
8878	if !done {
8879		je.Response.Response = future.Response()
8880		err = azure.NewAsyncOpIncompleteError("sql.JobExecutionsCreateOrUpdateFuture")
8881		return
8882	}
8883	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8884	if je.Response.Response, err = future.GetResult(sender); err == nil && je.Response.Response.StatusCode != http.StatusNoContent {
8885		je, err = client.CreateOrUpdateResponder(je.Response.Response)
8886		if err != nil {
8887			err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateOrUpdateFuture", "Result", je.Response.Response, "Failure responding to request")
8888		}
8889	}
8890	return
8891}
8892
8893// JobExecutionTarget the target that a job execution is executed on.
8894type JobExecutionTarget struct {
8895	// Type - READ-ONLY; The type of the target. Possible values include: 'JobTargetTypeTargetGroup', 'JobTargetTypeSQLDatabase', 'JobTargetTypeSQLElasticPool', 'JobTargetTypeSQLShardMap', 'JobTargetTypeSQLServer'
8896	Type JobTargetType `json:"type,omitempty"`
8897	// ServerName - READ-ONLY; The server name.
8898	ServerName *string `json:"serverName,omitempty"`
8899	// DatabaseName - READ-ONLY; The database name.
8900	DatabaseName *string `json:"databaseName,omitempty"`
8901}
8902
8903// MarshalJSON is the custom marshaler for JobExecutionTarget.
8904func (jet JobExecutionTarget) MarshalJSON() ([]byte, error) {
8905	objectMap := make(map[string]interface{})
8906	return json.Marshal(objectMap)
8907}
8908
8909// JobListResult a list of jobs.
8910type JobListResult struct {
8911	autorest.Response `json:"-"`
8912	// Value - READ-ONLY; Array of results.
8913	Value *[]Job `json:"value,omitempty"`
8914	// NextLink - READ-ONLY; Link to retrieve next page of results.
8915	NextLink *string `json:"nextLink,omitempty"`
8916}
8917
8918// MarshalJSON is the custom marshaler for JobListResult.
8919func (jlr JobListResult) MarshalJSON() ([]byte, error) {
8920	objectMap := make(map[string]interface{})
8921	return json.Marshal(objectMap)
8922}
8923
8924// JobListResultIterator provides access to a complete listing of Job values.
8925type JobListResultIterator struct {
8926	i    int
8927	page JobListResultPage
8928}
8929
8930// NextWithContext advances to the next value.  If there was an error making
8931// the request the iterator does not advance and the error is returned.
8932func (iter *JobListResultIterator) NextWithContext(ctx context.Context) (err error) {
8933	if tracing.IsEnabled() {
8934		ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultIterator.NextWithContext")
8935		defer func() {
8936			sc := -1
8937			if iter.Response().Response.Response != nil {
8938				sc = iter.Response().Response.Response.StatusCode
8939			}
8940			tracing.EndSpan(ctx, sc, err)
8941		}()
8942	}
8943	iter.i++
8944	if iter.i < len(iter.page.Values()) {
8945		return nil
8946	}
8947	err = iter.page.NextWithContext(ctx)
8948	if err != nil {
8949		iter.i--
8950		return err
8951	}
8952	iter.i = 0
8953	return nil
8954}
8955
8956// Next advances to the next value.  If there was an error making
8957// the request the iterator does not advance and the error is returned.
8958// Deprecated: Use NextWithContext() instead.
8959func (iter *JobListResultIterator) Next() error {
8960	return iter.NextWithContext(context.Background())
8961}
8962
8963// NotDone returns true if the enumeration should be started or is not yet complete.
8964func (iter JobListResultIterator) NotDone() bool {
8965	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8966}
8967
8968// Response returns the raw server response from the last page request.
8969func (iter JobListResultIterator) Response() JobListResult {
8970	return iter.page.Response()
8971}
8972
8973// Value returns the current value or a zero-initialized value if the
8974// iterator has advanced beyond the end of the collection.
8975func (iter JobListResultIterator) Value() Job {
8976	if !iter.page.NotDone() {
8977		return Job{}
8978	}
8979	return iter.page.Values()[iter.i]
8980}
8981
8982// Creates a new instance of the JobListResultIterator type.
8983func NewJobListResultIterator(page JobListResultPage) JobListResultIterator {
8984	return JobListResultIterator{page: page}
8985}
8986
8987// IsEmpty returns true if the ListResult contains no values.
8988func (jlr JobListResult) IsEmpty() bool {
8989	return jlr.Value == nil || len(*jlr.Value) == 0
8990}
8991
8992// hasNextLink returns true if the NextLink is not empty.
8993func (jlr JobListResult) hasNextLink() bool {
8994	return jlr.NextLink != nil && len(*jlr.NextLink) != 0
8995}
8996
8997// jobListResultPreparer prepares a request to retrieve the next set of results.
8998// It returns nil if no more results exist.
8999func (jlr JobListResult) jobListResultPreparer(ctx context.Context) (*http.Request, error) {
9000	if !jlr.hasNextLink() {
9001		return nil, nil
9002	}
9003	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9004		autorest.AsJSON(),
9005		autorest.AsGet(),
9006		autorest.WithBaseURL(to.String(jlr.NextLink)))
9007}
9008
9009// JobListResultPage contains a page of Job values.
9010type JobListResultPage struct {
9011	fn  func(context.Context, JobListResult) (JobListResult, error)
9012	jlr JobListResult
9013}
9014
9015// NextWithContext advances to the next page of values.  If there was an error making
9016// the request the page does not advance and the error is returned.
9017func (page *JobListResultPage) NextWithContext(ctx context.Context) (err error) {
9018	if tracing.IsEnabled() {
9019		ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultPage.NextWithContext")
9020		defer func() {
9021			sc := -1
9022			if page.Response().Response.Response != nil {
9023				sc = page.Response().Response.Response.StatusCode
9024			}
9025			tracing.EndSpan(ctx, sc, err)
9026		}()
9027	}
9028	for {
9029		next, err := page.fn(ctx, page.jlr)
9030		if err != nil {
9031			return err
9032		}
9033		page.jlr = next
9034		if !next.hasNextLink() || !next.IsEmpty() {
9035			break
9036		}
9037	}
9038	return nil
9039}
9040
9041// Next advances to the next page of values.  If there was an error making
9042// the request the page does not advance and the error is returned.
9043// Deprecated: Use NextWithContext() instead.
9044func (page *JobListResultPage) Next() error {
9045	return page.NextWithContext(context.Background())
9046}
9047
9048// NotDone returns true if the page enumeration should be started or is not yet complete.
9049func (page JobListResultPage) NotDone() bool {
9050	return !page.jlr.IsEmpty()
9051}
9052
9053// Response returns the raw server response from the last page request.
9054func (page JobListResultPage) Response() JobListResult {
9055	return page.jlr
9056}
9057
9058// Values returns the slice of values for the current page or nil if there are no values.
9059func (page JobListResultPage) Values() []Job {
9060	if page.jlr.IsEmpty() {
9061		return nil
9062	}
9063	return *page.jlr.Value
9064}
9065
9066// Creates a new instance of the JobListResultPage type.
9067func NewJobListResultPage(cur JobListResult, getNextPage func(context.Context, JobListResult) (JobListResult, error)) JobListResultPage {
9068	return JobListResultPage{
9069		fn:  getNextPage,
9070		jlr: cur,
9071	}
9072}
9073
9074// JobProperties properties of a job.
9075type JobProperties struct {
9076	// Description - User-defined description of the job.
9077	Description *string `json:"description,omitempty"`
9078	// Version - READ-ONLY; The job version number.
9079	Version *int32 `json:"version,omitempty"`
9080	// Schedule - Schedule properties of the job.
9081	Schedule *JobSchedule `json:"schedule,omitempty"`
9082}
9083
9084// MarshalJSON is the custom marshaler for JobProperties.
9085func (jp JobProperties) MarshalJSON() ([]byte, error) {
9086	objectMap := make(map[string]interface{})
9087	if jp.Description != nil {
9088		objectMap["description"] = jp.Description
9089	}
9090	if jp.Schedule != nil {
9091		objectMap["schedule"] = jp.Schedule
9092	}
9093	return json.Marshal(objectMap)
9094}
9095
9096// JobSchedule scheduling properties of a job.
9097type JobSchedule struct {
9098	// StartTime - Schedule start time.
9099	StartTime *date.Time `json:"startTime,omitempty"`
9100	// EndTime - Schedule end time.
9101	EndTime *date.Time `json:"endTime,omitempty"`
9102	// Type - Schedule interval type. Possible values include: 'Once', 'Recurring'
9103	Type JobScheduleType `json:"type,omitempty"`
9104	// Enabled - Whether or not the schedule is enabled.
9105	Enabled *bool `json:"enabled,omitempty"`
9106	// Interval - Value of the schedule's recurring interval, if the schedule type is recurring. ISO8601 duration format.
9107	Interval *string `json:"interval,omitempty"`
9108}
9109
9110// JobStep a job step.
9111type JobStep struct {
9112	autorest.Response `json:"-"`
9113	// JobStepProperties - Resource properties.
9114	*JobStepProperties `json:"properties,omitempty"`
9115	// ID - READ-ONLY; Resource ID.
9116	ID *string `json:"id,omitempty"`
9117	// Name - READ-ONLY; Resource name.
9118	Name *string `json:"name,omitempty"`
9119	// Type - READ-ONLY; Resource type.
9120	Type *string `json:"type,omitempty"`
9121}
9122
9123// MarshalJSON is the custom marshaler for JobStep.
9124func (js JobStep) MarshalJSON() ([]byte, error) {
9125	objectMap := make(map[string]interface{})
9126	if js.JobStepProperties != nil {
9127		objectMap["properties"] = js.JobStepProperties
9128	}
9129	return json.Marshal(objectMap)
9130}
9131
9132// UnmarshalJSON is the custom unmarshaler for JobStep struct.
9133func (js *JobStep) UnmarshalJSON(body []byte) error {
9134	var m map[string]*json.RawMessage
9135	err := json.Unmarshal(body, &m)
9136	if err != nil {
9137		return err
9138	}
9139	for k, v := range m {
9140		switch k {
9141		case "properties":
9142			if v != nil {
9143				var jobStepProperties JobStepProperties
9144				err = json.Unmarshal(*v, &jobStepProperties)
9145				if err != nil {
9146					return err
9147				}
9148				js.JobStepProperties = &jobStepProperties
9149			}
9150		case "id":
9151			if v != nil {
9152				var ID string
9153				err = json.Unmarshal(*v, &ID)
9154				if err != nil {
9155					return err
9156				}
9157				js.ID = &ID
9158			}
9159		case "name":
9160			if v != nil {
9161				var name string
9162				err = json.Unmarshal(*v, &name)
9163				if err != nil {
9164					return err
9165				}
9166				js.Name = &name
9167			}
9168		case "type":
9169			if v != nil {
9170				var typeVar string
9171				err = json.Unmarshal(*v, &typeVar)
9172				if err != nil {
9173					return err
9174				}
9175				js.Type = &typeVar
9176			}
9177		}
9178	}
9179
9180	return nil
9181}
9182
9183// JobStepAction the action to be executed by a job step.
9184type JobStepAction struct {
9185	// Type - Type of action being executed by the job step. Possible values include: 'TSQL'
9186	Type JobStepActionType `json:"type,omitempty"`
9187	// Source - The source of the action to execute. Possible values include: 'Inline'
9188	Source JobStepActionSource `json:"source,omitempty"`
9189	// Value - The action value, for example the text of the T-SQL script to execute.
9190	Value *string `json:"value,omitempty"`
9191}
9192
9193// JobStepExecutionOptions the execution options of a job step.
9194type JobStepExecutionOptions struct {
9195	// TimeoutSeconds - Execution timeout for the job step.
9196	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
9197	// RetryAttempts - Maximum number of times the job step will be reattempted if the first attempt fails.
9198	RetryAttempts *int32 `json:"retryAttempts,omitempty"`
9199	// InitialRetryIntervalSeconds - Initial delay between retries for job step execution.
9200	InitialRetryIntervalSeconds *int32 `json:"initialRetryIntervalSeconds,omitempty"`
9201	// MaximumRetryIntervalSeconds - The maximum amount of time to wait between retries for job step execution.
9202	MaximumRetryIntervalSeconds *int32 `json:"maximumRetryIntervalSeconds,omitempty"`
9203	// RetryIntervalBackoffMultiplier - The backoff multiplier for the time between retries.
9204	RetryIntervalBackoffMultiplier *float64 `json:"retryIntervalBackoffMultiplier,omitempty"`
9205}
9206
9207// JobStepListResult a list of job steps.
9208type JobStepListResult struct {
9209	autorest.Response `json:"-"`
9210	// Value - READ-ONLY; Array of results.
9211	Value *[]JobStep `json:"value,omitempty"`
9212	// NextLink - READ-ONLY; Link to retrieve next page of results.
9213	NextLink *string `json:"nextLink,omitempty"`
9214}
9215
9216// MarshalJSON is the custom marshaler for JobStepListResult.
9217func (jslr JobStepListResult) MarshalJSON() ([]byte, error) {
9218	objectMap := make(map[string]interface{})
9219	return json.Marshal(objectMap)
9220}
9221
9222// JobStepListResultIterator provides access to a complete listing of JobStep values.
9223type JobStepListResultIterator struct {
9224	i    int
9225	page JobStepListResultPage
9226}
9227
9228// NextWithContext advances to the next value.  If there was an error making
9229// the request the iterator does not advance and the error is returned.
9230func (iter *JobStepListResultIterator) NextWithContext(ctx context.Context) (err error) {
9231	if tracing.IsEnabled() {
9232		ctx = tracing.StartSpan(ctx, fqdn+"/JobStepListResultIterator.NextWithContext")
9233		defer func() {
9234			sc := -1
9235			if iter.Response().Response.Response != nil {
9236				sc = iter.Response().Response.Response.StatusCode
9237			}
9238			tracing.EndSpan(ctx, sc, err)
9239		}()
9240	}
9241	iter.i++
9242	if iter.i < len(iter.page.Values()) {
9243		return nil
9244	}
9245	err = iter.page.NextWithContext(ctx)
9246	if err != nil {
9247		iter.i--
9248		return err
9249	}
9250	iter.i = 0
9251	return nil
9252}
9253
9254// Next advances to the next value.  If there was an error making
9255// the request the iterator does not advance and the error is returned.
9256// Deprecated: Use NextWithContext() instead.
9257func (iter *JobStepListResultIterator) Next() error {
9258	return iter.NextWithContext(context.Background())
9259}
9260
9261// NotDone returns true if the enumeration should be started or is not yet complete.
9262func (iter JobStepListResultIterator) NotDone() bool {
9263	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9264}
9265
9266// Response returns the raw server response from the last page request.
9267func (iter JobStepListResultIterator) Response() JobStepListResult {
9268	return iter.page.Response()
9269}
9270
9271// Value returns the current value or a zero-initialized value if the
9272// iterator has advanced beyond the end of the collection.
9273func (iter JobStepListResultIterator) Value() JobStep {
9274	if !iter.page.NotDone() {
9275		return JobStep{}
9276	}
9277	return iter.page.Values()[iter.i]
9278}
9279
9280// Creates a new instance of the JobStepListResultIterator type.
9281func NewJobStepListResultIterator(page JobStepListResultPage) JobStepListResultIterator {
9282	return JobStepListResultIterator{page: page}
9283}
9284
9285// IsEmpty returns true if the ListResult contains no values.
9286func (jslr JobStepListResult) IsEmpty() bool {
9287	return jslr.Value == nil || len(*jslr.Value) == 0
9288}
9289
9290// hasNextLink returns true if the NextLink is not empty.
9291func (jslr JobStepListResult) hasNextLink() bool {
9292	return jslr.NextLink != nil && len(*jslr.NextLink) != 0
9293}
9294
9295// jobStepListResultPreparer prepares a request to retrieve the next set of results.
9296// It returns nil if no more results exist.
9297func (jslr JobStepListResult) jobStepListResultPreparer(ctx context.Context) (*http.Request, error) {
9298	if !jslr.hasNextLink() {
9299		return nil, nil
9300	}
9301	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9302		autorest.AsJSON(),
9303		autorest.AsGet(),
9304		autorest.WithBaseURL(to.String(jslr.NextLink)))
9305}
9306
9307// JobStepListResultPage contains a page of JobStep values.
9308type JobStepListResultPage struct {
9309	fn   func(context.Context, JobStepListResult) (JobStepListResult, error)
9310	jslr JobStepListResult
9311}
9312
9313// NextWithContext advances to the next page of values.  If there was an error making
9314// the request the page does not advance and the error is returned.
9315func (page *JobStepListResultPage) NextWithContext(ctx context.Context) (err error) {
9316	if tracing.IsEnabled() {
9317		ctx = tracing.StartSpan(ctx, fqdn+"/JobStepListResultPage.NextWithContext")
9318		defer func() {
9319			sc := -1
9320			if page.Response().Response.Response != nil {
9321				sc = page.Response().Response.Response.StatusCode
9322			}
9323			tracing.EndSpan(ctx, sc, err)
9324		}()
9325	}
9326	for {
9327		next, err := page.fn(ctx, page.jslr)
9328		if err != nil {
9329			return err
9330		}
9331		page.jslr = next
9332		if !next.hasNextLink() || !next.IsEmpty() {
9333			break
9334		}
9335	}
9336	return nil
9337}
9338
9339// Next advances to the next page of values.  If there was an error making
9340// the request the page does not advance and the error is returned.
9341// Deprecated: Use NextWithContext() instead.
9342func (page *JobStepListResultPage) Next() error {
9343	return page.NextWithContext(context.Background())
9344}
9345
9346// NotDone returns true if the page enumeration should be started or is not yet complete.
9347func (page JobStepListResultPage) NotDone() bool {
9348	return !page.jslr.IsEmpty()
9349}
9350
9351// Response returns the raw server response from the last page request.
9352func (page JobStepListResultPage) Response() JobStepListResult {
9353	return page.jslr
9354}
9355
9356// Values returns the slice of values for the current page or nil if there are no values.
9357func (page JobStepListResultPage) Values() []JobStep {
9358	if page.jslr.IsEmpty() {
9359		return nil
9360	}
9361	return *page.jslr.Value
9362}
9363
9364// Creates a new instance of the JobStepListResultPage type.
9365func NewJobStepListResultPage(cur JobStepListResult, getNextPage func(context.Context, JobStepListResult) (JobStepListResult, error)) JobStepListResultPage {
9366	return JobStepListResultPage{
9367		fn:   getNextPage,
9368		jslr: cur,
9369	}
9370}
9371
9372// JobStepOutput the output configuration of a job step.
9373type JobStepOutput struct {
9374	// Type - The output destination type. Possible values include: 'SQLDatabase'
9375	Type JobStepOutputType `json:"type,omitempty"`
9376	// SubscriptionID - The output destination subscription id.
9377	SubscriptionID *uuid.UUID `json:"subscriptionId,omitempty"`
9378	// ResourceGroupName - The output destination resource group.
9379	ResourceGroupName *string `json:"resourceGroupName,omitempty"`
9380	// ServerName - The output destination server name.
9381	ServerName *string `json:"serverName,omitempty"`
9382	// DatabaseName - The output destination database.
9383	DatabaseName *string `json:"databaseName,omitempty"`
9384	// SchemaName - The output destination schema.
9385	SchemaName *string `json:"schemaName,omitempty"`
9386	// TableName - The output destination table.
9387	TableName *string `json:"tableName,omitempty"`
9388	// Credential - The resource ID of the credential to use to connect to the output destination.
9389	Credential *string `json:"credential,omitempty"`
9390}
9391
9392// JobStepProperties properties of a job step.
9393type JobStepProperties struct {
9394	// 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.
9395	StepID *int32 `json:"stepId,omitempty"`
9396	// TargetGroup - The resource ID of the target group that the job step will be executed on.
9397	TargetGroup *string `json:"targetGroup,omitempty"`
9398	// Credential - The resource ID of the job credential that will be used to connect to the targets.
9399	Credential *string `json:"credential,omitempty"`
9400	// Action - The action payload of the job step.
9401	Action *JobStepAction `json:"action,omitempty"`
9402	// Output - Output destination properties of the job step.
9403	Output *JobStepOutput `json:"output,omitempty"`
9404	// ExecutionOptions - Execution options for the job step.
9405	ExecutionOptions *JobStepExecutionOptions `json:"executionOptions,omitempty"`
9406}
9407
9408// JobTarget a job target, for example a specific database or a container of databases that is evaluated
9409// during job execution.
9410type JobTarget struct {
9411	// MembershipType - Whether the target is included or excluded from the group. Possible values include: 'Include', 'Exclude'
9412	MembershipType JobTargetGroupMembershipType `json:"membershipType,omitempty"`
9413	// Type - The target type. Possible values include: 'JobTargetTypeTargetGroup', 'JobTargetTypeSQLDatabase', 'JobTargetTypeSQLElasticPool', 'JobTargetTypeSQLShardMap', 'JobTargetTypeSQLServer'
9414	Type JobTargetType `json:"type,omitempty"`
9415	// ServerName - The target server name.
9416	ServerName *string `json:"serverName,omitempty"`
9417	// DatabaseName - The target database name.
9418	DatabaseName *string `json:"databaseName,omitempty"`
9419	// ElasticPoolName - The target elastic pool name.
9420	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
9421	// ShardMapName - The target shard map.
9422	ShardMapName *string `json:"shardMapName,omitempty"`
9423	// 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.
9424	RefreshCredential *string `json:"refreshCredential,omitempty"`
9425}
9426
9427// JobTargetGroup a group of job targets.
9428type JobTargetGroup struct {
9429	autorest.Response `json:"-"`
9430	// JobTargetGroupProperties - Resource properties.
9431	*JobTargetGroupProperties `json:"properties,omitempty"`
9432	// ID - READ-ONLY; Resource ID.
9433	ID *string `json:"id,omitempty"`
9434	// Name - READ-ONLY; Resource name.
9435	Name *string `json:"name,omitempty"`
9436	// Type - READ-ONLY; Resource type.
9437	Type *string `json:"type,omitempty"`
9438}
9439
9440// MarshalJSON is the custom marshaler for JobTargetGroup.
9441func (jtg JobTargetGroup) MarshalJSON() ([]byte, error) {
9442	objectMap := make(map[string]interface{})
9443	if jtg.JobTargetGroupProperties != nil {
9444		objectMap["properties"] = jtg.JobTargetGroupProperties
9445	}
9446	return json.Marshal(objectMap)
9447}
9448
9449// UnmarshalJSON is the custom unmarshaler for JobTargetGroup struct.
9450func (jtg *JobTargetGroup) UnmarshalJSON(body []byte) error {
9451	var m map[string]*json.RawMessage
9452	err := json.Unmarshal(body, &m)
9453	if err != nil {
9454		return err
9455	}
9456	for k, v := range m {
9457		switch k {
9458		case "properties":
9459			if v != nil {
9460				var jobTargetGroupProperties JobTargetGroupProperties
9461				err = json.Unmarshal(*v, &jobTargetGroupProperties)
9462				if err != nil {
9463					return err
9464				}
9465				jtg.JobTargetGroupProperties = &jobTargetGroupProperties
9466			}
9467		case "id":
9468			if v != nil {
9469				var ID string
9470				err = json.Unmarshal(*v, &ID)
9471				if err != nil {
9472					return err
9473				}
9474				jtg.ID = &ID
9475			}
9476		case "name":
9477			if v != nil {
9478				var name string
9479				err = json.Unmarshal(*v, &name)
9480				if err != nil {
9481					return err
9482				}
9483				jtg.Name = &name
9484			}
9485		case "type":
9486			if v != nil {
9487				var typeVar string
9488				err = json.Unmarshal(*v, &typeVar)
9489				if err != nil {
9490					return err
9491				}
9492				jtg.Type = &typeVar
9493			}
9494		}
9495	}
9496
9497	return nil
9498}
9499
9500// JobTargetGroupListResult a list of target groups.
9501type JobTargetGroupListResult struct {
9502	autorest.Response `json:"-"`
9503	// Value - READ-ONLY; Array of results.
9504	Value *[]JobTargetGroup `json:"value,omitempty"`
9505	// NextLink - READ-ONLY; Link to retrieve next page of results.
9506	NextLink *string `json:"nextLink,omitempty"`
9507}
9508
9509// MarshalJSON is the custom marshaler for JobTargetGroupListResult.
9510func (jtglr JobTargetGroupListResult) MarshalJSON() ([]byte, error) {
9511	objectMap := make(map[string]interface{})
9512	return json.Marshal(objectMap)
9513}
9514
9515// JobTargetGroupListResultIterator provides access to a complete listing of JobTargetGroup values.
9516type JobTargetGroupListResultIterator struct {
9517	i    int
9518	page JobTargetGroupListResultPage
9519}
9520
9521// NextWithContext advances to the next value.  If there was an error making
9522// the request the iterator does not advance and the error is returned.
9523func (iter *JobTargetGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
9524	if tracing.IsEnabled() {
9525		ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultIterator.NextWithContext")
9526		defer func() {
9527			sc := -1
9528			if iter.Response().Response.Response != nil {
9529				sc = iter.Response().Response.Response.StatusCode
9530			}
9531			tracing.EndSpan(ctx, sc, err)
9532		}()
9533	}
9534	iter.i++
9535	if iter.i < len(iter.page.Values()) {
9536		return nil
9537	}
9538	err = iter.page.NextWithContext(ctx)
9539	if err != nil {
9540		iter.i--
9541		return err
9542	}
9543	iter.i = 0
9544	return nil
9545}
9546
9547// Next advances to the next value.  If there was an error making
9548// the request the iterator does not advance and the error is returned.
9549// Deprecated: Use NextWithContext() instead.
9550func (iter *JobTargetGroupListResultIterator) Next() error {
9551	return iter.NextWithContext(context.Background())
9552}
9553
9554// NotDone returns true if the enumeration should be started or is not yet complete.
9555func (iter JobTargetGroupListResultIterator) NotDone() bool {
9556	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9557}
9558
9559// Response returns the raw server response from the last page request.
9560func (iter JobTargetGroupListResultIterator) Response() JobTargetGroupListResult {
9561	return iter.page.Response()
9562}
9563
9564// Value returns the current value or a zero-initialized value if the
9565// iterator has advanced beyond the end of the collection.
9566func (iter JobTargetGroupListResultIterator) Value() JobTargetGroup {
9567	if !iter.page.NotDone() {
9568		return JobTargetGroup{}
9569	}
9570	return iter.page.Values()[iter.i]
9571}
9572
9573// Creates a new instance of the JobTargetGroupListResultIterator type.
9574func NewJobTargetGroupListResultIterator(page JobTargetGroupListResultPage) JobTargetGroupListResultIterator {
9575	return JobTargetGroupListResultIterator{page: page}
9576}
9577
9578// IsEmpty returns true if the ListResult contains no values.
9579func (jtglr JobTargetGroupListResult) IsEmpty() bool {
9580	return jtglr.Value == nil || len(*jtglr.Value) == 0
9581}
9582
9583// hasNextLink returns true if the NextLink is not empty.
9584func (jtglr JobTargetGroupListResult) hasNextLink() bool {
9585	return jtglr.NextLink != nil && len(*jtglr.NextLink) != 0
9586}
9587
9588// jobTargetGroupListResultPreparer prepares a request to retrieve the next set of results.
9589// It returns nil if no more results exist.
9590func (jtglr JobTargetGroupListResult) jobTargetGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
9591	if !jtglr.hasNextLink() {
9592		return nil, nil
9593	}
9594	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9595		autorest.AsJSON(),
9596		autorest.AsGet(),
9597		autorest.WithBaseURL(to.String(jtglr.NextLink)))
9598}
9599
9600// JobTargetGroupListResultPage contains a page of JobTargetGroup values.
9601type JobTargetGroupListResultPage struct {
9602	fn    func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error)
9603	jtglr JobTargetGroupListResult
9604}
9605
9606// NextWithContext advances to the next page of values.  If there was an error making
9607// the request the page does not advance and the error is returned.
9608func (page *JobTargetGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
9609	if tracing.IsEnabled() {
9610		ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultPage.NextWithContext")
9611		defer func() {
9612			sc := -1
9613			if page.Response().Response.Response != nil {
9614				sc = page.Response().Response.Response.StatusCode
9615			}
9616			tracing.EndSpan(ctx, sc, err)
9617		}()
9618	}
9619	for {
9620		next, err := page.fn(ctx, page.jtglr)
9621		if err != nil {
9622			return err
9623		}
9624		page.jtglr = next
9625		if !next.hasNextLink() || !next.IsEmpty() {
9626			break
9627		}
9628	}
9629	return nil
9630}
9631
9632// Next advances to the next page of values.  If there was an error making
9633// the request the page does not advance and the error is returned.
9634// Deprecated: Use NextWithContext() instead.
9635func (page *JobTargetGroupListResultPage) Next() error {
9636	return page.NextWithContext(context.Background())
9637}
9638
9639// NotDone returns true if the page enumeration should be started or is not yet complete.
9640func (page JobTargetGroupListResultPage) NotDone() bool {
9641	return !page.jtglr.IsEmpty()
9642}
9643
9644// Response returns the raw server response from the last page request.
9645func (page JobTargetGroupListResultPage) Response() JobTargetGroupListResult {
9646	return page.jtglr
9647}
9648
9649// Values returns the slice of values for the current page or nil if there are no values.
9650func (page JobTargetGroupListResultPage) Values() []JobTargetGroup {
9651	if page.jtglr.IsEmpty() {
9652		return nil
9653	}
9654	return *page.jtglr.Value
9655}
9656
9657// Creates a new instance of the JobTargetGroupListResultPage type.
9658func NewJobTargetGroupListResultPage(cur JobTargetGroupListResult, getNextPage func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error)) JobTargetGroupListResultPage {
9659	return JobTargetGroupListResultPage{
9660		fn:    getNextPage,
9661		jtglr: cur,
9662	}
9663}
9664
9665// JobTargetGroupProperties properties of job target group.
9666type JobTargetGroupProperties struct {
9667	// Members - Members of the target group.
9668	Members *[]JobTarget `json:"members,omitempty"`
9669}
9670
9671// JobVersion a job version.
9672type JobVersion struct {
9673	autorest.Response `json:"-"`
9674	// ID - READ-ONLY; Resource ID.
9675	ID *string `json:"id,omitempty"`
9676	// Name - READ-ONLY; Resource name.
9677	Name *string `json:"name,omitempty"`
9678	// Type - READ-ONLY; Resource type.
9679	Type *string `json:"type,omitempty"`
9680}
9681
9682// MarshalJSON is the custom marshaler for JobVersion.
9683func (jv JobVersion) MarshalJSON() ([]byte, error) {
9684	objectMap := make(map[string]interface{})
9685	return json.Marshal(objectMap)
9686}
9687
9688// JobVersionListResult a list of job versions.
9689type JobVersionListResult struct {
9690	autorest.Response `json:"-"`
9691	// Value - READ-ONLY; Array of results.
9692	Value *[]JobVersion `json:"value,omitempty"`
9693	// NextLink - READ-ONLY; Link to retrieve next page of results.
9694	NextLink *string `json:"nextLink,omitempty"`
9695}
9696
9697// MarshalJSON is the custom marshaler for JobVersionListResult.
9698func (jvlr JobVersionListResult) MarshalJSON() ([]byte, error) {
9699	objectMap := make(map[string]interface{})
9700	return json.Marshal(objectMap)
9701}
9702
9703// JobVersionListResultIterator provides access to a complete listing of JobVersion values.
9704type JobVersionListResultIterator struct {
9705	i    int
9706	page JobVersionListResultPage
9707}
9708
9709// NextWithContext advances to the next value.  If there was an error making
9710// the request the iterator does not advance and the error is returned.
9711func (iter *JobVersionListResultIterator) NextWithContext(ctx context.Context) (err error) {
9712	if tracing.IsEnabled() {
9713		ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultIterator.NextWithContext")
9714		defer func() {
9715			sc := -1
9716			if iter.Response().Response.Response != nil {
9717				sc = iter.Response().Response.Response.StatusCode
9718			}
9719			tracing.EndSpan(ctx, sc, err)
9720		}()
9721	}
9722	iter.i++
9723	if iter.i < len(iter.page.Values()) {
9724		return nil
9725	}
9726	err = iter.page.NextWithContext(ctx)
9727	if err != nil {
9728		iter.i--
9729		return err
9730	}
9731	iter.i = 0
9732	return nil
9733}
9734
9735// Next advances to the next value.  If there was an error making
9736// the request the iterator does not advance and the error is returned.
9737// Deprecated: Use NextWithContext() instead.
9738func (iter *JobVersionListResultIterator) Next() error {
9739	return iter.NextWithContext(context.Background())
9740}
9741
9742// NotDone returns true if the enumeration should be started or is not yet complete.
9743func (iter JobVersionListResultIterator) NotDone() bool {
9744	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9745}
9746
9747// Response returns the raw server response from the last page request.
9748func (iter JobVersionListResultIterator) Response() JobVersionListResult {
9749	return iter.page.Response()
9750}
9751
9752// Value returns the current value or a zero-initialized value if the
9753// iterator has advanced beyond the end of the collection.
9754func (iter JobVersionListResultIterator) Value() JobVersion {
9755	if !iter.page.NotDone() {
9756		return JobVersion{}
9757	}
9758	return iter.page.Values()[iter.i]
9759}
9760
9761// Creates a new instance of the JobVersionListResultIterator type.
9762func NewJobVersionListResultIterator(page JobVersionListResultPage) JobVersionListResultIterator {
9763	return JobVersionListResultIterator{page: page}
9764}
9765
9766// IsEmpty returns true if the ListResult contains no values.
9767func (jvlr JobVersionListResult) IsEmpty() bool {
9768	return jvlr.Value == nil || len(*jvlr.Value) == 0
9769}
9770
9771// hasNextLink returns true if the NextLink is not empty.
9772func (jvlr JobVersionListResult) hasNextLink() bool {
9773	return jvlr.NextLink != nil && len(*jvlr.NextLink) != 0
9774}
9775
9776// jobVersionListResultPreparer prepares a request to retrieve the next set of results.
9777// It returns nil if no more results exist.
9778func (jvlr JobVersionListResult) jobVersionListResultPreparer(ctx context.Context) (*http.Request, error) {
9779	if !jvlr.hasNextLink() {
9780		return nil, nil
9781	}
9782	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9783		autorest.AsJSON(),
9784		autorest.AsGet(),
9785		autorest.WithBaseURL(to.String(jvlr.NextLink)))
9786}
9787
9788// JobVersionListResultPage contains a page of JobVersion values.
9789type JobVersionListResultPage struct {
9790	fn   func(context.Context, JobVersionListResult) (JobVersionListResult, error)
9791	jvlr JobVersionListResult
9792}
9793
9794// NextWithContext advances to the next page of values.  If there was an error making
9795// the request the page does not advance and the error is returned.
9796func (page *JobVersionListResultPage) NextWithContext(ctx context.Context) (err error) {
9797	if tracing.IsEnabled() {
9798		ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultPage.NextWithContext")
9799		defer func() {
9800			sc := -1
9801			if page.Response().Response.Response != nil {
9802				sc = page.Response().Response.Response.StatusCode
9803			}
9804			tracing.EndSpan(ctx, sc, err)
9805		}()
9806	}
9807	for {
9808		next, err := page.fn(ctx, page.jvlr)
9809		if err != nil {
9810			return err
9811		}
9812		page.jvlr = next
9813		if !next.hasNextLink() || !next.IsEmpty() {
9814			break
9815		}
9816	}
9817	return nil
9818}
9819
9820// Next advances to the next page of values.  If there was an error making
9821// the request the page does not advance and the error is returned.
9822// Deprecated: Use NextWithContext() instead.
9823func (page *JobVersionListResultPage) Next() error {
9824	return page.NextWithContext(context.Background())
9825}
9826
9827// NotDone returns true if the page enumeration should be started or is not yet complete.
9828func (page JobVersionListResultPage) NotDone() bool {
9829	return !page.jvlr.IsEmpty()
9830}
9831
9832// Response returns the raw server response from the last page request.
9833func (page JobVersionListResultPage) Response() JobVersionListResult {
9834	return page.jvlr
9835}
9836
9837// Values returns the slice of values for the current page or nil if there are no values.
9838func (page JobVersionListResultPage) Values() []JobVersion {
9839	if page.jvlr.IsEmpty() {
9840		return nil
9841	}
9842	return *page.jvlr.Value
9843}
9844
9845// Creates a new instance of the JobVersionListResultPage type.
9846func NewJobVersionListResultPage(cur JobVersionListResult, getNextPage func(context.Context, JobVersionListResult) (JobVersionListResult, error)) JobVersionListResultPage {
9847	return JobVersionListResultPage{
9848		fn:   getNextPage,
9849		jvlr: cur,
9850	}
9851}
9852
9853// LicenseTypeCapability the license type capability
9854type LicenseTypeCapability struct {
9855	// Name - READ-ONLY; License type identifier.
9856	Name *string `json:"name,omitempty"`
9857	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
9858	Status CapabilityStatus `json:"status,omitempty"`
9859	// Reason - The reason for the capability not being available.
9860	Reason *string `json:"reason,omitempty"`
9861}
9862
9863// MarshalJSON is the custom marshaler for LicenseTypeCapability.
9864func (ltc LicenseTypeCapability) MarshalJSON() ([]byte, error) {
9865	objectMap := make(map[string]interface{})
9866	if ltc.Reason != nil {
9867		objectMap["reason"] = ltc.Reason
9868	}
9869	return json.Marshal(objectMap)
9870}
9871
9872// LocationCapabilities the location capability.
9873type LocationCapabilities struct {
9874	autorest.Response `json:"-"`
9875	// Name - READ-ONLY; The location name.
9876	Name *string `json:"name,omitempty"`
9877	// SupportedServerVersions - READ-ONLY; The list of supported server versions.
9878	SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"`
9879	// SupportedManagedInstanceVersions - READ-ONLY; The list of supported managed instance versions.
9880	SupportedManagedInstanceVersions *[]ManagedInstanceVersionCapability `json:"supportedManagedInstanceVersions,omitempty"`
9881	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
9882	Status CapabilityStatus `json:"status,omitempty"`
9883	// Reason - The reason for the capability not being available.
9884	Reason *string `json:"reason,omitempty"`
9885}
9886
9887// MarshalJSON is the custom marshaler for LocationCapabilities.
9888func (lc LocationCapabilities) MarshalJSON() ([]byte, error) {
9889	objectMap := make(map[string]interface{})
9890	if lc.Reason != nil {
9891		objectMap["reason"] = lc.Reason
9892	}
9893	return json.Marshal(objectMap)
9894}
9895
9896// LogicalServerSecurityAlertPolicyListResult a list of the server's security alert policies.
9897type LogicalServerSecurityAlertPolicyListResult struct {
9898	autorest.Response `json:"-"`
9899	// Value - READ-ONLY; Array of results.
9900	Value *[]ServerSecurityAlertPolicy `json:"value,omitempty"`
9901	// NextLink - READ-ONLY; Link to retrieve next page of results.
9902	NextLink *string `json:"nextLink,omitempty"`
9903}
9904
9905// MarshalJSON is the custom marshaler for LogicalServerSecurityAlertPolicyListResult.
9906func (lssaplr LogicalServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) {
9907	objectMap := make(map[string]interface{})
9908	return json.Marshal(objectMap)
9909}
9910
9911// LogicalServerSecurityAlertPolicyListResultIterator provides access to a complete listing of
9912// ServerSecurityAlertPolicy values.
9913type LogicalServerSecurityAlertPolicyListResultIterator struct {
9914	i    int
9915	page LogicalServerSecurityAlertPolicyListResultPage
9916}
9917
9918// NextWithContext advances to the next value.  If there was an error making
9919// the request the iterator does not advance and the error is returned.
9920func (iter *LogicalServerSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
9921	if tracing.IsEnabled() {
9922		ctx = tracing.StartSpan(ctx, fqdn+"/LogicalServerSecurityAlertPolicyListResultIterator.NextWithContext")
9923		defer func() {
9924			sc := -1
9925			if iter.Response().Response.Response != nil {
9926				sc = iter.Response().Response.Response.StatusCode
9927			}
9928			tracing.EndSpan(ctx, sc, err)
9929		}()
9930	}
9931	iter.i++
9932	if iter.i < len(iter.page.Values()) {
9933		return nil
9934	}
9935	err = iter.page.NextWithContext(ctx)
9936	if err != nil {
9937		iter.i--
9938		return err
9939	}
9940	iter.i = 0
9941	return nil
9942}
9943
9944// Next advances to the next value.  If there was an error making
9945// the request the iterator does not advance and the error is returned.
9946// Deprecated: Use NextWithContext() instead.
9947func (iter *LogicalServerSecurityAlertPolicyListResultIterator) Next() error {
9948	return iter.NextWithContext(context.Background())
9949}
9950
9951// NotDone returns true if the enumeration should be started or is not yet complete.
9952func (iter LogicalServerSecurityAlertPolicyListResultIterator) NotDone() bool {
9953	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9954}
9955
9956// Response returns the raw server response from the last page request.
9957func (iter LogicalServerSecurityAlertPolicyListResultIterator) Response() LogicalServerSecurityAlertPolicyListResult {
9958	return iter.page.Response()
9959}
9960
9961// Value returns the current value or a zero-initialized value if the
9962// iterator has advanced beyond the end of the collection.
9963func (iter LogicalServerSecurityAlertPolicyListResultIterator) Value() ServerSecurityAlertPolicy {
9964	if !iter.page.NotDone() {
9965		return ServerSecurityAlertPolicy{}
9966	}
9967	return iter.page.Values()[iter.i]
9968}
9969
9970// Creates a new instance of the LogicalServerSecurityAlertPolicyListResultIterator type.
9971func NewLogicalServerSecurityAlertPolicyListResultIterator(page LogicalServerSecurityAlertPolicyListResultPage) LogicalServerSecurityAlertPolicyListResultIterator {
9972	return LogicalServerSecurityAlertPolicyListResultIterator{page: page}
9973}
9974
9975// IsEmpty returns true if the ListResult contains no values.
9976func (lssaplr LogicalServerSecurityAlertPolicyListResult) IsEmpty() bool {
9977	return lssaplr.Value == nil || len(*lssaplr.Value) == 0
9978}
9979
9980// hasNextLink returns true if the NextLink is not empty.
9981func (lssaplr LogicalServerSecurityAlertPolicyListResult) hasNextLink() bool {
9982	return lssaplr.NextLink != nil && len(*lssaplr.NextLink) != 0
9983}
9984
9985// logicalServerSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
9986// It returns nil if no more results exist.
9987func (lssaplr LogicalServerSecurityAlertPolicyListResult) logicalServerSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
9988	if !lssaplr.hasNextLink() {
9989		return nil, nil
9990	}
9991	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9992		autorest.AsJSON(),
9993		autorest.AsGet(),
9994		autorest.WithBaseURL(to.String(lssaplr.NextLink)))
9995}
9996
9997// LogicalServerSecurityAlertPolicyListResultPage contains a page of ServerSecurityAlertPolicy values.
9998type LogicalServerSecurityAlertPolicyListResultPage struct {
9999	fn      func(context.Context, LogicalServerSecurityAlertPolicyListResult) (LogicalServerSecurityAlertPolicyListResult, error)
10000	lssaplr LogicalServerSecurityAlertPolicyListResult
10001}
10002
10003// NextWithContext advances to the next page of values.  If there was an error making
10004// the request the page does not advance and the error is returned.
10005func (page *LogicalServerSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
10006	if tracing.IsEnabled() {
10007		ctx = tracing.StartSpan(ctx, fqdn+"/LogicalServerSecurityAlertPolicyListResultPage.NextWithContext")
10008		defer func() {
10009			sc := -1
10010			if page.Response().Response.Response != nil {
10011				sc = page.Response().Response.Response.StatusCode
10012			}
10013			tracing.EndSpan(ctx, sc, err)
10014		}()
10015	}
10016	for {
10017		next, err := page.fn(ctx, page.lssaplr)
10018		if err != nil {
10019			return err
10020		}
10021		page.lssaplr = next
10022		if !next.hasNextLink() || !next.IsEmpty() {
10023			break
10024		}
10025	}
10026	return nil
10027}
10028
10029// Next advances to the next page of values.  If there was an error making
10030// the request the page does not advance and the error is returned.
10031// Deprecated: Use NextWithContext() instead.
10032func (page *LogicalServerSecurityAlertPolicyListResultPage) Next() error {
10033	return page.NextWithContext(context.Background())
10034}
10035
10036// NotDone returns true if the page enumeration should be started or is not yet complete.
10037func (page LogicalServerSecurityAlertPolicyListResultPage) NotDone() bool {
10038	return !page.lssaplr.IsEmpty()
10039}
10040
10041// Response returns the raw server response from the last page request.
10042func (page LogicalServerSecurityAlertPolicyListResultPage) Response() LogicalServerSecurityAlertPolicyListResult {
10043	return page.lssaplr
10044}
10045
10046// Values returns the slice of values for the current page or nil if there are no values.
10047func (page LogicalServerSecurityAlertPolicyListResultPage) Values() []ServerSecurityAlertPolicy {
10048	if page.lssaplr.IsEmpty() {
10049		return nil
10050	}
10051	return *page.lssaplr.Value
10052}
10053
10054// Creates a new instance of the LogicalServerSecurityAlertPolicyListResultPage type.
10055func NewLogicalServerSecurityAlertPolicyListResultPage(cur LogicalServerSecurityAlertPolicyListResult, getNextPage func(context.Context, LogicalServerSecurityAlertPolicyListResult) (LogicalServerSecurityAlertPolicyListResult, error)) LogicalServerSecurityAlertPolicyListResultPage {
10056	return LogicalServerSecurityAlertPolicyListResultPage{
10057		fn:      getNextPage,
10058		lssaplr: cur,
10059	}
10060}
10061
10062// LogSizeCapability the log size capability.
10063type LogSizeCapability struct {
10064	// Limit - READ-ONLY; The log size limit (see 'unit' for the units).
10065	Limit *int32 `json:"limit,omitempty"`
10066	// Unit - READ-ONLY; The units that the limit is expressed in. Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', 'Percent'
10067	Unit LogSizeUnit `json:"unit,omitempty"`
10068}
10069
10070// MarshalJSON is the custom marshaler for LogSizeCapability.
10071func (lsc LogSizeCapability) MarshalJSON() ([]byte, error) {
10072	objectMap := make(map[string]interface{})
10073	return json.Marshal(objectMap)
10074}
10075
10076// LongTermRetentionBackup a long term retention backup.
10077type LongTermRetentionBackup struct {
10078	autorest.Response `json:"-"`
10079	// LongTermRetentionBackupProperties - Resource properties.
10080	*LongTermRetentionBackupProperties `json:"properties,omitempty"`
10081	// ID - READ-ONLY; Resource ID.
10082	ID *string `json:"id,omitempty"`
10083	// Name - READ-ONLY; Resource name.
10084	Name *string `json:"name,omitempty"`
10085	// Type - READ-ONLY; Resource type.
10086	Type *string `json:"type,omitempty"`
10087}
10088
10089// MarshalJSON is the custom marshaler for LongTermRetentionBackup.
10090func (ltrb LongTermRetentionBackup) MarshalJSON() ([]byte, error) {
10091	objectMap := make(map[string]interface{})
10092	if ltrb.LongTermRetentionBackupProperties != nil {
10093		objectMap["properties"] = ltrb.LongTermRetentionBackupProperties
10094	}
10095	return json.Marshal(objectMap)
10096}
10097
10098// UnmarshalJSON is the custom unmarshaler for LongTermRetentionBackup struct.
10099func (ltrb *LongTermRetentionBackup) UnmarshalJSON(body []byte) error {
10100	var m map[string]*json.RawMessage
10101	err := json.Unmarshal(body, &m)
10102	if err != nil {
10103		return err
10104	}
10105	for k, v := range m {
10106		switch k {
10107		case "properties":
10108			if v != nil {
10109				var longTermRetentionBackupProperties LongTermRetentionBackupProperties
10110				err = json.Unmarshal(*v, &longTermRetentionBackupProperties)
10111				if err != nil {
10112					return err
10113				}
10114				ltrb.LongTermRetentionBackupProperties = &longTermRetentionBackupProperties
10115			}
10116		case "id":
10117			if v != nil {
10118				var ID string
10119				err = json.Unmarshal(*v, &ID)
10120				if err != nil {
10121					return err
10122				}
10123				ltrb.ID = &ID
10124			}
10125		case "name":
10126			if v != nil {
10127				var name string
10128				err = json.Unmarshal(*v, &name)
10129				if err != nil {
10130					return err
10131				}
10132				ltrb.Name = &name
10133			}
10134		case "type":
10135			if v != nil {
10136				var typeVar string
10137				err = json.Unmarshal(*v, &typeVar)
10138				if err != nil {
10139					return err
10140				}
10141				ltrb.Type = &typeVar
10142			}
10143		}
10144	}
10145
10146	return nil
10147}
10148
10149// LongTermRetentionBackupListResult a list of long term retention backups.
10150type LongTermRetentionBackupListResult struct {
10151	autorest.Response `json:"-"`
10152	// Value - READ-ONLY; Array of results.
10153	Value *[]LongTermRetentionBackup `json:"value,omitempty"`
10154	// NextLink - READ-ONLY; Link to retrieve next page of results.
10155	NextLink *string `json:"nextLink,omitempty"`
10156}
10157
10158// MarshalJSON is the custom marshaler for LongTermRetentionBackupListResult.
10159func (ltrblr LongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) {
10160	objectMap := make(map[string]interface{})
10161	return json.Marshal(objectMap)
10162}
10163
10164// LongTermRetentionBackupListResultIterator provides access to a complete listing of
10165// LongTermRetentionBackup values.
10166type LongTermRetentionBackupListResultIterator struct {
10167	i    int
10168	page LongTermRetentionBackupListResultPage
10169}
10170
10171// NextWithContext advances to the next value.  If there was an error making
10172// the request the iterator does not advance and the error is returned.
10173func (iter *LongTermRetentionBackupListResultIterator) NextWithContext(ctx context.Context) (err error) {
10174	if tracing.IsEnabled() {
10175		ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultIterator.NextWithContext")
10176		defer func() {
10177			sc := -1
10178			if iter.Response().Response.Response != nil {
10179				sc = iter.Response().Response.Response.StatusCode
10180			}
10181			tracing.EndSpan(ctx, sc, err)
10182		}()
10183	}
10184	iter.i++
10185	if iter.i < len(iter.page.Values()) {
10186		return nil
10187	}
10188	err = iter.page.NextWithContext(ctx)
10189	if err != nil {
10190		iter.i--
10191		return err
10192	}
10193	iter.i = 0
10194	return nil
10195}
10196
10197// Next advances to the next value.  If there was an error making
10198// the request the iterator does not advance and the error is returned.
10199// Deprecated: Use NextWithContext() instead.
10200func (iter *LongTermRetentionBackupListResultIterator) Next() error {
10201	return iter.NextWithContext(context.Background())
10202}
10203
10204// NotDone returns true if the enumeration should be started or is not yet complete.
10205func (iter LongTermRetentionBackupListResultIterator) NotDone() bool {
10206	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10207}
10208
10209// Response returns the raw server response from the last page request.
10210func (iter LongTermRetentionBackupListResultIterator) Response() LongTermRetentionBackupListResult {
10211	return iter.page.Response()
10212}
10213
10214// Value returns the current value or a zero-initialized value if the
10215// iterator has advanced beyond the end of the collection.
10216func (iter LongTermRetentionBackupListResultIterator) Value() LongTermRetentionBackup {
10217	if !iter.page.NotDone() {
10218		return LongTermRetentionBackup{}
10219	}
10220	return iter.page.Values()[iter.i]
10221}
10222
10223// Creates a new instance of the LongTermRetentionBackupListResultIterator type.
10224func NewLongTermRetentionBackupListResultIterator(page LongTermRetentionBackupListResultPage) LongTermRetentionBackupListResultIterator {
10225	return LongTermRetentionBackupListResultIterator{page: page}
10226}
10227
10228// IsEmpty returns true if the ListResult contains no values.
10229func (ltrblr LongTermRetentionBackupListResult) IsEmpty() bool {
10230	return ltrblr.Value == nil || len(*ltrblr.Value) == 0
10231}
10232
10233// hasNextLink returns true if the NextLink is not empty.
10234func (ltrblr LongTermRetentionBackupListResult) hasNextLink() bool {
10235	return ltrblr.NextLink != nil && len(*ltrblr.NextLink) != 0
10236}
10237
10238// longTermRetentionBackupListResultPreparer prepares a request to retrieve the next set of results.
10239// It returns nil if no more results exist.
10240func (ltrblr LongTermRetentionBackupListResult) longTermRetentionBackupListResultPreparer(ctx context.Context) (*http.Request, error) {
10241	if !ltrblr.hasNextLink() {
10242		return nil, nil
10243	}
10244	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10245		autorest.AsJSON(),
10246		autorest.AsGet(),
10247		autorest.WithBaseURL(to.String(ltrblr.NextLink)))
10248}
10249
10250// LongTermRetentionBackupListResultPage contains a page of LongTermRetentionBackup values.
10251type LongTermRetentionBackupListResultPage struct {
10252	fn     func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error)
10253	ltrblr LongTermRetentionBackupListResult
10254}
10255
10256// NextWithContext advances to the next page of values.  If there was an error making
10257// the request the page does not advance and the error is returned.
10258func (page *LongTermRetentionBackupListResultPage) NextWithContext(ctx context.Context) (err error) {
10259	if tracing.IsEnabled() {
10260		ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultPage.NextWithContext")
10261		defer func() {
10262			sc := -1
10263			if page.Response().Response.Response != nil {
10264				sc = page.Response().Response.Response.StatusCode
10265			}
10266			tracing.EndSpan(ctx, sc, err)
10267		}()
10268	}
10269	for {
10270		next, err := page.fn(ctx, page.ltrblr)
10271		if err != nil {
10272			return err
10273		}
10274		page.ltrblr = next
10275		if !next.hasNextLink() || !next.IsEmpty() {
10276			break
10277		}
10278	}
10279	return nil
10280}
10281
10282// Next advances to the next page of values.  If there was an error making
10283// the request the page does not advance and the error is returned.
10284// Deprecated: Use NextWithContext() instead.
10285func (page *LongTermRetentionBackupListResultPage) Next() error {
10286	return page.NextWithContext(context.Background())
10287}
10288
10289// NotDone returns true if the page enumeration should be started or is not yet complete.
10290func (page LongTermRetentionBackupListResultPage) NotDone() bool {
10291	return !page.ltrblr.IsEmpty()
10292}
10293
10294// Response returns the raw server response from the last page request.
10295func (page LongTermRetentionBackupListResultPage) Response() LongTermRetentionBackupListResult {
10296	return page.ltrblr
10297}
10298
10299// Values returns the slice of values for the current page or nil if there are no values.
10300func (page LongTermRetentionBackupListResultPage) Values() []LongTermRetentionBackup {
10301	if page.ltrblr.IsEmpty() {
10302		return nil
10303	}
10304	return *page.ltrblr.Value
10305}
10306
10307// Creates a new instance of the LongTermRetentionBackupListResultPage type.
10308func NewLongTermRetentionBackupListResultPage(cur LongTermRetentionBackupListResult, getNextPage func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error)) LongTermRetentionBackupListResultPage {
10309	return LongTermRetentionBackupListResultPage{
10310		fn:     getNextPage,
10311		ltrblr: cur,
10312	}
10313}
10314
10315// LongTermRetentionBackupProperties properties of a long term retention backup
10316type LongTermRetentionBackupProperties struct {
10317	// ServerName - READ-ONLY; The server name that the backup database belong to.
10318	ServerName *string `json:"serverName,omitempty"`
10319	// ServerCreateTime - READ-ONLY; The create time of the server.
10320	ServerCreateTime *date.Time `json:"serverCreateTime,omitempty"`
10321	// DatabaseName - READ-ONLY; The name of the database the backup belong to
10322	DatabaseName *string `json:"databaseName,omitempty"`
10323	// DatabaseDeletionTime - READ-ONLY; The delete time of the database
10324	DatabaseDeletionTime *date.Time `json:"databaseDeletionTime,omitempty"`
10325	// BackupTime - READ-ONLY; The time the backup was taken
10326	BackupTime *date.Time `json:"backupTime,omitempty"`
10327	// BackupExpirationTime - READ-ONLY; The time the long term retention backup will expire.
10328	BackupExpirationTime *date.Time `json:"backupExpirationTime,omitempty"`
10329}
10330
10331// MarshalJSON is the custom marshaler for LongTermRetentionBackupProperties.
10332func (ltrbp LongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) {
10333	objectMap := make(map[string]interface{})
10334	return json.Marshal(objectMap)
10335}
10336
10337// LongTermRetentionBackupsDeleteByResourceGroupFuture an abstraction for monitoring and retrieving the
10338// results of a long-running operation.
10339type LongTermRetentionBackupsDeleteByResourceGroupFuture struct {
10340	azure.FutureAPI
10341	// Result returns the result of the asynchronous operation.
10342	// If the operation has not completed it will return an error.
10343	Result func(LongTermRetentionBackupsClient) (autorest.Response, error)
10344}
10345
10346// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10347func (future *LongTermRetentionBackupsDeleteByResourceGroupFuture) UnmarshalJSON(body []byte) error {
10348	var azFuture azure.Future
10349	if err := json.Unmarshal(body, &azFuture); err != nil {
10350		return err
10351	}
10352	future.FutureAPI = &azFuture
10353	future.Result = future.result
10354	return nil
10355}
10356
10357// result is the default implementation for LongTermRetentionBackupsDeleteByResourceGroupFuture.Result.
10358func (future *LongTermRetentionBackupsDeleteByResourceGroupFuture) result(client LongTermRetentionBackupsClient) (ar autorest.Response, err error) {
10359	var done bool
10360	done, err = future.DoneWithContext(context.Background(), client)
10361	if err != nil {
10362		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsDeleteByResourceGroupFuture", "Result", future.Response(), "Polling failure")
10363		return
10364	}
10365	if !done {
10366		ar.Response = future.Response()
10367		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsDeleteByResourceGroupFuture")
10368		return
10369	}
10370	ar.Response = future.Response()
10371	return
10372}
10373
10374// LongTermRetentionBackupsDeleteFuture an abstraction for monitoring and retrieving the results of a
10375// long-running operation.
10376type LongTermRetentionBackupsDeleteFuture struct {
10377	azure.FutureAPI
10378	// Result returns the result of the asynchronous operation.
10379	// If the operation has not completed it will return an error.
10380	Result func(LongTermRetentionBackupsClient) (autorest.Response, error)
10381}
10382
10383// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10384func (future *LongTermRetentionBackupsDeleteFuture) UnmarshalJSON(body []byte) error {
10385	var azFuture azure.Future
10386	if err := json.Unmarshal(body, &azFuture); err != nil {
10387		return err
10388	}
10389	future.FutureAPI = &azFuture
10390	future.Result = future.result
10391	return nil
10392}
10393
10394// result is the default implementation for LongTermRetentionBackupsDeleteFuture.Result.
10395func (future *LongTermRetentionBackupsDeleteFuture) result(client LongTermRetentionBackupsClient) (ar autorest.Response, err error) {
10396	var done bool
10397	done, err = future.DoneWithContext(context.Background(), client)
10398	if err != nil {
10399		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsDeleteFuture", "Result", future.Response(), "Polling failure")
10400		return
10401	}
10402	if !done {
10403		ar.Response = future.Response()
10404		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsDeleteFuture")
10405		return
10406	}
10407	ar.Response = future.Response()
10408	return
10409}
10410
10411// LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture an abstraction for monitoring and
10412// retrieving the results of a long-running operation.
10413type LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture struct {
10414	azure.FutureAPI
10415	// Result returns the result of the asynchronous operation.
10416	// If the operation has not completed it will return an error.
10417	Result func(LongTermRetentionManagedInstanceBackupsClient) (autorest.Response, error)
10418}
10419
10420// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10421func (future *LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture) UnmarshalJSON(body []byte) error {
10422	var azFuture azure.Future
10423	if err := json.Unmarshal(body, &azFuture); err != nil {
10424		return err
10425	}
10426	future.FutureAPI = &azFuture
10427	future.Result = future.result
10428	return nil
10429}
10430
10431// result is the default implementation for LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture.Result.
10432func (future *LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture) result(client LongTermRetentionManagedInstanceBackupsClient) (ar autorest.Response, err error) {
10433	var done bool
10434	done, err = future.DoneWithContext(context.Background(), client)
10435	if err != nil {
10436		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture", "Result", future.Response(), "Polling failure")
10437		return
10438	}
10439	if !done {
10440		ar.Response = future.Response()
10441		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture")
10442		return
10443	}
10444	ar.Response = future.Response()
10445	return
10446}
10447
10448// LongTermRetentionManagedInstanceBackupsDeleteFuture an abstraction for monitoring and retrieving the
10449// results of a long-running operation.
10450type LongTermRetentionManagedInstanceBackupsDeleteFuture struct {
10451	azure.FutureAPI
10452	// Result returns the result of the asynchronous operation.
10453	// If the operation has not completed it will return an error.
10454	Result func(LongTermRetentionManagedInstanceBackupsClient) (autorest.Response, error)
10455}
10456
10457// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10458func (future *LongTermRetentionManagedInstanceBackupsDeleteFuture) UnmarshalJSON(body []byte) error {
10459	var azFuture azure.Future
10460	if err := json.Unmarshal(body, &azFuture); err != nil {
10461		return err
10462	}
10463	future.FutureAPI = &azFuture
10464	future.Result = future.result
10465	return nil
10466}
10467
10468// result is the default implementation for LongTermRetentionManagedInstanceBackupsDeleteFuture.Result.
10469func (future *LongTermRetentionManagedInstanceBackupsDeleteFuture) result(client LongTermRetentionManagedInstanceBackupsClient) (ar autorest.Response, err error) {
10470	var done bool
10471	done, err = future.DoneWithContext(context.Background(), client)
10472	if err != nil {
10473		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionManagedInstanceBackupsDeleteFuture", "Result", future.Response(), "Polling failure")
10474		return
10475	}
10476	if !done {
10477		ar.Response = future.Response()
10478		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionManagedInstanceBackupsDeleteFuture")
10479		return
10480	}
10481	ar.Response = future.Response()
10482	return
10483}
10484
10485// LongTermRetentionPolicyProperties properties of a long term retention policy
10486type LongTermRetentionPolicyProperties struct {
10487	// WeeklyRetention - The weekly retention policy for an LTR backup in an ISO 8601 format.
10488	WeeklyRetention *string `json:"weeklyRetention,omitempty"`
10489	// MonthlyRetention - The monthly retention policy for an LTR backup in an ISO 8601 format.
10490	MonthlyRetention *string `json:"monthlyRetention,omitempty"`
10491	// YearlyRetention - The yearly retention policy for an LTR backup in an ISO 8601 format.
10492	YearlyRetention *string `json:"yearlyRetention,omitempty"`
10493	// WeekOfYear - The week of year to take the yearly backup in an ISO 8601 format.
10494	WeekOfYear *int32 `json:"weekOfYear,omitempty"`
10495}
10496
10497// MaintenanceConfigurationCapability the maintenance configuration capability
10498type MaintenanceConfigurationCapability struct {
10499	// Name - READ-ONLY; Maintenance configuration name
10500	Name *string `json:"name,omitempty"`
10501	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the maintenance configuration.
10502	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
10503	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
10504	Status CapabilityStatus `json:"status,omitempty"`
10505	// Reason - The reason for the capability not being available.
10506	Reason *string `json:"reason,omitempty"`
10507}
10508
10509// MarshalJSON is the custom marshaler for MaintenanceConfigurationCapability.
10510func (mcc MaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) {
10511	objectMap := make(map[string]interface{})
10512	if mcc.Reason != nil {
10513		objectMap["reason"] = mcc.Reason
10514	}
10515	return json.Marshal(objectMap)
10516}
10517
10518// ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving
10519// the results of a long-running operation.
10520type ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture struct {
10521	azure.FutureAPI
10522	// Result returns the result of the asynchronous operation.
10523	// If the operation has not completed it will return an error.
10524	Result func(ManagedBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
10525}
10526
10527// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10528func (future *ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
10529	var azFuture azure.Future
10530	if err := json.Unmarshal(body, &azFuture); err != nil {
10531		return err
10532	}
10533	future.FutureAPI = &azFuture
10534	future.Result = future.result
10535	return nil
10536}
10537
10538// result is the default implementation for ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture.Result.
10539func (future *ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture) result(client ManagedBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) {
10540	var done bool
10541	done, err = future.DoneWithContext(context.Background(), client)
10542	if err != nil {
10543		err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10544		return
10545	}
10546	if !done {
10547		mbstrp.Response.Response = future.Response()
10548		err = azure.NewAsyncOpIncompleteError("sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture")
10549		return
10550	}
10551	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10552	if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent {
10553		mbstrp, err = client.CreateOrUpdateResponder(mbstrp.Response.Response)
10554		if err != nil {
10555			err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request")
10556		}
10557	}
10558	return
10559}
10560
10561// ManagedBackupShortTermRetentionPoliciesUpdateFuture an abstraction for monitoring and retrieving the
10562// results of a long-running operation.
10563type ManagedBackupShortTermRetentionPoliciesUpdateFuture struct {
10564	azure.FutureAPI
10565	// Result returns the result of the asynchronous operation.
10566	// If the operation has not completed it will return an error.
10567	Result func(ManagedBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
10568}
10569
10570// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10571func (future *ManagedBackupShortTermRetentionPoliciesUpdateFuture) UnmarshalJSON(body []byte) error {
10572	var azFuture azure.Future
10573	if err := json.Unmarshal(body, &azFuture); err != nil {
10574		return err
10575	}
10576	future.FutureAPI = &azFuture
10577	future.Result = future.result
10578	return nil
10579}
10580
10581// result is the default implementation for ManagedBackupShortTermRetentionPoliciesUpdateFuture.Result.
10582func (future *ManagedBackupShortTermRetentionPoliciesUpdateFuture) result(client ManagedBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) {
10583	var done bool
10584	done, err = future.DoneWithContext(context.Background(), client)
10585	if err != nil {
10586		err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture", "Result", future.Response(), "Polling failure")
10587		return
10588	}
10589	if !done {
10590		mbstrp.Response.Response = future.Response()
10591		err = azure.NewAsyncOpIncompleteError("sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture")
10592		return
10593	}
10594	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10595	if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent {
10596		mbstrp, err = client.UpdateResponder(mbstrp.Response.Response)
10597		if err != nil {
10598			err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request")
10599		}
10600	}
10601	return
10602}
10603
10604// ManagedBackupShortTermRetentionPolicy a short term retention policy.
10605type ManagedBackupShortTermRetentionPolicy struct {
10606	autorest.Response `json:"-"`
10607	// ManagedBackupShortTermRetentionPolicyProperties - Resource properties.
10608	*ManagedBackupShortTermRetentionPolicyProperties `json:"properties,omitempty"`
10609	// ID - READ-ONLY; Resource ID.
10610	ID *string `json:"id,omitempty"`
10611	// Name - READ-ONLY; Resource name.
10612	Name *string `json:"name,omitempty"`
10613	// Type - READ-ONLY; Resource type.
10614	Type *string `json:"type,omitempty"`
10615}
10616
10617// MarshalJSON is the custom marshaler for ManagedBackupShortTermRetentionPolicy.
10618func (mbstrp ManagedBackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) {
10619	objectMap := make(map[string]interface{})
10620	if mbstrp.ManagedBackupShortTermRetentionPolicyProperties != nil {
10621		objectMap["properties"] = mbstrp.ManagedBackupShortTermRetentionPolicyProperties
10622	}
10623	return json.Marshal(objectMap)
10624}
10625
10626// UnmarshalJSON is the custom unmarshaler for ManagedBackupShortTermRetentionPolicy struct.
10627func (mbstrp *ManagedBackupShortTermRetentionPolicy) UnmarshalJSON(body []byte) error {
10628	var m map[string]*json.RawMessage
10629	err := json.Unmarshal(body, &m)
10630	if err != nil {
10631		return err
10632	}
10633	for k, v := range m {
10634		switch k {
10635		case "properties":
10636			if v != nil {
10637				var managedBackupShortTermRetentionPolicyProperties ManagedBackupShortTermRetentionPolicyProperties
10638				err = json.Unmarshal(*v, &managedBackupShortTermRetentionPolicyProperties)
10639				if err != nil {
10640					return err
10641				}
10642				mbstrp.ManagedBackupShortTermRetentionPolicyProperties = &managedBackupShortTermRetentionPolicyProperties
10643			}
10644		case "id":
10645			if v != nil {
10646				var ID string
10647				err = json.Unmarshal(*v, &ID)
10648				if err != nil {
10649					return err
10650				}
10651				mbstrp.ID = &ID
10652			}
10653		case "name":
10654			if v != nil {
10655				var name string
10656				err = json.Unmarshal(*v, &name)
10657				if err != nil {
10658					return err
10659				}
10660				mbstrp.Name = &name
10661			}
10662		case "type":
10663			if v != nil {
10664				var typeVar string
10665				err = json.Unmarshal(*v, &typeVar)
10666				if err != nil {
10667					return err
10668				}
10669				mbstrp.Type = &typeVar
10670			}
10671		}
10672	}
10673
10674	return nil
10675}
10676
10677// ManagedBackupShortTermRetentionPolicyListResult a list of short term retention policies.
10678type ManagedBackupShortTermRetentionPolicyListResult struct {
10679	autorest.Response `json:"-"`
10680	// Value - READ-ONLY; Array of results.
10681	Value *[]ManagedBackupShortTermRetentionPolicy `json:"value,omitempty"`
10682	// NextLink - READ-ONLY; Link to retrieve next page of results.
10683	NextLink *string `json:"nextLink,omitempty"`
10684}
10685
10686// MarshalJSON is the custom marshaler for ManagedBackupShortTermRetentionPolicyListResult.
10687func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) {
10688	objectMap := make(map[string]interface{})
10689	return json.Marshal(objectMap)
10690}
10691
10692// ManagedBackupShortTermRetentionPolicyListResultIterator provides access to a complete listing of
10693// ManagedBackupShortTermRetentionPolicy values.
10694type ManagedBackupShortTermRetentionPolicyListResultIterator struct {
10695	i    int
10696	page ManagedBackupShortTermRetentionPolicyListResultPage
10697}
10698
10699// NextWithContext advances to the next value.  If there was an error making
10700// the request the iterator does not advance and the error is returned.
10701func (iter *ManagedBackupShortTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
10702	if tracing.IsEnabled() {
10703		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPolicyListResultIterator.NextWithContext")
10704		defer func() {
10705			sc := -1
10706			if iter.Response().Response.Response != nil {
10707				sc = iter.Response().Response.Response.StatusCode
10708			}
10709			tracing.EndSpan(ctx, sc, err)
10710		}()
10711	}
10712	iter.i++
10713	if iter.i < len(iter.page.Values()) {
10714		return nil
10715	}
10716	err = iter.page.NextWithContext(ctx)
10717	if err != nil {
10718		iter.i--
10719		return err
10720	}
10721	iter.i = 0
10722	return nil
10723}
10724
10725// Next advances to the next value.  If there was an error making
10726// the request the iterator does not advance and the error is returned.
10727// Deprecated: Use NextWithContext() instead.
10728func (iter *ManagedBackupShortTermRetentionPolicyListResultIterator) Next() error {
10729	return iter.NextWithContext(context.Background())
10730}
10731
10732// NotDone returns true if the enumeration should be started or is not yet complete.
10733func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) NotDone() bool {
10734	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10735}
10736
10737// Response returns the raw server response from the last page request.
10738func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) Response() ManagedBackupShortTermRetentionPolicyListResult {
10739	return iter.page.Response()
10740}
10741
10742// Value returns the current value or a zero-initialized value if the
10743// iterator has advanced beyond the end of the collection.
10744func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) Value() ManagedBackupShortTermRetentionPolicy {
10745	if !iter.page.NotDone() {
10746		return ManagedBackupShortTermRetentionPolicy{}
10747	}
10748	return iter.page.Values()[iter.i]
10749}
10750
10751// Creates a new instance of the ManagedBackupShortTermRetentionPolicyListResultIterator type.
10752func NewManagedBackupShortTermRetentionPolicyListResultIterator(page ManagedBackupShortTermRetentionPolicyListResultPage) ManagedBackupShortTermRetentionPolicyListResultIterator {
10753	return ManagedBackupShortTermRetentionPolicyListResultIterator{page: page}
10754}
10755
10756// IsEmpty returns true if the ListResult contains no values.
10757func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) IsEmpty() bool {
10758	return mbstrplr.Value == nil || len(*mbstrplr.Value) == 0
10759}
10760
10761// hasNextLink returns true if the NextLink is not empty.
10762func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) hasNextLink() bool {
10763	return mbstrplr.NextLink != nil && len(*mbstrplr.NextLink) != 0
10764}
10765
10766// managedBackupShortTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results.
10767// It returns nil if no more results exist.
10768func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) managedBackupShortTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
10769	if !mbstrplr.hasNextLink() {
10770		return nil, nil
10771	}
10772	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10773		autorest.AsJSON(),
10774		autorest.AsGet(),
10775		autorest.WithBaseURL(to.String(mbstrplr.NextLink)))
10776}
10777
10778// ManagedBackupShortTermRetentionPolicyListResultPage contains a page of
10779// ManagedBackupShortTermRetentionPolicy values.
10780type ManagedBackupShortTermRetentionPolicyListResultPage struct {
10781	fn       func(context.Context, ManagedBackupShortTermRetentionPolicyListResult) (ManagedBackupShortTermRetentionPolicyListResult, error)
10782	mbstrplr ManagedBackupShortTermRetentionPolicyListResult
10783}
10784
10785// NextWithContext advances to the next page of values.  If there was an error making
10786// the request the page does not advance and the error is returned.
10787func (page *ManagedBackupShortTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
10788	if tracing.IsEnabled() {
10789		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPolicyListResultPage.NextWithContext")
10790		defer func() {
10791			sc := -1
10792			if page.Response().Response.Response != nil {
10793				sc = page.Response().Response.Response.StatusCode
10794			}
10795			tracing.EndSpan(ctx, sc, err)
10796		}()
10797	}
10798	for {
10799		next, err := page.fn(ctx, page.mbstrplr)
10800		if err != nil {
10801			return err
10802		}
10803		page.mbstrplr = next
10804		if !next.hasNextLink() || !next.IsEmpty() {
10805			break
10806		}
10807	}
10808	return nil
10809}
10810
10811// Next advances to the next page of values.  If there was an error making
10812// the request the page does not advance and the error is returned.
10813// Deprecated: Use NextWithContext() instead.
10814func (page *ManagedBackupShortTermRetentionPolicyListResultPage) Next() error {
10815	return page.NextWithContext(context.Background())
10816}
10817
10818// NotDone returns true if the page enumeration should be started or is not yet complete.
10819func (page ManagedBackupShortTermRetentionPolicyListResultPage) NotDone() bool {
10820	return !page.mbstrplr.IsEmpty()
10821}
10822
10823// Response returns the raw server response from the last page request.
10824func (page ManagedBackupShortTermRetentionPolicyListResultPage) Response() ManagedBackupShortTermRetentionPolicyListResult {
10825	return page.mbstrplr
10826}
10827
10828// Values returns the slice of values for the current page or nil if there are no values.
10829func (page ManagedBackupShortTermRetentionPolicyListResultPage) Values() []ManagedBackupShortTermRetentionPolicy {
10830	if page.mbstrplr.IsEmpty() {
10831		return nil
10832	}
10833	return *page.mbstrplr.Value
10834}
10835
10836// Creates a new instance of the ManagedBackupShortTermRetentionPolicyListResultPage type.
10837func NewManagedBackupShortTermRetentionPolicyListResultPage(cur ManagedBackupShortTermRetentionPolicyListResult, getNextPage func(context.Context, ManagedBackupShortTermRetentionPolicyListResult) (ManagedBackupShortTermRetentionPolicyListResult, error)) ManagedBackupShortTermRetentionPolicyListResultPage {
10838	return ManagedBackupShortTermRetentionPolicyListResultPage{
10839		fn:       getNextPage,
10840		mbstrplr: cur,
10841	}
10842}
10843
10844// ManagedBackupShortTermRetentionPolicyProperties properties of a short term retention policy
10845type ManagedBackupShortTermRetentionPolicyProperties struct {
10846	// RetentionDays - The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
10847	RetentionDays *int32 `json:"retentionDays,omitempty"`
10848}
10849
10850// ManagedDatabase a managed database resource.
10851type ManagedDatabase struct {
10852	autorest.Response `json:"-"`
10853	// ManagedDatabaseProperties - Resource properties.
10854	*ManagedDatabaseProperties `json:"properties,omitempty"`
10855	// Location - Resource location.
10856	Location *string `json:"location,omitempty"`
10857	// Tags - Resource tags.
10858	Tags map[string]*string `json:"tags"`
10859	// ID - READ-ONLY; Resource ID.
10860	ID *string `json:"id,omitempty"`
10861	// Name - READ-ONLY; Resource name.
10862	Name *string `json:"name,omitempty"`
10863	// Type - READ-ONLY; Resource type.
10864	Type *string `json:"type,omitempty"`
10865}
10866
10867// MarshalJSON is the custom marshaler for ManagedDatabase.
10868func (md ManagedDatabase) MarshalJSON() ([]byte, error) {
10869	objectMap := make(map[string]interface{})
10870	if md.ManagedDatabaseProperties != nil {
10871		objectMap["properties"] = md.ManagedDatabaseProperties
10872	}
10873	if md.Location != nil {
10874		objectMap["location"] = md.Location
10875	}
10876	if md.Tags != nil {
10877		objectMap["tags"] = md.Tags
10878	}
10879	return json.Marshal(objectMap)
10880}
10881
10882// UnmarshalJSON is the custom unmarshaler for ManagedDatabase struct.
10883func (md *ManagedDatabase) UnmarshalJSON(body []byte) error {
10884	var m map[string]*json.RawMessage
10885	err := json.Unmarshal(body, &m)
10886	if err != nil {
10887		return err
10888	}
10889	for k, v := range m {
10890		switch k {
10891		case "properties":
10892			if v != nil {
10893				var managedDatabaseProperties ManagedDatabaseProperties
10894				err = json.Unmarshal(*v, &managedDatabaseProperties)
10895				if err != nil {
10896					return err
10897				}
10898				md.ManagedDatabaseProperties = &managedDatabaseProperties
10899			}
10900		case "location":
10901			if v != nil {
10902				var location string
10903				err = json.Unmarshal(*v, &location)
10904				if err != nil {
10905					return err
10906				}
10907				md.Location = &location
10908			}
10909		case "tags":
10910			if v != nil {
10911				var tags map[string]*string
10912				err = json.Unmarshal(*v, &tags)
10913				if err != nil {
10914					return err
10915				}
10916				md.Tags = tags
10917			}
10918		case "id":
10919			if v != nil {
10920				var ID string
10921				err = json.Unmarshal(*v, &ID)
10922				if err != nil {
10923					return err
10924				}
10925				md.ID = &ID
10926			}
10927		case "name":
10928			if v != nil {
10929				var name string
10930				err = json.Unmarshal(*v, &name)
10931				if err != nil {
10932					return err
10933				}
10934				md.Name = &name
10935			}
10936		case "type":
10937			if v != nil {
10938				var typeVar string
10939				err = json.Unmarshal(*v, &typeVar)
10940				if err != nil {
10941					return err
10942				}
10943				md.Type = &typeVar
10944			}
10945		}
10946	}
10947
10948	return nil
10949}
10950
10951// ManagedDatabaseListResult a list of managed databases.
10952type ManagedDatabaseListResult struct {
10953	autorest.Response `json:"-"`
10954	// Value - READ-ONLY; Array of results.
10955	Value *[]ManagedDatabase `json:"value,omitempty"`
10956	// NextLink - READ-ONLY; Link to retrieve next page of results.
10957	NextLink *string `json:"nextLink,omitempty"`
10958}
10959
10960// MarshalJSON is the custom marshaler for ManagedDatabaseListResult.
10961func (mdlr ManagedDatabaseListResult) MarshalJSON() ([]byte, error) {
10962	objectMap := make(map[string]interface{})
10963	return json.Marshal(objectMap)
10964}
10965
10966// ManagedDatabaseListResultIterator provides access to a complete listing of ManagedDatabase values.
10967type ManagedDatabaseListResultIterator struct {
10968	i    int
10969	page ManagedDatabaseListResultPage
10970}
10971
10972// NextWithContext advances to the next value.  If there was an error making
10973// the request the iterator does not advance and the error is returned.
10974func (iter *ManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
10975	if tracing.IsEnabled() {
10976		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseListResultIterator.NextWithContext")
10977		defer func() {
10978			sc := -1
10979			if iter.Response().Response.Response != nil {
10980				sc = iter.Response().Response.Response.StatusCode
10981			}
10982			tracing.EndSpan(ctx, sc, err)
10983		}()
10984	}
10985	iter.i++
10986	if iter.i < len(iter.page.Values()) {
10987		return nil
10988	}
10989	err = iter.page.NextWithContext(ctx)
10990	if err != nil {
10991		iter.i--
10992		return err
10993	}
10994	iter.i = 0
10995	return nil
10996}
10997
10998// Next advances to the next value.  If there was an error making
10999// the request the iterator does not advance and the error is returned.
11000// Deprecated: Use NextWithContext() instead.
11001func (iter *ManagedDatabaseListResultIterator) Next() error {
11002	return iter.NextWithContext(context.Background())
11003}
11004
11005// NotDone returns true if the enumeration should be started or is not yet complete.
11006func (iter ManagedDatabaseListResultIterator) NotDone() bool {
11007	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11008}
11009
11010// Response returns the raw server response from the last page request.
11011func (iter ManagedDatabaseListResultIterator) Response() ManagedDatabaseListResult {
11012	return iter.page.Response()
11013}
11014
11015// Value returns the current value or a zero-initialized value if the
11016// iterator has advanced beyond the end of the collection.
11017func (iter ManagedDatabaseListResultIterator) Value() ManagedDatabase {
11018	if !iter.page.NotDone() {
11019		return ManagedDatabase{}
11020	}
11021	return iter.page.Values()[iter.i]
11022}
11023
11024// Creates a new instance of the ManagedDatabaseListResultIterator type.
11025func NewManagedDatabaseListResultIterator(page ManagedDatabaseListResultPage) ManagedDatabaseListResultIterator {
11026	return ManagedDatabaseListResultIterator{page: page}
11027}
11028
11029// IsEmpty returns true if the ListResult contains no values.
11030func (mdlr ManagedDatabaseListResult) IsEmpty() bool {
11031	return mdlr.Value == nil || len(*mdlr.Value) == 0
11032}
11033
11034// hasNextLink returns true if the NextLink is not empty.
11035func (mdlr ManagedDatabaseListResult) hasNextLink() bool {
11036	return mdlr.NextLink != nil && len(*mdlr.NextLink) != 0
11037}
11038
11039// managedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
11040// It returns nil if no more results exist.
11041func (mdlr ManagedDatabaseListResult) managedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
11042	if !mdlr.hasNextLink() {
11043		return nil, nil
11044	}
11045	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11046		autorest.AsJSON(),
11047		autorest.AsGet(),
11048		autorest.WithBaseURL(to.String(mdlr.NextLink)))
11049}
11050
11051// ManagedDatabaseListResultPage contains a page of ManagedDatabase values.
11052type ManagedDatabaseListResultPage struct {
11053	fn   func(context.Context, ManagedDatabaseListResult) (ManagedDatabaseListResult, error)
11054	mdlr ManagedDatabaseListResult
11055}
11056
11057// NextWithContext advances to the next page of values.  If there was an error making
11058// the request the page does not advance and the error is returned.
11059func (page *ManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
11060	if tracing.IsEnabled() {
11061		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseListResultPage.NextWithContext")
11062		defer func() {
11063			sc := -1
11064			if page.Response().Response.Response != nil {
11065				sc = page.Response().Response.Response.StatusCode
11066			}
11067			tracing.EndSpan(ctx, sc, err)
11068		}()
11069	}
11070	for {
11071		next, err := page.fn(ctx, page.mdlr)
11072		if err != nil {
11073			return err
11074		}
11075		page.mdlr = next
11076		if !next.hasNextLink() || !next.IsEmpty() {
11077			break
11078		}
11079	}
11080	return nil
11081}
11082
11083// Next advances to the next page of values.  If there was an error making
11084// the request the page does not advance and the error is returned.
11085// Deprecated: Use NextWithContext() instead.
11086func (page *ManagedDatabaseListResultPage) Next() error {
11087	return page.NextWithContext(context.Background())
11088}
11089
11090// NotDone returns true if the page enumeration should be started or is not yet complete.
11091func (page ManagedDatabaseListResultPage) NotDone() bool {
11092	return !page.mdlr.IsEmpty()
11093}
11094
11095// Response returns the raw server response from the last page request.
11096func (page ManagedDatabaseListResultPage) Response() ManagedDatabaseListResult {
11097	return page.mdlr
11098}
11099
11100// Values returns the slice of values for the current page or nil if there are no values.
11101func (page ManagedDatabaseListResultPage) Values() []ManagedDatabase {
11102	if page.mdlr.IsEmpty() {
11103		return nil
11104	}
11105	return *page.mdlr.Value
11106}
11107
11108// Creates a new instance of the ManagedDatabaseListResultPage type.
11109func NewManagedDatabaseListResultPage(cur ManagedDatabaseListResult, getNextPage func(context.Context, ManagedDatabaseListResult) (ManagedDatabaseListResult, error)) ManagedDatabaseListResultPage {
11110	return ManagedDatabaseListResultPage{
11111		fn:   getNextPage,
11112		mdlr: cur,
11113	}
11114}
11115
11116// ManagedDatabaseProperties the managed database's properties.
11117type ManagedDatabaseProperties struct {
11118	// Collation - Collation of the managed database.
11119	Collation *string `json:"collation,omitempty"`
11120	// Status - READ-ONLY; Status of the database. Possible values include: 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Restoring', 'Updating'
11121	Status ManagedDatabaseStatus `json:"status,omitempty"`
11122	// CreationDate - READ-ONLY; Creation date of the database.
11123	CreationDate *date.Time `json:"creationDate,omitempty"`
11124	// EarliestRestorePoint - READ-ONLY; Earliest restore point in time for point in time restore.
11125	EarliestRestorePoint *date.Time `json:"earliestRestorePoint,omitempty"`
11126	// 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.
11127	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
11128	// DefaultSecondaryLocation - READ-ONLY; Geo paired region.
11129	DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"`
11130	// CatalogCollation - Collation of the metadata catalog. Possible values include: 'DATABASEDEFAULT', 'SQLLatin1GeneralCP1CIAS'
11131	CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"`
11132	// 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'
11133	CreateMode ManagedDatabaseCreateMode `json:"createMode,omitempty"`
11134	// StorageContainerURI - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored.
11135	StorageContainerURI *string `json:"storageContainerUri,omitempty"`
11136	// SourceDatabaseID - The resource identifier of the source database associated with create operation of this database.
11137	SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`
11138	// RestorableDroppedDatabaseID - The restorable dropped database resource id to restore when creating this database.
11139	RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"`
11140	// StorageContainerSasToken - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token.
11141	StorageContainerSasToken *string `json:"storageContainerSasToken,omitempty"`
11142	// FailoverGroupID - READ-ONLY; Instance Failover Group resource identifier that this managed database belongs to.
11143	FailoverGroupID *string `json:"failoverGroupId,omitempty"`
11144	// RecoverableDatabaseID - The resource identifier of the recoverable database associated with create operation of this database.
11145	RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"`
11146	// LongTermRetentionBackupResourceID - The name of the Long Term Retention backup to be used for restore of this managed database.
11147	LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"`
11148	// AutoCompleteRestore - Whether to auto complete restore of this managed database.
11149	AutoCompleteRestore *bool `json:"autoCompleteRestore,omitempty"`
11150	// LastBackupName - Last backup file name for restore of this managed database.
11151	LastBackupName *string `json:"lastBackupName,omitempty"`
11152}
11153
11154// MarshalJSON is the custom marshaler for ManagedDatabaseProperties.
11155func (mdp ManagedDatabaseProperties) MarshalJSON() ([]byte, error) {
11156	objectMap := make(map[string]interface{})
11157	if mdp.Collation != nil {
11158		objectMap["collation"] = mdp.Collation
11159	}
11160	if mdp.RestorePointInTime != nil {
11161		objectMap["restorePointInTime"] = mdp.RestorePointInTime
11162	}
11163	if mdp.CatalogCollation != "" {
11164		objectMap["catalogCollation"] = mdp.CatalogCollation
11165	}
11166	if mdp.CreateMode != "" {
11167		objectMap["createMode"] = mdp.CreateMode
11168	}
11169	if mdp.StorageContainerURI != nil {
11170		objectMap["storageContainerUri"] = mdp.StorageContainerURI
11171	}
11172	if mdp.SourceDatabaseID != nil {
11173		objectMap["sourceDatabaseId"] = mdp.SourceDatabaseID
11174	}
11175	if mdp.RestorableDroppedDatabaseID != nil {
11176		objectMap["restorableDroppedDatabaseId"] = mdp.RestorableDroppedDatabaseID
11177	}
11178	if mdp.StorageContainerSasToken != nil {
11179		objectMap["storageContainerSasToken"] = mdp.StorageContainerSasToken
11180	}
11181	if mdp.RecoverableDatabaseID != nil {
11182		objectMap["recoverableDatabaseId"] = mdp.RecoverableDatabaseID
11183	}
11184	if mdp.LongTermRetentionBackupResourceID != nil {
11185		objectMap["longTermRetentionBackupResourceId"] = mdp.LongTermRetentionBackupResourceID
11186	}
11187	if mdp.AutoCompleteRestore != nil {
11188		objectMap["autoCompleteRestore"] = mdp.AutoCompleteRestore
11189	}
11190	if mdp.LastBackupName != nil {
11191		objectMap["lastBackupName"] = mdp.LastBackupName
11192	}
11193	return json.Marshal(objectMap)
11194}
11195
11196// ManagedDatabaseRestoreDetailsProperties the managed database's restore details properties.
11197type ManagedDatabaseRestoreDetailsProperties struct {
11198	// Status - READ-ONLY; Restore status.
11199	Status *string `json:"status,omitempty"`
11200	// CurrentRestoringFileName - READ-ONLY; Current restoring file name.
11201	CurrentRestoringFileName *string `json:"currentRestoringFileName,omitempty"`
11202	// LastRestoredFileName - READ-ONLY; Last restored file name.
11203	LastRestoredFileName *string `json:"lastRestoredFileName,omitempty"`
11204	// LastRestoredFileTime - READ-ONLY; Last restored file time.
11205	LastRestoredFileTime *date.Time `json:"lastRestoredFileTime,omitempty"`
11206	// PercentCompleted - READ-ONLY; Percent completed.
11207	PercentCompleted *float64 `json:"percentCompleted,omitempty"`
11208	// UnrestorableFiles - READ-ONLY; List of unrestorable files.
11209	UnrestorableFiles *[]string `json:"unrestorableFiles,omitempty"`
11210	// NumberOfFilesDetected - READ-ONLY; Number of files detected.
11211	NumberOfFilesDetected *int64 `json:"numberOfFilesDetected,omitempty"`
11212	// LastUploadedFileName - READ-ONLY; Last uploaded file name.
11213	LastUploadedFileName *string `json:"lastUploadedFileName,omitempty"`
11214	// LastUploadedFileTime - READ-ONLY; Last uploaded file time.
11215	LastUploadedFileTime *date.Time `json:"lastUploadedFileTime,omitempty"`
11216	// BlockReason - READ-ONLY; The reason why restore is in Blocked state.
11217	BlockReason *string `json:"blockReason,omitempty"`
11218}
11219
11220// MarshalJSON is the custom marshaler for ManagedDatabaseRestoreDetailsProperties.
11221func (mdrdp ManagedDatabaseRestoreDetailsProperties) MarshalJSON() ([]byte, error) {
11222	objectMap := make(map[string]interface{})
11223	return json.Marshal(objectMap)
11224}
11225
11226// ManagedDatabaseRestoreDetailsResult a managed database restore details.
11227type ManagedDatabaseRestoreDetailsResult struct {
11228	autorest.Response `json:"-"`
11229	// ManagedDatabaseRestoreDetailsProperties - Resource properties.
11230	*ManagedDatabaseRestoreDetailsProperties `json:"properties,omitempty"`
11231	// ID - READ-ONLY; Resource ID.
11232	ID *string `json:"id,omitempty"`
11233	// Name - READ-ONLY; Resource name.
11234	Name *string `json:"name,omitempty"`
11235	// Type - READ-ONLY; Resource type.
11236	Type *string `json:"type,omitempty"`
11237}
11238
11239// MarshalJSON is the custom marshaler for ManagedDatabaseRestoreDetailsResult.
11240func (mdrdr ManagedDatabaseRestoreDetailsResult) MarshalJSON() ([]byte, error) {
11241	objectMap := make(map[string]interface{})
11242	if mdrdr.ManagedDatabaseRestoreDetailsProperties != nil {
11243		objectMap["properties"] = mdrdr.ManagedDatabaseRestoreDetailsProperties
11244	}
11245	return json.Marshal(objectMap)
11246}
11247
11248// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseRestoreDetailsResult struct.
11249func (mdrdr *ManagedDatabaseRestoreDetailsResult) UnmarshalJSON(body []byte) error {
11250	var m map[string]*json.RawMessage
11251	err := json.Unmarshal(body, &m)
11252	if err != nil {
11253		return err
11254	}
11255	for k, v := range m {
11256		switch k {
11257		case "properties":
11258			if v != nil {
11259				var managedDatabaseRestoreDetailsProperties ManagedDatabaseRestoreDetailsProperties
11260				err = json.Unmarshal(*v, &managedDatabaseRestoreDetailsProperties)
11261				if err != nil {
11262					return err
11263				}
11264				mdrdr.ManagedDatabaseRestoreDetailsProperties = &managedDatabaseRestoreDetailsProperties
11265			}
11266		case "id":
11267			if v != nil {
11268				var ID string
11269				err = json.Unmarshal(*v, &ID)
11270				if err != nil {
11271					return err
11272				}
11273				mdrdr.ID = &ID
11274			}
11275		case "name":
11276			if v != nil {
11277				var name string
11278				err = json.Unmarshal(*v, &name)
11279				if err != nil {
11280					return err
11281				}
11282				mdrdr.Name = &name
11283			}
11284		case "type":
11285			if v != nil {
11286				var typeVar string
11287				err = json.Unmarshal(*v, &typeVar)
11288				if err != nil {
11289					return err
11290				}
11291				mdrdr.Type = &typeVar
11292			}
11293		}
11294	}
11295
11296	return nil
11297}
11298
11299// ManagedDatabasesCompleteRestoreFuture an abstraction for monitoring and retrieving the results of a
11300// long-running operation.
11301type ManagedDatabasesCompleteRestoreFuture struct {
11302	azure.FutureAPI
11303	// Result returns the result of the asynchronous operation.
11304	// If the operation has not completed it will return an error.
11305	Result func(ManagedDatabasesClient) (autorest.Response, error)
11306}
11307
11308// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11309func (future *ManagedDatabasesCompleteRestoreFuture) UnmarshalJSON(body []byte) error {
11310	var azFuture azure.Future
11311	if err := json.Unmarshal(body, &azFuture); err != nil {
11312		return err
11313	}
11314	future.FutureAPI = &azFuture
11315	future.Result = future.result
11316	return nil
11317}
11318
11319// result is the default implementation for ManagedDatabasesCompleteRestoreFuture.Result.
11320func (future *ManagedDatabasesCompleteRestoreFuture) result(client ManagedDatabasesClient) (ar autorest.Response, err error) {
11321	var done bool
11322	done, err = future.DoneWithContext(context.Background(), client)
11323	if err != nil {
11324		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCompleteRestoreFuture", "Result", future.Response(), "Polling failure")
11325		return
11326	}
11327	if !done {
11328		ar.Response = future.Response()
11329		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesCompleteRestoreFuture")
11330		return
11331	}
11332	ar.Response = future.Response()
11333	return
11334}
11335
11336// ManagedDatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
11337// long-running operation.
11338type ManagedDatabasesCreateOrUpdateFuture struct {
11339	azure.FutureAPI
11340	// Result returns the result of the asynchronous operation.
11341	// If the operation has not completed it will return an error.
11342	Result func(ManagedDatabasesClient) (ManagedDatabase, error)
11343}
11344
11345// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11346func (future *ManagedDatabasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
11347	var azFuture azure.Future
11348	if err := json.Unmarshal(body, &azFuture); err != nil {
11349		return err
11350	}
11351	future.FutureAPI = &azFuture
11352	future.Result = future.result
11353	return nil
11354}
11355
11356// result is the default implementation for ManagedDatabasesCreateOrUpdateFuture.Result.
11357func (future *ManagedDatabasesCreateOrUpdateFuture) result(client ManagedDatabasesClient) (md ManagedDatabase, err error) {
11358	var done bool
11359	done, err = future.DoneWithContext(context.Background(), client)
11360	if err != nil {
11361		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
11362		return
11363	}
11364	if !done {
11365		md.Response.Response = future.Response()
11366		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesCreateOrUpdateFuture")
11367		return
11368	}
11369	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11370	if md.Response.Response, err = future.GetResult(sender); err == nil && md.Response.Response.StatusCode != http.StatusNoContent {
11371		md, err = client.CreateOrUpdateResponder(md.Response.Response)
11372		if err != nil {
11373			err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCreateOrUpdateFuture", "Result", md.Response.Response, "Failure responding to request")
11374		}
11375	}
11376	return
11377}
11378
11379// ManagedDatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
11380// operation.
11381type ManagedDatabasesDeleteFuture struct {
11382	azure.FutureAPI
11383	// Result returns the result of the asynchronous operation.
11384	// If the operation has not completed it will return an error.
11385	Result func(ManagedDatabasesClient) (autorest.Response, error)
11386}
11387
11388// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11389func (future *ManagedDatabasesDeleteFuture) UnmarshalJSON(body []byte) error {
11390	var azFuture azure.Future
11391	if err := json.Unmarshal(body, &azFuture); err != nil {
11392		return err
11393	}
11394	future.FutureAPI = &azFuture
11395	future.Result = future.result
11396	return nil
11397}
11398
11399// result is the default implementation for ManagedDatabasesDeleteFuture.Result.
11400func (future *ManagedDatabasesDeleteFuture) result(client ManagedDatabasesClient) (ar autorest.Response, err error) {
11401	var done bool
11402	done, err = future.DoneWithContext(context.Background(), client)
11403	if err != nil {
11404		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesDeleteFuture", "Result", future.Response(), "Polling failure")
11405		return
11406	}
11407	if !done {
11408		ar.Response = future.Response()
11409		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesDeleteFuture")
11410		return
11411	}
11412	ar.Response = future.Response()
11413	return
11414}
11415
11416// ManagedDatabaseSecurityAlertPolicy a managed database security alert policy.
11417type ManagedDatabaseSecurityAlertPolicy struct {
11418	autorest.Response `json:"-"`
11419	// SecurityAlertPolicyProperties - Resource properties.
11420	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
11421	// ID - READ-ONLY; Resource ID.
11422	ID *string `json:"id,omitempty"`
11423	// Name - READ-ONLY; Resource name.
11424	Name *string `json:"name,omitempty"`
11425	// Type - READ-ONLY; Resource type.
11426	Type *string `json:"type,omitempty"`
11427}
11428
11429// MarshalJSON is the custom marshaler for ManagedDatabaseSecurityAlertPolicy.
11430func (mdsap ManagedDatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
11431	objectMap := make(map[string]interface{})
11432	if mdsap.SecurityAlertPolicyProperties != nil {
11433		objectMap["properties"] = mdsap.SecurityAlertPolicyProperties
11434	}
11435	return json.Marshal(objectMap)
11436}
11437
11438// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseSecurityAlertPolicy struct.
11439func (mdsap *ManagedDatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
11440	var m map[string]*json.RawMessage
11441	err := json.Unmarshal(body, &m)
11442	if err != nil {
11443		return err
11444	}
11445	for k, v := range m {
11446		switch k {
11447		case "properties":
11448			if v != nil {
11449				var securityAlertPolicyProperties SecurityAlertPolicyProperties
11450				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
11451				if err != nil {
11452					return err
11453				}
11454				mdsap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
11455			}
11456		case "id":
11457			if v != nil {
11458				var ID string
11459				err = json.Unmarshal(*v, &ID)
11460				if err != nil {
11461					return err
11462				}
11463				mdsap.ID = &ID
11464			}
11465		case "name":
11466			if v != nil {
11467				var name string
11468				err = json.Unmarshal(*v, &name)
11469				if err != nil {
11470					return err
11471				}
11472				mdsap.Name = &name
11473			}
11474		case "type":
11475			if v != nil {
11476				var typeVar string
11477				err = json.Unmarshal(*v, &typeVar)
11478				if err != nil {
11479					return err
11480				}
11481				mdsap.Type = &typeVar
11482			}
11483		}
11484	}
11485
11486	return nil
11487}
11488
11489// ManagedDatabaseSecurityAlertPolicyListResult a list of the managed database's security alert policies.
11490type ManagedDatabaseSecurityAlertPolicyListResult struct {
11491	autorest.Response `json:"-"`
11492	// Value - READ-ONLY; Array of results.
11493	Value *[]ManagedDatabaseSecurityAlertPolicy `json:"value,omitempty"`
11494	// NextLink - READ-ONLY; Link to retrieve next page of results.
11495	NextLink *string `json:"nextLink,omitempty"`
11496}
11497
11498// MarshalJSON is the custom marshaler for ManagedDatabaseSecurityAlertPolicyListResult.
11499func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) {
11500	objectMap := make(map[string]interface{})
11501	return json.Marshal(objectMap)
11502}
11503
11504// ManagedDatabaseSecurityAlertPolicyListResultIterator provides access to a complete listing of
11505// ManagedDatabaseSecurityAlertPolicy values.
11506type ManagedDatabaseSecurityAlertPolicyListResultIterator struct {
11507	i    int
11508	page ManagedDatabaseSecurityAlertPolicyListResultPage
11509}
11510
11511// NextWithContext advances to the next value.  If there was an error making
11512// the request the iterator does not advance and the error is returned.
11513func (iter *ManagedDatabaseSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
11514	if tracing.IsEnabled() {
11515		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPolicyListResultIterator.NextWithContext")
11516		defer func() {
11517			sc := -1
11518			if iter.Response().Response.Response != nil {
11519				sc = iter.Response().Response.Response.StatusCode
11520			}
11521			tracing.EndSpan(ctx, sc, err)
11522		}()
11523	}
11524	iter.i++
11525	if iter.i < len(iter.page.Values()) {
11526		return nil
11527	}
11528	err = iter.page.NextWithContext(ctx)
11529	if err != nil {
11530		iter.i--
11531		return err
11532	}
11533	iter.i = 0
11534	return nil
11535}
11536
11537// Next advances to the next value.  If there was an error making
11538// the request the iterator does not advance and the error is returned.
11539// Deprecated: Use NextWithContext() instead.
11540func (iter *ManagedDatabaseSecurityAlertPolicyListResultIterator) Next() error {
11541	return iter.NextWithContext(context.Background())
11542}
11543
11544// NotDone returns true if the enumeration should be started or is not yet complete.
11545func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) NotDone() bool {
11546	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11547}
11548
11549// Response returns the raw server response from the last page request.
11550func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) Response() ManagedDatabaseSecurityAlertPolicyListResult {
11551	return iter.page.Response()
11552}
11553
11554// Value returns the current value or a zero-initialized value if the
11555// iterator has advanced beyond the end of the collection.
11556func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) Value() ManagedDatabaseSecurityAlertPolicy {
11557	if !iter.page.NotDone() {
11558		return ManagedDatabaseSecurityAlertPolicy{}
11559	}
11560	return iter.page.Values()[iter.i]
11561}
11562
11563// Creates a new instance of the ManagedDatabaseSecurityAlertPolicyListResultIterator type.
11564func NewManagedDatabaseSecurityAlertPolicyListResultIterator(page ManagedDatabaseSecurityAlertPolicyListResultPage) ManagedDatabaseSecurityAlertPolicyListResultIterator {
11565	return ManagedDatabaseSecurityAlertPolicyListResultIterator{page: page}
11566}
11567
11568// IsEmpty returns true if the ListResult contains no values.
11569func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) IsEmpty() bool {
11570	return mdsaplr.Value == nil || len(*mdsaplr.Value) == 0
11571}
11572
11573// hasNextLink returns true if the NextLink is not empty.
11574func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) hasNextLink() bool {
11575	return mdsaplr.NextLink != nil && len(*mdsaplr.NextLink) != 0
11576}
11577
11578// managedDatabaseSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
11579// It returns nil if no more results exist.
11580func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) managedDatabaseSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
11581	if !mdsaplr.hasNextLink() {
11582		return nil, nil
11583	}
11584	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11585		autorest.AsJSON(),
11586		autorest.AsGet(),
11587		autorest.WithBaseURL(to.String(mdsaplr.NextLink)))
11588}
11589
11590// ManagedDatabaseSecurityAlertPolicyListResultPage contains a page of ManagedDatabaseSecurityAlertPolicy
11591// values.
11592type ManagedDatabaseSecurityAlertPolicyListResultPage struct {
11593	fn      func(context.Context, ManagedDatabaseSecurityAlertPolicyListResult) (ManagedDatabaseSecurityAlertPolicyListResult, error)
11594	mdsaplr ManagedDatabaseSecurityAlertPolicyListResult
11595}
11596
11597// NextWithContext advances to the next page of values.  If there was an error making
11598// the request the page does not advance and the error is returned.
11599func (page *ManagedDatabaseSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
11600	if tracing.IsEnabled() {
11601		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPolicyListResultPage.NextWithContext")
11602		defer func() {
11603			sc := -1
11604			if page.Response().Response.Response != nil {
11605				sc = page.Response().Response.Response.StatusCode
11606			}
11607			tracing.EndSpan(ctx, sc, err)
11608		}()
11609	}
11610	for {
11611		next, err := page.fn(ctx, page.mdsaplr)
11612		if err != nil {
11613			return err
11614		}
11615		page.mdsaplr = next
11616		if !next.hasNextLink() || !next.IsEmpty() {
11617			break
11618		}
11619	}
11620	return nil
11621}
11622
11623// Next advances to the next page of values.  If there was an error making
11624// the request the page does not advance and the error is returned.
11625// Deprecated: Use NextWithContext() instead.
11626func (page *ManagedDatabaseSecurityAlertPolicyListResultPage) Next() error {
11627	return page.NextWithContext(context.Background())
11628}
11629
11630// NotDone returns true if the page enumeration should be started or is not yet complete.
11631func (page ManagedDatabaseSecurityAlertPolicyListResultPage) NotDone() bool {
11632	return !page.mdsaplr.IsEmpty()
11633}
11634
11635// Response returns the raw server response from the last page request.
11636func (page ManagedDatabaseSecurityAlertPolicyListResultPage) Response() ManagedDatabaseSecurityAlertPolicyListResult {
11637	return page.mdsaplr
11638}
11639
11640// Values returns the slice of values for the current page or nil if there are no values.
11641func (page ManagedDatabaseSecurityAlertPolicyListResultPage) Values() []ManagedDatabaseSecurityAlertPolicy {
11642	if page.mdsaplr.IsEmpty() {
11643		return nil
11644	}
11645	return *page.mdsaplr.Value
11646}
11647
11648// Creates a new instance of the ManagedDatabaseSecurityAlertPolicyListResultPage type.
11649func NewManagedDatabaseSecurityAlertPolicyListResultPage(cur ManagedDatabaseSecurityAlertPolicyListResult, getNextPage func(context.Context, ManagedDatabaseSecurityAlertPolicyListResult) (ManagedDatabaseSecurityAlertPolicyListResult, error)) ManagedDatabaseSecurityAlertPolicyListResultPage {
11650	return ManagedDatabaseSecurityAlertPolicyListResultPage{
11651		fn:      getNextPage,
11652		mdsaplr: cur,
11653	}
11654}
11655
11656// ManagedDatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
11657// operation.
11658type ManagedDatabasesUpdateFuture struct {
11659	azure.FutureAPI
11660	// Result returns the result of the asynchronous operation.
11661	// If the operation has not completed it will return an error.
11662	Result func(ManagedDatabasesClient) (ManagedDatabase, error)
11663}
11664
11665// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11666func (future *ManagedDatabasesUpdateFuture) UnmarshalJSON(body []byte) error {
11667	var azFuture azure.Future
11668	if err := json.Unmarshal(body, &azFuture); err != nil {
11669		return err
11670	}
11671	future.FutureAPI = &azFuture
11672	future.Result = future.result
11673	return nil
11674}
11675
11676// result is the default implementation for ManagedDatabasesUpdateFuture.Result.
11677func (future *ManagedDatabasesUpdateFuture) result(client ManagedDatabasesClient) (md ManagedDatabase, err error) {
11678	var done bool
11679	done, err = future.DoneWithContext(context.Background(), client)
11680	if err != nil {
11681		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesUpdateFuture", "Result", future.Response(), "Polling failure")
11682		return
11683	}
11684	if !done {
11685		md.Response.Response = future.Response()
11686		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesUpdateFuture")
11687		return
11688	}
11689	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11690	if md.Response.Response, err = future.GetResult(sender); err == nil && md.Response.Response.StatusCode != http.StatusNoContent {
11691		md, err = client.UpdateResponder(md.Response.Response)
11692		if err != nil {
11693			err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesUpdateFuture", "Result", md.Response.Response, "Failure responding to request")
11694		}
11695	}
11696	return
11697}
11698
11699// ManagedDatabaseUpdate an managed database update.
11700type ManagedDatabaseUpdate struct {
11701	// ManagedDatabaseProperties - Resource properties.
11702	*ManagedDatabaseProperties `json:"properties,omitempty"`
11703	// Tags - Resource tags.
11704	Tags map[string]*string `json:"tags"`
11705}
11706
11707// MarshalJSON is the custom marshaler for ManagedDatabaseUpdate.
11708func (mdu ManagedDatabaseUpdate) MarshalJSON() ([]byte, error) {
11709	objectMap := make(map[string]interface{})
11710	if mdu.ManagedDatabaseProperties != nil {
11711		objectMap["properties"] = mdu.ManagedDatabaseProperties
11712	}
11713	if mdu.Tags != nil {
11714		objectMap["tags"] = mdu.Tags
11715	}
11716	return json.Marshal(objectMap)
11717}
11718
11719// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseUpdate struct.
11720func (mdu *ManagedDatabaseUpdate) UnmarshalJSON(body []byte) error {
11721	var m map[string]*json.RawMessage
11722	err := json.Unmarshal(body, &m)
11723	if err != nil {
11724		return err
11725	}
11726	for k, v := range m {
11727		switch k {
11728		case "properties":
11729			if v != nil {
11730				var managedDatabaseProperties ManagedDatabaseProperties
11731				err = json.Unmarshal(*v, &managedDatabaseProperties)
11732				if err != nil {
11733					return err
11734				}
11735				mdu.ManagedDatabaseProperties = &managedDatabaseProperties
11736			}
11737		case "tags":
11738			if v != nil {
11739				var tags map[string]*string
11740				err = json.Unmarshal(*v, &tags)
11741				if err != nil {
11742					return err
11743				}
11744				mdu.Tags = tags
11745			}
11746		}
11747	}
11748
11749	return nil
11750}
11751
11752// ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture an abstraction for monitoring and
11753// retrieving the results of a long-running operation.
11754type ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture struct {
11755	azure.FutureAPI
11756	// Result returns the result of the asynchronous operation.
11757	// If the operation has not completed it will return an error.
11758	Result func(ManagedDatabaseVulnerabilityAssessmentScansClient) (autorest.Response, error)
11759}
11760
11761// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11762func (future *ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture) UnmarshalJSON(body []byte) error {
11763	var azFuture azure.Future
11764	if err := json.Unmarshal(body, &azFuture); err != nil {
11765		return err
11766	}
11767	future.FutureAPI = &azFuture
11768	future.Result = future.result
11769	return nil
11770}
11771
11772// result is the default implementation for ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture.Result.
11773func (future *ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture) result(client ManagedDatabaseVulnerabilityAssessmentScansClient) (ar autorest.Response, err error) {
11774	var done bool
11775	done, err = future.DoneWithContext(context.Background(), client)
11776	if err != nil {
11777		err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture", "Result", future.Response(), "Polling failure")
11778		return
11779	}
11780	if !done {
11781		ar.Response = future.Response()
11782		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture")
11783		return
11784	}
11785	ar.Response = future.Response()
11786	return
11787}
11788
11789// ManagedInstance an Azure SQL managed instance.
11790type ManagedInstance struct {
11791	autorest.Response `json:"-"`
11792	// Identity - The Azure Active Directory identity of the managed instance.
11793	Identity *ResourceIdentity `json:"identity,omitempty"`
11794	// Sku - Managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5
11795	Sku *Sku `json:"sku,omitempty"`
11796	// ManagedInstanceProperties - Resource properties.
11797	*ManagedInstanceProperties `json:"properties,omitempty"`
11798	// Location - Resource location.
11799	Location *string `json:"location,omitempty"`
11800	// Tags - Resource tags.
11801	Tags map[string]*string `json:"tags"`
11802	// ID - READ-ONLY; Resource ID.
11803	ID *string `json:"id,omitempty"`
11804	// Name - READ-ONLY; Resource name.
11805	Name *string `json:"name,omitempty"`
11806	// Type - READ-ONLY; Resource type.
11807	Type *string `json:"type,omitempty"`
11808}
11809
11810// MarshalJSON is the custom marshaler for ManagedInstance.
11811func (mi ManagedInstance) MarshalJSON() ([]byte, error) {
11812	objectMap := make(map[string]interface{})
11813	if mi.Identity != nil {
11814		objectMap["identity"] = mi.Identity
11815	}
11816	if mi.Sku != nil {
11817		objectMap["sku"] = mi.Sku
11818	}
11819	if mi.ManagedInstanceProperties != nil {
11820		objectMap["properties"] = mi.ManagedInstanceProperties
11821	}
11822	if mi.Location != nil {
11823		objectMap["location"] = mi.Location
11824	}
11825	if mi.Tags != nil {
11826		objectMap["tags"] = mi.Tags
11827	}
11828	return json.Marshal(objectMap)
11829}
11830
11831// UnmarshalJSON is the custom unmarshaler for ManagedInstance struct.
11832func (mi *ManagedInstance) UnmarshalJSON(body []byte) error {
11833	var m map[string]*json.RawMessage
11834	err := json.Unmarshal(body, &m)
11835	if err != nil {
11836		return err
11837	}
11838	for k, v := range m {
11839		switch k {
11840		case "identity":
11841			if v != nil {
11842				var identity ResourceIdentity
11843				err = json.Unmarshal(*v, &identity)
11844				if err != nil {
11845					return err
11846				}
11847				mi.Identity = &identity
11848			}
11849		case "sku":
11850			if v != nil {
11851				var sku Sku
11852				err = json.Unmarshal(*v, &sku)
11853				if err != nil {
11854					return err
11855				}
11856				mi.Sku = &sku
11857			}
11858		case "properties":
11859			if v != nil {
11860				var managedInstanceProperties ManagedInstanceProperties
11861				err = json.Unmarshal(*v, &managedInstanceProperties)
11862				if err != nil {
11863					return err
11864				}
11865				mi.ManagedInstanceProperties = &managedInstanceProperties
11866			}
11867		case "location":
11868			if v != nil {
11869				var location string
11870				err = json.Unmarshal(*v, &location)
11871				if err != nil {
11872					return err
11873				}
11874				mi.Location = &location
11875			}
11876		case "tags":
11877			if v != nil {
11878				var tags map[string]*string
11879				err = json.Unmarshal(*v, &tags)
11880				if err != nil {
11881					return err
11882				}
11883				mi.Tags = tags
11884			}
11885		case "id":
11886			if v != nil {
11887				var ID string
11888				err = json.Unmarshal(*v, &ID)
11889				if err != nil {
11890					return err
11891				}
11892				mi.ID = &ID
11893			}
11894		case "name":
11895			if v != nil {
11896				var name string
11897				err = json.Unmarshal(*v, &name)
11898				if err != nil {
11899					return err
11900				}
11901				mi.Name = &name
11902			}
11903		case "type":
11904			if v != nil {
11905				var typeVar string
11906				err = json.Unmarshal(*v, &typeVar)
11907				if err != nil {
11908					return err
11909				}
11910				mi.Type = &typeVar
11911			}
11912		}
11913	}
11914
11915	return nil
11916}
11917
11918// ManagedInstanceAdministrator an Azure SQL managed instance administrator.
11919type ManagedInstanceAdministrator struct {
11920	autorest.Response `json:"-"`
11921	// ManagedInstanceAdministratorProperties - Resource properties.
11922	*ManagedInstanceAdministratorProperties `json:"properties,omitempty"`
11923	// ID - READ-ONLY; Resource ID.
11924	ID *string `json:"id,omitempty"`
11925	// Name - READ-ONLY; Resource name.
11926	Name *string `json:"name,omitempty"`
11927	// Type - READ-ONLY; Resource type.
11928	Type *string `json:"type,omitempty"`
11929}
11930
11931// MarshalJSON is the custom marshaler for ManagedInstanceAdministrator.
11932func (mia ManagedInstanceAdministrator) MarshalJSON() ([]byte, error) {
11933	objectMap := make(map[string]interface{})
11934	if mia.ManagedInstanceAdministratorProperties != nil {
11935		objectMap["properties"] = mia.ManagedInstanceAdministratorProperties
11936	}
11937	return json.Marshal(objectMap)
11938}
11939
11940// UnmarshalJSON is the custom unmarshaler for ManagedInstanceAdministrator struct.
11941func (mia *ManagedInstanceAdministrator) UnmarshalJSON(body []byte) error {
11942	var m map[string]*json.RawMessage
11943	err := json.Unmarshal(body, &m)
11944	if err != nil {
11945		return err
11946	}
11947	for k, v := range m {
11948		switch k {
11949		case "properties":
11950			if v != nil {
11951				var managedInstanceAdministratorProperties ManagedInstanceAdministratorProperties
11952				err = json.Unmarshal(*v, &managedInstanceAdministratorProperties)
11953				if err != nil {
11954					return err
11955				}
11956				mia.ManagedInstanceAdministratorProperties = &managedInstanceAdministratorProperties
11957			}
11958		case "id":
11959			if v != nil {
11960				var ID string
11961				err = json.Unmarshal(*v, &ID)
11962				if err != nil {
11963					return err
11964				}
11965				mia.ID = &ID
11966			}
11967		case "name":
11968			if v != nil {
11969				var name string
11970				err = json.Unmarshal(*v, &name)
11971				if err != nil {
11972					return err
11973				}
11974				mia.Name = &name
11975			}
11976		case "type":
11977			if v != nil {
11978				var typeVar string
11979				err = json.Unmarshal(*v, &typeVar)
11980				if err != nil {
11981					return err
11982				}
11983				mia.Type = &typeVar
11984			}
11985		}
11986	}
11987
11988	return nil
11989}
11990
11991// ManagedInstanceAdministratorListResult a list of managed instance administrators.
11992type ManagedInstanceAdministratorListResult struct {
11993	autorest.Response `json:"-"`
11994	// Value - READ-ONLY; Array of results.
11995	Value *[]ManagedInstanceAdministrator `json:"value,omitempty"`
11996	// NextLink - READ-ONLY; Link to retrieve next page of results.
11997	NextLink *string `json:"nextLink,omitempty"`
11998}
11999
12000// MarshalJSON is the custom marshaler for ManagedInstanceAdministratorListResult.
12001func (mialr ManagedInstanceAdministratorListResult) MarshalJSON() ([]byte, error) {
12002	objectMap := make(map[string]interface{})
12003	return json.Marshal(objectMap)
12004}
12005
12006// ManagedInstanceAdministratorListResultIterator provides access to a complete listing of
12007// ManagedInstanceAdministrator values.
12008type ManagedInstanceAdministratorListResultIterator struct {
12009	i    int
12010	page ManagedInstanceAdministratorListResultPage
12011}
12012
12013// NextWithContext advances to the next value.  If there was an error making
12014// the request the iterator does not advance and the error is returned.
12015func (iter *ManagedInstanceAdministratorListResultIterator) NextWithContext(ctx context.Context) (err error) {
12016	if tracing.IsEnabled() {
12017		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorListResultIterator.NextWithContext")
12018		defer func() {
12019			sc := -1
12020			if iter.Response().Response.Response != nil {
12021				sc = iter.Response().Response.Response.StatusCode
12022			}
12023			tracing.EndSpan(ctx, sc, err)
12024		}()
12025	}
12026	iter.i++
12027	if iter.i < len(iter.page.Values()) {
12028		return nil
12029	}
12030	err = iter.page.NextWithContext(ctx)
12031	if err != nil {
12032		iter.i--
12033		return err
12034	}
12035	iter.i = 0
12036	return nil
12037}
12038
12039// Next advances to the next value.  If there was an error making
12040// the request the iterator does not advance and the error is returned.
12041// Deprecated: Use NextWithContext() instead.
12042func (iter *ManagedInstanceAdministratorListResultIterator) Next() error {
12043	return iter.NextWithContext(context.Background())
12044}
12045
12046// NotDone returns true if the enumeration should be started or is not yet complete.
12047func (iter ManagedInstanceAdministratorListResultIterator) NotDone() bool {
12048	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12049}
12050
12051// Response returns the raw server response from the last page request.
12052func (iter ManagedInstanceAdministratorListResultIterator) Response() ManagedInstanceAdministratorListResult {
12053	return iter.page.Response()
12054}
12055
12056// Value returns the current value or a zero-initialized value if the
12057// iterator has advanced beyond the end of the collection.
12058func (iter ManagedInstanceAdministratorListResultIterator) Value() ManagedInstanceAdministrator {
12059	if !iter.page.NotDone() {
12060		return ManagedInstanceAdministrator{}
12061	}
12062	return iter.page.Values()[iter.i]
12063}
12064
12065// Creates a new instance of the ManagedInstanceAdministratorListResultIterator type.
12066func NewManagedInstanceAdministratorListResultIterator(page ManagedInstanceAdministratorListResultPage) ManagedInstanceAdministratorListResultIterator {
12067	return ManagedInstanceAdministratorListResultIterator{page: page}
12068}
12069
12070// IsEmpty returns true if the ListResult contains no values.
12071func (mialr ManagedInstanceAdministratorListResult) IsEmpty() bool {
12072	return mialr.Value == nil || len(*mialr.Value) == 0
12073}
12074
12075// hasNextLink returns true if the NextLink is not empty.
12076func (mialr ManagedInstanceAdministratorListResult) hasNextLink() bool {
12077	return mialr.NextLink != nil && len(*mialr.NextLink) != 0
12078}
12079
12080// managedInstanceAdministratorListResultPreparer prepares a request to retrieve the next set of results.
12081// It returns nil if no more results exist.
12082func (mialr ManagedInstanceAdministratorListResult) managedInstanceAdministratorListResultPreparer(ctx context.Context) (*http.Request, error) {
12083	if !mialr.hasNextLink() {
12084		return nil, nil
12085	}
12086	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12087		autorest.AsJSON(),
12088		autorest.AsGet(),
12089		autorest.WithBaseURL(to.String(mialr.NextLink)))
12090}
12091
12092// ManagedInstanceAdministratorListResultPage contains a page of ManagedInstanceAdministrator values.
12093type ManagedInstanceAdministratorListResultPage struct {
12094	fn    func(context.Context, ManagedInstanceAdministratorListResult) (ManagedInstanceAdministratorListResult, error)
12095	mialr ManagedInstanceAdministratorListResult
12096}
12097
12098// NextWithContext advances to the next page of values.  If there was an error making
12099// the request the page does not advance and the error is returned.
12100func (page *ManagedInstanceAdministratorListResultPage) NextWithContext(ctx context.Context) (err error) {
12101	if tracing.IsEnabled() {
12102		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorListResultPage.NextWithContext")
12103		defer func() {
12104			sc := -1
12105			if page.Response().Response.Response != nil {
12106				sc = page.Response().Response.Response.StatusCode
12107			}
12108			tracing.EndSpan(ctx, sc, err)
12109		}()
12110	}
12111	for {
12112		next, err := page.fn(ctx, page.mialr)
12113		if err != nil {
12114			return err
12115		}
12116		page.mialr = next
12117		if !next.hasNextLink() || !next.IsEmpty() {
12118			break
12119		}
12120	}
12121	return nil
12122}
12123
12124// Next advances to the next page of values.  If there was an error making
12125// the request the page does not advance and the error is returned.
12126// Deprecated: Use NextWithContext() instead.
12127func (page *ManagedInstanceAdministratorListResultPage) Next() error {
12128	return page.NextWithContext(context.Background())
12129}
12130
12131// NotDone returns true if the page enumeration should be started or is not yet complete.
12132func (page ManagedInstanceAdministratorListResultPage) NotDone() bool {
12133	return !page.mialr.IsEmpty()
12134}
12135
12136// Response returns the raw server response from the last page request.
12137func (page ManagedInstanceAdministratorListResultPage) Response() ManagedInstanceAdministratorListResult {
12138	return page.mialr
12139}
12140
12141// Values returns the slice of values for the current page or nil if there are no values.
12142func (page ManagedInstanceAdministratorListResultPage) Values() []ManagedInstanceAdministrator {
12143	if page.mialr.IsEmpty() {
12144		return nil
12145	}
12146	return *page.mialr.Value
12147}
12148
12149// Creates a new instance of the ManagedInstanceAdministratorListResultPage type.
12150func NewManagedInstanceAdministratorListResultPage(cur ManagedInstanceAdministratorListResult, getNextPage func(context.Context, ManagedInstanceAdministratorListResult) (ManagedInstanceAdministratorListResult, error)) ManagedInstanceAdministratorListResultPage {
12151	return ManagedInstanceAdministratorListResultPage{
12152		fn:    getNextPage,
12153		mialr: cur,
12154	}
12155}
12156
12157// ManagedInstanceAdministratorProperties the properties of a managed instance administrator.
12158type ManagedInstanceAdministratorProperties struct {
12159	// AdministratorType - Type of the managed instance administrator.
12160	AdministratorType *string `json:"administratorType,omitempty"`
12161	// Login - Login name of the managed instance administrator.
12162	Login *string `json:"login,omitempty"`
12163	// Sid - SID (object ID) of the managed instance administrator.
12164	Sid *uuid.UUID `json:"sid,omitempty"`
12165	// TenantID - Tenant ID of the managed instance administrator.
12166	TenantID *uuid.UUID `json:"tenantId,omitempty"`
12167}
12168
12169// ManagedInstanceAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
12170// results of a long-running operation.
12171type ManagedInstanceAdministratorsCreateOrUpdateFuture struct {
12172	azure.FutureAPI
12173	// Result returns the result of the asynchronous operation.
12174	// If the operation has not completed it will return an error.
12175	Result func(ManagedInstanceAdministratorsClient) (ManagedInstanceAdministrator, error)
12176}
12177
12178// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12179func (future *ManagedInstanceAdministratorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12180	var azFuture azure.Future
12181	if err := json.Unmarshal(body, &azFuture); err != nil {
12182		return err
12183	}
12184	future.FutureAPI = &azFuture
12185	future.Result = future.result
12186	return nil
12187}
12188
12189// result is the default implementation for ManagedInstanceAdministratorsCreateOrUpdateFuture.Result.
12190func (future *ManagedInstanceAdministratorsCreateOrUpdateFuture) result(client ManagedInstanceAdministratorsClient) (mia ManagedInstanceAdministrator, err error) {
12191	var done bool
12192	done, err = future.DoneWithContext(context.Background(), client)
12193	if err != nil {
12194		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12195		return
12196	}
12197	if !done {
12198		mia.Response.Response = future.Response()
12199		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAdministratorsCreateOrUpdateFuture")
12200		return
12201	}
12202	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12203	if mia.Response.Response, err = future.GetResult(sender); err == nil && mia.Response.Response.StatusCode != http.StatusNoContent {
12204		mia, err = client.CreateOrUpdateResponder(mia.Response.Response)
12205		if err != nil {
12206			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsCreateOrUpdateFuture", "Result", mia.Response.Response, "Failure responding to request")
12207		}
12208	}
12209	return
12210}
12211
12212// ManagedInstanceAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a
12213// long-running operation.
12214type ManagedInstanceAdministratorsDeleteFuture struct {
12215	azure.FutureAPI
12216	// Result returns the result of the asynchronous operation.
12217	// If the operation has not completed it will return an error.
12218	Result func(ManagedInstanceAdministratorsClient) (autorest.Response, error)
12219}
12220
12221// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12222func (future *ManagedInstanceAdministratorsDeleteFuture) UnmarshalJSON(body []byte) error {
12223	var azFuture azure.Future
12224	if err := json.Unmarshal(body, &azFuture); err != nil {
12225		return err
12226	}
12227	future.FutureAPI = &azFuture
12228	future.Result = future.result
12229	return nil
12230}
12231
12232// result is the default implementation for ManagedInstanceAdministratorsDeleteFuture.Result.
12233func (future *ManagedInstanceAdministratorsDeleteFuture) result(client ManagedInstanceAdministratorsClient) (ar autorest.Response, err error) {
12234	var done bool
12235	done, err = future.DoneWithContext(context.Background(), client)
12236	if err != nil {
12237		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure")
12238		return
12239	}
12240	if !done {
12241		ar.Response = future.Response()
12242		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAdministratorsDeleteFuture")
12243		return
12244	}
12245	ar.Response = future.Response()
12246	return
12247}
12248
12249// ManagedInstanceAzureADOnlyAuthentication azure Active Directory only authentication.
12250type ManagedInstanceAzureADOnlyAuthentication struct {
12251	autorest.Response `json:"-"`
12252	// ManagedInstanceAzureADOnlyAuthProperties - Resource properties.
12253	*ManagedInstanceAzureADOnlyAuthProperties `json:"properties,omitempty"`
12254	// ID - READ-ONLY; Resource ID.
12255	ID *string `json:"id,omitempty"`
12256	// Name - READ-ONLY; Resource name.
12257	Name *string `json:"name,omitempty"`
12258	// Type - READ-ONLY; Resource type.
12259	Type *string `json:"type,omitempty"`
12260}
12261
12262// MarshalJSON is the custom marshaler for ManagedInstanceAzureADOnlyAuthentication.
12263func (miaaoa ManagedInstanceAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) {
12264	objectMap := make(map[string]interface{})
12265	if miaaoa.ManagedInstanceAzureADOnlyAuthProperties != nil {
12266		objectMap["properties"] = miaaoa.ManagedInstanceAzureADOnlyAuthProperties
12267	}
12268	return json.Marshal(objectMap)
12269}
12270
12271// UnmarshalJSON is the custom unmarshaler for ManagedInstanceAzureADOnlyAuthentication struct.
12272func (miaaoa *ManagedInstanceAzureADOnlyAuthentication) UnmarshalJSON(body []byte) error {
12273	var m map[string]*json.RawMessage
12274	err := json.Unmarshal(body, &m)
12275	if err != nil {
12276		return err
12277	}
12278	for k, v := range m {
12279		switch k {
12280		case "properties":
12281			if v != nil {
12282				var managedInstanceAzureADOnlyAuthProperties ManagedInstanceAzureADOnlyAuthProperties
12283				err = json.Unmarshal(*v, &managedInstanceAzureADOnlyAuthProperties)
12284				if err != nil {
12285					return err
12286				}
12287				miaaoa.ManagedInstanceAzureADOnlyAuthProperties = &managedInstanceAzureADOnlyAuthProperties
12288			}
12289		case "id":
12290			if v != nil {
12291				var ID string
12292				err = json.Unmarshal(*v, &ID)
12293				if err != nil {
12294					return err
12295				}
12296				miaaoa.ID = &ID
12297			}
12298		case "name":
12299			if v != nil {
12300				var name string
12301				err = json.Unmarshal(*v, &name)
12302				if err != nil {
12303					return err
12304				}
12305				miaaoa.Name = &name
12306			}
12307		case "type":
12308			if v != nil {
12309				var typeVar string
12310				err = json.Unmarshal(*v, &typeVar)
12311				if err != nil {
12312					return err
12313				}
12314				miaaoa.Type = &typeVar
12315			}
12316		}
12317	}
12318
12319	return nil
12320}
12321
12322// ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture an abstraction for monitoring and
12323// retrieving the results of a long-running operation.
12324type ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture struct {
12325	azure.FutureAPI
12326	// Result returns the result of the asynchronous operation.
12327	// If the operation has not completed it will return an error.
12328	Result func(ManagedInstanceAzureADOnlyAuthenticationsClient) (ManagedInstanceAzureADOnlyAuthentication, error)
12329}
12330
12331// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12332func (future *ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12333	var azFuture azure.Future
12334	if err := json.Unmarshal(body, &azFuture); err != nil {
12335		return err
12336	}
12337	future.FutureAPI = &azFuture
12338	future.Result = future.result
12339	return nil
12340}
12341
12342// result is the default implementation for ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture.Result.
12343func (future *ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture) result(client ManagedInstanceAzureADOnlyAuthenticationsClient) (miaaoa ManagedInstanceAzureADOnlyAuthentication, err error) {
12344	var done bool
12345	done, err = future.DoneWithContext(context.Background(), client)
12346	if err != nil {
12347		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12348		return
12349	}
12350	if !done {
12351		miaaoa.Response.Response = future.Response()
12352		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture")
12353		return
12354	}
12355	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12356	if miaaoa.Response.Response, err = future.GetResult(sender); err == nil && miaaoa.Response.Response.StatusCode != http.StatusNoContent {
12357		miaaoa, err = client.CreateOrUpdateResponder(miaaoa.Response.Response)
12358		if err != nil {
12359			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture", "Result", miaaoa.Response.Response, "Failure responding to request")
12360		}
12361	}
12362	return
12363}
12364
12365// ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture an abstraction for monitoring and retrieving the
12366// results of a long-running operation.
12367type ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture struct {
12368	azure.FutureAPI
12369	// Result returns the result of the asynchronous operation.
12370	// If the operation has not completed it will return an error.
12371	Result func(ManagedInstanceAzureADOnlyAuthenticationsClient) (autorest.Response, error)
12372}
12373
12374// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12375func (future *ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture) UnmarshalJSON(body []byte) error {
12376	var azFuture azure.Future
12377	if err := json.Unmarshal(body, &azFuture); err != nil {
12378		return err
12379	}
12380	future.FutureAPI = &azFuture
12381	future.Result = future.result
12382	return nil
12383}
12384
12385// result is the default implementation for ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture.Result.
12386func (future *ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture) result(client ManagedInstanceAzureADOnlyAuthenticationsClient) (ar autorest.Response, err error) {
12387	var done bool
12388	done, err = future.DoneWithContext(context.Background(), client)
12389	if err != nil {
12390		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture", "Result", future.Response(), "Polling failure")
12391		return
12392	}
12393	if !done {
12394		ar.Response = future.Response()
12395		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture")
12396		return
12397	}
12398	ar.Response = future.Response()
12399	return
12400}
12401
12402// ManagedInstanceAzureADOnlyAuthListResult a list of active directory only authentications.
12403type ManagedInstanceAzureADOnlyAuthListResult struct {
12404	autorest.Response `json:"-"`
12405	// Value - READ-ONLY; Array of results.
12406	Value *[]ManagedInstanceAzureADOnlyAuthentication `json:"value,omitempty"`
12407	// NextLink - READ-ONLY; Link to retrieve next page of results.
12408	NextLink *string `json:"nextLink,omitempty"`
12409}
12410
12411// MarshalJSON is the custom marshaler for ManagedInstanceAzureADOnlyAuthListResult.
12412func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) MarshalJSON() ([]byte, error) {
12413	objectMap := make(map[string]interface{})
12414	return json.Marshal(objectMap)
12415}
12416
12417// ManagedInstanceAzureADOnlyAuthListResultIterator provides access to a complete listing of
12418// ManagedInstanceAzureADOnlyAuthentication values.
12419type ManagedInstanceAzureADOnlyAuthListResultIterator struct {
12420	i    int
12421	page ManagedInstanceAzureADOnlyAuthListResultPage
12422}
12423
12424// NextWithContext advances to the next value.  If there was an error making
12425// the request the iterator does not advance and the error is returned.
12426func (iter *ManagedInstanceAzureADOnlyAuthListResultIterator) NextWithContext(ctx context.Context) (err error) {
12427	if tracing.IsEnabled() {
12428		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAzureADOnlyAuthListResultIterator.NextWithContext")
12429		defer func() {
12430			sc := -1
12431			if iter.Response().Response.Response != nil {
12432				sc = iter.Response().Response.Response.StatusCode
12433			}
12434			tracing.EndSpan(ctx, sc, err)
12435		}()
12436	}
12437	iter.i++
12438	if iter.i < len(iter.page.Values()) {
12439		return nil
12440	}
12441	err = iter.page.NextWithContext(ctx)
12442	if err != nil {
12443		iter.i--
12444		return err
12445	}
12446	iter.i = 0
12447	return nil
12448}
12449
12450// Next advances to the next value.  If there was an error making
12451// the request the iterator does not advance and the error is returned.
12452// Deprecated: Use NextWithContext() instead.
12453func (iter *ManagedInstanceAzureADOnlyAuthListResultIterator) Next() error {
12454	return iter.NextWithContext(context.Background())
12455}
12456
12457// NotDone returns true if the enumeration should be started or is not yet complete.
12458func (iter ManagedInstanceAzureADOnlyAuthListResultIterator) NotDone() bool {
12459	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12460}
12461
12462// Response returns the raw server response from the last page request.
12463func (iter ManagedInstanceAzureADOnlyAuthListResultIterator) Response() ManagedInstanceAzureADOnlyAuthListResult {
12464	return iter.page.Response()
12465}
12466
12467// Value returns the current value or a zero-initialized value if the
12468// iterator has advanced beyond the end of the collection.
12469func (iter ManagedInstanceAzureADOnlyAuthListResultIterator) Value() ManagedInstanceAzureADOnlyAuthentication {
12470	if !iter.page.NotDone() {
12471		return ManagedInstanceAzureADOnlyAuthentication{}
12472	}
12473	return iter.page.Values()[iter.i]
12474}
12475
12476// Creates a new instance of the ManagedInstanceAzureADOnlyAuthListResultIterator type.
12477func NewManagedInstanceAzureADOnlyAuthListResultIterator(page ManagedInstanceAzureADOnlyAuthListResultPage) ManagedInstanceAzureADOnlyAuthListResultIterator {
12478	return ManagedInstanceAzureADOnlyAuthListResultIterator{page: page}
12479}
12480
12481// IsEmpty returns true if the ListResult contains no values.
12482func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) IsEmpty() bool {
12483	return miaaoalr.Value == nil || len(*miaaoalr.Value) == 0
12484}
12485
12486// hasNextLink returns true if the NextLink is not empty.
12487func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) hasNextLink() bool {
12488	return miaaoalr.NextLink != nil && len(*miaaoalr.NextLink) != 0
12489}
12490
12491// managedInstanceAzureADOnlyAuthListResultPreparer prepares a request to retrieve the next set of results.
12492// It returns nil if no more results exist.
12493func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) managedInstanceAzureADOnlyAuthListResultPreparer(ctx context.Context) (*http.Request, error) {
12494	if !miaaoalr.hasNextLink() {
12495		return nil, nil
12496	}
12497	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12498		autorest.AsJSON(),
12499		autorest.AsGet(),
12500		autorest.WithBaseURL(to.String(miaaoalr.NextLink)))
12501}
12502
12503// ManagedInstanceAzureADOnlyAuthListResultPage contains a page of ManagedInstanceAzureADOnlyAuthentication
12504// values.
12505type ManagedInstanceAzureADOnlyAuthListResultPage struct {
12506	fn       func(context.Context, ManagedInstanceAzureADOnlyAuthListResult) (ManagedInstanceAzureADOnlyAuthListResult, error)
12507	miaaoalr ManagedInstanceAzureADOnlyAuthListResult
12508}
12509
12510// NextWithContext advances to the next page of values.  If there was an error making
12511// the request the page does not advance and the error is returned.
12512func (page *ManagedInstanceAzureADOnlyAuthListResultPage) NextWithContext(ctx context.Context) (err error) {
12513	if tracing.IsEnabled() {
12514		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAzureADOnlyAuthListResultPage.NextWithContext")
12515		defer func() {
12516			sc := -1
12517			if page.Response().Response.Response != nil {
12518				sc = page.Response().Response.Response.StatusCode
12519			}
12520			tracing.EndSpan(ctx, sc, err)
12521		}()
12522	}
12523	for {
12524		next, err := page.fn(ctx, page.miaaoalr)
12525		if err != nil {
12526			return err
12527		}
12528		page.miaaoalr = next
12529		if !next.hasNextLink() || !next.IsEmpty() {
12530			break
12531		}
12532	}
12533	return nil
12534}
12535
12536// Next advances to the next page of values.  If there was an error making
12537// the request the page does not advance and the error is returned.
12538// Deprecated: Use NextWithContext() instead.
12539func (page *ManagedInstanceAzureADOnlyAuthListResultPage) Next() error {
12540	return page.NextWithContext(context.Background())
12541}
12542
12543// NotDone returns true if the page enumeration should be started or is not yet complete.
12544func (page ManagedInstanceAzureADOnlyAuthListResultPage) NotDone() bool {
12545	return !page.miaaoalr.IsEmpty()
12546}
12547
12548// Response returns the raw server response from the last page request.
12549func (page ManagedInstanceAzureADOnlyAuthListResultPage) Response() ManagedInstanceAzureADOnlyAuthListResult {
12550	return page.miaaoalr
12551}
12552
12553// Values returns the slice of values for the current page or nil if there are no values.
12554func (page ManagedInstanceAzureADOnlyAuthListResultPage) Values() []ManagedInstanceAzureADOnlyAuthentication {
12555	if page.miaaoalr.IsEmpty() {
12556		return nil
12557	}
12558	return *page.miaaoalr.Value
12559}
12560
12561// Creates a new instance of the ManagedInstanceAzureADOnlyAuthListResultPage type.
12562func NewManagedInstanceAzureADOnlyAuthListResultPage(cur ManagedInstanceAzureADOnlyAuthListResult, getNextPage func(context.Context, ManagedInstanceAzureADOnlyAuthListResult) (ManagedInstanceAzureADOnlyAuthListResult, error)) ManagedInstanceAzureADOnlyAuthListResultPage {
12563	return ManagedInstanceAzureADOnlyAuthListResultPage{
12564		fn:       getNextPage,
12565		miaaoalr: cur,
12566	}
12567}
12568
12569// ManagedInstanceAzureADOnlyAuthProperties properties of a active directory only authentication for
12570// Managed Instance.
12571type ManagedInstanceAzureADOnlyAuthProperties struct {
12572	// AzureADOnlyAuthentication - Azure Active Directory only Authentication enabled.
12573	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
12574}
12575
12576// ManagedInstanceEditionCapability the managed server capability
12577type ManagedInstanceEditionCapability struct {
12578	// Name - READ-ONLY; The managed server version name.
12579	Name *string `json:"name,omitempty"`
12580	// SupportedFamilies - READ-ONLY; The supported families.
12581	SupportedFamilies *[]ManagedInstanceFamilyCapability `json:"supportedFamilies,omitempty"`
12582	// SupportedStorageCapabilities - READ-ONLY; The list of supported storage capabilities for this edition
12583	SupportedStorageCapabilities *[]StorageCapability `json:"supportedStorageCapabilities,omitempty"`
12584	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition.
12585	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
12586	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
12587	Status CapabilityStatus `json:"status,omitempty"`
12588	// Reason - The reason for the capability not being available.
12589	Reason *string `json:"reason,omitempty"`
12590}
12591
12592// MarshalJSON is the custom marshaler for ManagedInstanceEditionCapability.
12593func (miec ManagedInstanceEditionCapability) MarshalJSON() ([]byte, error) {
12594	objectMap := make(map[string]interface{})
12595	if miec.Reason != nil {
12596		objectMap["reason"] = miec.Reason
12597	}
12598	return json.Marshal(objectMap)
12599}
12600
12601// ManagedInstanceEncryptionProtector the managed instance encryption protector.
12602type ManagedInstanceEncryptionProtector struct {
12603	autorest.Response `json:"-"`
12604	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
12605	Kind *string `json:"kind,omitempty"`
12606	// ManagedInstanceEncryptionProtectorProperties - Resource properties.
12607	*ManagedInstanceEncryptionProtectorProperties `json:"properties,omitempty"`
12608	// ID - READ-ONLY; Resource ID.
12609	ID *string `json:"id,omitempty"`
12610	// Name - READ-ONLY; Resource name.
12611	Name *string `json:"name,omitempty"`
12612	// Type - READ-ONLY; Resource type.
12613	Type *string `json:"type,omitempty"`
12614}
12615
12616// MarshalJSON is the custom marshaler for ManagedInstanceEncryptionProtector.
12617func (miep ManagedInstanceEncryptionProtector) MarshalJSON() ([]byte, error) {
12618	objectMap := make(map[string]interface{})
12619	if miep.ManagedInstanceEncryptionProtectorProperties != nil {
12620		objectMap["properties"] = miep.ManagedInstanceEncryptionProtectorProperties
12621	}
12622	return json.Marshal(objectMap)
12623}
12624
12625// UnmarshalJSON is the custom unmarshaler for ManagedInstanceEncryptionProtector struct.
12626func (miep *ManagedInstanceEncryptionProtector) UnmarshalJSON(body []byte) error {
12627	var m map[string]*json.RawMessage
12628	err := json.Unmarshal(body, &m)
12629	if err != nil {
12630		return err
12631	}
12632	for k, v := range m {
12633		switch k {
12634		case "kind":
12635			if v != nil {
12636				var kind string
12637				err = json.Unmarshal(*v, &kind)
12638				if err != nil {
12639					return err
12640				}
12641				miep.Kind = &kind
12642			}
12643		case "properties":
12644			if v != nil {
12645				var managedInstanceEncryptionProtectorProperties ManagedInstanceEncryptionProtectorProperties
12646				err = json.Unmarshal(*v, &managedInstanceEncryptionProtectorProperties)
12647				if err != nil {
12648					return err
12649				}
12650				miep.ManagedInstanceEncryptionProtectorProperties = &managedInstanceEncryptionProtectorProperties
12651			}
12652		case "id":
12653			if v != nil {
12654				var ID string
12655				err = json.Unmarshal(*v, &ID)
12656				if err != nil {
12657					return err
12658				}
12659				miep.ID = &ID
12660			}
12661		case "name":
12662			if v != nil {
12663				var name string
12664				err = json.Unmarshal(*v, &name)
12665				if err != nil {
12666					return err
12667				}
12668				miep.Name = &name
12669			}
12670		case "type":
12671			if v != nil {
12672				var typeVar string
12673				err = json.Unmarshal(*v, &typeVar)
12674				if err != nil {
12675					return err
12676				}
12677				miep.Type = &typeVar
12678			}
12679		}
12680	}
12681
12682	return nil
12683}
12684
12685// ManagedInstanceEncryptionProtectorListResult a list of managed instance encryption protectors.
12686type ManagedInstanceEncryptionProtectorListResult struct {
12687	autorest.Response `json:"-"`
12688	// Value - READ-ONLY; Array of results.
12689	Value *[]ManagedInstanceEncryptionProtector `json:"value,omitempty"`
12690	// NextLink - READ-ONLY; Link to retrieve next page of results.
12691	NextLink *string `json:"nextLink,omitempty"`
12692}
12693
12694// MarshalJSON is the custom marshaler for ManagedInstanceEncryptionProtectorListResult.
12695func (mieplr ManagedInstanceEncryptionProtectorListResult) MarshalJSON() ([]byte, error) {
12696	objectMap := make(map[string]interface{})
12697	return json.Marshal(objectMap)
12698}
12699
12700// ManagedInstanceEncryptionProtectorListResultIterator provides access to a complete listing of
12701// ManagedInstanceEncryptionProtector values.
12702type ManagedInstanceEncryptionProtectorListResultIterator struct {
12703	i    int
12704	page ManagedInstanceEncryptionProtectorListResultPage
12705}
12706
12707// NextWithContext advances to the next value.  If there was an error making
12708// the request the iterator does not advance and the error is returned.
12709func (iter *ManagedInstanceEncryptionProtectorListResultIterator) NextWithContext(ctx context.Context) (err error) {
12710	if tracing.IsEnabled() {
12711		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorListResultIterator.NextWithContext")
12712		defer func() {
12713			sc := -1
12714			if iter.Response().Response.Response != nil {
12715				sc = iter.Response().Response.Response.StatusCode
12716			}
12717			tracing.EndSpan(ctx, sc, err)
12718		}()
12719	}
12720	iter.i++
12721	if iter.i < len(iter.page.Values()) {
12722		return nil
12723	}
12724	err = iter.page.NextWithContext(ctx)
12725	if err != nil {
12726		iter.i--
12727		return err
12728	}
12729	iter.i = 0
12730	return nil
12731}
12732
12733// Next advances to the next value.  If there was an error making
12734// the request the iterator does not advance and the error is returned.
12735// Deprecated: Use NextWithContext() instead.
12736func (iter *ManagedInstanceEncryptionProtectorListResultIterator) Next() error {
12737	return iter.NextWithContext(context.Background())
12738}
12739
12740// NotDone returns true if the enumeration should be started or is not yet complete.
12741func (iter ManagedInstanceEncryptionProtectorListResultIterator) NotDone() bool {
12742	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12743}
12744
12745// Response returns the raw server response from the last page request.
12746func (iter ManagedInstanceEncryptionProtectorListResultIterator) Response() ManagedInstanceEncryptionProtectorListResult {
12747	return iter.page.Response()
12748}
12749
12750// Value returns the current value or a zero-initialized value if the
12751// iterator has advanced beyond the end of the collection.
12752func (iter ManagedInstanceEncryptionProtectorListResultIterator) Value() ManagedInstanceEncryptionProtector {
12753	if !iter.page.NotDone() {
12754		return ManagedInstanceEncryptionProtector{}
12755	}
12756	return iter.page.Values()[iter.i]
12757}
12758
12759// Creates a new instance of the ManagedInstanceEncryptionProtectorListResultIterator type.
12760func NewManagedInstanceEncryptionProtectorListResultIterator(page ManagedInstanceEncryptionProtectorListResultPage) ManagedInstanceEncryptionProtectorListResultIterator {
12761	return ManagedInstanceEncryptionProtectorListResultIterator{page: page}
12762}
12763
12764// IsEmpty returns true if the ListResult contains no values.
12765func (mieplr ManagedInstanceEncryptionProtectorListResult) IsEmpty() bool {
12766	return mieplr.Value == nil || len(*mieplr.Value) == 0
12767}
12768
12769// hasNextLink returns true if the NextLink is not empty.
12770func (mieplr ManagedInstanceEncryptionProtectorListResult) hasNextLink() bool {
12771	return mieplr.NextLink != nil && len(*mieplr.NextLink) != 0
12772}
12773
12774// managedInstanceEncryptionProtectorListResultPreparer prepares a request to retrieve the next set of results.
12775// It returns nil if no more results exist.
12776func (mieplr ManagedInstanceEncryptionProtectorListResult) managedInstanceEncryptionProtectorListResultPreparer(ctx context.Context) (*http.Request, error) {
12777	if !mieplr.hasNextLink() {
12778		return nil, nil
12779	}
12780	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12781		autorest.AsJSON(),
12782		autorest.AsGet(),
12783		autorest.WithBaseURL(to.String(mieplr.NextLink)))
12784}
12785
12786// ManagedInstanceEncryptionProtectorListResultPage contains a page of ManagedInstanceEncryptionProtector
12787// values.
12788type ManagedInstanceEncryptionProtectorListResultPage struct {
12789	fn     func(context.Context, ManagedInstanceEncryptionProtectorListResult) (ManagedInstanceEncryptionProtectorListResult, error)
12790	mieplr ManagedInstanceEncryptionProtectorListResult
12791}
12792
12793// NextWithContext advances to the next page of values.  If there was an error making
12794// the request the page does not advance and the error is returned.
12795func (page *ManagedInstanceEncryptionProtectorListResultPage) NextWithContext(ctx context.Context) (err error) {
12796	if tracing.IsEnabled() {
12797		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorListResultPage.NextWithContext")
12798		defer func() {
12799			sc := -1
12800			if page.Response().Response.Response != nil {
12801				sc = page.Response().Response.Response.StatusCode
12802			}
12803			tracing.EndSpan(ctx, sc, err)
12804		}()
12805	}
12806	for {
12807		next, err := page.fn(ctx, page.mieplr)
12808		if err != nil {
12809			return err
12810		}
12811		page.mieplr = next
12812		if !next.hasNextLink() || !next.IsEmpty() {
12813			break
12814		}
12815	}
12816	return nil
12817}
12818
12819// Next advances to the next page of values.  If there was an error making
12820// the request the page does not advance and the error is returned.
12821// Deprecated: Use NextWithContext() instead.
12822func (page *ManagedInstanceEncryptionProtectorListResultPage) Next() error {
12823	return page.NextWithContext(context.Background())
12824}
12825
12826// NotDone returns true if the page enumeration should be started or is not yet complete.
12827func (page ManagedInstanceEncryptionProtectorListResultPage) NotDone() bool {
12828	return !page.mieplr.IsEmpty()
12829}
12830
12831// Response returns the raw server response from the last page request.
12832func (page ManagedInstanceEncryptionProtectorListResultPage) Response() ManagedInstanceEncryptionProtectorListResult {
12833	return page.mieplr
12834}
12835
12836// Values returns the slice of values for the current page or nil if there are no values.
12837func (page ManagedInstanceEncryptionProtectorListResultPage) Values() []ManagedInstanceEncryptionProtector {
12838	if page.mieplr.IsEmpty() {
12839		return nil
12840	}
12841	return *page.mieplr.Value
12842}
12843
12844// Creates a new instance of the ManagedInstanceEncryptionProtectorListResultPage type.
12845func NewManagedInstanceEncryptionProtectorListResultPage(cur ManagedInstanceEncryptionProtectorListResult, getNextPage func(context.Context, ManagedInstanceEncryptionProtectorListResult) (ManagedInstanceEncryptionProtectorListResult, error)) ManagedInstanceEncryptionProtectorListResultPage {
12846	return ManagedInstanceEncryptionProtectorListResultPage{
12847		fn:     getNextPage,
12848		mieplr: cur,
12849	}
12850}
12851
12852// ManagedInstanceEncryptionProtectorProperties properties for an encryption protector execution.
12853type ManagedInstanceEncryptionProtectorProperties struct {
12854	// ServerKeyName - The name of the managed instance key.
12855	ServerKeyName *string `json:"serverKeyName,omitempty"`
12856	// ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
12857	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
12858	// URI - READ-ONLY; The URI of the server key.
12859	URI *string `json:"uri,omitempty"`
12860	// Thumbprint - READ-ONLY; Thumbprint of the server key.
12861	Thumbprint *string `json:"thumbprint,omitempty"`
12862}
12863
12864// MarshalJSON is the custom marshaler for ManagedInstanceEncryptionProtectorProperties.
12865func (miepp ManagedInstanceEncryptionProtectorProperties) MarshalJSON() ([]byte, error) {
12866	objectMap := make(map[string]interface{})
12867	if miepp.ServerKeyName != nil {
12868		objectMap["serverKeyName"] = miepp.ServerKeyName
12869	}
12870	if miepp.ServerKeyType != "" {
12871		objectMap["serverKeyType"] = miepp.ServerKeyType
12872	}
12873	return json.Marshal(objectMap)
12874}
12875
12876// ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
12877// results of a long-running operation.
12878type ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture struct {
12879	azure.FutureAPI
12880	// Result returns the result of the asynchronous operation.
12881	// If the operation has not completed it will return an error.
12882	Result func(ManagedInstanceEncryptionProtectorsClient) (ManagedInstanceEncryptionProtector, error)
12883}
12884
12885// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12886func (future *ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12887	var azFuture azure.Future
12888	if err := json.Unmarshal(body, &azFuture); err != nil {
12889		return err
12890	}
12891	future.FutureAPI = &azFuture
12892	future.Result = future.result
12893	return nil
12894}
12895
12896// result is the default implementation for ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture.Result.
12897func (future *ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture) result(client ManagedInstanceEncryptionProtectorsClient) (miep ManagedInstanceEncryptionProtector, err error) {
12898	var done bool
12899	done, err = future.DoneWithContext(context.Background(), client)
12900	if err != nil {
12901		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12902		return
12903	}
12904	if !done {
12905		miep.Response.Response = future.Response()
12906		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture")
12907		return
12908	}
12909	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12910	if miep.Response.Response, err = future.GetResult(sender); err == nil && miep.Response.Response.StatusCode != http.StatusNoContent {
12911		miep, err = client.CreateOrUpdateResponder(miep.Response.Response)
12912		if err != nil {
12913			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture", "Result", miep.Response.Response, "Failure responding to request")
12914		}
12915	}
12916	return
12917}
12918
12919// ManagedInstanceEncryptionProtectorsRevalidateFuture an abstraction for monitoring and retrieving the
12920// results of a long-running operation.
12921type ManagedInstanceEncryptionProtectorsRevalidateFuture struct {
12922	azure.FutureAPI
12923	// Result returns the result of the asynchronous operation.
12924	// If the operation has not completed it will return an error.
12925	Result func(ManagedInstanceEncryptionProtectorsClient) (autorest.Response, error)
12926}
12927
12928// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12929func (future *ManagedInstanceEncryptionProtectorsRevalidateFuture) UnmarshalJSON(body []byte) error {
12930	var azFuture azure.Future
12931	if err := json.Unmarshal(body, &azFuture); err != nil {
12932		return err
12933	}
12934	future.FutureAPI = &azFuture
12935	future.Result = future.result
12936	return nil
12937}
12938
12939// result is the default implementation for ManagedInstanceEncryptionProtectorsRevalidateFuture.Result.
12940func (future *ManagedInstanceEncryptionProtectorsRevalidateFuture) result(client ManagedInstanceEncryptionProtectorsClient) (ar autorest.Response, err error) {
12941	var done bool
12942	done, err = future.DoneWithContext(context.Background(), client)
12943	if err != nil {
12944		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsRevalidateFuture", "Result", future.Response(), "Polling failure")
12945		return
12946	}
12947	if !done {
12948		ar.Response = future.Response()
12949		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceEncryptionProtectorsRevalidateFuture")
12950		return
12951	}
12952	ar.Response = future.Response()
12953	return
12954}
12955
12956// ManagedInstanceFamilyCapability the managed server family capability.
12957type ManagedInstanceFamilyCapability struct {
12958	// Name - READ-ONLY; Family name.
12959	Name *string `json:"name,omitempty"`
12960	// Sku - READ-ONLY; SKU name.
12961	Sku *string `json:"sku,omitempty"`
12962	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
12963	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
12964	// SupportedVcoresValues - READ-ONLY; List of supported virtual cores values.
12965	SupportedVcoresValues *[]ManagedInstanceVcoresCapability `json:"supportedVcoresValues,omitempty"`
12966	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
12967	Status CapabilityStatus `json:"status,omitempty"`
12968	// Reason - The reason for the capability not being available.
12969	Reason *string `json:"reason,omitempty"`
12970}
12971
12972// MarshalJSON is the custom marshaler for ManagedInstanceFamilyCapability.
12973func (mifc ManagedInstanceFamilyCapability) MarshalJSON() ([]byte, error) {
12974	objectMap := make(map[string]interface{})
12975	if mifc.Reason != nil {
12976		objectMap["reason"] = mifc.Reason
12977	}
12978	return json.Marshal(objectMap)
12979}
12980
12981// ManagedInstanceKey a managed instance key.
12982type ManagedInstanceKey struct {
12983	autorest.Response `json:"-"`
12984	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
12985	Kind *string `json:"kind,omitempty"`
12986	// ManagedInstanceKeyProperties - Resource properties.
12987	*ManagedInstanceKeyProperties `json:"properties,omitempty"`
12988	// ID - READ-ONLY; Resource ID.
12989	ID *string `json:"id,omitempty"`
12990	// Name - READ-ONLY; Resource name.
12991	Name *string `json:"name,omitempty"`
12992	// Type - READ-ONLY; Resource type.
12993	Type *string `json:"type,omitempty"`
12994}
12995
12996// MarshalJSON is the custom marshaler for ManagedInstanceKey.
12997func (mik ManagedInstanceKey) MarshalJSON() ([]byte, error) {
12998	objectMap := make(map[string]interface{})
12999	if mik.ManagedInstanceKeyProperties != nil {
13000		objectMap["properties"] = mik.ManagedInstanceKeyProperties
13001	}
13002	return json.Marshal(objectMap)
13003}
13004
13005// UnmarshalJSON is the custom unmarshaler for ManagedInstanceKey struct.
13006func (mik *ManagedInstanceKey) UnmarshalJSON(body []byte) error {
13007	var m map[string]*json.RawMessage
13008	err := json.Unmarshal(body, &m)
13009	if err != nil {
13010		return err
13011	}
13012	for k, v := range m {
13013		switch k {
13014		case "kind":
13015			if v != nil {
13016				var kind string
13017				err = json.Unmarshal(*v, &kind)
13018				if err != nil {
13019					return err
13020				}
13021				mik.Kind = &kind
13022			}
13023		case "properties":
13024			if v != nil {
13025				var managedInstanceKeyProperties ManagedInstanceKeyProperties
13026				err = json.Unmarshal(*v, &managedInstanceKeyProperties)
13027				if err != nil {
13028					return err
13029				}
13030				mik.ManagedInstanceKeyProperties = &managedInstanceKeyProperties
13031			}
13032		case "id":
13033			if v != nil {
13034				var ID string
13035				err = json.Unmarshal(*v, &ID)
13036				if err != nil {
13037					return err
13038				}
13039				mik.ID = &ID
13040			}
13041		case "name":
13042			if v != nil {
13043				var name string
13044				err = json.Unmarshal(*v, &name)
13045				if err != nil {
13046					return err
13047				}
13048				mik.Name = &name
13049			}
13050		case "type":
13051			if v != nil {
13052				var typeVar string
13053				err = json.Unmarshal(*v, &typeVar)
13054				if err != nil {
13055					return err
13056				}
13057				mik.Type = &typeVar
13058			}
13059		}
13060	}
13061
13062	return nil
13063}
13064
13065// ManagedInstanceKeyListResult a list of managed instance keys.
13066type ManagedInstanceKeyListResult struct {
13067	autorest.Response `json:"-"`
13068	// Value - READ-ONLY; Array of results.
13069	Value *[]ManagedInstanceKey `json:"value,omitempty"`
13070	// NextLink - READ-ONLY; Link to retrieve next page of results.
13071	NextLink *string `json:"nextLink,omitempty"`
13072}
13073
13074// MarshalJSON is the custom marshaler for ManagedInstanceKeyListResult.
13075func (miklr ManagedInstanceKeyListResult) MarshalJSON() ([]byte, error) {
13076	objectMap := make(map[string]interface{})
13077	return json.Marshal(objectMap)
13078}
13079
13080// ManagedInstanceKeyListResultIterator provides access to a complete listing of ManagedInstanceKey values.
13081type ManagedInstanceKeyListResultIterator struct {
13082	i    int
13083	page ManagedInstanceKeyListResultPage
13084}
13085
13086// NextWithContext advances to the next value.  If there was an error making
13087// the request the iterator does not advance and the error is returned.
13088func (iter *ManagedInstanceKeyListResultIterator) NextWithContext(ctx context.Context) (err error) {
13089	if tracing.IsEnabled() {
13090		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeyListResultIterator.NextWithContext")
13091		defer func() {
13092			sc := -1
13093			if iter.Response().Response.Response != nil {
13094				sc = iter.Response().Response.Response.StatusCode
13095			}
13096			tracing.EndSpan(ctx, sc, err)
13097		}()
13098	}
13099	iter.i++
13100	if iter.i < len(iter.page.Values()) {
13101		return nil
13102	}
13103	err = iter.page.NextWithContext(ctx)
13104	if err != nil {
13105		iter.i--
13106		return err
13107	}
13108	iter.i = 0
13109	return nil
13110}
13111
13112// Next advances to the next value.  If there was an error making
13113// the request the iterator does not advance and the error is returned.
13114// Deprecated: Use NextWithContext() instead.
13115func (iter *ManagedInstanceKeyListResultIterator) Next() error {
13116	return iter.NextWithContext(context.Background())
13117}
13118
13119// NotDone returns true if the enumeration should be started or is not yet complete.
13120func (iter ManagedInstanceKeyListResultIterator) NotDone() bool {
13121	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13122}
13123
13124// Response returns the raw server response from the last page request.
13125func (iter ManagedInstanceKeyListResultIterator) Response() ManagedInstanceKeyListResult {
13126	return iter.page.Response()
13127}
13128
13129// Value returns the current value or a zero-initialized value if the
13130// iterator has advanced beyond the end of the collection.
13131func (iter ManagedInstanceKeyListResultIterator) Value() ManagedInstanceKey {
13132	if !iter.page.NotDone() {
13133		return ManagedInstanceKey{}
13134	}
13135	return iter.page.Values()[iter.i]
13136}
13137
13138// Creates a new instance of the ManagedInstanceKeyListResultIterator type.
13139func NewManagedInstanceKeyListResultIterator(page ManagedInstanceKeyListResultPage) ManagedInstanceKeyListResultIterator {
13140	return ManagedInstanceKeyListResultIterator{page: page}
13141}
13142
13143// IsEmpty returns true if the ListResult contains no values.
13144func (miklr ManagedInstanceKeyListResult) IsEmpty() bool {
13145	return miklr.Value == nil || len(*miklr.Value) == 0
13146}
13147
13148// hasNextLink returns true if the NextLink is not empty.
13149func (miklr ManagedInstanceKeyListResult) hasNextLink() bool {
13150	return miklr.NextLink != nil && len(*miklr.NextLink) != 0
13151}
13152
13153// managedInstanceKeyListResultPreparer prepares a request to retrieve the next set of results.
13154// It returns nil if no more results exist.
13155func (miklr ManagedInstanceKeyListResult) managedInstanceKeyListResultPreparer(ctx context.Context) (*http.Request, error) {
13156	if !miklr.hasNextLink() {
13157		return nil, nil
13158	}
13159	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13160		autorest.AsJSON(),
13161		autorest.AsGet(),
13162		autorest.WithBaseURL(to.String(miklr.NextLink)))
13163}
13164
13165// ManagedInstanceKeyListResultPage contains a page of ManagedInstanceKey values.
13166type ManagedInstanceKeyListResultPage struct {
13167	fn    func(context.Context, ManagedInstanceKeyListResult) (ManagedInstanceKeyListResult, error)
13168	miklr ManagedInstanceKeyListResult
13169}
13170
13171// NextWithContext advances to the next page of values.  If there was an error making
13172// the request the page does not advance and the error is returned.
13173func (page *ManagedInstanceKeyListResultPage) NextWithContext(ctx context.Context) (err error) {
13174	if tracing.IsEnabled() {
13175		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeyListResultPage.NextWithContext")
13176		defer func() {
13177			sc := -1
13178			if page.Response().Response.Response != nil {
13179				sc = page.Response().Response.Response.StatusCode
13180			}
13181			tracing.EndSpan(ctx, sc, err)
13182		}()
13183	}
13184	for {
13185		next, err := page.fn(ctx, page.miklr)
13186		if err != nil {
13187			return err
13188		}
13189		page.miklr = next
13190		if !next.hasNextLink() || !next.IsEmpty() {
13191			break
13192		}
13193	}
13194	return nil
13195}
13196
13197// Next advances to the next page of values.  If there was an error making
13198// the request the page does not advance and the error is returned.
13199// Deprecated: Use NextWithContext() instead.
13200func (page *ManagedInstanceKeyListResultPage) Next() error {
13201	return page.NextWithContext(context.Background())
13202}
13203
13204// NotDone returns true if the page enumeration should be started or is not yet complete.
13205func (page ManagedInstanceKeyListResultPage) NotDone() bool {
13206	return !page.miklr.IsEmpty()
13207}
13208
13209// Response returns the raw server response from the last page request.
13210func (page ManagedInstanceKeyListResultPage) Response() ManagedInstanceKeyListResult {
13211	return page.miklr
13212}
13213
13214// Values returns the slice of values for the current page or nil if there are no values.
13215func (page ManagedInstanceKeyListResultPage) Values() []ManagedInstanceKey {
13216	if page.miklr.IsEmpty() {
13217		return nil
13218	}
13219	return *page.miklr.Value
13220}
13221
13222// Creates a new instance of the ManagedInstanceKeyListResultPage type.
13223func NewManagedInstanceKeyListResultPage(cur ManagedInstanceKeyListResult, getNextPage func(context.Context, ManagedInstanceKeyListResult) (ManagedInstanceKeyListResult, error)) ManagedInstanceKeyListResultPage {
13224	return ManagedInstanceKeyListResultPage{
13225		fn:    getNextPage,
13226		miklr: cur,
13227	}
13228}
13229
13230// ManagedInstanceKeyProperties properties for a key execution.
13231type ManagedInstanceKeyProperties struct {
13232	// ServerKeyType - The key type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
13233	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
13234	// URI - The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is required.
13235	URI *string `json:"uri,omitempty"`
13236	// Thumbprint - READ-ONLY; Thumbprint of the key.
13237	Thumbprint *string `json:"thumbprint,omitempty"`
13238	// CreationDate - READ-ONLY; The key creation date.
13239	CreationDate *date.Time `json:"creationDate,omitempty"`
13240}
13241
13242// MarshalJSON is the custom marshaler for ManagedInstanceKeyProperties.
13243func (mikp ManagedInstanceKeyProperties) MarshalJSON() ([]byte, error) {
13244	objectMap := make(map[string]interface{})
13245	if mikp.ServerKeyType != "" {
13246		objectMap["serverKeyType"] = mikp.ServerKeyType
13247	}
13248	if mikp.URI != nil {
13249		objectMap["uri"] = mikp.URI
13250	}
13251	return json.Marshal(objectMap)
13252}
13253
13254// ManagedInstanceKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
13255// long-running operation.
13256type ManagedInstanceKeysCreateOrUpdateFuture struct {
13257	azure.FutureAPI
13258	// Result returns the result of the asynchronous operation.
13259	// If the operation has not completed it will return an error.
13260	Result func(ManagedInstanceKeysClient) (ManagedInstanceKey, error)
13261}
13262
13263// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13264func (future *ManagedInstanceKeysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
13265	var azFuture azure.Future
13266	if err := json.Unmarshal(body, &azFuture); err != nil {
13267		return err
13268	}
13269	future.FutureAPI = &azFuture
13270	future.Result = future.result
13271	return nil
13272}
13273
13274// result is the default implementation for ManagedInstanceKeysCreateOrUpdateFuture.Result.
13275func (future *ManagedInstanceKeysCreateOrUpdateFuture) result(client ManagedInstanceKeysClient) (mik ManagedInstanceKey, err error) {
13276	var done bool
13277	done, err = future.DoneWithContext(context.Background(), client)
13278	if err != nil {
13279		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
13280		return
13281	}
13282	if !done {
13283		mik.Response.Response = future.Response()
13284		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceKeysCreateOrUpdateFuture")
13285		return
13286	}
13287	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13288	if mik.Response.Response, err = future.GetResult(sender); err == nil && mik.Response.Response.StatusCode != http.StatusNoContent {
13289		mik, err = client.CreateOrUpdateResponder(mik.Response.Response)
13290		if err != nil {
13291			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysCreateOrUpdateFuture", "Result", mik.Response.Response, "Failure responding to request")
13292		}
13293	}
13294	return
13295}
13296
13297// ManagedInstanceKeysDeleteFuture an abstraction for monitoring and retrieving the results of a
13298// long-running operation.
13299type ManagedInstanceKeysDeleteFuture struct {
13300	azure.FutureAPI
13301	// Result returns the result of the asynchronous operation.
13302	// If the operation has not completed it will return an error.
13303	Result func(ManagedInstanceKeysClient) (autorest.Response, error)
13304}
13305
13306// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13307func (future *ManagedInstanceKeysDeleteFuture) UnmarshalJSON(body []byte) error {
13308	var azFuture azure.Future
13309	if err := json.Unmarshal(body, &azFuture); err != nil {
13310		return err
13311	}
13312	future.FutureAPI = &azFuture
13313	future.Result = future.result
13314	return nil
13315}
13316
13317// result is the default implementation for ManagedInstanceKeysDeleteFuture.Result.
13318func (future *ManagedInstanceKeysDeleteFuture) result(client ManagedInstanceKeysClient) (ar autorest.Response, err error) {
13319	var done bool
13320	done, err = future.DoneWithContext(context.Background(), client)
13321	if err != nil {
13322		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysDeleteFuture", "Result", future.Response(), "Polling failure")
13323		return
13324	}
13325	if !done {
13326		ar.Response = future.Response()
13327		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceKeysDeleteFuture")
13328		return
13329	}
13330	ar.Response = future.Response()
13331	return
13332}
13333
13334// ManagedInstanceListResult a list of managed instances.
13335type ManagedInstanceListResult struct {
13336	autorest.Response `json:"-"`
13337	// Value - READ-ONLY; Array of results.
13338	Value *[]ManagedInstance `json:"value,omitempty"`
13339	// NextLink - READ-ONLY; Link to retrieve next page of results.
13340	NextLink *string `json:"nextLink,omitempty"`
13341}
13342
13343// MarshalJSON is the custom marshaler for ManagedInstanceListResult.
13344func (milr ManagedInstanceListResult) MarshalJSON() ([]byte, error) {
13345	objectMap := make(map[string]interface{})
13346	return json.Marshal(objectMap)
13347}
13348
13349// ManagedInstanceListResultIterator provides access to a complete listing of ManagedInstance values.
13350type ManagedInstanceListResultIterator struct {
13351	i    int
13352	page ManagedInstanceListResultPage
13353}
13354
13355// NextWithContext advances to the next value.  If there was an error making
13356// the request the iterator does not advance and the error is returned.
13357func (iter *ManagedInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) {
13358	if tracing.IsEnabled() {
13359		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceListResultIterator.NextWithContext")
13360		defer func() {
13361			sc := -1
13362			if iter.Response().Response.Response != nil {
13363				sc = iter.Response().Response.Response.StatusCode
13364			}
13365			tracing.EndSpan(ctx, sc, err)
13366		}()
13367	}
13368	iter.i++
13369	if iter.i < len(iter.page.Values()) {
13370		return nil
13371	}
13372	err = iter.page.NextWithContext(ctx)
13373	if err != nil {
13374		iter.i--
13375		return err
13376	}
13377	iter.i = 0
13378	return nil
13379}
13380
13381// Next advances to the next value.  If there was an error making
13382// the request the iterator does not advance and the error is returned.
13383// Deprecated: Use NextWithContext() instead.
13384func (iter *ManagedInstanceListResultIterator) Next() error {
13385	return iter.NextWithContext(context.Background())
13386}
13387
13388// NotDone returns true if the enumeration should be started or is not yet complete.
13389func (iter ManagedInstanceListResultIterator) NotDone() bool {
13390	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13391}
13392
13393// Response returns the raw server response from the last page request.
13394func (iter ManagedInstanceListResultIterator) Response() ManagedInstanceListResult {
13395	return iter.page.Response()
13396}
13397
13398// Value returns the current value or a zero-initialized value if the
13399// iterator has advanced beyond the end of the collection.
13400func (iter ManagedInstanceListResultIterator) Value() ManagedInstance {
13401	if !iter.page.NotDone() {
13402		return ManagedInstance{}
13403	}
13404	return iter.page.Values()[iter.i]
13405}
13406
13407// Creates a new instance of the ManagedInstanceListResultIterator type.
13408func NewManagedInstanceListResultIterator(page ManagedInstanceListResultPage) ManagedInstanceListResultIterator {
13409	return ManagedInstanceListResultIterator{page: page}
13410}
13411
13412// IsEmpty returns true if the ListResult contains no values.
13413func (milr ManagedInstanceListResult) IsEmpty() bool {
13414	return milr.Value == nil || len(*milr.Value) == 0
13415}
13416
13417// hasNextLink returns true if the NextLink is not empty.
13418func (milr ManagedInstanceListResult) hasNextLink() bool {
13419	return milr.NextLink != nil && len(*milr.NextLink) != 0
13420}
13421
13422// managedInstanceListResultPreparer prepares a request to retrieve the next set of results.
13423// It returns nil if no more results exist.
13424func (milr ManagedInstanceListResult) managedInstanceListResultPreparer(ctx context.Context) (*http.Request, error) {
13425	if !milr.hasNextLink() {
13426		return nil, nil
13427	}
13428	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13429		autorest.AsJSON(),
13430		autorest.AsGet(),
13431		autorest.WithBaseURL(to.String(milr.NextLink)))
13432}
13433
13434// ManagedInstanceListResultPage contains a page of ManagedInstance values.
13435type ManagedInstanceListResultPage struct {
13436	fn   func(context.Context, ManagedInstanceListResult) (ManagedInstanceListResult, error)
13437	milr ManagedInstanceListResult
13438}
13439
13440// NextWithContext advances to the next page of values.  If there was an error making
13441// the request the page does not advance and the error is returned.
13442func (page *ManagedInstanceListResultPage) NextWithContext(ctx context.Context) (err error) {
13443	if tracing.IsEnabled() {
13444		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceListResultPage.NextWithContext")
13445		defer func() {
13446			sc := -1
13447			if page.Response().Response.Response != nil {
13448				sc = page.Response().Response.Response.StatusCode
13449			}
13450			tracing.EndSpan(ctx, sc, err)
13451		}()
13452	}
13453	for {
13454		next, err := page.fn(ctx, page.milr)
13455		if err != nil {
13456			return err
13457		}
13458		page.milr = next
13459		if !next.hasNextLink() || !next.IsEmpty() {
13460			break
13461		}
13462	}
13463	return nil
13464}
13465
13466// Next advances to the next page of values.  If there was an error making
13467// the request the page does not advance and the error is returned.
13468// Deprecated: Use NextWithContext() instead.
13469func (page *ManagedInstanceListResultPage) Next() error {
13470	return page.NextWithContext(context.Background())
13471}
13472
13473// NotDone returns true if the page enumeration should be started or is not yet complete.
13474func (page ManagedInstanceListResultPage) NotDone() bool {
13475	return !page.milr.IsEmpty()
13476}
13477
13478// Response returns the raw server response from the last page request.
13479func (page ManagedInstanceListResultPage) Response() ManagedInstanceListResult {
13480	return page.milr
13481}
13482
13483// Values returns the slice of values for the current page or nil if there are no values.
13484func (page ManagedInstanceListResultPage) Values() []ManagedInstance {
13485	if page.milr.IsEmpty() {
13486		return nil
13487	}
13488	return *page.milr.Value
13489}
13490
13491// Creates a new instance of the ManagedInstanceListResultPage type.
13492func NewManagedInstanceListResultPage(cur ManagedInstanceListResult, getNextPage func(context.Context, ManagedInstanceListResult) (ManagedInstanceListResult, error)) ManagedInstanceListResultPage {
13493	return ManagedInstanceListResultPage{
13494		fn:   getNextPage,
13495		milr: cur,
13496	}
13497}
13498
13499// ManagedInstanceLongTermRetentionBackup a long term retention backup for a managed database.
13500type ManagedInstanceLongTermRetentionBackup struct {
13501	autorest.Response `json:"-"`
13502	// ManagedInstanceLongTermRetentionBackupProperties - Resource properties.
13503	*ManagedInstanceLongTermRetentionBackupProperties `json:"properties,omitempty"`
13504	// ID - READ-ONLY; Resource ID.
13505	ID *string `json:"id,omitempty"`
13506	// Name - READ-ONLY; Resource name.
13507	Name *string `json:"name,omitempty"`
13508	// Type - READ-ONLY; Resource type.
13509	Type *string `json:"type,omitempty"`
13510}
13511
13512// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionBackup.
13513func (miltrb ManagedInstanceLongTermRetentionBackup) MarshalJSON() ([]byte, error) {
13514	objectMap := make(map[string]interface{})
13515	if miltrb.ManagedInstanceLongTermRetentionBackupProperties != nil {
13516		objectMap["properties"] = miltrb.ManagedInstanceLongTermRetentionBackupProperties
13517	}
13518	return json.Marshal(objectMap)
13519}
13520
13521// UnmarshalJSON is the custom unmarshaler for ManagedInstanceLongTermRetentionBackup struct.
13522func (miltrb *ManagedInstanceLongTermRetentionBackup) UnmarshalJSON(body []byte) error {
13523	var m map[string]*json.RawMessage
13524	err := json.Unmarshal(body, &m)
13525	if err != nil {
13526		return err
13527	}
13528	for k, v := range m {
13529		switch k {
13530		case "properties":
13531			if v != nil {
13532				var managedInstanceLongTermRetentionBackupProperties ManagedInstanceLongTermRetentionBackupProperties
13533				err = json.Unmarshal(*v, &managedInstanceLongTermRetentionBackupProperties)
13534				if err != nil {
13535					return err
13536				}
13537				miltrb.ManagedInstanceLongTermRetentionBackupProperties = &managedInstanceLongTermRetentionBackupProperties
13538			}
13539		case "id":
13540			if v != nil {
13541				var ID string
13542				err = json.Unmarshal(*v, &ID)
13543				if err != nil {
13544					return err
13545				}
13546				miltrb.ID = &ID
13547			}
13548		case "name":
13549			if v != nil {
13550				var name string
13551				err = json.Unmarshal(*v, &name)
13552				if err != nil {
13553					return err
13554				}
13555				miltrb.Name = &name
13556			}
13557		case "type":
13558			if v != nil {
13559				var typeVar string
13560				err = json.Unmarshal(*v, &typeVar)
13561				if err != nil {
13562					return err
13563				}
13564				miltrb.Type = &typeVar
13565			}
13566		}
13567	}
13568
13569	return nil
13570}
13571
13572// ManagedInstanceLongTermRetentionBackupListResult a list of long term retention backups for managed
13573// database(s).
13574type ManagedInstanceLongTermRetentionBackupListResult struct {
13575	autorest.Response `json:"-"`
13576	// Value - READ-ONLY; Array of results.
13577	Value *[]ManagedInstanceLongTermRetentionBackup `json:"value,omitempty"`
13578	// NextLink - READ-ONLY; Link to retrieve next page of results.
13579	NextLink *string `json:"nextLink,omitempty"`
13580}
13581
13582// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionBackupListResult.
13583func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) {
13584	objectMap := make(map[string]interface{})
13585	return json.Marshal(objectMap)
13586}
13587
13588// ManagedInstanceLongTermRetentionBackupListResultIterator provides access to a complete listing of
13589// ManagedInstanceLongTermRetentionBackup values.
13590type ManagedInstanceLongTermRetentionBackupListResultIterator struct {
13591	i    int
13592	page ManagedInstanceLongTermRetentionBackupListResultPage
13593}
13594
13595// NextWithContext advances to the next value.  If there was an error making
13596// the request the iterator does not advance and the error is returned.
13597func (iter *ManagedInstanceLongTermRetentionBackupListResultIterator) NextWithContext(ctx context.Context) (err error) {
13598	if tracing.IsEnabled() {
13599		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionBackupListResultIterator.NextWithContext")
13600		defer func() {
13601			sc := -1
13602			if iter.Response().Response.Response != nil {
13603				sc = iter.Response().Response.Response.StatusCode
13604			}
13605			tracing.EndSpan(ctx, sc, err)
13606		}()
13607	}
13608	iter.i++
13609	if iter.i < len(iter.page.Values()) {
13610		return nil
13611	}
13612	err = iter.page.NextWithContext(ctx)
13613	if err != nil {
13614		iter.i--
13615		return err
13616	}
13617	iter.i = 0
13618	return nil
13619}
13620
13621// Next advances to the next value.  If there was an error making
13622// the request the iterator does not advance and the error is returned.
13623// Deprecated: Use NextWithContext() instead.
13624func (iter *ManagedInstanceLongTermRetentionBackupListResultIterator) Next() error {
13625	return iter.NextWithContext(context.Background())
13626}
13627
13628// NotDone returns true if the enumeration should be started or is not yet complete.
13629func (iter ManagedInstanceLongTermRetentionBackupListResultIterator) NotDone() bool {
13630	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13631}
13632
13633// Response returns the raw server response from the last page request.
13634func (iter ManagedInstanceLongTermRetentionBackupListResultIterator) Response() ManagedInstanceLongTermRetentionBackupListResult {
13635	return iter.page.Response()
13636}
13637
13638// Value returns the current value or a zero-initialized value if the
13639// iterator has advanced beyond the end of the collection.
13640func (iter ManagedInstanceLongTermRetentionBackupListResultIterator) Value() ManagedInstanceLongTermRetentionBackup {
13641	if !iter.page.NotDone() {
13642		return ManagedInstanceLongTermRetentionBackup{}
13643	}
13644	return iter.page.Values()[iter.i]
13645}
13646
13647// Creates a new instance of the ManagedInstanceLongTermRetentionBackupListResultIterator type.
13648func NewManagedInstanceLongTermRetentionBackupListResultIterator(page ManagedInstanceLongTermRetentionBackupListResultPage) ManagedInstanceLongTermRetentionBackupListResultIterator {
13649	return ManagedInstanceLongTermRetentionBackupListResultIterator{page: page}
13650}
13651
13652// IsEmpty returns true if the ListResult contains no values.
13653func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) IsEmpty() bool {
13654	return miltrblr.Value == nil || len(*miltrblr.Value) == 0
13655}
13656
13657// hasNextLink returns true if the NextLink is not empty.
13658func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) hasNextLink() bool {
13659	return miltrblr.NextLink != nil && len(*miltrblr.NextLink) != 0
13660}
13661
13662// managedInstanceLongTermRetentionBackupListResultPreparer prepares a request to retrieve the next set of results.
13663// It returns nil if no more results exist.
13664func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) managedInstanceLongTermRetentionBackupListResultPreparer(ctx context.Context) (*http.Request, error) {
13665	if !miltrblr.hasNextLink() {
13666		return nil, nil
13667	}
13668	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13669		autorest.AsJSON(),
13670		autorest.AsGet(),
13671		autorest.WithBaseURL(to.String(miltrblr.NextLink)))
13672}
13673
13674// ManagedInstanceLongTermRetentionBackupListResultPage contains a page of
13675// ManagedInstanceLongTermRetentionBackup values.
13676type ManagedInstanceLongTermRetentionBackupListResultPage struct {
13677	fn       func(context.Context, ManagedInstanceLongTermRetentionBackupListResult) (ManagedInstanceLongTermRetentionBackupListResult, error)
13678	miltrblr ManagedInstanceLongTermRetentionBackupListResult
13679}
13680
13681// NextWithContext advances to the next page of values.  If there was an error making
13682// the request the page does not advance and the error is returned.
13683func (page *ManagedInstanceLongTermRetentionBackupListResultPage) NextWithContext(ctx context.Context) (err error) {
13684	if tracing.IsEnabled() {
13685		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionBackupListResultPage.NextWithContext")
13686		defer func() {
13687			sc := -1
13688			if page.Response().Response.Response != nil {
13689				sc = page.Response().Response.Response.StatusCode
13690			}
13691			tracing.EndSpan(ctx, sc, err)
13692		}()
13693	}
13694	for {
13695		next, err := page.fn(ctx, page.miltrblr)
13696		if err != nil {
13697			return err
13698		}
13699		page.miltrblr = next
13700		if !next.hasNextLink() || !next.IsEmpty() {
13701			break
13702		}
13703	}
13704	return nil
13705}
13706
13707// Next advances to the next page of values.  If there was an error making
13708// the request the page does not advance and the error is returned.
13709// Deprecated: Use NextWithContext() instead.
13710func (page *ManagedInstanceLongTermRetentionBackupListResultPage) Next() error {
13711	return page.NextWithContext(context.Background())
13712}
13713
13714// NotDone returns true if the page enumeration should be started or is not yet complete.
13715func (page ManagedInstanceLongTermRetentionBackupListResultPage) NotDone() bool {
13716	return !page.miltrblr.IsEmpty()
13717}
13718
13719// Response returns the raw server response from the last page request.
13720func (page ManagedInstanceLongTermRetentionBackupListResultPage) Response() ManagedInstanceLongTermRetentionBackupListResult {
13721	return page.miltrblr
13722}
13723
13724// Values returns the slice of values for the current page or nil if there are no values.
13725func (page ManagedInstanceLongTermRetentionBackupListResultPage) Values() []ManagedInstanceLongTermRetentionBackup {
13726	if page.miltrblr.IsEmpty() {
13727		return nil
13728	}
13729	return *page.miltrblr.Value
13730}
13731
13732// Creates a new instance of the ManagedInstanceLongTermRetentionBackupListResultPage type.
13733func NewManagedInstanceLongTermRetentionBackupListResultPage(cur ManagedInstanceLongTermRetentionBackupListResult, getNextPage func(context.Context, ManagedInstanceLongTermRetentionBackupListResult) (ManagedInstanceLongTermRetentionBackupListResult, error)) ManagedInstanceLongTermRetentionBackupListResultPage {
13734	return ManagedInstanceLongTermRetentionBackupListResultPage{
13735		fn:       getNextPage,
13736		miltrblr: cur,
13737	}
13738}
13739
13740// ManagedInstanceLongTermRetentionBackupProperties properties of a long term retention backup
13741type ManagedInstanceLongTermRetentionBackupProperties struct {
13742	// ManagedInstanceName - READ-ONLY; The managed instance that the backup database belongs to.
13743	ManagedInstanceName *string `json:"managedInstanceName,omitempty"`
13744	// ManagedInstanceCreateTime - READ-ONLY; The create time of the instance.
13745	ManagedInstanceCreateTime *date.Time `json:"managedInstanceCreateTime,omitempty"`
13746	// DatabaseName - READ-ONLY; The name of the database the backup belong to
13747	DatabaseName *string `json:"databaseName,omitempty"`
13748	// DatabaseDeletionTime - READ-ONLY; The delete time of the database
13749	DatabaseDeletionTime *date.Time `json:"databaseDeletionTime,omitempty"`
13750	// BackupTime - READ-ONLY; The time the backup was taken
13751	BackupTime *date.Time `json:"backupTime,omitempty"`
13752	// BackupExpirationTime - READ-ONLY; The time the long term retention backup will expire.
13753	BackupExpirationTime *date.Time `json:"backupExpirationTime,omitempty"`
13754}
13755
13756// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionBackupProperties.
13757func (miltrbp ManagedInstanceLongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) {
13758	objectMap := make(map[string]interface{})
13759	return json.Marshal(objectMap)
13760}
13761
13762// ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and
13763// retrieving the results of a long-running operation.
13764type ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture struct {
13765	azure.FutureAPI
13766	// Result returns the result of the asynchronous operation.
13767	// If the operation has not completed it will return an error.
13768	Result func(ManagedInstanceLongTermRetentionPoliciesClient) (ManagedInstanceLongTermRetentionPolicy, error)
13769}
13770
13771// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13772func (future *ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
13773	var azFuture azure.Future
13774	if err := json.Unmarshal(body, &azFuture); err != nil {
13775		return err
13776	}
13777	future.FutureAPI = &azFuture
13778	future.Result = future.result
13779	return nil
13780}
13781
13782// result is the default implementation for ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture.Result.
13783func (future *ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture) result(client ManagedInstanceLongTermRetentionPoliciesClient) (miltrp ManagedInstanceLongTermRetentionPolicy, err error) {
13784	var done bool
13785	done, err = future.DoneWithContext(context.Background(), client)
13786	if err != nil {
13787		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
13788		return
13789	}
13790	if !done {
13791		miltrp.Response.Response = future.Response()
13792		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture")
13793		return
13794	}
13795	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13796	if miltrp.Response.Response, err = future.GetResult(sender); err == nil && miltrp.Response.Response.StatusCode != http.StatusNoContent {
13797		miltrp, err = client.CreateOrUpdateResponder(miltrp.Response.Response)
13798		if err != nil {
13799			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", miltrp.Response.Response, "Failure responding to request")
13800		}
13801	}
13802	return
13803}
13804
13805// ManagedInstanceLongTermRetentionPolicy a long term retention policy.
13806type ManagedInstanceLongTermRetentionPolicy struct {
13807	autorest.Response `json:"-"`
13808	// BaseLongTermRetentionPolicyProperties - Resource properties.
13809	*BaseLongTermRetentionPolicyProperties `json:"properties,omitempty"`
13810	// ID - READ-ONLY; Resource ID.
13811	ID *string `json:"id,omitempty"`
13812	// Name - READ-ONLY; Resource name.
13813	Name *string `json:"name,omitempty"`
13814	// Type - READ-ONLY; Resource type.
13815	Type *string `json:"type,omitempty"`
13816}
13817
13818// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionPolicy.
13819func (miltrp ManagedInstanceLongTermRetentionPolicy) MarshalJSON() ([]byte, error) {
13820	objectMap := make(map[string]interface{})
13821	if miltrp.BaseLongTermRetentionPolicyProperties != nil {
13822		objectMap["properties"] = miltrp.BaseLongTermRetentionPolicyProperties
13823	}
13824	return json.Marshal(objectMap)
13825}
13826
13827// UnmarshalJSON is the custom unmarshaler for ManagedInstanceLongTermRetentionPolicy struct.
13828func (miltrp *ManagedInstanceLongTermRetentionPolicy) UnmarshalJSON(body []byte) error {
13829	var m map[string]*json.RawMessage
13830	err := json.Unmarshal(body, &m)
13831	if err != nil {
13832		return err
13833	}
13834	for k, v := range m {
13835		switch k {
13836		case "properties":
13837			if v != nil {
13838				var baseLongTermRetentionPolicyProperties BaseLongTermRetentionPolicyProperties
13839				err = json.Unmarshal(*v, &baseLongTermRetentionPolicyProperties)
13840				if err != nil {
13841					return err
13842				}
13843				miltrp.BaseLongTermRetentionPolicyProperties = &baseLongTermRetentionPolicyProperties
13844			}
13845		case "id":
13846			if v != nil {
13847				var ID string
13848				err = json.Unmarshal(*v, &ID)
13849				if err != nil {
13850					return err
13851				}
13852				miltrp.ID = &ID
13853			}
13854		case "name":
13855			if v != nil {
13856				var name string
13857				err = json.Unmarshal(*v, &name)
13858				if err != nil {
13859					return err
13860				}
13861				miltrp.Name = &name
13862			}
13863		case "type":
13864			if v != nil {
13865				var typeVar string
13866				err = json.Unmarshal(*v, &typeVar)
13867				if err != nil {
13868					return err
13869				}
13870				miltrp.Type = &typeVar
13871			}
13872		}
13873	}
13874
13875	return nil
13876}
13877
13878// ManagedInstanceLongTermRetentionPolicyListResult a list of long term retention policies.
13879type ManagedInstanceLongTermRetentionPolicyListResult struct {
13880	autorest.Response `json:"-"`
13881	// Value - READ-ONLY; Array of results.
13882	Value *[]ManagedInstanceLongTermRetentionPolicy `json:"value,omitempty"`
13883	// NextLink - READ-ONLY; Link to retrieve next page of results.
13884	NextLink *string `json:"nextLink,omitempty"`
13885}
13886
13887// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionPolicyListResult.
13888func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) {
13889	objectMap := make(map[string]interface{})
13890	return json.Marshal(objectMap)
13891}
13892
13893// ManagedInstanceLongTermRetentionPolicyListResultIterator provides access to a complete listing of
13894// ManagedInstanceLongTermRetentionPolicy values.
13895type ManagedInstanceLongTermRetentionPolicyListResultIterator struct {
13896	i    int
13897	page ManagedInstanceLongTermRetentionPolicyListResultPage
13898}
13899
13900// NextWithContext advances to the next value.  If there was an error making
13901// the request the iterator does not advance and the error is returned.
13902func (iter *ManagedInstanceLongTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
13903	if tracing.IsEnabled() {
13904		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionPolicyListResultIterator.NextWithContext")
13905		defer func() {
13906			sc := -1
13907			if iter.Response().Response.Response != nil {
13908				sc = iter.Response().Response.Response.StatusCode
13909			}
13910			tracing.EndSpan(ctx, sc, err)
13911		}()
13912	}
13913	iter.i++
13914	if iter.i < len(iter.page.Values()) {
13915		return nil
13916	}
13917	err = iter.page.NextWithContext(ctx)
13918	if err != nil {
13919		iter.i--
13920		return err
13921	}
13922	iter.i = 0
13923	return nil
13924}
13925
13926// Next advances to the next value.  If there was an error making
13927// the request the iterator does not advance and the error is returned.
13928// Deprecated: Use NextWithContext() instead.
13929func (iter *ManagedInstanceLongTermRetentionPolicyListResultIterator) Next() error {
13930	return iter.NextWithContext(context.Background())
13931}
13932
13933// NotDone returns true if the enumeration should be started or is not yet complete.
13934func (iter ManagedInstanceLongTermRetentionPolicyListResultIterator) NotDone() bool {
13935	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13936}
13937
13938// Response returns the raw server response from the last page request.
13939func (iter ManagedInstanceLongTermRetentionPolicyListResultIterator) Response() ManagedInstanceLongTermRetentionPolicyListResult {
13940	return iter.page.Response()
13941}
13942
13943// Value returns the current value or a zero-initialized value if the
13944// iterator has advanced beyond the end of the collection.
13945func (iter ManagedInstanceLongTermRetentionPolicyListResultIterator) Value() ManagedInstanceLongTermRetentionPolicy {
13946	if !iter.page.NotDone() {
13947		return ManagedInstanceLongTermRetentionPolicy{}
13948	}
13949	return iter.page.Values()[iter.i]
13950}
13951
13952// Creates a new instance of the ManagedInstanceLongTermRetentionPolicyListResultIterator type.
13953func NewManagedInstanceLongTermRetentionPolicyListResultIterator(page ManagedInstanceLongTermRetentionPolicyListResultPage) ManagedInstanceLongTermRetentionPolicyListResultIterator {
13954	return ManagedInstanceLongTermRetentionPolicyListResultIterator{page: page}
13955}
13956
13957// IsEmpty returns true if the ListResult contains no values.
13958func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) IsEmpty() bool {
13959	return miltrplr.Value == nil || len(*miltrplr.Value) == 0
13960}
13961
13962// hasNextLink returns true if the NextLink is not empty.
13963func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) hasNextLink() bool {
13964	return miltrplr.NextLink != nil && len(*miltrplr.NextLink) != 0
13965}
13966
13967// managedInstanceLongTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results.
13968// It returns nil if no more results exist.
13969func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) managedInstanceLongTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
13970	if !miltrplr.hasNextLink() {
13971		return nil, nil
13972	}
13973	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13974		autorest.AsJSON(),
13975		autorest.AsGet(),
13976		autorest.WithBaseURL(to.String(miltrplr.NextLink)))
13977}
13978
13979// ManagedInstanceLongTermRetentionPolicyListResultPage contains a page of
13980// ManagedInstanceLongTermRetentionPolicy values.
13981type ManagedInstanceLongTermRetentionPolicyListResultPage struct {
13982	fn       func(context.Context, ManagedInstanceLongTermRetentionPolicyListResult) (ManagedInstanceLongTermRetentionPolicyListResult, error)
13983	miltrplr ManagedInstanceLongTermRetentionPolicyListResult
13984}
13985
13986// NextWithContext advances to the next page of values.  If there was an error making
13987// the request the page does not advance and the error is returned.
13988func (page *ManagedInstanceLongTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
13989	if tracing.IsEnabled() {
13990		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionPolicyListResultPage.NextWithContext")
13991		defer func() {
13992			sc := -1
13993			if page.Response().Response.Response != nil {
13994				sc = page.Response().Response.Response.StatusCode
13995			}
13996			tracing.EndSpan(ctx, sc, err)
13997		}()
13998	}
13999	for {
14000		next, err := page.fn(ctx, page.miltrplr)
14001		if err != nil {
14002			return err
14003		}
14004		page.miltrplr = next
14005		if !next.hasNextLink() || !next.IsEmpty() {
14006			break
14007		}
14008	}
14009	return nil
14010}
14011
14012// Next advances to the next page of values.  If there was an error making
14013// the request the page does not advance and the error is returned.
14014// Deprecated: Use NextWithContext() instead.
14015func (page *ManagedInstanceLongTermRetentionPolicyListResultPage) Next() error {
14016	return page.NextWithContext(context.Background())
14017}
14018
14019// NotDone returns true if the page enumeration should be started or is not yet complete.
14020func (page ManagedInstanceLongTermRetentionPolicyListResultPage) NotDone() bool {
14021	return !page.miltrplr.IsEmpty()
14022}
14023
14024// Response returns the raw server response from the last page request.
14025func (page ManagedInstanceLongTermRetentionPolicyListResultPage) Response() ManagedInstanceLongTermRetentionPolicyListResult {
14026	return page.miltrplr
14027}
14028
14029// Values returns the slice of values for the current page or nil if there are no values.
14030func (page ManagedInstanceLongTermRetentionPolicyListResultPage) Values() []ManagedInstanceLongTermRetentionPolicy {
14031	if page.miltrplr.IsEmpty() {
14032		return nil
14033	}
14034	return *page.miltrplr.Value
14035}
14036
14037// Creates a new instance of the ManagedInstanceLongTermRetentionPolicyListResultPage type.
14038func NewManagedInstanceLongTermRetentionPolicyListResultPage(cur ManagedInstanceLongTermRetentionPolicyListResult, getNextPage func(context.Context, ManagedInstanceLongTermRetentionPolicyListResult) (ManagedInstanceLongTermRetentionPolicyListResult, error)) ManagedInstanceLongTermRetentionPolicyListResultPage {
14039	return ManagedInstanceLongTermRetentionPolicyListResultPage{
14040		fn:       getNextPage,
14041		miltrplr: cur,
14042	}
14043}
14044
14045// ManagedInstanceMaintenanceConfigurationCapability the maintenance configuration capability
14046type ManagedInstanceMaintenanceConfigurationCapability struct {
14047	// Name - READ-ONLY; Maintenance configuration name
14048	Name *string `json:"name,omitempty"`
14049	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
14050	Status CapabilityStatus `json:"status,omitempty"`
14051	// Reason - The reason for the capability not being available.
14052	Reason *string `json:"reason,omitempty"`
14053}
14054
14055// MarshalJSON is the custom marshaler for ManagedInstanceMaintenanceConfigurationCapability.
14056func (mimcc ManagedInstanceMaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) {
14057	objectMap := make(map[string]interface{})
14058	if mimcc.Reason != nil {
14059		objectMap["reason"] = mimcc.Reason
14060	}
14061	return json.Marshal(objectMap)
14062}
14063
14064// ManagedInstanceOperation a managed instance operation.
14065type ManagedInstanceOperation struct {
14066	autorest.Response `json:"-"`
14067	// ManagedInstanceOperationProperties - Resource properties.
14068	*ManagedInstanceOperationProperties `json:"properties,omitempty"`
14069	// ID - READ-ONLY; Resource ID.
14070	ID *string `json:"id,omitempty"`
14071	// Name - READ-ONLY; Resource name.
14072	Name *string `json:"name,omitempty"`
14073	// Type - READ-ONLY; Resource type.
14074	Type *string `json:"type,omitempty"`
14075}
14076
14077// MarshalJSON is the custom marshaler for ManagedInstanceOperation.
14078func (mio ManagedInstanceOperation) MarshalJSON() ([]byte, error) {
14079	objectMap := make(map[string]interface{})
14080	if mio.ManagedInstanceOperationProperties != nil {
14081		objectMap["properties"] = mio.ManagedInstanceOperationProperties
14082	}
14083	return json.Marshal(objectMap)
14084}
14085
14086// UnmarshalJSON is the custom unmarshaler for ManagedInstanceOperation struct.
14087func (mio *ManagedInstanceOperation) UnmarshalJSON(body []byte) error {
14088	var m map[string]*json.RawMessage
14089	err := json.Unmarshal(body, &m)
14090	if err != nil {
14091		return err
14092	}
14093	for k, v := range m {
14094		switch k {
14095		case "properties":
14096			if v != nil {
14097				var managedInstanceOperationProperties ManagedInstanceOperationProperties
14098				err = json.Unmarshal(*v, &managedInstanceOperationProperties)
14099				if err != nil {
14100					return err
14101				}
14102				mio.ManagedInstanceOperationProperties = &managedInstanceOperationProperties
14103			}
14104		case "id":
14105			if v != nil {
14106				var ID string
14107				err = json.Unmarshal(*v, &ID)
14108				if err != nil {
14109					return err
14110				}
14111				mio.ID = &ID
14112			}
14113		case "name":
14114			if v != nil {
14115				var name string
14116				err = json.Unmarshal(*v, &name)
14117				if err != nil {
14118					return err
14119				}
14120				mio.Name = &name
14121			}
14122		case "type":
14123			if v != nil {
14124				var typeVar string
14125				err = json.Unmarshal(*v, &typeVar)
14126				if err != nil {
14127					return err
14128				}
14129				mio.Type = &typeVar
14130			}
14131		}
14132	}
14133
14134	return nil
14135}
14136
14137// ManagedInstanceOperationListResult the response to a list managed instance operations request
14138type ManagedInstanceOperationListResult struct {
14139	autorest.Response `json:"-"`
14140	// Value - READ-ONLY; Array of results.
14141	Value *[]ManagedInstanceOperation `json:"value,omitempty"`
14142	// NextLink - READ-ONLY; Link to retrieve next page of results.
14143	NextLink *string `json:"nextLink,omitempty"`
14144}
14145
14146// MarshalJSON is the custom marshaler for ManagedInstanceOperationListResult.
14147func (miolr ManagedInstanceOperationListResult) MarshalJSON() ([]byte, error) {
14148	objectMap := make(map[string]interface{})
14149	return json.Marshal(objectMap)
14150}
14151
14152// ManagedInstanceOperationListResultIterator provides access to a complete listing of
14153// ManagedInstanceOperation values.
14154type ManagedInstanceOperationListResultIterator struct {
14155	i    int
14156	page ManagedInstanceOperationListResultPage
14157}
14158
14159// NextWithContext advances to the next value.  If there was an error making
14160// the request the iterator does not advance and the error is returned.
14161func (iter *ManagedInstanceOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
14162	if tracing.IsEnabled() {
14163		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceOperationListResultIterator.NextWithContext")
14164		defer func() {
14165			sc := -1
14166			if iter.Response().Response.Response != nil {
14167				sc = iter.Response().Response.Response.StatusCode
14168			}
14169			tracing.EndSpan(ctx, sc, err)
14170		}()
14171	}
14172	iter.i++
14173	if iter.i < len(iter.page.Values()) {
14174		return nil
14175	}
14176	err = iter.page.NextWithContext(ctx)
14177	if err != nil {
14178		iter.i--
14179		return err
14180	}
14181	iter.i = 0
14182	return nil
14183}
14184
14185// Next advances to the next value.  If there was an error making
14186// the request the iterator does not advance and the error is returned.
14187// Deprecated: Use NextWithContext() instead.
14188func (iter *ManagedInstanceOperationListResultIterator) Next() error {
14189	return iter.NextWithContext(context.Background())
14190}
14191
14192// NotDone returns true if the enumeration should be started or is not yet complete.
14193func (iter ManagedInstanceOperationListResultIterator) NotDone() bool {
14194	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14195}
14196
14197// Response returns the raw server response from the last page request.
14198func (iter ManagedInstanceOperationListResultIterator) Response() ManagedInstanceOperationListResult {
14199	return iter.page.Response()
14200}
14201
14202// Value returns the current value or a zero-initialized value if the
14203// iterator has advanced beyond the end of the collection.
14204func (iter ManagedInstanceOperationListResultIterator) Value() ManagedInstanceOperation {
14205	if !iter.page.NotDone() {
14206		return ManagedInstanceOperation{}
14207	}
14208	return iter.page.Values()[iter.i]
14209}
14210
14211// Creates a new instance of the ManagedInstanceOperationListResultIterator type.
14212func NewManagedInstanceOperationListResultIterator(page ManagedInstanceOperationListResultPage) ManagedInstanceOperationListResultIterator {
14213	return ManagedInstanceOperationListResultIterator{page: page}
14214}
14215
14216// IsEmpty returns true if the ListResult contains no values.
14217func (miolr ManagedInstanceOperationListResult) IsEmpty() bool {
14218	return miolr.Value == nil || len(*miolr.Value) == 0
14219}
14220
14221// hasNextLink returns true if the NextLink is not empty.
14222func (miolr ManagedInstanceOperationListResult) hasNextLink() bool {
14223	return miolr.NextLink != nil && len(*miolr.NextLink) != 0
14224}
14225
14226// managedInstanceOperationListResultPreparer prepares a request to retrieve the next set of results.
14227// It returns nil if no more results exist.
14228func (miolr ManagedInstanceOperationListResult) managedInstanceOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
14229	if !miolr.hasNextLink() {
14230		return nil, nil
14231	}
14232	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14233		autorest.AsJSON(),
14234		autorest.AsGet(),
14235		autorest.WithBaseURL(to.String(miolr.NextLink)))
14236}
14237
14238// ManagedInstanceOperationListResultPage contains a page of ManagedInstanceOperation values.
14239type ManagedInstanceOperationListResultPage struct {
14240	fn    func(context.Context, ManagedInstanceOperationListResult) (ManagedInstanceOperationListResult, error)
14241	miolr ManagedInstanceOperationListResult
14242}
14243
14244// NextWithContext advances to the next page of values.  If there was an error making
14245// the request the page does not advance and the error is returned.
14246func (page *ManagedInstanceOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
14247	if tracing.IsEnabled() {
14248		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceOperationListResultPage.NextWithContext")
14249		defer func() {
14250			sc := -1
14251			if page.Response().Response.Response != nil {
14252				sc = page.Response().Response.Response.StatusCode
14253			}
14254			tracing.EndSpan(ctx, sc, err)
14255		}()
14256	}
14257	for {
14258		next, err := page.fn(ctx, page.miolr)
14259		if err != nil {
14260			return err
14261		}
14262		page.miolr = next
14263		if !next.hasNextLink() || !next.IsEmpty() {
14264			break
14265		}
14266	}
14267	return nil
14268}
14269
14270// Next advances to the next page of values.  If there was an error making
14271// the request the page does not advance and the error is returned.
14272// Deprecated: Use NextWithContext() instead.
14273func (page *ManagedInstanceOperationListResultPage) Next() error {
14274	return page.NextWithContext(context.Background())
14275}
14276
14277// NotDone returns true if the page enumeration should be started or is not yet complete.
14278func (page ManagedInstanceOperationListResultPage) NotDone() bool {
14279	return !page.miolr.IsEmpty()
14280}
14281
14282// Response returns the raw server response from the last page request.
14283func (page ManagedInstanceOperationListResultPage) Response() ManagedInstanceOperationListResult {
14284	return page.miolr
14285}
14286
14287// Values returns the slice of values for the current page or nil if there are no values.
14288func (page ManagedInstanceOperationListResultPage) Values() []ManagedInstanceOperation {
14289	if page.miolr.IsEmpty() {
14290		return nil
14291	}
14292	return *page.miolr.Value
14293}
14294
14295// Creates a new instance of the ManagedInstanceOperationListResultPage type.
14296func NewManagedInstanceOperationListResultPage(cur ManagedInstanceOperationListResult, getNextPage func(context.Context, ManagedInstanceOperationListResult) (ManagedInstanceOperationListResult, error)) ManagedInstanceOperationListResultPage {
14297	return ManagedInstanceOperationListResultPage{
14298		fn:    getNextPage,
14299		miolr: cur,
14300	}
14301}
14302
14303// ManagedInstanceOperationParametersPair the parameters of a managed instance operation.
14304type ManagedInstanceOperationParametersPair struct {
14305	// CurrentParameters - READ-ONLY; The current parameters.
14306	CurrentParameters *UpsertManagedServerOperationParameters `json:"currentParameters,omitempty"`
14307	// RequestedParameters - READ-ONLY; The requested parameters.
14308	RequestedParameters *UpsertManagedServerOperationParameters `json:"requestedParameters,omitempty"`
14309}
14310
14311// MarshalJSON is the custom marshaler for ManagedInstanceOperationParametersPair.
14312func (miopp ManagedInstanceOperationParametersPair) MarshalJSON() ([]byte, error) {
14313	objectMap := make(map[string]interface{})
14314	return json.Marshal(objectMap)
14315}
14316
14317// ManagedInstanceOperationProperties the properties of a managed instance operation.
14318type ManagedInstanceOperationProperties struct {
14319	// ManagedInstanceName - READ-ONLY; The name of the managed instance the operation is being performed on.
14320	ManagedInstanceName *string `json:"managedInstanceName,omitempty"`
14321	// Operation - READ-ONLY; The name of operation.
14322	Operation *string `json:"operation,omitempty"`
14323	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
14324	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
14325	// PercentComplete - READ-ONLY; The percentage of the operation completed.
14326	PercentComplete *int32 `json:"percentComplete,omitempty"`
14327	// StartTime - READ-ONLY; The operation start time.
14328	StartTime *date.Time `json:"startTime,omitempty"`
14329	// State - READ-ONLY; The operation state. Possible values include: 'ManagementOperationStatePending', 'ManagementOperationStateInProgress', 'ManagementOperationStateSucceeded', 'ManagementOperationStateFailed', 'ManagementOperationStateCancelInProgress', 'ManagementOperationStateCancelled'
14330	State ManagementOperationState `json:"state,omitempty"`
14331	// ErrorCode - READ-ONLY; The operation error code.
14332	ErrorCode *int32 `json:"errorCode,omitempty"`
14333	// ErrorDescription - READ-ONLY; The operation error description.
14334	ErrorDescription *string `json:"errorDescription,omitempty"`
14335	// ErrorSeverity - READ-ONLY; The operation error severity.
14336	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
14337	// IsUserError - READ-ONLY; Whether or not the error is a user error.
14338	IsUserError *bool `json:"isUserError,omitempty"`
14339	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
14340	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
14341	// Description - READ-ONLY; The operation description.
14342	Description *string `json:"description,omitempty"`
14343	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
14344	IsCancellable *bool `json:"isCancellable,omitempty"`
14345	// OperationParameters - READ-ONLY; The operation parameters.
14346	OperationParameters *ManagedInstanceOperationParametersPair `json:"operationParameters,omitempty"`
14347	// OperationSteps - READ-ONLY; The operation steps.
14348	OperationSteps *ManagedInstanceOperationSteps `json:"operationSteps,omitempty"`
14349}
14350
14351// MarshalJSON is the custom marshaler for ManagedInstanceOperationProperties.
14352func (miop ManagedInstanceOperationProperties) MarshalJSON() ([]byte, error) {
14353	objectMap := make(map[string]interface{})
14354	return json.Marshal(objectMap)
14355}
14356
14357// ManagedInstanceOperationSteps the steps of a managed instance operation.
14358type ManagedInstanceOperationSteps struct {
14359	// TotalSteps - READ-ONLY; The total number of operation steps.
14360	TotalSteps *string `json:"totalSteps,omitempty"`
14361	// CurrentStep - READ-ONLY; The number of current operation steps.
14362	CurrentStep *int32 `json:"currentStep,omitempty"`
14363	// StepsList - READ-ONLY; The operation steps list.
14364	StepsList *[]UpsertManagedServerOperationStep `json:"stepsList,omitempty"`
14365}
14366
14367// MarshalJSON is the custom marshaler for ManagedInstanceOperationSteps.
14368func (mios ManagedInstanceOperationSteps) MarshalJSON() ([]byte, error) {
14369	objectMap := make(map[string]interface{})
14370	return json.Marshal(objectMap)
14371}
14372
14373// ManagedInstancePairInfo pairs of Managed Instances in the failover group.
14374type ManagedInstancePairInfo struct {
14375	// PrimaryManagedInstanceID - Id of Primary Managed Instance in pair.
14376	PrimaryManagedInstanceID *string `json:"primaryManagedInstanceId,omitempty"`
14377	// PartnerManagedInstanceID - Id of Partner Managed Instance in pair.
14378	PartnerManagedInstanceID *string `json:"partnerManagedInstanceId,omitempty"`
14379}
14380
14381// ManagedInstancePecProperty a private endpoint connection under a managed instance
14382type ManagedInstancePecProperty struct {
14383	// ID - READ-ONLY; Resource ID.
14384	ID *string `json:"id,omitempty"`
14385	// Properties - READ-ONLY; Private endpoint connection properties
14386	Properties *ManagedInstancePrivateEndpointConnectionProperties `json:"properties,omitempty"`
14387}
14388
14389// MarshalJSON is the custom marshaler for ManagedInstancePecProperty.
14390func (mipp ManagedInstancePecProperty) MarshalJSON() ([]byte, error) {
14391	objectMap := make(map[string]interface{})
14392	return json.Marshal(objectMap)
14393}
14394
14395// ManagedInstancePrivateEndpointConnectionProperties properties of a private endpoint connection.
14396type ManagedInstancePrivateEndpointConnectionProperties struct {
14397	// PrivateEndpoint - Private endpoint which the connection belongs to.
14398	PrivateEndpoint *ManagedInstancePrivateEndpointProperty `json:"privateEndpoint,omitempty"`
14399	// PrivateLinkServiceConnectionState - Connection State of the Private Endpoint Connection.
14400	PrivateLinkServiceConnectionState *ManagedInstancePrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`
14401	// ProvisioningState - READ-ONLY; State of the Private Endpoint Connection.
14402	ProvisioningState *string `json:"provisioningState,omitempty"`
14403}
14404
14405// MarshalJSON is the custom marshaler for ManagedInstancePrivateEndpointConnectionProperties.
14406func (mipecp ManagedInstancePrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
14407	objectMap := make(map[string]interface{})
14408	if mipecp.PrivateEndpoint != nil {
14409		objectMap["privateEndpoint"] = mipecp.PrivateEndpoint
14410	}
14411	if mipecp.PrivateLinkServiceConnectionState != nil {
14412		objectMap["privateLinkServiceConnectionState"] = mipecp.PrivateLinkServiceConnectionState
14413	}
14414	return json.Marshal(objectMap)
14415}
14416
14417// ManagedInstancePrivateEndpointProperty ...
14418type ManagedInstancePrivateEndpointProperty struct {
14419	// ID - Resource id of the private endpoint.
14420	ID *string `json:"id,omitempty"`
14421}
14422
14423// ManagedInstancePrivateLinkServiceConnectionStateProperty ...
14424type ManagedInstancePrivateLinkServiceConnectionStateProperty struct {
14425	// Status - The private link service connection status.
14426	Status *string `json:"status,omitempty"`
14427	// Description - The private link service connection description.
14428	Description *string `json:"description,omitempty"`
14429	// ActionsRequired - READ-ONLY; The private link service connection description.
14430	ActionsRequired *string `json:"actionsRequired,omitempty"`
14431}
14432
14433// MarshalJSON is the custom marshaler for ManagedInstancePrivateLinkServiceConnectionStateProperty.
14434func (miplscsp ManagedInstancePrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
14435	objectMap := make(map[string]interface{})
14436	if miplscsp.Status != nil {
14437		objectMap["status"] = miplscsp.Status
14438	}
14439	if miplscsp.Description != nil {
14440		objectMap["description"] = miplscsp.Description
14441	}
14442	return json.Marshal(objectMap)
14443}
14444
14445// ManagedInstanceProperties the properties of a managed instance.
14446type ManagedInstanceProperties struct {
14447	// ProvisioningState - READ-ONLY; Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Deleting', 'ProvisioningState1Updating', 'ProvisioningState1Unknown', 'ProvisioningState1Succeeded', 'ProvisioningState1Failed'
14448	ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"`
14449	// ManagedInstanceCreateMode - Specifies the mode of database creation.
14450	//
14451	// Default: Regular instance creation.
14452	//
14453	// 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'
14454	ManagedInstanceCreateMode ManagedServerCreateMode `json:"managedInstanceCreateMode,omitempty"`
14455	// FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the managed instance.
14456	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
14457	// AdministratorLogin - Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation).
14458	AdministratorLogin *string `json:"administratorLogin,omitempty"`
14459	// AdministratorLoginPassword - The administrator login password (required for managed instance creation).
14460	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
14461	// SubnetID - Subnet resource ID for the managed instance.
14462	SubnetID *string `json:"subnetId,omitempty"`
14463	// State - READ-ONLY; The state of the managed instance.
14464	State *string `json:"state,omitempty"`
14465	// 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'
14466	LicenseType ManagedInstanceLicenseType `json:"licenseType,omitempty"`
14467	// VCores - The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80.
14468	VCores *int32 `json:"vCores,omitempty"`
14469	// StorageSizeInGB - Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only.
14470	StorageSizeInGB *int32 `json:"storageSizeInGB,omitempty"`
14471	// Collation - Collation of the managed instance.
14472	Collation *string `json:"collation,omitempty"`
14473	// DNSZone - READ-ONLY; The Dns Zone that the managed instance is in.
14474	DNSZone *string `json:"dnsZone,omitempty"`
14475	// DNSZonePartner - The resource id of another managed instance whose DNS zone this managed instance will share after creation.
14476	DNSZonePartner *string `json:"dnsZonePartner,omitempty"`
14477	// PublicDataEndpointEnabled - Whether or not the public data endpoint is enabled.
14478	PublicDataEndpointEnabled *bool `json:"publicDataEndpointEnabled,omitempty"`
14479	// SourceManagedInstanceID - The resource identifier of the source managed instance associated with create operation of this instance.
14480	SourceManagedInstanceID *string `json:"sourceManagedInstanceId,omitempty"`
14481	// RestorePointInTime - Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
14482	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
14483	// ProxyOverride - Connection type used for connecting to the instance. Possible values include: 'ManagedInstanceProxyOverrideProxy', 'ManagedInstanceProxyOverrideRedirect', 'ManagedInstanceProxyOverrideDefault'
14484	ProxyOverride ManagedInstanceProxyOverride `json:"proxyOverride,omitempty"`
14485	// TimezoneID - Id of the timezone. Allowed values are timezones supported by Windows.
14486	// Windows keeps details on supported timezones, including the id, in registry under
14487	// KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.
14488	// You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info.
14489	// List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell.
14490	// An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time".
14491	TimezoneID *string `json:"timezoneId,omitempty"`
14492	// InstancePoolID - The Id of the instance pool this managed server belongs to.
14493	InstancePoolID *string `json:"instancePoolId,omitempty"`
14494	// MaintenanceConfigurationID - Specifies maintenance configuration id to apply to this managed instance.
14495	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`
14496	// PrivateEndpointConnections - READ-ONLY; List of private endpoint connections on a managed instance.
14497	PrivateEndpointConnections *[]ManagedInstancePecProperty `json:"privateEndpointConnections,omitempty"`
14498	// MinimalTLSVersion - Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'
14499	MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"`
14500	// 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'
14501	StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"`
14502	// ZoneRedundant - Whether or not the multi-az is enabled.
14503	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
14504}
14505
14506// MarshalJSON is the custom marshaler for ManagedInstanceProperties.
14507func (mip ManagedInstanceProperties) MarshalJSON() ([]byte, error) {
14508	objectMap := make(map[string]interface{})
14509	if mip.ManagedInstanceCreateMode != "" {
14510		objectMap["managedInstanceCreateMode"] = mip.ManagedInstanceCreateMode
14511	}
14512	if mip.AdministratorLogin != nil {
14513		objectMap["administratorLogin"] = mip.AdministratorLogin
14514	}
14515	if mip.AdministratorLoginPassword != nil {
14516		objectMap["administratorLoginPassword"] = mip.AdministratorLoginPassword
14517	}
14518	if mip.SubnetID != nil {
14519		objectMap["subnetId"] = mip.SubnetID
14520	}
14521	if mip.LicenseType != "" {
14522		objectMap["licenseType"] = mip.LicenseType
14523	}
14524	if mip.VCores != nil {
14525		objectMap["vCores"] = mip.VCores
14526	}
14527	if mip.StorageSizeInGB != nil {
14528		objectMap["storageSizeInGB"] = mip.StorageSizeInGB
14529	}
14530	if mip.Collation != nil {
14531		objectMap["collation"] = mip.Collation
14532	}
14533	if mip.DNSZonePartner != nil {
14534		objectMap["dnsZonePartner"] = mip.DNSZonePartner
14535	}
14536	if mip.PublicDataEndpointEnabled != nil {
14537		objectMap["publicDataEndpointEnabled"] = mip.PublicDataEndpointEnabled
14538	}
14539	if mip.SourceManagedInstanceID != nil {
14540		objectMap["sourceManagedInstanceId"] = mip.SourceManagedInstanceID
14541	}
14542	if mip.RestorePointInTime != nil {
14543		objectMap["restorePointInTime"] = mip.RestorePointInTime
14544	}
14545	if mip.ProxyOverride != "" {
14546		objectMap["proxyOverride"] = mip.ProxyOverride
14547	}
14548	if mip.TimezoneID != nil {
14549		objectMap["timezoneId"] = mip.TimezoneID
14550	}
14551	if mip.InstancePoolID != nil {
14552		objectMap["instancePoolId"] = mip.InstancePoolID
14553	}
14554	if mip.MaintenanceConfigurationID != nil {
14555		objectMap["maintenanceConfigurationId"] = mip.MaintenanceConfigurationID
14556	}
14557	if mip.MinimalTLSVersion != nil {
14558		objectMap["minimalTlsVersion"] = mip.MinimalTLSVersion
14559	}
14560	if mip.StorageAccountType != "" {
14561		objectMap["storageAccountType"] = mip.StorageAccountType
14562	}
14563	if mip.ZoneRedundant != nil {
14564		objectMap["zoneRedundant"] = mip.ZoneRedundant
14565	}
14566	return json.Marshal(objectMap)
14567}
14568
14569// ManagedInstancesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
14570// long-running operation.
14571type ManagedInstancesCreateOrUpdateFuture struct {
14572	azure.FutureAPI
14573	// Result returns the result of the asynchronous operation.
14574	// If the operation has not completed it will return an error.
14575	Result func(ManagedInstancesClient) (ManagedInstance, error)
14576}
14577
14578// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14579func (future *ManagedInstancesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
14580	var azFuture azure.Future
14581	if err := json.Unmarshal(body, &azFuture); err != nil {
14582		return err
14583	}
14584	future.FutureAPI = &azFuture
14585	future.Result = future.result
14586	return nil
14587}
14588
14589// result is the default implementation for ManagedInstancesCreateOrUpdateFuture.Result.
14590func (future *ManagedInstancesCreateOrUpdateFuture) result(client ManagedInstancesClient) (mi ManagedInstance, err error) {
14591	var done bool
14592	done, err = future.DoneWithContext(context.Background(), client)
14593	if err != nil {
14594		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
14595		return
14596	}
14597	if !done {
14598		mi.Response.Response = future.Response()
14599		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesCreateOrUpdateFuture")
14600		return
14601	}
14602	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14603	if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent {
14604		mi, err = client.CreateOrUpdateResponder(mi.Response.Response)
14605		if err != nil {
14606			err = autorest.NewErrorWithError(err, "sql.ManagedInstancesCreateOrUpdateFuture", "Result", mi.Response.Response, "Failure responding to request")
14607		}
14608	}
14609	return
14610}
14611
14612// ManagedInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
14613// operation.
14614type ManagedInstancesDeleteFuture struct {
14615	azure.FutureAPI
14616	// Result returns the result of the asynchronous operation.
14617	// If the operation has not completed it will return an error.
14618	Result func(ManagedInstancesClient) (autorest.Response, error)
14619}
14620
14621// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14622func (future *ManagedInstancesDeleteFuture) UnmarshalJSON(body []byte) error {
14623	var azFuture azure.Future
14624	if err := json.Unmarshal(body, &azFuture); err != nil {
14625		return err
14626	}
14627	future.FutureAPI = &azFuture
14628	future.Result = future.result
14629	return nil
14630}
14631
14632// result is the default implementation for ManagedInstancesDeleteFuture.Result.
14633func (future *ManagedInstancesDeleteFuture) result(client ManagedInstancesClient) (ar autorest.Response, err error) {
14634	var done bool
14635	done, err = future.DoneWithContext(context.Background(), client)
14636	if err != nil {
14637		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesDeleteFuture", "Result", future.Response(), "Polling failure")
14638		return
14639	}
14640	if !done {
14641		ar.Response = future.Response()
14642		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesDeleteFuture")
14643		return
14644	}
14645	ar.Response = future.Response()
14646	return
14647}
14648
14649// ManagedInstancesFailoverFuture an abstraction for monitoring and retrieving the results of a
14650// long-running operation.
14651type ManagedInstancesFailoverFuture struct {
14652	azure.FutureAPI
14653	// Result returns the result of the asynchronous operation.
14654	// If the operation has not completed it will return an error.
14655	Result func(ManagedInstancesClient) (autorest.Response, error)
14656}
14657
14658// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14659func (future *ManagedInstancesFailoverFuture) UnmarshalJSON(body []byte) error {
14660	var azFuture azure.Future
14661	if err := json.Unmarshal(body, &azFuture); err != nil {
14662		return err
14663	}
14664	future.FutureAPI = &azFuture
14665	future.Result = future.result
14666	return nil
14667}
14668
14669// result is the default implementation for ManagedInstancesFailoverFuture.Result.
14670func (future *ManagedInstancesFailoverFuture) result(client ManagedInstancesClient) (ar autorest.Response, err error) {
14671	var done bool
14672	done, err = future.DoneWithContext(context.Background(), client)
14673	if err != nil {
14674		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesFailoverFuture", "Result", future.Response(), "Polling failure")
14675		return
14676	}
14677	if !done {
14678		ar.Response = future.Response()
14679		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesFailoverFuture")
14680		return
14681	}
14682	ar.Response = future.Response()
14683	return
14684}
14685
14686// ManagedInstancesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
14687// operation.
14688type ManagedInstancesUpdateFuture struct {
14689	azure.FutureAPI
14690	// Result returns the result of the asynchronous operation.
14691	// If the operation has not completed it will return an error.
14692	Result func(ManagedInstancesClient) (ManagedInstance, error)
14693}
14694
14695// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14696func (future *ManagedInstancesUpdateFuture) UnmarshalJSON(body []byte) error {
14697	var azFuture azure.Future
14698	if err := json.Unmarshal(body, &azFuture); err != nil {
14699		return err
14700	}
14701	future.FutureAPI = &azFuture
14702	future.Result = future.result
14703	return nil
14704}
14705
14706// result is the default implementation for ManagedInstancesUpdateFuture.Result.
14707func (future *ManagedInstancesUpdateFuture) result(client ManagedInstancesClient) (mi ManagedInstance, err error) {
14708	var done bool
14709	done, err = future.DoneWithContext(context.Background(), client)
14710	if err != nil {
14711		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesUpdateFuture", "Result", future.Response(), "Polling failure")
14712		return
14713	}
14714	if !done {
14715		mi.Response.Response = future.Response()
14716		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesUpdateFuture")
14717		return
14718	}
14719	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14720	if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent {
14721		mi, err = client.UpdateResponder(mi.Response.Response)
14722		if err != nil {
14723			err = autorest.NewErrorWithError(err, "sql.ManagedInstancesUpdateFuture", "Result", mi.Response.Response, "Failure responding to request")
14724		}
14725	}
14726	return
14727}
14728
14729// ManagedInstanceTdeCertificatesCreateFuture an abstraction for monitoring and retrieving the results of a
14730// long-running operation.
14731type ManagedInstanceTdeCertificatesCreateFuture struct {
14732	azure.FutureAPI
14733	// Result returns the result of the asynchronous operation.
14734	// If the operation has not completed it will return an error.
14735	Result func(ManagedInstanceTdeCertificatesClient) (autorest.Response, error)
14736}
14737
14738// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14739func (future *ManagedInstanceTdeCertificatesCreateFuture) UnmarshalJSON(body []byte) error {
14740	var azFuture azure.Future
14741	if err := json.Unmarshal(body, &azFuture); err != nil {
14742		return err
14743	}
14744	future.FutureAPI = &azFuture
14745	future.Result = future.result
14746	return nil
14747}
14748
14749// result is the default implementation for ManagedInstanceTdeCertificatesCreateFuture.Result.
14750func (future *ManagedInstanceTdeCertificatesCreateFuture) result(client ManagedInstanceTdeCertificatesClient) (ar autorest.Response, err error) {
14751	var done bool
14752	done, err = future.DoneWithContext(context.Background(), client)
14753	if err != nil {
14754		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceTdeCertificatesCreateFuture", "Result", future.Response(), "Polling failure")
14755		return
14756	}
14757	if !done {
14758		ar.Response = future.Response()
14759		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceTdeCertificatesCreateFuture")
14760		return
14761	}
14762	ar.Response = future.Response()
14763	return
14764}
14765
14766// ManagedInstanceUpdate an update request for an Azure SQL Database managed instance.
14767type ManagedInstanceUpdate struct {
14768	// Sku - Managed instance sku
14769	Sku *Sku `json:"sku,omitempty"`
14770	// Identity - Managed instance identity
14771	Identity *ResourceIdentity `json:"identity,omitempty"`
14772	// ManagedInstanceProperties - Resource properties.
14773	*ManagedInstanceProperties `json:"properties,omitempty"`
14774	// Tags - Resource tags.
14775	Tags map[string]*string `json:"tags"`
14776}
14777
14778// MarshalJSON is the custom marshaler for ManagedInstanceUpdate.
14779func (miu ManagedInstanceUpdate) MarshalJSON() ([]byte, error) {
14780	objectMap := make(map[string]interface{})
14781	if miu.Sku != nil {
14782		objectMap["sku"] = miu.Sku
14783	}
14784	if miu.Identity != nil {
14785		objectMap["identity"] = miu.Identity
14786	}
14787	if miu.ManagedInstanceProperties != nil {
14788		objectMap["properties"] = miu.ManagedInstanceProperties
14789	}
14790	if miu.Tags != nil {
14791		objectMap["tags"] = miu.Tags
14792	}
14793	return json.Marshal(objectMap)
14794}
14795
14796// UnmarshalJSON is the custom unmarshaler for ManagedInstanceUpdate struct.
14797func (miu *ManagedInstanceUpdate) UnmarshalJSON(body []byte) error {
14798	var m map[string]*json.RawMessage
14799	err := json.Unmarshal(body, &m)
14800	if err != nil {
14801		return err
14802	}
14803	for k, v := range m {
14804		switch k {
14805		case "sku":
14806			if v != nil {
14807				var sku Sku
14808				err = json.Unmarshal(*v, &sku)
14809				if err != nil {
14810					return err
14811				}
14812				miu.Sku = &sku
14813			}
14814		case "identity":
14815			if v != nil {
14816				var identity ResourceIdentity
14817				err = json.Unmarshal(*v, &identity)
14818				if err != nil {
14819					return err
14820				}
14821				miu.Identity = &identity
14822			}
14823		case "properties":
14824			if v != nil {
14825				var managedInstanceProperties ManagedInstanceProperties
14826				err = json.Unmarshal(*v, &managedInstanceProperties)
14827				if err != nil {
14828					return err
14829				}
14830				miu.ManagedInstanceProperties = &managedInstanceProperties
14831			}
14832		case "tags":
14833			if v != nil {
14834				var tags map[string]*string
14835				err = json.Unmarshal(*v, &tags)
14836				if err != nil {
14837					return err
14838				}
14839				miu.Tags = tags
14840			}
14841		}
14842	}
14843
14844	return nil
14845}
14846
14847// ManagedInstanceVcoresCapability the managed instance virtual cores capability.
14848type ManagedInstanceVcoresCapability struct {
14849	// Name - READ-ONLY; The virtual cores identifier.
14850	Name *string `json:"name,omitempty"`
14851	// Value - READ-ONLY; The virtual cores value.
14852	Value *int32 `json:"value,omitempty"`
14853	// IncludedMaxSize - READ-ONLY; Included size.
14854	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
14855	// SupportedStorageSizes - READ-ONLY; Storage size ranges.
14856	SupportedStorageSizes *[]MaxSizeRangeCapability `json:"supportedStorageSizes,omitempty"`
14857	// InstancePoolSupported - READ-ONLY; True if this service objective is supported for managed instances in an instance pool.
14858	InstancePoolSupported *bool `json:"instancePoolSupported,omitempty"`
14859	// StandaloneSupported - READ-ONLY; True if this service objective is supported for standalone managed instances.
14860	StandaloneSupported *bool `json:"standaloneSupported,omitempty"`
14861	// SupportedMaintenanceConfigurations - READ-ONLY; List of supported maintenance configurations
14862	SupportedMaintenanceConfigurations *[]ManagedInstanceMaintenanceConfigurationCapability `json:"supportedMaintenanceConfigurations,omitempty"`
14863	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
14864	Status CapabilityStatus `json:"status,omitempty"`
14865	// Reason - The reason for the capability not being available.
14866	Reason *string `json:"reason,omitempty"`
14867}
14868
14869// MarshalJSON is the custom marshaler for ManagedInstanceVcoresCapability.
14870func (mivc ManagedInstanceVcoresCapability) MarshalJSON() ([]byte, error) {
14871	objectMap := make(map[string]interface{})
14872	if mivc.Reason != nil {
14873		objectMap["reason"] = mivc.Reason
14874	}
14875	return json.Marshal(objectMap)
14876}
14877
14878// ManagedInstanceVersionCapability the managed instance capability
14879type ManagedInstanceVersionCapability struct {
14880	// Name - READ-ONLY; The server version name.
14881	Name *string `json:"name,omitempty"`
14882	// SupportedEditions - READ-ONLY; The list of supported managed instance editions.
14883	SupportedEditions *[]ManagedInstanceEditionCapability `json:"supportedEditions,omitempty"`
14884	// SupportedInstancePoolEditions - READ-ONLY; The list of supported instance pool editions.
14885	SupportedInstancePoolEditions *[]InstancePoolEditionCapability `json:"supportedInstancePoolEditions,omitempty"`
14886	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
14887	Status CapabilityStatus `json:"status,omitempty"`
14888	// Reason - The reason for the capability not being available.
14889	Reason *string `json:"reason,omitempty"`
14890}
14891
14892// MarshalJSON is the custom marshaler for ManagedInstanceVersionCapability.
14893func (mivc ManagedInstanceVersionCapability) MarshalJSON() ([]byte, error) {
14894	objectMap := make(map[string]interface{})
14895	if mivc.Reason != nil {
14896		objectMap["reason"] = mivc.Reason
14897	}
14898	return json.Marshal(objectMap)
14899}
14900
14901// ManagedInstanceVulnerabilityAssessment a managed instance vulnerability assessment.
14902type ManagedInstanceVulnerabilityAssessment struct {
14903	autorest.Response `json:"-"`
14904	// ManagedInstanceVulnerabilityAssessmentProperties - Resource properties.
14905	*ManagedInstanceVulnerabilityAssessmentProperties `json:"properties,omitempty"`
14906	// ID - READ-ONLY; Resource ID.
14907	ID *string `json:"id,omitempty"`
14908	// Name - READ-ONLY; Resource name.
14909	Name *string `json:"name,omitempty"`
14910	// Type - READ-ONLY; Resource type.
14911	Type *string `json:"type,omitempty"`
14912}
14913
14914// MarshalJSON is the custom marshaler for ManagedInstanceVulnerabilityAssessment.
14915func (miva ManagedInstanceVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
14916	objectMap := make(map[string]interface{})
14917	if miva.ManagedInstanceVulnerabilityAssessmentProperties != nil {
14918		objectMap["properties"] = miva.ManagedInstanceVulnerabilityAssessmentProperties
14919	}
14920	return json.Marshal(objectMap)
14921}
14922
14923// UnmarshalJSON is the custom unmarshaler for ManagedInstanceVulnerabilityAssessment struct.
14924func (miva *ManagedInstanceVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
14925	var m map[string]*json.RawMessage
14926	err := json.Unmarshal(body, &m)
14927	if err != nil {
14928		return err
14929	}
14930	for k, v := range m {
14931		switch k {
14932		case "properties":
14933			if v != nil {
14934				var managedInstanceVulnerabilityAssessmentProperties ManagedInstanceVulnerabilityAssessmentProperties
14935				err = json.Unmarshal(*v, &managedInstanceVulnerabilityAssessmentProperties)
14936				if err != nil {
14937					return err
14938				}
14939				miva.ManagedInstanceVulnerabilityAssessmentProperties = &managedInstanceVulnerabilityAssessmentProperties
14940			}
14941		case "id":
14942			if v != nil {
14943				var ID string
14944				err = json.Unmarshal(*v, &ID)
14945				if err != nil {
14946					return err
14947				}
14948				miva.ID = &ID
14949			}
14950		case "name":
14951			if v != nil {
14952				var name string
14953				err = json.Unmarshal(*v, &name)
14954				if err != nil {
14955					return err
14956				}
14957				miva.Name = &name
14958			}
14959		case "type":
14960			if v != nil {
14961				var typeVar string
14962				err = json.Unmarshal(*v, &typeVar)
14963				if err != nil {
14964					return err
14965				}
14966				miva.Type = &typeVar
14967			}
14968		}
14969	}
14970
14971	return nil
14972}
14973
14974// ManagedInstanceVulnerabilityAssessmentListResult a list of the ManagedInstance's vulnerability
14975// assessments.
14976type ManagedInstanceVulnerabilityAssessmentListResult struct {
14977	autorest.Response `json:"-"`
14978	// Value - READ-ONLY; Array of results.
14979	Value *[]ManagedInstanceVulnerabilityAssessment `json:"value,omitempty"`
14980	// NextLink - READ-ONLY; Link to retrieve next page of results.
14981	NextLink *string `json:"nextLink,omitempty"`
14982}
14983
14984// MarshalJSON is the custom marshaler for ManagedInstanceVulnerabilityAssessmentListResult.
14985func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) {
14986	objectMap := make(map[string]interface{})
14987	return json.Marshal(objectMap)
14988}
14989
14990// ManagedInstanceVulnerabilityAssessmentListResultIterator provides access to a complete listing of
14991// ManagedInstanceVulnerabilityAssessment values.
14992type ManagedInstanceVulnerabilityAssessmentListResultIterator struct {
14993	i    int
14994	page ManagedInstanceVulnerabilityAssessmentListResultPage
14995}
14996
14997// NextWithContext advances to the next value.  If there was an error making
14998// the request the iterator does not advance and the error is returned.
14999func (iter *ManagedInstanceVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
15000	if tracing.IsEnabled() {
15001		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentListResultIterator.NextWithContext")
15002		defer func() {
15003			sc := -1
15004			if iter.Response().Response.Response != nil {
15005				sc = iter.Response().Response.Response.StatusCode
15006			}
15007			tracing.EndSpan(ctx, sc, err)
15008		}()
15009	}
15010	iter.i++
15011	if iter.i < len(iter.page.Values()) {
15012		return nil
15013	}
15014	err = iter.page.NextWithContext(ctx)
15015	if err != nil {
15016		iter.i--
15017		return err
15018	}
15019	iter.i = 0
15020	return nil
15021}
15022
15023// Next advances to the next value.  If there was an error making
15024// the request the iterator does not advance and the error is returned.
15025// Deprecated: Use NextWithContext() instead.
15026func (iter *ManagedInstanceVulnerabilityAssessmentListResultIterator) Next() error {
15027	return iter.NextWithContext(context.Background())
15028}
15029
15030// NotDone returns true if the enumeration should be started or is not yet complete.
15031func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) NotDone() bool {
15032	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15033}
15034
15035// Response returns the raw server response from the last page request.
15036func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) Response() ManagedInstanceVulnerabilityAssessmentListResult {
15037	return iter.page.Response()
15038}
15039
15040// Value returns the current value or a zero-initialized value if the
15041// iterator has advanced beyond the end of the collection.
15042func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) Value() ManagedInstanceVulnerabilityAssessment {
15043	if !iter.page.NotDone() {
15044		return ManagedInstanceVulnerabilityAssessment{}
15045	}
15046	return iter.page.Values()[iter.i]
15047}
15048
15049// Creates a new instance of the ManagedInstanceVulnerabilityAssessmentListResultIterator type.
15050func NewManagedInstanceVulnerabilityAssessmentListResultIterator(page ManagedInstanceVulnerabilityAssessmentListResultPage) ManagedInstanceVulnerabilityAssessmentListResultIterator {
15051	return ManagedInstanceVulnerabilityAssessmentListResultIterator{page: page}
15052}
15053
15054// IsEmpty returns true if the ListResult contains no values.
15055func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) IsEmpty() bool {
15056	return mivalr.Value == nil || len(*mivalr.Value) == 0
15057}
15058
15059// hasNextLink returns true if the NextLink is not empty.
15060func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) hasNextLink() bool {
15061	return mivalr.NextLink != nil && len(*mivalr.NextLink) != 0
15062}
15063
15064// managedInstanceVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
15065// It returns nil if no more results exist.
15066func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) managedInstanceVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
15067	if !mivalr.hasNextLink() {
15068		return nil, nil
15069	}
15070	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15071		autorest.AsJSON(),
15072		autorest.AsGet(),
15073		autorest.WithBaseURL(to.String(mivalr.NextLink)))
15074}
15075
15076// ManagedInstanceVulnerabilityAssessmentListResultPage contains a page of
15077// ManagedInstanceVulnerabilityAssessment values.
15078type ManagedInstanceVulnerabilityAssessmentListResultPage struct {
15079	fn     func(context.Context, ManagedInstanceVulnerabilityAssessmentListResult) (ManagedInstanceVulnerabilityAssessmentListResult, error)
15080	mivalr ManagedInstanceVulnerabilityAssessmentListResult
15081}
15082
15083// NextWithContext advances to the next page of values.  If there was an error making
15084// the request the page does not advance and the error is returned.
15085func (page *ManagedInstanceVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
15086	if tracing.IsEnabled() {
15087		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentListResultPage.NextWithContext")
15088		defer func() {
15089			sc := -1
15090			if page.Response().Response.Response != nil {
15091				sc = page.Response().Response.Response.StatusCode
15092			}
15093			tracing.EndSpan(ctx, sc, err)
15094		}()
15095	}
15096	for {
15097		next, err := page.fn(ctx, page.mivalr)
15098		if err != nil {
15099			return err
15100		}
15101		page.mivalr = next
15102		if !next.hasNextLink() || !next.IsEmpty() {
15103			break
15104		}
15105	}
15106	return nil
15107}
15108
15109// Next advances to the next page of values.  If there was an error making
15110// the request the page does not advance and the error is returned.
15111// Deprecated: Use NextWithContext() instead.
15112func (page *ManagedInstanceVulnerabilityAssessmentListResultPage) Next() error {
15113	return page.NextWithContext(context.Background())
15114}
15115
15116// NotDone returns true if the page enumeration should be started or is not yet complete.
15117func (page ManagedInstanceVulnerabilityAssessmentListResultPage) NotDone() bool {
15118	return !page.mivalr.IsEmpty()
15119}
15120
15121// Response returns the raw server response from the last page request.
15122func (page ManagedInstanceVulnerabilityAssessmentListResultPage) Response() ManagedInstanceVulnerabilityAssessmentListResult {
15123	return page.mivalr
15124}
15125
15126// Values returns the slice of values for the current page or nil if there are no values.
15127func (page ManagedInstanceVulnerabilityAssessmentListResultPage) Values() []ManagedInstanceVulnerabilityAssessment {
15128	if page.mivalr.IsEmpty() {
15129		return nil
15130	}
15131	return *page.mivalr.Value
15132}
15133
15134// Creates a new instance of the ManagedInstanceVulnerabilityAssessmentListResultPage type.
15135func NewManagedInstanceVulnerabilityAssessmentListResultPage(cur ManagedInstanceVulnerabilityAssessmentListResult, getNextPage func(context.Context, ManagedInstanceVulnerabilityAssessmentListResult) (ManagedInstanceVulnerabilityAssessmentListResult, error)) ManagedInstanceVulnerabilityAssessmentListResultPage {
15136	return ManagedInstanceVulnerabilityAssessmentListResultPage{
15137		fn:     getNextPage,
15138		mivalr: cur,
15139	}
15140}
15141
15142// ManagedInstanceVulnerabilityAssessmentProperties properties of a managed instance vulnerability
15143// assessment.
15144type ManagedInstanceVulnerabilityAssessmentProperties struct {
15145	// StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
15146	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
15147	// 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.
15148	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
15149	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
15150	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
15151	// RecurringScans - The recurring scans settings
15152	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
15153}
15154
15155// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for
15156// monitoring and retrieving the results of a long-running operation.
15157type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture struct {
15158	azure.FutureAPI
15159	// Result returns the result of the asynchronous operation.
15160	// If the operation has not completed it will return an error.
15161	Result func(ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
15162}
15163
15164// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15165func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
15166	var azFuture azure.Future
15167	if err := json.Unmarshal(body, &azFuture); err != nil {
15168		return err
15169	}
15170	future.FutureAPI = &azFuture
15171	future.Result = future.result
15172	return nil
15173}
15174
15175// result is the default implementation for ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture.Result.
15176func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture) result(client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) {
15177	var done bool
15178	done, err = future.DoneWithContext(context.Background(), client)
15179	if err != nil {
15180		err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
15181		return
15182	}
15183	if !done {
15184		mbstrp.Response.Response = future.Response()
15185		err = azure.NewAsyncOpIncompleteError("sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture")
15186		return
15187	}
15188	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15189	if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent {
15190		mbstrp, err = client.CreateOrUpdateResponder(mbstrp.Response.Response)
15191		if err != nil {
15192			err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request")
15193		}
15194	}
15195	return
15196}
15197
15198// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture an abstraction for
15199// monitoring and retrieving the results of a long-running operation.
15200type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture struct {
15201	azure.FutureAPI
15202	// Result returns the result of the asynchronous operation.
15203	// If the operation has not completed it will return an error.
15204	Result func(ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
15205}
15206
15207// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15208func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture) UnmarshalJSON(body []byte) error {
15209	var azFuture azure.Future
15210	if err := json.Unmarshal(body, &azFuture); err != nil {
15211		return err
15212	}
15213	future.FutureAPI = &azFuture
15214	future.Result = future.result
15215	return nil
15216}
15217
15218// result is the default implementation for ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture.Result.
15219func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture) result(client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) {
15220	var done bool
15221	done, err = future.DoneWithContext(context.Background(), client)
15222	if err != nil {
15223		err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture", "Result", future.Response(), "Polling failure")
15224		return
15225	}
15226	if !done {
15227		mbstrp.Response.Response = future.Response()
15228		err = azure.NewAsyncOpIncompleteError("sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture")
15229		return
15230	}
15231	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15232	if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent {
15233		mbstrp, err = client.UpdateResponder(mbstrp.Response.Response)
15234		if err != nil {
15235			err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request")
15236		}
15237	}
15238	return
15239}
15240
15241// ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
15242// results of a long-running operation.
15243type ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture struct {
15244	azure.FutureAPI
15245	// Result returns the result of the asynchronous operation.
15246	// If the operation has not completed it will return an error.
15247	Result func(ManagedServerSecurityAlertPoliciesClient) (ManagedServerSecurityAlertPolicy, error)
15248}
15249
15250// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15251func (future *ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
15252	var azFuture azure.Future
15253	if err := json.Unmarshal(body, &azFuture); err != nil {
15254		return err
15255	}
15256	future.FutureAPI = &azFuture
15257	future.Result = future.result
15258	return nil
15259}
15260
15261// result is the default implementation for ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture.Result.
15262func (future *ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture) result(client ManagedServerSecurityAlertPoliciesClient) (mssap ManagedServerSecurityAlertPolicy, err error) {
15263	var done bool
15264	done, err = future.DoneWithContext(context.Background(), client)
15265	if err != nil {
15266		err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
15267		return
15268	}
15269	if !done {
15270		mssap.Response.Response = future.Response()
15271		err = azure.NewAsyncOpIncompleteError("sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture")
15272		return
15273	}
15274	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15275	if mssap.Response.Response, err = future.GetResult(sender); err == nil && mssap.Response.Response.StatusCode != http.StatusNoContent {
15276		mssap, err = client.CreateOrUpdateResponder(mssap.Response.Response)
15277		if err != nil {
15278			err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", mssap.Response.Response, "Failure responding to request")
15279		}
15280	}
15281	return
15282}
15283
15284// ManagedServerSecurityAlertPolicy a managed server security alert policy.
15285type ManagedServerSecurityAlertPolicy struct {
15286	autorest.Response `json:"-"`
15287	// SecurityAlertPolicyProperties - Resource properties.
15288	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
15289	// ID - READ-ONLY; Resource ID.
15290	ID *string `json:"id,omitempty"`
15291	// Name - READ-ONLY; Resource name.
15292	Name *string `json:"name,omitempty"`
15293	// Type - READ-ONLY; Resource type.
15294	Type *string `json:"type,omitempty"`
15295}
15296
15297// MarshalJSON is the custom marshaler for ManagedServerSecurityAlertPolicy.
15298func (mssap ManagedServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
15299	objectMap := make(map[string]interface{})
15300	if mssap.SecurityAlertPolicyProperties != nil {
15301		objectMap["properties"] = mssap.SecurityAlertPolicyProperties
15302	}
15303	return json.Marshal(objectMap)
15304}
15305
15306// UnmarshalJSON is the custom unmarshaler for ManagedServerSecurityAlertPolicy struct.
15307func (mssap *ManagedServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
15308	var m map[string]*json.RawMessage
15309	err := json.Unmarshal(body, &m)
15310	if err != nil {
15311		return err
15312	}
15313	for k, v := range m {
15314		switch k {
15315		case "properties":
15316			if v != nil {
15317				var securityAlertPolicyProperties SecurityAlertPolicyProperties
15318				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
15319				if err != nil {
15320					return err
15321				}
15322				mssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
15323			}
15324		case "id":
15325			if v != nil {
15326				var ID string
15327				err = json.Unmarshal(*v, &ID)
15328				if err != nil {
15329					return err
15330				}
15331				mssap.ID = &ID
15332			}
15333		case "name":
15334			if v != nil {
15335				var name string
15336				err = json.Unmarshal(*v, &name)
15337				if err != nil {
15338					return err
15339				}
15340				mssap.Name = &name
15341			}
15342		case "type":
15343			if v != nil {
15344				var typeVar string
15345				err = json.Unmarshal(*v, &typeVar)
15346				if err != nil {
15347					return err
15348				}
15349				mssap.Type = &typeVar
15350			}
15351		}
15352	}
15353
15354	return nil
15355}
15356
15357// ManagedServerSecurityAlertPolicyListResult a list of the managed Server's security alert policies.
15358type ManagedServerSecurityAlertPolicyListResult struct {
15359	autorest.Response `json:"-"`
15360	// Value - READ-ONLY; Array of results.
15361	Value *[]ManagedServerSecurityAlertPolicy `json:"value,omitempty"`
15362	// NextLink - READ-ONLY; Link to retrieve next page of results.
15363	NextLink *string `json:"nextLink,omitempty"`
15364}
15365
15366// MarshalJSON is the custom marshaler for ManagedServerSecurityAlertPolicyListResult.
15367func (mssaplr ManagedServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) {
15368	objectMap := make(map[string]interface{})
15369	return json.Marshal(objectMap)
15370}
15371
15372// ManagedServerSecurityAlertPolicyListResultIterator provides access to a complete listing of
15373// ManagedServerSecurityAlertPolicy values.
15374type ManagedServerSecurityAlertPolicyListResultIterator struct {
15375	i    int
15376	page ManagedServerSecurityAlertPolicyListResultPage
15377}
15378
15379// NextWithContext advances to the next value.  If there was an error making
15380// the request the iterator does not advance and the error is returned.
15381func (iter *ManagedServerSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
15382	if tracing.IsEnabled() {
15383		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPolicyListResultIterator.NextWithContext")
15384		defer func() {
15385			sc := -1
15386			if iter.Response().Response.Response != nil {
15387				sc = iter.Response().Response.Response.StatusCode
15388			}
15389			tracing.EndSpan(ctx, sc, err)
15390		}()
15391	}
15392	iter.i++
15393	if iter.i < len(iter.page.Values()) {
15394		return nil
15395	}
15396	err = iter.page.NextWithContext(ctx)
15397	if err != nil {
15398		iter.i--
15399		return err
15400	}
15401	iter.i = 0
15402	return nil
15403}
15404
15405// Next advances to the next value.  If there was an error making
15406// the request the iterator does not advance and the error is returned.
15407// Deprecated: Use NextWithContext() instead.
15408func (iter *ManagedServerSecurityAlertPolicyListResultIterator) Next() error {
15409	return iter.NextWithContext(context.Background())
15410}
15411
15412// NotDone returns true if the enumeration should be started or is not yet complete.
15413func (iter ManagedServerSecurityAlertPolicyListResultIterator) NotDone() bool {
15414	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15415}
15416
15417// Response returns the raw server response from the last page request.
15418func (iter ManagedServerSecurityAlertPolicyListResultIterator) Response() ManagedServerSecurityAlertPolicyListResult {
15419	return iter.page.Response()
15420}
15421
15422// Value returns the current value or a zero-initialized value if the
15423// iterator has advanced beyond the end of the collection.
15424func (iter ManagedServerSecurityAlertPolicyListResultIterator) Value() ManagedServerSecurityAlertPolicy {
15425	if !iter.page.NotDone() {
15426		return ManagedServerSecurityAlertPolicy{}
15427	}
15428	return iter.page.Values()[iter.i]
15429}
15430
15431// Creates a new instance of the ManagedServerSecurityAlertPolicyListResultIterator type.
15432func NewManagedServerSecurityAlertPolicyListResultIterator(page ManagedServerSecurityAlertPolicyListResultPage) ManagedServerSecurityAlertPolicyListResultIterator {
15433	return ManagedServerSecurityAlertPolicyListResultIterator{page: page}
15434}
15435
15436// IsEmpty returns true if the ListResult contains no values.
15437func (mssaplr ManagedServerSecurityAlertPolicyListResult) IsEmpty() bool {
15438	return mssaplr.Value == nil || len(*mssaplr.Value) == 0
15439}
15440
15441// hasNextLink returns true if the NextLink is not empty.
15442func (mssaplr ManagedServerSecurityAlertPolicyListResult) hasNextLink() bool {
15443	return mssaplr.NextLink != nil && len(*mssaplr.NextLink) != 0
15444}
15445
15446// managedServerSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
15447// It returns nil if no more results exist.
15448func (mssaplr ManagedServerSecurityAlertPolicyListResult) managedServerSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
15449	if !mssaplr.hasNextLink() {
15450		return nil, nil
15451	}
15452	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15453		autorest.AsJSON(),
15454		autorest.AsGet(),
15455		autorest.WithBaseURL(to.String(mssaplr.NextLink)))
15456}
15457
15458// ManagedServerSecurityAlertPolicyListResultPage contains a page of ManagedServerSecurityAlertPolicy
15459// values.
15460type ManagedServerSecurityAlertPolicyListResultPage struct {
15461	fn      func(context.Context, ManagedServerSecurityAlertPolicyListResult) (ManagedServerSecurityAlertPolicyListResult, error)
15462	mssaplr ManagedServerSecurityAlertPolicyListResult
15463}
15464
15465// NextWithContext advances to the next page of values.  If there was an error making
15466// the request the page does not advance and the error is returned.
15467func (page *ManagedServerSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
15468	if tracing.IsEnabled() {
15469		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPolicyListResultPage.NextWithContext")
15470		defer func() {
15471			sc := -1
15472			if page.Response().Response.Response != nil {
15473				sc = page.Response().Response.Response.StatusCode
15474			}
15475			tracing.EndSpan(ctx, sc, err)
15476		}()
15477	}
15478	for {
15479		next, err := page.fn(ctx, page.mssaplr)
15480		if err != nil {
15481			return err
15482		}
15483		page.mssaplr = next
15484		if !next.hasNextLink() || !next.IsEmpty() {
15485			break
15486		}
15487	}
15488	return nil
15489}
15490
15491// Next advances to the next page of values.  If there was an error making
15492// the request the page does not advance and the error is returned.
15493// Deprecated: Use NextWithContext() instead.
15494func (page *ManagedServerSecurityAlertPolicyListResultPage) Next() error {
15495	return page.NextWithContext(context.Background())
15496}
15497
15498// NotDone returns true if the page enumeration should be started or is not yet complete.
15499func (page ManagedServerSecurityAlertPolicyListResultPage) NotDone() bool {
15500	return !page.mssaplr.IsEmpty()
15501}
15502
15503// Response returns the raw server response from the last page request.
15504func (page ManagedServerSecurityAlertPolicyListResultPage) Response() ManagedServerSecurityAlertPolicyListResult {
15505	return page.mssaplr
15506}
15507
15508// Values returns the slice of values for the current page or nil if there are no values.
15509func (page ManagedServerSecurityAlertPolicyListResultPage) Values() []ManagedServerSecurityAlertPolicy {
15510	if page.mssaplr.IsEmpty() {
15511		return nil
15512	}
15513	return *page.mssaplr.Value
15514}
15515
15516// Creates a new instance of the ManagedServerSecurityAlertPolicyListResultPage type.
15517func NewManagedServerSecurityAlertPolicyListResultPage(cur ManagedServerSecurityAlertPolicyListResult, getNextPage func(context.Context, ManagedServerSecurityAlertPolicyListResult) (ManagedServerSecurityAlertPolicyListResult, error)) ManagedServerSecurityAlertPolicyListResultPage {
15518	return ManagedServerSecurityAlertPolicyListResultPage{
15519		fn:      getNextPage,
15520		mssaplr: cur,
15521	}
15522}
15523
15524// MaxSizeCapability the maximum size capability.
15525type MaxSizeCapability struct {
15526	// Limit - READ-ONLY; The maximum size limit (see 'unit' for the units).
15527	Limit *int32 `json:"limit,omitempty"`
15528	// Unit - READ-ONLY; The units that the limit is expressed in. Possible values include: 'MaxSizeUnitMegabytes', 'MaxSizeUnitGigabytes', 'MaxSizeUnitTerabytes', 'MaxSizeUnitPetabytes'
15529	Unit MaxSizeUnit `json:"unit,omitempty"`
15530}
15531
15532// MarshalJSON is the custom marshaler for MaxSizeCapability.
15533func (msc MaxSizeCapability) MarshalJSON() ([]byte, error) {
15534	objectMap := make(map[string]interface{})
15535	return json.Marshal(objectMap)
15536}
15537
15538// MaxSizeRangeCapability the maximum size range capability.
15539type MaxSizeRangeCapability struct {
15540	// MinValue - READ-ONLY; Minimum value.
15541	MinValue *MaxSizeCapability `json:"minValue,omitempty"`
15542	// MaxValue - READ-ONLY; Maximum value.
15543	MaxValue *MaxSizeCapability `json:"maxValue,omitempty"`
15544	// ScaleSize - READ-ONLY; Scale/step size for discrete values between the minimum value and the maximum value.
15545	ScaleSize *MaxSizeCapability `json:"scaleSize,omitempty"`
15546	// LogSize - READ-ONLY; Size of transaction log.
15547	LogSize *LogSizeCapability `json:"logSize,omitempty"`
15548	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
15549	Status CapabilityStatus `json:"status,omitempty"`
15550	// Reason - The reason for the capability not being available.
15551	Reason *string `json:"reason,omitempty"`
15552}
15553
15554// MarshalJSON is the custom marshaler for MaxSizeRangeCapability.
15555func (msrc MaxSizeRangeCapability) MarshalJSON() ([]byte, error) {
15556	objectMap := make(map[string]interface{})
15557	if msrc.Reason != nil {
15558		objectMap["reason"] = msrc.Reason
15559	}
15560	return json.Marshal(objectMap)
15561}
15562
15563// Metric database metrics.
15564type Metric struct {
15565	// StartTime - READ-ONLY; The start time for the metric (ISO-8601 format).
15566	StartTime *date.Time `json:"startTime,omitempty"`
15567	// EndTime - READ-ONLY; The end time for the metric (ISO-8601 format).
15568	EndTime *date.Time `json:"endTime,omitempty"`
15569	// TimeGrain - READ-ONLY; The time step to be used to summarize the metric values.
15570	TimeGrain *string `json:"timeGrain,omitempty"`
15571	// Unit - READ-ONLY; The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond'
15572	Unit UnitType `json:"unit,omitempty"`
15573	// Name - READ-ONLY; The name information for the metric.
15574	Name *MetricName `json:"name,omitempty"`
15575	// MetricValues - READ-ONLY; The metric values for the specified time window and timestep.
15576	MetricValues *[]MetricValue `json:"metricValues,omitempty"`
15577}
15578
15579// MarshalJSON is the custom marshaler for Metric.
15580func (mVar Metric) MarshalJSON() ([]byte, error) {
15581	objectMap := make(map[string]interface{})
15582	return json.Marshal(objectMap)
15583}
15584
15585// MetricAvailability a metric availability value.
15586type MetricAvailability struct {
15587	// Retention - READ-ONLY; The length of retention for the database metric.
15588	Retention *string `json:"retention,omitempty"`
15589	// TimeGrain - READ-ONLY; The granularity of the database metric.
15590	TimeGrain *string `json:"timeGrain,omitempty"`
15591}
15592
15593// MarshalJSON is the custom marshaler for MetricAvailability.
15594func (ma MetricAvailability) MarshalJSON() ([]byte, error) {
15595	objectMap := make(map[string]interface{})
15596	return json.Marshal(objectMap)
15597}
15598
15599// MetricDefinition a database metric definition.
15600type MetricDefinition struct {
15601	// Name - READ-ONLY; The name information for the metric.
15602	Name *MetricName `json:"name,omitempty"`
15603	// PrimaryAggregationType - READ-ONLY; The primary aggregation type defining how metric values are displayed. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeCount', 'PrimaryAggregationTypeMinimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeTotal'
15604	PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"`
15605	// ResourceURI - READ-ONLY; The resource uri of the database.
15606	ResourceURI *string `json:"resourceUri,omitempty"`
15607	// Unit - READ-ONLY; The unit of the metric. Possible values include: 'UnitDefinitionTypeCount', 'UnitDefinitionTypeBytes', 'UnitDefinitionTypeSeconds', 'UnitDefinitionTypePercent', 'UnitDefinitionTypeCountPerSecond', 'UnitDefinitionTypeBytesPerSecond'
15608	Unit UnitDefinitionType `json:"unit,omitempty"`
15609	// MetricAvailabilities - READ-ONLY; The list of database metric availabilities for the metric.
15610	MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
15611}
15612
15613// MarshalJSON is the custom marshaler for MetricDefinition.
15614func (md MetricDefinition) MarshalJSON() ([]byte, error) {
15615	objectMap := make(map[string]interface{})
15616	return json.Marshal(objectMap)
15617}
15618
15619// MetricDefinitionListResult the response to a list database metric definitions request.
15620type MetricDefinitionListResult struct {
15621	autorest.Response `json:"-"`
15622	// Value - The list of metric definitions for the database.
15623	Value *[]MetricDefinition `json:"value,omitempty"`
15624}
15625
15626// MetricListResult the response to a list database metrics request.
15627type MetricListResult struct {
15628	autorest.Response `json:"-"`
15629	// Value - The list of metrics for the database.
15630	Value *[]Metric `json:"value,omitempty"`
15631}
15632
15633// MetricName a database metric name.
15634type MetricName struct {
15635	// Value - READ-ONLY; The name of the database metric.
15636	Value *string `json:"value,omitempty"`
15637	// LocalizedValue - READ-ONLY; The friendly name of the database metric.
15638	LocalizedValue *string `json:"localizedValue,omitempty"`
15639}
15640
15641// MarshalJSON is the custom marshaler for MetricName.
15642func (mn MetricName) MarshalJSON() ([]byte, error) {
15643	objectMap := make(map[string]interface{})
15644	return json.Marshal(objectMap)
15645}
15646
15647// MetricValue represents database metrics.
15648type MetricValue struct {
15649	// Count - READ-ONLY; The number of values for the metric.
15650	Count *float64 `json:"count,omitempty"`
15651	// Average - READ-ONLY; The average value of the metric.
15652	Average *float64 `json:"average,omitempty"`
15653	// Maximum - READ-ONLY; The max value of the metric.
15654	Maximum *float64 `json:"maximum,omitempty"`
15655	// Minimum - READ-ONLY; The min value of the metric.
15656	Minimum *float64 `json:"minimum,omitempty"`
15657	// Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format).
15658	Timestamp *date.Time `json:"timestamp,omitempty"`
15659	// Total - READ-ONLY; The total value of the metric.
15660	Total *float64 `json:"total,omitempty"`
15661}
15662
15663// MarshalJSON is the custom marshaler for MetricValue.
15664func (mv MetricValue) MarshalJSON() ([]byte, error) {
15665	objectMap := make(map[string]interface{})
15666	return json.Marshal(objectMap)
15667}
15668
15669// MinCapacityCapability the min capacity capability
15670type MinCapacityCapability struct {
15671	// Value - READ-ONLY; Min capacity value
15672	Value *float64 `json:"value,omitempty"`
15673	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
15674	Status CapabilityStatus `json:"status,omitempty"`
15675	// Reason - The reason for the capability not being available.
15676	Reason *string `json:"reason,omitempty"`
15677}
15678
15679// MarshalJSON is the custom marshaler for MinCapacityCapability.
15680func (mcc MinCapacityCapability) MarshalJSON() ([]byte, error) {
15681	objectMap := make(map[string]interface{})
15682	if mcc.Reason != nil {
15683		objectMap["reason"] = mcc.Reason
15684	}
15685	return json.Marshal(objectMap)
15686}
15687
15688// Name ARM Usage Name
15689type Name struct {
15690	// Value - Usage name value
15691	Value *string `json:"value,omitempty"`
15692	// LocalizedValue - Usage name localized value.
15693	LocalizedValue *string `json:"localizedValue,omitempty"`
15694}
15695
15696// NetworkIsolationSettings contains the ARM resources for which to create private endpoint connection.
15697type NetworkIsolationSettings struct {
15698	// 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.
15699	StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
15700	// 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.
15701	SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"`
15702}
15703
15704// Operation SQL REST API operation definition.
15705type Operation struct {
15706	// Name - READ-ONLY; The name of the operation being performed on this particular object.
15707	Name *string `json:"name,omitempty"`
15708	// Display - READ-ONLY; The localized display information for this particular operation / action.
15709	Display *OperationDisplay `json:"display,omitempty"`
15710	// Origin - READ-ONLY; The intended executor of the operation. Possible values include: 'OperationOriginUser', 'OperationOriginSystem'
15711	Origin OperationOrigin `json:"origin,omitempty"`
15712	// Properties - READ-ONLY; Additional descriptions for the operation.
15713	Properties map[string]interface{} `json:"properties"`
15714}
15715
15716// MarshalJSON is the custom marshaler for Operation.
15717func (o Operation) MarshalJSON() ([]byte, error) {
15718	objectMap := make(map[string]interface{})
15719	return json.Marshal(objectMap)
15720}
15721
15722// OperationDisplay display metadata associated with the operation.
15723type OperationDisplay struct {
15724	// Provider - READ-ONLY; The localized friendly form of the resource provider name.
15725	Provider *string `json:"provider,omitempty"`
15726	// Resource - READ-ONLY; The localized friendly form of the resource type related to this action/operation.
15727	Resource *string `json:"resource,omitempty"`
15728	// Operation - READ-ONLY; The localized friendly name for the operation.
15729	Operation *string `json:"operation,omitempty"`
15730	// Description - READ-ONLY; The localized friendly description for the operation.
15731	Description *string `json:"description,omitempty"`
15732}
15733
15734// MarshalJSON is the custom marshaler for OperationDisplay.
15735func (od OperationDisplay) MarshalJSON() ([]byte, error) {
15736	objectMap := make(map[string]interface{})
15737	return json.Marshal(objectMap)
15738}
15739
15740// OperationImpact the impact of an operation, both in absolute and relative terms.
15741type OperationImpact struct {
15742	// Name - READ-ONLY; The name of the impact dimension.
15743	Name *string `json:"name,omitempty"`
15744	// Unit - READ-ONLY; The unit in which estimated impact to dimension is measured.
15745	Unit *string `json:"unit,omitempty"`
15746	// ChangeValueAbsolute - READ-ONLY; The absolute impact to dimension.
15747	ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty"`
15748	// ChangeValueRelative - READ-ONLY; The relative impact to dimension (null if not applicable)
15749	ChangeValueRelative *float64 `json:"changeValueRelative,omitempty"`
15750}
15751
15752// MarshalJSON is the custom marshaler for OperationImpact.
15753func (oi OperationImpact) MarshalJSON() ([]byte, error) {
15754	objectMap := make(map[string]interface{})
15755	return json.Marshal(objectMap)
15756}
15757
15758// OperationListResult result of the request to list SQL operations.
15759type OperationListResult struct {
15760	autorest.Response `json:"-"`
15761	// Value - READ-ONLY; Array of results.
15762	Value *[]Operation `json:"value,omitempty"`
15763	// NextLink - READ-ONLY; Link to retrieve next page of results.
15764	NextLink *string `json:"nextLink,omitempty"`
15765}
15766
15767// MarshalJSON is the custom marshaler for OperationListResult.
15768func (olr OperationListResult) MarshalJSON() ([]byte, error) {
15769	objectMap := make(map[string]interface{})
15770	return json.Marshal(objectMap)
15771}
15772
15773// OperationListResultIterator provides access to a complete listing of Operation values.
15774type OperationListResultIterator struct {
15775	i    int
15776	page OperationListResultPage
15777}
15778
15779// NextWithContext advances to the next value.  If there was an error making
15780// the request the iterator does not advance and the error is returned.
15781func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
15782	if tracing.IsEnabled() {
15783		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
15784		defer func() {
15785			sc := -1
15786			if iter.Response().Response.Response != nil {
15787				sc = iter.Response().Response.Response.StatusCode
15788			}
15789			tracing.EndSpan(ctx, sc, err)
15790		}()
15791	}
15792	iter.i++
15793	if iter.i < len(iter.page.Values()) {
15794		return nil
15795	}
15796	err = iter.page.NextWithContext(ctx)
15797	if err != nil {
15798		iter.i--
15799		return err
15800	}
15801	iter.i = 0
15802	return nil
15803}
15804
15805// Next advances to the next value.  If there was an error making
15806// the request the iterator does not advance and the error is returned.
15807// Deprecated: Use NextWithContext() instead.
15808func (iter *OperationListResultIterator) Next() error {
15809	return iter.NextWithContext(context.Background())
15810}
15811
15812// NotDone returns true if the enumeration should be started or is not yet complete.
15813func (iter OperationListResultIterator) NotDone() bool {
15814	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15815}
15816
15817// Response returns the raw server response from the last page request.
15818func (iter OperationListResultIterator) Response() OperationListResult {
15819	return iter.page.Response()
15820}
15821
15822// Value returns the current value or a zero-initialized value if the
15823// iterator has advanced beyond the end of the collection.
15824func (iter OperationListResultIterator) Value() Operation {
15825	if !iter.page.NotDone() {
15826		return Operation{}
15827	}
15828	return iter.page.Values()[iter.i]
15829}
15830
15831// Creates a new instance of the OperationListResultIterator type.
15832func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
15833	return OperationListResultIterator{page: page}
15834}
15835
15836// IsEmpty returns true if the ListResult contains no values.
15837func (olr OperationListResult) IsEmpty() bool {
15838	return olr.Value == nil || len(*olr.Value) == 0
15839}
15840
15841// hasNextLink returns true if the NextLink is not empty.
15842func (olr OperationListResult) hasNextLink() bool {
15843	return olr.NextLink != nil && len(*olr.NextLink) != 0
15844}
15845
15846// operationListResultPreparer prepares a request to retrieve the next set of results.
15847// It returns nil if no more results exist.
15848func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
15849	if !olr.hasNextLink() {
15850		return nil, nil
15851	}
15852	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15853		autorest.AsJSON(),
15854		autorest.AsGet(),
15855		autorest.WithBaseURL(to.String(olr.NextLink)))
15856}
15857
15858// OperationListResultPage contains a page of Operation values.
15859type OperationListResultPage struct {
15860	fn  func(context.Context, OperationListResult) (OperationListResult, error)
15861	olr OperationListResult
15862}
15863
15864// NextWithContext advances to the next page of values.  If there was an error making
15865// the request the page does not advance and the error is returned.
15866func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
15867	if tracing.IsEnabled() {
15868		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
15869		defer func() {
15870			sc := -1
15871			if page.Response().Response.Response != nil {
15872				sc = page.Response().Response.Response.StatusCode
15873			}
15874			tracing.EndSpan(ctx, sc, err)
15875		}()
15876	}
15877	for {
15878		next, err := page.fn(ctx, page.olr)
15879		if err != nil {
15880			return err
15881		}
15882		page.olr = next
15883		if !next.hasNextLink() || !next.IsEmpty() {
15884			break
15885		}
15886	}
15887	return nil
15888}
15889
15890// Next advances to the next page of values.  If there was an error making
15891// the request the page does not advance and the error is returned.
15892// Deprecated: Use NextWithContext() instead.
15893func (page *OperationListResultPage) Next() error {
15894	return page.NextWithContext(context.Background())
15895}
15896
15897// NotDone returns true if the page enumeration should be started or is not yet complete.
15898func (page OperationListResultPage) NotDone() bool {
15899	return !page.olr.IsEmpty()
15900}
15901
15902// Response returns the raw server response from the last page request.
15903func (page OperationListResultPage) Response() OperationListResult {
15904	return page.olr
15905}
15906
15907// Values returns the slice of values for the current page or nil if there are no values.
15908func (page OperationListResultPage) Values() []Operation {
15909	if page.olr.IsEmpty() {
15910		return nil
15911	}
15912	return *page.olr.Value
15913}
15914
15915// Creates a new instance of the OperationListResultPage type.
15916func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
15917	return OperationListResultPage{
15918		fn:  getNextPage,
15919		olr: cur,
15920	}
15921}
15922
15923// PartnerInfo partner server information for the failover group.
15924type PartnerInfo struct {
15925	// ID - Resource identifier of the partner server.
15926	ID *string `json:"id,omitempty"`
15927	// Location - READ-ONLY; Geo location of the partner server.
15928	Location *string `json:"location,omitempty"`
15929	// ReplicationRole - READ-ONLY; Replication role of the partner server. Possible values include: 'Primary', 'Secondary'
15930	ReplicationRole FailoverGroupReplicationRole `json:"replicationRole,omitempty"`
15931}
15932
15933// MarshalJSON is the custom marshaler for PartnerInfo.
15934func (pi PartnerInfo) MarshalJSON() ([]byte, error) {
15935	objectMap := make(map[string]interface{})
15936	if pi.ID != nil {
15937		objectMap["id"] = pi.ID
15938	}
15939	return json.Marshal(objectMap)
15940}
15941
15942// PartnerRegionInfo partner region information for the failover group.
15943type PartnerRegionInfo struct {
15944	// Location - Geo location of the partner managed instances.
15945	Location *string `json:"location,omitempty"`
15946	// ReplicationRole - READ-ONLY; Replication role of the partner managed instances. Possible values include: 'InstanceFailoverGroupReplicationRolePrimary', 'InstanceFailoverGroupReplicationRoleSecondary'
15947	ReplicationRole InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty"`
15948}
15949
15950// MarshalJSON is the custom marshaler for PartnerRegionInfo.
15951func (pri PartnerRegionInfo) MarshalJSON() ([]byte, error) {
15952	objectMap := make(map[string]interface{})
15953	if pri.Location != nil {
15954		objectMap["location"] = pri.Location
15955	}
15956	return json.Marshal(objectMap)
15957}
15958
15959// PerformanceLevelCapability the performance level capability.
15960type PerformanceLevelCapability struct {
15961	// Value - READ-ONLY; Performance level value.
15962	Value *float64 `json:"value,omitempty"`
15963	// Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'DTU', 'VCores'
15964	Unit PerformanceLevelUnit `json:"unit,omitempty"`
15965}
15966
15967// MarshalJSON is the custom marshaler for PerformanceLevelCapability.
15968func (plc PerformanceLevelCapability) MarshalJSON() ([]byte, error) {
15969	objectMap := make(map[string]interface{})
15970	return json.Marshal(objectMap)
15971}
15972
15973// PrivateEndpointConnection a private endpoint connection
15974type PrivateEndpointConnection struct {
15975	autorest.Response `json:"-"`
15976	// PrivateEndpointConnectionProperties - Resource properties.
15977	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
15978	// ID - READ-ONLY; Resource ID.
15979	ID *string `json:"id,omitempty"`
15980	// Name - READ-ONLY; Resource name.
15981	Name *string `json:"name,omitempty"`
15982	// Type - READ-ONLY; Resource type.
15983	Type *string `json:"type,omitempty"`
15984}
15985
15986// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
15987func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
15988	objectMap := make(map[string]interface{})
15989	if pec.PrivateEndpointConnectionProperties != nil {
15990		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
15991	}
15992	return json.Marshal(objectMap)
15993}
15994
15995// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
15996func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
15997	var m map[string]*json.RawMessage
15998	err := json.Unmarshal(body, &m)
15999	if err != nil {
16000		return err
16001	}
16002	for k, v := range m {
16003		switch k {
16004		case "properties":
16005			if v != nil {
16006				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
16007				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
16008				if err != nil {
16009					return err
16010				}
16011				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
16012			}
16013		case "id":
16014			if v != nil {
16015				var ID string
16016				err = json.Unmarshal(*v, &ID)
16017				if err != nil {
16018					return err
16019				}
16020				pec.ID = &ID
16021			}
16022		case "name":
16023			if v != nil {
16024				var name string
16025				err = json.Unmarshal(*v, &name)
16026				if err != nil {
16027					return err
16028				}
16029				pec.Name = &name
16030			}
16031		case "type":
16032			if v != nil {
16033				var typeVar string
16034				err = json.Unmarshal(*v, &typeVar)
16035				if err != nil {
16036					return err
16037				}
16038				pec.Type = &typeVar
16039			}
16040		}
16041	}
16042
16043	return nil
16044}
16045
16046// PrivateEndpointConnectionListResult a list of private endpoint connections.
16047type PrivateEndpointConnectionListResult struct {
16048	autorest.Response `json:"-"`
16049	// Value - READ-ONLY; Array of results.
16050	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
16051	// NextLink - READ-ONLY; Link to retrieve next page of results.
16052	NextLink *string `json:"nextLink,omitempty"`
16053}
16054
16055// MarshalJSON is the custom marshaler for PrivateEndpointConnectionListResult.
16056func (peclr PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) {
16057	objectMap := make(map[string]interface{})
16058	return json.Marshal(objectMap)
16059}
16060
16061// PrivateEndpointConnectionListResultIterator provides access to a complete listing of
16062// PrivateEndpointConnection values.
16063type PrivateEndpointConnectionListResultIterator struct {
16064	i    int
16065	page PrivateEndpointConnectionListResultPage
16066}
16067
16068// NextWithContext advances to the next value.  If there was an error making
16069// the request the iterator does not advance and the error is returned.
16070func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
16071	if tracing.IsEnabled() {
16072		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext")
16073		defer func() {
16074			sc := -1
16075			if iter.Response().Response.Response != nil {
16076				sc = iter.Response().Response.Response.StatusCode
16077			}
16078			tracing.EndSpan(ctx, sc, err)
16079		}()
16080	}
16081	iter.i++
16082	if iter.i < len(iter.page.Values()) {
16083		return nil
16084	}
16085	err = iter.page.NextWithContext(ctx)
16086	if err != nil {
16087		iter.i--
16088		return err
16089	}
16090	iter.i = 0
16091	return nil
16092}
16093
16094// Next advances to the next value.  If there was an error making
16095// the request the iterator does not advance and the error is returned.
16096// Deprecated: Use NextWithContext() instead.
16097func (iter *PrivateEndpointConnectionListResultIterator) Next() error {
16098	return iter.NextWithContext(context.Background())
16099}
16100
16101// NotDone returns true if the enumeration should be started or is not yet complete.
16102func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool {
16103	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16104}
16105
16106// Response returns the raw server response from the last page request.
16107func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult {
16108	return iter.page.Response()
16109}
16110
16111// Value returns the current value or a zero-initialized value if the
16112// iterator has advanced beyond the end of the collection.
16113func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection {
16114	if !iter.page.NotDone() {
16115		return PrivateEndpointConnection{}
16116	}
16117	return iter.page.Values()[iter.i]
16118}
16119
16120// Creates a new instance of the PrivateEndpointConnectionListResultIterator type.
16121func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator {
16122	return PrivateEndpointConnectionListResultIterator{page: page}
16123}
16124
16125// IsEmpty returns true if the ListResult contains no values.
16126func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool {
16127	return peclr.Value == nil || len(*peclr.Value) == 0
16128}
16129
16130// hasNextLink returns true if the NextLink is not empty.
16131func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool {
16132	return peclr.NextLink != nil && len(*peclr.NextLink) != 0
16133}
16134
16135// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results.
16136// It returns nil if no more results exist.
16137func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
16138	if !peclr.hasNextLink() {
16139		return nil, nil
16140	}
16141	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16142		autorest.AsJSON(),
16143		autorest.AsGet(),
16144		autorest.WithBaseURL(to.String(peclr.NextLink)))
16145}
16146
16147// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values.
16148type PrivateEndpointConnectionListResultPage struct {
16149	fn    func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)
16150	peclr PrivateEndpointConnectionListResult
16151}
16152
16153// NextWithContext advances to the next page of values.  If there was an error making
16154// the request the page does not advance and the error is returned.
16155func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
16156	if tracing.IsEnabled() {
16157		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext")
16158		defer func() {
16159			sc := -1
16160			if page.Response().Response.Response != nil {
16161				sc = page.Response().Response.Response.StatusCode
16162			}
16163			tracing.EndSpan(ctx, sc, err)
16164		}()
16165	}
16166	for {
16167		next, err := page.fn(ctx, page.peclr)
16168		if err != nil {
16169			return err
16170		}
16171		page.peclr = next
16172		if !next.hasNextLink() || !next.IsEmpty() {
16173			break
16174		}
16175	}
16176	return nil
16177}
16178
16179// Next advances to the next page of values.  If there was an error making
16180// the request the page does not advance and the error is returned.
16181// Deprecated: Use NextWithContext() instead.
16182func (page *PrivateEndpointConnectionListResultPage) Next() error {
16183	return page.NextWithContext(context.Background())
16184}
16185
16186// NotDone returns true if the page enumeration should be started or is not yet complete.
16187func (page PrivateEndpointConnectionListResultPage) NotDone() bool {
16188	return !page.peclr.IsEmpty()
16189}
16190
16191// Response returns the raw server response from the last page request.
16192func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult {
16193	return page.peclr
16194}
16195
16196// Values returns the slice of values for the current page or nil if there are no values.
16197func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection {
16198	if page.peclr.IsEmpty() {
16199		return nil
16200	}
16201	return *page.peclr.Value
16202}
16203
16204// Creates a new instance of the PrivateEndpointConnectionListResultPage type.
16205func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage {
16206	return PrivateEndpointConnectionListResultPage{
16207		fn:    getNextPage,
16208		peclr: cur,
16209	}
16210}
16211
16212// PrivateEndpointConnectionProperties properties of a private endpoint connection.
16213type PrivateEndpointConnectionProperties struct {
16214	// PrivateEndpoint - Private endpoint which the connection belongs to.
16215	PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"`
16216	// PrivateLinkServiceConnectionState - Connection state of the private endpoint connection.
16217	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`
16218	// ProvisioningState - READ-ONLY; State of the private endpoint connection. Possible values include: 'PrivateEndpointProvisioningStateApproving', 'PrivateEndpointProvisioningStateReady', 'PrivateEndpointProvisioningStateDropping', 'PrivateEndpointProvisioningStateFailed', 'PrivateEndpointProvisioningStateRejecting'
16219	ProvisioningState PrivateEndpointProvisioningState `json:"provisioningState,omitempty"`
16220}
16221
16222// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties.
16223func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
16224	objectMap := make(map[string]interface{})
16225	if pecp.PrivateEndpoint != nil {
16226		objectMap["privateEndpoint"] = pecp.PrivateEndpoint
16227	}
16228	if pecp.PrivateLinkServiceConnectionState != nil {
16229		objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState
16230	}
16231	return json.Marshal(objectMap)
16232}
16233
16234// PrivateEndpointConnectionRequestStatus contains the private endpoint connection requests status.
16235type PrivateEndpointConnectionRequestStatus struct {
16236	// PrivateLinkServiceID - READ-ONLY; Resource id for which the private endpoint is created.
16237	PrivateLinkServiceID *string `json:"privateLinkServiceId,omitempty"`
16238	// PrivateEndpointConnectionName - READ-ONLY; The connection name for the private endpoint.
16239	PrivateEndpointConnectionName *string `json:"privateEndpointConnectionName,omitempty"`
16240	// Status - READ-ONLY; Status of this private endpoint connection.
16241	Status *string `json:"status,omitempty"`
16242}
16243
16244// MarshalJSON is the custom marshaler for PrivateEndpointConnectionRequestStatus.
16245func (pecrs PrivateEndpointConnectionRequestStatus) MarshalJSON() ([]byte, error) {
16246	objectMap := make(map[string]interface{})
16247	return json.Marshal(objectMap)
16248}
16249
16250// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
16251// of a long-running operation.
16252type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
16253	azure.FutureAPI
16254	// Result returns the result of the asynchronous operation.
16255	// If the operation has not completed it will return an error.
16256	Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
16257}
16258
16259// UnmarshalJSON is the custom unmarshaller for CreateFuture.
16260func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
16261	var azFuture azure.Future
16262	if err := json.Unmarshal(body, &azFuture); err != nil {
16263		return err
16264	}
16265	future.FutureAPI = &azFuture
16266	future.Result = future.result
16267	return nil
16268}
16269
16270// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result.
16271func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
16272	var done bool
16273	done, err = future.DoneWithContext(context.Background(), client)
16274	if err != nil {
16275		err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
16276		return
16277	}
16278	if !done {
16279		pec.Response.Response = future.Response()
16280		err = azure.NewAsyncOpIncompleteError("sql.PrivateEndpointConnectionsCreateOrUpdateFuture")
16281		return
16282	}
16283	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16284	if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
16285		pec, err = client.CreateOrUpdateResponder(pec.Response.Response)
16286		if err != nil {
16287			err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request")
16288		}
16289	}
16290	return
16291}
16292
16293// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
16294// long-running operation.
16295type PrivateEndpointConnectionsDeleteFuture struct {
16296	azure.FutureAPI
16297	// Result returns the result of the asynchronous operation.
16298	// If the operation has not completed it will return an error.
16299	Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
16300}
16301
16302// UnmarshalJSON is the custom unmarshaller for CreateFuture.
16303func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
16304	var azFuture azure.Future
16305	if err := json.Unmarshal(body, &azFuture); err != nil {
16306		return err
16307	}
16308	future.FutureAPI = &azFuture
16309	future.Result = future.result
16310	return nil
16311}
16312
16313// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result.
16314func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
16315	var done bool
16316	done, err = future.DoneWithContext(context.Background(), client)
16317	if err != nil {
16318		err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
16319		return
16320	}
16321	if !done {
16322		ar.Response = future.Response()
16323		err = azure.NewAsyncOpIncompleteError("sql.PrivateEndpointConnectionsDeleteFuture")
16324		return
16325	}
16326	ar.Response = future.Response()
16327	return
16328}
16329
16330// PrivateEndpointProperty ...
16331type PrivateEndpointProperty struct {
16332	// ID - Resource id of the private endpoint.
16333	ID *string `json:"id,omitempty"`
16334}
16335
16336// PrivateLinkResource a private link resource
16337type PrivateLinkResource struct {
16338	autorest.Response `json:"-"`
16339	// Properties - READ-ONLY; The private link resource group id.
16340	Properties *PrivateLinkResourceProperties `json:"properties,omitempty"`
16341	// ID - READ-ONLY; Resource ID.
16342	ID *string `json:"id,omitempty"`
16343	// Name - READ-ONLY; Resource name.
16344	Name *string `json:"name,omitempty"`
16345	// Type - READ-ONLY; Resource type.
16346	Type *string `json:"type,omitempty"`
16347}
16348
16349// MarshalJSON is the custom marshaler for PrivateLinkResource.
16350func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
16351	objectMap := make(map[string]interface{})
16352	return json.Marshal(objectMap)
16353}
16354
16355// PrivateLinkResourceListResult a list of private link resources
16356type PrivateLinkResourceListResult struct {
16357	autorest.Response `json:"-"`
16358	// Value - READ-ONLY; Array of results.
16359	Value *[]PrivateLinkResource `json:"value,omitempty"`
16360	// NextLink - READ-ONLY; Link to retrieve next page of results.
16361	NextLink *string `json:"nextLink,omitempty"`
16362}
16363
16364// MarshalJSON is the custom marshaler for PrivateLinkResourceListResult.
16365func (plrlr PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) {
16366	objectMap := make(map[string]interface{})
16367	return json.Marshal(objectMap)
16368}
16369
16370// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource
16371// values.
16372type PrivateLinkResourceListResultIterator struct {
16373	i    int
16374	page PrivateLinkResourceListResultPage
16375}
16376
16377// NextWithContext advances to the next value.  If there was an error making
16378// the request the iterator does not advance and the error is returned.
16379func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
16380	if tracing.IsEnabled() {
16381		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext")
16382		defer func() {
16383			sc := -1
16384			if iter.Response().Response.Response != nil {
16385				sc = iter.Response().Response.Response.StatusCode
16386			}
16387			tracing.EndSpan(ctx, sc, err)
16388		}()
16389	}
16390	iter.i++
16391	if iter.i < len(iter.page.Values()) {
16392		return nil
16393	}
16394	err = iter.page.NextWithContext(ctx)
16395	if err != nil {
16396		iter.i--
16397		return err
16398	}
16399	iter.i = 0
16400	return nil
16401}
16402
16403// Next advances to the next value.  If there was an error making
16404// the request the iterator does not advance and the error is returned.
16405// Deprecated: Use NextWithContext() instead.
16406func (iter *PrivateLinkResourceListResultIterator) Next() error {
16407	return iter.NextWithContext(context.Background())
16408}
16409
16410// NotDone returns true if the enumeration should be started or is not yet complete.
16411func (iter PrivateLinkResourceListResultIterator) NotDone() bool {
16412	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16413}
16414
16415// Response returns the raw server response from the last page request.
16416func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult {
16417	return iter.page.Response()
16418}
16419
16420// Value returns the current value or a zero-initialized value if the
16421// iterator has advanced beyond the end of the collection.
16422func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource {
16423	if !iter.page.NotDone() {
16424		return PrivateLinkResource{}
16425	}
16426	return iter.page.Values()[iter.i]
16427}
16428
16429// Creates a new instance of the PrivateLinkResourceListResultIterator type.
16430func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator {
16431	return PrivateLinkResourceListResultIterator{page: page}
16432}
16433
16434// IsEmpty returns true if the ListResult contains no values.
16435func (plrlr PrivateLinkResourceListResult) IsEmpty() bool {
16436	return plrlr.Value == nil || len(*plrlr.Value) == 0
16437}
16438
16439// hasNextLink returns true if the NextLink is not empty.
16440func (plrlr PrivateLinkResourceListResult) hasNextLink() bool {
16441	return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0
16442}
16443
16444// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results.
16445// It returns nil if no more results exist.
16446func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
16447	if !plrlr.hasNextLink() {
16448		return nil, nil
16449	}
16450	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16451		autorest.AsJSON(),
16452		autorest.AsGet(),
16453		autorest.WithBaseURL(to.String(plrlr.NextLink)))
16454}
16455
16456// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values.
16457type PrivateLinkResourceListResultPage struct {
16458	fn    func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)
16459	plrlr PrivateLinkResourceListResult
16460}
16461
16462// NextWithContext advances to the next page of values.  If there was an error making
16463// the request the page does not advance and the error is returned.
16464func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
16465	if tracing.IsEnabled() {
16466		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext")
16467		defer func() {
16468			sc := -1
16469			if page.Response().Response.Response != nil {
16470				sc = page.Response().Response.Response.StatusCode
16471			}
16472			tracing.EndSpan(ctx, sc, err)
16473		}()
16474	}
16475	for {
16476		next, err := page.fn(ctx, page.plrlr)
16477		if err != nil {
16478			return err
16479		}
16480		page.plrlr = next
16481		if !next.hasNextLink() || !next.IsEmpty() {
16482			break
16483		}
16484	}
16485	return nil
16486}
16487
16488// Next advances to the next page of values.  If there was an error making
16489// the request the page does not advance and the error is returned.
16490// Deprecated: Use NextWithContext() instead.
16491func (page *PrivateLinkResourceListResultPage) Next() error {
16492	return page.NextWithContext(context.Background())
16493}
16494
16495// NotDone returns true if the page enumeration should be started or is not yet complete.
16496func (page PrivateLinkResourceListResultPage) NotDone() bool {
16497	return !page.plrlr.IsEmpty()
16498}
16499
16500// Response returns the raw server response from the last page request.
16501func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult {
16502	return page.plrlr
16503}
16504
16505// Values returns the slice of values for the current page or nil if there are no values.
16506func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource {
16507	if page.plrlr.IsEmpty() {
16508		return nil
16509	}
16510	return *page.plrlr.Value
16511}
16512
16513// Creates a new instance of the PrivateLinkResourceListResultPage type.
16514func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage {
16515	return PrivateLinkResourceListResultPage{
16516		fn:    getNextPage,
16517		plrlr: cur,
16518	}
16519}
16520
16521// PrivateLinkResourceProperties properties of a private link resource.
16522type PrivateLinkResourceProperties struct {
16523	// GroupID - READ-ONLY; The private link resource group id.
16524	GroupID *string `json:"groupId,omitempty"`
16525	// RequiredMembers - READ-ONLY; The private link resource required member names.
16526	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
16527}
16528
16529// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
16530func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
16531	objectMap := make(map[string]interface{})
16532	return json.Marshal(objectMap)
16533}
16534
16535// PrivateLinkServiceConnectionStateProperty ...
16536type PrivateLinkServiceConnectionStateProperty struct {
16537	// Status - The private link service connection status. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected'
16538	Status PrivateLinkServiceConnectionStateStatus `json:"status,omitempty"`
16539	// Description - The private link service connection description.
16540	Description *string `json:"description,omitempty"`
16541	// ActionsRequired - READ-ONLY; The actions required for private link service connection. Possible values include: 'PrivateLinkServiceConnectionStateActionsRequireNone'
16542	ActionsRequired PrivateLinkServiceConnectionStateActionsRequire `json:"actionsRequired,omitempty"`
16543}
16544
16545// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty.
16546func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
16547	objectMap := make(map[string]interface{})
16548	if plscsp.Status != "" {
16549		objectMap["status"] = plscsp.Status
16550	}
16551	if plscsp.Description != nil {
16552		objectMap["description"] = plscsp.Description
16553	}
16554	return json.Marshal(objectMap)
16555}
16556
16557// ProxyResource ARM proxy resource.
16558type ProxyResource struct {
16559	// ID - READ-ONLY; Resource ID.
16560	ID *string `json:"id,omitempty"`
16561	// Name - READ-ONLY; Resource name.
16562	Name *string `json:"name,omitempty"`
16563	// Type - READ-ONLY; Resource type.
16564	Type *string `json:"type,omitempty"`
16565}
16566
16567// MarshalJSON is the custom marshaler for ProxyResource.
16568func (pr ProxyResource) MarshalJSON() ([]byte, error) {
16569	objectMap := make(map[string]interface{})
16570	return json.Marshal(objectMap)
16571}
16572
16573// QueryMetricInterval properties of a query metrics interval.
16574type QueryMetricInterval struct {
16575	// IntervalStartTime - READ-ONLY; The start time for the metric interval (ISO-8601 format).
16576	IntervalStartTime *string `json:"intervalStartTime,omitempty"`
16577	// IntervalType - READ-ONLY; Interval type (length). Possible values include: 'PT1H', 'P1D'
16578	IntervalType QueryTimeGrainType `json:"intervalType,omitempty"`
16579	// ExecutionCount - READ-ONLY; Execution count of a query in this interval.
16580	ExecutionCount *int64 `json:"executionCount,omitempty"`
16581	// Metrics - List of metric objects for this interval
16582	Metrics *[]QueryMetricProperties `json:"metrics,omitempty"`
16583}
16584
16585// MarshalJSON is the custom marshaler for QueryMetricInterval.
16586func (qmi QueryMetricInterval) MarshalJSON() ([]byte, error) {
16587	objectMap := make(map[string]interface{})
16588	if qmi.Metrics != nil {
16589		objectMap["metrics"] = qmi.Metrics
16590	}
16591	return json.Marshal(objectMap)
16592}
16593
16594// QueryMetricProperties properties of a topquery metric in one interval.
16595type QueryMetricProperties struct {
16596	// Name - READ-ONLY; The name information for the metric.
16597	Name *string `json:"name,omitempty"`
16598	// DisplayName - READ-ONLY; The UI appropriate name for the metric.
16599	DisplayName *string `json:"displayName,omitempty"`
16600	// Unit - READ-ONLY; The unit of the metric. Possible values include: 'Percentage', 'KB', 'Microseconds', 'Count'
16601	Unit QueryMetricUnitType `json:"unit,omitempty"`
16602	// Value - READ-ONLY; The value of the metric.
16603	Value *float64 `json:"value,omitempty"`
16604	// Min - READ-ONLY; Metric value when min() aggregate function is used over the interval.
16605	Min *float64 `json:"min,omitempty"`
16606	// Max - READ-ONLY; Metric value when max() aggregate function is used over the interval.
16607	Max *float64 `json:"max,omitempty"`
16608	// Avg - READ-ONLY; Metric value when avg() aggregate function is used over the interval.
16609	Avg *float64 `json:"avg,omitempty"`
16610	// Sum - READ-ONLY; Metric value when sum() aggregate function is used over the interval.
16611	Sum *float64 `json:"sum,omitempty"`
16612	// Stdev - READ-ONLY; Metric value when stdev aggregate function is used over the interval.
16613	Stdev *float64 `json:"stdev,omitempty"`
16614}
16615
16616// MarshalJSON is the custom marshaler for QueryMetricProperties.
16617func (qmp QueryMetricProperties) MarshalJSON() ([]byte, error) {
16618	objectMap := make(map[string]interface{})
16619	return json.Marshal(objectMap)
16620}
16621
16622// QueryStatisticsProperties properties of a query execution statistics.
16623type QueryStatisticsProperties struct {
16624	// DatabaseName - READ-ONLY; Database name of the database in which this query was executed.
16625	DatabaseName *string `json:"databaseName,omitempty"`
16626	// QueryID - READ-ONLY; Unique query id (unique within one database).
16627	QueryID *string `json:"queryId,omitempty"`
16628	// StartTime - READ-ONLY; The start time for the metric (ISO-8601 format).
16629	StartTime *string `json:"startTime,omitempty"`
16630	// EndTime - READ-ONLY; The end time for the metric (ISO-8601 format).
16631	EndTime *string `json:"endTime,omitempty"`
16632	// Intervals - List of intervals with appropriate metric data
16633	Intervals *[]QueryMetricInterval `json:"intervals,omitempty"`
16634}
16635
16636// MarshalJSON is the custom marshaler for QueryStatisticsProperties.
16637func (qsp QueryStatisticsProperties) MarshalJSON() ([]byte, error) {
16638	objectMap := make(map[string]interface{})
16639	if qsp.Intervals != nil {
16640		objectMap["intervals"] = qsp.Intervals
16641	}
16642	return json.Marshal(objectMap)
16643}
16644
16645// ReadScaleCapability the read scale capability.
16646type ReadScaleCapability struct {
16647	// MaxNumberOfReplicas - READ-ONLY; The maximum number of read scale replicas.
16648	MaxNumberOfReplicas *int32 `json:"maxNumberOfReplicas,omitempty"`
16649	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
16650	Status CapabilityStatus `json:"status,omitempty"`
16651	// Reason - The reason for the capability not being available.
16652	Reason *string `json:"reason,omitempty"`
16653}
16654
16655// MarshalJSON is the custom marshaler for ReadScaleCapability.
16656func (rsc ReadScaleCapability) MarshalJSON() ([]byte, error) {
16657	objectMap := make(map[string]interface{})
16658	if rsc.Reason != nil {
16659		objectMap["reason"] = rsc.Reason
16660	}
16661	return json.Marshal(objectMap)
16662}
16663
16664// RecommendedElasticPool represents a recommended elastic pool.
16665type RecommendedElasticPool struct {
16666	autorest.Response `json:"-"`
16667	// RecommendedElasticPoolProperties - The properties representing the resource.
16668	*RecommendedElasticPoolProperties `json:"properties,omitempty"`
16669	// ID - READ-ONLY; Resource ID.
16670	ID *string `json:"id,omitempty"`
16671	// Name - READ-ONLY; Resource name.
16672	Name *string `json:"name,omitempty"`
16673	// Type - READ-ONLY; Resource type.
16674	Type *string `json:"type,omitempty"`
16675}
16676
16677// MarshalJSON is the custom marshaler for RecommendedElasticPool.
16678func (rep RecommendedElasticPool) MarshalJSON() ([]byte, error) {
16679	objectMap := make(map[string]interface{})
16680	if rep.RecommendedElasticPoolProperties != nil {
16681		objectMap["properties"] = rep.RecommendedElasticPoolProperties
16682	}
16683	return json.Marshal(objectMap)
16684}
16685
16686// UnmarshalJSON is the custom unmarshaler for RecommendedElasticPool struct.
16687func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error {
16688	var m map[string]*json.RawMessage
16689	err := json.Unmarshal(body, &m)
16690	if err != nil {
16691		return err
16692	}
16693	for k, v := range m {
16694		switch k {
16695		case "properties":
16696			if v != nil {
16697				var recommendedElasticPoolProperties RecommendedElasticPoolProperties
16698				err = json.Unmarshal(*v, &recommendedElasticPoolProperties)
16699				if err != nil {
16700					return err
16701				}
16702				rep.RecommendedElasticPoolProperties = &recommendedElasticPoolProperties
16703			}
16704		case "id":
16705			if v != nil {
16706				var ID string
16707				err = json.Unmarshal(*v, &ID)
16708				if err != nil {
16709					return err
16710				}
16711				rep.ID = &ID
16712			}
16713		case "name":
16714			if v != nil {
16715				var name string
16716				err = json.Unmarshal(*v, &name)
16717				if err != nil {
16718					return err
16719				}
16720				rep.Name = &name
16721			}
16722		case "type":
16723			if v != nil {
16724				var typeVar string
16725				err = json.Unmarshal(*v, &typeVar)
16726				if err != nil {
16727					return err
16728				}
16729				rep.Type = &typeVar
16730			}
16731		}
16732	}
16733
16734	return nil
16735}
16736
16737// RecommendedElasticPoolListMetricsResult represents the response to a list recommended elastic pool
16738// metrics request.
16739type RecommendedElasticPoolListMetricsResult struct {
16740	autorest.Response `json:"-"`
16741	// Value - The list of recommended elastic pools metrics.
16742	Value *[]RecommendedElasticPoolMetric `json:"value,omitempty"`
16743}
16744
16745// RecommendedElasticPoolListResult represents the response to a list recommended elastic pool request.
16746type RecommendedElasticPoolListResult struct {
16747	autorest.Response `json:"-"`
16748	// Value - The list of recommended elastic pools hosted in the server.
16749	Value *[]RecommendedElasticPool `json:"value,omitempty"`
16750}
16751
16752// RecommendedElasticPoolMetric represents recommended elastic pool metric.
16753type RecommendedElasticPoolMetric struct {
16754	// DateTime - The time of metric (ISO8601 format).
16755	DateTime *date.Time `json:"dateTime,omitempty"`
16756	// Dtu - Gets or sets the DTUs (Database Transaction Units). See https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/
16757	Dtu *float64 `json:"dtu,omitempty"`
16758	// SizeGB - Gets or sets size in gigabytes.
16759	SizeGB *float64 `json:"sizeGB,omitempty"`
16760}
16761
16762// RecommendedElasticPoolProperties represents the properties of a recommended elastic pool.
16763type RecommendedElasticPoolProperties struct {
16764	// 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'
16765	DatabaseEdition ElasticPoolEdition `json:"databaseEdition,omitempty"`
16766	// Dtu - The DTU for the recommended elastic pool.
16767	Dtu *float64 `json:"dtu,omitempty"`
16768	// DatabaseDtuMin - The minimum DTU for the database.
16769	DatabaseDtuMin *float64 `json:"databaseDtuMin,omitempty"`
16770	// DatabaseDtuMax - The maximum DTU for the database.
16771	DatabaseDtuMax *float64 `json:"databaseDtuMax,omitempty"`
16772	// StorageMB - Gets storage size in megabytes.
16773	StorageMB *float64 `json:"storageMB,omitempty"`
16774	// ObservationPeriodStart - READ-ONLY; The observation period start (ISO8601 format).
16775	ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"`
16776	// ObservationPeriodEnd - READ-ONLY; The observation period start (ISO8601 format).
16777	ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"`
16778	// MaxObservedDtu - READ-ONLY; Gets maximum observed DTU.
16779	MaxObservedDtu *float64 `json:"maxObservedDtu,omitempty"`
16780	// MaxObservedStorageMB - READ-ONLY; Gets maximum observed storage in megabytes.
16781	MaxObservedStorageMB *float64 `json:"maxObservedStorageMB,omitempty"`
16782	// Databases - READ-ONLY; The list of databases in this pool. Expanded property
16783	Databases *[]TrackedResource `json:"databases,omitempty"`
16784	// Metrics - READ-ONLY; The list of databases housed in the server. Expanded property
16785	Metrics *[]RecommendedElasticPoolMetric `json:"metrics,omitempty"`
16786}
16787
16788// MarshalJSON is the custom marshaler for RecommendedElasticPoolProperties.
16789func (repp RecommendedElasticPoolProperties) MarshalJSON() ([]byte, error) {
16790	objectMap := make(map[string]interface{})
16791	if repp.Dtu != nil {
16792		objectMap["dtu"] = repp.Dtu
16793	}
16794	if repp.DatabaseDtuMin != nil {
16795		objectMap["databaseDtuMin"] = repp.DatabaseDtuMin
16796	}
16797	if repp.DatabaseDtuMax != nil {
16798		objectMap["databaseDtuMax"] = repp.DatabaseDtuMax
16799	}
16800	if repp.StorageMB != nil {
16801		objectMap["storageMB"] = repp.StorageMB
16802	}
16803	return json.Marshal(objectMap)
16804}
16805
16806// RecommendedIndex represents a database recommended index.
16807type RecommendedIndex struct {
16808	// RecommendedIndexProperties - READ-ONLY; The properties representing the resource.
16809	*RecommendedIndexProperties `json:"properties,omitempty"`
16810	// ID - READ-ONLY; Resource ID.
16811	ID *string `json:"id,omitempty"`
16812	// Name - READ-ONLY; Resource name.
16813	Name *string `json:"name,omitempty"`
16814	// Type - READ-ONLY; Resource type.
16815	Type *string `json:"type,omitempty"`
16816}
16817
16818// MarshalJSON is the custom marshaler for RecommendedIndex.
16819func (ri RecommendedIndex) MarshalJSON() ([]byte, error) {
16820	objectMap := make(map[string]interface{})
16821	return json.Marshal(objectMap)
16822}
16823
16824// UnmarshalJSON is the custom unmarshaler for RecommendedIndex struct.
16825func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error {
16826	var m map[string]*json.RawMessage
16827	err := json.Unmarshal(body, &m)
16828	if err != nil {
16829		return err
16830	}
16831	for k, v := range m {
16832		switch k {
16833		case "properties":
16834			if v != nil {
16835				var recommendedIndexProperties RecommendedIndexProperties
16836				err = json.Unmarshal(*v, &recommendedIndexProperties)
16837				if err != nil {
16838					return err
16839				}
16840				ri.RecommendedIndexProperties = &recommendedIndexProperties
16841			}
16842		case "id":
16843			if v != nil {
16844				var ID string
16845				err = json.Unmarshal(*v, &ID)
16846				if err != nil {
16847					return err
16848				}
16849				ri.ID = &ID
16850			}
16851		case "name":
16852			if v != nil {
16853				var name string
16854				err = json.Unmarshal(*v, &name)
16855				if err != nil {
16856					return err
16857				}
16858				ri.Name = &name
16859			}
16860		case "type":
16861			if v != nil {
16862				var typeVar string
16863				err = json.Unmarshal(*v, &typeVar)
16864				if err != nil {
16865					return err
16866				}
16867				ri.Type = &typeVar
16868			}
16869		}
16870	}
16871
16872	return nil
16873}
16874
16875// RecommendedIndexProperties represents the properties of a database recommended index.
16876type RecommendedIndexProperties struct {
16877	// 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'
16878	Action RecommendedIndexAction `json:"action,omitempty"`
16879	// State - READ-ONLY; The current recommendation state. Possible values include: 'RecommendedIndexStateActive', 'RecommendedIndexStatePending', 'RecommendedIndexStateExecuting', 'RecommendedIndexStateVerifying', 'RecommendedIndexStatePendingRevert', 'RecommendedIndexStateReverting', 'RecommendedIndexStateReverted', 'RecommendedIndexStateIgnored', 'RecommendedIndexStateExpired', 'RecommendedIndexStateBlocked', 'RecommendedIndexStateSuccess'
16880	State RecommendedIndexState `json:"state,omitempty"`
16881	// Created - READ-ONLY; The UTC datetime showing when this resource was created (ISO8601 format).
16882	Created *date.Time `json:"created,omitempty"`
16883	// LastModified - READ-ONLY; The UTC datetime of when was this resource last changed (ISO8601 format).
16884	LastModified *date.Time `json:"lastModified,omitempty"`
16885	// IndexType - READ-ONLY; The type of index (CLUSTERED, NONCLUSTERED, COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTEREDCOLUMNSTORE'
16886	IndexType RecommendedIndexType `json:"indexType,omitempty"`
16887	// Schema - READ-ONLY; The schema where table to build index over resides
16888	Schema *string `json:"schema,omitempty"`
16889	// Table - READ-ONLY; The table on which to build index.
16890	Table *string `json:"table,omitempty"`
16891	// Columns - READ-ONLY; Columns over which to build index
16892	Columns *[]string `json:"columns,omitempty"`
16893	// IncludedColumns - READ-ONLY; The list of column names to be included in the index
16894	IncludedColumns *[]string `json:"includedColumns,omitempty"`
16895	// IndexScript - READ-ONLY; The full build index script
16896	IndexScript *string `json:"indexScript,omitempty"`
16897	// EstimatedImpact - READ-ONLY; The estimated impact of doing recommended index action.
16898	EstimatedImpact *[]OperationImpact `json:"estimatedImpact,omitempty"`
16899	// ReportedImpact - READ-ONLY; The values reported after index action is complete.
16900	ReportedImpact *[]OperationImpact `json:"reportedImpact,omitempty"`
16901}
16902
16903// MarshalJSON is the custom marshaler for RecommendedIndexProperties.
16904func (rip RecommendedIndexProperties) MarshalJSON() ([]byte, error) {
16905	objectMap := make(map[string]interface{})
16906	return json.Marshal(objectMap)
16907}
16908
16909// RecoverableDatabase a recoverable database
16910type RecoverableDatabase struct {
16911	autorest.Response `json:"-"`
16912	// RecoverableDatabaseProperties - The properties of a recoverable database
16913	*RecoverableDatabaseProperties `json:"properties,omitempty"`
16914	// ID - READ-ONLY; Resource ID.
16915	ID *string `json:"id,omitempty"`
16916	// Name - READ-ONLY; Resource name.
16917	Name *string `json:"name,omitempty"`
16918	// Type - READ-ONLY; Resource type.
16919	Type *string `json:"type,omitempty"`
16920}
16921
16922// MarshalJSON is the custom marshaler for RecoverableDatabase.
16923func (rd RecoverableDatabase) MarshalJSON() ([]byte, error) {
16924	objectMap := make(map[string]interface{})
16925	if rd.RecoverableDatabaseProperties != nil {
16926		objectMap["properties"] = rd.RecoverableDatabaseProperties
16927	}
16928	return json.Marshal(objectMap)
16929}
16930
16931// UnmarshalJSON is the custom unmarshaler for RecoverableDatabase struct.
16932func (rd *RecoverableDatabase) UnmarshalJSON(body []byte) error {
16933	var m map[string]*json.RawMessage
16934	err := json.Unmarshal(body, &m)
16935	if err != nil {
16936		return err
16937	}
16938	for k, v := range m {
16939		switch k {
16940		case "properties":
16941			if v != nil {
16942				var recoverableDatabaseProperties RecoverableDatabaseProperties
16943				err = json.Unmarshal(*v, &recoverableDatabaseProperties)
16944				if err != nil {
16945					return err
16946				}
16947				rd.RecoverableDatabaseProperties = &recoverableDatabaseProperties
16948			}
16949		case "id":
16950			if v != nil {
16951				var ID string
16952				err = json.Unmarshal(*v, &ID)
16953				if err != nil {
16954					return err
16955				}
16956				rd.ID = &ID
16957			}
16958		case "name":
16959			if v != nil {
16960				var name string
16961				err = json.Unmarshal(*v, &name)
16962				if err != nil {
16963					return err
16964				}
16965				rd.Name = &name
16966			}
16967		case "type":
16968			if v != nil {
16969				var typeVar string
16970				err = json.Unmarshal(*v, &typeVar)
16971				if err != nil {
16972					return err
16973				}
16974				rd.Type = &typeVar
16975			}
16976		}
16977	}
16978
16979	return nil
16980}
16981
16982// RecoverableDatabaseListResult the response to a list recoverable databases request
16983type RecoverableDatabaseListResult struct {
16984	autorest.Response `json:"-"`
16985	// Value - A list of recoverable databases
16986	Value *[]RecoverableDatabase `json:"value,omitempty"`
16987}
16988
16989// RecoverableDatabaseProperties the properties of a recoverable database
16990type RecoverableDatabaseProperties struct {
16991	// Edition - READ-ONLY; The edition of the database
16992	Edition *string `json:"edition,omitempty"`
16993	// ServiceLevelObjective - READ-ONLY; The service level objective name of the database
16994	ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"`
16995	// ElasticPoolName - READ-ONLY; The elastic pool name of the database
16996	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
16997	// LastAvailableBackupDate - READ-ONLY; The last available backup date of the database (ISO8601 format)
16998	LastAvailableBackupDate *date.Time `json:"lastAvailableBackupDate,omitempty"`
16999}
17000
17001// MarshalJSON is the custom marshaler for RecoverableDatabaseProperties.
17002func (rdp RecoverableDatabaseProperties) MarshalJSON() ([]byte, error) {
17003	objectMap := make(map[string]interface{})
17004	return json.Marshal(objectMap)
17005}
17006
17007// RecoverableManagedDatabase a recoverable managed database resource.
17008type RecoverableManagedDatabase struct {
17009	autorest.Response `json:"-"`
17010	// RecoverableManagedDatabaseProperties - Resource properties.
17011	*RecoverableManagedDatabaseProperties `json:"properties,omitempty"`
17012	// ID - READ-ONLY; Resource ID.
17013	ID *string `json:"id,omitempty"`
17014	// Name - READ-ONLY; Resource name.
17015	Name *string `json:"name,omitempty"`
17016	// Type - READ-ONLY; Resource type.
17017	Type *string `json:"type,omitempty"`
17018}
17019
17020// MarshalJSON is the custom marshaler for RecoverableManagedDatabase.
17021func (rmd RecoverableManagedDatabase) MarshalJSON() ([]byte, error) {
17022	objectMap := make(map[string]interface{})
17023	if rmd.RecoverableManagedDatabaseProperties != nil {
17024		objectMap["properties"] = rmd.RecoverableManagedDatabaseProperties
17025	}
17026	return json.Marshal(objectMap)
17027}
17028
17029// UnmarshalJSON is the custom unmarshaler for RecoverableManagedDatabase struct.
17030func (rmd *RecoverableManagedDatabase) UnmarshalJSON(body []byte) error {
17031	var m map[string]*json.RawMessage
17032	err := json.Unmarshal(body, &m)
17033	if err != nil {
17034		return err
17035	}
17036	for k, v := range m {
17037		switch k {
17038		case "properties":
17039			if v != nil {
17040				var recoverableManagedDatabaseProperties RecoverableManagedDatabaseProperties
17041				err = json.Unmarshal(*v, &recoverableManagedDatabaseProperties)
17042				if err != nil {
17043					return err
17044				}
17045				rmd.RecoverableManagedDatabaseProperties = &recoverableManagedDatabaseProperties
17046			}
17047		case "id":
17048			if v != nil {
17049				var ID string
17050				err = json.Unmarshal(*v, &ID)
17051				if err != nil {
17052					return err
17053				}
17054				rmd.ID = &ID
17055			}
17056		case "name":
17057			if v != nil {
17058				var name string
17059				err = json.Unmarshal(*v, &name)
17060				if err != nil {
17061					return err
17062				}
17063				rmd.Name = &name
17064			}
17065		case "type":
17066			if v != nil {
17067				var typeVar string
17068				err = json.Unmarshal(*v, &typeVar)
17069				if err != nil {
17070					return err
17071				}
17072				rmd.Type = &typeVar
17073			}
17074		}
17075	}
17076
17077	return nil
17078}
17079
17080// RecoverableManagedDatabaseListResult a list of recoverable managed databases.
17081type RecoverableManagedDatabaseListResult struct {
17082	autorest.Response `json:"-"`
17083	// Value - READ-ONLY; Array of results.
17084	Value *[]RecoverableManagedDatabase `json:"value,omitempty"`
17085	// NextLink - READ-ONLY; Link to retrieve next page of results.
17086	NextLink *string `json:"nextLink,omitempty"`
17087}
17088
17089// MarshalJSON is the custom marshaler for RecoverableManagedDatabaseListResult.
17090func (rmdlr RecoverableManagedDatabaseListResult) MarshalJSON() ([]byte, error) {
17091	objectMap := make(map[string]interface{})
17092	return json.Marshal(objectMap)
17093}
17094
17095// RecoverableManagedDatabaseListResultIterator provides access to a complete listing of
17096// RecoverableManagedDatabase values.
17097type RecoverableManagedDatabaseListResultIterator struct {
17098	i    int
17099	page RecoverableManagedDatabaseListResultPage
17100}
17101
17102// NextWithContext advances to the next value.  If there was an error making
17103// the request the iterator does not advance and the error is returned.
17104func (iter *RecoverableManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
17105	if tracing.IsEnabled() {
17106		ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabaseListResultIterator.NextWithContext")
17107		defer func() {
17108			sc := -1
17109			if iter.Response().Response.Response != nil {
17110				sc = iter.Response().Response.Response.StatusCode
17111			}
17112			tracing.EndSpan(ctx, sc, err)
17113		}()
17114	}
17115	iter.i++
17116	if iter.i < len(iter.page.Values()) {
17117		return nil
17118	}
17119	err = iter.page.NextWithContext(ctx)
17120	if err != nil {
17121		iter.i--
17122		return err
17123	}
17124	iter.i = 0
17125	return nil
17126}
17127
17128// Next advances to the next value.  If there was an error making
17129// the request the iterator does not advance and the error is returned.
17130// Deprecated: Use NextWithContext() instead.
17131func (iter *RecoverableManagedDatabaseListResultIterator) Next() error {
17132	return iter.NextWithContext(context.Background())
17133}
17134
17135// NotDone returns true if the enumeration should be started or is not yet complete.
17136func (iter RecoverableManagedDatabaseListResultIterator) NotDone() bool {
17137	return iter.page.NotDone() && iter.i < len(iter.page.Values())
17138}
17139
17140// Response returns the raw server response from the last page request.
17141func (iter RecoverableManagedDatabaseListResultIterator) Response() RecoverableManagedDatabaseListResult {
17142	return iter.page.Response()
17143}
17144
17145// Value returns the current value or a zero-initialized value if the
17146// iterator has advanced beyond the end of the collection.
17147func (iter RecoverableManagedDatabaseListResultIterator) Value() RecoverableManagedDatabase {
17148	if !iter.page.NotDone() {
17149		return RecoverableManagedDatabase{}
17150	}
17151	return iter.page.Values()[iter.i]
17152}
17153
17154// Creates a new instance of the RecoverableManagedDatabaseListResultIterator type.
17155func NewRecoverableManagedDatabaseListResultIterator(page RecoverableManagedDatabaseListResultPage) RecoverableManagedDatabaseListResultIterator {
17156	return RecoverableManagedDatabaseListResultIterator{page: page}
17157}
17158
17159// IsEmpty returns true if the ListResult contains no values.
17160func (rmdlr RecoverableManagedDatabaseListResult) IsEmpty() bool {
17161	return rmdlr.Value == nil || len(*rmdlr.Value) == 0
17162}
17163
17164// hasNextLink returns true if the NextLink is not empty.
17165func (rmdlr RecoverableManagedDatabaseListResult) hasNextLink() bool {
17166	return rmdlr.NextLink != nil && len(*rmdlr.NextLink) != 0
17167}
17168
17169// recoverableManagedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
17170// It returns nil if no more results exist.
17171func (rmdlr RecoverableManagedDatabaseListResult) recoverableManagedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
17172	if !rmdlr.hasNextLink() {
17173		return nil, nil
17174	}
17175	return autorest.Prepare((&http.Request{}).WithContext(ctx),
17176		autorest.AsJSON(),
17177		autorest.AsGet(),
17178		autorest.WithBaseURL(to.String(rmdlr.NextLink)))
17179}
17180
17181// RecoverableManagedDatabaseListResultPage contains a page of RecoverableManagedDatabase values.
17182type RecoverableManagedDatabaseListResultPage struct {
17183	fn    func(context.Context, RecoverableManagedDatabaseListResult) (RecoverableManagedDatabaseListResult, error)
17184	rmdlr RecoverableManagedDatabaseListResult
17185}
17186
17187// NextWithContext advances to the next page of values.  If there was an error making
17188// the request the page does not advance and the error is returned.
17189func (page *RecoverableManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
17190	if tracing.IsEnabled() {
17191		ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabaseListResultPage.NextWithContext")
17192		defer func() {
17193			sc := -1
17194			if page.Response().Response.Response != nil {
17195				sc = page.Response().Response.Response.StatusCode
17196			}
17197			tracing.EndSpan(ctx, sc, err)
17198		}()
17199	}
17200	for {
17201		next, err := page.fn(ctx, page.rmdlr)
17202		if err != nil {
17203			return err
17204		}
17205		page.rmdlr = next
17206		if !next.hasNextLink() || !next.IsEmpty() {
17207			break
17208		}
17209	}
17210	return nil
17211}
17212
17213// Next advances to the next page of values.  If there was an error making
17214// the request the page does not advance and the error is returned.
17215// Deprecated: Use NextWithContext() instead.
17216func (page *RecoverableManagedDatabaseListResultPage) Next() error {
17217	return page.NextWithContext(context.Background())
17218}
17219
17220// NotDone returns true if the page enumeration should be started or is not yet complete.
17221func (page RecoverableManagedDatabaseListResultPage) NotDone() bool {
17222	return !page.rmdlr.IsEmpty()
17223}
17224
17225// Response returns the raw server response from the last page request.
17226func (page RecoverableManagedDatabaseListResultPage) Response() RecoverableManagedDatabaseListResult {
17227	return page.rmdlr
17228}
17229
17230// Values returns the slice of values for the current page or nil if there are no values.
17231func (page RecoverableManagedDatabaseListResultPage) Values() []RecoverableManagedDatabase {
17232	if page.rmdlr.IsEmpty() {
17233		return nil
17234	}
17235	return *page.rmdlr.Value
17236}
17237
17238// Creates a new instance of the RecoverableManagedDatabaseListResultPage type.
17239func NewRecoverableManagedDatabaseListResultPage(cur RecoverableManagedDatabaseListResult, getNextPage func(context.Context, RecoverableManagedDatabaseListResult) (RecoverableManagedDatabaseListResult, error)) RecoverableManagedDatabaseListResultPage {
17240	return RecoverableManagedDatabaseListResultPage{
17241		fn:    getNextPage,
17242		rmdlr: cur,
17243	}
17244}
17245
17246// RecoverableManagedDatabaseProperties the recoverable managed database's properties.
17247type RecoverableManagedDatabaseProperties struct {
17248	// LastAvailableBackupDate - READ-ONLY; The last available backup date.
17249	LastAvailableBackupDate *string `json:"lastAvailableBackupDate,omitempty"`
17250}
17251
17252// MarshalJSON is the custom marshaler for RecoverableManagedDatabaseProperties.
17253func (rmdp RecoverableManagedDatabaseProperties) MarshalJSON() ([]byte, error) {
17254	objectMap := make(map[string]interface{})
17255	return json.Marshal(objectMap)
17256}
17257
17258// ReplicationLink represents a database replication link.
17259type ReplicationLink struct {
17260	autorest.Response `json:"-"`
17261	// Location - READ-ONLY; Location of the server that contains this firewall rule.
17262	Location *string `json:"location,omitempty"`
17263	// ReplicationLinkProperties - The properties representing the resource.
17264	*ReplicationLinkProperties `json:"properties,omitempty"`
17265	// ID - READ-ONLY; Resource ID.
17266	ID *string `json:"id,omitempty"`
17267	// Name - READ-ONLY; Resource name.
17268	Name *string `json:"name,omitempty"`
17269	// Type - READ-ONLY; Resource type.
17270	Type *string `json:"type,omitempty"`
17271}
17272
17273// MarshalJSON is the custom marshaler for ReplicationLink.
17274func (rl ReplicationLink) MarshalJSON() ([]byte, error) {
17275	objectMap := make(map[string]interface{})
17276	if rl.ReplicationLinkProperties != nil {
17277		objectMap["properties"] = rl.ReplicationLinkProperties
17278	}
17279	return json.Marshal(objectMap)
17280}
17281
17282// UnmarshalJSON is the custom unmarshaler for ReplicationLink struct.
17283func (rl *ReplicationLink) UnmarshalJSON(body []byte) error {
17284	var m map[string]*json.RawMessage
17285	err := json.Unmarshal(body, &m)
17286	if err != nil {
17287		return err
17288	}
17289	for k, v := range m {
17290		switch k {
17291		case "location":
17292			if v != nil {
17293				var location string
17294				err = json.Unmarshal(*v, &location)
17295				if err != nil {
17296					return err
17297				}
17298				rl.Location = &location
17299			}
17300		case "properties":
17301			if v != nil {
17302				var replicationLinkProperties ReplicationLinkProperties
17303				err = json.Unmarshal(*v, &replicationLinkProperties)
17304				if err != nil {
17305					return err
17306				}
17307				rl.ReplicationLinkProperties = &replicationLinkProperties
17308			}
17309		case "id":
17310			if v != nil {
17311				var ID string
17312				err = json.Unmarshal(*v, &ID)
17313				if err != nil {
17314					return err
17315				}
17316				rl.ID = &ID
17317			}
17318		case "name":
17319			if v != nil {
17320				var name string
17321				err = json.Unmarshal(*v, &name)
17322				if err != nil {
17323					return err
17324				}
17325				rl.Name = &name
17326			}
17327		case "type":
17328			if v != nil {
17329				var typeVar string
17330				err = json.Unmarshal(*v, &typeVar)
17331				if err != nil {
17332					return err
17333				}
17334				rl.Type = &typeVar
17335			}
17336		}
17337	}
17338
17339	return nil
17340}
17341
17342// ReplicationLinkListResult represents the response to a List database replication link request.
17343type ReplicationLinkListResult struct {
17344	autorest.Response `json:"-"`
17345	// Value - The list of database replication links housed in the database.
17346	Value *[]ReplicationLink `json:"value,omitempty"`
17347}
17348
17349// ReplicationLinkProperties represents the properties of a database replication link.
17350type ReplicationLinkProperties struct {
17351	// IsTerminationAllowed - READ-ONLY; Legacy value indicating whether termination is allowed.  Currently always returns true.
17352	IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty"`
17353	// ReplicationMode - READ-ONLY; Replication mode of this replication link.
17354	ReplicationMode *string `json:"replicationMode,omitempty"`
17355	// PartnerServer - READ-ONLY; The name of the server hosting the partner database.
17356	PartnerServer *string `json:"partnerServer,omitempty"`
17357	// PartnerDatabase - READ-ONLY; The name of the partner database.
17358	PartnerDatabase *string `json:"partnerDatabase,omitempty"`
17359	// PartnerLocation - READ-ONLY; The Azure Region of the partner database.
17360	PartnerLocation *string `json:"partnerLocation,omitempty"`
17361	// Role - READ-ONLY; The role of the database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy'
17362	Role ReplicationRole `json:"role,omitempty"`
17363	// PartnerRole - READ-ONLY; The role of the partner database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy'
17364	PartnerRole ReplicationRole `json:"partnerRole,omitempty"`
17365	// StartTime - READ-ONLY; The start time for the replication link.
17366	StartTime *date.Time `json:"startTime,omitempty"`
17367	// PercentComplete - READ-ONLY; The percentage of seeding complete for the replication link.
17368	PercentComplete *int32 `json:"percentComplete,omitempty"`
17369	// ReplicationState - READ-ONLY; The replication state for the replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCHUP', 'SUSPENDED'
17370	ReplicationState ReplicationState `json:"replicationState,omitempty"`
17371}
17372
17373// MarshalJSON is the custom marshaler for ReplicationLinkProperties.
17374func (rlp ReplicationLinkProperties) MarshalJSON() ([]byte, error) {
17375	objectMap := make(map[string]interface{})
17376	return json.Marshal(objectMap)
17377}
17378
17379// ReplicationLinksFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results of
17380// a long-running operation.
17381type ReplicationLinksFailoverAllowDataLossFuture struct {
17382	azure.FutureAPI
17383	// Result returns the result of the asynchronous operation.
17384	// If the operation has not completed it will return an error.
17385	Result func(ReplicationLinksClient) (autorest.Response, error)
17386}
17387
17388// UnmarshalJSON is the custom unmarshaller for CreateFuture.
17389func (future *ReplicationLinksFailoverAllowDataLossFuture) UnmarshalJSON(body []byte) error {
17390	var azFuture azure.Future
17391	if err := json.Unmarshal(body, &azFuture); err != nil {
17392		return err
17393	}
17394	future.FutureAPI = &azFuture
17395	future.Result = future.result
17396	return nil
17397}
17398
17399// result is the default implementation for ReplicationLinksFailoverAllowDataLossFuture.Result.
17400func (future *ReplicationLinksFailoverAllowDataLossFuture) result(client ReplicationLinksClient) (ar autorest.Response, err error) {
17401	var done bool
17402	done, err = future.DoneWithContext(context.Background(), client)
17403	if err != nil {
17404		err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure")
17405		return
17406	}
17407	if !done {
17408		ar.Response = future.Response()
17409		err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverAllowDataLossFuture")
17410		return
17411	}
17412	ar.Response = future.Response()
17413	return
17414}
17415
17416// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a
17417// long-running operation.
17418type ReplicationLinksFailoverFuture struct {
17419	azure.FutureAPI
17420	// Result returns the result of the asynchronous operation.
17421	// If the operation has not completed it will return an error.
17422	Result func(ReplicationLinksClient) (autorest.Response, error)
17423}
17424
17425// UnmarshalJSON is the custom unmarshaller for CreateFuture.
17426func (future *ReplicationLinksFailoverFuture) UnmarshalJSON(body []byte) error {
17427	var azFuture azure.Future
17428	if err := json.Unmarshal(body, &azFuture); err != nil {
17429		return err
17430	}
17431	future.FutureAPI = &azFuture
17432	future.Result = future.result
17433	return nil
17434}
17435
17436// result is the default implementation for ReplicationLinksFailoverFuture.Result.
17437func (future *ReplicationLinksFailoverFuture) result(client ReplicationLinksClient) (ar autorest.Response, err error) {
17438	var done bool
17439	done, err = future.DoneWithContext(context.Background(), client)
17440	if err != nil {
17441		err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", future.Response(), "Polling failure")
17442		return
17443	}
17444	if !done {
17445		ar.Response = future.Response()
17446		err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverFuture")
17447		return
17448	}
17449	ar.Response = future.Response()
17450	return
17451}
17452
17453// ReplicationLinksUnlinkFuture an abstraction for monitoring and retrieving the results of a long-running
17454// operation.
17455type ReplicationLinksUnlinkFuture struct {
17456	azure.FutureAPI
17457	// Result returns the result of the asynchronous operation.
17458	// If the operation has not completed it will return an error.
17459	Result func(ReplicationLinksClient) (autorest.Response, error)
17460}
17461
17462// UnmarshalJSON is the custom unmarshaller for CreateFuture.
17463func (future *ReplicationLinksUnlinkFuture) UnmarshalJSON(body []byte) error {
17464	var azFuture azure.Future
17465	if err := json.Unmarshal(body, &azFuture); err != nil {
17466		return err
17467	}
17468	future.FutureAPI = &azFuture
17469	future.Result = future.result
17470	return nil
17471}
17472
17473// result is the default implementation for ReplicationLinksUnlinkFuture.Result.
17474func (future *ReplicationLinksUnlinkFuture) result(client ReplicationLinksClient) (ar autorest.Response, err error) {
17475	var done bool
17476	done, err = future.DoneWithContext(context.Background(), client)
17477	if err != nil {
17478		err = autorest.NewErrorWithError(err, "sql.ReplicationLinksUnlinkFuture", "Result", future.Response(), "Polling failure")
17479		return
17480	}
17481	if !done {
17482		ar.Response = future.Response()
17483		err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksUnlinkFuture")
17484		return
17485	}
17486	ar.Response = future.Response()
17487	return
17488}
17489
17490// Resource ARM resource.
17491type Resource struct {
17492	// ID - READ-ONLY; Resource ID.
17493	ID *string `json:"id,omitempty"`
17494	// Name - READ-ONLY; Resource name.
17495	Name *string `json:"name,omitempty"`
17496	// Type - READ-ONLY; Resource type.
17497	Type *string `json:"type,omitempty"`
17498}
17499
17500// MarshalJSON is the custom marshaler for Resource.
17501func (r Resource) MarshalJSON() ([]byte, error) {
17502	objectMap := make(map[string]interface{})
17503	return json.Marshal(objectMap)
17504}
17505
17506// ResourceIdentity azure Active Directory identity configuration for a resource.
17507type ResourceIdentity struct {
17508	// PrincipalID - READ-ONLY; The Azure Active Directory principal id.
17509	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
17510	// 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: 'None', 'SystemAssigned', 'UserAssigned'
17511	Type IdentityType `json:"type,omitempty"`
17512	// TenantID - READ-ONLY; The Azure Active Directory tenant id.
17513	TenantID *uuid.UUID `json:"tenantId,omitempty"`
17514}
17515
17516// MarshalJSON is the custom marshaler for ResourceIdentity.
17517func (ri ResourceIdentity) MarshalJSON() ([]byte, error) {
17518	objectMap := make(map[string]interface{})
17519	if ri.Type != "" {
17520		objectMap["type"] = ri.Type
17521	}
17522	return json.Marshal(objectMap)
17523}
17524
17525// ResourceMoveDefinition contains the information necessary to perform a resource move (rename).
17526type ResourceMoveDefinition struct {
17527	// ID - The target ID for the resource
17528	ID *string `json:"id,omitempty"`
17529}
17530
17531// RestorableDroppedDatabase a restorable dropped database
17532type RestorableDroppedDatabase struct {
17533	autorest.Response `json:"-"`
17534	// Location - READ-ONLY; The geo-location where the resource lives
17535	Location *string `json:"location,omitempty"`
17536	// RestorableDroppedDatabaseProperties - The properties of a restorable dropped database
17537	*RestorableDroppedDatabaseProperties `json:"properties,omitempty"`
17538	// ID - READ-ONLY; Resource ID.
17539	ID *string `json:"id,omitempty"`
17540	// Name - READ-ONLY; Resource name.
17541	Name *string `json:"name,omitempty"`
17542	// Type - READ-ONLY; Resource type.
17543	Type *string `json:"type,omitempty"`
17544}
17545
17546// MarshalJSON is the custom marshaler for RestorableDroppedDatabase.
17547func (rdd RestorableDroppedDatabase) MarshalJSON() ([]byte, error) {
17548	objectMap := make(map[string]interface{})
17549	if rdd.RestorableDroppedDatabaseProperties != nil {
17550		objectMap["properties"] = rdd.RestorableDroppedDatabaseProperties
17551	}
17552	return json.Marshal(objectMap)
17553}
17554
17555// UnmarshalJSON is the custom unmarshaler for RestorableDroppedDatabase struct.
17556func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error {
17557	var m map[string]*json.RawMessage
17558	err := json.Unmarshal(body, &m)
17559	if err != nil {
17560		return err
17561	}
17562	for k, v := range m {
17563		switch k {
17564		case "location":
17565			if v != nil {
17566				var location string
17567				err = json.Unmarshal(*v, &location)
17568				if err != nil {
17569					return err
17570				}
17571				rdd.Location = &location
17572			}
17573		case "properties":
17574			if v != nil {
17575				var restorableDroppedDatabaseProperties RestorableDroppedDatabaseProperties
17576				err = json.Unmarshal(*v, &restorableDroppedDatabaseProperties)
17577				if err != nil {
17578					return err
17579				}
17580				rdd.RestorableDroppedDatabaseProperties = &restorableDroppedDatabaseProperties
17581			}
17582		case "id":
17583			if v != nil {
17584				var ID string
17585				err = json.Unmarshal(*v, &ID)
17586				if err != nil {
17587					return err
17588				}
17589				rdd.ID = &ID
17590			}
17591		case "name":
17592			if v != nil {
17593				var name string
17594				err = json.Unmarshal(*v, &name)
17595				if err != nil {
17596					return err
17597				}
17598				rdd.Name = &name
17599			}
17600		case "type":
17601			if v != nil {
17602				var typeVar string
17603				err = json.Unmarshal(*v, &typeVar)
17604				if err != nil {
17605					return err
17606				}
17607				rdd.Type = &typeVar
17608			}
17609		}
17610	}
17611
17612	return nil
17613}
17614
17615// RestorableDroppedDatabaseListResult the response to a list restorable dropped databases request
17616type RestorableDroppedDatabaseListResult struct {
17617	autorest.Response `json:"-"`
17618	// Value - A list of restorable dropped databases
17619	Value *[]RestorableDroppedDatabase `json:"value,omitempty"`
17620}
17621
17622// RestorableDroppedDatabaseProperties the properties of a restorable dropped database
17623type RestorableDroppedDatabaseProperties struct {
17624	// DatabaseName - READ-ONLY; The name of the database
17625	DatabaseName *string `json:"databaseName,omitempty"`
17626	// Edition - READ-ONLY; The edition of the database
17627	Edition *string `json:"edition,omitempty"`
17628	// MaxSizeBytes - READ-ONLY; The max size in bytes of the database
17629	MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`
17630	// ServiceLevelObjective - READ-ONLY; The service level objective name of the database
17631	ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"`
17632	// ElasticPoolName - READ-ONLY; The elastic pool name of the database
17633	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
17634	// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format)
17635	CreationDate *date.Time `json:"creationDate,omitempty"`
17636	// DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format)
17637	DeletionDate *date.Time `json:"deletionDate,omitempty"`
17638	// EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format)
17639	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
17640}
17641
17642// MarshalJSON is the custom marshaler for RestorableDroppedDatabaseProperties.
17643func (rddp RestorableDroppedDatabaseProperties) MarshalJSON() ([]byte, error) {
17644	objectMap := make(map[string]interface{})
17645	return json.Marshal(objectMap)
17646}
17647
17648// RestorableDroppedManagedDatabase a restorable dropped managed database resource.
17649type RestorableDroppedManagedDatabase struct {
17650	autorest.Response `json:"-"`
17651	// RestorableDroppedManagedDatabaseProperties - Resource properties.
17652	*RestorableDroppedManagedDatabaseProperties `json:"properties,omitempty"`
17653	// Location - Resource location.
17654	Location *string `json:"location,omitempty"`
17655	// Tags - Resource tags.
17656	Tags map[string]*string `json:"tags"`
17657	// ID - READ-ONLY; Resource ID.
17658	ID *string `json:"id,omitempty"`
17659	// Name - READ-ONLY; Resource name.
17660	Name *string `json:"name,omitempty"`
17661	// Type - READ-ONLY; Resource type.
17662	Type *string `json:"type,omitempty"`
17663}
17664
17665// MarshalJSON is the custom marshaler for RestorableDroppedManagedDatabase.
17666func (rdmd RestorableDroppedManagedDatabase) MarshalJSON() ([]byte, error) {
17667	objectMap := make(map[string]interface{})
17668	if rdmd.RestorableDroppedManagedDatabaseProperties != nil {
17669		objectMap["properties"] = rdmd.RestorableDroppedManagedDatabaseProperties
17670	}
17671	if rdmd.Location != nil {
17672		objectMap["location"] = rdmd.Location
17673	}
17674	if rdmd.Tags != nil {
17675		objectMap["tags"] = rdmd.Tags
17676	}
17677	return json.Marshal(objectMap)
17678}
17679
17680// UnmarshalJSON is the custom unmarshaler for RestorableDroppedManagedDatabase struct.
17681func (rdmd *RestorableDroppedManagedDatabase) UnmarshalJSON(body []byte) error {
17682	var m map[string]*json.RawMessage
17683	err := json.Unmarshal(body, &m)
17684	if err != nil {
17685		return err
17686	}
17687	for k, v := range m {
17688		switch k {
17689		case "properties":
17690			if v != nil {
17691				var restorableDroppedManagedDatabaseProperties RestorableDroppedManagedDatabaseProperties
17692				err = json.Unmarshal(*v, &restorableDroppedManagedDatabaseProperties)
17693				if err != nil {
17694					return err
17695				}
17696				rdmd.RestorableDroppedManagedDatabaseProperties = &restorableDroppedManagedDatabaseProperties
17697			}
17698		case "location":
17699			if v != nil {
17700				var location string
17701				err = json.Unmarshal(*v, &location)
17702				if err != nil {
17703					return err
17704				}
17705				rdmd.Location = &location
17706			}
17707		case "tags":
17708			if v != nil {
17709				var tags map[string]*string
17710				err = json.Unmarshal(*v, &tags)
17711				if err != nil {
17712					return err
17713				}
17714				rdmd.Tags = tags
17715			}
17716		case "id":
17717			if v != nil {
17718				var ID string
17719				err = json.Unmarshal(*v, &ID)
17720				if err != nil {
17721					return err
17722				}
17723				rdmd.ID = &ID
17724			}
17725		case "name":
17726			if v != nil {
17727				var name string
17728				err = json.Unmarshal(*v, &name)
17729				if err != nil {
17730					return err
17731				}
17732				rdmd.Name = &name
17733			}
17734		case "type":
17735			if v != nil {
17736				var typeVar string
17737				err = json.Unmarshal(*v, &typeVar)
17738				if err != nil {
17739					return err
17740				}
17741				rdmd.Type = &typeVar
17742			}
17743		}
17744	}
17745
17746	return nil
17747}
17748
17749// RestorableDroppedManagedDatabaseListResult a list of restorable dropped managed databases.
17750type RestorableDroppedManagedDatabaseListResult struct {
17751	autorest.Response `json:"-"`
17752	// Value - READ-ONLY; Array of results.
17753	Value *[]RestorableDroppedManagedDatabase `json:"value,omitempty"`
17754	// NextLink - READ-ONLY; Link to retrieve next page of results.
17755	NextLink *string `json:"nextLink,omitempty"`
17756}
17757
17758// MarshalJSON is the custom marshaler for RestorableDroppedManagedDatabaseListResult.
17759func (rdmdlr RestorableDroppedManagedDatabaseListResult) MarshalJSON() ([]byte, error) {
17760	objectMap := make(map[string]interface{})
17761	return json.Marshal(objectMap)
17762}
17763
17764// RestorableDroppedManagedDatabaseListResultIterator provides access to a complete listing of
17765// RestorableDroppedManagedDatabase values.
17766type RestorableDroppedManagedDatabaseListResultIterator struct {
17767	i    int
17768	page RestorableDroppedManagedDatabaseListResultPage
17769}
17770
17771// NextWithContext advances to the next value.  If there was an error making
17772// the request the iterator does not advance and the error is returned.
17773func (iter *RestorableDroppedManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
17774	if tracing.IsEnabled() {
17775		ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabaseListResultIterator.NextWithContext")
17776		defer func() {
17777			sc := -1
17778			if iter.Response().Response.Response != nil {
17779				sc = iter.Response().Response.Response.StatusCode
17780			}
17781			tracing.EndSpan(ctx, sc, err)
17782		}()
17783	}
17784	iter.i++
17785	if iter.i < len(iter.page.Values()) {
17786		return nil
17787	}
17788	err = iter.page.NextWithContext(ctx)
17789	if err != nil {
17790		iter.i--
17791		return err
17792	}
17793	iter.i = 0
17794	return nil
17795}
17796
17797// Next advances to the next value.  If there was an error making
17798// the request the iterator does not advance and the error is returned.
17799// Deprecated: Use NextWithContext() instead.
17800func (iter *RestorableDroppedManagedDatabaseListResultIterator) Next() error {
17801	return iter.NextWithContext(context.Background())
17802}
17803
17804// NotDone returns true if the enumeration should be started or is not yet complete.
17805func (iter RestorableDroppedManagedDatabaseListResultIterator) NotDone() bool {
17806	return iter.page.NotDone() && iter.i < len(iter.page.Values())
17807}
17808
17809// Response returns the raw server response from the last page request.
17810func (iter RestorableDroppedManagedDatabaseListResultIterator) Response() RestorableDroppedManagedDatabaseListResult {
17811	return iter.page.Response()
17812}
17813
17814// Value returns the current value or a zero-initialized value if the
17815// iterator has advanced beyond the end of the collection.
17816func (iter RestorableDroppedManagedDatabaseListResultIterator) Value() RestorableDroppedManagedDatabase {
17817	if !iter.page.NotDone() {
17818		return RestorableDroppedManagedDatabase{}
17819	}
17820	return iter.page.Values()[iter.i]
17821}
17822
17823// Creates a new instance of the RestorableDroppedManagedDatabaseListResultIterator type.
17824func NewRestorableDroppedManagedDatabaseListResultIterator(page RestorableDroppedManagedDatabaseListResultPage) RestorableDroppedManagedDatabaseListResultIterator {
17825	return RestorableDroppedManagedDatabaseListResultIterator{page: page}
17826}
17827
17828// IsEmpty returns true if the ListResult contains no values.
17829func (rdmdlr RestorableDroppedManagedDatabaseListResult) IsEmpty() bool {
17830	return rdmdlr.Value == nil || len(*rdmdlr.Value) == 0
17831}
17832
17833// hasNextLink returns true if the NextLink is not empty.
17834func (rdmdlr RestorableDroppedManagedDatabaseListResult) hasNextLink() bool {
17835	return rdmdlr.NextLink != nil && len(*rdmdlr.NextLink) != 0
17836}
17837
17838// restorableDroppedManagedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
17839// It returns nil if no more results exist.
17840func (rdmdlr RestorableDroppedManagedDatabaseListResult) restorableDroppedManagedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
17841	if !rdmdlr.hasNextLink() {
17842		return nil, nil
17843	}
17844	return autorest.Prepare((&http.Request{}).WithContext(ctx),
17845		autorest.AsJSON(),
17846		autorest.AsGet(),
17847		autorest.WithBaseURL(to.String(rdmdlr.NextLink)))
17848}
17849
17850// RestorableDroppedManagedDatabaseListResultPage contains a page of RestorableDroppedManagedDatabase
17851// values.
17852type RestorableDroppedManagedDatabaseListResultPage struct {
17853	fn     func(context.Context, RestorableDroppedManagedDatabaseListResult) (RestorableDroppedManagedDatabaseListResult, error)
17854	rdmdlr RestorableDroppedManagedDatabaseListResult
17855}
17856
17857// NextWithContext advances to the next page of values.  If there was an error making
17858// the request the page does not advance and the error is returned.
17859func (page *RestorableDroppedManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
17860	if tracing.IsEnabled() {
17861		ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabaseListResultPage.NextWithContext")
17862		defer func() {
17863			sc := -1
17864			if page.Response().Response.Response != nil {
17865				sc = page.Response().Response.Response.StatusCode
17866			}
17867			tracing.EndSpan(ctx, sc, err)
17868		}()
17869	}
17870	for {
17871		next, err := page.fn(ctx, page.rdmdlr)
17872		if err != nil {
17873			return err
17874		}
17875		page.rdmdlr = next
17876		if !next.hasNextLink() || !next.IsEmpty() {
17877			break
17878		}
17879	}
17880	return nil
17881}
17882
17883// Next advances to the next page of values.  If there was an error making
17884// the request the page does not advance and the error is returned.
17885// Deprecated: Use NextWithContext() instead.
17886func (page *RestorableDroppedManagedDatabaseListResultPage) Next() error {
17887	return page.NextWithContext(context.Background())
17888}
17889
17890// NotDone returns true if the page enumeration should be started or is not yet complete.
17891func (page RestorableDroppedManagedDatabaseListResultPage) NotDone() bool {
17892	return !page.rdmdlr.IsEmpty()
17893}
17894
17895// Response returns the raw server response from the last page request.
17896func (page RestorableDroppedManagedDatabaseListResultPage) Response() RestorableDroppedManagedDatabaseListResult {
17897	return page.rdmdlr
17898}
17899
17900// Values returns the slice of values for the current page or nil if there are no values.
17901func (page RestorableDroppedManagedDatabaseListResultPage) Values() []RestorableDroppedManagedDatabase {
17902	if page.rdmdlr.IsEmpty() {
17903		return nil
17904	}
17905	return *page.rdmdlr.Value
17906}
17907
17908// Creates a new instance of the RestorableDroppedManagedDatabaseListResultPage type.
17909func NewRestorableDroppedManagedDatabaseListResultPage(cur RestorableDroppedManagedDatabaseListResult, getNextPage func(context.Context, RestorableDroppedManagedDatabaseListResult) (RestorableDroppedManagedDatabaseListResult, error)) RestorableDroppedManagedDatabaseListResultPage {
17910	return RestorableDroppedManagedDatabaseListResultPage{
17911		fn:     getNextPage,
17912		rdmdlr: cur,
17913	}
17914}
17915
17916// RestorableDroppedManagedDatabaseProperties the restorable dropped managed database's properties.
17917type RestorableDroppedManagedDatabaseProperties struct {
17918	// DatabaseName - READ-ONLY; The name of the database.
17919	DatabaseName *string `json:"databaseName,omitempty"`
17920	// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format).
17921	CreationDate *date.Time `json:"creationDate,omitempty"`
17922	// DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format).
17923	DeletionDate *date.Time `json:"deletionDate,omitempty"`
17924	// EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format).
17925	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
17926}
17927
17928// MarshalJSON is the custom marshaler for RestorableDroppedManagedDatabaseProperties.
17929func (rdmdp RestorableDroppedManagedDatabaseProperties) MarshalJSON() ([]byte, error) {
17930	objectMap := make(map[string]interface{})
17931	return json.Marshal(objectMap)
17932}
17933
17934// RestorePoint database restore points.
17935type RestorePoint struct {
17936	autorest.Response `json:"-"`
17937	// Location - READ-ONLY; Resource location.
17938	Location *string `json:"location,omitempty"`
17939	// RestorePointProperties - Resource properties.
17940	*RestorePointProperties `json:"properties,omitempty"`
17941	// ID - READ-ONLY; Resource ID.
17942	ID *string `json:"id,omitempty"`
17943	// Name - READ-ONLY; Resource name.
17944	Name *string `json:"name,omitempty"`
17945	// Type - READ-ONLY; Resource type.
17946	Type *string `json:"type,omitempty"`
17947}
17948
17949// MarshalJSON is the custom marshaler for RestorePoint.
17950func (rp RestorePoint) MarshalJSON() ([]byte, error) {
17951	objectMap := make(map[string]interface{})
17952	if rp.RestorePointProperties != nil {
17953		objectMap["properties"] = rp.RestorePointProperties
17954	}
17955	return json.Marshal(objectMap)
17956}
17957
17958// UnmarshalJSON is the custom unmarshaler for RestorePoint struct.
17959func (rp *RestorePoint) UnmarshalJSON(body []byte) error {
17960	var m map[string]*json.RawMessage
17961	err := json.Unmarshal(body, &m)
17962	if err != nil {
17963		return err
17964	}
17965	for k, v := range m {
17966		switch k {
17967		case "location":
17968			if v != nil {
17969				var location string
17970				err = json.Unmarshal(*v, &location)
17971				if err != nil {
17972					return err
17973				}
17974				rp.Location = &location
17975			}
17976		case "properties":
17977			if v != nil {
17978				var restorePointProperties RestorePointProperties
17979				err = json.Unmarshal(*v, &restorePointProperties)
17980				if err != nil {
17981					return err
17982				}
17983				rp.RestorePointProperties = &restorePointProperties
17984			}
17985		case "id":
17986			if v != nil {
17987				var ID string
17988				err = json.Unmarshal(*v, &ID)
17989				if err != nil {
17990					return err
17991				}
17992				rp.ID = &ID
17993			}
17994		case "name":
17995			if v != nil {
17996				var name string
17997				err = json.Unmarshal(*v, &name)
17998				if err != nil {
17999					return err
18000				}
18001				rp.Name = &name
18002			}
18003		case "type":
18004			if v != nil {
18005				var typeVar string
18006				err = json.Unmarshal(*v, &typeVar)
18007				if err != nil {
18008					return err
18009				}
18010				rp.Type = &typeVar
18011			}
18012		}
18013	}
18014
18015	return nil
18016}
18017
18018// RestorePointListResult a list of long term retention backups.
18019type RestorePointListResult struct {
18020	autorest.Response `json:"-"`
18021	// Value - READ-ONLY; Array of results.
18022	Value *[]RestorePoint `json:"value,omitempty"`
18023	// NextLink - READ-ONLY; Link to retrieve next page of results.
18024	NextLink *string `json:"nextLink,omitempty"`
18025}
18026
18027// MarshalJSON is the custom marshaler for RestorePointListResult.
18028func (rplr RestorePointListResult) MarshalJSON() ([]byte, error) {
18029	objectMap := make(map[string]interface{})
18030	return json.Marshal(objectMap)
18031}
18032
18033// RestorePointProperties properties of a database restore point
18034type RestorePointProperties struct {
18035	// RestorePointType - READ-ONLY; The type of restore point. Possible values include: 'CONTINUOUS', 'DISCRETE'
18036	RestorePointType RestorePointType `json:"restorePointType,omitempty"`
18037	// EarliestRestoreDate - READ-ONLY; The earliest time to which this database can be restored
18038	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
18039	// RestorePointCreationDate - READ-ONLY; The time the backup was taken
18040	RestorePointCreationDate *date.Time `json:"restorePointCreationDate,omitempty"`
18041	// RestorePointLabel - READ-ONLY; The label of restore point for backup request by user
18042	RestorePointLabel *string `json:"restorePointLabel,omitempty"`
18043}
18044
18045// MarshalJSON is the custom marshaler for RestorePointProperties.
18046func (rpp RestorePointProperties) MarshalJSON() ([]byte, error) {
18047	objectMap := make(map[string]interface{})
18048	return json.Marshal(objectMap)
18049}
18050
18051// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
18052// operation.
18053type RestorePointsCreateFuture struct {
18054	azure.FutureAPI
18055	// Result returns the result of the asynchronous operation.
18056	// If the operation has not completed it will return an error.
18057	Result func(RestorePointsClient) (RestorePoint, error)
18058}
18059
18060// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18061func (future *RestorePointsCreateFuture) UnmarshalJSON(body []byte) error {
18062	var azFuture azure.Future
18063	if err := json.Unmarshal(body, &azFuture); err != nil {
18064		return err
18065	}
18066	future.FutureAPI = &azFuture
18067	future.Result = future.result
18068	return nil
18069}
18070
18071// result is the default implementation for RestorePointsCreateFuture.Result.
18072func (future *RestorePointsCreateFuture) result(client RestorePointsClient) (rp RestorePoint, err error) {
18073	var done bool
18074	done, err = future.DoneWithContext(context.Background(), client)
18075	if err != nil {
18076		err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", future.Response(), "Polling failure")
18077		return
18078	}
18079	if !done {
18080		rp.Response.Response = future.Response()
18081		err = azure.NewAsyncOpIncompleteError("sql.RestorePointsCreateFuture")
18082		return
18083	}
18084	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18085	if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent {
18086		rp, err = client.CreateResponder(rp.Response.Response)
18087		if err != nil {
18088			err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", rp.Response.Response, "Failure responding to request")
18089		}
18090	}
18091	return
18092}
18093
18094// SecurityAlertPolicyProperties properties of a security alert policy.
18095type SecurityAlertPolicyProperties struct {
18096	// 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'
18097	State SecurityAlertPolicyState `json:"state,omitempty"`
18098	// DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action
18099	DisabledAlerts *[]string `json:"disabledAlerts,omitempty"`
18100	// EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent.
18101	EmailAddresses *[]string `json:"emailAddresses,omitempty"`
18102	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators.
18103	EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"`
18104	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
18105	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
18106	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account.
18107	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
18108	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
18109	RetentionDays *int32 `json:"retentionDays,omitempty"`
18110	// CreationTime - READ-ONLY; Specifies the UTC creation time of the policy.
18111	CreationTime *date.Time `json:"creationTime,omitempty"`
18112}
18113
18114// MarshalJSON is the custom marshaler for SecurityAlertPolicyProperties.
18115func (sapp SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) {
18116	objectMap := make(map[string]interface{})
18117	if sapp.State != "" {
18118		objectMap["state"] = sapp.State
18119	}
18120	if sapp.DisabledAlerts != nil {
18121		objectMap["disabledAlerts"] = sapp.DisabledAlerts
18122	}
18123	if sapp.EmailAddresses != nil {
18124		objectMap["emailAddresses"] = sapp.EmailAddresses
18125	}
18126	if sapp.EmailAccountAdmins != nil {
18127		objectMap["emailAccountAdmins"] = sapp.EmailAccountAdmins
18128	}
18129	if sapp.StorageEndpoint != nil {
18130		objectMap["storageEndpoint"] = sapp.StorageEndpoint
18131	}
18132	if sapp.StorageAccountAccessKey != nil {
18133		objectMap["storageAccountAccessKey"] = sapp.StorageAccountAccessKey
18134	}
18135	if sapp.RetentionDays != nil {
18136		objectMap["retentionDays"] = sapp.RetentionDays
18137	}
18138	return json.Marshal(objectMap)
18139}
18140
18141// SensitivityLabel a sensitivity label.
18142type SensitivityLabel struct {
18143	autorest.Response `json:"-"`
18144	// SensitivityLabelProperties - Resource properties.
18145	*SensitivityLabelProperties `json:"properties,omitempty"`
18146	// ID - READ-ONLY; Resource ID.
18147	ID *string `json:"id,omitempty"`
18148	// Name - READ-ONLY; Resource name.
18149	Name *string `json:"name,omitempty"`
18150	// Type - READ-ONLY; Resource type.
18151	Type *string `json:"type,omitempty"`
18152}
18153
18154// MarshalJSON is the custom marshaler for SensitivityLabel.
18155func (sl SensitivityLabel) MarshalJSON() ([]byte, error) {
18156	objectMap := make(map[string]interface{})
18157	if sl.SensitivityLabelProperties != nil {
18158		objectMap["properties"] = sl.SensitivityLabelProperties
18159	}
18160	return json.Marshal(objectMap)
18161}
18162
18163// UnmarshalJSON is the custom unmarshaler for SensitivityLabel struct.
18164func (sl *SensitivityLabel) UnmarshalJSON(body []byte) error {
18165	var m map[string]*json.RawMessage
18166	err := json.Unmarshal(body, &m)
18167	if err != nil {
18168		return err
18169	}
18170	for k, v := range m {
18171		switch k {
18172		case "properties":
18173			if v != nil {
18174				var sensitivityLabelProperties SensitivityLabelProperties
18175				err = json.Unmarshal(*v, &sensitivityLabelProperties)
18176				if err != nil {
18177					return err
18178				}
18179				sl.SensitivityLabelProperties = &sensitivityLabelProperties
18180			}
18181		case "id":
18182			if v != nil {
18183				var ID string
18184				err = json.Unmarshal(*v, &ID)
18185				if err != nil {
18186					return err
18187				}
18188				sl.ID = &ID
18189			}
18190		case "name":
18191			if v != nil {
18192				var name string
18193				err = json.Unmarshal(*v, &name)
18194				if err != nil {
18195					return err
18196				}
18197				sl.Name = &name
18198			}
18199		case "type":
18200			if v != nil {
18201				var typeVar string
18202				err = json.Unmarshal(*v, &typeVar)
18203				if err != nil {
18204					return err
18205				}
18206				sl.Type = &typeVar
18207			}
18208		}
18209	}
18210
18211	return nil
18212}
18213
18214// SensitivityLabelListResult a list of sensitivity labels.
18215type SensitivityLabelListResult struct {
18216	autorest.Response `json:"-"`
18217	// Value - READ-ONLY; Array of results.
18218	Value *[]SensitivityLabel `json:"value,omitempty"`
18219	// NextLink - READ-ONLY; Link to retrieve next page of results.
18220	NextLink *string `json:"nextLink,omitempty"`
18221}
18222
18223// MarshalJSON is the custom marshaler for SensitivityLabelListResult.
18224func (sllr SensitivityLabelListResult) MarshalJSON() ([]byte, error) {
18225	objectMap := make(map[string]interface{})
18226	return json.Marshal(objectMap)
18227}
18228
18229// SensitivityLabelListResultIterator provides access to a complete listing of SensitivityLabel values.
18230type SensitivityLabelListResultIterator struct {
18231	i    int
18232	page SensitivityLabelListResultPage
18233}
18234
18235// NextWithContext advances to the next value.  If there was an error making
18236// the request the iterator does not advance and the error is returned.
18237func (iter *SensitivityLabelListResultIterator) NextWithContext(ctx context.Context) (err error) {
18238	if tracing.IsEnabled() {
18239		ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultIterator.NextWithContext")
18240		defer func() {
18241			sc := -1
18242			if iter.Response().Response.Response != nil {
18243				sc = iter.Response().Response.Response.StatusCode
18244			}
18245			tracing.EndSpan(ctx, sc, err)
18246		}()
18247	}
18248	iter.i++
18249	if iter.i < len(iter.page.Values()) {
18250		return nil
18251	}
18252	err = iter.page.NextWithContext(ctx)
18253	if err != nil {
18254		iter.i--
18255		return err
18256	}
18257	iter.i = 0
18258	return nil
18259}
18260
18261// Next advances to the next value.  If there was an error making
18262// the request the iterator does not advance and the error is returned.
18263// Deprecated: Use NextWithContext() instead.
18264func (iter *SensitivityLabelListResultIterator) Next() error {
18265	return iter.NextWithContext(context.Background())
18266}
18267
18268// NotDone returns true if the enumeration should be started or is not yet complete.
18269func (iter SensitivityLabelListResultIterator) NotDone() bool {
18270	return iter.page.NotDone() && iter.i < len(iter.page.Values())
18271}
18272
18273// Response returns the raw server response from the last page request.
18274func (iter SensitivityLabelListResultIterator) Response() SensitivityLabelListResult {
18275	return iter.page.Response()
18276}
18277
18278// Value returns the current value or a zero-initialized value if the
18279// iterator has advanced beyond the end of the collection.
18280func (iter SensitivityLabelListResultIterator) Value() SensitivityLabel {
18281	if !iter.page.NotDone() {
18282		return SensitivityLabel{}
18283	}
18284	return iter.page.Values()[iter.i]
18285}
18286
18287// Creates a new instance of the SensitivityLabelListResultIterator type.
18288func NewSensitivityLabelListResultIterator(page SensitivityLabelListResultPage) SensitivityLabelListResultIterator {
18289	return SensitivityLabelListResultIterator{page: page}
18290}
18291
18292// IsEmpty returns true if the ListResult contains no values.
18293func (sllr SensitivityLabelListResult) IsEmpty() bool {
18294	return sllr.Value == nil || len(*sllr.Value) == 0
18295}
18296
18297// hasNextLink returns true if the NextLink is not empty.
18298func (sllr SensitivityLabelListResult) hasNextLink() bool {
18299	return sllr.NextLink != nil && len(*sllr.NextLink) != 0
18300}
18301
18302// sensitivityLabelListResultPreparer prepares a request to retrieve the next set of results.
18303// It returns nil if no more results exist.
18304func (sllr SensitivityLabelListResult) sensitivityLabelListResultPreparer(ctx context.Context) (*http.Request, error) {
18305	if !sllr.hasNextLink() {
18306		return nil, nil
18307	}
18308	return autorest.Prepare((&http.Request{}).WithContext(ctx),
18309		autorest.AsJSON(),
18310		autorest.AsGet(),
18311		autorest.WithBaseURL(to.String(sllr.NextLink)))
18312}
18313
18314// SensitivityLabelListResultPage contains a page of SensitivityLabel values.
18315type SensitivityLabelListResultPage struct {
18316	fn   func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)
18317	sllr SensitivityLabelListResult
18318}
18319
18320// NextWithContext advances to the next page of values.  If there was an error making
18321// the request the page does not advance and the error is returned.
18322func (page *SensitivityLabelListResultPage) NextWithContext(ctx context.Context) (err error) {
18323	if tracing.IsEnabled() {
18324		ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultPage.NextWithContext")
18325		defer func() {
18326			sc := -1
18327			if page.Response().Response.Response != nil {
18328				sc = page.Response().Response.Response.StatusCode
18329			}
18330			tracing.EndSpan(ctx, sc, err)
18331		}()
18332	}
18333	for {
18334		next, err := page.fn(ctx, page.sllr)
18335		if err != nil {
18336			return err
18337		}
18338		page.sllr = next
18339		if !next.hasNextLink() || !next.IsEmpty() {
18340			break
18341		}
18342	}
18343	return nil
18344}
18345
18346// Next advances to the next page of values.  If there was an error making
18347// the request the page does not advance and the error is returned.
18348// Deprecated: Use NextWithContext() instead.
18349func (page *SensitivityLabelListResultPage) Next() error {
18350	return page.NextWithContext(context.Background())
18351}
18352
18353// NotDone returns true if the page enumeration should be started or is not yet complete.
18354func (page SensitivityLabelListResultPage) NotDone() bool {
18355	return !page.sllr.IsEmpty()
18356}
18357
18358// Response returns the raw server response from the last page request.
18359func (page SensitivityLabelListResultPage) Response() SensitivityLabelListResult {
18360	return page.sllr
18361}
18362
18363// Values returns the slice of values for the current page or nil if there are no values.
18364func (page SensitivityLabelListResultPage) Values() []SensitivityLabel {
18365	if page.sllr.IsEmpty() {
18366		return nil
18367	}
18368	return *page.sllr.Value
18369}
18370
18371// Creates a new instance of the SensitivityLabelListResultPage type.
18372func NewSensitivityLabelListResultPage(cur SensitivityLabelListResult, getNextPage func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)) SensitivityLabelListResultPage {
18373	return SensitivityLabelListResultPage{
18374		fn:   getNextPage,
18375		sllr: cur,
18376	}
18377}
18378
18379// SensitivityLabelProperties properties of a sensitivity label.
18380type SensitivityLabelProperties struct {
18381	// LabelName - The label name.
18382	LabelName *string `json:"labelName,omitempty"`
18383	// LabelID - The label ID.
18384	LabelID *string `json:"labelId,omitempty"`
18385	// InformationType - The information type.
18386	InformationType *string `json:"informationType,omitempty"`
18387	// InformationTypeID - The information type ID.
18388	InformationTypeID *string `json:"informationTypeId,omitempty"`
18389	// 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.
18390	IsDisabled *bool `json:"isDisabled,omitempty"`
18391	// Rank - Possible values include: 'SensitivityLabelRankNone', 'SensitivityLabelRankLow', 'SensitivityLabelRankMedium', 'SensitivityLabelRankHigh', 'SensitivityLabelRankCritical'
18392	Rank SensitivityLabelRank `json:"rank,omitempty"`
18393}
18394
18395// MarshalJSON is the custom marshaler for SensitivityLabelProperties.
18396func (slp SensitivityLabelProperties) MarshalJSON() ([]byte, error) {
18397	objectMap := make(map[string]interface{})
18398	if slp.LabelName != nil {
18399		objectMap["labelName"] = slp.LabelName
18400	}
18401	if slp.LabelID != nil {
18402		objectMap["labelId"] = slp.LabelID
18403	}
18404	if slp.InformationType != nil {
18405		objectMap["informationType"] = slp.InformationType
18406	}
18407	if slp.InformationTypeID != nil {
18408		objectMap["informationTypeId"] = slp.InformationTypeID
18409	}
18410	if slp.Rank != "" {
18411		objectMap["rank"] = slp.Rank
18412	}
18413	return json.Marshal(objectMap)
18414}
18415
18416// Server an Azure SQL Database server.
18417type Server struct {
18418	autorest.Response `json:"-"`
18419	// Identity - The Azure Active Directory identity of the server.
18420	Identity *ResourceIdentity `json:"identity,omitempty"`
18421	// Kind - READ-ONLY; Kind of sql server. This is metadata used for the Azure portal experience.
18422	Kind *string `json:"kind,omitempty"`
18423	// ServerProperties - Resource properties.
18424	*ServerProperties `json:"properties,omitempty"`
18425	// Location - Resource location.
18426	Location *string `json:"location,omitempty"`
18427	// Tags - Resource tags.
18428	Tags map[string]*string `json:"tags"`
18429	// ID - READ-ONLY; Resource ID.
18430	ID *string `json:"id,omitempty"`
18431	// Name - READ-ONLY; Resource name.
18432	Name *string `json:"name,omitempty"`
18433	// Type - READ-ONLY; Resource type.
18434	Type *string `json:"type,omitempty"`
18435}
18436
18437// MarshalJSON is the custom marshaler for Server.
18438func (s Server) MarshalJSON() ([]byte, error) {
18439	objectMap := make(map[string]interface{})
18440	if s.Identity != nil {
18441		objectMap["identity"] = s.Identity
18442	}
18443	if s.ServerProperties != nil {
18444		objectMap["properties"] = s.ServerProperties
18445	}
18446	if s.Location != nil {
18447		objectMap["location"] = s.Location
18448	}
18449	if s.Tags != nil {
18450		objectMap["tags"] = s.Tags
18451	}
18452	return json.Marshal(objectMap)
18453}
18454
18455// UnmarshalJSON is the custom unmarshaler for Server struct.
18456func (s *Server) UnmarshalJSON(body []byte) error {
18457	var m map[string]*json.RawMessage
18458	err := json.Unmarshal(body, &m)
18459	if err != nil {
18460		return err
18461	}
18462	for k, v := range m {
18463		switch k {
18464		case "identity":
18465			if v != nil {
18466				var identity ResourceIdentity
18467				err = json.Unmarshal(*v, &identity)
18468				if err != nil {
18469					return err
18470				}
18471				s.Identity = &identity
18472			}
18473		case "kind":
18474			if v != nil {
18475				var kind string
18476				err = json.Unmarshal(*v, &kind)
18477				if err != nil {
18478					return err
18479				}
18480				s.Kind = &kind
18481			}
18482		case "properties":
18483			if v != nil {
18484				var serverProperties ServerProperties
18485				err = json.Unmarshal(*v, &serverProperties)
18486				if err != nil {
18487					return err
18488				}
18489				s.ServerProperties = &serverProperties
18490			}
18491		case "location":
18492			if v != nil {
18493				var location string
18494				err = json.Unmarshal(*v, &location)
18495				if err != nil {
18496					return err
18497				}
18498				s.Location = &location
18499			}
18500		case "tags":
18501			if v != nil {
18502				var tags map[string]*string
18503				err = json.Unmarshal(*v, &tags)
18504				if err != nil {
18505					return err
18506				}
18507				s.Tags = tags
18508			}
18509		case "id":
18510			if v != nil {
18511				var ID string
18512				err = json.Unmarshal(*v, &ID)
18513				if err != nil {
18514					return err
18515				}
18516				s.ID = &ID
18517			}
18518		case "name":
18519			if v != nil {
18520				var name string
18521				err = json.Unmarshal(*v, &name)
18522				if err != nil {
18523					return err
18524				}
18525				s.Name = &name
18526			}
18527		case "type":
18528			if v != nil {
18529				var typeVar string
18530				err = json.Unmarshal(*v, &typeVar)
18531				if err != nil {
18532					return err
18533				}
18534				s.Type = &typeVar
18535			}
18536		}
18537	}
18538
18539	return nil
18540}
18541
18542// ServerAutomaticTuning server-level Automatic Tuning.
18543type ServerAutomaticTuning struct {
18544	autorest.Response `json:"-"`
18545	// AutomaticTuningServerProperties - Resource properties.
18546	*AutomaticTuningServerProperties `json:"properties,omitempty"`
18547	// ID - READ-ONLY; Resource ID.
18548	ID *string `json:"id,omitempty"`
18549	// Name - READ-ONLY; Resource name.
18550	Name *string `json:"name,omitempty"`
18551	// Type - READ-ONLY; Resource type.
18552	Type *string `json:"type,omitempty"`
18553}
18554
18555// MarshalJSON is the custom marshaler for ServerAutomaticTuning.
18556func (sat ServerAutomaticTuning) MarshalJSON() ([]byte, error) {
18557	objectMap := make(map[string]interface{})
18558	if sat.AutomaticTuningServerProperties != nil {
18559		objectMap["properties"] = sat.AutomaticTuningServerProperties
18560	}
18561	return json.Marshal(objectMap)
18562}
18563
18564// UnmarshalJSON is the custom unmarshaler for ServerAutomaticTuning struct.
18565func (sat *ServerAutomaticTuning) UnmarshalJSON(body []byte) error {
18566	var m map[string]*json.RawMessage
18567	err := json.Unmarshal(body, &m)
18568	if err != nil {
18569		return err
18570	}
18571	for k, v := range m {
18572		switch k {
18573		case "properties":
18574			if v != nil {
18575				var automaticTuningServerProperties AutomaticTuningServerProperties
18576				err = json.Unmarshal(*v, &automaticTuningServerProperties)
18577				if err != nil {
18578					return err
18579				}
18580				sat.AutomaticTuningServerProperties = &automaticTuningServerProperties
18581			}
18582		case "id":
18583			if v != nil {
18584				var ID string
18585				err = json.Unmarshal(*v, &ID)
18586				if err != nil {
18587					return err
18588				}
18589				sat.ID = &ID
18590			}
18591		case "name":
18592			if v != nil {
18593				var name string
18594				err = json.Unmarshal(*v, &name)
18595				if err != nil {
18596					return err
18597				}
18598				sat.Name = &name
18599			}
18600		case "type":
18601			if v != nil {
18602				var typeVar string
18603				err = json.Unmarshal(*v, &typeVar)
18604				if err != nil {
18605					return err
18606				}
18607				sat.Type = &typeVar
18608			}
18609		}
18610	}
18611
18612	return nil
18613}
18614
18615// ServerAzureADAdministrator azure Active Directory administrator.
18616type ServerAzureADAdministrator struct {
18617	autorest.Response `json:"-"`
18618	// AdministratorProperties - Resource properties.
18619	*AdministratorProperties `json:"properties,omitempty"`
18620	// ID - READ-ONLY; Resource ID.
18621	ID *string `json:"id,omitempty"`
18622	// Name - READ-ONLY; Resource name.
18623	Name *string `json:"name,omitempty"`
18624	// Type - READ-ONLY; Resource type.
18625	Type *string `json:"type,omitempty"`
18626}
18627
18628// MarshalJSON is the custom marshaler for ServerAzureADAdministrator.
18629func (saaa ServerAzureADAdministrator) MarshalJSON() ([]byte, error) {
18630	objectMap := make(map[string]interface{})
18631	if saaa.AdministratorProperties != nil {
18632		objectMap["properties"] = saaa.AdministratorProperties
18633	}
18634	return json.Marshal(objectMap)
18635}
18636
18637// UnmarshalJSON is the custom unmarshaler for ServerAzureADAdministrator struct.
18638func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error {
18639	var m map[string]*json.RawMessage
18640	err := json.Unmarshal(body, &m)
18641	if err != nil {
18642		return err
18643	}
18644	for k, v := range m {
18645		switch k {
18646		case "properties":
18647			if v != nil {
18648				var administratorProperties AdministratorProperties
18649				err = json.Unmarshal(*v, &administratorProperties)
18650				if err != nil {
18651					return err
18652				}
18653				saaa.AdministratorProperties = &administratorProperties
18654			}
18655		case "id":
18656			if v != nil {
18657				var ID string
18658				err = json.Unmarshal(*v, &ID)
18659				if err != nil {
18660					return err
18661				}
18662				saaa.ID = &ID
18663			}
18664		case "name":
18665			if v != nil {
18666				var name string
18667				err = json.Unmarshal(*v, &name)
18668				if err != nil {
18669					return err
18670				}
18671				saaa.Name = &name
18672			}
18673		case "type":
18674			if v != nil {
18675				var typeVar string
18676				err = json.Unmarshal(*v, &typeVar)
18677				if err != nil {
18678					return err
18679				}
18680				saaa.Type = &typeVar
18681			}
18682		}
18683	}
18684
18685	return nil
18686}
18687
18688// ServerAzureADAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
18689// of a long-running operation.
18690type ServerAzureADAdministratorsCreateOrUpdateFuture struct {
18691	azure.FutureAPI
18692	// Result returns the result of the asynchronous operation.
18693	// If the operation has not completed it will return an error.
18694	Result func(ServerAzureADAdministratorsClient) (ServerAzureADAdministrator, error)
18695}
18696
18697// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18698func (future *ServerAzureADAdministratorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
18699	var azFuture azure.Future
18700	if err := json.Unmarshal(body, &azFuture); err != nil {
18701		return err
18702	}
18703	future.FutureAPI = &azFuture
18704	future.Result = future.result
18705	return nil
18706}
18707
18708// result is the default implementation for ServerAzureADAdministratorsCreateOrUpdateFuture.Result.
18709func (future *ServerAzureADAdministratorsCreateOrUpdateFuture) result(client ServerAzureADAdministratorsClient) (saaa ServerAzureADAdministrator, err error) {
18710	var done bool
18711	done, err = future.DoneWithContext(context.Background(), client)
18712	if err != nil {
18713		err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
18714		return
18715	}
18716	if !done {
18717		saaa.Response.Response = future.Response()
18718		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsCreateOrUpdateFuture")
18719		return
18720	}
18721	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18722	if saaa.Response.Response, err = future.GetResult(sender); err == nil && saaa.Response.Response.StatusCode != http.StatusNoContent {
18723		saaa, err = client.CreateOrUpdateResponder(saaa.Response.Response)
18724		if err != nil {
18725			err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", saaa.Response.Response, "Failure responding to request")
18726		}
18727	}
18728	return
18729}
18730
18731// ServerAzureADAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a
18732// long-running operation.
18733type ServerAzureADAdministratorsDeleteFuture struct {
18734	azure.FutureAPI
18735	// Result returns the result of the asynchronous operation.
18736	// If the operation has not completed it will return an error.
18737	Result func(ServerAzureADAdministratorsClient) (autorest.Response, error)
18738}
18739
18740// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18741func (future *ServerAzureADAdministratorsDeleteFuture) UnmarshalJSON(body []byte) error {
18742	var azFuture azure.Future
18743	if err := json.Unmarshal(body, &azFuture); err != nil {
18744		return err
18745	}
18746	future.FutureAPI = &azFuture
18747	future.Result = future.result
18748	return nil
18749}
18750
18751// result is the default implementation for ServerAzureADAdministratorsDeleteFuture.Result.
18752func (future *ServerAzureADAdministratorsDeleteFuture) result(client ServerAzureADAdministratorsClient) (ar autorest.Response, err error) {
18753	var done bool
18754	done, err = future.DoneWithContext(context.Background(), client)
18755	if err != nil {
18756		err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure")
18757		return
18758	}
18759	if !done {
18760		ar.Response = future.Response()
18761		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsDeleteFuture")
18762		return
18763	}
18764	ar.Response = future.Response()
18765	return
18766}
18767
18768// ServerAzureADOnlyAuthentication azure Active Directory only authentication.
18769type ServerAzureADOnlyAuthentication struct {
18770	autorest.Response `json:"-"`
18771	// AzureADOnlyAuthProperties - Resource properties.
18772	*AzureADOnlyAuthProperties `json:"properties,omitempty"`
18773	// ID - READ-ONLY; Resource ID.
18774	ID *string `json:"id,omitempty"`
18775	// Name - READ-ONLY; Resource name.
18776	Name *string `json:"name,omitempty"`
18777	// Type - READ-ONLY; Resource type.
18778	Type *string `json:"type,omitempty"`
18779}
18780
18781// MarshalJSON is the custom marshaler for ServerAzureADOnlyAuthentication.
18782func (saaoa ServerAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) {
18783	objectMap := make(map[string]interface{})
18784	if saaoa.AzureADOnlyAuthProperties != nil {
18785		objectMap["properties"] = saaoa.AzureADOnlyAuthProperties
18786	}
18787	return json.Marshal(objectMap)
18788}
18789
18790// UnmarshalJSON is the custom unmarshaler for ServerAzureADOnlyAuthentication struct.
18791func (saaoa *ServerAzureADOnlyAuthentication) UnmarshalJSON(body []byte) error {
18792	var m map[string]*json.RawMessage
18793	err := json.Unmarshal(body, &m)
18794	if err != nil {
18795		return err
18796	}
18797	for k, v := range m {
18798		switch k {
18799		case "properties":
18800			if v != nil {
18801				var azureADOnlyAuthProperties AzureADOnlyAuthProperties
18802				err = json.Unmarshal(*v, &azureADOnlyAuthProperties)
18803				if err != nil {
18804					return err
18805				}
18806				saaoa.AzureADOnlyAuthProperties = &azureADOnlyAuthProperties
18807			}
18808		case "id":
18809			if v != nil {
18810				var ID string
18811				err = json.Unmarshal(*v, &ID)
18812				if err != nil {
18813					return err
18814				}
18815				saaoa.ID = &ID
18816			}
18817		case "name":
18818			if v != nil {
18819				var name string
18820				err = json.Unmarshal(*v, &name)
18821				if err != nil {
18822					return err
18823				}
18824				saaoa.Name = &name
18825			}
18826		case "type":
18827			if v != nil {
18828				var typeVar string
18829				err = json.Unmarshal(*v, &typeVar)
18830				if err != nil {
18831					return err
18832				}
18833				saaoa.Type = &typeVar
18834			}
18835		}
18836	}
18837
18838	return nil
18839}
18840
18841// ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
18842// results of a long-running operation.
18843type ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture struct {
18844	azure.FutureAPI
18845	// Result returns the result of the asynchronous operation.
18846	// If the operation has not completed it will return an error.
18847	Result func(ServerAzureADOnlyAuthenticationsClient) (ServerAzureADOnlyAuthentication, error)
18848}
18849
18850// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18851func (future *ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
18852	var azFuture azure.Future
18853	if err := json.Unmarshal(body, &azFuture); err != nil {
18854		return err
18855	}
18856	future.FutureAPI = &azFuture
18857	future.Result = future.result
18858	return nil
18859}
18860
18861// result is the default implementation for ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture.Result.
18862func (future *ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture) result(client ServerAzureADOnlyAuthenticationsClient) (saaoa ServerAzureADOnlyAuthentication, err error) {
18863	var done bool
18864	done, err = future.DoneWithContext(context.Background(), client)
18865	if err != nil {
18866		err = autorest.NewErrorWithError(err, "sql.ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
18867		return
18868	}
18869	if !done {
18870		saaoa.Response.Response = future.Response()
18871		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture")
18872		return
18873	}
18874	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18875	if saaoa.Response.Response, err = future.GetResult(sender); err == nil && saaoa.Response.Response.StatusCode != http.StatusNoContent {
18876		saaoa, err = client.CreateOrUpdateResponder(saaoa.Response.Response)
18877		if err != nil {
18878			err = autorest.NewErrorWithError(err, "sql.ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture", "Result", saaoa.Response.Response, "Failure responding to request")
18879		}
18880	}
18881	return
18882}
18883
18884// ServerAzureADOnlyAuthenticationsDeleteFuture an abstraction for monitoring and retrieving the results of
18885// a long-running operation.
18886type ServerAzureADOnlyAuthenticationsDeleteFuture struct {
18887	azure.FutureAPI
18888	// Result returns the result of the asynchronous operation.
18889	// If the operation has not completed it will return an error.
18890	Result func(ServerAzureADOnlyAuthenticationsClient) (autorest.Response, error)
18891}
18892
18893// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18894func (future *ServerAzureADOnlyAuthenticationsDeleteFuture) UnmarshalJSON(body []byte) error {
18895	var azFuture azure.Future
18896	if err := json.Unmarshal(body, &azFuture); err != nil {
18897		return err
18898	}
18899	future.FutureAPI = &azFuture
18900	future.Result = future.result
18901	return nil
18902}
18903
18904// result is the default implementation for ServerAzureADOnlyAuthenticationsDeleteFuture.Result.
18905func (future *ServerAzureADOnlyAuthenticationsDeleteFuture) result(client ServerAzureADOnlyAuthenticationsClient) (ar autorest.Response, err error) {
18906	var done bool
18907	done, err = future.DoneWithContext(context.Background(), client)
18908	if err != nil {
18909		err = autorest.NewErrorWithError(err, "sql.ServerAzureADOnlyAuthenticationsDeleteFuture", "Result", future.Response(), "Polling failure")
18910		return
18911	}
18912	if !done {
18913		ar.Response = future.Response()
18914		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADOnlyAuthenticationsDeleteFuture")
18915		return
18916	}
18917	ar.Response = future.Response()
18918	return
18919}
18920
18921// ServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
18922// of a long-running operation.
18923type ServerBlobAuditingPoliciesCreateOrUpdateFuture struct {
18924	azure.FutureAPI
18925	// Result returns the result of the asynchronous operation.
18926	// If the operation has not completed it will return an error.
18927	Result func(ServerBlobAuditingPoliciesClient) (ServerBlobAuditingPolicy, error)
18928}
18929
18930// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18931func (future *ServerBlobAuditingPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
18932	var azFuture azure.Future
18933	if err := json.Unmarshal(body, &azFuture); err != nil {
18934		return err
18935	}
18936	future.FutureAPI = &azFuture
18937	future.Result = future.result
18938	return nil
18939}
18940
18941// result is the default implementation for ServerBlobAuditingPoliciesCreateOrUpdateFuture.Result.
18942func (future *ServerBlobAuditingPoliciesCreateOrUpdateFuture) result(client ServerBlobAuditingPoliciesClient) (sbap ServerBlobAuditingPolicy, err error) {
18943	var done bool
18944	done, err = future.DoneWithContext(context.Background(), client)
18945	if err != nil {
18946		err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
18947		return
18948	}
18949	if !done {
18950		sbap.Response.Response = future.Response()
18951		err = azure.NewAsyncOpIncompleteError("sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture")
18952		return
18953	}
18954	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18955	if sbap.Response.Response, err = future.GetResult(sender); err == nil && sbap.Response.Response.StatusCode != http.StatusNoContent {
18956		sbap, err = client.CreateOrUpdateResponder(sbap.Response.Response)
18957		if err != nil {
18958			err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", sbap.Response.Response, "Failure responding to request")
18959		}
18960	}
18961	return
18962}
18963
18964// ServerBlobAuditingPolicy a server blob auditing policy.
18965type ServerBlobAuditingPolicy struct {
18966	autorest.Response `json:"-"`
18967	// ServerBlobAuditingPolicyProperties - Resource properties.
18968	*ServerBlobAuditingPolicyProperties `json:"properties,omitempty"`
18969	// ID - READ-ONLY; Resource ID.
18970	ID *string `json:"id,omitempty"`
18971	// Name - READ-ONLY; Resource name.
18972	Name *string `json:"name,omitempty"`
18973	// Type - READ-ONLY; Resource type.
18974	Type *string `json:"type,omitempty"`
18975}
18976
18977// MarshalJSON is the custom marshaler for ServerBlobAuditingPolicy.
18978func (sbap ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
18979	objectMap := make(map[string]interface{})
18980	if sbap.ServerBlobAuditingPolicyProperties != nil {
18981		objectMap["properties"] = sbap.ServerBlobAuditingPolicyProperties
18982	}
18983	return json.Marshal(objectMap)
18984}
18985
18986// UnmarshalJSON is the custom unmarshaler for ServerBlobAuditingPolicy struct.
18987func (sbap *ServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
18988	var m map[string]*json.RawMessage
18989	err := json.Unmarshal(body, &m)
18990	if err != nil {
18991		return err
18992	}
18993	for k, v := range m {
18994		switch k {
18995		case "properties":
18996			if v != nil {
18997				var serverBlobAuditingPolicyProperties ServerBlobAuditingPolicyProperties
18998				err = json.Unmarshal(*v, &serverBlobAuditingPolicyProperties)
18999				if err != nil {
19000					return err
19001				}
19002				sbap.ServerBlobAuditingPolicyProperties = &serverBlobAuditingPolicyProperties
19003			}
19004		case "id":
19005			if v != nil {
19006				var ID string
19007				err = json.Unmarshal(*v, &ID)
19008				if err != nil {
19009					return err
19010				}
19011				sbap.ID = &ID
19012			}
19013		case "name":
19014			if v != nil {
19015				var name string
19016				err = json.Unmarshal(*v, &name)
19017				if err != nil {
19018					return err
19019				}
19020				sbap.Name = &name
19021			}
19022		case "type":
19023			if v != nil {
19024				var typeVar string
19025				err = json.Unmarshal(*v, &typeVar)
19026				if err != nil {
19027					return err
19028				}
19029				sbap.Type = &typeVar
19030			}
19031		}
19032	}
19033
19034	return nil
19035}
19036
19037// ServerBlobAuditingPolicyListResult a list of server auditing settings.
19038type ServerBlobAuditingPolicyListResult struct {
19039	autorest.Response `json:"-"`
19040	// Value - READ-ONLY; Array of results.
19041	Value *[]ServerBlobAuditingPolicy `json:"value,omitempty"`
19042	// NextLink - READ-ONLY; Link to retrieve next page of results.
19043	NextLink *string `json:"nextLink,omitempty"`
19044}
19045
19046// MarshalJSON is the custom marshaler for ServerBlobAuditingPolicyListResult.
19047func (sbaplr ServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
19048	objectMap := make(map[string]interface{})
19049	return json.Marshal(objectMap)
19050}
19051
19052// ServerBlobAuditingPolicyListResultIterator provides access to a complete listing of
19053// ServerBlobAuditingPolicy values.
19054type ServerBlobAuditingPolicyListResultIterator struct {
19055	i    int
19056	page ServerBlobAuditingPolicyListResultPage
19057}
19058
19059// NextWithContext advances to the next value.  If there was an error making
19060// the request the iterator does not advance and the error is returned.
19061func (iter *ServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
19062	if tracing.IsEnabled() {
19063		ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultIterator.NextWithContext")
19064		defer func() {
19065			sc := -1
19066			if iter.Response().Response.Response != nil {
19067				sc = iter.Response().Response.Response.StatusCode
19068			}
19069			tracing.EndSpan(ctx, sc, err)
19070		}()
19071	}
19072	iter.i++
19073	if iter.i < len(iter.page.Values()) {
19074		return nil
19075	}
19076	err = iter.page.NextWithContext(ctx)
19077	if err != nil {
19078		iter.i--
19079		return err
19080	}
19081	iter.i = 0
19082	return nil
19083}
19084
19085// Next advances to the next value.  If there was an error making
19086// the request the iterator does not advance and the error is returned.
19087// Deprecated: Use NextWithContext() instead.
19088func (iter *ServerBlobAuditingPolicyListResultIterator) Next() error {
19089	return iter.NextWithContext(context.Background())
19090}
19091
19092// NotDone returns true if the enumeration should be started or is not yet complete.
19093func (iter ServerBlobAuditingPolicyListResultIterator) NotDone() bool {
19094	return iter.page.NotDone() && iter.i < len(iter.page.Values())
19095}
19096
19097// Response returns the raw server response from the last page request.
19098func (iter ServerBlobAuditingPolicyListResultIterator) Response() ServerBlobAuditingPolicyListResult {
19099	return iter.page.Response()
19100}
19101
19102// Value returns the current value or a zero-initialized value if the
19103// iterator has advanced beyond the end of the collection.
19104func (iter ServerBlobAuditingPolicyListResultIterator) Value() ServerBlobAuditingPolicy {
19105	if !iter.page.NotDone() {
19106		return ServerBlobAuditingPolicy{}
19107	}
19108	return iter.page.Values()[iter.i]
19109}
19110
19111// Creates a new instance of the ServerBlobAuditingPolicyListResultIterator type.
19112func NewServerBlobAuditingPolicyListResultIterator(page ServerBlobAuditingPolicyListResultPage) ServerBlobAuditingPolicyListResultIterator {
19113	return ServerBlobAuditingPolicyListResultIterator{page: page}
19114}
19115
19116// IsEmpty returns true if the ListResult contains no values.
19117func (sbaplr ServerBlobAuditingPolicyListResult) IsEmpty() bool {
19118	return sbaplr.Value == nil || len(*sbaplr.Value) == 0
19119}
19120
19121// hasNextLink returns true if the NextLink is not empty.
19122func (sbaplr ServerBlobAuditingPolicyListResult) hasNextLink() bool {
19123	return sbaplr.NextLink != nil && len(*sbaplr.NextLink) != 0
19124}
19125
19126// serverBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
19127// It returns nil if no more results exist.
19128func (sbaplr ServerBlobAuditingPolicyListResult) serverBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
19129	if !sbaplr.hasNextLink() {
19130		return nil, nil
19131	}
19132	return autorest.Prepare((&http.Request{}).WithContext(ctx),
19133		autorest.AsJSON(),
19134		autorest.AsGet(),
19135		autorest.WithBaseURL(to.String(sbaplr.NextLink)))
19136}
19137
19138// ServerBlobAuditingPolicyListResultPage contains a page of ServerBlobAuditingPolicy values.
19139type ServerBlobAuditingPolicyListResultPage struct {
19140	fn     func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)
19141	sbaplr ServerBlobAuditingPolicyListResult
19142}
19143
19144// NextWithContext advances to the next page of values.  If there was an error making
19145// the request the page does not advance and the error is returned.
19146func (page *ServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
19147	if tracing.IsEnabled() {
19148		ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultPage.NextWithContext")
19149		defer func() {
19150			sc := -1
19151			if page.Response().Response.Response != nil {
19152				sc = page.Response().Response.Response.StatusCode
19153			}
19154			tracing.EndSpan(ctx, sc, err)
19155		}()
19156	}
19157	for {
19158		next, err := page.fn(ctx, page.sbaplr)
19159		if err != nil {
19160			return err
19161		}
19162		page.sbaplr = next
19163		if !next.hasNextLink() || !next.IsEmpty() {
19164			break
19165		}
19166	}
19167	return nil
19168}
19169
19170// Next advances to the next page of values.  If there was an error making
19171// the request the page does not advance and the error is returned.
19172// Deprecated: Use NextWithContext() instead.
19173func (page *ServerBlobAuditingPolicyListResultPage) Next() error {
19174	return page.NextWithContext(context.Background())
19175}
19176
19177// NotDone returns true if the page enumeration should be started or is not yet complete.
19178func (page ServerBlobAuditingPolicyListResultPage) NotDone() bool {
19179	return !page.sbaplr.IsEmpty()
19180}
19181
19182// Response returns the raw server response from the last page request.
19183func (page ServerBlobAuditingPolicyListResultPage) Response() ServerBlobAuditingPolicyListResult {
19184	return page.sbaplr
19185}
19186
19187// Values returns the slice of values for the current page or nil if there are no values.
19188func (page ServerBlobAuditingPolicyListResultPage) Values() []ServerBlobAuditingPolicy {
19189	if page.sbaplr.IsEmpty() {
19190		return nil
19191	}
19192	return *page.sbaplr.Value
19193}
19194
19195// Creates a new instance of the ServerBlobAuditingPolicyListResultPage type.
19196func NewServerBlobAuditingPolicyListResultPage(cur ServerBlobAuditingPolicyListResult, getNextPage func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)) ServerBlobAuditingPolicyListResultPage {
19197	return ServerBlobAuditingPolicyListResultPage{
19198		fn:     getNextPage,
19199		sbaplr: cur,
19200	}
19201}
19202
19203// ServerBlobAuditingPolicyProperties properties of a server blob auditing policy.
19204type ServerBlobAuditingPolicyProperties struct {
19205	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
19206	State BlobAuditingPolicyState `json:"state,omitempty"`
19207	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
19208	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
19209	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
19210	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
19211	// Prerequisites for using managed identity authentication:
19212	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
19213	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
19214	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
19215	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
19216	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
19217	RetentionDays *int32 `json:"retentionDays,omitempty"`
19218	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
19219	//
19220	// 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:
19221	//
19222	// BATCH_COMPLETED_GROUP,
19223	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
19224	// FAILED_DATABASE_AUTHENTICATION_GROUP.
19225	//
19226	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
19227	//
19228	// 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):
19229	//
19230	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
19231	// BACKUP_RESTORE_GROUP
19232	// DATABASE_LOGOUT_GROUP
19233	// DATABASE_OBJECT_CHANGE_GROUP
19234	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
19235	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
19236	// DATABASE_OPERATION_GROUP
19237	// DATABASE_PERMISSION_CHANGE_GROUP
19238	// DATABASE_PRINCIPAL_CHANGE_GROUP
19239	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
19240	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
19241	// FAILED_DATABASE_AUTHENTICATION_GROUP
19242	// SCHEMA_OBJECT_ACCESS_GROUP
19243	// SCHEMA_OBJECT_CHANGE_GROUP
19244	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
19245	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
19246	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
19247	// USER_CHANGE_PASSWORD_GROUP
19248	// BATCH_STARTED_GROUP
19249	// BATCH_COMPLETED_GROUP
19250	//
19251	// 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.
19252	//
19253	// 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).
19254	//
19255	// 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:
19256	// SELECT
19257	// UPDATE
19258	// INSERT
19259	// DELETE
19260	// EXECUTE
19261	// RECEIVE
19262	// REFERENCES
19263	//
19264	// The general form for defining an action to be audited is:
19265	// {action} ON {object} BY {principal}
19266	//
19267	// 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.
19268	//
19269	// For example:
19270	// SELECT on dbo.myTable by public
19271	// SELECT on DATABASE::myDatabase by public
19272	// SELECT on SCHEMA::mySchema by public
19273	//
19274	// 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)
19275	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
19276	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
19277	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
19278	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
19279	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
19280	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
19281	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
19282	//
19283	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
19284	// Note that for server level audit you should use the 'master' database as {databaseName}.
19285	//
19286	// Diagnostic Settings URI format:
19287	// 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
19288	//
19289	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
19290	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
19291	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
19292	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
19293	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
19294	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
19295}
19296
19297// ServerCommunicationLink server communication link.
19298type ServerCommunicationLink struct {
19299	autorest.Response `json:"-"`
19300	// ServerCommunicationLinkProperties - The properties of resource.
19301	*ServerCommunicationLinkProperties `json:"properties,omitempty"`
19302	// Location - READ-ONLY; Communication link location.
19303	Location *string `json:"location,omitempty"`
19304	// Kind - READ-ONLY; Communication link kind.  This property is used for Azure Portal metadata.
19305	Kind *string `json:"kind,omitempty"`
19306	// ID - READ-ONLY; Resource ID.
19307	ID *string `json:"id,omitempty"`
19308	// Name - READ-ONLY; Resource name.
19309	Name *string `json:"name,omitempty"`
19310	// Type - READ-ONLY; Resource type.
19311	Type *string `json:"type,omitempty"`
19312}
19313
19314// MarshalJSON is the custom marshaler for ServerCommunicationLink.
19315func (scl ServerCommunicationLink) MarshalJSON() ([]byte, error) {
19316	objectMap := make(map[string]interface{})
19317	if scl.ServerCommunicationLinkProperties != nil {
19318		objectMap["properties"] = scl.ServerCommunicationLinkProperties
19319	}
19320	return json.Marshal(objectMap)
19321}
19322
19323// UnmarshalJSON is the custom unmarshaler for ServerCommunicationLink struct.
19324func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error {
19325	var m map[string]*json.RawMessage
19326	err := json.Unmarshal(body, &m)
19327	if err != nil {
19328		return err
19329	}
19330	for k, v := range m {
19331		switch k {
19332		case "properties":
19333			if v != nil {
19334				var serverCommunicationLinkProperties ServerCommunicationLinkProperties
19335				err = json.Unmarshal(*v, &serverCommunicationLinkProperties)
19336				if err != nil {
19337					return err
19338				}
19339				scl.ServerCommunicationLinkProperties = &serverCommunicationLinkProperties
19340			}
19341		case "location":
19342			if v != nil {
19343				var location string
19344				err = json.Unmarshal(*v, &location)
19345				if err != nil {
19346					return err
19347				}
19348				scl.Location = &location
19349			}
19350		case "kind":
19351			if v != nil {
19352				var kind string
19353				err = json.Unmarshal(*v, &kind)
19354				if err != nil {
19355					return err
19356				}
19357				scl.Kind = &kind
19358			}
19359		case "id":
19360			if v != nil {
19361				var ID string
19362				err = json.Unmarshal(*v, &ID)
19363				if err != nil {
19364					return err
19365				}
19366				scl.ID = &ID
19367			}
19368		case "name":
19369			if v != nil {
19370				var name string
19371				err = json.Unmarshal(*v, &name)
19372				if err != nil {
19373					return err
19374				}
19375				scl.Name = &name
19376			}
19377		case "type":
19378			if v != nil {
19379				var typeVar string
19380				err = json.Unmarshal(*v, &typeVar)
19381				if err != nil {
19382					return err
19383				}
19384				scl.Type = &typeVar
19385			}
19386		}
19387	}
19388
19389	return nil
19390}
19391
19392// ServerCommunicationLinkListResult a list of server communication links.
19393type ServerCommunicationLinkListResult struct {
19394	autorest.Response `json:"-"`
19395	// Value - The list of server communication links.
19396	Value *[]ServerCommunicationLink `json:"value,omitempty"`
19397}
19398
19399// ServerCommunicationLinkProperties the properties of a server communication link.
19400type ServerCommunicationLinkProperties struct {
19401	// State - READ-ONLY; The state.
19402	State *string `json:"state,omitempty"`
19403	// PartnerServer - The name of the partner server.
19404	PartnerServer *string `json:"partnerServer,omitempty"`
19405}
19406
19407// MarshalJSON is the custom marshaler for ServerCommunicationLinkProperties.
19408func (sclp ServerCommunicationLinkProperties) MarshalJSON() ([]byte, error) {
19409	objectMap := make(map[string]interface{})
19410	if sclp.PartnerServer != nil {
19411		objectMap["partnerServer"] = sclp.PartnerServer
19412	}
19413	return json.Marshal(objectMap)
19414}
19415
19416// ServerCommunicationLinksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of
19417// a long-running operation.
19418type ServerCommunicationLinksCreateOrUpdateFuture struct {
19419	azure.FutureAPI
19420	// Result returns the result of the asynchronous operation.
19421	// If the operation has not completed it will return an error.
19422	Result func(ServerCommunicationLinksClient) (ServerCommunicationLink, error)
19423}
19424
19425// UnmarshalJSON is the custom unmarshaller for CreateFuture.
19426func (future *ServerCommunicationLinksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
19427	var azFuture azure.Future
19428	if err := json.Unmarshal(body, &azFuture); err != nil {
19429		return err
19430	}
19431	future.FutureAPI = &azFuture
19432	future.Result = future.result
19433	return nil
19434}
19435
19436// result is the default implementation for ServerCommunicationLinksCreateOrUpdateFuture.Result.
19437func (future *ServerCommunicationLinksCreateOrUpdateFuture) result(client ServerCommunicationLinksClient) (scl ServerCommunicationLink, err error) {
19438	var done bool
19439	done, err = future.DoneWithContext(context.Background(), client)
19440	if err != nil {
19441		err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
19442		return
19443	}
19444	if !done {
19445		scl.Response.Response = future.Response()
19446		err = azure.NewAsyncOpIncompleteError("sql.ServerCommunicationLinksCreateOrUpdateFuture")
19447		return
19448	}
19449	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19450	if scl.Response.Response, err = future.GetResult(sender); err == nil && scl.Response.Response.StatusCode != http.StatusNoContent {
19451		scl, err = client.CreateOrUpdateResponder(scl.Response.Response)
19452		if err != nil {
19453			err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", scl.Response.Response, "Failure responding to request")
19454		}
19455	}
19456	return
19457}
19458
19459// ServerConnectionPolicy a server secure connection policy.
19460type ServerConnectionPolicy struct {
19461	autorest.Response `json:"-"`
19462	// Kind - READ-ONLY; Metadata used for the Azure portal experience.
19463	Kind *string `json:"kind,omitempty"`
19464	// Location - READ-ONLY; Resource location.
19465	Location *string `json:"location,omitempty"`
19466	// ServerConnectionPolicyProperties - The properties of the server secure connection policy.
19467	*ServerConnectionPolicyProperties `json:"properties,omitempty"`
19468	// ID - READ-ONLY; Resource ID.
19469	ID *string `json:"id,omitempty"`
19470	// Name - READ-ONLY; Resource name.
19471	Name *string `json:"name,omitempty"`
19472	// Type - READ-ONLY; Resource type.
19473	Type *string `json:"type,omitempty"`
19474}
19475
19476// MarshalJSON is the custom marshaler for ServerConnectionPolicy.
19477func (scp ServerConnectionPolicy) MarshalJSON() ([]byte, error) {
19478	objectMap := make(map[string]interface{})
19479	if scp.ServerConnectionPolicyProperties != nil {
19480		objectMap["properties"] = scp.ServerConnectionPolicyProperties
19481	}
19482	return json.Marshal(objectMap)
19483}
19484
19485// UnmarshalJSON is the custom unmarshaler for ServerConnectionPolicy struct.
19486func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error {
19487	var m map[string]*json.RawMessage
19488	err := json.Unmarshal(body, &m)
19489	if err != nil {
19490		return err
19491	}
19492	for k, v := range m {
19493		switch k {
19494		case "kind":
19495			if v != nil {
19496				var kind string
19497				err = json.Unmarshal(*v, &kind)
19498				if err != nil {
19499					return err
19500				}
19501				scp.Kind = &kind
19502			}
19503		case "location":
19504			if v != nil {
19505				var location string
19506				err = json.Unmarshal(*v, &location)
19507				if err != nil {
19508					return err
19509				}
19510				scp.Location = &location
19511			}
19512		case "properties":
19513			if v != nil {
19514				var serverConnectionPolicyProperties ServerConnectionPolicyProperties
19515				err = json.Unmarshal(*v, &serverConnectionPolicyProperties)
19516				if err != nil {
19517					return err
19518				}
19519				scp.ServerConnectionPolicyProperties = &serverConnectionPolicyProperties
19520			}
19521		case "id":
19522			if v != nil {
19523				var ID string
19524				err = json.Unmarshal(*v, &ID)
19525				if err != nil {
19526					return err
19527				}
19528				scp.ID = &ID
19529			}
19530		case "name":
19531			if v != nil {
19532				var name string
19533				err = json.Unmarshal(*v, &name)
19534				if err != nil {
19535					return err
19536				}
19537				scp.Name = &name
19538			}
19539		case "type":
19540			if v != nil {
19541				var typeVar string
19542				err = json.Unmarshal(*v, &typeVar)
19543				if err != nil {
19544					return err
19545				}
19546				scp.Type = &typeVar
19547			}
19548		}
19549	}
19550
19551	return nil
19552}
19553
19554// ServerConnectionPolicyProperties the properties of a server secure connection policy.
19555type ServerConnectionPolicyProperties struct {
19556	// ConnectionType - The server connection type. Possible values include: 'ServerConnectionTypeDefault', 'ServerConnectionTypeProxy', 'ServerConnectionTypeRedirect'
19557	ConnectionType ServerConnectionType `json:"connectionType,omitempty"`
19558}
19559
19560// ServerDevOpsAuditingSettings a server DevOps auditing settings.
19561type ServerDevOpsAuditingSettings struct {
19562	autorest.Response `json:"-"`
19563	// SystemData - READ-ONLY; SystemData of ServerDevOpsAuditSettingsResource.
19564	SystemData *SystemData `json:"systemData,omitempty"`
19565	// ServerDevOpsAuditSettingsProperties - Resource properties.
19566	*ServerDevOpsAuditSettingsProperties `json:"properties,omitempty"`
19567	// ID - READ-ONLY; Resource ID.
19568	ID *string `json:"id,omitempty"`
19569	// Name - READ-ONLY; Resource name.
19570	Name *string `json:"name,omitempty"`
19571	// Type - READ-ONLY; Resource type.
19572	Type *string `json:"type,omitempty"`
19573}
19574
19575// MarshalJSON is the custom marshaler for ServerDevOpsAuditingSettings.
19576func (sdoas ServerDevOpsAuditingSettings) MarshalJSON() ([]byte, error) {
19577	objectMap := make(map[string]interface{})
19578	if sdoas.ServerDevOpsAuditSettingsProperties != nil {
19579		objectMap["properties"] = sdoas.ServerDevOpsAuditSettingsProperties
19580	}
19581	return json.Marshal(objectMap)
19582}
19583
19584// UnmarshalJSON is the custom unmarshaler for ServerDevOpsAuditingSettings struct.
19585func (sdoas *ServerDevOpsAuditingSettings) UnmarshalJSON(body []byte) error {
19586	var m map[string]*json.RawMessage
19587	err := json.Unmarshal(body, &m)
19588	if err != nil {
19589		return err
19590	}
19591	for k, v := range m {
19592		switch k {
19593		case "systemData":
19594			if v != nil {
19595				var systemData SystemData
19596				err = json.Unmarshal(*v, &systemData)
19597				if err != nil {
19598					return err
19599				}
19600				sdoas.SystemData = &systemData
19601			}
19602		case "properties":
19603			if v != nil {
19604				var serverDevOpsAuditSettingsProperties ServerDevOpsAuditSettingsProperties
19605				err = json.Unmarshal(*v, &serverDevOpsAuditSettingsProperties)
19606				if err != nil {
19607					return err
19608				}
19609				sdoas.ServerDevOpsAuditSettingsProperties = &serverDevOpsAuditSettingsProperties
19610			}
19611		case "id":
19612			if v != nil {
19613				var ID string
19614				err = json.Unmarshal(*v, &ID)
19615				if err != nil {
19616					return err
19617				}
19618				sdoas.ID = &ID
19619			}
19620		case "name":
19621			if v != nil {
19622				var name string
19623				err = json.Unmarshal(*v, &name)
19624				if err != nil {
19625					return err
19626				}
19627				sdoas.Name = &name
19628			}
19629		case "type":
19630			if v != nil {
19631				var typeVar string
19632				err = json.Unmarshal(*v, &typeVar)
19633				if err != nil {
19634					return err
19635				}
19636				sdoas.Type = &typeVar
19637			}
19638		}
19639	}
19640
19641	return nil
19642}
19643
19644// ServerDevOpsAuditSettingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
19645// of a long-running operation.
19646type ServerDevOpsAuditSettingsCreateOrUpdateFuture struct {
19647	azure.FutureAPI
19648	// Result returns the result of the asynchronous operation.
19649	// If the operation has not completed it will return an error.
19650	Result func(ServerDevOpsAuditSettingsClient) (ServerDevOpsAuditingSettings, error)
19651}
19652
19653// UnmarshalJSON is the custom unmarshaller for CreateFuture.
19654func (future *ServerDevOpsAuditSettingsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
19655	var azFuture azure.Future
19656	if err := json.Unmarshal(body, &azFuture); err != nil {
19657		return err
19658	}
19659	future.FutureAPI = &azFuture
19660	future.Result = future.result
19661	return nil
19662}
19663
19664// result is the default implementation for ServerDevOpsAuditSettingsCreateOrUpdateFuture.Result.
19665func (future *ServerDevOpsAuditSettingsCreateOrUpdateFuture) result(client ServerDevOpsAuditSettingsClient) (sdoas ServerDevOpsAuditingSettings, err error) {
19666	var done bool
19667	done, err = future.DoneWithContext(context.Background(), client)
19668	if err != nil {
19669		err = autorest.NewErrorWithError(err, "sql.ServerDevOpsAuditSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
19670		return
19671	}
19672	if !done {
19673		sdoas.Response.Response = future.Response()
19674		err = azure.NewAsyncOpIncompleteError("sql.ServerDevOpsAuditSettingsCreateOrUpdateFuture")
19675		return
19676	}
19677	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19678	if sdoas.Response.Response, err = future.GetResult(sender); err == nil && sdoas.Response.Response.StatusCode != http.StatusNoContent {
19679		sdoas, err = client.CreateOrUpdateResponder(sdoas.Response.Response)
19680		if err != nil {
19681			err = autorest.NewErrorWithError(err, "sql.ServerDevOpsAuditSettingsCreateOrUpdateFuture", "Result", sdoas.Response.Response, "Failure responding to request")
19682		}
19683	}
19684	return
19685}
19686
19687// ServerDevOpsAuditSettingsListResult a list of server DevOps audit settings.
19688type ServerDevOpsAuditSettingsListResult struct {
19689	autorest.Response `json:"-"`
19690	// Value - READ-ONLY; Array of results.
19691	Value *[]ServerDevOpsAuditingSettings `json:"value,omitempty"`
19692	// NextLink - READ-ONLY; Link to retrieve next page of results.
19693	NextLink *string `json:"nextLink,omitempty"`
19694}
19695
19696// MarshalJSON is the custom marshaler for ServerDevOpsAuditSettingsListResult.
19697func (sdoaslr ServerDevOpsAuditSettingsListResult) MarshalJSON() ([]byte, error) {
19698	objectMap := make(map[string]interface{})
19699	return json.Marshal(objectMap)
19700}
19701
19702// ServerDevOpsAuditSettingsListResultIterator provides access to a complete listing of
19703// ServerDevOpsAuditingSettings values.
19704type ServerDevOpsAuditSettingsListResultIterator struct {
19705	i    int
19706	page ServerDevOpsAuditSettingsListResultPage
19707}
19708
19709// NextWithContext advances to the next value.  If there was an error making
19710// the request the iterator does not advance and the error is returned.
19711func (iter *ServerDevOpsAuditSettingsListResultIterator) NextWithContext(ctx context.Context) (err error) {
19712	if tracing.IsEnabled() {
19713		ctx = tracing.StartSpan(ctx, fqdn+"/ServerDevOpsAuditSettingsListResultIterator.NextWithContext")
19714		defer func() {
19715			sc := -1
19716			if iter.Response().Response.Response != nil {
19717				sc = iter.Response().Response.Response.StatusCode
19718			}
19719			tracing.EndSpan(ctx, sc, err)
19720		}()
19721	}
19722	iter.i++
19723	if iter.i < len(iter.page.Values()) {
19724		return nil
19725	}
19726	err = iter.page.NextWithContext(ctx)
19727	if err != nil {
19728		iter.i--
19729		return err
19730	}
19731	iter.i = 0
19732	return nil
19733}
19734
19735// Next advances to the next value.  If there was an error making
19736// the request the iterator does not advance and the error is returned.
19737// Deprecated: Use NextWithContext() instead.
19738func (iter *ServerDevOpsAuditSettingsListResultIterator) Next() error {
19739	return iter.NextWithContext(context.Background())
19740}
19741
19742// NotDone returns true if the enumeration should be started or is not yet complete.
19743func (iter ServerDevOpsAuditSettingsListResultIterator) NotDone() bool {
19744	return iter.page.NotDone() && iter.i < len(iter.page.Values())
19745}
19746
19747// Response returns the raw server response from the last page request.
19748func (iter ServerDevOpsAuditSettingsListResultIterator) Response() ServerDevOpsAuditSettingsListResult {
19749	return iter.page.Response()
19750}
19751
19752// Value returns the current value or a zero-initialized value if the
19753// iterator has advanced beyond the end of the collection.
19754func (iter ServerDevOpsAuditSettingsListResultIterator) Value() ServerDevOpsAuditingSettings {
19755	if !iter.page.NotDone() {
19756		return ServerDevOpsAuditingSettings{}
19757	}
19758	return iter.page.Values()[iter.i]
19759}
19760
19761// Creates a new instance of the ServerDevOpsAuditSettingsListResultIterator type.
19762func NewServerDevOpsAuditSettingsListResultIterator(page ServerDevOpsAuditSettingsListResultPage) ServerDevOpsAuditSettingsListResultIterator {
19763	return ServerDevOpsAuditSettingsListResultIterator{page: page}
19764}
19765
19766// IsEmpty returns true if the ListResult contains no values.
19767func (sdoaslr ServerDevOpsAuditSettingsListResult) IsEmpty() bool {
19768	return sdoaslr.Value == nil || len(*sdoaslr.Value) == 0
19769}
19770
19771// hasNextLink returns true if the NextLink is not empty.
19772func (sdoaslr ServerDevOpsAuditSettingsListResult) hasNextLink() bool {
19773	return sdoaslr.NextLink != nil && len(*sdoaslr.NextLink) != 0
19774}
19775
19776// serverDevOpsAuditSettingsListResultPreparer prepares a request to retrieve the next set of results.
19777// It returns nil if no more results exist.
19778func (sdoaslr ServerDevOpsAuditSettingsListResult) serverDevOpsAuditSettingsListResultPreparer(ctx context.Context) (*http.Request, error) {
19779	if !sdoaslr.hasNextLink() {
19780		return nil, nil
19781	}
19782	return autorest.Prepare((&http.Request{}).WithContext(ctx),
19783		autorest.AsJSON(),
19784		autorest.AsGet(),
19785		autorest.WithBaseURL(to.String(sdoaslr.NextLink)))
19786}
19787
19788// ServerDevOpsAuditSettingsListResultPage contains a page of ServerDevOpsAuditingSettings values.
19789type ServerDevOpsAuditSettingsListResultPage struct {
19790	fn      func(context.Context, ServerDevOpsAuditSettingsListResult) (ServerDevOpsAuditSettingsListResult, error)
19791	sdoaslr ServerDevOpsAuditSettingsListResult
19792}
19793
19794// NextWithContext advances to the next page of values.  If there was an error making
19795// the request the page does not advance and the error is returned.
19796func (page *ServerDevOpsAuditSettingsListResultPage) NextWithContext(ctx context.Context) (err error) {
19797	if tracing.IsEnabled() {
19798		ctx = tracing.StartSpan(ctx, fqdn+"/ServerDevOpsAuditSettingsListResultPage.NextWithContext")
19799		defer func() {
19800			sc := -1
19801			if page.Response().Response.Response != nil {
19802				sc = page.Response().Response.Response.StatusCode
19803			}
19804			tracing.EndSpan(ctx, sc, err)
19805		}()
19806	}
19807	for {
19808		next, err := page.fn(ctx, page.sdoaslr)
19809		if err != nil {
19810			return err
19811		}
19812		page.sdoaslr = next
19813		if !next.hasNextLink() || !next.IsEmpty() {
19814			break
19815		}
19816	}
19817	return nil
19818}
19819
19820// Next advances to the next page of values.  If there was an error making
19821// the request the page does not advance and the error is returned.
19822// Deprecated: Use NextWithContext() instead.
19823func (page *ServerDevOpsAuditSettingsListResultPage) Next() error {
19824	return page.NextWithContext(context.Background())
19825}
19826
19827// NotDone returns true if the page enumeration should be started or is not yet complete.
19828func (page ServerDevOpsAuditSettingsListResultPage) NotDone() bool {
19829	return !page.sdoaslr.IsEmpty()
19830}
19831
19832// Response returns the raw server response from the last page request.
19833func (page ServerDevOpsAuditSettingsListResultPage) Response() ServerDevOpsAuditSettingsListResult {
19834	return page.sdoaslr
19835}
19836
19837// Values returns the slice of values for the current page or nil if there are no values.
19838func (page ServerDevOpsAuditSettingsListResultPage) Values() []ServerDevOpsAuditingSettings {
19839	if page.sdoaslr.IsEmpty() {
19840		return nil
19841	}
19842	return *page.sdoaslr.Value
19843}
19844
19845// Creates a new instance of the ServerDevOpsAuditSettingsListResultPage type.
19846func NewServerDevOpsAuditSettingsListResultPage(cur ServerDevOpsAuditSettingsListResult, getNextPage func(context.Context, ServerDevOpsAuditSettingsListResult) (ServerDevOpsAuditSettingsListResult, error)) ServerDevOpsAuditSettingsListResultPage {
19847	return ServerDevOpsAuditSettingsListResultPage{
19848		fn:      getNextPage,
19849		sdoaslr: cur,
19850	}
19851}
19852
19853// ServerDevOpsAuditSettingsProperties properties of a server DevOps audit settings.
19854type ServerDevOpsAuditSettingsProperties struct {
19855	// IsAzureMonitorTargetEnabled - Specifies whether DevOps audit events are sent to Azure Monitor.
19856	// In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
19857	//
19858	// When using REST API to configure DevOps audit, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should be also created.
19859	//
19860	// Diagnostic Settings URI format:
19861	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
19862	//
19863	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
19864	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
19865	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
19866	// State - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
19867	State BlobAuditingPolicyState `json:"state,omitempty"`
19868	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
19869	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
19870	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
19871	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
19872	// Prerequisites for using managed identity authentication:
19873	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
19874	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
19875	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
19876	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
19877	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
19878	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
19879}
19880
19881// ServerDNSAlias a server DNS alias.
19882type ServerDNSAlias struct {
19883	autorest.Response `json:"-"`
19884	// ServerDNSAliasProperties - Resource properties.
19885	*ServerDNSAliasProperties `json:"properties,omitempty"`
19886	// ID - READ-ONLY; Resource ID.
19887	ID *string `json:"id,omitempty"`
19888	// Name - READ-ONLY; Resource name.
19889	Name *string `json:"name,omitempty"`
19890	// Type - READ-ONLY; Resource type.
19891	Type *string `json:"type,omitempty"`
19892}
19893
19894// MarshalJSON is the custom marshaler for ServerDNSAlias.
19895func (sda ServerDNSAlias) MarshalJSON() ([]byte, error) {
19896	objectMap := make(map[string]interface{})
19897	if sda.ServerDNSAliasProperties != nil {
19898		objectMap["properties"] = sda.ServerDNSAliasProperties
19899	}
19900	return json.Marshal(objectMap)
19901}
19902
19903// UnmarshalJSON is the custom unmarshaler for ServerDNSAlias struct.
19904func (sda *ServerDNSAlias) UnmarshalJSON(body []byte) error {
19905	var m map[string]*json.RawMessage
19906	err := json.Unmarshal(body, &m)
19907	if err != nil {
19908		return err
19909	}
19910	for k, v := range m {
19911		switch k {
19912		case "properties":
19913			if v != nil {
19914				var serverDNSAliasProperties ServerDNSAliasProperties
19915				err = json.Unmarshal(*v, &serverDNSAliasProperties)
19916				if err != nil {
19917					return err
19918				}
19919				sda.ServerDNSAliasProperties = &serverDNSAliasProperties
19920			}
19921		case "id":
19922			if v != nil {
19923				var ID string
19924				err = json.Unmarshal(*v, &ID)
19925				if err != nil {
19926					return err
19927				}
19928				sda.ID = &ID
19929			}
19930		case "name":
19931			if v != nil {
19932				var name string
19933				err = json.Unmarshal(*v, &name)
19934				if err != nil {
19935					return err
19936				}
19937				sda.Name = &name
19938			}
19939		case "type":
19940			if v != nil {
19941				var typeVar string
19942				err = json.Unmarshal(*v, &typeVar)
19943				if err != nil {
19944					return err
19945				}
19946				sda.Type = &typeVar
19947			}
19948		}
19949	}
19950
19951	return nil
19952}
19953
19954// ServerDNSAliasAcquisition a server DNS alias acquisition request.
19955type ServerDNSAliasAcquisition struct {
19956	// OldServerDNSAliasID - The id of the server alias that will be acquired to point to this server instead.
19957	OldServerDNSAliasID *string `json:"oldServerDnsAliasId,omitempty"`
19958}
19959
19960// ServerDNSAliasesAcquireFuture an abstraction for monitoring and retrieving the results of a long-running
19961// operation.
19962type ServerDNSAliasesAcquireFuture struct {
19963	azure.FutureAPI
19964	// Result returns the result of the asynchronous operation.
19965	// If the operation has not completed it will return an error.
19966	Result func(ServerDNSAliasesClient) (autorest.Response, error)
19967}
19968
19969// UnmarshalJSON is the custom unmarshaller for CreateFuture.
19970func (future *ServerDNSAliasesAcquireFuture) UnmarshalJSON(body []byte) error {
19971	var azFuture azure.Future
19972	if err := json.Unmarshal(body, &azFuture); err != nil {
19973		return err
19974	}
19975	future.FutureAPI = &azFuture
19976	future.Result = future.result
19977	return nil
19978}
19979
19980// result is the default implementation for ServerDNSAliasesAcquireFuture.Result.
19981func (future *ServerDNSAliasesAcquireFuture) result(client ServerDNSAliasesClient) (ar autorest.Response, err error) {
19982	var done bool
19983	done, err = future.DoneWithContext(context.Background(), client)
19984	if err != nil {
19985		err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesAcquireFuture", "Result", future.Response(), "Polling failure")
19986		return
19987	}
19988	if !done {
19989		ar.Response = future.Response()
19990		err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesAcquireFuture")
19991		return
19992	}
19993	ar.Response = future.Response()
19994	return
19995}
19996
19997// ServerDNSAliasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
19998// long-running operation.
19999type ServerDNSAliasesCreateOrUpdateFuture struct {
20000	azure.FutureAPI
20001	// Result returns the result of the asynchronous operation.
20002	// If the operation has not completed it will return an error.
20003	Result func(ServerDNSAliasesClient) (ServerDNSAlias, error)
20004}
20005
20006// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20007func (future *ServerDNSAliasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
20008	var azFuture azure.Future
20009	if err := json.Unmarshal(body, &azFuture); err != nil {
20010		return err
20011	}
20012	future.FutureAPI = &azFuture
20013	future.Result = future.result
20014	return nil
20015}
20016
20017// result is the default implementation for ServerDNSAliasesCreateOrUpdateFuture.Result.
20018func (future *ServerDNSAliasesCreateOrUpdateFuture) result(client ServerDNSAliasesClient) (sda ServerDNSAlias, err error) {
20019	var done bool
20020	done, err = future.DoneWithContext(context.Background(), client)
20021	if err != nil {
20022		err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
20023		return
20024	}
20025	if !done {
20026		sda.Response.Response = future.Response()
20027		err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesCreateOrUpdateFuture")
20028		return
20029	}
20030	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20031	if sda.Response.Response, err = future.GetResult(sender); err == nil && sda.Response.Response.StatusCode != http.StatusNoContent {
20032		sda, err = client.CreateOrUpdateResponder(sda.Response.Response)
20033		if err != nil {
20034			err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesCreateOrUpdateFuture", "Result", sda.Response.Response, "Failure responding to request")
20035		}
20036	}
20037	return
20038}
20039
20040// ServerDNSAliasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
20041// operation.
20042type ServerDNSAliasesDeleteFuture struct {
20043	azure.FutureAPI
20044	// Result returns the result of the asynchronous operation.
20045	// If the operation has not completed it will return an error.
20046	Result func(ServerDNSAliasesClient) (autorest.Response, error)
20047}
20048
20049// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20050func (future *ServerDNSAliasesDeleteFuture) UnmarshalJSON(body []byte) error {
20051	var azFuture azure.Future
20052	if err := json.Unmarshal(body, &azFuture); err != nil {
20053		return err
20054	}
20055	future.FutureAPI = &azFuture
20056	future.Result = future.result
20057	return nil
20058}
20059
20060// result is the default implementation for ServerDNSAliasesDeleteFuture.Result.
20061func (future *ServerDNSAliasesDeleteFuture) result(client ServerDNSAliasesClient) (ar autorest.Response, err error) {
20062	var done bool
20063	done, err = future.DoneWithContext(context.Background(), client)
20064	if err != nil {
20065		err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesDeleteFuture", "Result", future.Response(), "Polling failure")
20066		return
20067	}
20068	if !done {
20069		ar.Response = future.Response()
20070		err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesDeleteFuture")
20071		return
20072	}
20073	ar.Response = future.Response()
20074	return
20075}
20076
20077// ServerDNSAliasListResult a list of server DNS aliases.
20078type ServerDNSAliasListResult struct {
20079	autorest.Response `json:"-"`
20080	// Value - READ-ONLY; Array of results.
20081	Value *[]ServerDNSAlias `json:"value,omitempty"`
20082	// NextLink - READ-ONLY; Link to retrieve next page of results.
20083	NextLink *string `json:"nextLink,omitempty"`
20084}
20085
20086// MarshalJSON is the custom marshaler for ServerDNSAliasListResult.
20087func (sdalr ServerDNSAliasListResult) MarshalJSON() ([]byte, error) {
20088	objectMap := make(map[string]interface{})
20089	return json.Marshal(objectMap)
20090}
20091
20092// ServerDNSAliasListResultIterator provides access to a complete listing of ServerDNSAlias values.
20093type ServerDNSAliasListResultIterator struct {
20094	i    int
20095	page ServerDNSAliasListResultPage
20096}
20097
20098// NextWithContext advances to the next value.  If there was an error making
20099// the request the iterator does not advance and the error is returned.
20100func (iter *ServerDNSAliasListResultIterator) NextWithContext(ctx context.Context) (err error) {
20101	if tracing.IsEnabled() {
20102		ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasListResultIterator.NextWithContext")
20103		defer func() {
20104			sc := -1
20105			if iter.Response().Response.Response != nil {
20106				sc = iter.Response().Response.Response.StatusCode
20107			}
20108			tracing.EndSpan(ctx, sc, err)
20109		}()
20110	}
20111	iter.i++
20112	if iter.i < len(iter.page.Values()) {
20113		return nil
20114	}
20115	err = iter.page.NextWithContext(ctx)
20116	if err != nil {
20117		iter.i--
20118		return err
20119	}
20120	iter.i = 0
20121	return nil
20122}
20123
20124// Next advances to the next value.  If there was an error making
20125// the request the iterator does not advance and the error is returned.
20126// Deprecated: Use NextWithContext() instead.
20127func (iter *ServerDNSAliasListResultIterator) Next() error {
20128	return iter.NextWithContext(context.Background())
20129}
20130
20131// NotDone returns true if the enumeration should be started or is not yet complete.
20132func (iter ServerDNSAliasListResultIterator) NotDone() bool {
20133	return iter.page.NotDone() && iter.i < len(iter.page.Values())
20134}
20135
20136// Response returns the raw server response from the last page request.
20137func (iter ServerDNSAliasListResultIterator) Response() ServerDNSAliasListResult {
20138	return iter.page.Response()
20139}
20140
20141// Value returns the current value or a zero-initialized value if the
20142// iterator has advanced beyond the end of the collection.
20143func (iter ServerDNSAliasListResultIterator) Value() ServerDNSAlias {
20144	if !iter.page.NotDone() {
20145		return ServerDNSAlias{}
20146	}
20147	return iter.page.Values()[iter.i]
20148}
20149
20150// Creates a new instance of the ServerDNSAliasListResultIterator type.
20151func NewServerDNSAliasListResultIterator(page ServerDNSAliasListResultPage) ServerDNSAliasListResultIterator {
20152	return ServerDNSAliasListResultIterator{page: page}
20153}
20154
20155// IsEmpty returns true if the ListResult contains no values.
20156func (sdalr ServerDNSAliasListResult) IsEmpty() bool {
20157	return sdalr.Value == nil || len(*sdalr.Value) == 0
20158}
20159
20160// hasNextLink returns true if the NextLink is not empty.
20161func (sdalr ServerDNSAliasListResult) hasNextLink() bool {
20162	return sdalr.NextLink != nil && len(*sdalr.NextLink) != 0
20163}
20164
20165// serverDNSAliasListResultPreparer prepares a request to retrieve the next set of results.
20166// It returns nil if no more results exist.
20167func (sdalr ServerDNSAliasListResult) serverDNSAliasListResultPreparer(ctx context.Context) (*http.Request, error) {
20168	if !sdalr.hasNextLink() {
20169		return nil, nil
20170	}
20171	return autorest.Prepare((&http.Request{}).WithContext(ctx),
20172		autorest.AsJSON(),
20173		autorest.AsGet(),
20174		autorest.WithBaseURL(to.String(sdalr.NextLink)))
20175}
20176
20177// ServerDNSAliasListResultPage contains a page of ServerDNSAlias values.
20178type ServerDNSAliasListResultPage struct {
20179	fn    func(context.Context, ServerDNSAliasListResult) (ServerDNSAliasListResult, error)
20180	sdalr ServerDNSAliasListResult
20181}
20182
20183// NextWithContext advances to the next page of values.  If there was an error making
20184// the request the page does not advance and the error is returned.
20185func (page *ServerDNSAliasListResultPage) NextWithContext(ctx context.Context) (err error) {
20186	if tracing.IsEnabled() {
20187		ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasListResultPage.NextWithContext")
20188		defer func() {
20189			sc := -1
20190			if page.Response().Response.Response != nil {
20191				sc = page.Response().Response.Response.StatusCode
20192			}
20193			tracing.EndSpan(ctx, sc, err)
20194		}()
20195	}
20196	for {
20197		next, err := page.fn(ctx, page.sdalr)
20198		if err != nil {
20199			return err
20200		}
20201		page.sdalr = next
20202		if !next.hasNextLink() || !next.IsEmpty() {
20203			break
20204		}
20205	}
20206	return nil
20207}
20208
20209// Next advances to the next page of values.  If there was an error making
20210// the request the page does not advance and the error is returned.
20211// Deprecated: Use NextWithContext() instead.
20212func (page *ServerDNSAliasListResultPage) Next() error {
20213	return page.NextWithContext(context.Background())
20214}
20215
20216// NotDone returns true if the page enumeration should be started or is not yet complete.
20217func (page ServerDNSAliasListResultPage) NotDone() bool {
20218	return !page.sdalr.IsEmpty()
20219}
20220
20221// Response returns the raw server response from the last page request.
20222func (page ServerDNSAliasListResultPage) Response() ServerDNSAliasListResult {
20223	return page.sdalr
20224}
20225
20226// Values returns the slice of values for the current page or nil if there are no values.
20227func (page ServerDNSAliasListResultPage) Values() []ServerDNSAlias {
20228	if page.sdalr.IsEmpty() {
20229		return nil
20230	}
20231	return *page.sdalr.Value
20232}
20233
20234// Creates a new instance of the ServerDNSAliasListResultPage type.
20235func NewServerDNSAliasListResultPage(cur ServerDNSAliasListResult, getNextPage func(context.Context, ServerDNSAliasListResult) (ServerDNSAliasListResult, error)) ServerDNSAliasListResultPage {
20236	return ServerDNSAliasListResultPage{
20237		fn:    getNextPage,
20238		sdalr: cur,
20239	}
20240}
20241
20242// ServerDNSAliasProperties properties of a server DNS alias.
20243type ServerDNSAliasProperties struct {
20244	// AzureDNSRecord - READ-ONLY; The fully qualified DNS record for alias
20245	AzureDNSRecord *string `json:"azureDnsRecord,omitempty"`
20246}
20247
20248// MarshalJSON is the custom marshaler for ServerDNSAliasProperties.
20249func (sdap ServerDNSAliasProperties) MarshalJSON() ([]byte, error) {
20250	objectMap := make(map[string]interface{})
20251	return json.Marshal(objectMap)
20252}
20253
20254// ServerInfo server info for the server trust group.
20255type ServerInfo struct {
20256	// ServerID - Server Id.
20257	ServerID *string `json:"serverId,omitempty"`
20258}
20259
20260// ServerKey a server key.
20261type ServerKey struct {
20262	autorest.Response `json:"-"`
20263	// Kind - Kind of encryption protector. This is metadata used for the Azure portal experience.
20264	Kind *string `json:"kind,omitempty"`
20265	// Location - READ-ONLY; Resource location.
20266	Location *string `json:"location,omitempty"`
20267	// ServerKeyProperties - Resource properties.
20268	*ServerKeyProperties `json:"properties,omitempty"`
20269	// ID - READ-ONLY; Resource ID.
20270	ID *string `json:"id,omitempty"`
20271	// Name - READ-ONLY; Resource name.
20272	Name *string `json:"name,omitempty"`
20273	// Type - READ-ONLY; Resource type.
20274	Type *string `json:"type,omitempty"`
20275}
20276
20277// MarshalJSON is the custom marshaler for ServerKey.
20278func (sk ServerKey) MarshalJSON() ([]byte, error) {
20279	objectMap := make(map[string]interface{})
20280	if sk.Kind != nil {
20281		objectMap["kind"] = sk.Kind
20282	}
20283	if sk.ServerKeyProperties != nil {
20284		objectMap["properties"] = sk.ServerKeyProperties
20285	}
20286	return json.Marshal(objectMap)
20287}
20288
20289// UnmarshalJSON is the custom unmarshaler for ServerKey struct.
20290func (sk *ServerKey) UnmarshalJSON(body []byte) error {
20291	var m map[string]*json.RawMessage
20292	err := json.Unmarshal(body, &m)
20293	if err != nil {
20294		return err
20295	}
20296	for k, v := range m {
20297		switch k {
20298		case "kind":
20299			if v != nil {
20300				var kind string
20301				err = json.Unmarshal(*v, &kind)
20302				if err != nil {
20303					return err
20304				}
20305				sk.Kind = &kind
20306			}
20307		case "location":
20308			if v != nil {
20309				var location string
20310				err = json.Unmarshal(*v, &location)
20311				if err != nil {
20312					return err
20313				}
20314				sk.Location = &location
20315			}
20316		case "properties":
20317			if v != nil {
20318				var serverKeyProperties ServerKeyProperties
20319				err = json.Unmarshal(*v, &serverKeyProperties)
20320				if err != nil {
20321					return err
20322				}
20323				sk.ServerKeyProperties = &serverKeyProperties
20324			}
20325		case "id":
20326			if v != nil {
20327				var ID string
20328				err = json.Unmarshal(*v, &ID)
20329				if err != nil {
20330					return err
20331				}
20332				sk.ID = &ID
20333			}
20334		case "name":
20335			if v != nil {
20336				var name string
20337				err = json.Unmarshal(*v, &name)
20338				if err != nil {
20339					return err
20340				}
20341				sk.Name = &name
20342			}
20343		case "type":
20344			if v != nil {
20345				var typeVar string
20346				err = json.Unmarshal(*v, &typeVar)
20347				if err != nil {
20348					return err
20349				}
20350				sk.Type = &typeVar
20351			}
20352		}
20353	}
20354
20355	return nil
20356}
20357
20358// ServerKeyListResult a list of server keys.
20359type ServerKeyListResult struct {
20360	autorest.Response `json:"-"`
20361	// Value - READ-ONLY; Array of results.
20362	Value *[]ServerKey `json:"value,omitempty"`
20363	// NextLink - READ-ONLY; Link to retrieve next page of results.
20364	NextLink *string `json:"nextLink,omitempty"`
20365}
20366
20367// MarshalJSON is the custom marshaler for ServerKeyListResult.
20368func (sklr ServerKeyListResult) MarshalJSON() ([]byte, error) {
20369	objectMap := make(map[string]interface{})
20370	return json.Marshal(objectMap)
20371}
20372
20373// ServerKeyListResultIterator provides access to a complete listing of ServerKey values.
20374type ServerKeyListResultIterator struct {
20375	i    int
20376	page ServerKeyListResultPage
20377}
20378
20379// NextWithContext advances to the next value.  If there was an error making
20380// the request the iterator does not advance and the error is returned.
20381func (iter *ServerKeyListResultIterator) NextWithContext(ctx context.Context) (err error) {
20382	if tracing.IsEnabled() {
20383		ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeyListResultIterator.NextWithContext")
20384		defer func() {
20385			sc := -1
20386			if iter.Response().Response.Response != nil {
20387				sc = iter.Response().Response.Response.StatusCode
20388			}
20389			tracing.EndSpan(ctx, sc, err)
20390		}()
20391	}
20392	iter.i++
20393	if iter.i < len(iter.page.Values()) {
20394		return nil
20395	}
20396	err = iter.page.NextWithContext(ctx)
20397	if err != nil {
20398		iter.i--
20399		return err
20400	}
20401	iter.i = 0
20402	return nil
20403}
20404
20405// Next advances to the next value.  If there was an error making
20406// the request the iterator does not advance and the error is returned.
20407// Deprecated: Use NextWithContext() instead.
20408func (iter *ServerKeyListResultIterator) Next() error {
20409	return iter.NextWithContext(context.Background())
20410}
20411
20412// NotDone returns true if the enumeration should be started or is not yet complete.
20413func (iter ServerKeyListResultIterator) NotDone() bool {
20414	return iter.page.NotDone() && iter.i < len(iter.page.Values())
20415}
20416
20417// Response returns the raw server response from the last page request.
20418func (iter ServerKeyListResultIterator) Response() ServerKeyListResult {
20419	return iter.page.Response()
20420}
20421
20422// Value returns the current value or a zero-initialized value if the
20423// iterator has advanced beyond the end of the collection.
20424func (iter ServerKeyListResultIterator) Value() ServerKey {
20425	if !iter.page.NotDone() {
20426		return ServerKey{}
20427	}
20428	return iter.page.Values()[iter.i]
20429}
20430
20431// Creates a new instance of the ServerKeyListResultIterator type.
20432func NewServerKeyListResultIterator(page ServerKeyListResultPage) ServerKeyListResultIterator {
20433	return ServerKeyListResultIterator{page: page}
20434}
20435
20436// IsEmpty returns true if the ListResult contains no values.
20437func (sklr ServerKeyListResult) IsEmpty() bool {
20438	return sklr.Value == nil || len(*sklr.Value) == 0
20439}
20440
20441// hasNextLink returns true if the NextLink is not empty.
20442func (sklr ServerKeyListResult) hasNextLink() bool {
20443	return sklr.NextLink != nil && len(*sklr.NextLink) != 0
20444}
20445
20446// serverKeyListResultPreparer prepares a request to retrieve the next set of results.
20447// It returns nil if no more results exist.
20448func (sklr ServerKeyListResult) serverKeyListResultPreparer(ctx context.Context) (*http.Request, error) {
20449	if !sklr.hasNextLink() {
20450		return nil, nil
20451	}
20452	return autorest.Prepare((&http.Request{}).WithContext(ctx),
20453		autorest.AsJSON(),
20454		autorest.AsGet(),
20455		autorest.WithBaseURL(to.String(sklr.NextLink)))
20456}
20457
20458// ServerKeyListResultPage contains a page of ServerKey values.
20459type ServerKeyListResultPage struct {
20460	fn   func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)
20461	sklr ServerKeyListResult
20462}
20463
20464// NextWithContext advances to the next page of values.  If there was an error making
20465// the request the page does not advance and the error is returned.
20466func (page *ServerKeyListResultPage) NextWithContext(ctx context.Context) (err error) {
20467	if tracing.IsEnabled() {
20468		ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeyListResultPage.NextWithContext")
20469		defer func() {
20470			sc := -1
20471			if page.Response().Response.Response != nil {
20472				sc = page.Response().Response.Response.StatusCode
20473			}
20474			tracing.EndSpan(ctx, sc, err)
20475		}()
20476	}
20477	for {
20478		next, err := page.fn(ctx, page.sklr)
20479		if err != nil {
20480			return err
20481		}
20482		page.sklr = next
20483		if !next.hasNextLink() || !next.IsEmpty() {
20484			break
20485		}
20486	}
20487	return nil
20488}
20489
20490// Next advances to the next page of values.  If there was an error making
20491// the request the page does not advance and the error is returned.
20492// Deprecated: Use NextWithContext() instead.
20493func (page *ServerKeyListResultPage) Next() error {
20494	return page.NextWithContext(context.Background())
20495}
20496
20497// NotDone returns true if the page enumeration should be started or is not yet complete.
20498func (page ServerKeyListResultPage) NotDone() bool {
20499	return !page.sklr.IsEmpty()
20500}
20501
20502// Response returns the raw server response from the last page request.
20503func (page ServerKeyListResultPage) Response() ServerKeyListResult {
20504	return page.sklr
20505}
20506
20507// Values returns the slice of values for the current page or nil if there are no values.
20508func (page ServerKeyListResultPage) Values() []ServerKey {
20509	if page.sklr.IsEmpty() {
20510		return nil
20511	}
20512	return *page.sklr.Value
20513}
20514
20515// Creates a new instance of the ServerKeyListResultPage type.
20516func NewServerKeyListResultPage(cur ServerKeyListResult, getNextPage func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)) ServerKeyListResultPage {
20517	return ServerKeyListResultPage{
20518		fn:   getNextPage,
20519		sklr: cur,
20520	}
20521}
20522
20523// ServerKeyProperties properties for a server key execution.
20524type ServerKeyProperties struct {
20525	// Subregion - READ-ONLY; Subregion of the server key.
20526	Subregion *string `json:"subregion,omitempty"`
20527	// ServerKeyType - The server key type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
20528	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
20529	// URI - The URI of the server key.
20530	URI *string `json:"uri,omitempty"`
20531	// Thumbprint - Thumbprint of the server key.
20532	Thumbprint *string `json:"thumbprint,omitempty"`
20533	// CreationDate - The server key creation date.
20534	CreationDate *date.Time `json:"creationDate,omitempty"`
20535}
20536
20537// MarshalJSON is the custom marshaler for ServerKeyProperties.
20538func (skp ServerKeyProperties) MarshalJSON() ([]byte, error) {
20539	objectMap := make(map[string]interface{})
20540	if skp.ServerKeyType != "" {
20541		objectMap["serverKeyType"] = skp.ServerKeyType
20542	}
20543	if skp.URI != nil {
20544		objectMap["uri"] = skp.URI
20545	}
20546	if skp.Thumbprint != nil {
20547		objectMap["thumbprint"] = skp.Thumbprint
20548	}
20549	if skp.CreationDate != nil {
20550		objectMap["creationDate"] = skp.CreationDate
20551	}
20552	return json.Marshal(objectMap)
20553}
20554
20555// ServerKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
20556// long-running operation.
20557type ServerKeysCreateOrUpdateFuture struct {
20558	azure.FutureAPI
20559	// Result returns the result of the asynchronous operation.
20560	// If the operation has not completed it will return an error.
20561	Result func(ServerKeysClient) (ServerKey, error)
20562}
20563
20564// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20565func (future *ServerKeysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
20566	var azFuture azure.Future
20567	if err := json.Unmarshal(body, &azFuture); err != nil {
20568		return err
20569	}
20570	future.FutureAPI = &azFuture
20571	future.Result = future.result
20572	return nil
20573}
20574
20575// result is the default implementation for ServerKeysCreateOrUpdateFuture.Result.
20576func (future *ServerKeysCreateOrUpdateFuture) result(client ServerKeysClient) (sk ServerKey, err error) {
20577	var done bool
20578	done, err = future.DoneWithContext(context.Background(), client)
20579	if err != nil {
20580		err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
20581		return
20582	}
20583	if !done {
20584		sk.Response.Response = future.Response()
20585		err = azure.NewAsyncOpIncompleteError("sql.ServerKeysCreateOrUpdateFuture")
20586		return
20587	}
20588	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20589	if sk.Response.Response, err = future.GetResult(sender); err == nil && sk.Response.Response.StatusCode != http.StatusNoContent {
20590		sk, err = client.CreateOrUpdateResponder(sk.Response.Response)
20591		if err != nil {
20592			err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", sk.Response.Response, "Failure responding to request")
20593		}
20594	}
20595	return
20596}
20597
20598// ServerKeysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
20599// operation.
20600type ServerKeysDeleteFuture struct {
20601	azure.FutureAPI
20602	// Result returns the result of the asynchronous operation.
20603	// If the operation has not completed it will return an error.
20604	Result func(ServerKeysClient) (autorest.Response, error)
20605}
20606
20607// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20608func (future *ServerKeysDeleteFuture) UnmarshalJSON(body []byte) error {
20609	var azFuture azure.Future
20610	if err := json.Unmarshal(body, &azFuture); err != nil {
20611		return err
20612	}
20613	future.FutureAPI = &azFuture
20614	future.Result = future.result
20615	return nil
20616}
20617
20618// result is the default implementation for ServerKeysDeleteFuture.Result.
20619func (future *ServerKeysDeleteFuture) result(client ServerKeysClient) (ar autorest.Response, err error) {
20620	var done bool
20621	done, err = future.DoneWithContext(context.Background(), client)
20622	if err != nil {
20623		err = autorest.NewErrorWithError(err, "sql.ServerKeysDeleteFuture", "Result", future.Response(), "Polling failure")
20624		return
20625	}
20626	if !done {
20627		ar.Response = future.Response()
20628		err = azure.NewAsyncOpIncompleteError("sql.ServerKeysDeleteFuture")
20629		return
20630	}
20631	ar.Response = future.Response()
20632	return
20633}
20634
20635// ServerListResult a list of servers.
20636type ServerListResult struct {
20637	autorest.Response `json:"-"`
20638	// Value - READ-ONLY; Array of results.
20639	Value *[]Server `json:"value,omitempty"`
20640	// NextLink - READ-ONLY; Link to retrieve next page of results.
20641	NextLink *string `json:"nextLink,omitempty"`
20642}
20643
20644// MarshalJSON is the custom marshaler for ServerListResult.
20645func (slr ServerListResult) MarshalJSON() ([]byte, error) {
20646	objectMap := make(map[string]interface{})
20647	return json.Marshal(objectMap)
20648}
20649
20650// ServerListResultIterator provides access to a complete listing of Server values.
20651type ServerListResultIterator struct {
20652	i    int
20653	page ServerListResultPage
20654}
20655
20656// NextWithContext advances to the next value.  If there was an error making
20657// the request the iterator does not advance and the error is returned.
20658func (iter *ServerListResultIterator) NextWithContext(ctx context.Context) (err error) {
20659	if tracing.IsEnabled() {
20660		ctx = tracing.StartSpan(ctx, fqdn+"/ServerListResultIterator.NextWithContext")
20661		defer func() {
20662			sc := -1
20663			if iter.Response().Response.Response != nil {
20664				sc = iter.Response().Response.Response.StatusCode
20665			}
20666			tracing.EndSpan(ctx, sc, err)
20667		}()
20668	}
20669	iter.i++
20670	if iter.i < len(iter.page.Values()) {
20671		return nil
20672	}
20673	err = iter.page.NextWithContext(ctx)
20674	if err != nil {
20675		iter.i--
20676		return err
20677	}
20678	iter.i = 0
20679	return nil
20680}
20681
20682// Next advances to the next value.  If there was an error making
20683// the request the iterator does not advance and the error is returned.
20684// Deprecated: Use NextWithContext() instead.
20685func (iter *ServerListResultIterator) Next() error {
20686	return iter.NextWithContext(context.Background())
20687}
20688
20689// NotDone returns true if the enumeration should be started or is not yet complete.
20690func (iter ServerListResultIterator) NotDone() bool {
20691	return iter.page.NotDone() && iter.i < len(iter.page.Values())
20692}
20693
20694// Response returns the raw server response from the last page request.
20695func (iter ServerListResultIterator) Response() ServerListResult {
20696	return iter.page.Response()
20697}
20698
20699// Value returns the current value or a zero-initialized value if the
20700// iterator has advanced beyond the end of the collection.
20701func (iter ServerListResultIterator) Value() Server {
20702	if !iter.page.NotDone() {
20703		return Server{}
20704	}
20705	return iter.page.Values()[iter.i]
20706}
20707
20708// Creates a new instance of the ServerListResultIterator type.
20709func NewServerListResultIterator(page ServerListResultPage) ServerListResultIterator {
20710	return ServerListResultIterator{page: page}
20711}
20712
20713// IsEmpty returns true if the ListResult contains no values.
20714func (slr ServerListResult) IsEmpty() bool {
20715	return slr.Value == nil || len(*slr.Value) == 0
20716}
20717
20718// hasNextLink returns true if the NextLink is not empty.
20719func (slr ServerListResult) hasNextLink() bool {
20720	return slr.NextLink != nil && len(*slr.NextLink) != 0
20721}
20722
20723// serverListResultPreparer prepares a request to retrieve the next set of results.
20724// It returns nil if no more results exist.
20725func (slr ServerListResult) serverListResultPreparer(ctx context.Context) (*http.Request, error) {
20726	if !slr.hasNextLink() {
20727		return nil, nil
20728	}
20729	return autorest.Prepare((&http.Request{}).WithContext(ctx),
20730		autorest.AsJSON(),
20731		autorest.AsGet(),
20732		autorest.WithBaseURL(to.String(slr.NextLink)))
20733}
20734
20735// ServerListResultPage contains a page of Server values.
20736type ServerListResultPage struct {
20737	fn  func(context.Context, ServerListResult) (ServerListResult, error)
20738	slr ServerListResult
20739}
20740
20741// NextWithContext advances to the next page of values.  If there was an error making
20742// the request the page does not advance and the error is returned.
20743func (page *ServerListResultPage) NextWithContext(ctx context.Context) (err error) {
20744	if tracing.IsEnabled() {
20745		ctx = tracing.StartSpan(ctx, fqdn+"/ServerListResultPage.NextWithContext")
20746		defer func() {
20747			sc := -1
20748			if page.Response().Response.Response != nil {
20749				sc = page.Response().Response.Response.StatusCode
20750			}
20751			tracing.EndSpan(ctx, sc, err)
20752		}()
20753	}
20754	for {
20755		next, err := page.fn(ctx, page.slr)
20756		if err != nil {
20757			return err
20758		}
20759		page.slr = next
20760		if !next.hasNextLink() || !next.IsEmpty() {
20761			break
20762		}
20763	}
20764	return nil
20765}
20766
20767// Next advances to the next page of values.  If there was an error making
20768// the request the page does not advance and the error is returned.
20769// Deprecated: Use NextWithContext() instead.
20770func (page *ServerListResultPage) Next() error {
20771	return page.NextWithContext(context.Background())
20772}
20773
20774// NotDone returns true if the page enumeration should be started or is not yet complete.
20775func (page ServerListResultPage) NotDone() bool {
20776	return !page.slr.IsEmpty()
20777}
20778
20779// Response returns the raw server response from the last page request.
20780func (page ServerListResultPage) Response() ServerListResult {
20781	return page.slr
20782}
20783
20784// Values returns the slice of values for the current page or nil if there are no values.
20785func (page ServerListResultPage) Values() []Server {
20786	if page.slr.IsEmpty() {
20787		return nil
20788	}
20789	return *page.slr.Value
20790}
20791
20792// Creates a new instance of the ServerListResultPage type.
20793func NewServerListResultPage(cur ServerListResult, getNextPage func(context.Context, ServerListResult) (ServerListResult, error)) ServerListResultPage {
20794	return ServerListResultPage{
20795		fn:  getNextPage,
20796		slr: cur,
20797	}
20798}
20799
20800// ServerPrivateEndpointConnection a private endpoint connection under a server
20801type ServerPrivateEndpointConnection struct {
20802	// ID - READ-ONLY; Resource ID.
20803	ID *string `json:"id,omitempty"`
20804	// Properties - READ-ONLY; Private endpoint connection properties
20805	Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
20806}
20807
20808// MarshalJSON is the custom marshaler for ServerPrivateEndpointConnection.
20809func (spec ServerPrivateEndpointConnection) MarshalJSON() ([]byte, error) {
20810	objectMap := make(map[string]interface{})
20811	return json.Marshal(objectMap)
20812}
20813
20814// ServerProperties the properties of a server.
20815type ServerProperties struct {
20816	// AdministratorLogin - Administrator username for the server. Once created it cannot be changed.
20817	AdministratorLogin *string `json:"administratorLogin,omitempty"`
20818	// AdministratorLoginPassword - The administrator login password (required for server creation).
20819	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
20820	// Version - The version of the server.
20821	Version *string `json:"version,omitempty"`
20822	// State - READ-ONLY; The state of the server.
20823	State *string `json:"state,omitempty"`
20824	// FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the server.
20825	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
20826	// PrivateEndpointConnections - READ-ONLY; List of private endpoint connections on a server
20827	PrivateEndpointConnections *[]ServerPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
20828	// MinimalTLSVersion - Minimal TLS version. Allowed values: '1.0', '1.1', '1.2'
20829	MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"`
20830	// 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'
20831	PublicNetworkAccess ServerPublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
20832}
20833
20834// MarshalJSON is the custom marshaler for ServerProperties.
20835func (sp ServerProperties) MarshalJSON() ([]byte, error) {
20836	objectMap := make(map[string]interface{})
20837	if sp.AdministratorLogin != nil {
20838		objectMap["administratorLogin"] = sp.AdministratorLogin
20839	}
20840	if sp.AdministratorLoginPassword != nil {
20841		objectMap["administratorLoginPassword"] = sp.AdministratorLoginPassword
20842	}
20843	if sp.Version != nil {
20844		objectMap["version"] = sp.Version
20845	}
20846	if sp.MinimalTLSVersion != nil {
20847		objectMap["minimalTlsVersion"] = sp.MinimalTLSVersion
20848	}
20849	if sp.PublicNetworkAccess != "" {
20850		objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess
20851	}
20852	return json.Marshal(objectMap)
20853}
20854
20855// ServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
20856// operation.
20857type ServersCreateOrUpdateFuture struct {
20858	azure.FutureAPI
20859	// Result returns the result of the asynchronous operation.
20860	// If the operation has not completed it will return an error.
20861	Result func(ServersClient) (Server, error)
20862}
20863
20864// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20865func (future *ServersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
20866	var azFuture azure.Future
20867	if err := json.Unmarshal(body, &azFuture); err != nil {
20868		return err
20869	}
20870	future.FutureAPI = &azFuture
20871	future.Result = future.result
20872	return nil
20873}
20874
20875// result is the default implementation for ServersCreateOrUpdateFuture.Result.
20876func (future *ServersCreateOrUpdateFuture) result(client ServersClient) (s Server, err error) {
20877	var done bool
20878	done, err = future.DoneWithContext(context.Background(), client)
20879	if err != nil {
20880		err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
20881		return
20882	}
20883	if !done {
20884		s.Response.Response = future.Response()
20885		err = azure.NewAsyncOpIncompleteError("sql.ServersCreateOrUpdateFuture")
20886		return
20887	}
20888	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20889	if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
20890		s, err = client.CreateOrUpdateResponder(s.Response.Response)
20891		if err != nil {
20892			err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
20893		}
20894	}
20895	return
20896}
20897
20898// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
20899// operation.
20900type ServersDeleteFuture struct {
20901	azure.FutureAPI
20902	// Result returns the result of the asynchronous operation.
20903	// If the operation has not completed it will return an error.
20904	Result func(ServersClient) (autorest.Response, error)
20905}
20906
20907// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20908func (future *ServersDeleteFuture) UnmarshalJSON(body []byte) error {
20909	var azFuture azure.Future
20910	if err := json.Unmarshal(body, &azFuture); err != nil {
20911		return err
20912	}
20913	future.FutureAPI = &azFuture
20914	future.Result = future.result
20915	return nil
20916}
20917
20918// result is the default implementation for ServersDeleteFuture.Result.
20919func (future *ServersDeleteFuture) result(client ServersClient) (ar autorest.Response, err error) {
20920	var done bool
20921	done, err = future.DoneWithContext(context.Background(), client)
20922	if err != nil {
20923		err = autorest.NewErrorWithError(err, "sql.ServersDeleteFuture", "Result", future.Response(), "Polling failure")
20924		return
20925	}
20926	if !done {
20927		ar.Response = future.Response()
20928		err = azure.NewAsyncOpIncompleteError("sql.ServersDeleteFuture")
20929		return
20930	}
20931	ar.Response = future.Response()
20932	return
20933}
20934
20935// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
20936// of a long-running operation.
20937type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct {
20938	azure.FutureAPI
20939	// Result returns the result of the asynchronous operation.
20940	// If the operation has not completed it will return an error.
20941	Result func(ServerSecurityAlertPoliciesClient) (ServerSecurityAlertPolicy, error)
20942}
20943
20944// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20945func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
20946	var azFuture azure.Future
20947	if err := json.Unmarshal(body, &azFuture); err != nil {
20948		return err
20949	}
20950	future.FutureAPI = &azFuture
20951	future.Result = future.result
20952	return nil
20953}
20954
20955// result is the default implementation for ServerSecurityAlertPoliciesCreateOrUpdateFuture.Result.
20956func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) result(client ServerSecurityAlertPoliciesClient) (ssap ServerSecurityAlertPolicy, err error) {
20957	var done bool
20958	done, err = future.DoneWithContext(context.Background(), client)
20959	if err != nil {
20960		err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
20961		return
20962	}
20963	if !done {
20964		ssap.Response.Response = future.Response()
20965		err = azure.NewAsyncOpIncompleteError("sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture")
20966		return
20967	}
20968	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20969	if ssap.Response.Response, err = future.GetResult(sender); err == nil && ssap.Response.Response.StatusCode != http.StatusNoContent {
20970		ssap, err = client.CreateOrUpdateResponder(ssap.Response.Response)
20971		if err != nil {
20972			err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", ssap.Response.Response, "Failure responding to request")
20973		}
20974	}
20975	return
20976}
20977
20978// ServerSecurityAlertPolicy a server security alert policy.
20979type ServerSecurityAlertPolicy struct {
20980	autorest.Response `json:"-"`
20981	// SecurityAlertPolicyProperties - Resource properties.
20982	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
20983	// ID - READ-ONLY; Resource ID.
20984	ID *string `json:"id,omitempty"`
20985	// Name - READ-ONLY; Resource name.
20986	Name *string `json:"name,omitempty"`
20987	// Type - READ-ONLY; Resource type.
20988	Type *string `json:"type,omitempty"`
20989}
20990
20991// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicy.
20992func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
20993	objectMap := make(map[string]interface{})
20994	if ssap.SecurityAlertPolicyProperties != nil {
20995		objectMap["properties"] = ssap.SecurityAlertPolicyProperties
20996	}
20997	return json.Marshal(objectMap)
20998}
20999
21000// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct.
21001func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
21002	var m map[string]*json.RawMessage
21003	err := json.Unmarshal(body, &m)
21004	if err != nil {
21005		return err
21006	}
21007	for k, v := range m {
21008		switch k {
21009		case "properties":
21010			if v != nil {
21011				var securityAlertPolicyProperties SecurityAlertPolicyProperties
21012				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
21013				if err != nil {
21014					return err
21015				}
21016				ssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
21017			}
21018		case "id":
21019			if v != nil {
21020				var ID string
21021				err = json.Unmarshal(*v, &ID)
21022				if err != nil {
21023					return err
21024				}
21025				ssap.ID = &ID
21026			}
21027		case "name":
21028			if v != nil {
21029				var name string
21030				err = json.Unmarshal(*v, &name)
21031				if err != nil {
21032					return err
21033				}
21034				ssap.Name = &name
21035			}
21036		case "type":
21037			if v != nil {
21038				var typeVar string
21039				err = json.Unmarshal(*v, &typeVar)
21040				if err != nil {
21041					return err
21042				}
21043				ssap.Type = &typeVar
21044			}
21045		}
21046	}
21047
21048	return nil
21049}
21050
21051// ServersImportDatabaseFuture an abstraction for monitoring and retrieving the results of a long-running
21052// operation.
21053type ServersImportDatabaseFuture struct {
21054	azure.FutureAPI
21055	// Result returns the result of the asynchronous operation.
21056	// If the operation has not completed it will return an error.
21057	Result func(ServersClient) (ImportExportOperationResult, error)
21058}
21059
21060// UnmarshalJSON is the custom unmarshaller for CreateFuture.
21061func (future *ServersImportDatabaseFuture) UnmarshalJSON(body []byte) error {
21062	var azFuture azure.Future
21063	if err := json.Unmarshal(body, &azFuture); err != nil {
21064		return err
21065	}
21066	future.FutureAPI = &azFuture
21067	future.Result = future.result
21068	return nil
21069}
21070
21071// result is the default implementation for ServersImportDatabaseFuture.Result.
21072func (future *ServersImportDatabaseFuture) result(client ServersClient) (ieor ImportExportOperationResult, err error) {
21073	var done bool
21074	done, err = future.DoneWithContext(context.Background(), client)
21075	if err != nil {
21076		err = autorest.NewErrorWithError(err, "sql.ServersImportDatabaseFuture", "Result", future.Response(), "Polling failure")
21077		return
21078	}
21079	if !done {
21080		ieor.Response.Response = future.Response()
21081		err = azure.NewAsyncOpIncompleteError("sql.ServersImportDatabaseFuture")
21082		return
21083	}
21084	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
21085	if ieor.Response.Response, err = future.GetResult(sender); err == nil && ieor.Response.Response.StatusCode != http.StatusNoContent {
21086		ieor, err = client.ImportDatabaseResponder(ieor.Response.Response)
21087		if err != nil {
21088			err = autorest.NewErrorWithError(err, "sql.ServersImportDatabaseFuture", "Result", ieor.Response.Response, "Failure responding to request")
21089		}
21090	}
21091	return
21092}
21093
21094// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
21095// operation.
21096type ServersUpdateFuture struct {
21097	azure.FutureAPI
21098	// Result returns the result of the asynchronous operation.
21099	// If the operation has not completed it will return an error.
21100	Result func(ServersClient) (Server, error)
21101}
21102
21103// UnmarshalJSON is the custom unmarshaller for CreateFuture.
21104func (future *ServersUpdateFuture) UnmarshalJSON(body []byte) error {
21105	var azFuture azure.Future
21106	if err := json.Unmarshal(body, &azFuture); err != nil {
21107		return err
21108	}
21109	future.FutureAPI = &azFuture
21110	future.Result = future.result
21111	return nil
21112}
21113
21114// result is the default implementation for ServersUpdateFuture.Result.
21115func (future *ServersUpdateFuture) result(client ServersClient) (s Server, err error) {
21116	var done bool
21117	done, err = future.DoneWithContext(context.Background(), client)
21118	if err != nil {
21119		err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", future.Response(), "Polling failure")
21120		return
21121	}
21122	if !done {
21123		s.Response.Response = future.Response()
21124		err = azure.NewAsyncOpIncompleteError("sql.ServersUpdateFuture")
21125		return
21126	}
21127	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
21128	if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
21129		s, err = client.UpdateResponder(s.Response.Response)
21130		if err != nil {
21131			err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
21132		}
21133	}
21134	return
21135}
21136
21137// ServerTrustGroup a server trust group.
21138type ServerTrustGroup struct {
21139	autorest.Response `json:"-"`
21140	// ServerTrustGroupProperties - Resource properties.
21141	*ServerTrustGroupProperties `json:"properties,omitempty"`
21142	// ID - READ-ONLY; Resource ID.
21143	ID *string `json:"id,omitempty"`
21144	// Name - READ-ONLY; Resource name.
21145	Name *string `json:"name,omitempty"`
21146	// Type - READ-ONLY; Resource type.
21147	Type *string `json:"type,omitempty"`
21148}
21149
21150// MarshalJSON is the custom marshaler for ServerTrustGroup.
21151func (stg ServerTrustGroup) MarshalJSON() ([]byte, error) {
21152	objectMap := make(map[string]interface{})
21153	if stg.ServerTrustGroupProperties != nil {
21154		objectMap["properties"] = stg.ServerTrustGroupProperties
21155	}
21156	return json.Marshal(objectMap)
21157}
21158
21159// UnmarshalJSON is the custom unmarshaler for ServerTrustGroup struct.
21160func (stg *ServerTrustGroup) UnmarshalJSON(body []byte) error {
21161	var m map[string]*json.RawMessage
21162	err := json.Unmarshal(body, &m)
21163	if err != nil {
21164		return err
21165	}
21166	for k, v := range m {
21167		switch k {
21168		case "properties":
21169			if v != nil {
21170				var serverTrustGroupProperties ServerTrustGroupProperties
21171				err = json.Unmarshal(*v, &serverTrustGroupProperties)
21172				if err != nil {
21173					return err
21174				}
21175				stg.ServerTrustGroupProperties = &serverTrustGroupProperties
21176			}
21177		case "id":
21178			if v != nil {
21179				var ID string
21180				err = json.Unmarshal(*v, &ID)
21181				if err != nil {
21182					return err
21183				}
21184				stg.ID = &ID
21185			}
21186		case "name":
21187			if v != nil {
21188				var name string
21189				err = json.Unmarshal(*v, &name)
21190				if err != nil {
21191					return err
21192				}
21193				stg.Name = &name
21194			}
21195		case "type":
21196			if v != nil {
21197				var typeVar string
21198				err = json.Unmarshal(*v, &typeVar)
21199				if err != nil {
21200					return err
21201				}
21202				stg.Type = &typeVar
21203			}
21204		}
21205	}
21206
21207	return nil
21208}
21209
21210// ServerTrustGroupListResult a list of server trust groups.
21211type ServerTrustGroupListResult struct {
21212	autorest.Response `json:"-"`
21213	// Value - READ-ONLY; Array of results.
21214	Value *[]ServerTrustGroup `json:"value,omitempty"`
21215	// NextLink - READ-ONLY; Link to retrieve next page of results.
21216	NextLink *string `json:"nextLink,omitempty"`
21217}
21218
21219// MarshalJSON is the custom marshaler for ServerTrustGroupListResult.
21220func (stglr ServerTrustGroupListResult) MarshalJSON() ([]byte, error) {
21221	objectMap := make(map[string]interface{})
21222	return json.Marshal(objectMap)
21223}
21224
21225// ServerTrustGroupListResultIterator provides access to a complete listing of ServerTrustGroup values.
21226type ServerTrustGroupListResultIterator struct {
21227	i    int
21228	page ServerTrustGroupListResultPage
21229}
21230
21231// NextWithContext advances to the next value.  If there was an error making
21232// the request the iterator does not advance and the error is returned.
21233func (iter *ServerTrustGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
21234	if tracing.IsEnabled() {
21235		ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustGroupListResultIterator.NextWithContext")
21236		defer func() {
21237			sc := -1
21238			if iter.Response().Response.Response != nil {
21239				sc = iter.Response().Response.Response.StatusCode
21240			}
21241			tracing.EndSpan(ctx, sc, err)
21242		}()
21243	}
21244	iter.i++
21245	if iter.i < len(iter.page.Values()) {
21246		return nil
21247	}
21248	err = iter.page.NextWithContext(ctx)
21249	if err != nil {
21250		iter.i--
21251		return err
21252	}
21253	iter.i = 0
21254	return nil
21255}
21256
21257// Next advances to the next value.  If there was an error making
21258// the request the iterator does not advance and the error is returned.
21259// Deprecated: Use NextWithContext() instead.
21260func (iter *ServerTrustGroupListResultIterator) Next() error {
21261	return iter.NextWithContext(context.Background())
21262}
21263
21264// NotDone returns true if the enumeration should be started or is not yet complete.
21265func (iter ServerTrustGroupListResultIterator) NotDone() bool {
21266	return iter.page.NotDone() && iter.i < len(iter.page.Values())
21267}
21268
21269// Response returns the raw server response from the last page request.
21270func (iter ServerTrustGroupListResultIterator) Response() ServerTrustGroupListResult {
21271	return iter.page.Response()
21272}
21273
21274// Value returns the current value or a zero-initialized value if the
21275// iterator has advanced beyond the end of the collection.
21276func (iter ServerTrustGroupListResultIterator) Value() ServerTrustGroup {
21277	if !iter.page.NotDone() {
21278		return ServerTrustGroup{}
21279	}
21280	return iter.page.Values()[iter.i]
21281}
21282
21283// Creates a new instance of the ServerTrustGroupListResultIterator type.
21284func NewServerTrustGroupListResultIterator(page ServerTrustGroupListResultPage) ServerTrustGroupListResultIterator {
21285	return ServerTrustGroupListResultIterator{page: page}
21286}
21287
21288// IsEmpty returns true if the ListResult contains no values.
21289func (stglr ServerTrustGroupListResult) IsEmpty() bool {
21290	return stglr.Value == nil || len(*stglr.Value) == 0
21291}
21292
21293// hasNextLink returns true if the NextLink is not empty.
21294func (stglr ServerTrustGroupListResult) hasNextLink() bool {
21295	return stglr.NextLink != nil && len(*stglr.NextLink) != 0
21296}
21297
21298// serverTrustGroupListResultPreparer prepares a request to retrieve the next set of results.
21299// It returns nil if no more results exist.
21300func (stglr ServerTrustGroupListResult) serverTrustGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
21301	if !stglr.hasNextLink() {
21302		return nil, nil
21303	}
21304	return autorest.Prepare((&http.Request{}).WithContext(ctx),
21305		autorest.AsJSON(),
21306		autorest.AsGet(),
21307		autorest.WithBaseURL(to.String(stglr.NextLink)))
21308}
21309
21310// ServerTrustGroupListResultPage contains a page of ServerTrustGroup values.
21311type ServerTrustGroupListResultPage struct {
21312	fn    func(context.Context, ServerTrustGroupListResult) (ServerTrustGroupListResult, error)
21313	stglr ServerTrustGroupListResult
21314}
21315
21316// NextWithContext advances to the next page of values.  If there was an error making
21317// the request the page does not advance and the error is returned.
21318func (page *ServerTrustGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
21319	if tracing.IsEnabled() {
21320		ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustGroupListResultPage.NextWithContext")
21321		defer func() {
21322			sc := -1
21323			if page.Response().Response.Response != nil {
21324				sc = page.Response().Response.Response.StatusCode
21325			}
21326			tracing.EndSpan(ctx, sc, err)
21327		}()
21328	}
21329	for {
21330		next, err := page.fn(ctx, page.stglr)
21331		if err != nil {
21332			return err
21333		}
21334		page.stglr = next
21335		if !next.hasNextLink() || !next.IsEmpty() {
21336			break
21337		}
21338	}
21339	return nil
21340}
21341
21342// Next advances to the next page of values.  If there was an error making
21343// the request the page does not advance and the error is returned.
21344// Deprecated: Use NextWithContext() instead.
21345func (page *ServerTrustGroupListResultPage) Next() error {
21346	return page.NextWithContext(context.Background())
21347}
21348
21349// NotDone returns true if the page enumeration should be started or is not yet complete.
21350func (page ServerTrustGroupListResultPage) NotDone() bool {
21351	return !page.stglr.IsEmpty()
21352}
21353
21354// Response returns the raw server response from the last page request.
21355func (page ServerTrustGroupListResultPage) Response() ServerTrustGroupListResult {
21356	return page.stglr
21357}
21358
21359// Values returns the slice of values for the current page or nil if there are no values.
21360func (page ServerTrustGroupListResultPage) Values() []ServerTrustGroup {
21361	if page.stglr.IsEmpty() {
21362		return nil
21363	}
21364	return *page.stglr.Value
21365}
21366
21367// Creates a new instance of the ServerTrustGroupListResultPage type.
21368func NewServerTrustGroupListResultPage(cur ServerTrustGroupListResult, getNextPage func(context.Context, ServerTrustGroupListResult) (ServerTrustGroupListResult, error)) ServerTrustGroupListResultPage {
21369	return ServerTrustGroupListResultPage{
21370		fn:    getNextPage,
21371		stglr: cur,
21372	}
21373}
21374
21375// ServerTrustGroupProperties properties of a server trust group.
21376type ServerTrustGroupProperties struct {
21377	// GroupMembers - Group members information for the server trust group.
21378	GroupMembers *[]ServerInfo `json:"groupMembers,omitempty"`
21379	// TrustScopes - Trust scope of the server trust group.
21380	TrustScopes *[]string `json:"trustScopes,omitempty"`
21381}
21382
21383// ServerTrustGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
21384// long-running operation.
21385type ServerTrustGroupsCreateOrUpdateFuture struct {
21386	azure.FutureAPI
21387	// Result returns the result of the asynchronous operation.
21388	// If the operation has not completed it will return an error.
21389	Result func(ServerTrustGroupsClient) (ServerTrustGroup, error)
21390}
21391
21392// UnmarshalJSON is the custom unmarshaller for CreateFuture.
21393func (future *ServerTrustGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
21394	var azFuture azure.Future
21395	if err := json.Unmarshal(body, &azFuture); err != nil {
21396		return err
21397	}
21398	future.FutureAPI = &azFuture
21399	future.Result = future.result
21400	return nil
21401}
21402
21403// result is the default implementation for ServerTrustGroupsCreateOrUpdateFuture.Result.
21404func (future *ServerTrustGroupsCreateOrUpdateFuture) result(client ServerTrustGroupsClient) (stg ServerTrustGroup, err error) {
21405	var done bool
21406	done, err = future.DoneWithContext(context.Background(), client)
21407	if err != nil {
21408		err = autorest.NewErrorWithError(err, "sql.ServerTrustGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
21409		return
21410	}
21411	if !done {
21412		stg.Response.Response = future.Response()
21413		err = azure.NewAsyncOpIncompleteError("sql.ServerTrustGroupsCreateOrUpdateFuture")
21414		return
21415	}
21416	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
21417	if stg.Response.Response, err = future.GetResult(sender); err == nil && stg.Response.Response.StatusCode != http.StatusNoContent {
21418		stg, err = client.CreateOrUpdateResponder(stg.Response.Response)
21419		if err != nil {
21420			err = autorest.NewErrorWithError(err, "sql.ServerTrustGroupsCreateOrUpdateFuture", "Result", stg.Response.Response, "Failure responding to request")
21421		}
21422	}
21423	return
21424}
21425
21426// ServerTrustGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
21427// operation.
21428type ServerTrustGroupsDeleteFuture struct {
21429	azure.FutureAPI
21430	// Result returns the result of the asynchronous operation.
21431	// If the operation has not completed it will return an error.
21432	Result func(ServerTrustGroupsClient) (autorest.Response, error)
21433}
21434
21435// UnmarshalJSON is the custom unmarshaller for CreateFuture.
21436func (future *ServerTrustGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
21437	var azFuture azure.Future
21438	if err := json.Unmarshal(body, &azFuture); err != nil {
21439		return err
21440	}
21441	future.FutureAPI = &azFuture
21442	future.Result = future.result
21443	return nil
21444}
21445
21446// result is the default implementation for ServerTrustGroupsDeleteFuture.Result.
21447func (future *ServerTrustGroupsDeleteFuture) result(client ServerTrustGroupsClient) (ar autorest.Response, err error) {
21448	var done bool
21449	done, err = future.DoneWithContext(context.Background(), client)
21450	if err != nil {
21451		err = autorest.NewErrorWithError(err, "sql.ServerTrustGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
21452		return
21453	}
21454	if !done {
21455		ar.Response = future.Response()
21456		err = azure.NewAsyncOpIncompleteError("sql.ServerTrustGroupsDeleteFuture")
21457		return
21458	}
21459	ar.Response = future.Response()
21460	return
21461}
21462
21463// ServerUpdate an update request for an Azure SQL Database server.
21464type ServerUpdate struct {
21465	// ServerProperties - Resource properties.
21466	*ServerProperties `json:"properties,omitempty"`
21467	// Tags - Resource tags.
21468	Tags map[string]*string `json:"tags"`
21469}
21470
21471// MarshalJSON is the custom marshaler for ServerUpdate.
21472func (su ServerUpdate) MarshalJSON() ([]byte, error) {
21473	objectMap := make(map[string]interface{})
21474	if su.ServerProperties != nil {
21475		objectMap["properties"] = su.ServerProperties
21476	}
21477	if su.Tags != nil {
21478		objectMap["tags"] = su.Tags
21479	}
21480	return json.Marshal(objectMap)
21481}
21482
21483// UnmarshalJSON is the custom unmarshaler for ServerUpdate struct.
21484func (su *ServerUpdate) UnmarshalJSON(body []byte) error {
21485	var m map[string]*json.RawMessage
21486	err := json.Unmarshal(body, &m)
21487	if err != nil {
21488		return err
21489	}
21490	for k, v := range m {
21491		switch k {
21492		case "properties":
21493			if v != nil {
21494				var serverProperties ServerProperties
21495				err = json.Unmarshal(*v, &serverProperties)
21496				if err != nil {
21497					return err
21498				}
21499				su.ServerProperties = &serverProperties
21500			}
21501		case "tags":
21502			if v != nil {
21503				var tags map[string]*string
21504				err = json.Unmarshal(*v, &tags)
21505				if err != nil {
21506					return err
21507				}
21508				su.Tags = tags
21509			}
21510		}
21511	}
21512
21513	return nil
21514}
21515
21516// ServerUsage represents server metrics.
21517type ServerUsage struct {
21518	// Name - READ-ONLY; Name of the server usage metric.
21519	Name *string `json:"name,omitempty"`
21520	// ResourceName - READ-ONLY; The name of the resource.
21521	ResourceName *string `json:"resourceName,omitempty"`
21522	// DisplayName - READ-ONLY; The metric display name.
21523	DisplayName *string `json:"displayName,omitempty"`
21524	// CurrentValue - READ-ONLY; The current value of the metric.
21525	CurrentValue *float64 `json:"currentValue,omitempty"`
21526	// Limit - READ-ONLY; The current limit of the metric.
21527	Limit *float64 `json:"limit,omitempty"`
21528	// Unit - READ-ONLY; The units of the metric.
21529	Unit *string `json:"unit,omitempty"`
21530	// NextResetTime - READ-ONLY; The next reset time for the metric (ISO8601 format).
21531	NextResetTime *date.Time `json:"nextResetTime,omitempty"`
21532}
21533
21534// MarshalJSON is the custom marshaler for ServerUsage.
21535func (su ServerUsage) MarshalJSON() ([]byte, error) {
21536	objectMap := make(map[string]interface{})
21537	return json.Marshal(objectMap)
21538}
21539
21540// ServerUsageListResult represents the response to a list server metrics request.
21541type ServerUsageListResult struct {
21542	autorest.Response `json:"-"`
21543	// Value - The list of server metrics for the server.
21544	Value *[]ServerUsage `json:"value,omitempty"`
21545}
21546
21547// ServerVersionCapability the server capability
21548type ServerVersionCapability struct {
21549	// Name - READ-ONLY; The server version name.
21550	Name *string `json:"name,omitempty"`
21551	// SupportedEditions - READ-ONLY; The list of supported database editions.
21552	SupportedEditions *[]EditionCapability `json:"supportedEditions,omitempty"`
21553	// SupportedElasticPoolEditions - READ-ONLY; The list of supported elastic pool editions.
21554	SupportedElasticPoolEditions *[]ElasticPoolEditionCapability `json:"supportedElasticPoolEditions,omitempty"`
21555	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
21556	Status CapabilityStatus `json:"status,omitempty"`
21557	// Reason - The reason for the capability not being available.
21558	Reason *string `json:"reason,omitempty"`
21559}
21560
21561// MarshalJSON is the custom marshaler for ServerVersionCapability.
21562func (svc ServerVersionCapability) MarshalJSON() ([]byte, error) {
21563	objectMap := make(map[string]interface{})
21564	if svc.Reason != nil {
21565		objectMap["reason"] = svc.Reason
21566	}
21567	return json.Marshal(objectMap)
21568}
21569
21570// ServerVulnerabilityAssessment a server vulnerability assessment.
21571type ServerVulnerabilityAssessment struct {
21572	autorest.Response `json:"-"`
21573	// ServerVulnerabilityAssessmentProperties - Resource properties.
21574	*ServerVulnerabilityAssessmentProperties `json:"properties,omitempty"`
21575	// ID - READ-ONLY; Resource ID.
21576	ID *string `json:"id,omitempty"`
21577	// Name - READ-ONLY; Resource name.
21578	Name *string `json:"name,omitempty"`
21579	// Type - READ-ONLY; Resource type.
21580	Type *string `json:"type,omitempty"`
21581}
21582
21583// MarshalJSON is the custom marshaler for ServerVulnerabilityAssessment.
21584func (sva ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
21585	objectMap := make(map[string]interface{})
21586	if sva.ServerVulnerabilityAssessmentProperties != nil {
21587		objectMap["properties"] = sva.ServerVulnerabilityAssessmentProperties
21588	}
21589	return json.Marshal(objectMap)
21590}
21591
21592// UnmarshalJSON is the custom unmarshaler for ServerVulnerabilityAssessment struct.
21593func (sva *ServerVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
21594	var m map[string]*json.RawMessage
21595	err := json.Unmarshal(body, &m)
21596	if err != nil {
21597		return err
21598	}
21599	for k, v := range m {
21600		switch k {
21601		case "properties":
21602			if v != nil {
21603				var serverVulnerabilityAssessmentProperties ServerVulnerabilityAssessmentProperties
21604				err = json.Unmarshal(*v, &serverVulnerabilityAssessmentProperties)
21605				if err != nil {
21606					return err
21607				}
21608				sva.ServerVulnerabilityAssessmentProperties = &serverVulnerabilityAssessmentProperties
21609			}
21610		case "id":
21611			if v != nil {
21612				var ID string
21613				err = json.Unmarshal(*v, &ID)
21614				if err != nil {
21615					return err
21616				}
21617				sva.ID = &ID
21618			}
21619		case "name":
21620			if v != nil {
21621				var name string
21622				err = json.Unmarshal(*v, &name)
21623				if err != nil {
21624					return err
21625				}
21626				sva.Name = &name
21627			}
21628		case "type":
21629			if v != nil {
21630				var typeVar string
21631				err = json.Unmarshal(*v, &typeVar)
21632				if err != nil {
21633					return err
21634				}
21635				sva.Type = &typeVar
21636			}
21637		}
21638	}
21639
21640	return nil
21641}
21642
21643// ServerVulnerabilityAssessmentListResult a list of the server's vulnerability assessments.
21644type ServerVulnerabilityAssessmentListResult struct {
21645	autorest.Response `json:"-"`
21646	// Value - READ-ONLY; Array of results.
21647	Value *[]ServerVulnerabilityAssessment `json:"value,omitempty"`
21648	// NextLink - READ-ONLY; Link to retrieve next page of results.
21649	NextLink *string `json:"nextLink,omitempty"`
21650}
21651
21652// MarshalJSON is the custom marshaler for ServerVulnerabilityAssessmentListResult.
21653func (svalr ServerVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) {
21654	objectMap := make(map[string]interface{})
21655	return json.Marshal(objectMap)
21656}
21657
21658// ServerVulnerabilityAssessmentListResultIterator provides access to a complete listing of
21659// ServerVulnerabilityAssessment values.
21660type ServerVulnerabilityAssessmentListResultIterator struct {
21661	i    int
21662	page ServerVulnerabilityAssessmentListResultPage
21663}
21664
21665// NextWithContext advances to the next value.  If there was an error making
21666// the request the iterator does not advance and the error is returned.
21667func (iter *ServerVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
21668	if tracing.IsEnabled() {
21669		ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultIterator.NextWithContext")
21670		defer func() {
21671			sc := -1
21672			if iter.Response().Response.Response != nil {
21673				sc = iter.Response().Response.Response.StatusCode
21674			}
21675			tracing.EndSpan(ctx, sc, err)
21676		}()
21677	}
21678	iter.i++
21679	if iter.i < len(iter.page.Values()) {
21680		return nil
21681	}
21682	err = iter.page.NextWithContext(ctx)
21683	if err != nil {
21684		iter.i--
21685		return err
21686	}
21687	iter.i = 0
21688	return nil
21689}
21690
21691// Next advances to the next value.  If there was an error making
21692// the request the iterator does not advance and the error is returned.
21693// Deprecated: Use NextWithContext() instead.
21694func (iter *ServerVulnerabilityAssessmentListResultIterator) Next() error {
21695	return iter.NextWithContext(context.Background())
21696}
21697
21698// NotDone returns true if the enumeration should be started or is not yet complete.
21699func (iter ServerVulnerabilityAssessmentListResultIterator) NotDone() bool {
21700	return iter.page.NotDone() && iter.i < len(iter.page.Values())
21701}
21702
21703// Response returns the raw server response from the last page request.
21704func (iter ServerVulnerabilityAssessmentListResultIterator) Response() ServerVulnerabilityAssessmentListResult {
21705	return iter.page.Response()
21706}
21707
21708// Value returns the current value or a zero-initialized value if the
21709// iterator has advanced beyond the end of the collection.
21710func (iter ServerVulnerabilityAssessmentListResultIterator) Value() ServerVulnerabilityAssessment {
21711	if !iter.page.NotDone() {
21712		return ServerVulnerabilityAssessment{}
21713	}
21714	return iter.page.Values()[iter.i]
21715}
21716
21717// Creates a new instance of the ServerVulnerabilityAssessmentListResultIterator type.
21718func NewServerVulnerabilityAssessmentListResultIterator(page ServerVulnerabilityAssessmentListResultPage) ServerVulnerabilityAssessmentListResultIterator {
21719	return ServerVulnerabilityAssessmentListResultIterator{page: page}
21720}
21721
21722// IsEmpty returns true if the ListResult contains no values.
21723func (svalr ServerVulnerabilityAssessmentListResult) IsEmpty() bool {
21724	return svalr.Value == nil || len(*svalr.Value) == 0
21725}
21726
21727// hasNextLink returns true if the NextLink is not empty.
21728func (svalr ServerVulnerabilityAssessmentListResult) hasNextLink() bool {
21729	return svalr.NextLink != nil && len(*svalr.NextLink) != 0
21730}
21731
21732// serverVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
21733// It returns nil if no more results exist.
21734func (svalr ServerVulnerabilityAssessmentListResult) serverVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
21735	if !svalr.hasNextLink() {
21736		return nil, nil
21737	}
21738	return autorest.Prepare((&http.Request{}).WithContext(ctx),
21739		autorest.AsJSON(),
21740		autorest.AsGet(),
21741		autorest.WithBaseURL(to.String(svalr.NextLink)))
21742}
21743
21744// ServerVulnerabilityAssessmentListResultPage contains a page of ServerVulnerabilityAssessment values.
21745type ServerVulnerabilityAssessmentListResultPage struct {
21746	fn    func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error)
21747	svalr ServerVulnerabilityAssessmentListResult
21748}
21749
21750// NextWithContext advances to the next page of values.  If there was an error making
21751// the request the page does not advance and the error is returned.
21752func (page *ServerVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
21753	if tracing.IsEnabled() {
21754		ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultPage.NextWithContext")
21755		defer func() {
21756			sc := -1
21757			if page.Response().Response.Response != nil {
21758				sc = page.Response().Response.Response.StatusCode
21759			}
21760			tracing.EndSpan(ctx, sc, err)
21761		}()
21762	}
21763	for {
21764		next, err := page.fn(ctx, page.svalr)
21765		if err != nil {
21766			return err
21767		}
21768		page.svalr = next
21769		if !next.hasNextLink() || !next.IsEmpty() {
21770			break
21771		}
21772	}
21773	return nil
21774}
21775
21776// Next advances to the next page of values.  If there was an error making
21777// the request the page does not advance and the error is returned.
21778// Deprecated: Use NextWithContext() instead.
21779func (page *ServerVulnerabilityAssessmentListResultPage) Next() error {
21780	return page.NextWithContext(context.Background())
21781}
21782
21783// NotDone returns true if the page enumeration should be started or is not yet complete.
21784func (page ServerVulnerabilityAssessmentListResultPage) NotDone() bool {
21785	return !page.svalr.IsEmpty()
21786}
21787
21788// Response returns the raw server response from the last page request.
21789func (page ServerVulnerabilityAssessmentListResultPage) Response() ServerVulnerabilityAssessmentListResult {
21790	return page.svalr
21791}
21792
21793// Values returns the slice of values for the current page or nil if there are no values.
21794func (page ServerVulnerabilityAssessmentListResultPage) Values() []ServerVulnerabilityAssessment {
21795	if page.svalr.IsEmpty() {
21796		return nil
21797	}
21798	return *page.svalr.Value
21799}
21800
21801// Creates a new instance of the ServerVulnerabilityAssessmentListResultPage type.
21802func NewServerVulnerabilityAssessmentListResultPage(cur ServerVulnerabilityAssessmentListResult, getNextPage func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error)) ServerVulnerabilityAssessmentListResultPage {
21803	return ServerVulnerabilityAssessmentListResultPage{
21804		fn:    getNextPage,
21805		svalr: cur,
21806	}
21807}
21808
21809// ServerVulnerabilityAssessmentProperties properties of a server Vulnerability Assessment.
21810type ServerVulnerabilityAssessmentProperties struct {
21811	// StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
21812	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
21813	// 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.
21814	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
21815	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
21816	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
21817	// RecurringScans - The recurring scans settings
21818	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
21819}
21820
21821// ServiceObjective represents a database service objective.
21822type ServiceObjective struct {
21823	autorest.Response `json:"-"`
21824	// ServiceObjectiveProperties - Represents the properties of the resource.
21825	*ServiceObjectiveProperties `json:"properties,omitempty"`
21826	// ID - READ-ONLY; Resource ID.
21827	ID *string `json:"id,omitempty"`
21828	// Name - READ-ONLY; Resource name.
21829	Name *string `json:"name,omitempty"`
21830	// Type - READ-ONLY; Resource type.
21831	Type *string `json:"type,omitempty"`
21832}
21833
21834// MarshalJSON is the custom marshaler for ServiceObjective.
21835func (so ServiceObjective) MarshalJSON() ([]byte, error) {
21836	objectMap := make(map[string]interface{})
21837	if so.ServiceObjectiveProperties != nil {
21838		objectMap["properties"] = so.ServiceObjectiveProperties
21839	}
21840	return json.Marshal(objectMap)
21841}
21842
21843// UnmarshalJSON is the custom unmarshaler for ServiceObjective struct.
21844func (so *ServiceObjective) UnmarshalJSON(body []byte) error {
21845	var m map[string]*json.RawMessage
21846	err := json.Unmarshal(body, &m)
21847	if err != nil {
21848		return err
21849	}
21850	for k, v := range m {
21851		switch k {
21852		case "properties":
21853			if v != nil {
21854				var serviceObjectiveProperties ServiceObjectiveProperties
21855				err = json.Unmarshal(*v, &serviceObjectiveProperties)
21856				if err != nil {
21857					return err
21858				}
21859				so.ServiceObjectiveProperties = &serviceObjectiveProperties
21860			}
21861		case "id":
21862			if v != nil {
21863				var ID string
21864				err = json.Unmarshal(*v, &ID)
21865				if err != nil {
21866					return err
21867				}
21868				so.ID = &ID
21869			}
21870		case "name":
21871			if v != nil {
21872				var name string
21873				err = json.Unmarshal(*v, &name)
21874				if err != nil {
21875					return err
21876				}
21877				so.Name = &name
21878			}
21879		case "type":
21880			if v != nil {
21881				var typeVar string
21882				err = json.Unmarshal(*v, &typeVar)
21883				if err != nil {
21884					return err
21885				}
21886				so.Type = &typeVar
21887			}
21888		}
21889	}
21890
21891	return nil
21892}
21893
21894// ServiceObjectiveCapability the service objectives capability.
21895type ServiceObjectiveCapability struct {
21896	// ID - READ-ONLY; The unique ID of the service objective.
21897	ID *uuid.UUID `json:"id,omitempty"`
21898	// Name - READ-ONLY; The service objective name.
21899	Name *string `json:"name,omitempty"`
21900	// SupportedMaxSizes - READ-ONLY; The list of supported maximum database sizes.
21901	SupportedMaxSizes *[]MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty"`
21902	// PerformanceLevel - READ-ONLY; The performance level.
21903	PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty"`
21904	// Sku - READ-ONLY; The sku.
21905	Sku *Sku `json:"sku,omitempty"`
21906	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
21907	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
21908	// IncludedMaxSize - READ-ONLY; The included (free) max size.
21909	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
21910	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the service objective.
21911	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
21912	// SupportedAutoPauseDelay - READ-ONLY; Supported time range for auto pause delay
21913	SupportedAutoPauseDelay *AutoPauseDelayTimeRange `json:"supportedAutoPauseDelay,omitempty"`
21914	// SupportedMinCapacities - READ-ONLY; List of supported min capacities
21915	SupportedMinCapacities *[]MinCapacityCapability `json:"supportedMinCapacities,omitempty"`
21916	// ComputeModel - READ-ONLY; The compute model
21917	ComputeModel *string `json:"computeModel,omitempty"`
21918	// SupportedMaintenanceConfigurations - READ-ONLY; List of supported maintenance configurations
21919	SupportedMaintenanceConfigurations *[]MaintenanceConfigurationCapability `json:"supportedMaintenanceConfigurations,omitempty"`
21920	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
21921	Status CapabilityStatus `json:"status,omitempty"`
21922	// Reason - The reason for the capability not being available.
21923	Reason *string `json:"reason,omitempty"`
21924}
21925
21926// MarshalJSON is the custom marshaler for ServiceObjectiveCapability.
21927func (soc ServiceObjectiveCapability) MarshalJSON() ([]byte, error) {
21928	objectMap := make(map[string]interface{})
21929	if soc.Reason != nil {
21930		objectMap["reason"] = soc.Reason
21931	}
21932	return json.Marshal(objectMap)
21933}
21934
21935// ServiceObjectiveListResult represents the response to a get database service objectives request.
21936type ServiceObjectiveListResult struct {
21937	autorest.Response `json:"-"`
21938	// Value - The list of database service objectives.
21939	Value *[]ServiceObjective `json:"value,omitempty"`
21940}
21941
21942// ServiceObjectiveProperties represents the properties of a database service objective.
21943type ServiceObjectiveProperties struct {
21944	// ServiceObjectiveName - READ-ONLY; The name for the service objective.
21945	ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"`
21946	// IsDefault - READ-ONLY; Gets whether the service level objective is the default service objective.
21947	IsDefault *bool `json:"isDefault,omitempty"`
21948	// IsSystem - READ-ONLY; Gets whether the service level objective is a system service objective.
21949	IsSystem *bool `json:"isSystem,omitempty"`
21950	// Description - READ-ONLY; The description for the service level objective.
21951	Description *string `json:"description,omitempty"`
21952	// Enabled - READ-ONLY; Gets whether the service level objective is enabled.
21953	Enabled *bool `json:"enabled,omitempty"`
21954}
21955
21956// MarshalJSON is the custom marshaler for ServiceObjectiveProperties.
21957func (sop ServiceObjectiveProperties) MarshalJSON() ([]byte, error) {
21958	objectMap := make(map[string]interface{})
21959	return json.Marshal(objectMap)
21960}
21961
21962// ServiceTierAdvisor represents a Service Tier Advisor.
21963type ServiceTierAdvisor struct {
21964	autorest.Response `json:"-"`
21965	// ServiceTierAdvisorProperties - READ-ONLY; The properties representing the resource.
21966	*ServiceTierAdvisorProperties `json:"properties,omitempty"`
21967	// ID - READ-ONLY; Resource ID.
21968	ID *string `json:"id,omitempty"`
21969	// Name - READ-ONLY; Resource name.
21970	Name *string `json:"name,omitempty"`
21971	// Type - READ-ONLY; Resource type.
21972	Type *string `json:"type,omitempty"`
21973}
21974
21975// MarshalJSON is the custom marshaler for ServiceTierAdvisor.
21976func (sta ServiceTierAdvisor) MarshalJSON() ([]byte, error) {
21977	objectMap := make(map[string]interface{})
21978	return json.Marshal(objectMap)
21979}
21980
21981// UnmarshalJSON is the custom unmarshaler for ServiceTierAdvisor struct.
21982func (sta *ServiceTierAdvisor) UnmarshalJSON(body []byte) error {
21983	var m map[string]*json.RawMessage
21984	err := json.Unmarshal(body, &m)
21985	if err != nil {
21986		return err
21987	}
21988	for k, v := range m {
21989		switch k {
21990		case "properties":
21991			if v != nil {
21992				var serviceTierAdvisorProperties ServiceTierAdvisorProperties
21993				err = json.Unmarshal(*v, &serviceTierAdvisorProperties)
21994				if err != nil {
21995					return err
21996				}
21997				sta.ServiceTierAdvisorProperties = &serviceTierAdvisorProperties
21998			}
21999		case "id":
22000			if v != nil {
22001				var ID string
22002				err = json.Unmarshal(*v, &ID)
22003				if err != nil {
22004					return err
22005				}
22006				sta.ID = &ID
22007			}
22008		case "name":
22009			if v != nil {
22010				var name string
22011				err = json.Unmarshal(*v, &name)
22012				if err != nil {
22013					return err
22014				}
22015				sta.Name = &name
22016			}
22017		case "type":
22018			if v != nil {
22019				var typeVar string
22020				err = json.Unmarshal(*v, &typeVar)
22021				if err != nil {
22022					return err
22023				}
22024				sta.Type = &typeVar
22025			}
22026		}
22027	}
22028
22029	return nil
22030}
22031
22032// ServiceTierAdvisorListResult represents the response to a list service tier advisor request.
22033type ServiceTierAdvisorListResult struct {
22034	autorest.Response `json:"-"`
22035	// Value - The list of service tier advisors for specified database.
22036	Value *[]ServiceTierAdvisor `json:"value,omitempty"`
22037}
22038
22039// ServiceTierAdvisorProperties represents the properties of a Service Tier Advisor.
22040type ServiceTierAdvisorProperties struct {
22041	// ObservationPeriodStart - READ-ONLY; The observation period start (ISO8601 format).
22042	ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"`
22043	// ObservationPeriodEnd - READ-ONLY; The observation period start (ISO8601 format).
22044	ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"`
22045	// ActiveTimeRatio - READ-ONLY; The activeTimeRatio for service tier advisor.
22046	ActiveTimeRatio *float64 `json:"activeTimeRatio,omitempty"`
22047	// MinDtu - READ-ONLY; Gets or sets minDtu for service tier advisor.
22048	MinDtu *float64 `json:"minDtu,omitempty"`
22049	// AvgDtu - READ-ONLY; Gets or sets avgDtu for service tier advisor.
22050	AvgDtu *float64 `json:"avgDtu,omitempty"`
22051	// MaxDtu - READ-ONLY; Gets or sets maxDtu for service tier advisor.
22052	MaxDtu *float64 `json:"maxDtu,omitempty"`
22053	// MaxSizeInGB - READ-ONLY; Gets or sets maxSizeInGB for service tier advisor.
22054	MaxSizeInGB *float64 `json:"maxSizeInGB,omitempty"`
22055	// ServiceLevelObjectiveUsageMetrics - READ-ONLY; Gets or sets serviceLevelObjectiveUsageMetrics for the service tier advisor.
22056	ServiceLevelObjectiveUsageMetrics *[]SloUsageMetric `json:"serviceLevelObjectiveUsageMetrics,omitempty"`
22057	// CurrentServiceLevelObjective - READ-ONLY; Gets or sets currentServiceLevelObjective for service tier advisor.
22058	CurrentServiceLevelObjective *string `json:"currentServiceLevelObjective,omitempty"`
22059	// CurrentServiceLevelObjectiveID - READ-ONLY; Gets or sets currentServiceLevelObjectiveId for service tier advisor.
22060	CurrentServiceLevelObjectiveID *uuid.UUID `json:"currentServiceLevelObjectiveId,omitempty"`
22061	// UsageBasedRecommendationServiceLevelObjective - READ-ONLY; Gets or sets usageBasedRecommendationServiceLevelObjective for service tier advisor.
22062	UsageBasedRecommendationServiceLevelObjective *string `json:"usageBasedRecommendationServiceLevelObjective,omitempty"`
22063	// UsageBasedRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets usageBasedRecommendationServiceLevelObjectiveId for service tier advisor.
22064	UsageBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"usageBasedRecommendationServiceLevelObjectiveId,omitempty"`
22065	// DatabaseSizeBasedRecommendationServiceLevelObjective - READ-ONLY; Gets or sets databaseSizeBasedRecommendationServiceLevelObjective for service tier advisor.
22066	DatabaseSizeBasedRecommendationServiceLevelObjective *string `json:"databaseSizeBasedRecommendationServiceLevelObjective,omitempty"`
22067	// DatabaseSizeBasedRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service tier advisor.
22068	DatabaseSizeBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"databaseSizeBasedRecommendationServiceLevelObjectiveId,omitempty"`
22069	// DisasterPlanBasedRecommendationServiceLevelObjective - READ-ONLY; Gets or sets disasterPlanBasedRecommendationServiceLevelObjective for service tier advisor.
22070	DisasterPlanBasedRecommendationServiceLevelObjective *string `json:"disasterPlanBasedRecommendationServiceLevelObjective,omitempty"`
22071	// DisasterPlanBasedRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service tier advisor.
22072	DisasterPlanBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"disasterPlanBasedRecommendationServiceLevelObjectiveId,omitempty"`
22073	// OverallRecommendationServiceLevelObjective - READ-ONLY; Gets or sets overallRecommendationServiceLevelObjective for service tier advisor.
22074	OverallRecommendationServiceLevelObjective *string `json:"overallRecommendationServiceLevelObjective,omitempty"`
22075	// OverallRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets overallRecommendationServiceLevelObjectiveId for service tier advisor.
22076	OverallRecommendationServiceLevelObjectiveID *uuid.UUID `json:"overallRecommendationServiceLevelObjectiveId,omitempty"`
22077	// Confidence - READ-ONLY; Gets or sets confidence for service tier advisor.
22078	Confidence *float64 `json:"confidence,omitempty"`
22079}
22080
22081// MarshalJSON is the custom marshaler for ServiceTierAdvisorProperties.
22082func (stap ServiceTierAdvisorProperties) MarshalJSON() ([]byte, error) {
22083	objectMap := make(map[string]interface{})
22084	return json.Marshal(objectMap)
22085}
22086
22087// Sku an ARM Resource SKU.
22088type Sku struct {
22089	// Name - The name of the SKU, typically, a letter + Number code, e.g. P3.
22090	Name *string `json:"name,omitempty"`
22091	// Tier - The tier or edition of the particular SKU, e.g. Basic, Premium.
22092	Tier *string `json:"tier,omitempty"`
22093	// Size - Size of the particular SKU
22094	Size *string `json:"size,omitempty"`
22095	// Family - If the service has different generations of hardware, for the same SKU, then that can be captured here.
22096	Family *string `json:"family,omitempty"`
22097	// Capacity - Capacity of the particular SKU.
22098	Capacity *int32 `json:"capacity,omitempty"`
22099}
22100
22101// SloUsageMetric a Slo Usage Metric.
22102type SloUsageMetric struct {
22103	// 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'
22104	ServiceLevelObjective ServiceObjectiveName `json:"serviceLevelObjective,omitempty"`
22105	// ServiceLevelObjectiveID - READ-ONLY; The serviceLevelObjectiveId for SLO usage metric.
22106	ServiceLevelObjectiveID *uuid.UUID `json:"serviceLevelObjectiveId,omitempty"`
22107	// InRangeTimeRatio - READ-ONLY; Gets or sets inRangeTimeRatio for SLO usage metric.
22108	InRangeTimeRatio *float64 `json:"inRangeTimeRatio,omitempty"`
22109}
22110
22111// MarshalJSON is the custom marshaler for SloUsageMetric.
22112func (sum SloUsageMetric) MarshalJSON() ([]byte, error) {
22113	objectMap := make(map[string]interface{})
22114	return json.Marshal(objectMap)
22115}
22116
22117// StorageCapability the storage account type capability.
22118type StorageCapability struct {
22119	// StorageAccountType - READ-ONLY; The storage account type for the database's backups. Possible values include: 'StorageAccountType1GRS', 'StorageAccountType1LRS', 'StorageAccountType1ZRS'
22120	StorageAccountType StorageAccountType1 `json:"storageAccountType,omitempty"`
22121	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
22122	Status CapabilityStatus `json:"status,omitempty"`
22123	// Reason - The reason for the capability not being available.
22124	Reason *string `json:"reason,omitempty"`
22125}
22126
22127// MarshalJSON is the custom marshaler for StorageCapability.
22128func (sc StorageCapability) MarshalJSON() ([]byte, error) {
22129	objectMap := make(map[string]interface{})
22130	if sc.Reason != nil {
22131		objectMap["reason"] = sc.Reason
22132	}
22133	return json.Marshal(objectMap)
22134}
22135
22136// SubscriptionUsage usage Metric of a Subscription in a Location.
22137type SubscriptionUsage struct {
22138	autorest.Response `json:"-"`
22139	// SubscriptionUsageProperties - Resource properties.
22140	*SubscriptionUsageProperties `json:"properties,omitempty"`
22141	// ID - READ-ONLY; Resource ID.
22142	ID *string `json:"id,omitempty"`
22143	// Name - READ-ONLY; Resource name.
22144	Name *string `json:"name,omitempty"`
22145	// Type - READ-ONLY; Resource type.
22146	Type *string `json:"type,omitempty"`
22147}
22148
22149// MarshalJSON is the custom marshaler for SubscriptionUsage.
22150func (su SubscriptionUsage) MarshalJSON() ([]byte, error) {
22151	objectMap := make(map[string]interface{})
22152	if su.SubscriptionUsageProperties != nil {
22153		objectMap["properties"] = su.SubscriptionUsageProperties
22154	}
22155	return json.Marshal(objectMap)
22156}
22157
22158// UnmarshalJSON is the custom unmarshaler for SubscriptionUsage struct.
22159func (su *SubscriptionUsage) UnmarshalJSON(body []byte) error {
22160	var m map[string]*json.RawMessage
22161	err := json.Unmarshal(body, &m)
22162	if err != nil {
22163		return err
22164	}
22165	for k, v := range m {
22166		switch k {
22167		case "properties":
22168			if v != nil {
22169				var subscriptionUsageProperties SubscriptionUsageProperties
22170				err = json.Unmarshal(*v, &subscriptionUsageProperties)
22171				if err != nil {
22172					return err
22173				}
22174				su.SubscriptionUsageProperties = &subscriptionUsageProperties
22175			}
22176		case "id":
22177			if v != nil {
22178				var ID string
22179				err = json.Unmarshal(*v, &ID)
22180				if err != nil {
22181					return err
22182				}
22183				su.ID = &ID
22184			}
22185		case "name":
22186			if v != nil {
22187				var name string
22188				err = json.Unmarshal(*v, &name)
22189				if err != nil {
22190					return err
22191				}
22192				su.Name = &name
22193			}
22194		case "type":
22195			if v != nil {
22196				var typeVar string
22197				err = json.Unmarshal(*v, &typeVar)
22198				if err != nil {
22199					return err
22200				}
22201				su.Type = &typeVar
22202			}
22203		}
22204	}
22205
22206	return nil
22207}
22208
22209// SubscriptionUsageListResult a list of subscription usage metrics in a location.
22210type SubscriptionUsageListResult struct {
22211	autorest.Response `json:"-"`
22212	// Value - READ-ONLY; Array of results.
22213	Value *[]SubscriptionUsage `json:"value,omitempty"`
22214	// NextLink - READ-ONLY; Link to retrieve next page of results.
22215	NextLink *string `json:"nextLink,omitempty"`
22216}
22217
22218// MarshalJSON is the custom marshaler for SubscriptionUsageListResult.
22219func (sulr SubscriptionUsageListResult) MarshalJSON() ([]byte, error) {
22220	objectMap := make(map[string]interface{})
22221	return json.Marshal(objectMap)
22222}
22223
22224// SubscriptionUsageListResultIterator provides access to a complete listing of SubscriptionUsage values.
22225type SubscriptionUsageListResultIterator struct {
22226	i    int
22227	page SubscriptionUsageListResultPage
22228}
22229
22230// NextWithContext advances to the next value.  If there was an error making
22231// the request the iterator does not advance and the error is returned.
22232func (iter *SubscriptionUsageListResultIterator) NextWithContext(ctx context.Context) (err error) {
22233	if tracing.IsEnabled() {
22234		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsageListResultIterator.NextWithContext")
22235		defer func() {
22236			sc := -1
22237			if iter.Response().Response.Response != nil {
22238				sc = iter.Response().Response.Response.StatusCode
22239			}
22240			tracing.EndSpan(ctx, sc, err)
22241		}()
22242	}
22243	iter.i++
22244	if iter.i < len(iter.page.Values()) {
22245		return nil
22246	}
22247	err = iter.page.NextWithContext(ctx)
22248	if err != nil {
22249		iter.i--
22250		return err
22251	}
22252	iter.i = 0
22253	return nil
22254}
22255
22256// Next advances to the next value.  If there was an error making
22257// the request the iterator does not advance and the error is returned.
22258// Deprecated: Use NextWithContext() instead.
22259func (iter *SubscriptionUsageListResultIterator) Next() error {
22260	return iter.NextWithContext(context.Background())
22261}
22262
22263// NotDone returns true if the enumeration should be started or is not yet complete.
22264func (iter SubscriptionUsageListResultIterator) NotDone() bool {
22265	return iter.page.NotDone() && iter.i < len(iter.page.Values())
22266}
22267
22268// Response returns the raw server response from the last page request.
22269func (iter SubscriptionUsageListResultIterator) Response() SubscriptionUsageListResult {
22270	return iter.page.Response()
22271}
22272
22273// Value returns the current value or a zero-initialized value if the
22274// iterator has advanced beyond the end of the collection.
22275func (iter SubscriptionUsageListResultIterator) Value() SubscriptionUsage {
22276	if !iter.page.NotDone() {
22277		return SubscriptionUsage{}
22278	}
22279	return iter.page.Values()[iter.i]
22280}
22281
22282// Creates a new instance of the SubscriptionUsageListResultIterator type.
22283func NewSubscriptionUsageListResultIterator(page SubscriptionUsageListResultPage) SubscriptionUsageListResultIterator {
22284	return SubscriptionUsageListResultIterator{page: page}
22285}
22286
22287// IsEmpty returns true if the ListResult contains no values.
22288func (sulr SubscriptionUsageListResult) IsEmpty() bool {
22289	return sulr.Value == nil || len(*sulr.Value) == 0
22290}
22291
22292// hasNextLink returns true if the NextLink is not empty.
22293func (sulr SubscriptionUsageListResult) hasNextLink() bool {
22294	return sulr.NextLink != nil && len(*sulr.NextLink) != 0
22295}
22296
22297// subscriptionUsageListResultPreparer prepares a request to retrieve the next set of results.
22298// It returns nil if no more results exist.
22299func (sulr SubscriptionUsageListResult) subscriptionUsageListResultPreparer(ctx context.Context) (*http.Request, error) {
22300	if !sulr.hasNextLink() {
22301		return nil, nil
22302	}
22303	return autorest.Prepare((&http.Request{}).WithContext(ctx),
22304		autorest.AsJSON(),
22305		autorest.AsGet(),
22306		autorest.WithBaseURL(to.String(sulr.NextLink)))
22307}
22308
22309// SubscriptionUsageListResultPage contains a page of SubscriptionUsage values.
22310type SubscriptionUsageListResultPage struct {
22311	fn   func(context.Context, SubscriptionUsageListResult) (SubscriptionUsageListResult, error)
22312	sulr SubscriptionUsageListResult
22313}
22314
22315// NextWithContext advances to the next page of values.  If there was an error making
22316// the request the page does not advance and the error is returned.
22317func (page *SubscriptionUsageListResultPage) NextWithContext(ctx context.Context) (err error) {
22318	if tracing.IsEnabled() {
22319		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsageListResultPage.NextWithContext")
22320		defer func() {
22321			sc := -1
22322			if page.Response().Response.Response != nil {
22323				sc = page.Response().Response.Response.StatusCode
22324			}
22325			tracing.EndSpan(ctx, sc, err)
22326		}()
22327	}
22328	for {
22329		next, err := page.fn(ctx, page.sulr)
22330		if err != nil {
22331			return err
22332		}
22333		page.sulr = next
22334		if !next.hasNextLink() || !next.IsEmpty() {
22335			break
22336		}
22337	}
22338	return nil
22339}
22340
22341// Next advances to the next page of values.  If there was an error making
22342// the request the page does not advance and the error is returned.
22343// Deprecated: Use NextWithContext() instead.
22344func (page *SubscriptionUsageListResultPage) Next() error {
22345	return page.NextWithContext(context.Background())
22346}
22347
22348// NotDone returns true if the page enumeration should be started or is not yet complete.
22349func (page SubscriptionUsageListResultPage) NotDone() bool {
22350	return !page.sulr.IsEmpty()
22351}
22352
22353// Response returns the raw server response from the last page request.
22354func (page SubscriptionUsageListResultPage) Response() SubscriptionUsageListResult {
22355	return page.sulr
22356}
22357
22358// Values returns the slice of values for the current page or nil if there are no values.
22359func (page SubscriptionUsageListResultPage) Values() []SubscriptionUsage {
22360	if page.sulr.IsEmpty() {
22361		return nil
22362	}
22363	return *page.sulr.Value
22364}
22365
22366// Creates a new instance of the SubscriptionUsageListResultPage type.
22367func NewSubscriptionUsageListResultPage(cur SubscriptionUsageListResult, getNextPage func(context.Context, SubscriptionUsageListResult) (SubscriptionUsageListResult, error)) SubscriptionUsageListResultPage {
22368	return SubscriptionUsageListResultPage{
22369		fn:   getNextPage,
22370		sulr: cur,
22371	}
22372}
22373
22374// SubscriptionUsageProperties properties of a subscription usage.
22375type SubscriptionUsageProperties struct {
22376	// DisplayName - READ-ONLY; User-readable name of the metric.
22377	DisplayName *string `json:"displayName,omitempty"`
22378	// CurrentValue - READ-ONLY; Current value of the metric.
22379	CurrentValue *float64 `json:"currentValue,omitempty"`
22380	// Limit - READ-ONLY; Boundary value of the metric.
22381	Limit *float64 `json:"limit,omitempty"`
22382	// Unit - READ-ONLY; Unit of the metric.
22383	Unit *string `json:"unit,omitempty"`
22384}
22385
22386// MarshalJSON is the custom marshaler for SubscriptionUsageProperties.
22387func (sup SubscriptionUsageProperties) MarshalJSON() ([]byte, error) {
22388	objectMap := make(map[string]interface{})
22389	return json.Marshal(objectMap)
22390}
22391
22392// SyncAgent an Azure SQL Database sync agent.
22393type SyncAgent struct {
22394	autorest.Response `json:"-"`
22395	// SyncAgentProperties - Resource properties.
22396	*SyncAgentProperties `json:"properties,omitempty"`
22397	// ID - READ-ONLY; Resource ID.
22398	ID *string `json:"id,omitempty"`
22399	// Name - READ-ONLY; Resource name.
22400	Name *string `json:"name,omitempty"`
22401	// Type - READ-ONLY; Resource type.
22402	Type *string `json:"type,omitempty"`
22403}
22404
22405// MarshalJSON is the custom marshaler for SyncAgent.
22406func (sa SyncAgent) MarshalJSON() ([]byte, error) {
22407	objectMap := make(map[string]interface{})
22408	if sa.SyncAgentProperties != nil {
22409		objectMap["properties"] = sa.SyncAgentProperties
22410	}
22411	return json.Marshal(objectMap)
22412}
22413
22414// UnmarshalJSON is the custom unmarshaler for SyncAgent struct.
22415func (sa *SyncAgent) UnmarshalJSON(body []byte) error {
22416	var m map[string]*json.RawMessage
22417	err := json.Unmarshal(body, &m)
22418	if err != nil {
22419		return err
22420	}
22421	for k, v := range m {
22422		switch k {
22423		case "properties":
22424			if v != nil {
22425				var syncAgentProperties SyncAgentProperties
22426				err = json.Unmarshal(*v, &syncAgentProperties)
22427				if err != nil {
22428					return err
22429				}
22430				sa.SyncAgentProperties = &syncAgentProperties
22431			}
22432		case "id":
22433			if v != nil {
22434				var ID string
22435				err = json.Unmarshal(*v, &ID)
22436				if err != nil {
22437					return err
22438				}
22439				sa.ID = &ID
22440			}
22441		case "name":
22442			if v != nil {
22443				var name string
22444				err = json.Unmarshal(*v, &name)
22445				if err != nil {
22446					return err
22447				}
22448				sa.Name = &name
22449			}
22450		case "type":
22451			if v != nil {
22452				var typeVar string
22453				err = json.Unmarshal(*v, &typeVar)
22454				if err != nil {
22455					return err
22456				}
22457				sa.Type = &typeVar
22458			}
22459		}
22460	}
22461
22462	return nil
22463}
22464
22465// SyncAgentKeyProperties properties of an Azure SQL Database sync agent key.
22466type SyncAgentKeyProperties struct {
22467	autorest.Response `json:"-"`
22468	// SyncAgentKey - READ-ONLY; Key of sync agent.
22469	SyncAgentKey *string `json:"syncAgentKey,omitempty"`
22470}
22471
22472// MarshalJSON is the custom marshaler for SyncAgentKeyProperties.
22473func (sakp SyncAgentKeyProperties) MarshalJSON() ([]byte, error) {
22474	objectMap := make(map[string]interface{})
22475	return json.Marshal(objectMap)
22476}
22477
22478// SyncAgentLinkedDatabase an Azure SQL Database sync agent linked database.
22479type SyncAgentLinkedDatabase struct {
22480	// SyncAgentLinkedDatabaseProperties - Resource properties.
22481	*SyncAgentLinkedDatabaseProperties `json:"properties,omitempty"`
22482	// ID - READ-ONLY; Resource ID.
22483	ID *string `json:"id,omitempty"`
22484	// Name - READ-ONLY; Resource name.
22485	Name *string `json:"name,omitempty"`
22486	// Type - READ-ONLY; Resource type.
22487	Type *string `json:"type,omitempty"`
22488}
22489
22490// MarshalJSON is the custom marshaler for SyncAgentLinkedDatabase.
22491func (sald SyncAgentLinkedDatabase) MarshalJSON() ([]byte, error) {
22492	objectMap := make(map[string]interface{})
22493	if sald.SyncAgentLinkedDatabaseProperties != nil {
22494		objectMap["properties"] = sald.SyncAgentLinkedDatabaseProperties
22495	}
22496	return json.Marshal(objectMap)
22497}
22498
22499// UnmarshalJSON is the custom unmarshaler for SyncAgentLinkedDatabase struct.
22500func (sald *SyncAgentLinkedDatabase) UnmarshalJSON(body []byte) error {
22501	var m map[string]*json.RawMessage
22502	err := json.Unmarshal(body, &m)
22503	if err != nil {
22504		return err
22505	}
22506	for k, v := range m {
22507		switch k {
22508		case "properties":
22509			if v != nil {
22510				var syncAgentLinkedDatabaseProperties SyncAgentLinkedDatabaseProperties
22511				err = json.Unmarshal(*v, &syncAgentLinkedDatabaseProperties)
22512				if err != nil {
22513					return err
22514				}
22515				sald.SyncAgentLinkedDatabaseProperties = &syncAgentLinkedDatabaseProperties
22516			}
22517		case "id":
22518			if v != nil {
22519				var ID string
22520				err = json.Unmarshal(*v, &ID)
22521				if err != nil {
22522					return err
22523				}
22524				sald.ID = &ID
22525			}
22526		case "name":
22527			if v != nil {
22528				var name string
22529				err = json.Unmarshal(*v, &name)
22530				if err != nil {
22531					return err
22532				}
22533				sald.Name = &name
22534			}
22535		case "type":
22536			if v != nil {
22537				var typeVar string
22538				err = json.Unmarshal(*v, &typeVar)
22539				if err != nil {
22540					return err
22541				}
22542				sald.Type = &typeVar
22543			}
22544		}
22545	}
22546
22547	return nil
22548}
22549
22550// SyncAgentLinkedDatabaseListResult a list of sync agent linked databases.
22551type SyncAgentLinkedDatabaseListResult struct {
22552	autorest.Response `json:"-"`
22553	// Value - READ-ONLY; Array of results.
22554	Value *[]SyncAgentLinkedDatabase `json:"value,omitempty"`
22555	// NextLink - READ-ONLY; Link to retrieve next page of results.
22556	NextLink *string `json:"nextLink,omitempty"`
22557}
22558
22559// MarshalJSON is the custom marshaler for SyncAgentLinkedDatabaseListResult.
22560func (saldlr SyncAgentLinkedDatabaseListResult) MarshalJSON() ([]byte, error) {
22561	objectMap := make(map[string]interface{})
22562	return json.Marshal(objectMap)
22563}
22564
22565// SyncAgentLinkedDatabaseListResultIterator provides access to a complete listing of
22566// SyncAgentLinkedDatabase values.
22567type SyncAgentLinkedDatabaseListResultIterator struct {
22568	i    int
22569	page SyncAgentLinkedDatabaseListResultPage
22570}
22571
22572// NextWithContext advances to the next value.  If there was an error making
22573// the request the iterator does not advance and the error is returned.
22574func (iter *SyncAgentLinkedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
22575	if tracing.IsEnabled() {
22576		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentLinkedDatabaseListResultIterator.NextWithContext")
22577		defer func() {
22578			sc := -1
22579			if iter.Response().Response.Response != nil {
22580				sc = iter.Response().Response.Response.StatusCode
22581			}
22582			tracing.EndSpan(ctx, sc, err)
22583		}()
22584	}
22585	iter.i++
22586	if iter.i < len(iter.page.Values()) {
22587		return nil
22588	}
22589	err = iter.page.NextWithContext(ctx)
22590	if err != nil {
22591		iter.i--
22592		return err
22593	}
22594	iter.i = 0
22595	return nil
22596}
22597
22598// Next advances to the next value.  If there was an error making
22599// the request the iterator does not advance and the error is returned.
22600// Deprecated: Use NextWithContext() instead.
22601func (iter *SyncAgentLinkedDatabaseListResultIterator) Next() error {
22602	return iter.NextWithContext(context.Background())
22603}
22604
22605// NotDone returns true if the enumeration should be started or is not yet complete.
22606func (iter SyncAgentLinkedDatabaseListResultIterator) NotDone() bool {
22607	return iter.page.NotDone() && iter.i < len(iter.page.Values())
22608}
22609
22610// Response returns the raw server response from the last page request.
22611func (iter SyncAgentLinkedDatabaseListResultIterator) Response() SyncAgentLinkedDatabaseListResult {
22612	return iter.page.Response()
22613}
22614
22615// Value returns the current value or a zero-initialized value if the
22616// iterator has advanced beyond the end of the collection.
22617func (iter SyncAgentLinkedDatabaseListResultIterator) Value() SyncAgentLinkedDatabase {
22618	if !iter.page.NotDone() {
22619		return SyncAgentLinkedDatabase{}
22620	}
22621	return iter.page.Values()[iter.i]
22622}
22623
22624// Creates a new instance of the SyncAgentLinkedDatabaseListResultIterator type.
22625func NewSyncAgentLinkedDatabaseListResultIterator(page SyncAgentLinkedDatabaseListResultPage) SyncAgentLinkedDatabaseListResultIterator {
22626	return SyncAgentLinkedDatabaseListResultIterator{page: page}
22627}
22628
22629// IsEmpty returns true if the ListResult contains no values.
22630func (saldlr SyncAgentLinkedDatabaseListResult) IsEmpty() bool {
22631	return saldlr.Value == nil || len(*saldlr.Value) == 0
22632}
22633
22634// hasNextLink returns true if the NextLink is not empty.
22635func (saldlr SyncAgentLinkedDatabaseListResult) hasNextLink() bool {
22636	return saldlr.NextLink != nil && len(*saldlr.NextLink) != 0
22637}
22638
22639// syncAgentLinkedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
22640// It returns nil if no more results exist.
22641func (saldlr SyncAgentLinkedDatabaseListResult) syncAgentLinkedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
22642	if !saldlr.hasNextLink() {
22643		return nil, nil
22644	}
22645	return autorest.Prepare((&http.Request{}).WithContext(ctx),
22646		autorest.AsJSON(),
22647		autorest.AsGet(),
22648		autorest.WithBaseURL(to.String(saldlr.NextLink)))
22649}
22650
22651// SyncAgentLinkedDatabaseListResultPage contains a page of SyncAgentLinkedDatabase values.
22652type SyncAgentLinkedDatabaseListResultPage struct {
22653	fn     func(context.Context, SyncAgentLinkedDatabaseListResult) (SyncAgentLinkedDatabaseListResult, error)
22654	saldlr SyncAgentLinkedDatabaseListResult
22655}
22656
22657// NextWithContext advances to the next page of values.  If there was an error making
22658// the request the page does not advance and the error is returned.
22659func (page *SyncAgentLinkedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
22660	if tracing.IsEnabled() {
22661		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentLinkedDatabaseListResultPage.NextWithContext")
22662		defer func() {
22663			sc := -1
22664			if page.Response().Response.Response != nil {
22665				sc = page.Response().Response.Response.StatusCode
22666			}
22667			tracing.EndSpan(ctx, sc, err)
22668		}()
22669	}
22670	for {
22671		next, err := page.fn(ctx, page.saldlr)
22672		if err != nil {
22673			return err
22674		}
22675		page.saldlr = next
22676		if !next.hasNextLink() || !next.IsEmpty() {
22677			break
22678		}
22679	}
22680	return nil
22681}
22682
22683// Next advances to the next page of values.  If there was an error making
22684// the request the page does not advance and the error is returned.
22685// Deprecated: Use NextWithContext() instead.
22686func (page *SyncAgentLinkedDatabaseListResultPage) Next() error {
22687	return page.NextWithContext(context.Background())
22688}
22689
22690// NotDone returns true if the page enumeration should be started or is not yet complete.
22691func (page SyncAgentLinkedDatabaseListResultPage) NotDone() bool {
22692	return !page.saldlr.IsEmpty()
22693}
22694
22695// Response returns the raw server response from the last page request.
22696func (page SyncAgentLinkedDatabaseListResultPage) Response() SyncAgentLinkedDatabaseListResult {
22697	return page.saldlr
22698}
22699
22700// Values returns the slice of values for the current page or nil if there are no values.
22701func (page SyncAgentLinkedDatabaseListResultPage) Values() []SyncAgentLinkedDatabase {
22702	if page.saldlr.IsEmpty() {
22703		return nil
22704	}
22705	return *page.saldlr.Value
22706}
22707
22708// Creates a new instance of the SyncAgentLinkedDatabaseListResultPage type.
22709func NewSyncAgentLinkedDatabaseListResultPage(cur SyncAgentLinkedDatabaseListResult, getNextPage func(context.Context, SyncAgentLinkedDatabaseListResult) (SyncAgentLinkedDatabaseListResult, error)) SyncAgentLinkedDatabaseListResultPage {
22710	return SyncAgentLinkedDatabaseListResultPage{
22711		fn:     getNextPage,
22712		saldlr: cur,
22713	}
22714}
22715
22716// SyncAgentLinkedDatabaseProperties properties of an Azure SQL Database sync agent linked database.
22717type SyncAgentLinkedDatabaseProperties struct {
22718	// DatabaseType - READ-ONLY; Type of the sync agent linked database. Possible values include: 'AzureSQLDatabase', 'SQLServerDatabase'
22719	DatabaseType SyncMemberDbType `json:"databaseType,omitempty"`
22720	// DatabaseID - READ-ONLY; Id of the sync agent linked database.
22721	DatabaseID *string `json:"databaseId,omitempty"`
22722	// Description - READ-ONLY; Description of the sync agent linked database.
22723	Description *string `json:"description,omitempty"`
22724	// ServerName - READ-ONLY; Server name of the sync agent linked database.
22725	ServerName *string `json:"serverName,omitempty"`
22726	// DatabaseName - READ-ONLY; Database name of the sync agent linked database.
22727	DatabaseName *string `json:"databaseName,omitempty"`
22728	// UserName - READ-ONLY; User name of the sync agent linked database.
22729	UserName *string `json:"userName,omitempty"`
22730}
22731
22732// MarshalJSON is the custom marshaler for SyncAgentLinkedDatabaseProperties.
22733func (saldp SyncAgentLinkedDatabaseProperties) MarshalJSON() ([]byte, error) {
22734	objectMap := make(map[string]interface{})
22735	return json.Marshal(objectMap)
22736}
22737
22738// SyncAgentListResult a list of sync agents.
22739type SyncAgentListResult struct {
22740	autorest.Response `json:"-"`
22741	// Value - READ-ONLY; Array of results.
22742	Value *[]SyncAgent `json:"value,omitempty"`
22743	// NextLink - READ-ONLY; Link to retrieve next page of results.
22744	NextLink *string `json:"nextLink,omitempty"`
22745}
22746
22747// MarshalJSON is the custom marshaler for SyncAgentListResult.
22748func (salr SyncAgentListResult) MarshalJSON() ([]byte, error) {
22749	objectMap := make(map[string]interface{})
22750	return json.Marshal(objectMap)
22751}
22752
22753// SyncAgentListResultIterator provides access to a complete listing of SyncAgent values.
22754type SyncAgentListResultIterator struct {
22755	i    int
22756	page SyncAgentListResultPage
22757}
22758
22759// NextWithContext advances to the next value.  If there was an error making
22760// the request the iterator does not advance and the error is returned.
22761func (iter *SyncAgentListResultIterator) NextWithContext(ctx context.Context) (err error) {
22762	if tracing.IsEnabled() {
22763		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentListResultIterator.NextWithContext")
22764		defer func() {
22765			sc := -1
22766			if iter.Response().Response.Response != nil {
22767				sc = iter.Response().Response.Response.StatusCode
22768			}
22769			tracing.EndSpan(ctx, sc, err)
22770		}()
22771	}
22772	iter.i++
22773	if iter.i < len(iter.page.Values()) {
22774		return nil
22775	}
22776	err = iter.page.NextWithContext(ctx)
22777	if err != nil {
22778		iter.i--
22779		return err
22780	}
22781	iter.i = 0
22782	return nil
22783}
22784
22785// Next advances to the next value.  If there was an error making
22786// the request the iterator does not advance and the error is returned.
22787// Deprecated: Use NextWithContext() instead.
22788func (iter *SyncAgentListResultIterator) Next() error {
22789	return iter.NextWithContext(context.Background())
22790}
22791
22792// NotDone returns true if the enumeration should be started or is not yet complete.
22793func (iter SyncAgentListResultIterator) NotDone() bool {
22794	return iter.page.NotDone() && iter.i < len(iter.page.Values())
22795}
22796
22797// Response returns the raw server response from the last page request.
22798func (iter SyncAgentListResultIterator) Response() SyncAgentListResult {
22799	return iter.page.Response()
22800}
22801
22802// Value returns the current value or a zero-initialized value if the
22803// iterator has advanced beyond the end of the collection.
22804func (iter SyncAgentListResultIterator) Value() SyncAgent {
22805	if !iter.page.NotDone() {
22806		return SyncAgent{}
22807	}
22808	return iter.page.Values()[iter.i]
22809}
22810
22811// Creates a new instance of the SyncAgentListResultIterator type.
22812func NewSyncAgentListResultIterator(page SyncAgentListResultPage) SyncAgentListResultIterator {
22813	return SyncAgentListResultIterator{page: page}
22814}
22815
22816// IsEmpty returns true if the ListResult contains no values.
22817func (salr SyncAgentListResult) IsEmpty() bool {
22818	return salr.Value == nil || len(*salr.Value) == 0
22819}
22820
22821// hasNextLink returns true if the NextLink is not empty.
22822func (salr SyncAgentListResult) hasNextLink() bool {
22823	return salr.NextLink != nil && len(*salr.NextLink) != 0
22824}
22825
22826// syncAgentListResultPreparer prepares a request to retrieve the next set of results.
22827// It returns nil if no more results exist.
22828func (salr SyncAgentListResult) syncAgentListResultPreparer(ctx context.Context) (*http.Request, error) {
22829	if !salr.hasNextLink() {
22830		return nil, nil
22831	}
22832	return autorest.Prepare((&http.Request{}).WithContext(ctx),
22833		autorest.AsJSON(),
22834		autorest.AsGet(),
22835		autorest.WithBaseURL(to.String(salr.NextLink)))
22836}
22837
22838// SyncAgentListResultPage contains a page of SyncAgent values.
22839type SyncAgentListResultPage struct {
22840	fn   func(context.Context, SyncAgentListResult) (SyncAgentListResult, error)
22841	salr SyncAgentListResult
22842}
22843
22844// NextWithContext advances to the next page of values.  If there was an error making
22845// the request the page does not advance and the error is returned.
22846func (page *SyncAgentListResultPage) NextWithContext(ctx context.Context) (err error) {
22847	if tracing.IsEnabled() {
22848		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentListResultPage.NextWithContext")
22849		defer func() {
22850			sc := -1
22851			if page.Response().Response.Response != nil {
22852				sc = page.Response().Response.Response.StatusCode
22853			}
22854			tracing.EndSpan(ctx, sc, err)
22855		}()
22856	}
22857	for {
22858		next, err := page.fn(ctx, page.salr)
22859		if err != nil {
22860			return err
22861		}
22862		page.salr = next
22863		if !next.hasNextLink() || !next.IsEmpty() {
22864			break
22865		}
22866	}
22867	return nil
22868}
22869
22870// Next advances to the next page of values.  If there was an error making
22871// the request the page does not advance and the error is returned.
22872// Deprecated: Use NextWithContext() instead.
22873func (page *SyncAgentListResultPage) Next() error {
22874	return page.NextWithContext(context.Background())
22875}
22876
22877// NotDone returns true if the page enumeration should be started or is not yet complete.
22878func (page SyncAgentListResultPage) NotDone() bool {
22879	return !page.salr.IsEmpty()
22880}
22881
22882// Response returns the raw server response from the last page request.
22883func (page SyncAgentListResultPage) Response() SyncAgentListResult {
22884	return page.salr
22885}
22886
22887// Values returns the slice of values for the current page or nil if there are no values.
22888func (page SyncAgentListResultPage) Values() []SyncAgent {
22889	if page.salr.IsEmpty() {
22890		return nil
22891	}
22892	return *page.salr.Value
22893}
22894
22895// Creates a new instance of the SyncAgentListResultPage type.
22896func NewSyncAgentListResultPage(cur SyncAgentListResult, getNextPage func(context.Context, SyncAgentListResult) (SyncAgentListResult, error)) SyncAgentListResultPage {
22897	return SyncAgentListResultPage{
22898		fn:   getNextPage,
22899		salr: cur,
22900	}
22901}
22902
22903// SyncAgentProperties properties of an Azure SQL Database sync agent.
22904type SyncAgentProperties struct {
22905	// Name - READ-ONLY; Name of the sync agent.
22906	Name *string `json:"name,omitempty"`
22907	// SyncDatabaseID - ARM resource id of the sync database in the sync agent.
22908	SyncDatabaseID *string `json:"syncDatabaseId,omitempty"`
22909	// LastAliveTime - READ-ONLY; Last alive time of the sync agent.
22910	LastAliveTime *date.Time `json:"lastAliveTime,omitempty"`
22911	// State - READ-ONLY; State of the sync agent. Possible values include: 'SyncAgentStateOnline', 'SyncAgentStateOffline', 'SyncAgentStateNeverConnected'
22912	State SyncAgentState `json:"state,omitempty"`
22913	// IsUpToDate - READ-ONLY; If the sync agent version is up to date.
22914	IsUpToDate *bool `json:"isUpToDate,omitempty"`
22915	// ExpiryTime - READ-ONLY; Expiration time of the sync agent version.
22916	ExpiryTime *date.Time `json:"expiryTime,omitempty"`
22917	// Version - READ-ONLY; Version of the sync agent.
22918	Version *string `json:"version,omitempty"`
22919}
22920
22921// MarshalJSON is the custom marshaler for SyncAgentProperties.
22922func (sap SyncAgentProperties) MarshalJSON() ([]byte, error) {
22923	objectMap := make(map[string]interface{})
22924	if sap.SyncDatabaseID != nil {
22925		objectMap["syncDatabaseId"] = sap.SyncDatabaseID
22926	}
22927	return json.Marshal(objectMap)
22928}
22929
22930// SyncAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
22931// long-running operation.
22932type SyncAgentsCreateOrUpdateFuture struct {
22933	azure.FutureAPI
22934	// Result returns the result of the asynchronous operation.
22935	// If the operation has not completed it will return an error.
22936	Result func(SyncAgentsClient) (SyncAgent, error)
22937}
22938
22939// UnmarshalJSON is the custom unmarshaller for CreateFuture.
22940func (future *SyncAgentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
22941	var azFuture azure.Future
22942	if err := json.Unmarshal(body, &azFuture); err != nil {
22943		return err
22944	}
22945	future.FutureAPI = &azFuture
22946	future.Result = future.result
22947	return nil
22948}
22949
22950// result is the default implementation for SyncAgentsCreateOrUpdateFuture.Result.
22951func (future *SyncAgentsCreateOrUpdateFuture) result(client SyncAgentsClient) (sa SyncAgent, err error) {
22952	var done bool
22953	done, err = future.DoneWithContext(context.Background(), client)
22954	if err != nil {
22955		err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
22956		return
22957	}
22958	if !done {
22959		sa.Response.Response = future.Response()
22960		err = azure.NewAsyncOpIncompleteError("sql.SyncAgentsCreateOrUpdateFuture")
22961		return
22962	}
22963	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
22964	if sa.Response.Response, err = future.GetResult(sender); err == nil && sa.Response.Response.StatusCode != http.StatusNoContent {
22965		sa, err = client.CreateOrUpdateResponder(sa.Response.Response)
22966		if err != nil {
22967			err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", sa.Response.Response, "Failure responding to request")
22968		}
22969	}
22970	return
22971}
22972
22973// SyncAgentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
22974// operation.
22975type SyncAgentsDeleteFuture struct {
22976	azure.FutureAPI
22977	// Result returns the result of the asynchronous operation.
22978	// If the operation has not completed it will return an error.
22979	Result func(SyncAgentsClient) (autorest.Response, error)
22980}
22981
22982// UnmarshalJSON is the custom unmarshaller for CreateFuture.
22983func (future *SyncAgentsDeleteFuture) UnmarshalJSON(body []byte) error {
22984	var azFuture azure.Future
22985	if err := json.Unmarshal(body, &azFuture); err != nil {
22986		return err
22987	}
22988	future.FutureAPI = &azFuture
22989	future.Result = future.result
22990	return nil
22991}
22992
22993// result is the default implementation for SyncAgentsDeleteFuture.Result.
22994func (future *SyncAgentsDeleteFuture) result(client SyncAgentsClient) (ar autorest.Response, err error) {
22995	var done bool
22996	done, err = future.DoneWithContext(context.Background(), client)
22997	if err != nil {
22998		err = autorest.NewErrorWithError(err, "sql.SyncAgentsDeleteFuture", "Result", future.Response(), "Polling failure")
22999		return
23000	}
23001	if !done {
23002		ar.Response = future.Response()
23003		err = azure.NewAsyncOpIncompleteError("sql.SyncAgentsDeleteFuture")
23004		return
23005	}
23006	ar.Response = future.Response()
23007	return
23008}
23009
23010// SyncDatabaseIDListResult a list of sync database ID properties.
23011type SyncDatabaseIDListResult struct {
23012	autorest.Response `json:"-"`
23013	// Value - READ-ONLY; Array of results.
23014	Value *[]SyncDatabaseIDProperties `json:"value,omitempty"`
23015	// NextLink - READ-ONLY; Link to retrieve next page of results.
23016	NextLink *string `json:"nextLink,omitempty"`
23017}
23018
23019// MarshalJSON is the custom marshaler for SyncDatabaseIDListResult.
23020func (sdilr SyncDatabaseIDListResult) MarshalJSON() ([]byte, error) {
23021	objectMap := make(map[string]interface{})
23022	return json.Marshal(objectMap)
23023}
23024
23025// SyncDatabaseIDListResultIterator provides access to a complete listing of SyncDatabaseIDProperties
23026// values.
23027type SyncDatabaseIDListResultIterator struct {
23028	i    int
23029	page SyncDatabaseIDListResultPage
23030}
23031
23032// NextWithContext advances to the next value.  If there was an error making
23033// the request the iterator does not advance and the error is returned.
23034func (iter *SyncDatabaseIDListResultIterator) NextWithContext(ctx context.Context) (err error) {
23035	if tracing.IsEnabled() {
23036		ctx = tracing.StartSpan(ctx, fqdn+"/SyncDatabaseIDListResultIterator.NextWithContext")
23037		defer func() {
23038			sc := -1
23039			if iter.Response().Response.Response != nil {
23040				sc = iter.Response().Response.Response.StatusCode
23041			}
23042			tracing.EndSpan(ctx, sc, err)
23043		}()
23044	}
23045	iter.i++
23046	if iter.i < len(iter.page.Values()) {
23047		return nil
23048	}
23049	err = iter.page.NextWithContext(ctx)
23050	if err != nil {
23051		iter.i--
23052		return err
23053	}
23054	iter.i = 0
23055	return nil
23056}
23057
23058// Next advances to the next value.  If there was an error making
23059// the request the iterator does not advance and the error is returned.
23060// Deprecated: Use NextWithContext() instead.
23061func (iter *SyncDatabaseIDListResultIterator) Next() error {
23062	return iter.NextWithContext(context.Background())
23063}
23064
23065// NotDone returns true if the enumeration should be started or is not yet complete.
23066func (iter SyncDatabaseIDListResultIterator) NotDone() bool {
23067	return iter.page.NotDone() && iter.i < len(iter.page.Values())
23068}
23069
23070// Response returns the raw server response from the last page request.
23071func (iter SyncDatabaseIDListResultIterator) Response() SyncDatabaseIDListResult {
23072	return iter.page.Response()
23073}
23074
23075// Value returns the current value or a zero-initialized value if the
23076// iterator has advanced beyond the end of the collection.
23077func (iter SyncDatabaseIDListResultIterator) Value() SyncDatabaseIDProperties {
23078	if !iter.page.NotDone() {
23079		return SyncDatabaseIDProperties{}
23080	}
23081	return iter.page.Values()[iter.i]
23082}
23083
23084// Creates a new instance of the SyncDatabaseIDListResultIterator type.
23085func NewSyncDatabaseIDListResultIterator(page SyncDatabaseIDListResultPage) SyncDatabaseIDListResultIterator {
23086	return SyncDatabaseIDListResultIterator{page: page}
23087}
23088
23089// IsEmpty returns true if the ListResult contains no values.
23090func (sdilr SyncDatabaseIDListResult) IsEmpty() bool {
23091	return sdilr.Value == nil || len(*sdilr.Value) == 0
23092}
23093
23094// hasNextLink returns true if the NextLink is not empty.
23095func (sdilr SyncDatabaseIDListResult) hasNextLink() bool {
23096	return sdilr.NextLink != nil && len(*sdilr.NextLink) != 0
23097}
23098
23099// syncDatabaseIDListResultPreparer prepares a request to retrieve the next set of results.
23100// It returns nil if no more results exist.
23101func (sdilr SyncDatabaseIDListResult) syncDatabaseIDListResultPreparer(ctx context.Context) (*http.Request, error) {
23102	if !sdilr.hasNextLink() {
23103		return nil, nil
23104	}
23105	return autorest.Prepare((&http.Request{}).WithContext(ctx),
23106		autorest.AsJSON(),
23107		autorest.AsGet(),
23108		autorest.WithBaseURL(to.String(sdilr.NextLink)))
23109}
23110
23111// SyncDatabaseIDListResultPage contains a page of SyncDatabaseIDProperties values.
23112type SyncDatabaseIDListResultPage struct {
23113	fn    func(context.Context, SyncDatabaseIDListResult) (SyncDatabaseIDListResult, error)
23114	sdilr SyncDatabaseIDListResult
23115}
23116
23117// NextWithContext advances to the next page of values.  If there was an error making
23118// the request the page does not advance and the error is returned.
23119func (page *SyncDatabaseIDListResultPage) NextWithContext(ctx context.Context) (err error) {
23120	if tracing.IsEnabled() {
23121		ctx = tracing.StartSpan(ctx, fqdn+"/SyncDatabaseIDListResultPage.NextWithContext")
23122		defer func() {
23123			sc := -1
23124			if page.Response().Response.Response != nil {
23125				sc = page.Response().Response.Response.StatusCode
23126			}
23127			tracing.EndSpan(ctx, sc, err)
23128		}()
23129	}
23130	for {
23131		next, err := page.fn(ctx, page.sdilr)
23132		if err != nil {
23133			return err
23134		}
23135		page.sdilr = next
23136		if !next.hasNextLink() || !next.IsEmpty() {
23137			break
23138		}
23139	}
23140	return nil
23141}
23142
23143// Next advances to the next page of values.  If there was an error making
23144// the request the page does not advance and the error is returned.
23145// Deprecated: Use NextWithContext() instead.
23146func (page *SyncDatabaseIDListResultPage) Next() error {
23147	return page.NextWithContext(context.Background())
23148}
23149
23150// NotDone returns true if the page enumeration should be started or is not yet complete.
23151func (page SyncDatabaseIDListResultPage) NotDone() bool {
23152	return !page.sdilr.IsEmpty()
23153}
23154
23155// Response returns the raw server response from the last page request.
23156func (page SyncDatabaseIDListResultPage) Response() SyncDatabaseIDListResult {
23157	return page.sdilr
23158}
23159
23160// Values returns the slice of values for the current page or nil if there are no values.
23161func (page SyncDatabaseIDListResultPage) Values() []SyncDatabaseIDProperties {
23162	if page.sdilr.IsEmpty() {
23163		return nil
23164	}
23165	return *page.sdilr.Value
23166}
23167
23168// Creates a new instance of the SyncDatabaseIDListResultPage type.
23169func NewSyncDatabaseIDListResultPage(cur SyncDatabaseIDListResult, getNextPage func(context.Context, SyncDatabaseIDListResult) (SyncDatabaseIDListResult, error)) SyncDatabaseIDListResultPage {
23170	return SyncDatabaseIDListResultPage{
23171		fn:    getNextPage,
23172		sdilr: cur,
23173	}
23174}
23175
23176// SyncDatabaseIDProperties properties of the sync database id.
23177type SyncDatabaseIDProperties struct {
23178	// ID - READ-ONLY; ARM resource id of sync database.
23179	ID *string `json:"id,omitempty"`
23180}
23181
23182// MarshalJSON is the custom marshaler for SyncDatabaseIDProperties.
23183func (sdip SyncDatabaseIDProperties) MarshalJSON() ([]byte, error) {
23184	objectMap := make(map[string]interface{})
23185	return json.Marshal(objectMap)
23186}
23187
23188// SyncFullSchemaProperties properties of the database full schema.
23189type SyncFullSchemaProperties struct {
23190	// Tables - READ-ONLY; List of tables in the database full schema.
23191	Tables *[]SyncFullSchemaTable `json:"tables,omitempty"`
23192	// LastUpdateTime - READ-ONLY; Last update time of the database schema.
23193	LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
23194}
23195
23196// MarshalJSON is the custom marshaler for SyncFullSchemaProperties.
23197func (sfsp SyncFullSchemaProperties) MarshalJSON() ([]byte, error) {
23198	objectMap := make(map[string]interface{})
23199	return json.Marshal(objectMap)
23200}
23201
23202// SyncFullSchemaPropertiesListResult a list of sync schema properties.
23203type SyncFullSchemaPropertiesListResult struct {
23204	autorest.Response `json:"-"`
23205	// Value - READ-ONLY; Array of results.
23206	Value *[]SyncFullSchemaProperties `json:"value,omitempty"`
23207	// NextLink - READ-ONLY; Link to retrieve next page of results.
23208	NextLink *string `json:"nextLink,omitempty"`
23209}
23210
23211// MarshalJSON is the custom marshaler for SyncFullSchemaPropertiesListResult.
23212func (sfsplr SyncFullSchemaPropertiesListResult) MarshalJSON() ([]byte, error) {
23213	objectMap := make(map[string]interface{})
23214	return json.Marshal(objectMap)
23215}
23216
23217// SyncFullSchemaPropertiesListResultIterator provides access to a complete listing of
23218// SyncFullSchemaProperties values.
23219type SyncFullSchemaPropertiesListResultIterator struct {
23220	i    int
23221	page SyncFullSchemaPropertiesListResultPage
23222}
23223
23224// NextWithContext advances to the next value.  If there was an error making
23225// the request the iterator does not advance and the error is returned.
23226func (iter *SyncFullSchemaPropertiesListResultIterator) NextWithContext(ctx context.Context) (err error) {
23227	if tracing.IsEnabled() {
23228		ctx = tracing.StartSpan(ctx, fqdn+"/SyncFullSchemaPropertiesListResultIterator.NextWithContext")
23229		defer func() {
23230			sc := -1
23231			if iter.Response().Response.Response != nil {
23232				sc = iter.Response().Response.Response.StatusCode
23233			}
23234			tracing.EndSpan(ctx, sc, err)
23235		}()
23236	}
23237	iter.i++
23238	if iter.i < len(iter.page.Values()) {
23239		return nil
23240	}
23241	err = iter.page.NextWithContext(ctx)
23242	if err != nil {
23243		iter.i--
23244		return err
23245	}
23246	iter.i = 0
23247	return nil
23248}
23249
23250// Next advances to the next value.  If there was an error making
23251// the request the iterator does not advance and the error is returned.
23252// Deprecated: Use NextWithContext() instead.
23253func (iter *SyncFullSchemaPropertiesListResultIterator) Next() error {
23254	return iter.NextWithContext(context.Background())
23255}
23256
23257// NotDone returns true if the enumeration should be started or is not yet complete.
23258func (iter SyncFullSchemaPropertiesListResultIterator) NotDone() bool {
23259	return iter.page.NotDone() && iter.i < len(iter.page.Values())
23260}
23261
23262// Response returns the raw server response from the last page request.
23263func (iter SyncFullSchemaPropertiesListResultIterator) Response() SyncFullSchemaPropertiesListResult {
23264	return iter.page.Response()
23265}
23266
23267// Value returns the current value or a zero-initialized value if the
23268// iterator has advanced beyond the end of the collection.
23269func (iter SyncFullSchemaPropertiesListResultIterator) Value() SyncFullSchemaProperties {
23270	if !iter.page.NotDone() {
23271		return SyncFullSchemaProperties{}
23272	}
23273	return iter.page.Values()[iter.i]
23274}
23275
23276// Creates a new instance of the SyncFullSchemaPropertiesListResultIterator type.
23277func NewSyncFullSchemaPropertiesListResultIterator(page SyncFullSchemaPropertiesListResultPage) SyncFullSchemaPropertiesListResultIterator {
23278	return SyncFullSchemaPropertiesListResultIterator{page: page}
23279}
23280
23281// IsEmpty returns true if the ListResult contains no values.
23282func (sfsplr SyncFullSchemaPropertiesListResult) IsEmpty() bool {
23283	return sfsplr.Value == nil || len(*sfsplr.Value) == 0
23284}
23285
23286// hasNextLink returns true if the NextLink is not empty.
23287func (sfsplr SyncFullSchemaPropertiesListResult) hasNextLink() bool {
23288	return sfsplr.NextLink != nil && len(*sfsplr.NextLink) != 0
23289}
23290
23291// syncFullSchemaPropertiesListResultPreparer prepares a request to retrieve the next set of results.
23292// It returns nil if no more results exist.
23293func (sfsplr SyncFullSchemaPropertiesListResult) syncFullSchemaPropertiesListResultPreparer(ctx context.Context) (*http.Request, error) {
23294	if !sfsplr.hasNextLink() {
23295		return nil, nil
23296	}
23297	return autorest.Prepare((&http.Request{}).WithContext(ctx),
23298		autorest.AsJSON(),
23299		autorest.AsGet(),
23300		autorest.WithBaseURL(to.String(sfsplr.NextLink)))
23301}
23302
23303// SyncFullSchemaPropertiesListResultPage contains a page of SyncFullSchemaProperties values.
23304type SyncFullSchemaPropertiesListResultPage struct {
23305	fn     func(context.Context, SyncFullSchemaPropertiesListResult) (SyncFullSchemaPropertiesListResult, error)
23306	sfsplr SyncFullSchemaPropertiesListResult
23307}
23308
23309// NextWithContext advances to the next page of values.  If there was an error making
23310// the request the page does not advance and the error is returned.
23311func (page *SyncFullSchemaPropertiesListResultPage) NextWithContext(ctx context.Context) (err error) {
23312	if tracing.IsEnabled() {
23313		ctx = tracing.StartSpan(ctx, fqdn+"/SyncFullSchemaPropertiesListResultPage.NextWithContext")
23314		defer func() {
23315			sc := -1
23316			if page.Response().Response.Response != nil {
23317				sc = page.Response().Response.Response.StatusCode
23318			}
23319			tracing.EndSpan(ctx, sc, err)
23320		}()
23321	}
23322	for {
23323		next, err := page.fn(ctx, page.sfsplr)
23324		if err != nil {
23325			return err
23326		}
23327		page.sfsplr = next
23328		if !next.hasNextLink() || !next.IsEmpty() {
23329			break
23330		}
23331	}
23332	return nil
23333}
23334
23335// Next advances to the next page of values.  If there was an error making
23336// the request the page does not advance and the error is returned.
23337// Deprecated: Use NextWithContext() instead.
23338func (page *SyncFullSchemaPropertiesListResultPage) Next() error {
23339	return page.NextWithContext(context.Background())
23340}
23341
23342// NotDone returns true if the page enumeration should be started or is not yet complete.
23343func (page SyncFullSchemaPropertiesListResultPage) NotDone() bool {
23344	return !page.sfsplr.IsEmpty()
23345}
23346
23347// Response returns the raw server response from the last page request.
23348func (page SyncFullSchemaPropertiesListResultPage) Response() SyncFullSchemaPropertiesListResult {
23349	return page.sfsplr
23350}
23351
23352// Values returns the slice of values for the current page or nil if there are no values.
23353func (page SyncFullSchemaPropertiesListResultPage) Values() []SyncFullSchemaProperties {
23354	if page.sfsplr.IsEmpty() {
23355		return nil
23356	}
23357	return *page.sfsplr.Value
23358}
23359
23360// Creates a new instance of the SyncFullSchemaPropertiesListResultPage type.
23361func NewSyncFullSchemaPropertiesListResultPage(cur SyncFullSchemaPropertiesListResult, getNextPage func(context.Context, SyncFullSchemaPropertiesListResult) (SyncFullSchemaPropertiesListResult, error)) SyncFullSchemaPropertiesListResultPage {
23362	return SyncFullSchemaPropertiesListResultPage{
23363		fn:     getNextPage,
23364		sfsplr: cur,
23365	}
23366}
23367
23368// SyncFullSchemaTable properties of the table in the database full schema.
23369type SyncFullSchemaTable struct {
23370	// Columns - READ-ONLY; List of columns in the table of database full schema.
23371	Columns *[]SyncFullSchemaTableColumn `json:"columns,omitempty"`
23372	// ErrorID - READ-ONLY; Error id of the table.
23373	ErrorID *string `json:"errorId,omitempty"`
23374	// HasError - READ-ONLY; If there is error in the table.
23375	HasError *bool `json:"hasError,omitempty"`
23376	// Name - READ-ONLY; Name of the table.
23377	Name *string `json:"name,omitempty"`
23378	// QuotedName - READ-ONLY; Quoted name of the table.
23379	QuotedName *string `json:"quotedName,omitempty"`
23380}
23381
23382// MarshalJSON is the custom marshaler for SyncFullSchemaTable.
23383func (sfst SyncFullSchemaTable) MarshalJSON() ([]byte, error) {
23384	objectMap := make(map[string]interface{})
23385	return json.Marshal(objectMap)
23386}
23387
23388// SyncFullSchemaTableColumn properties of the column in the table of database full schema.
23389type SyncFullSchemaTableColumn struct {
23390	// DataSize - READ-ONLY; Data size of the column.
23391	DataSize *string `json:"dataSize,omitempty"`
23392	// DataType - READ-ONLY; Data type of the column.
23393	DataType *string `json:"dataType,omitempty"`
23394	// ErrorID - READ-ONLY; Error id of the column.
23395	ErrorID *string `json:"errorId,omitempty"`
23396	// HasError - READ-ONLY; If there is error in the table.
23397	HasError *bool `json:"hasError,omitempty"`
23398	// IsPrimaryKey - READ-ONLY; If it is the primary key of the table.
23399	IsPrimaryKey *bool `json:"isPrimaryKey,omitempty"`
23400	// Name - READ-ONLY; Name of the column.
23401	Name *string `json:"name,omitempty"`
23402	// QuotedName - READ-ONLY; Quoted name of the column.
23403	QuotedName *string `json:"quotedName,omitempty"`
23404}
23405
23406// MarshalJSON is the custom marshaler for SyncFullSchemaTableColumn.
23407func (sfstc SyncFullSchemaTableColumn) MarshalJSON() ([]byte, error) {
23408	objectMap := make(map[string]interface{})
23409	return json.Marshal(objectMap)
23410}
23411
23412// SyncGroup an Azure SQL Database sync group.
23413type SyncGroup struct {
23414	autorest.Response `json:"-"`
23415	// SyncGroupProperties - Resource properties.
23416	*SyncGroupProperties `json:"properties,omitempty"`
23417	// ID - READ-ONLY; Resource ID.
23418	ID *string `json:"id,omitempty"`
23419	// Name - READ-ONLY; Resource name.
23420	Name *string `json:"name,omitempty"`
23421	// Type - READ-ONLY; Resource type.
23422	Type *string `json:"type,omitempty"`
23423}
23424
23425// MarshalJSON is the custom marshaler for SyncGroup.
23426func (sg SyncGroup) MarshalJSON() ([]byte, error) {
23427	objectMap := make(map[string]interface{})
23428	if sg.SyncGroupProperties != nil {
23429		objectMap["properties"] = sg.SyncGroupProperties
23430	}
23431	return json.Marshal(objectMap)
23432}
23433
23434// UnmarshalJSON is the custom unmarshaler for SyncGroup struct.
23435func (sg *SyncGroup) UnmarshalJSON(body []byte) error {
23436	var m map[string]*json.RawMessage
23437	err := json.Unmarshal(body, &m)
23438	if err != nil {
23439		return err
23440	}
23441	for k, v := range m {
23442		switch k {
23443		case "properties":
23444			if v != nil {
23445				var syncGroupProperties SyncGroupProperties
23446				err = json.Unmarshal(*v, &syncGroupProperties)
23447				if err != nil {
23448					return err
23449				}
23450				sg.SyncGroupProperties = &syncGroupProperties
23451			}
23452		case "id":
23453			if v != nil {
23454				var ID string
23455				err = json.Unmarshal(*v, &ID)
23456				if err != nil {
23457					return err
23458				}
23459				sg.ID = &ID
23460			}
23461		case "name":
23462			if v != nil {
23463				var name string
23464				err = json.Unmarshal(*v, &name)
23465				if err != nil {
23466					return err
23467				}
23468				sg.Name = &name
23469			}
23470		case "type":
23471			if v != nil {
23472				var typeVar string
23473				err = json.Unmarshal(*v, &typeVar)
23474				if err != nil {
23475					return err
23476				}
23477				sg.Type = &typeVar
23478			}
23479		}
23480	}
23481
23482	return nil
23483}
23484
23485// SyncGroupListResult a list of sync groups.
23486type SyncGroupListResult struct {
23487	autorest.Response `json:"-"`
23488	// Value - READ-ONLY; Array of results.
23489	Value *[]SyncGroup `json:"value,omitempty"`
23490	// NextLink - READ-ONLY; Link to retrieve next page of results.
23491	NextLink *string `json:"nextLink,omitempty"`
23492}
23493
23494// MarshalJSON is the custom marshaler for SyncGroupListResult.
23495func (sglr SyncGroupListResult) MarshalJSON() ([]byte, error) {
23496	objectMap := make(map[string]interface{})
23497	return json.Marshal(objectMap)
23498}
23499
23500// SyncGroupListResultIterator provides access to a complete listing of SyncGroup values.
23501type SyncGroupListResultIterator struct {
23502	i    int
23503	page SyncGroupListResultPage
23504}
23505
23506// NextWithContext advances to the next value.  If there was an error making
23507// the request the iterator does not advance and the error is returned.
23508func (iter *SyncGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
23509	if tracing.IsEnabled() {
23510		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupListResultIterator.NextWithContext")
23511		defer func() {
23512			sc := -1
23513			if iter.Response().Response.Response != nil {
23514				sc = iter.Response().Response.Response.StatusCode
23515			}
23516			tracing.EndSpan(ctx, sc, err)
23517		}()
23518	}
23519	iter.i++
23520	if iter.i < len(iter.page.Values()) {
23521		return nil
23522	}
23523	err = iter.page.NextWithContext(ctx)
23524	if err != nil {
23525		iter.i--
23526		return err
23527	}
23528	iter.i = 0
23529	return nil
23530}
23531
23532// Next advances to the next value.  If there was an error making
23533// the request the iterator does not advance and the error is returned.
23534// Deprecated: Use NextWithContext() instead.
23535func (iter *SyncGroupListResultIterator) Next() error {
23536	return iter.NextWithContext(context.Background())
23537}
23538
23539// NotDone returns true if the enumeration should be started or is not yet complete.
23540func (iter SyncGroupListResultIterator) NotDone() bool {
23541	return iter.page.NotDone() && iter.i < len(iter.page.Values())
23542}
23543
23544// Response returns the raw server response from the last page request.
23545func (iter SyncGroupListResultIterator) Response() SyncGroupListResult {
23546	return iter.page.Response()
23547}
23548
23549// Value returns the current value or a zero-initialized value if the
23550// iterator has advanced beyond the end of the collection.
23551func (iter SyncGroupListResultIterator) Value() SyncGroup {
23552	if !iter.page.NotDone() {
23553		return SyncGroup{}
23554	}
23555	return iter.page.Values()[iter.i]
23556}
23557
23558// Creates a new instance of the SyncGroupListResultIterator type.
23559func NewSyncGroupListResultIterator(page SyncGroupListResultPage) SyncGroupListResultIterator {
23560	return SyncGroupListResultIterator{page: page}
23561}
23562
23563// IsEmpty returns true if the ListResult contains no values.
23564func (sglr SyncGroupListResult) IsEmpty() bool {
23565	return sglr.Value == nil || len(*sglr.Value) == 0
23566}
23567
23568// hasNextLink returns true if the NextLink is not empty.
23569func (sglr SyncGroupListResult) hasNextLink() bool {
23570	return sglr.NextLink != nil && len(*sglr.NextLink) != 0
23571}
23572
23573// syncGroupListResultPreparer prepares a request to retrieve the next set of results.
23574// It returns nil if no more results exist.
23575func (sglr SyncGroupListResult) syncGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
23576	if !sglr.hasNextLink() {
23577		return nil, nil
23578	}
23579	return autorest.Prepare((&http.Request{}).WithContext(ctx),
23580		autorest.AsJSON(),
23581		autorest.AsGet(),
23582		autorest.WithBaseURL(to.String(sglr.NextLink)))
23583}
23584
23585// SyncGroupListResultPage contains a page of SyncGroup values.
23586type SyncGroupListResultPage struct {
23587	fn   func(context.Context, SyncGroupListResult) (SyncGroupListResult, error)
23588	sglr SyncGroupListResult
23589}
23590
23591// NextWithContext advances to the next page of values.  If there was an error making
23592// the request the page does not advance and the error is returned.
23593func (page *SyncGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
23594	if tracing.IsEnabled() {
23595		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupListResultPage.NextWithContext")
23596		defer func() {
23597			sc := -1
23598			if page.Response().Response.Response != nil {
23599				sc = page.Response().Response.Response.StatusCode
23600			}
23601			tracing.EndSpan(ctx, sc, err)
23602		}()
23603	}
23604	for {
23605		next, err := page.fn(ctx, page.sglr)
23606		if err != nil {
23607			return err
23608		}
23609		page.sglr = next
23610		if !next.hasNextLink() || !next.IsEmpty() {
23611			break
23612		}
23613	}
23614	return nil
23615}
23616
23617// Next advances to the next page of values.  If there was an error making
23618// the request the page does not advance and the error is returned.
23619// Deprecated: Use NextWithContext() instead.
23620func (page *SyncGroupListResultPage) Next() error {
23621	return page.NextWithContext(context.Background())
23622}
23623
23624// NotDone returns true if the page enumeration should be started or is not yet complete.
23625func (page SyncGroupListResultPage) NotDone() bool {
23626	return !page.sglr.IsEmpty()
23627}
23628
23629// Response returns the raw server response from the last page request.
23630func (page SyncGroupListResultPage) Response() SyncGroupListResult {
23631	return page.sglr
23632}
23633
23634// Values returns the slice of values for the current page or nil if there are no values.
23635func (page SyncGroupListResultPage) Values() []SyncGroup {
23636	if page.sglr.IsEmpty() {
23637		return nil
23638	}
23639	return *page.sglr.Value
23640}
23641
23642// Creates a new instance of the SyncGroupListResultPage type.
23643func NewSyncGroupListResultPage(cur SyncGroupListResult, getNextPage func(context.Context, SyncGroupListResult) (SyncGroupListResult, error)) SyncGroupListResultPage {
23644	return SyncGroupListResultPage{
23645		fn:   getNextPage,
23646		sglr: cur,
23647	}
23648}
23649
23650// SyncGroupLogListResult a list of sync group log properties.
23651type SyncGroupLogListResult struct {
23652	autorest.Response `json:"-"`
23653	// Value - READ-ONLY; Array of results.
23654	Value *[]SyncGroupLogProperties `json:"value,omitempty"`
23655	// NextLink - READ-ONLY; Link to retrieve next page of results.
23656	NextLink *string `json:"nextLink,omitempty"`
23657}
23658
23659// MarshalJSON is the custom marshaler for SyncGroupLogListResult.
23660func (sgllr SyncGroupLogListResult) MarshalJSON() ([]byte, error) {
23661	objectMap := make(map[string]interface{})
23662	return json.Marshal(objectMap)
23663}
23664
23665// SyncGroupLogListResultIterator provides access to a complete listing of SyncGroupLogProperties values.
23666type SyncGroupLogListResultIterator struct {
23667	i    int
23668	page SyncGroupLogListResultPage
23669}
23670
23671// NextWithContext advances to the next value.  If there was an error making
23672// the request the iterator does not advance and the error is returned.
23673func (iter *SyncGroupLogListResultIterator) NextWithContext(ctx context.Context) (err error) {
23674	if tracing.IsEnabled() {
23675		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupLogListResultIterator.NextWithContext")
23676		defer func() {
23677			sc := -1
23678			if iter.Response().Response.Response != nil {
23679				sc = iter.Response().Response.Response.StatusCode
23680			}
23681			tracing.EndSpan(ctx, sc, err)
23682		}()
23683	}
23684	iter.i++
23685	if iter.i < len(iter.page.Values()) {
23686		return nil
23687	}
23688	err = iter.page.NextWithContext(ctx)
23689	if err != nil {
23690		iter.i--
23691		return err
23692	}
23693	iter.i = 0
23694	return nil
23695}
23696
23697// Next advances to the next value.  If there was an error making
23698// the request the iterator does not advance and the error is returned.
23699// Deprecated: Use NextWithContext() instead.
23700func (iter *SyncGroupLogListResultIterator) Next() error {
23701	return iter.NextWithContext(context.Background())
23702}
23703
23704// NotDone returns true if the enumeration should be started or is not yet complete.
23705func (iter SyncGroupLogListResultIterator) NotDone() bool {
23706	return iter.page.NotDone() && iter.i < len(iter.page.Values())
23707}
23708
23709// Response returns the raw server response from the last page request.
23710func (iter SyncGroupLogListResultIterator) Response() SyncGroupLogListResult {
23711	return iter.page.Response()
23712}
23713
23714// Value returns the current value or a zero-initialized value if the
23715// iterator has advanced beyond the end of the collection.
23716func (iter SyncGroupLogListResultIterator) Value() SyncGroupLogProperties {
23717	if !iter.page.NotDone() {
23718		return SyncGroupLogProperties{}
23719	}
23720	return iter.page.Values()[iter.i]
23721}
23722
23723// Creates a new instance of the SyncGroupLogListResultIterator type.
23724func NewSyncGroupLogListResultIterator(page SyncGroupLogListResultPage) SyncGroupLogListResultIterator {
23725	return SyncGroupLogListResultIterator{page: page}
23726}
23727
23728// IsEmpty returns true if the ListResult contains no values.
23729func (sgllr SyncGroupLogListResult) IsEmpty() bool {
23730	return sgllr.Value == nil || len(*sgllr.Value) == 0
23731}
23732
23733// hasNextLink returns true if the NextLink is not empty.
23734func (sgllr SyncGroupLogListResult) hasNextLink() bool {
23735	return sgllr.NextLink != nil && len(*sgllr.NextLink) != 0
23736}
23737
23738// syncGroupLogListResultPreparer prepares a request to retrieve the next set of results.
23739// It returns nil if no more results exist.
23740func (sgllr SyncGroupLogListResult) syncGroupLogListResultPreparer(ctx context.Context) (*http.Request, error) {
23741	if !sgllr.hasNextLink() {
23742		return nil, nil
23743	}
23744	return autorest.Prepare((&http.Request{}).WithContext(ctx),
23745		autorest.AsJSON(),
23746		autorest.AsGet(),
23747		autorest.WithBaseURL(to.String(sgllr.NextLink)))
23748}
23749
23750// SyncGroupLogListResultPage contains a page of SyncGroupLogProperties values.
23751type SyncGroupLogListResultPage struct {
23752	fn    func(context.Context, SyncGroupLogListResult) (SyncGroupLogListResult, error)
23753	sgllr SyncGroupLogListResult
23754}
23755
23756// NextWithContext 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.
23758func (page *SyncGroupLogListResultPage) NextWithContext(ctx context.Context) (err error) {
23759	if tracing.IsEnabled() {
23760		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupLogListResultPage.NextWithContext")
23761		defer func() {
23762			sc := -1
23763			if page.Response().Response.Response != nil {
23764				sc = page.Response().Response.Response.StatusCode
23765			}
23766			tracing.EndSpan(ctx, sc, err)
23767		}()
23768	}
23769	for {
23770		next, err := page.fn(ctx, page.sgllr)
23771		if err != nil {
23772			return err
23773		}
23774		page.sgllr = next
23775		if !next.hasNextLink() || !next.IsEmpty() {
23776			break
23777		}
23778	}
23779	return nil
23780}
23781
23782// Next advances to the next page of values.  If there was an error making
23783// the request the page does not advance and the error is returned.
23784// Deprecated: Use NextWithContext() instead.
23785func (page *SyncGroupLogListResultPage) Next() error {
23786	return page.NextWithContext(context.Background())
23787}
23788
23789// NotDone returns true if the page enumeration should be started or is not yet complete.
23790func (page SyncGroupLogListResultPage) NotDone() bool {
23791	return !page.sgllr.IsEmpty()
23792}
23793
23794// Response returns the raw server response from the last page request.
23795func (page SyncGroupLogListResultPage) Response() SyncGroupLogListResult {
23796	return page.sgllr
23797}
23798
23799// Values returns the slice of values for the current page or nil if there are no values.
23800func (page SyncGroupLogListResultPage) Values() []SyncGroupLogProperties {
23801	if page.sgllr.IsEmpty() {
23802		return nil
23803	}
23804	return *page.sgllr.Value
23805}
23806
23807// Creates a new instance of the SyncGroupLogListResultPage type.
23808func NewSyncGroupLogListResultPage(cur SyncGroupLogListResult, getNextPage func(context.Context, SyncGroupLogListResult) (SyncGroupLogListResult, error)) SyncGroupLogListResultPage {
23809	return SyncGroupLogListResultPage{
23810		fn:    getNextPage,
23811		sgllr: cur,
23812	}
23813}
23814
23815// SyncGroupLogProperties properties of an Azure SQL Database sync group log.
23816type SyncGroupLogProperties struct {
23817	// Timestamp - READ-ONLY; Timestamp of the sync group log.
23818	Timestamp *date.Time `json:"timestamp,omitempty"`
23819	// Type - READ-ONLY; Type of the sync group log. Possible values include: 'SyncGroupLogTypeAll', 'SyncGroupLogTypeError', 'SyncGroupLogTypeWarning', 'SyncGroupLogTypeSuccess'
23820	Type SyncGroupLogType `json:"type,omitempty"`
23821	// Source - READ-ONLY; Source of the sync group log.
23822	Source *string `json:"source,omitempty"`
23823	// Details - READ-ONLY; Details of the sync group log.
23824	Details *string `json:"details,omitempty"`
23825	// TracingID - READ-ONLY; TracingId of the sync group log.
23826	TracingID *uuid.UUID `json:"tracingId,omitempty"`
23827	// OperationStatus - READ-ONLY; OperationStatus of the sync group log.
23828	OperationStatus *string `json:"operationStatus,omitempty"`
23829}
23830
23831// MarshalJSON is the custom marshaler for SyncGroupLogProperties.
23832func (sglp SyncGroupLogProperties) MarshalJSON() ([]byte, error) {
23833	objectMap := make(map[string]interface{})
23834	return json.Marshal(objectMap)
23835}
23836
23837// SyncGroupProperties properties of a sync group.
23838type SyncGroupProperties struct {
23839	// Interval - Sync interval of the sync group.
23840	Interval *int32 `json:"interval,omitempty"`
23841	// LastSyncTime - READ-ONLY; Last sync time of the sync group.
23842	LastSyncTime *date.Time `json:"lastSyncTime,omitempty"`
23843	// ConflictResolutionPolicy - Conflict resolution policy of the sync group. Possible values include: 'HubWin', 'MemberWin'
23844	ConflictResolutionPolicy SyncConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
23845	// SyncDatabaseID - ARM resource id of the sync database in the sync group.
23846	SyncDatabaseID *string `json:"syncDatabaseId,omitempty"`
23847	// HubDatabaseUserName - User name for the sync group hub database credential.
23848	HubDatabaseUserName *string `json:"hubDatabaseUserName,omitempty"`
23849	// HubDatabasePassword - Password for the sync group hub database credential.
23850	HubDatabasePassword *string `json:"hubDatabasePassword,omitempty"`
23851	// SyncState - READ-ONLY; Sync state of the sync group. Possible values include: 'NotReady', 'Error', 'Warning', 'Progressing', 'Good'
23852	SyncState SyncGroupState `json:"syncState,omitempty"`
23853	// Schema - Sync schema of the sync group.
23854	Schema *SyncGroupSchema `json:"schema,omitempty"`
23855	// UsePrivateLinkConnection - If use private link connection is enabled.
23856	UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"`
23857	// PrivateEndpointName - READ-ONLY; Private endpoint name of the sync group if use private link connection is enabled.
23858	PrivateEndpointName *string `json:"privateEndpointName,omitempty"`
23859}
23860
23861// MarshalJSON is the custom marshaler for SyncGroupProperties.
23862func (sgp SyncGroupProperties) MarshalJSON() ([]byte, error) {
23863	objectMap := make(map[string]interface{})
23864	if sgp.Interval != nil {
23865		objectMap["interval"] = sgp.Interval
23866	}
23867	if sgp.ConflictResolutionPolicy != "" {
23868		objectMap["conflictResolutionPolicy"] = sgp.ConflictResolutionPolicy
23869	}
23870	if sgp.SyncDatabaseID != nil {
23871		objectMap["syncDatabaseId"] = sgp.SyncDatabaseID
23872	}
23873	if sgp.HubDatabaseUserName != nil {
23874		objectMap["hubDatabaseUserName"] = sgp.HubDatabaseUserName
23875	}
23876	if sgp.HubDatabasePassword != nil {
23877		objectMap["hubDatabasePassword"] = sgp.HubDatabasePassword
23878	}
23879	if sgp.Schema != nil {
23880		objectMap["schema"] = sgp.Schema
23881	}
23882	if sgp.UsePrivateLinkConnection != nil {
23883		objectMap["usePrivateLinkConnection"] = sgp.UsePrivateLinkConnection
23884	}
23885	return json.Marshal(objectMap)
23886}
23887
23888// SyncGroupSchema properties of sync group schema.
23889type SyncGroupSchema struct {
23890	// Tables - List of tables in sync group schema.
23891	Tables *[]SyncGroupSchemaTable `json:"tables,omitempty"`
23892	// MasterSyncMemberName - Name of master sync member where the schema is from.
23893	MasterSyncMemberName *string `json:"masterSyncMemberName,omitempty"`
23894}
23895
23896// SyncGroupSchemaTable properties of table in sync group schema.
23897type SyncGroupSchemaTable struct {
23898	// Columns - List of columns in sync group schema.
23899	Columns *[]SyncGroupSchemaTableColumn `json:"columns,omitempty"`
23900	// QuotedName - Quoted name of sync group schema table.
23901	QuotedName *string `json:"quotedName,omitempty"`
23902}
23903
23904// SyncGroupSchemaTableColumn properties of column in sync group table.
23905type SyncGroupSchemaTableColumn struct {
23906	// QuotedName - Quoted name of sync group table column.
23907	QuotedName *string `json:"quotedName,omitempty"`
23908	// DataSize - Data size of the column.
23909	DataSize *string `json:"dataSize,omitempty"`
23910	// DataType - Data type of the column.
23911	DataType *string `json:"dataType,omitempty"`
23912}
23913
23914// SyncGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
23915// long-running operation.
23916type SyncGroupsCreateOrUpdateFuture struct {
23917	azure.FutureAPI
23918	// Result returns the result of the asynchronous operation.
23919	// If the operation has not completed it will return an error.
23920	Result func(SyncGroupsClient) (SyncGroup, error)
23921}
23922
23923// UnmarshalJSON is the custom unmarshaller for CreateFuture.
23924func (future *SyncGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
23925	var azFuture azure.Future
23926	if err := json.Unmarshal(body, &azFuture); err != nil {
23927		return err
23928	}
23929	future.FutureAPI = &azFuture
23930	future.Result = future.result
23931	return nil
23932}
23933
23934// result is the default implementation for SyncGroupsCreateOrUpdateFuture.Result.
23935func (future *SyncGroupsCreateOrUpdateFuture) result(client SyncGroupsClient) (sg SyncGroup, err error) {
23936	var done bool
23937	done, err = future.DoneWithContext(context.Background(), client)
23938	if err != nil {
23939		err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
23940		return
23941	}
23942	if !done {
23943		sg.Response.Response = future.Response()
23944		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsCreateOrUpdateFuture")
23945		return
23946	}
23947	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
23948	if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent {
23949		sg, err = client.CreateOrUpdateResponder(sg.Response.Response)
23950		if err != nil {
23951			err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", sg.Response.Response, "Failure responding to request")
23952		}
23953	}
23954	return
23955}
23956
23957// SyncGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
23958// operation.
23959type SyncGroupsDeleteFuture struct {
23960	azure.FutureAPI
23961	// Result returns the result of the asynchronous operation.
23962	// If the operation has not completed it will return an error.
23963	Result func(SyncGroupsClient) (autorest.Response, error)
23964}
23965
23966// UnmarshalJSON is the custom unmarshaller for CreateFuture.
23967func (future *SyncGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
23968	var azFuture azure.Future
23969	if err := json.Unmarshal(body, &azFuture); err != nil {
23970		return err
23971	}
23972	future.FutureAPI = &azFuture
23973	future.Result = future.result
23974	return nil
23975}
23976
23977// result is the default implementation for SyncGroupsDeleteFuture.Result.
23978func (future *SyncGroupsDeleteFuture) result(client SyncGroupsClient) (ar autorest.Response, err error) {
23979	var done bool
23980	done, err = future.DoneWithContext(context.Background(), client)
23981	if err != nil {
23982		err = autorest.NewErrorWithError(err, "sql.SyncGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
23983		return
23984	}
23985	if !done {
23986		ar.Response = future.Response()
23987		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsDeleteFuture")
23988		return
23989	}
23990	ar.Response = future.Response()
23991	return
23992}
23993
23994// SyncGroupsRefreshHubSchemaFuture an abstraction for monitoring and retrieving the results of a
23995// long-running operation.
23996type SyncGroupsRefreshHubSchemaFuture struct {
23997	azure.FutureAPI
23998	// Result returns the result of the asynchronous operation.
23999	// If the operation has not completed it will return an error.
24000	Result func(SyncGroupsClient) (autorest.Response, error)
24001}
24002
24003// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24004func (future *SyncGroupsRefreshHubSchemaFuture) UnmarshalJSON(body []byte) error {
24005	var azFuture azure.Future
24006	if err := json.Unmarshal(body, &azFuture); err != nil {
24007		return err
24008	}
24009	future.FutureAPI = &azFuture
24010	future.Result = future.result
24011	return nil
24012}
24013
24014// result is the default implementation for SyncGroupsRefreshHubSchemaFuture.Result.
24015func (future *SyncGroupsRefreshHubSchemaFuture) result(client SyncGroupsClient) (ar autorest.Response, err error) {
24016	var done bool
24017	done, err = future.DoneWithContext(context.Background(), client)
24018	if err != nil {
24019		err = autorest.NewErrorWithError(err, "sql.SyncGroupsRefreshHubSchemaFuture", "Result", future.Response(), "Polling failure")
24020		return
24021	}
24022	if !done {
24023		ar.Response = future.Response()
24024		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsRefreshHubSchemaFuture")
24025		return
24026	}
24027	ar.Response = future.Response()
24028	return
24029}
24030
24031// SyncGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
24032// operation.
24033type SyncGroupsUpdateFuture struct {
24034	azure.FutureAPI
24035	// Result returns the result of the asynchronous operation.
24036	// If the operation has not completed it will return an error.
24037	Result func(SyncGroupsClient) (SyncGroup, error)
24038}
24039
24040// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24041func (future *SyncGroupsUpdateFuture) UnmarshalJSON(body []byte) error {
24042	var azFuture azure.Future
24043	if err := json.Unmarshal(body, &azFuture); err != nil {
24044		return err
24045	}
24046	future.FutureAPI = &azFuture
24047	future.Result = future.result
24048	return nil
24049}
24050
24051// result is the default implementation for SyncGroupsUpdateFuture.Result.
24052func (future *SyncGroupsUpdateFuture) result(client SyncGroupsClient) (sg SyncGroup, err error) {
24053	var done bool
24054	done, err = future.DoneWithContext(context.Background(), client)
24055	if err != nil {
24056		err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", future.Response(), "Polling failure")
24057		return
24058	}
24059	if !done {
24060		sg.Response.Response = future.Response()
24061		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsUpdateFuture")
24062		return
24063	}
24064	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
24065	if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent {
24066		sg, err = client.UpdateResponder(sg.Response.Response)
24067		if err != nil {
24068			err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", sg.Response.Response, "Failure responding to request")
24069		}
24070	}
24071	return
24072}
24073
24074// SyncMember an Azure SQL Database sync member.
24075type SyncMember struct {
24076	autorest.Response `json:"-"`
24077	// SyncMemberProperties - Resource properties.
24078	*SyncMemberProperties `json:"properties,omitempty"`
24079	// ID - READ-ONLY; Resource ID.
24080	ID *string `json:"id,omitempty"`
24081	// Name - READ-ONLY; Resource name.
24082	Name *string `json:"name,omitempty"`
24083	// Type - READ-ONLY; Resource type.
24084	Type *string `json:"type,omitempty"`
24085}
24086
24087// MarshalJSON is the custom marshaler for SyncMember.
24088func (sm SyncMember) MarshalJSON() ([]byte, error) {
24089	objectMap := make(map[string]interface{})
24090	if sm.SyncMemberProperties != nil {
24091		objectMap["properties"] = sm.SyncMemberProperties
24092	}
24093	return json.Marshal(objectMap)
24094}
24095
24096// UnmarshalJSON is the custom unmarshaler for SyncMember struct.
24097func (sm *SyncMember) UnmarshalJSON(body []byte) error {
24098	var m map[string]*json.RawMessage
24099	err := json.Unmarshal(body, &m)
24100	if err != nil {
24101		return err
24102	}
24103	for k, v := range m {
24104		switch k {
24105		case "properties":
24106			if v != nil {
24107				var syncMemberProperties SyncMemberProperties
24108				err = json.Unmarshal(*v, &syncMemberProperties)
24109				if err != nil {
24110					return err
24111				}
24112				sm.SyncMemberProperties = &syncMemberProperties
24113			}
24114		case "id":
24115			if v != nil {
24116				var ID string
24117				err = json.Unmarshal(*v, &ID)
24118				if err != nil {
24119					return err
24120				}
24121				sm.ID = &ID
24122			}
24123		case "name":
24124			if v != nil {
24125				var name string
24126				err = json.Unmarshal(*v, &name)
24127				if err != nil {
24128					return err
24129				}
24130				sm.Name = &name
24131			}
24132		case "type":
24133			if v != nil {
24134				var typeVar string
24135				err = json.Unmarshal(*v, &typeVar)
24136				if err != nil {
24137					return err
24138				}
24139				sm.Type = &typeVar
24140			}
24141		}
24142	}
24143
24144	return nil
24145}
24146
24147// SyncMemberListResult a list of Azure SQL Database sync members.
24148type SyncMemberListResult struct {
24149	autorest.Response `json:"-"`
24150	// Value - READ-ONLY; Array of results.
24151	Value *[]SyncMember `json:"value,omitempty"`
24152	// NextLink - READ-ONLY; Link to retrieve next page of results.
24153	NextLink *string `json:"nextLink,omitempty"`
24154}
24155
24156// MarshalJSON is the custom marshaler for SyncMemberListResult.
24157func (smlr SyncMemberListResult) MarshalJSON() ([]byte, error) {
24158	objectMap := make(map[string]interface{})
24159	return json.Marshal(objectMap)
24160}
24161
24162// SyncMemberListResultIterator provides access to a complete listing of SyncMember values.
24163type SyncMemberListResultIterator struct {
24164	i    int
24165	page SyncMemberListResultPage
24166}
24167
24168// NextWithContext advances to the next value.  If there was an error making
24169// the request the iterator does not advance and the error is returned.
24170func (iter *SyncMemberListResultIterator) NextWithContext(ctx context.Context) (err error) {
24171	if tracing.IsEnabled() {
24172		ctx = tracing.StartSpan(ctx, fqdn+"/SyncMemberListResultIterator.NextWithContext")
24173		defer func() {
24174			sc := -1
24175			if iter.Response().Response.Response != nil {
24176				sc = iter.Response().Response.Response.StatusCode
24177			}
24178			tracing.EndSpan(ctx, sc, err)
24179		}()
24180	}
24181	iter.i++
24182	if iter.i < len(iter.page.Values()) {
24183		return nil
24184	}
24185	err = iter.page.NextWithContext(ctx)
24186	if err != nil {
24187		iter.i--
24188		return err
24189	}
24190	iter.i = 0
24191	return nil
24192}
24193
24194// Next advances to the next value.  If there was an error making
24195// the request the iterator does not advance and the error is returned.
24196// Deprecated: Use NextWithContext() instead.
24197func (iter *SyncMemberListResultIterator) Next() error {
24198	return iter.NextWithContext(context.Background())
24199}
24200
24201// NotDone returns true if the enumeration should be started or is not yet complete.
24202func (iter SyncMemberListResultIterator) NotDone() bool {
24203	return iter.page.NotDone() && iter.i < len(iter.page.Values())
24204}
24205
24206// Response returns the raw server response from the last page request.
24207func (iter SyncMemberListResultIterator) Response() SyncMemberListResult {
24208	return iter.page.Response()
24209}
24210
24211// Value returns the current value or a zero-initialized value if the
24212// iterator has advanced beyond the end of the collection.
24213func (iter SyncMemberListResultIterator) Value() SyncMember {
24214	if !iter.page.NotDone() {
24215		return SyncMember{}
24216	}
24217	return iter.page.Values()[iter.i]
24218}
24219
24220// Creates a new instance of the SyncMemberListResultIterator type.
24221func NewSyncMemberListResultIterator(page SyncMemberListResultPage) SyncMemberListResultIterator {
24222	return SyncMemberListResultIterator{page: page}
24223}
24224
24225// IsEmpty returns true if the ListResult contains no values.
24226func (smlr SyncMemberListResult) IsEmpty() bool {
24227	return smlr.Value == nil || len(*smlr.Value) == 0
24228}
24229
24230// hasNextLink returns true if the NextLink is not empty.
24231func (smlr SyncMemberListResult) hasNextLink() bool {
24232	return smlr.NextLink != nil && len(*smlr.NextLink) != 0
24233}
24234
24235// syncMemberListResultPreparer prepares a request to retrieve the next set of results.
24236// It returns nil if no more results exist.
24237func (smlr SyncMemberListResult) syncMemberListResultPreparer(ctx context.Context) (*http.Request, error) {
24238	if !smlr.hasNextLink() {
24239		return nil, nil
24240	}
24241	return autorest.Prepare((&http.Request{}).WithContext(ctx),
24242		autorest.AsJSON(),
24243		autorest.AsGet(),
24244		autorest.WithBaseURL(to.String(smlr.NextLink)))
24245}
24246
24247// SyncMemberListResultPage contains a page of SyncMember values.
24248type SyncMemberListResultPage struct {
24249	fn   func(context.Context, SyncMemberListResult) (SyncMemberListResult, error)
24250	smlr SyncMemberListResult
24251}
24252
24253// NextWithContext advances to the next page of values.  If there was an error making
24254// the request the page does not advance and the error is returned.
24255func (page *SyncMemberListResultPage) NextWithContext(ctx context.Context) (err error) {
24256	if tracing.IsEnabled() {
24257		ctx = tracing.StartSpan(ctx, fqdn+"/SyncMemberListResultPage.NextWithContext")
24258		defer func() {
24259			sc := -1
24260			if page.Response().Response.Response != nil {
24261				sc = page.Response().Response.Response.StatusCode
24262			}
24263			tracing.EndSpan(ctx, sc, err)
24264		}()
24265	}
24266	for {
24267		next, err := page.fn(ctx, page.smlr)
24268		if err != nil {
24269			return err
24270		}
24271		page.smlr = next
24272		if !next.hasNextLink() || !next.IsEmpty() {
24273			break
24274		}
24275	}
24276	return nil
24277}
24278
24279// Next advances to the next page of values.  If there was an error making
24280// the request the page does not advance and the error is returned.
24281// Deprecated: Use NextWithContext() instead.
24282func (page *SyncMemberListResultPage) Next() error {
24283	return page.NextWithContext(context.Background())
24284}
24285
24286// NotDone returns true if the page enumeration should be started or is not yet complete.
24287func (page SyncMemberListResultPage) NotDone() bool {
24288	return !page.smlr.IsEmpty()
24289}
24290
24291// Response returns the raw server response from the last page request.
24292func (page SyncMemberListResultPage) Response() SyncMemberListResult {
24293	return page.smlr
24294}
24295
24296// Values returns the slice of values for the current page or nil if there are no values.
24297func (page SyncMemberListResultPage) Values() []SyncMember {
24298	if page.smlr.IsEmpty() {
24299		return nil
24300	}
24301	return *page.smlr.Value
24302}
24303
24304// Creates a new instance of the SyncMemberListResultPage type.
24305func NewSyncMemberListResultPage(cur SyncMemberListResult, getNextPage func(context.Context, SyncMemberListResult) (SyncMemberListResult, error)) SyncMemberListResultPage {
24306	return SyncMemberListResultPage{
24307		fn:   getNextPage,
24308		smlr: cur,
24309	}
24310}
24311
24312// SyncMemberProperties properties of a sync member.
24313type SyncMemberProperties struct {
24314	// DatabaseType - Database type of the sync member. Possible values include: 'AzureSQLDatabase', 'SQLServerDatabase'
24315	DatabaseType SyncMemberDbType `json:"databaseType,omitempty"`
24316	// SyncAgentID - ARM resource id of the sync agent in the sync member.
24317	SyncAgentID *string `json:"syncAgentId,omitempty"`
24318	// SQLServerDatabaseID - SQL Server database id of the sync member.
24319	SQLServerDatabaseID *uuid.UUID `json:"sqlServerDatabaseId,omitempty"`
24320	// SyncMemberAzureDatabaseResourceID - ARM resource id of the sync member logical database, for sync members in Azure.
24321	SyncMemberAzureDatabaseResourceID *string `json:"syncMemberAzureDatabaseResourceId,omitempty"`
24322	// UsePrivateLinkConnection - Whether to use private link connection.
24323	UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"`
24324	// PrivateEndpointName - READ-ONLY; Private endpoint name of the sync member if use private link connection is enabled, for sync members in Azure.
24325	PrivateEndpointName *string `json:"privateEndpointName,omitempty"`
24326	// ServerName - Server name of the member database in the sync member
24327	ServerName *string `json:"serverName,omitempty"`
24328	// DatabaseName - Database name of the member database in the sync member.
24329	DatabaseName *string `json:"databaseName,omitempty"`
24330	// UserName - User name of the member database in the sync member.
24331	UserName *string `json:"userName,omitempty"`
24332	// Password - Password of the member database in the sync member.
24333	Password *string `json:"password,omitempty"`
24334	// SyncDirection - Sync direction of the sync member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', 'OneWayHubToMember'
24335	SyncDirection SyncDirection `json:"syncDirection,omitempty"`
24336	// 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'
24337	SyncState SyncMemberState `json:"syncState,omitempty"`
24338}
24339
24340// MarshalJSON is the custom marshaler for SyncMemberProperties.
24341func (smp SyncMemberProperties) MarshalJSON() ([]byte, error) {
24342	objectMap := make(map[string]interface{})
24343	if smp.DatabaseType != "" {
24344		objectMap["databaseType"] = smp.DatabaseType
24345	}
24346	if smp.SyncAgentID != nil {
24347		objectMap["syncAgentId"] = smp.SyncAgentID
24348	}
24349	if smp.SQLServerDatabaseID != nil {
24350		objectMap["sqlServerDatabaseId"] = smp.SQLServerDatabaseID
24351	}
24352	if smp.SyncMemberAzureDatabaseResourceID != nil {
24353		objectMap["syncMemberAzureDatabaseResourceId"] = smp.SyncMemberAzureDatabaseResourceID
24354	}
24355	if smp.UsePrivateLinkConnection != nil {
24356		objectMap["usePrivateLinkConnection"] = smp.UsePrivateLinkConnection
24357	}
24358	if smp.ServerName != nil {
24359		objectMap["serverName"] = smp.ServerName
24360	}
24361	if smp.DatabaseName != nil {
24362		objectMap["databaseName"] = smp.DatabaseName
24363	}
24364	if smp.UserName != nil {
24365		objectMap["userName"] = smp.UserName
24366	}
24367	if smp.Password != nil {
24368		objectMap["password"] = smp.Password
24369	}
24370	if smp.SyncDirection != "" {
24371		objectMap["syncDirection"] = smp.SyncDirection
24372	}
24373	return json.Marshal(objectMap)
24374}
24375
24376// SyncMembersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
24377// long-running operation.
24378type SyncMembersCreateOrUpdateFuture struct {
24379	azure.FutureAPI
24380	// Result returns the result of the asynchronous operation.
24381	// If the operation has not completed it will return an error.
24382	Result func(SyncMembersClient) (SyncMember, error)
24383}
24384
24385// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24386func (future *SyncMembersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
24387	var azFuture azure.Future
24388	if err := json.Unmarshal(body, &azFuture); err != nil {
24389		return err
24390	}
24391	future.FutureAPI = &azFuture
24392	future.Result = future.result
24393	return nil
24394}
24395
24396// result is the default implementation for SyncMembersCreateOrUpdateFuture.Result.
24397func (future *SyncMembersCreateOrUpdateFuture) result(client SyncMembersClient) (sm SyncMember, err error) {
24398	var done bool
24399	done, err = future.DoneWithContext(context.Background(), client)
24400	if err != nil {
24401		err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
24402		return
24403	}
24404	if !done {
24405		sm.Response.Response = future.Response()
24406		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersCreateOrUpdateFuture")
24407		return
24408	}
24409	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
24410	if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent {
24411		sm, err = client.CreateOrUpdateResponder(sm.Response.Response)
24412		if err != nil {
24413			err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", sm.Response.Response, "Failure responding to request")
24414		}
24415	}
24416	return
24417}
24418
24419// SyncMembersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
24420// operation.
24421type SyncMembersDeleteFuture struct {
24422	azure.FutureAPI
24423	// Result returns the result of the asynchronous operation.
24424	// If the operation has not completed it will return an error.
24425	Result func(SyncMembersClient) (autorest.Response, error)
24426}
24427
24428// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24429func (future *SyncMembersDeleteFuture) UnmarshalJSON(body []byte) error {
24430	var azFuture azure.Future
24431	if err := json.Unmarshal(body, &azFuture); err != nil {
24432		return err
24433	}
24434	future.FutureAPI = &azFuture
24435	future.Result = future.result
24436	return nil
24437}
24438
24439// result is the default implementation for SyncMembersDeleteFuture.Result.
24440func (future *SyncMembersDeleteFuture) result(client SyncMembersClient) (ar autorest.Response, err error) {
24441	var done bool
24442	done, err = future.DoneWithContext(context.Background(), client)
24443	if err != nil {
24444		err = autorest.NewErrorWithError(err, "sql.SyncMembersDeleteFuture", "Result", future.Response(), "Polling failure")
24445		return
24446	}
24447	if !done {
24448		ar.Response = future.Response()
24449		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersDeleteFuture")
24450		return
24451	}
24452	ar.Response = future.Response()
24453	return
24454}
24455
24456// SyncMembersRefreshMemberSchemaFuture an abstraction for monitoring and retrieving the results of a
24457// long-running operation.
24458type SyncMembersRefreshMemberSchemaFuture struct {
24459	azure.FutureAPI
24460	// Result returns the result of the asynchronous operation.
24461	// If the operation has not completed it will return an error.
24462	Result func(SyncMembersClient) (autorest.Response, error)
24463}
24464
24465// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24466func (future *SyncMembersRefreshMemberSchemaFuture) UnmarshalJSON(body []byte) error {
24467	var azFuture azure.Future
24468	if err := json.Unmarshal(body, &azFuture); err != nil {
24469		return err
24470	}
24471	future.FutureAPI = &azFuture
24472	future.Result = future.result
24473	return nil
24474}
24475
24476// result is the default implementation for SyncMembersRefreshMemberSchemaFuture.Result.
24477func (future *SyncMembersRefreshMemberSchemaFuture) result(client SyncMembersClient) (ar autorest.Response, err error) {
24478	var done bool
24479	done, err = future.DoneWithContext(context.Background(), client)
24480	if err != nil {
24481		err = autorest.NewErrorWithError(err, "sql.SyncMembersRefreshMemberSchemaFuture", "Result", future.Response(), "Polling failure")
24482		return
24483	}
24484	if !done {
24485		ar.Response = future.Response()
24486		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersRefreshMemberSchemaFuture")
24487		return
24488	}
24489	ar.Response = future.Response()
24490	return
24491}
24492
24493// SyncMembersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
24494// operation.
24495type SyncMembersUpdateFuture struct {
24496	azure.FutureAPI
24497	// Result returns the result of the asynchronous operation.
24498	// If the operation has not completed it will return an error.
24499	Result func(SyncMembersClient) (SyncMember, error)
24500}
24501
24502// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24503func (future *SyncMembersUpdateFuture) UnmarshalJSON(body []byte) error {
24504	var azFuture azure.Future
24505	if err := json.Unmarshal(body, &azFuture); err != nil {
24506		return err
24507	}
24508	future.FutureAPI = &azFuture
24509	future.Result = future.result
24510	return nil
24511}
24512
24513// result is the default implementation for SyncMembersUpdateFuture.Result.
24514func (future *SyncMembersUpdateFuture) result(client SyncMembersClient) (sm SyncMember, err error) {
24515	var done bool
24516	done, err = future.DoneWithContext(context.Background(), client)
24517	if err != nil {
24518		err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", future.Response(), "Polling failure")
24519		return
24520	}
24521	if !done {
24522		sm.Response.Response = future.Response()
24523		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersUpdateFuture")
24524		return
24525	}
24526	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
24527	if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent {
24528		sm, err = client.UpdateResponder(sm.Response.Response)
24529		if err != nil {
24530			err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", sm.Response.Response, "Failure responding to request")
24531		}
24532	}
24533	return
24534}
24535
24536// SystemData metadata pertaining to creation and last modification of the resource.
24537type SystemData struct {
24538	// CreatedBy - READ-ONLY; A string identifier for the identity that created the resource.
24539	CreatedBy *string `json:"createdBy,omitempty"`
24540	// CreatedByType - READ-ONLY; The type of identity that created the resource: <User|Application|ManagedIdentity|Key>. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
24541	CreatedByType CreatedByType `json:"createdByType,omitempty"`
24542	// CreatedAt - READ-ONLY; The timestamp of resource creation (UTC).
24543	CreatedAt *date.Time `json:"createdAt,omitempty"`
24544	// LastModifiedBy - READ-ONLY; A string identifier for the identity that last modified the resource.
24545	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
24546	// LastModifiedByType - READ-ONLY; The type of identity that last modified the resource: <User|Application|ManagedIdentity|Key>. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
24547	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
24548	// LastModifiedAt - READ-ONLY; The timestamp of last modification (UTC).
24549	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
24550}
24551
24552// MarshalJSON is the custom marshaler for SystemData.
24553func (sd SystemData) MarshalJSON() ([]byte, error) {
24554	objectMap := make(map[string]interface{})
24555	return json.Marshal(objectMap)
24556}
24557
24558// TdeCertificate a TDE certificate that can be uploaded into a server.
24559type TdeCertificate struct {
24560	// TdeCertificateProperties - Resource properties.
24561	*TdeCertificateProperties `json:"properties,omitempty"`
24562	// ID - READ-ONLY; Resource ID.
24563	ID *string `json:"id,omitempty"`
24564	// Name - READ-ONLY; Resource name.
24565	Name *string `json:"name,omitempty"`
24566	// Type - READ-ONLY; Resource type.
24567	Type *string `json:"type,omitempty"`
24568}
24569
24570// MarshalJSON is the custom marshaler for TdeCertificate.
24571func (tc TdeCertificate) MarshalJSON() ([]byte, error) {
24572	objectMap := make(map[string]interface{})
24573	if tc.TdeCertificateProperties != nil {
24574		objectMap["properties"] = tc.TdeCertificateProperties
24575	}
24576	return json.Marshal(objectMap)
24577}
24578
24579// UnmarshalJSON is the custom unmarshaler for TdeCertificate struct.
24580func (tc *TdeCertificate) UnmarshalJSON(body []byte) error {
24581	var m map[string]*json.RawMessage
24582	err := json.Unmarshal(body, &m)
24583	if err != nil {
24584		return err
24585	}
24586	for k, v := range m {
24587		switch k {
24588		case "properties":
24589			if v != nil {
24590				var tdeCertificateProperties TdeCertificateProperties
24591				err = json.Unmarshal(*v, &tdeCertificateProperties)
24592				if err != nil {
24593					return err
24594				}
24595				tc.TdeCertificateProperties = &tdeCertificateProperties
24596			}
24597		case "id":
24598			if v != nil {
24599				var ID string
24600				err = json.Unmarshal(*v, &ID)
24601				if err != nil {
24602					return err
24603				}
24604				tc.ID = &ID
24605			}
24606		case "name":
24607			if v != nil {
24608				var name string
24609				err = json.Unmarshal(*v, &name)
24610				if err != nil {
24611					return err
24612				}
24613				tc.Name = &name
24614			}
24615		case "type":
24616			if v != nil {
24617				var typeVar string
24618				err = json.Unmarshal(*v, &typeVar)
24619				if err != nil {
24620					return err
24621				}
24622				tc.Type = &typeVar
24623			}
24624		}
24625	}
24626
24627	return nil
24628}
24629
24630// TdeCertificateProperties properties of a TDE certificate.
24631type TdeCertificateProperties struct {
24632	// PrivateBlob - The base64 encoded certificate private blob.
24633	PrivateBlob *string `json:"privateBlob,omitempty"`
24634	// CertPassword - The certificate password.
24635	CertPassword *string `json:"certPassword,omitempty"`
24636}
24637
24638// TdeCertificatesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
24639// operation.
24640type TdeCertificatesCreateFuture struct {
24641	azure.FutureAPI
24642	// Result returns the result of the asynchronous operation.
24643	// If the operation has not completed it will return an error.
24644	Result func(TdeCertificatesClient) (autorest.Response, error)
24645}
24646
24647// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24648func (future *TdeCertificatesCreateFuture) UnmarshalJSON(body []byte) error {
24649	var azFuture azure.Future
24650	if err := json.Unmarshal(body, &azFuture); err != nil {
24651		return err
24652	}
24653	future.FutureAPI = &azFuture
24654	future.Result = future.result
24655	return nil
24656}
24657
24658// result is the default implementation for TdeCertificatesCreateFuture.Result.
24659func (future *TdeCertificatesCreateFuture) result(client TdeCertificatesClient) (ar autorest.Response, err error) {
24660	var done bool
24661	done, err = future.DoneWithContext(context.Background(), client)
24662	if err != nil {
24663		err = autorest.NewErrorWithError(err, "sql.TdeCertificatesCreateFuture", "Result", future.Response(), "Polling failure")
24664		return
24665	}
24666	if !done {
24667		ar.Response = future.Response()
24668		err = azure.NewAsyncOpIncompleteError("sql.TdeCertificatesCreateFuture")
24669		return
24670	}
24671	ar.Response = future.Response()
24672	return
24673}
24674
24675// TopQueries ...
24676type TopQueries struct {
24677	// NumberOfQueries - READ-ONLY; Requested number of top queries.
24678	NumberOfQueries *int32 `json:"numberOfQueries,omitempty"`
24679	// AggregationFunction - READ-ONLY; Aggregation function used to calculate query metrics.
24680	AggregationFunction *string `json:"aggregationFunction,omitempty"`
24681	// ObservationMetric - READ-ONLY; Metric used to rank queries.
24682	ObservationMetric *string `json:"observationMetric,omitempty"`
24683	// IntervalType - READ-ONLY; Interval type (length). Possible values include: 'PT1H', 'P1D'
24684	IntervalType QueryTimeGrainType `json:"intervalType,omitempty"`
24685	// StartTime - READ-ONLY; The start time for the metric (ISO-8601 format).
24686	StartTime *string `json:"startTime,omitempty"`
24687	// EndTime - READ-ONLY; The end time for the metric (ISO-8601 format).
24688	EndTime *string `json:"endTime,omitempty"`
24689	// Queries - List of top resource consuming queries with appropriate metric data
24690	Queries *[]QueryStatisticsProperties `json:"queries,omitempty"`
24691}
24692
24693// MarshalJSON is the custom marshaler for TopQueries.
24694func (tq TopQueries) MarshalJSON() ([]byte, error) {
24695	objectMap := make(map[string]interface{})
24696	if tq.Queries != nil {
24697		objectMap["queries"] = tq.Queries
24698	}
24699	return json.Marshal(objectMap)
24700}
24701
24702// TopQueriesListResult a list of top resource consuming queries on managed instance
24703type TopQueriesListResult struct {
24704	autorest.Response `json:"-"`
24705	// Value - READ-ONLY; Array of results.
24706	Value *[]TopQueries `json:"value,omitempty"`
24707	// NextLink - READ-ONLY; Link to retrieve next page of results.
24708	NextLink *string `json:"nextLink,omitempty"`
24709}
24710
24711// MarshalJSON is the custom marshaler for TopQueriesListResult.
24712func (tqlr TopQueriesListResult) MarshalJSON() ([]byte, error) {
24713	objectMap := make(map[string]interface{})
24714	return json.Marshal(objectMap)
24715}
24716
24717// TopQueriesListResultIterator provides access to a complete listing of TopQueries values.
24718type TopQueriesListResultIterator struct {
24719	i    int
24720	page TopQueriesListResultPage
24721}
24722
24723// NextWithContext advances to the next value.  If there was an error making
24724// the request the iterator does not advance and the error is returned.
24725func (iter *TopQueriesListResultIterator) NextWithContext(ctx context.Context) (err error) {
24726	if tracing.IsEnabled() {
24727		ctx = tracing.StartSpan(ctx, fqdn+"/TopQueriesListResultIterator.NextWithContext")
24728		defer func() {
24729			sc := -1
24730			if iter.Response().Response.Response != nil {
24731				sc = iter.Response().Response.Response.StatusCode
24732			}
24733			tracing.EndSpan(ctx, sc, err)
24734		}()
24735	}
24736	iter.i++
24737	if iter.i < len(iter.page.Values()) {
24738		return nil
24739	}
24740	err = iter.page.NextWithContext(ctx)
24741	if err != nil {
24742		iter.i--
24743		return err
24744	}
24745	iter.i = 0
24746	return nil
24747}
24748
24749// Next advances to the next value.  If there was an error making
24750// the request the iterator does not advance and the error is returned.
24751// Deprecated: Use NextWithContext() instead.
24752func (iter *TopQueriesListResultIterator) Next() error {
24753	return iter.NextWithContext(context.Background())
24754}
24755
24756// NotDone returns true if the enumeration should be started or is not yet complete.
24757func (iter TopQueriesListResultIterator) NotDone() bool {
24758	return iter.page.NotDone() && iter.i < len(iter.page.Values())
24759}
24760
24761// Response returns the raw server response from the last page request.
24762func (iter TopQueriesListResultIterator) Response() TopQueriesListResult {
24763	return iter.page.Response()
24764}
24765
24766// Value returns the current value or a zero-initialized value if the
24767// iterator has advanced beyond the end of the collection.
24768func (iter TopQueriesListResultIterator) Value() TopQueries {
24769	if !iter.page.NotDone() {
24770		return TopQueries{}
24771	}
24772	return iter.page.Values()[iter.i]
24773}
24774
24775// Creates a new instance of the TopQueriesListResultIterator type.
24776func NewTopQueriesListResultIterator(page TopQueriesListResultPage) TopQueriesListResultIterator {
24777	return TopQueriesListResultIterator{page: page}
24778}
24779
24780// IsEmpty returns true if the ListResult contains no values.
24781func (tqlr TopQueriesListResult) IsEmpty() bool {
24782	return tqlr.Value == nil || len(*tqlr.Value) == 0
24783}
24784
24785// hasNextLink returns true if the NextLink is not empty.
24786func (tqlr TopQueriesListResult) hasNextLink() bool {
24787	return tqlr.NextLink != nil && len(*tqlr.NextLink) != 0
24788}
24789
24790// topQueriesListResultPreparer prepares a request to retrieve the next set of results.
24791// It returns nil if no more results exist.
24792func (tqlr TopQueriesListResult) topQueriesListResultPreparer(ctx context.Context) (*http.Request, error) {
24793	if !tqlr.hasNextLink() {
24794		return nil, nil
24795	}
24796	return autorest.Prepare((&http.Request{}).WithContext(ctx),
24797		autorest.AsJSON(),
24798		autorest.AsGet(),
24799		autorest.WithBaseURL(to.String(tqlr.NextLink)))
24800}
24801
24802// TopQueriesListResultPage contains a page of TopQueries values.
24803type TopQueriesListResultPage struct {
24804	fn   func(context.Context, TopQueriesListResult) (TopQueriesListResult, error)
24805	tqlr TopQueriesListResult
24806}
24807
24808// NextWithContext advances to the next page of values.  If there was an error making
24809// the request the page does not advance and the error is returned.
24810func (page *TopQueriesListResultPage) NextWithContext(ctx context.Context) (err error) {
24811	if tracing.IsEnabled() {
24812		ctx = tracing.StartSpan(ctx, fqdn+"/TopQueriesListResultPage.NextWithContext")
24813		defer func() {
24814			sc := -1
24815			if page.Response().Response.Response != nil {
24816				sc = page.Response().Response.Response.StatusCode
24817			}
24818			tracing.EndSpan(ctx, sc, err)
24819		}()
24820	}
24821	for {
24822		next, err := page.fn(ctx, page.tqlr)
24823		if err != nil {
24824			return err
24825		}
24826		page.tqlr = next
24827		if !next.hasNextLink() || !next.IsEmpty() {
24828			break
24829		}
24830	}
24831	return nil
24832}
24833
24834// Next advances to the next page of values.  If there was an error making
24835// the request the page does not advance and the error is returned.
24836// Deprecated: Use NextWithContext() instead.
24837func (page *TopQueriesListResultPage) Next() error {
24838	return page.NextWithContext(context.Background())
24839}
24840
24841// NotDone returns true if the page enumeration should be started or is not yet complete.
24842func (page TopQueriesListResultPage) NotDone() bool {
24843	return !page.tqlr.IsEmpty()
24844}
24845
24846// Response returns the raw server response from the last page request.
24847func (page TopQueriesListResultPage) Response() TopQueriesListResult {
24848	return page.tqlr
24849}
24850
24851// Values returns the slice of values for the current page or nil if there are no values.
24852func (page TopQueriesListResultPage) Values() []TopQueries {
24853	if page.tqlr.IsEmpty() {
24854		return nil
24855	}
24856	return *page.tqlr.Value
24857}
24858
24859// Creates a new instance of the TopQueriesListResultPage type.
24860func NewTopQueriesListResultPage(cur TopQueriesListResult, getNextPage func(context.Context, TopQueriesListResult) (TopQueriesListResult, error)) TopQueriesListResultPage {
24861	return TopQueriesListResultPage{
24862		fn:   getNextPage,
24863		tqlr: cur,
24864	}
24865}
24866
24867// TrackedResource ARM tracked top level resource.
24868type TrackedResource struct {
24869	// Location - Resource location.
24870	Location *string `json:"location,omitempty"`
24871	// Tags - Resource tags.
24872	Tags map[string]*string `json:"tags"`
24873	// ID - READ-ONLY; Resource ID.
24874	ID *string `json:"id,omitempty"`
24875	// Name - READ-ONLY; Resource name.
24876	Name *string `json:"name,omitempty"`
24877	// Type - READ-ONLY; Resource type.
24878	Type *string `json:"type,omitempty"`
24879}
24880
24881// MarshalJSON is the custom marshaler for TrackedResource.
24882func (tr TrackedResource) MarshalJSON() ([]byte, error) {
24883	objectMap := make(map[string]interface{})
24884	if tr.Location != nil {
24885		objectMap["location"] = tr.Location
24886	}
24887	if tr.Tags != nil {
24888		objectMap["tags"] = tr.Tags
24889	}
24890	return json.Marshal(objectMap)
24891}
24892
24893// TransparentDataEncryption represents a database transparent data encryption configuration.
24894type TransparentDataEncryption struct {
24895	autorest.Response `json:"-"`
24896	// Location - READ-ONLY; Resource location.
24897	Location *string `json:"location,omitempty"`
24898	// TransparentDataEncryptionProperties - Represents the properties of the resource.
24899	*TransparentDataEncryptionProperties `json:"properties,omitempty"`
24900	// ID - READ-ONLY; Resource ID.
24901	ID *string `json:"id,omitempty"`
24902	// Name - READ-ONLY; Resource name.
24903	Name *string `json:"name,omitempty"`
24904	// Type - READ-ONLY; Resource type.
24905	Type *string `json:"type,omitempty"`
24906}
24907
24908// MarshalJSON is the custom marshaler for TransparentDataEncryption.
24909func (tde TransparentDataEncryption) MarshalJSON() ([]byte, error) {
24910	objectMap := make(map[string]interface{})
24911	if tde.TransparentDataEncryptionProperties != nil {
24912		objectMap["properties"] = tde.TransparentDataEncryptionProperties
24913	}
24914	return json.Marshal(objectMap)
24915}
24916
24917// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryption struct.
24918func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error {
24919	var m map[string]*json.RawMessage
24920	err := json.Unmarshal(body, &m)
24921	if err != nil {
24922		return err
24923	}
24924	for k, v := range m {
24925		switch k {
24926		case "location":
24927			if v != nil {
24928				var location string
24929				err = json.Unmarshal(*v, &location)
24930				if err != nil {
24931					return err
24932				}
24933				tde.Location = &location
24934			}
24935		case "properties":
24936			if v != nil {
24937				var transparentDataEncryptionProperties TransparentDataEncryptionProperties
24938				err = json.Unmarshal(*v, &transparentDataEncryptionProperties)
24939				if err != nil {
24940					return err
24941				}
24942				tde.TransparentDataEncryptionProperties = &transparentDataEncryptionProperties
24943			}
24944		case "id":
24945			if v != nil {
24946				var ID string
24947				err = json.Unmarshal(*v, &ID)
24948				if err != nil {
24949					return err
24950				}
24951				tde.ID = &ID
24952			}
24953		case "name":
24954			if v != nil {
24955				var name string
24956				err = json.Unmarshal(*v, &name)
24957				if err != nil {
24958					return err
24959				}
24960				tde.Name = &name
24961			}
24962		case "type":
24963			if v != nil {
24964				var typeVar string
24965				err = json.Unmarshal(*v, &typeVar)
24966				if err != nil {
24967					return err
24968				}
24969				tde.Type = &typeVar
24970			}
24971		}
24972	}
24973
24974	return nil
24975}
24976
24977// TransparentDataEncryptionActivity represents a database transparent data encryption Scan.
24978type TransparentDataEncryptionActivity struct {
24979	// Location - READ-ONLY; Resource location.
24980	Location *string `json:"location,omitempty"`
24981	// TransparentDataEncryptionActivityProperties - Represents the properties of the resource.
24982	*TransparentDataEncryptionActivityProperties `json:"properties,omitempty"`
24983	// ID - READ-ONLY; Resource ID.
24984	ID *string `json:"id,omitempty"`
24985	// Name - READ-ONLY; Resource name.
24986	Name *string `json:"name,omitempty"`
24987	// Type - READ-ONLY; Resource type.
24988	Type *string `json:"type,omitempty"`
24989}
24990
24991// MarshalJSON is the custom marshaler for TransparentDataEncryptionActivity.
24992func (tdea TransparentDataEncryptionActivity) MarshalJSON() ([]byte, error) {
24993	objectMap := make(map[string]interface{})
24994	if tdea.TransparentDataEncryptionActivityProperties != nil {
24995		objectMap["properties"] = tdea.TransparentDataEncryptionActivityProperties
24996	}
24997	return json.Marshal(objectMap)
24998}
24999
25000// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryptionActivity struct.
25001func (tdea *TransparentDataEncryptionActivity) UnmarshalJSON(body []byte) error {
25002	var m map[string]*json.RawMessage
25003	err := json.Unmarshal(body, &m)
25004	if err != nil {
25005		return err
25006	}
25007	for k, v := range m {
25008		switch k {
25009		case "location":
25010			if v != nil {
25011				var location string
25012				err = json.Unmarshal(*v, &location)
25013				if err != nil {
25014					return err
25015				}
25016				tdea.Location = &location
25017			}
25018		case "properties":
25019			if v != nil {
25020				var transparentDataEncryptionActivityProperties TransparentDataEncryptionActivityProperties
25021				err = json.Unmarshal(*v, &transparentDataEncryptionActivityProperties)
25022				if err != nil {
25023					return err
25024				}
25025				tdea.TransparentDataEncryptionActivityProperties = &transparentDataEncryptionActivityProperties
25026			}
25027		case "id":
25028			if v != nil {
25029				var ID string
25030				err = json.Unmarshal(*v, &ID)
25031				if err != nil {
25032					return err
25033				}
25034				tdea.ID = &ID
25035			}
25036		case "name":
25037			if v != nil {
25038				var name string
25039				err = json.Unmarshal(*v, &name)
25040				if err != nil {
25041					return err
25042				}
25043				tdea.Name = &name
25044			}
25045		case "type":
25046			if v != nil {
25047				var typeVar string
25048				err = json.Unmarshal(*v, &typeVar)
25049				if err != nil {
25050					return err
25051				}
25052				tdea.Type = &typeVar
25053			}
25054		}
25055	}
25056
25057	return nil
25058}
25059
25060// TransparentDataEncryptionActivityListResult represents the response to a list database transparent data
25061// encryption activity request.
25062type TransparentDataEncryptionActivityListResult struct {
25063	autorest.Response `json:"-"`
25064	// Value - The list of database transparent data encryption activities.
25065	Value *[]TransparentDataEncryptionActivity `json:"value,omitempty"`
25066}
25067
25068// TransparentDataEncryptionActivityProperties represents the properties of a database transparent data
25069// encryption Scan.
25070type TransparentDataEncryptionActivityProperties struct {
25071	// Status - READ-ONLY; The status of the database. Possible values include: 'Encrypting', 'Decrypting'
25072	Status TransparentDataEncryptionActivityStatus `json:"status,omitempty"`
25073	// PercentComplete - READ-ONLY; The percent complete of the transparent data encryption scan for a database.
25074	PercentComplete *float64 `json:"percentComplete,omitempty"`
25075}
25076
25077// MarshalJSON is the custom marshaler for TransparentDataEncryptionActivityProperties.
25078func (tdeap TransparentDataEncryptionActivityProperties) MarshalJSON() ([]byte, error) {
25079	objectMap := make(map[string]interface{})
25080	return json.Marshal(objectMap)
25081}
25082
25083// TransparentDataEncryptionProperties represents the properties of a database transparent data encryption.
25084type TransparentDataEncryptionProperties struct {
25085	// Status - The status of the database transparent data encryption. Possible values include: 'TransparentDataEncryptionStatusEnabled', 'TransparentDataEncryptionStatusDisabled'
25086	Status TransparentDataEncryptionStatus `json:"status,omitempty"`
25087}
25088
25089// UnlinkParameters represents the parameters for Unlink Replication Link request.
25090type UnlinkParameters struct {
25091	// ForcedTermination - Determines whether link will be terminated in a forced or a friendly way.
25092	ForcedTermination *bool `json:"forcedTermination,omitempty"`
25093}
25094
25095// UpsertManagedServerOperationParameters ...
25096type UpsertManagedServerOperationParameters struct {
25097	Family          *string `json:"family,omitempty"`
25098	Tier            *string `json:"tier,omitempty"`
25099	VCores          *int32  `json:"vCores,omitempty"`
25100	StorageSizeInGB *int32  `json:"storageSizeInGB,omitempty"`
25101}
25102
25103// UpsertManagedServerOperationStep ...
25104type UpsertManagedServerOperationStep struct {
25105	Order *int32  `json:"order,omitempty"`
25106	Name  *string `json:"name,omitempty"`
25107	// Status - Possible values include: 'StatusNotStarted', 'StatusInProgress', 'StatusSlowedDown', 'StatusCompleted', 'StatusFailed', 'StatusCanceled'
25108	Status Status `json:"status,omitempty"`
25109}
25110
25111// Usage ARM usage.
25112type Usage struct {
25113	// ID - READ-ONLY; Resource ID.
25114	ID *string `json:"id,omitempty"`
25115	// Name - READ-ONLY; Resource name.
25116	Name *Name `json:"name,omitempty"`
25117	// Type - READ-ONLY; Resource type.
25118	Type *string `json:"type,omitempty"`
25119	// Unit - READ-ONLY; Usage unit.
25120	Unit *string `json:"unit,omitempty"`
25121	// CurrentValue - READ-ONLY; Usage current value.
25122	CurrentValue *int32 `json:"currentValue,omitempty"`
25123	// Limit - READ-ONLY; Usage limit.
25124	Limit *int32 `json:"limit,omitempty"`
25125	// RequestedLimit - READ-ONLY; Usage requested limit.
25126	RequestedLimit *int32 `json:"requestedLimit,omitempty"`
25127}
25128
25129// MarshalJSON is the custom marshaler for Usage.
25130func (u Usage) MarshalJSON() ([]byte, error) {
25131	objectMap := make(map[string]interface{})
25132	return json.Marshal(objectMap)
25133}
25134
25135// UsageListResult a list of usages.
25136type UsageListResult struct {
25137	autorest.Response `json:"-"`
25138	// Value - READ-ONLY; Array of results.
25139	Value *[]Usage `json:"value,omitempty"`
25140	// NextLink - READ-ONLY; Link to retrieve next page of results.
25141	NextLink *string `json:"nextLink,omitempty"`
25142}
25143
25144// MarshalJSON is the custom marshaler for UsageListResult.
25145func (ulr UsageListResult) MarshalJSON() ([]byte, error) {
25146	objectMap := make(map[string]interface{})
25147	return json.Marshal(objectMap)
25148}
25149
25150// UsageListResultIterator provides access to a complete listing of Usage values.
25151type UsageListResultIterator struct {
25152	i    int
25153	page UsageListResultPage
25154}
25155
25156// NextWithContext advances to the next value.  If there was an error making
25157// the request the iterator does not advance and the error is returned.
25158func (iter *UsageListResultIterator) NextWithContext(ctx context.Context) (err error) {
25159	if tracing.IsEnabled() {
25160		ctx = tracing.StartSpan(ctx, fqdn+"/UsageListResultIterator.NextWithContext")
25161		defer func() {
25162			sc := -1
25163			if iter.Response().Response.Response != nil {
25164				sc = iter.Response().Response.Response.StatusCode
25165			}
25166			tracing.EndSpan(ctx, sc, err)
25167		}()
25168	}
25169	iter.i++
25170	if iter.i < len(iter.page.Values()) {
25171		return nil
25172	}
25173	err = iter.page.NextWithContext(ctx)
25174	if err != nil {
25175		iter.i--
25176		return err
25177	}
25178	iter.i = 0
25179	return nil
25180}
25181
25182// Next advances to the next value.  If there was an error making
25183// the request the iterator does not advance and the error is returned.
25184// Deprecated: Use NextWithContext() instead.
25185func (iter *UsageListResultIterator) Next() error {
25186	return iter.NextWithContext(context.Background())
25187}
25188
25189// NotDone returns true if the enumeration should be started or is not yet complete.
25190func (iter UsageListResultIterator) NotDone() bool {
25191	return iter.page.NotDone() && iter.i < len(iter.page.Values())
25192}
25193
25194// Response returns the raw server response from the last page request.
25195func (iter UsageListResultIterator) Response() UsageListResult {
25196	return iter.page.Response()
25197}
25198
25199// Value returns the current value or a zero-initialized value if the
25200// iterator has advanced beyond the end of the collection.
25201func (iter UsageListResultIterator) Value() Usage {
25202	if !iter.page.NotDone() {
25203		return Usage{}
25204	}
25205	return iter.page.Values()[iter.i]
25206}
25207
25208// Creates a new instance of the UsageListResultIterator type.
25209func NewUsageListResultIterator(page UsageListResultPage) UsageListResultIterator {
25210	return UsageListResultIterator{page: page}
25211}
25212
25213// IsEmpty returns true if the ListResult contains no values.
25214func (ulr UsageListResult) IsEmpty() bool {
25215	return ulr.Value == nil || len(*ulr.Value) == 0
25216}
25217
25218// hasNextLink returns true if the NextLink is not empty.
25219func (ulr UsageListResult) hasNextLink() bool {
25220	return ulr.NextLink != nil && len(*ulr.NextLink) != 0
25221}
25222
25223// usageListResultPreparer prepares a request to retrieve the next set of results.
25224// It returns nil if no more results exist.
25225func (ulr UsageListResult) usageListResultPreparer(ctx context.Context) (*http.Request, error) {
25226	if !ulr.hasNextLink() {
25227		return nil, nil
25228	}
25229	return autorest.Prepare((&http.Request{}).WithContext(ctx),
25230		autorest.AsJSON(),
25231		autorest.AsGet(),
25232		autorest.WithBaseURL(to.String(ulr.NextLink)))
25233}
25234
25235// UsageListResultPage contains a page of Usage values.
25236type UsageListResultPage struct {
25237	fn  func(context.Context, UsageListResult) (UsageListResult, error)
25238	ulr UsageListResult
25239}
25240
25241// NextWithContext advances to the next page of values.  If there was an error making
25242// the request the page does not advance and the error is returned.
25243func (page *UsageListResultPage) NextWithContext(ctx context.Context) (err error) {
25244	if tracing.IsEnabled() {
25245		ctx = tracing.StartSpan(ctx, fqdn+"/UsageListResultPage.NextWithContext")
25246		defer func() {
25247			sc := -1
25248			if page.Response().Response.Response != nil {
25249				sc = page.Response().Response.Response.StatusCode
25250			}
25251			tracing.EndSpan(ctx, sc, err)
25252		}()
25253	}
25254	for {
25255		next, err := page.fn(ctx, page.ulr)
25256		if err != nil {
25257			return err
25258		}
25259		page.ulr = next
25260		if !next.hasNextLink() || !next.IsEmpty() {
25261			break
25262		}
25263	}
25264	return nil
25265}
25266
25267// Next advances to the next page of values.  If there was an error making
25268// the request the page does not advance and the error is returned.
25269// Deprecated: Use NextWithContext() instead.
25270func (page *UsageListResultPage) Next() error {
25271	return page.NextWithContext(context.Background())
25272}
25273
25274// NotDone returns true if the page enumeration should be started or is not yet complete.
25275func (page UsageListResultPage) NotDone() bool {
25276	return !page.ulr.IsEmpty()
25277}
25278
25279// Response returns the raw server response from the last page request.
25280func (page UsageListResultPage) Response() UsageListResult {
25281	return page.ulr
25282}
25283
25284// Values returns the slice of values for the current page or nil if there are no values.
25285func (page UsageListResultPage) Values() []Usage {
25286	if page.ulr.IsEmpty() {
25287		return nil
25288	}
25289	return *page.ulr.Value
25290}
25291
25292// Creates a new instance of the UsageListResultPage type.
25293func NewUsageListResultPage(cur UsageListResult, getNextPage func(context.Context, UsageListResult) (UsageListResult, error)) UsageListResultPage {
25294	return UsageListResultPage{
25295		fn:  getNextPage,
25296		ulr: cur,
25297	}
25298}
25299
25300// VirtualCluster an Azure SQL virtual cluster.
25301type VirtualCluster struct {
25302	autorest.Response `json:"-"`
25303	// VirtualClusterProperties - Resource properties.
25304	*VirtualClusterProperties `json:"properties,omitempty"`
25305	// Location - Resource location.
25306	Location *string `json:"location,omitempty"`
25307	// Tags - Resource tags.
25308	Tags map[string]*string `json:"tags"`
25309	// ID - READ-ONLY; Resource ID.
25310	ID *string `json:"id,omitempty"`
25311	// Name - READ-ONLY; Resource name.
25312	Name *string `json:"name,omitempty"`
25313	// Type - READ-ONLY; Resource type.
25314	Type *string `json:"type,omitempty"`
25315}
25316
25317// MarshalJSON is the custom marshaler for VirtualCluster.
25318func (vc VirtualCluster) MarshalJSON() ([]byte, error) {
25319	objectMap := make(map[string]interface{})
25320	if vc.VirtualClusterProperties != nil {
25321		objectMap["properties"] = vc.VirtualClusterProperties
25322	}
25323	if vc.Location != nil {
25324		objectMap["location"] = vc.Location
25325	}
25326	if vc.Tags != nil {
25327		objectMap["tags"] = vc.Tags
25328	}
25329	return json.Marshal(objectMap)
25330}
25331
25332// UnmarshalJSON is the custom unmarshaler for VirtualCluster struct.
25333func (vc *VirtualCluster) UnmarshalJSON(body []byte) error {
25334	var m map[string]*json.RawMessage
25335	err := json.Unmarshal(body, &m)
25336	if err != nil {
25337		return err
25338	}
25339	for k, v := range m {
25340		switch k {
25341		case "properties":
25342			if v != nil {
25343				var virtualClusterProperties VirtualClusterProperties
25344				err = json.Unmarshal(*v, &virtualClusterProperties)
25345				if err != nil {
25346					return err
25347				}
25348				vc.VirtualClusterProperties = &virtualClusterProperties
25349			}
25350		case "location":
25351			if v != nil {
25352				var location string
25353				err = json.Unmarshal(*v, &location)
25354				if err != nil {
25355					return err
25356				}
25357				vc.Location = &location
25358			}
25359		case "tags":
25360			if v != nil {
25361				var tags map[string]*string
25362				err = json.Unmarshal(*v, &tags)
25363				if err != nil {
25364					return err
25365				}
25366				vc.Tags = tags
25367			}
25368		case "id":
25369			if v != nil {
25370				var ID string
25371				err = json.Unmarshal(*v, &ID)
25372				if err != nil {
25373					return err
25374				}
25375				vc.ID = &ID
25376			}
25377		case "name":
25378			if v != nil {
25379				var name string
25380				err = json.Unmarshal(*v, &name)
25381				if err != nil {
25382					return err
25383				}
25384				vc.Name = &name
25385			}
25386		case "type":
25387			if v != nil {
25388				var typeVar string
25389				err = json.Unmarshal(*v, &typeVar)
25390				if err != nil {
25391					return err
25392				}
25393				vc.Type = &typeVar
25394			}
25395		}
25396	}
25397
25398	return nil
25399}
25400
25401// VirtualClusterListResult a list of virtual clusters.
25402type VirtualClusterListResult struct {
25403	autorest.Response `json:"-"`
25404	// Value - READ-ONLY; Array of results.
25405	Value *[]VirtualCluster `json:"value,omitempty"`
25406	// NextLink - READ-ONLY; Link to retrieve next page of results.
25407	NextLink *string `json:"nextLink,omitempty"`
25408}
25409
25410// MarshalJSON is the custom marshaler for VirtualClusterListResult.
25411func (vclr VirtualClusterListResult) MarshalJSON() ([]byte, error) {
25412	objectMap := make(map[string]interface{})
25413	return json.Marshal(objectMap)
25414}
25415
25416// VirtualClusterListResultIterator provides access to a complete listing of VirtualCluster values.
25417type VirtualClusterListResultIterator struct {
25418	i    int
25419	page VirtualClusterListResultPage
25420}
25421
25422// NextWithContext advances to the next value.  If there was an error making
25423// the request the iterator does not advance and the error is returned.
25424func (iter *VirtualClusterListResultIterator) NextWithContext(ctx context.Context) (err error) {
25425	if tracing.IsEnabled() {
25426		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClusterListResultIterator.NextWithContext")
25427		defer func() {
25428			sc := -1
25429			if iter.Response().Response.Response != nil {
25430				sc = iter.Response().Response.Response.StatusCode
25431			}
25432			tracing.EndSpan(ctx, sc, err)
25433		}()
25434	}
25435	iter.i++
25436	if iter.i < len(iter.page.Values()) {
25437		return nil
25438	}
25439	err = iter.page.NextWithContext(ctx)
25440	if err != nil {
25441		iter.i--
25442		return err
25443	}
25444	iter.i = 0
25445	return nil
25446}
25447
25448// Next advances to the next value.  If there was an error making
25449// the request the iterator does not advance and the error is returned.
25450// Deprecated: Use NextWithContext() instead.
25451func (iter *VirtualClusterListResultIterator) Next() error {
25452	return iter.NextWithContext(context.Background())
25453}
25454
25455// NotDone returns true if the enumeration should be started or is not yet complete.
25456func (iter VirtualClusterListResultIterator) NotDone() bool {
25457	return iter.page.NotDone() && iter.i < len(iter.page.Values())
25458}
25459
25460// Response returns the raw server response from the last page request.
25461func (iter VirtualClusterListResultIterator) Response() VirtualClusterListResult {
25462	return iter.page.Response()
25463}
25464
25465// Value returns the current value or a zero-initialized value if the
25466// iterator has advanced beyond the end of the collection.
25467func (iter VirtualClusterListResultIterator) Value() VirtualCluster {
25468	if !iter.page.NotDone() {
25469		return VirtualCluster{}
25470	}
25471	return iter.page.Values()[iter.i]
25472}
25473
25474// Creates a new instance of the VirtualClusterListResultIterator type.
25475func NewVirtualClusterListResultIterator(page VirtualClusterListResultPage) VirtualClusterListResultIterator {
25476	return VirtualClusterListResultIterator{page: page}
25477}
25478
25479// IsEmpty returns true if the ListResult contains no values.
25480func (vclr VirtualClusterListResult) IsEmpty() bool {
25481	return vclr.Value == nil || len(*vclr.Value) == 0
25482}
25483
25484// hasNextLink returns true if the NextLink is not empty.
25485func (vclr VirtualClusterListResult) hasNextLink() bool {
25486	return vclr.NextLink != nil && len(*vclr.NextLink) != 0
25487}
25488
25489// virtualClusterListResultPreparer prepares a request to retrieve the next set of results.
25490// It returns nil if no more results exist.
25491func (vclr VirtualClusterListResult) virtualClusterListResultPreparer(ctx context.Context) (*http.Request, error) {
25492	if !vclr.hasNextLink() {
25493		return nil, nil
25494	}
25495	return autorest.Prepare((&http.Request{}).WithContext(ctx),
25496		autorest.AsJSON(),
25497		autorest.AsGet(),
25498		autorest.WithBaseURL(to.String(vclr.NextLink)))
25499}
25500
25501// VirtualClusterListResultPage contains a page of VirtualCluster values.
25502type VirtualClusterListResultPage struct {
25503	fn   func(context.Context, VirtualClusterListResult) (VirtualClusterListResult, error)
25504	vclr VirtualClusterListResult
25505}
25506
25507// NextWithContext advances to the next page of values.  If there was an error making
25508// the request the page does not advance and the error is returned.
25509func (page *VirtualClusterListResultPage) NextWithContext(ctx context.Context) (err error) {
25510	if tracing.IsEnabled() {
25511		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClusterListResultPage.NextWithContext")
25512		defer func() {
25513			sc := -1
25514			if page.Response().Response.Response != nil {
25515				sc = page.Response().Response.Response.StatusCode
25516			}
25517			tracing.EndSpan(ctx, sc, err)
25518		}()
25519	}
25520	for {
25521		next, err := page.fn(ctx, page.vclr)
25522		if err != nil {
25523			return err
25524		}
25525		page.vclr = next
25526		if !next.hasNextLink() || !next.IsEmpty() {
25527			break
25528		}
25529	}
25530	return nil
25531}
25532
25533// Next advances to the next page of values.  If there was an error making
25534// the request the page does not advance and the error is returned.
25535// Deprecated: Use NextWithContext() instead.
25536func (page *VirtualClusterListResultPage) Next() error {
25537	return page.NextWithContext(context.Background())
25538}
25539
25540// NotDone returns true if the page enumeration should be started or is not yet complete.
25541func (page VirtualClusterListResultPage) NotDone() bool {
25542	return !page.vclr.IsEmpty()
25543}
25544
25545// Response returns the raw server response from the last page request.
25546func (page VirtualClusterListResultPage) Response() VirtualClusterListResult {
25547	return page.vclr
25548}
25549
25550// Values returns the slice of values for the current page or nil if there are no values.
25551func (page VirtualClusterListResultPage) Values() []VirtualCluster {
25552	if page.vclr.IsEmpty() {
25553		return nil
25554	}
25555	return *page.vclr.Value
25556}
25557
25558// Creates a new instance of the VirtualClusterListResultPage type.
25559func NewVirtualClusterListResultPage(cur VirtualClusterListResult, getNextPage func(context.Context, VirtualClusterListResult) (VirtualClusterListResult, error)) VirtualClusterListResultPage {
25560	return VirtualClusterListResultPage{
25561		fn:   getNextPage,
25562		vclr: cur,
25563	}
25564}
25565
25566// VirtualClusterProperties the properties of a virtual cluster.
25567type VirtualClusterProperties struct {
25568	// SubnetID - READ-ONLY; Subnet resource ID for the virtual cluster.
25569	SubnetID *string `json:"subnetId,omitempty"`
25570	// Family - If the service has different generations of hardware, for the same SKU, then that can be captured here.
25571	Family *string `json:"family,omitempty"`
25572	// ChildResources - READ-ONLY; List of resources in this virtual cluster.
25573	ChildResources *[]string `json:"childResources,omitempty"`
25574}
25575
25576// MarshalJSON is the custom marshaler for VirtualClusterProperties.
25577func (vcp VirtualClusterProperties) MarshalJSON() ([]byte, error) {
25578	objectMap := make(map[string]interface{})
25579	if vcp.Family != nil {
25580		objectMap["family"] = vcp.Family
25581	}
25582	return json.Marshal(objectMap)
25583}
25584
25585// VirtualClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
25586// operation.
25587type VirtualClustersDeleteFuture struct {
25588	azure.FutureAPI
25589	// Result returns the result of the asynchronous operation.
25590	// If the operation has not completed it will return an error.
25591	Result func(VirtualClustersClient) (autorest.Response, error)
25592}
25593
25594// UnmarshalJSON is the custom unmarshaller for CreateFuture.
25595func (future *VirtualClustersDeleteFuture) UnmarshalJSON(body []byte) error {
25596	var azFuture azure.Future
25597	if err := json.Unmarshal(body, &azFuture); err != nil {
25598		return err
25599	}
25600	future.FutureAPI = &azFuture
25601	future.Result = future.result
25602	return nil
25603}
25604
25605// result is the default implementation for VirtualClustersDeleteFuture.Result.
25606func (future *VirtualClustersDeleteFuture) result(client VirtualClustersClient) (ar autorest.Response, err error) {
25607	var done bool
25608	done, err = future.DoneWithContext(context.Background(), client)
25609	if err != nil {
25610		err = autorest.NewErrorWithError(err, "sql.VirtualClustersDeleteFuture", "Result", future.Response(), "Polling failure")
25611		return
25612	}
25613	if !done {
25614		ar.Response = future.Response()
25615		err = azure.NewAsyncOpIncompleteError("sql.VirtualClustersDeleteFuture")
25616		return
25617	}
25618	ar.Response = future.Response()
25619	return
25620}
25621
25622// VirtualClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
25623// operation.
25624type VirtualClustersUpdateFuture struct {
25625	azure.FutureAPI
25626	// Result returns the result of the asynchronous operation.
25627	// If the operation has not completed it will return an error.
25628	Result func(VirtualClustersClient) (VirtualCluster, error)
25629}
25630
25631// UnmarshalJSON is the custom unmarshaller for CreateFuture.
25632func (future *VirtualClustersUpdateFuture) UnmarshalJSON(body []byte) error {
25633	var azFuture azure.Future
25634	if err := json.Unmarshal(body, &azFuture); err != nil {
25635		return err
25636	}
25637	future.FutureAPI = &azFuture
25638	future.Result = future.result
25639	return nil
25640}
25641
25642// result is the default implementation for VirtualClustersUpdateFuture.Result.
25643func (future *VirtualClustersUpdateFuture) result(client VirtualClustersClient) (vc VirtualCluster, err error) {
25644	var done bool
25645	done, err = future.DoneWithContext(context.Background(), client)
25646	if err != nil {
25647		err = autorest.NewErrorWithError(err, "sql.VirtualClustersUpdateFuture", "Result", future.Response(), "Polling failure")
25648		return
25649	}
25650	if !done {
25651		vc.Response.Response = future.Response()
25652		err = azure.NewAsyncOpIncompleteError("sql.VirtualClustersUpdateFuture")
25653		return
25654	}
25655	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
25656	if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent {
25657		vc, err = client.UpdateResponder(vc.Response.Response)
25658		if err != nil {
25659			err = autorest.NewErrorWithError(err, "sql.VirtualClustersUpdateFuture", "Result", vc.Response.Response, "Failure responding to request")
25660		}
25661	}
25662	return
25663}
25664
25665// VirtualClusterUpdate an update request for an Azure SQL Database virtual cluster.
25666type VirtualClusterUpdate struct {
25667	// VirtualClusterProperties - Resource properties.
25668	*VirtualClusterProperties `json:"properties,omitempty"`
25669	// Tags - Resource tags.
25670	Tags map[string]*string `json:"tags"`
25671}
25672
25673// MarshalJSON is the custom marshaler for VirtualClusterUpdate.
25674func (vcu VirtualClusterUpdate) MarshalJSON() ([]byte, error) {
25675	objectMap := make(map[string]interface{})
25676	if vcu.VirtualClusterProperties != nil {
25677		objectMap["properties"] = vcu.VirtualClusterProperties
25678	}
25679	if vcu.Tags != nil {
25680		objectMap["tags"] = vcu.Tags
25681	}
25682	return json.Marshal(objectMap)
25683}
25684
25685// UnmarshalJSON is the custom unmarshaler for VirtualClusterUpdate struct.
25686func (vcu *VirtualClusterUpdate) UnmarshalJSON(body []byte) error {
25687	var m map[string]*json.RawMessage
25688	err := json.Unmarshal(body, &m)
25689	if err != nil {
25690		return err
25691	}
25692	for k, v := range m {
25693		switch k {
25694		case "properties":
25695			if v != nil {
25696				var virtualClusterProperties VirtualClusterProperties
25697				err = json.Unmarshal(*v, &virtualClusterProperties)
25698				if err != nil {
25699					return err
25700				}
25701				vcu.VirtualClusterProperties = &virtualClusterProperties
25702			}
25703		case "tags":
25704			if v != nil {
25705				var tags map[string]*string
25706				err = json.Unmarshal(*v, &tags)
25707				if err != nil {
25708					return err
25709				}
25710				vcu.Tags = tags
25711			}
25712		}
25713	}
25714
25715	return nil
25716}
25717
25718// VirtualNetworkRule a virtual network rule.
25719type VirtualNetworkRule struct {
25720	autorest.Response `json:"-"`
25721	// VirtualNetworkRuleProperties - Resource properties.
25722	*VirtualNetworkRuleProperties `json:"properties,omitempty"`
25723	// ID - READ-ONLY; Resource ID.
25724	ID *string `json:"id,omitempty"`
25725	// Name - READ-ONLY; Resource name.
25726	Name *string `json:"name,omitempty"`
25727	// Type - READ-ONLY; Resource type.
25728	Type *string `json:"type,omitempty"`
25729}
25730
25731// MarshalJSON is the custom marshaler for VirtualNetworkRule.
25732func (vnr VirtualNetworkRule) MarshalJSON() ([]byte, error) {
25733	objectMap := make(map[string]interface{})
25734	if vnr.VirtualNetworkRuleProperties != nil {
25735		objectMap["properties"] = vnr.VirtualNetworkRuleProperties
25736	}
25737	return json.Marshal(objectMap)
25738}
25739
25740// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct.
25741func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error {
25742	var m map[string]*json.RawMessage
25743	err := json.Unmarshal(body, &m)
25744	if err != nil {
25745		return err
25746	}
25747	for k, v := range m {
25748		switch k {
25749		case "properties":
25750			if v != nil {
25751				var virtualNetworkRuleProperties VirtualNetworkRuleProperties
25752				err = json.Unmarshal(*v, &virtualNetworkRuleProperties)
25753				if err != nil {
25754					return err
25755				}
25756				vnr.VirtualNetworkRuleProperties = &virtualNetworkRuleProperties
25757			}
25758		case "id":
25759			if v != nil {
25760				var ID string
25761				err = json.Unmarshal(*v, &ID)
25762				if err != nil {
25763					return err
25764				}
25765				vnr.ID = &ID
25766			}
25767		case "name":
25768			if v != nil {
25769				var name string
25770				err = json.Unmarshal(*v, &name)
25771				if err != nil {
25772					return err
25773				}
25774				vnr.Name = &name
25775			}
25776		case "type":
25777			if v != nil {
25778				var typeVar string
25779				err = json.Unmarshal(*v, &typeVar)
25780				if err != nil {
25781					return err
25782				}
25783				vnr.Type = &typeVar
25784			}
25785		}
25786	}
25787
25788	return nil
25789}
25790
25791// VirtualNetworkRuleListResult a list of virtual network rules.
25792type VirtualNetworkRuleListResult struct {
25793	autorest.Response `json:"-"`
25794	// Value - READ-ONLY; Array of results.
25795	Value *[]VirtualNetworkRule `json:"value,omitempty"`
25796	// NextLink - READ-ONLY; Link to retrieve next page of results.
25797	NextLink *string `json:"nextLink,omitempty"`
25798}
25799
25800// MarshalJSON is the custom marshaler for VirtualNetworkRuleListResult.
25801func (vnrlr VirtualNetworkRuleListResult) MarshalJSON() ([]byte, error) {
25802	objectMap := make(map[string]interface{})
25803	return json.Marshal(objectMap)
25804}
25805
25806// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values.
25807type VirtualNetworkRuleListResultIterator struct {
25808	i    int
25809	page VirtualNetworkRuleListResultPage
25810}
25811
25812// NextWithContext advances to the next value.  If there was an error making
25813// the request the iterator does not advance and the error is returned.
25814func (iter *VirtualNetworkRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
25815	if tracing.IsEnabled() {
25816		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultIterator.NextWithContext")
25817		defer func() {
25818			sc := -1
25819			if iter.Response().Response.Response != nil {
25820				sc = iter.Response().Response.Response.StatusCode
25821			}
25822			tracing.EndSpan(ctx, sc, err)
25823		}()
25824	}
25825	iter.i++
25826	if iter.i < len(iter.page.Values()) {
25827		return nil
25828	}
25829	err = iter.page.NextWithContext(ctx)
25830	if err != nil {
25831		iter.i--
25832		return err
25833	}
25834	iter.i = 0
25835	return nil
25836}
25837
25838// Next advances to the next value.  If there was an error making
25839// the request the iterator does not advance and the error is returned.
25840// Deprecated: Use NextWithContext() instead.
25841func (iter *VirtualNetworkRuleListResultIterator) Next() error {
25842	return iter.NextWithContext(context.Background())
25843}
25844
25845// NotDone returns true if the enumeration should be started or is not yet complete.
25846func (iter VirtualNetworkRuleListResultIterator) NotDone() bool {
25847	return iter.page.NotDone() && iter.i < len(iter.page.Values())
25848}
25849
25850// Response returns the raw server response from the last page request.
25851func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult {
25852	return iter.page.Response()
25853}
25854
25855// Value returns the current value or a zero-initialized value if the
25856// iterator has advanced beyond the end of the collection.
25857func (iter VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule {
25858	if !iter.page.NotDone() {
25859		return VirtualNetworkRule{}
25860	}
25861	return iter.page.Values()[iter.i]
25862}
25863
25864// Creates a new instance of the VirtualNetworkRuleListResultIterator type.
25865func NewVirtualNetworkRuleListResultIterator(page VirtualNetworkRuleListResultPage) VirtualNetworkRuleListResultIterator {
25866	return VirtualNetworkRuleListResultIterator{page: page}
25867}
25868
25869// IsEmpty returns true if the ListResult contains no values.
25870func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool {
25871	return vnrlr.Value == nil || len(*vnrlr.Value) == 0
25872}
25873
25874// hasNextLink returns true if the NextLink is not empty.
25875func (vnrlr VirtualNetworkRuleListResult) hasNextLink() bool {
25876	return vnrlr.NextLink != nil && len(*vnrlr.NextLink) != 0
25877}
25878
25879// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results.
25880// It returns nil if no more results exist.
25881func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
25882	if !vnrlr.hasNextLink() {
25883		return nil, nil
25884	}
25885	return autorest.Prepare((&http.Request{}).WithContext(ctx),
25886		autorest.AsJSON(),
25887		autorest.AsGet(),
25888		autorest.WithBaseURL(to.String(vnrlr.NextLink)))
25889}
25890
25891// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values.
25892type VirtualNetworkRuleListResultPage struct {
25893	fn    func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)
25894	vnrlr VirtualNetworkRuleListResult
25895}
25896
25897// NextWithContext advances to the next page of values.  If there was an error making
25898// the request the page does not advance and the error is returned.
25899func (page *VirtualNetworkRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
25900	if tracing.IsEnabled() {
25901		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultPage.NextWithContext")
25902		defer func() {
25903			sc := -1
25904			if page.Response().Response.Response != nil {
25905				sc = page.Response().Response.Response.StatusCode
25906			}
25907			tracing.EndSpan(ctx, sc, err)
25908		}()
25909	}
25910	for {
25911		next, err := page.fn(ctx, page.vnrlr)
25912		if err != nil {
25913			return err
25914		}
25915		page.vnrlr = next
25916		if !next.hasNextLink() || !next.IsEmpty() {
25917			break
25918		}
25919	}
25920	return nil
25921}
25922
25923// Next advances to the next page of values.  If there was an error making
25924// the request the page does not advance and the error is returned.
25925// Deprecated: Use NextWithContext() instead.
25926func (page *VirtualNetworkRuleListResultPage) Next() error {
25927	return page.NextWithContext(context.Background())
25928}
25929
25930// NotDone returns true if the page enumeration should be started or is not yet complete.
25931func (page VirtualNetworkRuleListResultPage) NotDone() bool {
25932	return !page.vnrlr.IsEmpty()
25933}
25934
25935// Response returns the raw server response from the last page request.
25936func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult {
25937	return page.vnrlr
25938}
25939
25940// Values returns the slice of values for the current page or nil if there are no values.
25941func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule {
25942	if page.vnrlr.IsEmpty() {
25943		return nil
25944	}
25945	return *page.vnrlr.Value
25946}
25947
25948// Creates a new instance of the VirtualNetworkRuleListResultPage type.
25949func NewVirtualNetworkRuleListResultPage(cur VirtualNetworkRuleListResult, getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage {
25950	return VirtualNetworkRuleListResultPage{
25951		fn:    getNextPage,
25952		vnrlr: cur,
25953	}
25954}
25955
25956// VirtualNetworkRuleProperties properties of a virtual network rule.
25957type VirtualNetworkRuleProperties struct {
25958	// VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet.
25959	VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"`
25960	// IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled.
25961	IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"`
25962	// State - READ-ONLY; Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown'
25963	State VirtualNetworkRuleState `json:"state,omitempty"`
25964}
25965
25966// MarshalJSON is the custom marshaler for VirtualNetworkRuleProperties.
25967func (vnrp VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error) {
25968	objectMap := make(map[string]interface{})
25969	if vnrp.VirtualNetworkSubnetID != nil {
25970		objectMap["virtualNetworkSubnetId"] = vnrp.VirtualNetworkSubnetID
25971	}
25972	if vnrp.IgnoreMissingVnetServiceEndpoint != nil {
25973		objectMap["ignoreMissingVnetServiceEndpoint"] = vnrp.IgnoreMissingVnetServiceEndpoint
25974	}
25975	return json.Marshal(objectMap)
25976}
25977
25978// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
25979// long-running operation.
25980type VirtualNetworkRulesCreateOrUpdateFuture struct {
25981	azure.FutureAPI
25982	// Result returns the result of the asynchronous operation.
25983	// If the operation has not completed it will return an error.
25984	Result func(VirtualNetworkRulesClient) (VirtualNetworkRule, error)
25985}
25986
25987// UnmarshalJSON is the custom unmarshaller for CreateFuture.
25988func (future *VirtualNetworkRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
25989	var azFuture azure.Future
25990	if err := json.Unmarshal(body, &azFuture); err != nil {
25991		return err
25992	}
25993	future.FutureAPI = &azFuture
25994	future.Result = future.result
25995	return nil
25996}
25997
25998// result is the default implementation for VirtualNetworkRulesCreateOrUpdateFuture.Result.
25999func (future *VirtualNetworkRulesCreateOrUpdateFuture) result(client VirtualNetworkRulesClient) (vnr VirtualNetworkRule, err error) {
26000	var done bool
26001	done, err = future.DoneWithContext(context.Background(), client)
26002	if err != nil {
26003		err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
26004		return
26005	}
26006	if !done {
26007		vnr.Response.Response = future.Response()
26008		err = azure.NewAsyncOpIncompleteError("sql.VirtualNetworkRulesCreateOrUpdateFuture")
26009		return
26010	}
26011	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
26012	if vnr.Response.Response, err = future.GetResult(sender); err == nil && vnr.Response.Response.StatusCode != http.StatusNoContent {
26013		vnr, err = client.CreateOrUpdateResponder(vnr.Response.Response)
26014		if err != nil {
26015			err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", vnr.Response.Response, "Failure responding to request")
26016		}
26017	}
26018	return
26019}
26020
26021// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a
26022// long-running operation.
26023type VirtualNetworkRulesDeleteFuture struct {
26024	azure.FutureAPI
26025	// Result returns the result of the asynchronous operation.
26026	// If the operation has not completed it will return an error.
26027	Result func(VirtualNetworkRulesClient) (autorest.Response, error)
26028}
26029
26030// UnmarshalJSON is the custom unmarshaller for CreateFuture.
26031func (future *VirtualNetworkRulesDeleteFuture) UnmarshalJSON(body []byte) error {
26032	var azFuture azure.Future
26033	if err := json.Unmarshal(body, &azFuture); err != nil {
26034		return err
26035	}
26036	future.FutureAPI = &azFuture
26037	future.Result = future.result
26038	return nil
26039}
26040
26041// result is the default implementation for VirtualNetworkRulesDeleteFuture.Result.
26042func (future *VirtualNetworkRulesDeleteFuture) result(client VirtualNetworkRulesClient) (ar autorest.Response, err error) {
26043	var done bool
26044	done, err = future.DoneWithContext(context.Background(), client)
26045	if err != nil {
26046		err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesDeleteFuture", "Result", future.Response(), "Polling failure")
26047		return
26048	}
26049	if !done {
26050		ar.Response = future.Response()
26051		err = azure.NewAsyncOpIncompleteError("sql.VirtualNetworkRulesDeleteFuture")
26052		return
26053	}
26054	ar.Response = future.Response()
26055	return
26056}
26057
26058// VulnerabilityAssessmentRecurringScansProperties properties of a Vulnerability Assessment recurring
26059// scans.
26060type VulnerabilityAssessmentRecurringScansProperties struct {
26061	// IsEnabled - Recurring scans state.
26062	IsEnabled *bool `json:"isEnabled,omitempty"`
26063	// EmailSubscriptionAdmins - Specifies that the schedule scan notification will be is sent to the subscription administrators.
26064	EmailSubscriptionAdmins *bool `json:"emailSubscriptionAdmins,omitempty"`
26065	// Emails - Specifies an array of e-mail addresses to which the scan notification is sent.
26066	Emails *[]string `json:"emails,omitempty"`
26067}
26068
26069// VulnerabilityAssessmentScanError properties of a vulnerability assessment scan error.
26070type VulnerabilityAssessmentScanError struct {
26071	// Code - READ-ONLY; The error code.
26072	Code *string `json:"code,omitempty"`
26073	// Message - READ-ONLY; The error message.
26074	Message *string `json:"message,omitempty"`
26075}
26076
26077// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanError.
26078func (vase VulnerabilityAssessmentScanError) MarshalJSON() ([]byte, error) {
26079	objectMap := make(map[string]interface{})
26080	return json.Marshal(objectMap)
26081}
26082
26083// VulnerabilityAssessmentScanRecord a vulnerability assessment scan record.
26084type VulnerabilityAssessmentScanRecord struct {
26085	autorest.Response `json:"-"`
26086	// VulnerabilityAssessmentScanRecordProperties - Resource properties.
26087	*VulnerabilityAssessmentScanRecordProperties `json:"properties,omitempty"`
26088	// ID - READ-ONLY; Resource ID.
26089	ID *string `json:"id,omitempty"`
26090	// Name - READ-ONLY; Resource name.
26091	Name *string `json:"name,omitempty"`
26092	// Type - READ-ONLY; Resource type.
26093	Type *string `json:"type,omitempty"`
26094}
26095
26096// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecord.
26097func (vasr VulnerabilityAssessmentScanRecord) MarshalJSON() ([]byte, error) {
26098	objectMap := make(map[string]interface{})
26099	if vasr.VulnerabilityAssessmentScanRecordProperties != nil {
26100		objectMap["properties"] = vasr.VulnerabilityAssessmentScanRecordProperties
26101	}
26102	return json.Marshal(objectMap)
26103}
26104
26105// UnmarshalJSON is the custom unmarshaler for VulnerabilityAssessmentScanRecord struct.
26106func (vasr *VulnerabilityAssessmentScanRecord) UnmarshalJSON(body []byte) error {
26107	var m map[string]*json.RawMessage
26108	err := json.Unmarshal(body, &m)
26109	if err != nil {
26110		return err
26111	}
26112	for k, v := range m {
26113		switch k {
26114		case "properties":
26115			if v != nil {
26116				var vulnerabilityAssessmentScanRecordProperties VulnerabilityAssessmentScanRecordProperties
26117				err = json.Unmarshal(*v, &vulnerabilityAssessmentScanRecordProperties)
26118				if err != nil {
26119					return err
26120				}
26121				vasr.VulnerabilityAssessmentScanRecordProperties = &vulnerabilityAssessmentScanRecordProperties
26122			}
26123		case "id":
26124			if v != nil {
26125				var ID string
26126				err = json.Unmarshal(*v, &ID)
26127				if err != nil {
26128					return err
26129				}
26130				vasr.ID = &ID
26131			}
26132		case "name":
26133			if v != nil {
26134				var name string
26135				err = json.Unmarshal(*v, &name)
26136				if err != nil {
26137					return err
26138				}
26139				vasr.Name = &name
26140			}
26141		case "type":
26142			if v != nil {
26143				var typeVar string
26144				err = json.Unmarshal(*v, &typeVar)
26145				if err != nil {
26146					return err
26147				}
26148				vasr.Type = &typeVar
26149			}
26150		}
26151	}
26152
26153	return nil
26154}
26155
26156// VulnerabilityAssessmentScanRecordListResult a list of vulnerability assessment scan records.
26157type VulnerabilityAssessmentScanRecordListResult struct {
26158	autorest.Response `json:"-"`
26159	// Value - READ-ONLY; Array of results.
26160	Value *[]VulnerabilityAssessmentScanRecord `json:"value,omitempty"`
26161	// NextLink - READ-ONLY; Link to retrieve next page of results.
26162	NextLink *string `json:"nextLink,omitempty"`
26163}
26164
26165// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecordListResult.
26166func (vasrlr VulnerabilityAssessmentScanRecordListResult) MarshalJSON() ([]byte, error) {
26167	objectMap := make(map[string]interface{})
26168	return json.Marshal(objectMap)
26169}
26170
26171// VulnerabilityAssessmentScanRecordListResultIterator provides access to a complete listing of
26172// VulnerabilityAssessmentScanRecord values.
26173type VulnerabilityAssessmentScanRecordListResultIterator struct {
26174	i    int
26175	page VulnerabilityAssessmentScanRecordListResultPage
26176}
26177
26178// NextWithContext advances to the next value.  If there was an error making
26179// the request the iterator does not advance and the error is returned.
26180func (iter *VulnerabilityAssessmentScanRecordListResultIterator) NextWithContext(ctx context.Context) (err error) {
26181	if tracing.IsEnabled() {
26182		ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultIterator.NextWithContext")
26183		defer func() {
26184			sc := -1
26185			if iter.Response().Response.Response != nil {
26186				sc = iter.Response().Response.Response.StatusCode
26187			}
26188			tracing.EndSpan(ctx, sc, err)
26189		}()
26190	}
26191	iter.i++
26192	if iter.i < len(iter.page.Values()) {
26193		return nil
26194	}
26195	err = iter.page.NextWithContext(ctx)
26196	if err != nil {
26197		iter.i--
26198		return err
26199	}
26200	iter.i = 0
26201	return nil
26202}
26203
26204// Next advances to the next value.  If there was an error making
26205// the request the iterator does not advance and the error is returned.
26206// Deprecated: Use NextWithContext() instead.
26207func (iter *VulnerabilityAssessmentScanRecordListResultIterator) Next() error {
26208	return iter.NextWithContext(context.Background())
26209}
26210
26211// NotDone returns true if the enumeration should be started or is not yet complete.
26212func (iter VulnerabilityAssessmentScanRecordListResultIterator) NotDone() bool {
26213	return iter.page.NotDone() && iter.i < len(iter.page.Values())
26214}
26215
26216// Response returns the raw server response from the last page request.
26217func (iter VulnerabilityAssessmentScanRecordListResultIterator) Response() VulnerabilityAssessmentScanRecordListResult {
26218	return iter.page.Response()
26219}
26220
26221// Value returns the current value or a zero-initialized value if the
26222// iterator has advanced beyond the end of the collection.
26223func (iter VulnerabilityAssessmentScanRecordListResultIterator) Value() VulnerabilityAssessmentScanRecord {
26224	if !iter.page.NotDone() {
26225		return VulnerabilityAssessmentScanRecord{}
26226	}
26227	return iter.page.Values()[iter.i]
26228}
26229
26230// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultIterator type.
26231func NewVulnerabilityAssessmentScanRecordListResultIterator(page VulnerabilityAssessmentScanRecordListResultPage) VulnerabilityAssessmentScanRecordListResultIterator {
26232	return VulnerabilityAssessmentScanRecordListResultIterator{page: page}
26233}
26234
26235// IsEmpty returns true if the ListResult contains no values.
26236func (vasrlr VulnerabilityAssessmentScanRecordListResult) IsEmpty() bool {
26237	return vasrlr.Value == nil || len(*vasrlr.Value) == 0
26238}
26239
26240// hasNextLink returns true if the NextLink is not empty.
26241func (vasrlr VulnerabilityAssessmentScanRecordListResult) hasNextLink() bool {
26242	return vasrlr.NextLink != nil && len(*vasrlr.NextLink) != 0
26243}
26244
26245// vulnerabilityAssessmentScanRecordListResultPreparer prepares a request to retrieve the next set of results.
26246// It returns nil if no more results exist.
26247func (vasrlr VulnerabilityAssessmentScanRecordListResult) vulnerabilityAssessmentScanRecordListResultPreparer(ctx context.Context) (*http.Request, error) {
26248	if !vasrlr.hasNextLink() {
26249		return nil, nil
26250	}
26251	return autorest.Prepare((&http.Request{}).WithContext(ctx),
26252		autorest.AsJSON(),
26253		autorest.AsGet(),
26254		autorest.WithBaseURL(to.String(vasrlr.NextLink)))
26255}
26256
26257// VulnerabilityAssessmentScanRecordListResultPage contains a page of VulnerabilityAssessmentScanRecord
26258// values.
26259type VulnerabilityAssessmentScanRecordListResultPage struct {
26260	fn     func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)
26261	vasrlr VulnerabilityAssessmentScanRecordListResult
26262}
26263
26264// NextWithContext advances to the next page of values.  If there was an error making
26265// the request the page does not advance and the error is returned.
26266func (page *VulnerabilityAssessmentScanRecordListResultPage) NextWithContext(ctx context.Context) (err error) {
26267	if tracing.IsEnabled() {
26268		ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultPage.NextWithContext")
26269		defer func() {
26270			sc := -1
26271			if page.Response().Response.Response != nil {
26272				sc = page.Response().Response.Response.StatusCode
26273			}
26274			tracing.EndSpan(ctx, sc, err)
26275		}()
26276	}
26277	for {
26278		next, err := page.fn(ctx, page.vasrlr)
26279		if err != nil {
26280			return err
26281		}
26282		page.vasrlr = next
26283		if !next.hasNextLink() || !next.IsEmpty() {
26284			break
26285		}
26286	}
26287	return nil
26288}
26289
26290// Next advances to the next page of values.  If there was an error making
26291// the request the page does not advance and the error is returned.
26292// Deprecated: Use NextWithContext() instead.
26293func (page *VulnerabilityAssessmentScanRecordListResultPage) Next() error {
26294	return page.NextWithContext(context.Background())
26295}
26296
26297// NotDone returns true if the page enumeration should be started or is not yet complete.
26298func (page VulnerabilityAssessmentScanRecordListResultPage) NotDone() bool {
26299	return !page.vasrlr.IsEmpty()
26300}
26301
26302// Response returns the raw server response from the last page request.
26303func (page VulnerabilityAssessmentScanRecordListResultPage) Response() VulnerabilityAssessmentScanRecordListResult {
26304	return page.vasrlr
26305}
26306
26307// Values returns the slice of values for the current page or nil if there are no values.
26308func (page VulnerabilityAssessmentScanRecordListResultPage) Values() []VulnerabilityAssessmentScanRecord {
26309	if page.vasrlr.IsEmpty() {
26310		return nil
26311	}
26312	return *page.vasrlr.Value
26313}
26314
26315// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultPage type.
26316func NewVulnerabilityAssessmentScanRecordListResultPage(cur VulnerabilityAssessmentScanRecordListResult, getNextPage func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)) VulnerabilityAssessmentScanRecordListResultPage {
26317	return VulnerabilityAssessmentScanRecordListResultPage{
26318		fn:     getNextPage,
26319		vasrlr: cur,
26320	}
26321}
26322
26323// VulnerabilityAssessmentScanRecordProperties properties of a vulnerability assessment scan record.
26324type VulnerabilityAssessmentScanRecordProperties struct {
26325	// ScanID - READ-ONLY; The scan ID.
26326	ScanID *string `json:"scanId,omitempty"`
26327	// TriggerType - READ-ONLY; The scan trigger type. Possible values include: 'VulnerabilityAssessmentScanTriggerTypeOnDemand', 'VulnerabilityAssessmentScanTriggerTypeRecurring'
26328	TriggerType VulnerabilityAssessmentScanTriggerType `json:"triggerType,omitempty"`
26329	// State - READ-ONLY; The scan status. Possible values include: 'VulnerabilityAssessmentScanStatePassed', 'VulnerabilityAssessmentScanStateFailed', 'VulnerabilityAssessmentScanStateFailedToRun', 'VulnerabilityAssessmentScanStateInProgress'
26330	State VulnerabilityAssessmentScanState `json:"state,omitempty"`
26331	// StartTime - READ-ONLY; The scan start time (UTC).
26332	StartTime *date.Time `json:"startTime,omitempty"`
26333	// EndTime - READ-ONLY; The scan end time (UTC).
26334	EndTime *date.Time `json:"endTime,omitempty"`
26335	// Errors - READ-ONLY; The scan errors.
26336	Errors *[]VulnerabilityAssessmentScanError `json:"errors,omitempty"`
26337	// StorageContainerPath - READ-ONLY; The scan results storage container path.
26338	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
26339	// NumberOfFailedSecurityChecks - READ-ONLY; The number of failed security checks.
26340	NumberOfFailedSecurityChecks *int32 `json:"numberOfFailedSecurityChecks,omitempty"`
26341}
26342
26343// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecordProperties.
26344func (vasrp VulnerabilityAssessmentScanRecordProperties) MarshalJSON() ([]byte, error) {
26345	objectMap := make(map[string]interface{})
26346	return json.Marshal(objectMap)
26347}
26348
26349// WorkloadClassifier workload classifier operations for a data warehouse
26350type WorkloadClassifier struct {
26351	autorest.Response `json:"-"`
26352	// WorkloadClassifierProperties - Resource properties.
26353	*WorkloadClassifierProperties `json:"properties,omitempty"`
26354	// ID - READ-ONLY; Resource ID.
26355	ID *string `json:"id,omitempty"`
26356	// Name - READ-ONLY; Resource name.
26357	Name *string `json:"name,omitempty"`
26358	// Type - READ-ONLY; Resource type.
26359	Type *string `json:"type,omitempty"`
26360}
26361
26362// MarshalJSON is the custom marshaler for WorkloadClassifier.
26363func (wc WorkloadClassifier) MarshalJSON() ([]byte, error) {
26364	objectMap := make(map[string]interface{})
26365	if wc.WorkloadClassifierProperties != nil {
26366		objectMap["properties"] = wc.WorkloadClassifierProperties
26367	}
26368	return json.Marshal(objectMap)
26369}
26370
26371// UnmarshalJSON is the custom unmarshaler for WorkloadClassifier struct.
26372func (wc *WorkloadClassifier) UnmarshalJSON(body []byte) error {
26373	var m map[string]*json.RawMessage
26374	err := json.Unmarshal(body, &m)
26375	if err != nil {
26376		return err
26377	}
26378	for k, v := range m {
26379		switch k {
26380		case "properties":
26381			if v != nil {
26382				var workloadClassifierProperties WorkloadClassifierProperties
26383				err = json.Unmarshal(*v, &workloadClassifierProperties)
26384				if err != nil {
26385					return err
26386				}
26387				wc.WorkloadClassifierProperties = &workloadClassifierProperties
26388			}
26389		case "id":
26390			if v != nil {
26391				var ID string
26392				err = json.Unmarshal(*v, &ID)
26393				if err != nil {
26394					return err
26395				}
26396				wc.ID = &ID
26397			}
26398		case "name":
26399			if v != nil {
26400				var name string
26401				err = json.Unmarshal(*v, &name)
26402				if err != nil {
26403					return err
26404				}
26405				wc.Name = &name
26406			}
26407		case "type":
26408			if v != nil {
26409				var typeVar string
26410				err = json.Unmarshal(*v, &typeVar)
26411				if err != nil {
26412					return err
26413				}
26414				wc.Type = &typeVar
26415			}
26416		}
26417	}
26418
26419	return nil
26420}
26421
26422// WorkloadClassifierListResult a list of workload classifiers for a workload group.
26423type WorkloadClassifierListResult struct {
26424	autorest.Response `json:"-"`
26425	// Value - READ-ONLY; Array of results.
26426	Value *[]WorkloadClassifier `json:"value,omitempty"`
26427	// NextLink - READ-ONLY; Link to retrieve next page of results.
26428	NextLink *string `json:"nextLink,omitempty"`
26429}
26430
26431// MarshalJSON is the custom marshaler for WorkloadClassifierListResult.
26432func (wclr WorkloadClassifierListResult) MarshalJSON() ([]byte, error) {
26433	objectMap := make(map[string]interface{})
26434	return json.Marshal(objectMap)
26435}
26436
26437// WorkloadClassifierListResultIterator provides access to a complete listing of WorkloadClassifier values.
26438type WorkloadClassifierListResultIterator struct {
26439	i    int
26440	page WorkloadClassifierListResultPage
26441}
26442
26443// NextWithContext advances to the next value.  If there was an error making
26444// the request the iterator does not advance and the error is returned.
26445func (iter *WorkloadClassifierListResultIterator) NextWithContext(ctx context.Context) (err error) {
26446	if tracing.IsEnabled() {
26447		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadClassifierListResultIterator.NextWithContext")
26448		defer func() {
26449			sc := -1
26450			if iter.Response().Response.Response != nil {
26451				sc = iter.Response().Response.Response.StatusCode
26452			}
26453			tracing.EndSpan(ctx, sc, err)
26454		}()
26455	}
26456	iter.i++
26457	if iter.i < len(iter.page.Values()) {
26458		return nil
26459	}
26460	err = iter.page.NextWithContext(ctx)
26461	if err != nil {
26462		iter.i--
26463		return err
26464	}
26465	iter.i = 0
26466	return nil
26467}
26468
26469// Next advances to the next value.  If there was an error making
26470// the request the iterator does not advance and the error is returned.
26471// Deprecated: Use NextWithContext() instead.
26472func (iter *WorkloadClassifierListResultIterator) Next() error {
26473	return iter.NextWithContext(context.Background())
26474}
26475
26476// NotDone returns true if the enumeration should be started or is not yet complete.
26477func (iter WorkloadClassifierListResultIterator) NotDone() bool {
26478	return iter.page.NotDone() && iter.i < len(iter.page.Values())
26479}
26480
26481// Response returns the raw server response from the last page request.
26482func (iter WorkloadClassifierListResultIterator) Response() WorkloadClassifierListResult {
26483	return iter.page.Response()
26484}
26485
26486// Value returns the current value or a zero-initialized value if the
26487// iterator has advanced beyond the end of the collection.
26488func (iter WorkloadClassifierListResultIterator) Value() WorkloadClassifier {
26489	if !iter.page.NotDone() {
26490		return WorkloadClassifier{}
26491	}
26492	return iter.page.Values()[iter.i]
26493}
26494
26495// Creates a new instance of the WorkloadClassifierListResultIterator type.
26496func NewWorkloadClassifierListResultIterator(page WorkloadClassifierListResultPage) WorkloadClassifierListResultIterator {
26497	return WorkloadClassifierListResultIterator{page: page}
26498}
26499
26500// IsEmpty returns true if the ListResult contains no values.
26501func (wclr WorkloadClassifierListResult) IsEmpty() bool {
26502	return wclr.Value == nil || len(*wclr.Value) == 0
26503}
26504
26505// hasNextLink returns true if the NextLink is not empty.
26506func (wclr WorkloadClassifierListResult) hasNextLink() bool {
26507	return wclr.NextLink != nil && len(*wclr.NextLink) != 0
26508}
26509
26510// workloadClassifierListResultPreparer prepares a request to retrieve the next set of results.
26511// It returns nil if no more results exist.
26512func (wclr WorkloadClassifierListResult) workloadClassifierListResultPreparer(ctx context.Context) (*http.Request, error) {
26513	if !wclr.hasNextLink() {
26514		return nil, nil
26515	}
26516	return autorest.Prepare((&http.Request{}).WithContext(ctx),
26517		autorest.AsJSON(),
26518		autorest.AsGet(),
26519		autorest.WithBaseURL(to.String(wclr.NextLink)))
26520}
26521
26522// WorkloadClassifierListResultPage contains a page of WorkloadClassifier values.
26523type WorkloadClassifierListResultPage struct {
26524	fn   func(context.Context, WorkloadClassifierListResult) (WorkloadClassifierListResult, error)
26525	wclr WorkloadClassifierListResult
26526}
26527
26528// NextWithContext advances to the next page of values.  If there was an error making
26529// the request the page does not advance and the error is returned.
26530func (page *WorkloadClassifierListResultPage) NextWithContext(ctx context.Context) (err error) {
26531	if tracing.IsEnabled() {
26532		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadClassifierListResultPage.NextWithContext")
26533		defer func() {
26534			sc := -1
26535			if page.Response().Response.Response != nil {
26536				sc = page.Response().Response.Response.StatusCode
26537			}
26538			tracing.EndSpan(ctx, sc, err)
26539		}()
26540	}
26541	for {
26542		next, err := page.fn(ctx, page.wclr)
26543		if err != nil {
26544			return err
26545		}
26546		page.wclr = next
26547		if !next.hasNextLink() || !next.IsEmpty() {
26548			break
26549		}
26550	}
26551	return nil
26552}
26553
26554// Next advances to the next page of values.  If there was an error making
26555// the request the page does not advance and the error is returned.
26556// Deprecated: Use NextWithContext() instead.
26557func (page *WorkloadClassifierListResultPage) Next() error {
26558	return page.NextWithContext(context.Background())
26559}
26560
26561// NotDone returns true if the page enumeration should be started or is not yet complete.
26562func (page WorkloadClassifierListResultPage) NotDone() bool {
26563	return !page.wclr.IsEmpty()
26564}
26565
26566// Response returns the raw server response from the last page request.
26567func (page WorkloadClassifierListResultPage) Response() WorkloadClassifierListResult {
26568	return page.wclr
26569}
26570
26571// Values returns the slice of values for the current page or nil if there are no values.
26572func (page WorkloadClassifierListResultPage) Values() []WorkloadClassifier {
26573	if page.wclr.IsEmpty() {
26574		return nil
26575	}
26576	return *page.wclr.Value
26577}
26578
26579// Creates a new instance of the WorkloadClassifierListResultPage type.
26580func NewWorkloadClassifierListResultPage(cur WorkloadClassifierListResult, getNextPage func(context.Context, WorkloadClassifierListResult) (WorkloadClassifierListResult, error)) WorkloadClassifierListResultPage {
26581	return WorkloadClassifierListResultPage{
26582		fn:   getNextPage,
26583		wclr: cur,
26584	}
26585}
26586
26587// WorkloadClassifierProperties workload classifier definition. For more information look at
26588// sys.workload_management_workload_classifiers (DMV).
26589type WorkloadClassifierProperties struct {
26590	// MemberName - The workload classifier member name.
26591	MemberName *string `json:"memberName,omitempty"`
26592	// Label - The workload classifier label.
26593	Label *string `json:"label,omitempty"`
26594	// Context - The workload classifier context.
26595	Context *string `json:"context,omitempty"`
26596	// StartTime - The workload classifier start time for classification.
26597	StartTime *string `json:"startTime,omitempty"`
26598	// EndTime - The workload classifier end time for classification.
26599	EndTime *string `json:"endTime,omitempty"`
26600	// Importance - The workload classifier importance.
26601	Importance *string `json:"importance,omitempty"`
26602}
26603
26604// WorkloadClassifiersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
26605// long-running operation.
26606type WorkloadClassifiersCreateOrUpdateFuture struct {
26607	azure.FutureAPI
26608	// Result returns the result of the asynchronous operation.
26609	// If the operation has not completed it will return an error.
26610	Result func(WorkloadClassifiersClient) (WorkloadClassifier, error)
26611}
26612
26613// UnmarshalJSON is the custom unmarshaller for CreateFuture.
26614func (future *WorkloadClassifiersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
26615	var azFuture azure.Future
26616	if err := json.Unmarshal(body, &azFuture); err != nil {
26617		return err
26618	}
26619	future.FutureAPI = &azFuture
26620	future.Result = future.result
26621	return nil
26622}
26623
26624// result is the default implementation for WorkloadClassifiersCreateOrUpdateFuture.Result.
26625func (future *WorkloadClassifiersCreateOrUpdateFuture) result(client WorkloadClassifiersClient) (wc WorkloadClassifier, err error) {
26626	var done bool
26627	done, err = future.DoneWithContext(context.Background(), client)
26628	if err != nil {
26629		err = autorest.NewErrorWithError(err, "sql.WorkloadClassifiersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
26630		return
26631	}
26632	if !done {
26633		wc.Response.Response = future.Response()
26634		err = azure.NewAsyncOpIncompleteError("sql.WorkloadClassifiersCreateOrUpdateFuture")
26635		return
26636	}
26637	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
26638	if wc.Response.Response, err = future.GetResult(sender); err == nil && wc.Response.Response.StatusCode != http.StatusNoContent {
26639		wc, err = client.CreateOrUpdateResponder(wc.Response.Response)
26640		if err != nil {
26641			err = autorest.NewErrorWithError(err, "sql.WorkloadClassifiersCreateOrUpdateFuture", "Result", wc.Response.Response, "Failure responding to request")
26642		}
26643	}
26644	return
26645}
26646
26647// WorkloadClassifiersDeleteFuture an abstraction for monitoring and retrieving the results of a
26648// long-running operation.
26649type WorkloadClassifiersDeleteFuture struct {
26650	azure.FutureAPI
26651	// Result returns the result of the asynchronous operation.
26652	// If the operation has not completed it will return an error.
26653	Result func(WorkloadClassifiersClient) (autorest.Response, error)
26654}
26655
26656// UnmarshalJSON is the custom unmarshaller for CreateFuture.
26657func (future *WorkloadClassifiersDeleteFuture) UnmarshalJSON(body []byte) error {
26658	var azFuture azure.Future
26659	if err := json.Unmarshal(body, &azFuture); err != nil {
26660		return err
26661	}
26662	future.FutureAPI = &azFuture
26663	future.Result = future.result
26664	return nil
26665}
26666
26667// result is the default implementation for WorkloadClassifiersDeleteFuture.Result.
26668func (future *WorkloadClassifiersDeleteFuture) result(client WorkloadClassifiersClient) (ar autorest.Response, err error) {
26669	var done bool
26670	done, err = future.DoneWithContext(context.Background(), client)
26671	if err != nil {
26672		err = autorest.NewErrorWithError(err, "sql.WorkloadClassifiersDeleteFuture", "Result", future.Response(), "Polling failure")
26673		return
26674	}
26675	if !done {
26676		ar.Response = future.Response()
26677		err = azure.NewAsyncOpIncompleteError("sql.WorkloadClassifiersDeleteFuture")
26678		return
26679	}
26680	ar.Response = future.Response()
26681	return
26682}
26683
26684// WorkloadGroup workload group operations for a data warehouse
26685type WorkloadGroup struct {
26686	autorest.Response `json:"-"`
26687	// WorkloadGroupProperties - Resource properties.
26688	*WorkloadGroupProperties `json:"properties,omitempty"`
26689	// ID - READ-ONLY; Resource ID.
26690	ID *string `json:"id,omitempty"`
26691	// Name - READ-ONLY; Resource name.
26692	Name *string `json:"name,omitempty"`
26693	// Type - READ-ONLY; Resource type.
26694	Type *string `json:"type,omitempty"`
26695}
26696
26697// MarshalJSON is the custom marshaler for WorkloadGroup.
26698func (wg WorkloadGroup) MarshalJSON() ([]byte, error) {
26699	objectMap := make(map[string]interface{})
26700	if wg.WorkloadGroupProperties != nil {
26701		objectMap["properties"] = wg.WorkloadGroupProperties
26702	}
26703	return json.Marshal(objectMap)
26704}
26705
26706// UnmarshalJSON is the custom unmarshaler for WorkloadGroup struct.
26707func (wg *WorkloadGroup) UnmarshalJSON(body []byte) error {
26708	var m map[string]*json.RawMessage
26709	err := json.Unmarshal(body, &m)
26710	if err != nil {
26711		return err
26712	}
26713	for k, v := range m {
26714		switch k {
26715		case "properties":
26716			if v != nil {
26717				var workloadGroupProperties WorkloadGroupProperties
26718				err = json.Unmarshal(*v, &workloadGroupProperties)
26719				if err != nil {
26720					return err
26721				}
26722				wg.WorkloadGroupProperties = &workloadGroupProperties
26723			}
26724		case "id":
26725			if v != nil {
26726				var ID string
26727				err = json.Unmarshal(*v, &ID)
26728				if err != nil {
26729					return err
26730				}
26731				wg.ID = &ID
26732			}
26733		case "name":
26734			if v != nil {
26735				var name string
26736				err = json.Unmarshal(*v, &name)
26737				if err != nil {
26738					return err
26739				}
26740				wg.Name = &name
26741			}
26742		case "type":
26743			if v != nil {
26744				var typeVar string
26745				err = json.Unmarshal(*v, &typeVar)
26746				if err != nil {
26747					return err
26748				}
26749				wg.Type = &typeVar
26750			}
26751		}
26752	}
26753
26754	return nil
26755}
26756
26757// WorkloadGroupListResult a list of workload groups.
26758type WorkloadGroupListResult struct {
26759	autorest.Response `json:"-"`
26760	// Value - READ-ONLY; Array of results.
26761	Value *[]WorkloadGroup `json:"value,omitempty"`
26762	// NextLink - READ-ONLY; Link to retrieve next page of results.
26763	NextLink *string `json:"nextLink,omitempty"`
26764}
26765
26766// MarshalJSON is the custom marshaler for WorkloadGroupListResult.
26767func (wglr WorkloadGroupListResult) MarshalJSON() ([]byte, error) {
26768	objectMap := make(map[string]interface{})
26769	return json.Marshal(objectMap)
26770}
26771
26772// WorkloadGroupListResultIterator provides access to a complete listing of WorkloadGroup values.
26773type WorkloadGroupListResultIterator struct {
26774	i    int
26775	page WorkloadGroupListResultPage
26776}
26777
26778// NextWithContext advances to the next value.  If there was an error making
26779// the request the iterator does not advance and the error is returned.
26780func (iter *WorkloadGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
26781	if tracing.IsEnabled() {
26782		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadGroupListResultIterator.NextWithContext")
26783		defer func() {
26784			sc := -1
26785			if iter.Response().Response.Response != nil {
26786				sc = iter.Response().Response.Response.StatusCode
26787			}
26788			tracing.EndSpan(ctx, sc, err)
26789		}()
26790	}
26791	iter.i++
26792	if iter.i < len(iter.page.Values()) {
26793		return nil
26794	}
26795	err = iter.page.NextWithContext(ctx)
26796	if err != nil {
26797		iter.i--
26798		return err
26799	}
26800	iter.i = 0
26801	return nil
26802}
26803
26804// Next advances to the next value.  If there was an error making
26805// the request the iterator does not advance and the error is returned.
26806// Deprecated: Use NextWithContext() instead.
26807func (iter *WorkloadGroupListResultIterator) Next() error {
26808	return iter.NextWithContext(context.Background())
26809}
26810
26811// NotDone returns true if the enumeration should be started or is not yet complete.
26812func (iter WorkloadGroupListResultIterator) NotDone() bool {
26813	return iter.page.NotDone() && iter.i < len(iter.page.Values())
26814}
26815
26816// Response returns the raw server response from the last page request.
26817func (iter WorkloadGroupListResultIterator) Response() WorkloadGroupListResult {
26818	return iter.page.Response()
26819}
26820
26821// Value returns the current value or a zero-initialized value if the
26822// iterator has advanced beyond the end of the collection.
26823func (iter WorkloadGroupListResultIterator) Value() WorkloadGroup {
26824	if !iter.page.NotDone() {
26825		return WorkloadGroup{}
26826	}
26827	return iter.page.Values()[iter.i]
26828}
26829
26830// Creates a new instance of the WorkloadGroupListResultIterator type.
26831func NewWorkloadGroupListResultIterator(page WorkloadGroupListResultPage) WorkloadGroupListResultIterator {
26832	return WorkloadGroupListResultIterator{page: page}
26833}
26834
26835// IsEmpty returns true if the ListResult contains no values.
26836func (wglr WorkloadGroupListResult) IsEmpty() bool {
26837	return wglr.Value == nil || len(*wglr.Value) == 0
26838}
26839
26840// hasNextLink returns true if the NextLink is not empty.
26841func (wglr WorkloadGroupListResult) hasNextLink() bool {
26842	return wglr.NextLink != nil && len(*wglr.NextLink) != 0
26843}
26844
26845// workloadGroupListResultPreparer prepares a request to retrieve the next set of results.
26846// It returns nil if no more results exist.
26847func (wglr WorkloadGroupListResult) workloadGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
26848	if !wglr.hasNextLink() {
26849		return nil, nil
26850	}
26851	return autorest.Prepare((&http.Request{}).WithContext(ctx),
26852		autorest.AsJSON(),
26853		autorest.AsGet(),
26854		autorest.WithBaseURL(to.String(wglr.NextLink)))
26855}
26856
26857// WorkloadGroupListResultPage contains a page of WorkloadGroup values.
26858type WorkloadGroupListResultPage struct {
26859	fn   func(context.Context, WorkloadGroupListResult) (WorkloadGroupListResult, error)
26860	wglr WorkloadGroupListResult
26861}
26862
26863// NextWithContext advances to the next page of values.  If there was an error making
26864// the request the page does not advance and the error is returned.
26865func (page *WorkloadGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
26866	if tracing.IsEnabled() {
26867		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadGroupListResultPage.NextWithContext")
26868		defer func() {
26869			sc := -1
26870			if page.Response().Response.Response != nil {
26871				sc = page.Response().Response.Response.StatusCode
26872			}
26873			tracing.EndSpan(ctx, sc, err)
26874		}()
26875	}
26876	for {
26877		next, err := page.fn(ctx, page.wglr)
26878		if err != nil {
26879			return err
26880		}
26881		page.wglr = next
26882		if !next.hasNextLink() || !next.IsEmpty() {
26883			break
26884		}
26885	}
26886	return nil
26887}
26888
26889// Next advances to the next page of values.  If there was an error making
26890// the request the page does not advance and the error is returned.
26891// Deprecated: Use NextWithContext() instead.
26892func (page *WorkloadGroupListResultPage) Next() error {
26893	return page.NextWithContext(context.Background())
26894}
26895
26896// NotDone returns true if the page enumeration should be started or is not yet complete.
26897func (page WorkloadGroupListResultPage) NotDone() bool {
26898	return !page.wglr.IsEmpty()
26899}
26900
26901// Response returns the raw server response from the last page request.
26902func (page WorkloadGroupListResultPage) Response() WorkloadGroupListResult {
26903	return page.wglr
26904}
26905
26906// Values returns the slice of values for the current page or nil if there are no values.
26907func (page WorkloadGroupListResultPage) Values() []WorkloadGroup {
26908	if page.wglr.IsEmpty() {
26909		return nil
26910	}
26911	return *page.wglr.Value
26912}
26913
26914// Creates a new instance of the WorkloadGroupListResultPage type.
26915func NewWorkloadGroupListResultPage(cur WorkloadGroupListResult, getNextPage func(context.Context, WorkloadGroupListResult) (WorkloadGroupListResult, error)) WorkloadGroupListResultPage {
26916	return WorkloadGroupListResultPage{
26917		fn:   getNextPage,
26918		wglr: cur,
26919	}
26920}
26921
26922// WorkloadGroupProperties workload group definition. For more information look at
26923// sys.workload_management_workload_groups (DMV).
26924type WorkloadGroupProperties struct {
26925	// MinResourcePercent - The workload group minimum percentage resource.
26926	MinResourcePercent *int32 `json:"minResourcePercent,omitempty"`
26927	// MaxResourcePercent - The workload group cap percentage resource.
26928	MaxResourcePercent *int32 `json:"maxResourcePercent,omitempty"`
26929	// MinResourcePercentPerRequest - The workload group request minimum grant percentage.
26930	MinResourcePercentPerRequest *float64 `json:"minResourcePercentPerRequest,omitempty"`
26931	// MaxResourcePercentPerRequest - The workload group request maximum grant percentage.
26932	MaxResourcePercentPerRequest *float64 `json:"maxResourcePercentPerRequest,omitempty"`
26933	// Importance - The workload group importance level.
26934	Importance *string `json:"importance,omitempty"`
26935	// QueryExecutionTimeout - The workload group query execution timeout.
26936	QueryExecutionTimeout *int32 `json:"queryExecutionTimeout,omitempty"`
26937}
26938
26939// WorkloadGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
26940// long-running operation.
26941type WorkloadGroupsCreateOrUpdateFuture struct {
26942	azure.FutureAPI
26943	// Result returns the result of the asynchronous operation.
26944	// If the operation has not completed it will return an error.
26945	Result func(WorkloadGroupsClient) (WorkloadGroup, error)
26946}
26947
26948// UnmarshalJSON is the custom unmarshaller for CreateFuture.
26949func (future *WorkloadGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
26950	var azFuture azure.Future
26951	if err := json.Unmarshal(body, &azFuture); err != nil {
26952		return err
26953	}
26954	future.FutureAPI = &azFuture
26955	future.Result = future.result
26956	return nil
26957}
26958
26959// result is the default implementation for WorkloadGroupsCreateOrUpdateFuture.Result.
26960func (future *WorkloadGroupsCreateOrUpdateFuture) result(client WorkloadGroupsClient) (wg WorkloadGroup, err error) {
26961	var done bool
26962	done, err = future.DoneWithContext(context.Background(), client)
26963	if err != nil {
26964		err = autorest.NewErrorWithError(err, "sql.WorkloadGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
26965		return
26966	}
26967	if !done {
26968		wg.Response.Response = future.Response()
26969		err = azure.NewAsyncOpIncompleteError("sql.WorkloadGroupsCreateOrUpdateFuture")
26970		return
26971	}
26972	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
26973	if wg.Response.Response, err = future.GetResult(sender); err == nil && wg.Response.Response.StatusCode != http.StatusNoContent {
26974		wg, err = client.CreateOrUpdateResponder(wg.Response.Response)
26975		if err != nil {
26976			err = autorest.NewErrorWithError(err, "sql.WorkloadGroupsCreateOrUpdateFuture", "Result", wg.Response.Response, "Failure responding to request")
26977		}
26978	}
26979	return
26980}
26981
26982// WorkloadGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
26983// operation.
26984type WorkloadGroupsDeleteFuture struct {
26985	azure.FutureAPI
26986	// Result returns the result of the asynchronous operation.
26987	// If the operation has not completed it will return an error.
26988	Result func(WorkloadGroupsClient) (autorest.Response, error)
26989}
26990
26991// UnmarshalJSON is the custom unmarshaller for CreateFuture.
26992func (future *WorkloadGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
26993	var azFuture azure.Future
26994	if err := json.Unmarshal(body, &azFuture); err != nil {
26995		return err
26996	}
26997	future.FutureAPI = &azFuture
26998	future.Result = future.result
26999	return nil
27000}
27001
27002// result is the default implementation for WorkloadGroupsDeleteFuture.Result.
27003func (future *WorkloadGroupsDeleteFuture) result(client WorkloadGroupsClient) (ar autorest.Response, err error) {
27004	var done bool
27005	done, err = future.DoneWithContext(context.Background(), client)
27006	if err != nil {
27007		err = autorest.NewErrorWithError(err, "sql.WorkloadGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
27008		return
27009	}
27010	if !done {
27011		ar.Response = future.Response()
27012		err = azure.NewAsyncOpIncompleteError("sql.WorkloadGroupsDeleteFuture")
27013		return
27014	}
27015	ar.Response = future.Response()
27016	return
27017}
27018