1package sql
2
3// Copyright (c) Microsoft and contributors.  All rights reserved.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Code generated by Microsoft (R) AutoRest Code Generator.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"context"
22	"encoding/json"
23	"github.com/Azure/go-autorest/autorest"
24	"github.com/Azure/go-autorest/autorest/azure"
25	"github.com/Azure/go-autorest/autorest/date"
26	"github.com/Azure/go-autorest/autorest/to"
27	"github.com/Azure/go-autorest/tracing"
28	"github.com/satori/go.uuid"
29	"net/http"
30)
31
32// The package's fully qualified name.
33const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v3.0/sql"
34
35// AdministratorListResult a list of active directory administrators.
36type AdministratorListResult struct {
37	autorest.Response `json:"-"`
38	// Value - READ-ONLY; Array of results.
39	Value *[]ServerAzureADAdministrator `json:"value,omitempty"`
40	// NextLink - READ-ONLY; Link to retrieve next page of results.
41	NextLink *string `json:"nextLink,omitempty"`
42}
43
44// AdministratorListResultIterator provides access to a complete listing of ServerAzureADAdministrator
45// values.
46type AdministratorListResultIterator struct {
47	i    int
48	page AdministratorListResultPage
49}
50
51// NextWithContext advances to the next value.  If there was an error making
52// the request the iterator does not advance and the error is returned.
53func (iter *AdministratorListResultIterator) NextWithContext(ctx context.Context) (err error) {
54	if tracing.IsEnabled() {
55		ctx = tracing.StartSpan(ctx, fqdn+"/AdministratorListResultIterator.NextWithContext")
56		defer func() {
57			sc := -1
58			if iter.Response().Response.Response != nil {
59				sc = iter.Response().Response.Response.StatusCode
60			}
61			tracing.EndSpan(ctx, sc, err)
62		}()
63	}
64	iter.i++
65	if iter.i < len(iter.page.Values()) {
66		return nil
67	}
68	err = iter.page.NextWithContext(ctx)
69	if err != nil {
70		iter.i--
71		return err
72	}
73	iter.i = 0
74	return nil
75}
76
77// Next advances to the next value.  If there was an error making
78// the request the iterator does not advance and the error is returned.
79// Deprecated: Use NextWithContext() instead.
80func (iter *AdministratorListResultIterator) Next() error {
81	return iter.NextWithContext(context.Background())
82}
83
84// NotDone returns true if the enumeration should be started or is not yet complete.
85func (iter AdministratorListResultIterator) NotDone() bool {
86	return iter.page.NotDone() && iter.i < len(iter.page.Values())
87}
88
89// Response returns the raw server response from the last page request.
90func (iter AdministratorListResultIterator) Response() AdministratorListResult {
91	return iter.page.Response()
92}
93
94// Value returns the current value or a zero-initialized value if the
95// iterator has advanced beyond the end of the collection.
96func (iter AdministratorListResultIterator) Value() ServerAzureADAdministrator {
97	if !iter.page.NotDone() {
98		return ServerAzureADAdministrator{}
99	}
100	return iter.page.Values()[iter.i]
101}
102
103// Creates a new instance of the AdministratorListResultIterator type.
104func NewAdministratorListResultIterator(page AdministratorListResultPage) AdministratorListResultIterator {
105	return AdministratorListResultIterator{page: page}
106}
107
108// IsEmpty returns true if the ListResult contains no values.
109func (alr AdministratorListResult) IsEmpty() bool {
110	return alr.Value == nil || len(*alr.Value) == 0
111}
112
113// hasNextLink returns true if the NextLink is not empty.
114func (alr AdministratorListResult) hasNextLink() bool {
115	return alr.NextLink != nil && len(*alr.NextLink) != 0
116}
117
118// administratorListResultPreparer prepares a request to retrieve the next set of results.
119// It returns nil if no more results exist.
120func (alr AdministratorListResult) administratorListResultPreparer(ctx context.Context) (*http.Request, error) {
121	if !alr.hasNextLink() {
122		return nil, nil
123	}
124	return autorest.Prepare((&http.Request{}).WithContext(ctx),
125		autorest.AsJSON(),
126		autorest.AsGet(),
127		autorest.WithBaseURL(to.String(alr.NextLink)))
128}
129
130// AdministratorListResultPage contains a page of ServerAzureADAdministrator values.
131type AdministratorListResultPage struct {
132	fn  func(context.Context, AdministratorListResult) (AdministratorListResult, error)
133	alr AdministratorListResult
134}
135
136// NextWithContext advances to the next page of values.  If there was an error making
137// the request the page does not advance and the error is returned.
138func (page *AdministratorListResultPage) NextWithContext(ctx context.Context) (err error) {
139	if tracing.IsEnabled() {
140		ctx = tracing.StartSpan(ctx, fqdn+"/AdministratorListResultPage.NextWithContext")
141		defer func() {
142			sc := -1
143			if page.Response().Response.Response != nil {
144				sc = page.Response().Response.Response.StatusCode
145			}
146			tracing.EndSpan(ctx, sc, err)
147		}()
148	}
149	for {
150		next, err := page.fn(ctx, page.alr)
151		if err != nil {
152			return err
153		}
154		page.alr = next
155		if !next.hasNextLink() || !next.IsEmpty() {
156			break
157		}
158	}
159	return nil
160}
161
162// Next advances to the next page of values.  If there was an error making
163// the request the page does not advance and the error is returned.
164// Deprecated: Use NextWithContext() instead.
165func (page *AdministratorListResultPage) Next() error {
166	return page.NextWithContext(context.Background())
167}
168
169// NotDone returns true if the page enumeration should be started or is not yet complete.
170func (page AdministratorListResultPage) NotDone() bool {
171	return !page.alr.IsEmpty()
172}
173
174// Response returns the raw server response from the last page request.
175func (page AdministratorListResultPage) Response() AdministratorListResult {
176	return page.alr
177}
178
179// Values returns the slice of values for the current page or nil if there are no values.
180func (page AdministratorListResultPage) Values() []ServerAzureADAdministrator {
181	if page.alr.IsEmpty() {
182		return nil
183	}
184	return *page.alr.Value
185}
186
187// Creates a new instance of the AdministratorListResultPage type.
188func NewAdministratorListResultPage(cur AdministratorListResult, getNextPage func(context.Context, AdministratorListResult) (AdministratorListResult, error)) AdministratorListResultPage {
189	return AdministratorListResultPage{
190		fn:  getNextPage,
191		alr: cur,
192	}
193}
194
195// AdministratorProperties properties of a active directory administrator.
196type AdministratorProperties struct {
197	// AdministratorType - Type of the sever administrator.
198	AdministratorType *string `json:"administratorType,omitempty"`
199	// Login - Login name of the server administrator.
200	Login *string `json:"login,omitempty"`
201	// Sid - SID (object ID) of the server administrator.
202	Sid *uuid.UUID `json:"sid,omitempty"`
203	// TenantID - Tenant ID of the administrator.
204	TenantID *uuid.UUID `json:"tenantId,omitempty"`
205	// AzureADOnlyAuthentication - READ-ONLY; Azure Active Directory only Authentication enabled.
206	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
207}
208
209// MarshalJSON is the custom marshaler for AdministratorProperties.
210func (ap AdministratorProperties) MarshalJSON() ([]byte, error) {
211	objectMap := make(map[string]interface{})
212	if ap.AdministratorType != nil {
213		objectMap["administratorType"] = ap.AdministratorType
214	}
215	if ap.Login != nil {
216		objectMap["login"] = ap.Login
217	}
218	if ap.Sid != nil {
219		objectMap["sid"] = ap.Sid
220	}
221	if ap.TenantID != nil {
222		objectMap["tenantId"] = ap.TenantID
223	}
224	return json.Marshal(objectMap)
225}
226
227// AutomaticTuningOptions automatic tuning properties for individual advisors.
228type AutomaticTuningOptions struct {
229	// DesiredState - Automatic tuning option desired state. Possible values include: 'AutomaticTuningOptionModeDesiredOff', 'AutomaticTuningOptionModeDesiredOn', 'AutomaticTuningOptionModeDesiredDefault'
230	DesiredState AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"`
231	// ActualState - READ-ONLY; Automatic tuning option actual state. Possible values include: 'Off', 'On'
232	ActualState AutomaticTuningOptionModeActual `json:"actualState,omitempty"`
233	// ReasonCode - READ-ONLY; Reason code if desired and actual state are different.
234	ReasonCode *int32 `json:"reasonCode,omitempty"`
235	// ReasonDesc - READ-ONLY; Reason description if desired and actual state are different. Possible values include: 'Default', 'Disabled', 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', 'QueryStoreReadOnly', 'NotSupported'
236	ReasonDesc AutomaticTuningDisabledReason `json:"reasonDesc,omitempty"`
237}
238
239// MarshalJSON is the custom marshaler for AutomaticTuningOptions.
240func (ato AutomaticTuningOptions) MarshalJSON() ([]byte, error) {
241	objectMap := make(map[string]interface{})
242	if ato.DesiredState != "" {
243		objectMap["desiredState"] = ato.DesiredState
244	}
245	return json.Marshal(objectMap)
246}
247
248// AutomaticTuningServerOptions automatic tuning properties for individual advisors.
249type AutomaticTuningServerOptions struct {
250	// DesiredState - Automatic tuning option desired state. Possible values include: 'AutomaticTuningOptionModeDesiredOff', 'AutomaticTuningOptionModeDesiredOn', 'AutomaticTuningOptionModeDesiredDefault'
251	DesiredState AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"`
252	// ActualState - READ-ONLY; Automatic tuning option actual state. Possible values include: 'Off', 'On'
253	ActualState AutomaticTuningOptionModeActual `json:"actualState,omitempty"`
254	// ReasonCode - READ-ONLY; Reason code if desired and actual state are different.
255	ReasonCode *int32 `json:"reasonCode,omitempty"`
256	// ReasonDesc - READ-ONLY; Reason description if desired and actual state are different. Possible values include: 'AutomaticTuningServerReasonDefault', 'AutomaticTuningServerReasonDisabled', 'AutomaticTuningServerReasonAutoConfigured'
257	ReasonDesc AutomaticTuningServerReason `json:"reasonDesc,omitempty"`
258}
259
260// MarshalJSON is the custom marshaler for AutomaticTuningServerOptions.
261func (atso AutomaticTuningServerOptions) MarshalJSON() ([]byte, error) {
262	objectMap := make(map[string]interface{})
263	if atso.DesiredState != "" {
264		objectMap["desiredState"] = atso.DesiredState
265	}
266	return json.Marshal(objectMap)
267}
268
269// AutomaticTuningServerProperties server-level Automatic Tuning properties.
270type AutomaticTuningServerProperties struct {
271	// DesiredState - Automatic tuning desired state. Possible values include: 'AutomaticTuningServerModeCustom', 'AutomaticTuningServerModeAuto', 'AutomaticTuningServerModeUnspecified'
272	DesiredState AutomaticTuningServerMode `json:"desiredState,omitempty"`
273	// ActualState - READ-ONLY; Automatic tuning actual state. Possible values include: 'AutomaticTuningServerModeCustom', 'AutomaticTuningServerModeAuto', 'AutomaticTuningServerModeUnspecified'
274	ActualState AutomaticTuningServerMode `json:"actualState,omitempty"`
275	// Options - Automatic tuning options definition.
276	Options map[string]*AutomaticTuningServerOptions `json:"options"`
277}
278
279// MarshalJSON is the custom marshaler for AutomaticTuningServerProperties.
280func (atsp AutomaticTuningServerProperties) MarshalJSON() ([]byte, error) {
281	objectMap := make(map[string]interface{})
282	if atsp.DesiredState != "" {
283		objectMap["desiredState"] = atsp.DesiredState
284	}
285	if atsp.Options != nil {
286		objectMap["options"] = atsp.Options
287	}
288	return json.Marshal(objectMap)
289}
290
291// AutoPauseDelayTimeRange supported auto pause delay time range
292type AutoPauseDelayTimeRange struct {
293	// MinValue - READ-ONLY; Minimum value
294	MinValue *int32 `json:"minValue,omitempty"`
295	// MaxValue - READ-ONLY; Maximum value
296	MaxValue *int32 `json:"maxValue,omitempty"`
297	// StepSize - READ-ONLY; Step value for discrete values between the minimum value and the maximum value.
298	StepSize *int32 `json:"stepSize,omitempty"`
299	// Default - READ-ONLY; Default value is no value is provided
300	Default *int32 `json:"default,omitempty"`
301	// Unit - READ-ONLY; Unit of time that delay is expressed in. Possible values include: 'Minutes'
302	Unit PauseDelayTimeUnit `json:"unit,omitempty"`
303	// DoNotPauseValue - READ-ONLY; Value that is used to not pause (infinite delay before pause)
304	DoNotPauseValue *int32 `json:"doNotPauseValue,omitempty"`
305}
306
307// AzureADOnlyAuthListResult a list of active directory only authentications.
308type AzureADOnlyAuthListResult struct {
309	autorest.Response `json:"-"`
310	// Value - READ-ONLY; Array of results.
311	Value *[]ServerAzureADOnlyAuthentication `json:"value,omitempty"`
312	// NextLink - READ-ONLY; Link to retrieve next page of results.
313	NextLink *string `json:"nextLink,omitempty"`
314}
315
316// AzureADOnlyAuthListResultIterator provides access to a complete listing of
317// ServerAzureADOnlyAuthentication values.
318type AzureADOnlyAuthListResultIterator struct {
319	i    int
320	page AzureADOnlyAuthListResultPage
321}
322
323// NextWithContext advances to the next value.  If there was an error making
324// the request the iterator does not advance and the error is returned.
325func (iter *AzureADOnlyAuthListResultIterator) NextWithContext(ctx context.Context) (err error) {
326	if tracing.IsEnabled() {
327		ctx = tracing.StartSpan(ctx, fqdn+"/AzureADOnlyAuthListResultIterator.NextWithContext")
328		defer func() {
329			sc := -1
330			if iter.Response().Response.Response != nil {
331				sc = iter.Response().Response.Response.StatusCode
332			}
333			tracing.EndSpan(ctx, sc, err)
334		}()
335	}
336	iter.i++
337	if iter.i < len(iter.page.Values()) {
338		return nil
339	}
340	err = iter.page.NextWithContext(ctx)
341	if err != nil {
342		iter.i--
343		return err
344	}
345	iter.i = 0
346	return nil
347}
348
349// Next advances to the next value.  If there was an error making
350// the request the iterator does not advance and the error is returned.
351// Deprecated: Use NextWithContext() instead.
352func (iter *AzureADOnlyAuthListResultIterator) Next() error {
353	return iter.NextWithContext(context.Background())
354}
355
356// NotDone returns true if the enumeration should be started or is not yet complete.
357func (iter AzureADOnlyAuthListResultIterator) NotDone() bool {
358	return iter.page.NotDone() && iter.i < len(iter.page.Values())
359}
360
361// Response returns the raw server response from the last page request.
362func (iter AzureADOnlyAuthListResultIterator) Response() AzureADOnlyAuthListResult {
363	return iter.page.Response()
364}
365
366// Value returns the current value or a zero-initialized value if the
367// iterator has advanced beyond the end of the collection.
368func (iter AzureADOnlyAuthListResultIterator) Value() ServerAzureADOnlyAuthentication {
369	if !iter.page.NotDone() {
370		return ServerAzureADOnlyAuthentication{}
371	}
372	return iter.page.Values()[iter.i]
373}
374
375// Creates a new instance of the AzureADOnlyAuthListResultIterator type.
376func NewAzureADOnlyAuthListResultIterator(page AzureADOnlyAuthListResultPage) AzureADOnlyAuthListResultIterator {
377	return AzureADOnlyAuthListResultIterator{page: page}
378}
379
380// IsEmpty returns true if the ListResult contains no values.
381func (aaoalr AzureADOnlyAuthListResult) IsEmpty() bool {
382	return aaoalr.Value == nil || len(*aaoalr.Value) == 0
383}
384
385// hasNextLink returns true if the NextLink is not empty.
386func (aaoalr AzureADOnlyAuthListResult) hasNextLink() bool {
387	return aaoalr.NextLink != nil && len(*aaoalr.NextLink) != 0
388}
389
390// azureADOnlyAuthListResultPreparer prepares a request to retrieve the next set of results.
391// It returns nil if no more results exist.
392func (aaoalr AzureADOnlyAuthListResult) azureADOnlyAuthListResultPreparer(ctx context.Context) (*http.Request, error) {
393	if !aaoalr.hasNextLink() {
394		return nil, nil
395	}
396	return autorest.Prepare((&http.Request{}).WithContext(ctx),
397		autorest.AsJSON(),
398		autorest.AsGet(),
399		autorest.WithBaseURL(to.String(aaoalr.NextLink)))
400}
401
402// AzureADOnlyAuthListResultPage contains a page of ServerAzureADOnlyAuthentication values.
403type AzureADOnlyAuthListResultPage struct {
404	fn     func(context.Context, AzureADOnlyAuthListResult) (AzureADOnlyAuthListResult, error)
405	aaoalr AzureADOnlyAuthListResult
406}
407
408// NextWithContext advances to the next page of values.  If there was an error making
409// the request the page does not advance and the error is returned.
410func (page *AzureADOnlyAuthListResultPage) NextWithContext(ctx context.Context) (err error) {
411	if tracing.IsEnabled() {
412		ctx = tracing.StartSpan(ctx, fqdn+"/AzureADOnlyAuthListResultPage.NextWithContext")
413		defer func() {
414			sc := -1
415			if page.Response().Response.Response != nil {
416				sc = page.Response().Response.Response.StatusCode
417			}
418			tracing.EndSpan(ctx, sc, err)
419		}()
420	}
421	for {
422		next, err := page.fn(ctx, page.aaoalr)
423		if err != nil {
424			return err
425		}
426		page.aaoalr = next
427		if !next.hasNextLink() || !next.IsEmpty() {
428			break
429		}
430	}
431	return nil
432}
433
434// Next advances to the next page of values.  If there was an error making
435// the request the page does not advance and the error is returned.
436// Deprecated: Use NextWithContext() instead.
437func (page *AzureADOnlyAuthListResultPage) Next() error {
438	return page.NextWithContext(context.Background())
439}
440
441// NotDone returns true if the page enumeration should be started or is not yet complete.
442func (page AzureADOnlyAuthListResultPage) NotDone() bool {
443	return !page.aaoalr.IsEmpty()
444}
445
446// Response returns the raw server response from the last page request.
447func (page AzureADOnlyAuthListResultPage) Response() AzureADOnlyAuthListResult {
448	return page.aaoalr
449}
450
451// Values returns the slice of values for the current page or nil if there are no values.
452func (page AzureADOnlyAuthListResultPage) Values() []ServerAzureADOnlyAuthentication {
453	if page.aaoalr.IsEmpty() {
454		return nil
455	}
456	return *page.aaoalr.Value
457}
458
459// Creates a new instance of the AzureADOnlyAuthListResultPage type.
460func NewAzureADOnlyAuthListResultPage(cur AzureADOnlyAuthListResult, getNextPage func(context.Context, AzureADOnlyAuthListResult) (AzureADOnlyAuthListResult, error)) AzureADOnlyAuthListResultPage {
461	return AzureADOnlyAuthListResultPage{
462		fn:     getNextPage,
463		aaoalr: cur,
464	}
465}
466
467// AzureADOnlyAuthProperties properties of a active directory only authentication.
468type AzureADOnlyAuthProperties struct {
469	// AzureADOnlyAuthentication - Azure Active Directory only Authentication enabled.
470	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
471}
472
473// BackupLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
474// results of a long-running operation.
475type BackupLongTermRetentionPoliciesCreateOrUpdateFuture struct {
476	azure.FutureAPI
477	// Result returns the result of the asynchronous operation.
478	// If the operation has not completed it will return an error.
479	Result func(BackupLongTermRetentionPoliciesClient) (BackupLongTermRetentionPolicy, error)
480}
481
482// BackupLongTermRetentionPolicy a long term retention policy.
483type BackupLongTermRetentionPolicy struct {
484	autorest.Response `json:"-"`
485	// LongTermRetentionPolicyProperties - Resource properties.
486	*LongTermRetentionPolicyProperties `json:"properties,omitempty"`
487	// ID - READ-ONLY; Resource ID.
488	ID *string `json:"id,omitempty"`
489	// Name - READ-ONLY; Resource name.
490	Name *string `json:"name,omitempty"`
491	// Type - READ-ONLY; Resource type.
492	Type *string `json:"type,omitempty"`
493}
494
495// MarshalJSON is the custom marshaler for BackupLongTermRetentionPolicy.
496func (bltrp BackupLongTermRetentionPolicy) MarshalJSON() ([]byte, error) {
497	objectMap := make(map[string]interface{})
498	if bltrp.LongTermRetentionPolicyProperties != nil {
499		objectMap["properties"] = bltrp.LongTermRetentionPolicyProperties
500	}
501	return json.Marshal(objectMap)
502}
503
504// UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionPolicy struct.
505func (bltrp *BackupLongTermRetentionPolicy) UnmarshalJSON(body []byte) error {
506	var m map[string]*json.RawMessage
507	err := json.Unmarshal(body, &m)
508	if err != nil {
509		return err
510	}
511	for k, v := range m {
512		switch k {
513		case "properties":
514			if v != nil {
515				var longTermRetentionPolicyProperties LongTermRetentionPolicyProperties
516				err = json.Unmarshal(*v, &longTermRetentionPolicyProperties)
517				if err != nil {
518					return err
519				}
520				bltrp.LongTermRetentionPolicyProperties = &longTermRetentionPolicyProperties
521			}
522		case "id":
523			if v != nil {
524				var ID string
525				err = json.Unmarshal(*v, &ID)
526				if err != nil {
527					return err
528				}
529				bltrp.ID = &ID
530			}
531		case "name":
532			if v != nil {
533				var name string
534				err = json.Unmarshal(*v, &name)
535				if err != nil {
536					return err
537				}
538				bltrp.Name = &name
539			}
540		case "type":
541			if v != nil {
542				var typeVar string
543				err = json.Unmarshal(*v, &typeVar)
544				if err != nil {
545					return err
546				}
547				bltrp.Type = &typeVar
548			}
549		}
550	}
551
552	return nil
553}
554
555// BackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
556// results of a long-running operation.
557type BackupShortTermRetentionPoliciesCreateOrUpdateFuture struct {
558	azure.FutureAPI
559	// Result returns the result of the asynchronous operation.
560	// If the operation has not completed it will return an error.
561	Result func(BackupShortTermRetentionPoliciesClient) (BackupShortTermRetentionPolicy, error)
562}
563
564// BackupShortTermRetentionPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of
565// a long-running operation.
566type BackupShortTermRetentionPoliciesUpdateFuture struct {
567	azure.FutureAPI
568	// Result returns the result of the asynchronous operation.
569	// If the operation has not completed it will return an error.
570	Result func(BackupShortTermRetentionPoliciesClient) (BackupShortTermRetentionPolicy, error)
571}
572
573// BackupShortTermRetentionPolicy a short term retention policy.
574type BackupShortTermRetentionPolicy struct {
575	autorest.Response `json:"-"`
576	// BackupShortTermRetentionPolicyProperties - Resource properties.
577	*BackupShortTermRetentionPolicyProperties `json:"properties,omitempty"`
578	// ID - READ-ONLY; Resource ID.
579	ID *string `json:"id,omitempty"`
580	// Name - READ-ONLY; Resource name.
581	Name *string `json:"name,omitempty"`
582	// Type - READ-ONLY; Resource type.
583	Type *string `json:"type,omitempty"`
584}
585
586// MarshalJSON is the custom marshaler for BackupShortTermRetentionPolicy.
587func (bstrp BackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) {
588	objectMap := make(map[string]interface{})
589	if bstrp.BackupShortTermRetentionPolicyProperties != nil {
590		objectMap["properties"] = bstrp.BackupShortTermRetentionPolicyProperties
591	}
592	return json.Marshal(objectMap)
593}
594
595// UnmarshalJSON is the custom unmarshaler for BackupShortTermRetentionPolicy struct.
596func (bstrp *BackupShortTermRetentionPolicy) UnmarshalJSON(body []byte) error {
597	var m map[string]*json.RawMessage
598	err := json.Unmarshal(body, &m)
599	if err != nil {
600		return err
601	}
602	for k, v := range m {
603		switch k {
604		case "properties":
605			if v != nil {
606				var backupShortTermRetentionPolicyProperties BackupShortTermRetentionPolicyProperties
607				err = json.Unmarshal(*v, &backupShortTermRetentionPolicyProperties)
608				if err != nil {
609					return err
610				}
611				bstrp.BackupShortTermRetentionPolicyProperties = &backupShortTermRetentionPolicyProperties
612			}
613		case "id":
614			if v != nil {
615				var ID string
616				err = json.Unmarshal(*v, &ID)
617				if err != nil {
618					return err
619				}
620				bstrp.ID = &ID
621			}
622		case "name":
623			if v != nil {
624				var name string
625				err = json.Unmarshal(*v, &name)
626				if err != nil {
627					return err
628				}
629				bstrp.Name = &name
630			}
631		case "type":
632			if v != nil {
633				var typeVar string
634				err = json.Unmarshal(*v, &typeVar)
635				if err != nil {
636					return err
637				}
638				bstrp.Type = &typeVar
639			}
640		}
641	}
642
643	return nil
644}
645
646// BackupShortTermRetentionPolicyListResult a list of short term retention policies.
647type BackupShortTermRetentionPolicyListResult struct {
648	autorest.Response `json:"-"`
649	// Value - READ-ONLY; Array of results.
650	Value *[]BackupShortTermRetentionPolicy `json:"value,omitempty"`
651	// NextLink - READ-ONLY; Link to retrieve next page of results.
652	NextLink *string `json:"nextLink,omitempty"`
653}
654
655// BackupShortTermRetentionPolicyListResultIterator provides access to a complete listing of
656// BackupShortTermRetentionPolicy values.
657type BackupShortTermRetentionPolicyListResultIterator struct {
658	i    int
659	page BackupShortTermRetentionPolicyListResultPage
660}
661
662// NextWithContext advances to the next value.  If there was an error making
663// the request the iterator does not advance and the error is returned.
664func (iter *BackupShortTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
665	if tracing.IsEnabled() {
666		ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPolicyListResultIterator.NextWithContext")
667		defer func() {
668			sc := -1
669			if iter.Response().Response.Response != nil {
670				sc = iter.Response().Response.Response.StatusCode
671			}
672			tracing.EndSpan(ctx, sc, err)
673		}()
674	}
675	iter.i++
676	if iter.i < len(iter.page.Values()) {
677		return nil
678	}
679	err = iter.page.NextWithContext(ctx)
680	if err != nil {
681		iter.i--
682		return err
683	}
684	iter.i = 0
685	return nil
686}
687
688// Next advances to the next value.  If there was an error making
689// the request the iterator does not advance and the error is returned.
690// Deprecated: Use NextWithContext() instead.
691func (iter *BackupShortTermRetentionPolicyListResultIterator) Next() error {
692	return iter.NextWithContext(context.Background())
693}
694
695// NotDone returns true if the enumeration should be started or is not yet complete.
696func (iter BackupShortTermRetentionPolicyListResultIterator) NotDone() bool {
697	return iter.page.NotDone() && iter.i < len(iter.page.Values())
698}
699
700// Response returns the raw server response from the last page request.
701func (iter BackupShortTermRetentionPolicyListResultIterator) Response() BackupShortTermRetentionPolicyListResult {
702	return iter.page.Response()
703}
704
705// Value returns the current value or a zero-initialized value if the
706// iterator has advanced beyond the end of the collection.
707func (iter BackupShortTermRetentionPolicyListResultIterator) Value() BackupShortTermRetentionPolicy {
708	if !iter.page.NotDone() {
709		return BackupShortTermRetentionPolicy{}
710	}
711	return iter.page.Values()[iter.i]
712}
713
714// Creates a new instance of the BackupShortTermRetentionPolicyListResultIterator type.
715func NewBackupShortTermRetentionPolicyListResultIterator(page BackupShortTermRetentionPolicyListResultPage) BackupShortTermRetentionPolicyListResultIterator {
716	return BackupShortTermRetentionPolicyListResultIterator{page: page}
717}
718
719// IsEmpty returns true if the ListResult contains no values.
720func (bstrplr BackupShortTermRetentionPolicyListResult) IsEmpty() bool {
721	return bstrplr.Value == nil || len(*bstrplr.Value) == 0
722}
723
724// hasNextLink returns true if the NextLink is not empty.
725func (bstrplr BackupShortTermRetentionPolicyListResult) hasNextLink() bool {
726	return bstrplr.NextLink != nil && len(*bstrplr.NextLink) != 0
727}
728
729// backupShortTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results.
730// It returns nil if no more results exist.
731func (bstrplr BackupShortTermRetentionPolicyListResult) backupShortTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
732	if !bstrplr.hasNextLink() {
733		return nil, nil
734	}
735	return autorest.Prepare((&http.Request{}).WithContext(ctx),
736		autorest.AsJSON(),
737		autorest.AsGet(),
738		autorest.WithBaseURL(to.String(bstrplr.NextLink)))
739}
740
741// BackupShortTermRetentionPolicyListResultPage contains a page of BackupShortTermRetentionPolicy values.
742type BackupShortTermRetentionPolicyListResultPage struct {
743	fn      func(context.Context, BackupShortTermRetentionPolicyListResult) (BackupShortTermRetentionPolicyListResult, error)
744	bstrplr BackupShortTermRetentionPolicyListResult
745}
746
747// NextWithContext advances to the next page of values.  If there was an error making
748// the request the page does not advance and the error is returned.
749func (page *BackupShortTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
750	if tracing.IsEnabled() {
751		ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPolicyListResultPage.NextWithContext")
752		defer func() {
753			sc := -1
754			if page.Response().Response.Response != nil {
755				sc = page.Response().Response.Response.StatusCode
756			}
757			tracing.EndSpan(ctx, sc, err)
758		}()
759	}
760	for {
761		next, err := page.fn(ctx, page.bstrplr)
762		if err != nil {
763			return err
764		}
765		page.bstrplr = next
766		if !next.hasNextLink() || !next.IsEmpty() {
767			break
768		}
769	}
770	return nil
771}
772
773// Next advances to the next page of values.  If there was an error making
774// the request the page does not advance and the error is returned.
775// Deprecated: Use NextWithContext() instead.
776func (page *BackupShortTermRetentionPolicyListResultPage) Next() error {
777	return page.NextWithContext(context.Background())
778}
779
780// NotDone returns true if the page enumeration should be started or is not yet complete.
781func (page BackupShortTermRetentionPolicyListResultPage) NotDone() bool {
782	return !page.bstrplr.IsEmpty()
783}
784
785// Response returns the raw server response from the last page request.
786func (page BackupShortTermRetentionPolicyListResultPage) Response() BackupShortTermRetentionPolicyListResult {
787	return page.bstrplr
788}
789
790// Values returns the slice of values for the current page or nil if there are no values.
791func (page BackupShortTermRetentionPolicyListResultPage) Values() []BackupShortTermRetentionPolicy {
792	if page.bstrplr.IsEmpty() {
793		return nil
794	}
795	return *page.bstrplr.Value
796}
797
798// Creates a new instance of the BackupShortTermRetentionPolicyListResultPage type.
799func NewBackupShortTermRetentionPolicyListResultPage(cur BackupShortTermRetentionPolicyListResult, getNextPage func(context.Context, BackupShortTermRetentionPolicyListResult) (BackupShortTermRetentionPolicyListResult, error)) BackupShortTermRetentionPolicyListResultPage {
800	return BackupShortTermRetentionPolicyListResultPage{
801		fn:      getNextPage,
802		bstrplr: cur,
803	}
804}
805
806// BackupShortTermRetentionPolicyProperties properties of a short term retention policy
807type BackupShortTermRetentionPolicyProperties struct {
808	// RetentionDays - The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
809	RetentionDays *int32 `json:"retentionDays,omitempty"`
810}
811
812// BaseLongTermRetentionPolicyProperties properties of a long term retention policy
813type BaseLongTermRetentionPolicyProperties struct {
814	// WeeklyRetention - The weekly retention policy for an LTR backup in an ISO 8601 format.
815	WeeklyRetention *string `json:"weeklyRetention,omitempty"`
816	// MonthlyRetention - The monthly retention policy for an LTR backup in an ISO 8601 format.
817	MonthlyRetention *string `json:"monthlyRetention,omitempty"`
818	// YearlyRetention - The yearly retention policy for an LTR backup in an ISO 8601 format.
819	YearlyRetention *string `json:"yearlyRetention,omitempty"`
820	// WeekOfYear - The week of year to take the yearly backup in an ISO 8601 format.
821	WeekOfYear *int32 `json:"weekOfYear,omitempty"`
822}
823
824// CheckNameAvailabilityRequest a request to check whether the specified name for a resource is available.
825type CheckNameAvailabilityRequest struct {
826	Name *string `json:"name,omitempty"`
827	Type *string `json:"type,omitempty"`
828}
829
830// CheckNameAvailabilityResponse the result of a name availability check.
831type CheckNameAvailabilityResponse struct {
832	autorest.Response `json:"-"`
833	// Name - READ-ONLY; The name whose availability was checked.
834	Name *string `json:"name,omitempty"`
835	// Available - READ-ONLY; True if the name is available, otherwise false.
836	Available *bool `json:"available,omitempty"`
837	// 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'
838	Reason CheckNameAvailabilityReason `json:"reason,omitempty"`
839	// Message - READ-ONLY; A message explaining why the name is unavailable. Will be undefined if the name is available.
840	Message *string `json:"message,omitempty"`
841}
842
843// CompleteDatabaseRestoreDefinition contains the information necessary to perform a complete database
844// restore operation.
845type CompleteDatabaseRestoreDefinition struct {
846	// LastBackupName - The last backup name to apply
847	LastBackupName *string `json:"lastBackupName,omitempty"`
848}
849
850// CreateDatabaseRestorePointDefinition contains the information necessary to perform a create database
851// restore point operation.
852type CreateDatabaseRestorePointDefinition struct {
853	// RestorePointLabel - The restore point label to apply
854	RestorePointLabel *string `json:"restorePointLabel,omitempty"`
855}
856
857// Database a database resource.
858type Database struct {
859	autorest.Response `json:"-"`
860	// Sku - The database SKU.
861	//
862	// 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:
863	//
864	// ```azurecli
865	// az sql db list-editions -l <location> -o table
866	// ````
867	//
868	// ```powershell
869	// Get-AzSqlServerServiceObjective -Location <location>
870	// ````
871	Sku *Sku `json:"sku,omitempty"`
872	// Kind - READ-ONLY; Kind of database. This is metadata used for the Azure portal experience.
873	Kind *string `json:"kind,omitempty"`
874	// ManagedBy - READ-ONLY; Resource that manages the database.
875	ManagedBy *string `json:"managedBy,omitempty"`
876	// DatabaseProperties - Resource properties.
877	*DatabaseProperties `json:"properties,omitempty"`
878	// Location - Resource location.
879	Location *string `json:"location,omitempty"`
880	// Tags - Resource tags.
881	Tags map[string]*string `json:"tags"`
882	// ID - READ-ONLY; Resource ID.
883	ID *string `json:"id,omitempty"`
884	// Name - READ-ONLY; Resource name.
885	Name *string `json:"name,omitempty"`
886	// Type - READ-ONLY; Resource type.
887	Type *string `json:"type,omitempty"`
888}
889
890// MarshalJSON is the custom marshaler for Database.
891func (d Database) MarshalJSON() ([]byte, error) {
892	objectMap := make(map[string]interface{})
893	if d.Sku != nil {
894		objectMap["sku"] = d.Sku
895	}
896	if d.DatabaseProperties != nil {
897		objectMap["properties"] = d.DatabaseProperties
898	}
899	if d.Location != nil {
900		objectMap["location"] = d.Location
901	}
902	if d.Tags != nil {
903		objectMap["tags"] = d.Tags
904	}
905	return json.Marshal(objectMap)
906}
907
908// UnmarshalJSON is the custom unmarshaler for Database struct.
909func (d *Database) UnmarshalJSON(body []byte) error {
910	var m map[string]*json.RawMessage
911	err := json.Unmarshal(body, &m)
912	if err != nil {
913		return err
914	}
915	for k, v := range m {
916		switch k {
917		case "sku":
918			if v != nil {
919				var sku Sku
920				err = json.Unmarshal(*v, &sku)
921				if err != nil {
922					return err
923				}
924				d.Sku = &sku
925			}
926		case "kind":
927			if v != nil {
928				var kind string
929				err = json.Unmarshal(*v, &kind)
930				if err != nil {
931					return err
932				}
933				d.Kind = &kind
934			}
935		case "managedBy":
936			if v != nil {
937				var managedBy string
938				err = json.Unmarshal(*v, &managedBy)
939				if err != nil {
940					return err
941				}
942				d.ManagedBy = &managedBy
943			}
944		case "properties":
945			if v != nil {
946				var databaseProperties DatabaseProperties
947				err = json.Unmarshal(*v, &databaseProperties)
948				if err != nil {
949					return err
950				}
951				d.DatabaseProperties = &databaseProperties
952			}
953		case "location":
954			if v != nil {
955				var location string
956				err = json.Unmarshal(*v, &location)
957				if err != nil {
958					return err
959				}
960				d.Location = &location
961			}
962		case "tags":
963			if v != nil {
964				var tags map[string]*string
965				err = json.Unmarshal(*v, &tags)
966				if err != nil {
967					return err
968				}
969				d.Tags = tags
970			}
971		case "id":
972			if v != nil {
973				var ID string
974				err = json.Unmarshal(*v, &ID)
975				if err != nil {
976					return err
977				}
978				d.ID = &ID
979			}
980		case "name":
981			if v != nil {
982				var name string
983				err = json.Unmarshal(*v, &name)
984				if err != nil {
985					return err
986				}
987				d.Name = &name
988			}
989		case "type":
990			if v != nil {
991				var typeVar string
992				err = json.Unmarshal(*v, &typeVar)
993				if err != nil {
994					return err
995				}
996				d.Type = &typeVar
997			}
998		}
999	}
1000
1001	return nil
1002}
1003
1004// DatabaseAutomaticTuning database-level Automatic Tuning.
1005type DatabaseAutomaticTuning struct {
1006	autorest.Response `json:"-"`
1007	// DatabaseAutomaticTuningProperties - Resource properties.
1008	*DatabaseAutomaticTuningProperties `json:"properties,omitempty"`
1009	// ID - READ-ONLY; Resource ID.
1010	ID *string `json:"id,omitempty"`
1011	// Name - READ-ONLY; Resource name.
1012	Name *string `json:"name,omitempty"`
1013	// Type - READ-ONLY; Resource type.
1014	Type *string `json:"type,omitempty"`
1015}
1016
1017// MarshalJSON is the custom marshaler for DatabaseAutomaticTuning.
1018func (dat DatabaseAutomaticTuning) MarshalJSON() ([]byte, error) {
1019	objectMap := make(map[string]interface{})
1020	if dat.DatabaseAutomaticTuningProperties != nil {
1021		objectMap["properties"] = dat.DatabaseAutomaticTuningProperties
1022	}
1023	return json.Marshal(objectMap)
1024}
1025
1026// UnmarshalJSON is the custom unmarshaler for DatabaseAutomaticTuning struct.
1027func (dat *DatabaseAutomaticTuning) UnmarshalJSON(body []byte) error {
1028	var m map[string]*json.RawMessage
1029	err := json.Unmarshal(body, &m)
1030	if err != nil {
1031		return err
1032	}
1033	for k, v := range m {
1034		switch k {
1035		case "properties":
1036			if v != nil {
1037				var databaseAutomaticTuningProperties DatabaseAutomaticTuningProperties
1038				err = json.Unmarshal(*v, &databaseAutomaticTuningProperties)
1039				if err != nil {
1040					return err
1041				}
1042				dat.DatabaseAutomaticTuningProperties = &databaseAutomaticTuningProperties
1043			}
1044		case "id":
1045			if v != nil {
1046				var ID string
1047				err = json.Unmarshal(*v, &ID)
1048				if err != nil {
1049					return err
1050				}
1051				dat.ID = &ID
1052			}
1053		case "name":
1054			if v != nil {
1055				var name string
1056				err = json.Unmarshal(*v, &name)
1057				if err != nil {
1058					return err
1059				}
1060				dat.Name = &name
1061			}
1062		case "type":
1063			if v != nil {
1064				var typeVar string
1065				err = json.Unmarshal(*v, &typeVar)
1066				if err != nil {
1067					return err
1068				}
1069				dat.Type = &typeVar
1070			}
1071		}
1072	}
1073
1074	return nil
1075}
1076
1077// DatabaseAutomaticTuningProperties database-level Automatic Tuning properties.
1078type DatabaseAutomaticTuningProperties struct {
1079	// DesiredState - Automatic tuning desired state. Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified'
1080	DesiredState AutomaticTuningMode `json:"desiredState,omitempty"`
1081	// ActualState - READ-ONLY; Automatic tuning actual state. Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified'
1082	ActualState AutomaticTuningMode `json:"actualState,omitempty"`
1083	// Options - Automatic tuning options definition.
1084	Options map[string]*AutomaticTuningOptions `json:"options"`
1085}
1086
1087// MarshalJSON is the custom marshaler for DatabaseAutomaticTuningProperties.
1088func (datp DatabaseAutomaticTuningProperties) MarshalJSON() ([]byte, error) {
1089	objectMap := make(map[string]interface{})
1090	if datp.DesiredState != "" {
1091		objectMap["desiredState"] = datp.DesiredState
1092	}
1093	if datp.Options != nil {
1094		objectMap["options"] = datp.Options
1095	}
1096	return json.Marshal(objectMap)
1097}
1098
1099// DatabaseBlobAuditingPolicy a database blob auditing policy.
1100type DatabaseBlobAuditingPolicy struct {
1101	autorest.Response `json:"-"`
1102	// Kind - READ-ONLY; Resource kind.
1103	Kind *string `json:"kind,omitempty"`
1104	// DatabaseBlobAuditingPolicyProperties - Resource properties.
1105	*DatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"`
1106	// ID - READ-ONLY; Resource ID.
1107	ID *string `json:"id,omitempty"`
1108	// Name - READ-ONLY; Resource name.
1109	Name *string `json:"name,omitempty"`
1110	// Type - READ-ONLY; Resource type.
1111	Type *string `json:"type,omitempty"`
1112}
1113
1114// MarshalJSON is the custom marshaler for DatabaseBlobAuditingPolicy.
1115func (dbap DatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
1116	objectMap := make(map[string]interface{})
1117	if dbap.DatabaseBlobAuditingPolicyProperties != nil {
1118		objectMap["properties"] = dbap.DatabaseBlobAuditingPolicyProperties
1119	}
1120	return json.Marshal(objectMap)
1121}
1122
1123// UnmarshalJSON is the custom unmarshaler for DatabaseBlobAuditingPolicy struct.
1124func (dbap *DatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
1125	var m map[string]*json.RawMessage
1126	err := json.Unmarshal(body, &m)
1127	if err != nil {
1128		return err
1129	}
1130	for k, v := range m {
1131		switch k {
1132		case "kind":
1133			if v != nil {
1134				var kind string
1135				err = json.Unmarshal(*v, &kind)
1136				if err != nil {
1137					return err
1138				}
1139				dbap.Kind = &kind
1140			}
1141		case "properties":
1142			if v != nil {
1143				var databaseBlobAuditingPolicyProperties DatabaseBlobAuditingPolicyProperties
1144				err = json.Unmarshal(*v, &databaseBlobAuditingPolicyProperties)
1145				if err != nil {
1146					return err
1147				}
1148				dbap.DatabaseBlobAuditingPolicyProperties = &databaseBlobAuditingPolicyProperties
1149			}
1150		case "id":
1151			if v != nil {
1152				var ID string
1153				err = json.Unmarshal(*v, &ID)
1154				if err != nil {
1155					return err
1156				}
1157				dbap.ID = &ID
1158			}
1159		case "name":
1160			if v != nil {
1161				var name string
1162				err = json.Unmarshal(*v, &name)
1163				if err != nil {
1164					return err
1165				}
1166				dbap.Name = &name
1167			}
1168		case "type":
1169			if v != nil {
1170				var typeVar string
1171				err = json.Unmarshal(*v, &typeVar)
1172				if err != nil {
1173					return err
1174				}
1175				dbap.Type = &typeVar
1176			}
1177		}
1178	}
1179
1180	return nil
1181}
1182
1183// DatabaseBlobAuditingPolicyListResult a list of database auditing settings.
1184type DatabaseBlobAuditingPolicyListResult struct {
1185	autorest.Response `json:"-"`
1186	// Value - READ-ONLY; Array of results.
1187	Value *[]DatabaseBlobAuditingPolicy `json:"value,omitempty"`
1188	// NextLink - READ-ONLY; Link to retrieve next page of results.
1189	NextLink *string `json:"nextLink,omitempty"`
1190}
1191
1192// DatabaseBlobAuditingPolicyListResultIterator provides access to a complete listing of
1193// DatabaseBlobAuditingPolicy values.
1194type DatabaseBlobAuditingPolicyListResultIterator struct {
1195	i    int
1196	page DatabaseBlobAuditingPolicyListResultPage
1197}
1198
1199// NextWithContext advances to the next value.  If there was an error making
1200// the request the iterator does not advance and the error is returned.
1201func (iter *DatabaseBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
1202	if tracing.IsEnabled() {
1203		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPolicyListResultIterator.NextWithContext")
1204		defer func() {
1205			sc := -1
1206			if iter.Response().Response.Response != nil {
1207				sc = iter.Response().Response.Response.StatusCode
1208			}
1209			tracing.EndSpan(ctx, sc, err)
1210		}()
1211	}
1212	iter.i++
1213	if iter.i < len(iter.page.Values()) {
1214		return nil
1215	}
1216	err = iter.page.NextWithContext(ctx)
1217	if err != nil {
1218		iter.i--
1219		return err
1220	}
1221	iter.i = 0
1222	return nil
1223}
1224
1225// Next advances to the next value.  If there was an error making
1226// the request the iterator does not advance and the error is returned.
1227// Deprecated: Use NextWithContext() instead.
1228func (iter *DatabaseBlobAuditingPolicyListResultIterator) Next() error {
1229	return iter.NextWithContext(context.Background())
1230}
1231
1232// NotDone returns true if the enumeration should be started or is not yet complete.
1233func (iter DatabaseBlobAuditingPolicyListResultIterator) NotDone() bool {
1234	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1235}
1236
1237// Response returns the raw server response from the last page request.
1238func (iter DatabaseBlobAuditingPolicyListResultIterator) Response() DatabaseBlobAuditingPolicyListResult {
1239	return iter.page.Response()
1240}
1241
1242// Value returns the current value or a zero-initialized value if the
1243// iterator has advanced beyond the end of the collection.
1244func (iter DatabaseBlobAuditingPolicyListResultIterator) Value() DatabaseBlobAuditingPolicy {
1245	if !iter.page.NotDone() {
1246		return DatabaseBlobAuditingPolicy{}
1247	}
1248	return iter.page.Values()[iter.i]
1249}
1250
1251// Creates a new instance of the DatabaseBlobAuditingPolicyListResultIterator type.
1252func NewDatabaseBlobAuditingPolicyListResultIterator(page DatabaseBlobAuditingPolicyListResultPage) DatabaseBlobAuditingPolicyListResultIterator {
1253	return DatabaseBlobAuditingPolicyListResultIterator{page: page}
1254}
1255
1256// IsEmpty returns true if the ListResult contains no values.
1257func (dbaplr DatabaseBlobAuditingPolicyListResult) IsEmpty() bool {
1258	return dbaplr.Value == nil || len(*dbaplr.Value) == 0
1259}
1260
1261// hasNextLink returns true if the NextLink is not empty.
1262func (dbaplr DatabaseBlobAuditingPolicyListResult) hasNextLink() bool {
1263	return dbaplr.NextLink != nil && len(*dbaplr.NextLink) != 0
1264}
1265
1266// databaseBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
1267// It returns nil if no more results exist.
1268func (dbaplr DatabaseBlobAuditingPolicyListResult) databaseBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
1269	if !dbaplr.hasNextLink() {
1270		return nil, nil
1271	}
1272	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1273		autorest.AsJSON(),
1274		autorest.AsGet(),
1275		autorest.WithBaseURL(to.String(dbaplr.NextLink)))
1276}
1277
1278// DatabaseBlobAuditingPolicyListResultPage contains a page of DatabaseBlobAuditingPolicy values.
1279type DatabaseBlobAuditingPolicyListResultPage struct {
1280	fn     func(context.Context, DatabaseBlobAuditingPolicyListResult) (DatabaseBlobAuditingPolicyListResult, error)
1281	dbaplr DatabaseBlobAuditingPolicyListResult
1282}
1283
1284// NextWithContext advances to the next page of values.  If there was an error making
1285// the request the page does not advance and the error is returned.
1286func (page *DatabaseBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
1287	if tracing.IsEnabled() {
1288		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPolicyListResultPage.NextWithContext")
1289		defer func() {
1290			sc := -1
1291			if page.Response().Response.Response != nil {
1292				sc = page.Response().Response.Response.StatusCode
1293			}
1294			tracing.EndSpan(ctx, sc, err)
1295		}()
1296	}
1297	for {
1298		next, err := page.fn(ctx, page.dbaplr)
1299		if err != nil {
1300			return err
1301		}
1302		page.dbaplr = next
1303		if !next.hasNextLink() || !next.IsEmpty() {
1304			break
1305		}
1306	}
1307	return nil
1308}
1309
1310// Next advances to the next page of values.  If there was an error making
1311// the request the page does not advance and the error is returned.
1312// Deprecated: Use NextWithContext() instead.
1313func (page *DatabaseBlobAuditingPolicyListResultPage) Next() error {
1314	return page.NextWithContext(context.Background())
1315}
1316
1317// NotDone returns true if the page enumeration should be started or is not yet complete.
1318func (page DatabaseBlobAuditingPolicyListResultPage) NotDone() bool {
1319	return !page.dbaplr.IsEmpty()
1320}
1321
1322// Response returns the raw server response from the last page request.
1323func (page DatabaseBlobAuditingPolicyListResultPage) Response() DatabaseBlobAuditingPolicyListResult {
1324	return page.dbaplr
1325}
1326
1327// Values returns the slice of values for the current page or nil if there are no values.
1328func (page DatabaseBlobAuditingPolicyListResultPage) Values() []DatabaseBlobAuditingPolicy {
1329	if page.dbaplr.IsEmpty() {
1330		return nil
1331	}
1332	return *page.dbaplr.Value
1333}
1334
1335// Creates a new instance of the DatabaseBlobAuditingPolicyListResultPage type.
1336func NewDatabaseBlobAuditingPolicyListResultPage(cur DatabaseBlobAuditingPolicyListResult, getNextPage func(context.Context, DatabaseBlobAuditingPolicyListResult) (DatabaseBlobAuditingPolicyListResult, error)) DatabaseBlobAuditingPolicyListResultPage {
1337	return DatabaseBlobAuditingPolicyListResultPage{
1338		fn:     getNextPage,
1339		dbaplr: cur,
1340	}
1341}
1342
1343// DatabaseBlobAuditingPolicyProperties properties of a database blob auditing policy.
1344type DatabaseBlobAuditingPolicyProperties struct {
1345	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
1346	State BlobAuditingPolicyState `json:"state,omitempty"`
1347	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
1348	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
1349	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
1350	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
1351	// Prerequisites for using managed identity authentication:
1352	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
1353	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
1354	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
1355	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
1356	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
1357	RetentionDays *int32 `json:"retentionDays,omitempty"`
1358	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
1359	//
1360	// 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:
1361	//
1362	// BATCH_COMPLETED_GROUP,
1363	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
1364	// FAILED_DATABASE_AUTHENTICATION_GROUP.
1365	//
1366	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
1367	//
1368	// 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):
1369	//
1370	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
1371	// BACKUP_RESTORE_GROUP
1372	// DATABASE_LOGOUT_GROUP
1373	// DATABASE_OBJECT_CHANGE_GROUP
1374	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
1375	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
1376	// DATABASE_OPERATION_GROUP
1377	// DATABASE_PERMISSION_CHANGE_GROUP
1378	// DATABASE_PRINCIPAL_CHANGE_GROUP
1379	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
1380	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
1381	// FAILED_DATABASE_AUTHENTICATION_GROUP
1382	// SCHEMA_OBJECT_ACCESS_GROUP
1383	// SCHEMA_OBJECT_CHANGE_GROUP
1384	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
1385	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
1386	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
1387	// USER_CHANGE_PASSWORD_GROUP
1388	// BATCH_STARTED_GROUP
1389	// BATCH_COMPLETED_GROUP
1390	//
1391	// 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.
1392	//
1393	// 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).
1394	//
1395	// 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:
1396	// SELECT
1397	// UPDATE
1398	// INSERT
1399	// DELETE
1400	// EXECUTE
1401	// RECEIVE
1402	// REFERENCES
1403	//
1404	// The general form for defining an action to be audited is:
1405	// {action} ON {object} BY {principal}
1406	//
1407	// 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.
1408	//
1409	// For example:
1410	// SELECT on dbo.myTable by public
1411	// SELECT on DATABASE::myDatabase by public
1412	// SELECT on SCHEMA::mySchema by public
1413	//
1414	// 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)
1415	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
1416	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
1417	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
1418	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
1419	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
1420	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
1421	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
1422	//
1423	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
1424	// Note that for server level audit you should use the 'master' database as {databaseName}.
1425	//
1426	// Diagnostic Settings URI format:
1427	// 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
1428	//
1429	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
1430	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
1431	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
1432	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
1433	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
1434	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
1435}
1436
1437// DatabaseListResult a list of databases.
1438type DatabaseListResult struct {
1439	autorest.Response `json:"-"`
1440	// Value - READ-ONLY; Array of results.
1441	Value *[]Database `json:"value,omitempty"`
1442	// NextLink - READ-ONLY; Link to retrieve next page of results.
1443	NextLink *string `json:"nextLink,omitempty"`
1444}
1445
1446// DatabaseListResultIterator provides access to a complete listing of Database values.
1447type DatabaseListResultIterator struct {
1448	i    int
1449	page DatabaseListResultPage
1450}
1451
1452// NextWithContext advances to the next value.  If there was an error making
1453// the request the iterator does not advance and the error is returned.
1454func (iter *DatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
1455	if tracing.IsEnabled() {
1456		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseListResultIterator.NextWithContext")
1457		defer func() {
1458			sc := -1
1459			if iter.Response().Response.Response != nil {
1460				sc = iter.Response().Response.Response.StatusCode
1461			}
1462			tracing.EndSpan(ctx, sc, err)
1463		}()
1464	}
1465	iter.i++
1466	if iter.i < len(iter.page.Values()) {
1467		return nil
1468	}
1469	err = iter.page.NextWithContext(ctx)
1470	if err != nil {
1471		iter.i--
1472		return err
1473	}
1474	iter.i = 0
1475	return nil
1476}
1477
1478// Next advances to the next value.  If there was an error making
1479// the request the iterator does not advance and the error is returned.
1480// Deprecated: Use NextWithContext() instead.
1481func (iter *DatabaseListResultIterator) Next() error {
1482	return iter.NextWithContext(context.Background())
1483}
1484
1485// NotDone returns true if the enumeration should be started or is not yet complete.
1486func (iter DatabaseListResultIterator) NotDone() bool {
1487	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1488}
1489
1490// Response returns the raw server response from the last page request.
1491func (iter DatabaseListResultIterator) Response() DatabaseListResult {
1492	return iter.page.Response()
1493}
1494
1495// Value returns the current value or a zero-initialized value if the
1496// iterator has advanced beyond the end of the collection.
1497func (iter DatabaseListResultIterator) Value() Database {
1498	if !iter.page.NotDone() {
1499		return Database{}
1500	}
1501	return iter.page.Values()[iter.i]
1502}
1503
1504// Creates a new instance of the DatabaseListResultIterator type.
1505func NewDatabaseListResultIterator(page DatabaseListResultPage) DatabaseListResultIterator {
1506	return DatabaseListResultIterator{page: page}
1507}
1508
1509// IsEmpty returns true if the ListResult contains no values.
1510func (dlr DatabaseListResult) IsEmpty() bool {
1511	return dlr.Value == nil || len(*dlr.Value) == 0
1512}
1513
1514// hasNextLink returns true if the NextLink is not empty.
1515func (dlr DatabaseListResult) hasNextLink() bool {
1516	return dlr.NextLink != nil && len(*dlr.NextLink) != 0
1517}
1518
1519// databaseListResultPreparer prepares a request to retrieve the next set of results.
1520// It returns nil if no more results exist.
1521func (dlr DatabaseListResult) databaseListResultPreparer(ctx context.Context) (*http.Request, error) {
1522	if !dlr.hasNextLink() {
1523		return nil, nil
1524	}
1525	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1526		autorest.AsJSON(),
1527		autorest.AsGet(),
1528		autorest.WithBaseURL(to.String(dlr.NextLink)))
1529}
1530
1531// DatabaseListResultPage contains a page of Database values.
1532type DatabaseListResultPage struct {
1533	fn  func(context.Context, DatabaseListResult) (DatabaseListResult, error)
1534	dlr DatabaseListResult
1535}
1536
1537// NextWithContext advances to the next page of values.  If there was an error making
1538// the request the page does not advance and the error is returned.
1539func (page *DatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
1540	if tracing.IsEnabled() {
1541		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseListResultPage.NextWithContext")
1542		defer func() {
1543			sc := -1
1544			if page.Response().Response.Response != nil {
1545				sc = page.Response().Response.Response.StatusCode
1546			}
1547			tracing.EndSpan(ctx, sc, err)
1548		}()
1549	}
1550	for {
1551		next, err := page.fn(ctx, page.dlr)
1552		if err != nil {
1553			return err
1554		}
1555		page.dlr = next
1556		if !next.hasNextLink() || !next.IsEmpty() {
1557			break
1558		}
1559	}
1560	return nil
1561}
1562
1563// Next advances to the next page of values.  If there was an error making
1564// the request the page does not advance and the error is returned.
1565// Deprecated: Use NextWithContext() instead.
1566func (page *DatabaseListResultPage) Next() error {
1567	return page.NextWithContext(context.Background())
1568}
1569
1570// NotDone returns true if the page enumeration should be started or is not yet complete.
1571func (page DatabaseListResultPage) NotDone() bool {
1572	return !page.dlr.IsEmpty()
1573}
1574
1575// Response returns the raw server response from the last page request.
1576func (page DatabaseListResultPage) Response() DatabaseListResult {
1577	return page.dlr
1578}
1579
1580// Values returns the slice of values for the current page or nil if there are no values.
1581func (page DatabaseListResultPage) Values() []Database {
1582	if page.dlr.IsEmpty() {
1583		return nil
1584	}
1585	return *page.dlr.Value
1586}
1587
1588// Creates a new instance of the DatabaseListResultPage type.
1589func NewDatabaseListResultPage(cur DatabaseListResult, getNextPage func(context.Context, DatabaseListResult) (DatabaseListResult, error)) DatabaseListResultPage {
1590	return DatabaseListResultPage{
1591		fn:  getNextPage,
1592		dlr: cur,
1593	}
1594}
1595
1596// DatabaseOperation a database operation.
1597type DatabaseOperation struct {
1598	// DatabaseOperationProperties - Resource properties.
1599	*DatabaseOperationProperties `json:"properties,omitempty"`
1600	// ID - READ-ONLY; Resource ID.
1601	ID *string `json:"id,omitempty"`
1602	// Name - READ-ONLY; Resource name.
1603	Name *string `json:"name,omitempty"`
1604	// Type - READ-ONLY; Resource type.
1605	Type *string `json:"type,omitempty"`
1606}
1607
1608// MarshalJSON is the custom marshaler for DatabaseOperation.
1609func (do DatabaseOperation) MarshalJSON() ([]byte, error) {
1610	objectMap := make(map[string]interface{})
1611	if do.DatabaseOperationProperties != nil {
1612		objectMap["properties"] = do.DatabaseOperationProperties
1613	}
1614	return json.Marshal(objectMap)
1615}
1616
1617// UnmarshalJSON is the custom unmarshaler for DatabaseOperation struct.
1618func (do *DatabaseOperation) UnmarshalJSON(body []byte) error {
1619	var m map[string]*json.RawMessage
1620	err := json.Unmarshal(body, &m)
1621	if err != nil {
1622		return err
1623	}
1624	for k, v := range m {
1625		switch k {
1626		case "properties":
1627			if v != nil {
1628				var databaseOperationProperties DatabaseOperationProperties
1629				err = json.Unmarshal(*v, &databaseOperationProperties)
1630				if err != nil {
1631					return err
1632				}
1633				do.DatabaseOperationProperties = &databaseOperationProperties
1634			}
1635		case "id":
1636			if v != nil {
1637				var ID string
1638				err = json.Unmarshal(*v, &ID)
1639				if err != nil {
1640					return err
1641				}
1642				do.ID = &ID
1643			}
1644		case "name":
1645			if v != nil {
1646				var name string
1647				err = json.Unmarshal(*v, &name)
1648				if err != nil {
1649					return err
1650				}
1651				do.Name = &name
1652			}
1653		case "type":
1654			if v != nil {
1655				var typeVar string
1656				err = json.Unmarshal(*v, &typeVar)
1657				if err != nil {
1658					return err
1659				}
1660				do.Type = &typeVar
1661			}
1662		}
1663	}
1664
1665	return nil
1666}
1667
1668// DatabaseOperationListResult the response to a list database operations request
1669type DatabaseOperationListResult struct {
1670	autorest.Response `json:"-"`
1671	// Value - READ-ONLY; Array of results.
1672	Value *[]DatabaseOperation `json:"value,omitempty"`
1673	// NextLink - READ-ONLY; Link to retrieve next page of results.
1674	NextLink *string `json:"nextLink,omitempty"`
1675}
1676
1677// DatabaseOperationListResultIterator provides access to a complete listing of DatabaseOperation values.
1678type DatabaseOperationListResultIterator struct {
1679	i    int
1680	page DatabaseOperationListResultPage
1681}
1682
1683// NextWithContext advances to the next value.  If there was an error making
1684// the request the iterator does not advance and the error is returned.
1685func (iter *DatabaseOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1686	if tracing.IsEnabled() {
1687		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseOperationListResultIterator.NextWithContext")
1688		defer func() {
1689			sc := -1
1690			if iter.Response().Response.Response != nil {
1691				sc = iter.Response().Response.Response.StatusCode
1692			}
1693			tracing.EndSpan(ctx, sc, err)
1694		}()
1695	}
1696	iter.i++
1697	if iter.i < len(iter.page.Values()) {
1698		return nil
1699	}
1700	err = iter.page.NextWithContext(ctx)
1701	if err != nil {
1702		iter.i--
1703		return err
1704	}
1705	iter.i = 0
1706	return nil
1707}
1708
1709// Next advances to the next value.  If there was an error making
1710// the request the iterator does not advance and the error is returned.
1711// Deprecated: Use NextWithContext() instead.
1712func (iter *DatabaseOperationListResultIterator) Next() error {
1713	return iter.NextWithContext(context.Background())
1714}
1715
1716// NotDone returns true if the enumeration should be started or is not yet complete.
1717func (iter DatabaseOperationListResultIterator) NotDone() bool {
1718	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1719}
1720
1721// Response returns the raw server response from the last page request.
1722func (iter DatabaseOperationListResultIterator) Response() DatabaseOperationListResult {
1723	return iter.page.Response()
1724}
1725
1726// Value returns the current value or a zero-initialized value if the
1727// iterator has advanced beyond the end of the collection.
1728func (iter DatabaseOperationListResultIterator) Value() DatabaseOperation {
1729	if !iter.page.NotDone() {
1730		return DatabaseOperation{}
1731	}
1732	return iter.page.Values()[iter.i]
1733}
1734
1735// Creates a new instance of the DatabaseOperationListResultIterator type.
1736func NewDatabaseOperationListResultIterator(page DatabaseOperationListResultPage) DatabaseOperationListResultIterator {
1737	return DatabaseOperationListResultIterator{page: page}
1738}
1739
1740// IsEmpty returns true if the ListResult contains no values.
1741func (dolr DatabaseOperationListResult) IsEmpty() bool {
1742	return dolr.Value == nil || len(*dolr.Value) == 0
1743}
1744
1745// hasNextLink returns true if the NextLink is not empty.
1746func (dolr DatabaseOperationListResult) hasNextLink() bool {
1747	return dolr.NextLink != nil && len(*dolr.NextLink) != 0
1748}
1749
1750// databaseOperationListResultPreparer prepares a request to retrieve the next set of results.
1751// It returns nil if no more results exist.
1752func (dolr DatabaseOperationListResult) databaseOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
1753	if !dolr.hasNextLink() {
1754		return nil, nil
1755	}
1756	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1757		autorest.AsJSON(),
1758		autorest.AsGet(),
1759		autorest.WithBaseURL(to.String(dolr.NextLink)))
1760}
1761
1762// DatabaseOperationListResultPage contains a page of DatabaseOperation values.
1763type DatabaseOperationListResultPage struct {
1764	fn   func(context.Context, DatabaseOperationListResult) (DatabaseOperationListResult, error)
1765	dolr DatabaseOperationListResult
1766}
1767
1768// NextWithContext advances to the next page of values.  If there was an error making
1769// the request the page does not advance and the error is returned.
1770func (page *DatabaseOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
1771	if tracing.IsEnabled() {
1772		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseOperationListResultPage.NextWithContext")
1773		defer func() {
1774			sc := -1
1775			if page.Response().Response.Response != nil {
1776				sc = page.Response().Response.Response.StatusCode
1777			}
1778			tracing.EndSpan(ctx, sc, err)
1779		}()
1780	}
1781	for {
1782		next, err := page.fn(ctx, page.dolr)
1783		if err != nil {
1784			return err
1785		}
1786		page.dolr = next
1787		if !next.hasNextLink() || !next.IsEmpty() {
1788			break
1789		}
1790	}
1791	return nil
1792}
1793
1794// Next advances to the next page of values.  If there was an error making
1795// the request the page does not advance and the error is returned.
1796// Deprecated: Use NextWithContext() instead.
1797func (page *DatabaseOperationListResultPage) Next() error {
1798	return page.NextWithContext(context.Background())
1799}
1800
1801// NotDone returns true if the page enumeration should be started or is not yet complete.
1802func (page DatabaseOperationListResultPage) NotDone() bool {
1803	return !page.dolr.IsEmpty()
1804}
1805
1806// Response returns the raw server response from the last page request.
1807func (page DatabaseOperationListResultPage) Response() DatabaseOperationListResult {
1808	return page.dolr
1809}
1810
1811// Values returns the slice of values for the current page or nil if there are no values.
1812func (page DatabaseOperationListResultPage) Values() []DatabaseOperation {
1813	if page.dolr.IsEmpty() {
1814		return nil
1815	}
1816	return *page.dolr.Value
1817}
1818
1819// Creates a new instance of the DatabaseOperationListResultPage type.
1820func NewDatabaseOperationListResultPage(cur DatabaseOperationListResult, getNextPage func(context.Context, DatabaseOperationListResult) (DatabaseOperationListResult, error)) DatabaseOperationListResultPage {
1821	return DatabaseOperationListResultPage{
1822		fn:   getNextPage,
1823		dolr: cur,
1824	}
1825}
1826
1827// DatabaseOperationProperties the properties of a database operation.
1828type DatabaseOperationProperties struct {
1829	// DatabaseName - READ-ONLY; The name of the database the operation is being performed on.
1830	DatabaseName *string `json:"databaseName,omitempty"`
1831	// Operation - READ-ONLY; The name of operation.
1832	Operation *string `json:"operation,omitempty"`
1833	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
1834	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
1835	// PercentComplete - READ-ONLY; The percentage of the operation completed.
1836	PercentComplete *int32 `json:"percentComplete,omitempty"`
1837	// ServerName - READ-ONLY; The name of the server.
1838	ServerName *string `json:"serverName,omitempty"`
1839	// StartTime - READ-ONLY; The operation start time.
1840	StartTime *date.Time `json:"startTime,omitempty"`
1841	// State - READ-ONLY; The operation state. Possible values include: 'ManagementOperationStatePending', 'ManagementOperationStateInProgress', 'ManagementOperationStateSucceeded', 'ManagementOperationStateFailed', 'ManagementOperationStateCancelInProgress', 'ManagementOperationStateCancelled'
1842	State ManagementOperationState `json:"state,omitempty"`
1843	// ErrorCode - READ-ONLY; The operation error code.
1844	ErrorCode *int32 `json:"errorCode,omitempty"`
1845	// ErrorDescription - READ-ONLY; The operation error description.
1846	ErrorDescription *string `json:"errorDescription,omitempty"`
1847	// ErrorSeverity - READ-ONLY; The operation error severity.
1848	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
1849	// IsUserError - READ-ONLY; Whether or not the error is a user error.
1850	IsUserError *bool `json:"isUserError,omitempty"`
1851	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
1852	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
1853	// Description - READ-ONLY; The operation description.
1854	Description *string `json:"description,omitempty"`
1855	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
1856	IsCancellable *bool `json:"isCancellable,omitempty"`
1857}
1858
1859// DatabaseProperties the database's properties.
1860type DatabaseProperties struct {
1861	// CreateMode - Specifies the mode of database creation.
1862	//
1863	// Default: regular database creation.
1864	//
1865	// Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
1866	//
1867	// 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.
1868	//
1869	// 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.
1870	//
1871	// Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
1872	//
1873	// 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.
1874	//
1875	// RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
1876	//
1877	// Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: 'CreateModeDefault', 'CreateModeCopy', 'CreateModeSecondary', 'CreateModePointInTimeRestore', 'CreateModeRestore', 'CreateModeRecovery', 'CreateModeRestoreExternalBackup', 'CreateModeRestoreExternalBackupSecondary', 'CreateModeRestoreLongTermRetentionBackup', 'CreateModeOnlineSecondary'
1878	CreateMode CreateMode `json:"createMode,omitempty"`
1879	// Collation - The collation of the database.
1880	Collation *string `json:"collation,omitempty"`
1881	// MaxSizeBytes - The max size of the database expressed in bytes.
1882	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
1883	// SampleName - The name of the sample schema to apply when creating this database. Possible values include: 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull'
1884	SampleName SampleName `json:"sampleName,omitempty"`
1885	// ElasticPoolID - The resource identifier of the elastic pool containing this database.
1886	ElasticPoolID *string `json:"elasticPoolId,omitempty"`
1887	// SourceDatabaseID - The resource identifier of the source database associated with create operation of this database.
1888	SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`
1889	// 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'
1890	Status DatabaseStatus `json:"status,omitempty"`
1891	// DatabaseID - READ-ONLY; The ID of the database.
1892	DatabaseID *uuid.UUID `json:"databaseId,omitempty"`
1893	// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format).
1894	CreationDate *date.Time `json:"creationDate,omitempty"`
1895	// CurrentServiceObjectiveName - READ-ONLY; The current service level objective name of the database.
1896	CurrentServiceObjectiveName *string `json:"currentServiceObjectiveName,omitempty"`
1897	// RequestedServiceObjectiveName - READ-ONLY; The requested service level objective name of the database.
1898	RequestedServiceObjectiveName *string `json:"requestedServiceObjectiveName,omitempty"`
1899	// DefaultSecondaryLocation - READ-ONLY; The default secondary region for this database.
1900	DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"`
1901	// FailoverGroupID - READ-ONLY; Failover Group resource identifier that this database belongs to.
1902	FailoverGroupID *string `json:"failoverGroupId,omitempty"`
1903	// RestorePointInTime - Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
1904	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
1905	// SourceDatabaseDeletionDate - Specifies the time that the database was deleted.
1906	SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"`
1907	// RecoveryServicesRecoveryPointID - The resource identifier of the recovery point associated with create operation of this database.
1908	RecoveryServicesRecoveryPointID *string `json:"recoveryServicesRecoveryPointId,omitempty"`
1909	// LongTermRetentionBackupResourceID - The resource identifier of the long term retention backup associated with create operation of this database.
1910	LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"`
1911	// RecoverableDatabaseID - The resource identifier of the recoverable database associated with create operation of this database.
1912	RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"`
1913	// RestorableDroppedDatabaseID - The resource identifier of the restorable dropped database associated with create operation of this database.
1914	RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"`
1915	// CatalogCollation - Collation of the metadata catalog. Possible values include: 'DATABASEDEFAULT', 'SQLLatin1GeneralCP1CIAS'
1916	CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"`
1917	// ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
1918	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
1919	// 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'
1920	LicenseType DatabaseLicenseType `json:"licenseType,omitempty"`
1921	// MaxLogSizeBytes - READ-ONLY; The max log size for this database.
1922	MaxLogSizeBytes *int64 `json:"maxLogSizeBytes,omitempty"`
1923	// EarliestRestoreDate - READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format).
1924	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
1925	// 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'
1926	ReadScale DatabaseReadScale `json:"readScale,omitempty"`
1927	// ReadReplicaCount - The number of readonly secondary replicas associated with the database.
1928	ReadReplicaCount *int32 `json:"readReplicaCount,omitempty"`
1929	// CurrentSku - READ-ONLY; The name and tier of the SKU.
1930	CurrentSku *Sku `json:"currentSku,omitempty"`
1931	// AutoPauseDelay - Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
1932	AutoPauseDelay *int32 `json:"autoPauseDelay,omitempty"`
1933	// StorageAccountType - The storage account type used to store backups for this database. Possible values include: 'GRS', 'LRS', 'ZRS'
1934	StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"`
1935	// MinCapacity - Minimal capacity that database will always have allocated, if not paused
1936	MinCapacity *float64 `json:"minCapacity,omitempty"`
1937	// PausedDate - READ-ONLY; The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
1938	PausedDate *date.Time `json:"pausedDate,omitempty"`
1939	// ResumedDate - READ-ONLY; The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
1940	ResumedDate *date.Time `json:"resumedDate,omitempty"`
1941}
1942
1943// MarshalJSON is the custom marshaler for DatabaseProperties.
1944func (dp DatabaseProperties) MarshalJSON() ([]byte, error) {
1945	objectMap := make(map[string]interface{})
1946	if dp.CreateMode != "" {
1947		objectMap["createMode"] = dp.CreateMode
1948	}
1949	if dp.Collation != nil {
1950		objectMap["collation"] = dp.Collation
1951	}
1952	if dp.MaxSizeBytes != nil {
1953		objectMap["maxSizeBytes"] = dp.MaxSizeBytes
1954	}
1955	if dp.SampleName != "" {
1956		objectMap["sampleName"] = dp.SampleName
1957	}
1958	if dp.ElasticPoolID != nil {
1959		objectMap["elasticPoolId"] = dp.ElasticPoolID
1960	}
1961	if dp.SourceDatabaseID != nil {
1962		objectMap["sourceDatabaseId"] = dp.SourceDatabaseID
1963	}
1964	if dp.RestorePointInTime != nil {
1965		objectMap["restorePointInTime"] = dp.RestorePointInTime
1966	}
1967	if dp.SourceDatabaseDeletionDate != nil {
1968		objectMap["sourceDatabaseDeletionDate"] = dp.SourceDatabaseDeletionDate
1969	}
1970	if dp.RecoveryServicesRecoveryPointID != nil {
1971		objectMap["recoveryServicesRecoveryPointId"] = dp.RecoveryServicesRecoveryPointID
1972	}
1973	if dp.LongTermRetentionBackupResourceID != nil {
1974		objectMap["longTermRetentionBackupResourceId"] = dp.LongTermRetentionBackupResourceID
1975	}
1976	if dp.RecoverableDatabaseID != nil {
1977		objectMap["recoverableDatabaseId"] = dp.RecoverableDatabaseID
1978	}
1979	if dp.RestorableDroppedDatabaseID != nil {
1980		objectMap["restorableDroppedDatabaseId"] = dp.RestorableDroppedDatabaseID
1981	}
1982	if dp.CatalogCollation != "" {
1983		objectMap["catalogCollation"] = dp.CatalogCollation
1984	}
1985	if dp.ZoneRedundant != nil {
1986		objectMap["zoneRedundant"] = dp.ZoneRedundant
1987	}
1988	if dp.LicenseType != "" {
1989		objectMap["licenseType"] = dp.LicenseType
1990	}
1991	if dp.ReadScale != "" {
1992		objectMap["readScale"] = dp.ReadScale
1993	}
1994	if dp.ReadReplicaCount != nil {
1995		objectMap["readReplicaCount"] = dp.ReadReplicaCount
1996	}
1997	if dp.AutoPauseDelay != nil {
1998		objectMap["autoPauseDelay"] = dp.AutoPauseDelay
1999	}
2000	if dp.StorageAccountType != "" {
2001		objectMap["storageAccountType"] = dp.StorageAccountType
2002	}
2003	if dp.MinCapacity != nil {
2004		objectMap["minCapacity"] = dp.MinCapacity
2005	}
2006	return json.Marshal(objectMap)
2007}
2008
2009// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
2010// operation.
2011type DatabasesCreateOrUpdateFuture struct {
2012	azure.FutureAPI
2013	// Result returns the result of the asynchronous operation.
2014	// If the operation has not completed it will return an error.
2015	Result func(DatabasesClient) (Database, error)
2016}
2017
2018// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
2019// operation.
2020type DatabasesDeleteFuture struct {
2021	azure.FutureAPI
2022	// Result returns the result of the asynchronous operation.
2023	// If the operation has not completed it will return an error.
2024	Result func(DatabasesClient) (autorest.Response, error)
2025}
2026
2027// DatabaseSecurityAlertPolicy contains information about a database Threat Detection policy.
2028type DatabaseSecurityAlertPolicy struct {
2029	autorest.Response `json:"-"`
2030	// Location - The geo-location where the resource lives
2031	Location *string `json:"location,omitempty"`
2032	// Kind - READ-ONLY; Resource kind.
2033	Kind *string `json:"kind,omitempty"`
2034	// DatabaseSecurityAlertPolicyProperties - Properties of the security alert policy.
2035	*DatabaseSecurityAlertPolicyProperties `json:"properties,omitempty"`
2036	// ID - READ-ONLY; Resource ID.
2037	ID *string `json:"id,omitempty"`
2038	// Name - READ-ONLY; Resource name.
2039	Name *string `json:"name,omitempty"`
2040	// Type - READ-ONLY; Resource type.
2041	Type *string `json:"type,omitempty"`
2042}
2043
2044// MarshalJSON is the custom marshaler for DatabaseSecurityAlertPolicy.
2045func (dsap DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
2046	objectMap := make(map[string]interface{})
2047	if dsap.Location != nil {
2048		objectMap["location"] = dsap.Location
2049	}
2050	if dsap.DatabaseSecurityAlertPolicyProperties != nil {
2051		objectMap["properties"] = dsap.DatabaseSecurityAlertPolicyProperties
2052	}
2053	return json.Marshal(objectMap)
2054}
2055
2056// UnmarshalJSON is the custom unmarshaler for DatabaseSecurityAlertPolicy struct.
2057func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
2058	var m map[string]*json.RawMessage
2059	err := json.Unmarshal(body, &m)
2060	if err != nil {
2061		return err
2062	}
2063	for k, v := range m {
2064		switch k {
2065		case "location":
2066			if v != nil {
2067				var location string
2068				err = json.Unmarshal(*v, &location)
2069				if err != nil {
2070					return err
2071				}
2072				dsap.Location = &location
2073			}
2074		case "kind":
2075			if v != nil {
2076				var kind string
2077				err = json.Unmarshal(*v, &kind)
2078				if err != nil {
2079					return err
2080				}
2081				dsap.Kind = &kind
2082			}
2083		case "properties":
2084			if v != nil {
2085				var databaseSecurityAlertPolicyProperties DatabaseSecurityAlertPolicyProperties
2086				err = json.Unmarshal(*v, &databaseSecurityAlertPolicyProperties)
2087				if err != nil {
2088					return err
2089				}
2090				dsap.DatabaseSecurityAlertPolicyProperties = &databaseSecurityAlertPolicyProperties
2091			}
2092		case "id":
2093			if v != nil {
2094				var ID string
2095				err = json.Unmarshal(*v, &ID)
2096				if err != nil {
2097					return err
2098				}
2099				dsap.ID = &ID
2100			}
2101		case "name":
2102			if v != nil {
2103				var name string
2104				err = json.Unmarshal(*v, &name)
2105				if err != nil {
2106					return err
2107				}
2108				dsap.Name = &name
2109			}
2110		case "type":
2111			if v != nil {
2112				var typeVar string
2113				err = json.Unmarshal(*v, &typeVar)
2114				if err != nil {
2115					return err
2116				}
2117				dsap.Type = &typeVar
2118			}
2119		}
2120	}
2121
2122	return nil
2123}
2124
2125// DatabaseSecurityAlertPolicyProperties properties for a database Threat Detection policy.
2126type DatabaseSecurityAlertPolicyProperties struct {
2127	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled'
2128	State SecurityAlertPolicyState `json:"state,omitempty"`
2129	// 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.
2130	DisabledAlerts *string `json:"disabledAlerts,omitempty"`
2131	// EmailAddresses - Specifies the semicolon-separated list of e-mail addresses to which the alert is sent.
2132	EmailAddresses *string `json:"emailAddresses,omitempty"`
2133	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators. Possible values include: 'SecurityAlertPolicyEmailAccountAdminsEnabled', 'SecurityAlertPolicyEmailAccountAdminsDisabled'
2134	EmailAccountAdmins SecurityAlertPolicyEmailAccountAdmins `json:"emailAccountAdmins,omitempty"`
2135	// 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.
2136	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
2137	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. If state is Enabled, storageAccountAccessKey is required.
2138	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
2139	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
2140	RetentionDays *int32 `json:"retentionDays,omitempty"`
2141	// UseServerDefault - Specifies whether to use the default server policy. Possible values include: 'SecurityAlertPolicyUseServerDefaultEnabled', 'SecurityAlertPolicyUseServerDefaultDisabled'
2142	UseServerDefault SecurityAlertPolicyUseServerDefault `json:"useServerDefault,omitempty"`
2143}
2144
2145// DatabasesExportFuture an abstraction for monitoring and retrieving the results of a long-running
2146// operation.
2147type DatabasesExportFuture struct {
2148	azure.FutureAPI
2149	// Result returns the result of the asynchronous operation.
2150	// If the operation has not completed it will return an error.
2151	Result func(DatabasesClient) (ImportExportOperationResult, error)
2152}
2153
2154// DatabasesFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
2155// operation.
2156type DatabasesFailoverFuture struct {
2157	azure.FutureAPI
2158	// Result returns the result of the asynchronous operation.
2159	// If the operation has not completed it will return an error.
2160	Result func(DatabasesClient) (autorest.Response, error)
2161}
2162
2163// DatabasesPauseFuture an abstraction for monitoring and retrieving the results of a long-running
2164// operation.
2165type DatabasesPauseFuture struct {
2166	azure.FutureAPI
2167	// Result returns the result of the asynchronous operation.
2168	// If the operation has not completed it will return an error.
2169	Result func(DatabasesClient) (Database, error)
2170}
2171
2172// DatabasesResumeFuture an abstraction for monitoring and retrieving the results of a long-running
2173// operation.
2174type DatabasesResumeFuture struct {
2175	azure.FutureAPI
2176	// Result returns the result of the asynchronous operation.
2177	// If the operation has not completed it will return an error.
2178	Result func(DatabasesClient) (Database, error)
2179}
2180
2181// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
2182// operation.
2183type DatabasesUpdateFuture struct {
2184	azure.FutureAPI
2185	// Result returns the result of the asynchronous operation.
2186	// If the operation has not completed it will return an error.
2187	Result func(DatabasesClient) (Database, error)
2188}
2189
2190// DatabasesUpgradeDataWarehouseFuture an abstraction for monitoring and retrieving the results of a
2191// long-running operation.
2192type DatabasesUpgradeDataWarehouseFuture struct {
2193	azure.FutureAPI
2194	// Result returns the result of the asynchronous operation.
2195	// If the operation has not completed it will return an error.
2196	Result func(DatabasesClient) (autorest.Response, error)
2197}
2198
2199// DatabaseUpdate a database resource.
2200type DatabaseUpdate struct {
2201	// Sku - The name and tier of the SKU.
2202	Sku *Sku `json:"sku,omitempty"`
2203	// DatabaseProperties - Resource properties.
2204	*DatabaseProperties `json:"properties,omitempty"`
2205	// Tags - Resource tags.
2206	Tags map[string]*string `json:"tags"`
2207}
2208
2209// MarshalJSON is the custom marshaler for DatabaseUpdate.
2210func (du DatabaseUpdate) MarshalJSON() ([]byte, error) {
2211	objectMap := make(map[string]interface{})
2212	if du.Sku != nil {
2213		objectMap["sku"] = du.Sku
2214	}
2215	if du.DatabaseProperties != nil {
2216		objectMap["properties"] = du.DatabaseProperties
2217	}
2218	if du.Tags != nil {
2219		objectMap["tags"] = du.Tags
2220	}
2221	return json.Marshal(objectMap)
2222}
2223
2224// UnmarshalJSON is the custom unmarshaler for DatabaseUpdate struct.
2225func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error {
2226	var m map[string]*json.RawMessage
2227	err := json.Unmarshal(body, &m)
2228	if err != nil {
2229		return err
2230	}
2231	for k, v := range m {
2232		switch k {
2233		case "sku":
2234			if v != nil {
2235				var sku Sku
2236				err = json.Unmarshal(*v, &sku)
2237				if err != nil {
2238					return err
2239				}
2240				du.Sku = &sku
2241			}
2242		case "properties":
2243			if v != nil {
2244				var databaseProperties DatabaseProperties
2245				err = json.Unmarshal(*v, &databaseProperties)
2246				if err != nil {
2247					return err
2248				}
2249				du.DatabaseProperties = &databaseProperties
2250			}
2251		case "tags":
2252			if v != nil {
2253				var tags map[string]*string
2254				err = json.Unmarshal(*v, &tags)
2255				if err != nil {
2256					return err
2257				}
2258				du.Tags = tags
2259			}
2260		}
2261	}
2262
2263	return nil
2264}
2265
2266// DatabaseUsage the database usages.
2267type DatabaseUsage struct {
2268	// Name - READ-ONLY; The name of the usage metric.
2269	Name *string `json:"name,omitempty"`
2270	// ResourceName - READ-ONLY; The name of the resource.
2271	ResourceName *string `json:"resourceName,omitempty"`
2272	// DisplayName - READ-ONLY; The usage metric display name.
2273	DisplayName *string `json:"displayName,omitempty"`
2274	// CurrentValue - READ-ONLY; The current value of the usage metric.
2275	CurrentValue *float64 `json:"currentValue,omitempty"`
2276	// Limit - READ-ONLY; The current limit of the usage metric.
2277	Limit *float64 `json:"limit,omitempty"`
2278	// Unit - READ-ONLY; The units of the usage metric.
2279	Unit *string `json:"unit,omitempty"`
2280	// NextResetTime - READ-ONLY; The next reset time for the usage metric (ISO8601 format).
2281	NextResetTime *date.Time `json:"nextResetTime,omitempty"`
2282}
2283
2284// DatabaseUsageListResult the response to a list database metrics request.
2285type DatabaseUsageListResult struct {
2286	autorest.Response `json:"-"`
2287	// Value - The list of database usages for the database.
2288	Value *[]DatabaseUsage `json:"value,omitempty"`
2289}
2290
2291// DatabaseVulnerabilityAssessment a database vulnerability assessment.
2292type DatabaseVulnerabilityAssessment struct {
2293	autorest.Response `json:"-"`
2294	// DatabaseVulnerabilityAssessmentProperties - Resource properties.
2295	*DatabaseVulnerabilityAssessmentProperties `json:"properties,omitempty"`
2296	// ID - READ-ONLY; Resource ID.
2297	ID *string `json:"id,omitempty"`
2298	// Name - READ-ONLY; Resource name.
2299	Name *string `json:"name,omitempty"`
2300	// Type - READ-ONLY; Resource type.
2301	Type *string `json:"type,omitempty"`
2302}
2303
2304// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessment.
2305func (dva DatabaseVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
2306	objectMap := make(map[string]interface{})
2307	if dva.DatabaseVulnerabilityAssessmentProperties != nil {
2308		objectMap["properties"] = dva.DatabaseVulnerabilityAssessmentProperties
2309	}
2310	return json.Marshal(objectMap)
2311}
2312
2313// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessment struct.
2314func (dva *DatabaseVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
2315	var m map[string]*json.RawMessage
2316	err := json.Unmarshal(body, &m)
2317	if err != nil {
2318		return err
2319	}
2320	for k, v := range m {
2321		switch k {
2322		case "properties":
2323			if v != nil {
2324				var databaseVulnerabilityAssessmentProperties DatabaseVulnerabilityAssessmentProperties
2325				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentProperties)
2326				if err != nil {
2327					return err
2328				}
2329				dva.DatabaseVulnerabilityAssessmentProperties = &databaseVulnerabilityAssessmentProperties
2330			}
2331		case "id":
2332			if v != nil {
2333				var ID string
2334				err = json.Unmarshal(*v, &ID)
2335				if err != nil {
2336					return err
2337				}
2338				dva.ID = &ID
2339			}
2340		case "name":
2341			if v != nil {
2342				var name string
2343				err = json.Unmarshal(*v, &name)
2344				if err != nil {
2345					return err
2346				}
2347				dva.Name = &name
2348			}
2349		case "type":
2350			if v != nil {
2351				var typeVar string
2352				err = json.Unmarshal(*v, &typeVar)
2353				if err != nil {
2354					return err
2355				}
2356				dva.Type = &typeVar
2357			}
2358		}
2359	}
2360
2361	return nil
2362}
2363
2364// DatabaseVulnerabilityAssessmentListResult a list of the database's vulnerability assessments.
2365type DatabaseVulnerabilityAssessmentListResult struct {
2366	autorest.Response `json:"-"`
2367	// Value - READ-ONLY; Array of results.
2368	Value *[]DatabaseVulnerabilityAssessment `json:"value,omitempty"`
2369	// NextLink - READ-ONLY; Link to retrieve next page of results.
2370	NextLink *string `json:"nextLink,omitempty"`
2371}
2372
2373// DatabaseVulnerabilityAssessmentListResultIterator provides access to a complete listing of
2374// DatabaseVulnerabilityAssessment values.
2375type DatabaseVulnerabilityAssessmentListResultIterator struct {
2376	i    int
2377	page DatabaseVulnerabilityAssessmentListResultPage
2378}
2379
2380// NextWithContext advances to the next value.  If there was an error making
2381// the request the iterator does not advance and the error is returned.
2382func (iter *DatabaseVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
2383	if tracing.IsEnabled() {
2384		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentListResultIterator.NextWithContext")
2385		defer func() {
2386			sc := -1
2387			if iter.Response().Response.Response != nil {
2388				sc = iter.Response().Response.Response.StatusCode
2389			}
2390			tracing.EndSpan(ctx, sc, err)
2391		}()
2392	}
2393	iter.i++
2394	if iter.i < len(iter.page.Values()) {
2395		return nil
2396	}
2397	err = iter.page.NextWithContext(ctx)
2398	if err != nil {
2399		iter.i--
2400		return err
2401	}
2402	iter.i = 0
2403	return nil
2404}
2405
2406// Next advances to the next value.  If there was an error making
2407// the request the iterator does not advance and the error is returned.
2408// Deprecated: Use NextWithContext() instead.
2409func (iter *DatabaseVulnerabilityAssessmentListResultIterator) Next() error {
2410	return iter.NextWithContext(context.Background())
2411}
2412
2413// NotDone returns true if the enumeration should be started or is not yet complete.
2414func (iter DatabaseVulnerabilityAssessmentListResultIterator) NotDone() bool {
2415	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2416}
2417
2418// Response returns the raw server response from the last page request.
2419func (iter DatabaseVulnerabilityAssessmentListResultIterator) Response() DatabaseVulnerabilityAssessmentListResult {
2420	return iter.page.Response()
2421}
2422
2423// Value returns the current value or a zero-initialized value if the
2424// iterator has advanced beyond the end of the collection.
2425func (iter DatabaseVulnerabilityAssessmentListResultIterator) Value() DatabaseVulnerabilityAssessment {
2426	if !iter.page.NotDone() {
2427		return DatabaseVulnerabilityAssessment{}
2428	}
2429	return iter.page.Values()[iter.i]
2430}
2431
2432// Creates a new instance of the DatabaseVulnerabilityAssessmentListResultIterator type.
2433func NewDatabaseVulnerabilityAssessmentListResultIterator(page DatabaseVulnerabilityAssessmentListResultPage) DatabaseVulnerabilityAssessmentListResultIterator {
2434	return DatabaseVulnerabilityAssessmentListResultIterator{page: page}
2435}
2436
2437// IsEmpty returns true if the ListResult contains no values.
2438func (dvalr DatabaseVulnerabilityAssessmentListResult) IsEmpty() bool {
2439	return dvalr.Value == nil || len(*dvalr.Value) == 0
2440}
2441
2442// hasNextLink returns true if the NextLink is not empty.
2443func (dvalr DatabaseVulnerabilityAssessmentListResult) hasNextLink() bool {
2444	return dvalr.NextLink != nil && len(*dvalr.NextLink) != 0
2445}
2446
2447// databaseVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
2448// It returns nil if no more results exist.
2449func (dvalr DatabaseVulnerabilityAssessmentListResult) databaseVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
2450	if !dvalr.hasNextLink() {
2451		return nil, nil
2452	}
2453	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2454		autorest.AsJSON(),
2455		autorest.AsGet(),
2456		autorest.WithBaseURL(to.String(dvalr.NextLink)))
2457}
2458
2459// DatabaseVulnerabilityAssessmentListResultPage contains a page of DatabaseVulnerabilityAssessment values.
2460type DatabaseVulnerabilityAssessmentListResultPage struct {
2461	fn    func(context.Context, DatabaseVulnerabilityAssessmentListResult) (DatabaseVulnerabilityAssessmentListResult, error)
2462	dvalr DatabaseVulnerabilityAssessmentListResult
2463}
2464
2465// NextWithContext advances to the next page of values.  If there was an error making
2466// the request the page does not advance and the error is returned.
2467func (page *DatabaseVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
2468	if tracing.IsEnabled() {
2469		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentListResultPage.NextWithContext")
2470		defer func() {
2471			sc := -1
2472			if page.Response().Response.Response != nil {
2473				sc = page.Response().Response.Response.StatusCode
2474			}
2475			tracing.EndSpan(ctx, sc, err)
2476		}()
2477	}
2478	for {
2479		next, err := page.fn(ctx, page.dvalr)
2480		if err != nil {
2481			return err
2482		}
2483		page.dvalr = next
2484		if !next.hasNextLink() || !next.IsEmpty() {
2485			break
2486		}
2487	}
2488	return nil
2489}
2490
2491// Next advances to the next page of values.  If there was an error making
2492// the request the page does not advance and the error is returned.
2493// Deprecated: Use NextWithContext() instead.
2494func (page *DatabaseVulnerabilityAssessmentListResultPage) Next() error {
2495	return page.NextWithContext(context.Background())
2496}
2497
2498// NotDone returns true if the page enumeration should be started or is not yet complete.
2499func (page DatabaseVulnerabilityAssessmentListResultPage) NotDone() bool {
2500	return !page.dvalr.IsEmpty()
2501}
2502
2503// Response returns the raw server response from the last page request.
2504func (page DatabaseVulnerabilityAssessmentListResultPage) Response() DatabaseVulnerabilityAssessmentListResult {
2505	return page.dvalr
2506}
2507
2508// Values returns the slice of values for the current page or nil if there are no values.
2509func (page DatabaseVulnerabilityAssessmentListResultPage) Values() []DatabaseVulnerabilityAssessment {
2510	if page.dvalr.IsEmpty() {
2511		return nil
2512	}
2513	return *page.dvalr.Value
2514}
2515
2516// Creates a new instance of the DatabaseVulnerabilityAssessmentListResultPage type.
2517func NewDatabaseVulnerabilityAssessmentListResultPage(cur DatabaseVulnerabilityAssessmentListResult, getNextPage func(context.Context, DatabaseVulnerabilityAssessmentListResult) (DatabaseVulnerabilityAssessmentListResult, error)) DatabaseVulnerabilityAssessmentListResultPage {
2518	return DatabaseVulnerabilityAssessmentListResultPage{
2519		fn:    getNextPage,
2520		dvalr: cur,
2521	}
2522}
2523
2524// DatabaseVulnerabilityAssessmentProperties properties of a database Vulnerability Assessment.
2525type DatabaseVulnerabilityAssessmentProperties struct {
2526	// 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
2527	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
2528	// 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.
2529	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
2530	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
2531	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
2532	// RecurringScans - The recurring scans settings
2533	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
2534}
2535
2536// DatabaseVulnerabilityAssessmentRuleBaseline a database vulnerability assessment rule baseline.
2537type DatabaseVulnerabilityAssessmentRuleBaseline struct {
2538	autorest.Response `json:"-"`
2539	// DatabaseVulnerabilityAssessmentRuleBaselineProperties - Resource properties.
2540	*DatabaseVulnerabilityAssessmentRuleBaselineProperties `json:"properties,omitempty"`
2541	// ID - READ-ONLY; Resource ID.
2542	ID *string `json:"id,omitempty"`
2543	// Name - READ-ONLY; Resource name.
2544	Name *string `json:"name,omitempty"`
2545	// Type - READ-ONLY; Resource type.
2546	Type *string `json:"type,omitempty"`
2547}
2548
2549// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentRuleBaseline.
2550func (dvarb DatabaseVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) {
2551	objectMap := make(map[string]interface{})
2552	if dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties != nil {
2553		objectMap["properties"] = dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties
2554	}
2555	return json.Marshal(objectMap)
2556}
2557
2558// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessmentRuleBaseline struct.
2559func (dvarb *DatabaseVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(body []byte) error {
2560	var m map[string]*json.RawMessage
2561	err := json.Unmarshal(body, &m)
2562	if err != nil {
2563		return err
2564	}
2565	for k, v := range m {
2566		switch k {
2567		case "properties":
2568			if v != nil {
2569				var databaseVulnerabilityAssessmentRuleBaselineProperties DatabaseVulnerabilityAssessmentRuleBaselineProperties
2570				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentRuleBaselineProperties)
2571				if err != nil {
2572					return err
2573				}
2574				dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties = &databaseVulnerabilityAssessmentRuleBaselineProperties
2575			}
2576		case "id":
2577			if v != nil {
2578				var ID string
2579				err = json.Unmarshal(*v, &ID)
2580				if err != nil {
2581					return err
2582				}
2583				dvarb.ID = &ID
2584			}
2585		case "name":
2586			if v != nil {
2587				var name string
2588				err = json.Unmarshal(*v, &name)
2589				if err != nil {
2590					return err
2591				}
2592				dvarb.Name = &name
2593			}
2594		case "type":
2595			if v != nil {
2596				var typeVar string
2597				err = json.Unmarshal(*v, &typeVar)
2598				if err != nil {
2599					return err
2600				}
2601				dvarb.Type = &typeVar
2602			}
2603		}
2604	}
2605
2606	return nil
2607}
2608
2609// DatabaseVulnerabilityAssessmentRuleBaselineItem properties for an Azure SQL Database Vulnerability
2610// Assessment rule baseline's result.
2611type DatabaseVulnerabilityAssessmentRuleBaselineItem struct {
2612	// Result - The rule baseline result
2613	Result *[]string `json:"result,omitempty"`
2614}
2615
2616// DatabaseVulnerabilityAssessmentRuleBaselineProperties properties of a database Vulnerability Assessment
2617// rule baseline.
2618type DatabaseVulnerabilityAssessmentRuleBaselineProperties struct {
2619	// BaselineResults - The rule baseline result
2620	BaselineResults *[]DatabaseVulnerabilityAssessmentRuleBaselineItem `json:"baselineResults,omitempty"`
2621}
2622
2623// DatabaseVulnerabilityAssessmentScanExportProperties properties of the export operation's result.
2624type DatabaseVulnerabilityAssessmentScanExportProperties struct {
2625	// ExportedReportLocation - READ-ONLY; Location of the exported report (e.g. https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx).
2626	ExportedReportLocation *string `json:"exportedReportLocation,omitempty"`
2627}
2628
2629// DatabaseVulnerabilityAssessmentScansExport a database Vulnerability Assessment scan export resource.
2630type DatabaseVulnerabilityAssessmentScansExport struct {
2631	autorest.Response `json:"-"`
2632	// DatabaseVulnerabilityAssessmentScanExportProperties - Resource properties.
2633	*DatabaseVulnerabilityAssessmentScanExportProperties `json:"properties,omitempty"`
2634	// ID - READ-ONLY; Resource ID.
2635	ID *string `json:"id,omitempty"`
2636	// Name - READ-ONLY; Resource name.
2637	Name *string `json:"name,omitempty"`
2638	// Type - READ-ONLY; Resource type.
2639	Type *string `json:"type,omitempty"`
2640}
2641
2642// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentScansExport.
2643func (dvase DatabaseVulnerabilityAssessmentScansExport) MarshalJSON() ([]byte, error) {
2644	objectMap := make(map[string]interface{})
2645	if dvase.DatabaseVulnerabilityAssessmentScanExportProperties != nil {
2646		objectMap["properties"] = dvase.DatabaseVulnerabilityAssessmentScanExportProperties
2647	}
2648	return json.Marshal(objectMap)
2649}
2650
2651// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessmentScansExport struct.
2652func (dvase *DatabaseVulnerabilityAssessmentScansExport) UnmarshalJSON(body []byte) error {
2653	var m map[string]*json.RawMessage
2654	err := json.Unmarshal(body, &m)
2655	if err != nil {
2656		return err
2657	}
2658	for k, v := range m {
2659		switch k {
2660		case "properties":
2661			if v != nil {
2662				var databaseVulnerabilityAssessmentScanExportProperties DatabaseVulnerabilityAssessmentScanExportProperties
2663				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentScanExportProperties)
2664				if err != nil {
2665					return err
2666				}
2667				dvase.DatabaseVulnerabilityAssessmentScanExportProperties = &databaseVulnerabilityAssessmentScanExportProperties
2668			}
2669		case "id":
2670			if v != nil {
2671				var ID string
2672				err = json.Unmarshal(*v, &ID)
2673				if err != nil {
2674					return err
2675				}
2676				dvase.ID = &ID
2677			}
2678		case "name":
2679			if v != nil {
2680				var name string
2681				err = json.Unmarshal(*v, &name)
2682				if err != nil {
2683					return err
2684				}
2685				dvase.Name = &name
2686			}
2687		case "type":
2688			if v != nil {
2689				var typeVar string
2690				err = json.Unmarshal(*v, &typeVar)
2691				if err != nil {
2692					return err
2693				}
2694				dvase.Type = &typeVar
2695			}
2696		}
2697	}
2698
2699	return nil
2700}
2701
2702// DatabaseVulnerabilityAssessmentScansInitiateScanFuture an abstraction for monitoring and retrieving the
2703// results of a long-running operation.
2704type DatabaseVulnerabilityAssessmentScansInitiateScanFuture struct {
2705	azure.FutureAPI
2706	// Result returns the result of the asynchronous operation.
2707	// If the operation has not completed it will return an error.
2708	Result func(DatabaseVulnerabilityAssessmentScansClient) (autorest.Response, error)
2709}
2710
2711// DataMaskingPolicy represents a database data masking policy.
2712type DataMaskingPolicy struct {
2713	autorest.Response `json:"-"`
2714	// DataMaskingPolicyProperties - The properties of the data masking policy.
2715	*DataMaskingPolicyProperties `json:"properties,omitempty"`
2716	// Location - READ-ONLY; The location of the data masking policy.
2717	Location *string `json:"location,omitempty"`
2718	// Kind - READ-ONLY; The kind of data masking policy. Metadata, used for Azure portal.
2719	Kind *string `json:"kind,omitempty"`
2720	// ID - READ-ONLY; Resource ID.
2721	ID *string `json:"id,omitempty"`
2722	// Name - READ-ONLY; Resource name.
2723	Name *string `json:"name,omitempty"`
2724	// Type - READ-ONLY; Resource type.
2725	Type *string `json:"type,omitempty"`
2726}
2727
2728// MarshalJSON is the custom marshaler for DataMaskingPolicy.
2729func (dmp DataMaskingPolicy) MarshalJSON() ([]byte, error) {
2730	objectMap := make(map[string]interface{})
2731	if dmp.DataMaskingPolicyProperties != nil {
2732		objectMap["properties"] = dmp.DataMaskingPolicyProperties
2733	}
2734	return json.Marshal(objectMap)
2735}
2736
2737// UnmarshalJSON is the custom unmarshaler for DataMaskingPolicy struct.
2738func (dmp *DataMaskingPolicy) UnmarshalJSON(body []byte) error {
2739	var m map[string]*json.RawMessage
2740	err := json.Unmarshal(body, &m)
2741	if err != nil {
2742		return err
2743	}
2744	for k, v := range m {
2745		switch k {
2746		case "properties":
2747			if v != nil {
2748				var dataMaskingPolicyProperties DataMaskingPolicyProperties
2749				err = json.Unmarshal(*v, &dataMaskingPolicyProperties)
2750				if err != nil {
2751					return err
2752				}
2753				dmp.DataMaskingPolicyProperties = &dataMaskingPolicyProperties
2754			}
2755		case "location":
2756			if v != nil {
2757				var location string
2758				err = json.Unmarshal(*v, &location)
2759				if err != nil {
2760					return err
2761				}
2762				dmp.Location = &location
2763			}
2764		case "kind":
2765			if v != nil {
2766				var kind string
2767				err = json.Unmarshal(*v, &kind)
2768				if err != nil {
2769					return err
2770				}
2771				dmp.Kind = &kind
2772			}
2773		case "id":
2774			if v != nil {
2775				var ID string
2776				err = json.Unmarshal(*v, &ID)
2777				if err != nil {
2778					return err
2779				}
2780				dmp.ID = &ID
2781			}
2782		case "name":
2783			if v != nil {
2784				var name string
2785				err = json.Unmarshal(*v, &name)
2786				if err != nil {
2787					return err
2788				}
2789				dmp.Name = &name
2790			}
2791		case "type":
2792			if v != nil {
2793				var typeVar string
2794				err = json.Unmarshal(*v, &typeVar)
2795				if err != nil {
2796					return err
2797				}
2798				dmp.Type = &typeVar
2799			}
2800		}
2801	}
2802
2803	return nil
2804}
2805
2806// DataMaskingPolicyProperties the properties of a database data masking policy.
2807type DataMaskingPolicyProperties struct {
2808	// DataMaskingState - The state of the data masking policy. Possible values include: 'DataMaskingStateDisabled', 'DataMaskingStateEnabled'
2809	DataMaskingState DataMaskingState `json:"dataMaskingState,omitempty"`
2810	// 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.
2811	ExemptPrincipals *string `json:"exemptPrincipals,omitempty"`
2812	// ApplicationPrincipals - READ-ONLY; The list of the application principals. This is a legacy parameter and is no longer used.
2813	ApplicationPrincipals *string `json:"applicationPrincipals,omitempty"`
2814	// MaskingLevel - READ-ONLY; The masking level. This is a legacy parameter and is no longer used.
2815	MaskingLevel *string `json:"maskingLevel,omitempty"`
2816}
2817
2818// MarshalJSON is the custom marshaler for DataMaskingPolicyProperties.
2819func (dmpp DataMaskingPolicyProperties) MarshalJSON() ([]byte, error) {
2820	objectMap := make(map[string]interface{})
2821	if dmpp.DataMaskingState != "" {
2822		objectMap["dataMaskingState"] = dmpp.DataMaskingState
2823	}
2824	if dmpp.ExemptPrincipals != nil {
2825		objectMap["exemptPrincipals"] = dmpp.ExemptPrincipals
2826	}
2827	return json.Marshal(objectMap)
2828}
2829
2830// DataMaskingRule represents a database data masking rule.
2831type DataMaskingRule struct {
2832	autorest.Response `json:"-"`
2833	// DataMaskingRuleProperties - The properties of the resource.
2834	*DataMaskingRuleProperties `json:"properties,omitempty"`
2835	// Location - READ-ONLY; The location of the data masking rule.
2836	Location *string `json:"location,omitempty"`
2837	// Kind - READ-ONLY; The kind of Data Masking Rule. Metadata, used for Azure portal.
2838	Kind *string `json:"kind,omitempty"`
2839	// ID - READ-ONLY; Resource ID.
2840	ID *string `json:"id,omitempty"`
2841	// Name - READ-ONLY; Resource name.
2842	Name *string `json:"name,omitempty"`
2843	// Type - READ-ONLY; Resource type.
2844	Type *string `json:"type,omitempty"`
2845}
2846
2847// MarshalJSON is the custom marshaler for DataMaskingRule.
2848func (dmr DataMaskingRule) MarshalJSON() ([]byte, error) {
2849	objectMap := make(map[string]interface{})
2850	if dmr.DataMaskingRuleProperties != nil {
2851		objectMap["properties"] = dmr.DataMaskingRuleProperties
2852	}
2853	return json.Marshal(objectMap)
2854}
2855
2856// UnmarshalJSON is the custom unmarshaler for DataMaskingRule struct.
2857func (dmr *DataMaskingRule) UnmarshalJSON(body []byte) error {
2858	var m map[string]*json.RawMessage
2859	err := json.Unmarshal(body, &m)
2860	if err != nil {
2861		return err
2862	}
2863	for k, v := range m {
2864		switch k {
2865		case "properties":
2866			if v != nil {
2867				var dataMaskingRuleProperties DataMaskingRuleProperties
2868				err = json.Unmarshal(*v, &dataMaskingRuleProperties)
2869				if err != nil {
2870					return err
2871				}
2872				dmr.DataMaskingRuleProperties = &dataMaskingRuleProperties
2873			}
2874		case "location":
2875			if v != nil {
2876				var location string
2877				err = json.Unmarshal(*v, &location)
2878				if err != nil {
2879					return err
2880				}
2881				dmr.Location = &location
2882			}
2883		case "kind":
2884			if v != nil {
2885				var kind string
2886				err = json.Unmarshal(*v, &kind)
2887				if err != nil {
2888					return err
2889				}
2890				dmr.Kind = &kind
2891			}
2892		case "id":
2893			if v != nil {
2894				var ID string
2895				err = json.Unmarshal(*v, &ID)
2896				if err != nil {
2897					return err
2898				}
2899				dmr.ID = &ID
2900			}
2901		case "name":
2902			if v != nil {
2903				var name string
2904				err = json.Unmarshal(*v, &name)
2905				if err != nil {
2906					return err
2907				}
2908				dmr.Name = &name
2909			}
2910		case "type":
2911			if v != nil {
2912				var typeVar string
2913				err = json.Unmarshal(*v, &typeVar)
2914				if err != nil {
2915					return err
2916				}
2917				dmr.Type = &typeVar
2918			}
2919		}
2920	}
2921
2922	return nil
2923}
2924
2925// DataMaskingRuleListResult the response to a list data masking rules request.
2926type DataMaskingRuleListResult struct {
2927	autorest.Response `json:"-"`
2928	// Value - The list of database data masking rules.
2929	Value *[]DataMaskingRule `json:"value,omitempty"`
2930}
2931
2932// DataMaskingRuleProperties the properties of a database data masking rule.
2933type DataMaskingRuleProperties struct {
2934	// ID - READ-ONLY; The rule Id.
2935	ID *string `json:"id,omitempty"`
2936	// AliasName - The alias name. This is a legacy parameter and is no longer used.
2937	AliasName *string `json:"aliasName,omitempty"`
2938	// 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'
2939	RuleState DataMaskingRuleState `json:"ruleState,omitempty"`
2940	// SchemaName - The schema name on which the data masking rule is applied.
2941	SchemaName *string `json:"schemaName,omitempty"`
2942	// TableName - The table name on which the data masking rule is applied.
2943	TableName *string `json:"tableName,omitempty"`
2944	// ColumnName - The column name on which the data masking rule is applied.
2945	ColumnName *string `json:"columnName,omitempty"`
2946	// MaskingFunction - The masking function that is used for the data masking rule. Possible values include: 'DataMaskingFunctionDefault', 'DataMaskingFunctionCCN', 'DataMaskingFunctionEmail', 'DataMaskingFunctionNumber', 'DataMaskingFunctionSSN', 'DataMaskingFunctionText'
2947	MaskingFunction DataMaskingFunction `json:"maskingFunction,omitempty"`
2948	// NumberFrom - The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
2949	NumberFrom *string `json:"numberFrom,omitempty"`
2950	// NumberTo - The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
2951	NumberTo *string `json:"numberTo,omitempty"`
2952	// 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.
2953	PrefixSize *string `json:"prefixSize,omitempty"`
2954	// 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.
2955	SuffixSize *string `json:"suffixSize,omitempty"`
2956	// 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.
2957	ReplacementString *string `json:"replacementString,omitempty"`
2958}
2959
2960// MarshalJSON is the custom marshaler for DataMaskingRuleProperties.
2961func (dmrp DataMaskingRuleProperties) MarshalJSON() ([]byte, error) {
2962	objectMap := make(map[string]interface{})
2963	if dmrp.AliasName != nil {
2964		objectMap["aliasName"] = dmrp.AliasName
2965	}
2966	if dmrp.RuleState != "" {
2967		objectMap["ruleState"] = dmrp.RuleState
2968	}
2969	if dmrp.SchemaName != nil {
2970		objectMap["schemaName"] = dmrp.SchemaName
2971	}
2972	if dmrp.TableName != nil {
2973		objectMap["tableName"] = dmrp.TableName
2974	}
2975	if dmrp.ColumnName != nil {
2976		objectMap["columnName"] = dmrp.ColumnName
2977	}
2978	if dmrp.MaskingFunction != "" {
2979		objectMap["maskingFunction"] = dmrp.MaskingFunction
2980	}
2981	if dmrp.NumberFrom != nil {
2982		objectMap["numberFrom"] = dmrp.NumberFrom
2983	}
2984	if dmrp.NumberTo != nil {
2985		objectMap["numberTo"] = dmrp.NumberTo
2986	}
2987	if dmrp.PrefixSize != nil {
2988		objectMap["prefixSize"] = dmrp.PrefixSize
2989	}
2990	if dmrp.SuffixSize != nil {
2991		objectMap["suffixSize"] = dmrp.SuffixSize
2992	}
2993	if dmrp.ReplacementString != nil {
2994		objectMap["replacementString"] = dmrp.ReplacementString
2995	}
2996	return json.Marshal(objectMap)
2997}
2998
2999// EditionCapability the edition capability.
3000type EditionCapability struct {
3001	// Name - READ-ONLY; The database edition name.
3002	Name *string `json:"name,omitempty"`
3003	// SupportedServiceLevelObjectives - READ-ONLY; The list of supported service objectives for the edition.
3004	SupportedServiceLevelObjectives *[]ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty"`
3005	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition.
3006	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
3007	// ReadScale - READ-ONLY; The read scale capability for the edition.
3008	ReadScale *ReadScaleCapability `json:"readScale,omitempty"`
3009	// SupportedStorageCapabilities - READ-ONLY; The list of supported storage capabilities for this edition
3010	SupportedStorageCapabilities *[]StorageCapability `json:"supportedStorageCapabilities,omitempty"`
3011	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3012	Status CapabilityStatus `json:"status,omitempty"`
3013	// Reason - The reason for the capability not being available.
3014	Reason *string `json:"reason,omitempty"`
3015}
3016
3017// MarshalJSON is the custom marshaler for EditionCapability.
3018func (ec EditionCapability) MarshalJSON() ([]byte, error) {
3019	objectMap := make(map[string]interface{})
3020	if ec.Reason != nil {
3021		objectMap["reason"] = ec.Reason
3022	}
3023	return json.Marshal(objectMap)
3024}
3025
3026// ElasticPool an elastic pool.
3027type ElasticPool struct {
3028	autorest.Response `json:"-"`
3029	// Sku - The elastic pool SKU.
3030	//
3031	// 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:
3032	//
3033	// ```azurecli
3034	// az sql elastic-pool list-editions -l <location> -o table
3035	// ````
3036	Sku *Sku `json:"sku,omitempty"`
3037	// Kind - READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience.
3038	Kind *string `json:"kind,omitempty"`
3039	// ElasticPoolProperties - Resource properties.
3040	*ElasticPoolProperties `json:"properties,omitempty"`
3041	// Location - Resource location.
3042	Location *string `json:"location,omitempty"`
3043	// Tags - Resource tags.
3044	Tags map[string]*string `json:"tags"`
3045	// ID - READ-ONLY; Resource ID.
3046	ID *string `json:"id,omitempty"`
3047	// Name - READ-ONLY; Resource name.
3048	Name *string `json:"name,omitempty"`
3049	// Type - READ-ONLY; Resource type.
3050	Type *string `json:"type,omitempty"`
3051}
3052
3053// MarshalJSON is the custom marshaler for ElasticPool.
3054func (ep ElasticPool) MarshalJSON() ([]byte, error) {
3055	objectMap := make(map[string]interface{})
3056	if ep.Sku != nil {
3057		objectMap["sku"] = ep.Sku
3058	}
3059	if ep.ElasticPoolProperties != nil {
3060		objectMap["properties"] = ep.ElasticPoolProperties
3061	}
3062	if ep.Location != nil {
3063		objectMap["location"] = ep.Location
3064	}
3065	if ep.Tags != nil {
3066		objectMap["tags"] = ep.Tags
3067	}
3068	return json.Marshal(objectMap)
3069}
3070
3071// UnmarshalJSON is the custom unmarshaler for ElasticPool struct.
3072func (ep *ElasticPool) UnmarshalJSON(body []byte) error {
3073	var m map[string]*json.RawMessage
3074	err := json.Unmarshal(body, &m)
3075	if err != nil {
3076		return err
3077	}
3078	for k, v := range m {
3079		switch k {
3080		case "sku":
3081			if v != nil {
3082				var sku Sku
3083				err = json.Unmarshal(*v, &sku)
3084				if err != nil {
3085					return err
3086				}
3087				ep.Sku = &sku
3088			}
3089		case "kind":
3090			if v != nil {
3091				var kind string
3092				err = json.Unmarshal(*v, &kind)
3093				if err != nil {
3094					return err
3095				}
3096				ep.Kind = &kind
3097			}
3098		case "properties":
3099			if v != nil {
3100				var elasticPoolProperties ElasticPoolProperties
3101				err = json.Unmarshal(*v, &elasticPoolProperties)
3102				if err != nil {
3103					return err
3104				}
3105				ep.ElasticPoolProperties = &elasticPoolProperties
3106			}
3107		case "location":
3108			if v != nil {
3109				var location string
3110				err = json.Unmarshal(*v, &location)
3111				if err != nil {
3112					return err
3113				}
3114				ep.Location = &location
3115			}
3116		case "tags":
3117			if v != nil {
3118				var tags map[string]*string
3119				err = json.Unmarshal(*v, &tags)
3120				if err != nil {
3121					return err
3122				}
3123				ep.Tags = tags
3124			}
3125		case "id":
3126			if v != nil {
3127				var ID string
3128				err = json.Unmarshal(*v, &ID)
3129				if err != nil {
3130					return err
3131				}
3132				ep.ID = &ID
3133			}
3134		case "name":
3135			if v != nil {
3136				var name string
3137				err = json.Unmarshal(*v, &name)
3138				if err != nil {
3139					return err
3140				}
3141				ep.Name = &name
3142			}
3143		case "type":
3144			if v != nil {
3145				var typeVar string
3146				err = json.Unmarshal(*v, &typeVar)
3147				if err != nil {
3148					return err
3149				}
3150				ep.Type = &typeVar
3151			}
3152		}
3153	}
3154
3155	return nil
3156}
3157
3158// ElasticPoolActivity represents the activity on an elastic pool.
3159type ElasticPoolActivity struct {
3160	// Location - The geo-location where the resource lives
3161	Location *string `json:"location,omitempty"`
3162	// ElasticPoolActivityProperties - The properties representing the resource.
3163	*ElasticPoolActivityProperties `json:"properties,omitempty"`
3164	// ID - READ-ONLY; Resource ID.
3165	ID *string `json:"id,omitempty"`
3166	// Name - READ-ONLY; Resource name.
3167	Name *string `json:"name,omitempty"`
3168	// Type - READ-ONLY; Resource type.
3169	Type *string `json:"type,omitempty"`
3170}
3171
3172// MarshalJSON is the custom marshaler for ElasticPoolActivity.
3173func (epa ElasticPoolActivity) MarshalJSON() ([]byte, error) {
3174	objectMap := make(map[string]interface{})
3175	if epa.Location != nil {
3176		objectMap["location"] = epa.Location
3177	}
3178	if epa.ElasticPoolActivityProperties != nil {
3179		objectMap["properties"] = epa.ElasticPoolActivityProperties
3180	}
3181	return json.Marshal(objectMap)
3182}
3183
3184// UnmarshalJSON is the custom unmarshaler for ElasticPoolActivity struct.
3185func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error {
3186	var m map[string]*json.RawMessage
3187	err := json.Unmarshal(body, &m)
3188	if err != nil {
3189		return err
3190	}
3191	for k, v := range m {
3192		switch k {
3193		case "location":
3194			if v != nil {
3195				var location string
3196				err = json.Unmarshal(*v, &location)
3197				if err != nil {
3198					return err
3199				}
3200				epa.Location = &location
3201			}
3202		case "properties":
3203			if v != nil {
3204				var elasticPoolActivityProperties ElasticPoolActivityProperties
3205				err = json.Unmarshal(*v, &elasticPoolActivityProperties)
3206				if err != nil {
3207					return err
3208				}
3209				epa.ElasticPoolActivityProperties = &elasticPoolActivityProperties
3210			}
3211		case "id":
3212			if v != nil {
3213				var ID string
3214				err = json.Unmarshal(*v, &ID)
3215				if err != nil {
3216					return err
3217				}
3218				epa.ID = &ID
3219			}
3220		case "name":
3221			if v != nil {
3222				var name string
3223				err = json.Unmarshal(*v, &name)
3224				if err != nil {
3225					return err
3226				}
3227				epa.Name = &name
3228			}
3229		case "type":
3230			if v != nil {
3231				var typeVar string
3232				err = json.Unmarshal(*v, &typeVar)
3233				if err != nil {
3234					return err
3235				}
3236				epa.Type = &typeVar
3237			}
3238		}
3239	}
3240
3241	return nil
3242}
3243
3244// ElasticPoolActivityListResult represents the response to a list elastic pool activity request.
3245type ElasticPoolActivityListResult struct {
3246	autorest.Response `json:"-"`
3247	// Value - The list of elastic pool activities.
3248	Value *[]ElasticPoolActivity `json:"value,omitempty"`
3249}
3250
3251// ElasticPoolActivityProperties represents the properties of an elastic pool.
3252type ElasticPoolActivityProperties struct {
3253	// EndTime - READ-ONLY; The time the operation finished (ISO8601 format).
3254	EndTime *date.Time `json:"endTime,omitempty"`
3255	// ErrorCode - READ-ONLY; The error code if available.
3256	ErrorCode *int32 `json:"errorCode,omitempty"`
3257	// ErrorMessage - READ-ONLY; The error message if available.
3258	ErrorMessage *string `json:"errorMessage,omitempty"`
3259	// ErrorSeverity - READ-ONLY; The error severity if available.
3260	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
3261	// Operation - READ-ONLY; The operation name.
3262	Operation *string `json:"operation,omitempty"`
3263	// OperationID - READ-ONLY; The unique operation ID.
3264	OperationID *uuid.UUID `json:"operationId,omitempty"`
3265	// PercentComplete - READ-ONLY; The percentage complete if available.
3266	PercentComplete *int32 `json:"percentComplete,omitempty"`
3267	// RequestedDatabaseDtuMax - READ-ONLY; The requested max DTU per database if available.
3268	RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty"`
3269	// RequestedDatabaseDtuMin - READ-ONLY; The requested min DTU per database if available.
3270	RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty"`
3271	// RequestedDtu - READ-ONLY; The requested DTU for the pool if available.
3272	RequestedDtu *int32 `json:"requestedDtu,omitempty"`
3273	// RequestedElasticPoolName - READ-ONLY; The requested name for the elastic pool if available.
3274	RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"`
3275	// RequestedStorageLimitInGB - READ-ONLY; The requested storage limit for the pool in GB if available.
3276	RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty"`
3277	// ElasticPoolName - READ-ONLY; The name of the elastic pool.
3278	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
3279	// ServerName - READ-ONLY; The name of the server the elastic pool is in.
3280	ServerName *string `json:"serverName,omitempty"`
3281	// StartTime - READ-ONLY; The time the operation started (ISO8601 format).
3282	StartTime *date.Time `json:"startTime,omitempty"`
3283	// State - READ-ONLY; The current state of the operation.
3284	State *string `json:"state,omitempty"`
3285	// RequestedStorageLimitInMB - READ-ONLY; The requested storage limit in MB.
3286	RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty"`
3287	// RequestedDatabaseDtuGuarantee - READ-ONLY; The requested per database DTU guarantee.
3288	RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty"`
3289	// RequestedDatabaseDtuCap - READ-ONLY; The requested per database DTU cap.
3290	RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty"`
3291	// RequestedDtuGuarantee - READ-ONLY; The requested DTU guarantee.
3292	RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty"`
3293}
3294
3295// ElasticPoolDatabaseActivity represents the activity on an elastic pool.
3296type ElasticPoolDatabaseActivity struct {
3297	// Location - The geo-location where the resource lives
3298	Location *string `json:"location,omitempty"`
3299	// ElasticPoolDatabaseActivityProperties - The properties representing the resource.
3300	*ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"`
3301	// ID - READ-ONLY; Resource ID.
3302	ID *string `json:"id,omitempty"`
3303	// Name - READ-ONLY; Resource name.
3304	Name *string `json:"name,omitempty"`
3305	// Type - READ-ONLY; Resource type.
3306	Type *string `json:"type,omitempty"`
3307}
3308
3309// MarshalJSON is the custom marshaler for ElasticPoolDatabaseActivity.
3310func (epda ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) {
3311	objectMap := make(map[string]interface{})
3312	if epda.Location != nil {
3313		objectMap["location"] = epda.Location
3314	}
3315	if epda.ElasticPoolDatabaseActivityProperties != nil {
3316		objectMap["properties"] = epda.ElasticPoolDatabaseActivityProperties
3317	}
3318	return json.Marshal(objectMap)
3319}
3320
3321// UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct.
3322func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error {
3323	var m map[string]*json.RawMessage
3324	err := json.Unmarshal(body, &m)
3325	if err != nil {
3326		return err
3327	}
3328	for k, v := range m {
3329		switch k {
3330		case "location":
3331			if v != nil {
3332				var location string
3333				err = json.Unmarshal(*v, &location)
3334				if err != nil {
3335					return err
3336				}
3337				epda.Location = &location
3338			}
3339		case "properties":
3340			if v != nil {
3341				var elasticPoolDatabaseActivityProperties ElasticPoolDatabaseActivityProperties
3342				err = json.Unmarshal(*v, &elasticPoolDatabaseActivityProperties)
3343				if err != nil {
3344					return err
3345				}
3346				epda.ElasticPoolDatabaseActivityProperties = &elasticPoolDatabaseActivityProperties
3347			}
3348		case "id":
3349			if v != nil {
3350				var ID string
3351				err = json.Unmarshal(*v, &ID)
3352				if err != nil {
3353					return err
3354				}
3355				epda.ID = &ID
3356			}
3357		case "name":
3358			if v != nil {
3359				var name string
3360				err = json.Unmarshal(*v, &name)
3361				if err != nil {
3362					return err
3363				}
3364				epda.Name = &name
3365			}
3366		case "type":
3367			if v != nil {
3368				var typeVar string
3369				err = json.Unmarshal(*v, &typeVar)
3370				if err != nil {
3371					return err
3372				}
3373				epda.Type = &typeVar
3374			}
3375		}
3376	}
3377
3378	return nil
3379}
3380
3381// ElasticPoolDatabaseActivityListResult represents the response to a list elastic pool database activity
3382// request.
3383type ElasticPoolDatabaseActivityListResult struct {
3384	autorest.Response `json:"-"`
3385	// Value - The list of elastic pool database activities.
3386	Value *[]ElasticPoolDatabaseActivity `json:"value,omitempty"`
3387}
3388
3389// ElasticPoolDatabaseActivityProperties represents the properties of an elastic pool database activity.
3390type ElasticPoolDatabaseActivityProperties struct {
3391	// DatabaseName - READ-ONLY; The database name.
3392	DatabaseName *string `json:"databaseName,omitempty"`
3393	// EndTime - READ-ONLY; The time the operation finished (ISO8601 format).
3394	EndTime *date.Time `json:"endTime,omitempty"`
3395	// ErrorCode - READ-ONLY; The error code if available.
3396	ErrorCode *int32 `json:"errorCode,omitempty"`
3397	// ErrorMessage - READ-ONLY; The error message if available.
3398	ErrorMessage *string `json:"errorMessage,omitempty"`
3399	// ErrorSeverity - READ-ONLY; The error severity if available.
3400	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
3401	// Operation - READ-ONLY; The operation name.
3402	Operation *string `json:"operation,omitempty"`
3403	// OperationID - READ-ONLY; The unique operation ID.
3404	OperationID *uuid.UUID `json:"operationId,omitempty"`
3405	// PercentComplete - READ-ONLY; The percentage complete if available.
3406	PercentComplete *int32 `json:"percentComplete,omitempty"`
3407	// RequestedElasticPoolName - READ-ONLY; The name for the elastic pool the database is moving into if available.
3408	RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"`
3409	// CurrentElasticPoolName - READ-ONLY; The name of the current elastic pool the database is in if available.
3410	CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty"`
3411	// CurrentServiceObjective - READ-ONLY; The name of the current service objective if available.
3412	CurrentServiceObjective *string `json:"currentServiceObjective,omitempty"`
3413	// RequestedServiceObjective - READ-ONLY; The name of the requested service objective if available.
3414	RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty"`
3415	// ServerName - READ-ONLY; The name of the server the elastic pool is in.
3416	ServerName *string `json:"serverName,omitempty"`
3417	// StartTime - READ-ONLY; The time the operation started (ISO8601 format).
3418	StartTime *date.Time `json:"startTime,omitempty"`
3419	// State - READ-ONLY; The current state of the operation.
3420	State *string `json:"state,omitempty"`
3421}
3422
3423// ElasticPoolEditionCapability the elastic pool edition capability.
3424type ElasticPoolEditionCapability struct {
3425	// Name - READ-ONLY; The elastic pool edition name.
3426	Name *string `json:"name,omitempty"`
3427	// SupportedElasticPoolPerformanceLevels - READ-ONLY; The list of supported elastic pool DTU levels for the edition.
3428	SupportedElasticPoolPerformanceLevels *[]ElasticPoolPerformanceLevelCapability `json:"supportedElasticPoolPerformanceLevels,omitempty"`
3429	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition.
3430	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
3431	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3432	Status CapabilityStatus `json:"status,omitempty"`
3433	// Reason - The reason for the capability not being available.
3434	Reason *string `json:"reason,omitempty"`
3435}
3436
3437// MarshalJSON is the custom marshaler for ElasticPoolEditionCapability.
3438func (epec ElasticPoolEditionCapability) MarshalJSON() ([]byte, error) {
3439	objectMap := make(map[string]interface{})
3440	if epec.Reason != nil {
3441		objectMap["reason"] = epec.Reason
3442	}
3443	return json.Marshal(objectMap)
3444}
3445
3446// ElasticPoolListResult the result of an elastic pool list request.
3447type ElasticPoolListResult struct {
3448	autorest.Response `json:"-"`
3449	// Value - READ-ONLY; Array of results.
3450	Value *[]ElasticPool `json:"value,omitempty"`
3451	// NextLink - READ-ONLY; Link to retrieve next page of results.
3452	NextLink *string `json:"nextLink,omitempty"`
3453}
3454
3455// ElasticPoolListResultIterator provides access to a complete listing of ElasticPool values.
3456type ElasticPoolListResultIterator struct {
3457	i    int
3458	page ElasticPoolListResultPage
3459}
3460
3461// NextWithContext advances to the next value.  If there was an error making
3462// the request the iterator does not advance and the error is returned.
3463func (iter *ElasticPoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
3464	if tracing.IsEnabled() {
3465		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolListResultIterator.NextWithContext")
3466		defer func() {
3467			sc := -1
3468			if iter.Response().Response.Response != nil {
3469				sc = iter.Response().Response.Response.StatusCode
3470			}
3471			tracing.EndSpan(ctx, sc, err)
3472		}()
3473	}
3474	iter.i++
3475	if iter.i < len(iter.page.Values()) {
3476		return nil
3477	}
3478	err = iter.page.NextWithContext(ctx)
3479	if err != nil {
3480		iter.i--
3481		return err
3482	}
3483	iter.i = 0
3484	return nil
3485}
3486
3487// Next advances to the next value.  If there was an error making
3488// the request the iterator does not advance and the error is returned.
3489// Deprecated: Use NextWithContext() instead.
3490func (iter *ElasticPoolListResultIterator) Next() error {
3491	return iter.NextWithContext(context.Background())
3492}
3493
3494// NotDone returns true if the enumeration should be started or is not yet complete.
3495func (iter ElasticPoolListResultIterator) NotDone() bool {
3496	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3497}
3498
3499// Response returns the raw server response from the last page request.
3500func (iter ElasticPoolListResultIterator) Response() ElasticPoolListResult {
3501	return iter.page.Response()
3502}
3503
3504// Value returns the current value or a zero-initialized value if the
3505// iterator has advanced beyond the end of the collection.
3506func (iter ElasticPoolListResultIterator) Value() ElasticPool {
3507	if !iter.page.NotDone() {
3508		return ElasticPool{}
3509	}
3510	return iter.page.Values()[iter.i]
3511}
3512
3513// Creates a new instance of the ElasticPoolListResultIterator type.
3514func NewElasticPoolListResultIterator(page ElasticPoolListResultPage) ElasticPoolListResultIterator {
3515	return ElasticPoolListResultIterator{page: page}
3516}
3517
3518// IsEmpty returns true if the ListResult contains no values.
3519func (eplr ElasticPoolListResult) IsEmpty() bool {
3520	return eplr.Value == nil || len(*eplr.Value) == 0
3521}
3522
3523// hasNextLink returns true if the NextLink is not empty.
3524func (eplr ElasticPoolListResult) hasNextLink() bool {
3525	return eplr.NextLink != nil && len(*eplr.NextLink) != 0
3526}
3527
3528// elasticPoolListResultPreparer prepares a request to retrieve the next set of results.
3529// It returns nil if no more results exist.
3530func (eplr ElasticPoolListResult) elasticPoolListResultPreparer(ctx context.Context) (*http.Request, error) {
3531	if !eplr.hasNextLink() {
3532		return nil, nil
3533	}
3534	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3535		autorest.AsJSON(),
3536		autorest.AsGet(),
3537		autorest.WithBaseURL(to.String(eplr.NextLink)))
3538}
3539
3540// ElasticPoolListResultPage contains a page of ElasticPool values.
3541type ElasticPoolListResultPage struct {
3542	fn   func(context.Context, ElasticPoolListResult) (ElasticPoolListResult, error)
3543	eplr ElasticPoolListResult
3544}
3545
3546// NextWithContext advances to the next page of values.  If there was an error making
3547// the request the page does not advance and the error is returned.
3548func (page *ElasticPoolListResultPage) NextWithContext(ctx context.Context) (err error) {
3549	if tracing.IsEnabled() {
3550		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolListResultPage.NextWithContext")
3551		defer func() {
3552			sc := -1
3553			if page.Response().Response.Response != nil {
3554				sc = page.Response().Response.Response.StatusCode
3555			}
3556			tracing.EndSpan(ctx, sc, err)
3557		}()
3558	}
3559	for {
3560		next, err := page.fn(ctx, page.eplr)
3561		if err != nil {
3562			return err
3563		}
3564		page.eplr = next
3565		if !next.hasNextLink() || !next.IsEmpty() {
3566			break
3567		}
3568	}
3569	return nil
3570}
3571
3572// Next advances to the next page of values.  If there was an error making
3573// the request the page does not advance and the error is returned.
3574// Deprecated: Use NextWithContext() instead.
3575func (page *ElasticPoolListResultPage) Next() error {
3576	return page.NextWithContext(context.Background())
3577}
3578
3579// NotDone returns true if the page enumeration should be started or is not yet complete.
3580func (page ElasticPoolListResultPage) NotDone() bool {
3581	return !page.eplr.IsEmpty()
3582}
3583
3584// Response returns the raw server response from the last page request.
3585func (page ElasticPoolListResultPage) Response() ElasticPoolListResult {
3586	return page.eplr
3587}
3588
3589// Values returns the slice of values for the current page or nil if there are no values.
3590func (page ElasticPoolListResultPage) Values() []ElasticPool {
3591	if page.eplr.IsEmpty() {
3592		return nil
3593	}
3594	return *page.eplr.Value
3595}
3596
3597// Creates a new instance of the ElasticPoolListResultPage type.
3598func NewElasticPoolListResultPage(cur ElasticPoolListResult, getNextPage func(context.Context, ElasticPoolListResult) (ElasticPoolListResult, error)) ElasticPoolListResultPage {
3599	return ElasticPoolListResultPage{
3600		fn:   getNextPage,
3601		eplr: cur,
3602	}
3603}
3604
3605// ElasticPoolOperation a elastic pool operation.
3606type ElasticPoolOperation struct {
3607	// ElasticPoolOperationProperties - Resource properties.
3608	*ElasticPoolOperationProperties `json:"properties,omitempty"`
3609	// ID - READ-ONLY; Resource ID.
3610	ID *string `json:"id,omitempty"`
3611	// Name - READ-ONLY; Resource name.
3612	Name *string `json:"name,omitempty"`
3613	// Type - READ-ONLY; Resource type.
3614	Type *string `json:"type,omitempty"`
3615}
3616
3617// MarshalJSON is the custom marshaler for ElasticPoolOperation.
3618func (epo ElasticPoolOperation) MarshalJSON() ([]byte, error) {
3619	objectMap := make(map[string]interface{})
3620	if epo.ElasticPoolOperationProperties != nil {
3621		objectMap["properties"] = epo.ElasticPoolOperationProperties
3622	}
3623	return json.Marshal(objectMap)
3624}
3625
3626// UnmarshalJSON is the custom unmarshaler for ElasticPoolOperation struct.
3627func (epo *ElasticPoolOperation) UnmarshalJSON(body []byte) error {
3628	var m map[string]*json.RawMessage
3629	err := json.Unmarshal(body, &m)
3630	if err != nil {
3631		return err
3632	}
3633	for k, v := range m {
3634		switch k {
3635		case "properties":
3636			if v != nil {
3637				var elasticPoolOperationProperties ElasticPoolOperationProperties
3638				err = json.Unmarshal(*v, &elasticPoolOperationProperties)
3639				if err != nil {
3640					return err
3641				}
3642				epo.ElasticPoolOperationProperties = &elasticPoolOperationProperties
3643			}
3644		case "id":
3645			if v != nil {
3646				var ID string
3647				err = json.Unmarshal(*v, &ID)
3648				if err != nil {
3649					return err
3650				}
3651				epo.ID = &ID
3652			}
3653		case "name":
3654			if v != nil {
3655				var name string
3656				err = json.Unmarshal(*v, &name)
3657				if err != nil {
3658					return err
3659				}
3660				epo.Name = &name
3661			}
3662		case "type":
3663			if v != nil {
3664				var typeVar string
3665				err = json.Unmarshal(*v, &typeVar)
3666				if err != nil {
3667					return err
3668				}
3669				epo.Type = &typeVar
3670			}
3671		}
3672	}
3673
3674	return nil
3675}
3676
3677// ElasticPoolOperationListResult the response to a list elastic pool operations request
3678type ElasticPoolOperationListResult struct {
3679	autorest.Response `json:"-"`
3680	// Value - READ-ONLY; Array of results.
3681	Value *[]ElasticPoolOperation `json:"value,omitempty"`
3682	// NextLink - READ-ONLY; Link to retrieve next page of results.
3683	NextLink *string `json:"nextLink,omitempty"`
3684}
3685
3686// ElasticPoolOperationListResultIterator provides access to a complete listing of ElasticPoolOperation
3687// values.
3688type ElasticPoolOperationListResultIterator struct {
3689	i    int
3690	page ElasticPoolOperationListResultPage
3691}
3692
3693// NextWithContext advances to the next value.  If there was an error making
3694// the request the iterator does not advance and the error is returned.
3695func (iter *ElasticPoolOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
3696	if tracing.IsEnabled() {
3697		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationListResultIterator.NextWithContext")
3698		defer func() {
3699			sc := -1
3700			if iter.Response().Response.Response != nil {
3701				sc = iter.Response().Response.Response.StatusCode
3702			}
3703			tracing.EndSpan(ctx, sc, err)
3704		}()
3705	}
3706	iter.i++
3707	if iter.i < len(iter.page.Values()) {
3708		return nil
3709	}
3710	err = iter.page.NextWithContext(ctx)
3711	if err != nil {
3712		iter.i--
3713		return err
3714	}
3715	iter.i = 0
3716	return nil
3717}
3718
3719// Next advances to the next value.  If there was an error making
3720// the request the iterator does not advance and the error is returned.
3721// Deprecated: Use NextWithContext() instead.
3722func (iter *ElasticPoolOperationListResultIterator) Next() error {
3723	return iter.NextWithContext(context.Background())
3724}
3725
3726// NotDone returns true if the enumeration should be started or is not yet complete.
3727func (iter ElasticPoolOperationListResultIterator) NotDone() bool {
3728	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3729}
3730
3731// Response returns the raw server response from the last page request.
3732func (iter ElasticPoolOperationListResultIterator) Response() ElasticPoolOperationListResult {
3733	return iter.page.Response()
3734}
3735
3736// Value returns the current value or a zero-initialized value if the
3737// iterator has advanced beyond the end of the collection.
3738func (iter ElasticPoolOperationListResultIterator) Value() ElasticPoolOperation {
3739	if !iter.page.NotDone() {
3740		return ElasticPoolOperation{}
3741	}
3742	return iter.page.Values()[iter.i]
3743}
3744
3745// Creates a new instance of the ElasticPoolOperationListResultIterator type.
3746func NewElasticPoolOperationListResultIterator(page ElasticPoolOperationListResultPage) ElasticPoolOperationListResultIterator {
3747	return ElasticPoolOperationListResultIterator{page: page}
3748}
3749
3750// IsEmpty returns true if the ListResult contains no values.
3751func (epolr ElasticPoolOperationListResult) IsEmpty() bool {
3752	return epolr.Value == nil || len(*epolr.Value) == 0
3753}
3754
3755// hasNextLink returns true if the NextLink is not empty.
3756func (epolr ElasticPoolOperationListResult) hasNextLink() bool {
3757	return epolr.NextLink != nil && len(*epolr.NextLink) != 0
3758}
3759
3760// elasticPoolOperationListResultPreparer prepares a request to retrieve the next set of results.
3761// It returns nil if no more results exist.
3762func (epolr ElasticPoolOperationListResult) elasticPoolOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
3763	if !epolr.hasNextLink() {
3764		return nil, nil
3765	}
3766	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3767		autorest.AsJSON(),
3768		autorest.AsGet(),
3769		autorest.WithBaseURL(to.String(epolr.NextLink)))
3770}
3771
3772// ElasticPoolOperationListResultPage contains a page of ElasticPoolOperation values.
3773type ElasticPoolOperationListResultPage struct {
3774	fn    func(context.Context, ElasticPoolOperationListResult) (ElasticPoolOperationListResult, error)
3775	epolr ElasticPoolOperationListResult
3776}
3777
3778// NextWithContext advances to the next page of values.  If there was an error making
3779// the request the page does not advance and the error is returned.
3780func (page *ElasticPoolOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
3781	if tracing.IsEnabled() {
3782		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationListResultPage.NextWithContext")
3783		defer func() {
3784			sc := -1
3785			if page.Response().Response.Response != nil {
3786				sc = page.Response().Response.Response.StatusCode
3787			}
3788			tracing.EndSpan(ctx, sc, err)
3789		}()
3790	}
3791	for {
3792		next, err := page.fn(ctx, page.epolr)
3793		if err != nil {
3794			return err
3795		}
3796		page.epolr = next
3797		if !next.hasNextLink() || !next.IsEmpty() {
3798			break
3799		}
3800	}
3801	return nil
3802}
3803
3804// Next advances to the next page of values.  If there was an error making
3805// the request the page does not advance and the error is returned.
3806// Deprecated: Use NextWithContext() instead.
3807func (page *ElasticPoolOperationListResultPage) Next() error {
3808	return page.NextWithContext(context.Background())
3809}
3810
3811// NotDone returns true if the page enumeration should be started or is not yet complete.
3812func (page ElasticPoolOperationListResultPage) NotDone() bool {
3813	return !page.epolr.IsEmpty()
3814}
3815
3816// Response returns the raw server response from the last page request.
3817func (page ElasticPoolOperationListResultPage) Response() ElasticPoolOperationListResult {
3818	return page.epolr
3819}
3820
3821// Values returns the slice of values for the current page or nil if there are no values.
3822func (page ElasticPoolOperationListResultPage) Values() []ElasticPoolOperation {
3823	if page.epolr.IsEmpty() {
3824		return nil
3825	}
3826	return *page.epolr.Value
3827}
3828
3829// Creates a new instance of the ElasticPoolOperationListResultPage type.
3830func NewElasticPoolOperationListResultPage(cur ElasticPoolOperationListResult, getNextPage func(context.Context, ElasticPoolOperationListResult) (ElasticPoolOperationListResult, error)) ElasticPoolOperationListResultPage {
3831	return ElasticPoolOperationListResultPage{
3832		fn:    getNextPage,
3833		epolr: cur,
3834	}
3835}
3836
3837// ElasticPoolOperationProperties the properties of a elastic pool operation.
3838type ElasticPoolOperationProperties struct {
3839	// ElasticPoolName - READ-ONLY; The name of the elastic pool the operation is being performed on.
3840	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
3841	// Operation - READ-ONLY; The name of operation.
3842	Operation *string `json:"operation,omitempty"`
3843	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
3844	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
3845	// PercentComplete - READ-ONLY; The percentage of the operation completed.
3846	PercentComplete *int32 `json:"percentComplete,omitempty"`
3847	// ServerName - READ-ONLY; The name of the server.
3848	ServerName *string `json:"serverName,omitempty"`
3849	// StartTime - READ-ONLY; The operation start time.
3850	StartTime *date.Time `json:"startTime,omitempty"`
3851	// State - READ-ONLY; The operation state.
3852	State *string `json:"state,omitempty"`
3853	// ErrorCode - READ-ONLY; The operation error code.
3854	ErrorCode *int32 `json:"errorCode,omitempty"`
3855	// ErrorDescription - READ-ONLY; The operation error description.
3856	ErrorDescription *string `json:"errorDescription,omitempty"`
3857	// ErrorSeverity - READ-ONLY; The operation error severity.
3858	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
3859	// IsUserError - READ-ONLY; Whether or not the error is a user error.
3860	IsUserError *bool `json:"isUserError,omitempty"`
3861	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
3862	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
3863	// Description - READ-ONLY; The operation description.
3864	Description *string `json:"description,omitempty"`
3865	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
3866	IsCancellable *bool `json:"isCancellable,omitempty"`
3867}
3868
3869// ElasticPoolPerDatabaseMaxPerformanceLevelCapability the max per-database performance level capability.
3870type ElasticPoolPerDatabaseMaxPerformanceLevelCapability struct {
3871	// Limit - READ-ONLY; The maximum performance level per database.
3872	Limit *float64 `json:"limit,omitempty"`
3873	// Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'DTU', 'VCores'
3874	Unit PerformanceLevelUnit `json:"unit,omitempty"`
3875	// SupportedPerDatabaseMinPerformanceLevels - READ-ONLY; The list of supported min database performance levels.
3876	SupportedPerDatabaseMinPerformanceLevels *[]ElasticPoolPerDatabaseMinPerformanceLevelCapability `json:"supportedPerDatabaseMinPerformanceLevels,omitempty"`
3877	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3878	Status CapabilityStatus `json:"status,omitempty"`
3879	// Reason - The reason for the capability not being available.
3880	Reason *string `json:"reason,omitempty"`
3881}
3882
3883// MarshalJSON is the custom marshaler for ElasticPoolPerDatabaseMaxPerformanceLevelCapability.
3884func (eppdmplc ElasticPoolPerDatabaseMaxPerformanceLevelCapability) MarshalJSON() ([]byte, error) {
3885	objectMap := make(map[string]interface{})
3886	if eppdmplc.Reason != nil {
3887		objectMap["reason"] = eppdmplc.Reason
3888	}
3889	return json.Marshal(objectMap)
3890}
3891
3892// ElasticPoolPerDatabaseMinPerformanceLevelCapability the minimum per-database performance level
3893// capability.
3894type ElasticPoolPerDatabaseMinPerformanceLevelCapability struct {
3895	// Limit - READ-ONLY; The minimum performance level per database.
3896	Limit *float64 `json:"limit,omitempty"`
3897	// Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'DTU', 'VCores'
3898	Unit PerformanceLevelUnit `json:"unit,omitempty"`
3899	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3900	Status CapabilityStatus `json:"status,omitempty"`
3901	// Reason - The reason for the capability not being available.
3902	Reason *string `json:"reason,omitempty"`
3903}
3904
3905// MarshalJSON is the custom marshaler for ElasticPoolPerDatabaseMinPerformanceLevelCapability.
3906func (eppdmplc ElasticPoolPerDatabaseMinPerformanceLevelCapability) MarshalJSON() ([]byte, error) {
3907	objectMap := make(map[string]interface{})
3908	if eppdmplc.Reason != nil {
3909		objectMap["reason"] = eppdmplc.Reason
3910	}
3911	return json.Marshal(objectMap)
3912}
3913
3914// ElasticPoolPerDatabaseSettings per database settings of an elastic pool.
3915type ElasticPoolPerDatabaseSettings struct {
3916	// MinCapacity - The minimum capacity all databases are guaranteed.
3917	MinCapacity *float64 `json:"minCapacity,omitempty"`
3918	// MaxCapacity - The maximum capacity any one database can consume.
3919	MaxCapacity *float64 `json:"maxCapacity,omitempty"`
3920}
3921
3922// ElasticPoolPerformanceLevelCapability the Elastic Pool performance level capability.
3923type ElasticPoolPerformanceLevelCapability struct {
3924	// PerformanceLevel - READ-ONLY; The performance level for the pool.
3925	PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty"`
3926	// Sku - READ-ONLY; The sku.
3927	Sku *Sku `json:"sku,omitempty"`
3928	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
3929	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
3930	// MaxDatabaseCount - READ-ONLY; The maximum number of databases supported.
3931	MaxDatabaseCount *int32 `json:"maxDatabaseCount,omitempty"`
3932	// IncludedMaxSize - READ-ONLY; The included (free) max size for this performance level.
3933	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
3934	// SupportedMaxSizes - READ-ONLY; The list of supported max sizes.
3935	SupportedMaxSizes *[]MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty"`
3936	// SupportedPerDatabaseMaxSizes - READ-ONLY; The list of supported per database max sizes.
3937	SupportedPerDatabaseMaxSizes *[]MaxSizeRangeCapability `json:"supportedPerDatabaseMaxSizes,omitempty"`
3938	// SupportedPerDatabaseMaxPerformanceLevels - READ-ONLY; The list of supported per database max performance levels.
3939	SupportedPerDatabaseMaxPerformanceLevels *[]ElasticPoolPerDatabaseMaxPerformanceLevelCapability `json:"supportedPerDatabaseMaxPerformanceLevels,omitempty"`
3940	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the performance level.
3941	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
3942	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3943	Status CapabilityStatus `json:"status,omitempty"`
3944	// Reason - The reason for the capability not being available.
3945	Reason *string `json:"reason,omitempty"`
3946}
3947
3948// MarshalJSON is the custom marshaler for ElasticPoolPerformanceLevelCapability.
3949func (epplc ElasticPoolPerformanceLevelCapability) MarshalJSON() ([]byte, error) {
3950	objectMap := make(map[string]interface{})
3951	if epplc.Reason != nil {
3952		objectMap["reason"] = epplc.Reason
3953	}
3954	return json.Marshal(objectMap)
3955}
3956
3957// ElasticPoolProperties properties of an elastic pool
3958type ElasticPoolProperties struct {
3959	// State - READ-ONLY; The state of the elastic pool. Possible values include: 'ElasticPoolStateCreating', 'ElasticPoolStateReady', 'ElasticPoolStateDisabled'
3960	State ElasticPoolState `json:"state,omitempty"`
3961	// CreationDate - READ-ONLY; The creation date of the elastic pool (ISO8601 format).
3962	CreationDate *date.Time `json:"creationDate,omitempty"`
3963	// MaxSizeBytes - The storage limit for the database elastic pool in bytes.
3964	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
3965	// PerDatabaseSettings - The per database settings for the elastic pool.
3966	PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"`
3967	// 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.
3968	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
3969	// LicenseType - The license type to apply for this elastic pool. Possible values include: 'ElasticPoolLicenseTypeLicenseIncluded', 'ElasticPoolLicenseTypeBasePrice'
3970	LicenseType ElasticPoolLicenseType `json:"licenseType,omitempty"`
3971}
3972
3973// MarshalJSON is the custom marshaler for ElasticPoolProperties.
3974func (epp ElasticPoolProperties) MarshalJSON() ([]byte, error) {
3975	objectMap := make(map[string]interface{})
3976	if epp.MaxSizeBytes != nil {
3977		objectMap["maxSizeBytes"] = epp.MaxSizeBytes
3978	}
3979	if epp.PerDatabaseSettings != nil {
3980		objectMap["perDatabaseSettings"] = epp.PerDatabaseSettings
3981	}
3982	if epp.ZoneRedundant != nil {
3983		objectMap["zoneRedundant"] = epp.ZoneRedundant
3984	}
3985	if epp.LicenseType != "" {
3986		objectMap["licenseType"] = epp.LicenseType
3987	}
3988	return json.Marshal(objectMap)
3989}
3990
3991// ElasticPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
3992// long-running operation.
3993type ElasticPoolsCreateOrUpdateFuture struct {
3994	azure.FutureAPI
3995	// Result returns the result of the asynchronous operation.
3996	// If the operation has not completed it will return an error.
3997	Result func(ElasticPoolsClient) (ElasticPool, error)
3998}
3999
4000// ElasticPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
4001// operation.
4002type ElasticPoolsDeleteFuture struct {
4003	azure.FutureAPI
4004	// Result returns the result of the asynchronous operation.
4005	// If the operation has not completed it will return an error.
4006	Result func(ElasticPoolsClient) (autorest.Response, error)
4007}
4008
4009// ElasticPoolsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
4010// operation.
4011type ElasticPoolsFailoverFuture struct {
4012	azure.FutureAPI
4013	// Result returns the result of the asynchronous operation.
4014	// If the operation has not completed it will return an error.
4015	Result func(ElasticPoolsClient) (autorest.Response, error)
4016}
4017
4018// ElasticPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
4019// operation.
4020type ElasticPoolsUpdateFuture struct {
4021	azure.FutureAPI
4022	// Result returns the result of the asynchronous operation.
4023	// If the operation has not completed it will return an error.
4024	Result func(ElasticPoolsClient) (ElasticPool, error)
4025}
4026
4027// ElasticPoolUpdate an elastic pool update.
4028type ElasticPoolUpdate struct {
4029	Sku *Sku `json:"sku,omitempty"`
4030	// ElasticPoolUpdateProperties - Resource properties.
4031	*ElasticPoolUpdateProperties `json:"properties,omitempty"`
4032	// Tags - Resource tags.
4033	Tags map[string]*string `json:"tags"`
4034}
4035
4036// MarshalJSON is the custom marshaler for ElasticPoolUpdate.
4037func (epu ElasticPoolUpdate) MarshalJSON() ([]byte, error) {
4038	objectMap := make(map[string]interface{})
4039	if epu.Sku != nil {
4040		objectMap["sku"] = epu.Sku
4041	}
4042	if epu.ElasticPoolUpdateProperties != nil {
4043		objectMap["properties"] = epu.ElasticPoolUpdateProperties
4044	}
4045	if epu.Tags != nil {
4046		objectMap["tags"] = epu.Tags
4047	}
4048	return json.Marshal(objectMap)
4049}
4050
4051// UnmarshalJSON is the custom unmarshaler for ElasticPoolUpdate struct.
4052func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error {
4053	var m map[string]*json.RawMessage
4054	err := json.Unmarshal(body, &m)
4055	if err != nil {
4056		return err
4057	}
4058	for k, v := range m {
4059		switch k {
4060		case "sku":
4061			if v != nil {
4062				var sku Sku
4063				err = json.Unmarshal(*v, &sku)
4064				if err != nil {
4065					return err
4066				}
4067				epu.Sku = &sku
4068			}
4069		case "properties":
4070			if v != nil {
4071				var elasticPoolUpdateProperties ElasticPoolUpdateProperties
4072				err = json.Unmarshal(*v, &elasticPoolUpdateProperties)
4073				if err != nil {
4074					return err
4075				}
4076				epu.ElasticPoolUpdateProperties = &elasticPoolUpdateProperties
4077			}
4078		case "tags":
4079			if v != nil {
4080				var tags map[string]*string
4081				err = json.Unmarshal(*v, &tags)
4082				if err != nil {
4083					return err
4084				}
4085				epu.Tags = tags
4086			}
4087		}
4088	}
4089
4090	return nil
4091}
4092
4093// ElasticPoolUpdateProperties properties of an elastic pool
4094type ElasticPoolUpdateProperties struct {
4095	// MaxSizeBytes - The storage limit for the database elastic pool in bytes.
4096	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
4097	// PerDatabaseSettings - The per database settings for the elastic pool.
4098	PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"`
4099	// 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.
4100	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
4101	// LicenseType - The license type to apply for this elastic pool. Possible values include: 'ElasticPoolLicenseTypeLicenseIncluded', 'ElasticPoolLicenseTypeBasePrice'
4102	LicenseType ElasticPoolLicenseType `json:"licenseType,omitempty"`
4103}
4104
4105// EncryptionProtector the server encryption protector.
4106type EncryptionProtector struct {
4107	autorest.Response `json:"-"`
4108	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
4109	Kind *string `json:"kind,omitempty"`
4110	// Location - READ-ONLY; Resource location.
4111	Location *string `json:"location,omitempty"`
4112	// EncryptionProtectorProperties - Resource properties.
4113	*EncryptionProtectorProperties `json:"properties,omitempty"`
4114	// ID - READ-ONLY; Resource ID.
4115	ID *string `json:"id,omitempty"`
4116	// Name - READ-ONLY; Resource name.
4117	Name *string `json:"name,omitempty"`
4118	// Type - READ-ONLY; Resource type.
4119	Type *string `json:"type,omitempty"`
4120}
4121
4122// MarshalJSON is the custom marshaler for EncryptionProtector.
4123func (ep EncryptionProtector) MarshalJSON() ([]byte, error) {
4124	objectMap := make(map[string]interface{})
4125	if ep.EncryptionProtectorProperties != nil {
4126		objectMap["properties"] = ep.EncryptionProtectorProperties
4127	}
4128	return json.Marshal(objectMap)
4129}
4130
4131// UnmarshalJSON is the custom unmarshaler for EncryptionProtector struct.
4132func (ep *EncryptionProtector) UnmarshalJSON(body []byte) error {
4133	var m map[string]*json.RawMessage
4134	err := json.Unmarshal(body, &m)
4135	if err != nil {
4136		return err
4137	}
4138	for k, v := range m {
4139		switch k {
4140		case "kind":
4141			if v != nil {
4142				var kind string
4143				err = json.Unmarshal(*v, &kind)
4144				if err != nil {
4145					return err
4146				}
4147				ep.Kind = &kind
4148			}
4149		case "location":
4150			if v != nil {
4151				var location string
4152				err = json.Unmarshal(*v, &location)
4153				if err != nil {
4154					return err
4155				}
4156				ep.Location = &location
4157			}
4158		case "properties":
4159			if v != nil {
4160				var encryptionProtectorProperties EncryptionProtectorProperties
4161				err = json.Unmarshal(*v, &encryptionProtectorProperties)
4162				if err != nil {
4163					return err
4164				}
4165				ep.EncryptionProtectorProperties = &encryptionProtectorProperties
4166			}
4167		case "id":
4168			if v != nil {
4169				var ID string
4170				err = json.Unmarshal(*v, &ID)
4171				if err != nil {
4172					return err
4173				}
4174				ep.ID = &ID
4175			}
4176		case "name":
4177			if v != nil {
4178				var name string
4179				err = json.Unmarshal(*v, &name)
4180				if err != nil {
4181					return err
4182				}
4183				ep.Name = &name
4184			}
4185		case "type":
4186			if v != nil {
4187				var typeVar string
4188				err = json.Unmarshal(*v, &typeVar)
4189				if err != nil {
4190					return err
4191				}
4192				ep.Type = &typeVar
4193			}
4194		}
4195	}
4196
4197	return nil
4198}
4199
4200// EncryptionProtectorListResult a list of server encryption protectors.
4201type EncryptionProtectorListResult struct {
4202	autorest.Response `json:"-"`
4203	// Value - READ-ONLY; Array of results.
4204	Value *[]EncryptionProtector `json:"value,omitempty"`
4205	// NextLink - READ-ONLY; Link to retrieve next page of results.
4206	NextLink *string `json:"nextLink,omitempty"`
4207}
4208
4209// EncryptionProtectorListResultIterator provides access to a complete listing of EncryptionProtector
4210// values.
4211type EncryptionProtectorListResultIterator struct {
4212	i    int
4213	page EncryptionProtectorListResultPage
4214}
4215
4216// NextWithContext advances to the next value.  If there was an error making
4217// the request the iterator does not advance and the error is returned.
4218func (iter *EncryptionProtectorListResultIterator) NextWithContext(ctx context.Context) (err error) {
4219	if tracing.IsEnabled() {
4220		ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultIterator.NextWithContext")
4221		defer func() {
4222			sc := -1
4223			if iter.Response().Response.Response != nil {
4224				sc = iter.Response().Response.Response.StatusCode
4225			}
4226			tracing.EndSpan(ctx, sc, err)
4227		}()
4228	}
4229	iter.i++
4230	if iter.i < len(iter.page.Values()) {
4231		return nil
4232	}
4233	err = iter.page.NextWithContext(ctx)
4234	if err != nil {
4235		iter.i--
4236		return err
4237	}
4238	iter.i = 0
4239	return nil
4240}
4241
4242// Next advances to the next value.  If there was an error making
4243// the request the iterator does not advance and the error is returned.
4244// Deprecated: Use NextWithContext() instead.
4245func (iter *EncryptionProtectorListResultIterator) Next() error {
4246	return iter.NextWithContext(context.Background())
4247}
4248
4249// NotDone returns true if the enumeration should be started or is not yet complete.
4250func (iter EncryptionProtectorListResultIterator) NotDone() bool {
4251	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4252}
4253
4254// Response returns the raw server response from the last page request.
4255func (iter EncryptionProtectorListResultIterator) Response() EncryptionProtectorListResult {
4256	return iter.page.Response()
4257}
4258
4259// Value returns the current value or a zero-initialized value if the
4260// iterator has advanced beyond the end of the collection.
4261func (iter EncryptionProtectorListResultIterator) Value() EncryptionProtector {
4262	if !iter.page.NotDone() {
4263		return EncryptionProtector{}
4264	}
4265	return iter.page.Values()[iter.i]
4266}
4267
4268// Creates a new instance of the EncryptionProtectorListResultIterator type.
4269func NewEncryptionProtectorListResultIterator(page EncryptionProtectorListResultPage) EncryptionProtectorListResultIterator {
4270	return EncryptionProtectorListResultIterator{page: page}
4271}
4272
4273// IsEmpty returns true if the ListResult contains no values.
4274func (eplr EncryptionProtectorListResult) IsEmpty() bool {
4275	return eplr.Value == nil || len(*eplr.Value) == 0
4276}
4277
4278// hasNextLink returns true if the NextLink is not empty.
4279func (eplr EncryptionProtectorListResult) hasNextLink() bool {
4280	return eplr.NextLink != nil && len(*eplr.NextLink) != 0
4281}
4282
4283// encryptionProtectorListResultPreparer prepares a request to retrieve the next set of results.
4284// It returns nil if no more results exist.
4285func (eplr EncryptionProtectorListResult) encryptionProtectorListResultPreparer(ctx context.Context) (*http.Request, error) {
4286	if !eplr.hasNextLink() {
4287		return nil, nil
4288	}
4289	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4290		autorest.AsJSON(),
4291		autorest.AsGet(),
4292		autorest.WithBaseURL(to.String(eplr.NextLink)))
4293}
4294
4295// EncryptionProtectorListResultPage contains a page of EncryptionProtector values.
4296type EncryptionProtectorListResultPage struct {
4297	fn   func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)
4298	eplr EncryptionProtectorListResult
4299}
4300
4301// NextWithContext advances to the next page of values.  If there was an error making
4302// the request the page does not advance and the error is returned.
4303func (page *EncryptionProtectorListResultPage) NextWithContext(ctx context.Context) (err error) {
4304	if tracing.IsEnabled() {
4305		ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultPage.NextWithContext")
4306		defer func() {
4307			sc := -1
4308			if page.Response().Response.Response != nil {
4309				sc = page.Response().Response.Response.StatusCode
4310			}
4311			tracing.EndSpan(ctx, sc, err)
4312		}()
4313	}
4314	for {
4315		next, err := page.fn(ctx, page.eplr)
4316		if err != nil {
4317			return err
4318		}
4319		page.eplr = next
4320		if !next.hasNextLink() || !next.IsEmpty() {
4321			break
4322		}
4323	}
4324	return nil
4325}
4326
4327// Next advances to the next page of values.  If there was an error making
4328// the request the page does not advance and the error is returned.
4329// Deprecated: Use NextWithContext() instead.
4330func (page *EncryptionProtectorListResultPage) Next() error {
4331	return page.NextWithContext(context.Background())
4332}
4333
4334// NotDone returns true if the page enumeration should be started or is not yet complete.
4335func (page EncryptionProtectorListResultPage) NotDone() bool {
4336	return !page.eplr.IsEmpty()
4337}
4338
4339// Response returns the raw server response from the last page request.
4340func (page EncryptionProtectorListResultPage) Response() EncryptionProtectorListResult {
4341	return page.eplr
4342}
4343
4344// Values returns the slice of values for the current page or nil if there are no values.
4345func (page EncryptionProtectorListResultPage) Values() []EncryptionProtector {
4346	if page.eplr.IsEmpty() {
4347		return nil
4348	}
4349	return *page.eplr.Value
4350}
4351
4352// Creates a new instance of the EncryptionProtectorListResultPage type.
4353func NewEncryptionProtectorListResultPage(cur EncryptionProtectorListResult, getNextPage func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)) EncryptionProtectorListResultPage {
4354	return EncryptionProtectorListResultPage{
4355		fn:   getNextPage,
4356		eplr: cur,
4357	}
4358}
4359
4360// EncryptionProtectorProperties properties for an encryption protector execution.
4361type EncryptionProtectorProperties struct {
4362	// Subregion - READ-ONLY; Subregion of the encryption protector.
4363	Subregion *string `json:"subregion,omitempty"`
4364	// ServerKeyName - The name of the server key.
4365	ServerKeyName *string `json:"serverKeyName,omitempty"`
4366	// ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
4367	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
4368	// URI - READ-ONLY; The URI of the server key.
4369	URI *string `json:"uri,omitempty"`
4370	// Thumbprint - READ-ONLY; Thumbprint of the server key.
4371	Thumbprint *string `json:"thumbprint,omitempty"`
4372}
4373
4374// MarshalJSON is the custom marshaler for EncryptionProtectorProperties.
4375func (epp EncryptionProtectorProperties) MarshalJSON() ([]byte, error) {
4376	objectMap := make(map[string]interface{})
4377	if epp.ServerKeyName != nil {
4378		objectMap["serverKeyName"] = epp.ServerKeyName
4379	}
4380	if epp.ServerKeyType != "" {
4381		objectMap["serverKeyType"] = epp.ServerKeyType
4382	}
4383	return json.Marshal(objectMap)
4384}
4385
4386// EncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
4387// long-running operation.
4388type EncryptionProtectorsCreateOrUpdateFuture struct {
4389	azure.FutureAPI
4390	// Result returns the result of the asynchronous operation.
4391	// If the operation has not completed it will return an error.
4392	Result func(EncryptionProtectorsClient) (EncryptionProtector, error)
4393}
4394
4395// EncryptionProtectorsRevalidateFuture an abstraction for monitoring and retrieving the results of a
4396// long-running operation.
4397type EncryptionProtectorsRevalidateFuture struct {
4398	azure.FutureAPI
4399	// Result returns the result of the asynchronous operation.
4400	// If the operation has not completed it will return an error.
4401	Result func(EncryptionProtectorsClient) (autorest.Response, error)
4402}
4403
4404// ExportDatabaseDefinition contains the information necessary to perform export database operation.
4405type ExportDatabaseDefinition struct {
4406	// StorageKeyType - Storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey'
4407	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
4408	// StorageKey - Storage key.
4409	StorageKey *string `json:"storageKey,omitempty"`
4410	// StorageURI - Storage Uri.
4411	StorageURI *string `json:"storageUri,omitempty"`
4412	// AdministratorLogin - Administrator login name.
4413	AdministratorLogin *string `json:"administratorLogin,omitempty"`
4414	// AdministratorLoginPassword - Administrator login password.
4415	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
4416	// AuthenticationType - Authentication type.
4417	AuthenticationType *string `json:"authenticationType,omitempty"`
4418	// NetworkIsolation - Optional resource information to enable network isolation for request.
4419	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
4420}
4421
4422// ExtendedDatabaseBlobAuditingPolicy an extended database blob auditing policy.
4423type ExtendedDatabaseBlobAuditingPolicy struct {
4424	autorest.Response `json:"-"`
4425	// ExtendedDatabaseBlobAuditingPolicyProperties - Resource properties.
4426	*ExtendedDatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"`
4427	// ID - READ-ONLY; Resource ID.
4428	ID *string `json:"id,omitempty"`
4429	// Name - READ-ONLY; Resource name.
4430	Name *string `json:"name,omitempty"`
4431	// Type - READ-ONLY; Resource type.
4432	Type *string `json:"type,omitempty"`
4433}
4434
4435// MarshalJSON is the custom marshaler for ExtendedDatabaseBlobAuditingPolicy.
4436func (edbap ExtendedDatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
4437	objectMap := make(map[string]interface{})
4438	if edbap.ExtendedDatabaseBlobAuditingPolicyProperties != nil {
4439		objectMap["properties"] = edbap.ExtendedDatabaseBlobAuditingPolicyProperties
4440	}
4441	return json.Marshal(objectMap)
4442}
4443
4444// UnmarshalJSON is the custom unmarshaler for ExtendedDatabaseBlobAuditingPolicy struct.
4445func (edbap *ExtendedDatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
4446	var m map[string]*json.RawMessage
4447	err := json.Unmarshal(body, &m)
4448	if err != nil {
4449		return err
4450	}
4451	for k, v := range m {
4452		switch k {
4453		case "properties":
4454			if v != nil {
4455				var extendedDatabaseBlobAuditingPolicyProperties ExtendedDatabaseBlobAuditingPolicyProperties
4456				err = json.Unmarshal(*v, &extendedDatabaseBlobAuditingPolicyProperties)
4457				if err != nil {
4458					return err
4459				}
4460				edbap.ExtendedDatabaseBlobAuditingPolicyProperties = &extendedDatabaseBlobAuditingPolicyProperties
4461			}
4462		case "id":
4463			if v != nil {
4464				var ID string
4465				err = json.Unmarshal(*v, &ID)
4466				if err != nil {
4467					return err
4468				}
4469				edbap.ID = &ID
4470			}
4471		case "name":
4472			if v != nil {
4473				var name string
4474				err = json.Unmarshal(*v, &name)
4475				if err != nil {
4476					return err
4477				}
4478				edbap.Name = &name
4479			}
4480		case "type":
4481			if v != nil {
4482				var typeVar string
4483				err = json.Unmarshal(*v, &typeVar)
4484				if err != nil {
4485					return err
4486				}
4487				edbap.Type = &typeVar
4488			}
4489		}
4490	}
4491
4492	return nil
4493}
4494
4495// ExtendedDatabaseBlobAuditingPolicyListResult a list of database extended auditing settings.
4496type ExtendedDatabaseBlobAuditingPolicyListResult struct {
4497	autorest.Response `json:"-"`
4498	// Value - READ-ONLY; Array of results.
4499	Value *[]ExtendedDatabaseBlobAuditingPolicy `json:"value,omitempty"`
4500	// NextLink - READ-ONLY; Link to retrieve next page of results.
4501	NextLink *string `json:"nextLink,omitempty"`
4502}
4503
4504// ExtendedDatabaseBlobAuditingPolicyListResultIterator provides access to a complete listing of
4505// ExtendedDatabaseBlobAuditingPolicy values.
4506type ExtendedDatabaseBlobAuditingPolicyListResultIterator struct {
4507	i    int
4508	page ExtendedDatabaseBlobAuditingPolicyListResultPage
4509}
4510
4511// NextWithContext advances to the next value.  If there was an error making
4512// the request the iterator does not advance and the error is returned.
4513func (iter *ExtendedDatabaseBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
4514	if tracing.IsEnabled() {
4515		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPolicyListResultIterator.NextWithContext")
4516		defer func() {
4517			sc := -1
4518			if iter.Response().Response.Response != nil {
4519				sc = iter.Response().Response.Response.StatusCode
4520			}
4521			tracing.EndSpan(ctx, sc, err)
4522		}()
4523	}
4524	iter.i++
4525	if iter.i < len(iter.page.Values()) {
4526		return nil
4527	}
4528	err = iter.page.NextWithContext(ctx)
4529	if err != nil {
4530		iter.i--
4531		return err
4532	}
4533	iter.i = 0
4534	return nil
4535}
4536
4537// Next advances to the next value.  If there was an error making
4538// the request the iterator does not advance and the error is returned.
4539// Deprecated: Use NextWithContext() instead.
4540func (iter *ExtendedDatabaseBlobAuditingPolicyListResultIterator) Next() error {
4541	return iter.NextWithContext(context.Background())
4542}
4543
4544// NotDone returns true if the enumeration should be started or is not yet complete.
4545func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) NotDone() bool {
4546	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4547}
4548
4549// Response returns the raw server response from the last page request.
4550func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) Response() ExtendedDatabaseBlobAuditingPolicyListResult {
4551	return iter.page.Response()
4552}
4553
4554// Value returns the current value or a zero-initialized value if the
4555// iterator has advanced beyond the end of the collection.
4556func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) Value() ExtendedDatabaseBlobAuditingPolicy {
4557	if !iter.page.NotDone() {
4558		return ExtendedDatabaseBlobAuditingPolicy{}
4559	}
4560	return iter.page.Values()[iter.i]
4561}
4562
4563// Creates a new instance of the ExtendedDatabaseBlobAuditingPolicyListResultIterator type.
4564func NewExtendedDatabaseBlobAuditingPolicyListResultIterator(page ExtendedDatabaseBlobAuditingPolicyListResultPage) ExtendedDatabaseBlobAuditingPolicyListResultIterator {
4565	return ExtendedDatabaseBlobAuditingPolicyListResultIterator{page: page}
4566}
4567
4568// IsEmpty returns true if the ListResult contains no values.
4569func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) IsEmpty() bool {
4570	return edbaplr.Value == nil || len(*edbaplr.Value) == 0
4571}
4572
4573// hasNextLink returns true if the NextLink is not empty.
4574func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) hasNextLink() bool {
4575	return edbaplr.NextLink != nil && len(*edbaplr.NextLink) != 0
4576}
4577
4578// extendedDatabaseBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
4579// It returns nil if no more results exist.
4580func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) extendedDatabaseBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
4581	if !edbaplr.hasNextLink() {
4582		return nil, nil
4583	}
4584	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4585		autorest.AsJSON(),
4586		autorest.AsGet(),
4587		autorest.WithBaseURL(to.String(edbaplr.NextLink)))
4588}
4589
4590// ExtendedDatabaseBlobAuditingPolicyListResultPage contains a page of ExtendedDatabaseBlobAuditingPolicy
4591// values.
4592type ExtendedDatabaseBlobAuditingPolicyListResultPage struct {
4593	fn      func(context.Context, ExtendedDatabaseBlobAuditingPolicyListResult) (ExtendedDatabaseBlobAuditingPolicyListResult, error)
4594	edbaplr ExtendedDatabaseBlobAuditingPolicyListResult
4595}
4596
4597// NextWithContext advances to the next page of values.  If there was an error making
4598// the request the page does not advance and the error is returned.
4599func (page *ExtendedDatabaseBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
4600	if tracing.IsEnabled() {
4601		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPolicyListResultPage.NextWithContext")
4602		defer func() {
4603			sc := -1
4604			if page.Response().Response.Response != nil {
4605				sc = page.Response().Response.Response.StatusCode
4606			}
4607			tracing.EndSpan(ctx, sc, err)
4608		}()
4609	}
4610	for {
4611		next, err := page.fn(ctx, page.edbaplr)
4612		if err != nil {
4613			return err
4614		}
4615		page.edbaplr = next
4616		if !next.hasNextLink() || !next.IsEmpty() {
4617			break
4618		}
4619	}
4620	return nil
4621}
4622
4623// Next advances to the next page of values.  If there was an error making
4624// the request the page does not advance and the error is returned.
4625// Deprecated: Use NextWithContext() instead.
4626func (page *ExtendedDatabaseBlobAuditingPolicyListResultPage) Next() error {
4627	return page.NextWithContext(context.Background())
4628}
4629
4630// NotDone returns true if the page enumeration should be started or is not yet complete.
4631func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) NotDone() bool {
4632	return !page.edbaplr.IsEmpty()
4633}
4634
4635// Response returns the raw server response from the last page request.
4636func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) Response() ExtendedDatabaseBlobAuditingPolicyListResult {
4637	return page.edbaplr
4638}
4639
4640// Values returns the slice of values for the current page or nil if there are no values.
4641func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) Values() []ExtendedDatabaseBlobAuditingPolicy {
4642	if page.edbaplr.IsEmpty() {
4643		return nil
4644	}
4645	return *page.edbaplr.Value
4646}
4647
4648// Creates a new instance of the ExtendedDatabaseBlobAuditingPolicyListResultPage type.
4649func NewExtendedDatabaseBlobAuditingPolicyListResultPage(cur ExtendedDatabaseBlobAuditingPolicyListResult, getNextPage func(context.Context, ExtendedDatabaseBlobAuditingPolicyListResult) (ExtendedDatabaseBlobAuditingPolicyListResult, error)) ExtendedDatabaseBlobAuditingPolicyListResultPage {
4650	return ExtendedDatabaseBlobAuditingPolicyListResultPage{
4651		fn:      getNextPage,
4652		edbaplr: cur,
4653	}
4654}
4655
4656// ExtendedDatabaseBlobAuditingPolicyProperties properties of an extended database blob auditing policy.
4657type ExtendedDatabaseBlobAuditingPolicyProperties struct {
4658	// PredicateExpression - Specifies condition of where clause when creating an audit.
4659	PredicateExpression *string `json:"predicateExpression,omitempty"`
4660	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
4661	State BlobAuditingPolicyState `json:"state,omitempty"`
4662	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
4663	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
4664	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
4665	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
4666	// Prerequisites for using managed identity authentication:
4667	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
4668	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
4669	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
4670	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
4671	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
4672	RetentionDays *int32 `json:"retentionDays,omitempty"`
4673	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
4674	//
4675	// 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:
4676	//
4677	// BATCH_COMPLETED_GROUP,
4678	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
4679	// FAILED_DATABASE_AUTHENTICATION_GROUP.
4680	//
4681	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
4682	//
4683	// 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):
4684	//
4685	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
4686	// BACKUP_RESTORE_GROUP
4687	// DATABASE_LOGOUT_GROUP
4688	// DATABASE_OBJECT_CHANGE_GROUP
4689	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
4690	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
4691	// DATABASE_OPERATION_GROUP
4692	// DATABASE_PERMISSION_CHANGE_GROUP
4693	// DATABASE_PRINCIPAL_CHANGE_GROUP
4694	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
4695	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
4696	// FAILED_DATABASE_AUTHENTICATION_GROUP
4697	// SCHEMA_OBJECT_ACCESS_GROUP
4698	// SCHEMA_OBJECT_CHANGE_GROUP
4699	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
4700	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
4701	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
4702	// USER_CHANGE_PASSWORD_GROUP
4703	// BATCH_STARTED_GROUP
4704	// BATCH_COMPLETED_GROUP
4705	//
4706	// 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.
4707	//
4708	// 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).
4709	//
4710	// 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:
4711	// SELECT
4712	// UPDATE
4713	// INSERT
4714	// DELETE
4715	// EXECUTE
4716	// RECEIVE
4717	// REFERENCES
4718	//
4719	// The general form for defining an action to be audited is:
4720	// {action} ON {object} BY {principal}
4721	//
4722	// 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.
4723	//
4724	// For example:
4725	// SELECT on dbo.myTable by public
4726	// SELECT on DATABASE::myDatabase by public
4727	// SELECT on SCHEMA::mySchema by public
4728	//
4729	// 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)
4730	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
4731	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
4732	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
4733	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
4734	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
4735	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
4736	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
4737	//
4738	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
4739	// Note that for server level audit you should use the 'master' database as {databaseName}.
4740	//
4741	// Diagnostic Settings URI format:
4742	// 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
4743	//
4744	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
4745	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
4746	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
4747	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
4748	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
4749	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
4750}
4751
4752// ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
4753// results of a long-running operation.
4754type ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture struct {
4755	azure.FutureAPI
4756	// Result returns the result of the asynchronous operation.
4757	// If the operation has not completed it will return an error.
4758	Result func(ExtendedServerBlobAuditingPoliciesClient) (ExtendedServerBlobAuditingPolicy, error)
4759}
4760
4761// ExtendedServerBlobAuditingPolicy an extended server blob auditing policy.
4762type ExtendedServerBlobAuditingPolicy struct {
4763	autorest.Response `json:"-"`
4764	// ExtendedServerBlobAuditingPolicyProperties - Resource properties.
4765	*ExtendedServerBlobAuditingPolicyProperties `json:"properties,omitempty"`
4766	// ID - READ-ONLY; Resource ID.
4767	ID *string `json:"id,omitempty"`
4768	// Name - READ-ONLY; Resource name.
4769	Name *string `json:"name,omitempty"`
4770	// Type - READ-ONLY; Resource type.
4771	Type *string `json:"type,omitempty"`
4772}
4773
4774// MarshalJSON is the custom marshaler for ExtendedServerBlobAuditingPolicy.
4775func (esbap ExtendedServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
4776	objectMap := make(map[string]interface{})
4777	if esbap.ExtendedServerBlobAuditingPolicyProperties != nil {
4778		objectMap["properties"] = esbap.ExtendedServerBlobAuditingPolicyProperties
4779	}
4780	return json.Marshal(objectMap)
4781}
4782
4783// UnmarshalJSON is the custom unmarshaler for ExtendedServerBlobAuditingPolicy struct.
4784func (esbap *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
4785	var m map[string]*json.RawMessage
4786	err := json.Unmarshal(body, &m)
4787	if err != nil {
4788		return err
4789	}
4790	for k, v := range m {
4791		switch k {
4792		case "properties":
4793			if v != nil {
4794				var extendedServerBlobAuditingPolicyProperties ExtendedServerBlobAuditingPolicyProperties
4795				err = json.Unmarshal(*v, &extendedServerBlobAuditingPolicyProperties)
4796				if err != nil {
4797					return err
4798				}
4799				esbap.ExtendedServerBlobAuditingPolicyProperties = &extendedServerBlobAuditingPolicyProperties
4800			}
4801		case "id":
4802			if v != nil {
4803				var ID string
4804				err = json.Unmarshal(*v, &ID)
4805				if err != nil {
4806					return err
4807				}
4808				esbap.ID = &ID
4809			}
4810		case "name":
4811			if v != nil {
4812				var name string
4813				err = json.Unmarshal(*v, &name)
4814				if err != nil {
4815					return err
4816				}
4817				esbap.Name = &name
4818			}
4819		case "type":
4820			if v != nil {
4821				var typeVar string
4822				err = json.Unmarshal(*v, &typeVar)
4823				if err != nil {
4824					return err
4825				}
4826				esbap.Type = &typeVar
4827			}
4828		}
4829	}
4830
4831	return nil
4832}
4833
4834// ExtendedServerBlobAuditingPolicyListResult a list of server extended auditing settings.
4835type ExtendedServerBlobAuditingPolicyListResult struct {
4836	autorest.Response `json:"-"`
4837	// Value - READ-ONLY; Array of results.
4838	Value *[]ExtendedServerBlobAuditingPolicy `json:"value,omitempty"`
4839	// NextLink - READ-ONLY; Link to retrieve next page of results.
4840	NextLink *string `json:"nextLink,omitempty"`
4841}
4842
4843// ExtendedServerBlobAuditingPolicyListResultIterator provides access to a complete listing of
4844// ExtendedServerBlobAuditingPolicy values.
4845type ExtendedServerBlobAuditingPolicyListResultIterator struct {
4846	i    int
4847	page ExtendedServerBlobAuditingPolicyListResultPage
4848}
4849
4850// NextWithContext advances to the next value.  If there was an error making
4851// the request the iterator does not advance and the error is returned.
4852func (iter *ExtendedServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
4853	if tracing.IsEnabled() {
4854		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultIterator.NextWithContext")
4855		defer func() {
4856			sc := -1
4857			if iter.Response().Response.Response != nil {
4858				sc = iter.Response().Response.Response.StatusCode
4859			}
4860			tracing.EndSpan(ctx, sc, err)
4861		}()
4862	}
4863	iter.i++
4864	if iter.i < len(iter.page.Values()) {
4865		return nil
4866	}
4867	err = iter.page.NextWithContext(ctx)
4868	if err != nil {
4869		iter.i--
4870		return err
4871	}
4872	iter.i = 0
4873	return nil
4874}
4875
4876// Next advances to the next value.  If there was an error making
4877// the request the iterator does not advance and the error is returned.
4878// Deprecated: Use NextWithContext() instead.
4879func (iter *ExtendedServerBlobAuditingPolicyListResultIterator) Next() error {
4880	return iter.NextWithContext(context.Background())
4881}
4882
4883// NotDone returns true if the enumeration should be started or is not yet complete.
4884func (iter ExtendedServerBlobAuditingPolicyListResultIterator) NotDone() bool {
4885	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4886}
4887
4888// Response returns the raw server response from the last page request.
4889func (iter ExtendedServerBlobAuditingPolicyListResultIterator) Response() ExtendedServerBlobAuditingPolicyListResult {
4890	return iter.page.Response()
4891}
4892
4893// Value returns the current value or a zero-initialized value if the
4894// iterator has advanced beyond the end of the collection.
4895func (iter ExtendedServerBlobAuditingPolicyListResultIterator) Value() ExtendedServerBlobAuditingPolicy {
4896	if !iter.page.NotDone() {
4897		return ExtendedServerBlobAuditingPolicy{}
4898	}
4899	return iter.page.Values()[iter.i]
4900}
4901
4902// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultIterator type.
4903func NewExtendedServerBlobAuditingPolicyListResultIterator(page ExtendedServerBlobAuditingPolicyListResultPage) ExtendedServerBlobAuditingPolicyListResultIterator {
4904	return ExtendedServerBlobAuditingPolicyListResultIterator{page: page}
4905}
4906
4907// IsEmpty returns true if the ListResult contains no values.
4908func (esbaplr ExtendedServerBlobAuditingPolicyListResult) IsEmpty() bool {
4909	return esbaplr.Value == nil || len(*esbaplr.Value) == 0
4910}
4911
4912// hasNextLink returns true if the NextLink is not empty.
4913func (esbaplr ExtendedServerBlobAuditingPolicyListResult) hasNextLink() bool {
4914	return esbaplr.NextLink != nil && len(*esbaplr.NextLink) != 0
4915}
4916
4917// extendedServerBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
4918// It returns nil if no more results exist.
4919func (esbaplr ExtendedServerBlobAuditingPolicyListResult) extendedServerBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
4920	if !esbaplr.hasNextLink() {
4921		return nil, nil
4922	}
4923	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4924		autorest.AsJSON(),
4925		autorest.AsGet(),
4926		autorest.WithBaseURL(to.String(esbaplr.NextLink)))
4927}
4928
4929// ExtendedServerBlobAuditingPolicyListResultPage contains a page of ExtendedServerBlobAuditingPolicy
4930// values.
4931type ExtendedServerBlobAuditingPolicyListResultPage struct {
4932	fn      func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)
4933	esbaplr ExtendedServerBlobAuditingPolicyListResult
4934}
4935
4936// NextWithContext advances to the next page of values.  If there was an error making
4937// the request the page does not advance and the error is returned.
4938func (page *ExtendedServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
4939	if tracing.IsEnabled() {
4940		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultPage.NextWithContext")
4941		defer func() {
4942			sc := -1
4943			if page.Response().Response.Response != nil {
4944				sc = page.Response().Response.Response.StatusCode
4945			}
4946			tracing.EndSpan(ctx, sc, err)
4947		}()
4948	}
4949	for {
4950		next, err := page.fn(ctx, page.esbaplr)
4951		if err != nil {
4952			return err
4953		}
4954		page.esbaplr = next
4955		if !next.hasNextLink() || !next.IsEmpty() {
4956			break
4957		}
4958	}
4959	return nil
4960}
4961
4962// Next advances to the next page of values.  If there was an error making
4963// the request the page does not advance and the error is returned.
4964// Deprecated: Use NextWithContext() instead.
4965func (page *ExtendedServerBlobAuditingPolicyListResultPage) Next() error {
4966	return page.NextWithContext(context.Background())
4967}
4968
4969// NotDone returns true if the page enumeration should be started or is not yet complete.
4970func (page ExtendedServerBlobAuditingPolicyListResultPage) NotDone() bool {
4971	return !page.esbaplr.IsEmpty()
4972}
4973
4974// Response returns the raw server response from the last page request.
4975func (page ExtendedServerBlobAuditingPolicyListResultPage) Response() ExtendedServerBlobAuditingPolicyListResult {
4976	return page.esbaplr
4977}
4978
4979// Values returns the slice of values for the current page or nil if there are no values.
4980func (page ExtendedServerBlobAuditingPolicyListResultPage) Values() []ExtendedServerBlobAuditingPolicy {
4981	if page.esbaplr.IsEmpty() {
4982		return nil
4983	}
4984	return *page.esbaplr.Value
4985}
4986
4987// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultPage type.
4988func NewExtendedServerBlobAuditingPolicyListResultPage(cur ExtendedServerBlobAuditingPolicyListResult, getNextPage func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)) ExtendedServerBlobAuditingPolicyListResultPage {
4989	return ExtendedServerBlobAuditingPolicyListResultPage{
4990		fn:      getNextPage,
4991		esbaplr: cur,
4992	}
4993}
4994
4995// ExtendedServerBlobAuditingPolicyProperties properties of an extended server blob auditing policy.
4996type ExtendedServerBlobAuditingPolicyProperties struct {
4997	// PredicateExpression - Specifies condition of where clause when creating an audit.
4998	PredicateExpression *string `json:"predicateExpression,omitempty"`
4999	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
5000	State BlobAuditingPolicyState `json:"state,omitempty"`
5001	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
5002	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
5003	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
5004	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
5005	// Prerequisites for using managed identity authentication:
5006	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
5007	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
5008	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
5009	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
5010	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
5011	RetentionDays *int32 `json:"retentionDays,omitempty"`
5012	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
5013	//
5014	// 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:
5015	//
5016	// BATCH_COMPLETED_GROUP,
5017	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
5018	// FAILED_DATABASE_AUTHENTICATION_GROUP.
5019	//
5020	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
5021	//
5022	// 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):
5023	//
5024	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
5025	// BACKUP_RESTORE_GROUP
5026	// DATABASE_LOGOUT_GROUP
5027	// DATABASE_OBJECT_CHANGE_GROUP
5028	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
5029	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
5030	// DATABASE_OPERATION_GROUP
5031	// DATABASE_PERMISSION_CHANGE_GROUP
5032	// DATABASE_PRINCIPAL_CHANGE_GROUP
5033	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
5034	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
5035	// FAILED_DATABASE_AUTHENTICATION_GROUP
5036	// SCHEMA_OBJECT_ACCESS_GROUP
5037	// SCHEMA_OBJECT_CHANGE_GROUP
5038	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
5039	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
5040	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
5041	// USER_CHANGE_PASSWORD_GROUP
5042	// BATCH_STARTED_GROUP
5043	// BATCH_COMPLETED_GROUP
5044	//
5045	// 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.
5046	//
5047	// 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).
5048	//
5049	// 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:
5050	// SELECT
5051	// UPDATE
5052	// INSERT
5053	// DELETE
5054	// EXECUTE
5055	// RECEIVE
5056	// REFERENCES
5057	//
5058	// The general form for defining an action to be audited is:
5059	// {action} ON {object} BY {principal}
5060	//
5061	// 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.
5062	//
5063	// For example:
5064	// SELECT on dbo.myTable by public
5065	// SELECT on DATABASE::myDatabase by public
5066	// SELECT on SCHEMA::mySchema by public
5067	//
5068	// 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)
5069	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
5070	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
5071	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
5072	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
5073	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
5074	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
5075	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
5076	//
5077	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
5078	// Note that for server level audit you should use the 'master' database as {databaseName}.
5079	//
5080	// Diagnostic Settings URI format:
5081	// 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
5082	//
5083	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
5084	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
5085	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
5086	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
5087	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
5088	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
5089}
5090
5091// FailoverGroup a failover group.
5092type FailoverGroup struct {
5093	autorest.Response `json:"-"`
5094	// Location - READ-ONLY; Resource location.
5095	Location *string `json:"location,omitempty"`
5096	// Tags - Resource tags.
5097	Tags map[string]*string `json:"tags"`
5098	// FailoverGroupProperties - Resource properties.
5099	*FailoverGroupProperties `json:"properties,omitempty"`
5100	// ID - READ-ONLY; Resource ID.
5101	ID *string `json:"id,omitempty"`
5102	// Name - READ-ONLY; Resource name.
5103	Name *string `json:"name,omitempty"`
5104	// Type - READ-ONLY; Resource type.
5105	Type *string `json:"type,omitempty"`
5106}
5107
5108// MarshalJSON is the custom marshaler for FailoverGroup.
5109func (fg FailoverGroup) MarshalJSON() ([]byte, error) {
5110	objectMap := make(map[string]interface{})
5111	if fg.Tags != nil {
5112		objectMap["tags"] = fg.Tags
5113	}
5114	if fg.FailoverGroupProperties != nil {
5115		objectMap["properties"] = fg.FailoverGroupProperties
5116	}
5117	return json.Marshal(objectMap)
5118}
5119
5120// UnmarshalJSON is the custom unmarshaler for FailoverGroup struct.
5121func (fg *FailoverGroup) UnmarshalJSON(body []byte) error {
5122	var m map[string]*json.RawMessage
5123	err := json.Unmarshal(body, &m)
5124	if err != nil {
5125		return err
5126	}
5127	for k, v := range m {
5128		switch k {
5129		case "location":
5130			if v != nil {
5131				var location string
5132				err = json.Unmarshal(*v, &location)
5133				if err != nil {
5134					return err
5135				}
5136				fg.Location = &location
5137			}
5138		case "tags":
5139			if v != nil {
5140				var tags map[string]*string
5141				err = json.Unmarshal(*v, &tags)
5142				if err != nil {
5143					return err
5144				}
5145				fg.Tags = tags
5146			}
5147		case "properties":
5148			if v != nil {
5149				var failoverGroupProperties FailoverGroupProperties
5150				err = json.Unmarshal(*v, &failoverGroupProperties)
5151				if err != nil {
5152					return err
5153				}
5154				fg.FailoverGroupProperties = &failoverGroupProperties
5155			}
5156		case "id":
5157			if v != nil {
5158				var ID string
5159				err = json.Unmarshal(*v, &ID)
5160				if err != nil {
5161					return err
5162				}
5163				fg.ID = &ID
5164			}
5165		case "name":
5166			if v != nil {
5167				var name string
5168				err = json.Unmarshal(*v, &name)
5169				if err != nil {
5170					return err
5171				}
5172				fg.Name = &name
5173			}
5174		case "type":
5175			if v != nil {
5176				var typeVar string
5177				err = json.Unmarshal(*v, &typeVar)
5178				if err != nil {
5179					return err
5180				}
5181				fg.Type = &typeVar
5182			}
5183		}
5184	}
5185
5186	return nil
5187}
5188
5189// FailoverGroupListResult a list of failover groups.
5190type FailoverGroupListResult struct {
5191	autorest.Response `json:"-"`
5192	// Value - READ-ONLY; Array of results.
5193	Value *[]FailoverGroup `json:"value,omitempty"`
5194	// NextLink - READ-ONLY; Link to retrieve next page of results.
5195	NextLink *string `json:"nextLink,omitempty"`
5196}
5197
5198// FailoverGroupListResultIterator provides access to a complete listing of FailoverGroup values.
5199type FailoverGroupListResultIterator struct {
5200	i    int
5201	page FailoverGroupListResultPage
5202}
5203
5204// NextWithContext advances to the next value.  If there was an error making
5205// the request the iterator does not advance and the error is returned.
5206func (iter *FailoverGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
5207	if tracing.IsEnabled() {
5208		ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupListResultIterator.NextWithContext")
5209		defer func() {
5210			sc := -1
5211			if iter.Response().Response.Response != nil {
5212				sc = iter.Response().Response.Response.StatusCode
5213			}
5214			tracing.EndSpan(ctx, sc, err)
5215		}()
5216	}
5217	iter.i++
5218	if iter.i < len(iter.page.Values()) {
5219		return nil
5220	}
5221	err = iter.page.NextWithContext(ctx)
5222	if err != nil {
5223		iter.i--
5224		return err
5225	}
5226	iter.i = 0
5227	return nil
5228}
5229
5230// Next advances to the next value.  If there was an error making
5231// the request the iterator does not advance and the error is returned.
5232// Deprecated: Use NextWithContext() instead.
5233func (iter *FailoverGroupListResultIterator) Next() error {
5234	return iter.NextWithContext(context.Background())
5235}
5236
5237// NotDone returns true if the enumeration should be started or is not yet complete.
5238func (iter FailoverGroupListResultIterator) NotDone() bool {
5239	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5240}
5241
5242// Response returns the raw server response from the last page request.
5243func (iter FailoverGroupListResultIterator) Response() FailoverGroupListResult {
5244	return iter.page.Response()
5245}
5246
5247// Value returns the current value or a zero-initialized value if the
5248// iterator has advanced beyond the end of the collection.
5249func (iter FailoverGroupListResultIterator) Value() FailoverGroup {
5250	if !iter.page.NotDone() {
5251		return FailoverGroup{}
5252	}
5253	return iter.page.Values()[iter.i]
5254}
5255
5256// Creates a new instance of the FailoverGroupListResultIterator type.
5257func NewFailoverGroupListResultIterator(page FailoverGroupListResultPage) FailoverGroupListResultIterator {
5258	return FailoverGroupListResultIterator{page: page}
5259}
5260
5261// IsEmpty returns true if the ListResult contains no values.
5262func (fglr FailoverGroupListResult) IsEmpty() bool {
5263	return fglr.Value == nil || len(*fglr.Value) == 0
5264}
5265
5266// hasNextLink returns true if the NextLink is not empty.
5267func (fglr FailoverGroupListResult) hasNextLink() bool {
5268	return fglr.NextLink != nil && len(*fglr.NextLink) != 0
5269}
5270
5271// failoverGroupListResultPreparer prepares a request to retrieve the next set of results.
5272// It returns nil if no more results exist.
5273func (fglr FailoverGroupListResult) failoverGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
5274	if !fglr.hasNextLink() {
5275		return nil, nil
5276	}
5277	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5278		autorest.AsJSON(),
5279		autorest.AsGet(),
5280		autorest.WithBaseURL(to.String(fglr.NextLink)))
5281}
5282
5283// FailoverGroupListResultPage contains a page of FailoverGroup values.
5284type FailoverGroupListResultPage struct {
5285	fn   func(context.Context, FailoverGroupListResult) (FailoverGroupListResult, error)
5286	fglr FailoverGroupListResult
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 *FailoverGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
5292	if tracing.IsEnabled() {
5293		ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupListResultPage.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.fglr)
5304		if err != nil {
5305			return err
5306		}
5307		page.fglr = 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 *FailoverGroupListResultPage) 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 FailoverGroupListResultPage) NotDone() bool {
5324	return !page.fglr.IsEmpty()
5325}
5326
5327// Response returns the raw server response from the last page request.
5328func (page FailoverGroupListResultPage) Response() FailoverGroupListResult {
5329	return page.fglr
5330}
5331
5332// Values returns the slice of values for the current page or nil if there are no values.
5333func (page FailoverGroupListResultPage) Values() []FailoverGroup {
5334	if page.fglr.IsEmpty() {
5335		return nil
5336	}
5337	return *page.fglr.Value
5338}
5339
5340// Creates a new instance of the FailoverGroupListResultPage type.
5341func NewFailoverGroupListResultPage(cur FailoverGroupListResult, getNextPage func(context.Context, FailoverGroupListResult) (FailoverGroupListResult, error)) FailoverGroupListResultPage {
5342	return FailoverGroupListResultPage{
5343		fn:   getNextPage,
5344		fglr: cur,
5345	}
5346}
5347
5348// FailoverGroupProperties properties of a failover group.
5349type FailoverGroupProperties struct {
5350	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
5351	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
5352	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
5353	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
5354	// ReplicationRole - READ-ONLY; Local replication role of the failover group instance. Possible values include: 'Primary', 'Secondary'
5355	ReplicationRole FailoverGroupReplicationRole `json:"replicationRole,omitempty"`
5356	// ReplicationState - READ-ONLY; Replication state of the failover group instance.
5357	ReplicationState *string `json:"replicationState,omitempty"`
5358	// PartnerServers - List of partner server information for the failover group.
5359	PartnerServers *[]PartnerInfo `json:"partnerServers,omitempty"`
5360	// Databases - List of databases in the failover group.
5361	Databases *[]string `json:"databases,omitempty"`
5362}
5363
5364// MarshalJSON is the custom marshaler for FailoverGroupProperties.
5365func (fgp FailoverGroupProperties) MarshalJSON() ([]byte, error) {
5366	objectMap := make(map[string]interface{})
5367	if fgp.ReadWriteEndpoint != nil {
5368		objectMap["readWriteEndpoint"] = fgp.ReadWriteEndpoint
5369	}
5370	if fgp.ReadOnlyEndpoint != nil {
5371		objectMap["readOnlyEndpoint"] = fgp.ReadOnlyEndpoint
5372	}
5373	if fgp.PartnerServers != nil {
5374		objectMap["partnerServers"] = fgp.PartnerServers
5375	}
5376	if fgp.Databases != nil {
5377		objectMap["databases"] = fgp.Databases
5378	}
5379	return json.Marshal(objectMap)
5380}
5381
5382// FailoverGroupReadOnlyEndpoint read-only endpoint of the failover group instance.
5383type FailoverGroupReadOnlyEndpoint struct {
5384	// FailoverPolicy - Failover policy of the read-only endpoint for the failover group. Possible values include: 'ReadOnlyEndpointFailoverPolicyDisabled', 'ReadOnlyEndpointFailoverPolicyEnabled'
5385	FailoverPolicy ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
5386}
5387
5388// FailoverGroupReadWriteEndpoint read-write endpoint of the failover group instance.
5389type FailoverGroupReadWriteEndpoint struct {
5390	// 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'
5391	FailoverPolicy ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
5392	// FailoverWithDataLossGracePeriodMinutes - Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
5393	FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
5394}
5395
5396// FailoverGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
5397// long-running operation.
5398type FailoverGroupsCreateOrUpdateFuture struct {
5399	azure.FutureAPI
5400	// Result returns the result of the asynchronous operation.
5401	// If the operation has not completed it will return an error.
5402	Result func(FailoverGroupsClient) (FailoverGroup, error)
5403}
5404
5405// FailoverGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
5406// operation.
5407type FailoverGroupsDeleteFuture struct {
5408	azure.FutureAPI
5409	// Result returns the result of the asynchronous operation.
5410	// If the operation has not completed it will return an error.
5411	Result func(FailoverGroupsClient) (autorest.Response, error)
5412}
5413
5414// FailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
5415// operation.
5416type FailoverGroupsFailoverFuture struct {
5417	azure.FutureAPI
5418	// Result returns the result of the asynchronous operation.
5419	// If the operation has not completed it will return an error.
5420	Result func(FailoverGroupsClient) (FailoverGroup, error)
5421}
5422
5423// FailoverGroupsForceFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results
5424// of a long-running operation.
5425type FailoverGroupsForceFailoverAllowDataLossFuture struct {
5426	azure.FutureAPI
5427	// Result returns the result of the asynchronous operation.
5428	// If the operation has not completed it will return an error.
5429	Result func(FailoverGroupsClient) (FailoverGroup, error)
5430}
5431
5432// FailoverGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
5433// operation.
5434type FailoverGroupsUpdateFuture struct {
5435	azure.FutureAPI
5436	// Result returns the result of the asynchronous operation.
5437	// If the operation has not completed it will return an error.
5438	Result func(FailoverGroupsClient) (FailoverGroup, error)
5439}
5440
5441// FailoverGroupUpdate a failover group update request.
5442type FailoverGroupUpdate struct {
5443	// FailoverGroupUpdateProperties - Resource properties.
5444	*FailoverGroupUpdateProperties `json:"properties,omitempty"`
5445	// Tags - Resource tags.
5446	Tags map[string]*string `json:"tags"`
5447}
5448
5449// MarshalJSON is the custom marshaler for FailoverGroupUpdate.
5450func (fgu FailoverGroupUpdate) MarshalJSON() ([]byte, error) {
5451	objectMap := make(map[string]interface{})
5452	if fgu.FailoverGroupUpdateProperties != nil {
5453		objectMap["properties"] = fgu.FailoverGroupUpdateProperties
5454	}
5455	if fgu.Tags != nil {
5456		objectMap["tags"] = fgu.Tags
5457	}
5458	return json.Marshal(objectMap)
5459}
5460
5461// UnmarshalJSON is the custom unmarshaler for FailoverGroupUpdate struct.
5462func (fgu *FailoverGroupUpdate) UnmarshalJSON(body []byte) error {
5463	var m map[string]*json.RawMessage
5464	err := json.Unmarshal(body, &m)
5465	if err != nil {
5466		return err
5467	}
5468	for k, v := range m {
5469		switch k {
5470		case "properties":
5471			if v != nil {
5472				var failoverGroupUpdateProperties FailoverGroupUpdateProperties
5473				err = json.Unmarshal(*v, &failoverGroupUpdateProperties)
5474				if err != nil {
5475					return err
5476				}
5477				fgu.FailoverGroupUpdateProperties = &failoverGroupUpdateProperties
5478			}
5479		case "tags":
5480			if v != nil {
5481				var tags map[string]*string
5482				err = json.Unmarshal(*v, &tags)
5483				if err != nil {
5484					return err
5485				}
5486				fgu.Tags = tags
5487			}
5488		}
5489	}
5490
5491	return nil
5492}
5493
5494// FailoverGroupUpdateProperties properties of a failover group update.
5495type FailoverGroupUpdateProperties struct {
5496	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
5497	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
5498	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
5499	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
5500	// Databases - List of databases in the failover group.
5501	Databases *[]string `json:"databases,omitempty"`
5502}
5503
5504// FirewallRule represents a server firewall rule.
5505type FirewallRule struct {
5506	autorest.Response `json:"-"`
5507	// Kind - READ-ONLY; Kind of server that contains this firewall rule.
5508	Kind *string `json:"kind,omitempty"`
5509	// Location - READ-ONLY; Location of the server that contains this firewall rule.
5510	Location *string `json:"location,omitempty"`
5511	// FirewallRuleProperties - The properties representing the resource.
5512	*FirewallRuleProperties `json:"properties,omitempty"`
5513	// ID - READ-ONLY; Resource ID.
5514	ID *string `json:"id,omitempty"`
5515	// Name - READ-ONLY; Resource name.
5516	Name *string `json:"name,omitempty"`
5517	// Type - READ-ONLY; Resource type.
5518	Type *string `json:"type,omitempty"`
5519}
5520
5521// MarshalJSON is the custom marshaler for FirewallRule.
5522func (fr FirewallRule) MarshalJSON() ([]byte, error) {
5523	objectMap := make(map[string]interface{})
5524	if fr.FirewallRuleProperties != nil {
5525		objectMap["properties"] = fr.FirewallRuleProperties
5526	}
5527	return json.Marshal(objectMap)
5528}
5529
5530// UnmarshalJSON is the custom unmarshaler for FirewallRule struct.
5531func (fr *FirewallRule) UnmarshalJSON(body []byte) error {
5532	var m map[string]*json.RawMessage
5533	err := json.Unmarshal(body, &m)
5534	if err != nil {
5535		return err
5536	}
5537	for k, v := range m {
5538		switch k {
5539		case "kind":
5540			if v != nil {
5541				var kind string
5542				err = json.Unmarshal(*v, &kind)
5543				if err != nil {
5544					return err
5545				}
5546				fr.Kind = &kind
5547			}
5548		case "location":
5549			if v != nil {
5550				var location string
5551				err = json.Unmarshal(*v, &location)
5552				if err != nil {
5553					return err
5554				}
5555				fr.Location = &location
5556			}
5557		case "properties":
5558			if v != nil {
5559				var firewallRuleProperties FirewallRuleProperties
5560				err = json.Unmarshal(*v, &firewallRuleProperties)
5561				if err != nil {
5562					return err
5563				}
5564				fr.FirewallRuleProperties = &firewallRuleProperties
5565			}
5566		case "id":
5567			if v != nil {
5568				var ID string
5569				err = json.Unmarshal(*v, &ID)
5570				if err != nil {
5571					return err
5572				}
5573				fr.ID = &ID
5574			}
5575		case "name":
5576			if v != nil {
5577				var name string
5578				err = json.Unmarshal(*v, &name)
5579				if err != nil {
5580					return err
5581				}
5582				fr.Name = &name
5583			}
5584		case "type":
5585			if v != nil {
5586				var typeVar string
5587				err = json.Unmarshal(*v, &typeVar)
5588				if err != nil {
5589					return err
5590				}
5591				fr.Type = &typeVar
5592			}
5593		}
5594	}
5595
5596	return nil
5597}
5598
5599// FirewallRuleListResult represents the response to a List Firewall Rules request.
5600type FirewallRuleListResult struct {
5601	autorest.Response `json:"-"`
5602	// Value - The list of server firewall rules.
5603	Value *[]FirewallRule `json:"value,omitempty"`
5604}
5605
5606// FirewallRuleProperties represents the properties of a server firewall rule.
5607type FirewallRuleProperties struct {
5608	// 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.
5609	StartIPAddress *string `json:"startIpAddress,omitempty"`
5610	// 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.
5611	EndIPAddress *string `json:"endIpAddress,omitempty"`
5612}
5613
5614// GeoBackupPolicy a database geo backup policy.
5615type GeoBackupPolicy struct {
5616	autorest.Response `json:"-"`
5617	// GeoBackupPolicyProperties - The properties of the geo backup policy.
5618	*GeoBackupPolicyProperties `json:"properties,omitempty"`
5619	// Kind - READ-ONLY; Kind of geo backup policy.  This is metadata used for the Azure portal experience.
5620	Kind *string `json:"kind,omitempty"`
5621	// Location - READ-ONLY; Backup policy location.
5622	Location *string `json:"location,omitempty"`
5623	// ID - READ-ONLY; Resource ID.
5624	ID *string `json:"id,omitempty"`
5625	// Name - READ-ONLY; Resource name.
5626	Name *string `json:"name,omitempty"`
5627	// Type - READ-ONLY; Resource type.
5628	Type *string `json:"type,omitempty"`
5629}
5630
5631// MarshalJSON is the custom marshaler for GeoBackupPolicy.
5632func (gbp GeoBackupPolicy) MarshalJSON() ([]byte, error) {
5633	objectMap := make(map[string]interface{})
5634	if gbp.GeoBackupPolicyProperties != nil {
5635		objectMap["properties"] = gbp.GeoBackupPolicyProperties
5636	}
5637	return json.Marshal(objectMap)
5638}
5639
5640// UnmarshalJSON is the custom unmarshaler for GeoBackupPolicy struct.
5641func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error {
5642	var m map[string]*json.RawMessage
5643	err := json.Unmarshal(body, &m)
5644	if err != nil {
5645		return err
5646	}
5647	for k, v := range m {
5648		switch k {
5649		case "properties":
5650			if v != nil {
5651				var geoBackupPolicyProperties GeoBackupPolicyProperties
5652				err = json.Unmarshal(*v, &geoBackupPolicyProperties)
5653				if err != nil {
5654					return err
5655				}
5656				gbp.GeoBackupPolicyProperties = &geoBackupPolicyProperties
5657			}
5658		case "kind":
5659			if v != nil {
5660				var kind string
5661				err = json.Unmarshal(*v, &kind)
5662				if err != nil {
5663					return err
5664				}
5665				gbp.Kind = &kind
5666			}
5667		case "location":
5668			if v != nil {
5669				var location string
5670				err = json.Unmarshal(*v, &location)
5671				if err != nil {
5672					return err
5673				}
5674				gbp.Location = &location
5675			}
5676		case "id":
5677			if v != nil {
5678				var ID string
5679				err = json.Unmarshal(*v, &ID)
5680				if err != nil {
5681					return err
5682				}
5683				gbp.ID = &ID
5684			}
5685		case "name":
5686			if v != nil {
5687				var name string
5688				err = json.Unmarshal(*v, &name)
5689				if err != nil {
5690					return err
5691				}
5692				gbp.Name = &name
5693			}
5694		case "type":
5695			if v != nil {
5696				var typeVar string
5697				err = json.Unmarshal(*v, &typeVar)
5698				if err != nil {
5699					return err
5700				}
5701				gbp.Type = &typeVar
5702			}
5703		}
5704	}
5705
5706	return nil
5707}
5708
5709// GeoBackupPolicyListResult the response to a list geo backup policies request.
5710type GeoBackupPolicyListResult struct {
5711	autorest.Response `json:"-"`
5712	// Value - The list of geo backup policies.
5713	Value *[]GeoBackupPolicy `json:"value,omitempty"`
5714}
5715
5716// GeoBackupPolicyProperties the properties of the geo backup policy.
5717type GeoBackupPolicyProperties struct {
5718	// State - The state of the geo backup policy. Possible values include: 'GeoBackupPolicyStateDisabled', 'GeoBackupPolicyStateEnabled'
5719	State GeoBackupPolicyState `json:"state,omitempty"`
5720	// StorageType - READ-ONLY; The storage type of the geo backup policy.
5721	StorageType *string `json:"storageType,omitempty"`
5722}
5723
5724// MarshalJSON is the custom marshaler for GeoBackupPolicyProperties.
5725func (gbpp GeoBackupPolicyProperties) MarshalJSON() ([]byte, error) {
5726	objectMap := make(map[string]interface{})
5727	if gbpp.State != "" {
5728		objectMap["state"] = gbpp.State
5729	}
5730	return json.Marshal(objectMap)
5731}
5732
5733// ImportExistingDatabaseDefinition contains the information necessary to perform import operation for
5734// existing database.
5735type ImportExistingDatabaseDefinition struct {
5736	// StorageKeyType - Storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey'
5737	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
5738	// StorageKey - Storage key.
5739	StorageKey *string `json:"storageKey,omitempty"`
5740	// StorageURI - Storage Uri.
5741	StorageURI *string `json:"storageUri,omitempty"`
5742	// AdministratorLogin - Administrator login name.
5743	AdministratorLogin *string `json:"administratorLogin,omitempty"`
5744	// AdministratorLoginPassword - Administrator login password.
5745	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
5746	// AuthenticationType - Authentication type.
5747	AuthenticationType *string `json:"authenticationType,omitempty"`
5748	// NetworkIsolation - Optional resource information to enable network isolation for request.
5749	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
5750}
5751
5752// ImportExportImportFuture an abstraction for monitoring and retrieving the results of a long-running
5753// operation.
5754type ImportExportImportFuture struct {
5755	azure.FutureAPI
5756	// Result returns the result of the asynchronous operation.
5757	// If the operation has not completed it will return an error.
5758	Result func(ImportExportClient) (ImportExportOperationResult, error)
5759}
5760
5761// ImportExportOperationResult an ImportExport operation result resource.
5762type ImportExportOperationResult struct {
5763	autorest.Response `json:"-"`
5764	// ImportExportOperationResultProperties - Resource properties.
5765	*ImportExportOperationResultProperties `json:"properties,omitempty"`
5766	// ID - READ-ONLY; Resource ID.
5767	ID *string `json:"id,omitempty"`
5768	// Name - READ-ONLY; Resource name.
5769	Name *string `json:"name,omitempty"`
5770	// Type - READ-ONLY; Resource type.
5771	Type *string `json:"type,omitempty"`
5772}
5773
5774// MarshalJSON is the custom marshaler for ImportExportOperationResult.
5775func (ieor ImportExportOperationResult) MarshalJSON() ([]byte, error) {
5776	objectMap := make(map[string]interface{})
5777	if ieor.ImportExportOperationResultProperties != nil {
5778		objectMap["properties"] = ieor.ImportExportOperationResultProperties
5779	}
5780	return json.Marshal(objectMap)
5781}
5782
5783// UnmarshalJSON is the custom unmarshaler for ImportExportOperationResult struct.
5784func (ieor *ImportExportOperationResult) UnmarshalJSON(body []byte) error {
5785	var m map[string]*json.RawMessage
5786	err := json.Unmarshal(body, &m)
5787	if err != nil {
5788		return err
5789	}
5790	for k, v := range m {
5791		switch k {
5792		case "properties":
5793			if v != nil {
5794				var importExportOperationResultProperties ImportExportOperationResultProperties
5795				err = json.Unmarshal(*v, &importExportOperationResultProperties)
5796				if err != nil {
5797					return err
5798				}
5799				ieor.ImportExportOperationResultProperties = &importExportOperationResultProperties
5800			}
5801		case "id":
5802			if v != nil {
5803				var ID string
5804				err = json.Unmarshal(*v, &ID)
5805				if err != nil {
5806					return err
5807				}
5808				ieor.ID = &ID
5809			}
5810		case "name":
5811			if v != nil {
5812				var name string
5813				err = json.Unmarshal(*v, &name)
5814				if err != nil {
5815					return err
5816				}
5817				ieor.Name = &name
5818			}
5819		case "type":
5820			if v != nil {
5821				var typeVar string
5822				err = json.Unmarshal(*v, &typeVar)
5823				if err != nil {
5824					return err
5825				}
5826				ieor.Type = &typeVar
5827			}
5828		}
5829	}
5830
5831	return nil
5832}
5833
5834// ImportExportOperationResultProperties contains the operation result properties for import/export
5835// operation.
5836type ImportExportOperationResultProperties struct {
5837	// RequestID - READ-ONLY; Request Id.
5838	RequestID *uuid.UUID `json:"requestId,omitempty"`
5839	// RequestType - READ-ONLY; Request type.
5840	RequestType *string `json:"requestType,omitempty"`
5841	// QueuedTime - READ-ONLY; Queued time.
5842	QueuedTime *string `json:"queuedTime,omitempty"`
5843	// LastModifiedTime - READ-ONLY; Last modified time.
5844	LastModifiedTime *string `json:"lastModifiedTime,omitempty"`
5845	// BlobURI - READ-ONLY; Blob Uri.
5846	BlobURI *string `json:"blobUri,omitempty"`
5847	// ServerName - READ-ONLY; Server name.
5848	ServerName *string `json:"serverName,omitempty"`
5849	// DatabaseName - READ-ONLY; Database name.
5850	DatabaseName *string `json:"databaseName,omitempty"`
5851	// Status - READ-ONLY; Operation status.
5852	Status *string `json:"status,omitempty"`
5853	// ErrorMessage - READ-ONLY; Error message.
5854	ErrorMessage *string `json:"errorMessage,omitempty"`
5855	// PrivateEndpointConnections - READ-ONLY; Gets the status of private endpoints associated with this request.
5856	PrivateEndpointConnections *[]PrivateEndpointConnectionRequestStatus `json:"privateEndpointConnections,omitempty"`
5857}
5858
5859// ImportNewDatabaseDefinition contains the information necessary to perform import operation for new
5860// database.
5861type ImportNewDatabaseDefinition struct {
5862	// DatabaseName - Name of the import database.
5863	DatabaseName *string `json:"databaseName,omitempty"`
5864	// Edition - Edition of the import database.
5865	Edition *string `json:"edition,omitempty"`
5866	// ServiceObjectiveName - Service level objective name of the import database.
5867	ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"`
5868	// MaxSizeBytes - Max size in bytes for the import database.
5869	MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`
5870	// StorageKeyType - Storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey'
5871	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
5872	// StorageKey - Storage key.
5873	StorageKey *string `json:"storageKey,omitempty"`
5874	// StorageURI - Storage Uri.
5875	StorageURI *string `json:"storageUri,omitempty"`
5876	// AdministratorLogin - Administrator login name.
5877	AdministratorLogin *string `json:"administratorLogin,omitempty"`
5878	// AdministratorLoginPassword - Administrator login password.
5879	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
5880	// AuthenticationType - Authentication type.
5881	AuthenticationType *string `json:"authenticationType,omitempty"`
5882	// NetworkIsolation - Optional resource information to enable network isolation for request.
5883	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
5884}
5885
5886// InstanceFailoverGroup an instance failover group.
5887type InstanceFailoverGroup struct {
5888	autorest.Response `json:"-"`
5889	// InstanceFailoverGroupProperties - Resource properties.
5890	*InstanceFailoverGroupProperties `json:"properties,omitempty"`
5891	// ID - READ-ONLY; Resource ID.
5892	ID *string `json:"id,omitempty"`
5893	// Name - READ-ONLY; Resource name.
5894	Name *string `json:"name,omitempty"`
5895	// Type - READ-ONLY; Resource type.
5896	Type *string `json:"type,omitempty"`
5897}
5898
5899// MarshalJSON is the custom marshaler for InstanceFailoverGroup.
5900func (ifg InstanceFailoverGroup) MarshalJSON() ([]byte, error) {
5901	objectMap := make(map[string]interface{})
5902	if ifg.InstanceFailoverGroupProperties != nil {
5903		objectMap["properties"] = ifg.InstanceFailoverGroupProperties
5904	}
5905	return json.Marshal(objectMap)
5906}
5907
5908// UnmarshalJSON is the custom unmarshaler for InstanceFailoverGroup struct.
5909func (ifg *InstanceFailoverGroup) UnmarshalJSON(body []byte) error {
5910	var m map[string]*json.RawMessage
5911	err := json.Unmarshal(body, &m)
5912	if err != nil {
5913		return err
5914	}
5915	for k, v := range m {
5916		switch k {
5917		case "properties":
5918			if v != nil {
5919				var instanceFailoverGroupProperties InstanceFailoverGroupProperties
5920				err = json.Unmarshal(*v, &instanceFailoverGroupProperties)
5921				if err != nil {
5922					return err
5923				}
5924				ifg.InstanceFailoverGroupProperties = &instanceFailoverGroupProperties
5925			}
5926		case "id":
5927			if v != nil {
5928				var ID string
5929				err = json.Unmarshal(*v, &ID)
5930				if err != nil {
5931					return err
5932				}
5933				ifg.ID = &ID
5934			}
5935		case "name":
5936			if v != nil {
5937				var name string
5938				err = json.Unmarshal(*v, &name)
5939				if err != nil {
5940					return err
5941				}
5942				ifg.Name = &name
5943			}
5944		case "type":
5945			if v != nil {
5946				var typeVar string
5947				err = json.Unmarshal(*v, &typeVar)
5948				if err != nil {
5949					return err
5950				}
5951				ifg.Type = &typeVar
5952			}
5953		}
5954	}
5955
5956	return nil
5957}
5958
5959// InstanceFailoverGroupListResult a list of instance failover groups.
5960type InstanceFailoverGroupListResult struct {
5961	autorest.Response `json:"-"`
5962	// Value - READ-ONLY; Array of results.
5963	Value *[]InstanceFailoverGroup `json:"value,omitempty"`
5964	// NextLink - READ-ONLY; Link to retrieve next page of results.
5965	NextLink *string `json:"nextLink,omitempty"`
5966}
5967
5968// InstanceFailoverGroupListResultIterator provides access to a complete listing of InstanceFailoverGroup
5969// values.
5970type InstanceFailoverGroupListResultIterator struct {
5971	i    int
5972	page InstanceFailoverGroupListResultPage
5973}
5974
5975// NextWithContext advances to the next value.  If there was an error making
5976// the request the iterator does not advance and the error is returned.
5977func (iter *InstanceFailoverGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
5978	if tracing.IsEnabled() {
5979		ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupListResultIterator.NextWithContext")
5980		defer func() {
5981			sc := -1
5982			if iter.Response().Response.Response != nil {
5983				sc = iter.Response().Response.Response.StatusCode
5984			}
5985			tracing.EndSpan(ctx, sc, err)
5986		}()
5987	}
5988	iter.i++
5989	if iter.i < len(iter.page.Values()) {
5990		return nil
5991	}
5992	err = iter.page.NextWithContext(ctx)
5993	if err != nil {
5994		iter.i--
5995		return err
5996	}
5997	iter.i = 0
5998	return nil
5999}
6000
6001// Next advances to the next value.  If there was an error making
6002// the request the iterator does not advance and the error is returned.
6003// Deprecated: Use NextWithContext() instead.
6004func (iter *InstanceFailoverGroupListResultIterator) Next() error {
6005	return iter.NextWithContext(context.Background())
6006}
6007
6008// NotDone returns true if the enumeration should be started or is not yet complete.
6009func (iter InstanceFailoverGroupListResultIterator) NotDone() bool {
6010	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6011}
6012
6013// Response returns the raw server response from the last page request.
6014func (iter InstanceFailoverGroupListResultIterator) Response() InstanceFailoverGroupListResult {
6015	return iter.page.Response()
6016}
6017
6018// Value returns the current value or a zero-initialized value if the
6019// iterator has advanced beyond the end of the collection.
6020func (iter InstanceFailoverGroupListResultIterator) Value() InstanceFailoverGroup {
6021	if !iter.page.NotDone() {
6022		return InstanceFailoverGroup{}
6023	}
6024	return iter.page.Values()[iter.i]
6025}
6026
6027// Creates a new instance of the InstanceFailoverGroupListResultIterator type.
6028func NewInstanceFailoverGroupListResultIterator(page InstanceFailoverGroupListResultPage) InstanceFailoverGroupListResultIterator {
6029	return InstanceFailoverGroupListResultIterator{page: page}
6030}
6031
6032// IsEmpty returns true if the ListResult contains no values.
6033func (ifglr InstanceFailoverGroupListResult) IsEmpty() bool {
6034	return ifglr.Value == nil || len(*ifglr.Value) == 0
6035}
6036
6037// hasNextLink returns true if the NextLink is not empty.
6038func (ifglr InstanceFailoverGroupListResult) hasNextLink() bool {
6039	return ifglr.NextLink != nil && len(*ifglr.NextLink) != 0
6040}
6041
6042// instanceFailoverGroupListResultPreparer prepares a request to retrieve the next set of results.
6043// It returns nil if no more results exist.
6044func (ifglr InstanceFailoverGroupListResult) instanceFailoverGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
6045	if !ifglr.hasNextLink() {
6046		return nil, nil
6047	}
6048	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6049		autorest.AsJSON(),
6050		autorest.AsGet(),
6051		autorest.WithBaseURL(to.String(ifglr.NextLink)))
6052}
6053
6054// InstanceFailoverGroupListResultPage contains a page of InstanceFailoverGroup values.
6055type InstanceFailoverGroupListResultPage struct {
6056	fn    func(context.Context, InstanceFailoverGroupListResult) (InstanceFailoverGroupListResult, error)
6057	ifglr InstanceFailoverGroupListResult
6058}
6059
6060// NextWithContext advances to the next page of values.  If there was an error making
6061// the request the page does not advance and the error is returned.
6062func (page *InstanceFailoverGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
6063	if tracing.IsEnabled() {
6064		ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupListResultPage.NextWithContext")
6065		defer func() {
6066			sc := -1
6067			if page.Response().Response.Response != nil {
6068				sc = page.Response().Response.Response.StatusCode
6069			}
6070			tracing.EndSpan(ctx, sc, err)
6071		}()
6072	}
6073	for {
6074		next, err := page.fn(ctx, page.ifglr)
6075		if err != nil {
6076			return err
6077		}
6078		page.ifglr = next
6079		if !next.hasNextLink() || !next.IsEmpty() {
6080			break
6081		}
6082	}
6083	return nil
6084}
6085
6086// Next advances to the next page of values.  If there was an error making
6087// the request the page does not advance and the error is returned.
6088// Deprecated: Use NextWithContext() instead.
6089func (page *InstanceFailoverGroupListResultPage) Next() error {
6090	return page.NextWithContext(context.Background())
6091}
6092
6093// NotDone returns true if the page enumeration should be started or is not yet complete.
6094func (page InstanceFailoverGroupListResultPage) NotDone() bool {
6095	return !page.ifglr.IsEmpty()
6096}
6097
6098// Response returns the raw server response from the last page request.
6099func (page InstanceFailoverGroupListResultPage) Response() InstanceFailoverGroupListResult {
6100	return page.ifglr
6101}
6102
6103// Values returns the slice of values for the current page or nil if there are no values.
6104func (page InstanceFailoverGroupListResultPage) Values() []InstanceFailoverGroup {
6105	if page.ifglr.IsEmpty() {
6106		return nil
6107	}
6108	return *page.ifglr.Value
6109}
6110
6111// Creates a new instance of the InstanceFailoverGroupListResultPage type.
6112func NewInstanceFailoverGroupListResultPage(cur InstanceFailoverGroupListResult, getNextPage func(context.Context, InstanceFailoverGroupListResult) (InstanceFailoverGroupListResult, error)) InstanceFailoverGroupListResultPage {
6113	return InstanceFailoverGroupListResultPage{
6114		fn:    getNextPage,
6115		ifglr: cur,
6116	}
6117}
6118
6119// InstanceFailoverGroupProperties properties of a instance failover group.
6120type InstanceFailoverGroupProperties struct {
6121	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
6122	ReadWriteEndpoint *InstanceFailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
6123	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
6124	ReadOnlyEndpoint *InstanceFailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
6125	// ReplicationRole - READ-ONLY; Local replication role of the failover group instance. Possible values include: 'InstanceFailoverGroupReplicationRolePrimary', 'InstanceFailoverGroupReplicationRoleSecondary'
6126	ReplicationRole InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty"`
6127	// ReplicationState - READ-ONLY; Replication state of the failover group instance.
6128	ReplicationState *string `json:"replicationState,omitempty"`
6129	// PartnerRegions - Partner region information for the failover group.
6130	PartnerRegions *[]PartnerRegionInfo `json:"partnerRegions,omitempty"`
6131	// ManagedInstancePairs - List of managed instance pairs in the failover group.
6132	ManagedInstancePairs *[]ManagedInstancePairInfo `json:"managedInstancePairs,omitempty"`
6133}
6134
6135// MarshalJSON is the custom marshaler for InstanceFailoverGroupProperties.
6136func (ifgp InstanceFailoverGroupProperties) MarshalJSON() ([]byte, error) {
6137	objectMap := make(map[string]interface{})
6138	if ifgp.ReadWriteEndpoint != nil {
6139		objectMap["readWriteEndpoint"] = ifgp.ReadWriteEndpoint
6140	}
6141	if ifgp.ReadOnlyEndpoint != nil {
6142		objectMap["readOnlyEndpoint"] = ifgp.ReadOnlyEndpoint
6143	}
6144	if ifgp.PartnerRegions != nil {
6145		objectMap["partnerRegions"] = ifgp.PartnerRegions
6146	}
6147	if ifgp.ManagedInstancePairs != nil {
6148		objectMap["managedInstancePairs"] = ifgp.ManagedInstancePairs
6149	}
6150	return json.Marshal(objectMap)
6151}
6152
6153// InstanceFailoverGroupReadOnlyEndpoint read-only endpoint of the failover group instance.
6154type InstanceFailoverGroupReadOnlyEndpoint struct {
6155	// FailoverPolicy - Failover policy of the read-only endpoint for the failover group. Possible values include: 'ReadOnlyEndpointFailoverPolicyDisabled', 'ReadOnlyEndpointFailoverPolicyEnabled'
6156	FailoverPolicy ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
6157}
6158
6159// InstanceFailoverGroupReadWriteEndpoint read-write endpoint of the failover group instance.
6160type InstanceFailoverGroupReadWriteEndpoint struct {
6161	// 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'
6162	FailoverPolicy ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
6163	// FailoverWithDataLossGracePeriodMinutes - Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
6164	FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
6165}
6166
6167// InstanceFailoverGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
6168// long-running operation.
6169type InstanceFailoverGroupsCreateOrUpdateFuture struct {
6170	azure.FutureAPI
6171	// Result returns the result of the asynchronous operation.
6172	// If the operation has not completed it will return an error.
6173	Result func(InstanceFailoverGroupsClient) (InstanceFailoverGroup, error)
6174}
6175
6176// InstanceFailoverGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a
6177// long-running operation.
6178type InstanceFailoverGroupsDeleteFuture struct {
6179	azure.FutureAPI
6180	// Result returns the result of the asynchronous operation.
6181	// If the operation has not completed it will return an error.
6182	Result func(InstanceFailoverGroupsClient) (autorest.Response, error)
6183}
6184
6185// InstanceFailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a
6186// long-running operation.
6187type InstanceFailoverGroupsFailoverFuture struct {
6188	azure.FutureAPI
6189	// Result returns the result of the asynchronous operation.
6190	// If the operation has not completed it will return an error.
6191	Result func(InstanceFailoverGroupsClient) (InstanceFailoverGroup, error)
6192}
6193
6194// InstanceFailoverGroupsForceFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the
6195// results of a long-running operation.
6196type InstanceFailoverGroupsForceFailoverAllowDataLossFuture struct {
6197	azure.FutureAPI
6198	// Result returns the result of the asynchronous operation.
6199	// If the operation has not completed it will return an error.
6200	Result func(InstanceFailoverGroupsClient) (InstanceFailoverGroup, error)
6201}
6202
6203// InstancePool an Azure SQL instance pool.
6204type InstancePool struct {
6205	autorest.Response `json:"-"`
6206	// Sku - The name and tier of the SKU.
6207	Sku *Sku `json:"sku,omitempty"`
6208	// InstancePoolProperties - Resource properties.
6209	*InstancePoolProperties `json:"properties,omitempty"`
6210	// Location - Resource location.
6211	Location *string `json:"location,omitempty"`
6212	// Tags - Resource tags.
6213	Tags map[string]*string `json:"tags"`
6214	// ID - READ-ONLY; Resource ID.
6215	ID *string `json:"id,omitempty"`
6216	// Name - READ-ONLY; Resource name.
6217	Name *string `json:"name,omitempty"`
6218	// Type - READ-ONLY; Resource type.
6219	Type *string `json:"type,omitempty"`
6220}
6221
6222// MarshalJSON is the custom marshaler for InstancePool.
6223func (IP InstancePool) MarshalJSON() ([]byte, error) {
6224	objectMap := make(map[string]interface{})
6225	if IP.Sku != nil {
6226		objectMap["sku"] = IP.Sku
6227	}
6228	if IP.InstancePoolProperties != nil {
6229		objectMap["properties"] = IP.InstancePoolProperties
6230	}
6231	if IP.Location != nil {
6232		objectMap["location"] = IP.Location
6233	}
6234	if IP.Tags != nil {
6235		objectMap["tags"] = IP.Tags
6236	}
6237	return json.Marshal(objectMap)
6238}
6239
6240// UnmarshalJSON is the custom unmarshaler for InstancePool struct.
6241func (IP *InstancePool) UnmarshalJSON(body []byte) error {
6242	var m map[string]*json.RawMessage
6243	err := json.Unmarshal(body, &m)
6244	if err != nil {
6245		return err
6246	}
6247	for k, v := range m {
6248		switch k {
6249		case "sku":
6250			if v != nil {
6251				var sku Sku
6252				err = json.Unmarshal(*v, &sku)
6253				if err != nil {
6254					return err
6255				}
6256				IP.Sku = &sku
6257			}
6258		case "properties":
6259			if v != nil {
6260				var instancePoolProperties InstancePoolProperties
6261				err = json.Unmarshal(*v, &instancePoolProperties)
6262				if err != nil {
6263					return err
6264				}
6265				IP.InstancePoolProperties = &instancePoolProperties
6266			}
6267		case "location":
6268			if v != nil {
6269				var location string
6270				err = json.Unmarshal(*v, &location)
6271				if err != nil {
6272					return err
6273				}
6274				IP.Location = &location
6275			}
6276		case "tags":
6277			if v != nil {
6278				var tags map[string]*string
6279				err = json.Unmarshal(*v, &tags)
6280				if err != nil {
6281					return err
6282				}
6283				IP.Tags = tags
6284			}
6285		case "id":
6286			if v != nil {
6287				var ID string
6288				err = json.Unmarshal(*v, &ID)
6289				if err != nil {
6290					return err
6291				}
6292				IP.ID = &ID
6293			}
6294		case "name":
6295			if v != nil {
6296				var name string
6297				err = json.Unmarshal(*v, &name)
6298				if err != nil {
6299					return err
6300				}
6301				IP.Name = &name
6302			}
6303		case "type":
6304			if v != nil {
6305				var typeVar string
6306				err = json.Unmarshal(*v, &typeVar)
6307				if err != nil {
6308					return err
6309				}
6310				IP.Type = &typeVar
6311			}
6312		}
6313	}
6314
6315	return nil
6316}
6317
6318// InstancePoolEditionCapability the instance pool capability
6319type InstancePoolEditionCapability struct {
6320	// Name - READ-ONLY; The instance pool version name.
6321	Name *string `json:"name,omitempty"`
6322	// SupportedFamilies - READ-ONLY; The supported families.
6323	SupportedFamilies *[]InstancePoolFamilyCapability `json:"supportedFamilies,omitempty"`
6324	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
6325	Status CapabilityStatus `json:"status,omitempty"`
6326	// Reason - The reason for the capability not being available.
6327	Reason *string `json:"reason,omitempty"`
6328}
6329
6330// MarshalJSON is the custom marshaler for InstancePoolEditionCapability.
6331func (ipec InstancePoolEditionCapability) MarshalJSON() ([]byte, error) {
6332	objectMap := make(map[string]interface{})
6333	if ipec.Reason != nil {
6334		objectMap["reason"] = ipec.Reason
6335	}
6336	return json.Marshal(objectMap)
6337}
6338
6339// InstancePoolFamilyCapability the instance pool family capability.
6340type InstancePoolFamilyCapability struct {
6341	// Name - READ-ONLY; Family name.
6342	Name *string `json:"name,omitempty"`
6343	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
6344	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
6345	// SupportedVcoresValues - READ-ONLY; List of supported virtual cores values.
6346	SupportedVcoresValues *[]InstancePoolVcoresCapability `json:"supportedVcoresValues,omitempty"`
6347	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
6348	Status CapabilityStatus `json:"status,omitempty"`
6349	// Reason - The reason for the capability not being available.
6350	Reason *string `json:"reason,omitempty"`
6351}
6352
6353// MarshalJSON is the custom marshaler for InstancePoolFamilyCapability.
6354func (ipfc InstancePoolFamilyCapability) MarshalJSON() ([]byte, error) {
6355	objectMap := make(map[string]interface{})
6356	if ipfc.Reason != nil {
6357		objectMap["reason"] = ipfc.Reason
6358	}
6359	return json.Marshal(objectMap)
6360}
6361
6362// InstancePoolListResult a list of Azure SQL instance pools.
6363type InstancePoolListResult struct {
6364	autorest.Response `json:"-"`
6365	// Value - READ-ONLY; Array of results.
6366	Value *[]InstancePool `json:"value,omitempty"`
6367	// NextLink - READ-ONLY; Link to retrieve next page of results.
6368	NextLink *string `json:"nextLink,omitempty"`
6369}
6370
6371// InstancePoolListResultIterator provides access to a complete listing of InstancePool values.
6372type InstancePoolListResultIterator struct {
6373	i    int
6374	page InstancePoolListResultPage
6375}
6376
6377// NextWithContext advances to the next value.  If there was an error making
6378// the request the iterator does not advance and the error is returned.
6379func (iter *InstancePoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
6380	if tracing.IsEnabled() {
6381		ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolListResultIterator.NextWithContext")
6382		defer func() {
6383			sc := -1
6384			if iter.Response().Response.Response != nil {
6385				sc = iter.Response().Response.Response.StatusCode
6386			}
6387			tracing.EndSpan(ctx, sc, err)
6388		}()
6389	}
6390	iter.i++
6391	if iter.i < len(iter.page.Values()) {
6392		return nil
6393	}
6394	err = iter.page.NextWithContext(ctx)
6395	if err != nil {
6396		iter.i--
6397		return err
6398	}
6399	iter.i = 0
6400	return nil
6401}
6402
6403// Next advances to the next value.  If there was an error making
6404// the request the iterator does not advance and the error is returned.
6405// Deprecated: Use NextWithContext() instead.
6406func (iter *InstancePoolListResultIterator) Next() error {
6407	return iter.NextWithContext(context.Background())
6408}
6409
6410// NotDone returns true if the enumeration should be started or is not yet complete.
6411func (iter InstancePoolListResultIterator) NotDone() bool {
6412	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6413}
6414
6415// Response returns the raw server response from the last page request.
6416func (iter InstancePoolListResultIterator) Response() InstancePoolListResult {
6417	return iter.page.Response()
6418}
6419
6420// Value returns the current value or a zero-initialized value if the
6421// iterator has advanced beyond the end of the collection.
6422func (iter InstancePoolListResultIterator) Value() InstancePool {
6423	if !iter.page.NotDone() {
6424		return InstancePool{}
6425	}
6426	return iter.page.Values()[iter.i]
6427}
6428
6429// Creates a new instance of the InstancePoolListResultIterator type.
6430func NewInstancePoolListResultIterator(page InstancePoolListResultPage) InstancePoolListResultIterator {
6431	return InstancePoolListResultIterator{page: page}
6432}
6433
6434// IsEmpty returns true if the ListResult contains no values.
6435func (iplr InstancePoolListResult) IsEmpty() bool {
6436	return iplr.Value == nil || len(*iplr.Value) == 0
6437}
6438
6439// hasNextLink returns true if the NextLink is not empty.
6440func (iplr InstancePoolListResult) hasNextLink() bool {
6441	return iplr.NextLink != nil && len(*iplr.NextLink) != 0
6442}
6443
6444// instancePoolListResultPreparer prepares a request to retrieve the next set of results.
6445// It returns nil if no more results exist.
6446func (iplr InstancePoolListResult) instancePoolListResultPreparer(ctx context.Context) (*http.Request, error) {
6447	if !iplr.hasNextLink() {
6448		return nil, nil
6449	}
6450	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6451		autorest.AsJSON(),
6452		autorest.AsGet(),
6453		autorest.WithBaseURL(to.String(iplr.NextLink)))
6454}
6455
6456// InstancePoolListResultPage contains a page of InstancePool values.
6457type InstancePoolListResultPage struct {
6458	fn   func(context.Context, InstancePoolListResult) (InstancePoolListResult, error)
6459	iplr InstancePoolListResult
6460}
6461
6462// NextWithContext advances to the next page of values.  If there was an error making
6463// the request the page does not advance and the error is returned.
6464func (page *InstancePoolListResultPage) NextWithContext(ctx context.Context) (err error) {
6465	if tracing.IsEnabled() {
6466		ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolListResultPage.NextWithContext")
6467		defer func() {
6468			sc := -1
6469			if page.Response().Response.Response != nil {
6470				sc = page.Response().Response.Response.StatusCode
6471			}
6472			tracing.EndSpan(ctx, sc, err)
6473		}()
6474	}
6475	for {
6476		next, err := page.fn(ctx, page.iplr)
6477		if err != nil {
6478			return err
6479		}
6480		page.iplr = next
6481		if !next.hasNextLink() || !next.IsEmpty() {
6482			break
6483		}
6484	}
6485	return nil
6486}
6487
6488// Next advances to the next page of values.  If there was an error making
6489// the request the page does not advance and the error is returned.
6490// Deprecated: Use NextWithContext() instead.
6491func (page *InstancePoolListResultPage) Next() error {
6492	return page.NextWithContext(context.Background())
6493}
6494
6495// NotDone returns true if the page enumeration should be started or is not yet complete.
6496func (page InstancePoolListResultPage) NotDone() bool {
6497	return !page.iplr.IsEmpty()
6498}
6499
6500// Response returns the raw server response from the last page request.
6501func (page InstancePoolListResultPage) Response() InstancePoolListResult {
6502	return page.iplr
6503}
6504
6505// Values returns the slice of values for the current page or nil if there are no values.
6506func (page InstancePoolListResultPage) Values() []InstancePool {
6507	if page.iplr.IsEmpty() {
6508		return nil
6509	}
6510	return *page.iplr.Value
6511}
6512
6513// Creates a new instance of the InstancePoolListResultPage type.
6514func NewInstancePoolListResultPage(cur InstancePoolListResult, getNextPage func(context.Context, InstancePoolListResult) (InstancePoolListResult, error)) InstancePoolListResultPage {
6515	return InstancePoolListResultPage{
6516		fn:   getNextPage,
6517		iplr: cur,
6518	}
6519}
6520
6521// InstancePoolProperties properties of an instance pool.
6522type InstancePoolProperties struct {
6523	// SubnetID - Resource ID of the subnet to place this instance pool in.
6524	SubnetID *string `json:"subnetId,omitempty"`
6525	// VCores - Count of vCores belonging to this instance pool.
6526	VCores *int32 `json:"vCores,omitempty"`
6527	// 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'
6528	LicenseType InstancePoolLicenseType `json:"licenseType,omitempty"`
6529}
6530
6531// InstancePoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
6532// long-running operation.
6533type InstancePoolsCreateOrUpdateFuture struct {
6534	azure.FutureAPI
6535	// Result returns the result of the asynchronous operation.
6536	// If the operation has not completed it will return an error.
6537	Result func(InstancePoolsClient) (InstancePool, error)
6538}
6539
6540// InstancePoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
6541// operation.
6542type InstancePoolsDeleteFuture struct {
6543	azure.FutureAPI
6544	// Result returns the result of the asynchronous operation.
6545	// If the operation has not completed it will return an error.
6546	Result func(InstancePoolsClient) (autorest.Response, error)
6547}
6548
6549// InstancePoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
6550// operation.
6551type InstancePoolsUpdateFuture struct {
6552	azure.FutureAPI
6553	// Result returns the result of the asynchronous operation.
6554	// If the operation has not completed it will return an error.
6555	Result func(InstancePoolsClient) (InstancePool, error)
6556}
6557
6558// InstancePoolUpdate an update to an Instance pool.
6559type InstancePoolUpdate struct {
6560	// Tags - Resource tags.
6561	Tags map[string]*string `json:"tags"`
6562}
6563
6564// MarshalJSON is the custom marshaler for InstancePoolUpdate.
6565func (ipu InstancePoolUpdate) MarshalJSON() ([]byte, error) {
6566	objectMap := make(map[string]interface{})
6567	if ipu.Tags != nil {
6568		objectMap["tags"] = ipu.Tags
6569	}
6570	return json.Marshal(objectMap)
6571}
6572
6573// InstancePoolVcoresCapability the managed instance virtual cores capability.
6574type InstancePoolVcoresCapability struct {
6575	// Name - READ-ONLY; The virtual cores identifier.
6576	Name *string `json:"name,omitempty"`
6577	// Value - READ-ONLY; The virtual cores value.
6578	Value *int32 `json:"value,omitempty"`
6579	// StorageLimit - READ-ONLY; Storage limit.
6580	StorageLimit *MaxSizeCapability `json:"storageLimit,omitempty"`
6581	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
6582	Status CapabilityStatus `json:"status,omitempty"`
6583	// Reason - The reason for the capability not being available.
6584	Reason *string `json:"reason,omitempty"`
6585}
6586
6587// MarshalJSON is the custom marshaler for InstancePoolVcoresCapability.
6588func (ipvc InstancePoolVcoresCapability) MarshalJSON() ([]byte, error) {
6589	objectMap := make(map[string]interface{})
6590	if ipvc.Reason != nil {
6591		objectMap["reason"] = ipvc.Reason
6592	}
6593	return json.Marshal(objectMap)
6594}
6595
6596// Job a job.
6597type Job struct {
6598	autorest.Response `json:"-"`
6599	// JobProperties - Resource properties.
6600	*JobProperties `json:"properties,omitempty"`
6601	// ID - READ-ONLY; Resource ID.
6602	ID *string `json:"id,omitempty"`
6603	// Name - READ-ONLY; Resource name.
6604	Name *string `json:"name,omitempty"`
6605	// Type - READ-ONLY; Resource type.
6606	Type *string `json:"type,omitempty"`
6607}
6608
6609// MarshalJSON is the custom marshaler for Job.
6610func (j Job) MarshalJSON() ([]byte, error) {
6611	objectMap := make(map[string]interface{})
6612	if j.JobProperties != nil {
6613		objectMap["properties"] = j.JobProperties
6614	}
6615	return json.Marshal(objectMap)
6616}
6617
6618// UnmarshalJSON is the custom unmarshaler for Job struct.
6619func (j *Job) UnmarshalJSON(body []byte) error {
6620	var m map[string]*json.RawMessage
6621	err := json.Unmarshal(body, &m)
6622	if err != nil {
6623		return err
6624	}
6625	for k, v := range m {
6626		switch k {
6627		case "properties":
6628			if v != nil {
6629				var jobProperties JobProperties
6630				err = json.Unmarshal(*v, &jobProperties)
6631				if err != nil {
6632					return err
6633				}
6634				j.JobProperties = &jobProperties
6635			}
6636		case "id":
6637			if v != nil {
6638				var ID string
6639				err = json.Unmarshal(*v, &ID)
6640				if err != nil {
6641					return err
6642				}
6643				j.ID = &ID
6644			}
6645		case "name":
6646			if v != nil {
6647				var name string
6648				err = json.Unmarshal(*v, &name)
6649				if err != nil {
6650					return err
6651				}
6652				j.Name = &name
6653			}
6654		case "type":
6655			if v != nil {
6656				var typeVar string
6657				err = json.Unmarshal(*v, &typeVar)
6658				if err != nil {
6659					return err
6660				}
6661				j.Type = &typeVar
6662			}
6663		}
6664	}
6665
6666	return nil
6667}
6668
6669// JobAgent an Azure SQL job agent.
6670type JobAgent struct {
6671	autorest.Response `json:"-"`
6672	// Sku - The name and tier of the SKU.
6673	Sku *Sku `json:"sku,omitempty"`
6674	// JobAgentProperties - Resource properties.
6675	*JobAgentProperties `json:"properties,omitempty"`
6676	// Location - Resource location.
6677	Location *string `json:"location,omitempty"`
6678	// Tags - Resource tags.
6679	Tags map[string]*string `json:"tags"`
6680	// ID - READ-ONLY; Resource ID.
6681	ID *string `json:"id,omitempty"`
6682	// Name - READ-ONLY; Resource name.
6683	Name *string `json:"name,omitempty"`
6684	// Type - READ-ONLY; Resource type.
6685	Type *string `json:"type,omitempty"`
6686}
6687
6688// MarshalJSON is the custom marshaler for JobAgent.
6689func (ja JobAgent) MarshalJSON() ([]byte, error) {
6690	objectMap := make(map[string]interface{})
6691	if ja.Sku != nil {
6692		objectMap["sku"] = ja.Sku
6693	}
6694	if ja.JobAgentProperties != nil {
6695		objectMap["properties"] = ja.JobAgentProperties
6696	}
6697	if ja.Location != nil {
6698		objectMap["location"] = ja.Location
6699	}
6700	if ja.Tags != nil {
6701		objectMap["tags"] = ja.Tags
6702	}
6703	return json.Marshal(objectMap)
6704}
6705
6706// UnmarshalJSON is the custom unmarshaler for JobAgent struct.
6707func (ja *JobAgent) UnmarshalJSON(body []byte) error {
6708	var m map[string]*json.RawMessage
6709	err := json.Unmarshal(body, &m)
6710	if err != nil {
6711		return err
6712	}
6713	for k, v := range m {
6714		switch k {
6715		case "sku":
6716			if v != nil {
6717				var sku Sku
6718				err = json.Unmarshal(*v, &sku)
6719				if err != nil {
6720					return err
6721				}
6722				ja.Sku = &sku
6723			}
6724		case "properties":
6725			if v != nil {
6726				var jobAgentProperties JobAgentProperties
6727				err = json.Unmarshal(*v, &jobAgentProperties)
6728				if err != nil {
6729					return err
6730				}
6731				ja.JobAgentProperties = &jobAgentProperties
6732			}
6733		case "location":
6734			if v != nil {
6735				var location string
6736				err = json.Unmarshal(*v, &location)
6737				if err != nil {
6738					return err
6739				}
6740				ja.Location = &location
6741			}
6742		case "tags":
6743			if v != nil {
6744				var tags map[string]*string
6745				err = json.Unmarshal(*v, &tags)
6746				if err != nil {
6747					return err
6748				}
6749				ja.Tags = tags
6750			}
6751		case "id":
6752			if v != nil {
6753				var ID string
6754				err = json.Unmarshal(*v, &ID)
6755				if err != nil {
6756					return err
6757				}
6758				ja.ID = &ID
6759			}
6760		case "name":
6761			if v != nil {
6762				var name string
6763				err = json.Unmarshal(*v, &name)
6764				if err != nil {
6765					return err
6766				}
6767				ja.Name = &name
6768			}
6769		case "type":
6770			if v != nil {
6771				var typeVar string
6772				err = json.Unmarshal(*v, &typeVar)
6773				if err != nil {
6774					return err
6775				}
6776				ja.Type = &typeVar
6777			}
6778		}
6779	}
6780
6781	return nil
6782}
6783
6784// JobAgentListResult a list of Azure SQL job agents.
6785type JobAgentListResult struct {
6786	autorest.Response `json:"-"`
6787	// Value - READ-ONLY; Array of results.
6788	Value *[]JobAgent `json:"value,omitempty"`
6789	// NextLink - READ-ONLY; Link to retrieve next page of results.
6790	NextLink *string `json:"nextLink,omitempty"`
6791}
6792
6793// JobAgentListResultIterator provides access to a complete listing of JobAgent values.
6794type JobAgentListResultIterator struct {
6795	i    int
6796	page JobAgentListResultPage
6797}
6798
6799// NextWithContext advances to the next value.  If there was an error making
6800// the request the iterator does not advance and the error is returned.
6801func (iter *JobAgentListResultIterator) NextWithContext(ctx context.Context) (err error) {
6802	if tracing.IsEnabled() {
6803		ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentListResultIterator.NextWithContext")
6804		defer func() {
6805			sc := -1
6806			if iter.Response().Response.Response != nil {
6807				sc = iter.Response().Response.Response.StatusCode
6808			}
6809			tracing.EndSpan(ctx, sc, err)
6810		}()
6811	}
6812	iter.i++
6813	if iter.i < len(iter.page.Values()) {
6814		return nil
6815	}
6816	err = iter.page.NextWithContext(ctx)
6817	if err != nil {
6818		iter.i--
6819		return err
6820	}
6821	iter.i = 0
6822	return nil
6823}
6824
6825// Next advances to the next value.  If there was an error making
6826// the request the iterator does not advance and the error is returned.
6827// Deprecated: Use NextWithContext() instead.
6828func (iter *JobAgentListResultIterator) Next() error {
6829	return iter.NextWithContext(context.Background())
6830}
6831
6832// NotDone returns true if the enumeration should be started or is not yet complete.
6833func (iter JobAgentListResultIterator) NotDone() bool {
6834	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6835}
6836
6837// Response returns the raw server response from the last page request.
6838func (iter JobAgentListResultIterator) Response() JobAgentListResult {
6839	return iter.page.Response()
6840}
6841
6842// Value returns the current value or a zero-initialized value if the
6843// iterator has advanced beyond the end of the collection.
6844func (iter JobAgentListResultIterator) Value() JobAgent {
6845	if !iter.page.NotDone() {
6846		return JobAgent{}
6847	}
6848	return iter.page.Values()[iter.i]
6849}
6850
6851// Creates a new instance of the JobAgentListResultIterator type.
6852func NewJobAgentListResultIterator(page JobAgentListResultPage) JobAgentListResultIterator {
6853	return JobAgentListResultIterator{page: page}
6854}
6855
6856// IsEmpty returns true if the ListResult contains no values.
6857func (jalr JobAgentListResult) IsEmpty() bool {
6858	return jalr.Value == nil || len(*jalr.Value) == 0
6859}
6860
6861// hasNextLink returns true if the NextLink is not empty.
6862func (jalr JobAgentListResult) hasNextLink() bool {
6863	return jalr.NextLink != nil && len(*jalr.NextLink) != 0
6864}
6865
6866// jobAgentListResultPreparer prepares a request to retrieve the next set of results.
6867// It returns nil if no more results exist.
6868func (jalr JobAgentListResult) jobAgentListResultPreparer(ctx context.Context) (*http.Request, error) {
6869	if !jalr.hasNextLink() {
6870		return nil, nil
6871	}
6872	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6873		autorest.AsJSON(),
6874		autorest.AsGet(),
6875		autorest.WithBaseURL(to.String(jalr.NextLink)))
6876}
6877
6878// JobAgentListResultPage contains a page of JobAgent values.
6879type JobAgentListResultPage struct {
6880	fn   func(context.Context, JobAgentListResult) (JobAgentListResult, error)
6881	jalr JobAgentListResult
6882}
6883
6884// NextWithContext advances to the next page of values.  If there was an error making
6885// the request the page does not advance and the error is returned.
6886func (page *JobAgentListResultPage) NextWithContext(ctx context.Context) (err error) {
6887	if tracing.IsEnabled() {
6888		ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentListResultPage.NextWithContext")
6889		defer func() {
6890			sc := -1
6891			if page.Response().Response.Response != nil {
6892				sc = page.Response().Response.Response.StatusCode
6893			}
6894			tracing.EndSpan(ctx, sc, err)
6895		}()
6896	}
6897	for {
6898		next, err := page.fn(ctx, page.jalr)
6899		if err != nil {
6900			return err
6901		}
6902		page.jalr = next
6903		if !next.hasNextLink() || !next.IsEmpty() {
6904			break
6905		}
6906	}
6907	return nil
6908}
6909
6910// Next advances to the next page of values.  If there was an error making
6911// the request the page does not advance and the error is returned.
6912// Deprecated: Use NextWithContext() instead.
6913func (page *JobAgentListResultPage) Next() error {
6914	return page.NextWithContext(context.Background())
6915}
6916
6917// NotDone returns true if the page enumeration should be started or is not yet complete.
6918func (page JobAgentListResultPage) NotDone() bool {
6919	return !page.jalr.IsEmpty()
6920}
6921
6922// Response returns the raw server response from the last page request.
6923func (page JobAgentListResultPage) Response() JobAgentListResult {
6924	return page.jalr
6925}
6926
6927// Values returns the slice of values for the current page or nil if there are no values.
6928func (page JobAgentListResultPage) Values() []JobAgent {
6929	if page.jalr.IsEmpty() {
6930		return nil
6931	}
6932	return *page.jalr.Value
6933}
6934
6935// Creates a new instance of the JobAgentListResultPage type.
6936func NewJobAgentListResultPage(cur JobAgentListResult, getNextPage func(context.Context, JobAgentListResult) (JobAgentListResult, error)) JobAgentListResultPage {
6937	return JobAgentListResultPage{
6938		fn:   getNextPage,
6939		jalr: cur,
6940	}
6941}
6942
6943// JobAgentProperties properties of a job agent.
6944type JobAgentProperties struct {
6945	// DatabaseID - Resource ID of the database to store job metadata in.
6946	DatabaseID *string `json:"databaseId,omitempty"`
6947	// State - READ-ONLY; The state of the job agent. Possible values include: 'JobAgentStateCreating', 'JobAgentStateReady', 'JobAgentStateUpdating', 'JobAgentStateDeleting', 'JobAgentStateDisabled'
6948	State JobAgentState `json:"state,omitempty"`
6949}
6950
6951// MarshalJSON is the custom marshaler for JobAgentProperties.
6952func (jap JobAgentProperties) MarshalJSON() ([]byte, error) {
6953	objectMap := make(map[string]interface{})
6954	if jap.DatabaseID != nil {
6955		objectMap["databaseId"] = jap.DatabaseID
6956	}
6957	return json.Marshal(objectMap)
6958}
6959
6960// JobAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
6961// operation.
6962type JobAgentsCreateOrUpdateFuture struct {
6963	azure.FutureAPI
6964	// Result returns the result of the asynchronous operation.
6965	// If the operation has not completed it will return an error.
6966	Result func(JobAgentsClient) (JobAgent, error)
6967}
6968
6969// JobAgentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
6970// operation.
6971type JobAgentsDeleteFuture struct {
6972	azure.FutureAPI
6973	// Result returns the result of the asynchronous operation.
6974	// If the operation has not completed it will return an error.
6975	Result func(JobAgentsClient) (autorest.Response, error)
6976}
6977
6978// JobAgentsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
6979// operation.
6980type JobAgentsUpdateFuture struct {
6981	azure.FutureAPI
6982	// Result returns the result of the asynchronous operation.
6983	// If the operation has not completed it will return an error.
6984	Result func(JobAgentsClient) (JobAgent, error)
6985}
6986
6987// JobAgentUpdate an update to an Azure SQL job agent.
6988type JobAgentUpdate struct {
6989	// Tags - Resource tags.
6990	Tags map[string]*string `json:"tags"`
6991}
6992
6993// MarshalJSON is the custom marshaler for JobAgentUpdate.
6994func (jau JobAgentUpdate) MarshalJSON() ([]byte, error) {
6995	objectMap := make(map[string]interface{})
6996	if jau.Tags != nil {
6997		objectMap["tags"] = jau.Tags
6998	}
6999	return json.Marshal(objectMap)
7000}
7001
7002// JobCredential a stored credential that can be used by a job to connect to target databases.
7003type JobCredential struct {
7004	autorest.Response `json:"-"`
7005	// JobCredentialProperties - Resource properties.
7006	*JobCredentialProperties `json:"properties,omitempty"`
7007	// ID - READ-ONLY; Resource ID.
7008	ID *string `json:"id,omitempty"`
7009	// Name - READ-ONLY; Resource name.
7010	Name *string `json:"name,omitempty"`
7011	// Type - READ-ONLY; Resource type.
7012	Type *string `json:"type,omitempty"`
7013}
7014
7015// MarshalJSON is the custom marshaler for JobCredential.
7016func (jc JobCredential) MarshalJSON() ([]byte, error) {
7017	objectMap := make(map[string]interface{})
7018	if jc.JobCredentialProperties != nil {
7019		objectMap["properties"] = jc.JobCredentialProperties
7020	}
7021	return json.Marshal(objectMap)
7022}
7023
7024// UnmarshalJSON is the custom unmarshaler for JobCredential struct.
7025func (jc *JobCredential) UnmarshalJSON(body []byte) error {
7026	var m map[string]*json.RawMessage
7027	err := json.Unmarshal(body, &m)
7028	if err != nil {
7029		return err
7030	}
7031	for k, v := range m {
7032		switch k {
7033		case "properties":
7034			if v != nil {
7035				var jobCredentialProperties JobCredentialProperties
7036				err = json.Unmarshal(*v, &jobCredentialProperties)
7037				if err != nil {
7038					return err
7039				}
7040				jc.JobCredentialProperties = &jobCredentialProperties
7041			}
7042		case "id":
7043			if v != nil {
7044				var ID string
7045				err = json.Unmarshal(*v, &ID)
7046				if err != nil {
7047					return err
7048				}
7049				jc.ID = &ID
7050			}
7051		case "name":
7052			if v != nil {
7053				var name string
7054				err = json.Unmarshal(*v, &name)
7055				if err != nil {
7056					return err
7057				}
7058				jc.Name = &name
7059			}
7060		case "type":
7061			if v != nil {
7062				var typeVar string
7063				err = json.Unmarshal(*v, &typeVar)
7064				if err != nil {
7065					return err
7066				}
7067				jc.Type = &typeVar
7068			}
7069		}
7070	}
7071
7072	return nil
7073}
7074
7075// JobCredentialListResult a list of job credentials.
7076type JobCredentialListResult struct {
7077	autorest.Response `json:"-"`
7078	// Value - READ-ONLY; Array of results.
7079	Value *[]JobCredential `json:"value,omitempty"`
7080	// NextLink - READ-ONLY; Link to retrieve next page of results.
7081	NextLink *string `json:"nextLink,omitempty"`
7082}
7083
7084// JobCredentialListResultIterator provides access to a complete listing of JobCredential values.
7085type JobCredentialListResultIterator struct {
7086	i    int
7087	page JobCredentialListResultPage
7088}
7089
7090// NextWithContext advances to the next value.  If there was an error making
7091// the request the iterator does not advance and the error is returned.
7092func (iter *JobCredentialListResultIterator) NextWithContext(ctx context.Context) (err error) {
7093	if tracing.IsEnabled() {
7094		ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialListResultIterator.NextWithContext")
7095		defer func() {
7096			sc := -1
7097			if iter.Response().Response.Response != nil {
7098				sc = iter.Response().Response.Response.StatusCode
7099			}
7100			tracing.EndSpan(ctx, sc, err)
7101		}()
7102	}
7103	iter.i++
7104	if iter.i < len(iter.page.Values()) {
7105		return nil
7106	}
7107	err = iter.page.NextWithContext(ctx)
7108	if err != nil {
7109		iter.i--
7110		return err
7111	}
7112	iter.i = 0
7113	return nil
7114}
7115
7116// Next advances to the next value.  If there was an error making
7117// the request the iterator does not advance and the error is returned.
7118// Deprecated: Use NextWithContext() instead.
7119func (iter *JobCredentialListResultIterator) Next() error {
7120	return iter.NextWithContext(context.Background())
7121}
7122
7123// NotDone returns true if the enumeration should be started or is not yet complete.
7124func (iter JobCredentialListResultIterator) NotDone() bool {
7125	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7126}
7127
7128// Response returns the raw server response from the last page request.
7129func (iter JobCredentialListResultIterator) Response() JobCredentialListResult {
7130	return iter.page.Response()
7131}
7132
7133// Value returns the current value or a zero-initialized value if the
7134// iterator has advanced beyond the end of the collection.
7135func (iter JobCredentialListResultIterator) Value() JobCredential {
7136	if !iter.page.NotDone() {
7137		return JobCredential{}
7138	}
7139	return iter.page.Values()[iter.i]
7140}
7141
7142// Creates a new instance of the JobCredentialListResultIterator type.
7143func NewJobCredentialListResultIterator(page JobCredentialListResultPage) JobCredentialListResultIterator {
7144	return JobCredentialListResultIterator{page: page}
7145}
7146
7147// IsEmpty returns true if the ListResult contains no values.
7148func (jclr JobCredentialListResult) IsEmpty() bool {
7149	return jclr.Value == nil || len(*jclr.Value) == 0
7150}
7151
7152// hasNextLink returns true if the NextLink is not empty.
7153func (jclr JobCredentialListResult) hasNextLink() bool {
7154	return jclr.NextLink != nil && len(*jclr.NextLink) != 0
7155}
7156
7157// jobCredentialListResultPreparer prepares a request to retrieve the next set of results.
7158// It returns nil if no more results exist.
7159func (jclr JobCredentialListResult) jobCredentialListResultPreparer(ctx context.Context) (*http.Request, error) {
7160	if !jclr.hasNextLink() {
7161		return nil, nil
7162	}
7163	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7164		autorest.AsJSON(),
7165		autorest.AsGet(),
7166		autorest.WithBaseURL(to.String(jclr.NextLink)))
7167}
7168
7169// JobCredentialListResultPage contains a page of JobCredential values.
7170type JobCredentialListResultPage struct {
7171	fn   func(context.Context, JobCredentialListResult) (JobCredentialListResult, error)
7172	jclr JobCredentialListResult
7173}
7174
7175// NextWithContext advances to the next page of values.  If there was an error making
7176// the request the page does not advance and the error is returned.
7177func (page *JobCredentialListResultPage) NextWithContext(ctx context.Context) (err error) {
7178	if tracing.IsEnabled() {
7179		ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialListResultPage.NextWithContext")
7180		defer func() {
7181			sc := -1
7182			if page.Response().Response.Response != nil {
7183				sc = page.Response().Response.Response.StatusCode
7184			}
7185			tracing.EndSpan(ctx, sc, err)
7186		}()
7187	}
7188	for {
7189		next, err := page.fn(ctx, page.jclr)
7190		if err != nil {
7191			return err
7192		}
7193		page.jclr = next
7194		if !next.hasNextLink() || !next.IsEmpty() {
7195			break
7196		}
7197	}
7198	return nil
7199}
7200
7201// Next advances to the next page of values.  If there was an error making
7202// the request the page does not advance and the error is returned.
7203// Deprecated: Use NextWithContext() instead.
7204func (page *JobCredentialListResultPage) Next() error {
7205	return page.NextWithContext(context.Background())
7206}
7207
7208// NotDone returns true if the page enumeration should be started or is not yet complete.
7209func (page JobCredentialListResultPage) NotDone() bool {
7210	return !page.jclr.IsEmpty()
7211}
7212
7213// Response returns the raw server response from the last page request.
7214func (page JobCredentialListResultPage) Response() JobCredentialListResult {
7215	return page.jclr
7216}
7217
7218// Values returns the slice of values for the current page or nil if there are no values.
7219func (page JobCredentialListResultPage) Values() []JobCredential {
7220	if page.jclr.IsEmpty() {
7221		return nil
7222	}
7223	return *page.jclr.Value
7224}
7225
7226// Creates a new instance of the JobCredentialListResultPage type.
7227func NewJobCredentialListResultPage(cur JobCredentialListResult, getNextPage func(context.Context, JobCredentialListResult) (JobCredentialListResult, error)) JobCredentialListResultPage {
7228	return JobCredentialListResultPage{
7229		fn:   getNextPage,
7230		jclr: cur,
7231	}
7232}
7233
7234// JobCredentialProperties properties of a job credential.
7235type JobCredentialProperties struct {
7236	// Username - The credential user name.
7237	Username *string `json:"username,omitempty"`
7238	// Password - The credential password.
7239	Password *string `json:"password,omitempty"`
7240}
7241
7242// JobExecution an execution of a job
7243type JobExecution struct {
7244	autorest.Response `json:"-"`
7245	// JobExecutionProperties - Resource properties.
7246	*JobExecutionProperties `json:"properties,omitempty"`
7247	// ID - READ-ONLY; Resource ID.
7248	ID *string `json:"id,omitempty"`
7249	// Name - READ-ONLY; Resource name.
7250	Name *string `json:"name,omitempty"`
7251	// Type - READ-ONLY; Resource type.
7252	Type *string `json:"type,omitempty"`
7253}
7254
7255// MarshalJSON is the custom marshaler for JobExecution.
7256func (je JobExecution) MarshalJSON() ([]byte, error) {
7257	objectMap := make(map[string]interface{})
7258	if je.JobExecutionProperties != nil {
7259		objectMap["properties"] = je.JobExecutionProperties
7260	}
7261	return json.Marshal(objectMap)
7262}
7263
7264// UnmarshalJSON is the custom unmarshaler for JobExecution struct.
7265func (je *JobExecution) UnmarshalJSON(body []byte) error {
7266	var m map[string]*json.RawMessage
7267	err := json.Unmarshal(body, &m)
7268	if err != nil {
7269		return err
7270	}
7271	for k, v := range m {
7272		switch k {
7273		case "properties":
7274			if v != nil {
7275				var jobExecutionProperties JobExecutionProperties
7276				err = json.Unmarshal(*v, &jobExecutionProperties)
7277				if err != nil {
7278					return err
7279				}
7280				je.JobExecutionProperties = &jobExecutionProperties
7281			}
7282		case "id":
7283			if v != nil {
7284				var ID string
7285				err = json.Unmarshal(*v, &ID)
7286				if err != nil {
7287					return err
7288				}
7289				je.ID = &ID
7290			}
7291		case "name":
7292			if v != nil {
7293				var name string
7294				err = json.Unmarshal(*v, &name)
7295				if err != nil {
7296					return err
7297				}
7298				je.Name = &name
7299			}
7300		case "type":
7301			if v != nil {
7302				var typeVar string
7303				err = json.Unmarshal(*v, &typeVar)
7304				if err != nil {
7305					return err
7306				}
7307				je.Type = &typeVar
7308			}
7309		}
7310	}
7311
7312	return nil
7313}
7314
7315// JobExecutionListResult a list of job executions.
7316type JobExecutionListResult struct {
7317	autorest.Response `json:"-"`
7318	// Value - READ-ONLY; Array of results.
7319	Value *[]JobExecution `json:"value,omitempty"`
7320	// NextLink - READ-ONLY; Link to retrieve next page of results.
7321	NextLink *string `json:"nextLink,omitempty"`
7322}
7323
7324// JobExecutionListResultIterator provides access to a complete listing of JobExecution values.
7325type JobExecutionListResultIterator struct {
7326	i    int
7327	page JobExecutionListResultPage
7328}
7329
7330// NextWithContext advances to the next value.  If there was an error making
7331// the request the iterator does not advance and the error is returned.
7332func (iter *JobExecutionListResultIterator) NextWithContext(ctx context.Context) (err error) {
7333	if tracing.IsEnabled() {
7334		ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionListResultIterator.NextWithContext")
7335		defer func() {
7336			sc := -1
7337			if iter.Response().Response.Response != nil {
7338				sc = iter.Response().Response.Response.StatusCode
7339			}
7340			tracing.EndSpan(ctx, sc, err)
7341		}()
7342	}
7343	iter.i++
7344	if iter.i < len(iter.page.Values()) {
7345		return nil
7346	}
7347	err = iter.page.NextWithContext(ctx)
7348	if err != nil {
7349		iter.i--
7350		return err
7351	}
7352	iter.i = 0
7353	return nil
7354}
7355
7356// Next advances to the next value.  If there was an error making
7357// the request the iterator does not advance and the error is returned.
7358// Deprecated: Use NextWithContext() instead.
7359func (iter *JobExecutionListResultIterator) Next() error {
7360	return iter.NextWithContext(context.Background())
7361}
7362
7363// NotDone returns true if the enumeration should be started or is not yet complete.
7364func (iter JobExecutionListResultIterator) NotDone() bool {
7365	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7366}
7367
7368// Response returns the raw server response from the last page request.
7369func (iter JobExecutionListResultIterator) Response() JobExecutionListResult {
7370	return iter.page.Response()
7371}
7372
7373// Value returns the current value or a zero-initialized value if the
7374// iterator has advanced beyond the end of the collection.
7375func (iter JobExecutionListResultIterator) Value() JobExecution {
7376	if !iter.page.NotDone() {
7377		return JobExecution{}
7378	}
7379	return iter.page.Values()[iter.i]
7380}
7381
7382// Creates a new instance of the JobExecutionListResultIterator type.
7383func NewJobExecutionListResultIterator(page JobExecutionListResultPage) JobExecutionListResultIterator {
7384	return JobExecutionListResultIterator{page: page}
7385}
7386
7387// IsEmpty returns true if the ListResult contains no values.
7388func (jelr JobExecutionListResult) IsEmpty() bool {
7389	return jelr.Value == nil || len(*jelr.Value) == 0
7390}
7391
7392// hasNextLink returns true if the NextLink is not empty.
7393func (jelr JobExecutionListResult) hasNextLink() bool {
7394	return jelr.NextLink != nil && len(*jelr.NextLink) != 0
7395}
7396
7397// jobExecutionListResultPreparer prepares a request to retrieve the next set of results.
7398// It returns nil if no more results exist.
7399func (jelr JobExecutionListResult) jobExecutionListResultPreparer(ctx context.Context) (*http.Request, error) {
7400	if !jelr.hasNextLink() {
7401		return nil, nil
7402	}
7403	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7404		autorest.AsJSON(),
7405		autorest.AsGet(),
7406		autorest.WithBaseURL(to.String(jelr.NextLink)))
7407}
7408
7409// JobExecutionListResultPage contains a page of JobExecution values.
7410type JobExecutionListResultPage struct {
7411	fn   func(context.Context, JobExecutionListResult) (JobExecutionListResult, error)
7412	jelr JobExecutionListResult
7413}
7414
7415// NextWithContext advances to the next page of values.  If there was an error making
7416// the request the page does not advance and the error is returned.
7417func (page *JobExecutionListResultPage) NextWithContext(ctx context.Context) (err error) {
7418	if tracing.IsEnabled() {
7419		ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionListResultPage.NextWithContext")
7420		defer func() {
7421			sc := -1
7422			if page.Response().Response.Response != nil {
7423				sc = page.Response().Response.Response.StatusCode
7424			}
7425			tracing.EndSpan(ctx, sc, err)
7426		}()
7427	}
7428	for {
7429		next, err := page.fn(ctx, page.jelr)
7430		if err != nil {
7431			return err
7432		}
7433		page.jelr = next
7434		if !next.hasNextLink() || !next.IsEmpty() {
7435			break
7436		}
7437	}
7438	return nil
7439}
7440
7441// Next advances to the next page of values.  If there was an error making
7442// the request the page does not advance and the error is returned.
7443// Deprecated: Use NextWithContext() instead.
7444func (page *JobExecutionListResultPage) Next() error {
7445	return page.NextWithContext(context.Background())
7446}
7447
7448// NotDone returns true if the page enumeration should be started or is not yet complete.
7449func (page JobExecutionListResultPage) NotDone() bool {
7450	return !page.jelr.IsEmpty()
7451}
7452
7453// Response returns the raw server response from the last page request.
7454func (page JobExecutionListResultPage) Response() JobExecutionListResult {
7455	return page.jelr
7456}
7457
7458// Values returns the slice of values for the current page or nil if there are no values.
7459func (page JobExecutionListResultPage) Values() []JobExecution {
7460	if page.jelr.IsEmpty() {
7461		return nil
7462	}
7463	return *page.jelr.Value
7464}
7465
7466// Creates a new instance of the JobExecutionListResultPage type.
7467func NewJobExecutionListResultPage(cur JobExecutionListResult, getNextPage func(context.Context, JobExecutionListResult) (JobExecutionListResult, error)) JobExecutionListResultPage {
7468	return JobExecutionListResultPage{
7469		fn:   getNextPage,
7470		jelr: cur,
7471	}
7472}
7473
7474// JobExecutionProperties properties for an Azure SQL Database Elastic job execution.
7475type JobExecutionProperties struct {
7476	// JobVersion - READ-ONLY; The job version number.
7477	JobVersion *int32 `json:"jobVersion,omitempty"`
7478	// StepName - READ-ONLY; The job step name.
7479	StepName *string `json:"stepName,omitempty"`
7480	// StepID - READ-ONLY; The job step id.
7481	StepID *int32 `json:"stepId,omitempty"`
7482	// JobExecutionID - READ-ONLY; The unique identifier of the job execution.
7483	JobExecutionID *uuid.UUID `json:"jobExecutionId,omitempty"`
7484	// Lifecycle - READ-ONLY; The detailed state of the job execution. Possible values include: 'Created', 'InProgress', 'WaitingForChildJobExecutions', 'WaitingForRetry', 'Succeeded', 'SucceededWithSkipped', 'Failed', 'TimedOut', 'Canceled', 'Skipped'
7485	Lifecycle JobExecutionLifecycle `json:"lifecycle,omitempty"`
7486	// ProvisioningState - READ-ONLY; The ARM provisioning state of the job execution. Possible values include: 'ProvisioningStateCreated', 'ProvisioningStateInProgress', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
7487	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
7488	// CreateTime - READ-ONLY; The time that the job execution was created.
7489	CreateTime *date.Time `json:"createTime,omitempty"`
7490	// StartTime - READ-ONLY; The time that the job execution started.
7491	StartTime *date.Time `json:"startTime,omitempty"`
7492	// EndTime - READ-ONLY; The time that the job execution completed.
7493	EndTime *date.Time `json:"endTime,omitempty"`
7494	// CurrentAttempts - Number of times the job execution has been attempted.
7495	CurrentAttempts *int32 `json:"currentAttempts,omitempty"`
7496	// CurrentAttemptStartTime - READ-ONLY; Start time of the current attempt.
7497	CurrentAttemptStartTime *date.Time `json:"currentAttemptStartTime,omitempty"`
7498	// LastMessage - READ-ONLY; The last status or error message.
7499	LastMessage *string `json:"lastMessage,omitempty"`
7500	// Target - READ-ONLY; The target that this execution is executed on.
7501	Target *JobExecutionTarget `json:"target,omitempty"`
7502}
7503
7504// MarshalJSON is the custom marshaler for JobExecutionProperties.
7505func (jep JobExecutionProperties) MarshalJSON() ([]byte, error) {
7506	objectMap := make(map[string]interface{})
7507	if jep.CurrentAttempts != nil {
7508		objectMap["currentAttempts"] = jep.CurrentAttempts
7509	}
7510	return json.Marshal(objectMap)
7511}
7512
7513// JobExecutionsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
7514// operation.
7515type JobExecutionsCreateFuture struct {
7516	azure.FutureAPI
7517	// Result returns the result of the asynchronous operation.
7518	// If the operation has not completed it will return an error.
7519	Result func(JobExecutionsClient) (JobExecution, error)
7520}
7521
7522// JobExecutionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
7523// long-running operation.
7524type JobExecutionsCreateOrUpdateFuture struct {
7525	azure.FutureAPI
7526	// Result returns the result of the asynchronous operation.
7527	// If the operation has not completed it will return an error.
7528	Result func(JobExecutionsClient) (JobExecution, error)
7529}
7530
7531// JobExecutionTarget the target that a job execution is executed on.
7532type JobExecutionTarget struct {
7533	// Type - READ-ONLY; The type of the target. Possible values include: 'JobTargetTypeTargetGroup', 'JobTargetTypeSQLDatabase', 'JobTargetTypeSQLElasticPool', 'JobTargetTypeSQLShardMap', 'JobTargetTypeSQLServer'
7534	Type JobTargetType `json:"type,omitempty"`
7535	// ServerName - READ-ONLY; The server name.
7536	ServerName *string `json:"serverName,omitempty"`
7537	// DatabaseName - READ-ONLY; The database name.
7538	DatabaseName *string `json:"databaseName,omitempty"`
7539}
7540
7541// JobListResult a list of jobs.
7542type JobListResult struct {
7543	autorest.Response `json:"-"`
7544	// Value - READ-ONLY; Array of results.
7545	Value *[]Job `json:"value,omitempty"`
7546	// NextLink - READ-ONLY; Link to retrieve next page of results.
7547	NextLink *string `json:"nextLink,omitempty"`
7548}
7549
7550// JobListResultIterator provides access to a complete listing of Job values.
7551type JobListResultIterator struct {
7552	i    int
7553	page JobListResultPage
7554}
7555
7556// NextWithContext advances to the next value.  If there was an error making
7557// the request the iterator does not advance and the error is returned.
7558func (iter *JobListResultIterator) NextWithContext(ctx context.Context) (err error) {
7559	if tracing.IsEnabled() {
7560		ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultIterator.NextWithContext")
7561		defer func() {
7562			sc := -1
7563			if iter.Response().Response.Response != nil {
7564				sc = iter.Response().Response.Response.StatusCode
7565			}
7566			tracing.EndSpan(ctx, sc, err)
7567		}()
7568	}
7569	iter.i++
7570	if iter.i < len(iter.page.Values()) {
7571		return nil
7572	}
7573	err = iter.page.NextWithContext(ctx)
7574	if err != nil {
7575		iter.i--
7576		return err
7577	}
7578	iter.i = 0
7579	return nil
7580}
7581
7582// Next advances to the next value.  If there was an error making
7583// the request the iterator does not advance and the error is returned.
7584// Deprecated: Use NextWithContext() instead.
7585func (iter *JobListResultIterator) Next() error {
7586	return iter.NextWithContext(context.Background())
7587}
7588
7589// NotDone returns true if the enumeration should be started or is not yet complete.
7590func (iter JobListResultIterator) NotDone() bool {
7591	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7592}
7593
7594// Response returns the raw server response from the last page request.
7595func (iter JobListResultIterator) Response() JobListResult {
7596	return iter.page.Response()
7597}
7598
7599// Value returns the current value or a zero-initialized value if the
7600// iterator has advanced beyond the end of the collection.
7601func (iter JobListResultIterator) Value() Job {
7602	if !iter.page.NotDone() {
7603		return Job{}
7604	}
7605	return iter.page.Values()[iter.i]
7606}
7607
7608// Creates a new instance of the JobListResultIterator type.
7609func NewJobListResultIterator(page JobListResultPage) JobListResultIterator {
7610	return JobListResultIterator{page: page}
7611}
7612
7613// IsEmpty returns true if the ListResult contains no values.
7614func (jlr JobListResult) IsEmpty() bool {
7615	return jlr.Value == nil || len(*jlr.Value) == 0
7616}
7617
7618// hasNextLink returns true if the NextLink is not empty.
7619func (jlr JobListResult) hasNextLink() bool {
7620	return jlr.NextLink != nil && len(*jlr.NextLink) != 0
7621}
7622
7623// jobListResultPreparer prepares a request to retrieve the next set of results.
7624// It returns nil if no more results exist.
7625func (jlr JobListResult) jobListResultPreparer(ctx context.Context) (*http.Request, error) {
7626	if !jlr.hasNextLink() {
7627		return nil, nil
7628	}
7629	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7630		autorest.AsJSON(),
7631		autorest.AsGet(),
7632		autorest.WithBaseURL(to.String(jlr.NextLink)))
7633}
7634
7635// JobListResultPage contains a page of Job values.
7636type JobListResultPage struct {
7637	fn  func(context.Context, JobListResult) (JobListResult, error)
7638	jlr JobListResult
7639}
7640
7641// NextWithContext advances to the next page of values.  If there was an error making
7642// the request the page does not advance and the error is returned.
7643func (page *JobListResultPage) NextWithContext(ctx context.Context) (err error) {
7644	if tracing.IsEnabled() {
7645		ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultPage.NextWithContext")
7646		defer func() {
7647			sc := -1
7648			if page.Response().Response.Response != nil {
7649				sc = page.Response().Response.Response.StatusCode
7650			}
7651			tracing.EndSpan(ctx, sc, err)
7652		}()
7653	}
7654	for {
7655		next, err := page.fn(ctx, page.jlr)
7656		if err != nil {
7657			return err
7658		}
7659		page.jlr = next
7660		if !next.hasNextLink() || !next.IsEmpty() {
7661			break
7662		}
7663	}
7664	return nil
7665}
7666
7667// Next advances to the next page of values.  If there was an error making
7668// the request the page does not advance and the error is returned.
7669// Deprecated: Use NextWithContext() instead.
7670func (page *JobListResultPage) Next() error {
7671	return page.NextWithContext(context.Background())
7672}
7673
7674// NotDone returns true if the page enumeration should be started or is not yet complete.
7675func (page JobListResultPage) NotDone() bool {
7676	return !page.jlr.IsEmpty()
7677}
7678
7679// Response returns the raw server response from the last page request.
7680func (page JobListResultPage) Response() JobListResult {
7681	return page.jlr
7682}
7683
7684// Values returns the slice of values for the current page or nil if there are no values.
7685func (page JobListResultPage) Values() []Job {
7686	if page.jlr.IsEmpty() {
7687		return nil
7688	}
7689	return *page.jlr.Value
7690}
7691
7692// Creates a new instance of the JobListResultPage type.
7693func NewJobListResultPage(cur JobListResult, getNextPage func(context.Context, JobListResult) (JobListResult, error)) JobListResultPage {
7694	return JobListResultPage{
7695		fn:  getNextPage,
7696		jlr: cur,
7697	}
7698}
7699
7700// JobProperties properties of a job.
7701type JobProperties struct {
7702	// Description - User-defined description of the job.
7703	Description *string `json:"description,omitempty"`
7704	// Version - READ-ONLY; The job version number.
7705	Version *int32 `json:"version,omitempty"`
7706	// Schedule - Schedule properties of the job.
7707	Schedule *JobSchedule `json:"schedule,omitempty"`
7708}
7709
7710// MarshalJSON is the custom marshaler for JobProperties.
7711func (jp JobProperties) MarshalJSON() ([]byte, error) {
7712	objectMap := make(map[string]interface{})
7713	if jp.Description != nil {
7714		objectMap["description"] = jp.Description
7715	}
7716	if jp.Schedule != nil {
7717		objectMap["schedule"] = jp.Schedule
7718	}
7719	return json.Marshal(objectMap)
7720}
7721
7722// JobSchedule scheduling properties of a job.
7723type JobSchedule struct {
7724	// StartTime - Schedule start time.
7725	StartTime *date.Time `json:"startTime,omitempty"`
7726	// EndTime - Schedule end time.
7727	EndTime *date.Time `json:"endTime,omitempty"`
7728	// Type - Schedule interval type. Possible values include: 'Once', 'Recurring'
7729	Type JobScheduleType `json:"type,omitempty"`
7730	// Enabled - Whether or not the schedule is enabled.
7731	Enabled *bool `json:"enabled,omitempty"`
7732	// Interval - Value of the schedule's recurring interval, if the schedule type is recurring. ISO8601 duration format.
7733	Interval *string `json:"interval,omitempty"`
7734}
7735
7736// JobStep a job step.
7737type JobStep struct {
7738	autorest.Response `json:"-"`
7739	// JobStepProperties - Resource properties.
7740	*JobStepProperties `json:"properties,omitempty"`
7741	// ID - READ-ONLY; Resource ID.
7742	ID *string `json:"id,omitempty"`
7743	// Name - READ-ONLY; Resource name.
7744	Name *string `json:"name,omitempty"`
7745	// Type - READ-ONLY; Resource type.
7746	Type *string `json:"type,omitempty"`
7747}
7748
7749// MarshalJSON is the custom marshaler for JobStep.
7750func (js JobStep) MarshalJSON() ([]byte, error) {
7751	objectMap := make(map[string]interface{})
7752	if js.JobStepProperties != nil {
7753		objectMap["properties"] = js.JobStepProperties
7754	}
7755	return json.Marshal(objectMap)
7756}
7757
7758// UnmarshalJSON is the custom unmarshaler for JobStep struct.
7759func (js *JobStep) UnmarshalJSON(body []byte) error {
7760	var m map[string]*json.RawMessage
7761	err := json.Unmarshal(body, &m)
7762	if err != nil {
7763		return err
7764	}
7765	for k, v := range m {
7766		switch k {
7767		case "properties":
7768			if v != nil {
7769				var jobStepProperties JobStepProperties
7770				err = json.Unmarshal(*v, &jobStepProperties)
7771				if err != nil {
7772					return err
7773				}
7774				js.JobStepProperties = &jobStepProperties
7775			}
7776		case "id":
7777			if v != nil {
7778				var ID string
7779				err = json.Unmarshal(*v, &ID)
7780				if err != nil {
7781					return err
7782				}
7783				js.ID = &ID
7784			}
7785		case "name":
7786			if v != nil {
7787				var name string
7788				err = json.Unmarshal(*v, &name)
7789				if err != nil {
7790					return err
7791				}
7792				js.Name = &name
7793			}
7794		case "type":
7795			if v != nil {
7796				var typeVar string
7797				err = json.Unmarshal(*v, &typeVar)
7798				if err != nil {
7799					return err
7800				}
7801				js.Type = &typeVar
7802			}
7803		}
7804	}
7805
7806	return nil
7807}
7808
7809// JobStepAction the action to be executed by a job step.
7810type JobStepAction struct {
7811	// Type - Type of action being executed by the job step. Possible values include: 'TSQL'
7812	Type JobStepActionType `json:"type,omitempty"`
7813	// Source - The source of the action to execute. Possible values include: 'Inline'
7814	Source JobStepActionSource `json:"source,omitempty"`
7815	// Value - The action value, for example the text of the T-SQL script to execute.
7816	Value *string `json:"value,omitempty"`
7817}
7818
7819// JobStepExecutionOptions the execution options of a job step.
7820type JobStepExecutionOptions struct {
7821	// TimeoutSeconds - Execution timeout for the job step.
7822	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
7823	// RetryAttempts - Maximum number of times the job step will be reattempted if the first attempt fails.
7824	RetryAttempts *int32 `json:"retryAttempts,omitempty"`
7825	// InitialRetryIntervalSeconds - Initial delay between retries for job step execution.
7826	InitialRetryIntervalSeconds *int32 `json:"initialRetryIntervalSeconds,omitempty"`
7827	// MaximumRetryIntervalSeconds - The maximum amount of time to wait between retries for job step execution.
7828	MaximumRetryIntervalSeconds *int32 `json:"maximumRetryIntervalSeconds,omitempty"`
7829	// RetryIntervalBackoffMultiplier - The backoff multiplier for the time between retries.
7830	RetryIntervalBackoffMultiplier *float64 `json:"retryIntervalBackoffMultiplier,omitempty"`
7831}
7832
7833// JobStepListResult a list of job steps.
7834type JobStepListResult struct {
7835	autorest.Response `json:"-"`
7836	// Value - READ-ONLY; Array of results.
7837	Value *[]JobStep `json:"value,omitempty"`
7838	// NextLink - READ-ONLY; Link to retrieve next page of results.
7839	NextLink *string `json:"nextLink,omitempty"`
7840}
7841
7842// JobStepListResultIterator provides access to a complete listing of JobStep values.
7843type JobStepListResultIterator struct {
7844	i    int
7845	page JobStepListResultPage
7846}
7847
7848// NextWithContext advances to the next value.  If there was an error making
7849// the request the iterator does not advance and the error is returned.
7850func (iter *JobStepListResultIterator) NextWithContext(ctx context.Context) (err error) {
7851	if tracing.IsEnabled() {
7852		ctx = tracing.StartSpan(ctx, fqdn+"/JobStepListResultIterator.NextWithContext")
7853		defer func() {
7854			sc := -1
7855			if iter.Response().Response.Response != nil {
7856				sc = iter.Response().Response.Response.StatusCode
7857			}
7858			tracing.EndSpan(ctx, sc, err)
7859		}()
7860	}
7861	iter.i++
7862	if iter.i < len(iter.page.Values()) {
7863		return nil
7864	}
7865	err = iter.page.NextWithContext(ctx)
7866	if err != nil {
7867		iter.i--
7868		return err
7869	}
7870	iter.i = 0
7871	return nil
7872}
7873
7874// Next advances to the next value.  If there was an error making
7875// the request the iterator does not advance and the error is returned.
7876// Deprecated: Use NextWithContext() instead.
7877func (iter *JobStepListResultIterator) Next() error {
7878	return iter.NextWithContext(context.Background())
7879}
7880
7881// NotDone returns true if the enumeration should be started or is not yet complete.
7882func (iter JobStepListResultIterator) NotDone() bool {
7883	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7884}
7885
7886// Response returns the raw server response from the last page request.
7887func (iter JobStepListResultIterator) Response() JobStepListResult {
7888	return iter.page.Response()
7889}
7890
7891// Value returns the current value or a zero-initialized value if the
7892// iterator has advanced beyond the end of the collection.
7893func (iter JobStepListResultIterator) Value() JobStep {
7894	if !iter.page.NotDone() {
7895		return JobStep{}
7896	}
7897	return iter.page.Values()[iter.i]
7898}
7899
7900// Creates a new instance of the JobStepListResultIterator type.
7901func NewJobStepListResultIterator(page JobStepListResultPage) JobStepListResultIterator {
7902	return JobStepListResultIterator{page: page}
7903}
7904
7905// IsEmpty returns true if the ListResult contains no values.
7906func (jslr JobStepListResult) IsEmpty() bool {
7907	return jslr.Value == nil || len(*jslr.Value) == 0
7908}
7909
7910// hasNextLink returns true if the NextLink is not empty.
7911func (jslr JobStepListResult) hasNextLink() bool {
7912	return jslr.NextLink != nil && len(*jslr.NextLink) != 0
7913}
7914
7915// jobStepListResultPreparer prepares a request to retrieve the next set of results.
7916// It returns nil if no more results exist.
7917func (jslr JobStepListResult) jobStepListResultPreparer(ctx context.Context) (*http.Request, error) {
7918	if !jslr.hasNextLink() {
7919		return nil, nil
7920	}
7921	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7922		autorest.AsJSON(),
7923		autorest.AsGet(),
7924		autorest.WithBaseURL(to.String(jslr.NextLink)))
7925}
7926
7927// JobStepListResultPage contains a page of JobStep values.
7928type JobStepListResultPage struct {
7929	fn   func(context.Context, JobStepListResult) (JobStepListResult, error)
7930	jslr JobStepListResult
7931}
7932
7933// NextWithContext advances to the next page of values.  If there was an error making
7934// the request the page does not advance and the error is returned.
7935func (page *JobStepListResultPage) NextWithContext(ctx context.Context) (err error) {
7936	if tracing.IsEnabled() {
7937		ctx = tracing.StartSpan(ctx, fqdn+"/JobStepListResultPage.NextWithContext")
7938		defer func() {
7939			sc := -1
7940			if page.Response().Response.Response != nil {
7941				sc = page.Response().Response.Response.StatusCode
7942			}
7943			tracing.EndSpan(ctx, sc, err)
7944		}()
7945	}
7946	for {
7947		next, err := page.fn(ctx, page.jslr)
7948		if err != nil {
7949			return err
7950		}
7951		page.jslr = next
7952		if !next.hasNextLink() || !next.IsEmpty() {
7953			break
7954		}
7955	}
7956	return nil
7957}
7958
7959// Next advances to the next page of values.  If there was an error making
7960// the request the page does not advance and the error is returned.
7961// Deprecated: Use NextWithContext() instead.
7962func (page *JobStepListResultPage) Next() error {
7963	return page.NextWithContext(context.Background())
7964}
7965
7966// NotDone returns true if the page enumeration should be started or is not yet complete.
7967func (page JobStepListResultPage) NotDone() bool {
7968	return !page.jslr.IsEmpty()
7969}
7970
7971// Response returns the raw server response from the last page request.
7972func (page JobStepListResultPage) Response() JobStepListResult {
7973	return page.jslr
7974}
7975
7976// Values returns the slice of values for the current page or nil if there are no values.
7977func (page JobStepListResultPage) Values() []JobStep {
7978	if page.jslr.IsEmpty() {
7979		return nil
7980	}
7981	return *page.jslr.Value
7982}
7983
7984// Creates a new instance of the JobStepListResultPage type.
7985func NewJobStepListResultPage(cur JobStepListResult, getNextPage func(context.Context, JobStepListResult) (JobStepListResult, error)) JobStepListResultPage {
7986	return JobStepListResultPage{
7987		fn:   getNextPage,
7988		jslr: cur,
7989	}
7990}
7991
7992// JobStepOutput the output configuration of a job step.
7993type JobStepOutput struct {
7994	// Type - The output destination type. Possible values include: 'SQLDatabase'
7995	Type JobStepOutputType `json:"type,omitempty"`
7996	// SubscriptionID - The output destination subscription id.
7997	SubscriptionID *uuid.UUID `json:"subscriptionId,omitempty"`
7998	// ResourceGroupName - The output destination resource group.
7999	ResourceGroupName *string `json:"resourceGroupName,omitempty"`
8000	// ServerName - The output destination server name.
8001	ServerName *string `json:"serverName,omitempty"`
8002	// DatabaseName - The output destination database.
8003	DatabaseName *string `json:"databaseName,omitempty"`
8004	// SchemaName - The output destination schema.
8005	SchemaName *string `json:"schemaName,omitempty"`
8006	// TableName - The output destination table.
8007	TableName *string `json:"tableName,omitempty"`
8008	// Credential - The resource ID of the credential to use to connect to the output destination.
8009	Credential *string `json:"credential,omitempty"`
8010}
8011
8012// JobStepProperties properties of a job step.
8013type JobStepProperties struct {
8014	// 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.
8015	StepID *int32 `json:"stepId,omitempty"`
8016	// TargetGroup - The resource ID of the target group that the job step will be executed on.
8017	TargetGroup *string `json:"targetGroup,omitempty"`
8018	// Credential - The resource ID of the job credential that will be used to connect to the targets.
8019	Credential *string `json:"credential,omitempty"`
8020	// Action - The action payload of the job step.
8021	Action *JobStepAction `json:"action,omitempty"`
8022	// Output - Output destination properties of the job step.
8023	Output *JobStepOutput `json:"output,omitempty"`
8024	// ExecutionOptions - Execution options for the job step.
8025	ExecutionOptions *JobStepExecutionOptions `json:"executionOptions,omitempty"`
8026}
8027
8028// JobTarget a job target, for example a specific database or a container of databases that is evaluated
8029// during job execution.
8030type JobTarget struct {
8031	// MembershipType - Whether the target is included or excluded from the group. Possible values include: 'Include', 'Exclude'
8032	MembershipType JobTargetGroupMembershipType `json:"membershipType,omitempty"`
8033	// Type - The target type. Possible values include: 'JobTargetTypeTargetGroup', 'JobTargetTypeSQLDatabase', 'JobTargetTypeSQLElasticPool', 'JobTargetTypeSQLShardMap', 'JobTargetTypeSQLServer'
8034	Type JobTargetType `json:"type,omitempty"`
8035	// ServerName - The target server name.
8036	ServerName *string `json:"serverName,omitempty"`
8037	// DatabaseName - The target database name.
8038	DatabaseName *string `json:"databaseName,omitempty"`
8039	// ElasticPoolName - The target elastic pool name.
8040	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
8041	// ShardMapName - The target shard map.
8042	ShardMapName *string `json:"shardMapName,omitempty"`
8043	// 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.
8044	RefreshCredential *string `json:"refreshCredential,omitempty"`
8045}
8046
8047// JobTargetGroup a group of job targets.
8048type JobTargetGroup struct {
8049	autorest.Response `json:"-"`
8050	// JobTargetGroupProperties - Resource properties.
8051	*JobTargetGroupProperties `json:"properties,omitempty"`
8052	// ID - READ-ONLY; Resource ID.
8053	ID *string `json:"id,omitempty"`
8054	// Name - READ-ONLY; Resource name.
8055	Name *string `json:"name,omitempty"`
8056	// Type - READ-ONLY; Resource type.
8057	Type *string `json:"type,omitempty"`
8058}
8059
8060// MarshalJSON is the custom marshaler for JobTargetGroup.
8061func (jtg JobTargetGroup) MarshalJSON() ([]byte, error) {
8062	objectMap := make(map[string]interface{})
8063	if jtg.JobTargetGroupProperties != nil {
8064		objectMap["properties"] = jtg.JobTargetGroupProperties
8065	}
8066	return json.Marshal(objectMap)
8067}
8068
8069// UnmarshalJSON is the custom unmarshaler for JobTargetGroup struct.
8070func (jtg *JobTargetGroup) UnmarshalJSON(body []byte) error {
8071	var m map[string]*json.RawMessage
8072	err := json.Unmarshal(body, &m)
8073	if err != nil {
8074		return err
8075	}
8076	for k, v := range m {
8077		switch k {
8078		case "properties":
8079			if v != nil {
8080				var jobTargetGroupProperties JobTargetGroupProperties
8081				err = json.Unmarshal(*v, &jobTargetGroupProperties)
8082				if err != nil {
8083					return err
8084				}
8085				jtg.JobTargetGroupProperties = &jobTargetGroupProperties
8086			}
8087		case "id":
8088			if v != nil {
8089				var ID string
8090				err = json.Unmarshal(*v, &ID)
8091				if err != nil {
8092					return err
8093				}
8094				jtg.ID = &ID
8095			}
8096		case "name":
8097			if v != nil {
8098				var name string
8099				err = json.Unmarshal(*v, &name)
8100				if err != nil {
8101					return err
8102				}
8103				jtg.Name = &name
8104			}
8105		case "type":
8106			if v != nil {
8107				var typeVar string
8108				err = json.Unmarshal(*v, &typeVar)
8109				if err != nil {
8110					return err
8111				}
8112				jtg.Type = &typeVar
8113			}
8114		}
8115	}
8116
8117	return nil
8118}
8119
8120// JobTargetGroupListResult a list of target groups.
8121type JobTargetGroupListResult struct {
8122	autorest.Response `json:"-"`
8123	// Value - READ-ONLY; Array of results.
8124	Value *[]JobTargetGroup `json:"value,omitempty"`
8125	// NextLink - READ-ONLY; Link to retrieve next page of results.
8126	NextLink *string `json:"nextLink,omitempty"`
8127}
8128
8129// JobTargetGroupListResultIterator provides access to a complete listing of JobTargetGroup values.
8130type JobTargetGroupListResultIterator struct {
8131	i    int
8132	page JobTargetGroupListResultPage
8133}
8134
8135// NextWithContext advances to the next value.  If there was an error making
8136// the request the iterator does not advance and the error is returned.
8137func (iter *JobTargetGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
8138	if tracing.IsEnabled() {
8139		ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultIterator.NextWithContext")
8140		defer func() {
8141			sc := -1
8142			if iter.Response().Response.Response != nil {
8143				sc = iter.Response().Response.Response.StatusCode
8144			}
8145			tracing.EndSpan(ctx, sc, err)
8146		}()
8147	}
8148	iter.i++
8149	if iter.i < len(iter.page.Values()) {
8150		return nil
8151	}
8152	err = iter.page.NextWithContext(ctx)
8153	if err != nil {
8154		iter.i--
8155		return err
8156	}
8157	iter.i = 0
8158	return nil
8159}
8160
8161// Next advances to the next value.  If there was an error making
8162// the request the iterator does not advance and the error is returned.
8163// Deprecated: Use NextWithContext() instead.
8164func (iter *JobTargetGroupListResultIterator) Next() error {
8165	return iter.NextWithContext(context.Background())
8166}
8167
8168// NotDone returns true if the enumeration should be started or is not yet complete.
8169func (iter JobTargetGroupListResultIterator) NotDone() bool {
8170	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8171}
8172
8173// Response returns the raw server response from the last page request.
8174func (iter JobTargetGroupListResultIterator) Response() JobTargetGroupListResult {
8175	return iter.page.Response()
8176}
8177
8178// Value returns the current value or a zero-initialized value if the
8179// iterator has advanced beyond the end of the collection.
8180func (iter JobTargetGroupListResultIterator) Value() JobTargetGroup {
8181	if !iter.page.NotDone() {
8182		return JobTargetGroup{}
8183	}
8184	return iter.page.Values()[iter.i]
8185}
8186
8187// Creates a new instance of the JobTargetGroupListResultIterator type.
8188func NewJobTargetGroupListResultIterator(page JobTargetGroupListResultPage) JobTargetGroupListResultIterator {
8189	return JobTargetGroupListResultIterator{page: page}
8190}
8191
8192// IsEmpty returns true if the ListResult contains no values.
8193func (jtglr JobTargetGroupListResult) IsEmpty() bool {
8194	return jtglr.Value == nil || len(*jtglr.Value) == 0
8195}
8196
8197// hasNextLink returns true if the NextLink is not empty.
8198func (jtglr JobTargetGroupListResult) hasNextLink() bool {
8199	return jtglr.NextLink != nil && len(*jtglr.NextLink) != 0
8200}
8201
8202// jobTargetGroupListResultPreparer prepares a request to retrieve the next set of results.
8203// It returns nil if no more results exist.
8204func (jtglr JobTargetGroupListResult) jobTargetGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
8205	if !jtglr.hasNextLink() {
8206		return nil, nil
8207	}
8208	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8209		autorest.AsJSON(),
8210		autorest.AsGet(),
8211		autorest.WithBaseURL(to.String(jtglr.NextLink)))
8212}
8213
8214// JobTargetGroupListResultPage contains a page of JobTargetGroup values.
8215type JobTargetGroupListResultPage struct {
8216	fn    func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error)
8217	jtglr JobTargetGroupListResult
8218}
8219
8220// NextWithContext advances to the next page of values.  If there was an error making
8221// the request the page does not advance and the error is returned.
8222func (page *JobTargetGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
8223	if tracing.IsEnabled() {
8224		ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultPage.NextWithContext")
8225		defer func() {
8226			sc := -1
8227			if page.Response().Response.Response != nil {
8228				sc = page.Response().Response.Response.StatusCode
8229			}
8230			tracing.EndSpan(ctx, sc, err)
8231		}()
8232	}
8233	for {
8234		next, err := page.fn(ctx, page.jtglr)
8235		if err != nil {
8236			return err
8237		}
8238		page.jtglr = next
8239		if !next.hasNextLink() || !next.IsEmpty() {
8240			break
8241		}
8242	}
8243	return nil
8244}
8245
8246// Next advances to the next page of values.  If there was an error making
8247// the request the page does not advance and the error is returned.
8248// Deprecated: Use NextWithContext() instead.
8249func (page *JobTargetGroupListResultPage) Next() error {
8250	return page.NextWithContext(context.Background())
8251}
8252
8253// NotDone returns true if the page enumeration should be started or is not yet complete.
8254func (page JobTargetGroupListResultPage) NotDone() bool {
8255	return !page.jtglr.IsEmpty()
8256}
8257
8258// Response returns the raw server response from the last page request.
8259func (page JobTargetGroupListResultPage) Response() JobTargetGroupListResult {
8260	return page.jtglr
8261}
8262
8263// Values returns the slice of values for the current page or nil if there are no values.
8264func (page JobTargetGroupListResultPage) Values() []JobTargetGroup {
8265	if page.jtglr.IsEmpty() {
8266		return nil
8267	}
8268	return *page.jtglr.Value
8269}
8270
8271// Creates a new instance of the JobTargetGroupListResultPage type.
8272func NewJobTargetGroupListResultPage(cur JobTargetGroupListResult, getNextPage func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error)) JobTargetGroupListResultPage {
8273	return JobTargetGroupListResultPage{
8274		fn:    getNextPage,
8275		jtglr: cur,
8276	}
8277}
8278
8279// JobTargetGroupProperties properties of job target group.
8280type JobTargetGroupProperties struct {
8281	// Members - Members of the target group.
8282	Members *[]JobTarget `json:"members,omitempty"`
8283}
8284
8285// JobVersion a job version.
8286type JobVersion struct {
8287	autorest.Response `json:"-"`
8288	// ID - READ-ONLY; Resource ID.
8289	ID *string `json:"id,omitempty"`
8290	// Name - READ-ONLY; Resource name.
8291	Name *string `json:"name,omitempty"`
8292	// Type - READ-ONLY; Resource type.
8293	Type *string `json:"type,omitempty"`
8294}
8295
8296// JobVersionListResult a list of job versions.
8297type JobVersionListResult struct {
8298	autorest.Response `json:"-"`
8299	// Value - READ-ONLY; Array of results.
8300	Value *[]JobVersion `json:"value,omitempty"`
8301	// NextLink - READ-ONLY; Link to retrieve next page of results.
8302	NextLink *string `json:"nextLink,omitempty"`
8303}
8304
8305// JobVersionListResultIterator provides access to a complete listing of JobVersion values.
8306type JobVersionListResultIterator struct {
8307	i    int
8308	page JobVersionListResultPage
8309}
8310
8311// NextWithContext advances to the next value.  If there was an error making
8312// the request the iterator does not advance and the error is returned.
8313func (iter *JobVersionListResultIterator) NextWithContext(ctx context.Context) (err error) {
8314	if tracing.IsEnabled() {
8315		ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultIterator.NextWithContext")
8316		defer func() {
8317			sc := -1
8318			if iter.Response().Response.Response != nil {
8319				sc = iter.Response().Response.Response.StatusCode
8320			}
8321			tracing.EndSpan(ctx, sc, err)
8322		}()
8323	}
8324	iter.i++
8325	if iter.i < len(iter.page.Values()) {
8326		return nil
8327	}
8328	err = iter.page.NextWithContext(ctx)
8329	if err != nil {
8330		iter.i--
8331		return err
8332	}
8333	iter.i = 0
8334	return nil
8335}
8336
8337// Next advances to the next value.  If there was an error making
8338// the request the iterator does not advance and the error is returned.
8339// Deprecated: Use NextWithContext() instead.
8340func (iter *JobVersionListResultIterator) Next() error {
8341	return iter.NextWithContext(context.Background())
8342}
8343
8344// NotDone returns true if the enumeration should be started or is not yet complete.
8345func (iter JobVersionListResultIterator) NotDone() bool {
8346	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8347}
8348
8349// Response returns the raw server response from the last page request.
8350func (iter JobVersionListResultIterator) Response() JobVersionListResult {
8351	return iter.page.Response()
8352}
8353
8354// Value returns the current value or a zero-initialized value if the
8355// iterator has advanced beyond the end of the collection.
8356func (iter JobVersionListResultIterator) Value() JobVersion {
8357	if !iter.page.NotDone() {
8358		return JobVersion{}
8359	}
8360	return iter.page.Values()[iter.i]
8361}
8362
8363// Creates a new instance of the JobVersionListResultIterator type.
8364func NewJobVersionListResultIterator(page JobVersionListResultPage) JobVersionListResultIterator {
8365	return JobVersionListResultIterator{page: page}
8366}
8367
8368// IsEmpty returns true if the ListResult contains no values.
8369func (jvlr JobVersionListResult) IsEmpty() bool {
8370	return jvlr.Value == nil || len(*jvlr.Value) == 0
8371}
8372
8373// hasNextLink returns true if the NextLink is not empty.
8374func (jvlr JobVersionListResult) hasNextLink() bool {
8375	return jvlr.NextLink != nil && len(*jvlr.NextLink) != 0
8376}
8377
8378// jobVersionListResultPreparer prepares a request to retrieve the next set of results.
8379// It returns nil if no more results exist.
8380func (jvlr JobVersionListResult) jobVersionListResultPreparer(ctx context.Context) (*http.Request, error) {
8381	if !jvlr.hasNextLink() {
8382		return nil, nil
8383	}
8384	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8385		autorest.AsJSON(),
8386		autorest.AsGet(),
8387		autorest.WithBaseURL(to.String(jvlr.NextLink)))
8388}
8389
8390// JobVersionListResultPage contains a page of JobVersion values.
8391type JobVersionListResultPage struct {
8392	fn   func(context.Context, JobVersionListResult) (JobVersionListResult, error)
8393	jvlr JobVersionListResult
8394}
8395
8396// NextWithContext advances to the next page of values.  If there was an error making
8397// the request the page does not advance and the error is returned.
8398func (page *JobVersionListResultPage) NextWithContext(ctx context.Context) (err error) {
8399	if tracing.IsEnabled() {
8400		ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultPage.NextWithContext")
8401		defer func() {
8402			sc := -1
8403			if page.Response().Response.Response != nil {
8404				sc = page.Response().Response.Response.StatusCode
8405			}
8406			tracing.EndSpan(ctx, sc, err)
8407		}()
8408	}
8409	for {
8410		next, err := page.fn(ctx, page.jvlr)
8411		if err != nil {
8412			return err
8413		}
8414		page.jvlr = next
8415		if !next.hasNextLink() || !next.IsEmpty() {
8416			break
8417		}
8418	}
8419	return nil
8420}
8421
8422// Next advances to the next page of values.  If there was an error making
8423// the request the page does not advance and the error is returned.
8424// Deprecated: Use NextWithContext() instead.
8425func (page *JobVersionListResultPage) Next() error {
8426	return page.NextWithContext(context.Background())
8427}
8428
8429// NotDone returns true if the page enumeration should be started or is not yet complete.
8430func (page JobVersionListResultPage) NotDone() bool {
8431	return !page.jvlr.IsEmpty()
8432}
8433
8434// Response returns the raw server response from the last page request.
8435func (page JobVersionListResultPage) Response() JobVersionListResult {
8436	return page.jvlr
8437}
8438
8439// Values returns the slice of values for the current page or nil if there are no values.
8440func (page JobVersionListResultPage) Values() []JobVersion {
8441	if page.jvlr.IsEmpty() {
8442		return nil
8443	}
8444	return *page.jvlr.Value
8445}
8446
8447// Creates a new instance of the JobVersionListResultPage type.
8448func NewJobVersionListResultPage(cur JobVersionListResult, getNextPage func(context.Context, JobVersionListResult) (JobVersionListResult, error)) JobVersionListResultPage {
8449	return JobVersionListResultPage{
8450		fn:   getNextPage,
8451		jvlr: cur,
8452	}
8453}
8454
8455// LicenseTypeCapability the license type capability
8456type LicenseTypeCapability struct {
8457	// Name - READ-ONLY; License type identifier.
8458	Name *string `json:"name,omitempty"`
8459	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
8460	Status CapabilityStatus `json:"status,omitempty"`
8461	// Reason - The reason for the capability not being available.
8462	Reason *string `json:"reason,omitempty"`
8463}
8464
8465// MarshalJSON is the custom marshaler for LicenseTypeCapability.
8466func (ltc LicenseTypeCapability) MarshalJSON() ([]byte, error) {
8467	objectMap := make(map[string]interface{})
8468	if ltc.Reason != nil {
8469		objectMap["reason"] = ltc.Reason
8470	}
8471	return json.Marshal(objectMap)
8472}
8473
8474// LocationCapabilities the location capability.
8475type LocationCapabilities struct {
8476	autorest.Response `json:"-"`
8477	// Name - READ-ONLY; The location name.
8478	Name *string `json:"name,omitempty"`
8479	// SupportedServerVersions - READ-ONLY; The list of supported server versions.
8480	SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"`
8481	// SupportedManagedInstanceVersions - READ-ONLY; The list of supported managed instance versions.
8482	SupportedManagedInstanceVersions *[]ManagedInstanceVersionCapability `json:"supportedManagedInstanceVersions,omitempty"`
8483	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
8484	Status CapabilityStatus `json:"status,omitempty"`
8485	// Reason - The reason for the capability not being available.
8486	Reason *string `json:"reason,omitempty"`
8487}
8488
8489// MarshalJSON is the custom marshaler for LocationCapabilities.
8490func (lc LocationCapabilities) MarshalJSON() ([]byte, error) {
8491	objectMap := make(map[string]interface{})
8492	if lc.Reason != nil {
8493		objectMap["reason"] = lc.Reason
8494	}
8495	return json.Marshal(objectMap)
8496}
8497
8498// LogicalServerSecurityAlertPolicyListResult a list of the server's security alert policies.
8499type LogicalServerSecurityAlertPolicyListResult struct {
8500	autorest.Response `json:"-"`
8501	// Value - READ-ONLY; Array of results.
8502	Value *[]ServerSecurityAlertPolicy `json:"value,omitempty"`
8503	// NextLink - READ-ONLY; Link to retrieve next page of results.
8504	NextLink *string `json:"nextLink,omitempty"`
8505}
8506
8507// LogicalServerSecurityAlertPolicyListResultIterator provides access to a complete listing of
8508// ServerSecurityAlertPolicy values.
8509type LogicalServerSecurityAlertPolicyListResultIterator struct {
8510	i    int
8511	page LogicalServerSecurityAlertPolicyListResultPage
8512}
8513
8514// NextWithContext advances to the next value.  If there was an error making
8515// the request the iterator does not advance and the error is returned.
8516func (iter *LogicalServerSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
8517	if tracing.IsEnabled() {
8518		ctx = tracing.StartSpan(ctx, fqdn+"/LogicalServerSecurityAlertPolicyListResultIterator.NextWithContext")
8519		defer func() {
8520			sc := -1
8521			if iter.Response().Response.Response != nil {
8522				sc = iter.Response().Response.Response.StatusCode
8523			}
8524			tracing.EndSpan(ctx, sc, err)
8525		}()
8526	}
8527	iter.i++
8528	if iter.i < len(iter.page.Values()) {
8529		return nil
8530	}
8531	err = iter.page.NextWithContext(ctx)
8532	if err != nil {
8533		iter.i--
8534		return err
8535	}
8536	iter.i = 0
8537	return nil
8538}
8539
8540// Next advances to the next value.  If there was an error making
8541// the request the iterator does not advance and the error is returned.
8542// Deprecated: Use NextWithContext() instead.
8543func (iter *LogicalServerSecurityAlertPolicyListResultIterator) Next() error {
8544	return iter.NextWithContext(context.Background())
8545}
8546
8547// NotDone returns true if the enumeration should be started or is not yet complete.
8548func (iter LogicalServerSecurityAlertPolicyListResultIterator) NotDone() bool {
8549	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8550}
8551
8552// Response returns the raw server response from the last page request.
8553func (iter LogicalServerSecurityAlertPolicyListResultIterator) Response() LogicalServerSecurityAlertPolicyListResult {
8554	return iter.page.Response()
8555}
8556
8557// Value returns the current value or a zero-initialized value if the
8558// iterator has advanced beyond the end of the collection.
8559func (iter LogicalServerSecurityAlertPolicyListResultIterator) Value() ServerSecurityAlertPolicy {
8560	if !iter.page.NotDone() {
8561		return ServerSecurityAlertPolicy{}
8562	}
8563	return iter.page.Values()[iter.i]
8564}
8565
8566// Creates a new instance of the LogicalServerSecurityAlertPolicyListResultIterator type.
8567func NewLogicalServerSecurityAlertPolicyListResultIterator(page LogicalServerSecurityAlertPolicyListResultPage) LogicalServerSecurityAlertPolicyListResultIterator {
8568	return LogicalServerSecurityAlertPolicyListResultIterator{page: page}
8569}
8570
8571// IsEmpty returns true if the ListResult contains no values.
8572func (lssaplr LogicalServerSecurityAlertPolicyListResult) IsEmpty() bool {
8573	return lssaplr.Value == nil || len(*lssaplr.Value) == 0
8574}
8575
8576// hasNextLink returns true if the NextLink is not empty.
8577func (lssaplr LogicalServerSecurityAlertPolicyListResult) hasNextLink() bool {
8578	return lssaplr.NextLink != nil && len(*lssaplr.NextLink) != 0
8579}
8580
8581// logicalServerSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
8582// It returns nil if no more results exist.
8583func (lssaplr LogicalServerSecurityAlertPolicyListResult) logicalServerSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
8584	if !lssaplr.hasNextLink() {
8585		return nil, nil
8586	}
8587	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8588		autorest.AsJSON(),
8589		autorest.AsGet(),
8590		autorest.WithBaseURL(to.String(lssaplr.NextLink)))
8591}
8592
8593// LogicalServerSecurityAlertPolicyListResultPage contains a page of ServerSecurityAlertPolicy values.
8594type LogicalServerSecurityAlertPolicyListResultPage struct {
8595	fn      func(context.Context, LogicalServerSecurityAlertPolicyListResult) (LogicalServerSecurityAlertPolicyListResult, error)
8596	lssaplr LogicalServerSecurityAlertPolicyListResult
8597}
8598
8599// NextWithContext advances to the next page of values.  If there was an error making
8600// the request the page does not advance and the error is returned.
8601func (page *LogicalServerSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
8602	if tracing.IsEnabled() {
8603		ctx = tracing.StartSpan(ctx, fqdn+"/LogicalServerSecurityAlertPolicyListResultPage.NextWithContext")
8604		defer func() {
8605			sc := -1
8606			if page.Response().Response.Response != nil {
8607				sc = page.Response().Response.Response.StatusCode
8608			}
8609			tracing.EndSpan(ctx, sc, err)
8610		}()
8611	}
8612	for {
8613		next, err := page.fn(ctx, page.lssaplr)
8614		if err != nil {
8615			return err
8616		}
8617		page.lssaplr = next
8618		if !next.hasNextLink() || !next.IsEmpty() {
8619			break
8620		}
8621	}
8622	return nil
8623}
8624
8625// Next advances to the next page of values.  If there was an error making
8626// the request the page does not advance and the error is returned.
8627// Deprecated: Use NextWithContext() instead.
8628func (page *LogicalServerSecurityAlertPolicyListResultPage) Next() error {
8629	return page.NextWithContext(context.Background())
8630}
8631
8632// NotDone returns true if the page enumeration should be started or is not yet complete.
8633func (page LogicalServerSecurityAlertPolicyListResultPage) NotDone() bool {
8634	return !page.lssaplr.IsEmpty()
8635}
8636
8637// Response returns the raw server response from the last page request.
8638func (page LogicalServerSecurityAlertPolicyListResultPage) Response() LogicalServerSecurityAlertPolicyListResult {
8639	return page.lssaplr
8640}
8641
8642// Values returns the slice of values for the current page or nil if there are no values.
8643func (page LogicalServerSecurityAlertPolicyListResultPage) Values() []ServerSecurityAlertPolicy {
8644	if page.lssaplr.IsEmpty() {
8645		return nil
8646	}
8647	return *page.lssaplr.Value
8648}
8649
8650// Creates a new instance of the LogicalServerSecurityAlertPolicyListResultPage type.
8651func NewLogicalServerSecurityAlertPolicyListResultPage(cur LogicalServerSecurityAlertPolicyListResult, getNextPage func(context.Context, LogicalServerSecurityAlertPolicyListResult) (LogicalServerSecurityAlertPolicyListResult, error)) LogicalServerSecurityAlertPolicyListResultPage {
8652	return LogicalServerSecurityAlertPolicyListResultPage{
8653		fn:      getNextPage,
8654		lssaplr: cur,
8655	}
8656}
8657
8658// LogSizeCapability the log size capability.
8659type LogSizeCapability struct {
8660	// Limit - READ-ONLY; The log size limit (see 'unit' for the units).
8661	Limit *int32 `json:"limit,omitempty"`
8662	// Unit - READ-ONLY; The units that the limit is expressed in. Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', 'Percent'
8663	Unit LogSizeUnit `json:"unit,omitempty"`
8664}
8665
8666// LongTermRetentionBackup a long term retention backup.
8667type LongTermRetentionBackup struct {
8668	autorest.Response `json:"-"`
8669	// LongTermRetentionBackupProperties - Resource properties.
8670	*LongTermRetentionBackupProperties `json:"properties,omitempty"`
8671	// ID - READ-ONLY; Resource ID.
8672	ID *string `json:"id,omitempty"`
8673	// Name - READ-ONLY; Resource name.
8674	Name *string `json:"name,omitempty"`
8675	// Type - READ-ONLY; Resource type.
8676	Type *string `json:"type,omitempty"`
8677}
8678
8679// MarshalJSON is the custom marshaler for LongTermRetentionBackup.
8680func (ltrb LongTermRetentionBackup) MarshalJSON() ([]byte, error) {
8681	objectMap := make(map[string]interface{})
8682	if ltrb.LongTermRetentionBackupProperties != nil {
8683		objectMap["properties"] = ltrb.LongTermRetentionBackupProperties
8684	}
8685	return json.Marshal(objectMap)
8686}
8687
8688// UnmarshalJSON is the custom unmarshaler for LongTermRetentionBackup struct.
8689func (ltrb *LongTermRetentionBackup) UnmarshalJSON(body []byte) error {
8690	var m map[string]*json.RawMessage
8691	err := json.Unmarshal(body, &m)
8692	if err != nil {
8693		return err
8694	}
8695	for k, v := range m {
8696		switch k {
8697		case "properties":
8698			if v != nil {
8699				var longTermRetentionBackupProperties LongTermRetentionBackupProperties
8700				err = json.Unmarshal(*v, &longTermRetentionBackupProperties)
8701				if err != nil {
8702					return err
8703				}
8704				ltrb.LongTermRetentionBackupProperties = &longTermRetentionBackupProperties
8705			}
8706		case "id":
8707			if v != nil {
8708				var ID string
8709				err = json.Unmarshal(*v, &ID)
8710				if err != nil {
8711					return err
8712				}
8713				ltrb.ID = &ID
8714			}
8715		case "name":
8716			if v != nil {
8717				var name string
8718				err = json.Unmarshal(*v, &name)
8719				if err != nil {
8720					return err
8721				}
8722				ltrb.Name = &name
8723			}
8724		case "type":
8725			if v != nil {
8726				var typeVar string
8727				err = json.Unmarshal(*v, &typeVar)
8728				if err != nil {
8729					return err
8730				}
8731				ltrb.Type = &typeVar
8732			}
8733		}
8734	}
8735
8736	return nil
8737}
8738
8739// LongTermRetentionBackupListResult a list of long term retention backups.
8740type LongTermRetentionBackupListResult struct {
8741	autorest.Response `json:"-"`
8742	// Value - READ-ONLY; Array of results.
8743	Value *[]LongTermRetentionBackup `json:"value,omitempty"`
8744	// NextLink - READ-ONLY; Link to retrieve next page of results.
8745	NextLink *string `json:"nextLink,omitempty"`
8746}
8747
8748// LongTermRetentionBackupListResultIterator provides access to a complete listing of
8749// LongTermRetentionBackup values.
8750type LongTermRetentionBackupListResultIterator struct {
8751	i    int
8752	page LongTermRetentionBackupListResultPage
8753}
8754
8755// NextWithContext advances to the next value.  If there was an error making
8756// the request the iterator does not advance and the error is returned.
8757func (iter *LongTermRetentionBackupListResultIterator) NextWithContext(ctx context.Context) (err error) {
8758	if tracing.IsEnabled() {
8759		ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultIterator.NextWithContext")
8760		defer func() {
8761			sc := -1
8762			if iter.Response().Response.Response != nil {
8763				sc = iter.Response().Response.Response.StatusCode
8764			}
8765			tracing.EndSpan(ctx, sc, err)
8766		}()
8767	}
8768	iter.i++
8769	if iter.i < len(iter.page.Values()) {
8770		return nil
8771	}
8772	err = iter.page.NextWithContext(ctx)
8773	if err != nil {
8774		iter.i--
8775		return err
8776	}
8777	iter.i = 0
8778	return nil
8779}
8780
8781// Next advances to the next value.  If there was an error making
8782// the request the iterator does not advance and the error is returned.
8783// Deprecated: Use NextWithContext() instead.
8784func (iter *LongTermRetentionBackupListResultIterator) Next() error {
8785	return iter.NextWithContext(context.Background())
8786}
8787
8788// NotDone returns true if the enumeration should be started or is not yet complete.
8789func (iter LongTermRetentionBackupListResultIterator) NotDone() bool {
8790	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8791}
8792
8793// Response returns the raw server response from the last page request.
8794func (iter LongTermRetentionBackupListResultIterator) Response() LongTermRetentionBackupListResult {
8795	return iter.page.Response()
8796}
8797
8798// Value returns the current value or a zero-initialized value if the
8799// iterator has advanced beyond the end of the collection.
8800func (iter LongTermRetentionBackupListResultIterator) Value() LongTermRetentionBackup {
8801	if !iter.page.NotDone() {
8802		return LongTermRetentionBackup{}
8803	}
8804	return iter.page.Values()[iter.i]
8805}
8806
8807// Creates a new instance of the LongTermRetentionBackupListResultIterator type.
8808func NewLongTermRetentionBackupListResultIterator(page LongTermRetentionBackupListResultPage) LongTermRetentionBackupListResultIterator {
8809	return LongTermRetentionBackupListResultIterator{page: page}
8810}
8811
8812// IsEmpty returns true if the ListResult contains no values.
8813func (ltrblr LongTermRetentionBackupListResult) IsEmpty() bool {
8814	return ltrblr.Value == nil || len(*ltrblr.Value) == 0
8815}
8816
8817// hasNextLink returns true if the NextLink is not empty.
8818func (ltrblr LongTermRetentionBackupListResult) hasNextLink() bool {
8819	return ltrblr.NextLink != nil && len(*ltrblr.NextLink) != 0
8820}
8821
8822// longTermRetentionBackupListResultPreparer prepares a request to retrieve the next set of results.
8823// It returns nil if no more results exist.
8824func (ltrblr LongTermRetentionBackupListResult) longTermRetentionBackupListResultPreparer(ctx context.Context) (*http.Request, error) {
8825	if !ltrblr.hasNextLink() {
8826		return nil, nil
8827	}
8828	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8829		autorest.AsJSON(),
8830		autorest.AsGet(),
8831		autorest.WithBaseURL(to.String(ltrblr.NextLink)))
8832}
8833
8834// LongTermRetentionBackupListResultPage contains a page of LongTermRetentionBackup values.
8835type LongTermRetentionBackupListResultPage struct {
8836	fn     func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error)
8837	ltrblr LongTermRetentionBackupListResult
8838}
8839
8840// NextWithContext advances to the next page of values.  If there was an error making
8841// the request the page does not advance and the error is returned.
8842func (page *LongTermRetentionBackupListResultPage) NextWithContext(ctx context.Context) (err error) {
8843	if tracing.IsEnabled() {
8844		ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultPage.NextWithContext")
8845		defer func() {
8846			sc := -1
8847			if page.Response().Response.Response != nil {
8848				sc = page.Response().Response.Response.StatusCode
8849			}
8850			tracing.EndSpan(ctx, sc, err)
8851		}()
8852	}
8853	for {
8854		next, err := page.fn(ctx, page.ltrblr)
8855		if err != nil {
8856			return err
8857		}
8858		page.ltrblr = next
8859		if !next.hasNextLink() || !next.IsEmpty() {
8860			break
8861		}
8862	}
8863	return nil
8864}
8865
8866// Next advances to the next page of values.  If there was an error making
8867// the request the page does not advance and the error is returned.
8868// Deprecated: Use NextWithContext() instead.
8869func (page *LongTermRetentionBackupListResultPage) Next() error {
8870	return page.NextWithContext(context.Background())
8871}
8872
8873// NotDone returns true if the page enumeration should be started or is not yet complete.
8874func (page LongTermRetentionBackupListResultPage) NotDone() bool {
8875	return !page.ltrblr.IsEmpty()
8876}
8877
8878// Response returns the raw server response from the last page request.
8879func (page LongTermRetentionBackupListResultPage) Response() LongTermRetentionBackupListResult {
8880	return page.ltrblr
8881}
8882
8883// Values returns the slice of values for the current page or nil if there are no values.
8884func (page LongTermRetentionBackupListResultPage) Values() []LongTermRetentionBackup {
8885	if page.ltrblr.IsEmpty() {
8886		return nil
8887	}
8888	return *page.ltrblr.Value
8889}
8890
8891// Creates a new instance of the LongTermRetentionBackupListResultPage type.
8892func NewLongTermRetentionBackupListResultPage(cur LongTermRetentionBackupListResult, getNextPage func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error)) LongTermRetentionBackupListResultPage {
8893	return LongTermRetentionBackupListResultPage{
8894		fn:     getNextPage,
8895		ltrblr: cur,
8896	}
8897}
8898
8899// LongTermRetentionBackupProperties properties of a long term retention backup
8900type LongTermRetentionBackupProperties struct {
8901	// ServerName - READ-ONLY; The server name that the backup database belong to.
8902	ServerName *string `json:"serverName,omitempty"`
8903	// ServerCreateTime - READ-ONLY; The create time of the server.
8904	ServerCreateTime *date.Time `json:"serverCreateTime,omitempty"`
8905	// DatabaseName - READ-ONLY; The name of the database the backup belong to
8906	DatabaseName *string `json:"databaseName,omitempty"`
8907	// DatabaseDeletionTime - READ-ONLY; The delete time of the database
8908	DatabaseDeletionTime *date.Time `json:"databaseDeletionTime,omitempty"`
8909	// BackupTime - READ-ONLY; The time the backup was taken
8910	BackupTime *date.Time `json:"backupTime,omitempty"`
8911	// BackupExpirationTime - READ-ONLY; The time the long term retention backup will expire.
8912	BackupExpirationTime *date.Time `json:"backupExpirationTime,omitempty"`
8913}
8914
8915// LongTermRetentionBackupsDeleteByResourceGroupFuture an abstraction for monitoring and retrieving the
8916// results of a long-running operation.
8917type LongTermRetentionBackupsDeleteByResourceGroupFuture struct {
8918	azure.FutureAPI
8919	// Result returns the result of the asynchronous operation.
8920	// If the operation has not completed it will return an error.
8921	Result func(LongTermRetentionBackupsClient) (autorest.Response, error)
8922}
8923
8924// LongTermRetentionBackupsDeleteFuture an abstraction for monitoring and retrieving the results of a
8925// long-running operation.
8926type LongTermRetentionBackupsDeleteFuture struct {
8927	azure.FutureAPI
8928	// Result returns the result of the asynchronous operation.
8929	// If the operation has not completed it will return an error.
8930	Result func(LongTermRetentionBackupsClient) (autorest.Response, error)
8931}
8932
8933// LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture an abstraction for monitoring and
8934// retrieving the results of a long-running operation.
8935type LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture struct {
8936	azure.FutureAPI
8937	// Result returns the result of the asynchronous operation.
8938	// If the operation has not completed it will return an error.
8939	Result func(LongTermRetentionManagedInstanceBackupsClient) (autorest.Response, error)
8940}
8941
8942// LongTermRetentionManagedInstanceBackupsDeleteFuture an abstraction for monitoring and retrieving the
8943// results of a long-running operation.
8944type LongTermRetentionManagedInstanceBackupsDeleteFuture struct {
8945	azure.FutureAPI
8946	// Result returns the result of the asynchronous operation.
8947	// If the operation has not completed it will return an error.
8948	Result func(LongTermRetentionManagedInstanceBackupsClient) (autorest.Response, error)
8949}
8950
8951// LongTermRetentionPolicyProperties properties of a long term retention policy
8952type LongTermRetentionPolicyProperties struct {
8953	// WeeklyRetention - The weekly retention policy for an LTR backup in an ISO 8601 format.
8954	WeeklyRetention *string `json:"weeklyRetention,omitempty"`
8955	// MonthlyRetention - The monthly retention policy for an LTR backup in an ISO 8601 format.
8956	MonthlyRetention *string `json:"monthlyRetention,omitempty"`
8957	// YearlyRetention - The yearly retention policy for an LTR backup in an ISO 8601 format.
8958	YearlyRetention *string `json:"yearlyRetention,omitempty"`
8959	// WeekOfYear - The week of year to take the yearly backup in an ISO 8601 format.
8960	WeekOfYear *int32 `json:"weekOfYear,omitempty"`
8961}
8962
8963// ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving
8964// the results of a long-running operation.
8965type ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture struct {
8966	azure.FutureAPI
8967	// Result returns the result of the asynchronous operation.
8968	// If the operation has not completed it will return an error.
8969	Result func(ManagedBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
8970}
8971
8972// ManagedBackupShortTermRetentionPoliciesUpdateFuture an abstraction for monitoring and retrieving the
8973// results of a long-running operation.
8974type ManagedBackupShortTermRetentionPoliciesUpdateFuture struct {
8975	azure.FutureAPI
8976	// Result returns the result of the asynchronous operation.
8977	// If the operation has not completed it will return an error.
8978	Result func(ManagedBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
8979}
8980
8981// ManagedBackupShortTermRetentionPolicy a short term retention policy.
8982type ManagedBackupShortTermRetentionPolicy struct {
8983	autorest.Response `json:"-"`
8984	// ManagedBackupShortTermRetentionPolicyProperties - Resource properties.
8985	*ManagedBackupShortTermRetentionPolicyProperties `json:"properties,omitempty"`
8986	// ID - READ-ONLY; Resource ID.
8987	ID *string `json:"id,omitempty"`
8988	// Name - READ-ONLY; Resource name.
8989	Name *string `json:"name,omitempty"`
8990	// Type - READ-ONLY; Resource type.
8991	Type *string `json:"type,omitempty"`
8992}
8993
8994// MarshalJSON is the custom marshaler for ManagedBackupShortTermRetentionPolicy.
8995func (mbstrp ManagedBackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) {
8996	objectMap := make(map[string]interface{})
8997	if mbstrp.ManagedBackupShortTermRetentionPolicyProperties != nil {
8998		objectMap["properties"] = mbstrp.ManagedBackupShortTermRetentionPolicyProperties
8999	}
9000	return json.Marshal(objectMap)
9001}
9002
9003// UnmarshalJSON is the custom unmarshaler for ManagedBackupShortTermRetentionPolicy struct.
9004func (mbstrp *ManagedBackupShortTermRetentionPolicy) UnmarshalJSON(body []byte) error {
9005	var m map[string]*json.RawMessage
9006	err := json.Unmarshal(body, &m)
9007	if err != nil {
9008		return err
9009	}
9010	for k, v := range m {
9011		switch k {
9012		case "properties":
9013			if v != nil {
9014				var managedBackupShortTermRetentionPolicyProperties ManagedBackupShortTermRetentionPolicyProperties
9015				err = json.Unmarshal(*v, &managedBackupShortTermRetentionPolicyProperties)
9016				if err != nil {
9017					return err
9018				}
9019				mbstrp.ManagedBackupShortTermRetentionPolicyProperties = &managedBackupShortTermRetentionPolicyProperties
9020			}
9021		case "id":
9022			if v != nil {
9023				var ID string
9024				err = json.Unmarshal(*v, &ID)
9025				if err != nil {
9026					return err
9027				}
9028				mbstrp.ID = &ID
9029			}
9030		case "name":
9031			if v != nil {
9032				var name string
9033				err = json.Unmarshal(*v, &name)
9034				if err != nil {
9035					return err
9036				}
9037				mbstrp.Name = &name
9038			}
9039		case "type":
9040			if v != nil {
9041				var typeVar string
9042				err = json.Unmarshal(*v, &typeVar)
9043				if err != nil {
9044					return err
9045				}
9046				mbstrp.Type = &typeVar
9047			}
9048		}
9049	}
9050
9051	return nil
9052}
9053
9054// ManagedBackupShortTermRetentionPolicyListResult a list of short term retention policies.
9055type ManagedBackupShortTermRetentionPolicyListResult struct {
9056	autorest.Response `json:"-"`
9057	// Value - READ-ONLY; Array of results.
9058	Value *[]ManagedBackupShortTermRetentionPolicy `json:"value,omitempty"`
9059	// NextLink - READ-ONLY; Link to retrieve next page of results.
9060	NextLink *string `json:"nextLink,omitempty"`
9061}
9062
9063// ManagedBackupShortTermRetentionPolicyListResultIterator provides access to a complete listing of
9064// ManagedBackupShortTermRetentionPolicy values.
9065type ManagedBackupShortTermRetentionPolicyListResultIterator struct {
9066	i    int
9067	page ManagedBackupShortTermRetentionPolicyListResultPage
9068}
9069
9070// NextWithContext advances to the next value.  If there was an error making
9071// the request the iterator does not advance and the error is returned.
9072func (iter *ManagedBackupShortTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
9073	if tracing.IsEnabled() {
9074		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPolicyListResultIterator.NextWithContext")
9075		defer func() {
9076			sc := -1
9077			if iter.Response().Response.Response != nil {
9078				sc = iter.Response().Response.Response.StatusCode
9079			}
9080			tracing.EndSpan(ctx, sc, err)
9081		}()
9082	}
9083	iter.i++
9084	if iter.i < len(iter.page.Values()) {
9085		return nil
9086	}
9087	err = iter.page.NextWithContext(ctx)
9088	if err != nil {
9089		iter.i--
9090		return err
9091	}
9092	iter.i = 0
9093	return nil
9094}
9095
9096// Next advances to the next value.  If there was an error making
9097// the request the iterator does not advance and the error is returned.
9098// Deprecated: Use NextWithContext() instead.
9099func (iter *ManagedBackupShortTermRetentionPolicyListResultIterator) Next() error {
9100	return iter.NextWithContext(context.Background())
9101}
9102
9103// NotDone returns true if the enumeration should be started or is not yet complete.
9104func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) NotDone() bool {
9105	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9106}
9107
9108// Response returns the raw server response from the last page request.
9109func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) Response() ManagedBackupShortTermRetentionPolicyListResult {
9110	return iter.page.Response()
9111}
9112
9113// Value returns the current value or a zero-initialized value if the
9114// iterator has advanced beyond the end of the collection.
9115func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) Value() ManagedBackupShortTermRetentionPolicy {
9116	if !iter.page.NotDone() {
9117		return ManagedBackupShortTermRetentionPolicy{}
9118	}
9119	return iter.page.Values()[iter.i]
9120}
9121
9122// Creates a new instance of the ManagedBackupShortTermRetentionPolicyListResultIterator type.
9123func NewManagedBackupShortTermRetentionPolicyListResultIterator(page ManagedBackupShortTermRetentionPolicyListResultPage) ManagedBackupShortTermRetentionPolicyListResultIterator {
9124	return ManagedBackupShortTermRetentionPolicyListResultIterator{page: page}
9125}
9126
9127// IsEmpty returns true if the ListResult contains no values.
9128func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) IsEmpty() bool {
9129	return mbstrplr.Value == nil || len(*mbstrplr.Value) == 0
9130}
9131
9132// hasNextLink returns true if the NextLink is not empty.
9133func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) hasNextLink() bool {
9134	return mbstrplr.NextLink != nil && len(*mbstrplr.NextLink) != 0
9135}
9136
9137// managedBackupShortTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results.
9138// It returns nil if no more results exist.
9139func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) managedBackupShortTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
9140	if !mbstrplr.hasNextLink() {
9141		return nil, nil
9142	}
9143	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9144		autorest.AsJSON(),
9145		autorest.AsGet(),
9146		autorest.WithBaseURL(to.String(mbstrplr.NextLink)))
9147}
9148
9149// ManagedBackupShortTermRetentionPolicyListResultPage contains a page of
9150// ManagedBackupShortTermRetentionPolicy values.
9151type ManagedBackupShortTermRetentionPolicyListResultPage struct {
9152	fn       func(context.Context, ManagedBackupShortTermRetentionPolicyListResult) (ManagedBackupShortTermRetentionPolicyListResult, error)
9153	mbstrplr ManagedBackupShortTermRetentionPolicyListResult
9154}
9155
9156// NextWithContext advances to the next page of values.  If there was an error making
9157// the request the page does not advance and the error is returned.
9158func (page *ManagedBackupShortTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
9159	if tracing.IsEnabled() {
9160		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPolicyListResultPage.NextWithContext")
9161		defer func() {
9162			sc := -1
9163			if page.Response().Response.Response != nil {
9164				sc = page.Response().Response.Response.StatusCode
9165			}
9166			tracing.EndSpan(ctx, sc, err)
9167		}()
9168	}
9169	for {
9170		next, err := page.fn(ctx, page.mbstrplr)
9171		if err != nil {
9172			return err
9173		}
9174		page.mbstrplr = next
9175		if !next.hasNextLink() || !next.IsEmpty() {
9176			break
9177		}
9178	}
9179	return nil
9180}
9181
9182// Next advances to the next page of values.  If there was an error making
9183// the request the page does not advance and the error is returned.
9184// Deprecated: Use NextWithContext() instead.
9185func (page *ManagedBackupShortTermRetentionPolicyListResultPage) Next() error {
9186	return page.NextWithContext(context.Background())
9187}
9188
9189// NotDone returns true if the page enumeration should be started or is not yet complete.
9190func (page ManagedBackupShortTermRetentionPolicyListResultPage) NotDone() bool {
9191	return !page.mbstrplr.IsEmpty()
9192}
9193
9194// Response returns the raw server response from the last page request.
9195func (page ManagedBackupShortTermRetentionPolicyListResultPage) Response() ManagedBackupShortTermRetentionPolicyListResult {
9196	return page.mbstrplr
9197}
9198
9199// Values returns the slice of values for the current page or nil if there are no values.
9200func (page ManagedBackupShortTermRetentionPolicyListResultPage) Values() []ManagedBackupShortTermRetentionPolicy {
9201	if page.mbstrplr.IsEmpty() {
9202		return nil
9203	}
9204	return *page.mbstrplr.Value
9205}
9206
9207// Creates a new instance of the ManagedBackupShortTermRetentionPolicyListResultPage type.
9208func NewManagedBackupShortTermRetentionPolicyListResultPage(cur ManagedBackupShortTermRetentionPolicyListResult, getNextPage func(context.Context, ManagedBackupShortTermRetentionPolicyListResult) (ManagedBackupShortTermRetentionPolicyListResult, error)) ManagedBackupShortTermRetentionPolicyListResultPage {
9209	return ManagedBackupShortTermRetentionPolicyListResultPage{
9210		fn:       getNextPage,
9211		mbstrplr: cur,
9212	}
9213}
9214
9215// ManagedBackupShortTermRetentionPolicyProperties properties of a short term retention policy
9216type ManagedBackupShortTermRetentionPolicyProperties struct {
9217	// RetentionDays - The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
9218	RetentionDays *int32 `json:"retentionDays,omitempty"`
9219}
9220
9221// ManagedDatabase a managed database resource.
9222type ManagedDatabase struct {
9223	autorest.Response `json:"-"`
9224	// ManagedDatabaseProperties - Resource properties.
9225	*ManagedDatabaseProperties `json:"properties,omitempty"`
9226	// Location - Resource location.
9227	Location *string `json:"location,omitempty"`
9228	// Tags - Resource tags.
9229	Tags map[string]*string `json:"tags"`
9230	// ID - READ-ONLY; Resource ID.
9231	ID *string `json:"id,omitempty"`
9232	// Name - READ-ONLY; Resource name.
9233	Name *string `json:"name,omitempty"`
9234	// Type - READ-ONLY; Resource type.
9235	Type *string `json:"type,omitempty"`
9236}
9237
9238// MarshalJSON is the custom marshaler for ManagedDatabase.
9239func (md ManagedDatabase) MarshalJSON() ([]byte, error) {
9240	objectMap := make(map[string]interface{})
9241	if md.ManagedDatabaseProperties != nil {
9242		objectMap["properties"] = md.ManagedDatabaseProperties
9243	}
9244	if md.Location != nil {
9245		objectMap["location"] = md.Location
9246	}
9247	if md.Tags != nil {
9248		objectMap["tags"] = md.Tags
9249	}
9250	return json.Marshal(objectMap)
9251}
9252
9253// UnmarshalJSON is the custom unmarshaler for ManagedDatabase struct.
9254func (md *ManagedDatabase) UnmarshalJSON(body []byte) error {
9255	var m map[string]*json.RawMessage
9256	err := json.Unmarshal(body, &m)
9257	if err != nil {
9258		return err
9259	}
9260	for k, v := range m {
9261		switch k {
9262		case "properties":
9263			if v != nil {
9264				var managedDatabaseProperties ManagedDatabaseProperties
9265				err = json.Unmarshal(*v, &managedDatabaseProperties)
9266				if err != nil {
9267					return err
9268				}
9269				md.ManagedDatabaseProperties = &managedDatabaseProperties
9270			}
9271		case "location":
9272			if v != nil {
9273				var location string
9274				err = json.Unmarshal(*v, &location)
9275				if err != nil {
9276					return err
9277				}
9278				md.Location = &location
9279			}
9280		case "tags":
9281			if v != nil {
9282				var tags map[string]*string
9283				err = json.Unmarshal(*v, &tags)
9284				if err != nil {
9285					return err
9286				}
9287				md.Tags = tags
9288			}
9289		case "id":
9290			if v != nil {
9291				var ID string
9292				err = json.Unmarshal(*v, &ID)
9293				if err != nil {
9294					return err
9295				}
9296				md.ID = &ID
9297			}
9298		case "name":
9299			if v != nil {
9300				var name string
9301				err = json.Unmarshal(*v, &name)
9302				if err != nil {
9303					return err
9304				}
9305				md.Name = &name
9306			}
9307		case "type":
9308			if v != nil {
9309				var typeVar string
9310				err = json.Unmarshal(*v, &typeVar)
9311				if err != nil {
9312					return err
9313				}
9314				md.Type = &typeVar
9315			}
9316		}
9317	}
9318
9319	return nil
9320}
9321
9322// ManagedDatabaseListResult a list of managed databases.
9323type ManagedDatabaseListResult struct {
9324	autorest.Response `json:"-"`
9325	// Value - READ-ONLY; Array of results.
9326	Value *[]ManagedDatabase `json:"value,omitempty"`
9327	// NextLink - READ-ONLY; Link to retrieve next page of results.
9328	NextLink *string `json:"nextLink,omitempty"`
9329}
9330
9331// ManagedDatabaseListResultIterator provides access to a complete listing of ManagedDatabase values.
9332type ManagedDatabaseListResultIterator struct {
9333	i    int
9334	page ManagedDatabaseListResultPage
9335}
9336
9337// NextWithContext advances to the next value.  If there was an error making
9338// the request the iterator does not advance and the error is returned.
9339func (iter *ManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
9340	if tracing.IsEnabled() {
9341		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseListResultIterator.NextWithContext")
9342		defer func() {
9343			sc := -1
9344			if iter.Response().Response.Response != nil {
9345				sc = iter.Response().Response.Response.StatusCode
9346			}
9347			tracing.EndSpan(ctx, sc, err)
9348		}()
9349	}
9350	iter.i++
9351	if iter.i < len(iter.page.Values()) {
9352		return nil
9353	}
9354	err = iter.page.NextWithContext(ctx)
9355	if err != nil {
9356		iter.i--
9357		return err
9358	}
9359	iter.i = 0
9360	return nil
9361}
9362
9363// Next advances to the next value.  If there was an error making
9364// the request the iterator does not advance and the error is returned.
9365// Deprecated: Use NextWithContext() instead.
9366func (iter *ManagedDatabaseListResultIterator) Next() error {
9367	return iter.NextWithContext(context.Background())
9368}
9369
9370// NotDone returns true if the enumeration should be started or is not yet complete.
9371func (iter ManagedDatabaseListResultIterator) NotDone() bool {
9372	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9373}
9374
9375// Response returns the raw server response from the last page request.
9376func (iter ManagedDatabaseListResultIterator) Response() ManagedDatabaseListResult {
9377	return iter.page.Response()
9378}
9379
9380// Value returns the current value or a zero-initialized value if the
9381// iterator has advanced beyond the end of the collection.
9382func (iter ManagedDatabaseListResultIterator) Value() ManagedDatabase {
9383	if !iter.page.NotDone() {
9384		return ManagedDatabase{}
9385	}
9386	return iter.page.Values()[iter.i]
9387}
9388
9389// Creates a new instance of the ManagedDatabaseListResultIterator type.
9390func NewManagedDatabaseListResultIterator(page ManagedDatabaseListResultPage) ManagedDatabaseListResultIterator {
9391	return ManagedDatabaseListResultIterator{page: page}
9392}
9393
9394// IsEmpty returns true if the ListResult contains no values.
9395func (mdlr ManagedDatabaseListResult) IsEmpty() bool {
9396	return mdlr.Value == nil || len(*mdlr.Value) == 0
9397}
9398
9399// hasNextLink returns true if the NextLink is not empty.
9400func (mdlr ManagedDatabaseListResult) hasNextLink() bool {
9401	return mdlr.NextLink != nil && len(*mdlr.NextLink) != 0
9402}
9403
9404// managedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
9405// It returns nil if no more results exist.
9406func (mdlr ManagedDatabaseListResult) managedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
9407	if !mdlr.hasNextLink() {
9408		return nil, nil
9409	}
9410	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9411		autorest.AsJSON(),
9412		autorest.AsGet(),
9413		autorest.WithBaseURL(to.String(mdlr.NextLink)))
9414}
9415
9416// ManagedDatabaseListResultPage contains a page of ManagedDatabase values.
9417type ManagedDatabaseListResultPage struct {
9418	fn   func(context.Context, ManagedDatabaseListResult) (ManagedDatabaseListResult, error)
9419	mdlr ManagedDatabaseListResult
9420}
9421
9422// NextWithContext advances to the next page of values.  If there was an error making
9423// the request the page does not advance and the error is returned.
9424func (page *ManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
9425	if tracing.IsEnabled() {
9426		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseListResultPage.NextWithContext")
9427		defer func() {
9428			sc := -1
9429			if page.Response().Response.Response != nil {
9430				sc = page.Response().Response.Response.StatusCode
9431			}
9432			tracing.EndSpan(ctx, sc, err)
9433		}()
9434	}
9435	for {
9436		next, err := page.fn(ctx, page.mdlr)
9437		if err != nil {
9438			return err
9439		}
9440		page.mdlr = next
9441		if !next.hasNextLink() || !next.IsEmpty() {
9442			break
9443		}
9444	}
9445	return nil
9446}
9447
9448// Next advances to the next page of values.  If there was an error making
9449// the request the page does not advance and the error is returned.
9450// Deprecated: Use NextWithContext() instead.
9451func (page *ManagedDatabaseListResultPage) Next() error {
9452	return page.NextWithContext(context.Background())
9453}
9454
9455// NotDone returns true if the page enumeration should be started or is not yet complete.
9456func (page ManagedDatabaseListResultPage) NotDone() bool {
9457	return !page.mdlr.IsEmpty()
9458}
9459
9460// Response returns the raw server response from the last page request.
9461func (page ManagedDatabaseListResultPage) Response() ManagedDatabaseListResult {
9462	return page.mdlr
9463}
9464
9465// Values returns the slice of values for the current page or nil if there are no values.
9466func (page ManagedDatabaseListResultPage) Values() []ManagedDatabase {
9467	if page.mdlr.IsEmpty() {
9468		return nil
9469	}
9470	return *page.mdlr.Value
9471}
9472
9473// Creates a new instance of the ManagedDatabaseListResultPage type.
9474func NewManagedDatabaseListResultPage(cur ManagedDatabaseListResult, getNextPage func(context.Context, ManagedDatabaseListResult) (ManagedDatabaseListResult, error)) ManagedDatabaseListResultPage {
9475	return ManagedDatabaseListResultPage{
9476		fn:   getNextPage,
9477		mdlr: cur,
9478	}
9479}
9480
9481// ManagedDatabaseProperties the managed database's properties.
9482type ManagedDatabaseProperties struct {
9483	// Collation - Collation of the managed database.
9484	Collation *string `json:"collation,omitempty"`
9485	// Status - READ-ONLY; Status of the database. Possible values include: 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Restoring', 'Updating'
9486	Status ManagedDatabaseStatus `json:"status,omitempty"`
9487	// CreationDate - READ-ONLY; Creation date of the database.
9488	CreationDate *date.Time `json:"creationDate,omitempty"`
9489	// EarliestRestorePoint - READ-ONLY; Earliest restore point in time for point in time restore.
9490	EarliestRestorePoint *date.Time `json:"earliestRestorePoint,omitempty"`
9491	// 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.
9492	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
9493	// DefaultSecondaryLocation - READ-ONLY; Geo paired region.
9494	DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"`
9495	// CatalogCollation - Collation of the metadata catalog. Possible values include: 'DATABASEDEFAULT', 'SQLLatin1GeneralCP1CIAS'
9496	CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"`
9497	// 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'
9498	CreateMode ManagedDatabaseCreateMode `json:"createMode,omitempty"`
9499	// StorageContainerURI - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored.
9500	StorageContainerURI *string `json:"storageContainerUri,omitempty"`
9501	// SourceDatabaseID - The resource identifier of the source database associated with create operation of this database.
9502	SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`
9503	// RestorableDroppedDatabaseID - The restorable dropped database resource id to restore when creating this database.
9504	RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"`
9505	// StorageContainerSasToken - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token.
9506	StorageContainerSasToken *string `json:"storageContainerSasToken,omitempty"`
9507	// FailoverGroupID - READ-ONLY; Instance Failover Group resource identifier that this managed database belongs to.
9508	FailoverGroupID *string `json:"failoverGroupId,omitempty"`
9509	// RecoverableDatabaseID - The resource identifier of the recoverable database associated with create operation of this database.
9510	RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"`
9511	// LongTermRetentionBackupResourceID - The name of the Long Term Retention backup to be used for restore of this managed database.
9512	LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"`
9513	// AutoCompleteRestore - Whether to auto complete restore of this managed database.
9514	AutoCompleteRestore *bool `json:"autoCompleteRestore,omitempty"`
9515	// LastBackupName - Last backup file name for restore of this managed database.
9516	LastBackupName *string `json:"lastBackupName,omitempty"`
9517}
9518
9519// MarshalJSON is the custom marshaler for ManagedDatabaseProperties.
9520func (mdp ManagedDatabaseProperties) MarshalJSON() ([]byte, error) {
9521	objectMap := make(map[string]interface{})
9522	if mdp.Collation != nil {
9523		objectMap["collation"] = mdp.Collation
9524	}
9525	if mdp.RestorePointInTime != nil {
9526		objectMap["restorePointInTime"] = mdp.RestorePointInTime
9527	}
9528	if mdp.CatalogCollation != "" {
9529		objectMap["catalogCollation"] = mdp.CatalogCollation
9530	}
9531	if mdp.CreateMode != "" {
9532		objectMap["createMode"] = mdp.CreateMode
9533	}
9534	if mdp.StorageContainerURI != nil {
9535		objectMap["storageContainerUri"] = mdp.StorageContainerURI
9536	}
9537	if mdp.SourceDatabaseID != nil {
9538		objectMap["sourceDatabaseId"] = mdp.SourceDatabaseID
9539	}
9540	if mdp.RestorableDroppedDatabaseID != nil {
9541		objectMap["restorableDroppedDatabaseId"] = mdp.RestorableDroppedDatabaseID
9542	}
9543	if mdp.StorageContainerSasToken != nil {
9544		objectMap["storageContainerSasToken"] = mdp.StorageContainerSasToken
9545	}
9546	if mdp.RecoverableDatabaseID != nil {
9547		objectMap["recoverableDatabaseId"] = mdp.RecoverableDatabaseID
9548	}
9549	if mdp.LongTermRetentionBackupResourceID != nil {
9550		objectMap["longTermRetentionBackupResourceId"] = mdp.LongTermRetentionBackupResourceID
9551	}
9552	if mdp.AutoCompleteRestore != nil {
9553		objectMap["autoCompleteRestore"] = mdp.AutoCompleteRestore
9554	}
9555	if mdp.LastBackupName != nil {
9556		objectMap["lastBackupName"] = mdp.LastBackupName
9557	}
9558	return json.Marshal(objectMap)
9559}
9560
9561// ManagedDatabaseRestoreDetailsProperties the managed database's restore details properties.
9562type ManagedDatabaseRestoreDetailsProperties struct {
9563	// Status - READ-ONLY; Restore status.
9564	Status *string `json:"status,omitempty"`
9565	// CurrentRestoringFileName - READ-ONLY; Current restoring file name.
9566	CurrentRestoringFileName *string `json:"currentRestoringFileName,omitempty"`
9567	// LastRestoredFileName - READ-ONLY; Last restored file name.
9568	LastRestoredFileName *string `json:"lastRestoredFileName,omitempty"`
9569	// LastRestoredFileTime - READ-ONLY; Last restored file time.
9570	LastRestoredFileTime *date.Time `json:"lastRestoredFileTime,omitempty"`
9571	// PercentCompleted - READ-ONLY; Percent completed.
9572	PercentCompleted *float64 `json:"percentCompleted,omitempty"`
9573	// UnrestorableFiles - READ-ONLY; List of unrestorable files.
9574	UnrestorableFiles *[]string `json:"unrestorableFiles,omitempty"`
9575	// NumberOfFilesDetected - READ-ONLY; Number of files detected.
9576	NumberOfFilesDetected *int64 `json:"numberOfFilesDetected,omitempty"`
9577	// LastUploadedFileName - READ-ONLY; Last uploaded file name.
9578	LastUploadedFileName *string `json:"lastUploadedFileName,omitempty"`
9579	// LastUploadedFileTime - READ-ONLY; Last uploaded file time.
9580	LastUploadedFileTime *date.Time `json:"lastUploadedFileTime,omitempty"`
9581	// BlockReason - READ-ONLY; The reason why restore is in Blocked state.
9582	BlockReason *string `json:"blockReason,omitempty"`
9583}
9584
9585// ManagedDatabaseRestoreDetailsResult a managed database restore details.
9586type ManagedDatabaseRestoreDetailsResult struct {
9587	autorest.Response `json:"-"`
9588	// ManagedDatabaseRestoreDetailsProperties - Resource properties.
9589	*ManagedDatabaseRestoreDetailsProperties `json:"properties,omitempty"`
9590	// ID - READ-ONLY; Resource ID.
9591	ID *string `json:"id,omitempty"`
9592	// Name - READ-ONLY; Resource name.
9593	Name *string `json:"name,omitempty"`
9594	// Type - READ-ONLY; Resource type.
9595	Type *string `json:"type,omitempty"`
9596}
9597
9598// MarshalJSON is the custom marshaler for ManagedDatabaseRestoreDetailsResult.
9599func (mdrdr ManagedDatabaseRestoreDetailsResult) MarshalJSON() ([]byte, error) {
9600	objectMap := make(map[string]interface{})
9601	if mdrdr.ManagedDatabaseRestoreDetailsProperties != nil {
9602		objectMap["properties"] = mdrdr.ManagedDatabaseRestoreDetailsProperties
9603	}
9604	return json.Marshal(objectMap)
9605}
9606
9607// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseRestoreDetailsResult struct.
9608func (mdrdr *ManagedDatabaseRestoreDetailsResult) UnmarshalJSON(body []byte) error {
9609	var m map[string]*json.RawMessage
9610	err := json.Unmarshal(body, &m)
9611	if err != nil {
9612		return err
9613	}
9614	for k, v := range m {
9615		switch k {
9616		case "properties":
9617			if v != nil {
9618				var managedDatabaseRestoreDetailsProperties ManagedDatabaseRestoreDetailsProperties
9619				err = json.Unmarshal(*v, &managedDatabaseRestoreDetailsProperties)
9620				if err != nil {
9621					return err
9622				}
9623				mdrdr.ManagedDatabaseRestoreDetailsProperties = &managedDatabaseRestoreDetailsProperties
9624			}
9625		case "id":
9626			if v != nil {
9627				var ID string
9628				err = json.Unmarshal(*v, &ID)
9629				if err != nil {
9630					return err
9631				}
9632				mdrdr.ID = &ID
9633			}
9634		case "name":
9635			if v != nil {
9636				var name string
9637				err = json.Unmarshal(*v, &name)
9638				if err != nil {
9639					return err
9640				}
9641				mdrdr.Name = &name
9642			}
9643		case "type":
9644			if v != nil {
9645				var typeVar string
9646				err = json.Unmarshal(*v, &typeVar)
9647				if err != nil {
9648					return err
9649				}
9650				mdrdr.Type = &typeVar
9651			}
9652		}
9653	}
9654
9655	return nil
9656}
9657
9658// ManagedDatabasesCompleteRestoreFuture an abstraction for monitoring and retrieving the results of a
9659// long-running operation.
9660type ManagedDatabasesCompleteRestoreFuture struct {
9661	azure.FutureAPI
9662	// Result returns the result of the asynchronous operation.
9663	// If the operation has not completed it will return an error.
9664	Result func(ManagedDatabasesClient) (autorest.Response, error)
9665}
9666
9667// ManagedDatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
9668// long-running operation.
9669type ManagedDatabasesCreateOrUpdateFuture struct {
9670	azure.FutureAPI
9671	// Result returns the result of the asynchronous operation.
9672	// If the operation has not completed it will return an error.
9673	Result func(ManagedDatabasesClient) (ManagedDatabase, error)
9674}
9675
9676// ManagedDatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
9677// operation.
9678type ManagedDatabasesDeleteFuture struct {
9679	azure.FutureAPI
9680	// Result returns the result of the asynchronous operation.
9681	// If the operation has not completed it will return an error.
9682	Result func(ManagedDatabasesClient) (autorest.Response, error)
9683}
9684
9685// ManagedDatabaseSecurityAlertPolicy a managed database security alert policy.
9686type ManagedDatabaseSecurityAlertPolicy struct {
9687	autorest.Response `json:"-"`
9688	// SecurityAlertPolicyProperties - Resource properties.
9689	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
9690	// ID - READ-ONLY; Resource ID.
9691	ID *string `json:"id,omitempty"`
9692	// Name - READ-ONLY; Resource name.
9693	Name *string `json:"name,omitempty"`
9694	// Type - READ-ONLY; Resource type.
9695	Type *string `json:"type,omitempty"`
9696}
9697
9698// MarshalJSON is the custom marshaler for ManagedDatabaseSecurityAlertPolicy.
9699func (mdsap ManagedDatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
9700	objectMap := make(map[string]interface{})
9701	if mdsap.SecurityAlertPolicyProperties != nil {
9702		objectMap["properties"] = mdsap.SecurityAlertPolicyProperties
9703	}
9704	return json.Marshal(objectMap)
9705}
9706
9707// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseSecurityAlertPolicy struct.
9708func (mdsap *ManagedDatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
9709	var m map[string]*json.RawMessage
9710	err := json.Unmarshal(body, &m)
9711	if err != nil {
9712		return err
9713	}
9714	for k, v := range m {
9715		switch k {
9716		case "properties":
9717			if v != nil {
9718				var securityAlertPolicyProperties SecurityAlertPolicyProperties
9719				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
9720				if err != nil {
9721					return err
9722				}
9723				mdsap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
9724			}
9725		case "id":
9726			if v != nil {
9727				var ID string
9728				err = json.Unmarshal(*v, &ID)
9729				if err != nil {
9730					return err
9731				}
9732				mdsap.ID = &ID
9733			}
9734		case "name":
9735			if v != nil {
9736				var name string
9737				err = json.Unmarshal(*v, &name)
9738				if err != nil {
9739					return err
9740				}
9741				mdsap.Name = &name
9742			}
9743		case "type":
9744			if v != nil {
9745				var typeVar string
9746				err = json.Unmarshal(*v, &typeVar)
9747				if err != nil {
9748					return err
9749				}
9750				mdsap.Type = &typeVar
9751			}
9752		}
9753	}
9754
9755	return nil
9756}
9757
9758// ManagedDatabaseSecurityAlertPolicyListResult a list of the managed database's security alert policies.
9759type ManagedDatabaseSecurityAlertPolicyListResult struct {
9760	autorest.Response `json:"-"`
9761	// Value - READ-ONLY; Array of results.
9762	Value *[]ManagedDatabaseSecurityAlertPolicy `json:"value,omitempty"`
9763	// NextLink - READ-ONLY; Link to retrieve next page of results.
9764	NextLink *string `json:"nextLink,omitempty"`
9765}
9766
9767// ManagedDatabaseSecurityAlertPolicyListResultIterator provides access to a complete listing of
9768// ManagedDatabaseSecurityAlertPolicy values.
9769type ManagedDatabaseSecurityAlertPolicyListResultIterator struct {
9770	i    int
9771	page ManagedDatabaseSecurityAlertPolicyListResultPage
9772}
9773
9774// NextWithContext advances to the next value.  If there was an error making
9775// the request the iterator does not advance and the error is returned.
9776func (iter *ManagedDatabaseSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
9777	if tracing.IsEnabled() {
9778		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPolicyListResultIterator.NextWithContext")
9779		defer func() {
9780			sc := -1
9781			if iter.Response().Response.Response != nil {
9782				sc = iter.Response().Response.Response.StatusCode
9783			}
9784			tracing.EndSpan(ctx, sc, err)
9785		}()
9786	}
9787	iter.i++
9788	if iter.i < len(iter.page.Values()) {
9789		return nil
9790	}
9791	err = iter.page.NextWithContext(ctx)
9792	if err != nil {
9793		iter.i--
9794		return err
9795	}
9796	iter.i = 0
9797	return nil
9798}
9799
9800// Next advances to the next value.  If there was an error making
9801// the request the iterator does not advance and the error is returned.
9802// Deprecated: Use NextWithContext() instead.
9803func (iter *ManagedDatabaseSecurityAlertPolicyListResultIterator) Next() error {
9804	return iter.NextWithContext(context.Background())
9805}
9806
9807// NotDone returns true if the enumeration should be started or is not yet complete.
9808func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) NotDone() bool {
9809	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9810}
9811
9812// Response returns the raw server response from the last page request.
9813func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) Response() ManagedDatabaseSecurityAlertPolicyListResult {
9814	return iter.page.Response()
9815}
9816
9817// Value returns the current value or a zero-initialized value if the
9818// iterator has advanced beyond the end of the collection.
9819func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) Value() ManagedDatabaseSecurityAlertPolicy {
9820	if !iter.page.NotDone() {
9821		return ManagedDatabaseSecurityAlertPolicy{}
9822	}
9823	return iter.page.Values()[iter.i]
9824}
9825
9826// Creates a new instance of the ManagedDatabaseSecurityAlertPolicyListResultIterator type.
9827func NewManagedDatabaseSecurityAlertPolicyListResultIterator(page ManagedDatabaseSecurityAlertPolicyListResultPage) ManagedDatabaseSecurityAlertPolicyListResultIterator {
9828	return ManagedDatabaseSecurityAlertPolicyListResultIterator{page: page}
9829}
9830
9831// IsEmpty returns true if the ListResult contains no values.
9832func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) IsEmpty() bool {
9833	return mdsaplr.Value == nil || len(*mdsaplr.Value) == 0
9834}
9835
9836// hasNextLink returns true if the NextLink is not empty.
9837func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) hasNextLink() bool {
9838	return mdsaplr.NextLink != nil && len(*mdsaplr.NextLink) != 0
9839}
9840
9841// managedDatabaseSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
9842// It returns nil if no more results exist.
9843func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) managedDatabaseSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
9844	if !mdsaplr.hasNextLink() {
9845		return nil, nil
9846	}
9847	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9848		autorest.AsJSON(),
9849		autorest.AsGet(),
9850		autorest.WithBaseURL(to.String(mdsaplr.NextLink)))
9851}
9852
9853// ManagedDatabaseSecurityAlertPolicyListResultPage contains a page of ManagedDatabaseSecurityAlertPolicy
9854// values.
9855type ManagedDatabaseSecurityAlertPolicyListResultPage struct {
9856	fn      func(context.Context, ManagedDatabaseSecurityAlertPolicyListResult) (ManagedDatabaseSecurityAlertPolicyListResult, error)
9857	mdsaplr ManagedDatabaseSecurityAlertPolicyListResult
9858}
9859
9860// NextWithContext advances to the next page of values.  If there was an error making
9861// the request the page does not advance and the error is returned.
9862func (page *ManagedDatabaseSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
9863	if tracing.IsEnabled() {
9864		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPolicyListResultPage.NextWithContext")
9865		defer func() {
9866			sc := -1
9867			if page.Response().Response.Response != nil {
9868				sc = page.Response().Response.Response.StatusCode
9869			}
9870			tracing.EndSpan(ctx, sc, err)
9871		}()
9872	}
9873	for {
9874		next, err := page.fn(ctx, page.mdsaplr)
9875		if err != nil {
9876			return err
9877		}
9878		page.mdsaplr = next
9879		if !next.hasNextLink() || !next.IsEmpty() {
9880			break
9881		}
9882	}
9883	return nil
9884}
9885
9886// Next advances to the next page of values.  If there was an error making
9887// the request the page does not advance and the error is returned.
9888// Deprecated: Use NextWithContext() instead.
9889func (page *ManagedDatabaseSecurityAlertPolicyListResultPage) Next() error {
9890	return page.NextWithContext(context.Background())
9891}
9892
9893// NotDone returns true if the page enumeration should be started or is not yet complete.
9894func (page ManagedDatabaseSecurityAlertPolicyListResultPage) NotDone() bool {
9895	return !page.mdsaplr.IsEmpty()
9896}
9897
9898// Response returns the raw server response from the last page request.
9899func (page ManagedDatabaseSecurityAlertPolicyListResultPage) Response() ManagedDatabaseSecurityAlertPolicyListResult {
9900	return page.mdsaplr
9901}
9902
9903// Values returns the slice of values for the current page or nil if there are no values.
9904func (page ManagedDatabaseSecurityAlertPolicyListResultPage) Values() []ManagedDatabaseSecurityAlertPolicy {
9905	if page.mdsaplr.IsEmpty() {
9906		return nil
9907	}
9908	return *page.mdsaplr.Value
9909}
9910
9911// Creates a new instance of the ManagedDatabaseSecurityAlertPolicyListResultPage type.
9912func NewManagedDatabaseSecurityAlertPolicyListResultPage(cur ManagedDatabaseSecurityAlertPolicyListResult, getNextPage func(context.Context, ManagedDatabaseSecurityAlertPolicyListResult) (ManagedDatabaseSecurityAlertPolicyListResult, error)) ManagedDatabaseSecurityAlertPolicyListResultPage {
9913	return ManagedDatabaseSecurityAlertPolicyListResultPage{
9914		fn:      getNextPage,
9915		mdsaplr: cur,
9916	}
9917}
9918
9919// ManagedDatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
9920// operation.
9921type ManagedDatabasesUpdateFuture struct {
9922	azure.FutureAPI
9923	// Result returns the result of the asynchronous operation.
9924	// If the operation has not completed it will return an error.
9925	Result func(ManagedDatabasesClient) (ManagedDatabase, error)
9926}
9927
9928// ManagedDatabaseUpdate an managed database update.
9929type ManagedDatabaseUpdate struct {
9930	// ManagedDatabaseProperties - Resource properties.
9931	*ManagedDatabaseProperties `json:"properties,omitempty"`
9932	// Tags - Resource tags.
9933	Tags map[string]*string `json:"tags"`
9934}
9935
9936// MarshalJSON is the custom marshaler for ManagedDatabaseUpdate.
9937func (mdu ManagedDatabaseUpdate) MarshalJSON() ([]byte, error) {
9938	objectMap := make(map[string]interface{})
9939	if mdu.ManagedDatabaseProperties != nil {
9940		objectMap["properties"] = mdu.ManagedDatabaseProperties
9941	}
9942	if mdu.Tags != nil {
9943		objectMap["tags"] = mdu.Tags
9944	}
9945	return json.Marshal(objectMap)
9946}
9947
9948// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseUpdate struct.
9949func (mdu *ManagedDatabaseUpdate) UnmarshalJSON(body []byte) error {
9950	var m map[string]*json.RawMessage
9951	err := json.Unmarshal(body, &m)
9952	if err != nil {
9953		return err
9954	}
9955	for k, v := range m {
9956		switch k {
9957		case "properties":
9958			if v != nil {
9959				var managedDatabaseProperties ManagedDatabaseProperties
9960				err = json.Unmarshal(*v, &managedDatabaseProperties)
9961				if err != nil {
9962					return err
9963				}
9964				mdu.ManagedDatabaseProperties = &managedDatabaseProperties
9965			}
9966		case "tags":
9967			if v != nil {
9968				var tags map[string]*string
9969				err = json.Unmarshal(*v, &tags)
9970				if err != nil {
9971					return err
9972				}
9973				mdu.Tags = tags
9974			}
9975		}
9976	}
9977
9978	return nil
9979}
9980
9981// ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture an abstraction for monitoring and
9982// retrieving the results of a long-running operation.
9983type ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture struct {
9984	azure.FutureAPI
9985	// Result returns the result of the asynchronous operation.
9986	// If the operation has not completed it will return an error.
9987	Result func(ManagedDatabaseVulnerabilityAssessmentScansClient) (autorest.Response, error)
9988}
9989
9990// ManagedInstance an Azure SQL managed instance.
9991type ManagedInstance struct {
9992	autorest.Response `json:"-"`
9993	// Identity - The Azure Active Directory identity of the managed instance.
9994	Identity *ResourceIdentity `json:"identity,omitempty"`
9995	// Sku - Managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5
9996	Sku *Sku `json:"sku,omitempty"`
9997	// ManagedInstanceProperties - Resource properties.
9998	*ManagedInstanceProperties `json:"properties,omitempty"`
9999	// Location - Resource location.
10000	Location *string `json:"location,omitempty"`
10001	// Tags - Resource tags.
10002	Tags map[string]*string `json:"tags"`
10003	// ID - READ-ONLY; Resource ID.
10004	ID *string `json:"id,omitempty"`
10005	// Name - READ-ONLY; Resource name.
10006	Name *string `json:"name,omitempty"`
10007	// Type - READ-ONLY; Resource type.
10008	Type *string `json:"type,omitempty"`
10009}
10010
10011// MarshalJSON is the custom marshaler for ManagedInstance.
10012func (mi ManagedInstance) MarshalJSON() ([]byte, error) {
10013	objectMap := make(map[string]interface{})
10014	if mi.Identity != nil {
10015		objectMap["identity"] = mi.Identity
10016	}
10017	if mi.Sku != nil {
10018		objectMap["sku"] = mi.Sku
10019	}
10020	if mi.ManagedInstanceProperties != nil {
10021		objectMap["properties"] = mi.ManagedInstanceProperties
10022	}
10023	if mi.Location != nil {
10024		objectMap["location"] = mi.Location
10025	}
10026	if mi.Tags != nil {
10027		objectMap["tags"] = mi.Tags
10028	}
10029	return json.Marshal(objectMap)
10030}
10031
10032// UnmarshalJSON is the custom unmarshaler for ManagedInstance struct.
10033func (mi *ManagedInstance) UnmarshalJSON(body []byte) error {
10034	var m map[string]*json.RawMessage
10035	err := json.Unmarshal(body, &m)
10036	if err != nil {
10037		return err
10038	}
10039	for k, v := range m {
10040		switch k {
10041		case "identity":
10042			if v != nil {
10043				var identity ResourceIdentity
10044				err = json.Unmarshal(*v, &identity)
10045				if err != nil {
10046					return err
10047				}
10048				mi.Identity = &identity
10049			}
10050		case "sku":
10051			if v != nil {
10052				var sku Sku
10053				err = json.Unmarshal(*v, &sku)
10054				if err != nil {
10055					return err
10056				}
10057				mi.Sku = &sku
10058			}
10059		case "properties":
10060			if v != nil {
10061				var managedInstanceProperties ManagedInstanceProperties
10062				err = json.Unmarshal(*v, &managedInstanceProperties)
10063				if err != nil {
10064					return err
10065				}
10066				mi.ManagedInstanceProperties = &managedInstanceProperties
10067			}
10068		case "location":
10069			if v != nil {
10070				var location string
10071				err = json.Unmarshal(*v, &location)
10072				if err != nil {
10073					return err
10074				}
10075				mi.Location = &location
10076			}
10077		case "tags":
10078			if v != nil {
10079				var tags map[string]*string
10080				err = json.Unmarshal(*v, &tags)
10081				if err != nil {
10082					return err
10083				}
10084				mi.Tags = tags
10085			}
10086		case "id":
10087			if v != nil {
10088				var ID string
10089				err = json.Unmarshal(*v, &ID)
10090				if err != nil {
10091					return err
10092				}
10093				mi.ID = &ID
10094			}
10095		case "name":
10096			if v != nil {
10097				var name string
10098				err = json.Unmarshal(*v, &name)
10099				if err != nil {
10100					return err
10101				}
10102				mi.Name = &name
10103			}
10104		case "type":
10105			if v != nil {
10106				var typeVar string
10107				err = json.Unmarshal(*v, &typeVar)
10108				if err != nil {
10109					return err
10110				}
10111				mi.Type = &typeVar
10112			}
10113		}
10114	}
10115
10116	return nil
10117}
10118
10119// ManagedInstanceAdministrator an Azure SQL managed instance administrator.
10120type ManagedInstanceAdministrator struct {
10121	autorest.Response `json:"-"`
10122	// ManagedInstanceAdministratorProperties - Resource properties.
10123	*ManagedInstanceAdministratorProperties `json:"properties,omitempty"`
10124	// ID - READ-ONLY; Resource ID.
10125	ID *string `json:"id,omitempty"`
10126	// Name - READ-ONLY; Resource name.
10127	Name *string `json:"name,omitempty"`
10128	// Type - READ-ONLY; Resource type.
10129	Type *string `json:"type,omitempty"`
10130}
10131
10132// MarshalJSON is the custom marshaler for ManagedInstanceAdministrator.
10133func (mia ManagedInstanceAdministrator) MarshalJSON() ([]byte, error) {
10134	objectMap := make(map[string]interface{})
10135	if mia.ManagedInstanceAdministratorProperties != nil {
10136		objectMap["properties"] = mia.ManagedInstanceAdministratorProperties
10137	}
10138	return json.Marshal(objectMap)
10139}
10140
10141// UnmarshalJSON is the custom unmarshaler for ManagedInstanceAdministrator struct.
10142func (mia *ManagedInstanceAdministrator) UnmarshalJSON(body []byte) error {
10143	var m map[string]*json.RawMessage
10144	err := json.Unmarshal(body, &m)
10145	if err != nil {
10146		return err
10147	}
10148	for k, v := range m {
10149		switch k {
10150		case "properties":
10151			if v != nil {
10152				var managedInstanceAdministratorProperties ManagedInstanceAdministratorProperties
10153				err = json.Unmarshal(*v, &managedInstanceAdministratorProperties)
10154				if err != nil {
10155					return err
10156				}
10157				mia.ManagedInstanceAdministratorProperties = &managedInstanceAdministratorProperties
10158			}
10159		case "id":
10160			if v != nil {
10161				var ID string
10162				err = json.Unmarshal(*v, &ID)
10163				if err != nil {
10164					return err
10165				}
10166				mia.ID = &ID
10167			}
10168		case "name":
10169			if v != nil {
10170				var name string
10171				err = json.Unmarshal(*v, &name)
10172				if err != nil {
10173					return err
10174				}
10175				mia.Name = &name
10176			}
10177		case "type":
10178			if v != nil {
10179				var typeVar string
10180				err = json.Unmarshal(*v, &typeVar)
10181				if err != nil {
10182					return err
10183				}
10184				mia.Type = &typeVar
10185			}
10186		}
10187	}
10188
10189	return nil
10190}
10191
10192// ManagedInstanceAdministratorListResult a list of managed instance administrators.
10193type ManagedInstanceAdministratorListResult struct {
10194	autorest.Response `json:"-"`
10195	// Value - READ-ONLY; Array of results.
10196	Value *[]ManagedInstanceAdministrator `json:"value,omitempty"`
10197	// NextLink - READ-ONLY; Link to retrieve next page of results.
10198	NextLink *string `json:"nextLink,omitempty"`
10199}
10200
10201// ManagedInstanceAdministratorListResultIterator provides access to a complete listing of
10202// ManagedInstanceAdministrator values.
10203type ManagedInstanceAdministratorListResultIterator struct {
10204	i    int
10205	page ManagedInstanceAdministratorListResultPage
10206}
10207
10208// NextWithContext advances to the next value.  If there was an error making
10209// the request the iterator does not advance and the error is returned.
10210func (iter *ManagedInstanceAdministratorListResultIterator) NextWithContext(ctx context.Context) (err error) {
10211	if tracing.IsEnabled() {
10212		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorListResultIterator.NextWithContext")
10213		defer func() {
10214			sc := -1
10215			if iter.Response().Response.Response != nil {
10216				sc = iter.Response().Response.Response.StatusCode
10217			}
10218			tracing.EndSpan(ctx, sc, err)
10219		}()
10220	}
10221	iter.i++
10222	if iter.i < len(iter.page.Values()) {
10223		return nil
10224	}
10225	err = iter.page.NextWithContext(ctx)
10226	if err != nil {
10227		iter.i--
10228		return err
10229	}
10230	iter.i = 0
10231	return nil
10232}
10233
10234// Next advances to the next value.  If there was an error making
10235// the request the iterator does not advance and the error is returned.
10236// Deprecated: Use NextWithContext() instead.
10237func (iter *ManagedInstanceAdministratorListResultIterator) Next() error {
10238	return iter.NextWithContext(context.Background())
10239}
10240
10241// NotDone returns true if the enumeration should be started or is not yet complete.
10242func (iter ManagedInstanceAdministratorListResultIterator) NotDone() bool {
10243	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10244}
10245
10246// Response returns the raw server response from the last page request.
10247func (iter ManagedInstanceAdministratorListResultIterator) Response() ManagedInstanceAdministratorListResult {
10248	return iter.page.Response()
10249}
10250
10251// Value returns the current value or a zero-initialized value if the
10252// iterator has advanced beyond the end of the collection.
10253func (iter ManagedInstanceAdministratorListResultIterator) Value() ManagedInstanceAdministrator {
10254	if !iter.page.NotDone() {
10255		return ManagedInstanceAdministrator{}
10256	}
10257	return iter.page.Values()[iter.i]
10258}
10259
10260// Creates a new instance of the ManagedInstanceAdministratorListResultIterator type.
10261func NewManagedInstanceAdministratorListResultIterator(page ManagedInstanceAdministratorListResultPage) ManagedInstanceAdministratorListResultIterator {
10262	return ManagedInstanceAdministratorListResultIterator{page: page}
10263}
10264
10265// IsEmpty returns true if the ListResult contains no values.
10266func (mialr ManagedInstanceAdministratorListResult) IsEmpty() bool {
10267	return mialr.Value == nil || len(*mialr.Value) == 0
10268}
10269
10270// hasNextLink returns true if the NextLink is not empty.
10271func (mialr ManagedInstanceAdministratorListResult) hasNextLink() bool {
10272	return mialr.NextLink != nil && len(*mialr.NextLink) != 0
10273}
10274
10275// managedInstanceAdministratorListResultPreparer prepares a request to retrieve the next set of results.
10276// It returns nil if no more results exist.
10277func (mialr ManagedInstanceAdministratorListResult) managedInstanceAdministratorListResultPreparer(ctx context.Context) (*http.Request, error) {
10278	if !mialr.hasNextLink() {
10279		return nil, nil
10280	}
10281	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10282		autorest.AsJSON(),
10283		autorest.AsGet(),
10284		autorest.WithBaseURL(to.String(mialr.NextLink)))
10285}
10286
10287// ManagedInstanceAdministratorListResultPage contains a page of ManagedInstanceAdministrator values.
10288type ManagedInstanceAdministratorListResultPage struct {
10289	fn    func(context.Context, ManagedInstanceAdministratorListResult) (ManagedInstanceAdministratorListResult, error)
10290	mialr ManagedInstanceAdministratorListResult
10291}
10292
10293// NextWithContext advances to the next page of values.  If there was an error making
10294// the request the page does not advance and the error is returned.
10295func (page *ManagedInstanceAdministratorListResultPage) NextWithContext(ctx context.Context) (err error) {
10296	if tracing.IsEnabled() {
10297		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorListResultPage.NextWithContext")
10298		defer func() {
10299			sc := -1
10300			if page.Response().Response.Response != nil {
10301				sc = page.Response().Response.Response.StatusCode
10302			}
10303			tracing.EndSpan(ctx, sc, err)
10304		}()
10305	}
10306	for {
10307		next, err := page.fn(ctx, page.mialr)
10308		if err != nil {
10309			return err
10310		}
10311		page.mialr = next
10312		if !next.hasNextLink() || !next.IsEmpty() {
10313			break
10314		}
10315	}
10316	return nil
10317}
10318
10319// Next advances to the next page of values.  If there was an error making
10320// the request the page does not advance and the error is returned.
10321// Deprecated: Use NextWithContext() instead.
10322func (page *ManagedInstanceAdministratorListResultPage) Next() error {
10323	return page.NextWithContext(context.Background())
10324}
10325
10326// NotDone returns true if the page enumeration should be started or is not yet complete.
10327func (page ManagedInstanceAdministratorListResultPage) NotDone() bool {
10328	return !page.mialr.IsEmpty()
10329}
10330
10331// Response returns the raw server response from the last page request.
10332func (page ManagedInstanceAdministratorListResultPage) Response() ManagedInstanceAdministratorListResult {
10333	return page.mialr
10334}
10335
10336// Values returns the slice of values for the current page or nil if there are no values.
10337func (page ManagedInstanceAdministratorListResultPage) Values() []ManagedInstanceAdministrator {
10338	if page.mialr.IsEmpty() {
10339		return nil
10340	}
10341	return *page.mialr.Value
10342}
10343
10344// Creates a new instance of the ManagedInstanceAdministratorListResultPage type.
10345func NewManagedInstanceAdministratorListResultPage(cur ManagedInstanceAdministratorListResult, getNextPage func(context.Context, ManagedInstanceAdministratorListResult) (ManagedInstanceAdministratorListResult, error)) ManagedInstanceAdministratorListResultPage {
10346	return ManagedInstanceAdministratorListResultPage{
10347		fn:    getNextPage,
10348		mialr: cur,
10349	}
10350}
10351
10352// ManagedInstanceAdministratorProperties the properties of a managed instance administrator.
10353type ManagedInstanceAdministratorProperties struct {
10354	// AdministratorType - Type of the managed instance administrator.
10355	AdministratorType *string `json:"administratorType,omitempty"`
10356	// Login - Login name of the managed instance administrator.
10357	Login *string `json:"login,omitempty"`
10358	// Sid - SID (object ID) of the managed instance administrator.
10359	Sid *uuid.UUID `json:"sid,omitempty"`
10360	// TenantID - Tenant ID of the managed instance administrator.
10361	TenantID *uuid.UUID `json:"tenantId,omitempty"`
10362}
10363
10364// ManagedInstanceAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
10365// results of a long-running operation.
10366type ManagedInstanceAdministratorsCreateOrUpdateFuture struct {
10367	azure.FutureAPI
10368	// Result returns the result of the asynchronous operation.
10369	// If the operation has not completed it will return an error.
10370	Result func(ManagedInstanceAdministratorsClient) (ManagedInstanceAdministrator, error)
10371}
10372
10373// ManagedInstanceAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a
10374// long-running operation.
10375type ManagedInstanceAdministratorsDeleteFuture struct {
10376	azure.FutureAPI
10377	// Result returns the result of the asynchronous operation.
10378	// If the operation has not completed it will return an error.
10379	Result func(ManagedInstanceAdministratorsClient) (autorest.Response, error)
10380}
10381
10382// ManagedInstanceAzureADOnlyAuthentication azure Active Directory only authentication.
10383type ManagedInstanceAzureADOnlyAuthentication struct {
10384	autorest.Response `json:"-"`
10385	// ManagedInstanceAzureADOnlyAuthProperties - Resource properties.
10386	*ManagedInstanceAzureADOnlyAuthProperties `json:"properties,omitempty"`
10387	// ID - READ-ONLY; Resource ID.
10388	ID *string `json:"id,omitempty"`
10389	// Name - READ-ONLY; Resource name.
10390	Name *string `json:"name,omitempty"`
10391	// Type - READ-ONLY; Resource type.
10392	Type *string `json:"type,omitempty"`
10393}
10394
10395// MarshalJSON is the custom marshaler for ManagedInstanceAzureADOnlyAuthentication.
10396func (miaaoa ManagedInstanceAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) {
10397	objectMap := make(map[string]interface{})
10398	if miaaoa.ManagedInstanceAzureADOnlyAuthProperties != nil {
10399		objectMap["properties"] = miaaoa.ManagedInstanceAzureADOnlyAuthProperties
10400	}
10401	return json.Marshal(objectMap)
10402}
10403
10404// UnmarshalJSON is the custom unmarshaler for ManagedInstanceAzureADOnlyAuthentication struct.
10405func (miaaoa *ManagedInstanceAzureADOnlyAuthentication) UnmarshalJSON(body []byte) error {
10406	var m map[string]*json.RawMessage
10407	err := json.Unmarshal(body, &m)
10408	if err != nil {
10409		return err
10410	}
10411	for k, v := range m {
10412		switch k {
10413		case "properties":
10414			if v != nil {
10415				var managedInstanceAzureADOnlyAuthProperties ManagedInstanceAzureADOnlyAuthProperties
10416				err = json.Unmarshal(*v, &managedInstanceAzureADOnlyAuthProperties)
10417				if err != nil {
10418					return err
10419				}
10420				miaaoa.ManagedInstanceAzureADOnlyAuthProperties = &managedInstanceAzureADOnlyAuthProperties
10421			}
10422		case "id":
10423			if v != nil {
10424				var ID string
10425				err = json.Unmarshal(*v, &ID)
10426				if err != nil {
10427					return err
10428				}
10429				miaaoa.ID = &ID
10430			}
10431		case "name":
10432			if v != nil {
10433				var name string
10434				err = json.Unmarshal(*v, &name)
10435				if err != nil {
10436					return err
10437				}
10438				miaaoa.Name = &name
10439			}
10440		case "type":
10441			if v != nil {
10442				var typeVar string
10443				err = json.Unmarshal(*v, &typeVar)
10444				if err != nil {
10445					return err
10446				}
10447				miaaoa.Type = &typeVar
10448			}
10449		}
10450	}
10451
10452	return nil
10453}
10454
10455// ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture an abstraction for monitoring and
10456// retrieving the results of a long-running operation.
10457type ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture struct {
10458	azure.FutureAPI
10459	// Result returns the result of the asynchronous operation.
10460	// If the operation has not completed it will return an error.
10461	Result func(ManagedInstanceAzureADOnlyAuthenticationsClient) (ManagedInstanceAzureADOnlyAuthentication, error)
10462}
10463
10464// ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture an abstraction for monitoring and retrieving the
10465// results of a long-running operation.
10466type ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture struct {
10467	azure.FutureAPI
10468	// Result returns the result of the asynchronous operation.
10469	// If the operation has not completed it will return an error.
10470	Result func(ManagedInstanceAzureADOnlyAuthenticationsClient) (autorest.Response, error)
10471}
10472
10473// ManagedInstanceAzureADOnlyAuthListResult a list of active directory only authentications.
10474type ManagedInstanceAzureADOnlyAuthListResult struct {
10475	autorest.Response `json:"-"`
10476	// Value - READ-ONLY; Array of results.
10477	Value *[]ManagedInstanceAzureADOnlyAuthentication `json:"value,omitempty"`
10478	// NextLink - READ-ONLY; Link to retrieve next page of results.
10479	NextLink *string `json:"nextLink,omitempty"`
10480}
10481
10482// ManagedInstanceAzureADOnlyAuthListResultIterator provides access to a complete listing of
10483// ManagedInstanceAzureADOnlyAuthentication values.
10484type ManagedInstanceAzureADOnlyAuthListResultIterator struct {
10485	i    int
10486	page ManagedInstanceAzureADOnlyAuthListResultPage
10487}
10488
10489// NextWithContext advances to the next value.  If there was an error making
10490// the request the iterator does not advance and the error is returned.
10491func (iter *ManagedInstanceAzureADOnlyAuthListResultIterator) NextWithContext(ctx context.Context) (err error) {
10492	if tracing.IsEnabled() {
10493		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAzureADOnlyAuthListResultIterator.NextWithContext")
10494		defer func() {
10495			sc := -1
10496			if iter.Response().Response.Response != nil {
10497				sc = iter.Response().Response.Response.StatusCode
10498			}
10499			tracing.EndSpan(ctx, sc, err)
10500		}()
10501	}
10502	iter.i++
10503	if iter.i < len(iter.page.Values()) {
10504		return nil
10505	}
10506	err = iter.page.NextWithContext(ctx)
10507	if err != nil {
10508		iter.i--
10509		return err
10510	}
10511	iter.i = 0
10512	return nil
10513}
10514
10515// Next advances to the next value.  If there was an error making
10516// the request the iterator does not advance and the error is returned.
10517// Deprecated: Use NextWithContext() instead.
10518func (iter *ManagedInstanceAzureADOnlyAuthListResultIterator) Next() error {
10519	return iter.NextWithContext(context.Background())
10520}
10521
10522// NotDone returns true if the enumeration should be started or is not yet complete.
10523func (iter ManagedInstanceAzureADOnlyAuthListResultIterator) NotDone() bool {
10524	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10525}
10526
10527// Response returns the raw server response from the last page request.
10528func (iter ManagedInstanceAzureADOnlyAuthListResultIterator) Response() ManagedInstanceAzureADOnlyAuthListResult {
10529	return iter.page.Response()
10530}
10531
10532// Value returns the current value or a zero-initialized value if the
10533// iterator has advanced beyond the end of the collection.
10534func (iter ManagedInstanceAzureADOnlyAuthListResultIterator) Value() ManagedInstanceAzureADOnlyAuthentication {
10535	if !iter.page.NotDone() {
10536		return ManagedInstanceAzureADOnlyAuthentication{}
10537	}
10538	return iter.page.Values()[iter.i]
10539}
10540
10541// Creates a new instance of the ManagedInstanceAzureADOnlyAuthListResultIterator type.
10542func NewManagedInstanceAzureADOnlyAuthListResultIterator(page ManagedInstanceAzureADOnlyAuthListResultPage) ManagedInstanceAzureADOnlyAuthListResultIterator {
10543	return ManagedInstanceAzureADOnlyAuthListResultIterator{page: page}
10544}
10545
10546// IsEmpty returns true if the ListResult contains no values.
10547func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) IsEmpty() bool {
10548	return miaaoalr.Value == nil || len(*miaaoalr.Value) == 0
10549}
10550
10551// hasNextLink returns true if the NextLink is not empty.
10552func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) hasNextLink() bool {
10553	return miaaoalr.NextLink != nil && len(*miaaoalr.NextLink) != 0
10554}
10555
10556// managedInstanceAzureADOnlyAuthListResultPreparer prepares a request to retrieve the next set of results.
10557// It returns nil if no more results exist.
10558func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) managedInstanceAzureADOnlyAuthListResultPreparer(ctx context.Context) (*http.Request, error) {
10559	if !miaaoalr.hasNextLink() {
10560		return nil, nil
10561	}
10562	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10563		autorest.AsJSON(),
10564		autorest.AsGet(),
10565		autorest.WithBaseURL(to.String(miaaoalr.NextLink)))
10566}
10567
10568// ManagedInstanceAzureADOnlyAuthListResultPage contains a page of ManagedInstanceAzureADOnlyAuthentication
10569// values.
10570type ManagedInstanceAzureADOnlyAuthListResultPage struct {
10571	fn       func(context.Context, ManagedInstanceAzureADOnlyAuthListResult) (ManagedInstanceAzureADOnlyAuthListResult, error)
10572	miaaoalr ManagedInstanceAzureADOnlyAuthListResult
10573}
10574
10575// NextWithContext advances to the next page of values.  If there was an error making
10576// the request the page does not advance and the error is returned.
10577func (page *ManagedInstanceAzureADOnlyAuthListResultPage) NextWithContext(ctx context.Context) (err error) {
10578	if tracing.IsEnabled() {
10579		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAzureADOnlyAuthListResultPage.NextWithContext")
10580		defer func() {
10581			sc := -1
10582			if page.Response().Response.Response != nil {
10583				sc = page.Response().Response.Response.StatusCode
10584			}
10585			tracing.EndSpan(ctx, sc, err)
10586		}()
10587	}
10588	for {
10589		next, err := page.fn(ctx, page.miaaoalr)
10590		if err != nil {
10591			return err
10592		}
10593		page.miaaoalr = next
10594		if !next.hasNextLink() || !next.IsEmpty() {
10595			break
10596		}
10597	}
10598	return nil
10599}
10600
10601// Next advances to the next page of values.  If there was an error making
10602// the request the page does not advance and the error is returned.
10603// Deprecated: Use NextWithContext() instead.
10604func (page *ManagedInstanceAzureADOnlyAuthListResultPage) Next() error {
10605	return page.NextWithContext(context.Background())
10606}
10607
10608// NotDone returns true if the page enumeration should be started or is not yet complete.
10609func (page ManagedInstanceAzureADOnlyAuthListResultPage) NotDone() bool {
10610	return !page.miaaoalr.IsEmpty()
10611}
10612
10613// Response returns the raw server response from the last page request.
10614func (page ManagedInstanceAzureADOnlyAuthListResultPage) Response() ManagedInstanceAzureADOnlyAuthListResult {
10615	return page.miaaoalr
10616}
10617
10618// Values returns the slice of values for the current page or nil if there are no values.
10619func (page ManagedInstanceAzureADOnlyAuthListResultPage) Values() []ManagedInstanceAzureADOnlyAuthentication {
10620	if page.miaaoalr.IsEmpty() {
10621		return nil
10622	}
10623	return *page.miaaoalr.Value
10624}
10625
10626// Creates a new instance of the ManagedInstanceAzureADOnlyAuthListResultPage type.
10627func NewManagedInstanceAzureADOnlyAuthListResultPage(cur ManagedInstanceAzureADOnlyAuthListResult, getNextPage func(context.Context, ManagedInstanceAzureADOnlyAuthListResult) (ManagedInstanceAzureADOnlyAuthListResult, error)) ManagedInstanceAzureADOnlyAuthListResultPage {
10628	return ManagedInstanceAzureADOnlyAuthListResultPage{
10629		fn:       getNextPage,
10630		miaaoalr: cur,
10631	}
10632}
10633
10634// ManagedInstanceAzureADOnlyAuthProperties properties of a active directory only authentication for
10635// Managed Instance.
10636type ManagedInstanceAzureADOnlyAuthProperties struct {
10637	// AzureADOnlyAuthentication - Azure Active Directory only Authentication enabled.
10638	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
10639}
10640
10641// ManagedInstanceEditionCapability the managed server capability
10642type ManagedInstanceEditionCapability struct {
10643	// Name - READ-ONLY; The managed server version name.
10644	Name *string `json:"name,omitempty"`
10645	// SupportedFamilies - READ-ONLY; The supported families.
10646	SupportedFamilies *[]ManagedInstanceFamilyCapability `json:"supportedFamilies,omitempty"`
10647	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
10648	Status CapabilityStatus `json:"status,omitempty"`
10649	// Reason - The reason for the capability not being available.
10650	Reason *string `json:"reason,omitempty"`
10651}
10652
10653// MarshalJSON is the custom marshaler for ManagedInstanceEditionCapability.
10654func (miec ManagedInstanceEditionCapability) MarshalJSON() ([]byte, error) {
10655	objectMap := make(map[string]interface{})
10656	if miec.Reason != nil {
10657		objectMap["reason"] = miec.Reason
10658	}
10659	return json.Marshal(objectMap)
10660}
10661
10662// ManagedInstanceEncryptionProtector the managed instance encryption protector.
10663type ManagedInstanceEncryptionProtector struct {
10664	autorest.Response `json:"-"`
10665	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
10666	Kind *string `json:"kind,omitempty"`
10667	// ManagedInstanceEncryptionProtectorProperties - Resource properties.
10668	*ManagedInstanceEncryptionProtectorProperties `json:"properties,omitempty"`
10669	// ID - READ-ONLY; Resource ID.
10670	ID *string `json:"id,omitempty"`
10671	// Name - READ-ONLY; Resource name.
10672	Name *string `json:"name,omitempty"`
10673	// Type - READ-ONLY; Resource type.
10674	Type *string `json:"type,omitempty"`
10675}
10676
10677// MarshalJSON is the custom marshaler for ManagedInstanceEncryptionProtector.
10678func (miep ManagedInstanceEncryptionProtector) MarshalJSON() ([]byte, error) {
10679	objectMap := make(map[string]interface{})
10680	if miep.ManagedInstanceEncryptionProtectorProperties != nil {
10681		objectMap["properties"] = miep.ManagedInstanceEncryptionProtectorProperties
10682	}
10683	return json.Marshal(objectMap)
10684}
10685
10686// UnmarshalJSON is the custom unmarshaler for ManagedInstanceEncryptionProtector struct.
10687func (miep *ManagedInstanceEncryptionProtector) UnmarshalJSON(body []byte) error {
10688	var m map[string]*json.RawMessage
10689	err := json.Unmarshal(body, &m)
10690	if err != nil {
10691		return err
10692	}
10693	for k, v := range m {
10694		switch k {
10695		case "kind":
10696			if v != nil {
10697				var kind string
10698				err = json.Unmarshal(*v, &kind)
10699				if err != nil {
10700					return err
10701				}
10702				miep.Kind = &kind
10703			}
10704		case "properties":
10705			if v != nil {
10706				var managedInstanceEncryptionProtectorProperties ManagedInstanceEncryptionProtectorProperties
10707				err = json.Unmarshal(*v, &managedInstanceEncryptionProtectorProperties)
10708				if err != nil {
10709					return err
10710				}
10711				miep.ManagedInstanceEncryptionProtectorProperties = &managedInstanceEncryptionProtectorProperties
10712			}
10713		case "id":
10714			if v != nil {
10715				var ID string
10716				err = json.Unmarshal(*v, &ID)
10717				if err != nil {
10718					return err
10719				}
10720				miep.ID = &ID
10721			}
10722		case "name":
10723			if v != nil {
10724				var name string
10725				err = json.Unmarshal(*v, &name)
10726				if err != nil {
10727					return err
10728				}
10729				miep.Name = &name
10730			}
10731		case "type":
10732			if v != nil {
10733				var typeVar string
10734				err = json.Unmarshal(*v, &typeVar)
10735				if err != nil {
10736					return err
10737				}
10738				miep.Type = &typeVar
10739			}
10740		}
10741	}
10742
10743	return nil
10744}
10745
10746// ManagedInstanceEncryptionProtectorListResult a list of managed instance encryption protectors.
10747type ManagedInstanceEncryptionProtectorListResult struct {
10748	autorest.Response `json:"-"`
10749	// Value - READ-ONLY; Array of results.
10750	Value *[]ManagedInstanceEncryptionProtector `json:"value,omitempty"`
10751	// NextLink - READ-ONLY; Link to retrieve next page of results.
10752	NextLink *string `json:"nextLink,omitempty"`
10753}
10754
10755// ManagedInstanceEncryptionProtectorListResultIterator provides access to a complete listing of
10756// ManagedInstanceEncryptionProtector values.
10757type ManagedInstanceEncryptionProtectorListResultIterator struct {
10758	i    int
10759	page ManagedInstanceEncryptionProtectorListResultPage
10760}
10761
10762// NextWithContext advances to the next value.  If there was an error making
10763// the request the iterator does not advance and the error is returned.
10764func (iter *ManagedInstanceEncryptionProtectorListResultIterator) NextWithContext(ctx context.Context) (err error) {
10765	if tracing.IsEnabled() {
10766		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorListResultIterator.NextWithContext")
10767		defer func() {
10768			sc := -1
10769			if iter.Response().Response.Response != nil {
10770				sc = iter.Response().Response.Response.StatusCode
10771			}
10772			tracing.EndSpan(ctx, sc, err)
10773		}()
10774	}
10775	iter.i++
10776	if iter.i < len(iter.page.Values()) {
10777		return nil
10778	}
10779	err = iter.page.NextWithContext(ctx)
10780	if err != nil {
10781		iter.i--
10782		return err
10783	}
10784	iter.i = 0
10785	return nil
10786}
10787
10788// Next advances to the next value.  If there was an error making
10789// the request the iterator does not advance and the error is returned.
10790// Deprecated: Use NextWithContext() instead.
10791func (iter *ManagedInstanceEncryptionProtectorListResultIterator) Next() error {
10792	return iter.NextWithContext(context.Background())
10793}
10794
10795// NotDone returns true if the enumeration should be started or is not yet complete.
10796func (iter ManagedInstanceEncryptionProtectorListResultIterator) NotDone() bool {
10797	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10798}
10799
10800// Response returns the raw server response from the last page request.
10801func (iter ManagedInstanceEncryptionProtectorListResultIterator) Response() ManagedInstanceEncryptionProtectorListResult {
10802	return iter.page.Response()
10803}
10804
10805// Value returns the current value or a zero-initialized value if the
10806// iterator has advanced beyond the end of the collection.
10807func (iter ManagedInstanceEncryptionProtectorListResultIterator) Value() ManagedInstanceEncryptionProtector {
10808	if !iter.page.NotDone() {
10809		return ManagedInstanceEncryptionProtector{}
10810	}
10811	return iter.page.Values()[iter.i]
10812}
10813
10814// Creates a new instance of the ManagedInstanceEncryptionProtectorListResultIterator type.
10815func NewManagedInstanceEncryptionProtectorListResultIterator(page ManagedInstanceEncryptionProtectorListResultPage) ManagedInstanceEncryptionProtectorListResultIterator {
10816	return ManagedInstanceEncryptionProtectorListResultIterator{page: page}
10817}
10818
10819// IsEmpty returns true if the ListResult contains no values.
10820func (mieplr ManagedInstanceEncryptionProtectorListResult) IsEmpty() bool {
10821	return mieplr.Value == nil || len(*mieplr.Value) == 0
10822}
10823
10824// hasNextLink returns true if the NextLink is not empty.
10825func (mieplr ManagedInstanceEncryptionProtectorListResult) hasNextLink() bool {
10826	return mieplr.NextLink != nil && len(*mieplr.NextLink) != 0
10827}
10828
10829// managedInstanceEncryptionProtectorListResultPreparer prepares a request to retrieve the next set of results.
10830// It returns nil if no more results exist.
10831func (mieplr ManagedInstanceEncryptionProtectorListResult) managedInstanceEncryptionProtectorListResultPreparer(ctx context.Context) (*http.Request, error) {
10832	if !mieplr.hasNextLink() {
10833		return nil, nil
10834	}
10835	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10836		autorest.AsJSON(),
10837		autorest.AsGet(),
10838		autorest.WithBaseURL(to.String(mieplr.NextLink)))
10839}
10840
10841// ManagedInstanceEncryptionProtectorListResultPage contains a page of ManagedInstanceEncryptionProtector
10842// values.
10843type ManagedInstanceEncryptionProtectorListResultPage struct {
10844	fn     func(context.Context, ManagedInstanceEncryptionProtectorListResult) (ManagedInstanceEncryptionProtectorListResult, error)
10845	mieplr ManagedInstanceEncryptionProtectorListResult
10846}
10847
10848// NextWithContext advances to the next page of values.  If there was an error making
10849// the request the page does not advance and the error is returned.
10850func (page *ManagedInstanceEncryptionProtectorListResultPage) NextWithContext(ctx context.Context) (err error) {
10851	if tracing.IsEnabled() {
10852		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorListResultPage.NextWithContext")
10853		defer func() {
10854			sc := -1
10855			if page.Response().Response.Response != nil {
10856				sc = page.Response().Response.Response.StatusCode
10857			}
10858			tracing.EndSpan(ctx, sc, err)
10859		}()
10860	}
10861	for {
10862		next, err := page.fn(ctx, page.mieplr)
10863		if err != nil {
10864			return err
10865		}
10866		page.mieplr = next
10867		if !next.hasNextLink() || !next.IsEmpty() {
10868			break
10869		}
10870	}
10871	return nil
10872}
10873
10874// Next advances to the next page of values.  If there was an error making
10875// the request the page does not advance and the error is returned.
10876// Deprecated: Use NextWithContext() instead.
10877func (page *ManagedInstanceEncryptionProtectorListResultPage) Next() error {
10878	return page.NextWithContext(context.Background())
10879}
10880
10881// NotDone returns true if the page enumeration should be started or is not yet complete.
10882func (page ManagedInstanceEncryptionProtectorListResultPage) NotDone() bool {
10883	return !page.mieplr.IsEmpty()
10884}
10885
10886// Response returns the raw server response from the last page request.
10887func (page ManagedInstanceEncryptionProtectorListResultPage) Response() ManagedInstanceEncryptionProtectorListResult {
10888	return page.mieplr
10889}
10890
10891// Values returns the slice of values for the current page or nil if there are no values.
10892func (page ManagedInstanceEncryptionProtectorListResultPage) Values() []ManagedInstanceEncryptionProtector {
10893	if page.mieplr.IsEmpty() {
10894		return nil
10895	}
10896	return *page.mieplr.Value
10897}
10898
10899// Creates a new instance of the ManagedInstanceEncryptionProtectorListResultPage type.
10900func NewManagedInstanceEncryptionProtectorListResultPage(cur ManagedInstanceEncryptionProtectorListResult, getNextPage func(context.Context, ManagedInstanceEncryptionProtectorListResult) (ManagedInstanceEncryptionProtectorListResult, error)) ManagedInstanceEncryptionProtectorListResultPage {
10901	return ManagedInstanceEncryptionProtectorListResultPage{
10902		fn:     getNextPage,
10903		mieplr: cur,
10904	}
10905}
10906
10907// ManagedInstanceEncryptionProtectorProperties properties for an encryption protector execution.
10908type ManagedInstanceEncryptionProtectorProperties struct {
10909	// ServerKeyName - The name of the managed instance key.
10910	ServerKeyName *string `json:"serverKeyName,omitempty"`
10911	// ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
10912	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
10913	// URI - READ-ONLY; The URI of the server key.
10914	URI *string `json:"uri,omitempty"`
10915	// Thumbprint - READ-ONLY; Thumbprint of the server key.
10916	Thumbprint *string `json:"thumbprint,omitempty"`
10917}
10918
10919// MarshalJSON is the custom marshaler for ManagedInstanceEncryptionProtectorProperties.
10920func (miepp ManagedInstanceEncryptionProtectorProperties) MarshalJSON() ([]byte, error) {
10921	objectMap := make(map[string]interface{})
10922	if miepp.ServerKeyName != nil {
10923		objectMap["serverKeyName"] = miepp.ServerKeyName
10924	}
10925	if miepp.ServerKeyType != "" {
10926		objectMap["serverKeyType"] = miepp.ServerKeyType
10927	}
10928	return json.Marshal(objectMap)
10929}
10930
10931// ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
10932// results of a long-running operation.
10933type ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture struct {
10934	azure.FutureAPI
10935	// Result returns the result of the asynchronous operation.
10936	// If the operation has not completed it will return an error.
10937	Result func(ManagedInstanceEncryptionProtectorsClient) (ManagedInstanceEncryptionProtector, error)
10938}
10939
10940// ManagedInstanceEncryptionProtectorsRevalidateFuture an abstraction for monitoring and retrieving the
10941// results of a long-running operation.
10942type ManagedInstanceEncryptionProtectorsRevalidateFuture struct {
10943	azure.FutureAPI
10944	// Result returns the result of the asynchronous operation.
10945	// If the operation has not completed it will return an error.
10946	Result func(ManagedInstanceEncryptionProtectorsClient) (autorest.Response, error)
10947}
10948
10949// ManagedInstanceFamilyCapability the managed server family capability.
10950type ManagedInstanceFamilyCapability struct {
10951	// Name - READ-ONLY; Family name.
10952	Name *string `json:"name,omitempty"`
10953	// Sku - READ-ONLY; SKU name.
10954	Sku *string `json:"sku,omitempty"`
10955	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
10956	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
10957	// SupportedVcoresValues - READ-ONLY; List of supported virtual cores values.
10958	SupportedVcoresValues *[]ManagedInstanceVcoresCapability `json:"supportedVcoresValues,omitempty"`
10959	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
10960	Status CapabilityStatus `json:"status,omitempty"`
10961	// Reason - The reason for the capability not being available.
10962	Reason *string `json:"reason,omitempty"`
10963}
10964
10965// MarshalJSON is the custom marshaler for ManagedInstanceFamilyCapability.
10966func (mifc ManagedInstanceFamilyCapability) MarshalJSON() ([]byte, error) {
10967	objectMap := make(map[string]interface{})
10968	if mifc.Reason != nil {
10969		objectMap["reason"] = mifc.Reason
10970	}
10971	return json.Marshal(objectMap)
10972}
10973
10974// ManagedInstanceKey a managed instance key.
10975type ManagedInstanceKey struct {
10976	autorest.Response `json:"-"`
10977	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
10978	Kind *string `json:"kind,omitempty"`
10979	// ManagedInstanceKeyProperties - Resource properties.
10980	*ManagedInstanceKeyProperties `json:"properties,omitempty"`
10981	// ID - READ-ONLY; Resource ID.
10982	ID *string `json:"id,omitempty"`
10983	// Name - READ-ONLY; Resource name.
10984	Name *string `json:"name,omitempty"`
10985	// Type - READ-ONLY; Resource type.
10986	Type *string `json:"type,omitempty"`
10987}
10988
10989// MarshalJSON is the custom marshaler for ManagedInstanceKey.
10990func (mik ManagedInstanceKey) MarshalJSON() ([]byte, error) {
10991	objectMap := make(map[string]interface{})
10992	if mik.ManagedInstanceKeyProperties != nil {
10993		objectMap["properties"] = mik.ManagedInstanceKeyProperties
10994	}
10995	return json.Marshal(objectMap)
10996}
10997
10998// UnmarshalJSON is the custom unmarshaler for ManagedInstanceKey struct.
10999func (mik *ManagedInstanceKey) UnmarshalJSON(body []byte) error {
11000	var m map[string]*json.RawMessage
11001	err := json.Unmarshal(body, &m)
11002	if err != nil {
11003		return err
11004	}
11005	for k, v := range m {
11006		switch k {
11007		case "kind":
11008			if v != nil {
11009				var kind string
11010				err = json.Unmarshal(*v, &kind)
11011				if err != nil {
11012					return err
11013				}
11014				mik.Kind = &kind
11015			}
11016		case "properties":
11017			if v != nil {
11018				var managedInstanceKeyProperties ManagedInstanceKeyProperties
11019				err = json.Unmarshal(*v, &managedInstanceKeyProperties)
11020				if err != nil {
11021					return err
11022				}
11023				mik.ManagedInstanceKeyProperties = &managedInstanceKeyProperties
11024			}
11025		case "id":
11026			if v != nil {
11027				var ID string
11028				err = json.Unmarshal(*v, &ID)
11029				if err != nil {
11030					return err
11031				}
11032				mik.ID = &ID
11033			}
11034		case "name":
11035			if v != nil {
11036				var name string
11037				err = json.Unmarshal(*v, &name)
11038				if err != nil {
11039					return err
11040				}
11041				mik.Name = &name
11042			}
11043		case "type":
11044			if v != nil {
11045				var typeVar string
11046				err = json.Unmarshal(*v, &typeVar)
11047				if err != nil {
11048					return err
11049				}
11050				mik.Type = &typeVar
11051			}
11052		}
11053	}
11054
11055	return nil
11056}
11057
11058// ManagedInstanceKeyListResult a list of managed instance keys.
11059type ManagedInstanceKeyListResult struct {
11060	autorest.Response `json:"-"`
11061	// Value - READ-ONLY; Array of results.
11062	Value *[]ManagedInstanceKey `json:"value,omitempty"`
11063	// NextLink - READ-ONLY; Link to retrieve next page of results.
11064	NextLink *string `json:"nextLink,omitempty"`
11065}
11066
11067// ManagedInstanceKeyListResultIterator provides access to a complete listing of ManagedInstanceKey values.
11068type ManagedInstanceKeyListResultIterator struct {
11069	i    int
11070	page ManagedInstanceKeyListResultPage
11071}
11072
11073// NextWithContext advances to the next value.  If there was an error making
11074// the request the iterator does not advance and the error is returned.
11075func (iter *ManagedInstanceKeyListResultIterator) NextWithContext(ctx context.Context) (err error) {
11076	if tracing.IsEnabled() {
11077		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeyListResultIterator.NextWithContext")
11078		defer func() {
11079			sc := -1
11080			if iter.Response().Response.Response != nil {
11081				sc = iter.Response().Response.Response.StatusCode
11082			}
11083			tracing.EndSpan(ctx, sc, err)
11084		}()
11085	}
11086	iter.i++
11087	if iter.i < len(iter.page.Values()) {
11088		return nil
11089	}
11090	err = iter.page.NextWithContext(ctx)
11091	if err != nil {
11092		iter.i--
11093		return err
11094	}
11095	iter.i = 0
11096	return nil
11097}
11098
11099// Next advances to the next value.  If there was an error making
11100// the request the iterator does not advance and the error is returned.
11101// Deprecated: Use NextWithContext() instead.
11102func (iter *ManagedInstanceKeyListResultIterator) Next() error {
11103	return iter.NextWithContext(context.Background())
11104}
11105
11106// NotDone returns true if the enumeration should be started or is not yet complete.
11107func (iter ManagedInstanceKeyListResultIterator) NotDone() bool {
11108	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11109}
11110
11111// Response returns the raw server response from the last page request.
11112func (iter ManagedInstanceKeyListResultIterator) Response() ManagedInstanceKeyListResult {
11113	return iter.page.Response()
11114}
11115
11116// Value returns the current value or a zero-initialized value if the
11117// iterator has advanced beyond the end of the collection.
11118func (iter ManagedInstanceKeyListResultIterator) Value() ManagedInstanceKey {
11119	if !iter.page.NotDone() {
11120		return ManagedInstanceKey{}
11121	}
11122	return iter.page.Values()[iter.i]
11123}
11124
11125// Creates a new instance of the ManagedInstanceKeyListResultIterator type.
11126func NewManagedInstanceKeyListResultIterator(page ManagedInstanceKeyListResultPage) ManagedInstanceKeyListResultIterator {
11127	return ManagedInstanceKeyListResultIterator{page: page}
11128}
11129
11130// IsEmpty returns true if the ListResult contains no values.
11131func (miklr ManagedInstanceKeyListResult) IsEmpty() bool {
11132	return miklr.Value == nil || len(*miklr.Value) == 0
11133}
11134
11135// hasNextLink returns true if the NextLink is not empty.
11136func (miklr ManagedInstanceKeyListResult) hasNextLink() bool {
11137	return miklr.NextLink != nil && len(*miklr.NextLink) != 0
11138}
11139
11140// managedInstanceKeyListResultPreparer prepares a request to retrieve the next set of results.
11141// It returns nil if no more results exist.
11142func (miklr ManagedInstanceKeyListResult) managedInstanceKeyListResultPreparer(ctx context.Context) (*http.Request, error) {
11143	if !miklr.hasNextLink() {
11144		return nil, nil
11145	}
11146	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11147		autorest.AsJSON(),
11148		autorest.AsGet(),
11149		autorest.WithBaseURL(to.String(miklr.NextLink)))
11150}
11151
11152// ManagedInstanceKeyListResultPage contains a page of ManagedInstanceKey values.
11153type ManagedInstanceKeyListResultPage struct {
11154	fn    func(context.Context, ManagedInstanceKeyListResult) (ManagedInstanceKeyListResult, error)
11155	miklr ManagedInstanceKeyListResult
11156}
11157
11158// NextWithContext advances to the next page of values.  If there was an error making
11159// the request the page does not advance and the error is returned.
11160func (page *ManagedInstanceKeyListResultPage) NextWithContext(ctx context.Context) (err error) {
11161	if tracing.IsEnabled() {
11162		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeyListResultPage.NextWithContext")
11163		defer func() {
11164			sc := -1
11165			if page.Response().Response.Response != nil {
11166				sc = page.Response().Response.Response.StatusCode
11167			}
11168			tracing.EndSpan(ctx, sc, err)
11169		}()
11170	}
11171	for {
11172		next, err := page.fn(ctx, page.miklr)
11173		if err != nil {
11174			return err
11175		}
11176		page.miklr = next
11177		if !next.hasNextLink() || !next.IsEmpty() {
11178			break
11179		}
11180	}
11181	return nil
11182}
11183
11184// Next advances to the next page of values.  If there was an error making
11185// the request the page does not advance and the error is returned.
11186// Deprecated: Use NextWithContext() instead.
11187func (page *ManagedInstanceKeyListResultPage) Next() error {
11188	return page.NextWithContext(context.Background())
11189}
11190
11191// NotDone returns true if the page enumeration should be started or is not yet complete.
11192func (page ManagedInstanceKeyListResultPage) NotDone() bool {
11193	return !page.miklr.IsEmpty()
11194}
11195
11196// Response returns the raw server response from the last page request.
11197func (page ManagedInstanceKeyListResultPage) Response() ManagedInstanceKeyListResult {
11198	return page.miklr
11199}
11200
11201// Values returns the slice of values for the current page or nil if there are no values.
11202func (page ManagedInstanceKeyListResultPage) Values() []ManagedInstanceKey {
11203	if page.miklr.IsEmpty() {
11204		return nil
11205	}
11206	return *page.miklr.Value
11207}
11208
11209// Creates a new instance of the ManagedInstanceKeyListResultPage type.
11210func NewManagedInstanceKeyListResultPage(cur ManagedInstanceKeyListResult, getNextPage func(context.Context, ManagedInstanceKeyListResult) (ManagedInstanceKeyListResult, error)) ManagedInstanceKeyListResultPage {
11211	return ManagedInstanceKeyListResultPage{
11212		fn:    getNextPage,
11213		miklr: cur,
11214	}
11215}
11216
11217// ManagedInstanceKeyProperties properties for a key execution.
11218type ManagedInstanceKeyProperties struct {
11219	// ServerKeyType - The key type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
11220	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
11221	// URI - The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is required.
11222	URI *string `json:"uri,omitempty"`
11223	// Thumbprint - READ-ONLY; Thumbprint of the key.
11224	Thumbprint *string `json:"thumbprint,omitempty"`
11225	// CreationDate - READ-ONLY; The key creation date.
11226	CreationDate *date.Time `json:"creationDate,omitempty"`
11227}
11228
11229// MarshalJSON is the custom marshaler for ManagedInstanceKeyProperties.
11230func (mikp ManagedInstanceKeyProperties) MarshalJSON() ([]byte, error) {
11231	objectMap := make(map[string]interface{})
11232	if mikp.ServerKeyType != "" {
11233		objectMap["serverKeyType"] = mikp.ServerKeyType
11234	}
11235	if mikp.URI != nil {
11236		objectMap["uri"] = mikp.URI
11237	}
11238	return json.Marshal(objectMap)
11239}
11240
11241// ManagedInstanceKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
11242// long-running operation.
11243type ManagedInstanceKeysCreateOrUpdateFuture struct {
11244	azure.FutureAPI
11245	// Result returns the result of the asynchronous operation.
11246	// If the operation has not completed it will return an error.
11247	Result func(ManagedInstanceKeysClient) (ManagedInstanceKey, error)
11248}
11249
11250// ManagedInstanceKeysDeleteFuture an abstraction for monitoring and retrieving the results of a
11251// long-running operation.
11252type ManagedInstanceKeysDeleteFuture struct {
11253	azure.FutureAPI
11254	// Result returns the result of the asynchronous operation.
11255	// If the operation has not completed it will return an error.
11256	Result func(ManagedInstanceKeysClient) (autorest.Response, error)
11257}
11258
11259// ManagedInstanceListResult a list of managed instances.
11260type ManagedInstanceListResult struct {
11261	autorest.Response `json:"-"`
11262	// Value - READ-ONLY; Array of results.
11263	Value *[]ManagedInstance `json:"value,omitempty"`
11264	// NextLink - READ-ONLY; Link to retrieve next page of results.
11265	NextLink *string `json:"nextLink,omitempty"`
11266}
11267
11268// ManagedInstanceListResultIterator provides access to a complete listing of ManagedInstance values.
11269type ManagedInstanceListResultIterator struct {
11270	i    int
11271	page ManagedInstanceListResultPage
11272}
11273
11274// NextWithContext advances to the next value.  If there was an error making
11275// the request the iterator does not advance and the error is returned.
11276func (iter *ManagedInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) {
11277	if tracing.IsEnabled() {
11278		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceListResultIterator.NextWithContext")
11279		defer func() {
11280			sc := -1
11281			if iter.Response().Response.Response != nil {
11282				sc = iter.Response().Response.Response.StatusCode
11283			}
11284			tracing.EndSpan(ctx, sc, err)
11285		}()
11286	}
11287	iter.i++
11288	if iter.i < len(iter.page.Values()) {
11289		return nil
11290	}
11291	err = iter.page.NextWithContext(ctx)
11292	if err != nil {
11293		iter.i--
11294		return err
11295	}
11296	iter.i = 0
11297	return nil
11298}
11299
11300// Next advances to the next value.  If there was an error making
11301// the request the iterator does not advance and the error is returned.
11302// Deprecated: Use NextWithContext() instead.
11303func (iter *ManagedInstanceListResultIterator) Next() error {
11304	return iter.NextWithContext(context.Background())
11305}
11306
11307// NotDone returns true if the enumeration should be started or is not yet complete.
11308func (iter ManagedInstanceListResultIterator) NotDone() bool {
11309	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11310}
11311
11312// Response returns the raw server response from the last page request.
11313func (iter ManagedInstanceListResultIterator) Response() ManagedInstanceListResult {
11314	return iter.page.Response()
11315}
11316
11317// Value returns the current value or a zero-initialized value if the
11318// iterator has advanced beyond the end of the collection.
11319func (iter ManagedInstanceListResultIterator) Value() ManagedInstance {
11320	if !iter.page.NotDone() {
11321		return ManagedInstance{}
11322	}
11323	return iter.page.Values()[iter.i]
11324}
11325
11326// Creates a new instance of the ManagedInstanceListResultIterator type.
11327func NewManagedInstanceListResultIterator(page ManagedInstanceListResultPage) ManagedInstanceListResultIterator {
11328	return ManagedInstanceListResultIterator{page: page}
11329}
11330
11331// IsEmpty returns true if the ListResult contains no values.
11332func (milr ManagedInstanceListResult) IsEmpty() bool {
11333	return milr.Value == nil || len(*milr.Value) == 0
11334}
11335
11336// hasNextLink returns true if the NextLink is not empty.
11337func (milr ManagedInstanceListResult) hasNextLink() bool {
11338	return milr.NextLink != nil && len(*milr.NextLink) != 0
11339}
11340
11341// managedInstanceListResultPreparer prepares a request to retrieve the next set of results.
11342// It returns nil if no more results exist.
11343func (milr ManagedInstanceListResult) managedInstanceListResultPreparer(ctx context.Context) (*http.Request, error) {
11344	if !milr.hasNextLink() {
11345		return nil, nil
11346	}
11347	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11348		autorest.AsJSON(),
11349		autorest.AsGet(),
11350		autorest.WithBaseURL(to.String(milr.NextLink)))
11351}
11352
11353// ManagedInstanceListResultPage contains a page of ManagedInstance values.
11354type ManagedInstanceListResultPage struct {
11355	fn   func(context.Context, ManagedInstanceListResult) (ManagedInstanceListResult, error)
11356	milr ManagedInstanceListResult
11357}
11358
11359// NextWithContext advances to the next page of values.  If there was an error making
11360// the request the page does not advance and the error is returned.
11361func (page *ManagedInstanceListResultPage) NextWithContext(ctx context.Context) (err error) {
11362	if tracing.IsEnabled() {
11363		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceListResultPage.NextWithContext")
11364		defer func() {
11365			sc := -1
11366			if page.Response().Response.Response != nil {
11367				sc = page.Response().Response.Response.StatusCode
11368			}
11369			tracing.EndSpan(ctx, sc, err)
11370		}()
11371	}
11372	for {
11373		next, err := page.fn(ctx, page.milr)
11374		if err != nil {
11375			return err
11376		}
11377		page.milr = next
11378		if !next.hasNextLink() || !next.IsEmpty() {
11379			break
11380		}
11381	}
11382	return nil
11383}
11384
11385// Next advances to the next page of values.  If there was an error making
11386// the request the page does not advance and the error is returned.
11387// Deprecated: Use NextWithContext() instead.
11388func (page *ManagedInstanceListResultPage) Next() error {
11389	return page.NextWithContext(context.Background())
11390}
11391
11392// NotDone returns true if the page enumeration should be started or is not yet complete.
11393func (page ManagedInstanceListResultPage) NotDone() bool {
11394	return !page.milr.IsEmpty()
11395}
11396
11397// Response returns the raw server response from the last page request.
11398func (page ManagedInstanceListResultPage) Response() ManagedInstanceListResult {
11399	return page.milr
11400}
11401
11402// Values returns the slice of values for the current page or nil if there are no values.
11403func (page ManagedInstanceListResultPage) Values() []ManagedInstance {
11404	if page.milr.IsEmpty() {
11405		return nil
11406	}
11407	return *page.milr.Value
11408}
11409
11410// Creates a new instance of the ManagedInstanceListResultPage type.
11411func NewManagedInstanceListResultPage(cur ManagedInstanceListResult, getNextPage func(context.Context, ManagedInstanceListResult) (ManagedInstanceListResult, error)) ManagedInstanceListResultPage {
11412	return ManagedInstanceListResultPage{
11413		fn:   getNextPage,
11414		milr: cur,
11415	}
11416}
11417
11418// ManagedInstanceLongTermRetentionBackup a long term retention backup for a managed database.
11419type ManagedInstanceLongTermRetentionBackup struct {
11420	autorest.Response `json:"-"`
11421	// ManagedInstanceLongTermRetentionBackupProperties - Resource properties.
11422	*ManagedInstanceLongTermRetentionBackupProperties `json:"properties,omitempty"`
11423	// ID - READ-ONLY; Resource ID.
11424	ID *string `json:"id,omitempty"`
11425	// Name - READ-ONLY; Resource name.
11426	Name *string `json:"name,omitempty"`
11427	// Type - READ-ONLY; Resource type.
11428	Type *string `json:"type,omitempty"`
11429}
11430
11431// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionBackup.
11432func (miltrb ManagedInstanceLongTermRetentionBackup) MarshalJSON() ([]byte, error) {
11433	objectMap := make(map[string]interface{})
11434	if miltrb.ManagedInstanceLongTermRetentionBackupProperties != nil {
11435		objectMap["properties"] = miltrb.ManagedInstanceLongTermRetentionBackupProperties
11436	}
11437	return json.Marshal(objectMap)
11438}
11439
11440// UnmarshalJSON is the custom unmarshaler for ManagedInstanceLongTermRetentionBackup struct.
11441func (miltrb *ManagedInstanceLongTermRetentionBackup) UnmarshalJSON(body []byte) error {
11442	var m map[string]*json.RawMessage
11443	err := json.Unmarshal(body, &m)
11444	if err != nil {
11445		return err
11446	}
11447	for k, v := range m {
11448		switch k {
11449		case "properties":
11450			if v != nil {
11451				var managedInstanceLongTermRetentionBackupProperties ManagedInstanceLongTermRetentionBackupProperties
11452				err = json.Unmarshal(*v, &managedInstanceLongTermRetentionBackupProperties)
11453				if err != nil {
11454					return err
11455				}
11456				miltrb.ManagedInstanceLongTermRetentionBackupProperties = &managedInstanceLongTermRetentionBackupProperties
11457			}
11458		case "id":
11459			if v != nil {
11460				var ID string
11461				err = json.Unmarshal(*v, &ID)
11462				if err != nil {
11463					return err
11464				}
11465				miltrb.ID = &ID
11466			}
11467		case "name":
11468			if v != nil {
11469				var name string
11470				err = json.Unmarshal(*v, &name)
11471				if err != nil {
11472					return err
11473				}
11474				miltrb.Name = &name
11475			}
11476		case "type":
11477			if v != nil {
11478				var typeVar string
11479				err = json.Unmarshal(*v, &typeVar)
11480				if err != nil {
11481					return err
11482				}
11483				miltrb.Type = &typeVar
11484			}
11485		}
11486	}
11487
11488	return nil
11489}
11490
11491// ManagedInstanceLongTermRetentionBackupListResult a list of long term retention backups for managed
11492// database(s).
11493type ManagedInstanceLongTermRetentionBackupListResult struct {
11494	autorest.Response `json:"-"`
11495	// Value - READ-ONLY; Array of results.
11496	Value *[]ManagedInstanceLongTermRetentionBackup `json:"value,omitempty"`
11497	// NextLink - READ-ONLY; Link to retrieve next page of results.
11498	NextLink *string `json:"nextLink,omitempty"`
11499}
11500
11501// ManagedInstanceLongTermRetentionBackupListResultIterator provides access to a complete listing of
11502// ManagedInstanceLongTermRetentionBackup values.
11503type ManagedInstanceLongTermRetentionBackupListResultIterator struct {
11504	i    int
11505	page ManagedInstanceLongTermRetentionBackupListResultPage
11506}
11507
11508// NextWithContext advances to the next value.  If there was an error making
11509// the request the iterator does not advance and the error is returned.
11510func (iter *ManagedInstanceLongTermRetentionBackupListResultIterator) NextWithContext(ctx context.Context) (err error) {
11511	if tracing.IsEnabled() {
11512		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionBackupListResultIterator.NextWithContext")
11513		defer func() {
11514			sc := -1
11515			if iter.Response().Response.Response != nil {
11516				sc = iter.Response().Response.Response.StatusCode
11517			}
11518			tracing.EndSpan(ctx, sc, err)
11519		}()
11520	}
11521	iter.i++
11522	if iter.i < len(iter.page.Values()) {
11523		return nil
11524	}
11525	err = iter.page.NextWithContext(ctx)
11526	if err != nil {
11527		iter.i--
11528		return err
11529	}
11530	iter.i = 0
11531	return nil
11532}
11533
11534// Next advances to the next value.  If there was an error making
11535// the request the iterator does not advance and the error is returned.
11536// Deprecated: Use NextWithContext() instead.
11537func (iter *ManagedInstanceLongTermRetentionBackupListResultIterator) Next() error {
11538	return iter.NextWithContext(context.Background())
11539}
11540
11541// NotDone returns true if the enumeration should be started or is not yet complete.
11542func (iter ManagedInstanceLongTermRetentionBackupListResultIterator) NotDone() bool {
11543	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11544}
11545
11546// Response returns the raw server response from the last page request.
11547func (iter ManagedInstanceLongTermRetentionBackupListResultIterator) Response() ManagedInstanceLongTermRetentionBackupListResult {
11548	return iter.page.Response()
11549}
11550
11551// Value returns the current value or a zero-initialized value if the
11552// iterator has advanced beyond the end of the collection.
11553func (iter ManagedInstanceLongTermRetentionBackupListResultIterator) Value() ManagedInstanceLongTermRetentionBackup {
11554	if !iter.page.NotDone() {
11555		return ManagedInstanceLongTermRetentionBackup{}
11556	}
11557	return iter.page.Values()[iter.i]
11558}
11559
11560// Creates a new instance of the ManagedInstanceLongTermRetentionBackupListResultIterator type.
11561func NewManagedInstanceLongTermRetentionBackupListResultIterator(page ManagedInstanceLongTermRetentionBackupListResultPage) ManagedInstanceLongTermRetentionBackupListResultIterator {
11562	return ManagedInstanceLongTermRetentionBackupListResultIterator{page: page}
11563}
11564
11565// IsEmpty returns true if the ListResult contains no values.
11566func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) IsEmpty() bool {
11567	return miltrblr.Value == nil || len(*miltrblr.Value) == 0
11568}
11569
11570// hasNextLink returns true if the NextLink is not empty.
11571func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) hasNextLink() bool {
11572	return miltrblr.NextLink != nil && len(*miltrblr.NextLink) != 0
11573}
11574
11575// managedInstanceLongTermRetentionBackupListResultPreparer prepares a request to retrieve the next set of results.
11576// It returns nil if no more results exist.
11577func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) managedInstanceLongTermRetentionBackupListResultPreparer(ctx context.Context) (*http.Request, error) {
11578	if !miltrblr.hasNextLink() {
11579		return nil, nil
11580	}
11581	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11582		autorest.AsJSON(),
11583		autorest.AsGet(),
11584		autorest.WithBaseURL(to.String(miltrblr.NextLink)))
11585}
11586
11587// ManagedInstanceLongTermRetentionBackupListResultPage contains a page of
11588// ManagedInstanceLongTermRetentionBackup values.
11589type ManagedInstanceLongTermRetentionBackupListResultPage struct {
11590	fn       func(context.Context, ManagedInstanceLongTermRetentionBackupListResult) (ManagedInstanceLongTermRetentionBackupListResult, error)
11591	miltrblr ManagedInstanceLongTermRetentionBackupListResult
11592}
11593
11594// NextWithContext advances to the next page of values.  If there was an error making
11595// the request the page does not advance and the error is returned.
11596func (page *ManagedInstanceLongTermRetentionBackupListResultPage) NextWithContext(ctx context.Context) (err error) {
11597	if tracing.IsEnabled() {
11598		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionBackupListResultPage.NextWithContext")
11599		defer func() {
11600			sc := -1
11601			if page.Response().Response.Response != nil {
11602				sc = page.Response().Response.Response.StatusCode
11603			}
11604			tracing.EndSpan(ctx, sc, err)
11605		}()
11606	}
11607	for {
11608		next, err := page.fn(ctx, page.miltrblr)
11609		if err != nil {
11610			return err
11611		}
11612		page.miltrblr = next
11613		if !next.hasNextLink() || !next.IsEmpty() {
11614			break
11615		}
11616	}
11617	return nil
11618}
11619
11620// Next advances to the next page of values.  If there was an error making
11621// the request the page does not advance and the error is returned.
11622// Deprecated: Use NextWithContext() instead.
11623func (page *ManagedInstanceLongTermRetentionBackupListResultPage) Next() error {
11624	return page.NextWithContext(context.Background())
11625}
11626
11627// NotDone returns true if the page enumeration should be started or is not yet complete.
11628func (page ManagedInstanceLongTermRetentionBackupListResultPage) NotDone() bool {
11629	return !page.miltrblr.IsEmpty()
11630}
11631
11632// Response returns the raw server response from the last page request.
11633func (page ManagedInstanceLongTermRetentionBackupListResultPage) Response() ManagedInstanceLongTermRetentionBackupListResult {
11634	return page.miltrblr
11635}
11636
11637// Values returns the slice of values for the current page or nil if there are no values.
11638func (page ManagedInstanceLongTermRetentionBackupListResultPage) Values() []ManagedInstanceLongTermRetentionBackup {
11639	if page.miltrblr.IsEmpty() {
11640		return nil
11641	}
11642	return *page.miltrblr.Value
11643}
11644
11645// Creates a new instance of the ManagedInstanceLongTermRetentionBackupListResultPage type.
11646func NewManagedInstanceLongTermRetentionBackupListResultPage(cur ManagedInstanceLongTermRetentionBackupListResult, getNextPage func(context.Context, ManagedInstanceLongTermRetentionBackupListResult) (ManagedInstanceLongTermRetentionBackupListResult, error)) ManagedInstanceLongTermRetentionBackupListResultPage {
11647	return ManagedInstanceLongTermRetentionBackupListResultPage{
11648		fn:       getNextPage,
11649		miltrblr: cur,
11650	}
11651}
11652
11653// ManagedInstanceLongTermRetentionBackupProperties properties of a long term retention backup
11654type ManagedInstanceLongTermRetentionBackupProperties struct {
11655	// ManagedInstanceName - READ-ONLY; The managed instance that the backup database belongs to.
11656	ManagedInstanceName *string `json:"managedInstanceName,omitempty"`
11657	// ManagedInstanceCreateTime - READ-ONLY; The create time of the instance.
11658	ManagedInstanceCreateTime *date.Time `json:"managedInstanceCreateTime,omitempty"`
11659	// DatabaseName - READ-ONLY; The name of the database the backup belong to
11660	DatabaseName *string `json:"databaseName,omitempty"`
11661	// DatabaseDeletionTime - READ-ONLY; The delete time of the database
11662	DatabaseDeletionTime *date.Time `json:"databaseDeletionTime,omitempty"`
11663	// BackupTime - READ-ONLY; The time the backup was taken
11664	BackupTime *date.Time `json:"backupTime,omitempty"`
11665	// BackupExpirationTime - READ-ONLY; The time the long term retention backup will expire.
11666	BackupExpirationTime *date.Time `json:"backupExpirationTime,omitempty"`
11667}
11668
11669// ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and
11670// retrieving the results of a long-running operation.
11671type ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture struct {
11672	azure.FutureAPI
11673	// Result returns the result of the asynchronous operation.
11674	// If the operation has not completed it will return an error.
11675	Result func(ManagedInstanceLongTermRetentionPoliciesClient) (ManagedInstanceLongTermRetentionPolicy, error)
11676}
11677
11678// ManagedInstanceLongTermRetentionPolicy a long term retention policy.
11679type ManagedInstanceLongTermRetentionPolicy struct {
11680	autorest.Response `json:"-"`
11681	// BaseLongTermRetentionPolicyProperties - Resource properties.
11682	*BaseLongTermRetentionPolicyProperties `json:"properties,omitempty"`
11683	// ID - READ-ONLY; Resource ID.
11684	ID *string `json:"id,omitempty"`
11685	// Name - READ-ONLY; Resource name.
11686	Name *string `json:"name,omitempty"`
11687	// Type - READ-ONLY; Resource type.
11688	Type *string `json:"type,omitempty"`
11689}
11690
11691// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionPolicy.
11692func (miltrp ManagedInstanceLongTermRetentionPolicy) MarshalJSON() ([]byte, error) {
11693	objectMap := make(map[string]interface{})
11694	if miltrp.BaseLongTermRetentionPolicyProperties != nil {
11695		objectMap["properties"] = miltrp.BaseLongTermRetentionPolicyProperties
11696	}
11697	return json.Marshal(objectMap)
11698}
11699
11700// UnmarshalJSON is the custom unmarshaler for ManagedInstanceLongTermRetentionPolicy struct.
11701func (miltrp *ManagedInstanceLongTermRetentionPolicy) UnmarshalJSON(body []byte) error {
11702	var m map[string]*json.RawMessage
11703	err := json.Unmarshal(body, &m)
11704	if err != nil {
11705		return err
11706	}
11707	for k, v := range m {
11708		switch k {
11709		case "properties":
11710			if v != nil {
11711				var baseLongTermRetentionPolicyProperties BaseLongTermRetentionPolicyProperties
11712				err = json.Unmarshal(*v, &baseLongTermRetentionPolicyProperties)
11713				if err != nil {
11714					return err
11715				}
11716				miltrp.BaseLongTermRetentionPolicyProperties = &baseLongTermRetentionPolicyProperties
11717			}
11718		case "id":
11719			if v != nil {
11720				var ID string
11721				err = json.Unmarshal(*v, &ID)
11722				if err != nil {
11723					return err
11724				}
11725				miltrp.ID = &ID
11726			}
11727		case "name":
11728			if v != nil {
11729				var name string
11730				err = json.Unmarshal(*v, &name)
11731				if err != nil {
11732					return err
11733				}
11734				miltrp.Name = &name
11735			}
11736		case "type":
11737			if v != nil {
11738				var typeVar string
11739				err = json.Unmarshal(*v, &typeVar)
11740				if err != nil {
11741					return err
11742				}
11743				miltrp.Type = &typeVar
11744			}
11745		}
11746	}
11747
11748	return nil
11749}
11750
11751// ManagedInstanceLongTermRetentionPolicyListResult a list of long term retention policies.
11752type ManagedInstanceLongTermRetentionPolicyListResult struct {
11753	autorest.Response `json:"-"`
11754	// Value - READ-ONLY; Array of results.
11755	Value *[]ManagedInstanceLongTermRetentionPolicy `json:"value,omitempty"`
11756	// NextLink - READ-ONLY; Link to retrieve next page of results.
11757	NextLink *string `json:"nextLink,omitempty"`
11758}
11759
11760// ManagedInstanceLongTermRetentionPolicyListResultIterator provides access to a complete listing of
11761// ManagedInstanceLongTermRetentionPolicy values.
11762type ManagedInstanceLongTermRetentionPolicyListResultIterator struct {
11763	i    int
11764	page ManagedInstanceLongTermRetentionPolicyListResultPage
11765}
11766
11767// NextWithContext advances to the next value.  If there was an error making
11768// the request the iterator does not advance and the error is returned.
11769func (iter *ManagedInstanceLongTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
11770	if tracing.IsEnabled() {
11771		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionPolicyListResultIterator.NextWithContext")
11772		defer func() {
11773			sc := -1
11774			if iter.Response().Response.Response != nil {
11775				sc = iter.Response().Response.Response.StatusCode
11776			}
11777			tracing.EndSpan(ctx, sc, err)
11778		}()
11779	}
11780	iter.i++
11781	if iter.i < len(iter.page.Values()) {
11782		return nil
11783	}
11784	err = iter.page.NextWithContext(ctx)
11785	if err != nil {
11786		iter.i--
11787		return err
11788	}
11789	iter.i = 0
11790	return nil
11791}
11792
11793// Next advances to the next value.  If there was an error making
11794// the request the iterator does not advance and the error is returned.
11795// Deprecated: Use NextWithContext() instead.
11796func (iter *ManagedInstanceLongTermRetentionPolicyListResultIterator) Next() error {
11797	return iter.NextWithContext(context.Background())
11798}
11799
11800// NotDone returns true if the enumeration should be started or is not yet complete.
11801func (iter ManagedInstanceLongTermRetentionPolicyListResultIterator) NotDone() bool {
11802	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11803}
11804
11805// Response returns the raw server response from the last page request.
11806func (iter ManagedInstanceLongTermRetentionPolicyListResultIterator) Response() ManagedInstanceLongTermRetentionPolicyListResult {
11807	return iter.page.Response()
11808}
11809
11810// Value returns the current value or a zero-initialized value if the
11811// iterator has advanced beyond the end of the collection.
11812func (iter ManagedInstanceLongTermRetentionPolicyListResultIterator) Value() ManagedInstanceLongTermRetentionPolicy {
11813	if !iter.page.NotDone() {
11814		return ManagedInstanceLongTermRetentionPolicy{}
11815	}
11816	return iter.page.Values()[iter.i]
11817}
11818
11819// Creates a new instance of the ManagedInstanceLongTermRetentionPolicyListResultIterator type.
11820func NewManagedInstanceLongTermRetentionPolicyListResultIterator(page ManagedInstanceLongTermRetentionPolicyListResultPage) ManagedInstanceLongTermRetentionPolicyListResultIterator {
11821	return ManagedInstanceLongTermRetentionPolicyListResultIterator{page: page}
11822}
11823
11824// IsEmpty returns true if the ListResult contains no values.
11825func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) IsEmpty() bool {
11826	return miltrplr.Value == nil || len(*miltrplr.Value) == 0
11827}
11828
11829// hasNextLink returns true if the NextLink is not empty.
11830func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) hasNextLink() bool {
11831	return miltrplr.NextLink != nil && len(*miltrplr.NextLink) != 0
11832}
11833
11834// managedInstanceLongTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results.
11835// It returns nil if no more results exist.
11836func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) managedInstanceLongTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
11837	if !miltrplr.hasNextLink() {
11838		return nil, nil
11839	}
11840	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11841		autorest.AsJSON(),
11842		autorest.AsGet(),
11843		autorest.WithBaseURL(to.String(miltrplr.NextLink)))
11844}
11845
11846// ManagedInstanceLongTermRetentionPolicyListResultPage contains a page of
11847// ManagedInstanceLongTermRetentionPolicy values.
11848type ManagedInstanceLongTermRetentionPolicyListResultPage struct {
11849	fn       func(context.Context, ManagedInstanceLongTermRetentionPolicyListResult) (ManagedInstanceLongTermRetentionPolicyListResult, error)
11850	miltrplr ManagedInstanceLongTermRetentionPolicyListResult
11851}
11852
11853// NextWithContext advances to the next page of values.  If there was an error making
11854// the request the page does not advance and the error is returned.
11855func (page *ManagedInstanceLongTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
11856	if tracing.IsEnabled() {
11857		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionPolicyListResultPage.NextWithContext")
11858		defer func() {
11859			sc := -1
11860			if page.Response().Response.Response != nil {
11861				sc = page.Response().Response.Response.StatusCode
11862			}
11863			tracing.EndSpan(ctx, sc, err)
11864		}()
11865	}
11866	for {
11867		next, err := page.fn(ctx, page.miltrplr)
11868		if err != nil {
11869			return err
11870		}
11871		page.miltrplr = next
11872		if !next.hasNextLink() || !next.IsEmpty() {
11873			break
11874		}
11875	}
11876	return nil
11877}
11878
11879// Next advances to the next page of values.  If there was an error making
11880// the request the page does not advance and the error is returned.
11881// Deprecated: Use NextWithContext() instead.
11882func (page *ManagedInstanceLongTermRetentionPolicyListResultPage) Next() error {
11883	return page.NextWithContext(context.Background())
11884}
11885
11886// NotDone returns true if the page enumeration should be started or is not yet complete.
11887func (page ManagedInstanceLongTermRetentionPolicyListResultPage) NotDone() bool {
11888	return !page.miltrplr.IsEmpty()
11889}
11890
11891// Response returns the raw server response from the last page request.
11892func (page ManagedInstanceLongTermRetentionPolicyListResultPage) Response() ManagedInstanceLongTermRetentionPolicyListResult {
11893	return page.miltrplr
11894}
11895
11896// Values returns the slice of values for the current page or nil if there are no values.
11897func (page ManagedInstanceLongTermRetentionPolicyListResultPage) Values() []ManagedInstanceLongTermRetentionPolicy {
11898	if page.miltrplr.IsEmpty() {
11899		return nil
11900	}
11901	return *page.miltrplr.Value
11902}
11903
11904// Creates a new instance of the ManagedInstanceLongTermRetentionPolicyListResultPage type.
11905func NewManagedInstanceLongTermRetentionPolicyListResultPage(cur ManagedInstanceLongTermRetentionPolicyListResult, getNextPage func(context.Context, ManagedInstanceLongTermRetentionPolicyListResult) (ManagedInstanceLongTermRetentionPolicyListResult, error)) ManagedInstanceLongTermRetentionPolicyListResultPage {
11906	return ManagedInstanceLongTermRetentionPolicyListResultPage{
11907		fn:       getNextPage,
11908		miltrplr: cur,
11909	}
11910}
11911
11912// ManagedInstanceOperation a managed instance operation.
11913type ManagedInstanceOperation struct {
11914	autorest.Response `json:"-"`
11915	// ManagedInstanceOperationProperties - Resource properties.
11916	*ManagedInstanceOperationProperties `json:"properties,omitempty"`
11917	// ID - READ-ONLY; Resource ID.
11918	ID *string `json:"id,omitempty"`
11919	// Name - READ-ONLY; Resource name.
11920	Name *string `json:"name,omitempty"`
11921	// Type - READ-ONLY; Resource type.
11922	Type *string `json:"type,omitempty"`
11923}
11924
11925// MarshalJSON is the custom marshaler for ManagedInstanceOperation.
11926func (mio ManagedInstanceOperation) MarshalJSON() ([]byte, error) {
11927	objectMap := make(map[string]interface{})
11928	if mio.ManagedInstanceOperationProperties != nil {
11929		objectMap["properties"] = mio.ManagedInstanceOperationProperties
11930	}
11931	return json.Marshal(objectMap)
11932}
11933
11934// UnmarshalJSON is the custom unmarshaler for ManagedInstanceOperation struct.
11935func (mio *ManagedInstanceOperation) UnmarshalJSON(body []byte) error {
11936	var m map[string]*json.RawMessage
11937	err := json.Unmarshal(body, &m)
11938	if err != nil {
11939		return err
11940	}
11941	for k, v := range m {
11942		switch k {
11943		case "properties":
11944			if v != nil {
11945				var managedInstanceOperationProperties ManagedInstanceOperationProperties
11946				err = json.Unmarshal(*v, &managedInstanceOperationProperties)
11947				if err != nil {
11948					return err
11949				}
11950				mio.ManagedInstanceOperationProperties = &managedInstanceOperationProperties
11951			}
11952		case "id":
11953			if v != nil {
11954				var ID string
11955				err = json.Unmarshal(*v, &ID)
11956				if err != nil {
11957					return err
11958				}
11959				mio.ID = &ID
11960			}
11961		case "name":
11962			if v != nil {
11963				var name string
11964				err = json.Unmarshal(*v, &name)
11965				if err != nil {
11966					return err
11967				}
11968				mio.Name = &name
11969			}
11970		case "type":
11971			if v != nil {
11972				var typeVar string
11973				err = json.Unmarshal(*v, &typeVar)
11974				if err != nil {
11975					return err
11976				}
11977				mio.Type = &typeVar
11978			}
11979		}
11980	}
11981
11982	return nil
11983}
11984
11985// ManagedInstanceOperationListResult the response to a list managed instance operations request
11986type ManagedInstanceOperationListResult struct {
11987	autorest.Response `json:"-"`
11988	// Value - READ-ONLY; Array of results.
11989	Value *[]ManagedInstanceOperation `json:"value,omitempty"`
11990	// NextLink - READ-ONLY; Link to retrieve next page of results.
11991	NextLink *string `json:"nextLink,omitempty"`
11992}
11993
11994// ManagedInstanceOperationListResultIterator provides access to a complete listing of
11995// ManagedInstanceOperation values.
11996type ManagedInstanceOperationListResultIterator struct {
11997	i    int
11998	page ManagedInstanceOperationListResultPage
11999}
12000
12001// NextWithContext advances to the next value.  If there was an error making
12002// the request the iterator does not advance and the error is returned.
12003func (iter *ManagedInstanceOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
12004	if tracing.IsEnabled() {
12005		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceOperationListResultIterator.NextWithContext")
12006		defer func() {
12007			sc := -1
12008			if iter.Response().Response.Response != nil {
12009				sc = iter.Response().Response.Response.StatusCode
12010			}
12011			tracing.EndSpan(ctx, sc, err)
12012		}()
12013	}
12014	iter.i++
12015	if iter.i < len(iter.page.Values()) {
12016		return nil
12017	}
12018	err = iter.page.NextWithContext(ctx)
12019	if err != nil {
12020		iter.i--
12021		return err
12022	}
12023	iter.i = 0
12024	return nil
12025}
12026
12027// Next advances to the next value.  If there was an error making
12028// the request the iterator does not advance and the error is returned.
12029// Deprecated: Use NextWithContext() instead.
12030func (iter *ManagedInstanceOperationListResultIterator) Next() error {
12031	return iter.NextWithContext(context.Background())
12032}
12033
12034// NotDone returns true if the enumeration should be started or is not yet complete.
12035func (iter ManagedInstanceOperationListResultIterator) NotDone() bool {
12036	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12037}
12038
12039// Response returns the raw server response from the last page request.
12040func (iter ManagedInstanceOperationListResultIterator) Response() ManagedInstanceOperationListResult {
12041	return iter.page.Response()
12042}
12043
12044// Value returns the current value or a zero-initialized value if the
12045// iterator has advanced beyond the end of the collection.
12046func (iter ManagedInstanceOperationListResultIterator) Value() ManagedInstanceOperation {
12047	if !iter.page.NotDone() {
12048		return ManagedInstanceOperation{}
12049	}
12050	return iter.page.Values()[iter.i]
12051}
12052
12053// Creates a new instance of the ManagedInstanceOperationListResultIterator type.
12054func NewManagedInstanceOperationListResultIterator(page ManagedInstanceOperationListResultPage) ManagedInstanceOperationListResultIterator {
12055	return ManagedInstanceOperationListResultIterator{page: page}
12056}
12057
12058// IsEmpty returns true if the ListResult contains no values.
12059func (miolr ManagedInstanceOperationListResult) IsEmpty() bool {
12060	return miolr.Value == nil || len(*miolr.Value) == 0
12061}
12062
12063// hasNextLink returns true if the NextLink is not empty.
12064func (miolr ManagedInstanceOperationListResult) hasNextLink() bool {
12065	return miolr.NextLink != nil && len(*miolr.NextLink) != 0
12066}
12067
12068// managedInstanceOperationListResultPreparer prepares a request to retrieve the next set of results.
12069// It returns nil if no more results exist.
12070func (miolr ManagedInstanceOperationListResult) managedInstanceOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
12071	if !miolr.hasNextLink() {
12072		return nil, nil
12073	}
12074	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12075		autorest.AsJSON(),
12076		autorest.AsGet(),
12077		autorest.WithBaseURL(to.String(miolr.NextLink)))
12078}
12079
12080// ManagedInstanceOperationListResultPage contains a page of ManagedInstanceOperation values.
12081type ManagedInstanceOperationListResultPage struct {
12082	fn    func(context.Context, ManagedInstanceOperationListResult) (ManagedInstanceOperationListResult, error)
12083	miolr ManagedInstanceOperationListResult
12084}
12085
12086// NextWithContext advances to the next page of values.  If there was an error making
12087// the request the page does not advance and the error is returned.
12088func (page *ManagedInstanceOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
12089	if tracing.IsEnabled() {
12090		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceOperationListResultPage.NextWithContext")
12091		defer func() {
12092			sc := -1
12093			if page.Response().Response.Response != nil {
12094				sc = page.Response().Response.Response.StatusCode
12095			}
12096			tracing.EndSpan(ctx, sc, err)
12097		}()
12098	}
12099	for {
12100		next, err := page.fn(ctx, page.miolr)
12101		if err != nil {
12102			return err
12103		}
12104		page.miolr = next
12105		if !next.hasNextLink() || !next.IsEmpty() {
12106			break
12107		}
12108	}
12109	return nil
12110}
12111
12112// Next advances to the next page of values.  If there was an error making
12113// the request the page does not advance and the error is returned.
12114// Deprecated: Use NextWithContext() instead.
12115func (page *ManagedInstanceOperationListResultPage) Next() error {
12116	return page.NextWithContext(context.Background())
12117}
12118
12119// NotDone returns true if the page enumeration should be started or is not yet complete.
12120func (page ManagedInstanceOperationListResultPage) NotDone() bool {
12121	return !page.miolr.IsEmpty()
12122}
12123
12124// Response returns the raw server response from the last page request.
12125func (page ManagedInstanceOperationListResultPage) Response() ManagedInstanceOperationListResult {
12126	return page.miolr
12127}
12128
12129// Values returns the slice of values for the current page or nil if there are no values.
12130func (page ManagedInstanceOperationListResultPage) Values() []ManagedInstanceOperation {
12131	if page.miolr.IsEmpty() {
12132		return nil
12133	}
12134	return *page.miolr.Value
12135}
12136
12137// Creates a new instance of the ManagedInstanceOperationListResultPage type.
12138func NewManagedInstanceOperationListResultPage(cur ManagedInstanceOperationListResult, getNextPage func(context.Context, ManagedInstanceOperationListResult) (ManagedInstanceOperationListResult, error)) ManagedInstanceOperationListResultPage {
12139	return ManagedInstanceOperationListResultPage{
12140		fn:    getNextPage,
12141		miolr: cur,
12142	}
12143}
12144
12145// ManagedInstanceOperationParametersPair the parameters of a managed instance operation.
12146type ManagedInstanceOperationParametersPair struct {
12147	// CurrentParameters - READ-ONLY; The current parameters.
12148	CurrentParameters *UpsertManagedServerOperationParameters `json:"currentParameters,omitempty"`
12149	// RequestedParameters - READ-ONLY; The requested parameters.
12150	RequestedParameters *UpsertManagedServerOperationParameters `json:"requestedParameters,omitempty"`
12151}
12152
12153// ManagedInstanceOperationProperties the properties of a managed instance operation.
12154type ManagedInstanceOperationProperties struct {
12155	// ManagedInstanceName - READ-ONLY; The name of the managed instance the operation is being performed on.
12156	ManagedInstanceName *string `json:"managedInstanceName,omitempty"`
12157	// Operation - READ-ONLY; The name of operation.
12158	Operation *string `json:"operation,omitempty"`
12159	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
12160	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
12161	// PercentComplete - READ-ONLY; The percentage of the operation completed.
12162	PercentComplete *int32 `json:"percentComplete,omitempty"`
12163	// StartTime - READ-ONLY; The operation start time.
12164	StartTime *date.Time `json:"startTime,omitempty"`
12165	// State - READ-ONLY; The operation state. Possible values include: 'ManagementOperationStatePending', 'ManagementOperationStateInProgress', 'ManagementOperationStateSucceeded', 'ManagementOperationStateFailed', 'ManagementOperationStateCancelInProgress', 'ManagementOperationStateCancelled'
12166	State ManagementOperationState `json:"state,omitempty"`
12167	// ErrorCode - READ-ONLY; The operation error code.
12168	ErrorCode *int32 `json:"errorCode,omitempty"`
12169	// ErrorDescription - READ-ONLY; The operation error description.
12170	ErrorDescription *string `json:"errorDescription,omitempty"`
12171	// ErrorSeverity - READ-ONLY; The operation error severity.
12172	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
12173	// IsUserError - READ-ONLY; Whether or not the error is a user error.
12174	IsUserError *bool `json:"isUserError,omitempty"`
12175	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
12176	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
12177	// Description - READ-ONLY; The operation description.
12178	Description *string `json:"description,omitempty"`
12179	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
12180	IsCancellable *bool `json:"isCancellable,omitempty"`
12181	// OperationParameters - READ-ONLY; The operation parameters.
12182	OperationParameters *ManagedInstanceOperationParametersPair `json:"operationParameters,omitempty"`
12183	// OperationSteps - READ-ONLY; The operation steps.
12184	OperationSteps *ManagedInstanceOperationSteps `json:"operationSteps,omitempty"`
12185}
12186
12187// ManagedInstanceOperationSteps the steps of a managed instance operation.
12188type ManagedInstanceOperationSteps struct {
12189	// TotalSteps - READ-ONLY; The total number of operation steps.
12190	TotalSteps *string `json:"totalSteps,omitempty"`
12191	// CurrentStep - READ-ONLY; The number of current operation steps.
12192	CurrentStep *int32 `json:"currentStep,omitempty"`
12193	// StepsList - READ-ONLY; The operation steps list.
12194	StepsList *[]UpsertManagedServerOperationStep `json:"stepsList,omitempty"`
12195}
12196
12197// ManagedInstancePairInfo pairs of Managed Instances in the failover group.
12198type ManagedInstancePairInfo struct {
12199	// PrimaryManagedInstanceID - Id of Primary Managed Instance in pair.
12200	PrimaryManagedInstanceID *string `json:"primaryManagedInstanceId,omitempty"`
12201	// PartnerManagedInstanceID - Id of Partner Managed Instance in pair.
12202	PartnerManagedInstanceID *string `json:"partnerManagedInstanceId,omitempty"`
12203}
12204
12205// ManagedInstancePrivateLinkServiceConnectionStateProperty ...
12206type ManagedInstancePrivateLinkServiceConnectionStateProperty struct {
12207	// Status - The private link service connection status.
12208	Status *string `json:"status,omitempty"`
12209	// Description - The private link service connection description.
12210	Description *string `json:"description,omitempty"`
12211	// ActionsRequired - READ-ONLY; The private link service connection description.
12212	ActionsRequired *string `json:"actionsRequired,omitempty"`
12213}
12214
12215// MarshalJSON is the custom marshaler for ManagedInstancePrivateLinkServiceConnectionStateProperty.
12216func (miplscsp ManagedInstancePrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
12217	objectMap := make(map[string]interface{})
12218	if miplscsp.Status != nil {
12219		objectMap["status"] = miplscsp.Status
12220	}
12221	if miplscsp.Description != nil {
12222		objectMap["description"] = miplscsp.Description
12223	}
12224	return json.Marshal(objectMap)
12225}
12226
12227// ManagedInstanceProperties the properties of a managed instance.
12228type ManagedInstanceProperties struct {
12229	// ProvisioningState - READ-ONLY; Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Deleting', 'ProvisioningState1Updating', 'ProvisioningState1Unknown', 'ProvisioningState1Succeeded', 'ProvisioningState1Failed'
12230	ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"`
12231	// ManagedInstanceCreateMode - Specifies the mode of database creation.
12232	//
12233	// Default: Regular instance creation.
12234	//
12235	// 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'
12236	ManagedInstanceCreateMode ManagedServerCreateMode `json:"managedInstanceCreateMode,omitempty"`
12237	// FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the managed instance.
12238	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
12239	// AdministratorLogin - Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation).
12240	AdministratorLogin *string `json:"administratorLogin,omitempty"`
12241	// AdministratorLoginPassword - The administrator login password (required for managed instance creation).
12242	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
12243	// SubnetID - Subnet resource ID for the managed instance.
12244	SubnetID *string `json:"subnetId,omitempty"`
12245	// State - READ-ONLY; The state of the managed instance.
12246	State *string `json:"state,omitempty"`
12247	// 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'
12248	LicenseType ManagedInstanceLicenseType `json:"licenseType,omitempty"`
12249	// VCores - The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80.
12250	VCores *int32 `json:"vCores,omitempty"`
12251	// StorageSizeInGB - Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only.
12252	StorageSizeInGB *int32 `json:"storageSizeInGB,omitempty"`
12253	// Collation - Collation of the managed instance.
12254	Collation *string `json:"collation,omitempty"`
12255	// DNSZone - READ-ONLY; The Dns Zone that the managed instance is in.
12256	DNSZone *string `json:"dnsZone,omitempty"`
12257	// DNSZonePartner - The resource id of another managed instance whose DNS zone this managed instance will share after creation.
12258	DNSZonePartner *string `json:"dnsZonePartner,omitempty"`
12259	// PublicDataEndpointEnabled - Whether or not the public data endpoint is enabled.
12260	PublicDataEndpointEnabled *bool `json:"publicDataEndpointEnabled,omitempty"`
12261	// SourceManagedInstanceID - The resource identifier of the source managed instance associated with create operation of this instance.
12262	SourceManagedInstanceID *string `json:"sourceManagedInstanceId,omitempty"`
12263	// RestorePointInTime - Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
12264	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
12265	// ProxyOverride - Connection type used for connecting to the instance. Possible values include: 'ManagedInstanceProxyOverrideProxy', 'ManagedInstanceProxyOverrideRedirect', 'ManagedInstanceProxyOverrideDefault'
12266	ProxyOverride ManagedInstanceProxyOverride `json:"proxyOverride,omitempty"`
12267	// TimezoneID - Id of the timezone. Allowed values are timezones supported by Windows.
12268	// Windows keeps details on supported timezones, including the id, in registry under
12269	// KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.
12270	// You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info.
12271	// List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell.
12272	// An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time".
12273	TimezoneID *string `json:"timezoneId,omitempty"`
12274	// InstancePoolID - The Id of the instance pool this managed server belongs to.
12275	InstancePoolID *string `json:"instancePoolId,omitempty"`
12276	// MaintenanceConfigurationID - Specifies maintenance configuration id to apply to this managed instance.
12277	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`
12278	// MinimalTLSVersion - Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'
12279	MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"`
12280	// 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'
12281	StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"`
12282}
12283
12284// MarshalJSON is the custom marshaler for ManagedInstanceProperties.
12285func (mip ManagedInstanceProperties) MarshalJSON() ([]byte, error) {
12286	objectMap := make(map[string]interface{})
12287	if mip.ManagedInstanceCreateMode != "" {
12288		objectMap["managedInstanceCreateMode"] = mip.ManagedInstanceCreateMode
12289	}
12290	if mip.AdministratorLogin != nil {
12291		objectMap["administratorLogin"] = mip.AdministratorLogin
12292	}
12293	if mip.AdministratorLoginPassword != nil {
12294		objectMap["administratorLoginPassword"] = mip.AdministratorLoginPassword
12295	}
12296	if mip.SubnetID != nil {
12297		objectMap["subnetId"] = mip.SubnetID
12298	}
12299	if mip.LicenseType != "" {
12300		objectMap["licenseType"] = mip.LicenseType
12301	}
12302	if mip.VCores != nil {
12303		objectMap["vCores"] = mip.VCores
12304	}
12305	if mip.StorageSizeInGB != nil {
12306		objectMap["storageSizeInGB"] = mip.StorageSizeInGB
12307	}
12308	if mip.Collation != nil {
12309		objectMap["collation"] = mip.Collation
12310	}
12311	if mip.DNSZonePartner != nil {
12312		objectMap["dnsZonePartner"] = mip.DNSZonePartner
12313	}
12314	if mip.PublicDataEndpointEnabled != nil {
12315		objectMap["publicDataEndpointEnabled"] = mip.PublicDataEndpointEnabled
12316	}
12317	if mip.SourceManagedInstanceID != nil {
12318		objectMap["sourceManagedInstanceId"] = mip.SourceManagedInstanceID
12319	}
12320	if mip.RestorePointInTime != nil {
12321		objectMap["restorePointInTime"] = mip.RestorePointInTime
12322	}
12323	if mip.ProxyOverride != "" {
12324		objectMap["proxyOverride"] = mip.ProxyOverride
12325	}
12326	if mip.TimezoneID != nil {
12327		objectMap["timezoneId"] = mip.TimezoneID
12328	}
12329	if mip.InstancePoolID != nil {
12330		objectMap["instancePoolId"] = mip.InstancePoolID
12331	}
12332	if mip.MaintenanceConfigurationID != nil {
12333		objectMap["maintenanceConfigurationId"] = mip.MaintenanceConfigurationID
12334	}
12335	if mip.MinimalTLSVersion != nil {
12336		objectMap["minimalTlsVersion"] = mip.MinimalTLSVersion
12337	}
12338	if mip.StorageAccountType != "" {
12339		objectMap["storageAccountType"] = mip.StorageAccountType
12340	}
12341	return json.Marshal(objectMap)
12342}
12343
12344// ManagedInstancesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
12345// long-running operation.
12346type ManagedInstancesCreateOrUpdateFuture struct {
12347	azure.FutureAPI
12348	// Result returns the result of the asynchronous operation.
12349	// If the operation has not completed it will return an error.
12350	Result func(ManagedInstancesClient) (ManagedInstance, error)
12351}
12352
12353// ManagedInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
12354// operation.
12355type ManagedInstancesDeleteFuture struct {
12356	azure.FutureAPI
12357	// Result returns the result of the asynchronous operation.
12358	// If the operation has not completed it will return an error.
12359	Result func(ManagedInstancesClient) (autorest.Response, error)
12360}
12361
12362// ManagedInstancesFailoverFuture an abstraction for monitoring and retrieving the results of a
12363// long-running operation.
12364type ManagedInstancesFailoverFuture struct {
12365	azure.FutureAPI
12366	// Result returns the result of the asynchronous operation.
12367	// If the operation has not completed it will return an error.
12368	Result func(ManagedInstancesClient) (autorest.Response, error)
12369}
12370
12371// ManagedInstancesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
12372// operation.
12373type ManagedInstancesUpdateFuture struct {
12374	azure.FutureAPI
12375	// Result returns the result of the asynchronous operation.
12376	// If the operation has not completed it will return an error.
12377	Result func(ManagedInstancesClient) (ManagedInstance, error)
12378}
12379
12380// ManagedInstanceTdeCertificatesCreateFuture an abstraction for monitoring and retrieving the results of a
12381// long-running operation.
12382type ManagedInstanceTdeCertificatesCreateFuture struct {
12383	azure.FutureAPI
12384	// Result returns the result of the asynchronous operation.
12385	// If the operation has not completed it will return an error.
12386	Result func(ManagedInstanceTdeCertificatesClient) (autorest.Response, error)
12387}
12388
12389// ManagedInstanceUpdate an update request for an Azure SQL Database managed instance.
12390type ManagedInstanceUpdate struct {
12391	// Sku - Managed instance sku
12392	Sku *Sku `json:"sku,omitempty"`
12393	// ManagedInstanceProperties - Resource properties.
12394	*ManagedInstanceProperties `json:"properties,omitempty"`
12395	// Tags - Resource tags.
12396	Tags map[string]*string `json:"tags"`
12397}
12398
12399// MarshalJSON is the custom marshaler for ManagedInstanceUpdate.
12400func (miu ManagedInstanceUpdate) MarshalJSON() ([]byte, error) {
12401	objectMap := make(map[string]interface{})
12402	if miu.Sku != nil {
12403		objectMap["sku"] = miu.Sku
12404	}
12405	if miu.ManagedInstanceProperties != nil {
12406		objectMap["properties"] = miu.ManagedInstanceProperties
12407	}
12408	if miu.Tags != nil {
12409		objectMap["tags"] = miu.Tags
12410	}
12411	return json.Marshal(objectMap)
12412}
12413
12414// UnmarshalJSON is the custom unmarshaler for ManagedInstanceUpdate struct.
12415func (miu *ManagedInstanceUpdate) UnmarshalJSON(body []byte) error {
12416	var m map[string]*json.RawMessage
12417	err := json.Unmarshal(body, &m)
12418	if err != nil {
12419		return err
12420	}
12421	for k, v := range m {
12422		switch k {
12423		case "sku":
12424			if v != nil {
12425				var sku Sku
12426				err = json.Unmarshal(*v, &sku)
12427				if err != nil {
12428					return err
12429				}
12430				miu.Sku = &sku
12431			}
12432		case "properties":
12433			if v != nil {
12434				var managedInstanceProperties ManagedInstanceProperties
12435				err = json.Unmarshal(*v, &managedInstanceProperties)
12436				if err != nil {
12437					return err
12438				}
12439				miu.ManagedInstanceProperties = &managedInstanceProperties
12440			}
12441		case "tags":
12442			if v != nil {
12443				var tags map[string]*string
12444				err = json.Unmarshal(*v, &tags)
12445				if err != nil {
12446					return err
12447				}
12448				miu.Tags = tags
12449			}
12450		}
12451	}
12452
12453	return nil
12454}
12455
12456// ManagedInstanceVcoresCapability the managed instance virtual cores capability.
12457type ManagedInstanceVcoresCapability struct {
12458	// Name - READ-ONLY; The virtual cores identifier.
12459	Name *string `json:"name,omitempty"`
12460	// Value - READ-ONLY; The virtual cores value.
12461	Value *int32 `json:"value,omitempty"`
12462	// IncludedMaxSize - READ-ONLY; Included size.
12463	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
12464	// SupportedStorageSizes - READ-ONLY; Storage size ranges.
12465	SupportedStorageSizes *[]MaxSizeRangeCapability `json:"supportedStorageSizes,omitempty"`
12466	// InstancePoolSupported - READ-ONLY; True if this service objective is supported for managed instances in an instance pool.
12467	InstancePoolSupported *bool `json:"instancePoolSupported,omitempty"`
12468	// StandaloneSupported - READ-ONLY; True if this service objective is supported for standalone managed instances.
12469	StandaloneSupported *bool `json:"standaloneSupported,omitempty"`
12470	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
12471	Status CapabilityStatus `json:"status,omitempty"`
12472	// Reason - The reason for the capability not being available.
12473	Reason *string `json:"reason,omitempty"`
12474}
12475
12476// MarshalJSON is the custom marshaler for ManagedInstanceVcoresCapability.
12477func (mivc ManagedInstanceVcoresCapability) MarshalJSON() ([]byte, error) {
12478	objectMap := make(map[string]interface{})
12479	if mivc.Reason != nil {
12480		objectMap["reason"] = mivc.Reason
12481	}
12482	return json.Marshal(objectMap)
12483}
12484
12485// ManagedInstanceVersionCapability the managed instance capability
12486type ManagedInstanceVersionCapability struct {
12487	// Name - READ-ONLY; The server version name.
12488	Name *string `json:"name,omitempty"`
12489	// SupportedEditions - READ-ONLY; The list of supported managed instance editions.
12490	SupportedEditions *[]ManagedInstanceEditionCapability `json:"supportedEditions,omitempty"`
12491	// SupportedInstancePoolEditions - READ-ONLY; The list of supported instance pool editions.
12492	SupportedInstancePoolEditions *[]InstancePoolEditionCapability `json:"supportedInstancePoolEditions,omitempty"`
12493	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
12494	Status CapabilityStatus `json:"status,omitempty"`
12495	// Reason - The reason for the capability not being available.
12496	Reason *string `json:"reason,omitempty"`
12497}
12498
12499// MarshalJSON is the custom marshaler for ManagedInstanceVersionCapability.
12500func (mivc ManagedInstanceVersionCapability) MarshalJSON() ([]byte, error) {
12501	objectMap := make(map[string]interface{})
12502	if mivc.Reason != nil {
12503		objectMap["reason"] = mivc.Reason
12504	}
12505	return json.Marshal(objectMap)
12506}
12507
12508// ManagedInstanceVulnerabilityAssessment a managed instance vulnerability assessment.
12509type ManagedInstanceVulnerabilityAssessment struct {
12510	autorest.Response `json:"-"`
12511	// ManagedInstanceVulnerabilityAssessmentProperties - Resource properties.
12512	*ManagedInstanceVulnerabilityAssessmentProperties `json:"properties,omitempty"`
12513	// ID - READ-ONLY; Resource ID.
12514	ID *string `json:"id,omitempty"`
12515	// Name - READ-ONLY; Resource name.
12516	Name *string `json:"name,omitempty"`
12517	// Type - READ-ONLY; Resource type.
12518	Type *string `json:"type,omitempty"`
12519}
12520
12521// MarshalJSON is the custom marshaler for ManagedInstanceVulnerabilityAssessment.
12522func (miva ManagedInstanceVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
12523	objectMap := make(map[string]interface{})
12524	if miva.ManagedInstanceVulnerabilityAssessmentProperties != nil {
12525		objectMap["properties"] = miva.ManagedInstanceVulnerabilityAssessmentProperties
12526	}
12527	return json.Marshal(objectMap)
12528}
12529
12530// UnmarshalJSON is the custom unmarshaler for ManagedInstanceVulnerabilityAssessment struct.
12531func (miva *ManagedInstanceVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
12532	var m map[string]*json.RawMessage
12533	err := json.Unmarshal(body, &m)
12534	if err != nil {
12535		return err
12536	}
12537	for k, v := range m {
12538		switch k {
12539		case "properties":
12540			if v != nil {
12541				var managedInstanceVulnerabilityAssessmentProperties ManagedInstanceVulnerabilityAssessmentProperties
12542				err = json.Unmarshal(*v, &managedInstanceVulnerabilityAssessmentProperties)
12543				if err != nil {
12544					return err
12545				}
12546				miva.ManagedInstanceVulnerabilityAssessmentProperties = &managedInstanceVulnerabilityAssessmentProperties
12547			}
12548		case "id":
12549			if v != nil {
12550				var ID string
12551				err = json.Unmarshal(*v, &ID)
12552				if err != nil {
12553					return err
12554				}
12555				miva.ID = &ID
12556			}
12557		case "name":
12558			if v != nil {
12559				var name string
12560				err = json.Unmarshal(*v, &name)
12561				if err != nil {
12562					return err
12563				}
12564				miva.Name = &name
12565			}
12566		case "type":
12567			if v != nil {
12568				var typeVar string
12569				err = json.Unmarshal(*v, &typeVar)
12570				if err != nil {
12571					return err
12572				}
12573				miva.Type = &typeVar
12574			}
12575		}
12576	}
12577
12578	return nil
12579}
12580
12581// ManagedInstanceVulnerabilityAssessmentListResult a list of the ManagedInstance's vulnerability
12582// assessments.
12583type ManagedInstanceVulnerabilityAssessmentListResult struct {
12584	autorest.Response `json:"-"`
12585	// Value - READ-ONLY; Array of results.
12586	Value *[]ManagedInstanceVulnerabilityAssessment `json:"value,omitempty"`
12587	// NextLink - READ-ONLY; Link to retrieve next page of results.
12588	NextLink *string `json:"nextLink,omitempty"`
12589}
12590
12591// ManagedInstanceVulnerabilityAssessmentListResultIterator provides access to a complete listing of
12592// ManagedInstanceVulnerabilityAssessment values.
12593type ManagedInstanceVulnerabilityAssessmentListResultIterator struct {
12594	i    int
12595	page ManagedInstanceVulnerabilityAssessmentListResultPage
12596}
12597
12598// NextWithContext advances to the next value.  If there was an error making
12599// the request the iterator does not advance and the error is returned.
12600func (iter *ManagedInstanceVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
12601	if tracing.IsEnabled() {
12602		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentListResultIterator.NextWithContext")
12603		defer func() {
12604			sc := -1
12605			if iter.Response().Response.Response != nil {
12606				sc = iter.Response().Response.Response.StatusCode
12607			}
12608			tracing.EndSpan(ctx, sc, err)
12609		}()
12610	}
12611	iter.i++
12612	if iter.i < len(iter.page.Values()) {
12613		return nil
12614	}
12615	err = iter.page.NextWithContext(ctx)
12616	if err != nil {
12617		iter.i--
12618		return err
12619	}
12620	iter.i = 0
12621	return nil
12622}
12623
12624// Next advances to the next value.  If there was an error making
12625// the request the iterator does not advance and the error is returned.
12626// Deprecated: Use NextWithContext() instead.
12627func (iter *ManagedInstanceVulnerabilityAssessmentListResultIterator) Next() error {
12628	return iter.NextWithContext(context.Background())
12629}
12630
12631// NotDone returns true if the enumeration should be started or is not yet complete.
12632func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) NotDone() bool {
12633	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12634}
12635
12636// Response returns the raw server response from the last page request.
12637func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) Response() ManagedInstanceVulnerabilityAssessmentListResult {
12638	return iter.page.Response()
12639}
12640
12641// Value returns the current value or a zero-initialized value if the
12642// iterator has advanced beyond the end of the collection.
12643func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) Value() ManagedInstanceVulnerabilityAssessment {
12644	if !iter.page.NotDone() {
12645		return ManagedInstanceVulnerabilityAssessment{}
12646	}
12647	return iter.page.Values()[iter.i]
12648}
12649
12650// Creates a new instance of the ManagedInstanceVulnerabilityAssessmentListResultIterator type.
12651func NewManagedInstanceVulnerabilityAssessmentListResultIterator(page ManagedInstanceVulnerabilityAssessmentListResultPage) ManagedInstanceVulnerabilityAssessmentListResultIterator {
12652	return ManagedInstanceVulnerabilityAssessmentListResultIterator{page: page}
12653}
12654
12655// IsEmpty returns true if the ListResult contains no values.
12656func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) IsEmpty() bool {
12657	return mivalr.Value == nil || len(*mivalr.Value) == 0
12658}
12659
12660// hasNextLink returns true if the NextLink is not empty.
12661func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) hasNextLink() bool {
12662	return mivalr.NextLink != nil && len(*mivalr.NextLink) != 0
12663}
12664
12665// managedInstanceVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
12666// It returns nil if no more results exist.
12667func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) managedInstanceVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
12668	if !mivalr.hasNextLink() {
12669		return nil, nil
12670	}
12671	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12672		autorest.AsJSON(),
12673		autorest.AsGet(),
12674		autorest.WithBaseURL(to.String(mivalr.NextLink)))
12675}
12676
12677// ManagedInstanceVulnerabilityAssessmentListResultPage contains a page of
12678// ManagedInstanceVulnerabilityAssessment values.
12679type ManagedInstanceVulnerabilityAssessmentListResultPage struct {
12680	fn     func(context.Context, ManagedInstanceVulnerabilityAssessmentListResult) (ManagedInstanceVulnerabilityAssessmentListResult, error)
12681	mivalr ManagedInstanceVulnerabilityAssessmentListResult
12682}
12683
12684// NextWithContext advances to the next page of values.  If there was an error making
12685// the request the page does not advance and the error is returned.
12686func (page *ManagedInstanceVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
12687	if tracing.IsEnabled() {
12688		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentListResultPage.NextWithContext")
12689		defer func() {
12690			sc := -1
12691			if page.Response().Response.Response != nil {
12692				sc = page.Response().Response.Response.StatusCode
12693			}
12694			tracing.EndSpan(ctx, sc, err)
12695		}()
12696	}
12697	for {
12698		next, err := page.fn(ctx, page.mivalr)
12699		if err != nil {
12700			return err
12701		}
12702		page.mivalr = next
12703		if !next.hasNextLink() || !next.IsEmpty() {
12704			break
12705		}
12706	}
12707	return nil
12708}
12709
12710// Next advances to the next page of values.  If there was an error making
12711// the request the page does not advance and the error is returned.
12712// Deprecated: Use NextWithContext() instead.
12713func (page *ManagedInstanceVulnerabilityAssessmentListResultPage) Next() error {
12714	return page.NextWithContext(context.Background())
12715}
12716
12717// NotDone returns true if the page enumeration should be started or is not yet complete.
12718func (page ManagedInstanceVulnerabilityAssessmentListResultPage) NotDone() bool {
12719	return !page.mivalr.IsEmpty()
12720}
12721
12722// Response returns the raw server response from the last page request.
12723func (page ManagedInstanceVulnerabilityAssessmentListResultPage) Response() ManagedInstanceVulnerabilityAssessmentListResult {
12724	return page.mivalr
12725}
12726
12727// Values returns the slice of values for the current page or nil if there are no values.
12728func (page ManagedInstanceVulnerabilityAssessmentListResultPage) Values() []ManagedInstanceVulnerabilityAssessment {
12729	if page.mivalr.IsEmpty() {
12730		return nil
12731	}
12732	return *page.mivalr.Value
12733}
12734
12735// Creates a new instance of the ManagedInstanceVulnerabilityAssessmentListResultPage type.
12736func NewManagedInstanceVulnerabilityAssessmentListResultPage(cur ManagedInstanceVulnerabilityAssessmentListResult, getNextPage func(context.Context, ManagedInstanceVulnerabilityAssessmentListResult) (ManagedInstanceVulnerabilityAssessmentListResult, error)) ManagedInstanceVulnerabilityAssessmentListResultPage {
12737	return ManagedInstanceVulnerabilityAssessmentListResultPage{
12738		fn:     getNextPage,
12739		mivalr: cur,
12740	}
12741}
12742
12743// ManagedInstanceVulnerabilityAssessmentProperties properties of a managed instance vulnerability
12744// assessment.
12745type ManagedInstanceVulnerabilityAssessmentProperties struct {
12746	// StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
12747	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
12748	// 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.
12749	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
12750	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
12751	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
12752	// RecurringScans - The recurring scans settings
12753	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
12754}
12755
12756// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for
12757// monitoring and retrieving the results of a long-running operation.
12758type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture struct {
12759	azure.FutureAPI
12760	// Result returns the result of the asynchronous operation.
12761	// If the operation has not completed it will return an error.
12762	Result func(ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
12763}
12764
12765// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture an abstraction for
12766// monitoring and retrieving the results of a long-running operation.
12767type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture struct {
12768	azure.FutureAPI
12769	// Result returns the result of the asynchronous operation.
12770	// If the operation has not completed it will return an error.
12771	Result func(ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
12772}
12773
12774// ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
12775// results of a long-running operation.
12776type ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture struct {
12777	azure.FutureAPI
12778	// Result returns the result of the asynchronous operation.
12779	// If the operation has not completed it will return an error.
12780	Result func(ManagedServerSecurityAlertPoliciesClient) (ManagedServerSecurityAlertPolicy, error)
12781}
12782
12783// ManagedServerSecurityAlertPolicy a managed server security alert policy.
12784type ManagedServerSecurityAlertPolicy struct {
12785	autorest.Response `json:"-"`
12786	// SecurityAlertPolicyProperties - Resource properties.
12787	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
12788	// ID - READ-ONLY; Resource ID.
12789	ID *string `json:"id,omitempty"`
12790	// Name - READ-ONLY; Resource name.
12791	Name *string `json:"name,omitempty"`
12792	// Type - READ-ONLY; Resource type.
12793	Type *string `json:"type,omitempty"`
12794}
12795
12796// MarshalJSON is the custom marshaler for ManagedServerSecurityAlertPolicy.
12797func (mssap ManagedServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
12798	objectMap := make(map[string]interface{})
12799	if mssap.SecurityAlertPolicyProperties != nil {
12800		objectMap["properties"] = mssap.SecurityAlertPolicyProperties
12801	}
12802	return json.Marshal(objectMap)
12803}
12804
12805// UnmarshalJSON is the custom unmarshaler for ManagedServerSecurityAlertPolicy struct.
12806func (mssap *ManagedServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
12807	var m map[string]*json.RawMessage
12808	err := json.Unmarshal(body, &m)
12809	if err != nil {
12810		return err
12811	}
12812	for k, v := range m {
12813		switch k {
12814		case "properties":
12815			if v != nil {
12816				var securityAlertPolicyProperties SecurityAlertPolicyProperties
12817				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
12818				if err != nil {
12819					return err
12820				}
12821				mssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
12822			}
12823		case "id":
12824			if v != nil {
12825				var ID string
12826				err = json.Unmarshal(*v, &ID)
12827				if err != nil {
12828					return err
12829				}
12830				mssap.ID = &ID
12831			}
12832		case "name":
12833			if v != nil {
12834				var name string
12835				err = json.Unmarshal(*v, &name)
12836				if err != nil {
12837					return err
12838				}
12839				mssap.Name = &name
12840			}
12841		case "type":
12842			if v != nil {
12843				var typeVar string
12844				err = json.Unmarshal(*v, &typeVar)
12845				if err != nil {
12846					return err
12847				}
12848				mssap.Type = &typeVar
12849			}
12850		}
12851	}
12852
12853	return nil
12854}
12855
12856// ManagedServerSecurityAlertPolicyListResult a list of the managed Server's security alert policies.
12857type ManagedServerSecurityAlertPolicyListResult struct {
12858	autorest.Response `json:"-"`
12859	// Value - READ-ONLY; Array of results.
12860	Value *[]ManagedServerSecurityAlertPolicy `json:"value,omitempty"`
12861	// NextLink - READ-ONLY; Link to retrieve next page of results.
12862	NextLink *string `json:"nextLink,omitempty"`
12863}
12864
12865// ManagedServerSecurityAlertPolicyListResultIterator provides access to a complete listing of
12866// ManagedServerSecurityAlertPolicy values.
12867type ManagedServerSecurityAlertPolicyListResultIterator struct {
12868	i    int
12869	page ManagedServerSecurityAlertPolicyListResultPage
12870}
12871
12872// NextWithContext advances to the next value.  If there was an error making
12873// the request the iterator does not advance and the error is returned.
12874func (iter *ManagedServerSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
12875	if tracing.IsEnabled() {
12876		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPolicyListResultIterator.NextWithContext")
12877		defer func() {
12878			sc := -1
12879			if iter.Response().Response.Response != nil {
12880				sc = iter.Response().Response.Response.StatusCode
12881			}
12882			tracing.EndSpan(ctx, sc, err)
12883		}()
12884	}
12885	iter.i++
12886	if iter.i < len(iter.page.Values()) {
12887		return nil
12888	}
12889	err = iter.page.NextWithContext(ctx)
12890	if err != nil {
12891		iter.i--
12892		return err
12893	}
12894	iter.i = 0
12895	return nil
12896}
12897
12898// Next advances to the next value.  If there was an error making
12899// the request the iterator does not advance and the error is returned.
12900// Deprecated: Use NextWithContext() instead.
12901func (iter *ManagedServerSecurityAlertPolicyListResultIterator) Next() error {
12902	return iter.NextWithContext(context.Background())
12903}
12904
12905// NotDone returns true if the enumeration should be started or is not yet complete.
12906func (iter ManagedServerSecurityAlertPolicyListResultIterator) NotDone() bool {
12907	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12908}
12909
12910// Response returns the raw server response from the last page request.
12911func (iter ManagedServerSecurityAlertPolicyListResultIterator) Response() ManagedServerSecurityAlertPolicyListResult {
12912	return iter.page.Response()
12913}
12914
12915// Value returns the current value or a zero-initialized value if the
12916// iterator has advanced beyond the end of the collection.
12917func (iter ManagedServerSecurityAlertPolicyListResultIterator) Value() ManagedServerSecurityAlertPolicy {
12918	if !iter.page.NotDone() {
12919		return ManagedServerSecurityAlertPolicy{}
12920	}
12921	return iter.page.Values()[iter.i]
12922}
12923
12924// Creates a new instance of the ManagedServerSecurityAlertPolicyListResultIterator type.
12925func NewManagedServerSecurityAlertPolicyListResultIterator(page ManagedServerSecurityAlertPolicyListResultPage) ManagedServerSecurityAlertPolicyListResultIterator {
12926	return ManagedServerSecurityAlertPolicyListResultIterator{page: page}
12927}
12928
12929// IsEmpty returns true if the ListResult contains no values.
12930func (mssaplr ManagedServerSecurityAlertPolicyListResult) IsEmpty() bool {
12931	return mssaplr.Value == nil || len(*mssaplr.Value) == 0
12932}
12933
12934// hasNextLink returns true if the NextLink is not empty.
12935func (mssaplr ManagedServerSecurityAlertPolicyListResult) hasNextLink() bool {
12936	return mssaplr.NextLink != nil && len(*mssaplr.NextLink) != 0
12937}
12938
12939// managedServerSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
12940// It returns nil if no more results exist.
12941func (mssaplr ManagedServerSecurityAlertPolicyListResult) managedServerSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
12942	if !mssaplr.hasNextLink() {
12943		return nil, nil
12944	}
12945	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12946		autorest.AsJSON(),
12947		autorest.AsGet(),
12948		autorest.WithBaseURL(to.String(mssaplr.NextLink)))
12949}
12950
12951// ManagedServerSecurityAlertPolicyListResultPage contains a page of ManagedServerSecurityAlertPolicy
12952// values.
12953type ManagedServerSecurityAlertPolicyListResultPage struct {
12954	fn      func(context.Context, ManagedServerSecurityAlertPolicyListResult) (ManagedServerSecurityAlertPolicyListResult, error)
12955	mssaplr ManagedServerSecurityAlertPolicyListResult
12956}
12957
12958// NextWithContext advances to the next page of values.  If there was an error making
12959// the request the page does not advance and the error is returned.
12960func (page *ManagedServerSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
12961	if tracing.IsEnabled() {
12962		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPolicyListResultPage.NextWithContext")
12963		defer func() {
12964			sc := -1
12965			if page.Response().Response.Response != nil {
12966				sc = page.Response().Response.Response.StatusCode
12967			}
12968			tracing.EndSpan(ctx, sc, err)
12969		}()
12970	}
12971	for {
12972		next, err := page.fn(ctx, page.mssaplr)
12973		if err != nil {
12974			return err
12975		}
12976		page.mssaplr = next
12977		if !next.hasNextLink() || !next.IsEmpty() {
12978			break
12979		}
12980	}
12981	return nil
12982}
12983
12984// Next advances to the next page of values.  If there was an error making
12985// the request the page does not advance and the error is returned.
12986// Deprecated: Use NextWithContext() instead.
12987func (page *ManagedServerSecurityAlertPolicyListResultPage) Next() error {
12988	return page.NextWithContext(context.Background())
12989}
12990
12991// NotDone returns true if the page enumeration should be started or is not yet complete.
12992func (page ManagedServerSecurityAlertPolicyListResultPage) NotDone() bool {
12993	return !page.mssaplr.IsEmpty()
12994}
12995
12996// Response returns the raw server response from the last page request.
12997func (page ManagedServerSecurityAlertPolicyListResultPage) Response() ManagedServerSecurityAlertPolicyListResult {
12998	return page.mssaplr
12999}
13000
13001// Values returns the slice of values for the current page or nil if there are no values.
13002func (page ManagedServerSecurityAlertPolicyListResultPage) Values() []ManagedServerSecurityAlertPolicy {
13003	if page.mssaplr.IsEmpty() {
13004		return nil
13005	}
13006	return *page.mssaplr.Value
13007}
13008
13009// Creates a new instance of the ManagedServerSecurityAlertPolicyListResultPage type.
13010func NewManagedServerSecurityAlertPolicyListResultPage(cur ManagedServerSecurityAlertPolicyListResult, getNextPage func(context.Context, ManagedServerSecurityAlertPolicyListResult) (ManagedServerSecurityAlertPolicyListResult, error)) ManagedServerSecurityAlertPolicyListResultPage {
13011	return ManagedServerSecurityAlertPolicyListResultPage{
13012		fn:      getNextPage,
13013		mssaplr: cur,
13014	}
13015}
13016
13017// MaxSizeCapability the maximum size capability.
13018type MaxSizeCapability struct {
13019	// Limit - READ-ONLY; The maximum size limit (see 'unit' for the units).
13020	Limit *int32 `json:"limit,omitempty"`
13021	// Unit - READ-ONLY; The units that the limit is expressed in. Possible values include: 'MaxSizeUnitMegabytes', 'MaxSizeUnitGigabytes', 'MaxSizeUnitTerabytes', 'MaxSizeUnitPetabytes'
13022	Unit MaxSizeUnit `json:"unit,omitempty"`
13023}
13024
13025// MaxSizeRangeCapability the maximum size range capability.
13026type MaxSizeRangeCapability struct {
13027	// MinValue - READ-ONLY; Minimum value.
13028	MinValue *MaxSizeCapability `json:"minValue,omitempty"`
13029	// MaxValue - READ-ONLY; Maximum value.
13030	MaxValue *MaxSizeCapability `json:"maxValue,omitempty"`
13031	// ScaleSize - READ-ONLY; Scale/step size for discrete values between the minimum value and the maximum value.
13032	ScaleSize *MaxSizeCapability `json:"scaleSize,omitempty"`
13033	// LogSize - READ-ONLY; Size of transaction log.
13034	LogSize *LogSizeCapability `json:"logSize,omitempty"`
13035	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
13036	Status CapabilityStatus `json:"status,omitempty"`
13037	// Reason - The reason for the capability not being available.
13038	Reason *string `json:"reason,omitempty"`
13039}
13040
13041// MarshalJSON is the custom marshaler for MaxSizeRangeCapability.
13042func (msrc MaxSizeRangeCapability) MarshalJSON() ([]byte, error) {
13043	objectMap := make(map[string]interface{})
13044	if msrc.Reason != nil {
13045		objectMap["reason"] = msrc.Reason
13046	}
13047	return json.Marshal(objectMap)
13048}
13049
13050// Metric database metrics.
13051type Metric struct {
13052	// StartTime - READ-ONLY; The start time for the metric (ISO-8601 format).
13053	StartTime *date.Time `json:"startTime,omitempty"`
13054	// EndTime - READ-ONLY; The end time for the metric (ISO-8601 format).
13055	EndTime *date.Time `json:"endTime,omitempty"`
13056	// TimeGrain - READ-ONLY; The time step to be used to summarize the metric values.
13057	TimeGrain *string `json:"timeGrain,omitempty"`
13058	// Unit - READ-ONLY; The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond'
13059	Unit UnitType `json:"unit,omitempty"`
13060	// Name - READ-ONLY; The name information for the metric.
13061	Name *MetricName `json:"name,omitempty"`
13062	// MetricValues - READ-ONLY; The metric values for the specified time window and timestep.
13063	MetricValues *[]MetricValue `json:"metricValues,omitempty"`
13064}
13065
13066// MetricAvailability a metric availability value.
13067type MetricAvailability struct {
13068	// Retention - READ-ONLY; The length of retention for the database metric.
13069	Retention *string `json:"retention,omitempty"`
13070	// TimeGrain - READ-ONLY; The granularity of the database metric.
13071	TimeGrain *string `json:"timeGrain,omitempty"`
13072}
13073
13074// MetricDefinition a database metric definition.
13075type MetricDefinition struct {
13076	// Name - READ-ONLY; The name information for the metric.
13077	Name *MetricName `json:"name,omitempty"`
13078	// PrimaryAggregationType - READ-ONLY; The primary aggregation type defining how metric values are displayed. Possible values include: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total'
13079	PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"`
13080	// ResourceURI - READ-ONLY; The resource uri of the database.
13081	ResourceURI *string `json:"resourceUri,omitempty"`
13082	// Unit - READ-ONLY; The unit of the metric. Possible values include: 'UnitDefinitionTypeCount', 'UnitDefinitionTypeBytes', 'UnitDefinitionTypeSeconds', 'UnitDefinitionTypePercent', 'UnitDefinitionTypeCountPerSecond', 'UnitDefinitionTypeBytesPerSecond'
13083	Unit UnitDefinitionType `json:"unit,omitempty"`
13084	// MetricAvailabilities - READ-ONLY; The list of database metric availabilities for the metric.
13085	MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
13086}
13087
13088// MetricDefinitionListResult the response to a list database metric definitions request.
13089type MetricDefinitionListResult struct {
13090	autorest.Response `json:"-"`
13091	// Value - The list of metric definitions for the database.
13092	Value *[]MetricDefinition `json:"value,omitempty"`
13093}
13094
13095// MetricListResult the response to a list database metrics request.
13096type MetricListResult struct {
13097	autorest.Response `json:"-"`
13098	// Value - The list of metrics for the database.
13099	Value *[]Metric `json:"value,omitempty"`
13100}
13101
13102// MetricName a database metric name.
13103type MetricName struct {
13104	// Value - READ-ONLY; The name of the database metric.
13105	Value *string `json:"value,omitempty"`
13106	// LocalizedValue - READ-ONLY; The friendly name of the database metric.
13107	LocalizedValue *string `json:"localizedValue,omitempty"`
13108}
13109
13110// MetricValue represents database metrics.
13111type MetricValue struct {
13112	// Count - READ-ONLY; The number of values for the metric.
13113	Count *float64 `json:"count,omitempty"`
13114	// Average - READ-ONLY; The average value of the metric.
13115	Average *float64 `json:"average,omitempty"`
13116	// Maximum - READ-ONLY; The max value of the metric.
13117	Maximum *float64 `json:"maximum,omitempty"`
13118	// Minimum - READ-ONLY; The min value of the metric.
13119	Minimum *float64 `json:"minimum,omitempty"`
13120	// Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format).
13121	Timestamp *date.Time `json:"timestamp,omitempty"`
13122	// Total - READ-ONLY; The total value of the metric.
13123	Total *float64 `json:"total,omitempty"`
13124}
13125
13126// MinCapacityCapability the min capacity capability
13127type MinCapacityCapability struct {
13128	// Value - READ-ONLY; Min capacity value
13129	Value *float64 `json:"value,omitempty"`
13130	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
13131	Status CapabilityStatus `json:"status,omitempty"`
13132	// Reason - The reason for the capability not being available.
13133	Reason *string `json:"reason,omitempty"`
13134}
13135
13136// MarshalJSON is the custom marshaler for MinCapacityCapability.
13137func (mcc MinCapacityCapability) MarshalJSON() ([]byte, error) {
13138	objectMap := make(map[string]interface{})
13139	if mcc.Reason != nil {
13140		objectMap["reason"] = mcc.Reason
13141	}
13142	return json.Marshal(objectMap)
13143}
13144
13145// Name ARM Usage Name
13146type Name struct {
13147	// Value - Usage name value
13148	Value *string `json:"value,omitempty"`
13149	// LocalizedValue - Usage name localized value.
13150	LocalizedValue *string `json:"localizedValue,omitempty"`
13151}
13152
13153// NetworkIsolationSettings contains the ARM resources for which to create private endpoint connection.
13154type NetworkIsolationSettings struct {
13155	// 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.
13156	StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
13157	// 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.
13158	SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"`
13159}
13160
13161// Operation SQL REST API operation definition.
13162type Operation struct {
13163	// Name - READ-ONLY; The name of the operation being performed on this particular object.
13164	Name *string `json:"name,omitempty"`
13165	// Display - READ-ONLY; The localized display information for this particular operation / action.
13166	Display *OperationDisplay `json:"display,omitempty"`
13167	// Origin - READ-ONLY; The intended executor of the operation. Possible values include: 'User', 'System'
13168	Origin OperationOrigin `json:"origin,omitempty"`
13169	// Properties - READ-ONLY; Additional descriptions for the operation.
13170	Properties map[string]interface{} `json:"properties"`
13171}
13172
13173// MarshalJSON is the custom marshaler for Operation.
13174func (o Operation) MarshalJSON() ([]byte, error) {
13175	objectMap := make(map[string]interface{})
13176	return json.Marshal(objectMap)
13177}
13178
13179// OperationDisplay display metadata associated with the operation.
13180type OperationDisplay struct {
13181	// Provider - READ-ONLY; The localized friendly form of the resource provider name.
13182	Provider *string `json:"provider,omitempty"`
13183	// Resource - READ-ONLY; The localized friendly form of the resource type related to this action/operation.
13184	Resource *string `json:"resource,omitempty"`
13185	// Operation - READ-ONLY; The localized friendly name for the operation.
13186	Operation *string `json:"operation,omitempty"`
13187	// Description - READ-ONLY; The localized friendly description for the operation.
13188	Description *string `json:"description,omitempty"`
13189}
13190
13191// OperationImpact the impact of an operation, both in absolute and relative terms.
13192type OperationImpact struct {
13193	// Name - READ-ONLY; The name of the impact dimension.
13194	Name *string `json:"name,omitempty"`
13195	// Unit - READ-ONLY; The unit in which estimated impact to dimension is measured.
13196	Unit *string `json:"unit,omitempty"`
13197	// ChangeValueAbsolute - READ-ONLY; The absolute impact to dimension.
13198	ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty"`
13199	// ChangeValueRelative - READ-ONLY; The relative impact to dimension (null if not applicable)
13200	ChangeValueRelative *float64 `json:"changeValueRelative,omitempty"`
13201}
13202
13203// OperationListResult result of the request to list SQL operations.
13204type OperationListResult struct {
13205	autorest.Response `json:"-"`
13206	// Value - READ-ONLY; Array of results.
13207	Value *[]Operation `json:"value,omitempty"`
13208	// NextLink - READ-ONLY; Link to retrieve next page of results.
13209	NextLink *string `json:"nextLink,omitempty"`
13210}
13211
13212// OperationListResultIterator provides access to a complete listing of Operation values.
13213type OperationListResultIterator struct {
13214	i    int
13215	page OperationListResultPage
13216}
13217
13218// NextWithContext advances to the next value.  If there was an error making
13219// the request the iterator does not advance and the error is returned.
13220func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
13221	if tracing.IsEnabled() {
13222		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
13223		defer func() {
13224			sc := -1
13225			if iter.Response().Response.Response != nil {
13226				sc = iter.Response().Response.Response.StatusCode
13227			}
13228			tracing.EndSpan(ctx, sc, err)
13229		}()
13230	}
13231	iter.i++
13232	if iter.i < len(iter.page.Values()) {
13233		return nil
13234	}
13235	err = iter.page.NextWithContext(ctx)
13236	if err != nil {
13237		iter.i--
13238		return err
13239	}
13240	iter.i = 0
13241	return nil
13242}
13243
13244// Next advances to the next value.  If there was an error making
13245// the request the iterator does not advance and the error is returned.
13246// Deprecated: Use NextWithContext() instead.
13247func (iter *OperationListResultIterator) Next() error {
13248	return iter.NextWithContext(context.Background())
13249}
13250
13251// NotDone returns true if the enumeration should be started or is not yet complete.
13252func (iter OperationListResultIterator) NotDone() bool {
13253	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13254}
13255
13256// Response returns the raw server response from the last page request.
13257func (iter OperationListResultIterator) Response() OperationListResult {
13258	return iter.page.Response()
13259}
13260
13261// Value returns the current value or a zero-initialized value if the
13262// iterator has advanced beyond the end of the collection.
13263func (iter OperationListResultIterator) Value() Operation {
13264	if !iter.page.NotDone() {
13265		return Operation{}
13266	}
13267	return iter.page.Values()[iter.i]
13268}
13269
13270// Creates a new instance of the OperationListResultIterator type.
13271func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
13272	return OperationListResultIterator{page: page}
13273}
13274
13275// IsEmpty returns true if the ListResult contains no values.
13276func (olr OperationListResult) IsEmpty() bool {
13277	return olr.Value == nil || len(*olr.Value) == 0
13278}
13279
13280// hasNextLink returns true if the NextLink is not empty.
13281func (olr OperationListResult) hasNextLink() bool {
13282	return olr.NextLink != nil && len(*olr.NextLink) != 0
13283}
13284
13285// operationListResultPreparer prepares a request to retrieve the next set of results.
13286// It returns nil if no more results exist.
13287func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
13288	if !olr.hasNextLink() {
13289		return nil, nil
13290	}
13291	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13292		autorest.AsJSON(),
13293		autorest.AsGet(),
13294		autorest.WithBaseURL(to.String(olr.NextLink)))
13295}
13296
13297// OperationListResultPage contains a page of Operation values.
13298type OperationListResultPage struct {
13299	fn  func(context.Context, OperationListResult) (OperationListResult, error)
13300	olr OperationListResult
13301}
13302
13303// NextWithContext advances to the next page of values.  If there was an error making
13304// the request the page does not advance and the error is returned.
13305func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
13306	if tracing.IsEnabled() {
13307		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
13308		defer func() {
13309			sc := -1
13310			if page.Response().Response.Response != nil {
13311				sc = page.Response().Response.Response.StatusCode
13312			}
13313			tracing.EndSpan(ctx, sc, err)
13314		}()
13315	}
13316	for {
13317		next, err := page.fn(ctx, page.olr)
13318		if err != nil {
13319			return err
13320		}
13321		page.olr = next
13322		if !next.hasNextLink() || !next.IsEmpty() {
13323			break
13324		}
13325	}
13326	return nil
13327}
13328
13329// Next advances to the next page of values.  If there was an error making
13330// the request the page does not advance and the error is returned.
13331// Deprecated: Use NextWithContext() instead.
13332func (page *OperationListResultPage) Next() error {
13333	return page.NextWithContext(context.Background())
13334}
13335
13336// NotDone returns true if the page enumeration should be started or is not yet complete.
13337func (page OperationListResultPage) NotDone() bool {
13338	return !page.olr.IsEmpty()
13339}
13340
13341// Response returns the raw server response from the last page request.
13342func (page OperationListResultPage) Response() OperationListResult {
13343	return page.olr
13344}
13345
13346// Values returns the slice of values for the current page or nil if there are no values.
13347func (page OperationListResultPage) Values() []Operation {
13348	if page.olr.IsEmpty() {
13349		return nil
13350	}
13351	return *page.olr.Value
13352}
13353
13354// Creates a new instance of the OperationListResultPage type.
13355func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
13356	return OperationListResultPage{
13357		fn:  getNextPage,
13358		olr: cur,
13359	}
13360}
13361
13362// PartnerInfo partner server information for the failover group.
13363type PartnerInfo struct {
13364	// ID - Resource identifier of the partner server.
13365	ID *string `json:"id,omitempty"`
13366	// Location - READ-ONLY; Geo location of the partner server.
13367	Location *string `json:"location,omitempty"`
13368	// ReplicationRole - READ-ONLY; Replication role of the partner server. Possible values include: 'Primary', 'Secondary'
13369	ReplicationRole FailoverGroupReplicationRole `json:"replicationRole,omitempty"`
13370}
13371
13372// MarshalJSON is the custom marshaler for PartnerInfo.
13373func (pi PartnerInfo) MarshalJSON() ([]byte, error) {
13374	objectMap := make(map[string]interface{})
13375	if pi.ID != nil {
13376		objectMap["id"] = pi.ID
13377	}
13378	return json.Marshal(objectMap)
13379}
13380
13381// PartnerRegionInfo partner region information for the failover group.
13382type PartnerRegionInfo struct {
13383	// Location - Geo location of the partner managed instances.
13384	Location *string `json:"location,omitempty"`
13385	// ReplicationRole - READ-ONLY; Replication role of the partner managed instances. Possible values include: 'InstanceFailoverGroupReplicationRolePrimary', 'InstanceFailoverGroupReplicationRoleSecondary'
13386	ReplicationRole InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty"`
13387}
13388
13389// MarshalJSON is the custom marshaler for PartnerRegionInfo.
13390func (pri PartnerRegionInfo) MarshalJSON() ([]byte, error) {
13391	objectMap := make(map[string]interface{})
13392	if pri.Location != nil {
13393		objectMap["location"] = pri.Location
13394	}
13395	return json.Marshal(objectMap)
13396}
13397
13398// PerformanceLevelCapability the performance level capability.
13399type PerformanceLevelCapability struct {
13400	// Value - READ-ONLY; Performance level value.
13401	Value *float64 `json:"value,omitempty"`
13402	// Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'DTU', 'VCores'
13403	Unit PerformanceLevelUnit `json:"unit,omitempty"`
13404}
13405
13406// PrivateEndpointConnection a private endpoint connection
13407type PrivateEndpointConnection struct {
13408	autorest.Response `json:"-"`
13409	// PrivateEndpointConnectionProperties - Resource properties.
13410	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
13411	// ID - READ-ONLY; Resource ID.
13412	ID *string `json:"id,omitempty"`
13413	// Name - READ-ONLY; Resource name.
13414	Name *string `json:"name,omitempty"`
13415	// Type - READ-ONLY; Resource type.
13416	Type *string `json:"type,omitempty"`
13417}
13418
13419// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
13420func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
13421	objectMap := make(map[string]interface{})
13422	if pec.PrivateEndpointConnectionProperties != nil {
13423		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
13424	}
13425	return json.Marshal(objectMap)
13426}
13427
13428// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
13429func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
13430	var m map[string]*json.RawMessage
13431	err := json.Unmarshal(body, &m)
13432	if err != nil {
13433		return err
13434	}
13435	for k, v := range m {
13436		switch k {
13437		case "properties":
13438			if v != nil {
13439				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
13440				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
13441				if err != nil {
13442					return err
13443				}
13444				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
13445			}
13446		case "id":
13447			if v != nil {
13448				var ID string
13449				err = json.Unmarshal(*v, &ID)
13450				if err != nil {
13451					return err
13452				}
13453				pec.ID = &ID
13454			}
13455		case "name":
13456			if v != nil {
13457				var name string
13458				err = json.Unmarshal(*v, &name)
13459				if err != nil {
13460					return err
13461				}
13462				pec.Name = &name
13463			}
13464		case "type":
13465			if v != nil {
13466				var typeVar string
13467				err = json.Unmarshal(*v, &typeVar)
13468				if err != nil {
13469					return err
13470				}
13471				pec.Type = &typeVar
13472			}
13473		}
13474	}
13475
13476	return nil
13477}
13478
13479// PrivateEndpointConnectionListResult a list of private endpoint connections.
13480type PrivateEndpointConnectionListResult struct {
13481	autorest.Response `json:"-"`
13482	// Value - READ-ONLY; Array of results.
13483	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
13484	// NextLink - READ-ONLY; Link to retrieve next page of results.
13485	NextLink *string `json:"nextLink,omitempty"`
13486}
13487
13488// PrivateEndpointConnectionListResultIterator provides access to a complete listing of
13489// PrivateEndpointConnection values.
13490type PrivateEndpointConnectionListResultIterator struct {
13491	i    int
13492	page PrivateEndpointConnectionListResultPage
13493}
13494
13495// NextWithContext advances to the next value.  If there was an error making
13496// the request the iterator does not advance and the error is returned.
13497func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
13498	if tracing.IsEnabled() {
13499		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext")
13500		defer func() {
13501			sc := -1
13502			if iter.Response().Response.Response != nil {
13503				sc = iter.Response().Response.Response.StatusCode
13504			}
13505			tracing.EndSpan(ctx, sc, err)
13506		}()
13507	}
13508	iter.i++
13509	if iter.i < len(iter.page.Values()) {
13510		return nil
13511	}
13512	err = iter.page.NextWithContext(ctx)
13513	if err != nil {
13514		iter.i--
13515		return err
13516	}
13517	iter.i = 0
13518	return nil
13519}
13520
13521// Next advances to the next value.  If there was an error making
13522// the request the iterator does not advance and the error is returned.
13523// Deprecated: Use NextWithContext() instead.
13524func (iter *PrivateEndpointConnectionListResultIterator) Next() error {
13525	return iter.NextWithContext(context.Background())
13526}
13527
13528// NotDone returns true if the enumeration should be started or is not yet complete.
13529func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool {
13530	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13531}
13532
13533// Response returns the raw server response from the last page request.
13534func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult {
13535	return iter.page.Response()
13536}
13537
13538// Value returns the current value or a zero-initialized value if the
13539// iterator has advanced beyond the end of the collection.
13540func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection {
13541	if !iter.page.NotDone() {
13542		return PrivateEndpointConnection{}
13543	}
13544	return iter.page.Values()[iter.i]
13545}
13546
13547// Creates a new instance of the PrivateEndpointConnectionListResultIterator type.
13548func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator {
13549	return PrivateEndpointConnectionListResultIterator{page: page}
13550}
13551
13552// IsEmpty returns true if the ListResult contains no values.
13553func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool {
13554	return peclr.Value == nil || len(*peclr.Value) == 0
13555}
13556
13557// hasNextLink returns true if the NextLink is not empty.
13558func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool {
13559	return peclr.NextLink != nil && len(*peclr.NextLink) != 0
13560}
13561
13562// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results.
13563// It returns nil if no more results exist.
13564func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
13565	if !peclr.hasNextLink() {
13566		return nil, nil
13567	}
13568	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13569		autorest.AsJSON(),
13570		autorest.AsGet(),
13571		autorest.WithBaseURL(to.String(peclr.NextLink)))
13572}
13573
13574// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values.
13575type PrivateEndpointConnectionListResultPage struct {
13576	fn    func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)
13577	peclr PrivateEndpointConnectionListResult
13578}
13579
13580// NextWithContext advances to the next page of values.  If there was an error making
13581// the request the page does not advance and the error is returned.
13582func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
13583	if tracing.IsEnabled() {
13584		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext")
13585		defer func() {
13586			sc := -1
13587			if page.Response().Response.Response != nil {
13588				sc = page.Response().Response.Response.StatusCode
13589			}
13590			tracing.EndSpan(ctx, sc, err)
13591		}()
13592	}
13593	for {
13594		next, err := page.fn(ctx, page.peclr)
13595		if err != nil {
13596			return err
13597		}
13598		page.peclr = next
13599		if !next.hasNextLink() || !next.IsEmpty() {
13600			break
13601		}
13602	}
13603	return nil
13604}
13605
13606// Next advances to the next page of values.  If there was an error making
13607// the request the page does not advance and the error is returned.
13608// Deprecated: Use NextWithContext() instead.
13609func (page *PrivateEndpointConnectionListResultPage) Next() error {
13610	return page.NextWithContext(context.Background())
13611}
13612
13613// NotDone returns true if the page enumeration should be started or is not yet complete.
13614func (page PrivateEndpointConnectionListResultPage) NotDone() bool {
13615	return !page.peclr.IsEmpty()
13616}
13617
13618// Response returns the raw server response from the last page request.
13619func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult {
13620	return page.peclr
13621}
13622
13623// Values returns the slice of values for the current page or nil if there are no values.
13624func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection {
13625	if page.peclr.IsEmpty() {
13626		return nil
13627	}
13628	return *page.peclr.Value
13629}
13630
13631// Creates a new instance of the PrivateEndpointConnectionListResultPage type.
13632func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage {
13633	return PrivateEndpointConnectionListResultPage{
13634		fn:    getNextPage,
13635		peclr: cur,
13636	}
13637}
13638
13639// PrivateEndpointConnectionProperties properties of a private endpoint connection.
13640type PrivateEndpointConnectionProperties struct {
13641	// PrivateEndpoint - Private endpoint which the connection belongs to.
13642	PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"`
13643	// PrivateLinkServiceConnectionState - Connection state of the private endpoint connection.
13644	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`
13645	// ProvisioningState - READ-ONLY; State of the private endpoint connection. Possible values include: 'PrivateEndpointProvisioningStateApproving', 'PrivateEndpointProvisioningStateReady', 'PrivateEndpointProvisioningStateDropping', 'PrivateEndpointProvisioningStateFailed', 'PrivateEndpointProvisioningStateRejecting'
13646	ProvisioningState PrivateEndpointProvisioningState `json:"provisioningState,omitempty"`
13647}
13648
13649// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties.
13650func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
13651	objectMap := make(map[string]interface{})
13652	if pecp.PrivateEndpoint != nil {
13653		objectMap["privateEndpoint"] = pecp.PrivateEndpoint
13654	}
13655	if pecp.PrivateLinkServiceConnectionState != nil {
13656		objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState
13657	}
13658	return json.Marshal(objectMap)
13659}
13660
13661// PrivateEndpointConnectionRequestStatus contains the private endpoint connection requests status.
13662type PrivateEndpointConnectionRequestStatus struct {
13663	// PrivateLinkServiceID - READ-ONLY; Resource id for which the private endpoint is created.
13664	PrivateLinkServiceID *string `json:"privateLinkServiceId,omitempty"`
13665	// PrivateEndpointConnectionName - READ-ONLY; The connection name for the private endpoint.
13666	PrivateEndpointConnectionName *string `json:"privateEndpointConnectionName,omitempty"`
13667	// Status - READ-ONLY; Status of this private endpoint connection.
13668	Status *string `json:"status,omitempty"`
13669}
13670
13671// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
13672// of a long-running operation.
13673type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
13674	azure.FutureAPI
13675	// Result returns the result of the asynchronous operation.
13676	// If the operation has not completed it will return an error.
13677	Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
13678}
13679
13680// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
13681// long-running operation.
13682type PrivateEndpointConnectionsDeleteFuture struct {
13683	azure.FutureAPI
13684	// Result returns the result of the asynchronous operation.
13685	// If the operation has not completed it will return an error.
13686	Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
13687}
13688
13689// PrivateEndpointProperty ...
13690type PrivateEndpointProperty struct {
13691	// ID - Resource id of the private endpoint.
13692	ID *string `json:"id,omitempty"`
13693}
13694
13695// PrivateLinkResource a private link resource
13696type PrivateLinkResource struct {
13697	autorest.Response `json:"-"`
13698	// Properties - READ-ONLY; The private link resource group id.
13699	Properties *PrivateLinkResourceProperties `json:"properties,omitempty"`
13700	// ID - READ-ONLY; Resource ID.
13701	ID *string `json:"id,omitempty"`
13702	// Name - READ-ONLY; Resource name.
13703	Name *string `json:"name,omitempty"`
13704	// Type - READ-ONLY; Resource type.
13705	Type *string `json:"type,omitempty"`
13706}
13707
13708// PrivateLinkResourceListResult a list of private link resources
13709type PrivateLinkResourceListResult struct {
13710	autorest.Response `json:"-"`
13711	// Value - READ-ONLY; Array of results.
13712	Value *[]PrivateLinkResource `json:"value,omitempty"`
13713	// NextLink - READ-ONLY; Link to retrieve next page of results.
13714	NextLink *string `json:"nextLink,omitempty"`
13715}
13716
13717// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource
13718// values.
13719type PrivateLinkResourceListResultIterator struct {
13720	i    int
13721	page PrivateLinkResourceListResultPage
13722}
13723
13724// NextWithContext advances to the next value.  If there was an error making
13725// the request the iterator does not advance and the error is returned.
13726func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
13727	if tracing.IsEnabled() {
13728		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext")
13729		defer func() {
13730			sc := -1
13731			if iter.Response().Response.Response != nil {
13732				sc = iter.Response().Response.Response.StatusCode
13733			}
13734			tracing.EndSpan(ctx, sc, err)
13735		}()
13736	}
13737	iter.i++
13738	if iter.i < len(iter.page.Values()) {
13739		return nil
13740	}
13741	err = iter.page.NextWithContext(ctx)
13742	if err != nil {
13743		iter.i--
13744		return err
13745	}
13746	iter.i = 0
13747	return nil
13748}
13749
13750// Next advances to the next value.  If there was an error making
13751// the request the iterator does not advance and the error is returned.
13752// Deprecated: Use NextWithContext() instead.
13753func (iter *PrivateLinkResourceListResultIterator) Next() error {
13754	return iter.NextWithContext(context.Background())
13755}
13756
13757// NotDone returns true if the enumeration should be started or is not yet complete.
13758func (iter PrivateLinkResourceListResultIterator) NotDone() bool {
13759	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13760}
13761
13762// Response returns the raw server response from the last page request.
13763func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult {
13764	return iter.page.Response()
13765}
13766
13767// Value returns the current value or a zero-initialized value if the
13768// iterator has advanced beyond the end of the collection.
13769func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource {
13770	if !iter.page.NotDone() {
13771		return PrivateLinkResource{}
13772	}
13773	return iter.page.Values()[iter.i]
13774}
13775
13776// Creates a new instance of the PrivateLinkResourceListResultIterator type.
13777func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator {
13778	return PrivateLinkResourceListResultIterator{page: page}
13779}
13780
13781// IsEmpty returns true if the ListResult contains no values.
13782func (plrlr PrivateLinkResourceListResult) IsEmpty() bool {
13783	return plrlr.Value == nil || len(*plrlr.Value) == 0
13784}
13785
13786// hasNextLink returns true if the NextLink is not empty.
13787func (plrlr PrivateLinkResourceListResult) hasNextLink() bool {
13788	return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0
13789}
13790
13791// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results.
13792// It returns nil if no more results exist.
13793func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
13794	if !plrlr.hasNextLink() {
13795		return nil, nil
13796	}
13797	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13798		autorest.AsJSON(),
13799		autorest.AsGet(),
13800		autorest.WithBaseURL(to.String(plrlr.NextLink)))
13801}
13802
13803// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values.
13804type PrivateLinkResourceListResultPage struct {
13805	fn    func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)
13806	plrlr PrivateLinkResourceListResult
13807}
13808
13809// NextWithContext advances to the next page of values.  If there was an error making
13810// the request the page does not advance and the error is returned.
13811func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
13812	if tracing.IsEnabled() {
13813		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext")
13814		defer func() {
13815			sc := -1
13816			if page.Response().Response.Response != nil {
13817				sc = page.Response().Response.Response.StatusCode
13818			}
13819			tracing.EndSpan(ctx, sc, err)
13820		}()
13821	}
13822	for {
13823		next, err := page.fn(ctx, page.plrlr)
13824		if err != nil {
13825			return err
13826		}
13827		page.plrlr = next
13828		if !next.hasNextLink() || !next.IsEmpty() {
13829			break
13830		}
13831	}
13832	return nil
13833}
13834
13835// Next advances to the next page of values.  If there was an error making
13836// the request the page does not advance and the error is returned.
13837// Deprecated: Use NextWithContext() instead.
13838func (page *PrivateLinkResourceListResultPage) Next() error {
13839	return page.NextWithContext(context.Background())
13840}
13841
13842// NotDone returns true if the page enumeration should be started or is not yet complete.
13843func (page PrivateLinkResourceListResultPage) NotDone() bool {
13844	return !page.plrlr.IsEmpty()
13845}
13846
13847// Response returns the raw server response from the last page request.
13848func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult {
13849	return page.plrlr
13850}
13851
13852// Values returns the slice of values for the current page or nil if there are no values.
13853func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource {
13854	if page.plrlr.IsEmpty() {
13855		return nil
13856	}
13857	return *page.plrlr.Value
13858}
13859
13860// Creates a new instance of the PrivateLinkResourceListResultPage type.
13861func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage {
13862	return PrivateLinkResourceListResultPage{
13863		fn:    getNextPage,
13864		plrlr: cur,
13865	}
13866}
13867
13868// PrivateLinkResourceProperties properties of a private link resource.
13869type PrivateLinkResourceProperties struct {
13870	// GroupID - READ-ONLY; The private link resource group id.
13871	GroupID *string `json:"groupId,omitempty"`
13872	// RequiredMembers - READ-ONLY; The private link resource required member names.
13873	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
13874}
13875
13876// PrivateLinkServiceConnectionStateProperty ...
13877type PrivateLinkServiceConnectionStateProperty struct {
13878	// Status - The private link service connection status. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected'
13879	Status PrivateLinkServiceConnectionStateStatus `json:"status,omitempty"`
13880	// Description - The private link service connection description.
13881	Description *string `json:"description,omitempty"`
13882	// ActionsRequired - READ-ONLY; The actions required for private link service connection. Possible values include: 'PrivateLinkServiceConnectionStateActionsRequireNone'
13883	ActionsRequired PrivateLinkServiceConnectionStateActionsRequire `json:"actionsRequired,omitempty"`
13884}
13885
13886// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty.
13887func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
13888	objectMap := make(map[string]interface{})
13889	if plscsp.Status != "" {
13890		objectMap["status"] = plscsp.Status
13891	}
13892	if plscsp.Description != nil {
13893		objectMap["description"] = plscsp.Description
13894	}
13895	return json.Marshal(objectMap)
13896}
13897
13898// ProxyResource ARM proxy resource.
13899type ProxyResource struct {
13900	// ID - READ-ONLY; Resource ID.
13901	ID *string `json:"id,omitempty"`
13902	// Name - READ-ONLY; Resource name.
13903	Name *string `json:"name,omitempty"`
13904	// Type - READ-ONLY; Resource type.
13905	Type *string `json:"type,omitempty"`
13906}
13907
13908// ReadScaleCapability the read scale capability.
13909type ReadScaleCapability struct {
13910	// MaxNumberOfReplicas - READ-ONLY; The maximum number of read scale replicas.
13911	MaxNumberOfReplicas *int32 `json:"maxNumberOfReplicas,omitempty"`
13912	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
13913	Status CapabilityStatus `json:"status,omitempty"`
13914	// Reason - The reason for the capability not being available.
13915	Reason *string `json:"reason,omitempty"`
13916}
13917
13918// MarshalJSON is the custom marshaler for ReadScaleCapability.
13919func (rsc ReadScaleCapability) MarshalJSON() ([]byte, error) {
13920	objectMap := make(map[string]interface{})
13921	if rsc.Reason != nil {
13922		objectMap["reason"] = rsc.Reason
13923	}
13924	return json.Marshal(objectMap)
13925}
13926
13927// RecommendedElasticPool represents a recommended elastic pool.
13928type RecommendedElasticPool struct {
13929	autorest.Response `json:"-"`
13930	// RecommendedElasticPoolProperties - The properties representing the resource.
13931	*RecommendedElasticPoolProperties `json:"properties,omitempty"`
13932	// ID - READ-ONLY; Resource ID.
13933	ID *string `json:"id,omitempty"`
13934	// Name - READ-ONLY; Resource name.
13935	Name *string `json:"name,omitempty"`
13936	// Type - READ-ONLY; Resource type.
13937	Type *string `json:"type,omitempty"`
13938}
13939
13940// MarshalJSON is the custom marshaler for RecommendedElasticPool.
13941func (rep RecommendedElasticPool) MarshalJSON() ([]byte, error) {
13942	objectMap := make(map[string]interface{})
13943	if rep.RecommendedElasticPoolProperties != nil {
13944		objectMap["properties"] = rep.RecommendedElasticPoolProperties
13945	}
13946	return json.Marshal(objectMap)
13947}
13948
13949// UnmarshalJSON is the custom unmarshaler for RecommendedElasticPool struct.
13950func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error {
13951	var m map[string]*json.RawMessage
13952	err := json.Unmarshal(body, &m)
13953	if err != nil {
13954		return err
13955	}
13956	for k, v := range m {
13957		switch k {
13958		case "properties":
13959			if v != nil {
13960				var recommendedElasticPoolProperties RecommendedElasticPoolProperties
13961				err = json.Unmarshal(*v, &recommendedElasticPoolProperties)
13962				if err != nil {
13963					return err
13964				}
13965				rep.RecommendedElasticPoolProperties = &recommendedElasticPoolProperties
13966			}
13967		case "id":
13968			if v != nil {
13969				var ID string
13970				err = json.Unmarshal(*v, &ID)
13971				if err != nil {
13972					return err
13973				}
13974				rep.ID = &ID
13975			}
13976		case "name":
13977			if v != nil {
13978				var name string
13979				err = json.Unmarshal(*v, &name)
13980				if err != nil {
13981					return err
13982				}
13983				rep.Name = &name
13984			}
13985		case "type":
13986			if v != nil {
13987				var typeVar string
13988				err = json.Unmarshal(*v, &typeVar)
13989				if err != nil {
13990					return err
13991				}
13992				rep.Type = &typeVar
13993			}
13994		}
13995	}
13996
13997	return nil
13998}
13999
14000// RecommendedElasticPoolListMetricsResult represents the response to a list recommended elastic pool
14001// metrics request.
14002type RecommendedElasticPoolListMetricsResult struct {
14003	autorest.Response `json:"-"`
14004	// Value - The list of recommended elastic pools metrics.
14005	Value *[]RecommendedElasticPoolMetric `json:"value,omitempty"`
14006}
14007
14008// RecommendedElasticPoolListResult represents the response to a list recommended elastic pool request.
14009type RecommendedElasticPoolListResult struct {
14010	autorest.Response `json:"-"`
14011	// Value - The list of recommended elastic pools hosted in the server.
14012	Value *[]RecommendedElasticPool `json:"value,omitempty"`
14013}
14014
14015// RecommendedElasticPoolMetric represents recommended elastic pool metric.
14016type RecommendedElasticPoolMetric struct {
14017	// DateTime - The time of metric (ISO8601 format).
14018	DateTime *date.Time `json:"dateTime,omitempty"`
14019	// Dtu - Gets or sets the DTUs (Database Transaction Units). See https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/
14020	Dtu *float64 `json:"dtu,omitempty"`
14021	// SizeGB - Gets or sets size in gigabytes.
14022	SizeGB *float64 `json:"sizeGB,omitempty"`
14023}
14024
14025// RecommendedElasticPoolProperties represents the properties of a recommended elastic pool.
14026type RecommendedElasticPoolProperties struct {
14027	// 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'
14028	DatabaseEdition ElasticPoolEdition `json:"databaseEdition,omitempty"`
14029	// Dtu - The DTU for the recommended elastic pool.
14030	Dtu *float64 `json:"dtu,omitempty"`
14031	// DatabaseDtuMin - The minimum DTU for the database.
14032	DatabaseDtuMin *float64 `json:"databaseDtuMin,omitempty"`
14033	// DatabaseDtuMax - The maximum DTU for the database.
14034	DatabaseDtuMax *float64 `json:"databaseDtuMax,omitempty"`
14035	// StorageMB - Gets storage size in megabytes.
14036	StorageMB *float64 `json:"storageMB,omitempty"`
14037	// ObservationPeriodStart - READ-ONLY; The observation period start (ISO8601 format).
14038	ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"`
14039	// ObservationPeriodEnd - READ-ONLY; The observation period start (ISO8601 format).
14040	ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"`
14041	// MaxObservedDtu - READ-ONLY; Gets maximum observed DTU.
14042	MaxObservedDtu *float64 `json:"maxObservedDtu,omitempty"`
14043	// MaxObservedStorageMB - READ-ONLY; Gets maximum observed storage in megabytes.
14044	MaxObservedStorageMB *float64 `json:"maxObservedStorageMB,omitempty"`
14045	// Databases - READ-ONLY; The list of databases in this pool. Expanded property
14046	Databases *[]TrackedResource `json:"databases,omitempty"`
14047	// Metrics - READ-ONLY; The list of databases housed in the server. Expanded property
14048	Metrics *[]RecommendedElasticPoolMetric `json:"metrics,omitempty"`
14049}
14050
14051// MarshalJSON is the custom marshaler for RecommendedElasticPoolProperties.
14052func (repp RecommendedElasticPoolProperties) MarshalJSON() ([]byte, error) {
14053	objectMap := make(map[string]interface{})
14054	if repp.Dtu != nil {
14055		objectMap["dtu"] = repp.Dtu
14056	}
14057	if repp.DatabaseDtuMin != nil {
14058		objectMap["databaseDtuMin"] = repp.DatabaseDtuMin
14059	}
14060	if repp.DatabaseDtuMax != nil {
14061		objectMap["databaseDtuMax"] = repp.DatabaseDtuMax
14062	}
14063	if repp.StorageMB != nil {
14064		objectMap["storageMB"] = repp.StorageMB
14065	}
14066	return json.Marshal(objectMap)
14067}
14068
14069// RecommendedIndex represents a database recommended index.
14070type RecommendedIndex struct {
14071	// RecommendedIndexProperties - READ-ONLY; The properties representing the resource.
14072	*RecommendedIndexProperties `json:"properties,omitempty"`
14073	// ID - READ-ONLY; Resource ID.
14074	ID *string `json:"id,omitempty"`
14075	// Name - READ-ONLY; Resource name.
14076	Name *string `json:"name,omitempty"`
14077	// Type - READ-ONLY; Resource type.
14078	Type *string `json:"type,omitempty"`
14079}
14080
14081// MarshalJSON is the custom marshaler for RecommendedIndex.
14082func (ri RecommendedIndex) MarshalJSON() ([]byte, error) {
14083	objectMap := make(map[string]interface{})
14084	return json.Marshal(objectMap)
14085}
14086
14087// UnmarshalJSON is the custom unmarshaler for RecommendedIndex struct.
14088func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error {
14089	var m map[string]*json.RawMessage
14090	err := json.Unmarshal(body, &m)
14091	if err != nil {
14092		return err
14093	}
14094	for k, v := range m {
14095		switch k {
14096		case "properties":
14097			if v != nil {
14098				var recommendedIndexProperties RecommendedIndexProperties
14099				err = json.Unmarshal(*v, &recommendedIndexProperties)
14100				if err != nil {
14101					return err
14102				}
14103				ri.RecommendedIndexProperties = &recommendedIndexProperties
14104			}
14105		case "id":
14106			if v != nil {
14107				var ID string
14108				err = json.Unmarshal(*v, &ID)
14109				if err != nil {
14110					return err
14111				}
14112				ri.ID = &ID
14113			}
14114		case "name":
14115			if v != nil {
14116				var name string
14117				err = json.Unmarshal(*v, &name)
14118				if err != nil {
14119					return err
14120				}
14121				ri.Name = &name
14122			}
14123		case "type":
14124			if v != nil {
14125				var typeVar string
14126				err = json.Unmarshal(*v, &typeVar)
14127				if err != nil {
14128					return err
14129				}
14130				ri.Type = &typeVar
14131			}
14132		}
14133	}
14134
14135	return nil
14136}
14137
14138// RecommendedIndexProperties represents the properties of a database recommended index.
14139type RecommendedIndexProperties struct {
14140	// 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'
14141	Action RecommendedIndexAction `json:"action,omitempty"`
14142	// State - READ-ONLY; The current recommendation state. Possible values include: 'RecommendedIndexStateActive', 'RecommendedIndexStatePending', 'RecommendedIndexStateExecuting', 'RecommendedIndexStateVerifying', 'RecommendedIndexStatePendingRevert', 'RecommendedIndexStateReverting', 'RecommendedIndexStateReverted', 'RecommendedIndexStateIgnored', 'RecommendedIndexStateExpired', 'RecommendedIndexStateBlocked', 'RecommendedIndexStateSuccess'
14143	State RecommendedIndexState `json:"state,omitempty"`
14144	// Created - READ-ONLY; The UTC datetime showing when this resource was created (ISO8601 format).
14145	Created *date.Time `json:"created,omitempty"`
14146	// LastModified - READ-ONLY; The UTC datetime of when was this resource last changed (ISO8601 format).
14147	LastModified *date.Time `json:"lastModified,omitempty"`
14148	// IndexType - READ-ONLY; The type of index (CLUSTERED, NONCLUSTERED, COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTEREDCOLUMNSTORE'
14149	IndexType RecommendedIndexType `json:"indexType,omitempty"`
14150	// Schema - READ-ONLY; The schema where table to build index over resides
14151	Schema *string `json:"schema,omitempty"`
14152	// Table - READ-ONLY; The table on which to build index.
14153	Table *string `json:"table,omitempty"`
14154	// Columns - READ-ONLY; Columns over which to build index
14155	Columns *[]string `json:"columns,omitempty"`
14156	// IncludedColumns - READ-ONLY; The list of column names to be included in the index
14157	IncludedColumns *[]string `json:"includedColumns,omitempty"`
14158	// IndexScript - READ-ONLY; The full build index script
14159	IndexScript *string `json:"indexScript,omitempty"`
14160	// EstimatedImpact - READ-ONLY; The estimated impact of doing recommended index action.
14161	EstimatedImpact *[]OperationImpact `json:"estimatedImpact,omitempty"`
14162	// ReportedImpact - READ-ONLY; The values reported after index action is complete.
14163	ReportedImpact *[]OperationImpact `json:"reportedImpact,omitempty"`
14164}
14165
14166// RecoverableDatabase a recoverable database
14167type RecoverableDatabase struct {
14168	autorest.Response `json:"-"`
14169	// RecoverableDatabaseProperties - The properties of a recoverable database
14170	*RecoverableDatabaseProperties `json:"properties,omitempty"`
14171	// ID - READ-ONLY; Resource ID.
14172	ID *string `json:"id,omitempty"`
14173	// Name - READ-ONLY; Resource name.
14174	Name *string `json:"name,omitempty"`
14175	// Type - READ-ONLY; Resource type.
14176	Type *string `json:"type,omitempty"`
14177}
14178
14179// MarshalJSON is the custom marshaler for RecoverableDatabase.
14180func (rd RecoverableDatabase) MarshalJSON() ([]byte, error) {
14181	objectMap := make(map[string]interface{})
14182	if rd.RecoverableDatabaseProperties != nil {
14183		objectMap["properties"] = rd.RecoverableDatabaseProperties
14184	}
14185	return json.Marshal(objectMap)
14186}
14187
14188// UnmarshalJSON is the custom unmarshaler for RecoverableDatabase struct.
14189func (rd *RecoverableDatabase) UnmarshalJSON(body []byte) error {
14190	var m map[string]*json.RawMessage
14191	err := json.Unmarshal(body, &m)
14192	if err != nil {
14193		return err
14194	}
14195	for k, v := range m {
14196		switch k {
14197		case "properties":
14198			if v != nil {
14199				var recoverableDatabaseProperties RecoverableDatabaseProperties
14200				err = json.Unmarshal(*v, &recoverableDatabaseProperties)
14201				if err != nil {
14202					return err
14203				}
14204				rd.RecoverableDatabaseProperties = &recoverableDatabaseProperties
14205			}
14206		case "id":
14207			if v != nil {
14208				var ID string
14209				err = json.Unmarshal(*v, &ID)
14210				if err != nil {
14211					return err
14212				}
14213				rd.ID = &ID
14214			}
14215		case "name":
14216			if v != nil {
14217				var name string
14218				err = json.Unmarshal(*v, &name)
14219				if err != nil {
14220					return err
14221				}
14222				rd.Name = &name
14223			}
14224		case "type":
14225			if v != nil {
14226				var typeVar string
14227				err = json.Unmarshal(*v, &typeVar)
14228				if err != nil {
14229					return err
14230				}
14231				rd.Type = &typeVar
14232			}
14233		}
14234	}
14235
14236	return nil
14237}
14238
14239// RecoverableDatabaseListResult the response to a list recoverable databases request
14240type RecoverableDatabaseListResult struct {
14241	autorest.Response `json:"-"`
14242	// Value - A list of recoverable databases
14243	Value *[]RecoverableDatabase `json:"value,omitempty"`
14244}
14245
14246// RecoverableDatabaseProperties the properties of a recoverable database
14247type RecoverableDatabaseProperties struct {
14248	// Edition - READ-ONLY; The edition of the database
14249	Edition *string `json:"edition,omitempty"`
14250	// ServiceLevelObjective - READ-ONLY; The service level objective name of the database
14251	ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"`
14252	// ElasticPoolName - READ-ONLY; The elastic pool name of the database
14253	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
14254	// LastAvailableBackupDate - READ-ONLY; The last available backup date of the database (ISO8601 format)
14255	LastAvailableBackupDate *date.Time `json:"lastAvailableBackupDate,omitempty"`
14256}
14257
14258// RecoverableManagedDatabase a recoverable managed database resource.
14259type RecoverableManagedDatabase struct {
14260	autorest.Response `json:"-"`
14261	// RecoverableManagedDatabaseProperties - Resource properties.
14262	*RecoverableManagedDatabaseProperties `json:"properties,omitempty"`
14263	// ID - READ-ONLY; Resource ID.
14264	ID *string `json:"id,omitempty"`
14265	// Name - READ-ONLY; Resource name.
14266	Name *string `json:"name,omitempty"`
14267	// Type - READ-ONLY; Resource type.
14268	Type *string `json:"type,omitempty"`
14269}
14270
14271// MarshalJSON is the custom marshaler for RecoverableManagedDatabase.
14272func (rmd RecoverableManagedDatabase) MarshalJSON() ([]byte, error) {
14273	objectMap := make(map[string]interface{})
14274	if rmd.RecoverableManagedDatabaseProperties != nil {
14275		objectMap["properties"] = rmd.RecoverableManagedDatabaseProperties
14276	}
14277	return json.Marshal(objectMap)
14278}
14279
14280// UnmarshalJSON is the custom unmarshaler for RecoverableManagedDatabase struct.
14281func (rmd *RecoverableManagedDatabase) UnmarshalJSON(body []byte) error {
14282	var m map[string]*json.RawMessage
14283	err := json.Unmarshal(body, &m)
14284	if err != nil {
14285		return err
14286	}
14287	for k, v := range m {
14288		switch k {
14289		case "properties":
14290			if v != nil {
14291				var recoverableManagedDatabaseProperties RecoverableManagedDatabaseProperties
14292				err = json.Unmarshal(*v, &recoverableManagedDatabaseProperties)
14293				if err != nil {
14294					return err
14295				}
14296				rmd.RecoverableManagedDatabaseProperties = &recoverableManagedDatabaseProperties
14297			}
14298		case "id":
14299			if v != nil {
14300				var ID string
14301				err = json.Unmarshal(*v, &ID)
14302				if err != nil {
14303					return err
14304				}
14305				rmd.ID = &ID
14306			}
14307		case "name":
14308			if v != nil {
14309				var name string
14310				err = json.Unmarshal(*v, &name)
14311				if err != nil {
14312					return err
14313				}
14314				rmd.Name = &name
14315			}
14316		case "type":
14317			if v != nil {
14318				var typeVar string
14319				err = json.Unmarshal(*v, &typeVar)
14320				if err != nil {
14321					return err
14322				}
14323				rmd.Type = &typeVar
14324			}
14325		}
14326	}
14327
14328	return nil
14329}
14330
14331// RecoverableManagedDatabaseListResult a list of recoverable managed databases.
14332type RecoverableManagedDatabaseListResult struct {
14333	autorest.Response `json:"-"`
14334	// Value - READ-ONLY; Array of results.
14335	Value *[]RecoverableManagedDatabase `json:"value,omitempty"`
14336	// NextLink - READ-ONLY; Link to retrieve next page of results.
14337	NextLink *string `json:"nextLink,omitempty"`
14338}
14339
14340// RecoverableManagedDatabaseListResultIterator provides access to a complete listing of
14341// RecoverableManagedDatabase values.
14342type RecoverableManagedDatabaseListResultIterator struct {
14343	i    int
14344	page RecoverableManagedDatabaseListResultPage
14345}
14346
14347// NextWithContext advances to the next value.  If there was an error making
14348// the request the iterator does not advance and the error is returned.
14349func (iter *RecoverableManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
14350	if tracing.IsEnabled() {
14351		ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabaseListResultIterator.NextWithContext")
14352		defer func() {
14353			sc := -1
14354			if iter.Response().Response.Response != nil {
14355				sc = iter.Response().Response.Response.StatusCode
14356			}
14357			tracing.EndSpan(ctx, sc, err)
14358		}()
14359	}
14360	iter.i++
14361	if iter.i < len(iter.page.Values()) {
14362		return nil
14363	}
14364	err = iter.page.NextWithContext(ctx)
14365	if err != nil {
14366		iter.i--
14367		return err
14368	}
14369	iter.i = 0
14370	return nil
14371}
14372
14373// Next advances to the next value.  If there was an error making
14374// the request the iterator does not advance and the error is returned.
14375// Deprecated: Use NextWithContext() instead.
14376func (iter *RecoverableManagedDatabaseListResultIterator) Next() error {
14377	return iter.NextWithContext(context.Background())
14378}
14379
14380// NotDone returns true if the enumeration should be started or is not yet complete.
14381func (iter RecoverableManagedDatabaseListResultIterator) NotDone() bool {
14382	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14383}
14384
14385// Response returns the raw server response from the last page request.
14386func (iter RecoverableManagedDatabaseListResultIterator) Response() RecoverableManagedDatabaseListResult {
14387	return iter.page.Response()
14388}
14389
14390// Value returns the current value or a zero-initialized value if the
14391// iterator has advanced beyond the end of the collection.
14392func (iter RecoverableManagedDatabaseListResultIterator) Value() RecoverableManagedDatabase {
14393	if !iter.page.NotDone() {
14394		return RecoverableManagedDatabase{}
14395	}
14396	return iter.page.Values()[iter.i]
14397}
14398
14399// Creates a new instance of the RecoverableManagedDatabaseListResultIterator type.
14400func NewRecoverableManagedDatabaseListResultIterator(page RecoverableManagedDatabaseListResultPage) RecoverableManagedDatabaseListResultIterator {
14401	return RecoverableManagedDatabaseListResultIterator{page: page}
14402}
14403
14404// IsEmpty returns true if the ListResult contains no values.
14405func (rmdlr RecoverableManagedDatabaseListResult) IsEmpty() bool {
14406	return rmdlr.Value == nil || len(*rmdlr.Value) == 0
14407}
14408
14409// hasNextLink returns true if the NextLink is not empty.
14410func (rmdlr RecoverableManagedDatabaseListResult) hasNextLink() bool {
14411	return rmdlr.NextLink != nil && len(*rmdlr.NextLink) != 0
14412}
14413
14414// recoverableManagedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
14415// It returns nil if no more results exist.
14416func (rmdlr RecoverableManagedDatabaseListResult) recoverableManagedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
14417	if !rmdlr.hasNextLink() {
14418		return nil, nil
14419	}
14420	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14421		autorest.AsJSON(),
14422		autorest.AsGet(),
14423		autorest.WithBaseURL(to.String(rmdlr.NextLink)))
14424}
14425
14426// RecoverableManagedDatabaseListResultPage contains a page of RecoverableManagedDatabase values.
14427type RecoverableManagedDatabaseListResultPage struct {
14428	fn    func(context.Context, RecoverableManagedDatabaseListResult) (RecoverableManagedDatabaseListResult, error)
14429	rmdlr RecoverableManagedDatabaseListResult
14430}
14431
14432// NextWithContext advances to the next page of values.  If there was an error making
14433// the request the page does not advance and the error is returned.
14434func (page *RecoverableManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
14435	if tracing.IsEnabled() {
14436		ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabaseListResultPage.NextWithContext")
14437		defer func() {
14438			sc := -1
14439			if page.Response().Response.Response != nil {
14440				sc = page.Response().Response.Response.StatusCode
14441			}
14442			tracing.EndSpan(ctx, sc, err)
14443		}()
14444	}
14445	for {
14446		next, err := page.fn(ctx, page.rmdlr)
14447		if err != nil {
14448			return err
14449		}
14450		page.rmdlr = next
14451		if !next.hasNextLink() || !next.IsEmpty() {
14452			break
14453		}
14454	}
14455	return nil
14456}
14457
14458// Next advances to the next page of values.  If there was an error making
14459// the request the page does not advance and the error is returned.
14460// Deprecated: Use NextWithContext() instead.
14461func (page *RecoverableManagedDatabaseListResultPage) Next() error {
14462	return page.NextWithContext(context.Background())
14463}
14464
14465// NotDone returns true if the page enumeration should be started or is not yet complete.
14466func (page RecoverableManagedDatabaseListResultPage) NotDone() bool {
14467	return !page.rmdlr.IsEmpty()
14468}
14469
14470// Response returns the raw server response from the last page request.
14471func (page RecoverableManagedDatabaseListResultPage) Response() RecoverableManagedDatabaseListResult {
14472	return page.rmdlr
14473}
14474
14475// Values returns the slice of values for the current page or nil if there are no values.
14476func (page RecoverableManagedDatabaseListResultPage) Values() []RecoverableManagedDatabase {
14477	if page.rmdlr.IsEmpty() {
14478		return nil
14479	}
14480	return *page.rmdlr.Value
14481}
14482
14483// Creates a new instance of the RecoverableManagedDatabaseListResultPage type.
14484func NewRecoverableManagedDatabaseListResultPage(cur RecoverableManagedDatabaseListResult, getNextPage func(context.Context, RecoverableManagedDatabaseListResult) (RecoverableManagedDatabaseListResult, error)) RecoverableManagedDatabaseListResultPage {
14485	return RecoverableManagedDatabaseListResultPage{
14486		fn:    getNextPage,
14487		rmdlr: cur,
14488	}
14489}
14490
14491// RecoverableManagedDatabaseProperties the recoverable managed database's properties.
14492type RecoverableManagedDatabaseProperties struct {
14493	// LastAvailableBackupDate - READ-ONLY; The last available backup date.
14494	LastAvailableBackupDate *string `json:"lastAvailableBackupDate,omitempty"`
14495}
14496
14497// ReplicationLink represents a database replication link.
14498type ReplicationLink struct {
14499	autorest.Response `json:"-"`
14500	// Location - READ-ONLY; Location of the server that contains this firewall rule.
14501	Location *string `json:"location,omitempty"`
14502	// ReplicationLinkProperties - The properties representing the resource.
14503	*ReplicationLinkProperties `json:"properties,omitempty"`
14504	// ID - READ-ONLY; Resource ID.
14505	ID *string `json:"id,omitempty"`
14506	// Name - READ-ONLY; Resource name.
14507	Name *string `json:"name,omitempty"`
14508	// Type - READ-ONLY; Resource type.
14509	Type *string `json:"type,omitempty"`
14510}
14511
14512// MarshalJSON is the custom marshaler for ReplicationLink.
14513func (rl ReplicationLink) MarshalJSON() ([]byte, error) {
14514	objectMap := make(map[string]interface{})
14515	if rl.ReplicationLinkProperties != nil {
14516		objectMap["properties"] = rl.ReplicationLinkProperties
14517	}
14518	return json.Marshal(objectMap)
14519}
14520
14521// UnmarshalJSON is the custom unmarshaler for ReplicationLink struct.
14522func (rl *ReplicationLink) UnmarshalJSON(body []byte) error {
14523	var m map[string]*json.RawMessage
14524	err := json.Unmarshal(body, &m)
14525	if err != nil {
14526		return err
14527	}
14528	for k, v := range m {
14529		switch k {
14530		case "location":
14531			if v != nil {
14532				var location string
14533				err = json.Unmarshal(*v, &location)
14534				if err != nil {
14535					return err
14536				}
14537				rl.Location = &location
14538			}
14539		case "properties":
14540			if v != nil {
14541				var replicationLinkProperties ReplicationLinkProperties
14542				err = json.Unmarshal(*v, &replicationLinkProperties)
14543				if err != nil {
14544					return err
14545				}
14546				rl.ReplicationLinkProperties = &replicationLinkProperties
14547			}
14548		case "id":
14549			if v != nil {
14550				var ID string
14551				err = json.Unmarshal(*v, &ID)
14552				if err != nil {
14553					return err
14554				}
14555				rl.ID = &ID
14556			}
14557		case "name":
14558			if v != nil {
14559				var name string
14560				err = json.Unmarshal(*v, &name)
14561				if err != nil {
14562					return err
14563				}
14564				rl.Name = &name
14565			}
14566		case "type":
14567			if v != nil {
14568				var typeVar string
14569				err = json.Unmarshal(*v, &typeVar)
14570				if err != nil {
14571					return err
14572				}
14573				rl.Type = &typeVar
14574			}
14575		}
14576	}
14577
14578	return nil
14579}
14580
14581// ReplicationLinkListResult represents the response to a List database replication link request.
14582type ReplicationLinkListResult struct {
14583	autorest.Response `json:"-"`
14584	// Value - The list of database replication links housed in the database.
14585	Value *[]ReplicationLink `json:"value,omitempty"`
14586}
14587
14588// ReplicationLinkProperties represents the properties of a database replication link.
14589type ReplicationLinkProperties struct {
14590	// IsTerminationAllowed - READ-ONLY; Legacy value indicating whether termination is allowed.  Currently always returns true.
14591	IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty"`
14592	// ReplicationMode - READ-ONLY; Replication mode of this replication link.
14593	ReplicationMode *string `json:"replicationMode,omitempty"`
14594	// PartnerServer - READ-ONLY; The name of the server hosting the partner database.
14595	PartnerServer *string `json:"partnerServer,omitempty"`
14596	// PartnerDatabase - READ-ONLY; The name of the partner database.
14597	PartnerDatabase *string `json:"partnerDatabase,omitempty"`
14598	// PartnerLocation - READ-ONLY; The Azure Region of the partner database.
14599	PartnerLocation *string `json:"partnerLocation,omitempty"`
14600	// Role - READ-ONLY; The role of the database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy'
14601	Role ReplicationRole `json:"role,omitempty"`
14602	// PartnerRole - READ-ONLY; The role of the partner database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy'
14603	PartnerRole ReplicationRole `json:"partnerRole,omitempty"`
14604	// StartTime - READ-ONLY; The start time for the replication link.
14605	StartTime *date.Time `json:"startTime,omitempty"`
14606	// PercentComplete - READ-ONLY; The percentage of seeding complete for the replication link.
14607	PercentComplete *int32 `json:"percentComplete,omitempty"`
14608	// ReplicationState - READ-ONLY; The replication state for the replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCHUP', 'SUSPENDED'
14609	ReplicationState ReplicationState `json:"replicationState,omitempty"`
14610}
14611
14612// ReplicationLinksFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results of
14613// a long-running operation.
14614type ReplicationLinksFailoverAllowDataLossFuture 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(ReplicationLinksClient) (autorest.Response, error)
14619}
14620
14621// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a
14622// long-running operation.
14623type ReplicationLinksFailoverFuture struct {
14624	azure.FutureAPI
14625	// Result returns the result of the asynchronous operation.
14626	// If the operation has not completed it will return an error.
14627	Result func(ReplicationLinksClient) (autorest.Response, error)
14628}
14629
14630// ReplicationLinksUnlinkFuture an abstraction for monitoring and retrieving the results of a long-running
14631// operation.
14632type ReplicationLinksUnlinkFuture struct {
14633	azure.FutureAPI
14634	// Result returns the result of the asynchronous operation.
14635	// If the operation has not completed it will return an error.
14636	Result func(ReplicationLinksClient) (autorest.Response, error)
14637}
14638
14639// Resource ARM resource.
14640type Resource struct {
14641	// ID - READ-ONLY; Resource ID.
14642	ID *string `json:"id,omitempty"`
14643	// Name - READ-ONLY; Resource name.
14644	Name *string `json:"name,omitempty"`
14645	// Type - READ-ONLY; Resource type.
14646	Type *string `json:"type,omitempty"`
14647}
14648
14649// ResourceIdentity azure Active Directory identity configuration for a resource.
14650type ResourceIdentity struct {
14651	// PrincipalID - READ-ONLY; The Azure Active Directory principal id.
14652	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
14653	// Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'SystemAssigned'
14654	Type IdentityType `json:"type,omitempty"`
14655	// TenantID - READ-ONLY; The Azure Active Directory tenant id.
14656	TenantID *uuid.UUID `json:"tenantId,omitempty"`
14657}
14658
14659// MarshalJSON is the custom marshaler for ResourceIdentity.
14660func (ri ResourceIdentity) MarshalJSON() ([]byte, error) {
14661	objectMap := make(map[string]interface{})
14662	if ri.Type != "" {
14663		objectMap["type"] = ri.Type
14664	}
14665	return json.Marshal(objectMap)
14666}
14667
14668// ResourceMoveDefinition contains the information necessary to perform a resource move (rename).
14669type ResourceMoveDefinition struct {
14670	// ID - The target ID for the resource
14671	ID *string `json:"id,omitempty"`
14672}
14673
14674// RestorableDroppedDatabase a restorable dropped database
14675type RestorableDroppedDatabase struct {
14676	autorest.Response `json:"-"`
14677	// Location - READ-ONLY; The geo-location where the resource lives
14678	Location *string `json:"location,omitempty"`
14679	// RestorableDroppedDatabaseProperties - The properties of a restorable dropped database
14680	*RestorableDroppedDatabaseProperties `json:"properties,omitempty"`
14681	// ID - READ-ONLY; Resource ID.
14682	ID *string `json:"id,omitempty"`
14683	// Name - READ-ONLY; Resource name.
14684	Name *string `json:"name,omitempty"`
14685	// Type - READ-ONLY; Resource type.
14686	Type *string `json:"type,omitempty"`
14687}
14688
14689// MarshalJSON is the custom marshaler for RestorableDroppedDatabase.
14690func (rdd RestorableDroppedDatabase) MarshalJSON() ([]byte, error) {
14691	objectMap := make(map[string]interface{})
14692	if rdd.RestorableDroppedDatabaseProperties != nil {
14693		objectMap["properties"] = rdd.RestorableDroppedDatabaseProperties
14694	}
14695	return json.Marshal(objectMap)
14696}
14697
14698// UnmarshalJSON is the custom unmarshaler for RestorableDroppedDatabase struct.
14699func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error {
14700	var m map[string]*json.RawMessage
14701	err := json.Unmarshal(body, &m)
14702	if err != nil {
14703		return err
14704	}
14705	for k, v := range m {
14706		switch k {
14707		case "location":
14708			if v != nil {
14709				var location string
14710				err = json.Unmarshal(*v, &location)
14711				if err != nil {
14712					return err
14713				}
14714				rdd.Location = &location
14715			}
14716		case "properties":
14717			if v != nil {
14718				var restorableDroppedDatabaseProperties RestorableDroppedDatabaseProperties
14719				err = json.Unmarshal(*v, &restorableDroppedDatabaseProperties)
14720				if err != nil {
14721					return err
14722				}
14723				rdd.RestorableDroppedDatabaseProperties = &restorableDroppedDatabaseProperties
14724			}
14725		case "id":
14726			if v != nil {
14727				var ID string
14728				err = json.Unmarshal(*v, &ID)
14729				if err != nil {
14730					return err
14731				}
14732				rdd.ID = &ID
14733			}
14734		case "name":
14735			if v != nil {
14736				var name string
14737				err = json.Unmarshal(*v, &name)
14738				if err != nil {
14739					return err
14740				}
14741				rdd.Name = &name
14742			}
14743		case "type":
14744			if v != nil {
14745				var typeVar string
14746				err = json.Unmarshal(*v, &typeVar)
14747				if err != nil {
14748					return err
14749				}
14750				rdd.Type = &typeVar
14751			}
14752		}
14753	}
14754
14755	return nil
14756}
14757
14758// RestorableDroppedDatabaseListResult the response to a list restorable dropped databases request
14759type RestorableDroppedDatabaseListResult struct {
14760	autorest.Response `json:"-"`
14761	// Value - A list of restorable dropped databases
14762	Value *[]RestorableDroppedDatabase `json:"value,omitempty"`
14763}
14764
14765// RestorableDroppedDatabaseProperties the properties of a restorable dropped database
14766type RestorableDroppedDatabaseProperties struct {
14767	// DatabaseName - READ-ONLY; The name of the database
14768	DatabaseName *string `json:"databaseName,omitempty"`
14769	// Edition - READ-ONLY; The edition of the database
14770	Edition *string `json:"edition,omitempty"`
14771	// MaxSizeBytes - READ-ONLY; The max size in bytes of the database
14772	MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`
14773	// ServiceLevelObjective - READ-ONLY; The service level objective name of the database
14774	ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"`
14775	// ElasticPoolName - READ-ONLY; The elastic pool name of the database
14776	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
14777	// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format)
14778	CreationDate *date.Time `json:"creationDate,omitempty"`
14779	// DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format)
14780	DeletionDate *date.Time `json:"deletionDate,omitempty"`
14781	// EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format)
14782	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
14783}
14784
14785// RestorableDroppedManagedDatabase a restorable dropped managed database resource.
14786type RestorableDroppedManagedDatabase struct {
14787	autorest.Response `json:"-"`
14788	// RestorableDroppedManagedDatabaseProperties - Resource properties.
14789	*RestorableDroppedManagedDatabaseProperties `json:"properties,omitempty"`
14790	// Location - Resource location.
14791	Location *string `json:"location,omitempty"`
14792	// Tags - Resource tags.
14793	Tags map[string]*string `json:"tags"`
14794	// ID - READ-ONLY; Resource ID.
14795	ID *string `json:"id,omitempty"`
14796	// Name - READ-ONLY; Resource name.
14797	Name *string `json:"name,omitempty"`
14798	// Type - READ-ONLY; Resource type.
14799	Type *string `json:"type,omitempty"`
14800}
14801
14802// MarshalJSON is the custom marshaler for RestorableDroppedManagedDatabase.
14803func (rdmd RestorableDroppedManagedDatabase) MarshalJSON() ([]byte, error) {
14804	objectMap := make(map[string]interface{})
14805	if rdmd.RestorableDroppedManagedDatabaseProperties != nil {
14806		objectMap["properties"] = rdmd.RestorableDroppedManagedDatabaseProperties
14807	}
14808	if rdmd.Location != nil {
14809		objectMap["location"] = rdmd.Location
14810	}
14811	if rdmd.Tags != nil {
14812		objectMap["tags"] = rdmd.Tags
14813	}
14814	return json.Marshal(objectMap)
14815}
14816
14817// UnmarshalJSON is the custom unmarshaler for RestorableDroppedManagedDatabase struct.
14818func (rdmd *RestorableDroppedManagedDatabase) UnmarshalJSON(body []byte) error {
14819	var m map[string]*json.RawMessage
14820	err := json.Unmarshal(body, &m)
14821	if err != nil {
14822		return err
14823	}
14824	for k, v := range m {
14825		switch k {
14826		case "properties":
14827			if v != nil {
14828				var restorableDroppedManagedDatabaseProperties RestorableDroppedManagedDatabaseProperties
14829				err = json.Unmarshal(*v, &restorableDroppedManagedDatabaseProperties)
14830				if err != nil {
14831					return err
14832				}
14833				rdmd.RestorableDroppedManagedDatabaseProperties = &restorableDroppedManagedDatabaseProperties
14834			}
14835		case "location":
14836			if v != nil {
14837				var location string
14838				err = json.Unmarshal(*v, &location)
14839				if err != nil {
14840					return err
14841				}
14842				rdmd.Location = &location
14843			}
14844		case "tags":
14845			if v != nil {
14846				var tags map[string]*string
14847				err = json.Unmarshal(*v, &tags)
14848				if err != nil {
14849					return err
14850				}
14851				rdmd.Tags = tags
14852			}
14853		case "id":
14854			if v != nil {
14855				var ID string
14856				err = json.Unmarshal(*v, &ID)
14857				if err != nil {
14858					return err
14859				}
14860				rdmd.ID = &ID
14861			}
14862		case "name":
14863			if v != nil {
14864				var name string
14865				err = json.Unmarshal(*v, &name)
14866				if err != nil {
14867					return err
14868				}
14869				rdmd.Name = &name
14870			}
14871		case "type":
14872			if v != nil {
14873				var typeVar string
14874				err = json.Unmarshal(*v, &typeVar)
14875				if err != nil {
14876					return err
14877				}
14878				rdmd.Type = &typeVar
14879			}
14880		}
14881	}
14882
14883	return nil
14884}
14885
14886// RestorableDroppedManagedDatabaseListResult a list of restorable dropped managed databases.
14887type RestorableDroppedManagedDatabaseListResult struct {
14888	autorest.Response `json:"-"`
14889	// Value - READ-ONLY; Array of results.
14890	Value *[]RestorableDroppedManagedDatabase `json:"value,omitempty"`
14891	// NextLink - READ-ONLY; Link to retrieve next page of results.
14892	NextLink *string `json:"nextLink,omitempty"`
14893}
14894
14895// RestorableDroppedManagedDatabaseListResultIterator provides access to a complete listing of
14896// RestorableDroppedManagedDatabase values.
14897type RestorableDroppedManagedDatabaseListResultIterator struct {
14898	i    int
14899	page RestorableDroppedManagedDatabaseListResultPage
14900}
14901
14902// NextWithContext advances to the next value.  If there was an error making
14903// the request the iterator does not advance and the error is returned.
14904func (iter *RestorableDroppedManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
14905	if tracing.IsEnabled() {
14906		ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabaseListResultIterator.NextWithContext")
14907		defer func() {
14908			sc := -1
14909			if iter.Response().Response.Response != nil {
14910				sc = iter.Response().Response.Response.StatusCode
14911			}
14912			tracing.EndSpan(ctx, sc, err)
14913		}()
14914	}
14915	iter.i++
14916	if iter.i < len(iter.page.Values()) {
14917		return nil
14918	}
14919	err = iter.page.NextWithContext(ctx)
14920	if err != nil {
14921		iter.i--
14922		return err
14923	}
14924	iter.i = 0
14925	return nil
14926}
14927
14928// Next advances to the next value.  If there was an error making
14929// the request the iterator does not advance and the error is returned.
14930// Deprecated: Use NextWithContext() instead.
14931func (iter *RestorableDroppedManagedDatabaseListResultIterator) Next() error {
14932	return iter.NextWithContext(context.Background())
14933}
14934
14935// NotDone returns true if the enumeration should be started or is not yet complete.
14936func (iter RestorableDroppedManagedDatabaseListResultIterator) NotDone() bool {
14937	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14938}
14939
14940// Response returns the raw server response from the last page request.
14941func (iter RestorableDroppedManagedDatabaseListResultIterator) Response() RestorableDroppedManagedDatabaseListResult {
14942	return iter.page.Response()
14943}
14944
14945// Value returns the current value or a zero-initialized value if the
14946// iterator has advanced beyond the end of the collection.
14947func (iter RestorableDroppedManagedDatabaseListResultIterator) Value() RestorableDroppedManagedDatabase {
14948	if !iter.page.NotDone() {
14949		return RestorableDroppedManagedDatabase{}
14950	}
14951	return iter.page.Values()[iter.i]
14952}
14953
14954// Creates a new instance of the RestorableDroppedManagedDatabaseListResultIterator type.
14955func NewRestorableDroppedManagedDatabaseListResultIterator(page RestorableDroppedManagedDatabaseListResultPage) RestorableDroppedManagedDatabaseListResultIterator {
14956	return RestorableDroppedManagedDatabaseListResultIterator{page: page}
14957}
14958
14959// IsEmpty returns true if the ListResult contains no values.
14960func (rdmdlr RestorableDroppedManagedDatabaseListResult) IsEmpty() bool {
14961	return rdmdlr.Value == nil || len(*rdmdlr.Value) == 0
14962}
14963
14964// hasNextLink returns true if the NextLink is not empty.
14965func (rdmdlr RestorableDroppedManagedDatabaseListResult) hasNextLink() bool {
14966	return rdmdlr.NextLink != nil && len(*rdmdlr.NextLink) != 0
14967}
14968
14969// restorableDroppedManagedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
14970// It returns nil if no more results exist.
14971func (rdmdlr RestorableDroppedManagedDatabaseListResult) restorableDroppedManagedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
14972	if !rdmdlr.hasNextLink() {
14973		return nil, nil
14974	}
14975	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14976		autorest.AsJSON(),
14977		autorest.AsGet(),
14978		autorest.WithBaseURL(to.String(rdmdlr.NextLink)))
14979}
14980
14981// RestorableDroppedManagedDatabaseListResultPage contains a page of RestorableDroppedManagedDatabase
14982// values.
14983type RestorableDroppedManagedDatabaseListResultPage struct {
14984	fn     func(context.Context, RestorableDroppedManagedDatabaseListResult) (RestorableDroppedManagedDatabaseListResult, error)
14985	rdmdlr RestorableDroppedManagedDatabaseListResult
14986}
14987
14988// NextWithContext advances to the next page of values.  If there was an error making
14989// the request the page does not advance and the error is returned.
14990func (page *RestorableDroppedManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
14991	if tracing.IsEnabled() {
14992		ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabaseListResultPage.NextWithContext")
14993		defer func() {
14994			sc := -1
14995			if page.Response().Response.Response != nil {
14996				sc = page.Response().Response.Response.StatusCode
14997			}
14998			tracing.EndSpan(ctx, sc, err)
14999		}()
15000	}
15001	for {
15002		next, err := page.fn(ctx, page.rdmdlr)
15003		if err != nil {
15004			return err
15005		}
15006		page.rdmdlr = next
15007		if !next.hasNextLink() || !next.IsEmpty() {
15008			break
15009		}
15010	}
15011	return nil
15012}
15013
15014// Next advances to the next page of values.  If there was an error making
15015// the request the page does not advance and the error is returned.
15016// Deprecated: Use NextWithContext() instead.
15017func (page *RestorableDroppedManagedDatabaseListResultPage) Next() error {
15018	return page.NextWithContext(context.Background())
15019}
15020
15021// NotDone returns true if the page enumeration should be started or is not yet complete.
15022func (page RestorableDroppedManagedDatabaseListResultPage) NotDone() bool {
15023	return !page.rdmdlr.IsEmpty()
15024}
15025
15026// Response returns the raw server response from the last page request.
15027func (page RestorableDroppedManagedDatabaseListResultPage) Response() RestorableDroppedManagedDatabaseListResult {
15028	return page.rdmdlr
15029}
15030
15031// Values returns the slice of values for the current page or nil if there are no values.
15032func (page RestorableDroppedManagedDatabaseListResultPage) Values() []RestorableDroppedManagedDatabase {
15033	if page.rdmdlr.IsEmpty() {
15034		return nil
15035	}
15036	return *page.rdmdlr.Value
15037}
15038
15039// Creates a new instance of the RestorableDroppedManagedDatabaseListResultPage type.
15040func NewRestorableDroppedManagedDatabaseListResultPage(cur RestorableDroppedManagedDatabaseListResult, getNextPage func(context.Context, RestorableDroppedManagedDatabaseListResult) (RestorableDroppedManagedDatabaseListResult, error)) RestorableDroppedManagedDatabaseListResultPage {
15041	return RestorableDroppedManagedDatabaseListResultPage{
15042		fn:     getNextPage,
15043		rdmdlr: cur,
15044	}
15045}
15046
15047// RestorableDroppedManagedDatabaseProperties the restorable dropped managed database's properties.
15048type RestorableDroppedManagedDatabaseProperties struct {
15049	// DatabaseName - READ-ONLY; The name of the database.
15050	DatabaseName *string `json:"databaseName,omitempty"`
15051	// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format).
15052	CreationDate *date.Time `json:"creationDate,omitempty"`
15053	// DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format).
15054	DeletionDate *date.Time `json:"deletionDate,omitempty"`
15055	// EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format).
15056	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
15057}
15058
15059// RestorePoint database restore points.
15060type RestorePoint struct {
15061	autorest.Response `json:"-"`
15062	// Location - READ-ONLY; Resource location.
15063	Location *string `json:"location,omitempty"`
15064	// RestorePointProperties - Resource properties.
15065	*RestorePointProperties `json:"properties,omitempty"`
15066	// ID - READ-ONLY; Resource ID.
15067	ID *string `json:"id,omitempty"`
15068	// Name - READ-ONLY; Resource name.
15069	Name *string `json:"name,omitempty"`
15070	// Type - READ-ONLY; Resource type.
15071	Type *string `json:"type,omitempty"`
15072}
15073
15074// MarshalJSON is the custom marshaler for RestorePoint.
15075func (rp RestorePoint) MarshalJSON() ([]byte, error) {
15076	objectMap := make(map[string]interface{})
15077	if rp.RestorePointProperties != nil {
15078		objectMap["properties"] = rp.RestorePointProperties
15079	}
15080	return json.Marshal(objectMap)
15081}
15082
15083// UnmarshalJSON is the custom unmarshaler for RestorePoint struct.
15084func (rp *RestorePoint) UnmarshalJSON(body []byte) error {
15085	var m map[string]*json.RawMessage
15086	err := json.Unmarshal(body, &m)
15087	if err != nil {
15088		return err
15089	}
15090	for k, v := range m {
15091		switch k {
15092		case "location":
15093			if v != nil {
15094				var location string
15095				err = json.Unmarshal(*v, &location)
15096				if err != nil {
15097					return err
15098				}
15099				rp.Location = &location
15100			}
15101		case "properties":
15102			if v != nil {
15103				var restorePointProperties RestorePointProperties
15104				err = json.Unmarshal(*v, &restorePointProperties)
15105				if err != nil {
15106					return err
15107				}
15108				rp.RestorePointProperties = &restorePointProperties
15109			}
15110		case "id":
15111			if v != nil {
15112				var ID string
15113				err = json.Unmarshal(*v, &ID)
15114				if err != nil {
15115					return err
15116				}
15117				rp.ID = &ID
15118			}
15119		case "name":
15120			if v != nil {
15121				var name string
15122				err = json.Unmarshal(*v, &name)
15123				if err != nil {
15124					return err
15125				}
15126				rp.Name = &name
15127			}
15128		case "type":
15129			if v != nil {
15130				var typeVar string
15131				err = json.Unmarshal(*v, &typeVar)
15132				if err != nil {
15133					return err
15134				}
15135				rp.Type = &typeVar
15136			}
15137		}
15138	}
15139
15140	return nil
15141}
15142
15143// RestorePointListResult a list of long term retention backups.
15144type RestorePointListResult struct {
15145	autorest.Response `json:"-"`
15146	// Value - READ-ONLY; Array of results.
15147	Value *[]RestorePoint `json:"value,omitempty"`
15148	// NextLink - READ-ONLY; Link to retrieve next page of results.
15149	NextLink *string `json:"nextLink,omitempty"`
15150}
15151
15152// RestorePointProperties properties of a database restore point
15153type RestorePointProperties struct {
15154	// RestorePointType - READ-ONLY; The type of restore point. Possible values include: 'CONTINUOUS', 'DISCRETE'
15155	RestorePointType RestorePointType `json:"restorePointType,omitempty"`
15156	// EarliestRestoreDate - READ-ONLY; The earliest time to which this database can be restored
15157	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
15158	// RestorePointCreationDate - READ-ONLY; The time the backup was taken
15159	RestorePointCreationDate *date.Time `json:"restorePointCreationDate,omitempty"`
15160	// RestorePointLabel - READ-ONLY; The label of restore point for backup request by user
15161	RestorePointLabel *string `json:"restorePointLabel,omitempty"`
15162}
15163
15164// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
15165// operation.
15166type RestorePointsCreateFuture struct {
15167	azure.FutureAPI
15168	// Result returns the result of the asynchronous operation.
15169	// If the operation has not completed it will return an error.
15170	Result func(RestorePointsClient) (RestorePoint, error)
15171}
15172
15173// SecurityAlertPolicyProperties properties of a security alert policy.
15174type SecurityAlertPolicyProperties struct {
15175	// 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'
15176	State SecurityAlertPolicyState `json:"state,omitempty"`
15177	// DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action
15178	DisabledAlerts *[]string `json:"disabledAlerts,omitempty"`
15179	// EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent.
15180	EmailAddresses *[]string `json:"emailAddresses,omitempty"`
15181	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators.
15182	EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"`
15183	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
15184	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
15185	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account.
15186	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
15187	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
15188	RetentionDays *int32 `json:"retentionDays,omitempty"`
15189	// CreationTime - READ-ONLY; Specifies the UTC creation time of the policy.
15190	CreationTime *date.Time `json:"creationTime,omitempty"`
15191}
15192
15193// MarshalJSON is the custom marshaler for SecurityAlertPolicyProperties.
15194func (sapp SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) {
15195	objectMap := make(map[string]interface{})
15196	if sapp.State != "" {
15197		objectMap["state"] = sapp.State
15198	}
15199	if sapp.DisabledAlerts != nil {
15200		objectMap["disabledAlerts"] = sapp.DisabledAlerts
15201	}
15202	if sapp.EmailAddresses != nil {
15203		objectMap["emailAddresses"] = sapp.EmailAddresses
15204	}
15205	if sapp.EmailAccountAdmins != nil {
15206		objectMap["emailAccountAdmins"] = sapp.EmailAccountAdmins
15207	}
15208	if sapp.StorageEndpoint != nil {
15209		objectMap["storageEndpoint"] = sapp.StorageEndpoint
15210	}
15211	if sapp.StorageAccountAccessKey != nil {
15212		objectMap["storageAccountAccessKey"] = sapp.StorageAccountAccessKey
15213	}
15214	if sapp.RetentionDays != nil {
15215		objectMap["retentionDays"] = sapp.RetentionDays
15216	}
15217	return json.Marshal(objectMap)
15218}
15219
15220// SensitivityLabel a sensitivity label.
15221type SensitivityLabel struct {
15222	autorest.Response `json:"-"`
15223	// SensitivityLabelProperties - Resource properties.
15224	*SensitivityLabelProperties `json:"properties,omitempty"`
15225	// ID - READ-ONLY; Resource ID.
15226	ID *string `json:"id,omitempty"`
15227	// Name - READ-ONLY; Resource name.
15228	Name *string `json:"name,omitempty"`
15229	// Type - READ-ONLY; Resource type.
15230	Type *string `json:"type,omitempty"`
15231}
15232
15233// MarshalJSON is the custom marshaler for SensitivityLabel.
15234func (sl SensitivityLabel) MarshalJSON() ([]byte, error) {
15235	objectMap := make(map[string]interface{})
15236	if sl.SensitivityLabelProperties != nil {
15237		objectMap["properties"] = sl.SensitivityLabelProperties
15238	}
15239	return json.Marshal(objectMap)
15240}
15241
15242// UnmarshalJSON is the custom unmarshaler for SensitivityLabel struct.
15243func (sl *SensitivityLabel) UnmarshalJSON(body []byte) error {
15244	var m map[string]*json.RawMessage
15245	err := json.Unmarshal(body, &m)
15246	if err != nil {
15247		return err
15248	}
15249	for k, v := range m {
15250		switch k {
15251		case "properties":
15252			if v != nil {
15253				var sensitivityLabelProperties SensitivityLabelProperties
15254				err = json.Unmarshal(*v, &sensitivityLabelProperties)
15255				if err != nil {
15256					return err
15257				}
15258				sl.SensitivityLabelProperties = &sensitivityLabelProperties
15259			}
15260		case "id":
15261			if v != nil {
15262				var ID string
15263				err = json.Unmarshal(*v, &ID)
15264				if err != nil {
15265					return err
15266				}
15267				sl.ID = &ID
15268			}
15269		case "name":
15270			if v != nil {
15271				var name string
15272				err = json.Unmarshal(*v, &name)
15273				if err != nil {
15274					return err
15275				}
15276				sl.Name = &name
15277			}
15278		case "type":
15279			if v != nil {
15280				var typeVar string
15281				err = json.Unmarshal(*v, &typeVar)
15282				if err != nil {
15283					return err
15284				}
15285				sl.Type = &typeVar
15286			}
15287		}
15288	}
15289
15290	return nil
15291}
15292
15293// SensitivityLabelListResult a list of sensitivity labels.
15294type SensitivityLabelListResult struct {
15295	autorest.Response `json:"-"`
15296	// Value - READ-ONLY; Array of results.
15297	Value *[]SensitivityLabel `json:"value,omitempty"`
15298	// NextLink - READ-ONLY; Link to retrieve next page of results.
15299	NextLink *string `json:"nextLink,omitempty"`
15300}
15301
15302// SensitivityLabelListResultIterator provides access to a complete listing of SensitivityLabel values.
15303type SensitivityLabelListResultIterator struct {
15304	i    int
15305	page SensitivityLabelListResultPage
15306}
15307
15308// NextWithContext advances to the next value.  If there was an error making
15309// the request the iterator does not advance and the error is returned.
15310func (iter *SensitivityLabelListResultIterator) NextWithContext(ctx context.Context) (err error) {
15311	if tracing.IsEnabled() {
15312		ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultIterator.NextWithContext")
15313		defer func() {
15314			sc := -1
15315			if iter.Response().Response.Response != nil {
15316				sc = iter.Response().Response.Response.StatusCode
15317			}
15318			tracing.EndSpan(ctx, sc, err)
15319		}()
15320	}
15321	iter.i++
15322	if iter.i < len(iter.page.Values()) {
15323		return nil
15324	}
15325	err = iter.page.NextWithContext(ctx)
15326	if err != nil {
15327		iter.i--
15328		return err
15329	}
15330	iter.i = 0
15331	return nil
15332}
15333
15334// Next advances to the next value.  If there was an error making
15335// the request the iterator does not advance and the error is returned.
15336// Deprecated: Use NextWithContext() instead.
15337func (iter *SensitivityLabelListResultIterator) Next() error {
15338	return iter.NextWithContext(context.Background())
15339}
15340
15341// NotDone returns true if the enumeration should be started or is not yet complete.
15342func (iter SensitivityLabelListResultIterator) NotDone() bool {
15343	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15344}
15345
15346// Response returns the raw server response from the last page request.
15347func (iter SensitivityLabelListResultIterator) Response() SensitivityLabelListResult {
15348	return iter.page.Response()
15349}
15350
15351// Value returns the current value or a zero-initialized value if the
15352// iterator has advanced beyond the end of the collection.
15353func (iter SensitivityLabelListResultIterator) Value() SensitivityLabel {
15354	if !iter.page.NotDone() {
15355		return SensitivityLabel{}
15356	}
15357	return iter.page.Values()[iter.i]
15358}
15359
15360// Creates a new instance of the SensitivityLabelListResultIterator type.
15361func NewSensitivityLabelListResultIterator(page SensitivityLabelListResultPage) SensitivityLabelListResultIterator {
15362	return SensitivityLabelListResultIterator{page: page}
15363}
15364
15365// IsEmpty returns true if the ListResult contains no values.
15366func (sllr SensitivityLabelListResult) IsEmpty() bool {
15367	return sllr.Value == nil || len(*sllr.Value) == 0
15368}
15369
15370// hasNextLink returns true if the NextLink is not empty.
15371func (sllr SensitivityLabelListResult) hasNextLink() bool {
15372	return sllr.NextLink != nil && len(*sllr.NextLink) != 0
15373}
15374
15375// sensitivityLabelListResultPreparer prepares a request to retrieve the next set of results.
15376// It returns nil if no more results exist.
15377func (sllr SensitivityLabelListResult) sensitivityLabelListResultPreparer(ctx context.Context) (*http.Request, error) {
15378	if !sllr.hasNextLink() {
15379		return nil, nil
15380	}
15381	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15382		autorest.AsJSON(),
15383		autorest.AsGet(),
15384		autorest.WithBaseURL(to.String(sllr.NextLink)))
15385}
15386
15387// SensitivityLabelListResultPage contains a page of SensitivityLabel values.
15388type SensitivityLabelListResultPage struct {
15389	fn   func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)
15390	sllr SensitivityLabelListResult
15391}
15392
15393// NextWithContext advances to the next page of values.  If there was an error making
15394// the request the page does not advance and the error is returned.
15395func (page *SensitivityLabelListResultPage) NextWithContext(ctx context.Context) (err error) {
15396	if tracing.IsEnabled() {
15397		ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultPage.NextWithContext")
15398		defer func() {
15399			sc := -1
15400			if page.Response().Response.Response != nil {
15401				sc = page.Response().Response.Response.StatusCode
15402			}
15403			tracing.EndSpan(ctx, sc, err)
15404		}()
15405	}
15406	for {
15407		next, err := page.fn(ctx, page.sllr)
15408		if err != nil {
15409			return err
15410		}
15411		page.sllr = next
15412		if !next.hasNextLink() || !next.IsEmpty() {
15413			break
15414		}
15415	}
15416	return nil
15417}
15418
15419// Next advances to the next page of values.  If there was an error making
15420// the request the page does not advance and the error is returned.
15421// Deprecated: Use NextWithContext() instead.
15422func (page *SensitivityLabelListResultPage) Next() error {
15423	return page.NextWithContext(context.Background())
15424}
15425
15426// NotDone returns true if the page enumeration should be started or is not yet complete.
15427func (page SensitivityLabelListResultPage) NotDone() bool {
15428	return !page.sllr.IsEmpty()
15429}
15430
15431// Response returns the raw server response from the last page request.
15432func (page SensitivityLabelListResultPage) Response() SensitivityLabelListResult {
15433	return page.sllr
15434}
15435
15436// Values returns the slice of values for the current page or nil if there are no values.
15437func (page SensitivityLabelListResultPage) Values() []SensitivityLabel {
15438	if page.sllr.IsEmpty() {
15439		return nil
15440	}
15441	return *page.sllr.Value
15442}
15443
15444// Creates a new instance of the SensitivityLabelListResultPage type.
15445func NewSensitivityLabelListResultPage(cur SensitivityLabelListResult, getNextPage func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)) SensitivityLabelListResultPage {
15446	return SensitivityLabelListResultPage{
15447		fn:   getNextPage,
15448		sllr: cur,
15449	}
15450}
15451
15452// SensitivityLabelProperties properties of a sensitivity label.
15453type SensitivityLabelProperties struct {
15454	// LabelName - The label name.
15455	LabelName *string `json:"labelName,omitempty"`
15456	// LabelID - The label ID.
15457	LabelID *string `json:"labelId,omitempty"`
15458	// InformationType - The information type.
15459	InformationType *string `json:"informationType,omitempty"`
15460	// InformationTypeID - The information type ID.
15461	InformationTypeID *string `json:"informationTypeId,omitempty"`
15462	// 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.
15463	IsDisabled *bool `json:"isDisabled,omitempty"`
15464	// Rank - Possible values include: 'SensitivityLabelRankNone', 'SensitivityLabelRankLow', 'SensitivityLabelRankMedium', 'SensitivityLabelRankHigh', 'SensitivityLabelRankCritical'
15465	Rank SensitivityLabelRank `json:"rank,omitempty"`
15466}
15467
15468// MarshalJSON is the custom marshaler for SensitivityLabelProperties.
15469func (slp SensitivityLabelProperties) MarshalJSON() ([]byte, error) {
15470	objectMap := make(map[string]interface{})
15471	if slp.LabelName != nil {
15472		objectMap["labelName"] = slp.LabelName
15473	}
15474	if slp.LabelID != nil {
15475		objectMap["labelId"] = slp.LabelID
15476	}
15477	if slp.InformationType != nil {
15478		objectMap["informationType"] = slp.InformationType
15479	}
15480	if slp.InformationTypeID != nil {
15481		objectMap["informationTypeId"] = slp.InformationTypeID
15482	}
15483	if slp.Rank != "" {
15484		objectMap["rank"] = slp.Rank
15485	}
15486	return json.Marshal(objectMap)
15487}
15488
15489// Server an Azure SQL Database server.
15490type Server struct {
15491	autorest.Response `json:"-"`
15492	// Identity - The Azure Active Directory identity of the server.
15493	Identity *ResourceIdentity `json:"identity,omitempty"`
15494	// Kind - READ-ONLY; Kind of sql server. This is metadata used for the Azure portal experience.
15495	Kind *string `json:"kind,omitempty"`
15496	// ServerProperties - Resource properties.
15497	*ServerProperties `json:"properties,omitempty"`
15498	// Location - Resource location.
15499	Location *string `json:"location,omitempty"`
15500	// Tags - Resource tags.
15501	Tags map[string]*string `json:"tags"`
15502	// ID - READ-ONLY; Resource ID.
15503	ID *string `json:"id,omitempty"`
15504	// Name - READ-ONLY; Resource name.
15505	Name *string `json:"name,omitempty"`
15506	// Type - READ-ONLY; Resource type.
15507	Type *string `json:"type,omitempty"`
15508}
15509
15510// MarshalJSON is the custom marshaler for Server.
15511func (s Server) MarshalJSON() ([]byte, error) {
15512	objectMap := make(map[string]interface{})
15513	if s.Identity != nil {
15514		objectMap["identity"] = s.Identity
15515	}
15516	if s.ServerProperties != nil {
15517		objectMap["properties"] = s.ServerProperties
15518	}
15519	if s.Location != nil {
15520		objectMap["location"] = s.Location
15521	}
15522	if s.Tags != nil {
15523		objectMap["tags"] = s.Tags
15524	}
15525	return json.Marshal(objectMap)
15526}
15527
15528// UnmarshalJSON is the custom unmarshaler for Server struct.
15529func (s *Server) UnmarshalJSON(body []byte) error {
15530	var m map[string]*json.RawMessage
15531	err := json.Unmarshal(body, &m)
15532	if err != nil {
15533		return err
15534	}
15535	for k, v := range m {
15536		switch k {
15537		case "identity":
15538			if v != nil {
15539				var identity ResourceIdentity
15540				err = json.Unmarshal(*v, &identity)
15541				if err != nil {
15542					return err
15543				}
15544				s.Identity = &identity
15545			}
15546		case "kind":
15547			if v != nil {
15548				var kind string
15549				err = json.Unmarshal(*v, &kind)
15550				if err != nil {
15551					return err
15552				}
15553				s.Kind = &kind
15554			}
15555		case "properties":
15556			if v != nil {
15557				var serverProperties ServerProperties
15558				err = json.Unmarshal(*v, &serverProperties)
15559				if err != nil {
15560					return err
15561				}
15562				s.ServerProperties = &serverProperties
15563			}
15564		case "location":
15565			if v != nil {
15566				var location string
15567				err = json.Unmarshal(*v, &location)
15568				if err != nil {
15569					return err
15570				}
15571				s.Location = &location
15572			}
15573		case "tags":
15574			if v != nil {
15575				var tags map[string]*string
15576				err = json.Unmarshal(*v, &tags)
15577				if err != nil {
15578					return err
15579				}
15580				s.Tags = tags
15581			}
15582		case "id":
15583			if v != nil {
15584				var ID string
15585				err = json.Unmarshal(*v, &ID)
15586				if err != nil {
15587					return err
15588				}
15589				s.ID = &ID
15590			}
15591		case "name":
15592			if v != nil {
15593				var name string
15594				err = json.Unmarshal(*v, &name)
15595				if err != nil {
15596					return err
15597				}
15598				s.Name = &name
15599			}
15600		case "type":
15601			if v != nil {
15602				var typeVar string
15603				err = json.Unmarshal(*v, &typeVar)
15604				if err != nil {
15605					return err
15606				}
15607				s.Type = &typeVar
15608			}
15609		}
15610	}
15611
15612	return nil
15613}
15614
15615// ServerAutomaticTuning server-level Automatic Tuning.
15616type ServerAutomaticTuning struct {
15617	autorest.Response `json:"-"`
15618	// AutomaticTuningServerProperties - Resource properties.
15619	*AutomaticTuningServerProperties `json:"properties,omitempty"`
15620	// ID - READ-ONLY; Resource ID.
15621	ID *string `json:"id,omitempty"`
15622	// Name - READ-ONLY; Resource name.
15623	Name *string `json:"name,omitempty"`
15624	// Type - READ-ONLY; Resource type.
15625	Type *string `json:"type,omitempty"`
15626}
15627
15628// MarshalJSON is the custom marshaler for ServerAutomaticTuning.
15629func (sat ServerAutomaticTuning) MarshalJSON() ([]byte, error) {
15630	objectMap := make(map[string]interface{})
15631	if sat.AutomaticTuningServerProperties != nil {
15632		objectMap["properties"] = sat.AutomaticTuningServerProperties
15633	}
15634	return json.Marshal(objectMap)
15635}
15636
15637// UnmarshalJSON is the custom unmarshaler for ServerAutomaticTuning struct.
15638func (sat *ServerAutomaticTuning) UnmarshalJSON(body []byte) error {
15639	var m map[string]*json.RawMessage
15640	err := json.Unmarshal(body, &m)
15641	if err != nil {
15642		return err
15643	}
15644	for k, v := range m {
15645		switch k {
15646		case "properties":
15647			if v != nil {
15648				var automaticTuningServerProperties AutomaticTuningServerProperties
15649				err = json.Unmarshal(*v, &automaticTuningServerProperties)
15650				if err != nil {
15651					return err
15652				}
15653				sat.AutomaticTuningServerProperties = &automaticTuningServerProperties
15654			}
15655		case "id":
15656			if v != nil {
15657				var ID string
15658				err = json.Unmarshal(*v, &ID)
15659				if err != nil {
15660					return err
15661				}
15662				sat.ID = &ID
15663			}
15664		case "name":
15665			if v != nil {
15666				var name string
15667				err = json.Unmarshal(*v, &name)
15668				if err != nil {
15669					return err
15670				}
15671				sat.Name = &name
15672			}
15673		case "type":
15674			if v != nil {
15675				var typeVar string
15676				err = json.Unmarshal(*v, &typeVar)
15677				if err != nil {
15678					return err
15679				}
15680				sat.Type = &typeVar
15681			}
15682		}
15683	}
15684
15685	return nil
15686}
15687
15688// ServerAzureADAdministrator azure Active Directory administrator.
15689type ServerAzureADAdministrator struct {
15690	autorest.Response `json:"-"`
15691	// AdministratorProperties - Resource properties.
15692	*AdministratorProperties `json:"properties,omitempty"`
15693	// ID - READ-ONLY; Resource ID.
15694	ID *string `json:"id,omitempty"`
15695	// Name - READ-ONLY; Resource name.
15696	Name *string `json:"name,omitempty"`
15697	// Type - READ-ONLY; Resource type.
15698	Type *string `json:"type,omitempty"`
15699}
15700
15701// MarshalJSON is the custom marshaler for ServerAzureADAdministrator.
15702func (saaa ServerAzureADAdministrator) MarshalJSON() ([]byte, error) {
15703	objectMap := make(map[string]interface{})
15704	if saaa.AdministratorProperties != nil {
15705		objectMap["properties"] = saaa.AdministratorProperties
15706	}
15707	return json.Marshal(objectMap)
15708}
15709
15710// UnmarshalJSON is the custom unmarshaler for ServerAzureADAdministrator struct.
15711func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error {
15712	var m map[string]*json.RawMessage
15713	err := json.Unmarshal(body, &m)
15714	if err != nil {
15715		return err
15716	}
15717	for k, v := range m {
15718		switch k {
15719		case "properties":
15720			if v != nil {
15721				var administratorProperties AdministratorProperties
15722				err = json.Unmarshal(*v, &administratorProperties)
15723				if err != nil {
15724					return err
15725				}
15726				saaa.AdministratorProperties = &administratorProperties
15727			}
15728		case "id":
15729			if v != nil {
15730				var ID string
15731				err = json.Unmarshal(*v, &ID)
15732				if err != nil {
15733					return err
15734				}
15735				saaa.ID = &ID
15736			}
15737		case "name":
15738			if v != nil {
15739				var name string
15740				err = json.Unmarshal(*v, &name)
15741				if err != nil {
15742					return err
15743				}
15744				saaa.Name = &name
15745			}
15746		case "type":
15747			if v != nil {
15748				var typeVar string
15749				err = json.Unmarshal(*v, &typeVar)
15750				if err != nil {
15751					return err
15752				}
15753				saaa.Type = &typeVar
15754			}
15755		}
15756	}
15757
15758	return nil
15759}
15760
15761// ServerAzureADAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
15762// of a long-running operation.
15763type ServerAzureADAdministratorsCreateOrUpdateFuture struct {
15764	azure.FutureAPI
15765	// Result returns the result of the asynchronous operation.
15766	// If the operation has not completed it will return an error.
15767	Result func(ServerAzureADAdministratorsClient) (ServerAzureADAdministrator, error)
15768}
15769
15770// ServerAzureADAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a
15771// long-running operation.
15772type ServerAzureADAdministratorsDeleteFuture struct {
15773	azure.FutureAPI
15774	// Result returns the result of the asynchronous operation.
15775	// If the operation has not completed it will return an error.
15776	Result func(ServerAzureADAdministratorsClient) (autorest.Response, error)
15777}
15778
15779// ServerAzureADOnlyAuthentication azure Active Directory only authentication.
15780type ServerAzureADOnlyAuthentication struct {
15781	autorest.Response `json:"-"`
15782	// AzureADOnlyAuthProperties - Resource properties.
15783	*AzureADOnlyAuthProperties `json:"properties,omitempty"`
15784	// ID - READ-ONLY; Resource ID.
15785	ID *string `json:"id,omitempty"`
15786	// Name - READ-ONLY; Resource name.
15787	Name *string `json:"name,omitempty"`
15788	// Type - READ-ONLY; Resource type.
15789	Type *string `json:"type,omitempty"`
15790}
15791
15792// MarshalJSON is the custom marshaler for ServerAzureADOnlyAuthentication.
15793func (saaoa ServerAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) {
15794	objectMap := make(map[string]interface{})
15795	if saaoa.AzureADOnlyAuthProperties != nil {
15796		objectMap["properties"] = saaoa.AzureADOnlyAuthProperties
15797	}
15798	return json.Marshal(objectMap)
15799}
15800
15801// UnmarshalJSON is the custom unmarshaler for ServerAzureADOnlyAuthentication struct.
15802func (saaoa *ServerAzureADOnlyAuthentication) UnmarshalJSON(body []byte) error {
15803	var m map[string]*json.RawMessage
15804	err := json.Unmarshal(body, &m)
15805	if err != nil {
15806		return err
15807	}
15808	for k, v := range m {
15809		switch k {
15810		case "properties":
15811			if v != nil {
15812				var azureADOnlyAuthProperties AzureADOnlyAuthProperties
15813				err = json.Unmarshal(*v, &azureADOnlyAuthProperties)
15814				if err != nil {
15815					return err
15816				}
15817				saaoa.AzureADOnlyAuthProperties = &azureADOnlyAuthProperties
15818			}
15819		case "id":
15820			if v != nil {
15821				var ID string
15822				err = json.Unmarshal(*v, &ID)
15823				if err != nil {
15824					return err
15825				}
15826				saaoa.ID = &ID
15827			}
15828		case "name":
15829			if v != nil {
15830				var name string
15831				err = json.Unmarshal(*v, &name)
15832				if err != nil {
15833					return err
15834				}
15835				saaoa.Name = &name
15836			}
15837		case "type":
15838			if v != nil {
15839				var typeVar string
15840				err = json.Unmarshal(*v, &typeVar)
15841				if err != nil {
15842					return err
15843				}
15844				saaoa.Type = &typeVar
15845			}
15846		}
15847	}
15848
15849	return nil
15850}
15851
15852// ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
15853// results of a long-running operation.
15854type ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture struct {
15855	azure.FutureAPI
15856	// Result returns the result of the asynchronous operation.
15857	// If the operation has not completed it will return an error.
15858	Result func(ServerAzureADOnlyAuthenticationsClient) (ServerAzureADOnlyAuthentication, error)
15859}
15860
15861// ServerAzureADOnlyAuthenticationsDeleteFuture an abstraction for monitoring and retrieving the results of
15862// a long-running operation.
15863type ServerAzureADOnlyAuthenticationsDeleteFuture struct {
15864	azure.FutureAPI
15865	// Result returns the result of the asynchronous operation.
15866	// If the operation has not completed it will return an error.
15867	Result func(ServerAzureADOnlyAuthenticationsClient) (autorest.Response, error)
15868}
15869
15870// ServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
15871// of a long-running operation.
15872type ServerBlobAuditingPoliciesCreateOrUpdateFuture struct {
15873	azure.FutureAPI
15874	// Result returns the result of the asynchronous operation.
15875	// If the operation has not completed it will return an error.
15876	Result func(ServerBlobAuditingPoliciesClient) (ServerBlobAuditingPolicy, error)
15877}
15878
15879// ServerBlobAuditingPolicy a server blob auditing policy.
15880type ServerBlobAuditingPolicy struct {
15881	autorest.Response `json:"-"`
15882	// ServerBlobAuditingPolicyProperties - Resource properties.
15883	*ServerBlobAuditingPolicyProperties `json:"properties,omitempty"`
15884	// ID - READ-ONLY; Resource ID.
15885	ID *string `json:"id,omitempty"`
15886	// Name - READ-ONLY; Resource name.
15887	Name *string `json:"name,omitempty"`
15888	// Type - READ-ONLY; Resource type.
15889	Type *string `json:"type,omitempty"`
15890}
15891
15892// MarshalJSON is the custom marshaler for ServerBlobAuditingPolicy.
15893func (sbap ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
15894	objectMap := make(map[string]interface{})
15895	if sbap.ServerBlobAuditingPolicyProperties != nil {
15896		objectMap["properties"] = sbap.ServerBlobAuditingPolicyProperties
15897	}
15898	return json.Marshal(objectMap)
15899}
15900
15901// UnmarshalJSON is the custom unmarshaler for ServerBlobAuditingPolicy struct.
15902func (sbap *ServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
15903	var m map[string]*json.RawMessage
15904	err := json.Unmarshal(body, &m)
15905	if err != nil {
15906		return err
15907	}
15908	for k, v := range m {
15909		switch k {
15910		case "properties":
15911			if v != nil {
15912				var serverBlobAuditingPolicyProperties ServerBlobAuditingPolicyProperties
15913				err = json.Unmarshal(*v, &serverBlobAuditingPolicyProperties)
15914				if err != nil {
15915					return err
15916				}
15917				sbap.ServerBlobAuditingPolicyProperties = &serverBlobAuditingPolicyProperties
15918			}
15919		case "id":
15920			if v != nil {
15921				var ID string
15922				err = json.Unmarshal(*v, &ID)
15923				if err != nil {
15924					return err
15925				}
15926				sbap.ID = &ID
15927			}
15928		case "name":
15929			if v != nil {
15930				var name string
15931				err = json.Unmarshal(*v, &name)
15932				if err != nil {
15933					return err
15934				}
15935				sbap.Name = &name
15936			}
15937		case "type":
15938			if v != nil {
15939				var typeVar string
15940				err = json.Unmarshal(*v, &typeVar)
15941				if err != nil {
15942					return err
15943				}
15944				sbap.Type = &typeVar
15945			}
15946		}
15947	}
15948
15949	return nil
15950}
15951
15952// ServerBlobAuditingPolicyListResult a list of server auditing settings.
15953type ServerBlobAuditingPolicyListResult struct {
15954	autorest.Response `json:"-"`
15955	// Value - READ-ONLY; Array of results.
15956	Value *[]ServerBlobAuditingPolicy `json:"value,omitempty"`
15957	// NextLink - READ-ONLY; Link to retrieve next page of results.
15958	NextLink *string `json:"nextLink,omitempty"`
15959}
15960
15961// ServerBlobAuditingPolicyListResultIterator provides access to a complete listing of
15962// ServerBlobAuditingPolicy values.
15963type ServerBlobAuditingPolicyListResultIterator struct {
15964	i    int
15965	page ServerBlobAuditingPolicyListResultPage
15966}
15967
15968// NextWithContext advances to the next value.  If there was an error making
15969// the request the iterator does not advance and the error is returned.
15970func (iter *ServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
15971	if tracing.IsEnabled() {
15972		ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultIterator.NextWithContext")
15973		defer func() {
15974			sc := -1
15975			if iter.Response().Response.Response != nil {
15976				sc = iter.Response().Response.Response.StatusCode
15977			}
15978			tracing.EndSpan(ctx, sc, err)
15979		}()
15980	}
15981	iter.i++
15982	if iter.i < len(iter.page.Values()) {
15983		return nil
15984	}
15985	err = iter.page.NextWithContext(ctx)
15986	if err != nil {
15987		iter.i--
15988		return err
15989	}
15990	iter.i = 0
15991	return nil
15992}
15993
15994// Next advances to the next value.  If there was an error making
15995// the request the iterator does not advance and the error is returned.
15996// Deprecated: Use NextWithContext() instead.
15997func (iter *ServerBlobAuditingPolicyListResultIterator) Next() error {
15998	return iter.NextWithContext(context.Background())
15999}
16000
16001// NotDone returns true if the enumeration should be started or is not yet complete.
16002func (iter ServerBlobAuditingPolicyListResultIterator) NotDone() bool {
16003	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16004}
16005
16006// Response returns the raw server response from the last page request.
16007func (iter ServerBlobAuditingPolicyListResultIterator) Response() ServerBlobAuditingPolicyListResult {
16008	return iter.page.Response()
16009}
16010
16011// Value returns the current value or a zero-initialized value if the
16012// iterator has advanced beyond the end of the collection.
16013func (iter ServerBlobAuditingPolicyListResultIterator) Value() ServerBlobAuditingPolicy {
16014	if !iter.page.NotDone() {
16015		return ServerBlobAuditingPolicy{}
16016	}
16017	return iter.page.Values()[iter.i]
16018}
16019
16020// Creates a new instance of the ServerBlobAuditingPolicyListResultIterator type.
16021func NewServerBlobAuditingPolicyListResultIterator(page ServerBlobAuditingPolicyListResultPage) ServerBlobAuditingPolicyListResultIterator {
16022	return ServerBlobAuditingPolicyListResultIterator{page: page}
16023}
16024
16025// IsEmpty returns true if the ListResult contains no values.
16026func (sbaplr ServerBlobAuditingPolicyListResult) IsEmpty() bool {
16027	return sbaplr.Value == nil || len(*sbaplr.Value) == 0
16028}
16029
16030// hasNextLink returns true if the NextLink is not empty.
16031func (sbaplr ServerBlobAuditingPolicyListResult) hasNextLink() bool {
16032	return sbaplr.NextLink != nil && len(*sbaplr.NextLink) != 0
16033}
16034
16035// serverBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
16036// It returns nil if no more results exist.
16037func (sbaplr ServerBlobAuditingPolicyListResult) serverBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
16038	if !sbaplr.hasNextLink() {
16039		return nil, nil
16040	}
16041	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16042		autorest.AsJSON(),
16043		autorest.AsGet(),
16044		autorest.WithBaseURL(to.String(sbaplr.NextLink)))
16045}
16046
16047// ServerBlobAuditingPolicyListResultPage contains a page of ServerBlobAuditingPolicy values.
16048type ServerBlobAuditingPolicyListResultPage struct {
16049	fn     func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)
16050	sbaplr ServerBlobAuditingPolicyListResult
16051}
16052
16053// NextWithContext advances to the next page of values.  If there was an error making
16054// the request the page does not advance and the error is returned.
16055func (page *ServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
16056	if tracing.IsEnabled() {
16057		ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultPage.NextWithContext")
16058		defer func() {
16059			sc := -1
16060			if page.Response().Response.Response != nil {
16061				sc = page.Response().Response.Response.StatusCode
16062			}
16063			tracing.EndSpan(ctx, sc, err)
16064		}()
16065	}
16066	for {
16067		next, err := page.fn(ctx, page.sbaplr)
16068		if err != nil {
16069			return err
16070		}
16071		page.sbaplr = next
16072		if !next.hasNextLink() || !next.IsEmpty() {
16073			break
16074		}
16075	}
16076	return nil
16077}
16078
16079// Next advances to the next page of values.  If there was an error making
16080// the request the page does not advance and the error is returned.
16081// Deprecated: Use NextWithContext() instead.
16082func (page *ServerBlobAuditingPolicyListResultPage) Next() error {
16083	return page.NextWithContext(context.Background())
16084}
16085
16086// NotDone returns true if the page enumeration should be started or is not yet complete.
16087func (page ServerBlobAuditingPolicyListResultPage) NotDone() bool {
16088	return !page.sbaplr.IsEmpty()
16089}
16090
16091// Response returns the raw server response from the last page request.
16092func (page ServerBlobAuditingPolicyListResultPage) Response() ServerBlobAuditingPolicyListResult {
16093	return page.sbaplr
16094}
16095
16096// Values returns the slice of values for the current page or nil if there are no values.
16097func (page ServerBlobAuditingPolicyListResultPage) Values() []ServerBlobAuditingPolicy {
16098	if page.sbaplr.IsEmpty() {
16099		return nil
16100	}
16101	return *page.sbaplr.Value
16102}
16103
16104// Creates a new instance of the ServerBlobAuditingPolicyListResultPage type.
16105func NewServerBlobAuditingPolicyListResultPage(cur ServerBlobAuditingPolicyListResult, getNextPage func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)) ServerBlobAuditingPolicyListResultPage {
16106	return ServerBlobAuditingPolicyListResultPage{
16107		fn:     getNextPage,
16108		sbaplr: cur,
16109	}
16110}
16111
16112// ServerBlobAuditingPolicyProperties properties of a server blob auditing policy.
16113type ServerBlobAuditingPolicyProperties struct {
16114	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
16115	State BlobAuditingPolicyState `json:"state,omitempty"`
16116	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
16117	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
16118	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
16119	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
16120	// Prerequisites for using managed identity authentication:
16121	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
16122	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
16123	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
16124	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
16125	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
16126	RetentionDays *int32 `json:"retentionDays,omitempty"`
16127	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
16128	//
16129	// 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:
16130	//
16131	// BATCH_COMPLETED_GROUP,
16132	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
16133	// FAILED_DATABASE_AUTHENTICATION_GROUP.
16134	//
16135	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
16136	//
16137	// 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):
16138	//
16139	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
16140	// BACKUP_RESTORE_GROUP
16141	// DATABASE_LOGOUT_GROUP
16142	// DATABASE_OBJECT_CHANGE_GROUP
16143	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
16144	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
16145	// DATABASE_OPERATION_GROUP
16146	// DATABASE_PERMISSION_CHANGE_GROUP
16147	// DATABASE_PRINCIPAL_CHANGE_GROUP
16148	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
16149	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
16150	// FAILED_DATABASE_AUTHENTICATION_GROUP
16151	// SCHEMA_OBJECT_ACCESS_GROUP
16152	// SCHEMA_OBJECT_CHANGE_GROUP
16153	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
16154	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
16155	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
16156	// USER_CHANGE_PASSWORD_GROUP
16157	// BATCH_STARTED_GROUP
16158	// BATCH_COMPLETED_GROUP
16159	//
16160	// 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.
16161	//
16162	// 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).
16163	//
16164	// 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:
16165	// SELECT
16166	// UPDATE
16167	// INSERT
16168	// DELETE
16169	// EXECUTE
16170	// RECEIVE
16171	// REFERENCES
16172	//
16173	// The general form for defining an action to be audited is:
16174	// {action} ON {object} BY {principal}
16175	//
16176	// 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.
16177	//
16178	// For example:
16179	// SELECT on dbo.myTable by public
16180	// SELECT on DATABASE::myDatabase by public
16181	// SELECT on SCHEMA::mySchema by public
16182	//
16183	// 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)
16184	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
16185	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
16186	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
16187	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
16188	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
16189	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
16190	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
16191	//
16192	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
16193	// Note that for server level audit you should use the 'master' database as {databaseName}.
16194	//
16195	// Diagnostic Settings URI format:
16196	// 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
16197	//
16198	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
16199	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
16200	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
16201	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
16202	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
16203	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
16204}
16205
16206// ServerCommunicationLink server communication link.
16207type ServerCommunicationLink struct {
16208	autorest.Response `json:"-"`
16209	// ServerCommunicationLinkProperties - The properties of resource.
16210	*ServerCommunicationLinkProperties `json:"properties,omitempty"`
16211	// Location - READ-ONLY; Communication link location.
16212	Location *string `json:"location,omitempty"`
16213	// Kind - READ-ONLY; Communication link kind.  This property is used for Azure Portal metadata.
16214	Kind *string `json:"kind,omitempty"`
16215	// ID - READ-ONLY; Resource ID.
16216	ID *string `json:"id,omitempty"`
16217	// Name - READ-ONLY; Resource name.
16218	Name *string `json:"name,omitempty"`
16219	// Type - READ-ONLY; Resource type.
16220	Type *string `json:"type,omitempty"`
16221}
16222
16223// MarshalJSON is the custom marshaler for ServerCommunicationLink.
16224func (scl ServerCommunicationLink) MarshalJSON() ([]byte, error) {
16225	objectMap := make(map[string]interface{})
16226	if scl.ServerCommunicationLinkProperties != nil {
16227		objectMap["properties"] = scl.ServerCommunicationLinkProperties
16228	}
16229	return json.Marshal(objectMap)
16230}
16231
16232// UnmarshalJSON is the custom unmarshaler for ServerCommunicationLink struct.
16233func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error {
16234	var m map[string]*json.RawMessage
16235	err := json.Unmarshal(body, &m)
16236	if err != nil {
16237		return err
16238	}
16239	for k, v := range m {
16240		switch k {
16241		case "properties":
16242			if v != nil {
16243				var serverCommunicationLinkProperties ServerCommunicationLinkProperties
16244				err = json.Unmarshal(*v, &serverCommunicationLinkProperties)
16245				if err != nil {
16246					return err
16247				}
16248				scl.ServerCommunicationLinkProperties = &serverCommunicationLinkProperties
16249			}
16250		case "location":
16251			if v != nil {
16252				var location string
16253				err = json.Unmarshal(*v, &location)
16254				if err != nil {
16255					return err
16256				}
16257				scl.Location = &location
16258			}
16259		case "kind":
16260			if v != nil {
16261				var kind string
16262				err = json.Unmarshal(*v, &kind)
16263				if err != nil {
16264					return err
16265				}
16266				scl.Kind = &kind
16267			}
16268		case "id":
16269			if v != nil {
16270				var ID string
16271				err = json.Unmarshal(*v, &ID)
16272				if err != nil {
16273					return err
16274				}
16275				scl.ID = &ID
16276			}
16277		case "name":
16278			if v != nil {
16279				var name string
16280				err = json.Unmarshal(*v, &name)
16281				if err != nil {
16282					return err
16283				}
16284				scl.Name = &name
16285			}
16286		case "type":
16287			if v != nil {
16288				var typeVar string
16289				err = json.Unmarshal(*v, &typeVar)
16290				if err != nil {
16291					return err
16292				}
16293				scl.Type = &typeVar
16294			}
16295		}
16296	}
16297
16298	return nil
16299}
16300
16301// ServerCommunicationLinkListResult a list of server communication links.
16302type ServerCommunicationLinkListResult struct {
16303	autorest.Response `json:"-"`
16304	// Value - The list of server communication links.
16305	Value *[]ServerCommunicationLink `json:"value,omitempty"`
16306}
16307
16308// ServerCommunicationLinkProperties the properties of a server communication link.
16309type ServerCommunicationLinkProperties struct {
16310	// State - READ-ONLY; The state.
16311	State *string `json:"state,omitempty"`
16312	// PartnerServer - The name of the partner server.
16313	PartnerServer *string `json:"partnerServer,omitempty"`
16314}
16315
16316// MarshalJSON is the custom marshaler for ServerCommunicationLinkProperties.
16317func (sclp ServerCommunicationLinkProperties) MarshalJSON() ([]byte, error) {
16318	objectMap := make(map[string]interface{})
16319	if sclp.PartnerServer != nil {
16320		objectMap["partnerServer"] = sclp.PartnerServer
16321	}
16322	return json.Marshal(objectMap)
16323}
16324
16325// ServerCommunicationLinksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of
16326// a long-running operation.
16327type ServerCommunicationLinksCreateOrUpdateFuture struct {
16328	azure.FutureAPI
16329	// Result returns the result of the asynchronous operation.
16330	// If the operation has not completed it will return an error.
16331	Result func(ServerCommunicationLinksClient) (ServerCommunicationLink, error)
16332}
16333
16334// ServerConnectionPolicy a server secure connection policy.
16335type ServerConnectionPolicy struct {
16336	autorest.Response `json:"-"`
16337	// Kind - READ-ONLY; Metadata used for the Azure portal experience.
16338	Kind *string `json:"kind,omitempty"`
16339	// Location - READ-ONLY; Resource location.
16340	Location *string `json:"location,omitempty"`
16341	// ServerConnectionPolicyProperties - The properties of the server secure connection policy.
16342	*ServerConnectionPolicyProperties `json:"properties,omitempty"`
16343	// ID - READ-ONLY; Resource ID.
16344	ID *string `json:"id,omitempty"`
16345	// Name - READ-ONLY; Resource name.
16346	Name *string `json:"name,omitempty"`
16347	// Type - READ-ONLY; Resource type.
16348	Type *string `json:"type,omitempty"`
16349}
16350
16351// MarshalJSON is the custom marshaler for ServerConnectionPolicy.
16352func (scp ServerConnectionPolicy) MarshalJSON() ([]byte, error) {
16353	objectMap := make(map[string]interface{})
16354	if scp.ServerConnectionPolicyProperties != nil {
16355		objectMap["properties"] = scp.ServerConnectionPolicyProperties
16356	}
16357	return json.Marshal(objectMap)
16358}
16359
16360// UnmarshalJSON is the custom unmarshaler for ServerConnectionPolicy struct.
16361func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error {
16362	var m map[string]*json.RawMessage
16363	err := json.Unmarshal(body, &m)
16364	if err != nil {
16365		return err
16366	}
16367	for k, v := range m {
16368		switch k {
16369		case "kind":
16370			if v != nil {
16371				var kind string
16372				err = json.Unmarshal(*v, &kind)
16373				if err != nil {
16374					return err
16375				}
16376				scp.Kind = &kind
16377			}
16378		case "location":
16379			if v != nil {
16380				var location string
16381				err = json.Unmarshal(*v, &location)
16382				if err != nil {
16383					return err
16384				}
16385				scp.Location = &location
16386			}
16387		case "properties":
16388			if v != nil {
16389				var serverConnectionPolicyProperties ServerConnectionPolicyProperties
16390				err = json.Unmarshal(*v, &serverConnectionPolicyProperties)
16391				if err != nil {
16392					return err
16393				}
16394				scp.ServerConnectionPolicyProperties = &serverConnectionPolicyProperties
16395			}
16396		case "id":
16397			if v != nil {
16398				var ID string
16399				err = json.Unmarshal(*v, &ID)
16400				if err != nil {
16401					return err
16402				}
16403				scp.ID = &ID
16404			}
16405		case "name":
16406			if v != nil {
16407				var name string
16408				err = json.Unmarshal(*v, &name)
16409				if err != nil {
16410					return err
16411				}
16412				scp.Name = &name
16413			}
16414		case "type":
16415			if v != nil {
16416				var typeVar string
16417				err = json.Unmarshal(*v, &typeVar)
16418				if err != nil {
16419					return err
16420				}
16421				scp.Type = &typeVar
16422			}
16423		}
16424	}
16425
16426	return nil
16427}
16428
16429// ServerConnectionPolicyProperties the properties of a server secure connection policy.
16430type ServerConnectionPolicyProperties struct {
16431	// ConnectionType - The server connection type. Possible values include: 'ServerConnectionTypeDefault', 'ServerConnectionTypeProxy', 'ServerConnectionTypeRedirect'
16432	ConnectionType ServerConnectionType `json:"connectionType,omitempty"`
16433}
16434
16435// ServerDNSAlias a server DNS alias.
16436type ServerDNSAlias struct {
16437	autorest.Response `json:"-"`
16438	// ServerDNSAliasProperties - Resource properties.
16439	*ServerDNSAliasProperties `json:"properties,omitempty"`
16440	// ID - READ-ONLY; Resource ID.
16441	ID *string `json:"id,omitempty"`
16442	// Name - READ-ONLY; Resource name.
16443	Name *string `json:"name,omitempty"`
16444	// Type - READ-ONLY; Resource type.
16445	Type *string `json:"type,omitempty"`
16446}
16447
16448// MarshalJSON is the custom marshaler for ServerDNSAlias.
16449func (sda ServerDNSAlias) MarshalJSON() ([]byte, error) {
16450	objectMap := make(map[string]interface{})
16451	if sda.ServerDNSAliasProperties != nil {
16452		objectMap["properties"] = sda.ServerDNSAliasProperties
16453	}
16454	return json.Marshal(objectMap)
16455}
16456
16457// UnmarshalJSON is the custom unmarshaler for ServerDNSAlias struct.
16458func (sda *ServerDNSAlias) UnmarshalJSON(body []byte) error {
16459	var m map[string]*json.RawMessage
16460	err := json.Unmarshal(body, &m)
16461	if err != nil {
16462		return err
16463	}
16464	for k, v := range m {
16465		switch k {
16466		case "properties":
16467			if v != nil {
16468				var serverDNSAliasProperties ServerDNSAliasProperties
16469				err = json.Unmarshal(*v, &serverDNSAliasProperties)
16470				if err != nil {
16471					return err
16472				}
16473				sda.ServerDNSAliasProperties = &serverDNSAliasProperties
16474			}
16475		case "id":
16476			if v != nil {
16477				var ID string
16478				err = json.Unmarshal(*v, &ID)
16479				if err != nil {
16480					return err
16481				}
16482				sda.ID = &ID
16483			}
16484		case "name":
16485			if v != nil {
16486				var name string
16487				err = json.Unmarshal(*v, &name)
16488				if err != nil {
16489					return err
16490				}
16491				sda.Name = &name
16492			}
16493		case "type":
16494			if v != nil {
16495				var typeVar string
16496				err = json.Unmarshal(*v, &typeVar)
16497				if err != nil {
16498					return err
16499				}
16500				sda.Type = &typeVar
16501			}
16502		}
16503	}
16504
16505	return nil
16506}
16507
16508// ServerDNSAliasAcquisition a server DNS alias acquisition request.
16509type ServerDNSAliasAcquisition struct {
16510	// OldServerDNSAliasID - The id of the server alias that will be acquired to point to this server instead.
16511	OldServerDNSAliasID *string `json:"oldServerDnsAliasId,omitempty"`
16512}
16513
16514// ServerDNSAliasesAcquireFuture an abstraction for monitoring and retrieving the results of a long-running
16515// operation.
16516type ServerDNSAliasesAcquireFuture struct {
16517	azure.FutureAPI
16518	// Result returns the result of the asynchronous operation.
16519	// If the operation has not completed it will return an error.
16520	Result func(ServerDNSAliasesClient) (autorest.Response, error)
16521}
16522
16523// ServerDNSAliasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
16524// long-running operation.
16525type ServerDNSAliasesCreateOrUpdateFuture struct {
16526	azure.FutureAPI
16527	// Result returns the result of the asynchronous operation.
16528	// If the operation has not completed it will return an error.
16529	Result func(ServerDNSAliasesClient) (ServerDNSAlias, error)
16530}
16531
16532// ServerDNSAliasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
16533// operation.
16534type ServerDNSAliasesDeleteFuture struct {
16535	azure.FutureAPI
16536	// Result returns the result of the asynchronous operation.
16537	// If the operation has not completed it will return an error.
16538	Result func(ServerDNSAliasesClient) (autorest.Response, error)
16539}
16540
16541// ServerDNSAliasListResult a list of server DNS aliases.
16542type ServerDNSAliasListResult struct {
16543	autorest.Response `json:"-"`
16544	// Value - READ-ONLY; Array of results.
16545	Value *[]ServerDNSAlias `json:"value,omitempty"`
16546	// NextLink - READ-ONLY; Link to retrieve next page of results.
16547	NextLink *string `json:"nextLink,omitempty"`
16548}
16549
16550// ServerDNSAliasListResultIterator provides access to a complete listing of ServerDNSAlias values.
16551type ServerDNSAliasListResultIterator struct {
16552	i    int
16553	page ServerDNSAliasListResultPage
16554}
16555
16556// NextWithContext advances to the next value.  If there was an error making
16557// the request the iterator does not advance and the error is returned.
16558func (iter *ServerDNSAliasListResultIterator) NextWithContext(ctx context.Context) (err error) {
16559	if tracing.IsEnabled() {
16560		ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasListResultIterator.NextWithContext")
16561		defer func() {
16562			sc := -1
16563			if iter.Response().Response.Response != nil {
16564				sc = iter.Response().Response.Response.StatusCode
16565			}
16566			tracing.EndSpan(ctx, sc, err)
16567		}()
16568	}
16569	iter.i++
16570	if iter.i < len(iter.page.Values()) {
16571		return nil
16572	}
16573	err = iter.page.NextWithContext(ctx)
16574	if err != nil {
16575		iter.i--
16576		return err
16577	}
16578	iter.i = 0
16579	return nil
16580}
16581
16582// Next advances to the next value.  If there was an error making
16583// the request the iterator does not advance and the error is returned.
16584// Deprecated: Use NextWithContext() instead.
16585func (iter *ServerDNSAliasListResultIterator) Next() error {
16586	return iter.NextWithContext(context.Background())
16587}
16588
16589// NotDone returns true if the enumeration should be started or is not yet complete.
16590func (iter ServerDNSAliasListResultIterator) NotDone() bool {
16591	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16592}
16593
16594// Response returns the raw server response from the last page request.
16595func (iter ServerDNSAliasListResultIterator) Response() ServerDNSAliasListResult {
16596	return iter.page.Response()
16597}
16598
16599// Value returns the current value or a zero-initialized value if the
16600// iterator has advanced beyond the end of the collection.
16601func (iter ServerDNSAliasListResultIterator) Value() ServerDNSAlias {
16602	if !iter.page.NotDone() {
16603		return ServerDNSAlias{}
16604	}
16605	return iter.page.Values()[iter.i]
16606}
16607
16608// Creates a new instance of the ServerDNSAliasListResultIterator type.
16609func NewServerDNSAliasListResultIterator(page ServerDNSAliasListResultPage) ServerDNSAliasListResultIterator {
16610	return ServerDNSAliasListResultIterator{page: page}
16611}
16612
16613// IsEmpty returns true if the ListResult contains no values.
16614func (sdalr ServerDNSAliasListResult) IsEmpty() bool {
16615	return sdalr.Value == nil || len(*sdalr.Value) == 0
16616}
16617
16618// hasNextLink returns true if the NextLink is not empty.
16619func (sdalr ServerDNSAliasListResult) hasNextLink() bool {
16620	return sdalr.NextLink != nil && len(*sdalr.NextLink) != 0
16621}
16622
16623// serverDNSAliasListResultPreparer prepares a request to retrieve the next set of results.
16624// It returns nil if no more results exist.
16625func (sdalr ServerDNSAliasListResult) serverDNSAliasListResultPreparer(ctx context.Context) (*http.Request, error) {
16626	if !sdalr.hasNextLink() {
16627		return nil, nil
16628	}
16629	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16630		autorest.AsJSON(),
16631		autorest.AsGet(),
16632		autorest.WithBaseURL(to.String(sdalr.NextLink)))
16633}
16634
16635// ServerDNSAliasListResultPage contains a page of ServerDNSAlias values.
16636type ServerDNSAliasListResultPage struct {
16637	fn    func(context.Context, ServerDNSAliasListResult) (ServerDNSAliasListResult, error)
16638	sdalr ServerDNSAliasListResult
16639}
16640
16641// NextWithContext advances to the next page of values.  If there was an error making
16642// the request the page does not advance and the error is returned.
16643func (page *ServerDNSAliasListResultPage) NextWithContext(ctx context.Context) (err error) {
16644	if tracing.IsEnabled() {
16645		ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasListResultPage.NextWithContext")
16646		defer func() {
16647			sc := -1
16648			if page.Response().Response.Response != nil {
16649				sc = page.Response().Response.Response.StatusCode
16650			}
16651			tracing.EndSpan(ctx, sc, err)
16652		}()
16653	}
16654	for {
16655		next, err := page.fn(ctx, page.sdalr)
16656		if err != nil {
16657			return err
16658		}
16659		page.sdalr = next
16660		if !next.hasNextLink() || !next.IsEmpty() {
16661			break
16662		}
16663	}
16664	return nil
16665}
16666
16667// Next advances to the next page of values.  If there was an error making
16668// the request the page does not advance and the error is returned.
16669// Deprecated: Use NextWithContext() instead.
16670func (page *ServerDNSAliasListResultPage) Next() error {
16671	return page.NextWithContext(context.Background())
16672}
16673
16674// NotDone returns true if the page enumeration should be started or is not yet complete.
16675func (page ServerDNSAliasListResultPage) NotDone() bool {
16676	return !page.sdalr.IsEmpty()
16677}
16678
16679// Response returns the raw server response from the last page request.
16680func (page ServerDNSAliasListResultPage) Response() ServerDNSAliasListResult {
16681	return page.sdalr
16682}
16683
16684// Values returns the slice of values for the current page or nil if there are no values.
16685func (page ServerDNSAliasListResultPage) Values() []ServerDNSAlias {
16686	if page.sdalr.IsEmpty() {
16687		return nil
16688	}
16689	return *page.sdalr.Value
16690}
16691
16692// Creates a new instance of the ServerDNSAliasListResultPage type.
16693func NewServerDNSAliasListResultPage(cur ServerDNSAliasListResult, getNextPage func(context.Context, ServerDNSAliasListResult) (ServerDNSAliasListResult, error)) ServerDNSAliasListResultPage {
16694	return ServerDNSAliasListResultPage{
16695		fn:    getNextPage,
16696		sdalr: cur,
16697	}
16698}
16699
16700// ServerDNSAliasProperties properties of a server DNS alias.
16701type ServerDNSAliasProperties struct {
16702	// AzureDNSRecord - READ-ONLY; The fully qualified DNS record for alias
16703	AzureDNSRecord *string `json:"azureDnsRecord,omitempty"`
16704}
16705
16706// ServerInfo server info for the server trust group.
16707type ServerInfo struct {
16708	// ServerID - Server Id.
16709	ServerID *string `json:"serverId,omitempty"`
16710}
16711
16712// ServerKey a server key.
16713type ServerKey struct {
16714	autorest.Response `json:"-"`
16715	// Kind - Kind of encryption protector. This is metadata used for the Azure portal experience.
16716	Kind *string `json:"kind,omitempty"`
16717	// Location - READ-ONLY; Resource location.
16718	Location *string `json:"location,omitempty"`
16719	// ServerKeyProperties - Resource properties.
16720	*ServerKeyProperties `json:"properties,omitempty"`
16721	// ID - READ-ONLY; Resource ID.
16722	ID *string `json:"id,omitempty"`
16723	// Name - READ-ONLY; Resource name.
16724	Name *string `json:"name,omitempty"`
16725	// Type - READ-ONLY; Resource type.
16726	Type *string `json:"type,omitempty"`
16727}
16728
16729// MarshalJSON is the custom marshaler for ServerKey.
16730func (sk ServerKey) MarshalJSON() ([]byte, error) {
16731	objectMap := make(map[string]interface{})
16732	if sk.Kind != nil {
16733		objectMap["kind"] = sk.Kind
16734	}
16735	if sk.ServerKeyProperties != nil {
16736		objectMap["properties"] = sk.ServerKeyProperties
16737	}
16738	return json.Marshal(objectMap)
16739}
16740
16741// UnmarshalJSON is the custom unmarshaler for ServerKey struct.
16742func (sk *ServerKey) UnmarshalJSON(body []byte) error {
16743	var m map[string]*json.RawMessage
16744	err := json.Unmarshal(body, &m)
16745	if err != nil {
16746		return err
16747	}
16748	for k, v := range m {
16749		switch k {
16750		case "kind":
16751			if v != nil {
16752				var kind string
16753				err = json.Unmarshal(*v, &kind)
16754				if err != nil {
16755					return err
16756				}
16757				sk.Kind = &kind
16758			}
16759		case "location":
16760			if v != nil {
16761				var location string
16762				err = json.Unmarshal(*v, &location)
16763				if err != nil {
16764					return err
16765				}
16766				sk.Location = &location
16767			}
16768		case "properties":
16769			if v != nil {
16770				var serverKeyProperties ServerKeyProperties
16771				err = json.Unmarshal(*v, &serverKeyProperties)
16772				if err != nil {
16773					return err
16774				}
16775				sk.ServerKeyProperties = &serverKeyProperties
16776			}
16777		case "id":
16778			if v != nil {
16779				var ID string
16780				err = json.Unmarshal(*v, &ID)
16781				if err != nil {
16782					return err
16783				}
16784				sk.ID = &ID
16785			}
16786		case "name":
16787			if v != nil {
16788				var name string
16789				err = json.Unmarshal(*v, &name)
16790				if err != nil {
16791					return err
16792				}
16793				sk.Name = &name
16794			}
16795		case "type":
16796			if v != nil {
16797				var typeVar string
16798				err = json.Unmarshal(*v, &typeVar)
16799				if err != nil {
16800					return err
16801				}
16802				sk.Type = &typeVar
16803			}
16804		}
16805	}
16806
16807	return nil
16808}
16809
16810// ServerKeyListResult a list of server keys.
16811type ServerKeyListResult struct {
16812	autorest.Response `json:"-"`
16813	// Value - READ-ONLY; Array of results.
16814	Value *[]ServerKey `json:"value,omitempty"`
16815	// NextLink - READ-ONLY; Link to retrieve next page of results.
16816	NextLink *string `json:"nextLink,omitempty"`
16817}
16818
16819// ServerKeyListResultIterator provides access to a complete listing of ServerKey values.
16820type ServerKeyListResultIterator struct {
16821	i    int
16822	page ServerKeyListResultPage
16823}
16824
16825// NextWithContext advances to the next value.  If there was an error making
16826// the request the iterator does not advance and the error is returned.
16827func (iter *ServerKeyListResultIterator) NextWithContext(ctx context.Context) (err error) {
16828	if tracing.IsEnabled() {
16829		ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeyListResultIterator.NextWithContext")
16830		defer func() {
16831			sc := -1
16832			if iter.Response().Response.Response != nil {
16833				sc = iter.Response().Response.Response.StatusCode
16834			}
16835			tracing.EndSpan(ctx, sc, err)
16836		}()
16837	}
16838	iter.i++
16839	if iter.i < len(iter.page.Values()) {
16840		return nil
16841	}
16842	err = iter.page.NextWithContext(ctx)
16843	if err != nil {
16844		iter.i--
16845		return err
16846	}
16847	iter.i = 0
16848	return nil
16849}
16850
16851// Next advances to the next value.  If there was an error making
16852// the request the iterator does not advance and the error is returned.
16853// Deprecated: Use NextWithContext() instead.
16854func (iter *ServerKeyListResultIterator) Next() error {
16855	return iter.NextWithContext(context.Background())
16856}
16857
16858// NotDone returns true if the enumeration should be started or is not yet complete.
16859func (iter ServerKeyListResultIterator) NotDone() bool {
16860	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16861}
16862
16863// Response returns the raw server response from the last page request.
16864func (iter ServerKeyListResultIterator) Response() ServerKeyListResult {
16865	return iter.page.Response()
16866}
16867
16868// Value returns the current value or a zero-initialized value if the
16869// iterator has advanced beyond the end of the collection.
16870func (iter ServerKeyListResultIterator) Value() ServerKey {
16871	if !iter.page.NotDone() {
16872		return ServerKey{}
16873	}
16874	return iter.page.Values()[iter.i]
16875}
16876
16877// Creates a new instance of the ServerKeyListResultIterator type.
16878func NewServerKeyListResultIterator(page ServerKeyListResultPage) ServerKeyListResultIterator {
16879	return ServerKeyListResultIterator{page: page}
16880}
16881
16882// IsEmpty returns true if the ListResult contains no values.
16883func (sklr ServerKeyListResult) IsEmpty() bool {
16884	return sklr.Value == nil || len(*sklr.Value) == 0
16885}
16886
16887// hasNextLink returns true if the NextLink is not empty.
16888func (sklr ServerKeyListResult) hasNextLink() bool {
16889	return sklr.NextLink != nil && len(*sklr.NextLink) != 0
16890}
16891
16892// serverKeyListResultPreparer prepares a request to retrieve the next set of results.
16893// It returns nil if no more results exist.
16894func (sklr ServerKeyListResult) serverKeyListResultPreparer(ctx context.Context) (*http.Request, error) {
16895	if !sklr.hasNextLink() {
16896		return nil, nil
16897	}
16898	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16899		autorest.AsJSON(),
16900		autorest.AsGet(),
16901		autorest.WithBaseURL(to.String(sklr.NextLink)))
16902}
16903
16904// ServerKeyListResultPage contains a page of ServerKey values.
16905type ServerKeyListResultPage struct {
16906	fn   func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)
16907	sklr ServerKeyListResult
16908}
16909
16910// NextWithContext advances to the next page of values.  If there was an error making
16911// the request the page does not advance and the error is returned.
16912func (page *ServerKeyListResultPage) NextWithContext(ctx context.Context) (err error) {
16913	if tracing.IsEnabled() {
16914		ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeyListResultPage.NextWithContext")
16915		defer func() {
16916			sc := -1
16917			if page.Response().Response.Response != nil {
16918				sc = page.Response().Response.Response.StatusCode
16919			}
16920			tracing.EndSpan(ctx, sc, err)
16921		}()
16922	}
16923	for {
16924		next, err := page.fn(ctx, page.sklr)
16925		if err != nil {
16926			return err
16927		}
16928		page.sklr = next
16929		if !next.hasNextLink() || !next.IsEmpty() {
16930			break
16931		}
16932	}
16933	return nil
16934}
16935
16936// Next advances to the next page of values.  If there was an error making
16937// the request the page does not advance and the error is returned.
16938// Deprecated: Use NextWithContext() instead.
16939func (page *ServerKeyListResultPage) Next() error {
16940	return page.NextWithContext(context.Background())
16941}
16942
16943// NotDone returns true if the page enumeration should be started or is not yet complete.
16944func (page ServerKeyListResultPage) NotDone() bool {
16945	return !page.sklr.IsEmpty()
16946}
16947
16948// Response returns the raw server response from the last page request.
16949func (page ServerKeyListResultPage) Response() ServerKeyListResult {
16950	return page.sklr
16951}
16952
16953// Values returns the slice of values for the current page or nil if there are no values.
16954func (page ServerKeyListResultPage) Values() []ServerKey {
16955	if page.sklr.IsEmpty() {
16956		return nil
16957	}
16958	return *page.sklr.Value
16959}
16960
16961// Creates a new instance of the ServerKeyListResultPage type.
16962func NewServerKeyListResultPage(cur ServerKeyListResult, getNextPage func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)) ServerKeyListResultPage {
16963	return ServerKeyListResultPage{
16964		fn:   getNextPage,
16965		sklr: cur,
16966	}
16967}
16968
16969// ServerKeyProperties properties for a server key execution.
16970type ServerKeyProperties struct {
16971	// Subregion - READ-ONLY; Subregion of the server key.
16972	Subregion *string `json:"subregion,omitempty"`
16973	// ServerKeyType - The server key type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
16974	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
16975	// URI - The URI of the server key.
16976	URI *string `json:"uri,omitempty"`
16977	// Thumbprint - Thumbprint of the server key.
16978	Thumbprint *string `json:"thumbprint,omitempty"`
16979	// CreationDate - The server key creation date.
16980	CreationDate *date.Time `json:"creationDate,omitempty"`
16981}
16982
16983// MarshalJSON is the custom marshaler for ServerKeyProperties.
16984func (skp ServerKeyProperties) MarshalJSON() ([]byte, error) {
16985	objectMap := make(map[string]interface{})
16986	if skp.ServerKeyType != "" {
16987		objectMap["serverKeyType"] = skp.ServerKeyType
16988	}
16989	if skp.URI != nil {
16990		objectMap["uri"] = skp.URI
16991	}
16992	if skp.Thumbprint != nil {
16993		objectMap["thumbprint"] = skp.Thumbprint
16994	}
16995	if skp.CreationDate != nil {
16996		objectMap["creationDate"] = skp.CreationDate
16997	}
16998	return json.Marshal(objectMap)
16999}
17000
17001// ServerKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
17002// long-running operation.
17003type ServerKeysCreateOrUpdateFuture struct {
17004	azure.FutureAPI
17005	// Result returns the result of the asynchronous operation.
17006	// If the operation has not completed it will return an error.
17007	Result func(ServerKeysClient) (ServerKey, error)
17008}
17009
17010// ServerKeysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
17011// operation.
17012type ServerKeysDeleteFuture struct {
17013	azure.FutureAPI
17014	// Result returns the result of the asynchronous operation.
17015	// If the operation has not completed it will return an error.
17016	Result func(ServerKeysClient) (autorest.Response, error)
17017}
17018
17019// ServerListResult a list of servers.
17020type ServerListResult struct {
17021	autorest.Response `json:"-"`
17022	// Value - READ-ONLY; Array of results.
17023	Value *[]Server `json:"value,omitempty"`
17024	// NextLink - READ-ONLY; Link to retrieve next page of results.
17025	NextLink *string `json:"nextLink,omitempty"`
17026}
17027
17028// ServerListResultIterator provides access to a complete listing of Server values.
17029type ServerListResultIterator struct {
17030	i    int
17031	page ServerListResultPage
17032}
17033
17034// NextWithContext advances to the next value.  If there was an error making
17035// the request the iterator does not advance and the error is returned.
17036func (iter *ServerListResultIterator) NextWithContext(ctx context.Context) (err error) {
17037	if tracing.IsEnabled() {
17038		ctx = tracing.StartSpan(ctx, fqdn+"/ServerListResultIterator.NextWithContext")
17039		defer func() {
17040			sc := -1
17041			if iter.Response().Response.Response != nil {
17042				sc = iter.Response().Response.Response.StatusCode
17043			}
17044			tracing.EndSpan(ctx, sc, err)
17045		}()
17046	}
17047	iter.i++
17048	if iter.i < len(iter.page.Values()) {
17049		return nil
17050	}
17051	err = iter.page.NextWithContext(ctx)
17052	if err != nil {
17053		iter.i--
17054		return err
17055	}
17056	iter.i = 0
17057	return nil
17058}
17059
17060// Next advances to the next value.  If there was an error making
17061// the request the iterator does not advance and the error is returned.
17062// Deprecated: Use NextWithContext() instead.
17063func (iter *ServerListResultIterator) Next() error {
17064	return iter.NextWithContext(context.Background())
17065}
17066
17067// NotDone returns true if the enumeration should be started or is not yet complete.
17068func (iter ServerListResultIterator) NotDone() bool {
17069	return iter.page.NotDone() && iter.i < len(iter.page.Values())
17070}
17071
17072// Response returns the raw server response from the last page request.
17073func (iter ServerListResultIterator) Response() ServerListResult {
17074	return iter.page.Response()
17075}
17076
17077// Value returns the current value or a zero-initialized value if the
17078// iterator has advanced beyond the end of the collection.
17079func (iter ServerListResultIterator) Value() Server {
17080	if !iter.page.NotDone() {
17081		return Server{}
17082	}
17083	return iter.page.Values()[iter.i]
17084}
17085
17086// Creates a new instance of the ServerListResultIterator type.
17087func NewServerListResultIterator(page ServerListResultPage) ServerListResultIterator {
17088	return ServerListResultIterator{page: page}
17089}
17090
17091// IsEmpty returns true if the ListResult contains no values.
17092func (slr ServerListResult) IsEmpty() bool {
17093	return slr.Value == nil || len(*slr.Value) == 0
17094}
17095
17096// hasNextLink returns true if the NextLink is not empty.
17097func (slr ServerListResult) hasNextLink() bool {
17098	return slr.NextLink != nil && len(*slr.NextLink) != 0
17099}
17100
17101// serverListResultPreparer prepares a request to retrieve the next set of results.
17102// It returns nil if no more results exist.
17103func (slr ServerListResult) serverListResultPreparer(ctx context.Context) (*http.Request, error) {
17104	if !slr.hasNextLink() {
17105		return nil, nil
17106	}
17107	return autorest.Prepare((&http.Request{}).WithContext(ctx),
17108		autorest.AsJSON(),
17109		autorest.AsGet(),
17110		autorest.WithBaseURL(to.String(slr.NextLink)))
17111}
17112
17113// ServerListResultPage contains a page of Server values.
17114type ServerListResultPage struct {
17115	fn  func(context.Context, ServerListResult) (ServerListResult, error)
17116	slr ServerListResult
17117}
17118
17119// NextWithContext advances to the next page of values.  If there was an error making
17120// the request the page does not advance and the error is returned.
17121func (page *ServerListResultPage) NextWithContext(ctx context.Context) (err error) {
17122	if tracing.IsEnabled() {
17123		ctx = tracing.StartSpan(ctx, fqdn+"/ServerListResultPage.NextWithContext")
17124		defer func() {
17125			sc := -1
17126			if page.Response().Response.Response != nil {
17127				sc = page.Response().Response.Response.StatusCode
17128			}
17129			tracing.EndSpan(ctx, sc, err)
17130		}()
17131	}
17132	for {
17133		next, err := page.fn(ctx, page.slr)
17134		if err != nil {
17135			return err
17136		}
17137		page.slr = next
17138		if !next.hasNextLink() || !next.IsEmpty() {
17139			break
17140		}
17141	}
17142	return nil
17143}
17144
17145// Next advances to the next page of values.  If there was an error making
17146// the request the page does not advance and the error is returned.
17147// Deprecated: Use NextWithContext() instead.
17148func (page *ServerListResultPage) Next() error {
17149	return page.NextWithContext(context.Background())
17150}
17151
17152// NotDone returns true if the page enumeration should be started or is not yet complete.
17153func (page ServerListResultPage) NotDone() bool {
17154	return !page.slr.IsEmpty()
17155}
17156
17157// Response returns the raw server response from the last page request.
17158func (page ServerListResultPage) Response() ServerListResult {
17159	return page.slr
17160}
17161
17162// Values returns the slice of values for the current page or nil if there are no values.
17163func (page ServerListResultPage) Values() []Server {
17164	if page.slr.IsEmpty() {
17165		return nil
17166	}
17167	return *page.slr.Value
17168}
17169
17170// Creates a new instance of the ServerListResultPage type.
17171func NewServerListResultPage(cur ServerListResult, getNextPage func(context.Context, ServerListResult) (ServerListResult, error)) ServerListResultPage {
17172	return ServerListResultPage{
17173		fn:  getNextPage,
17174		slr: cur,
17175	}
17176}
17177
17178// ServerPrivateEndpointConnection a private endpoint connection under a server
17179type ServerPrivateEndpointConnection struct {
17180	// ID - READ-ONLY; Resource ID.
17181	ID *string `json:"id,omitempty"`
17182	// Properties - READ-ONLY; Private endpoint connection properties
17183	Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
17184}
17185
17186// ServerProperties the properties of a server.
17187type ServerProperties struct {
17188	// AdministratorLogin - Administrator username for the server. Once created it cannot be changed.
17189	AdministratorLogin *string `json:"administratorLogin,omitempty"`
17190	// AdministratorLoginPassword - The administrator login password (required for server creation).
17191	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
17192	// Version - The version of the server.
17193	Version *string `json:"version,omitempty"`
17194	// State - READ-ONLY; The state of the server.
17195	State *string `json:"state,omitempty"`
17196	// FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the server.
17197	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
17198	// PrivateEndpointConnections - READ-ONLY; List of private endpoint connections on a server
17199	PrivateEndpointConnections *[]ServerPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
17200	// MinimalTLSVersion - Minimal TLS version. Allowed values: '1.0', '1.1', '1.2'
17201	MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"`
17202	// 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'
17203	PublicNetworkAccess ServerPublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
17204}
17205
17206// MarshalJSON is the custom marshaler for ServerProperties.
17207func (sp ServerProperties) MarshalJSON() ([]byte, error) {
17208	objectMap := make(map[string]interface{})
17209	if sp.AdministratorLogin != nil {
17210		objectMap["administratorLogin"] = sp.AdministratorLogin
17211	}
17212	if sp.AdministratorLoginPassword != nil {
17213		objectMap["administratorLoginPassword"] = sp.AdministratorLoginPassword
17214	}
17215	if sp.Version != nil {
17216		objectMap["version"] = sp.Version
17217	}
17218	if sp.MinimalTLSVersion != nil {
17219		objectMap["minimalTlsVersion"] = sp.MinimalTLSVersion
17220	}
17221	if sp.PublicNetworkAccess != "" {
17222		objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess
17223	}
17224	return json.Marshal(objectMap)
17225}
17226
17227// ServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
17228// operation.
17229type ServersCreateOrUpdateFuture struct {
17230	azure.FutureAPI
17231	// Result returns the result of the asynchronous operation.
17232	// If the operation has not completed it will return an error.
17233	Result func(ServersClient) (Server, error)
17234}
17235
17236// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
17237// operation.
17238type ServersDeleteFuture struct {
17239	azure.FutureAPI
17240	// Result returns the result of the asynchronous operation.
17241	// If the operation has not completed it will return an error.
17242	Result func(ServersClient) (autorest.Response, error)
17243}
17244
17245// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
17246// of a long-running operation.
17247type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct {
17248	azure.FutureAPI
17249	// Result returns the result of the asynchronous operation.
17250	// If the operation has not completed it will return an error.
17251	Result func(ServerSecurityAlertPoliciesClient) (ServerSecurityAlertPolicy, error)
17252}
17253
17254// ServerSecurityAlertPolicy a server security alert policy.
17255type ServerSecurityAlertPolicy struct {
17256	autorest.Response `json:"-"`
17257	// SecurityAlertPolicyProperties - Resource properties.
17258	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
17259	// ID - READ-ONLY; Resource ID.
17260	ID *string `json:"id,omitempty"`
17261	// Name - READ-ONLY; Resource name.
17262	Name *string `json:"name,omitempty"`
17263	// Type - READ-ONLY; Resource type.
17264	Type *string `json:"type,omitempty"`
17265}
17266
17267// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicy.
17268func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
17269	objectMap := make(map[string]interface{})
17270	if ssap.SecurityAlertPolicyProperties != nil {
17271		objectMap["properties"] = ssap.SecurityAlertPolicyProperties
17272	}
17273	return json.Marshal(objectMap)
17274}
17275
17276// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct.
17277func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
17278	var m map[string]*json.RawMessage
17279	err := json.Unmarshal(body, &m)
17280	if err != nil {
17281		return err
17282	}
17283	for k, v := range m {
17284		switch k {
17285		case "properties":
17286			if v != nil {
17287				var securityAlertPolicyProperties SecurityAlertPolicyProperties
17288				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
17289				if err != nil {
17290					return err
17291				}
17292				ssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
17293			}
17294		case "id":
17295			if v != nil {
17296				var ID string
17297				err = json.Unmarshal(*v, &ID)
17298				if err != nil {
17299					return err
17300				}
17301				ssap.ID = &ID
17302			}
17303		case "name":
17304			if v != nil {
17305				var name string
17306				err = json.Unmarshal(*v, &name)
17307				if err != nil {
17308					return err
17309				}
17310				ssap.Name = &name
17311			}
17312		case "type":
17313			if v != nil {
17314				var typeVar string
17315				err = json.Unmarshal(*v, &typeVar)
17316				if err != nil {
17317					return err
17318				}
17319				ssap.Type = &typeVar
17320			}
17321		}
17322	}
17323
17324	return nil
17325}
17326
17327// ServersImportDatabaseFuture an abstraction for monitoring and retrieving the results of a long-running
17328// operation.
17329type ServersImportDatabaseFuture struct {
17330	azure.FutureAPI
17331	// Result returns the result of the asynchronous operation.
17332	// If the operation has not completed it will return an error.
17333	Result func(ServersClient) (ImportExportOperationResult, error)
17334}
17335
17336// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
17337// operation.
17338type ServersUpdateFuture struct {
17339	azure.FutureAPI
17340	// Result returns the result of the asynchronous operation.
17341	// If the operation has not completed it will return an error.
17342	Result func(ServersClient) (Server, error)
17343}
17344
17345// ServerTrustGroup a server trust group.
17346type ServerTrustGroup struct {
17347	autorest.Response `json:"-"`
17348	// ServerTrustGroupProperties - Resource properties.
17349	*ServerTrustGroupProperties `json:"properties,omitempty"`
17350	// ID - READ-ONLY; Resource ID.
17351	ID *string `json:"id,omitempty"`
17352	// Name - READ-ONLY; Resource name.
17353	Name *string `json:"name,omitempty"`
17354	// Type - READ-ONLY; Resource type.
17355	Type *string `json:"type,omitempty"`
17356}
17357
17358// MarshalJSON is the custom marshaler for ServerTrustGroup.
17359func (stg ServerTrustGroup) MarshalJSON() ([]byte, error) {
17360	objectMap := make(map[string]interface{})
17361	if stg.ServerTrustGroupProperties != nil {
17362		objectMap["properties"] = stg.ServerTrustGroupProperties
17363	}
17364	return json.Marshal(objectMap)
17365}
17366
17367// UnmarshalJSON is the custom unmarshaler for ServerTrustGroup struct.
17368func (stg *ServerTrustGroup) UnmarshalJSON(body []byte) error {
17369	var m map[string]*json.RawMessage
17370	err := json.Unmarshal(body, &m)
17371	if err != nil {
17372		return err
17373	}
17374	for k, v := range m {
17375		switch k {
17376		case "properties":
17377			if v != nil {
17378				var serverTrustGroupProperties ServerTrustGroupProperties
17379				err = json.Unmarshal(*v, &serverTrustGroupProperties)
17380				if err != nil {
17381					return err
17382				}
17383				stg.ServerTrustGroupProperties = &serverTrustGroupProperties
17384			}
17385		case "id":
17386			if v != nil {
17387				var ID string
17388				err = json.Unmarshal(*v, &ID)
17389				if err != nil {
17390					return err
17391				}
17392				stg.ID = &ID
17393			}
17394		case "name":
17395			if v != nil {
17396				var name string
17397				err = json.Unmarshal(*v, &name)
17398				if err != nil {
17399					return err
17400				}
17401				stg.Name = &name
17402			}
17403		case "type":
17404			if v != nil {
17405				var typeVar string
17406				err = json.Unmarshal(*v, &typeVar)
17407				if err != nil {
17408					return err
17409				}
17410				stg.Type = &typeVar
17411			}
17412		}
17413	}
17414
17415	return nil
17416}
17417
17418// ServerTrustGroupListResult a list of server trust groups.
17419type ServerTrustGroupListResult struct {
17420	autorest.Response `json:"-"`
17421	// Value - READ-ONLY; Array of results.
17422	Value *[]ServerTrustGroup `json:"value,omitempty"`
17423	// NextLink - READ-ONLY; Link to retrieve next page of results.
17424	NextLink *string `json:"nextLink,omitempty"`
17425}
17426
17427// ServerTrustGroupListResultIterator provides access to a complete listing of ServerTrustGroup values.
17428type ServerTrustGroupListResultIterator struct {
17429	i    int
17430	page ServerTrustGroupListResultPage
17431}
17432
17433// NextWithContext advances to the next value.  If there was an error making
17434// the request the iterator does not advance and the error is returned.
17435func (iter *ServerTrustGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
17436	if tracing.IsEnabled() {
17437		ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustGroupListResultIterator.NextWithContext")
17438		defer func() {
17439			sc := -1
17440			if iter.Response().Response.Response != nil {
17441				sc = iter.Response().Response.Response.StatusCode
17442			}
17443			tracing.EndSpan(ctx, sc, err)
17444		}()
17445	}
17446	iter.i++
17447	if iter.i < len(iter.page.Values()) {
17448		return nil
17449	}
17450	err = iter.page.NextWithContext(ctx)
17451	if err != nil {
17452		iter.i--
17453		return err
17454	}
17455	iter.i = 0
17456	return nil
17457}
17458
17459// Next advances to the next value.  If there was an error making
17460// the request the iterator does not advance and the error is returned.
17461// Deprecated: Use NextWithContext() instead.
17462func (iter *ServerTrustGroupListResultIterator) Next() error {
17463	return iter.NextWithContext(context.Background())
17464}
17465
17466// NotDone returns true if the enumeration should be started or is not yet complete.
17467func (iter ServerTrustGroupListResultIterator) NotDone() bool {
17468	return iter.page.NotDone() && iter.i < len(iter.page.Values())
17469}
17470
17471// Response returns the raw server response from the last page request.
17472func (iter ServerTrustGroupListResultIterator) Response() ServerTrustGroupListResult {
17473	return iter.page.Response()
17474}
17475
17476// Value returns the current value or a zero-initialized value if the
17477// iterator has advanced beyond the end of the collection.
17478func (iter ServerTrustGroupListResultIterator) Value() ServerTrustGroup {
17479	if !iter.page.NotDone() {
17480		return ServerTrustGroup{}
17481	}
17482	return iter.page.Values()[iter.i]
17483}
17484
17485// Creates a new instance of the ServerTrustGroupListResultIterator type.
17486func NewServerTrustGroupListResultIterator(page ServerTrustGroupListResultPage) ServerTrustGroupListResultIterator {
17487	return ServerTrustGroupListResultIterator{page: page}
17488}
17489
17490// IsEmpty returns true if the ListResult contains no values.
17491func (stglr ServerTrustGroupListResult) IsEmpty() bool {
17492	return stglr.Value == nil || len(*stglr.Value) == 0
17493}
17494
17495// hasNextLink returns true if the NextLink is not empty.
17496func (stglr ServerTrustGroupListResult) hasNextLink() bool {
17497	return stglr.NextLink != nil && len(*stglr.NextLink) != 0
17498}
17499
17500// serverTrustGroupListResultPreparer prepares a request to retrieve the next set of results.
17501// It returns nil if no more results exist.
17502func (stglr ServerTrustGroupListResult) serverTrustGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
17503	if !stglr.hasNextLink() {
17504		return nil, nil
17505	}
17506	return autorest.Prepare((&http.Request{}).WithContext(ctx),
17507		autorest.AsJSON(),
17508		autorest.AsGet(),
17509		autorest.WithBaseURL(to.String(stglr.NextLink)))
17510}
17511
17512// ServerTrustGroupListResultPage contains a page of ServerTrustGroup values.
17513type ServerTrustGroupListResultPage struct {
17514	fn    func(context.Context, ServerTrustGroupListResult) (ServerTrustGroupListResult, error)
17515	stglr ServerTrustGroupListResult
17516}
17517
17518// NextWithContext advances to the next page of values.  If there was an error making
17519// the request the page does not advance and the error is returned.
17520func (page *ServerTrustGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
17521	if tracing.IsEnabled() {
17522		ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustGroupListResultPage.NextWithContext")
17523		defer func() {
17524			sc := -1
17525			if page.Response().Response.Response != nil {
17526				sc = page.Response().Response.Response.StatusCode
17527			}
17528			tracing.EndSpan(ctx, sc, err)
17529		}()
17530	}
17531	for {
17532		next, err := page.fn(ctx, page.stglr)
17533		if err != nil {
17534			return err
17535		}
17536		page.stglr = next
17537		if !next.hasNextLink() || !next.IsEmpty() {
17538			break
17539		}
17540	}
17541	return nil
17542}
17543
17544// Next advances to the next page of values.  If there was an error making
17545// the request the page does not advance and the error is returned.
17546// Deprecated: Use NextWithContext() instead.
17547func (page *ServerTrustGroupListResultPage) Next() error {
17548	return page.NextWithContext(context.Background())
17549}
17550
17551// NotDone returns true if the page enumeration should be started or is not yet complete.
17552func (page ServerTrustGroupListResultPage) NotDone() bool {
17553	return !page.stglr.IsEmpty()
17554}
17555
17556// Response returns the raw server response from the last page request.
17557func (page ServerTrustGroupListResultPage) Response() ServerTrustGroupListResult {
17558	return page.stglr
17559}
17560
17561// Values returns the slice of values for the current page or nil if there are no values.
17562func (page ServerTrustGroupListResultPage) Values() []ServerTrustGroup {
17563	if page.stglr.IsEmpty() {
17564		return nil
17565	}
17566	return *page.stglr.Value
17567}
17568
17569// Creates a new instance of the ServerTrustGroupListResultPage type.
17570func NewServerTrustGroupListResultPage(cur ServerTrustGroupListResult, getNextPage func(context.Context, ServerTrustGroupListResult) (ServerTrustGroupListResult, error)) ServerTrustGroupListResultPage {
17571	return ServerTrustGroupListResultPage{
17572		fn:    getNextPage,
17573		stglr: cur,
17574	}
17575}
17576
17577// ServerTrustGroupProperties properties of a server trust group.
17578type ServerTrustGroupProperties struct {
17579	// GroupMembers - Group members information for the server trust group.
17580	GroupMembers *[]ServerInfo `json:"groupMembers,omitempty"`
17581	// TrustScopes - Trust scope of the server trust group.
17582	TrustScopes *[]string `json:"trustScopes,omitempty"`
17583}
17584
17585// ServerTrustGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
17586// long-running operation.
17587type ServerTrustGroupsCreateOrUpdateFuture struct {
17588	azure.FutureAPI
17589	// Result returns the result of the asynchronous operation.
17590	// If the operation has not completed it will return an error.
17591	Result func(ServerTrustGroupsClient) (ServerTrustGroup, error)
17592}
17593
17594// ServerTrustGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
17595// operation.
17596type ServerTrustGroupsDeleteFuture struct {
17597	azure.FutureAPI
17598	// Result returns the result of the asynchronous operation.
17599	// If the operation has not completed it will return an error.
17600	Result func(ServerTrustGroupsClient) (autorest.Response, error)
17601}
17602
17603// ServerUpdate an update request for an Azure SQL Database server.
17604type ServerUpdate struct {
17605	// ServerProperties - Resource properties.
17606	*ServerProperties `json:"properties,omitempty"`
17607	// Tags - Resource tags.
17608	Tags map[string]*string `json:"tags"`
17609}
17610
17611// MarshalJSON is the custom marshaler for ServerUpdate.
17612func (su ServerUpdate) MarshalJSON() ([]byte, error) {
17613	objectMap := make(map[string]interface{})
17614	if su.ServerProperties != nil {
17615		objectMap["properties"] = su.ServerProperties
17616	}
17617	if su.Tags != nil {
17618		objectMap["tags"] = su.Tags
17619	}
17620	return json.Marshal(objectMap)
17621}
17622
17623// UnmarshalJSON is the custom unmarshaler for ServerUpdate struct.
17624func (su *ServerUpdate) UnmarshalJSON(body []byte) error {
17625	var m map[string]*json.RawMessage
17626	err := json.Unmarshal(body, &m)
17627	if err != nil {
17628		return err
17629	}
17630	for k, v := range m {
17631		switch k {
17632		case "properties":
17633			if v != nil {
17634				var serverProperties ServerProperties
17635				err = json.Unmarshal(*v, &serverProperties)
17636				if err != nil {
17637					return err
17638				}
17639				su.ServerProperties = &serverProperties
17640			}
17641		case "tags":
17642			if v != nil {
17643				var tags map[string]*string
17644				err = json.Unmarshal(*v, &tags)
17645				if err != nil {
17646					return err
17647				}
17648				su.Tags = tags
17649			}
17650		}
17651	}
17652
17653	return nil
17654}
17655
17656// ServerUsage represents server metrics.
17657type ServerUsage struct {
17658	// Name - READ-ONLY; Name of the server usage metric.
17659	Name *string `json:"name,omitempty"`
17660	// ResourceName - READ-ONLY; The name of the resource.
17661	ResourceName *string `json:"resourceName,omitempty"`
17662	// DisplayName - READ-ONLY; The metric display name.
17663	DisplayName *string `json:"displayName,omitempty"`
17664	// CurrentValue - READ-ONLY; The current value of the metric.
17665	CurrentValue *float64 `json:"currentValue,omitempty"`
17666	// Limit - READ-ONLY; The current limit of the metric.
17667	Limit *float64 `json:"limit,omitempty"`
17668	// Unit - READ-ONLY; The units of the metric.
17669	Unit *string `json:"unit,omitempty"`
17670	// NextResetTime - READ-ONLY; The next reset time for the metric (ISO8601 format).
17671	NextResetTime *date.Time `json:"nextResetTime,omitempty"`
17672}
17673
17674// ServerUsageListResult represents the response to a list server metrics request.
17675type ServerUsageListResult struct {
17676	autorest.Response `json:"-"`
17677	// Value - The list of server metrics for the server.
17678	Value *[]ServerUsage `json:"value,omitempty"`
17679}
17680
17681// ServerVersionCapability the server capability
17682type ServerVersionCapability struct {
17683	// Name - READ-ONLY; The server version name.
17684	Name *string `json:"name,omitempty"`
17685	// SupportedEditions - READ-ONLY; The list of supported database editions.
17686	SupportedEditions *[]EditionCapability `json:"supportedEditions,omitempty"`
17687	// SupportedElasticPoolEditions - READ-ONLY; The list of supported elastic pool editions.
17688	SupportedElasticPoolEditions *[]ElasticPoolEditionCapability `json:"supportedElasticPoolEditions,omitempty"`
17689	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
17690	Status CapabilityStatus `json:"status,omitempty"`
17691	// Reason - The reason for the capability not being available.
17692	Reason *string `json:"reason,omitempty"`
17693}
17694
17695// MarshalJSON is the custom marshaler for ServerVersionCapability.
17696func (svc ServerVersionCapability) MarshalJSON() ([]byte, error) {
17697	objectMap := make(map[string]interface{})
17698	if svc.Reason != nil {
17699		objectMap["reason"] = svc.Reason
17700	}
17701	return json.Marshal(objectMap)
17702}
17703
17704// ServerVulnerabilityAssessment a server vulnerability assessment.
17705type ServerVulnerabilityAssessment struct {
17706	autorest.Response `json:"-"`
17707	// ServerVulnerabilityAssessmentProperties - Resource properties.
17708	*ServerVulnerabilityAssessmentProperties `json:"properties,omitempty"`
17709	// ID - READ-ONLY; Resource ID.
17710	ID *string `json:"id,omitempty"`
17711	// Name - READ-ONLY; Resource name.
17712	Name *string `json:"name,omitempty"`
17713	// Type - READ-ONLY; Resource type.
17714	Type *string `json:"type,omitempty"`
17715}
17716
17717// MarshalJSON is the custom marshaler for ServerVulnerabilityAssessment.
17718func (sva ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
17719	objectMap := make(map[string]interface{})
17720	if sva.ServerVulnerabilityAssessmentProperties != nil {
17721		objectMap["properties"] = sva.ServerVulnerabilityAssessmentProperties
17722	}
17723	return json.Marshal(objectMap)
17724}
17725
17726// UnmarshalJSON is the custom unmarshaler for ServerVulnerabilityAssessment struct.
17727func (sva *ServerVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
17728	var m map[string]*json.RawMessage
17729	err := json.Unmarshal(body, &m)
17730	if err != nil {
17731		return err
17732	}
17733	for k, v := range m {
17734		switch k {
17735		case "properties":
17736			if v != nil {
17737				var serverVulnerabilityAssessmentProperties ServerVulnerabilityAssessmentProperties
17738				err = json.Unmarshal(*v, &serverVulnerabilityAssessmentProperties)
17739				if err != nil {
17740					return err
17741				}
17742				sva.ServerVulnerabilityAssessmentProperties = &serverVulnerabilityAssessmentProperties
17743			}
17744		case "id":
17745			if v != nil {
17746				var ID string
17747				err = json.Unmarshal(*v, &ID)
17748				if err != nil {
17749					return err
17750				}
17751				sva.ID = &ID
17752			}
17753		case "name":
17754			if v != nil {
17755				var name string
17756				err = json.Unmarshal(*v, &name)
17757				if err != nil {
17758					return err
17759				}
17760				sva.Name = &name
17761			}
17762		case "type":
17763			if v != nil {
17764				var typeVar string
17765				err = json.Unmarshal(*v, &typeVar)
17766				if err != nil {
17767					return err
17768				}
17769				sva.Type = &typeVar
17770			}
17771		}
17772	}
17773
17774	return nil
17775}
17776
17777// ServerVulnerabilityAssessmentListResult a list of the server's vulnerability assessments.
17778type ServerVulnerabilityAssessmentListResult struct {
17779	autorest.Response `json:"-"`
17780	// Value - READ-ONLY; Array of results.
17781	Value *[]ServerVulnerabilityAssessment `json:"value,omitempty"`
17782	// NextLink - READ-ONLY; Link to retrieve next page of results.
17783	NextLink *string `json:"nextLink,omitempty"`
17784}
17785
17786// ServerVulnerabilityAssessmentListResultIterator provides access to a complete listing of
17787// ServerVulnerabilityAssessment values.
17788type ServerVulnerabilityAssessmentListResultIterator struct {
17789	i    int
17790	page ServerVulnerabilityAssessmentListResultPage
17791}
17792
17793// NextWithContext advances to the next value.  If there was an error making
17794// the request the iterator does not advance and the error is returned.
17795func (iter *ServerVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
17796	if tracing.IsEnabled() {
17797		ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultIterator.NextWithContext")
17798		defer func() {
17799			sc := -1
17800			if iter.Response().Response.Response != nil {
17801				sc = iter.Response().Response.Response.StatusCode
17802			}
17803			tracing.EndSpan(ctx, sc, err)
17804		}()
17805	}
17806	iter.i++
17807	if iter.i < len(iter.page.Values()) {
17808		return nil
17809	}
17810	err = iter.page.NextWithContext(ctx)
17811	if err != nil {
17812		iter.i--
17813		return err
17814	}
17815	iter.i = 0
17816	return nil
17817}
17818
17819// Next advances to the next value.  If there was an error making
17820// the request the iterator does not advance and the error is returned.
17821// Deprecated: Use NextWithContext() instead.
17822func (iter *ServerVulnerabilityAssessmentListResultIterator) Next() error {
17823	return iter.NextWithContext(context.Background())
17824}
17825
17826// NotDone returns true if the enumeration should be started or is not yet complete.
17827func (iter ServerVulnerabilityAssessmentListResultIterator) NotDone() bool {
17828	return iter.page.NotDone() && iter.i < len(iter.page.Values())
17829}
17830
17831// Response returns the raw server response from the last page request.
17832func (iter ServerVulnerabilityAssessmentListResultIterator) Response() ServerVulnerabilityAssessmentListResult {
17833	return iter.page.Response()
17834}
17835
17836// Value returns the current value or a zero-initialized value if the
17837// iterator has advanced beyond the end of the collection.
17838func (iter ServerVulnerabilityAssessmentListResultIterator) Value() ServerVulnerabilityAssessment {
17839	if !iter.page.NotDone() {
17840		return ServerVulnerabilityAssessment{}
17841	}
17842	return iter.page.Values()[iter.i]
17843}
17844
17845// Creates a new instance of the ServerVulnerabilityAssessmentListResultIterator type.
17846func NewServerVulnerabilityAssessmentListResultIterator(page ServerVulnerabilityAssessmentListResultPage) ServerVulnerabilityAssessmentListResultIterator {
17847	return ServerVulnerabilityAssessmentListResultIterator{page: page}
17848}
17849
17850// IsEmpty returns true if the ListResult contains no values.
17851func (svalr ServerVulnerabilityAssessmentListResult) IsEmpty() bool {
17852	return svalr.Value == nil || len(*svalr.Value) == 0
17853}
17854
17855// hasNextLink returns true if the NextLink is not empty.
17856func (svalr ServerVulnerabilityAssessmentListResult) hasNextLink() bool {
17857	return svalr.NextLink != nil && len(*svalr.NextLink) != 0
17858}
17859
17860// serverVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
17861// It returns nil if no more results exist.
17862func (svalr ServerVulnerabilityAssessmentListResult) serverVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
17863	if !svalr.hasNextLink() {
17864		return nil, nil
17865	}
17866	return autorest.Prepare((&http.Request{}).WithContext(ctx),
17867		autorest.AsJSON(),
17868		autorest.AsGet(),
17869		autorest.WithBaseURL(to.String(svalr.NextLink)))
17870}
17871
17872// ServerVulnerabilityAssessmentListResultPage contains a page of ServerVulnerabilityAssessment values.
17873type ServerVulnerabilityAssessmentListResultPage struct {
17874	fn    func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error)
17875	svalr ServerVulnerabilityAssessmentListResult
17876}
17877
17878// NextWithContext advances to the next page of values.  If there was an error making
17879// the request the page does not advance and the error is returned.
17880func (page *ServerVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
17881	if tracing.IsEnabled() {
17882		ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultPage.NextWithContext")
17883		defer func() {
17884			sc := -1
17885			if page.Response().Response.Response != nil {
17886				sc = page.Response().Response.Response.StatusCode
17887			}
17888			tracing.EndSpan(ctx, sc, err)
17889		}()
17890	}
17891	for {
17892		next, err := page.fn(ctx, page.svalr)
17893		if err != nil {
17894			return err
17895		}
17896		page.svalr = next
17897		if !next.hasNextLink() || !next.IsEmpty() {
17898			break
17899		}
17900	}
17901	return nil
17902}
17903
17904// Next advances to the next page of values.  If there was an error making
17905// the request the page does not advance and the error is returned.
17906// Deprecated: Use NextWithContext() instead.
17907func (page *ServerVulnerabilityAssessmentListResultPage) Next() error {
17908	return page.NextWithContext(context.Background())
17909}
17910
17911// NotDone returns true if the page enumeration should be started or is not yet complete.
17912func (page ServerVulnerabilityAssessmentListResultPage) NotDone() bool {
17913	return !page.svalr.IsEmpty()
17914}
17915
17916// Response returns the raw server response from the last page request.
17917func (page ServerVulnerabilityAssessmentListResultPage) Response() ServerVulnerabilityAssessmentListResult {
17918	return page.svalr
17919}
17920
17921// Values returns the slice of values for the current page or nil if there are no values.
17922func (page ServerVulnerabilityAssessmentListResultPage) Values() []ServerVulnerabilityAssessment {
17923	if page.svalr.IsEmpty() {
17924		return nil
17925	}
17926	return *page.svalr.Value
17927}
17928
17929// Creates a new instance of the ServerVulnerabilityAssessmentListResultPage type.
17930func NewServerVulnerabilityAssessmentListResultPage(cur ServerVulnerabilityAssessmentListResult, getNextPage func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error)) ServerVulnerabilityAssessmentListResultPage {
17931	return ServerVulnerabilityAssessmentListResultPage{
17932		fn:    getNextPage,
17933		svalr: cur,
17934	}
17935}
17936
17937// ServerVulnerabilityAssessmentProperties properties of a server Vulnerability Assessment.
17938type ServerVulnerabilityAssessmentProperties struct {
17939	// StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
17940	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
17941	// 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.
17942	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
17943	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
17944	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
17945	// RecurringScans - The recurring scans settings
17946	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
17947}
17948
17949// ServiceObjective represents a database service objective.
17950type ServiceObjective struct {
17951	autorest.Response `json:"-"`
17952	// ServiceObjectiveProperties - Represents the properties of the resource.
17953	*ServiceObjectiveProperties `json:"properties,omitempty"`
17954	// ID - READ-ONLY; Resource ID.
17955	ID *string `json:"id,omitempty"`
17956	// Name - READ-ONLY; Resource name.
17957	Name *string `json:"name,omitempty"`
17958	// Type - READ-ONLY; Resource type.
17959	Type *string `json:"type,omitempty"`
17960}
17961
17962// MarshalJSON is the custom marshaler for ServiceObjective.
17963func (so ServiceObjective) MarshalJSON() ([]byte, error) {
17964	objectMap := make(map[string]interface{})
17965	if so.ServiceObjectiveProperties != nil {
17966		objectMap["properties"] = so.ServiceObjectiveProperties
17967	}
17968	return json.Marshal(objectMap)
17969}
17970
17971// UnmarshalJSON is the custom unmarshaler for ServiceObjective struct.
17972func (so *ServiceObjective) UnmarshalJSON(body []byte) error {
17973	var m map[string]*json.RawMessage
17974	err := json.Unmarshal(body, &m)
17975	if err != nil {
17976		return err
17977	}
17978	for k, v := range m {
17979		switch k {
17980		case "properties":
17981			if v != nil {
17982				var serviceObjectiveProperties ServiceObjectiveProperties
17983				err = json.Unmarshal(*v, &serviceObjectiveProperties)
17984				if err != nil {
17985					return err
17986				}
17987				so.ServiceObjectiveProperties = &serviceObjectiveProperties
17988			}
17989		case "id":
17990			if v != nil {
17991				var ID string
17992				err = json.Unmarshal(*v, &ID)
17993				if err != nil {
17994					return err
17995				}
17996				so.ID = &ID
17997			}
17998		case "name":
17999			if v != nil {
18000				var name string
18001				err = json.Unmarshal(*v, &name)
18002				if err != nil {
18003					return err
18004				}
18005				so.Name = &name
18006			}
18007		case "type":
18008			if v != nil {
18009				var typeVar string
18010				err = json.Unmarshal(*v, &typeVar)
18011				if err != nil {
18012					return err
18013				}
18014				so.Type = &typeVar
18015			}
18016		}
18017	}
18018
18019	return nil
18020}
18021
18022// ServiceObjectiveCapability the service objectives capability.
18023type ServiceObjectiveCapability struct {
18024	// ID - READ-ONLY; The unique ID of the service objective.
18025	ID *uuid.UUID `json:"id,omitempty"`
18026	// Name - READ-ONLY; The service objective name.
18027	Name *string `json:"name,omitempty"`
18028	// SupportedMaxSizes - READ-ONLY; The list of supported maximum database sizes.
18029	SupportedMaxSizes *[]MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty"`
18030	// PerformanceLevel - READ-ONLY; The performance level.
18031	PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty"`
18032	// Sku - READ-ONLY; The sku.
18033	Sku *Sku `json:"sku,omitempty"`
18034	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
18035	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
18036	// IncludedMaxSize - READ-ONLY; The included (free) max size.
18037	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
18038	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the service objective.
18039	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
18040	// SupportedAutoPauseDelay - READ-ONLY; Supported time range for auto pause delay
18041	SupportedAutoPauseDelay *AutoPauseDelayTimeRange `json:"supportedAutoPauseDelay,omitempty"`
18042	// SupportedMinCapacities - READ-ONLY; List of supported min capacities
18043	SupportedMinCapacities *[]MinCapacityCapability `json:"supportedMinCapacities,omitempty"`
18044	// ComputeModel - READ-ONLY; The compute model
18045	ComputeModel *string `json:"computeModel,omitempty"`
18046	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
18047	Status CapabilityStatus `json:"status,omitempty"`
18048	// Reason - The reason for the capability not being available.
18049	Reason *string `json:"reason,omitempty"`
18050}
18051
18052// MarshalJSON is the custom marshaler for ServiceObjectiveCapability.
18053func (soc ServiceObjectiveCapability) MarshalJSON() ([]byte, error) {
18054	objectMap := make(map[string]interface{})
18055	if soc.Reason != nil {
18056		objectMap["reason"] = soc.Reason
18057	}
18058	return json.Marshal(objectMap)
18059}
18060
18061// ServiceObjectiveListResult represents the response to a get database service objectives request.
18062type ServiceObjectiveListResult struct {
18063	autorest.Response `json:"-"`
18064	// Value - The list of database service objectives.
18065	Value *[]ServiceObjective `json:"value,omitempty"`
18066}
18067
18068// ServiceObjectiveProperties represents the properties of a database service objective.
18069type ServiceObjectiveProperties struct {
18070	// ServiceObjectiveName - READ-ONLY; The name for the service objective.
18071	ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"`
18072	// IsDefault - READ-ONLY; Gets whether the service level objective is the default service objective.
18073	IsDefault *bool `json:"isDefault,omitempty"`
18074	// IsSystem - READ-ONLY; Gets whether the service level objective is a system service objective.
18075	IsSystem *bool `json:"isSystem,omitempty"`
18076	// Description - READ-ONLY; The description for the service level objective.
18077	Description *string `json:"description,omitempty"`
18078	// Enabled - READ-ONLY; Gets whether the service level objective is enabled.
18079	Enabled *bool `json:"enabled,omitempty"`
18080}
18081
18082// ServiceTierAdvisor represents a Service Tier Advisor.
18083type ServiceTierAdvisor struct {
18084	autorest.Response `json:"-"`
18085	// ServiceTierAdvisorProperties - READ-ONLY; The properties representing the resource.
18086	*ServiceTierAdvisorProperties `json:"properties,omitempty"`
18087	// ID - READ-ONLY; Resource ID.
18088	ID *string `json:"id,omitempty"`
18089	// Name - READ-ONLY; Resource name.
18090	Name *string `json:"name,omitempty"`
18091	// Type - READ-ONLY; Resource type.
18092	Type *string `json:"type,omitempty"`
18093}
18094
18095// MarshalJSON is the custom marshaler for ServiceTierAdvisor.
18096func (sta ServiceTierAdvisor) MarshalJSON() ([]byte, error) {
18097	objectMap := make(map[string]interface{})
18098	return json.Marshal(objectMap)
18099}
18100
18101// UnmarshalJSON is the custom unmarshaler for ServiceTierAdvisor struct.
18102func (sta *ServiceTierAdvisor) UnmarshalJSON(body []byte) error {
18103	var m map[string]*json.RawMessage
18104	err := json.Unmarshal(body, &m)
18105	if err != nil {
18106		return err
18107	}
18108	for k, v := range m {
18109		switch k {
18110		case "properties":
18111			if v != nil {
18112				var serviceTierAdvisorProperties ServiceTierAdvisorProperties
18113				err = json.Unmarshal(*v, &serviceTierAdvisorProperties)
18114				if err != nil {
18115					return err
18116				}
18117				sta.ServiceTierAdvisorProperties = &serviceTierAdvisorProperties
18118			}
18119		case "id":
18120			if v != nil {
18121				var ID string
18122				err = json.Unmarshal(*v, &ID)
18123				if err != nil {
18124					return err
18125				}
18126				sta.ID = &ID
18127			}
18128		case "name":
18129			if v != nil {
18130				var name string
18131				err = json.Unmarshal(*v, &name)
18132				if err != nil {
18133					return err
18134				}
18135				sta.Name = &name
18136			}
18137		case "type":
18138			if v != nil {
18139				var typeVar string
18140				err = json.Unmarshal(*v, &typeVar)
18141				if err != nil {
18142					return err
18143				}
18144				sta.Type = &typeVar
18145			}
18146		}
18147	}
18148
18149	return nil
18150}
18151
18152// ServiceTierAdvisorListResult represents the response to a list service tier advisor request.
18153type ServiceTierAdvisorListResult struct {
18154	autorest.Response `json:"-"`
18155	// Value - The list of service tier advisors for specified database.
18156	Value *[]ServiceTierAdvisor `json:"value,omitempty"`
18157}
18158
18159// ServiceTierAdvisorProperties represents the properties of a Service Tier Advisor.
18160type ServiceTierAdvisorProperties struct {
18161	// ObservationPeriodStart - READ-ONLY; The observation period start (ISO8601 format).
18162	ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"`
18163	// ObservationPeriodEnd - READ-ONLY; The observation period start (ISO8601 format).
18164	ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"`
18165	// ActiveTimeRatio - READ-ONLY; The activeTimeRatio for service tier advisor.
18166	ActiveTimeRatio *float64 `json:"activeTimeRatio,omitempty"`
18167	// MinDtu - READ-ONLY; Gets or sets minDtu for service tier advisor.
18168	MinDtu *float64 `json:"minDtu,omitempty"`
18169	// AvgDtu - READ-ONLY; Gets or sets avgDtu for service tier advisor.
18170	AvgDtu *float64 `json:"avgDtu,omitempty"`
18171	// MaxDtu - READ-ONLY; Gets or sets maxDtu for service tier advisor.
18172	MaxDtu *float64 `json:"maxDtu,omitempty"`
18173	// MaxSizeInGB - READ-ONLY; Gets or sets maxSizeInGB for service tier advisor.
18174	MaxSizeInGB *float64 `json:"maxSizeInGB,omitempty"`
18175	// ServiceLevelObjectiveUsageMetrics - READ-ONLY; Gets or sets serviceLevelObjectiveUsageMetrics for the service tier advisor.
18176	ServiceLevelObjectiveUsageMetrics *[]SloUsageMetric `json:"serviceLevelObjectiveUsageMetrics,omitempty"`
18177	// CurrentServiceLevelObjective - READ-ONLY; Gets or sets currentServiceLevelObjective for service tier advisor.
18178	CurrentServiceLevelObjective *string `json:"currentServiceLevelObjective,omitempty"`
18179	// CurrentServiceLevelObjectiveID - READ-ONLY; Gets or sets currentServiceLevelObjectiveId for service tier advisor.
18180	CurrentServiceLevelObjectiveID *uuid.UUID `json:"currentServiceLevelObjectiveId,omitempty"`
18181	// UsageBasedRecommendationServiceLevelObjective - READ-ONLY; Gets or sets usageBasedRecommendationServiceLevelObjective for service tier advisor.
18182	UsageBasedRecommendationServiceLevelObjective *string `json:"usageBasedRecommendationServiceLevelObjective,omitempty"`
18183	// UsageBasedRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets usageBasedRecommendationServiceLevelObjectiveId for service tier advisor.
18184	UsageBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"usageBasedRecommendationServiceLevelObjectiveId,omitempty"`
18185	// DatabaseSizeBasedRecommendationServiceLevelObjective - READ-ONLY; Gets or sets databaseSizeBasedRecommendationServiceLevelObjective for service tier advisor.
18186	DatabaseSizeBasedRecommendationServiceLevelObjective *string `json:"databaseSizeBasedRecommendationServiceLevelObjective,omitempty"`
18187	// DatabaseSizeBasedRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service tier advisor.
18188	DatabaseSizeBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"databaseSizeBasedRecommendationServiceLevelObjectiveId,omitempty"`
18189	// DisasterPlanBasedRecommendationServiceLevelObjective - READ-ONLY; Gets or sets disasterPlanBasedRecommendationServiceLevelObjective for service tier advisor.
18190	DisasterPlanBasedRecommendationServiceLevelObjective *string `json:"disasterPlanBasedRecommendationServiceLevelObjective,omitempty"`
18191	// DisasterPlanBasedRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service tier advisor.
18192	DisasterPlanBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"disasterPlanBasedRecommendationServiceLevelObjectiveId,omitempty"`
18193	// OverallRecommendationServiceLevelObjective - READ-ONLY; Gets or sets overallRecommendationServiceLevelObjective for service tier advisor.
18194	OverallRecommendationServiceLevelObjective *string `json:"overallRecommendationServiceLevelObjective,omitempty"`
18195	// OverallRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets overallRecommendationServiceLevelObjectiveId for service tier advisor.
18196	OverallRecommendationServiceLevelObjectiveID *uuid.UUID `json:"overallRecommendationServiceLevelObjectiveId,omitempty"`
18197	// Confidence - READ-ONLY; Gets or sets confidence for service tier advisor.
18198	Confidence *float64 `json:"confidence,omitempty"`
18199}
18200
18201// Sku an ARM Resource SKU.
18202type Sku struct {
18203	// Name - The name of the SKU, typically, a letter + Number code, e.g. P3.
18204	Name *string `json:"name,omitempty"`
18205	// Tier - The tier or edition of the particular SKU, e.g. Basic, Premium.
18206	Tier *string `json:"tier,omitempty"`
18207	// Size - Size of the particular SKU
18208	Size *string `json:"size,omitempty"`
18209	// Family - If the service has different generations of hardware, for the same SKU, then that can be captured here.
18210	Family *string `json:"family,omitempty"`
18211	// Capacity - Capacity of the particular SKU.
18212	Capacity *int32 `json:"capacity,omitempty"`
18213}
18214
18215// SloUsageMetric a Slo Usage Metric.
18216type SloUsageMetric struct {
18217	// 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'
18218	ServiceLevelObjective ServiceObjectiveName `json:"serviceLevelObjective,omitempty"`
18219	// ServiceLevelObjectiveID - READ-ONLY; The serviceLevelObjectiveId for SLO usage metric.
18220	ServiceLevelObjectiveID *uuid.UUID `json:"serviceLevelObjectiveId,omitempty"`
18221	// InRangeTimeRatio - READ-ONLY; Gets or sets inRangeTimeRatio for SLO usage metric.
18222	InRangeTimeRatio *float64 `json:"inRangeTimeRatio,omitempty"`
18223}
18224
18225// StorageCapability the storage account type capability.
18226type StorageCapability struct {
18227	// StorageAccountType - READ-ONLY; The storage account type for the database's backups. Possible values include: 'StorageAccountType1GRS', 'StorageAccountType1LRS', 'StorageAccountType1ZRS'
18228	StorageAccountType StorageAccountType1 `json:"storageAccountType,omitempty"`
18229	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
18230	Status CapabilityStatus `json:"status,omitempty"`
18231	// Reason - The reason for the capability not being available.
18232	Reason *string `json:"reason,omitempty"`
18233}
18234
18235// MarshalJSON is the custom marshaler for StorageCapability.
18236func (sc StorageCapability) MarshalJSON() ([]byte, error) {
18237	objectMap := make(map[string]interface{})
18238	if sc.Reason != nil {
18239		objectMap["reason"] = sc.Reason
18240	}
18241	return json.Marshal(objectMap)
18242}
18243
18244// SubscriptionUsage usage Metric of a Subscription in a Location.
18245type SubscriptionUsage struct {
18246	autorest.Response `json:"-"`
18247	// SubscriptionUsageProperties - Resource properties.
18248	*SubscriptionUsageProperties `json:"properties,omitempty"`
18249	// ID - READ-ONLY; Resource ID.
18250	ID *string `json:"id,omitempty"`
18251	// Name - READ-ONLY; Resource name.
18252	Name *string `json:"name,omitempty"`
18253	// Type - READ-ONLY; Resource type.
18254	Type *string `json:"type,omitempty"`
18255}
18256
18257// MarshalJSON is the custom marshaler for SubscriptionUsage.
18258func (su SubscriptionUsage) MarshalJSON() ([]byte, error) {
18259	objectMap := make(map[string]interface{})
18260	if su.SubscriptionUsageProperties != nil {
18261		objectMap["properties"] = su.SubscriptionUsageProperties
18262	}
18263	return json.Marshal(objectMap)
18264}
18265
18266// UnmarshalJSON is the custom unmarshaler for SubscriptionUsage struct.
18267func (su *SubscriptionUsage) UnmarshalJSON(body []byte) error {
18268	var m map[string]*json.RawMessage
18269	err := json.Unmarshal(body, &m)
18270	if err != nil {
18271		return err
18272	}
18273	for k, v := range m {
18274		switch k {
18275		case "properties":
18276			if v != nil {
18277				var subscriptionUsageProperties SubscriptionUsageProperties
18278				err = json.Unmarshal(*v, &subscriptionUsageProperties)
18279				if err != nil {
18280					return err
18281				}
18282				su.SubscriptionUsageProperties = &subscriptionUsageProperties
18283			}
18284		case "id":
18285			if v != nil {
18286				var ID string
18287				err = json.Unmarshal(*v, &ID)
18288				if err != nil {
18289					return err
18290				}
18291				su.ID = &ID
18292			}
18293		case "name":
18294			if v != nil {
18295				var name string
18296				err = json.Unmarshal(*v, &name)
18297				if err != nil {
18298					return err
18299				}
18300				su.Name = &name
18301			}
18302		case "type":
18303			if v != nil {
18304				var typeVar string
18305				err = json.Unmarshal(*v, &typeVar)
18306				if err != nil {
18307					return err
18308				}
18309				su.Type = &typeVar
18310			}
18311		}
18312	}
18313
18314	return nil
18315}
18316
18317// SubscriptionUsageListResult a list of subscription usage metrics in a location.
18318type SubscriptionUsageListResult struct {
18319	autorest.Response `json:"-"`
18320	// Value - READ-ONLY; Array of results.
18321	Value *[]SubscriptionUsage `json:"value,omitempty"`
18322	// NextLink - READ-ONLY; Link to retrieve next page of results.
18323	NextLink *string `json:"nextLink,omitempty"`
18324}
18325
18326// SubscriptionUsageListResultIterator provides access to a complete listing of SubscriptionUsage values.
18327type SubscriptionUsageListResultIterator struct {
18328	i    int
18329	page SubscriptionUsageListResultPage
18330}
18331
18332// NextWithContext advances to the next value.  If there was an error making
18333// the request the iterator does not advance and the error is returned.
18334func (iter *SubscriptionUsageListResultIterator) NextWithContext(ctx context.Context) (err error) {
18335	if tracing.IsEnabled() {
18336		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsageListResultIterator.NextWithContext")
18337		defer func() {
18338			sc := -1
18339			if iter.Response().Response.Response != nil {
18340				sc = iter.Response().Response.Response.StatusCode
18341			}
18342			tracing.EndSpan(ctx, sc, err)
18343		}()
18344	}
18345	iter.i++
18346	if iter.i < len(iter.page.Values()) {
18347		return nil
18348	}
18349	err = iter.page.NextWithContext(ctx)
18350	if err != nil {
18351		iter.i--
18352		return err
18353	}
18354	iter.i = 0
18355	return nil
18356}
18357
18358// Next advances to the next value.  If there was an error making
18359// the request the iterator does not advance and the error is returned.
18360// Deprecated: Use NextWithContext() instead.
18361func (iter *SubscriptionUsageListResultIterator) Next() error {
18362	return iter.NextWithContext(context.Background())
18363}
18364
18365// NotDone returns true if the enumeration should be started or is not yet complete.
18366func (iter SubscriptionUsageListResultIterator) NotDone() bool {
18367	return iter.page.NotDone() && iter.i < len(iter.page.Values())
18368}
18369
18370// Response returns the raw server response from the last page request.
18371func (iter SubscriptionUsageListResultIterator) Response() SubscriptionUsageListResult {
18372	return iter.page.Response()
18373}
18374
18375// Value returns the current value or a zero-initialized value if the
18376// iterator has advanced beyond the end of the collection.
18377func (iter SubscriptionUsageListResultIterator) Value() SubscriptionUsage {
18378	if !iter.page.NotDone() {
18379		return SubscriptionUsage{}
18380	}
18381	return iter.page.Values()[iter.i]
18382}
18383
18384// Creates a new instance of the SubscriptionUsageListResultIterator type.
18385func NewSubscriptionUsageListResultIterator(page SubscriptionUsageListResultPage) SubscriptionUsageListResultIterator {
18386	return SubscriptionUsageListResultIterator{page: page}
18387}
18388
18389// IsEmpty returns true if the ListResult contains no values.
18390func (sulr SubscriptionUsageListResult) IsEmpty() bool {
18391	return sulr.Value == nil || len(*sulr.Value) == 0
18392}
18393
18394// hasNextLink returns true if the NextLink is not empty.
18395func (sulr SubscriptionUsageListResult) hasNextLink() bool {
18396	return sulr.NextLink != nil && len(*sulr.NextLink) != 0
18397}
18398
18399// subscriptionUsageListResultPreparer prepares a request to retrieve the next set of results.
18400// It returns nil if no more results exist.
18401func (sulr SubscriptionUsageListResult) subscriptionUsageListResultPreparer(ctx context.Context) (*http.Request, error) {
18402	if !sulr.hasNextLink() {
18403		return nil, nil
18404	}
18405	return autorest.Prepare((&http.Request{}).WithContext(ctx),
18406		autorest.AsJSON(),
18407		autorest.AsGet(),
18408		autorest.WithBaseURL(to.String(sulr.NextLink)))
18409}
18410
18411// SubscriptionUsageListResultPage contains a page of SubscriptionUsage values.
18412type SubscriptionUsageListResultPage struct {
18413	fn   func(context.Context, SubscriptionUsageListResult) (SubscriptionUsageListResult, error)
18414	sulr SubscriptionUsageListResult
18415}
18416
18417// NextWithContext advances to the next page of values.  If there was an error making
18418// the request the page does not advance and the error is returned.
18419func (page *SubscriptionUsageListResultPage) NextWithContext(ctx context.Context) (err error) {
18420	if tracing.IsEnabled() {
18421		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsageListResultPage.NextWithContext")
18422		defer func() {
18423			sc := -1
18424			if page.Response().Response.Response != nil {
18425				sc = page.Response().Response.Response.StatusCode
18426			}
18427			tracing.EndSpan(ctx, sc, err)
18428		}()
18429	}
18430	for {
18431		next, err := page.fn(ctx, page.sulr)
18432		if err != nil {
18433			return err
18434		}
18435		page.sulr = next
18436		if !next.hasNextLink() || !next.IsEmpty() {
18437			break
18438		}
18439	}
18440	return nil
18441}
18442
18443// Next advances to the next page of values.  If there was an error making
18444// the request the page does not advance and the error is returned.
18445// Deprecated: Use NextWithContext() instead.
18446func (page *SubscriptionUsageListResultPage) Next() error {
18447	return page.NextWithContext(context.Background())
18448}
18449
18450// NotDone returns true if the page enumeration should be started or is not yet complete.
18451func (page SubscriptionUsageListResultPage) NotDone() bool {
18452	return !page.sulr.IsEmpty()
18453}
18454
18455// Response returns the raw server response from the last page request.
18456func (page SubscriptionUsageListResultPage) Response() SubscriptionUsageListResult {
18457	return page.sulr
18458}
18459
18460// Values returns the slice of values for the current page or nil if there are no values.
18461func (page SubscriptionUsageListResultPage) Values() []SubscriptionUsage {
18462	if page.sulr.IsEmpty() {
18463		return nil
18464	}
18465	return *page.sulr.Value
18466}
18467
18468// Creates a new instance of the SubscriptionUsageListResultPage type.
18469func NewSubscriptionUsageListResultPage(cur SubscriptionUsageListResult, getNextPage func(context.Context, SubscriptionUsageListResult) (SubscriptionUsageListResult, error)) SubscriptionUsageListResultPage {
18470	return SubscriptionUsageListResultPage{
18471		fn:   getNextPage,
18472		sulr: cur,
18473	}
18474}
18475
18476// SubscriptionUsageProperties properties of a subscription usage.
18477type SubscriptionUsageProperties struct {
18478	// DisplayName - READ-ONLY; User-readable name of the metric.
18479	DisplayName *string `json:"displayName,omitempty"`
18480	// CurrentValue - READ-ONLY; Current value of the metric.
18481	CurrentValue *float64 `json:"currentValue,omitempty"`
18482	// Limit - READ-ONLY; Boundary value of the metric.
18483	Limit *float64 `json:"limit,omitempty"`
18484	// Unit - READ-ONLY; Unit of the metric.
18485	Unit *string `json:"unit,omitempty"`
18486}
18487
18488// SyncAgent an Azure SQL Database sync agent.
18489type SyncAgent struct {
18490	autorest.Response `json:"-"`
18491	// SyncAgentProperties - Resource properties.
18492	*SyncAgentProperties `json:"properties,omitempty"`
18493	// ID - READ-ONLY; Resource ID.
18494	ID *string `json:"id,omitempty"`
18495	// Name - READ-ONLY; Resource name.
18496	Name *string `json:"name,omitempty"`
18497	// Type - READ-ONLY; Resource type.
18498	Type *string `json:"type,omitempty"`
18499}
18500
18501// MarshalJSON is the custom marshaler for SyncAgent.
18502func (sa SyncAgent) MarshalJSON() ([]byte, error) {
18503	objectMap := make(map[string]interface{})
18504	if sa.SyncAgentProperties != nil {
18505		objectMap["properties"] = sa.SyncAgentProperties
18506	}
18507	return json.Marshal(objectMap)
18508}
18509
18510// UnmarshalJSON is the custom unmarshaler for SyncAgent struct.
18511func (sa *SyncAgent) UnmarshalJSON(body []byte) error {
18512	var m map[string]*json.RawMessage
18513	err := json.Unmarshal(body, &m)
18514	if err != nil {
18515		return err
18516	}
18517	for k, v := range m {
18518		switch k {
18519		case "properties":
18520			if v != nil {
18521				var syncAgentProperties SyncAgentProperties
18522				err = json.Unmarshal(*v, &syncAgentProperties)
18523				if err != nil {
18524					return err
18525				}
18526				sa.SyncAgentProperties = &syncAgentProperties
18527			}
18528		case "id":
18529			if v != nil {
18530				var ID string
18531				err = json.Unmarshal(*v, &ID)
18532				if err != nil {
18533					return err
18534				}
18535				sa.ID = &ID
18536			}
18537		case "name":
18538			if v != nil {
18539				var name string
18540				err = json.Unmarshal(*v, &name)
18541				if err != nil {
18542					return err
18543				}
18544				sa.Name = &name
18545			}
18546		case "type":
18547			if v != nil {
18548				var typeVar string
18549				err = json.Unmarshal(*v, &typeVar)
18550				if err != nil {
18551					return err
18552				}
18553				sa.Type = &typeVar
18554			}
18555		}
18556	}
18557
18558	return nil
18559}
18560
18561// SyncAgentKeyProperties properties of an Azure SQL Database sync agent key.
18562type SyncAgentKeyProperties struct {
18563	autorest.Response `json:"-"`
18564	// SyncAgentKey - READ-ONLY; Key of sync agent.
18565	SyncAgentKey *string `json:"syncAgentKey,omitempty"`
18566}
18567
18568// SyncAgentLinkedDatabase an Azure SQL Database sync agent linked database.
18569type SyncAgentLinkedDatabase struct {
18570	// SyncAgentLinkedDatabaseProperties - Resource properties.
18571	*SyncAgentLinkedDatabaseProperties `json:"properties,omitempty"`
18572	// ID - READ-ONLY; Resource ID.
18573	ID *string `json:"id,omitempty"`
18574	// Name - READ-ONLY; Resource name.
18575	Name *string `json:"name,omitempty"`
18576	// Type - READ-ONLY; Resource type.
18577	Type *string `json:"type,omitempty"`
18578}
18579
18580// MarshalJSON is the custom marshaler for SyncAgentLinkedDatabase.
18581func (sald SyncAgentLinkedDatabase) MarshalJSON() ([]byte, error) {
18582	objectMap := make(map[string]interface{})
18583	if sald.SyncAgentLinkedDatabaseProperties != nil {
18584		objectMap["properties"] = sald.SyncAgentLinkedDatabaseProperties
18585	}
18586	return json.Marshal(objectMap)
18587}
18588
18589// UnmarshalJSON is the custom unmarshaler for SyncAgentLinkedDatabase struct.
18590func (sald *SyncAgentLinkedDatabase) UnmarshalJSON(body []byte) error {
18591	var m map[string]*json.RawMessage
18592	err := json.Unmarshal(body, &m)
18593	if err != nil {
18594		return err
18595	}
18596	for k, v := range m {
18597		switch k {
18598		case "properties":
18599			if v != nil {
18600				var syncAgentLinkedDatabaseProperties SyncAgentLinkedDatabaseProperties
18601				err = json.Unmarshal(*v, &syncAgentLinkedDatabaseProperties)
18602				if err != nil {
18603					return err
18604				}
18605				sald.SyncAgentLinkedDatabaseProperties = &syncAgentLinkedDatabaseProperties
18606			}
18607		case "id":
18608			if v != nil {
18609				var ID string
18610				err = json.Unmarshal(*v, &ID)
18611				if err != nil {
18612					return err
18613				}
18614				sald.ID = &ID
18615			}
18616		case "name":
18617			if v != nil {
18618				var name string
18619				err = json.Unmarshal(*v, &name)
18620				if err != nil {
18621					return err
18622				}
18623				sald.Name = &name
18624			}
18625		case "type":
18626			if v != nil {
18627				var typeVar string
18628				err = json.Unmarshal(*v, &typeVar)
18629				if err != nil {
18630					return err
18631				}
18632				sald.Type = &typeVar
18633			}
18634		}
18635	}
18636
18637	return nil
18638}
18639
18640// SyncAgentLinkedDatabaseListResult a list of sync agent linked databases.
18641type SyncAgentLinkedDatabaseListResult struct {
18642	autorest.Response `json:"-"`
18643	// Value - READ-ONLY; Array of results.
18644	Value *[]SyncAgentLinkedDatabase `json:"value,omitempty"`
18645	// NextLink - READ-ONLY; Link to retrieve next page of results.
18646	NextLink *string `json:"nextLink,omitempty"`
18647}
18648
18649// SyncAgentLinkedDatabaseListResultIterator provides access to a complete listing of
18650// SyncAgentLinkedDatabase values.
18651type SyncAgentLinkedDatabaseListResultIterator struct {
18652	i    int
18653	page SyncAgentLinkedDatabaseListResultPage
18654}
18655
18656// NextWithContext advances to the next value.  If there was an error making
18657// the request the iterator does not advance and the error is returned.
18658func (iter *SyncAgentLinkedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
18659	if tracing.IsEnabled() {
18660		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentLinkedDatabaseListResultIterator.NextWithContext")
18661		defer func() {
18662			sc := -1
18663			if iter.Response().Response.Response != nil {
18664				sc = iter.Response().Response.Response.StatusCode
18665			}
18666			tracing.EndSpan(ctx, sc, err)
18667		}()
18668	}
18669	iter.i++
18670	if iter.i < len(iter.page.Values()) {
18671		return nil
18672	}
18673	err = iter.page.NextWithContext(ctx)
18674	if err != nil {
18675		iter.i--
18676		return err
18677	}
18678	iter.i = 0
18679	return nil
18680}
18681
18682// Next advances to the next value.  If there was an error making
18683// the request the iterator does not advance and the error is returned.
18684// Deprecated: Use NextWithContext() instead.
18685func (iter *SyncAgentLinkedDatabaseListResultIterator) Next() error {
18686	return iter.NextWithContext(context.Background())
18687}
18688
18689// NotDone returns true if the enumeration should be started or is not yet complete.
18690func (iter SyncAgentLinkedDatabaseListResultIterator) NotDone() bool {
18691	return iter.page.NotDone() && iter.i < len(iter.page.Values())
18692}
18693
18694// Response returns the raw server response from the last page request.
18695func (iter SyncAgentLinkedDatabaseListResultIterator) Response() SyncAgentLinkedDatabaseListResult {
18696	return iter.page.Response()
18697}
18698
18699// Value returns the current value or a zero-initialized value if the
18700// iterator has advanced beyond the end of the collection.
18701func (iter SyncAgentLinkedDatabaseListResultIterator) Value() SyncAgentLinkedDatabase {
18702	if !iter.page.NotDone() {
18703		return SyncAgentLinkedDatabase{}
18704	}
18705	return iter.page.Values()[iter.i]
18706}
18707
18708// Creates a new instance of the SyncAgentLinkedDatabaseListResultIterator type.
18709func NewSyncAgentLinkedDatabaseListResultIterator(page SyncAgentLinkedDatabaseListResultPage) SyncAgentLinkedDatabaseListResultIterator {
18710	return SyncAgentLinkedDatabaseListResultIterator{page: page}
18711}
18712
18713// IsEmpty returns true if the ListResult contains no values.
18714func (saldlr SyncAgentLinkedDatabaseListResult) IsEmpty() bool {
18715	return saldlr.Value == nil || len(*saldlr.Value) == 0
18716}
18717
18718// hasNextLink returns true if the NextLink is not empty.
18719func (saldlr SyncAgentLinkedDatabaseListResult) hasNextLink() bool {
18720	return saldlr.NextLink != nil && len(*saldlr.NextLink) != 0
18721}
18722
18723// syncAgentLinkedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
18724// It returns nil if no more results exist.
18725func (saldlr SyncAgentLinkedDatabaseListResult) syncAgentLinkedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
18726	if !saldlr.hasNextLink() {
18727		return nil, nil
18728	}
18729	return autorest.Prepare((&http.Request{}).WithContext(ctx),
18730		autorest.AsJSON(),
18731		autorest.AsGet(),
18732		autorest.WithBaseURL(to.String(saldlr.NextLink)))
18733}
18734
18735// SyncAgentLinkedDatabaseListResultPage contains a page of SyncAgentLinkedDatabase values.
18736type SyncAgentLinkedDatabaseListResultPage struct {
18737	fn     func(context.Context, SyncAgentLinkedDatabaseListResult) (SyncAgentLinkedDatabaseListResult, error)
18738	saldlr SyncAgentLinkedDatabaseListResult
18739}
18740
18741// NextWithContext advances to the next page of values.  If there was an error making
18742// the request the page does not advance and the error is returned.
18743func (page *SyncAgentLinkedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
18744	if tracing.IsEnabled() {
18745		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentLinkedDatabaseListResultPage.NextWithContext")
18746		defer func() {
18747			sc := -1
18748			if page.Response().Response.Response != nil {
18749				sc = page.Response().Response.Response.StatusCode
18750			}
18751			tracing.EndSpan(ctx, sc, err)
18752		}()
18753	}
18754	for {
18755		next, err := page.fn(ctx, page.saldlr)
18756		if err != nil {
18757			return err
18758		}
18759		page.saldlr = next
18760		if !next.hasNextLink() || !next.IsEmpty() {
18761			break
18762		}
18763	}
18764	return nil
18765}
18766
18767// Next advances to the next page of values.  If there was an error making
18768// the request the page does not advance and the error is returned.
18769// Deprecated: Use NextWithContext() instead.
18770func (page *SyncAgentLinkedDatabaseListResultPage) Next() error {
18771	return page.NextWithContext(context.Background())
18772}
18773
18774// NotDone returns true if the page enumeration should be started or is not yet complete.
18775func (page SyncAgentLinkedDatabaseListResultPage) NotDone() bool {
18776	return !page.saldlr.IsEmpty()
18777}
18778
18779// Response returns the raw server response from the last page request.
18780func (page SyncAgentLinkedDatabaseListResultPage) Response() SyncAgentLinkedDatabaseListResult {
18781	return page.saldlr
18782}
18783
18784// Values returns the slice of values for the current page or nil if there are no values.
18785func (page SyncAgentLinkedDatabaseListResultPage) Values() []SyncAgentLinkedDatabase {
18786	if page.saldlr.IsEmpty() {
18787		return nil
18788	}
18789	return *page.saldlr.Value
18790}
18791
18792// Creates a new instance of the SyncAgentLinkedDatabaseListResultPage type.
18793func NewSyncAgentLinkedDatabaseListResultPage(cur SyncAgentLinkedDatabaseListResult, getNextPage func(context.Context, SyncAgentLinkedDatabaseListResult) (SyncAgentLinkedDatabaseListResult, error)) SyncAgentLinkedDatabaseListResultPage {
18794	return SyncAgentLinkedDatabaseListResultPage{
18795		fn:     getNextPage,
18796		saldlr: cur,
18797	}
18798}
18799
18800// SyncAgentLinkedDatabaseProperties properties of an Azure SQL Database sync agent linked database.
18801type SyncAgentLinkedDatabaseProperties struct {
18802	// DatabaseType - READ-ONLY; Type of the sync agent linked database. Possible values include: 'AzureSQLDatabase', 'SQLServerDatabase'
18803	DatabaseType SyncMemberDbType `json:"databaseType,omitempty"`
18804	// DatabaseID - READ-ONLY; Id of the sync agent linked database.
18805	DatabaseID *string `json:"databaseId,omitempty"`
18806	// Description - READ-ONLY; Description of the sync agent linked database.
18807	Description *string `json:"description,omitempty"`
18808	// ServerName - READ-ONLY; Server name of the sync agent linked database.
18809	ServerName *string `json:"serverName,omitempty"`
18810	// DatabaseName - READ-ONLY; Database name of the sync agent linked database.
18811	DatabaseName *string `json:"databaseName,omitempty"`
18812	// UserName - READ-ONLY; User name of the sync agent linked database.
18813	UserName *string `json:"userName,omitempty"`
18814}
18815
18816// SyncAgentListResult a list of sync agents.
18817type SyncAgentListResult struct {
18818	autorest.Response `json:"-"`
18819	// Value - READ-ONLY; Array of results.
18820	Value *[]SyncAgent `json:"value,omitempty"`
18821	// NextLink - READ-ONLY; Link to retrieve next page of results.
18822	NextLink *string `json:"nextLink,omitempty"`
18823}
18824
18825// SyncAgentListResultIterator provides access to a complete listing of SyncAgent values.
18826type SyncAgentListResultIterator struct {
18827	i    int
18828	page SyncAgentListResultPage
18829}
18830
18831// NextWithContext advances to the next value.  If there was an error making
18832// the request the iterator does not advance and the error is returned.
18833func (iter *SyncAgentListResultIterator) NextWithContext(ctx context.Context) (err error) {
18834	if tracing.IsEnabled() {
18835		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentListResultIterator.NextWithContext")
18836		defer func() {
18837			sc := -1
18838			if iter.Response().Response.Response != nil {
18839				sc = iter.Response().Response.Response.StatusCode
18840			}
18841			tracing.EndSpan(ctx, sc, err)
18842		}()
18843	}
18844	iter.i++
18845	if iter.i < len(iter.page.Values()) {
18846		return nil
18847	}
18848	err = iter.page.NextWithContext(ctx)
18849	if err != nil {
18850		iter.i--
18851		return err
18852	}
18853	iter.i = 0
18854	return nil
18855}
18856
18857// Next advances to the next value.  If there was an error making
18858// the request the iterator does not advance and the error is returned.
18859// Deprecated: Use NextWithContext() instead.
18860func (iter *SyncAgentListResultIterator) Next() error {
18861	return iter.NextWithContext(context.Background())
18862}
18863
18864// NotDone returns true if the enumeration should be started or is not yet complete.
18865func (iter SyncAgentListResultIterator) NotDone() bool {
18866	return iter.page.NotDone() && iter.i < len(iter.page.Values())
18867}
18868
18869// Response returns the raw server response from the last page request.
18870func (iter SyncAgentListResultIterator) Response() SyncAgentListResult {
18871	return iter.page.Response()
18872}
18873
18874// Value returns the current value or a zero-initialized value if the
18875// iterator has advanced beyond the end of the collection.
18876func (iter SyncAgentListResultIterator) Value() SyncAgent {
18877	if !iter.page.NotDone() {
18878		return SyncAgent{}
18879	}
18880	return iter.page.Values()[iter.i]
18881}
18882
18883// Creates a new instance of the SyncAgentListResultIterator type.
18884func NewSyncAgentListResultIterator(page SyncAgentListResultPage) SyncAgentListResultIterator {
18885	return SyncAgentListResultIterator{page: page}
18886}
18887
18888// IsEmpty returns true if the ListResult contains no values.
18889func (salr SyncAgentListResult) IsEmpty() bool {
18890	return salr.Value == nil || len(*salr.Value) == 0
18891}
18892
18893// hasNextLink returns true if the NextLink is not empty.
18894func (salr SyncAgentListResult) hasNextLink() bool {
18895	return salr.NextLink != nil && len(*salr.NextLink) != 0
18896}
18897
18898// syncAgentListResultPreparer prepares a request to retrieve the next set of results.
18899// It returns nil if no more results exist.
18900func (salr SyncAgentListResult) syncAgentListResultPreparer(ctx context.Context) (*http.Request, error) {
18901	if !salr.hasNextLink() {
18902		return nil, nil
18903	}
18904	return autorest.Prepare((&http.Request{}).WithContext(ctx),
18905		autorest.AsJSON(),
18906		autorest.AsGet(),
18907		autorest.WithBaseURL(to.String(salr.NextLink)))
18908}
18909
18910// SyncAgentListResultPage contains a page of SyncAgent values.
18911type SyncAgentListResultPage struct {
18912	fn   func(context.Context, SyncAgentListResult) (SyncAgentListResult, error)
18913	salr SyncAgentListResult
18914}
18915
18916// NextWithContext advances to the next page of values.  If there was an error making
18917// the request the page does not advance and the error is returned.
18918func (page *SyncAgentListResultPage) NextWithContext(ctx context.Context) (err error) {
18919	if tracing.IsEnabled() {
18920		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentListResultPage.NextWithContext")
18921		defer func() {
18922			sc := -1
18923			if page.Response().Response.Response != nil {
18924				sc = page.Response().Response.Response.StatusCode
18925			}
18926			tracing.EndSpan(ctx, sc, err)
18927		}()
18928	}
18929	for {
18930		next, err := page.fn(ctx, page.salr)
18931		if err != nil {
18932			return err
18933		}
18934		page.salr = next
18935		if !next.hasNextLink() || !next.IsEmpty() {
18936			break
18937		}
18938	}
18939	return nil
18940}
18941
18942// Next advances to the next page of values.  If there was an error making
18943// the request the page does not advance and the error is returned.
18944// Deprecated: Use NextWithContext() instead.
18945func (page *SyncAgentListResultPage) Next() error {
18946	return page.NextWithContext(context.Background())
18947}
18948
18949// NotDone returns true if the page enumeration should be started or is not yet complete.
18950func (page SyncAgentListResultPage) NotDone() bool {
18951	return !page.salr.IsEmpty()
18952}
18953
18954// Response returns the raw server response from the last page request.
18955func (page SyncAgentListResultPage) Response() SyncAgentListResult {
18956	return page.salr
18957}
18958
18959// Values returns the slice of values for the current page or nil if there are no values.
18960func (page SyncAgentListResultPage) Values() []SyncAgent {
18961	if page.salr.IsEmpty() {
18962		return nil
18963	}
18964	return *page.salr.Value
18965}
18966
18967// Creates a new instance of the SyncAgentListResultPage type.
18968func NewSyncAgentListResultPage(cur SyncAgentListResult, getNextPage func(context.Context, SyncAgentListResult) (SyncAgentListResult, error)) SyncAgentListResultPage {
18969	return SyncAgentListResultPage{
18970		fn:   getNextPage,
18971		salr: cur,
18972	}
18973}
18974
18975// SyncAgentProperties properties of an Azure SQL Database sync agent.
18976type SyncAgentProperties struct {
18977	// Name - READ-ONLY; Name of the sync agent.
18978	Name *string `json:"name,omitempty"`
18979	// SyncDatabaseID - ARM resource id of the sync database in the sync agent.
18980	SyncDatabaseID *string `json:"syncDatabaseId,omitempty"`
18981	// LastAliveTime - READ-ONLY; Last alive time of the sync agent.
18982	LastAliveTime *date.Time `json:"lastAliveTime,omitempty"`
18983	// State - READ-ONLY; State of the sync agent. Possible values include: 'SyncAgentStateOnline', 'SyncAgentStateOffline', 'SyncAgentStateNeverConnected'
18984	State SyncAgentState `json:"state,omitempty"`
18985	// IsUpToDate - READ-ONLY; If the sync agent version is up to date.
18986	IsUpToDate *bool `json:"isUpToDate,omitempty"`
18987	// ExpiryTime - READ-ONLY; Expiration time of the sync agent version.
18988	ExpiryTime *date.Time `json:"expiryTime,omitempty"`
18989	// Version - READ-ONLY; Version of the sync agent.
18990	Version *string `json:"version,omitempty"`
18991}
18992
18993// MarshalJSON is the custom marshaler for SyncAgentProperties.
18994func (sap SyncAgentProperties) MarshalJSON() ([]byte, error) {
18995	objectMap := make(map[string]interface{})
18996	if sap.SyncDatabaseID != nil {
18997		objectMap["syncDatabaseId"] = sap.SyncDatabaseID
18998	}
18999	return json.Marshal(objectMap)
19000}
19001
19002// SyncAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
19003// long-running operation.
19004type SyncAgentsCreateOrUpdateFuture struct {
19005	azure.FutureAPI
19006	// Result returns the result of the asynchronous operation.
19007	// If the operation has not completed it will return an error.
19008	Result func(SyncAgentsClient) (SyncAgent, error)
19009}
19010
19011// SyncAgentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
19012// operation.
19013type SyncAgentsDeleteFuture struct {
19014	azure.FutureAPI
19015	// Result returns the result of the asynchronous operation.
19016	// If the operation has not completed it will return an error.
19017	Result func(SyncAgentsClient) (autorest.Response, error)
19018}
19019
19020// SyncDatabaseIDListResult a list of sync database ID properties.
19021type SyncDatabaseIDListResult struct {
19022	autorest.Response `json:"-"`
19023	// Value - READ-ONLY; Array of results.
19024	Value *[]SyncDatabaseIDProperties `json:"value,omitempty"`
19025	// NextLink - READ-ONLY; Link to retrieve next page of results.
19026	NextLink *string `json:"nextLink,omitempty"`
19027}
19028
19029// SyncDatabaseIDListResultIterator provides access to a complete listing of SyncDatabaseIDProperties
19030// values.
19031type SyncDatabaseIDListResultIterator struct {
19032	i    int
19033	page SyncDatabaseIDListResultPage
19034}
19035
19036// NextWithContext advances to the next value.  If there was an error making
19037// the request the iterator does not advance and the error is returned.
19038func (iter *SyncDatabaseIDListResultIterator) NextWithContext(ctx context.Context) (err error) {
19039	if tracing.IsEnabled() {
19040		ctx = tracing.StartSpan(ctx, fqdn+"/SyncDatabaseIDListResultIterator.NextWithContext")
19041		defer func() {
19042			sc := -1
19043			if iter.Response().Response.Response != nil {
19044				sc = iter.Response().Response.Response.StatusCode
19045			}
19046			tracing.EndSpan(ctx, sc, err)
19047		}()
19048	}
19049	iter.i++
19050	if iter.i < len(iter.page.Values()) {
19051		return nil
19052	}
19053	err = iter.page.NextWithContext(ctx)
19054	if err != nil {
19055		iter.i--
19056		return err
19057	}
19058	iter.i = 0
19059	return nil
19060}
19061
19062// Next advances to the next value.  If there was an error making
19063// the request the iterator does not advance and the error is returned.
19064// Deprecated: Use NextWithContext() instead.
19065func (iter *SyncDatabaseIDListResultIterator) Next() error {
19066	return iter.NextWithContext(context.Background())
19067}
19068
19069// NotDone returns true if the enumeration should be started or is not yet complete.
19070func (iter SyncDatabaseIDListResultIterator) NotDone() bool {
19071	return iter.page.NotDone() && iter.i < len(iter.page.Values())
19072}
19073
19074// Response returns the raw server response from the last page request.
19075func (iter SyncDatabaseIDListResultIterator) Response() SyncDatabaseIDListResult {
19076	return iter.page.Response()
19077}
19078
19079// Value returns the current value or a zero-initialized value if the
19080// iterator has advanced beyond the end of the collection.
19081func (iter SyncDatabaseIDListResultIterator) Value() SyncDatabaseIDProperties {
19082	if !iter.page.NotDone() {
19083		return SyncDatabaseIDProperties{}
19084	}
19085	return iter.page.Values()[iter.i]
19086}
19087
19088// Creates a new instance of the SyncDatabaseIDListResultIterator type.
19089func NewSyncDatabaseIDListResultIterator(page SyncDatabaseIDListResultPage) SyncDatabaseIDListResultIterator {
19090	return SyncDatabaseIDListResultIterator{page: page}
19091}
19092
19093// IsEmpty returns true if the ListResult contains no values.
19094func (sdilr SyncDatabaseIDListResult) IsEmpty() bool {
19095	return sdilr.Value == nil || len(*sdilr.Value) == 0
19096}
19097
19098// hasNextLink returns true if the NextLink is not empty.
19099func (sdilr SyncDatabaseIDListResult) hasNextLink() bool {
19100	return sdilr.NextLink != nil && len(*sdilr.NextLink) != 0
19101}
19102
19103// syncDatabaseIDListResultPreparer prepares a request to retrieve the next set of results.
19104// It returns nil if no more results exist.
19105func (sdilr SyncDatabaseIDListResult) syncDatabaseIDListResultPreparer(ctx context.Context) (*http.Request, error) {
19106	if !sdilr.hasNextLink() {
19107		return nil, nil
19108	}
19109	return autorest.Prepare((&http.Request{}).WithContext(ctx),
19110		autorest.AsJSON(),
19111		autorest.AsGet(),
19112		autorest.WithBaseURL(to.String(sdilr.NextLink)))
19113}
19114
19115// SyncDatabaseIDListResultPage contains a page of SyncDatabaseIDProperties values.
19116type SyncDatabaseIDListResultPage struct {
19117	fn    func(context.Context, SyncDatabaseIDListResult) (SyncDatabaseIDListResult, error)
19118	sdilr SyncDatabaseIDListResult
19119}
19120
19121// NextWithContext advances to the next page of values.  If there was an error making
19122// the request the page does not advance and the error is returned.
19123func (page *SyncDatabaseIDListResultPage) NextWithContext(ctx context.Context) (err error) {
19124	if tracing.IsEnabled() {
19125		ctx = tracing.StartSpan(ctx, fqdn+"/SyncDatabaseIDListResultPage.NextWithContext")
19126		defer func() {
19127			sc := -1
19128			if page.Response().Response.Response != nil {
19129				sc = page.Response().Response.Response.StatusCode
19130			}
19131			tracing.EndSpan(ctx, sc, err)
19132		}()
19133	}
19134	for {
19135		next, err := page.fn(ctx, page.sdilr)
19136		if err != nil {
19137			return err
19138		}
19139		page.sdilr = next
19140		if !next.hasNextLink() || !next.IsEmpty() {
19141			break
19142		}
19143	}
19144	return nil
19145}
19146
19147// Next advances to the next page of values.  If there was an error making
19148// the request the page does not advance and the error is returned.
19149// Deprecated: Use NextWithContext() instead.
19150func (page *SyncDatabaseIDListResultPage) Next() error {
19151	return page.NextWithContext(context.Background())
19152}
19153
19154// NotDone returns true if the page enumeration should be started or is not yet complete.
19155func (page SyncDatabaseIDListResultPage) NotDone() bool {
19156	return !page.sdilr.IsEmpty()
19157}
19158
19159// Response returns the raw server response from the last page request.
19160func (page SyncDatabaseIDListResultPage) Response() SyncDatabaseIDListResult {
19161	return page.sdilr
19162}
19163
19164// Values returns the slice of values for the current page or nil if there are no values.
19165func (page SyncDatabaseIDListResultPage) Values() []SyncDatabaseIDProperties {
19166	if page.sdilr.IsEmpty() {
19167		return nil
19168	}
19169	return *page.sdilr.Value
19170}
19171
19172// Creates a new instance of the SyncDatabaseIDListResultPage type.
19173func NewSyncDatabaseIDListResultPage(cur SyncDatabaseIDListResult, getNextPage func(context.Context, SyncDatabaseIDListResult) (SyncDatabaseIDListResult, error)) SyncDatabaseIDListResultPage {
19174	return SyncDatabaseIDListResultPage{
19175		fn:    getNextPage,
19176		sdilr: cur,
19177	}
19178}
19179
19180// SyncDatabaseIDProperties properties of the sync database id.
19181type SyncDatabaseIDProperties struct {
19182	// ID - READ-ONLY; ARM resource id of sync database.
19183	ID *string `json:"id,omitempty"`
19184}
19185
19186// SyncFullSchemaProperties properties of the database full schema.
19187type SyncFullSchemaProperties struct {
19188	// Tables - READ-ONLY; List of tables in the database full schema.
19189	Tables *[]SyncFullSchemaTable `json:"tables,omitempty"`
19190	// LastUpdateTime - READ-ONLY; Last update time of the database schema.
19191	LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
19192}
19193
19194// SyncFullSchemaPropertiesListResult a list of sync schema properties.
19195type SyncFullSchemaPropertiesListResult struct {
19196	autorest.Response `json:"-"`
19197	// Value - READ-ONLY; Array of results.
19198	Value *[]SyncFullSchemaProperties `json:"value,omitempty"`
19199	// NextLink - READ-ONLY; Link to retrieve next page of results.
19200	NextLink *string `json:"nextLink,omitempty"`
19201}
19202
19203// SyncFullSchemaPropertiesListResultIterator provides access to a complete listing of
19204// SyncFullSchemaProperties values.
19205type SyncFullSchemaPropertiesListResultIterator struct {
19206	i    int
19207	page SyncFullSchemaPropertiesListResultPage
19208}
19209
19210// NextWithContext advances to the next value.  If there was an error making
19211// the request the iterator does not advance and the error is returned.
19212func (iter *SyncFullSchemaPropertiesListResultIterator) NextWithContext(ctx context.Context) (err error) {
19213	if tracing.IsEnabled() {
19214		ctx = tracing.StartSpan(ctx, fqdn+"/SyncFullSchemaPropertiesListResultIterator.NextWithContext")
19215		defer func() {
19216			sc := -1
19217			if iter.Response().Response.Response != nil {
19218				sc = iter.Response().Response.Response.StatusCode
19219			}
19220			tracing.EndSpan(ctx, sc, err)
19221		}()
19222	}
19223	iter.i++
19224	if iter.i < len(iter.page.Values()) {
19225		return nil
19226	}
19227	err = iter.page.NextWithContext(ctx)
19228	if err != nil {
19229		iter.i--
19230		return err
19231	}
19232	iter.i = 0
19233	return nil
19234}
19235
19236// Next advances to the next value.  If there was an error making
19237// the request the iterator does not advance and the error is returned.
19238// Deprecated: Use NextWithContext() instead.
19239func (iter *SyncFullSchemaPropertiesListResultIterator) Next() error {
19240	return iter.NextWithContext(context.Background())
19241}
19242
19243// NotDone returns true if the enumeration should be started or is not yet complete.
19244func (iter SyncFullSchemaPropertiesListResultIterator) NotDone() bool {
19245	return iter.page.NotDone() && iter.i < len(iter.page.Values())
19246}
19247
19248// Response returns the raw server response from the last page request.
19249func (iter SyncFullSchemaPropertiesListResultIterator) Response() SyncFullSchemaPropertiesListResult {
19250	return iter.page.Response()
19251}
19252
19253// Value returns the current value or a zero-initialized value if the
19254// iterator has advanced beyond the end of the collection.
19255func (iter SyncFullSchemaPropertiesListResultIterator) Value() SyncFullSchemaProperties {
19256	if !iter.page.NotDone() {
19257		return SyncFullSchemaProperties{}
19258	}
19259	return iter.page.Values()[iter.i]
19260}
19261
19262// Creates a new instance of the SyncFullSchemaPropertiesListResultIterator type.
19263func NewSyncFullSchemaPropertiesListResultIterator(page SyncFullSchemaPropertiesListResultPage) SyncFullSchemaPropertiesListResultIterator {
19264	return SyncFullSchemaPropertiesListResultIterator{page: page}
19265}
19266
19267// IsEmpty returns true if the ListResult contains no values.
19268func (sfsplr SyncFullSchemaPropertiesListResult) IsEmpty() bool {
19269	return sfsplr.Value == nil || len(*sfsplr.Value) == 0
19270}
19271
19272// hasNextLink returns true if the NextLink is not empty.
19273func (sfsplr SyncFullSchemaPropertiesListResult) hasNextLink() bool {
19274	return sfsplr.NextLink != nil && len(*sfsplr.NextLink) != 0
19275}
19276
19277// syncFullSchemaPropertiesListResultPreparer prepares a request to retrieve the next set of results.
19278// It returns nil if no more results exist.
19279func (sfsplr SyncFullSchemaPropertiesListResult) syncFullSchemaPropertiesListResultPreparer(ctx context.Context) (*http.Request, error) {
19280	if !sfsplr.hasNextLink() {
19281		return nil, nil
19282	}
19283	return autorest.Prepare((&http.Request{}).WithContext(ctx),
19284		autorest.AsJSON(),
19285		autorest.AsGet(),
19286		autorest.WithBaseURL(to.String(sfsplr.NextLink)))
19287}
19288
19289// SyncFullSchemaPropertiesListResultPage contains a page of SyncFullSchemaProperties values.
19290type SyncFullSchemaPropertiesListResultPage struct {
19291	fn     func(context.Context, SyncFullSchemaPropertiesListResult) (SyncFullSchemaPropertiesListResult, error)
19292	sfsplr SyncFullSchemaPropertiesListResult
19293}
19294
19295// NextWithContext advances to the next page of values.  If there was an error making
19296// the request the page does not advance and the error is returned.
19297func (page *SyncFullSchemaPropertiesListResultPage) NextWithContext(ctx context.Context) (err error) {
19298	if tracing.IsEnabled() {
19299		ctx = tracing.StartSpan(ctx, fqdn+"/SyncFullSchemaPropertiesListResultPage.NextWithContext")
19300		defer func() {
19301			sc := -1
19302			if page.Response().Response.Response != nil {
19303				sc = page.Response().Response.Response.StatusCode
19304			}
19305			tracing.EndSpan(ctx, sc, err)
19306		}()
19307	}
19308	for {
19309		next, err := page.fn(ctx, page.sfsplr)
19310		if err != nil {
19311			return err
19312		}
19313		page.sfsplr = next
19314		if !next.hasNextLink() || !next.IsEmpty() {
19315			break
19316		}
19317	}
19318	return nil
19319}
19320
19321// Next advances to the next page of values.  If there was an error making
19322// the request the page does not advance and the error is returned.
19323// Deprecated: Use NextWithContext() instead.
19324func (page *SyncFullSchemaPropertiesListResultPage) Next() error {
19325	return page.NextWithContext(context.Background())
19326}
19327
19328// NotDone returns true if the page enumeration should be started or is not yet complete.
19329func (page SyncFullSchemaPropertiesListResultPage) NotDone() bool {
19330	return !page.sfsplr.IsEmpty()
19331}
19332
19333// Response returns the raw server response from the last page request.
19334func (page SyncFullSchemaPropertiesListResultPage) Response() SyncFullSchemaPropertiesListResult {
19335	return page.sfsplr
19336}
19337
19338// Values returns the slice of values for the current page or nil if there are no values.
19339func (page SyncFullSchemaPropertiesListResultPage) Values() []SyncFullSchemaProperties {
19340	if page.sfsplr.IsEmpty() {
19341		return nil
19342	}
19343	return *page.sfsplr.Value
19344}
19345
19346// Creates a new instance of the SyncFullSchemaPropertiesListResultPage type.
19347func NewSyncFullSchemaPropertiesListResultPage(cur SyncFullSchemaPropertiesListResult, getNextPage func(context.Context, SyncFullSchemaPropertiesListResult) (SyncFullSchemaPropertiesListResult, error)) SyncFullSchemaPropertiesListResultPage {
19348	return SyncFullSchemaPropertiesListResultPage{
19349		fn:     getNextPage,
19350		sfsplr: cur,
19351	}
19352}
19353
19354// SyncFullSchemaTable properties of the table in the database full schema.
19355type SyncFullSchemaTable struct {
19356	// Columns - READ-ONLY; List of columns in the table of database full schema.
19357	Columns *[]SyncFullSchemaTableColumn `json:"columns,omitempty"`
19358	// ErrorID - READ-ONLY; Error id of the table.
19359	ErrorID *string `json:"errorId,omitempty"`
19360	// HasError - READ-ONLY; If there is error in the table.
19361	HasError *bool `json:"hasError,omitempty"`
19362	// Name - READ-ONLY; Name of the table.
19363	Name *string `json:"name,omitempty"`
19364	// QuotedName - READ-ONLY; Quoted name of the table.
19365	QuotedName *string `json:"quotedName,omitempty"`
19366}
19367
19368// SyncFullSchemaTableColumn properties of the column in the table of database full schema.
19369type SyncFullSchemaTableColumn struct {
19370	// DataSize - READ-ONLY; Data size of the column.
19371	DataSize *string `json:"dataSize,omitempty"`
19372	// DataType - READ-ONLY; Data type of the column.
19373	DataType *string `json:"dataType,omitempty"`
19374	// ErrorID - READ-ONLY; Error id of the column.
19375	ErrorID *string `json:"errorId,omitempty"`
19376	// HasError - READ-ONLY; If there is error in the table.
19377	HasError *bool `json:"hasError,omitempty"`
19378	// IsPrimaryKey - READ-ONLY; If it is the primary key of the table.
19379	IsPrimaryKey *bool `json:"isPrimaryKey,omitempty"`
19380	// Name - READ-ONLY; Name of the column.
19381	Name *string `json:"name,omitempty"`
19382	// QuotedName - READ-ONLY; Quoted name of the column.
19383	QuotedName *string `json:"quotedName,omitempty"`
19384}
19385
19386// SyncGroup an Azure SQL Database sync group.
19387type SyncGroup struct {
19388	autorest.Response `json:"-"`
19389	// SyncGroupProperties - Resource properties.
19390	*SyncGroupProperties `json:"properties,omitempty"`
19391	// ID - READ-ONLY; Resource ID.
19392	ID *string `json:"id,omitempty"`
19393	// Name - READ-ONLY; Resource name.
19394	Name *string `json:"name,omitempty"`
19395	// Type - READ-ONLY; Resource type.
19396	Type *string `json:"type,omitempty"`
19397}
19398
19399// MarshalJSON is the custom marshaler for SyncGroup.
19400func (sg SyncGroup) MarshalJSON() ([]byte, error) {
19401	objectMap := make(map[string]interface{})
19402	if sg.SyncGroupProperties != nil {
19403		objectMap["properties"] = sg.SyncGroupProperties
19404	}
19405	return json.Marshal(objectMap)
19406}
19407
19408// UnmarshalJSON is the custom unmarshaler for SyncGroup struct.
19409func (sg *SyncGroup) UnmarshalJSON(body []byte) error {
19410	var m map[string]*json.RawMessage
19411	err := json.Unmarshal(body, &m)
19412	if err != nil {
19413		return err
19414	}
19415	for k, v := range m {
19416		switch k {
19417		case "properties":
19418			if v != nil {
19419				var syncGroupProperties SyncGroupProperties
19420				err = json.Unmarshal(*v, &syncGroupProperties)
19421				if err != nil {
19422					return err
19423				}
19424				sg.SyncGroupProperties = &syncGroupProperties
19425			}
19426		case "id":
19427			if v != nil {
19428				var ID string
19429				err = json.Unmarshal(*v, &ID)
19430				if err != nil {
19431					return err
19432				}
19433				sg.ID = &ID
19434			}
19435		case "name":
19436			if v != nil {
19437				var name string
19438				err = json.Unmarshal(*v, &name)
19439				if err != nil {
19440					return err
19441				}
19442				sg.Name = &name
19443			}
19444		case "type":
19445			if v != nil {
19446				var typeVar string
19447				err = json.Unmarshal(*v, &typeVar)
19448				if err != nil {
19449					return err
19450				}
19451				sg.Type = &typeVar
19452			}
19453		}
19454	}
19455
19456	return nil
19457}
19458
19459// SyncGroupListResult a list of sync groups.
19460type SyncGroupListResult struct {
19461	autorest.Response `json:"-"`
19462	// Value - READ-ONLY; Array of results.
19463	Value *[]SyncGroup `json:"value,omitempty"`
19464	// NextLink - READ-ONLY; Link to retrieve next page of results.
19465	NextLink *string `json:"nextLink,omitempty"`
19466}
19467
19468// SyncGroupListResultIterator provides access to a complete listing of SyncGroup values.
19469type SyncGroupListResultIterator struct {
19470	i    int
19471	page SyncGroupListResultPage
19472}
19473
19474// NextWithContext advances to the next value.  If there was an error making
19475// the request the iterator does not advance and the error is returned.
19476func (iter *SyncGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
19477	if tracing.IsEnabled() {
19478		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupListResultIterator.NextWithContext")
19479		defer func() {
19480			sc := -1
19481			if iter.Response().Response.Response != nil {
19482				sc = iter.Response().Response.Response.StatusCode
19483			}
19484			tracing.EndSpan(ctx, sc, err)
19485		}()
19486	}
19487	iter.i++
19488	if iter.i < len(iter.page.Values()) {
19489		return nil
19490	}
19491	err = iter.page.NextWithContext(ctx)
19492	if err != nil {
19493		iter.i--
19494		return err
19495	}
19496	iter.i = 0
19497	return nil
19498}
19499
19500// Next advances to the next value.  If there was an error making
19501// the request the iterator does not advance and the error is returned.
19502// Deprecated: Use NextWithContext() instead.
19503func (iter *SyncGroupListResultIterator) Next() error {
19504	return iter.NextWithContext(context.Background())
19505}
19506
19507// NotDone returns true if the enumeration should be started or is not yet complete.
19508func (iter SyncGroupListResultIterator) NotDone() bool {
19509	return iter.page.NotDone() && iter.i < len(iter.page.Values())
19510}
19511
19512// Response returns the raw server response from the last page request.
19513func (iter SyncGroupListResultIterator) Response() SyncGroupListResult {
19514	return iter.page.Response()
19515}
19516
19517// Value returns the current value or a zero-initialized value if the
19518// iterator has advanced beyond the end of the collection.
19519func (iter SyncGroupListResultIterator) Value() SyncGroup {
19520	if !iter.page.NotDone() {
19521		return SyncGroup{}
19522	}
19523	return iter.page.Values()[iter.i]
19524}
19525
19526// Creates a new instance of the SyncGroupListResultIterator type.
19527func NewSyncGroupListResultIterator(page SyncGroupListResultPage) SyncGroupListResultIterator {
19528	return SyncGroupListResultIterator{page: page}
19529}
19530
19531// IsEmpty returns true if the ListResult contains no values.
19532func (sglr SyncGroupListResult) IsEmpty() bool {
19533	return sglr.Value == nil || len(*sglr.Value) == 0
19534}
19535
19536// hasNextLink returns true if the NextLink is not empty.
19537func (sglr SyncGroupListResult) hasNextLink() bool {
19538	return sglr.NextLink != nil && len(*sglr.NextLink) != 0
19539}
19540
19541// syncGroupListResultPreparer prepares a request to retrieve the next set of results.
19542// It returns nil if no more results exist.
19543func (sglr SyncGroupListResult) syncGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
19544	if !sglr.hasNextLink() {
19545		return nil, nil
19546	}
19547	return autorest.Prepare((&http.Request{}).WithContext(ctx),
19548		autorest.AsJSON(),
19549		autorest.AsGet(),
19550		autorest.WithBaseURL(to.String(sglr.NextLink)))
19551}
19552
19553// SyncGroupListResultPage contains a page of SyncGroup values.
19554type SyncGroupListResultPage struct {
19555	fn   func(context.Context, SyncGroupListResult) (SyncGroupListResult, error)
19556	sglr SyncGroupListResult
19557}
19558
19559// NextWithContext advances to the next page of values.  If there was an error making
19560// the request the page does not advance and the error is returned.
19561func (page *SyncGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
19562	if tracing.IsEnabled() {
19563		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupListResultPage.NextWithContext")
19564		defer func() {
19565			sc := -1
19566			if page.Response().Response.Response != nil {
19567				sc = page.Response().Response.Response.StatusCode
19568			}
19569			tracing.EndSpan(ctx, sc, err)
19570		}()
19571	}
19572	for {
19573		next, err := page.fn(ctx, page.sglr)
19574		if err != nil {
19575			return err
19576		}
19577		page.sglr = next
19578		if !next.hasNextLink() || !next.IsEmpty() {
19579			break
19580		}
19581	}
19582	return nil
19583}
19584
19585// Next advances to the next page of values.  If there was an error making
19586// the request the page does not advance and the error is returned.
19587// Deprecated: Use NextWithContext() instead.
19588func (page *SyncGroupListResultPage) Next() error {
19589	return page.NextWithContext(context.Background())
19590}
19591
19592// NotDone returns true if the page enumeration should be started or is not yet complete.
19593func (page SyncGroupListResultPage) NotDone() bool {
19594	return !page.sglr.IsEmpty()
19595}
19596
19597// Response returns the raw server response from the last page request.
19598func (page SyncGroupListResultPage) Response() SyncGroupListResult {
19599	return page.sglr
19600}
19601
19602// Values returns the slice of values for the current page or nil if there are no values.
19603func (page SyncGroupListResultPage) Values() []SyncGroup {
19604	if page.sglr.IsEmpty() {
19605		return nil
19606	}
19607	return *page.sglr.Value
19608}
19609
19610// Creates a new instance of the SyncGroupListResultPage type.
19611func NewSyncGroupListResultPage(cur SyncGroupListResult, getNextPage func(context.Context, SyncGroupListResult) (SyncGroupListResult, error)) SyncGroupListResultPage {
19612	return SyncGroupListResultPage{
19613		fn:   getNextPage,
19614		sglr: cur,
19615	}
19616}
19617
19618// SyncGroupLogListResult a list of sync group log properties.
19619type SyncGroupLogListResult struct {
19620	autorest.Response `json:"-"`
19621	// Value - READ-ONLY; Array of results.
19622	Value *[]SyncGroupLogProperties `json:"value,omitempty"`
19623	// NextLink - READ-ONLY; Link to retrieve next page of results.
19624	NextLink *string `json:"nextLink,omitempty"`
19625}
19626
19627// SyncGroupLogListResultIterator provides access to a complete listing of SyncGroupLogProperties values.
19628type SyncGroupLogListResultIterator struct {
19629	i    int
19630	page SyncGroupLogListResultPage
19631}
19632
19633// NextWithContext advances to the next value.  If there was an error making
19634// the request the iterator does not advance and the error is returned.
19635func (iter *SyncGroupLogListResultIterator) NextWithContext(ctx context.Context) (err error) {
19636	if tracing.IsEnabled() {
19637		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupLogListResultIterator.NextWithContext")
19638		defer func() {
19639			sc := -1
19640			if iter.Response().Response.Response != nil {
19641				sc = iter.Response().Response.Response.StatusCode
19642			}
19643			tracing.EndSpan(ctx, sc, err)
19644		}()
19645	}
19646	iter.i++
19647	if iter.i < len(iter.page.Values()) {
19648		return nil
19649	}
19650	err = iter.page.NextWithContext(ctx)
19651	if err != nil {
19652		iter.i--
19653		return err
19654	}
19655	iter.i = 0
19656	return nil
19657}
19658
19659// Next advances to the next value.  If there was an error making
19660// the request the iterator does not advance and the error is returned.
19661// Deprecated: Use NextWithContext() instead.
19662func (iter *SyncGroupLogListResultIterator) Next() error {
19663	return iter.NextWithContext(context.Background())
19664}
19665
19666// NotDone returns true if the enumeration should be started or is not yet complete.
19667func (iter SyncGroupLogListResultIterator) NotDone() bool {
19668	return iter.page.NotDone() && iter.i < len(iter.page.Values())
19669}
19670
19671// Response returns the raw server response from the last page request.
19672func (iter SyncGroupLogListResultIterator) Response() SyncGroupLogListResult {
19673	return iter.page.Response()
19674}
19675
19676// Value returns the current value or a zero-initialized value if the
19677// iterator has advanced beyond the end of the collection.
19678func (iter SyncGroupLogListResultIterator) Value() SyncGroupLogProperties {
19679	if !iter.page.NotDone() {
19680		return SyncGroupLogProperties{}
19681	}
19682	return iter.page.Values()[iter.i]
19683}
19684
19685// Creates a new instance of the SyncGroupLogListResultIterator type.
19686func NewSyncGroupLogListResultIterator(page SyncGroupLogListResultPage) SyncGroupLogListResultIterator {
19687	return SyncGroupLogListResultIterator{page: page}
19688}
19689
19690// IsEmpty returns true if the ListResult contains no values.
19691func (sgllr SyncGroupLogListResult) IsEmpty() bool {
19692	return sgllr.Value == nil || len(*sgllr.Value) == 0
19693}
19694
19695// hasNextLink returns true if the NextLink is not empty.
19696func (sgllr SyncGroupLogListResult) hasNextLink() bool {
19697	return sgllr.NextLink != nil && len(*sgllr.NextLink) != 0
19698}
19699
19700// syncGroupLogListResultPreparer prepares a request to retrieve the next set of results.
19701// It returns nil if no more results exist.
19702func (sgllr SyncGroupLogListResult) syncGroupLogListResultPreparer(ctx context.Context) (*http.Request, error) {
19703	if !sgllr.hasNextLink() {
19704		return nil, nil
19705	}
19706	return autorest.Prepare((&http.Request{}).WithContext(ctx),
19707		autorest.AsJSON(),
19708		autorest.AsGet(),
19709		autorest.WithBaseURL(to.String(sgllr.NextLink)))
19710}
19711
19712// SyncGroupLogListResultPage contains a page of SyncGroupLogProperties values.
19713type SyncGroupLogListResultPage struct {
19714	fn    func(context.Context, SyncGroupLogListResult) (SyncGroupLogListResult, error)
19715	sgllr SyncGroupLogListResult
19716}
19717
19718// NextWithContext advances to the next page of values.  If there was an error making
19719// the request the page does not advance and the error is returned.
19720func (page *SyncGroupLogListResultPage) NextWithContext(ctx context.Context) (err error) {
19721	if tracing.IsEnabled() {
19722		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupLogListResultPage.NextWithContext")
19723		defer func() {
19724			sc := -1
19725			if page.Response().Response.Response != nil {
19726				sc = page.Response().Response.Response.StatusCode
19727			}
19728			tracing.EndSpan(ctx, sc, err)
19729		}()
19730	}
19731	for {
19732		next, err := page.fn(ctx, page.sgllr)
19733		if err != nil {
19734			return err
19735		}
19736		page.sgllr = next
19737		if !next.hasNextLink() || !next.IsEmpty() {
19738			break
19739		}
19740	}
19741	return nil
19742}
19743
19744// Next advances to the next page of values.  If there was an error making
19745// the request the page does not advance and the error is returned.
19746// Deprecated: Use NextWithContext() instead.
19747func (page *SyncGroupLogListResultPage) Next() error {
19748	return page.NextWithContext(context.Background())
19749}
19750
19751// NotDone returns true if the page enumeration should be started or is not yet complete.
19752func (page SyncGroupLogListResultPage) NotDone() bool {
19753	return !page.sgllr.IsEmpty()
19754}
19755
19756// Response returns the raw server response from the last page request.
19757func (page SyncGroupLogListResultPage) Response() SyncGroupLogListResult {
19758	return page.sgllr
19759}
19760
19761// Values returns the slice of values for the current page or nil if there are no values.
19762func (page SyncGroupLogListResultPage) Values() []SyncGroupLogProperties {
19763	if page.sgllr.IsEmpty() {
19764		return nil
19765	}
19766	return *page.sgllr.Value
19767}
19768
19769// Creates a new instance of the SyncGroupLogListResultPage type.
19770func NewSyncGroupLogListResultPage(cur SyncGroupLogListResult, getNextPage func(context.Context, SyncGroupLogListResult) (SyncGroupLogListResult, error)) SyncGroupLogListResultPage {
19771	return SyncGroupLogListResultPage{
19772		fn:    getNextPage,
19773		sgllr: cur,
19774	}
19775}
19776
19777// SyncGroupLogProperties properties of an Azure SQL Database sync group log.
19778type SyncGroupLogProperties struct {
19779	// Timestamp - READ-ONLY; Timestamp of the sync group log.
19780	Timestamp *date.Time `json:"timestamp,omitempty"`
19781	// Type - READ-ONLY; Type of the sync group log. Possible values include: 'SyncGroupLogTypeAll', 'SyncGroupLogTypeError', 'SyncGroupLogTypeWarning', 'SyncGroupLogTypeSuccess'
19782	Type SyncGroupLogType `json:"type,omitempty"`
19783	// Source - READ-ONLY; Source of the sync group log.
19784	Source *string `json:"source,omitempty"`
19785	// Details - READ-ONLY; Details of the sync group log.
19786	Details *string `json:"details,omitempty"`
19787	// TracingID - READ-ONLY; TracingId of the sync group log.
19788	TracingID *uuid.UUID `json:"tracingId,omitempty"`
19789	// OperationStatus - READ-ONLY; OperationStatus of the sync group log.
19790	OperationStatus *string `json:"operationStatus,omitempty"`
19791}
19792
19793// SyncGroupProperties properties of a sync group.
19794type SyncGroupProperties struct {
19795	// Interval - Sync interval of the sync group.
19796	Interval *int32 `json:"interval,omitempty"`
19797	// LastSyncTime - READ-ONLY; Last sync time of the sync group.
19798	LastSyncTime *date.Time `json:"lastSyncTime,omitempty"`
19799	// ConflictResolutionPolicy - Conflict resolution policy of the sync group. Possible values include: 'HubWin', 'MemberWin'
19800	ConflictResolutionPolicy SyncConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
19801	// SyncDatabaseID - ARM resource id of the sync database in the sync group.
19802	SyncDatabaseID *string `json:"syncDatabaseId,omitempty"`
19803	// HubDatabaseUserName - User name for the sync group hub database credential.
19804	HubDatabaseUserName *string `json:"hubDatabaseUserName,omitempty"`
19805	// HubDatabasePassword - Password for the sync group hub database credential.
19806	HubDatabasePassword *string `json:"hubDatabasePassword,omitempty"`
19807	// SyncState - READ-ONLY; Sync state of the sync group. Possible values include: 'NotReady', 'Error', 'Warning', 'Progressing', 'Good'
19808	SyncState SyncGroupState `json:"syncState,omitempty"`
19809	// Schema - Sync schema of the sync group.
19810	Schema *SyncGroupSchema `json:"schema,omitempty"`
19811	// UsePrivateLinkConnection - If use private link connection is enabled.
19812	UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"`
19813	// PrivateEndpointName - READ-ONLY; Private endpoint name of the sync group if use private link connection is enabled.
19814	PrivateEndpointName *string `json:"privateEndpointName,omitempty"`
19815}
19816
19817// MarshalJSON is the custom marshaler for SyncGroupProperties.
19818func (sgp SyncGroupProperties) MarshalJSON() ([]byte, error) {
19819	objectMap := make(map[string]interface{})
19820	if sgp.Interval != nil {
19821		objectMap["interval"] = sgp.Interval
19822	}
19823	if sgp.ConflictResolutionPolicy != "" {
19824		objectMap["conflictResolutionPolicy"] = sgp.ConflictResolutionPolicy
19825	}
19826	if sgp.SyncDatabaseID != nil {
19827		objectMap["syncDatabaseId"] = sgp.SyncDatabaseID
19828	}
19829	if sgp.HubDatabaseUserName != nil {
19830		objectMap["hubDatabaseUserName"] = sgp.HubDatabaseUserName
19831	}
19832	if sgp.HubDatabasePassword != nil {
19833		objectMap["hubDatabasePassword"] = sgp.HubDatabasePassword
19834	}
19835	if sgp.Schema != nil {
19836		objectMap["schema"] = sgp.Schema
19837	}
19838	if sgp.UsePrivateLinkConnection != nil {
19839		objectMap["usePrivateLinkConnection"] = sgp.UsePrivateLinkConnection
19840	}
19841	return json.Marshal(objectMap)
19842}
19843
19844// SyncGroupSchema properties of sync group schema.
19845type SyncGroupSchema struct {
19846	// Tables - List of tables in sync group schema.
19847	Tables *[]SyncGroupSchemaTable `json:"tables,omitempty"`
19848	// MasterSyncMemberName - Name of master sync member where the schema is from.
19849	MasterSyncMemberName *string `json:"masterSyncMemberName,omitempty"`
19850}
19851
19852// SyncGroupSchemaTable properties of table in sync group schema.
19853type SyncGroupSchemaTable struct {
19854	// Columns - List of columns in sync group schema.
19855	Columns *[]SyncGroupSchemaTableColumn `json:"columns,omitempty"`
19856	// QuotedName - Quoted name of sync group schema table.
19857	QuotedName *string `json:"quotedName,omitempty"`
19858}
19859
19860// SyncGroupSchemaTableColumn properties of column in sync group table.
19861type SyncGroupSchemaTableColumn struct {
19862	// QuotedName - Quoted name of sync group table column.
19863	QuotedName *string `json:"quotedName,omitempty"`
19864	// DataSize - Data size of the column.
19865	DataSize *string `json:"dataSize,omitempty"`
19866	// DataType - Data type of the column.
19867	DataType *string `json:"dataType,omitempty"`
19868}
19869
19870// SyncGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
19871// long-running operation.
19872type SyncGroupsCreateOrUpdateFuture struct {
19873	azure.FutureAPI
19874	// Result returns the result of the asynchronous operation.
19875	// If the operation has not completed it will return an error.
19876	Result func(SyncGroupsClient) (SyncGroup, error)
19877}
19878
19879// SyncGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
19880// operation.
19881type SyncGroupsDeleteFuture struct {
19882	azure.FutureAPI
19883	// Result returns the result of the asynchronous operation.
19884	// If the operation has not completed it will return an error.
19885	Result func(SyncGroupsClient) (autorest.Response, error)
19886}
19887
19888// SyncGroupsRefreshHubSchemaFuture an abstraction for monitoring and retrieving the results of a
19889// long-running operation.
19890type SyncGroupsRefreshHubSchemaFuture struct {
19891	azure.FutureAPI
19892	// Result returns the result of the asynchronous operation.
19893	// If the operation has not completed it will return an error.
19894	Result func(SyncGroupsClient) (autorest.Response, error)
19895}
19896
19897// SyncGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
19898// operation.
19899type SyncGroupsUpdateFuture struct {
19900	azure.FutureAPI
19901	// Result returns the result of the asynchronous operation.
19902	// If the operation has not completed it will return an error.
19903	Result func(SyncGroupsClient) (SyncGroup, error)
19904}
19905
19906// SyncMember an Azure SQL Database sync member.
19907type SyncMember struct {
19908	autorest.Response `json:"-"`
19909	// SyncMemberProperties - Resource properties.
19910	*SyncMemberProperties `json:"properties,omitempty"`
19911	// ID - READ-ONLY; Resource ID.
19912	ID *string `json:"id,omitempty"`
19913	// Name - READ-ONLY; Resource name.
19914	Name *string `json:"name,omitempty"`
19915	// Type - READ-ONLY; Resource type.
19916	Type *string `json:"type,omitempty"`
19917}
19918
19919// MarshalJSON is the custom marshaler for SyncMember.
19920func (sm SyncMember) MarshalJSON() ([]byte, error) {
19921	objectMap := make(map[string]interface{})
19922	if sm.SyncMemberProperties != nil {
19923		objectMap["properties"] = sm.SyncMemberProperties
19924	}
19925	return json.Marshal(objectMap)
19926}
19927
19928// UnmarshalJSON is the custom unmarshaler for SyncMember struct.
19929func (sm *SyncMember) UnmarshalJSON(body []byte) error {
19930	var m map[string]*json.RawMessage
19931	err := json.Unmarshal(body, &m)
19932	if err != nil {
19933		return err
19934	}
19935	for k, v := range m {
19936		switch k {
19937		case "properties":
19938			if v != nil {
19939				var syncMemberProperties SyncMemberProperties
19940				err = json.Unmarshal(*v, &syncMemberProperties)
19941				if err != nil {
19942					return err
19943				}
19944				sm.SyncMemberProperties = &syncMemberProperties
19945			}
19946		case "id":
19947			if v != nil {
19948				var ID string
19949				err = json.Unmarshal(*v, &ID)
19950				if err != nil {
19951					return err
19952				}
19953				sm.ID = &ID
19954			}
19955		case "name":
19956			if v != nil {
19957				var name string
19958				err = json.Unmarshal(*v, &name)
19959				if err != nil {
19960					return err
19961				}
19962				sm.Name = &name
19963			}
19964		case "type":
19965			if v != nil {
19966				var typeVar string
19967				err = json.Unmarshal(*v, &typeVar)
19968				if err != nil {
19969					return err
19970				}
19971				sm.Type = &typeVar
19972			}
19973		}
19974	}
19975
19976	return nil
19977}
19978
19979// SyncMemberListResult a list of Azure SQL Database sync members.
19980type SyncMemberListResult struct {
19981	autorest.Response `json:"-"`
19982	// Value - READ-ONLY; Array of results.
19983	Value *[]SyncMember `json:"value,omitempty"`
19984	// NextLink - READ-ONLY; Link to retrieve next page of results.
19985	NextLink *string `json:"nextLink,omitempty"`
19986}
19987
19988// SyncMemberListResultIterator provides access to a complete listing of SyncMember values.
19989type SyncMemberListResultIterator struct {
19990	i    int
19991	page SyncMemberListResultPage
19992}
19993
19994// NextWithContext advances to the next value.  If there was an error making
19995// the request the iterator does not advance and the error is returned.
19996func (iter *SyncMemberListResultIterator) NextWithContext(ctx context.Context) (err error) {
19997	if tracing.IsEnabled() {
19998		ctx = tracing.StartSpan(ctx, fqdn+"/SyncMemberListResultIterator.NextWithContext")
19999		defer func() {
20000			sc := -1
20001			if iter.Response().Response.Response != nil {
20002				sc = iter.Response().Response.Response.StatusCode
20003			}
20004			tracing.EndSpan(ctx, sc, err)
20005		}()
20006	}
20007	iter.i++
20008	if iter.i < len(iter.page.Values()) {
20009		return nil
20010	}
20011	err = iter.page.NextWithContext(ctx)
20012	if err != nil {
20013		iter.i--
20014		return err
20015	}
20016	iter.i = 0
20017	return nil
20018}
20019
20020// Next advances to the next value.  If there was an error making
20021// the request the iterator does not advance and the error is returned.
20022// Deprecated: Use NextWithContext() instead.
20023func (iter *SyncMemberListResultIterator) Next() error {
20024	return iter.NextWithContext(context.Background())
20025}
20026
20027// NotDone returns true if the enumeration should be started or is not yet complete.
20028func (iter SyncMemberListResultIterator) NotDone() bool {
20029	return iter.page.NotDone() && iter.i < len(iter.page.Values())
20030}
20031
20032// Response returns the raw server response from the last page request.
20033func (iter SyncMemberListResultIterator) Response() SyncMemberListResult {
20034	return iter.page.Response()
20035}
20036
20037// Value returns the current value or a zero-initialized value if the
20038// iterator has advanced beyond the end of the collection.
20039func (iter SyncMemberListResultIterator) Value() SyncMember {
20040	if !iter.page.NotDone() {
20041		return SyncMember{}
20042	}
20043	return iter.page.Values()[iter.i]
20044}
20045
20046// Creates a new instance of the SyncMemberListResultIterator type.
20047func NewSyncMemberListResultIterator(page SyncMemberListResultPage) SyncMemberListResultIterator {
20048	return SyncMemberListResultIterator{page: page}
20049}
20050
20051// IsEmpty returns true if the ListResult contains no values.
20052func (smlr SyncMemberListResult) IsEmpty() bool {
20053	return smlr.Value == nil || len(*smlr.Value) == 0
20054}
20055
20056// hasNextLink returns true if the NextLink is not empty.
20057func (smlr SyncMemberListResult) hasNextLink() bool {
20058	return smlr.NextLink != nil && len(*smlr.NextLink) != 0
20059}
20060
20061// syncMemberListResultPreparer prepares a request to retrieve the next set of results.
20062// It returns nil if no more results exist.
20063func (smlr SyncMemberListResult) syncMemberListResultPreparer(ctx context.Context) (*http.Request, error) {
20064	if !smlr.hasNextLink() {
20065		return nil, nil
20066	}
20067	return autorest.Prepare((&http.Request{}).WithContext(ctx),
20068		autorest.AsJSON(),
20069		autorest.AsGet(),
20070		autorest.WithBaseURL(to.String(smlr.NextLink)))
20071}
20072
20073// SyncMemberListResultPage contains a page of SyncMember values.
20074type SyncMemberListResultPage struct {
20075	fn   func(context.Context, SyncMemberListResult) (SyncMemberListResult, error)
20076	smlr SyncMemberListResult
20077}
20078
20079// NextWithContext advances to the next page of values.  If there was an error making
20080// the request the page does not advance and the error is returned.
20081func (page *SyncMemberListResultPage) NextWithContext(ctx context.Context) (err error) {
20082	if tracing.IsEnabled() {
20083		ctx = tracing.StartSpan(ctx, fqdn+"/SyncMemberListResultPage.NextWithContext")
20084		defer func() {
20085			sc := -1
20086			if page.Response().Response.Response != nil {
20087				sc = page.Response().Response.Response.StatusCode
20088			}
20089			tracing.EndSpan(ctx, sc, err)
20090		}()
20091	}
20092	for {
20093		next, err := page.fn(ctx, page.smlr)
20094		if err != nil {
20095			return err
20096		}
20097		page.smlr = next
20098		if !next.hasNextLink() || !next.IsEmpty() {
20099			break
20100		}
20101	}
20102	return nil
20103}
20104
20105// Next advances to the next page of values.  If there was an error making
20106// the request the page does not advance and the error is returned.
20107// Deprecated: Use NextWithContext() instead.
20108func (page *SyncMemberListResultPage) Next() error {
20109	return page.NextWithContext(context.Background())
20110}
20111
20112// NotDone returns true if the page enumeration should be started or is not yet complete.
20113func (page SyncMemberListResultPage) NotDone() bool {
20114	return !page.smlr.IsEmpty()
20115}
20116
20117// Response returns the raw server response from the last page request.
20118func (page SyncMemberListResultPage) Response() SyncMemberListResult {
20119	return page.smlr
20120}
20121
20122// Values returns the slice of values for the current page or nil if there are no values.
20123func (page SyncMemberListResultPage) Values() []SyncMember {
20124	if page.smlr.IsEmpty() {
20125		return nil
20126	}
20127	return *page.smlr.Value
20128}
20129
20130// Creates a new instance of the SyncMemberListResultPage type.
20131func NewSyncMemberListResultPage(cur SyncMemberListResult, getNextPage func(context.Context, SyncMemberListResult) (SyncMemberListResult, error)) SyncMemberListResultPage {
20132	return SyncMemberListResultPage{
20133		fn:   getNextPage,
20134		smlr: cur,
20135	}
20136}
20137
20138// SyncMemberProperties properties of a sync member.
20139type SyncMemberProperties struct {
20140	// DatabaseType - Database type of the sync member. Possible values include: 'AzureSQLDatabase', 'SQLServerDatabase'
20141	DatabaseType SyncMemberDbType `json:"databaseType,omitempty"`
20142	// SyncAgentID - ARM resource id of the sync agent in the sync member.
20143	SyncAgentID *string `json:"syncAgentId,omitempty"`
20144	// SQLServerDatabaseID - SQL Server database id of the sync member.
20145	SQLServerDatabaseID *uuid.UUID `json:"sqlServerDatabaseId,omitempty"`
20146	// SyncMemberAzureDatabaseResourceID - ARM resource id of the sync member logical database, for sync members in Azure.
20147	SyncMemberAzureDatabaseResourceID *string `json:"syncMemberAzureDatabaseResourceId,omitempty"`
20148	// UsePrivateLinkConnection - Whether to use private link connection.
20149	UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"`
20150	// PrivateEndpointName - READ-ONLY; Private endpoint name of the sync member if use private link connection is enabled, for sync members in Azure.
20151	PrivateEndpointName *string `json:"privateEndpointName,omitempty"`
20152	// ServerName - Server name of the member database in the sync member
20153	ServerName *string `json:"serverName,omitempty"`
20154	// DatabaseName - Database name of the member database in the sync member.
20155	DatabaseName *string `json:"databaseName,omitempty"`
20156	// UserName - User name of the member database in the sync member.
20157	UserName *string `json:"userName,omitempty"`
20158	// Password - Password of the member database in the sync member.
20159	Password *string `json:"password,omitempty"`
20160	// SyncDirection - Sync direction of the sync member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', 'OneWayHubToMember'
20161	SyncDirection SyncDirection `json:"syncDirection,omitempty"`
20162	// 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'
20163	SyncState SyncMemberState `json:"syncState,omitempty"`
20164}
20165
20166// MarshalJSON is the custom marshaler for SyncMemberProperties.
20167func (smp SyncMemberProperties) MarshalJSON() ([]byte, error) {
20168	objectMap := make(map[string]interface{})
20169	if smp.DatabaseType != "" {
20170		objectMap["databaseType"] = smp.DatabaseType
20171	}
20172	if smp.SyncAgentID != nil {
20173		objectMap["syncAgentId"] = smp.SyncAgentID
20174	}
20175	if smp.SQLServerDatabaseID != nil {
20176		objectMap["sqlServerDatabaseId"] = smp.SQLServerDatabaseID
20177	}
20178	if smp.SyncMemberAzureDatabaseResourceID != nil {
20179		objectMap["syncMemberAzureDatabaseResourceId"] = smp.SyncMemberAzureDatabaseResourceID
20180	}
20181	if smp.UsePrivateLinkConnection != nil {
20182		objectMap["usePrivateLinkConnection"] = smp.UsePrivateLinkConnection
20183	}
20184	if smp.ServerName != nil {
20185		objectMap["serverName"] = smp.ServerName
20186	}
20187	if smp.DatabaseName != nil {
20188		objectMap["databaseName"] = smp.DatabaseName
20189	}
20190	if smp.UserName != nil {
20191		objectMap["userName"] = smp.UserName
20192	}
20193	if smp.Password != nil {
20194		objectMap["password"] = smp.Password
20195	}
20196	if smp.SyncDirection != "" {
20197		objectMap["syncDirection"] = smp.SyncDirection
20198	}
20199	return json.Marshal(objectMap)
20200}
20201
20202// SyncMembersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
20203// long-running operation.
20204type SyncMembersCreateOrUpdateFuture struct {
20205	azure.FutureAPI
20206	// Result returns the result of the asynchronous operation.
20207	// If the operation has not completed it will return an error.
20208	Result func(SyncMembersClient) (SyncMember, error)
20209}
20210
20211// SyncMembersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
20212// operation.
20213type SyncMembersDeleteFuture struct {
20214	azure.FutureAPI
20215	// Result returns the result of the asynchronous operation.
20216	// If the operation has not completed it will return an error.
20217	Result func(SyncMembersClient) (autorest.Response, error)
20218}
20219
20220// SyncMembersRefreshMemberSchemaFuture an abstraction for monitoring and retrieving the results of a
20221// long-running operation.
20222type SyncMembersRefreshMemberSchemaFuture struct {
20223	azure.FutureAPI
20224	// Result returns the result of the asynchronous operation.
20225	// If the operation has not completed it will return an error.
20226	Result func(SyncMembersClient) (autorest.Response, error)
20227}
20228
20229// SyncMembersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
20230// operation.
20231type SyncMembersUpdateFuture struct {
20232	azure.FutureAPI
20233	// Result returns the result of the asynchronous operation.
20234	// If the operation has not completed it will return an error.
20235	Result func(SyncMembersClient) (SyncMember, error)
20236}
20237
20238// TdeCertificate a TDE certificate that can be uploaded into a server.
20239type TdeCertificate struct {
20240	// TdeCertificateProperties - Resource properties.
20241	*TdeCertificateProperties `json:"properties,omitempty"`
20242	// ID - READ-ONLY; Resource ID.
20243	ID *string `json:"id,omitempty"`
20244	// Name - READ-ONLY; Resource name.
20245	Name *string `json:"name,omitempty"`
20246	// Type - READ-ONLY; Resource type.
20247	Type *string `json:"type,omitempty"`
20248}
20249
20250// MarshalJSON is the custom marshaler for TdeCertificate.
20251func (tc TdeCertificate) MarshalJSON() ([]byte, error) {
20252	objectMap := make(map[string]interface{})
20253	if tc.TdeCertificateProperties != nil {
20254		objectMap["properties"] = tc.TdeCertificateProperties
20255	}
20256	return json.Marshal(objectMap)
20257}
20258
20259// UnmarshalJSON is the custom unmarshaler for TdeCertificate struct.
20260func (tc *TdeCertificate) UnmarshalJSON(body []byte) error {
20261	var m map[string]*json.RawMessage
20262	err := json.Unmarshal(body, &m)
20263	if err != nil {
20264		return err
20265	}
20266	for k, v := range m {
20267		switch k {
20268		case "properties":
20269			if v != nil {
20270				var tdeCertificateProperties TdeCertificateProperties
20271				err = json.Unmarshal(*v, &tdeCertificateProperties)
20272				if err != nil {
20273					return err
20274				}
20275				tc.TdeCertificateProperties = &tdeCertificateProperties
20276			}
20277		case "id":
20278			if v != nil {
20279				var ID string
20280				err = json.Unmarshal(*v, &ID)
20281				if err != nil {
20282					return err
20283				}
20284				tc.ID = &ID
20285			}
20286		case "name":
20287			if v != nil {
20288				var name string
20289				err = json.Unmarshal(*v, &name)
20290				if err != nil {
20291					return err
20292				}
20293				tc.Name = &name
20294			}
20295		case "type":
20296			if v != nil {
20297				var typeVar string
20298				err = json.Unmarshal(*v, &typeVar)
20299				if err != nil {
20300					return err
20301				}
20302				tc.Type = &typeVar
20303			}
20304		}
20305	}
20306
20307	return nil
20308}
20309
20310// TdeCertificateProperties properties of a TDE certificate.
20311type TdeCertificateProperties struct {
20312	// PrivateBlob - The base64 encoded certificate private blob.
20313	PrivateBlob *string `json:"privateBlob,omitempty"`
20314	// CertPassword - The certificate password.
20315	CertPassword *string `json:"certPassword,omitempty"`
20316}
20317
20318// TdeCertificatesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
20319// operation.
20320type TdeCertificatesCreateFuture struct {
20321	azure.FutureAPI
20322	// Result returns the result of the asynchronous operation.
20323	// If the operation has not completed it will return an error.
20324	Result func(TdeCertificatesClient) (autorest.Response, error)
20325}
20326
20327// TrackedResource ARM tracked top level resource.
20328type TrackedResource struct {
20329	// Location - Resource location.
20330	Location *string `json:"location,omitempty"`
20331	// Tags - Resource tags.
20332	Tags map[string]*string `json:"tags"`
20333	// ID - READ-ONLY; Resource ID.
20334	ID *string `json:"id,omitempty"`
20335	// Name - READ-ONLY; Resource name.
20336	Name *string `json:"name,omitempty"`
20337	// Type - READ-ONLY; Resource type.
20338	Type *string `json:"type,omitempty"`
20339}
20340
20341// MarshalJSON is the custom marshaler for TrackedResource.
20342func (tr TrackedResource) MarshalJSON() ([]byte, error) {
20343	objectMap := make(map[string]interface{})
20344	if tr.Location != nil {
20345		objectMap["location"] = tr.Location
20346	}
20347	if tr.Tags != nil {
20348		objectMap["tags"] = tr.Tags
20349	}
20350	return json.Marshal(objectMap)
20351}
20352
20353// TransparentDataEncryption represents a database transparent data encryption configuration.
20354type TransparentDataEncryption struct {
20355	autorest.Response `json:"-"`
20356	// Location - READ-ONLY; Resource location.
20357	Location *string `json:"location,omitempty"`
20358	// TransparentDataEncryptionProperties - Represents the properties of the resource.
20359	*TransparentDataEncryptionProperties `json:"properties,omitempty"`
20360	// ID - READ-ONLY; Resource ID.
20361	ID *string `json:"id,omitempty"`
20362	// Name - READ-ONLY; Resource name.
20363	Name *string `json:"name,omitempty"`
20364	// Type - READ-ONLY; Resource type.
20365	Type *string `json:"type,omitempty"`
20366}
20367
20368// MarshalJSON is the custom marshaler for TransparentDataEncryption.
20369func (tde TransparentDataEncryption) MarshalJSON() ([]byte, error) {
20370	objectMap := make(map[string]interface{})
20371	if tde.TransparentDataEncryptionProperties != nil {
20372		objectMap["properties"] = tde.TransparentDataEncryptionProperties
20373	}
20374	return json.Marshal(objectMap)
20375}
20376
20377// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryption struct.
20378func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error {
20379	var m map[string]*json.RawMessage
20380	err := json.Unmarshal(body, &m)
20381	if err != nil {
20382		return err
20383	}
20384	for k, v := range m {
20385		switch k {
20386		case "location":
20387			if v != nil {
20388				var location string
20389				err = json.Unmarshal(*v, &location)
20390				if err != nil {
20391					return err
20392				}
20393				tde.Location = &location
20394			}
20395		case "properties":
20396			if v != nil {
20397				var transparentDataEncryptionProperties TransparentDataEncryptionProperties
20398				err = json.Unmarshal(*v, &transparentDataEncryptionProperties)
20399				if err != nil {
20400					return err
20401				}
20402				tde.TransparentDataEncryptionProperties = &transparentDataEncryptionProperties
20403			}
20404		case "id":
20405			if v != nil {
20406				var ID string
20407				err = json.Unmarshal(*v, &ID)
20408				if err != nil {
20409					return err
20410				}
20411				tde.ID = &ID
20412			}
20413		case "name":
20414			if v != nil {
20415				var name string
20416				err = json.Unmarshal(*v, &name)
20417				if err != nil {
20418					return err
20419				}
20420				tde.Name = &name
20421			}
20422		case "type":
20423			if v != nil {
20424				var typeVar string
20425				err = json.Unmarshal(*v, &typeVar)
20426				if err != nil {
20427					return err
20428				}
20429				tde.Type = &typeVar
20430			}
20431		}
20432	}
20433
20434	return nil
20435}
20436
20437// TransparentDataEncryptionActivity represents a database transparent data encryption Scan.
20438type TransparentDataEncryptionActivity struct {
20439	// Location - READ-ONLY; Resource location.
20440	Location *string `json:"location,omitempty"`
20441	// TransparentDataEncryptionActivityProperties - Represents the properties of the resource.
20442	*TransparentDataEncryptionActivityProperties `json:"properties,omitempty"`
20443	// ID - READ-ONLY; Resource ID.
20444	ID *string `json:"id,omitempty"`
20445	// Name - READ-ONLY; Resource name.
20446	Name *string `json:"name,omitempty"`
20447	// Type - READ-ONLY; Resource type.
20448	Type *string `json:"type,omitempty"`
20449}
20450
20451// MarshalJSON is the custom marshaler for TransparentDataEncryptionActivity.
20452func (tdea TransparentDataEncryptionActivity) MarshalJSON() ([]byte, error) {
20453	objectMap := make(map[string]interface{})
20454	if tdea.TransparentDataEncryptionActivityProperties != nil {
20455		objectMap["properties"] = tdea.TransparentDataEncryptionActivityProperties
20456	}
20457	return json.Marshal(objectMap)
20458}
20459
20460// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryptionActivity struct.
20461func (tdea *TransparentDataEncryptionActivity) UnmarshalJSON(body []byte) error {
20462	var m map[string]*json.RawMessage
20463	err := json.Unmarshal(body, &m)
20464	if err != nil {
20465		return err
20466	}
20467	for k, v := range m {
20468		switch k {
20469		case "location":
20470			if v != nil {
20471				var location string
20472				err = json.Unmarshal(*v, &location)
20473				if err != nil {
20474					return err
20475				}
20476				tdea.Location = &location
20477			}
20478		case "properties":
20479			if v != nil {
20480				var transparentDataEncryptionActivityProperties TransparentDataEncryptionActivityProperties
20481				err = json.Unmarshal(*v, &transparentDataEncryptionActivityProperties)
20482				if err != nil {
20483					return err
20484				}
20485				tdea.TransparentDataEncryptionActivityProperties = &transparentDataEncryptionActivityProperties
20486			}
20487		case "id":
20488			if v != nil {
20489				var ID string
20490				err = json.Unmarshal(*v, &ID)
20491				if err != nil {
20492					return err
20493				}
20494				tdea.ID = &ID
20495			}
20496		case "name":
20497			if v != nil {
20498				var name string
20499				err = json.Unmarshal(*v, &name)
20500				if err != nil {
20501					return err
20502				}
20503				tdea.Name = &name
20504			}
20505		case "type":
20506			if v != nil {
20507				var typeVar string
20508				err = json.Unmarshal(*v, &typeVar)
20509				if err != nil {
20510					return err
20511				}
20512				tdea.Type = &typeVar
20513			}
20514		}
20515	}
20516
20517	return nil
20518}
20519
20520// TransparentDataEncryptionActivityListResult represents the response to a list database transparent data
20521// encryption activity request.
20522type TransparentDataEncryptionActivityListResult struct {
20523	autorest.Response `json:"-"`
20524	// Value - The list of database transparent data encryption activities.
20525	Value *[]TransparentDataEncryptionActivity `json:"value,omitempty"`
20526}
20527
20528// TransparentDataEncryptionActivityProperties represents the properties of a database transparent data
20529// encryption Scan.
20530type TransparentDataEncryptionActivityProperties struct {
20531	// Status - READ-ONLY; The status of the database. Possible values include: 'Encrypting', 'Decrypting'
20532	Status TransparentDataEncryptionActivityStatus `json:"status,omitempty"`
20533	// PercentComplete - READ-ONLY; The percent complete of the transparent data encryption scan for a database.
20534	PercentComplete *float64 `json:"percentComplete,omitempty"`
20535}
20536
20537// TransparentDataEncryptionProperties represents the properties of a database transparent data encryption.
20538type TransparentDataEncryptionProperties struct {
20539	// Status - The status of the database transparent data encryption. Possible values include: 'TransparentDataEncryptionStatusEnabled', 'TransparentDataEncryptionStatusDisabled'
20540	Status TransparentDataEncryptionStatus `json:"status,omitempty"`
20541}
20542
20543// UnlinkParameters represents the parameters for Unlink Replication Link request.
20544type UnlinkParameters struct {
20545	// ForcedTermination - Determines whether link will be terminated in a forced or a friendly way.
20546	ForcedTermination *bool `json:"forcedTermination,omitempty"`
20547}
20548
20549// UpsertManagedServerOperationParameters ...
20550type UpsertManagedServerOperationParameters struct {
20551	Family          *string `json:"family,omitempty"`
20552	Tier            *string `json:"tier,omitempty"`
20553	VCores          *int32  `json:"vCores,omitempty"`
20554	StorageSizeInGB *int32  `json:"storageSizeInGB,omitempty"`
20555}
20556
20557// UpsertManagedServerOperationStep ...
20558type UpsertManagedServerOperationStep struct {
20559	Order *int32  `json:"order,omitempty"`
20560	Name  *string `json:"name,omitempty"`
20561	// Status - Possible values include: 'StatusNotStarted', 'StatusInProgress', 'StatusSlowedDown', 'StatusCompleted', 'StatusFailed', 'StatusCanceled'
20562	Status Status `json:"status,omitempty"`
20563}
20564
20565// Usage ARM usage.
20566type Usage struct {
20567	// ID - READ-ONLY; Resource ID.
20568	ID *string `json:"id,omitempty"`
20569	// Name - READ-ONLY; Resource name.
20570	Name *Name `json:"name,omitempty"`
20571	// Type - READ-ONLY; Resource type.
20572	Type *string `json:"type,omitempty"`
20573	// Unit - READ-ONLY; Usage unit.
20574	Unit *string `json:"unit,omitempty"`
20575	// CurrentValue - READ-ONLY; Usage current value.
20576	CurrentValue *int32 `json:"currentValue,omitempty"`
20577	// Limit - READ-ONLY; Usage limit.
20578	Limit *int32 `json:"limit,omitempty"`
20579	// RequestedLimit - READ-ONLY; Usage requested limit.
20580	RequestedLimit *int32 `json:"requestedLimit,omitempty"`
20581}
20582
20583// UsageListResult a list of usages.
20584type UsageListResult struct {
20585	autorest.Response `json:"-"`
20586	// Value - READ-ONLY; Array of results.
20587	Value *[]Usage `json:"value,omitempty"`
20588	// NextLink - READ-ONLY; Link to retrieve next page of results.
20589	NextLink *string `json:"nextLink,omitempty"`
20590}
20591
20592// UsageListResultIterator provides access to a complete listing of Usage values.
20593type UsageListResultIterator struct {
20594	i    int
20595	page UsageListResultPage
20596}
20597
20598// NextWithContext advances to the next value.  If there was an error making
20599// the request the iterator does not advance and the error is returned.
20600func (iter *UsageListResultIterator) NextWithContext(ctx context.Context) (err error) {
20601	if tracing.IsEnabled() {
20602		ctx = tracing.StartSpan(ctx, fqdn+"/UsageListResultIterator.NextWithContext")
20603		defer func() {
20604			sc := -1
20605			if iter.Response().Response.Response != nil {
20606				sc = iter.Response().Response.Response.StatusCode
20607			}
20608			tracing.EndSpan(ctx, sc, err)
20609		}()
20610	}
20611	iter.i++
20612	if iter.i < len(iter.page.Values()) {
20613		return nil
20614	}
20615	err = iter.page.NextWithContext(ctx)
20616	if err != nil {
20617		iter.i--
20618		return err
20619	}
20620	iter.i = 0
20621	return nil
20622}
20623
20624// Next advances to the next value.  If there was an error making
20625// the request the iterator does not advance and the error is returned.
20626// Deprecated: Use NextWithContext() instead.
20627func (iter *UsageListResultIterator) Next() error {
20628	return iter.NextWithContext(context.Background())
20629}
20630
20631// NotDone returns true if the enumeration should be started or is not yet complete.
20632func (iter UsageListResultIterator) NotDone() bool {
20633	return iter.page.NotDone() && iter.i < len(iter.page.Values())
20634}
20635
20636// Response returns the raw server response from the last page request.
20637func (iter UsageListResultIterator) Response() UsageListResult {
20638	return iter.page.Response()
20639}
20640
20641// Value returns the current value or a zero-initialized value if the
20642// iterator has advanced beyond the end of the collection.
20643func (iter UsageListResultIterator) Value() Usage {
20644	if !iter.page.NotDone() {
20645		return Usage{}
20646	}
20647	return iter.page.Values()[iter.i]
20648}
20649
20650// Creates a new instance of the UsageListResultIterator type.
20651func NewUsageListResultIterator(page UsageListResultPage) UsageListResultIterator {
20652	return UsageListResultIterator{page: page}
20653}
20654
20655// IsEmpty returns true if the ListResult contains no values.
20656func (ulr UsageListResult) IsEmpty() bool {
20657	return ulr.Value == nil || len(*ulr.Value) == 0
20658}
20659
20660// hasNextLink returns true if the NextLink is not empty.
20661func (ulr UsageListResult) hasNextLink() bool {
20662	return ulr.NextLink != nil && len(*ulr.NextLink) != 0
20663}
20664
20665// usageListResultPreparer prepares a request to retrieve the next set of results.
20666// It returns nil if no more results exist.
20667func (ulr UsageListResult) usageListResultPreparer(ctx context.Context) (*http.Request, error) {
20668	if !ulr.hasNextLink() {
20669		return nil, nil
20670	}
20671	return autorest.Prepare((&http.Request{}).WithContext(ctx),
20672		autorest.AsJSON(),
20673		autorest.AsGet(),
20674		autorest.WithBaseURL(to.String(ulr.NextLink)))
20675}
20676
20677// UsageListResultPage contains a page of Usage values.
20678type UsageListResultPage struct {
20679	fn  func(context.Context, UsageListResult) (UsageListResult, error)
20680	ulr UsageListResult
20681}
20682
20683// NextWithContext advances to the next page of values.  If there was an error making
20684// the request the page does not advance and the error is returned.
20685func (page *UsageListResultPage) NextWithContext(ctx context.Context) (err error) {
20686	if tracing.IsEnabled() {
20687		ctx = tracing.StartSpan(ctx, fqdn+"/UsageListResultPage.NextWithContext")
20688		defer func() {
20689			sc := -1
20690			if page.Response().Response.Response != nil {
20691				sc = page.Response().Response.Response.StatusCode
20692			}
20693			tracing.EndSpan(ctx, sc, err)
20694		}()
20695	}
20696	for {
20697		next, err := page.fn(ctx, page.ulr)
20698		if err != nil {
20699			return err
20700		}
20701		page.ulr = next
20702		if !next.hasNextLink() || !next.IsEmpty() {
20703			break
20704		}
20705	}
20706	return nil
20707}
20708
20709// Next advances to the next page of values.  If there was an error making
20710// the request the page does not advance and the error is returned.
20711// Deprecated: Use NextWithContext() instead.
20712func (page *UsageListResultPage) Next() error {
20713	return page.NextWithContext(context.Background())
20714}
20715
20716// NotDone returns true if the page enumeration should be started or is not yet complete.
20717func (page UsageListResultPage) NotDone() bool {
20718	return !page.ulr.IsEmpty()
20719}
20720
20721// Response returns the raw server response from the last page request.
20722func (page UsageListResultPage) Response() UsageListResult {
20723	return page.ulr
20724}
20725
20726// Values returns the slice of values for the current page or nil if there are no values.
20727func (page UsageListResultPage) Values() []Usage {
20728	if page.ulr.IsEmpty() {
20729		return nil
20730	}
20731	return *page.ulr.Value
20732}
20733
20734// Creates a new instance of the UsageListResultPage type.
20735func NewUsageListResultPage(cur UsageListResult, getNextPage func(context.Context, UsageListResult) (UsageListResult, error)) UsageListResultPage {
20736	return UsageListResultPage{
20737		fn:  getNextPage,
20738		ulr: cur,
20739	}
20740}
20741
20742// VirtualCluster an Azure SQL virtual cluster.
20743type VirtualCluster struct {
20744	autorest.Response `json:"-"`
20745	// VirtualClusterProperties - Resource properties.
20746	*VirtualClusterProperties `json:"properties,omitempty"`
20747	// Location - Resource location.
20748	Location *string `json:"location,omitempty"`
20749	// Tags - Resource tags.
20750	Tags map[string]*string `json:"tags"`
20751	// ID - READ-ONLY; Resource ID.
20752	ID *string `json:"id,omitempty"`
20753	// Name - READ-ONLY; Resource name.
20754	Name *string `json:"name,omitempty"`
20755	// Type - READ-ONLY; Resource type.
20756	Type *string `json:"type,omitempty"`
20757}
20758
20759// MarshalJSON is the custom marshaler for VirtualCluster.
20760func (vc VirtualCluster) MarshalJSON() ([]byte, error) {
20761	objectMap := make(map[string]interface{})
20762	if vc.VirtualClusterProperties != nil {
20763		objectMap["properties"] = vc.VirtualClusterProperties
20764	}
20765	if vc.Location != nil {
20766		objectMap["location"] = vc.Location
20767	}
20768	if vc.Tags != nil {
20769		objectMap["tags"] = vc.Tags
20770	}
20771	return json.Marshal(objectMap)
20772}
20773
20774// UnmarshalJSON is the custom unmarshaler for VirtualCluster struct.
20775func (vc *VirtualCluster) UnmarshalJSON(body []byte) error {
20776	var m map[string]*json.RawMessage
20777	err := json.Unmarshal(body, &m)
20778	if err != nil {
20779		return err
20780	}
20781	for k, v := range m {
20782		switch k {
20783		case "properties":
20784			if v != nil {
20785				var virtualClusterProperties VirtualClusterProperties
20786				err = json.Unmarshal(*v, &virtualClusterProperties)
20787				if err != nil {
20788					return err
20789				}
20790				vc.VirtualClusterProperties = &virtualClusterProperties
20791			}
20792		case "location":
20793			if v != nil {
20794				var location string
20795				err = json.Unmarshal(*v, &location)
20796				if err != nil {
20797					return err
20798				}
20799				vc.Location = &location
20800			}
20801		case "tags":
20802			if v != nil {
20803				var tags map[string]*string
20804				err = json.Unmarshal(*v, &tags)
20805				if err != nil {
20806					return err
20807				}
20808				vc.Tags = tags
20809			}
20810		case "id":
20811			if v != nil {
20812				var ID string
20813				err = json.Unmarshal(*v, &ID)
20814				if err != nil {
20815					return err
20816				}
20817				vc.ID = &ID
20818			}
20819		case "name":
20820			if v != nil {
20821				var name string
20822				err = json.Unmarshal(*v, &name)
20823				if err != nil {
20824					return err
20825				}
20826				vc.Name = &name
20827			}
20828		case "type":
20829			if v != nil {
20830				var typeVar string
20831				err = json.Unmarshal(*v, &typeVar)
20832				if err != nil {
20833					return err
20834				}
20835				vc.Type = &typeVar
20836			}
20837		}
20838	}
20839
20840	return nil
20841}
20842
20843// VirtualClusterListResult a list of virtual clusters.
20844type VirtualClusterListResult struct {
20845	autorest.Response `json:"-"`
20846	// Value - READ-ONLY; Array of results.
20847	Value *[]VirtualCluster `json:"value,omitempty"`
20848	// NextLink - READ-ONLY; Link to retrieve next page of results.
20849	NextLink *string `json:"nextLink,omitempty"`
20850}
20851
20852// VirtualClusterListResultIterator provides access to a complete listing of VirtualCluster values.
20853type VirtualClusterListResultIterator struct {
20854	i    int
20855	page VirtualClusterListResultPage
20856}
20857
20858// NextWithContext advances to the next value.  If there was an error making
20859// the request the iterator does not advance and the error is returned.
20860func (iter *VirtualClusterListResultIterator) NextWithContext(ctx context.Context) (err error) {
20861	if tracing.IsEnabled() {
20862		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClusterListResultIterator.NextWithContext")
20863		defer func() {
20864			sc := -1
20865			if iter.Response().Response.Response != nil {
20866				sc = iter.Response().Response.Response.StatusCode
20867			}
20868			tracing.EndSpan(ctx, sc, err)
20869		}()
20870	}
20871	iter.i++
20872	if iter.i < len(iter.page.Values()) {
20873		return nil
20874	}
20875	err = iter.page.NextWithContext(ctx)
20876	if err != nil {
20877		iter.i--
20878		return err
20879	}
20880	iter.i = 0
20881	return nil
20882}
20883
20884// Next advances to the next value.  If there was an error making
20885// the request the iterator does not advance and the error is returned.
20886// Deprecated: Use NextWithContext() instead.
20887func (iter *VirtualClusterListResultIterator) Next() error {
20888	return iter.NextWithContext(context.Background())
20889}
20890
20891// NotDone returns true if the enumeration should be started or is not yet complete.
20892func (iter VirtualClusterListResultIterator) NotDone() bool {
20893	return iter.page.NotDone() && iter.i < len(iter.page.Values())
20894}
20895
20896// Response returns the raw server response from the last page request.
20897func (iter VirtualClusterListResultIterator) Response() VirtualClusterListResult {
20898	return iter.page.Response()
20899}
20900
20901// Value returns the current value or a zero-initialized value if the
20902// iterator has advanced beyond the end of the collection.
20903func (iter VirtualClusterListResultIterator) Value() VirtualCluster {
20904	if !iter.page.NotDone() {
20905		return VirtualCluster{}
20906	}
20907	return iter.page.Values()[iter.i]
20908}
20909
20910// Creates a new instance of the VirtualClusterListResultIterator type.
20911func NewVirtualClusterListResultIterator(page VirtualClusterListResultPage) VirtualClusterListResultIterator {
20912	return VirtualClusterListResultIterator{page: page}
20913}
20914
20915// IsEmpty returns true if the ListResult contains no values.
20916func (vclr VirtualClusterListResult) IsEmpty() bool {
20917	return vclr.Value == nil || len(*vclr.Value) == 0
20918}
20919
20920// hasNextLink returns true if the NextLink is not empty.
20921func (vclr VirtualClusterListResult) hasNextLink() bool {
20922	return vclr.NextLink != nil && len(*vclr.NextLink) != 0
20923}
20924
20925// virtualClusterListResultPreparer prepares a request to retrieve the next set of results.
20926// It returns nil if no more results exist.
20927func (vclr VirtualClusterListResult) virtualClusterListResultPreparer(ctx context.Context) (*http.Request, error) {
20928	if !vclr.hasNextLink() {
20929		return nil, nil
20930	}
20931	return autorest.Prepare((&http.Request{}).WithContext(ctx),
20932		autorest.AsJSON(),
20933		autorest.AsGet(),
20934		autorest.WithBaseURL(to.String(vclr.NextLink)))
20935}
20936
20937// VirtualClusterListResultPage contains a page of VirtualCluster values.
20938type VirtualClusterListResultPage struct {
20939	fn   func(context.Context, VirtualClusterListResult) (VirtualClusterListResult, error)
20940	vclr VirtualClusterListResult
20941}
20942
20943// NextWithContext advances to the next page of values.  If there was an error making
20944// the request the page does not advance and the error is returned.
20945func (page *VirtualClusterListResultPage) NextWithContext(ctx context.Context) (err error) {
20946	if tracing.IsEnabled() {
20947		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClusterListResultPage.NextWithContext")
20948		defer func() {
20949			sc := -1
20950			if page.Response().Response.Response != nil {
20951				sc = page.Response().Response.Response.StatusCode
20952			}
20953			tracing.EndSpan(ctx, sc, err)
20954		}()
20955	}
20956	for {
20957		next, err := page.fn(ctx, page.vclr)
20958		if err != nil {
20959			return err
20960		}
20961		page.vclr = next
20962		if !next.hasNextLink() || !next.IsEmpty() {
20963			break
20964		}
20965	}
20966	return nil
20967}
20968
20969// Next advances to the next page of values.  If there was an error making
20970// the request the page does not advance and the error is returned.
20971// Deprecated: Use NextWithContext() instead.
20972func (page *VirtualClusterListResultPage) Next() error {
20973	return page.NextWithContext(context.Background())
20974}
20975
20976// NotDone returns true if the page enumeration should be started or is not yet complete.
20977func (page VirtualClusterListResultPage) NotDone() bool {
20978	return !page.vclr.IsEmpty()
20979}
20980
20981// Response returns the raw server response from the last page request.
20982func (page VirtualClusterListResultPage) Response() VirtualClusterListResult {
20983	return page.vclr
20984}
20985
20986// Values returns the slice of values for the current page or nil if there are no values.
20987func (page VirtualClusterListResultPage) Values() []VirtualCluster {
20988	if page.vclr.IsEmpty() {
20989		return nil
20990	}
20991	return *page.vclr.Value
20992}
20993
20994// Creates a new instance of the VirtualClusterListResultPage type.
20995func NewVirtualClusterListResultPage(cur VirtualClusterListResult, getNextPage func(context.Context, VirtualClusterListResult) (VirtualClusterListResult, error)) VirtualClusterListResultPage {
20996	return VirtualClusterListResultPage{
20997		fn:   getNextPage,
20998		vclr: cur,
20999	}
21000}
21001
21002// VirtualClusterProperties the properties of a virtual cluster.
21003type VirtualClusterProperties struct {
21004	// SubnetID - READ-ONLY; Subnet resource ID for the virtual cluster.
21005	SubnetID *string `json:"subnetId,omitempty"`
21006	// Family - If the service has different generations of hardware, for the same SKU, then that can be captured here.
21007	Family *string `json:"family,omitempty"`
21008	// ChildResources - READ-ONLY; List of resources in this virtual cluster.
21009	ChildResources *[]string `json:"childResources,omitempty"`
21010}
21011
21012// MarshalJSON is the custom marshaler for VirtualClusterProperties.
21013func (vcp VirtualClusterProperties) MarshalJSON() ([]byte, error) {
21014	objectMap := make(map[string]interface{})
21015	if vcp.Family != nil {
21016		objectMap["family"] = vcp.Family
21017	}
21018	return json.Marshal(objectMap)
21019}
21020
21021// VirtualClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
21022// operation.
21023type VirtualClustersDeleteFuture struct {
21024	azure.FutureAPI
21025	// Result returns the result of the asynchronous operation.
21026	// If the operation has not completed it will return an error.
21027	Result func(VirtualClustersClient) (autorest.Response, error)
21028}
21029
21030// VirtualClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
21031// operation.
21032type VirtualClustersUpdateFuture struct {
21033	azure.FutureAPI
21034	// Result returns the result of the asynchronous operation.
21035	// If the operation has not completed it will return an error.
21036	Result func(VirtualClustersClient) (VirtualCluster, error)
21037}
21038
21039// VirtualClusterUpdate an update request for an Azure SQL Database virtual cluster.
21040type VirtualClusterUpdate struct {
21041	// VirtualClusterProperties - Resource properties.
21042	*VirtualClusterProperties `json:"properties,omitempty"`
21043	// Tags - Resource tags.
21044	Tags map[string]*string `json:"tags"`
21045}
21046
21047// MarshalJSON is the custom marshaler for VirtualClusterUpdate.
21048func (vcu VirtualClusterUpdate) MarshalJSON() ([]byte, error) {
21049	objectMap := make(map[string]interface{})
21050	if vcu.VirtualClusterProperties != nil {
21051		objectMap["properties"] = vcu.VirtualClusterProperties
21052	}
21053	if vcu.Tags != nil {
21054		objectMap["tags"] = vcu.Tags
21055	}
21056	return json.Marshal(objectMap)
21057}
21058
21059// UnmarshalJSON is the custom unmarshaler for VirtualClusterUpdate struct.
21060func (vcu *VirtualClusterUpdate) UnmarshalJSON(body []byte) error {
21061	var m map[string]*json.RawMessage
21062	err := json.Unmarshal(body, &m)
21063	if err != nil {
21064		return err
21065	}
21066	for k, v := range m {
21067		switch k {
21068		case "properties":
21069			if v != nil {
21070				var virtualClusterProperties VirtualClusterProperties
21071				err = json.Unmarshal(*v, &virtualClusterProperties)
21072				if err != nil {
21073					return err
21074				}
21075				vcu.VirtualClusterProperties = &virtualClusterProperties
21076			}
21077		case "tags":
21078			if v != nil {
21079				var tags map[string]*string
21080				err = json.Unmarshal(*v, &tags)
21081				if err != nil {
21082					return err
21083				}
21084				vcu.Tags = tags
21085			}
21086		}
21087	}
21088
21089	return nil
21090}
21091
21092// VirtualNetworkRule a virtual network rule.
21093type VirtualNetworkRule struct {
21094	autorest.Response `json:"-"`
21095	// VirtualNetworkRuleProperties - Resource properties.
21096	*VirtualNetworkRuleProperties `json:"properties,omitempty"`
21097	// ID - READ-ONLY; Resource ID.
21098	ID *string `json:"id,omitempty"`
21099	// Name - READ-ONLY; Resource name.
21100	Name *string `json:"name,omitempty"`
21101	// Type - READ-ONLY; Resource type.
21102	Type *string `json:"type,omitempty"`
21103}
21104
21105// MarshalJSON is the custom marshaler for VirtualNetworkRule.
21106func (vnr VirtualNetworkRule) MarshalJSON() ([]byte, error) {
21107	objectMap := make(map[string]interface{})
21108	if vnr.VirtualNetworkRuleProperties != nil {
21109		objectMap["properties"] = vnr.VirtualNetworkRuleProperties
21110	}
21111	return json.Marshal(objectMap)
21112}
21113
21114// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct.
21115func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error {
21116	var m map[string]*json.RawMessage
21117	err := json.Unmarshal(body, &m)
21118	if err != nil {
21119		return err
21120	}
21121	for k, v := range m {
21122		switch k {
21123		case "properties":
21124			if v != nil {
21125				var virtualNetworkRuleProperties VirtualNetworkRuleProperties
21126				err = json.Unmarshal(*v, &virtualNetworkRuleProperties)
21127				if err != nil {
21128					return err
21129				}
21130				vnr.VirtualNetworkRuleProperties = &virtualNetworkRuleProperties
21131			}
21132		case "id":
21133			if v != nil {
21134				var ID string
21135				err = json.Unmarshal(*v, &ID)
21136				if err != nil {
21137					return err
21138				}
21139				vnr.ID = &ID
21140			}
21141		case "name":
21142			if v != nil {
21143				var name string
21144				err = json.Unmarshal(*v, &name)
21145				if err != nil {
21146					return err
21147				}
21148				vnr.Name = &name
21149			}
21150		case "type":
21151			if v != nil {
21152				var typeVar string
21153				err = json.Unmarshal(*v, &typeVar)
21154				if err != nil {
21155					return err
21156				}
21157				vnr.Type = &typeVar
21158			}
21159		}
21160	}
21161
21162	return nil
21163}
21164
21165// VirtualNetworkRuleListResult a list of virtual network rules.
21166type VirtualNetworkRuleListResult struct {
21167	autorest.Response `json:"-"`
21168	// Value - READ-ONLY; Array of results.
21169	Value *[]VirtualNetworkRule `json:"value,omitempty"`
21170	// NextLink - READ-ONLY; Link to retrieve next page of results.
21171	NextLink *string `json:"nextLink,omitempty"`
21172}
21173
21174// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values.
21175type VirtualNetworkRuleListResultIterator struct {
21176	i    int
21177	page VirtualNetworkRuleListResultPage
21178}
21179
21180// NextWithContext advances to the next value.  If there was an error making
21181// the request the iterator does not advance and the error is returned.
21182func (iter *VirtualNetworkRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
21183	if tracing.IsEnabled() {
21184		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultIterator.NextWithContext")
21185		defer func() {
21186			sc := -1
21187			if iter.Response().Response.Response != nil {
21188				sc = iter.Response().Response.Response.StatusCode
21189			}
21190			tracing.EndSpan(ctx, sc, err)
21191		}()
21192	}
21193	iter.i++
21194	if iter.i < len(iter.page.Values()) {
21195		return nil
21196	}
21197	err = iter.page.NextWithContext(ctx)
21198	if err != nil {
21199		iter.i--
21200		return err
21201	}
21202	iter.i = 0
21203	return nil
21204}
21205
21206// Next advances to the next value.  If there was an error making
21207// the request the iterator does not advance and the error is returned.
21208// Deprecated: Use NextWithContext() instead.
21209func (iter *VirtualNetworkRuleListResultIterator) Next() error {
21210	return iter.NextWithContext(context.Background())
21211}
21212
21213// NotDone returns true if the enumeration should be started or is not yet complete.
21214func (iter VirtualNetworkRuleListResultIterator) NotDone() bool {
21215	return iter.page.NotDone() && iter.i < len(iter.page.Values())
21216}
21217
21218// Response returns the raw server response from the last page request.
21219func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult {
21220	return iter.page.Response()
21221}
21222
21223// Value returns the current value or a zero-initialized value if the
21224// iterator has advanced beyond the end of the collection.
21225func (iter VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule {
21226	if !iter.page.NotDone() {
21227		return VirtualNetworkRule{}
21228	}
21229	return iter.page.Values()[iter.i]
21230}
21231
21232// Creates a new instance of the VirtualNetworkRuleListResultIterator type.
21233func NewVirtualNetworkRuleListResultIterator(page VirtualNetworkRuleListResultPage) VirtualNetworkRuleListResultIterator {
21234	return VirtualNetworkRuleListResultIterator{page: page}
21235}
21236
21237// IsEmpty returns true if the ListResult contains no values.
21238func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool {
21239	return vnrlr.Value == nil || len(*vnrlr.Value) == 0
21240}
21241
21242// hasNextLink returns true if the NextLink is not empty.
21243func (vnrlr VirtualNetworkRuleListResult) hasNextLink() bool {
21244	return vnrlr.NextLink != nil && len(*vnrlr.NextLink) != 0
21245}
21246
21247// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results.
21248// It returns nil if no more results exist.
21249func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
21250	if !vnrlr.hasNextLink() {
21251		return nil, nil
21252	}
21253	return autorest.Prepare((&http.Request{}).WithContext(ctx),
21254		autorest.AsJSON(),
21255		autorest.AsGet(),
21256		autorest.WithBaseURL(to.String(vnrlr.NextLink)))
21257}
21258
21259// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values.
21260type VirtualNetworkRuleListResultPage struct {
21261	fn    func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)
21262	vnrlr VirtualNetworkRuleListResult
21263}
21264
21265// NextWithContext advances to the next page of values.  If there was an error making
21266// the request the page does not advance and the error is returned.
21267func (page *VirtualNetworkRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
21268	if tracing.IsEnabled() {
21269		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultPage.NextWithContext")
21270		defer func() {
21271			sc := -1
21272			if page.Response().Response.Response != nil {
21273				sc = page.Response().Response.Response.StatusCode
21274			}
21275			tracing.EndSpan(ctx, sc, err)
21276		}()
21277	}
21278	for {
21279		next, err := page.fn(ctx, page.vnrlr)
21280		if err != nil {
21281			return err
21282		}
21283		page.vnrlr = next
21284		if !next.hasNextLink() || !next.IsEmpty() {
21285			break
21286		}
21287	}
21288	return nil
21289}
21290
21291// Next advances to the next page of values.  If there was an error making
21292// the request the page does not advance and the error is returned.
21293// Deprecated: Use NextWithContext() instead.
21294func (page *VirtualNetworkRuleListResultPage) Next() error {
21295	return page.NextWithContext(context.Background())
21296}
21297
21298// NotDone returns true if the page enumeration should be started or is not yet complete.
21299func (page VirtualNetworkRuleListResultPage) NotDone() bool {
21300	return !page.vnrlr.IsEmpty()
21301}
21302
21303// Response returns the raw server response from the last page request.
21304func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult {
21305	return page.vnrlr
21306}
21307
21308// Values returns the slice of values for the current page or nil if there are no values.
21309func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule {
21310	if page.vnrlr.IsEmpty() {
21311		return nil
21312	}
21313	return *page.vnrlr.Value
21314}
21315
21316// Creates a new instance of the VirtualNetworkRuleListResultPage type.
21317func NewVirtualNetworkRuleListResultPage(cur VirtualNetworkRuleListResult, getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage {
21318	return VirtualNetworkRuleListResultPage{
21319		fn:    getNextPage,
21320		vnrlr: cur,
21321	}
21322}
21323
21324// VirtualNetworkRuleProperties properties of a virtual network rule.
21325type VirtualNetworkRuleProperties struct {
21326	// VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet.
21327	VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"`
21328	// IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled.
21329	IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"`
21330	// State - READ-ONLY; Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown'
21331	State VirtualNetworkRuleState `json:"state,omitempty"`
21332}
21333
21334// MarshalJSON is the custom marshaler for VirtualNetworkRuleProperties.
21335func (vnrp VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error) {
21336	objectMap := make(map[string]interface{})
21337	if vnrp.VirtualNetworkSubnetID != nil {
21338		objectMap["virtualNetworkSubnetId"] = vnrp.VirtualNetworkSubnetID
21339	}
21340	if vnrp.IgnoreMissingVnetServiceEndpoint != nil {
21341		objectMap["ignoreMissingVnetServiceEndpoint"] = vnrp.IgnoreMissingVnetServiceEndpoint
21342	}
21343	return json.Marshal(objectMap)
21344}
21345
21346// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
21347// long-running operation.
21348type VirtualNetworkRulesCreateOrUpdateFuture struct {
21349	azure.FutureAPI
21350	// Result returns the result of the asynchronous operation.
21351	// If the operation has not completed it will return an error.
21352	Result func(VirtualNetworkRulesClient) (VirtualNetworkRule, error)
21353}
21354
21355// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a
21356// long-running operation.
21357type VirtualNetworkRulesDeleteFuture struct {
21358	azure.FutureAPI
21359	// Result returns the result of the asynchronous operation.
21360	// If the operation has not completed it will return an error.
21361	Result func(VirtualNetworkRulesClient) (autorest.Response, error)
21362}
21363
21364// VulnerabilityAssessmentRecurringScansProperties properties of a Vulnerability Assessment recurring
21365// scans.
21366type VulnerabilityAssessmentRecurringScansProperties struct {
21367	// IsEnabled - Recurring scans state.
21368	IsEnabled *bool `json:"isEnabled,omitempty"`
21369	// EmailSubscriptionAdmins - Specifies that the schedule scan notification will be is sent to the subscription administrators.
21370	EmailSubscriptionAdmins *bool `json:"emailSubscriptionAdmins,omitempty"`
21371	// Emails - Specifies an array of e-mail addresses to which the scan notification is sent.
21372	Emails *[]string `json:"emails,omitempty"`
21373}
21374
21375// VulnerabilityAssessmentScanError properties of a vulnerability assessment scan error.
21376type VulnerabilityAssessmentScanError struct {
21377	// Code - READ-ONLY; The error code.
21378	Code *string `json:"code,omitempty"`
21379	// Message - READ-ONLY; The error message.
21380	Message *string `json:"message,omitempty"`
21381}
21382
21383// VulnerabilityAssessmentScanRecord a vulnerability assessment scan record.
21384type VulnerabilityAssessmentScanRecord struct {
21385	autorest.Response `json:"-"`
21386	// VulnerabilityAssessmentScanRecordProperties - Resource properties.
21387	*VulnerabilityAssessmentScanRecordProperties `json:"properties,omitempty"`
21388	// ID - READ-ONLY; Resource ID.
21389	ID *string `json:"id,omitempty"`
21390	// Name - READ-ONLY; Resource name.
21391	Name *string `json:"name,omitempty"`
21392	// Type - READ-ONLY; Resource type.
21393	Type *string `json:"type,omitempty"`
21394}
21395
21396// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecord.
21397func (vasr VulnerabilityAssessmentScanRecord) MarshalJSON() ([]byte, error) {
21398	objectMap := make(map[string]interface{})
21399	if vasr.VulnerabilityAssessmentScanRecordProperties != nil {
21400		objectMap["properties"] = vasr.VulnerabilityAssessmentScanRecordProperties
21401	}
21402	return json.Marshal(objectMap)
21403}
21404
21405// UnmarshalJSON is the custom unmarshaler for VulnerabilityAssessmentScanRecord struct.
21406func (vasr *VulnerabilityAssessmentScanRecord) UnmarshalJSON(body []byte) error {
21407	var m map[string]*json.RawMessage
21408	err := json.Unmarshal(body, &m)
21409	if err != nil {
21410		return err
21411	}
21412	for k, v := range m {
21413		switch k {
21414		case "properties":
21415			if v != nil {
21416				var vulnerabilityAssessmentScanRecordProperties VulnerabilityAssessmentScanRecordProperties
21417				err = json.Unmarshal(*v, &vulnerabilityAssessmentScanRecordProperties)
21418				if err != nil {
21419					return err
21420				}
21421				vasr.VulnerabilityAssessmentScanRecordProperties = &vulnerabilityAssessmentScanRecordProperties
21422			}
21423		case "id":
21424			if v != nil {
21425				var ID string
21426				err = json.Unmarshal(*v, &ID)
21427				if err != nil {
21428					return err
21429				}
21430				vasr.ID = &ID
21431			}
21432		case "name":
21433			if v != nil {
21434				var name string
21435				err = json.Unmarshal(*v, &name)
21436				if err != nil {
21437					return err
21438				}
21439				vasr.Name = &name
21440			}
21441		case "type":
21442			if v != nil {
21443				var typeVar string
21444				err = json.Unmarshal(*v, &typeVar)
21445				if err != nil {
21446					return err
21447				}
21448				vasr.Type = &typeVar
21449			}
21450		}
21451	}
21452
21453	return nil
21454}
21455
21456// VulnerabilityAssessmentScanRecordListResult a list of vulnerability assessment scan records.
21457type VulnerabilityAssessmentScanRecordListResult struct {
21458	autorest.Response `json:"-"`
21459	// Value - READ-ONLY; Array of results.
21460	Value *[]VulnerabilityAssessmentScanRecord `json:"value,omitempty"`
21461	// NextLink - READ-ONLY; Link to retrieve next page of results.
21462	NextLink *string `json:"nextLink,omitempty"`
21463}
21464
21465// VulnerabilityAssessmentScanRecordListResultIterator provides access to a complete listing of
21466// VulnerabilityAssessmentScanRecord values.
21467type VulnerabilityAssessmentScanRecordListResultIterator struct {
21468	i    int
21469	page VulnerabilityAssessmentScanRecordListResultPage
21470}
21471
21472// NextWithContext advances to the next value.  If there was an error making
21473// the request the iterator does not advance and the error is returned.
21474func (iter *VulnerabilityAssessmentScanRecordListResultIterator) NextWithContext(ctx context.Context) (err error) {
21475	if tracing.IsEnabled() {
21476		ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultIterator.NextWithContext")
21477		defer func() {
21478			sc := -1
21479			if iter.Response().Response.Response != nil {
21480				sc = iter.Response().Response.Response.StatusCode
21481			}
21482			tracing.EndSpan(ctx, sc, err)
21483		}()
21484	}
21485	iter.i++
21486	if iter.i < len(iter.page.Values()) {
21487		return nil
21488	}
21489	err = iter.page.NextWithContext(ctx)
21490	if err != nil {
21491		iter.i--
21492		return err
21493	}
21494	iter.i = 0
21495	return nil
21496}
21497
21498// Next advances to the next value.  If there was an error making
21499// the request the iterator does not advance and the error is returned.
21500// Deprecated: Use NextWithContext() instead.
21501func (iter *VulnerabilityAssessmentScanRecordListResultIterator) Next() error {
21502	return iter.NextWithContext(context.Background())
21503}
21504
21505// NotDone returns true if the enumeration should be started or is not yet complete.
21506func (iter VulnerabilityAssessmentScanRecordListResultIterator) NotDone() bool {
21507	return iter.page.NotDone() && iter.i < len(iter.page.Values())
21508}
21509
21510// Response returns the raw server response from the last page request.
21511func (iter VulnerabilityAssessmentScanRecordListResultIterator) Response() VulnerabilityAssessmentScanRecordListResult {
21512	return iter.page.Response()
21513}
21514
21515// Value returns the current value or a zero-initialized value if the
21516// iterator has advanced beyond the end of the collection.
21517func (iter VulnerabilityAssessmentScanRecordListResultIterator) Value() VulnerabilityAssessmentScanRecord {
21518	if !iter.page.NotDone() {
21519		return VulnerabilityAssessmentScanRecord{}
21520	}
21521	return iter.page.Values()[iter.i]
21522}
21523
21524// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultIterator type.
21525func NewVulnerabilityAssessmentScanRecordListResultIterator(page VulnerabilityAssessmentScanRecordListResultPage) VulnerabilityAssessmentScanRecordListResultIterator {
21526	return VulnerabilityAssessmentScanRecordListResultIterator{page: page}
21527}
21528
21529// IsEmpty returns true if the ListResult contains no values.
21530func (vasrlr VulnerabilityAssessmentScanRecordListResult) IsEmpty() bool {
21531	return vasrlr.Value == nil || len(*vasrlr.Value) == 0
21532}
21533
21534// hasNextLink returns true if the NextLink is not empty.
21535func (vasrlr VulnerabilityAssessmentScanRecordListResult) hasNextLink() bool {
21536	return vasrlr.NextLink != nil && len(*vasrlr.NextLink) != 0
21537}
21538
21539// vulnerabilityAssessmentScanRecordListResultPreparer prepares a request to retrieve the next set of results.
21540// It returns nil if no more results exist.
21541func (vasrlr VulnerabilityAssessmentScanRecordListResult) vulnerabilityAssessmentScanRecordListResultPreparer(ctx context.Context) (*http.Request, error) {
21542	if !vasrlr.hasNextLink() {
21543		return nil, nil
21544	}
21545	return autorest.Prepare((&http.Request{}).WithContext(ctx),
21546		autorest.AsJSON(),
21547		autorest.AsGet(),
21548		autorest.WithBaseURL(to.String(vasrlr.NextLink)))
21549}
21550
21551// VulnerabilityAssessmentScanRecordListResultPage contains a page of VulnerabilityAssessmentScanRecord
21552// values.
21553type VulnerabilityAssessmentScanRecordListResultPage struct {
21554	fn     func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)
21555	vasrlr VulnerabilityAssessmentScanRecordListResult
21556}
21557
21558// NextWithContext advances to the next page of values.  If there was an error making
21559// the request the page does not advance and the error is returned.
21560func (page *VulnerabilityAssessmentScanRecordListResultPage) NextWithContext(ctx context.Context) (err error) {
21561	if tracing.IsEnabled() {
21562		ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultPage.NextWithContext")
21563		defer func() {
21564			sc := -1
21565			if page.Response().Response.Response != nil {
21566				sc = page.Response().Response.Response.StatusCode
21567			}
21568			tracing.EndSpan(ctx, sc, err)
21569		}()
21570	}
21571	for {
21572		next, err := page.fn(ctx, page.vasrlr)
21573		if err != nil {
21574			return err
21575		}
21576		page.vasrlr = next
21577		if !next.hasNextLink() || !next.IsEmpty() {
21578			break
21579		}
21580	}
21581	return nil
21582}
21583
21584// Next advances to the next page of values.  If there was an error making
21585// the request the page does not advance and the error is returned.
21586// Deprecated: Use NextWithContext() instead.
21587func (page *VulnerabilityAssessmentScanRecordListResultPage) Next() error {
21588	return page.NextWithContext(context.Background())
21589}
21590
21591// NotDone returns true if the page enumeration should be started or is not yet complete.
21592func (page VulnerabilityAssessmentScanRecordListResultPage) NotDone() bool {
21593	return !page.vasrlr.IsEmpty()
21594}
21595
21596// Response returns the raw server response from the last page request.
21597func (page VulnerabilityAssessmentScanRecordListResultPage) Response() VulnerabilityAssessmentScanRecordListResult {
21598	return page.vasrlr
21599}
21600
21601// Values returns the slice of values for the current page or nil if there are no values.
21602func (page VulnerabilityAssessmentScanRecordListResultPage) Values() []VulnerabilityAssessmentScanRecord {
21603	if page.vasrlr.IsEmpty() {
21604		return nil
21605	}
21606	return *page.vasrlr.Value
21607}
21608
21609// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultPage type.
21610func NewVulnerabilityAssessmentScanRecordListResultPage(cur VulnerabilityAssessmentScanRecordListResult, getNextPage func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)) VulnerabilityAssessmentScanRecordListResultPage {
21611	return VulnerabilityAssessmentScanRecordListResultPage{
21612		fn:     getNextPage,
21613		vasrlr: cur,
21614	}
21615}
21616
21617// VulnerabilityAssessmentScanRecordProperties properties of a vulnerability assessment scan record.
21618type VulnerabilityAssessmentScanRecordProperties struct {
21619	// ScanID - READ-ONLY; The scan ID.
21620	ScanID *string `json:"scanId,omitempty"`
21621	// TriggerType - READ-ONLY; The scan trigger type. Possible values include: 'VulnerabilityAssessmentScanTriggerTypeOnDemand', 'VulnerabilityAssessmentScanTriggerTypeRecurring'
21622	TriggerType VulnerabilityAssessmentScanTriggerType `json:"triggerType,omitempty"`
21623	// State - READ-ONLY; The scan status. Possible values include: 'VulnerabilityAssessmentScanStatePassed', 'VulnerabilityAssessmentScanStateFailed', 'VulnerabilityAssessmentScanStateFailedToRun', 'VulnerabilityAssessmentScanStateInProgress'
21624	State VulnerabilityAssessmentScanState `json:"state,omitempty"`
21625	// StartTime - READ-ONLY; The scan start time (UTC).
21626	StartTime *date.Time `json:"startTime,omitempty"`
21627	// EndTime - READ-ONLY; The scan end time (UTC).
21628	EndTime *date.Time `json:"endTime,omitempty"`
21629	// Errors - READ-ONLY; The scan errors.
21630	Errors *[]VulnerabilityAssessmentScanError `json:"errors,omitempty"`
21631	// StorageContainerPath - READ-ONLY; The scan results storage container path.
21632	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
21633	// NumberOfFailedSecurityChecks - READ-ONLY; The number of failed security checks.
21634	NumberOfFailedSecurityChecks *int32 `json:"numberOfFailedSecurityChecks,omitempty"`
21635}
21636
21637// WorkloadClassifier workload classifier operations for a data warehouse
21638type WorkloadClassifier struct {
21639	autorest.Response `json:"-"`
21640	// WorkloadClassifierProperties - Resource properties.
21641	*WorkloadClassifierProperties `json:"properties,omitempty"`
21642	// ID - READ-ONLY; Resource ID.
21643	ID *string `json:"id,omitempty"`
21644	// Name - READ-ONLY; Resource name.
21645	Name *string `json:"name,omitempty"`
21646	// Type - READ-ONLY; Resource type.
21647	Type *string `json:"type,omitempty"`
21648}
21649
21650// MarshalJSON is the custom marshaler for WorkloadClassifier.
21651func (wc WorkloadClassifier) MarshalJSON() ([]byte, error) {
21652	objectMap := make(map[string]interface{})
21653	if wc.WorkloadClassifierProperties != nil {
21654		objectMap["properties"] = wc.WorkloadClassifierProperties
21655	}
21656	return json.Marshal(objectMap)
21657}
21658
21659// UnmarshalJSON is the custom unmarshaler for WorkloadClassifier struct.
21660func (wc *WorkloadClassifier) UnmarshalJSON(body []byte) error {
21661	var m map[string]*json.RawMessage
21662	err := json.Unmarshal(body, &m)
21663	if err != nil {
21664		return err
21665	}
21666	for k, v := range m {
21667		switch k {
21668		case "properties":
21669			if v != nil {
21670				var workloadClassifierProperties WorkloadClassifierProperties
21671				err = json.Unmarshal(*v, &workloadClassifierProperties)
21672				if err != nil {
21673					return err
21674				}
21675				wc.WorkloadClassifierProperties = &workloadClassifierProperties
21676			}
21677		case "id":
21678			if v != nil {
21679				var ID string
21680				err = json.Unmarshal(*v, &ID)
21681				if err != nil {
21682					return err
21683				}
21684				wc.ID = &ID
21685			}
21686		case "name":
21687			if v != nil {
21688				var name string
21689				err = json.Unmarshal(*v, &name)
21690				if err != nil {
21691					return err
21692				}
21693				wc.Name = &name
21694			}
21695		case "type":
21696			if v != nil {
21697				var typeVar string
21698				err = json.Unmarshal(*v, &typeVar)
21699				if err != nil {
21700					return err
21701				}
21702				wc.Type = &typeVar
21703			}
21704		}
21705	}
21706
21707	return nil
21708}
21709
21710// WorkloadClassifierListResult a list of workload classifiers for a workload group.
21711type WorkloadClassifierListResult struct {
21712	autorest.Response `json:"-"`
21713	// Value - READ-ONLY; Array of results.
21714	Value *[]WorkloadClassifier `json:"value,omitempty"`
21715	// NextLink - READ-ONLY; Link to retrieve next page of results.
21716	NextLink *string `json:"nextLink,omitempty"`
21717}
21718
21719// WorkloadClassifierListResultIterator provides access to a complete listing of WorkloadClassifier values.
21720type WorkloadClassifierListResultIterator struct {
21721	i    int
21722	page WorkloadClassifierListResultPage
21723}
21724
21725// NextWithContext advances to the next value.  If there was an error making
21726// the request the iterator does not advance and the error is returned.
21727func (iter *WorkloadClassifierListResultIterator) NextWithContext(ctx context.Context) (err error) {
21728	if tracing.IsEnabled() {
21729		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadClassifierListResultIterator.NextWithContext")
21730		defer func() {
21731			sc := -1
21732			if iter.Response().Response.Response != nil {
21733				sc = iter.Response().Response.Response.StatusCode
21734			}
21735			tracing.EndSpan(ctx, sc, err)
21736		}()
21737	}
21738	iter.i++
21739	if iter.i < len(iter.page.Values()) {
21740		return nil
21741	}
21742	err = iter.page.NextWithContext(ctx)
21743	if err != nil {
21744		iter.i--
21745		return err
21746	}
21747	iter.i = 0
21748	return nil
21749}
21750
21751// Next advances to the next value.  If there was an error making
21752// the request the iterator does not advance and the error is returned.
21753// Deprecated: Use NextWithContext() instead.
21754func (iter *WorkloadClassifierListResultIterator) Next() error {
21755	return iter.NextWithContext(context.Background())
21756}
21757
21758// NotDone returns true if the enumeration should be started or is not yet complete.
21759func (iter WorkloadClassifierListResultIterator) NotDone() bool {
21760	return iter.page.NotDone() && iter.i < len(iter.page.Values())
21761}
21762
21763// Response returns the raw server response from the last page request.
21764func (iter WorkloadClassifierListResultIterator) Response() WorkloadClassifierListResult {
21765	return iter.page.Response()
21766}
21767
21768// Value returns the current value or a zero-initialized value if the
21769// iterator has advanced beyond the end of the collection.
21770func (iter WorkloadClassifierListResultIterator) Value() WorkloadClassifier {
21771	if !iter.page.NotDone() {
21772		return WorkloadClassifier{}
21773	}
21774	return iter.page.Values()[iter.i]
21775}
21776
21777// Creates a new instance of the WorkloadClassifierListResultIterator type.
21778func NewWorkloadClassifierListResultIterator(page WorkloadClassifierListResultPage) WorkloadClassifierListResultIterator {
21779	return WorkloadClassifierListResultIterator{page: page}
21780}
21781
21782// IsEmpty returns true if the ListResult contains no values.
21783func (wclr WorkloadClassifierListResult) IsEmpty() bool {
21784	return wclr.Value == nil || len(*wclr.Value) == 0
21785}
21786
21787// hasNextLink returns true if the NextLink is not empty.
21788func (wclr WorkloadClassifierListResult) hasNextLink() bool {
21789	return wclr.NextLink != nil && len(*wclr.NextLink) != 0
21790}
21791
21792// workloadClassifierListResultPreparer prepares a request to retrieve the next set of results.
21793// It returns nil if no more results exist.
21794func (wclr WorkloadClassifierListResult) workloadClassifierListResultPreparer(ctx context.Context) (*http.Request, error) {
21795	if !wclr.hasNextLink() {
21796		return nil, nil
21797	}
21798	return autorest.Prepare((&http.Request{}).WithContext(ctx),
21799		autorest.AsJSON(),
21800		autorest.AsGet(),
21801		autorest.WithBaseURL(to.String(wclr.NextLink)))
21802}
21803
21804// WorkloadClassifierListResultPage contains a page of WorkloadClassifier values.
21805type WorkloadClassifierListResultPage struct {
21806	fn   func(context.Context, WorkloadClassifierListResult) (WorkloadClassifierListResult, error)
21807	wclr WorkloadClassifierListResult
21808}
21809
21810// NextWithContext advances to the next page of values.  If there was an error making
21811// the request the page does not advance and the error is returned.
21812func (page *WorkloadClassifierListResultPage) NextWithContext(ctx context.Context) (err error) {
21813	if tracing.IsEnabled() {
21814		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadClassifierListResultPage.NextWithContext")
21815		defer func() {
21816			sc := -1
21817			if page.Response().Response.Response != nil {
21818				sc = page.Response().Response.Response.StatusCode
21819			}
21820			tracing.EndSpan(ctx, sc, err)
21821		}()
21822	}
21823	for {
21824		next, err := page.fn(ctx, page.wclr)
21825		if err != nil {
21826			return err
21827		}
21828		page.wclr = next
21829		if !next.hasNextLink() || !next.IsEmpty() {
21830			break
21831		}
21832	}
21833	return nil
21834}
21835
21836// Next advances to the next page of values.  If there was an error making
21837// the request the page does not advance and the error is returned.
21838// Deprecated: Use NextWithContext() instead.
21839func (page *WorkloadClassifierListResultPage) Next() error {
21840	return page.NextWithContext(context.Background())
21841}
21842
21843// NotDone returns true if the page enumeration should be started or is not yet complete.
21844func (page WorkloadClassifierListResultPage) NotDone() bool {
21845	return !page.wclr.IsEmpty()
21846}
21847
21848// Response returns the raw server response from the last page request.
21849func (page WorkloadClassifierListResultPage) Response() WorkloadClassifierListResult {
21850	return page.wclr
21851}
21852
21853// Values returns the slice of values for the current page or nil if there are no values.
21854func (page WorkloadClassifierListResultPage) Values() []WorkloadClassifier {
21855	if page.wclr.IsEmpty() {
21856		return nil
21857	}
21858	return *page.wclr.Value
21859}
21860
21861// Creates a new instance of the WorkloadClassifierListResultPage type.
21862func NewWorkloadClassifierListResultPage(cur WorkloadClassifierListResult, getNextPage func(context.Context, WorkloadClassifierListResult) (WorkloadClassifierListResult, error)) WorkloadClassifierListResultPage {
21863	return WorkloadClassifierListResultPage{
21864		fn:   getNextPage,
21865		wclr: cur,
21866	}
21867}
21868
21869// WorkloadClassifierProperties workload classifier definition. For more information look at
21870// sys.workload_management_workload_classifiers (DMV).
21871type WorkloadClassifierProperties struct {
21872	// MemberName - The workload classifier member name.
21873	MemberName *string `json:"memberName,omitempty"`
21874	// Label - The workload classifier label.
21875	Label *string `json:"label,omitempty"`
21876	// Context - The workload classifier context.
21877	Context *string `json:"context,omitempty"`
21878	// StartTime - The workload classifier start time for classification.
21879	StartTime *string `json:"startTime,omitempty"`
21880	// EndTime - The workload classifier end time for classification.
21881	EndTime *string `json:"endTime,omitempty"`
21882	// Importance - The workload classifier importance.
21883	Importance *string `json:"importance,omitempty"`
21884}
21885
21886// WorkloadClassifiersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
21887// long-running operation.
21888type WorkloadClassifiersCreateOrUpdateFuture struct {
21889	azure.FutureAPI
21890	// Result returns the result of the asynchronous operation.
21891	// If the operation has not completed it will return an error.
21892	Result func(WorkloadClassifiersClient) (WorkloadClassifier, error)
21893}
21894
21895// WorkloadClassifiersDeleteFuture an abstraction for monitoring and retrieving the results of a
21896// long-running operation.
21897type WorkloadClassifiersDeleteFuture struct {
21898	azure.FutureAPI
21899	// Result returns the result of the asynchronous operation.
21900	// If the operation has not completed it will return an error.
21901	Result func(WorkloadClassifiersClient) (autorest.Response, error)
21902}
21903
21904// WorkloadGroup workload group operations for a data warehouse
21905type WorkloadGroup struct {
21906	autorest.Response `json:"-"`
21907	// WorkloadGroupProperties - Resource properties.
21908	*WorkloadGroupProperties `json:"properties,omitempty"`
21909	// ID - READ-ONLY; Resource ID.
21910	ID *string `json:"id,omitempty"`
21911	// Name - READ-ONLY; Resource name.
21912	Name *string `json:"name,omitempty"`
21913	// Type - READ-ONLY; Resource type.
21914	Type *string `json:"type,omitempty"`
21915}
21916
21917// MarshalJSON is the custom marshaler for WorkloadGroup.
21918func (wg WorkloadGroup) MarshalJSON() ([]byte, error) {
21919	objectMap := make(map[string]interface{})
21920	if wg.WorkloadGroupProperties != nil {
21921		objectMap["properties"] = wg.WorkloadGroupProperties
21922	}
21923	return json.Marshal(objectMap)
21924}
21925
21926// UnmarshalJSON is the custom unmarshaler for WorkloadGroup struct.
21927func (wg *WorkloadGroup) UnmarshalJSON(body []byte) error {
21928	var m map[string]*json.RawMessage
21929	err := json.Unmarshal(body, &m)
21930	if err != nil {
21931		return err
21932	}
21933	for k, v := range m {
21934		switch k {
21935		case "properties":
21936			if v != nil {
21937				var workloadGroupProperties WorkloadGroupProperties
21938				err = json.Unmarshal(*v, &workloadGroupProperties)
21939				if err != nil {
21940					return err
21941				}
21942				wg.WorkloadGroupProperties = &workloadGroupProperties
21943			}
21944		case "id":
21945			if v != nil {
21946				var ID string
21947				err = json.Unmarshal(*v, &ID)
21948				if err != nil {
21949					return err
21950				}
21951				wg.ID = &ID
21952			}
21953		case "name":
21954			if v != nil {
21955				var name string
21956				err = json.Unmarshal(*v, &name)
21957				if err != nil {
21958					return err
21959				}
21960				wg.Name = &name
21961			}
21962		case "type":
21963			if v != nil {
21964				var typeVar string
21965				err = json.Unmarshal(*v, &typeVar)
21966				if err != nil {
21967					return err
21968				}
21969				wg.Type = &typeVar
21970			}
21971		}
21972	}
21973
21974	return nil
21975}
21976
21977// WorkloadGroupListResult a list of workload groups.
21978type WorkloadGroupListResult struct {
21979	autorest.Response `json:"-"`
21980	// Value - READ-ONLY; Array of results.
21981	Value *[]WorkloadGroup `json:"value,omitempty"`
21982	// NextLink - READ-ONLY; Link to retrieve next page of results.
21983	NextLink *string `json:"nextLink,omitempty"`
21984}
21985
21986// WorkloadGroupListResultIterator provides access to a complete listing of WorkloadGroup values.
21987type WorkloadGroupListResultIterator struct {
21988	i    int
21989	page WorkloadGroupListResultPage
21990}
21991
21992// NextWithContext advances to the next value.  If there was an error making
21993// the request the iterator does not advance and the error is returned.
21994func (iter *WorkloadGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
21995	if tracing.IsEnabled() {
21996		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadGroupListResultIterator.NextWithContext")
21997		defer func() {
21998			sc := -1
21999			if iter.Response().Response.Response != nil {
22000				sc = iter.Response().Response.Response.StatusCode
22001			}
22002			tracing.EndSpan(ctx, sc, err)
22003		}()
22004	}
22005	iter.i++
22006	if iter.i < len(iter.page.Values()) {
22007		return nil
22008	}
22009	err = iter.page.NextWithContext(ctx)
22010	if err != nil {
22011		iter.i--
22012		return err
22013	}
22014	iter.i = 0
22015	return nil
22016}
22017
22018// Next advances to the next value.  If there was an error making
22019// the request the iterator does not advance and the error is returned.
22020// Deprecated: Use NextWithContext() instead.
22021func (iter *WorkloadGroupListResultIterator) Next() error {
22022	return iter.NextWithContext(context.Background())
22023}
22024
22025// NotDone returns true if the enumeration should be started or is not yet complete.
22026func (iter WorkloadGroupListResultIterator) NotDone() bool {
22027	return iter.page.NotDone() && iter.i < len(iter.page.Values())
22028}
22029
22030// Response returns the raw server response from the last page request.
22031func (iter WorkloadGroupListResultIterator) Response() WorkloadGroupListResult {
22032	return iter.page.Response()
22033}
22034
22035// Value returns the current value or a zero-initialized value if the
22036// iterator has advanced beyond the end of the collection.
22037func (iter WorkloadGroupListResultIterator) Value() WorkloadGroup {
22038	if !iter.page.NotDone() {
22039		return WorkloadGroup{}
22040	}
22041	return iter.page.Values()[iter.i]
22042}
22043
22044// Creates a new instance of the WorkloadGroupListResultIterator type.
22045func NewWorkloadGroupListResultIterator(page WorkloadGroupListResultPage) WorkloadGroupListResultIterator {
22046	return WorkloadGroupListResultIterator{page: page}
22047}
22048
22049// IsEmpty returns true if the ListResult contains no values.
22050func (wglr WorkloadGroupListResult) IsEmpty() bool {
22051	return wglr.Value == nil || len(*wglr.Value) == 0
22052}
22053
22054// hasNextLink returns true if the NextLink is not empty.
22055func (wglr WorkloadGroupListResult) hasNextLink() bool {
22056	return wglr.NextLink != nil && len(*wglr.NextLink) != 0
22057}
22058
22059// workloadGroupListResultPreparer prepares a request to retrieve the next set of results.
22060// It returns nil if no more results exist.
22061func (wglr WorkloadGroupListResult) workloadGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
22062	if !wglr.hasNextLink() {
22063		return nil, nil
22064	}
22065	return autorest.Prepare((&http.Request{}).WithContext(ctx),
22066		autorest.AsJSON(),
22067		autorest.AsGet(),
22068		autorest.WithBaseURL(to.String(wglr.NextLink)))
22069}
22070
22071// WorkloadGroupListResultPage contains a page of WorkloadGroup values.
22072type WorkloadGroupListResultPage struct {
22073	fn   func(context.Context, WorkloadGroupListResult) (WorkloadGroupListResult, error)
22074	wglr WorkloadGroupListResult
22075}
22076
22077// NextWithContext advances to the next page of values.  If there was an error making
22078// the request the page does not advance and the error is returned.
22079func (page *WorkloadGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
22080	if tracing.IsEnabled() {
22081		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadGroupListResultPage.NextWithContext")
22082		defer func() {
22083			sc := -1
22084			if page.Response().Response.Response != nil {
22085				sc = page.Response().Response.Response.StatusCode
22086			}
22087			tracing.EndSpan(ctx, sc, err)
22088		}()
22089	}
22090	for {
22091		next, err := page.fn(ctx, page.wglr)
22092		if err != nil {
22093			return err
22094		}
22095		page.wglr = next
22096		if !next.hasNextLink() || !next.IsEmpty() {
22097			break
22098		}
22099	}
22100	return nil
22101}
22102
22103// Next advances to the next page of values.  If there was an error making
22104// the request the page does not advance and the error is returned.
22105// Deprecated: Use NextWithContext() instead.
22106func (page *WorkloadGroupListResultPage) Next() error {
22107	return page.NextWithContext(context.Background())
22108}
22109
22110// NotDone returns true if the page enumeration should be started or is not yet complete.
22111func (page WorkloadGroupListResultPage) NotDone() bool {
22112	return !page.wglr.IsEmpty()
22113}
22114
22115// Response returns the raw server response from the last page request.
22116func (page WorkloadGroupListResultPage) Response() WorkloadGroupListResult {
22117	return page.wglr
22118}
22119
22120// Values returns the slice of values for the current page or nil if there are no values.
22121func (page WorkloadGroupListResultPage) Values() []WorkloadGroup {
22122	if page.wglr.IsEmpty() {
22123		return nil
22124	}
22125	return *page.wglr.Value
22126}
22127
22128// Creates a new instance of the WorkloadGroupListResultPage type.
22129func NewWorkloadGroupListResultPage(cur WorkloadGroupListResult, getNextPage func(context.Context, WorkloadGroupListResult) (WorkloadGroupListResult, error)) WorkloadGroupListResultPage {
22130	return WorkloadGroupListResultPage{
22131		fn:   getNextPage,
22132		wglr: cur,
22133	}
22134}
22135
22136// WorkloadGroupProperties workload group definition. For more information look at
22137// sys.workload_management_workload_groups (DMV).
22138type WorkloadGroupProperties struct {
22139	// MinResourcePercent - The workload group minimum percentage resource.
22140	MinResourcePercent *int32 `json:"minResourcePercent,omitempty"`
22141	// MaxResourcePercent - The workload group cap percentage resource.
22142	MaxResourcePercent *int32 `json:"maxResourcePercent,omitempty"`
22143	// MinResourcePercentPerRequest - The workload group request minimum grant percentage.
22144	MinResourcePercentPerRequest *float64 `json:"minResourcePercentPerRequest,omitempty"`
22145	// MaxResourcePercentPerRequest - The workload group request maximum grant percentage.
22146	MaxResourcePercentPerRequest *float64 `json:"maxResourcePercentPerRequest,omitempty"`
22147	// Importance - The workload group importance level.
22148	Importance *string `json:"importance,omitempty"`
22149	// QueryExecutionTimeout - The workload group query execution timeout.
22150	QueryExecutionTimeout *int32 `json:"queryExecutionTimeout,omitempty"`
22151}
22152
22153// WorkloadGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
22154// long-running operation.
22155type WorkloadGroupsCreateOrUpdateFuture struct {
22156	azure.FutureAPI
22157	// Result returns the result of the asynchronous operation.
22158	// If the operation has not completed it will return an error.
22159	Result func(WorkloadGroupsClient) (WorkloadGroup, error)
22160}
22161
22162// WorkloadGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
22163// operation.
22164type WorkloadGroupsDeleteFuture struct {
22165	azure.FutureAPI
22166	// Result returns the result of the asynchronous operation.
22167	// If the operation has not completed it will return an error.
22168	Result func(WorkloadGroupsClient) (autorest.Response, error)
22169}
22170