1package mariadb
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	"net/http"
29)
30
31// The package's fully qualified name.
32const fqdn = "github.com/Azure/azure-sdk-for-go/services/mariadb/mgmt/2018-06-01/mariadb"
33
34// Advisor represents a recommendation action advisor.
35type Advisor struct {
36	autorest.Response `json:"-"`
37	// Properties - The properties of a recommendation action advisor.
38	Properties interface{} `json:"properties,omitempty"`
39	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
40	ID *string `json:"id,omitempty"`
41	// Name - READ-ONLY; The name of the resource
42	Name *string `json:"name,omitempty"`
43	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
44	Type *string `json:"type,omitempty"`
45}
46
47// MarshalJSON is the custom marshaler for Advisor.
48func (a Advisor) MarshalJSON() ([]byte, error) {
49	objectMap := make(map[string]interface{})
50	if a.Properties != nil {
51		objectMap["properties"] = a.Properties
52	}
53	return json.Marshal(objectMap)
54}
55
56// AdvisorsResultList a list of query statistics.
57type AdvisorsResultList struct {
58	autorest.Response `json:"-"`
59	// Value - READ-ONLY; The list of recommendation action advisors.
60	Value *[]Advisor `json:"value,omitempty"`
61	// NextLink - READ-ONLY; Link to retrieve next page of results.
62	NextLink *string `json:"nextLink,omitempty"`
63}
64
65// AdvisorsResultListIterator provides access to a complete listing of Advisor values.
66type AdvisorsResultListIterator struct {
67	i    int
68	page AdvisorsResultListPage
69}
70
71// NextWithContext advances to the next value.  If there was an error making
72// the request the iterator does not advance and the error is returned.
73func (iter *AdvisorsResultListIterator) NextWithContext(ctx context.Context) (err error) {
74	if tracing.IsEnabled() {
75		ctx = tracing.StartSpan(ctx, fqdn+"/AdvisorsResultListIterator.NextWithContext")
76		defer func() {
77			sc := -1
78			if iter.Response().Response.Response != nil {
79				sc = iter.Response().Response.Response.StatusCode
80			}
81			tracing.EndSpan(ctx, sc, err)
82		}()
83	}
84	iter.i++
85	if iter.i < len(iter.page.Values()) {
86		return nil
87	}
88	err = iter.page.NextWithContext(ctx)
89	if err != nil {
90		iter.i--
91		return err
92	}
93	iter.i = 0
94	return nil
95}
96
97// Next advances to the next value.  If there was an error making
98// the request the iterator does not advance and the error is returned.
99// Deprecated: Use NextWithContext() instead.
100func (iter *AdvisorsResultListIterator) Next() error {
101	return iter.NextWithContext(context.Background())
102}
103
104// NotDone returns true if the enumeration should be started or is not yet complete.
105func (iter AdvisorsResultListIterator) NotDone() bool {
106	return iter.page.NotDone() && iter.i < len(iter.page.Values())
107}
108
109// Response returns the raw server response from the last page request.
110func (iter AdvisorsResultListIterator) Response() AdvisorsResultList {
111	return iter.page.Response()
112}
113
114// Value returns the current value or a zero-initialized value if the
115// iterator has advanced beyond the end of the collection.
116func (iter AdvisorsResultListIterator) Value() Advisor {
117	if !iter.page.NotDone() {
118		return Advisor{}
119	}
120	return iter.page.Values()[iter.i]
121}
122
123// Creates a new instance of the AdvisorsResultListIterator type.
124func NewAdvisorsResultListIterator(page AdvisorsResultListPage) AdvisorsResultListIterator {
125	return AdvisorsResultListIterator{page: page}
126}
127
128// IsEmpty returns true if the ListResult contains no values.
129func (arl AdvisorsResultList) IsEmpty() bool {
130	return arl.Value == nil || len(*arl.Value) == 0
131}
132
133// hasNextLink returns true if the NextLink is not empty.
134func (arl AdvisorsResultList) hasNextLink() bool {
135	return arl.NextLink != nil && len(*arl.NextLink) != 0
136}
137
138// advisorsResultListPreparer prepares a request to retrieve the next set of results.
139// It returns nil if no more results exist.
140func (arl AdvisorsResultList) advisorsResultListPreparer(ctx context.Context) (*http.Request, error) {
141	if !arl.hasNextLink() {
142		return nil, nil
143	}
144	return autorest.Prepare((&http.Request{}).WithContext(ctx),
145		autorest.AsJSON(),
146		autorest.AsGet(),
147		autorest.WithBaseURL(to.String(arl.NextLink)))
148}
149
150// AdvisorsResultListPage contains a page of Advisor values.
151type AdvisorsResultListPage struct {
152	fn  func(context.Context, AdvisorsResultList) (AdvisorsResultList, error)
153	arl AdvisorsResultList
154}
155
156// NextWithContext advances to the next page of values.  If there was an error making
157// the request the page does not advance and the error is returned.
158func (page *AdvisorsResultListPage) NextWithContext(ctx context.Context) (err error) {
159	if tracing.IsEnabled() {
160		ctx = tracing.StartSpan(ctx, fqdn+"/AdvisorsResultListPage.NextWithContext")
161		defer func() {
162			sc := -1
163			if page.Response().Response.Response != nil {
164				sc = page.Response().Response.Response.StatusCode
165			}
166			tracing.EndSpan(ctx, sc, err)
167		}()
168	}
169	for {
170		next, err := page.fn(ctx, page.arl)
171		if err != nil {
172			return err
173		}
174		page.arl = next
175		if !next.hasNextLink() || !next.IsEmpty() {
176			break
177		}
178	}
179	return nil
180}
181
182// Next advances to the next page of values.  If there was an error making
183// the request the page does not advance and the error is returned.
184// Deprecated: Use NextWithContext() instead.
185func (page *AdvisorsResultListPage) Next() error {
186	return page.NextWithContext(context.Background())
187}
188
189// NotDone returns true if the page enumeration should be started or is not yet complete.
190func (page AdvisorsResultListPage) NotDone() bool {
191	return !page.arl.IsEmpty()
192}
193
194// Response returns the raw server response from the last page request.
195func (page AdvisorsResultListPage) Response() AdvisorsResultList {
196	return page.arl
197}
198
199// Values returns the slice of values for the current page or nil if there are no values.
200func (page AdvisorsResultListPage) Values() []Advisor {
201	if page.arl.IsEmpty() {
202		return nil
203	}
204	return *page.arl.Value
205}
206
207// Creates a new instance of the AdvisorsResultListPage type.
208func NewAdvisorsResultListPage(cur AdvisorsResultList, getNextPage func(context.Context, AdvisorsResultList) (AdvisorsResultList, error)) AdvisorsResultListPage {
209	return AdvisorsResultListPage{
210		fn:  getNextPage,
211		arl: cur,
212	}
213}
214
215// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
216type AzureEntityResource struct {
217	// Etag - READ-ONLY; Resource Etag.
218	Etag *string `json:"etag,omitempty"`
219	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
220	ID *string `json:"id,omitempty"`
221	// Name - READ-ONLY; The name of the resource
222	Name *string `json:"name,omitempty"`
223	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
224	Type *string `json:"type,omitempty"`
225}
226
227// CloudError an error response from the Batch service.
228type CloudError struct {
229	Error *ErrorResponse `json:"error,omitempty"`
230}
231
232// Configuration represents a Configuration.
233type Configuration struct {
234	autorest.Response `json:"-"`
235	// ConfigurationProperties - The properties of a configuration.
236	*ConfigurationProperties `json:"properties,omitempty"`
237	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
238	ID *string `json:"id,omitempty"`
239	// Name - READ-ONLY; The name of the resource
240	Name *string `json:"name,omitempty"`
241	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
242	Type *string `json:"type,omitempty"`
243}
244
245// MarshalJSON is the custom marshaler for Configuration.
246func (c Configuration) MarshalJSON() ([]byte, error) {
247	objectMap := make(map[string]interface{})
248	if c.ConfigurationProperties != nil {
249		objectMap["properties"] = c.ConfigurationProperties
250	}
251	return json.Marshal(objectMap)
252}
253
254// UnmarshalJSON is the custom unmarshaler for Configuration struct.
255func (c *Configuration) UnmarshalJSON(body []byte) error {
256	var m map[string]*json.RawMessage
257	err := json.Unmarshal(body, &m)
258	if err != nil {
259		return err
260	}
261	for k, v := range m {
262		switch k {
263		case "properties":
264			if v != nil {
265				var configurationProperties ConfigurationProperties
266				err = json.Unmarshal(*v, &configurationProperties)
267				if err != nil {
268					return err
269				}
270				c.ConfigurationProperties = &configurationProperties
271			}
272		case "id":
273			if v != nil {
274				var ID string
275				err = json.Unmarshal(*v, &ID)
276				if err != nil {
277					return err
278				}
279				c.ID = &ID
280			}
281		case "name":
282			if v != nil {
283				var name string
284				err = json.Unmarshal(*v, &name)
285				if err != nil {
286					return err
287				}
288				c.Name = &name
289			}
290		case "type":
291			if v != nil {
292				var typeVar string
293				err = json.Unmarshal(*v, &typeVar)
294				if err != nil {
295					return err
296				}
297				c.Type = &typeVar
298			}
299		}
300	}
301
302	return nil
303}
304
305// ConfigurationListResult a list of server configurations.
306type ConfigurationListResult struct {
307	autorest.Response `json:"-"`
308	// Value - The list of server configurations.
309	Value *[]Configuration `json:"value,omitempty"`
310}
311
312// ConfigurationProperties the properties of a configuration.
313type ConfigurationProperties struct {
314	// Value - Value of the configuration.
315	Value *string `json:"value,omitempty"`
316	// Description - READ-ONLY; Description of the configuration.
317	Description *string `json:"description,omitempty"`
318	// DefaultValue - READ-ONLY; Default value of the configuration.
319	DefaultValue *string `json:"defaultValue,omitempty"`
320	// DataType - READ-ONLY; Data type of the configuration.
321	DataType *string `json:"dataType,omitempty"`
322	// AllowedValues - READ-ONLY; Allowed values of the configuration.
323	AllowedValues *string `json:"allowedValues,omitempty"`
324	// Source - Source of the configuration.
325	Source *string `json:"source,omitempty"`
326}
327
328// MarshalJSON is the custom marshaler for ConfigurationProperties.
329func (cp ConfigurationProperties) MarshalJSON() ([]byte, error) {
330	objectMap := make(map[string]interface{})
331	if cp.Value != nil {
332		objectMap["value"] = cp.Value
333	}
334	if cp.Source != nil {
335		objectMap["source"] = cp.Source
336	}
337	return json.Marshal(objectMap)
338}
339
340// ConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
341// long-running operation.
342type ConfigurationsCreateOrUpdateFuture struct {
343	azure.FutureAPI
344	// Result returns the result of the asynchronous operation.
345	// If the operation has not completed it will return an error.
346	Result func(ConfigurationsClient) (Configuration, error)
347}
348
349// CreateRecommendedActionSessionFuture an abstraction for monitoring and retrieving the results of a
350// long-running operation.
351type CreateRecommendedActionSessionFuture struct {
352	azure.FutureAPI
353	// Result returns the result of the asynchronous operation.
354	// If the operation has not completed it will return an error.
355	Result func(BaseClient) (autorest.Response, error)
356}
357
358// Database represents a Database.
359type Database struct {
360	autorest.Response `json:"-"`
361	// DatabaseProperties - The properties of a database.
362	*DatabaseProperties `json:"properties,omitempty"`
363	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
364	ID *string `json:"id,omitempty"`
365	// Name - READ-ONLY; The name of the resource
366	Name *string `json:"name,omitempty"`
367	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
368	Type *string `json:"type,omitempty"`
369}
370
371// MarshalJSON is the custom marshaler for Database.
372func (d Database) MarshalJSON() ([]byte, error) {
373	objectMap := make(map[string]interface{})
374	if d.DatabaseProperties != nil {
375		objectMap["properties"] = d.DatabaseProperties
376	}
377	return json.Marshal(objectMap)
378}
379
380// UnmarshalJSON is the custom unmarshaler for Database struct.
381func (d *Database) UnmarshalJSON(body []byte) error {
382	var m map[string]*json.RawMessage
383	err := json.Unmarshal(body, &m)
384	if err != nil {
385		return err
386	}
387	for k, v := range m {
388		switch k {
389		case "properties":
390			if v != nil {
391				var databaseProperties DatabaseProperties
392				err = json.Unmarshal(*v, &databaseProperties)
393				if err != nil {
394					return err
395				}
396				d.DatabaseProperties = &databaseProperties
397			}
398		case "id":
399			if v != nil {
400				var ID string
401				err = json.Unmarshal(*v, &ID)
402				if err != nil {
403					return err
404				}
405				d.ID = &ID
406			}
407		case "name":
408			if v != nil {
409				var name string
410				err = json.Unmarshal(*v, &name)
411				if err != nil {
412					return err
413				}
414				d.Name = &name
415			}
416		case "type":
417			if v != nil {
418				var typeVar string
419				err = json.Unmarshal(*v, &typeVar)
420				if err != nil {
421					return err
422				}
423				d.Type = &typeVar
424			}
425		}
426	}
427
428	return nil
429}
430
431// DatabaseListResult a List of databases.
432type DatabaseListResult struct {
433	autorest.Response `json:"-"`
434	// Value - The list of databases housed in a server
435	Value *[]Database `json:"value,omitempty"`
436}
437
438// DatabaseProperties the properties of a database.
439type DatabaseProperties struct {
440	// Charset - The charset of the database.
441	Charset *string `json:"charset,omitempty"`
442	// Collation - The collation of the database.
443	Collation *string `json:"collation,omitempty"`
444}
445
446// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
447// operation.
448type DatabasesCreateOrUpdateFuture struct {
449	azure.FutureAPI
450	// Result returns the result of the asynchronous operation.
451	// If the operation has not completed it will return an error.
452	Result func(DatabasesClient) (Database, error)
453}
454
455// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
456// operation.
457type DatabasesDeleteFuture struct {
458	azure.FutureAPI
459	// Result returns the result of the asynchronous operation.
460	// If the operation has not completed it will return an error.
461	Result func(DatabasesClient) (autorest.Response, error)
462}
463
464// ErrorAdditionalInfo the resource management error additional info.
465type ErrorAdditionalInfo struct {
466	// Type - READ-ONLY; The additional info type.
467	Type *string `json:"type,omitempty"`
468	// Info - READ-ONLY; The additional info.
469	Info interface{} `json:"info,omitempty"`
470}
471
472// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for
473// failed operations. (This also follows the OData error response format.)
474type ErrorResponse struct {
475	// Code - READ-ONLY; The error code.
476	Code *string `json:"code,omitempty"`
477	// Message - READ-ONLY; The error message.
478	Message *string `json:"message,omitempty"`
479	// Target - READ-ONLY; The error target.
480	Target *string `json:"target,omitempty"`
481	// Details - READ-ONLY; The error details.
482	Details *[]ErrorResponse `json:"details,omitempty"`
483	// AdditionalInfo - READ-ONLY; The error additional info.
484	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
485}
486
487// FirewallRule represents a server firewall rule.
488type FirewallRule struct {
489	autorest.Response `json:"-"`
490	// FirewallRuleProperties - The properties of a firewall rule.
491	*FirewallRuleProperties `json:"properties,omitempty"`
492	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
493	ID *string `json:"id,omitempty"`
494	// Name - READ-ONLY; The name of the resource
495	Name *string `json:"name,omitempty"`
496	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
497	Type *string `json:"type,omitempty"`
498}
499
500// MarshalJSON is the custom marshaler for FirewallRule.
501func (fr FirewallRule) MarshalJSON() ([]byte, error) {
502	objectMap := make(map[string]interface{})
503	if fr.FirewallRuleProperties != nil {
504		objectMap["properties"] = fr.FirewallRuleProperties
505	}
506	return json.Marshal(objectMap)
507}
508
509// UnmarshalJSON is the custom unmarshaler for FirewallRule struct.
510func (fr *FirewallRule) UnmarshalJSON(body []byte) error {
511	var m map[string]*json.RawMessage
512	err := json.Unmarshal(body, &m)
513	if err != nil {
514		return err
515	}
516	for k, v := range m {
517		switch k {
518		case "properties":
519			if v != nil {
520				var firewallRuleProperties FirewallRuleProperties
521				err = json.Unmarshal(*v, &firewallRuleProperties)
522				if err != nil {
523					return err
524				}
525				fr.FirewallRuleProperties = &firewallRuleProperties
526			}
527		case "id":
528			if v != nil {
529				var ID string
530				err = json.Unmarshal(*v, &ID)
531				if err != nil {
532					return err
533				}
534				fr.ID = &ID
535			}
536		case "name":
537			if v != nil {
538				var name string
539				err = json.Unmarshal(*v, &name)
540				if err != nil {
541					return err
542				}
543				fr.Name = &name
544			}
545		case "type":
546			if v != nil {
547				var typeVar string
548				err = json.Unmarshal(*v, &typeVar)
549				if err != nil {
550					return err
551				}
552				fr.Type = &typeVar
553			}
554		}
555	}
556
557	return nil
558}
559
560// FirewallRuleListResult a list of firewall rules.
561type FirewallRuleListResult struct {
562	autorest.Response `json:"-"`
563	// Value - The list of firewall rules in a server.
564	Value *[]FirewallRule `json:"value,omitempty"`
565}
566
567// FirewallRuleProperties the properties of a server firewall rule.
568type FirewallRuleProperties struct {
569	// StartIPAddress - The start IP address of the server firewall rule. Must be IPv4 format.
570	StartIPAddress *string `json:"startIpAddress,omitempty"`
571	// EndIPAddress - The end IP address of the server firewall rule. Must be IPv4 format.
572	EndIPAddress *string `json:"endIpAddress,omitempty"`
573}
574
575// FirewallRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
576// long-running operation.
577type FirewallRulesCreateOrUpdateFuture struct {
578	azure.FutureAPI
579	// Result returns the result of the asynchronous operation.
580	// If the operation has not completed it will return an error.
581	Result func(FirewallRulesClient) (FirewallRule, error)
582}
583
584// FirewallRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
585// operation.
586type FirewallRulesDeleteFuture struct {
587	azure.FutureAPI
588	// Result returns the result of the asynchronous operation.
589	// If the operation has not completed it will return an error.
590	Result func(FirewallRulesClient) (autorest.Response, error)
591}
592
593// LogFile represents a log file.
594type LogFile struct {
595	// LogFileProperties - The properties of the log file.
596	*LogFileProperties `json:"properties,omitempty"`
597	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
598	ID *string `json:"id,omitempty"`
599	// Name - READ-ONLY; The name of the resource
600	Name *string `json:"name,omitempty"`
601	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
602	Type *string `json:"type,omitempty"`
603}
604
605// MarshalJSON is the custom marshaler for LogFile.
606func (lf LogFile) MarshalJSON() ([]byte, error) {
607	objectMap := make(map[string]interface{})
608	if lf.LogFileProperties != nil {
609		objectMap["properties"] = lf.LogFileProperties
610	}
611	return json.Marshal(objectMap)
612}
613
614// UnmarshalJSON is the custom unmarshaler for LogFile struct.
615func (lf *LogFile) UnmarshalJSON(body []byte) error {
616	var m map[string]*json.RawMessage
617	err := json.Unmarshal(body, &m)
618	if err != nil {
619		return err
620	}
621	for k, v := range m {
622		switch k {
623		case "properties":
624			if v != nil {
625				var logFileProperties LogFileProperties
626				err = json.Unmarshal(*v, &logFileProperties)
627				if err != nil {
628					return err
629				}
630				lf.LogFileProperties = &logFileProperties
631			}
632		case "id":
633			if v != nil {
634				var ID string
635				err = json.Unmarshal(*v, &ID)
636				if err != nil {
637					return err
638				}
639				lf.ID = &ID
640			}
641		case "name":
642			if v != nil {
643				var name string
644				err = json.Unmarshal(*v, &name)
645				if err != nil {
646					return err
647				}
648				lf.Name = &name
649			}
650		case "type":
651			if v != nil {
652				var typeVar string
653				err = json.Unmarshal(*v, &typeVar)
654				if err != nil {
655					return err
656				}
657				lf.Type = &typeVar
658			}
659		}
660	}
661
662	return nil
663}
664
665// LogFileListResult a list of log files.
666type LogFileListResult struct {
667	autorest.Response `json:"-"`
668	// Value - The list of log files.
669	Value *[]LogFile `json:"value,omitempty"`
670}
671
672// LogFileProperties the properties of a log file.
673type LogFileProperties struct {
674	// SizeInKB - Size of the log file.
675	SizeInKB *int64 `json:"sizeInKB,omitempty"`
676	// CreatedTime - READ-ONLY; Creation timestamp of the log file.
677	CreatedTime *date.Time `json:"createdTime,omitempty"`
678	// LastModifiedTime - READ-ONLY; Last modified timestamp of the log file.
679	LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
680	// Type - Type of the log file.
681	Type *string `json:"type,omitempty"`
682	// URL - READ-ONLY; The url to download the log file from.
683	URL *string `json:"url,omitempty"`
684}
685
686// MarshalJSON is the custom marshaler for LogFileProperties.
687func (lfp LogFileProperties) MarshalJSON() ([]byte, error) {
688	objectMap := make(map[string]interface{})
689	if lfp.SizeInKB != nil {
690		objectMap["sizeInKB"] = lfp.SizeInKB
691	}
692	if lfp.Type != nil {
693		objectMap["type"] = lfp.Type
694	}
695	return json.Marshal(objectMap)
696}
697
698// NameAvailability represents a resource name availability.
699type NameAvailability struct {
700	autorest.Response `json:"-"`
701	// Message - Error Message.
702	Message *string `json:"message,omitempty"`
703	// NameAvailable - Indicates whether the resource name is available.
704	NameAvailable *bool `json:"nameAvailable,omitempty"`
705	// Reason - Reason for name being unavailable.
706	Reason *string `json:"reason,omitempty"`
707}
708
709// NameAvailabilityRequest request from client to check resource name availability.
710type NameAvailabilityRequest struct {
711	// Name - Resource name to verify.
712	Name *string `json:"name,omitempty"`
713	// Type - Resource type used for verification.
714	Type *string `json:"type,omitempty"`
715}
716
717// Operation REST API operation definition.
718type Operation struct {
719	// Name - READ-ONLY; The name of the operation being performed on this particular object.
720	Name *string `json:"name,omitempty"`
721	// Display - READ-ONLY; The localized display information for this particular operation or action.
722	Display *OperationDisplay `json:"display,omitempty"`
723	// Origin - READ-ONLY; The intended executor of the operation. Possible values include: 'NotSpecified', 'User', 'System'
724	Origin OperationOrigin `json:"origin,omitempty"`
725	// Properties - READ-ONLY; Additional descriptions for the operation.
726	Properties map[string]interface{} `json:"properties"`
727}
728
729// MarshalJSON is the custom marshaler for Operation.
730func (o Operation) MarshalJSON() ([]byte, error) {
731	objectMap := make(map[string]interface{})
732	return json.Marshal(objectMap)
733}
734
735// OperationDisplay display metadata associated with the operation.
736type OperationDisplay struct {
737	// Provider - READ-ONLY; Operation resource provider name.
738	Provider *string `json:"provider,omitempty"`
739	// Resource - READ-ONLY; Resource on which the operation is performed.
740	Resource *string `json:"resource,omitempty"`
741	// Operation - READ-ONLY; Localized friendly name for the operation.
742	Operation *string `json:"operation,omitempty"`
743	// Description - READ-ONLY; Operation description.
744	Description *string `json:"description,omitempty"`
745}
746
747// OperationListResult a list of resource provider operations.
748type OperationListResult struct {
749	autorest.Response `json:"-"`
750	// Value - The list of resource provider operations.
751	Value *[]Operation `json:"value,omitempty"`
752}
753
754// PerformanceTierListResult a list of performance tiers.
755type PerformanceTierListResult struct {
756	autorest.Response `json:"-"`
757	// Value - The list of performance tiers
758	Value *[]PerformanceTierProperties `json:"value,omitempty"`
759}
760
761// PerformanceTierProperties performance tier properties
762type PerformanceTierProperties struct {
763	// ID - ID of the performance tier.
764	ID *string `json:"id,omitempty"`
765	// ServiceLevelObjectives - Service level objectives associated with the performance tier
766	ServiceLevelObjectives *[]PerformanceTierServiceLevelObjectives `json:"serviceLevelObjectives,omitempty"`
767}
768
769// PerformanceTierServiceLevelObjectives service level objectives for performance tier.
770type PerformanceTierServiceLevelObjectives struct {
771	// ID - ID for the service level objective.
772	ID *string `json:"id,omitempty"`
773	// Edition - Edition of the performance tier.
774	Edition *string `json:"edition,omitempty"`
775	// VCore - vCore associated with the service level objective
776	VCore *int32 `json:"vCore,omitempty"`
777	// HardwareGeneration - Hardware generation associated with the service level objective
778	HardwareGeneration *string `json:"hardwareGeneration,omitempty"`
779	// MaxBackupRetentionDays - Maximum Backup retention in days for the performance tier edition
780	MaxBackupRetentionDays *int32 `json:"maxBackupRetentionDays,omitempty"`
781	// MinBackupRetentionDays - Minimum Backup retention in days for the performance tier edition
782	MinBackupRetentionDays *int32 `json:"minBackupRetentionDays,omitempty"`
783	// MaxStorageMB - Max storage allowed for a server.
784	MaxStorageMB *int32 `json:"maxStorageMB,omitempty"`
785	// MinStorageMB - Max storage allowed for a server.
786	MinStorageMB *int32 `json:"minStorageMB,omitempty"`
787}
788
789// PrivateEndpointConnection a private endpoint connection
790type PrivateEndpointConnection struct {
791	autorest.Response `json:"-"`
792	// PrivateEndpointConnectionProperties - Resource properties.
793	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
794	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
795	ID *string `json:"id,omitempty"`
796	// Name - READ-ONLY; The name of the resource
797	Name *string `json:"name,omitempty"`
798	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
799	Type *string `json:"type,omitempty"`
800}
801
802// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
803func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
804	objectMap := make(map[string]interface{})
805	if pec.PrivateEndpointConnectionProperties != nil {
806		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
807	}
808	return json.Marshal(objectMap)
809}
810
811// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
812func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
813	var m map[string]*json.RawMessage
814	err := json.Unmarshal(body, &m)
815	if err != nil {
816		return err
817	}
818	for k, v := range m {
819		switch k {
820		case "properties":
821			if v != nil {
822				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
823				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
824				if err != nil {
825					return err
826				}
827				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
828			}
829		case "id":
830			if v != nil {
831				var ID string
832				err = json.Unmarshal(*v, &ID)
833				if err != nil {
834					return err
835				}
836				pec.ID = &ID
837			}
838		case "name":
839			if v != nil {
840				var name string
841				err = json.Unmarshal(*v, &name)
842				if err != nil {
843					return err
844				}
845				pec.Name = &name
846			}
847		case "type":
848			if v != nil {
849				var typeVar string
850				err = json.Unmarshal(*v, &typeVar)
851				if err != nil {
852					return err
853				}
854				pec.Type = &typeVar
855			}
856		}
857	}
858
859	return nil
860}
861
862// PrivateEndpointConnectionListResult a list of private endpoint connections.
863type PrivateEndpointConnectionListResult struct {
864	autorest.Response `json:"-"`
865	// Value - READ-ONLY; Array of results.
866	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
867	// NextLink - READ-ONLY; Link to retrieve next page of results.
868	NextLink *string `json:"nextLink,omitempty"`
869}
870
871// PrivateEndpointConnectionListResultIterator provides access to a complete listing of
872// PrivateEndpointConnection values.
873type PrivateEndpointConnectionListResultIterator struct {
874	i    int
875	page PrivateEndpointConnectionListResultPage
876}
877
878// NextWithContext advances to the next value.  If there was an error making
879// the request the iterator does not advance and the error is returned.
880func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
881	if tracing.IsEnabled() {
882		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext")
883		defer func() {
884			sc := -1
885			if iter.Response().Response.Response != nil {
886				sc = iter.Response().Response.Response.StatusCode
887			}
888			tracing.EndSpan(ctx, sc, err)
889		}()
890	}
891	iter.i++
892	if iter.i < len(iter.page.Values()) {
893		return nil
894	}
895	err = iter.page.NextWithContext(ctx)
896	if err != nil {
897		iter.i--
898		return err
899	}
900	iter.i = 0
901	return nil
902}
903
904// Next advances to the next value.  If there was an error making
905// the request the iterator does not advance and the error is returned.
906// Deprecated: Use NextWithContext() instead.
907func (iter *PrivateEndpointConnectionListResultIterator) Next() error {
908	return iter.NextWithContext(context.Background())
909}
910
911// NotDone returns true if the enumeration should be started or is not yet complete.
912func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool {
913	return iter.page.NotDone() && iter.i < len(iter.page.Values())
914}
915
916// Response returns the raw server response from the last page request.
917func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult {
918	return iter.page.Response()
919}
920
921// Value returns the current value or a zero-initialized value if the
922// iterator has advanced beyond the end of the collection.
923func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection {
924	if !iter.page.NotDone() {
925		return PrivateEndpointConnection{}
926	}
927	return iter.page.Values()[iter.i]
928}
929
930// Creates a new instance of the PrivateEndpointConnectionListResultIterator type.
931func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator {
932	return PrivateEndpointConnectionListResultIterator{page: page}
933}
934
935// IsEmpty returns true if the ListResult contains no values.
936func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool {
937	return peclr.Value == nil || len(*peclr.Value) == 0
938}
939
940// hasNextLink returns true if the NextLink is not empty.
941func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool {
942	return peclr.NextLink != nil && len(*peclr.NextLink) != 0
943}
944
945// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results.
946// It returns nil if no more results exist.
947func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
948	if !peclr.hasNextLink() {
949		return nil, nil
950	}
951	return autorest.Prepare((&http.Request{}).WithContext(ctx),
952		autorest.AsJSON(),
953		autorest.AsGet(),
954		autorest.WithBaseURL(to.String(peclr.NextLink)))
955}
956
957// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values.
958type PrivateEndpointConnectionListResultPage struct {
959	fn    func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)
960	peclr PrivateEndpointConnectionListResult
961}
962
963// NextWithContext advances to the next page of values.  If there was an error making
964// the request the page does not advance and the error is returned.
965func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
966	if tracing.IsEnabled() {
967		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext")
968		defer func() {
969			sc := -1
970			if page.Response().Response.Response != nil {
971				sc = page.Response().Response.Response.StatusCode
972			}
973			tracing.EndSpan(ctx, sc, err)
974		}()
975	}
976	for {
977		next, err := page.fn(ctx, page.peclr)
978		if err != nil {
979			return err
980		}
981		page.peclr = next
982		if !next.hasNextLink() || !next.IsEmpty() {
983			break
984		}
985	}
986	return nil
987}
988
989// Next advances to the next page of values.  If there was an error making
990// the request the page does not advance and the error is returned.
991// Deprecated: Use NextWithContext() instead.
992func (page *PrivateEndpointConnectionListResultPage) Next() error {
993	return page.NextWithContext(context.Background())
994}
995
996// NotDone returns true if the page enumeration should be started or is not yet complete.
997func (page PrivateEndpointConnectionListResultPage) NotDone() bool {
998	return !page.peclr.IsEmpty()
999}
1000
1001// Response returns the raw server response from the last page request.
1002func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult {
1003	return page.peclr
1004}
1005
1006// Values returns the slice of values for the current page or nil if there are no values.
1007func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection {
1008	if page.peclr.IsEmpty() {
1009		return nil
1010	}
1011	return *page.peclr.Value
1012}
1013
1014// Creates a new instance of the PrivateEndpointConnectionListResultPage type.
1015func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage {
1016	return PrivateEndpointConnectionListResultPage{
1017		fn:    getNextPage,
1018		peclr: cur,
1019	}
1020}
1021
1022// PrivateEndpointConnectionProperties properties of a private endpoint connection.
1023type PrivateEndpointConnectionProperties struct {
1024	// PrivateEndpoint - Private endpoint which the connection belongs to.
1025	PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"`
1026	// PrivateLinkServiceConnectionState - Connection state of the private endpoint connection.
1027	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`
1028	// ProvisioningState - READ-ONLY; State of the private endpoint connection.
1029	ProvisioningState *string `json:"provisioningState,omitempty"`
1030}
1031
1032// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties.
1033func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
1034	objectMap := make(map[string]interface{})
1035	if pecp.PrivateEndpoint != nil {
1036		objectMap["privateEndpoint"] = pecp.PrivateEndpoint
1037	}
1038	if pecp.PrivateLinkServiceConnectionState != nil {
1039		objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState
1040	}
1041	return json.Marshal(objectMap)
1042}
1043
1044// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
1045// of a long-running operation.
1046type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
1047	azure.FutureAPI
1048	// Result returns the result of the asynchronous operation.
1049	// If the operation has not completed it will return an error.
1050	Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
1051}
1052
1053// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
1054// long-running operation.
1055type PrivateEndpointConnectionsDeleteFuture struct {
1056	azure.FutureAPI
1057	// Result returns the result of the asynchronous operation.
1058	// If the operation has not completed it will return an error.
1059	Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
1060}
1061
1062// PrivateEndpointConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a
1063// long-running operation.
1064type PrivateEndpointConnectionsUpdateTagsFuture struct {
1065	azure.FutureAPI
1066	// Result returns the result of the asynchronous operation.
1067	// If the operation has not completed it will return an error.
1068	Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
1069}
1070
1071// PrivateEndpointProperty ...
1072type PrivateEndpointProperty struct {
1073	// ID - Resource id of the private endpoint.
1074	ID *string `json:"id,omitempty"`
1075}
1076
1077// PrivateLinkResource a private link resource
1078type PrivateLinkResource struct {
1079	autorest.Response `json:"-"`
1080	// Properties - READ-ONLY; The private link resource group id.
1081	Properties *PrivateLinkResourceProperties `json:"properties,omitempty"`
1082	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1083	ID *string `json:"id,omitempty"`
1084	// Name - READ-ONLY; The name of the resource
1085	Name *string `json:"name,omitempty"`
1086	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1087	Type *string `json:"type,omitempty"`
1088}
1089
1090// PrivateLinkResourceListResult a list of private link resources
1091type PrivateLinkResourceListResult struct {
1092	autorest.Response `json:"-"`
1093	// Value - READ-ONLY; Array of results.
1094	Value *[]PrivateLinkResource `json:"value,omitempty"`
1095	// NextLink - READ-ONLY; Link to retrieve next page of results.
1096	NextLink *string `json:"nextLink,omitempty"`
1097}
1098
1099// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource
1100// values.
1101type PrivateLinkResourceListResultIterator struct {
1102	i    int
1103	page PrivateLinkResourceListResultPage
1104}
1105
1106// NextWithContext advances to the next value.  If there was an error making
1107// the request the iterator does not advance and the error is returned.
1108func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
1109	if tracing.IsEnabled() {
1110		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext")
1111		defer func() {
1112			sc := -1
1113			if iter.Response().Response.Response != nil {
1114				sc = iter.Response().Response.Response.StatusCode
1115			}
1116			tracing.EndSpan(ctx, sc, err)
1117		}()
1118	}
1119	iter.i++
1120	if iter.i < len(iter.page.Values()) {
1121		return nil
1122	}
1123	err = iter.page.NextWithContext(ctx)
1124	if err != nil {
1125		iter.i--
1126		return err
1127	}
1128	iter.i = 0
1129	return nil
1130}
1131
1132// Next advances to the next value.  If there was an error making
1133// the request the iterator does not advance and the error is returned.
1134// Deprecated: Use NextWithContext() instead.
1135func (iter *PrivateLinkResourceListResultIterator) Next() error {
1136	return iter.NextWithContext(context.Background())
1137}
1138
1139// NotDone returns true if the enumeration should be started or is not yet complete.
1140func (iter PrivateLinkResourceListResultIterator) NotDone() bool {
1141	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1142}
1143
1144// Response returns the raw server response from the last page request.
1145func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult {
1146	return iter.page.Response()
1147}
1148
1149// Value returns the current value or a zero-initialized value if the
1150// iterator has advanced beyond the end of the collection.
1151func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource {
1152	if !iter.page.NotDone() {
1153		return PrivateLinkResource{}
1154	}
1155	return iter.page.Values()[iter.i]
1156}
1157
1158// Creates a new instance of the PrivateLinkResourceListResultIterator type.
1159func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator {
1160	return PrivateLinkResourceListResultIterator{page: page}
1161}
1162
1163// IsEmpty returns true if the ListResult contains no values.
1164func (plrlr PrivateLinkResourceListResult) IsEmpty() bool {
1165	return plrlr.Value == nil || len(*plrlr.Value) == 0
1166}
1167
1168// hasNextLink returns true if the NextLink is not empty.
1169func (plrlr PrivateLinkResourceListResult) hasNextLink() bool {
1170	return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0
1171}
1172
1173// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results.
1174// It returns nil if no more results exist.
1175func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
1176	if !plrlr.hasNextLink() {
1177		return nil, nil
1178	}
1179	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1180		autorest.AsJSON(),
1181		autorest.AsGet(),
1182		autorest.WithBaseURL(to.String(plrlr.NextLink)))
1183}
1184
1185// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values.
1186type PrivateLinkResourceListResultPage struct {
1187	fn    func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)
1188	plrlr PrivateLinkResourceListResult
1189}
1190
1191// NextWithContext advances to the next page of values.  If there was an error making
1192// the request the page does not advance and the error is returned.
1193func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
1194	if tracing.IsEnabled() {
1195		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext")
1196		defer func() {
1197			sc := -1
1198			if page.Response().Response.Response != nil {
1199				sc = page.Response().Response.Response.StatusCode
1200			}
1201			tracing.EndSpan(ctx, sc, err)
1202		}()
1203	}
1204	for {
1205		next, err := page.fn(ctx, page.plrlr)
1206		if err != nil {
1207			return err
1208		}
1209		page.plrlr = next
1210		if !next.hasNextLink() || !next.IsEmpty() {
1211			break
1212		}
1213	}
1214	return nil
1215}
1216
1217// Next advances to the next page of values.  If there was an error making
1218// the request the page does not advance and the error is returned.
1219// Deprecated: Use NextWithContext() instead.
1220func (page *PrivateLinkResourceListResultPage) Next() error {
1221	return page.NextWithContext(context.Background())
1222}
1223
1224// NotDone returns true if the page enumeration should be started or is not yet complete.
1225func (page PrivateLinkResourceListResultPage) NotDone() bool {
1226	return !page.plrlr.IsEmpty()
1227}
1228
1229// Response returns the raw server response from the last page request.
1230func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult {
1231	return page.plrlr
1232}
1233
1234// Values returns the slice of values for the current page or nil if there are no values.
1235func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource {
1236	if page.plrlr.IsEmpty() {
1237		return nil
1238	}
1239	return *page.plrlr.Value
1240}
1241
1242// Creates a new instance of the PrivateLinkResourceListResultPage type.
1243func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage {
1244	return PrivateLinkResourceListResultPage{
1245		fn:    getNextPage,
1246		plrlr: cur,
1247	}
1248}
1249
1250// PrivateLinkResourceProperties properties of a private link resource.
1251type PrivateLinkResourceProperties struct {
1252	// GroupID - READ-ONLY; The private link resource group id.
1253	GroupID *string `json:"groupId,omitempty"`
1254	// RequiredMembers - READ-ONLY; The private link resource required member names.
1255	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
1256}
1257
1258// PrivateLinkServiceConnectionStateProperty ...
1259type PrivateLinkServiceConnectionStateProperty struct {
1260	// Status - The private link service connection status.
1261	Status *string `json:"status,omitempty"`
1262	// Description - The private link service connection description.
1263	Description *string `json:"description,omitempty"`
1264	// ActionsRequired - READ-ONLY; The actions required for private link service connection.
1265	ActionsRequired *string `json:"actionsRequired,omitempty"`
1266}
1267
1268// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty.
1269func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
1270	objectMap := make(map[string]interface{})
1271	if plscsp.Status != nil {
1272		objectMap["status"] = plscsp.Status
1273	}
1274	if plscsp.Description != nil {
1275		objectMap["description"] = plscsp.Description
1276	}
1277	return json.Marshal(objectMap)
1278}
1279
1280// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
1281// have tags and a location
1282type ProxyResource struct {
1283	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1284	ID *string `json:"id,omitempty"`
1285	// Name - READ-ONLY; The name of the resource
1286	Name *string `json:"name,omitempty"`
1287	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1288	Type *string `json:"type,omitempty"`
1289}
1290
1291// QueryStatistic represents a Query Statistic.
1292type QueryStatistic struct {
1293	autorest.Response `json:"-"`
1294	// QueryStatisticProperties - The properties of a query statistic.
1295	*QueryStatisticProperties `json:"properties,omitempty"`
1296	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1297	ID *string `json:"id,omitempty"`
1298	// Name - READ-ONLY; The name of the resource
1299	Name *string `json:"name,omitempty"`
1300	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1301	Type *string `json:"type,omitempty"`
1302}
1303
1304// MarshalJSON is the custom marshaler for QueryStatistic.
1305func (qs QueryStatistic) MarshalJSON() ([]byte, error) {
1306	objectMap := make(map[string]interface{})
1307	if qs.QueryStatisticProperties != nil {
1308		objectMap["properties"] = qs.QueryStatisticProperties
1309	}
1310	return json.Marshal(objectMap)
1311}
1312
1313// UnmarshalJSON is the custom unmarshaler for QueryStatistic struct.
1314func (qs *QueryStatistic) UnmarshalJSON(body []byte) error {
1315	var m map[string]*json.RawMessage
1316	err := json.Unmarshal(body, &m)
1317	if err != nil {
1318		return err
1319	}
1320	for k, v := range m {
1321		switch k {
1322		case "properties":
1323			if v != nil {
1324				var queryStatisticProperties QueryStatisticProperties
1325				err = json.Unmarshal(*v, &queryStatisticProperties)
1326				if err != nil {
1327					return err
1328				}
1329				qs.QueryStatisticProperties = &queryStatisticProperties
1330			}
1331		case "id":
1332			if v != nil {
1333				var ID string
1334				err = json.Unmarshal(*v, &ID)
1335				if err != nil {
1336					return err
1337				}
1338				qs.ID = &ID
1339			}
1340		case "name":
1341			if v != nil {
1342				var name string
1343				err = json.Unmarshal(*v, &name)
1344				if err != nil {
1345					return err
1346				}
1347				qs.Name = &name
1348			}
1349		case "type":
1350			if v != nil {
1351				var typeVar string
1352				err = json.Unmarshal(*v, &typeVar)
1353				if err != nil {
1354					return err
1355				}
1356				qs.Type = &typeVar
1357			}
1358		}
1359	}
1360
1361	return nil
1362}
1363
1364// QueryStatisticProperties the properties of a query statistic.
1365type QueryStatisticProperties struct {
1366	// QueryID - Database query identifier.
1367	QueryID *string `json:"queryId,omitempty"`
1368	// StartTime - Observation start time.
1369	StartTime *date.Time `json:"startTime,omitempty"`
1370	// EndTime - Observation end time.
1371	EndTime *date.Time `json:"endTime,omitempty"`
1372	// AggregationFunction - Aggregation function name.
1373	AggregationFunction *string `json:"aggregationFunction,omitempty"`
1374	// DatabaseNames - The list of database names.
1375	DatabaseNames *[]string `json:"databaseNames,omitempty"`
1376	// QueryExecutionCount - Number of query executions in this time interval.
1377	QueryExecutionCount *int64 `json:"queryExecutionCount,omitempty"`
1378	// MetricName - Metric name.
1379	MetricName *string `json:"metricName,omitempty"`
1380	// MetricDisplayName - Metric display name.
1381	MetricDisplayName *string `json:"metricDisplayName,omitempty"`
1382	// MetricValue - Metric value.
1383	MetricValue *float64 `json:"metricValue,omitempty"`
1384	// MetricValueUnit - Metric value unit.
1385	MetricValueUnit *string `json:"metricValueUnit,omitempty"`
1386}
1387
1388// QueryText represents a Query Text.
1389type QueryText struct {
1390	autorest.Response `json:"-"`
1391	// QueryTextProperties - The properties of a query text.
1392	*QueryTextProperties `json:"properties,omitempty"`
1393	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1394	ID *string `json:"id,omitempty"`
1395	// Name - READ-ONLY; The name of the resource
1396	Name *string `json:"name,omitempty"`
1397	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1398	Type *string `json:"type,omitempty"`
1399}
1400
1401// MarshalJSON is the custom marshaler for QueryText.
1402func (qt QueryText) MarshalJSON() ([]byte, error) {
1403	objectMap := make(map[string]interface{})
1404	if qt.QueryTextProperties != nil {
1405		objectMap["properties"] = qt.QueryTextProperties
1406	}
1407	return json.Marshal(objectMap)
1408}
1409
1410// UnmarshalJSON is the custom unmarshaler for QueryText struct.
1411func (qt *QueryText) UnmarshalJSON(body []byte) error {
1412	var m map[string]*json.RawMessage
1413	err := json.Unmarshal(body, &m)
1414	if err != nil {
1415		return err
1416	}
1417	for k, v := range m {
1418		switch k {
1419		case "properties":
1420			if v != nil {
1421				var queryTextProperties QueryTextProperties
1422				err = json.Unmarshal(*v, &queryTextProperties)
1423				if err != nil {
1424					return err
1425				}
1426				qt.QueryTextProperties = &queryTextProperties
1427			}
1428		case "id":
1429			if v != nil {
1430				var ID string
1431				err = json.Unmarshal(*v, &ID)
1432				if err != nil {
1433					return err
1434				}
1435				qt.ID = &ID
1436			}
1437		case "name":
1438			if v != nil {
1439				var name string
1440				err = json.Unmarshal(*v, &name)
1441				if err != nil {
1442					return err
1443				}
1444				qt.Name = &name
1445			}
1446		case "type":
1447			if v != nil {
1448				var typeVar string
1449				err = json.Unmarshal(*v, &typeVar)
1450				if err != nil {
1451					return err
1452				}
1453				qt.Type = &typeVar
1454			}
1455		}
1456	}
1457
1458	return nil
1459}
1460
1461// QueryTextProperties the properties of a query text.
1462type QueryTextProperties struct {
1463	// QueryID - Query identifier unique to the server.
1464	QueryID *string `json:"queryId,omitempty"`
1465	// QueryText - Query text.
1466	QueryText *string `json:"queryText,omitempty"`
1467}
1468
1469// QueryTextsResultList a list of query texts.
1470type QueryTextsResultList struct {
1471	autorest.Response `json:"-"`
1472	// Value - READ-ONLY; The list of query texts.
1473	Value *[]QueryText `json:"value,omitempty"`
1474	// NextLink - READ-ONLY; Link to retrieve next page of results.
1475	NextLink *string `json:"nextLink,omitempty"`
1476}
1477
1478// QueryTextsResultListIterator provides access to a complete listing of QueryText values.
1479type QueryTextsResultListIterator struct {
1480	i    int
1481	page QueryTextsResultListPage
1482}
1483
1484// NextWithContext advances to the next value.  If there was an error making
1485// the request the iterator does not advance and the error is returned.
1486func (iter *QueryTextsResultListIterator) NextWithContext(ctx context.Context) (err error) {
1487	if tracing.IsEnabled() {
1488		ctx = tracing.StartSpan(ctx, fqdn+"/QueryTextsResultListIterator.NextWithContext")
1489		defer func() {
1490			sc := -1
1491			if iter.Response().Response.Response != nil {
1492				sc = iter.Response().Response.Response.StatusCode
1493			}
1494			tracing.EndSpan(ctx, sc, err)
1495		}()
1496	}
1497	iter.i++
1498	if iter.i < len(iter.page.Values()) {
1499		return nil
1500	}
1501	err = iter.page.NextWithContext(ctx)
1502	if err != nil {
1503		iter.i--
1504		return err
1505	}
1506	iter.i = 0
1507	return nil
1508}
1509
1510// Next advances to the next value.  If there was an error making
1511// the request the iterator does not advance and the error is returned.
1512// Deprecated: Use NextWithContext() instead.
1513func (iter *QueryTextsResultListIterator) Next() error {
1514	return iter.NextWithContext(context.Background())
1515}
1516
1517// NotDone returns true if the enumeration should be started or is not yet complete.
1518func (iter QueryTextsResultListIterator) NotDone() bool {
1519	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1520}
1521
1522// Response returns the raw server response from the last page request.
1523func (iter QueryTextsResultListIterator) Response() QueryTextsResultList {
1524	return iter.page.Response()
1525}
1526
1527// Value returns the current value or a zero-initialized value if the
1528// iterator has advanced beyond the end of the collection.
1529func (iter QueryTextsResultListIterator) Value() QueryText {
1530	if !iter.page.NotDone() {
1531		return QueryText{}
1532	}
1533	return iter.page.Values()[iter.i]
1534}
1535
1536// Creates a new instance of the QueryTextsResultListIterator type.
1537func NewQueryTextsResultListIterator(page QueryTextsResultListPage) QueryTextsResultListIterator {
1538	return QueryTextsResultListIterator{page: page}
1539}
1540
1541// IsEmpty returns true if the ListResult contains no values.
1542func (qtrl QueryTextsResultList) IsEmpty() bool {
1543	return qtrl.Value == nil || len(*qtrl.Value) == 0
1544}
1545
1546// hasNextLink returns true if the NextLink is not empty.
1547func (qtrl QueryTextsResultList) hasNextLink() bool {
1548	return qtrl.NextLink != nil && len(*qtrl.NextLink) != 0
1549}
1550
1551// queryTextsResultListPreparer prepares a request to retrieve the next set of results.
1552// It returns nil if no more results exist.
1553func (qtrl QueryTextsResultList) queryTextsResultListPreparer(ctx context.Context) (*http.Request, error) {
1554	if !qtrl.hasNextLink() {
1555		return nil, nil
1556	}
1557	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1558		autorest.AsJSON(),
1559		autorest.AsGet(),
1560		autorest.WithBaseURL(to.String(qtrl.NextLink)))
1561}
1562
1563// QueryTextsResultListPage contains a page of QueryText values.
1564type QueryTextsResultListPage struct {
1565	fn   func(context.Context, QueryTextsResultList) (QueryTextsResultList, error)
1566	qtrl QueryTextsResultList
1567}
1568
1569// NextWithContext advances to the next page of values.  If there was an error making
1570// the request the page does not advance and the error is returned.
1571func (page *QueryTextsResultListPage) NextWithContext(ctx context.Context) (err error) {
1572	if tracing.IsEnabled() {
1573		ctx = tracing.StartSpan(ctx, fqdn+"/QueryTextsResultListPage.NextWithContext")
1574		defer func() {
1575			sc := -1
1576			if page.Response().Response.Response != nil {
1577				sc = page.Response().Response.Response.StatusCode
1578			}
1579			tracing.EndSpan(ctx, sc, err)
1580		}()
1581	}
1582	for {
1583		next, err := page.fn(ctx, page.qtrl)
1584		if err != nil {
1585			return err
1586		}
1587		page.qtrl = next
1588		if !next.hasNextLink() || !next.IsEmpty() {
1589			break
1590		}
1591	}
1592	return nil
1593}
1594
1595// Next advances to the next page of values.  If there was an error making
1596// the request the page does not advance and the error is returned.
1597// Deprecated: Use NextWithContext() instead.
1598func (page *QueryTextsResultListPage) Next() error {
1599	return page.NextWithContext(context.Background())
1600}
1601
1602// NotDone returns true if the page enumeration should be started or is not yet complete.
1603func (page QueryTextsResultListPage) NotDone() bool {
1604	return !page.qtrl.IsEmpty()
1605}
1606
1607// Response returns the raw server response from the last page request.
1608func (page QueryTextsResultListPage) Response() QueryTextsResultList {
1609	return page.qtrl
1610}
1611
1612// Values returns the slice of values for the current page or nil if there are no values.
1613func (page QueryTextsResultListPage) Values() []QueryText {
1614	if page.qtrl.IsEmpty() {
1615		return nil
1616	}
1617	return *page.qtrl.Value
1618}
1619
1620// Creates a new instance of the QueryTextsResultListPage type.
1621func NewQueryTextsResultListPage(cur QueryTextsResultList, getNextPage func(context.Context, QueryTextsResultList) (QueryTextsResultList, error)) QueryTextsResultListPage {
1622	return QueryTextsResultListPage{
1623		fn:   getNextPage,
1624		qtrl: cur,
1625	}
1626}
1627
1628// RecommendationAction represents a Recommendation Action.
1629type RecommendationAction struct {
1630	autorest.Response `json:"-"`
1631	// RecommendationActionProperties - The properties of a recommendation action.
1632	*RecommendationActionProperties `json:"properties,omitempty"`
1633	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1634	ID *string `json:"id,omitempty"`
1635	// Name - READ-ONLY; The name of the resource
1636	Name *string `json:"name,omitempty"`
1637	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1638	Type *string `json:"type,omitempty"`
1639}
1640
1641// MarshalJSON is the custom marshaler for RecommendationAction.
1642func (ra RecommendationAction) MarshalJSON() ([]byte, error) {
1643	objectMap := make(map[string]interface{})
1644	if ra.RecommendationActionProperties != nil {
1645		objectMap["properties"] = ra.RecommendationActionProperties
1646	}
1647	return json.Marshal(objectMap)
1648}
1649
1650// UnmarshalJSON is the custom unmarshaler for RecommendationAction struct.
1651func (ra *RecommendationAction) UnmarshalJSON(body []byte) error {
1652	var m map[string]*json.RawMessage
1653	err := json.Unmarshal(body, &m)
1654	if err != nil {
1655		return err
1656	}
1657	for k, v := range m {
1658		switch k {
1659		case "properties":
1660			if v != nil {
1661				var recommendationActionProperties RecommendationActionProperties
1662				err = json.Unmarshal(*v, &recommendationActionProperties)
1663				if err != nil {
1664					return err
1665				}
1666				ra.RecommendationActionProperties = &recommendationActionProperties
1667			}
1668		case "id":
1669			if v != nil {
1670				var ID string
1671				err = json.Unmarshal(*v, &ID)
1672				if err != nil {
1673					return err
1674				}
1675				ra.ID = &ID
1676			}
1677		case "name":
1678			if v != nil {
1679				var name string
1680				err = json.Unmarshal(*v, &name)
1681				if err != nil {
1682					return err
1683				}
1684				ra.Name = &name
1685			}
1686		case "type":
1687			if v != nil {
1688				var typeVar string
1689				err = json.Unmarshal(*v, &typeVar)
1690				if err != nil {
1691					return err
1692				}
1693				ra.Type = &typeVar
1694			}
1695		}
1696	}
1697
1698	return nil
1699}
1700
1701// RecommendationActionProperties the properties of a recommendation action.
1702type RecommendationActionProperties struct {
1703	// AdvisorName - Advisor name.
1704	AdvisorName *string `json:"advisorName,omitempty"`
1705	// SessionID - Recommendation action session identifier.
1706	SessionID *string `json:"sessionId,omitempty"`
1707	// ActionID - Recommendation action identifier.
1708	ActionID *int32 `json:"actionId,omitempty"`
1709	// CreatedTime - Recommendation action creation time.
1710	CreatedTime *date.Time `json:"createdTime,omitempty"`
1711	// ExpirationTime - Recommendation action expiration time.
1712	ExpirationTime *date.Time `json:"expirationTime,omitempty"`
1713	// Reason - Recommendation action reason.
1714	Reason *string `json:"reason,omitempty"`
1715	// RecommendationType - Recommendation action type.
1716	RecommendationType *string `json:"recommendationType,omitempty"`
1717	// Details - Recommendation action details.
1718	Details map[string]*string `json:"details"`
1719}
1720
1721// MarshalJSON is the custom marshaler for RecommendationActionProperties.
1722func (rap RecommendationActionProperties) MarshalJSON() ([]byte, error) {
1723	objectMap := make(map[string]interface{})
1724	if rap.AdvisorName != nil {
1725		objectMap["advisorName"] = rap.AdvisorName
1726	}
1727	if rap.SessionID != nil {
1728		objectMap["sessionId"] = rap.SessionID
1729	}
1730	if rap.ActionID != nil {
1731		objectMap["actionId"] = rap.ActionID
1732	}
1733	if rap.CreatedTime != nil {
1734		objectMap["createdTime"] = rap.CreatedTime
1735	}
1736	if rap.ExpirationTime != nil {
1737		objectMap["expirationTime"] = rap.ExpirationTime
1738	}
1739	if rap.Reason != nil {
1740		objectMap["reason"] = rap.Reason
1741	}
1742	if rap.RecommendationType != nil {
1743		objectMap["recommendationType"] = rap.RecommendationType
1744	}
1745	if rap.Details != nil {
1746		objectMap["details"] = rap.Details
1747	}
1748	return json.Marshal(objectMap)
1749}
1750
1751// RecommendationActionsResultList a list of recommendation actions.
1752type RecommendationActionsResultList struct {
1753	autorest.Response `json:"-"`
1754	// Value - READ-ONLY; The list of recommendation action advisors.
1755	Value *[]RecommendationAction `json:"value,omitempty"`
1756	// NextLink - READ-ONLY; Link to retrieve next page of results.
1757	NextLink *string `json:"nextLink,omitempty"`
1758}
1759
1760// RecommendationActionsResultListIterator provides access to a complete listing of RecommendationAction
1761// values.
1762type RecommendationActionsResultListIterator struct {
1763	i    int
1764	page RecommendationActionsResultListPage
1765}
1766
1767// NextWithContext advances to the next value.  If there was an error making
1768// the request the iterator does not advance and the error is returned.
1769func (iter *RecommendationActionsResultListIterator) NextWithContext(ctx context.Context) (err error) {
1770	if tracing.IsEnabled() {
1771		ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationActionsResultListIterator.NextWithContext")
1772		defer func() {
1773			sc := -1
1774			if iter.Response().Response.Response != nil {
1775				sc = iter.Response().Response.Response.StatusCode
1776			}
1777			tracing.EndSpan(ctx, sc, err)
1778		}()
1779	}
1780	iter.i++
1781	if iter.i < len(iter.page.Values()) {
1782		return nil
1783	}
1784	err = iter.page.NextWithContext(ctx)
1785	if err != nil {
1786		iter.i--
1787		return err
1788	}
1789	iter.i = 0
1790	return nil
1791}
1792
1793// Next advances to the next value.  If there was an error making
1794// the request the iterator does not advance and the error is returned.
1795// Deprecated: Use NextWithContext() instead.
1796func (iter *RecommendationActionsResultListIterator) Next() error {
1797	return iter.NextWithContext(context.Background())
1798}
1799
1800// NotDone returns true if the enumeration should be started or is not yet complete.
1801func (iter RecommendationActionsResultListIterator) NotDone() bool {
1802	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1803}
1804
1805// Response returns the raw server response from the last page request.
1806func (iter RecommendationActionsResultListIterator) Response() RecommendationActionsResultList {
1807	return iter.page.Response()
1808}
1809
1810// Value returns the current value or a zero-initialized value if the
1811// iterator has advanced beyond the end of the collection.
1812func (iter RecommendationActionsResultListIterator) Value() RecommendationAction {
1813	if !iter.page.NotDone() {
1814		return RecommendationAction{}
1815	}
1816	return iter.page.Values()[iter.i]
1817}
1818
1819// Creates a new instance of the RecommendationActionsResultListIterator type.
1820func NewRecommendationActionsResultListIterator(page RecommendationActionsResultListPage) RecommendationActionsResultListIterator {
1821	return RecommendationActionsResultListIterator{page: page}
1822}
1823
1824// IsEmpty returns true if the ListResult contains no values.
1825func (rarl RecommendationActionsResultList) IsEmpty() bool {
1826	return rarl.Value == nil || len(*rarl.Value) == 0
1827}
1828
1829// hasNextLink returns true if the NextLink is not empty.
1830func (rarl RecommendationActionsResultList) hasNextLink() bool {
1831	return rarl.NextLink != nil && len(*rarl.NextLink) != 0
1832}
1833
1834// recommendationActionsResultListPreparer prepares a request to retrieve the next set of results.
1835// It returns nil if no more results exist.
1836func (rarl RecommendationActionsResultList) recommendationActionsResultListPreparer(ctx context.Context) (*http.Request, error) {
1837	if !rarl.hasNextLink() {
1838		return nil, nil
1839	}
1840	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1841		autorest.AsJSON(),
1842		autorest.AsGet(),
1843		autorest.WithBaseURL(to.String(rarl.NextLink)))
1844}
1845
1846// RecommendationActionsResultListPage contains a page of RecommendationAction values.
1847type RecommendationActionsResultListPage struct {
1848	fn   func(context.Context, RecommendationActionsResultList) (RecommendationActionsResultList, error)
1849	rarl RecommendationActionsResultList
1850}
1851
1852// NextWithContext advances to the next page of values.  If there was an error making
1853// the request the page does not advance and the error is returned.
1854func (page *RecommendationActionsResultListPage) NextWithContext(ctx context.Context) (err error) {
1855	if tracing.IsEnabled() {
1856		ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationActionsResultListPage.NextWithContext")
1857		defer func() {
1858			sc := -1
1859			if page.Response().Response.Response != nil {
1860				sc = page.Response().Response.Response.StatusCode
1861			}
1862			tracing.EndSpan(ctx, sc, err)
1863		}()
1864	}
1865	for {
1866		next, err := page.fn(ctx, page.rarl)
1867		if err != nil {
1868			return err
1869		}
1870		page.rarl = next
1871		if !next.hasNextLink() || !next.IsEmpty() {
1872			break
1873		}
1874	}
1875	return nil
1876}
1877
1878// Next advances to the next page of values.  If there was an error making
1879// the request the page does not advance and the error is returned.
1880// Deprecated: Use NextWithContext() instead.
1881func (page *RecommendationActionsResultListPage) Next() error {
1882	return page.NextWithContext(context.Background())
1883}
1884
1885// NotDone returns true if the page enumeration should be started or is not yet complete.
1886func (page RecommendationActionsResultListPage) NotDone() bool {
1887	return !page.rarl.IsEmpty()
1888}
1889
1890// Response returns the raw server response from the last page request.
1891func (page RecommendationActionsResultListPage) Response() RecommendationActionsResultList {
1892	return page.rarl
1893}
1894
1895// Values returns the slice of values for the current page or nil if there are no values.
1896func (page RecommendationActionsResultListPage) Values() []RecommendationAction {
1897	if page.rarl.IsEmpty() {
1898		return nil
1899	}
1900	return *page.rarl.Value
1901}
1902
1903// Creates a new instance of the RecommendationActionsResultListPage type.
1904func NewRecommendationActionsResultListPage(cur RecommendationActionsResultList, getNextPage func(context.Context, RecommendationActionsResultList) (RecommendationActionsResultList, error)) RecommendationActionsResultListPage {
1905	return RecommendationActionsResultListPage{
1906		fn:   getNextPage,
1907		rarl: cur,
1908	}
1909}
1910
1911// RecommendedActionSessionsOperationStatus recommendation action session operation status.
1912type RecommendedActionSessionsOperationStatus struct {
1913	autorest.Response `json:"-"`
1914	// Name - Operation identifier.
1915	Name *string `json:"name,omitempty"`
1916	// StartTime - Operation start time.
1917	StartTime *date.Time `json:"startTime,omitempty"`
1918	// Status - Operation status.
1919	Status *string `json:"status,omitempty"`
1920}
1921
1922// Resource common fields that are returned in the response for all Azure Resource Manager resources
1923type Resource struct {
1924	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1925	ID *string `json:"id,omitempty"`
1926	// Name - READ-ONLY; The name of the resource
1927	Name *string `json:"name,omitempty"`
1928	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1929	Type *string `json:"type,omitempty"`
1930}
1931
1932// SecurityAlertPolicyProperties properties of a security alert policy.
1933type SecurityAlertPolicyProperties struct {
1934	// State - Specifies the state of the policy, whether it is enabled or disabled. Possible values include: 'ServerSecurityAlertPolicyStateEnabled', 'ServerSecurityAlertPolicyStateDisabled'
1935	State ServerSecurityAlertPolicyState `json:"state,omitempty"`
1936	// DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly
1937	DisabledAlerts *[]string `json:"disabledAlerts,omitempty"`
1938	// EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent.
1939	EmailAddresses *[]string `json:"emailAddresses,omitempty"`
1940	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators.
1941	EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"`
1942	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
1943	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
1944	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account.
1945	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
1946	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
1947	RetentionDays *int32 `json:"retentionDays,omitempty"`
1948}
1949
1950// Server represents a server.
1951type Server struct {
1952	autorest.Response `json:"-"`
1953	// Sku - The SKU (pricing tier) of the server.
1954	Sku *Sku `json:"sku,omitempty"`
1955	// ServerProperties - Properties of the server.
1956	*ServerProperties `json:"properties,omitempty"`
1957	// Tags - Resource tags.
1958	Tags map[string]*string `json:"tags"`
1959	// Location - The geo-location where the resource lives
1960	Location *string `json:"location,omitempty"`
1961	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1962	ID *string `json:"id,omitempty"`
1963	// Name - READ-ONLY; The name of the resource
1964	Name *string `json:"name,omitempty"`
1965	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1966	Type *string `json:"type,omitempty"`
1967}
1968
1969// MarshalJSON is the custom marshaler for Server.
1970func (s Server) MarshalJSON() ([]byte, error) {
1971	objectMap := make(map[string]interface{})
1972	if s.Sku != nil {
1973		objectMap["sku"] = s.Sku
1974	}
1975	if s.ServerProperties != nil {
1976		objectMap["properties"] = s.ServerProperties
1977	}
1978	if s.Tags != nil {
1979		objectMap["tags"] = s.Tags
1980	}
1981	if s.Location != nil {
1982		objectMap["location"] = s.Location
1983	}
1984	return json.Marshal(objectMap)
1985}
1986
1987// UnmarshalJSON is the custom unmarshaler for Server struct.
1988func (s *Server) UnmarshalJSON(body []byte) error {
1989	var m map[string]*json.RawMessage
1990	err := json.Unmarshal(body, &m)
1991	if err != nil {
1992		return err
1993	}
1994	for k, v := range m {
1995		switch k {
1996		case "sku":
1997			if v != nil {
1998				var sku Sku
1999				err = json.Unmarshal(*v, &sku)
2000				if err != nil {
2001					return err
2002				}
2003				s.Sku = &sku
2004			}
2005		case "properties":
2006			if v != nil {
2007				var serverProperties ServerProperties
2008				err = json.Unmarshal(*v, &serverProperties)
2009				if err != nil {
2010					return err
2011				}
2012				s.ServerProperties = &serverProperties
2013			}
2014		case "tags":
2015			if v != nil {
2016				var tags map[string]*string
2017				err = json.Unmarshal(*v, &tags)
2018				if err != nil {
2019					return err
2020				}
2021				s.Tags = tags
2022			}
2023		case "location":
2024			if v != nil {
2025				var location string
2026				err = json.Unmarshal(*v, &location)
2027				if err != nil {
2028					return err
2029				}
2030				s.Location = &location
2031			}
2032		case "id":
2033			if v != nil {
2034				var ID string
2035				err = json.Unmarshal(*v, &ID)
2036				if err != nil {
2037					return err
2038				}
2039				s.ID = &ID
2040			}
2041		case "name":
2042			if v != nil {
2043				var name string
2044				err = json.Unmarshal(*v, &name)
2045				if err != nil {
2046					return err
2047				}
2048				s.Name = &name
2049			}
2050		case "type":
2051			if v != nil {
2052				var typeVar string
2053				err = json.Unmarshal(*v, &typeVar)
2054				if err != nil {
2055					return err
2056				}
2057				s.Type = &typeVar
2058			}
2059		}
2060	}
2061
2062	return nil
2063}
2064
2065// ServerForCreate represents a server to be created.
2066type ServerForCreate struct {
2067	// Sku - The SKU (pricing tier) of the server.
2068	Sku *Sku `json:"sku,omitempty"`
2069	// Properties - Properties of the server.
2070	Properties BasicServerPropertiesForCreate `json:"properties,omitempty"`
2071	// Location - The location the resource resides in.
2072	Location *string `json:"location,omitempty"`
2073	// Tags - Application-specific metadata in the form of key-value pairs.
2074	Tags map[string]*string `json:"tags"`
2075}
2076
2077// MarshalJSON is the custom marshaler for ServerForCreate.
2078func (sfc ServerForCreate) MarshalJSON() ([]byte, error) {
2079	objectMap := make(map[string]interface{})
2080	if sfc.Sku != nil {
2081		objectMap["sku"] = sfc.Sku
2082	}
2083	objectMap["properties"] = sfc.Properties
2084	if sfc.Location != nil {
2085		objectMap["location"] = sfc.Location
2086	}
2087	if sfc.Tags != nil {
2088		objectMap["tags"] = sfc.Tags
2089	}
2090	return json.Marshal(objectMap)
2091}
2092
2093// UnmarshalJSON is the custom unmarshaler for ServerForCreate struct.
2094func (sfc *ServerForCreate) UnmarshalJSON(body []byte) error {
2095	var m map[string]*json.RawMessage
2096	err := json.Unmarshal(body, &m)
2097	if err != nil {
2098		return err
2099	}
2100	for k, v := range m {
2101		switch k {
2102		case "sku":
2103			if v != nil {
2104				var sku Sku
2105				err = json.Unmarshal(*v, &sku)
2106				if err != nil {
2107					return err
2108				}
2109				sfc.Sku = &sku
2110			}
2111		case "properties":
2112			if v != nil {
2113				properties, err := unmarshalBasicServerPropertiesForCreate(*v)
2114				if err != nil {
2115					return err
2116				}
2117				sfc.Properties = properties
2118			}
2119		case "location":
2120			if v != nil {
2121				var location string
2122				err = json.Unmarshal(*v, &location)
2123				if err != nil {
2124					return err
2125				}
2126				sfc.Location = &location
2127			}
2128		case "tags":
2129			if v != nil {
2130				var tags map[string]*string
2131				err = json.Unmarshal(*v, &tags)
2132				if err != nil {
2133					return err
2134				}
2135				sfc.Tags = tags
2136			}
2137		}
2138	}
2139
2140	return nil
2141}
2142
2143// ServerListResult a list of servers.
2144type ServerListResult struct {
2145	autorest.Response `json:"-"`
2146	// Value - The list of servers
2147	Value *[]Server `json:"value,omitempty"`
2148}
2149
2150// ServerPrivateEndpointConnection a private endpoint connection under a server
2151type ServerPrivateEndpointConnection struct {
2152	// ID - READ-ONLY; Resource Id of the private endpoint connection.
2153	ID *string `json:"id,omitempty"`
2154	// Properties - READ-ONLY; Private endpoint connection properties
2155	Properties *ServerPrivateEndpointConnectionProperties `json:"properties,omitempty"`
2156}
2157
2158// ServerPrivateEndpointConnectionProperties properties of a private endpoint connection.
2159type ServerPrivateEndpointConnectionProperties struct {
2160	// PrivateEndpoint - Private endpoint which the connection belongs to.
2161	PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"`
2162	// PrivateLinkServiceConnectionState - Connection state of the private endpoint connection.
2163	PrivateLinkServiceConnectionState *ServerPrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`
2164	// ProvisioningState - READ-ONLY; State of the private endpoint connection. Possible values include: 'Approving', 'Ready', 'Dropping', 'Failed', 'Rejecting'
2165	ProvisioningState PrivateEndpointProvisioningState `json:"provisioningState,omitempty"`
2166}
2167
2168// MarshalJSON is the custom marshaler for ServerPrivateEndpointConnectionProperties.
2169func (specp ServerPrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
2170	objectMap := make(map[string]interface{})
2171	if specp.PrivateEndpoint != nil {
2172		objectMap["privateEndpoint"] = specp.PrivateEndpoint
2173	}
2174	if specp.PrivateLinkServiceConnectionState != nil {
2175		objectMap["privateLinkServiceConnectionState"] = specp.PrivateLinkServiceConnectionState
2176	}
2177	return json.Marshal(objectMap)
2178}
2179
2180// ServerPrivateLinkServiceConnectionStateProperty ...
2181type ServerPrivateLinkServiceConnectionStateProperty struct {
2182	// Status - The private link service connection status. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected'
2183	Status PrivateLinkServiceConnectionStateStatus `json:"status,omitempty"`
2184	// Description - The private link service connection description.
2185	Description *string `json:"description,omitempty"`
2186	// ActionsRequired - READ-ONLY; The actions required for private link service connection. Possible values include: 'None'
2187	ActionsRequired PrivateLinkServiceConnectionStateActionsRequire `json:"actionsRequired,omitempty"`
2188}
2189
2190// MarshalJSON is the custom marshaler for ServerPrivateLinkServiceConnectionStateProperty.
2191func (splscsp ServerPrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
2192	objectMap := make(map[string]interface{})
2193	if splscsp.Status != "" {
2194		objectMap["status"] = splscsp.Status
2195	}
2196	if splscsp.Description != nil {
2197		objectMap["description"] = splscsp.Description
2198	}
2199	return json.Marshal(objectMap)
2200}
2201
2202// ServerProperties the properties of a server.
2203type ServerProperties struct {
2204	// AdministratorLogin - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
2205	AdministratorLogin *string `json:"administratorLogin,omitempty"`
2206	// Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven'
2207	Version ServerVersion `json:"version,omitempty"`
2208	// SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled'
2209	SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"`
2210	// UserVisibleState - A state of a server that is visible to user. Possible values include: 'ServerStateReady', 'ServerStateDropping', 'ServerStateDisabled'
2211	UserVisibleState ServerState `json:"userVisibleState,omitempty"`
2212	// FullyQualifiedDomainName - The fully qualified domain name of a server.
2213	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
2214	// EarliestRestoreDate - Earliest restore point creation time (ISO8601 format)
2215	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
2216	// StorageProfile - Storage profile of a server.
2217	StorageProfile *StorageProfile `json:"storageProfile,omitempty"`
2218	// ReplicationRole - The replication role of the server.
2219	ReplicationRole *string `json:"replicationRole,omitempty"`
2220	// MasterServerID - The master server id of a replica server.
2221	MasterServerID *string `json:"masterServerId,omitempty"`
2222	// ReplicaCapacity - The maximum number of replicas that a master server can have.
2223	ReplicaCapacity *int32 `json:"replicaCapacity,omitempty"`
2224	// PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled'
2225	PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"`
2226	// PrivateEndpointConnections - READ-ONLY; List of private endpoint connections on a server
2227	PrivateEndpointConnections *[]ServerPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
2228}
2229
2230// MarshalJSON is the custom marshaler for ServerProperties.
2231func (sp ServerProperties) MarshalJSON() ([]byte, error) {
2232	objectMap := make(map[string]interface{})
2233	if sp.AdministratorLogin != nil {
2234		objectMap["administratorLogin"] = sp.AdministratorLogin
2235	}
2236	if sp.Version != "" {
2237		objectMap["version"] = sp.Version
2238	}
2239	if sp.SslEnforcement != "" {
2240		objectMap["sslEnforcement"] = sp.SslEnforcement
2241	}
2242	if sp.UserVisibleState != "" {
2243		objectMap["userVisibleState"] = sp.UserVisibleState
2244	}
2245	if sp.FullyQualifiedDomainName != nil {
2246		objectMap["fullyQualifiedDomainName"] = sp.FullyQualifiedDomainName
2247	}
2248	if sp.EarliestRestoreDate != nil {
2249		objectMap["earliestRestoreDate"] = sp.EarliestRestoreDate
2250	}
2251	if sp.StorageProfile != nil {
2252		objectMap["storageProfile"] = sp.StorageProfile
2253	}
2254	if sp.ReplicationRole != nil {
2255		objectMap["replicationRole"] = sp.ReplicationRole
2256	}
2257	if sp.MasterServerID != nil {
2258		objectMap["masterServerId"] = sp.MasterServerID
2259	}
2260	if sp.ReplicaCapacity != nil {
2261		objectMap["replicaCapacity"] = sp.ReplicaCapacity
2262	}
2263	if sp.PublicNetworkAccess != "" {
2264		objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess
2265	}
2266	return json.Marshal(objectMap)
2267}
2268
2269// BasicServerPropertiesForCreate the properties used to create a new server.
2270type BasicServerPropertiesForCreate interface {
2271	AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool)
2272	AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool)
2273	AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool)
2274	AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool)
2275	AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool)
2276}
2277
2278// ServerPropertiesForCreate the properties used to create a new server.
2279type ServerPropertiesForCreate struct {
2280	// Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven'
2281	Version ServerVersion `json:"version,omitempty"`
2282	// SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled'
2283	SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"`
2284	// PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled'
2285	PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"`
2286	// StorageProfile - Storage profile of a server.
2287	StorageProfile *StorageProfile `json:"storageProfile,omitempty"`
2288	// CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica'
2289	CreateMode CreateMode `json:"createMode,omitempty"`
2290}
2291
2292func unmarshalBasicServerPropertiesForCreate(body []byte) (BasicServerPropertiesForCreate, error) {
2293	var m map[string]interface{}
2294	err := json.Unmarshal(body, &m)
2295	if err != nil {
2296		return nil, err
2297	}
2298
2299	switch m["createMode"] {
2300	case string(CreateModeDefault):
2301		var spfdc ServerPropertiesForDefaultCreate
2302		err := json.Unmarshal(body, &spfdc)
2303		return spfdc, err
2304	case string(CreateModePointInTimeRestore):
2305		var spfr ServerPropertiesForRestore
2306		err := json.Unmarshal(body, &spfr)
2307		return spfr, err
2308	case string(CreateModeGeoRestore):
2309		var spfgr ServerPropertiesForGeoRestore
2310		err := json.Unmarshal(body, &spfgr)
2311		return spfgr, err
2312	case string(CreateModeReplica):
2313		var spfr ServerPropertiesForReplica
2314		err := json.Unmarshal(body, &spfr)
2315		return spfr, err
2316	default:
2317		var spfc ServerPropertiesForCreate
2318		err := json.Unmarshal(body, &spfc)
2319		return spfc, err
2320	}
2321}
2322func unmarshalBasicServerPropertiesForCreateArray(body []byte) ([]BasicServerPropertiesForCreate, error) {
2323	var rawMessages []*json.RawMessage
2324	err := json.Unmarshal(body, &rawMessages)
2325	if err != nil {
2326		return nil, err
2327	}
2328
2329	spfcArray := make([]BasicServerPropertiesForCreate, len(rawMessages))
2330
2331	for index, rawMessage := range rawMessages {
2332		spfc, err := unmarshalBasicServerPropertiesForCreate(*rawMessage)
2333		if err != nil {
2334			return nil, err
2335		}
2336		spfcArray[index] = spfc
2337	}
2338	return spfcArray, nil
2339}
2340
2341// MarshalJSON is the custom marshaler for ServerPropertiesForCreate.
2342func (spfc ServerPropertiesForCreate) MarshalJSON() ([]byte, error) {
2343	spfc.CreateMode = CreateModeServerPropertiesForCreate
2344	objectMap := make(map[string]interface{})
2345	if spfc.Version != "" {
2346		objectMap["version"] = spfc.Version
2347	}
2348	if spfc.SslEnforcement != "" {
2349		objectMap["sslEnforcement"] = spfc.SslEnforcement
2350	}
2351	if spfc.PublicNetworkAccess != "" {
2352		objectMap["publicNetworkAccess"] = spfc.PublicNetworkAccess
2353	}
2354	if spfc.StorageProfile != nil {
2355		objectMap["storageProfile"] = spfc.StorageProfile
2356	}
2357	if spfc.CreateMode != "" {
2358		objectMap["createMode"] = spfc.CreateMode
2359	}
2360	return json.Marshal(objectMap)
2361}
2362
2363// AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate.
2364func (spfc ServerPropertiesForCreate) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) {
2365	return nil, false
2366}
2367
2368// AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate.
2369func (spfc ServerPropertiesForCreate) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) {
2370	return nil, false
2371}
2372
2373// AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate.
2374func (spfc ServerPropertiesForCreate) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) {
2375	return nil, false
2376}
2377
2378// AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate.
2379func (spfc ServerPropertiesForCreate) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) {
2380	return nil, false
2381}
2382
2383// AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate.
2384func (spfc ServerPropertiesForCreate) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) {
2385	return &spfc, true
2386}
2387
2388// AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForCreate.
2389func (spfc ServerPropertiesForCreate) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) {
2390	return &spfc, true
2391}
2392
2393// ServerPropertiesForDefaultCreate the properties used to create a new server.
2394type ServerPropertiesForDefaultCreate struct {
2395	// AdministratorLogin - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
2396	AdministratorLogin *string `json:"administratorLogin,omitempty"`
2397	// AdministratorLoginPassword - The password of the administrator login.
2398	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
2399	// Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven'
2400	Version ServerVersion `json:"version,omitempty"`
2401	// SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled'
2402	SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"`
2403	// PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled'
2404	PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"`
2405	// StorageProfile - Storage profile of a server.
2406	StorageProfile *StorageProfile `json:"storageProfile,omitempty"`
2407	// CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica'
2408	CreateMode CreateMode `json:"createMode,omitempty"`
2409}
2410
2411// MarshalJSON is the custom marshaler for ServerPropertiesForDefaultCreate.
2412func (spfdc ServerPropertiesForDefaultCreate) MarshalJSON() ([]byte, error) {
2413	spfdc.CreateMode = CreateModeDefault
2414	objectMap := make(map[string]interface{})
2415	if spfdc.AdministratorLogin != nil {
2416		objectMap["administratorLogin"] = spfdc.AdministratorLogin
2417	}
2418	if spfdc.AdministratorLoginPassword != nil {
2419		objectMap["administratorLoginPassword"] = spfdc.AdministratorLoginPassword
2420	}
2421	if spfdc.Version != "" {
2422		objectMap["version"] = spfdc.Version
2423	}
2424	if spfdc.SslEnforcement != "" {
2425		objectMap["sslEnforcement"] = spfdc.SslEnforcement
2426	}
2427	if spfdc.PublicNetworkAccess != "" {
2428		objectMap["publicNetworkAccess"] = spfdc.PublicNetworkAccess
2429	}
2430	if spfdc.StorageProfile != nil {
2431		objectMap["storageProfile"] = spfdc.StorageProfile
2432	}
2433	if spfdc.CreateMode != "" {
2434		objectMap["createMode"] = spfdc.CreateMode
2435	}
2436	return json.Marshal(objectMap)
2437}
2438
2439// AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate.
2440func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) {
2441	return &spfdc, true
2442}
2443
2444// AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate.
2445func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) {
2446	return nil, false
2447}
2448
2449// AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate.
2450func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) {
2451	return nil, false
2452}
2453
2454// AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate.
2455func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) {
2456	return nil, false
2457}
2458
2459// AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate.
2460func (spfdc ServerPropertiesForDefaultCreate) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) {
2461	return nil, false
2462}
2463
2464// AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForDefaultCreate.
2465func (spfdc ServerPropertiesForDefaultCreate) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) {
2466	return &spfdc, true
2467}
2468
2469// ServerPropertiesForGeoRestore the properties used to create a new server by restoring to a different
2470// region from a geo replicated backup.
2471type ServerPropertiesForGeoRestore struct {
2472	// SourceServerID - The source server id to restore from.
2473	SourceServerID *string `json:"sourceServerId,omitempty"`
2474	// Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven'
2475	Version ServerVersion `json:"version,omitempty"`
2476	// SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled'
2477	SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"`
2478	// PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled'
2479	PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"`
2480	// StorageProfile - Storage profile of a server.
2481	StorageProfile *StorageProfile `json:"storageProfile,omitempty"`
2482	// CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica'
2483	CreateMode CreateMode `json:"createMode,omitempty"`
2484}
2485
2486// MarshalJSON is the custom marshaler for ServerPropertiesForGeoRestore.
2487func (spfgr ServerPropertiesForGeoRestore) MarshalJSON() ([]byte, error) {
2488	spfgr.CreateMode = CreateModeGeoRestore
2489	objectMap := make(map[string]interface{})
2490	if spfgr.SourceServerID != nil {
2491		objectMap["sourceServerId"] = spfgr.SourceServerID
2492	}
2493	if spfgr.Version != "" {
2494		objectMap["version"] = spfgr.Version
2495	}
2496	if spfgr.SslEnforcement != "" {
2497		objectMap["sslEnforcement"] = spfgr.SslEnforcement
2498	}
2499	if spfgr.PublicNetworkAccess != "" {
2500		objectMap["publicNetworkAccess"] = spfgr.PublicNetworkAccess
2501	}
2502	if spfgr.StorageProfile != nil {
2503		objectMap["storageProfile"] = spfgr.StorageProfile
2504	}
2505	if spfgr.CreateMode != "" {
2506		objectMap["createMode"] = spfgr.CreateMode
2507	}
2508	return json.Marshal(objectMap)
2509}
2510
2511// AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore.
2512func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) {
2513	return nil, false
2514}
2515
2516// AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore.
2517func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) {
2518	return nil, false
2519}
2520
2521// AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore.
2522func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) {
2523	return &spfgr, true
2524}
2525
2526// AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore.
2527func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) {
2528	return nil, false
2529}
2530
2531// AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore.
2532func (spfgr ServerPropertiesForGeoRestore) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) {
2533	return nil, false
2534}
2535
2536// AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForGeoRestore.
2537func (spfgr ServerPropertiesForGeoRestore) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) {
2538	return &spfgr, true
2539}
2540
2541// ServerPropertiesForReplica the properties to create a new replica.
2542type ServerPropertiesForReplica struct {
2543	// SourceServerID - The master server id to create replica from.
2544	SourceServerID *string `json:"sourceServerId,omitempty"`
2545	// Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven'
2546	Version ServerVersion `json:"version,omitempty"`
2547	// SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled'
2548	SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"`
2549	// PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled'
2550	PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"`
2551	// StorageProfile - Storage profile of a server.
2552	StorageProfile *StorageProfile `json:"storageProfile,omitempty"`
2553	// CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica'
2554	CreateMode CreateMode `json:"createMode,omitempty"`
2555}
2556
2557// MarshalJSON is the custom marshaler for ServerPropertiesForReplica.
2558func (spfr ServerPropertiesForReplica) MarshalJSON() ([]byte, error) {
2559	spfr.CreateMode = CreateModeReplica
2560	objectMap := make(map[string]interface{})
2561	if spfr.SourceServerID != nil {
2562		objectMap["sourceServerId"] = spfr.SourceServerID
2563	}
2564	if spfr.Version != "" {
2565		objectMap["version"] = spfr.Version
2566	}
2567	if spfr.SslEnforcement != "" {
2568		objectMap["sslEnforcement"] = spfr.SslEnforcement
2569	}
2570	if spfr.PublicNetworkAccess != "" {
2571		objectMap["publicNetworkAccess"] = spfr.PublicNetworkAccess
2572	}
2573	if spfr.StorageProfile != nil {
2574		objectMap["storageProfile"] = spfr.StorageProfile
2575	}
2576	if spfr.CreateMode != "" {
2577		objectMap["createMode"] = spfr.CreateMode
2578	}
2579	return json.Marshal(objectMap)
2580}
2581
2582// AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica.
2583func (spfr ServerPropertiesForReplica) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) {
2584	return nil, false
2585}
2586
2587// AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica.
2588func (spfr ServerPropertiesForReplica) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) {
2589	return nil, false
2590}
2591
2592// AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica.
2593func (spfr ServerPropertiesForReplica) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) {
2594	return nil, false
2595}
2596
2597// AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica.
2598func (spfr ServerPropertiesForReplica) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) {
2599	return &spfr, true
2600}
2601
2602// AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica.
2603func (spfr ServerPropertiesForReplica) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) {
2604	return nil, false
2605}
2606
2607// AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForReplica.
2608func (spfr ServerPropertiesForReplica) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) {
2609	return &spfr, true
2610}
2611
2612// ServerPropertiesForRestore the properties used to create a new server by restoring from a backup.
2613type ServerPropertiesForRestore struct {
2614	// SourceServerID - The source server id to restore from.
2615	SourceServerID *string `json:"sourceServerId,omitempty"`
2616	// RestorePointInTime - Restore point creation time (ISO8601 format), specifying the time to restore from.
2617	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
2618	// Version - Server version. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven'
2619	Version ServerVersion `json:"version,omitempty"`
2620	// SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled'
2621	SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"`
2622	// PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled'
2623	PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"`
2624	// StorageProfile - Storage profile of a server.
2625	StorageProfile *StorageProfile `json:"storageProfile,omitempty"`
2626	// CreateMode - Possible values include: 'CreateModeServerPropertiesForCreate', 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeGeoRestore', 'CreateModeReplica'
2627	CreateMode CreateMode `json:"createMode,omitempty"`
2628}
2629
2630// MarshalJSON is the custom marshaler for ServerPropertiesForRestore.
2631func (spfr ServerPropertiesForRestore) MarshalJSON() ([]byte, error) {
2632	spfr.CreateMode = CreateModePointInTimeRestore
2633	objectMap := make(map[string]interface{})
2634	if spfr.SourceServerID != nil {
2635		objectMap["sourceServerId"] = spfr.SourceServerID
2636	}
2637	if spfr.RestorePointInTime != nil {
2638		objectMap["restorePointInTime"] = spfr.RestorePointInTime
2639	}
2640	if spfr.Version != "" {
2641		objectMap["version"] = spfr.Version
2642	}
2643	if spfr.SslEnforcement != "" {
2644		objectMap["sslEnforcement"] = spfr.SslEnforcement
2645	}
2646	if spfr.PublicNetworkAccess != "" {
2647		objectMap["publicNetworkAccess"] = spfr.PublicNetworkAccess
2648	}
2649	if spfr.StorageProfile != nil {
2650		objectMap["storageProfile"] = spfr.StorageProfile
2651	}
2652	if spfr.CreateMode != "" {
2653		objectMap["createMode"] = spfr.CreateMode
2654	}
2655	return json.Marshal(objectMap)
2656}
2657
2658// AsServerPropertiesForDefaultCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore.
2659func (spfr ServerPropertiesForRestore) AsServerPropertiesForDefaultCreate() (*ServerPropertiesForDefaultCreate, bool) {
2660	return nil, false
2661}
2662
2663// AsServerPropertiesForRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore.
2664func (spfr ServerPropertiesForRestore) AsServerPropertiesForRestore() (*ServerPropertiesForRestore, bool) {
2665	return &spfr, true
2666}
2667
2668// AsServerPropertiesForGeoRestore is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore.
2669func (spfr ServerPropertiesForRestore) AsServerPropertiesForGeoRestore() (*ServerPropertiesForGeoRestore, bool) {
2670	return nil, false
2671}
2672
2673// AsServerPropertiesForReplica is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore.
2674func (spfr ServerPropertiesForRestore) AsServerPropertiesForReplica() (*ServerPropertiesForReplica, bool) {
2675	return nil, false
2676}
2677
2678// AsServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore.
2679func (spfr ServerPropertiesForRestore) AsServerPropertiesForCreate() (*ServerPropertiesForCreate, bool) {
2680	return nil, false
2681}
2682
2683// AsBasicServerPropertiesForCreate is the BasicServerPropertiesForCreate implementation for ServerPropertiesForRestore.
2684func (spfr ServerPropertiesForRestore) AsBasicServerPropertiesForCreate() (BasicServerPropertiesForCreate, bool) {
2685	return &spfr, true
2686}
2687
2688// ServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running
2689// operation.
2690type ServersCreateFuture struct {
2691	azure.FutureAPI
2692	// Result returns the result of the asynchronous operation.
2693	// If the operation has not completed it will return an error.
2694	Result func(ServersClient) (Server, error)
2695}
2696
2697// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
2698// operation.
2699type ServersDeleteFuture struct {
2700	azure.FutureAPI
2701	// Result returns the result of the asynchronous operation.
2702	// If the operation has not completed it will return an error.
2703	Result func(ServersClient) (autorest.Response, error)
2704}
2705
2706// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
2707// of a long-running operation.
2708type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct {
2709	azure.FutureAPI
2710	// Result returns the result of the asynchronous operation.
2711	// If the operation has not completed it will return an error.
2712	Result func(ServerSecurityAlertPoliciesClient) (ServerSecurityAlertPolicy, error)
2713}
2714
2715// ServerSecurityAlertPolicy a server security alert policy.
2716type ServerSecurityAlertPolicy struct {
2717	autorest.Response `json:"-"`
2718	// SecurityAlertPolicyProperties - Resource properties.
2719	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
2720	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2721	ID *string `json:"id,omitempty"`
2722	// Name - READ-ONLY; The name of the resource
2723	Name *string `json:"name,omitempty"`
2724	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
2725	Type *string `json:"type,omitempty"`
2726}
2727
2728// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicy.
2729func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
2730	objectMap := make(map[string]interface{})
2731	if ssap.SecurityAlertPolicyProperties != nil {
2732		objectMap["properties"] = ssap.SecurityAlertPolicyProperties
2733	}
2734	return json.Marshal(objectMap)
2735}
2736
2737// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct.
2738func (ssap *ServerSecurityAlertPolicy) 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 securityAlertPolicyProperties SecurityAlertPolicyProperties
2749				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
2750				if err != nil {
2751					return err
2752				}
2753				ssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
2754			}
2755		case "id":
2756			if v != nil {
2757				var ID string
2758				err = json.Unmarshal(*v, &ID)
2759				if err != nil {
2760					return err
2761				}
2762				ssap.ID = &ID
2763			}
2764		case "name":
2765			if v != nil {
2766				var name string
2767				err = json.Unmarshal(*v, &name)
2768				if err != nil {
2769					return err
2770				}
2771				ssap.Name = &name
2772			}
2773		case "type":
2774			if v != nil {
2775				var typeVar string
2776				err = json.Unmarshal(*v, &typeVar)
2777				if err != nil {
2778					return err
2779				}
2780				ssap.Type = &typeVar
2781			}
2782		}
2783	}
2784
2785	return nil
2786}
2787
2788// ServersRestartFuture an abstraction for monitoring and retrieving the results of a long-running
2789// operation.
2790type ServersRestartFuture struct {
2791	azure.FutureAPI
2792	// Result returns the result of the asynchronous operation.
2793	// If the operation has not completed it will return an error.
2794	Result func(ServersClient) (autorest.Response, error)
2795}
2796
2797// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
2798// operation.
2799type ServersUpdateFuture struct {
2800	azure.FutureAPI
2801	// Result returns the result of the asynchronous operation.
2802	// If the operation has not completed it will return an error.
2803	Result func(ServersClient) (Server, error)
2804}
2805
2806// ServerUpdateParameters parameters allowed to update for a server.
2807type ServerUpdateParameters struct {
2808	// Sku - The SKU (pricing tier) of the server.
2809	Sku *Sku `json:"sku,omitempty"`
2810	// ServerUpdateParametersProperties - The properties that can be updated for a server.
2811	*ServerUpdateParametersProperties `json:"properties,omitempty"`
2812	// Tags - Application-specific metadata in the form of key-value pairs.
2813	Tags map[string]*string `json:"tags"`
2814}
2815
2816// MarshalJSON is the custom marshaler for ServerUpdateParameters.
2817func (sup ServerUpdateParameters) MarshalJSON() ([]byte, error) {
2818	objectMap := make(map[string]interface{})
2819	if sup.Sku != nil {
2820		objectMap["sku"] = sup.Sku
2821	}
2822	if sup.ServerUpdateParametersProperties != nil {
2823		objectMap["properties"] = sup.ServerUpdateParametersProperties
2824	}
2825	if sup.Tags != nil {
2826		objectMap["tags"] = sup.Tags
2827	}
2828	return json.Marshal(objectMap)
2829}
2830
2831// UnmarshalJSON is the custom unmarshaler for ServerUpdateParameters struct.
2832func (sup *ServerUpdateParameters) UnmarshalJSON(body []byte) error {
2833	var m map[string]*json.RawMessage
2834	err := json.Unmarshal(body, &m)
2835	if err != nil {
2836		return err
2837	}
2838	for k, v := range m {
2839		switch k {
2840		case "sku":
2841			if v != nil {
2842				var sku Sku
2843				err = json.Unmarshal(*v, &sku)
2844				if err != nil {
2845					return err
2846				}
2847				sup.Sku = &sku
2848			}
2849		case "properties":
2850			if v != nil {
2851				var serverUpdateParametersProperties ServerUpdateParametersProperties
2852				err = json.Unmarshal(*v, &serverUpdateParametersProperties)
2853				if err != nil {
2854					return err
2855				}
2856				sup.ServerUpdateParametersProperties = &serverUpdateParametersProperties
2857			}
2858		case "tags":
2859			if v != nil {
2860				var tags map[string]*string
2861				err = json.Unmarshal(*v, &tags)
2862				if err != nil {
2863					return err
2864				}
2865				sup.Tags = tags
2866			}
2867		}
2868	}
2869
2870	return nil
2871}
2872
2873// ServerUpdateParametersProperties the properties that can be updated for a server.
2874type ServerUpdateParametersProperties struct {
2875	// StorageProfile - Storage profile of a server.
2876	StorageProfile *StorageProfile `json:"storageProfile,omitempty"`
2877	// AdministratorLoginPassword - The password of the administrator login.
2878	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
2879	// Version - The version of a server. Possible values include: 'FiveFullStopSix', 'FiveFullStopSeven'
2880	Version ServerVersion `json:"version,omitempty"`
2881	// SslEnforcement - Enable ssl enforcement or not when connect to server. Possible values include: 'SslEnforcementEnumEnabled', 'SslEnforcementEnumDisabled'
2882	SslEnforcement SslEnforcementEnum `json:"sslEnforcement,omitempty"`
2883	// PublicNetworkAccess - Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'PublicNetworkAccessEnumEnabled', 'PublicNetworkAccessEnumDisabled'
2884	PublicNetworkAccess PublicNetworkAccessEnum `json:"publicNetworkAccess,omitempty"`
2885	// ReplicationRole - The replication role of the server.
2886	ReplicationRole *string `json:"replicationRole,omitempty"`
2887}
2888
2889// Sku billing information related properties of a server.
2890type Sku struct {
2891	// Name - The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.
2892	Name *string `json:"name,omitempty"`
2893	// Tier - The tier of the particular SKU, e.g. Basic. Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized'
2894	Tier SkuTier `json:"tier,omitempty"`
2895	// Capacity - The scale up/out capacity, representing server's compute units.
2896	Capacity *int32 `json:"capacity,omitempty"`
2897	// Size - The size code, to be interpreted by resource as appropriate.
2898	Size *string `json:"size,omitempty"`
2899	// Family - The family of hardware.
2900	Family *string `json:"family,omitempty"`
2901}
2902
2903// StorageProfile storage Profile properties of a server
2904type StorageProfile struct {
2905	// BackupRetentionDays - Backup retention days for the server.
2906	BackupRetentionDays *int32 `json:"backupRetentionDays,omitempty"`
2907	// GeoRedundantBackup - Enable Geo-redundant or not for server backup. Possible values include: 'Enabled', 'Disabled'
2908	GeoRedundantBackup GeoRedundantBackup `json:"geoRedundantBackup,omitempty"`
2909	// StorageMB - Max storage allowed for a server.
2910	StorageMB *int32 `json:"storageMB,omitempty"`
2911	// StorageAutogrow - Enable Storage Auto Grow. Possible values include: 'StorageAutogrowEnabled', 'StorageAutogrowDisabled'
2912	StorageAutogrow StorageAutogrow `json:"storageAutogrow,omitempty"`
2913}
2914
2915// TagsObject tags object for patch operations.
2916type TagsObject struct {
2917	// Tags - Resource tags.
2918	Tags map[string]*string `json:"tags"`
2919}
2920
2921// MarshalJSON is the custom marshaler for TagsObject.
2922func (toVar TagsObject) MarshalJSON() ([]byte, error) {
2923	objectMap := make(map[string]interface{})
2924	if toVar.Tags != nil {
2925		objectMap["tags"] = toVar.Tags
2926	}
2927	return json.Marshal(objectMap)
2928}
2929
2930// TopQueryStatisticsInput input to get top query statistics
2931type TopQueryStatisticsInput struct {
2932	// TopQueryStatisticsInputProperties - The properties of a wait statistics input.
2933	*TopQueryStatisticsInputProperties `json:"properties,omitempty"`
2934}
2935
2936// MarshalJSON is the custom marshaler for TopQueryStatisticsInput.
2937func (tqsi TopQueryStatisticsInput) MarshalJSON() ([]byte, error) {
2938	objectMap := make(map[string]interface{})
2939	if tqsi.TopQueryStatisticsInputProperties != nil {
2940		objectMap["properties"] = tqsi.TopQueryStatisticsInputProperties
2941	}
2942	return json.Marshal(objectMap)
2943}
2944
2945// UnmarshalJSON is the custom unmarshaler for TopQueryStatisticsInput struct.
2946func (tqsi *TopQueryStatisticsInput) UnmarshalJSON(body []byte) error {
2947	var m map[string]*json.RawMessage
2948	err := json.Unmarshal(body, &m)
2949	if err != nil {
2950		return err
2951	}
2952	for k, v := range m {
2953		switch k {
2954		case "properties":
2955			if v != nil {
2956				var topQueryStatisticsInputProperties TopQueryStatisticsInputProperties
2957				err = json.Unmarshal(*v, &topQueryStatisticsInputProperties)
2958				if err != nil {
2959					return err
2960				}
2961				tqsi.TopQueryStatisticsInputProperties = &topQueryStatisticsInputProperties
2962			}
2963		}
2964	}
2965
2966	return nil
2967}
2968
2969// TopQueryStatisticsInputProperties the properties for input to get top query statistics
2970type TopQueryStatisticsInputProperties struct {
2971	// NumberOfTopQueries - Max number of top queries to return.
2972	NumberOfTopQueries *int32 `json:"numberOfTopQueries,omitempty"`
2973	// AggregationFunction - Aggregation function name.
2974	AggregationFunction *string `json:"aggregationFunction,omitempty"`
2975	// ObservedMetric - Observed metric name.
2976	ObservedMetric *string `json:"observedMetric,omitempty"`
2977	// ObservationStartTime - Observation start time.
2978	ObservationStartTime *date.Time `json:"observationStartTime,omitempty"`
2979	// ObservationEndTime - Observation end time.
2980	ObservationEndTime *date.Time `json:"observationEndTime,omitempty"`
2981	// AggregationWindow - Aggregation interval type in ISO 8601 format.
2982	AggregationWindow *string `json:"aggregationWindow,omitempty"`
2983}
2984
2985// TopQueryStatisticsResultList a list of query statistics.
2986type TopQueryStatisticsResultList struct {
2987	autorest.Response `json:"-"`
2988	// Value - READ-ONLY; The list of top query statistics.
2989	Value *[]QueryStatistic `json:"value,omitempty"`
2990	// NextLink - READ-ONLY; Link to retrieve next page of results.
2991	NextLink *string `json:"nextLink,omitempty"`
2992}
2993
2994// TopQueryStatisticsResultListIterator provides access to a complete listing of QueryStatistic values.
2995type TopQueryStatisticsResultListIterator struct {
2996	i    int
2997	page TopQueryStatisticsResultListPage
2998}
2999
3000// NextWithContext advances to the next value.  If there was an error making
3001// the request the iterator does not advance and the error is returned.
3002func (iter *TopQueryStatisticsResultListIterator) NextWithContext(ctx context.Context) (err error) {
3003	if tracing.IsEnabled() {
3004		ctx = tracing.StartSpan(ctx, fqdn+"/TopQueryStatisticsResultListIterator.NextWithContext")
3005		defer func() {
3006			sc := -1
3007			if iter.Response().Response.Response != nil {
3008				sc = iter.Response().Response.Response.StatusCode
3009			}
3010			tracing.EndSpan(ctx, sc, err)
3011		}()
3012	}
3013	iter.i++
3014	if iter.i < len(iter.page.Values()) {
3015		return nil
3016	}
3017	err = iter.page.NextWithContext(ctx)
3018	if err != nil {
3019		iter.i--
3020		return err
3021	}
3022	iter.i = 0
3023	return nil
3024}
3025
3026// Next advances to the next value.  If there was an error making
3027// the request the iterator does not advance and the error is returned.
3028// Deprecated: Use NextWithContext() instead.
3029func (iter *TopQueryStatisticsResultListIterator) Next() error {
3030	return iter.NextWithContext(context.Background())
3031}
3032
3033// NotDone returns true if the enumeration should be started or is not yet complete.
3034func (iter TopQueryStatisticsResultListIterator) NotDone() bool {
3035	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3036}
3037
3038// Response returns the raw server response from the last page request.
3039func (iter TopQueryStatisticsResultListIterator) Response() TopQueryStatisticsResultList {
3040	return iter.page.Response()
3041}
3042
3043// Value returns the current value or a zero-initialized value if the
3044// iterator has advanced beyond the end of the collection.
3045func (iter TopQueryStatisticsResultListIterator) Value() QueryStatistic {
3046	if !iter.page.NotDone() {
3047		return QueryStatistic{}
3048	}
3049	return iter.page.Values()[iter.i]
3050}
3051
3052// Creates a new instance of the TopQueryStatisticsResultListIterator type.
3053func NewTopQueryStatisticsResultListIterator(page TopQueryStatisticsResultListPage) TopQueryStatisticsResultListIterator {
3054	return TopQueryStatisticsResultListIterator{page: page}
3055}
3056
3057// IsEmpty returns true if the ListResult contains no values.
3058func (tqsrl TopQueryStatisticsResultList) IsEmpty() bool {
3059	return tqsrl.Value == nil || len(*tqsrl.Value) == 0
3060}
3061
3062// hasNextLink returns true if the NextLink is not empty.
3063func (tqsrl TopQueryStatisticsResultList) hasNextLink() bool {
3064	return tqsrl.NextLink != nil && len(*tqsrl.NextLink) != 0
3065}
3066
3067// topQueryStatisticsResultListPreparer prepares a request to retrieve the next set of results.
3068// It returns nil if no more results exist.
3069func (tqsrl TopQueryStatisticsResultList) topQueryStatisticsResultListPreparer(ctx context.Context) (*http.Request, error) {
3070	if !tqsrl.hasNextLink() {
3071		return nil, nil
3072	}
3073	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3074		autorest.AsJSON(),
3075		autorest.AsGet(),
3076		autorest.WithBaseURL(to.String(tqsrl.NextLink)))
3077}
3078
3079// TopQueryStatisticsResultListPage contains a page of QueryStatistic values.
3080type TopQueryStatisticsResultListPage struct {
3081	fn    func(context.Context, TopQueryStatisticsResultList) (TopQueryStatisticsResultList, error)
3082	tqsrl TopQueryStatisticsResultList
3083}
3084
3085// NextWithContext advances to the next page of values.  If there was an error making
3086// the request the page does not advance and the error is returned.
3087func (page *TopQueryStatisticsResultListPage) NextWithContext(ctx context.Context) (err error) {
3088	if tracing.IsEnabled() {
3089		ctx = tracing.StartSpan(ctx, fqdn+"/TopQueryStatisticsResultListPage.NextWithContext")
3090		defer func() {
3091			sc := -1
3092			if page.Response().Response.Response != nil {
3093				sc = page.Response().Response.Response.StatusCode
3094			}
3095			tracing.EndSpan(ctx, sc, err)
3096		}()
3097	}
3098	for {
3099		next, err := page.fn(ctx, page.tqsrl)
3100		if err != nil {
3101			return err
3102		}
3103		page.tqsrl = next
3104		if !next.hasNextLink() || !next.IsEmpty() {
3105			break
3106		}
3107	}
3108	return nil
3109}
3110
3111// Next advances to the next page of values.  If there was an error making
3112// the request the page does not advance and the error is returned.
3113// Deprecated: Use NextWithContext() instead.
3114func (page *TopQueryStatisticsResultListPage) Next() error {
3115	return page.NextWithContext(context.Background())
3116}
3117
3118// NotDone returns true if the page enumeration should be started or is not yet complete.
3119func (page TopQueryStatisticsResultListPage) NotDone() bool {
3120	return !page.tqsrl.IsEmpty()
3121}
3122
3123// Response returns the raw server response from the last page request.
3124func (page TopQueryStatisticsResultListPage) Response() TopQueryStatisticsResultList {
3125	return page.tqsrl
3126}
3127
3128// Values returns the slice of values for the current page or nil if there are no values.
3129func (page TopQueryStatisticsResultListPage) Values() []QueryStatistic {
3130	if page.tqsrl.IsEmpty() {
3131		return nil
3132	}
3133	return *page.tqsrl.Value
3134}
3135
3136// Creates a new instance of the TopQueryStatisticsResultListPage type.
3137func NewTopQueryStatisticsResultListPage(cur TopQueryStatisticsResultList, getNextPage func(context.Context, TopQueryStatisticsResultList) (TopQueryStatisticsResultList, error)) TopQueryStatisticsResultListPage {
3138	return TopQueryStatisticsResultListPage{
3139		fn:    getNextPage,
3140		tqsrl: cur,
3141	}
3142}
3143
3144// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
3145// which has 'tags' and a 'location'
3146type TrackedResource struct {
3147	// Tags - Resource tags.
3148	Tags map[string]*string `json:"tags"`
3149	// Location - The geo-location where the resource lives
3150	Location *string `json:"location,omitempty"`
3151	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
3152	ID *string `json:"id,omitempty"`
3153	// Name - READ-ONLY; The name of the resource
3154	Name *string `json:"name,omitempty"`
3155	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
3156	Type *string `json:"type,omitempty"`
3157}
3158
3159// MarshalJSON is the custom marshaler for TrackedResource.
3160func (tr TrackedResource) MarshalJSON() ([]byte, error) {
3161	objectMap := make(map[string]interface{})
3162	if tr.Tags != nil {
3163		objectMap["tags"] = tr.Tags
3164	}
3165	if tr.Location != nil {
3166		objectMap["location"] = tr.Location
3167	}
3168	return json.Marshal(objectMap)
3169}
3170
3171// VirtualNetworkRule a virtual network rule.
3172type VirtualNetworkRule struct {
3173	autorest.Response `json:"-"`
3174	// VirtualNetworkRuleProperties - Resource properties.
3175	*VirtualNetworkRuleProperties `json:"properties,omitempty"`
3176	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
3177	ID *string `json:"id,omitempty"`
3178	// Name - READ-ONLY; The name of the resource
3179	Name *string `json:"name,omitempty"`
3180	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
3181	Type *string `json:"type,omitempty"`
3182}
3183
3184// MarshalJSON is the custom marshaler for VirtualNetworkRule.
3185func (vnr VirtualNetworkRule) MarshalJSON() ([]byte, error) {
3186	objectMap := make(map[string]interface{})
3187	if vnr.VirtualNetworkRuleProperties != nil {
3188		objectMap["properties"] = vnr.VirtualNetworkRuleProperties
3189	}
3190	return json.Marshal(objectMap)
3191}
3192
3193// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct.
3194func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error {
3195	var m map[string]*json.RawMessage
3196	err := json.Unmarshal(body, &m)
3197	if err != nil {
3198		return err
3199	}
3200	for k, v := range m {
3201		switch k {
3202		case "properties":
3203			if v != nil {
3204				var virtualNetworkRuleProperties VirtualNetworkRuleProperties
3205				err = json.Unmarshal(*v, &virtualNetworkRuleProperties)
3206				if err != nil {
3207					return err
3208				}
3209				vnr.VirtualNetworkRuleProperties = &virtualNetworkRuleProperties
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				vnr.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				vnr.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				vnr.Type = &typeVar
3237			}
3238		}
3239	}
3240
3241	return nil
3242}
3243
3244// VirtualNetworkRuleListResult a list of virtual network rules.
3245type VirtualNetworkRuleListResult struct {
3246	autorest.Response `json:"-"`
3247	// Value - READ-ONLY; Array of results.
3248	Value *[]VirtualNetworkRule `json:"value,omitempty"`
3249	// NextLink - READ-ONLY; Link to retrieve next page of results.
3250	NextLink *string `json:"nextLink,omitempty"`
3251}
3252
3253// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values.
3254type VirtualNetworkRuleListResultIterator struct {
3255	i    int
3256	page VirtualNetworkRuleListResultPage
3257}
3258
3259// NextWithContext advances to the next value.  If there was an error making
3260// the request the iterator does not advance and the error is returned.
3261func (iter *VirtualNetworkRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
3262	if tracing.IsEnabled() {
3263		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultIterator.NextWithContext")
3264		defer func() {
3265			sc := -1
3266			if iter.Response().Response.Response != nil {
3267				sc = iter.Response().Response.Response.StatusCode
3268			}
3269			tracing.EndSpan(ctx, sc, err)
3270		}()
3271	}
3272	iter.i++
3273	if iter.i < len(iter.page.Values()) {
3274		return nil
3275	}
3276	err = iter.page.NextWithContext(ctx)
3277	if err != nil {
3278		iter.i--
3279		return err
3280	}
3281	iter.i = 0
3282	return nil
3283}
3284
3285// Next advances to the next value.  If there was an error making
3286// the request the iterator does not advance and the error is returned.
3287// Deprecated: Use NextWithContext() instead.
3288func (iter *VirtualNetworkRuleListResultIterator) Next() error {
3289	return iter.NextWithContext(context.Background())
3290}
3291
3292// NotDone returns true if the enumeration should be started or is not yet complete.
3293func (iter VirtualNetworkRuleListResultIterator) NotDone() bool {
3294	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3295}
3296
3297// Response returns the raw server response from the last page request.
3298func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult {
3299	return iter.page.Response()
3300}
3301
3302// Value returns the current value or a zero-initialized value if the
3303// iterator has advanced beyond the end of the collection.
3304func (iter VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule {
3305	if !iter.page.NotDone() {
3306		return VirtualNetworkRule{}
3307	}
3308	return iter.page.Values()[iter.i]
3309}
3310
3311// Creates a new instance of the VirtualNetworkRuleListResultIterator type.
3312func NewVirtualNetworkRuleListResultIterator(page VirtualNetworkRuleListResultPage) VirtualNetworkRuleListResultIterator {
3313	return VirtualNetworkRuleListResultIterator{page: page}
3314}
3315
3316// IsEmpty returns true if the ListResult contains no values.
3317func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool {
3318	return vnrlr.Value == nil || len(*vnrlr.Value) == 0
3319}
3320
3321// hasNextLink returns true if the NextLink is not empty.
3322func (vnrlr VirtualNetworkRuleListResult) hasNextLink() bool {
3323	return vnrlr.NextLink != nil && len(*vnrlr.NextLink) != 0
3324}
3325
3326// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results.
3327// It returns nil if no more results exist.
3328func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
3329	if !vnrlr.hasNextLink() {
3330		return nil, nil
3331	}
3332	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3333		autorest.AsJSON(),
3334		autorest.AsGet(),
3335		autorest.WithBaseURL(to.String(vnrlr.NextLink)))
3336}
3337
3338// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values.
3339type VirtualNetworkRuleListResultPage struct {
3340	fn    func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)
3341	vnrlr VirtualNetworkRuleListResult
3342}
3343
3344// NextWithContext advances to the next page of values.  If there was an error making
3345// the request the page does not advance and the error is returned.
3346func (page *VirtualNetworkRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
3347	if tracing.IsEnabled() {
3348		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultPage.NextWithContext")
3349		defer func() {
3350			sc := -1
3351			if page.Response().Response.Response != nil {
3352				sc = page.Response().Response.Response.StatusCode
3353			}
3354			tracing.EndSpan(ctx, sc, err)
3355		}()
3356	}
3357	for {
3358		next, err := page.fn(ctx, page.vnrlr)
3359		if err != nil {
3360			return err
3361		}
3362		page.vnrlr = next
3363		if !next.hasNextLink() || !next.IsEmpty() {
3364			break
3365		}
3366	}
3367	return nil
3368}
3369
3370// Next advances to the next page of values.  If there was an error making
3371// the request the page does not advance and the error is returned.
3372// Deprecated: Use NextWithContext() instead.
3373func (page *VirtualNetworkRuleListResultPage) Next() error {
3374	return page.NextWithContext(context.Background())
3375}
3376
3377// NotDone returns true if the page enumeration should be started or is not yet complete.
3378func (page VirtualNetworkRuleListResultPage) NotDone() bool {
3379	return !page.vnrlr.IsEmpty()
3380}
3381
3382// Response returns the raw server response from the last page request.
3383func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult {
3384	return page.vnrlr
3385}
3386
3387// Values returns the slice of values for the current page or nil if there are no values.
3388func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule {
3389	if page.vnrlr.IsEmpty() {
3390		return nil
3391	}
3392	return *page.vnrlr.Value
3393}
3394
3395// Creates a new instance of the VirtualNetworkRuleListResultPage type.
3396func NewVirtualNetworkRuleListResultPage(cur VirtualNetworkRuleListResult, getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage {
3397	return VirtualNetworkRuleListResultPage{
3398		fn:    getNextPage,
3399		vnrlr: cur,
3400	}
3401}
3402
3403// VirtualNetworkRuleProperties properties of a virtual network rule.
3404type VirtualNetworkRuleProperties struct {
3405	// VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet.
3406	VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"`
3407	// IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled.
3408	IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"`
3409	// State - READ-ONLY; Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown'
3410	State VirtualNetworkRuleState `json:"state,omitempty"`
3411}
3412
3413// MarshalJSON is the custom marshaler for VirtualNetworkRuleProperties.
3414func (vnrp VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error) {
3415	objectMap := make(map[string]interface{})
3416	if vnrp.VirtualNetworkSubnetID != nil {
3417		objectMap["virtualNetworkSubnetId"] = vnrp.VirtualNetworkSubnetID
3418	}
3419	if vnrp.IgnoreMissingVnetServiceEndpoint != nil {
3420		objectMap["ignoreMissingVnetServiceEndpoint"] = vnrp.IgnoreMissingVnetServiceEndpoint
3421	}
3422	return json.Marshal(objectMap)
3423}
3424
3425// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
3426// long-running operation.
3427type VirtualNetworkRulesCreateOrUpdateFuture struct {
3428	azure.FutureAPI
3429	// Result returns the result of the asynchronous operation.
3430	// If the operation has not completed it will return an error.
3431	Result func(VirtualNetworkRulesClient) (VirtualNetworkRule, error)
3432}
3433
3434// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a
3435// long-running operation.
3436type VirtualNetworkRulesDeleteFuture struct {
3437	azure.FutureAPI
3438	// Result returns the result of the asynchronous operation.
3439	// If the operation has not completed it will return an error.
3440	Result func(VirtualNetworkRulesClient) (autorest.Response, error)
3441}
3442
3443// WaitStatistic represents a Wait Statistic.
3444type WaitStatistic struct {
3445	autorest.Response `json:"-"`
3446	// WaitStatisticProperties - The properties of a wait statistic.
3447	*WaitStatisticProperties `json:"properties,omitempty"`
3448	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
3449	ID *string `json:"id,omitempty"`
3450	// Name - READ-ONLY; The name of the resource
3451	Name *string `json:"name,omitempty"`
3452	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
3453	Type *string `json:"type,omitempty"`
3454}
3455
3456// MarshalJSON is the custom marshaler for WaitStatistic.
3457func (ws WaitStatistic) MarshalJSON() ([]byte, error) {
3458	objectMap := make(map[string]interface{})
3459	if ws.WaitStatisticProperties != nil {
3460		objectMap["properties"] = ws.WaitStatisticProperties
3461	}
3462	return json.Marshal(objectMap)
3463}
3464
3465// UnmarshalJSON is the custom unmarshaler for WaitStatistic struct.
3466func (ws *WaitStatistic) UnmarshalJSON(body []byte) error {
3467	var m map[string]*json.RawMessage
3468	err := json.Unmarshal(body, &m)
3469	if err != nil {
3470		return err
3471	}
3472	for k, v := range m {
3473		switch k {
3474		case "properties":
3475			if v != nil {
3476				var waitStatisticProperties WaitStatisticProperties
3477				err = json.Unmarshal(*v, &waitStatisticProperties)
3478				if err != nil {
3479					return err
3480				}
3481				ws.WaitStatisticProperties = &waitStatisticProperties
3482			}
3483		case "id":
3484			if v != nil {
3485				var ID string
3486				err = json.Unmarshal(*v, &ID)
3487				if err != nil {
3488					return err
3489				}
3490				ws.ID = &ID
3491			}
3492		case "name":
3493			if v != nil {
3494				var name string
3495				err = json.Unmarshal(*v, &name)
3496				if err != nil {
3497					return err
3498				}
3499				ws.Name = &name
3500			}
3501		case "type":
3502			if v != nil {
3503				var typeVar string
3504				err = json.Unmarshal(*v, &typeVar)
3505				if err != nil {
3506					return err
3507				}
3508				ws.Type = &typeVar
3509			}
3510		}
3511	}
3512
3513	return nil
3514}
3515
3516// WaitStatisticProperties the properties of a wait statistic.
3517type WaitStatisticProperties struct {
3518	// StartTime - Observation start time.
3519	StartTime *date.Time `json:"startTime,omitempty"`
3520	// EndTime - Observation end time.
3521	EndTime *date.Time `json:"endTime,omitempty"`
3522	// EventName - Wait event name.
3523	EventName *string `json:"eventName,omitempty"`
3524	// EventTypeName - Wait event type name.
3525	EventTypeName *string `json:"eventTypeName,omitempty"`
3526	// QueryID - Database query identifier.
3527	QueryID *int64 `json:"queryId,omitempty"`
3528	// DatabaseName - Database Name.
3529	DatabaseName *string `json:"databaseName,omitempty"`
3530	// UserID - Database user identifier.
3531	UserID *int64 `json:"userId,omitempty"`
3532	// Count - Wait event count observed in this time interval.
3533	Count *int64 `json:"count,omitempty"`
3534	// TotalTimeInMs - Total time of wait in milliseconds in this time interval.
3535	TotalTimeInMs *float64 `json:"totalTimeInMs,omitempty"`
3536}
3537
3538// WaitStatisticsInput input to get wait statistics
3539type WaitStatisticsInput struct {
3540	// WaitStatisticsInputProperties - The properties of a wait statistics input.
3541	*WaitStatisticsInputProperties `json:"properties,omitempty"`
3542}
3543
3544// MarshalJSON is the custom marshaler for WaitStatisticsInput.
3545func (wsi WaitStatisticsInput) MarshalJSON() ([]byte, error) {
3546	objectMap := make(map[string]interface{})
3547	if wsi.WaitStatisticsInputProperties != nil {
3548		objectMap["properties"] = wsi.WaitStatisticsInputProperties
3549	}
3550	return json.Marshal(objectMap)
3551}
3552
3553// UnmarshalJSON is the custom unmarshaler for WaitStatisticsInput struct.
3554func (wsi *WaitStatisticsInput) UnmarshalJSON(body []byte) error {
3555	var m map[string]*json.RawMessage
3556	err := json.Unmarshal(body, &m)
3557	if err != nil {
3558		return err
3559	}
3560	for k, v := range m {
3561		switch k {
3562		case "properties":
3563			if v != nil {
3564				var waitStatisticsInputProperties WaitStatisticsInputProperties
3565				err = json.Unmarshal(*v, &waitStatisticsInputProperties)
3566				if err != nil {
3567					return err
3568				}
3569				wsi.WaitStatisticsInputProperties = &waitStatisticsInputProperties
3570			}
3571		}
3572	}
3573
3574	return nil
3575}
3576
3577// WaitStatisticsInputProperties the properties for input to get wait statistics
3578type WaitStatisticsInputProperties struct {
3579	// ObservationStartTime - Observation start time.
3580	ObservationStartTime *date.Time `json:"observationStartTime,omitempty"`
3581	// ObservationEndTime - Observation end time.
3582	ObservationEndTime *date.Time `json:"observationEndTime,omitempty"`
3583	// AggregationWindow - Aggregation interval type in ISO 8601 format.
3584	AggregationWindow *string `json:"aggregationWindow,omitempty"`
3585}
3586
3587// WaitStatisticsResultList a list of wait statistics.
3588type WaitStatisticsResultList struct {
3589	autorest.Response `json:"-"`
3590	// Value - READ-ONLY; The list of wait statistics.
3591	Value *[]WaitStatistic `json:"value,omitempty"`
3592	// NextLink - READ-ONLY; Link to retrieve next page of results.
3593	NextLink *string `json:"nextLink,omitempty"`
3594}
3595
3596// WaitStatisticsResultListIterator provides access to a complete listing of WaitStatistic values.
3597type WaitStatisticsResultListIterator struct {
3598	i    int
3599	page WaitStatisticsResultListPage
3600}
3601
3602// NextWithContext advances to the next value.  If there was an error making
3603// the request the iterator does not advance and the error is returned.
3604func (iter *WaitStatisticsResultListIterator) NextWithContext(ctx context.Context) (err error) {
3605	if tracing.IsEnabled() {
3606		ctx = tracing.StartSpan(ctx, fqdn+"/WaitStatisticsResultListIterator.NextWithContext")
3607		defer func() {
3608			sc := -1
3609			if iter.Response().Response.Response != nil {
3610				sc = iter.Response().Response.Response.StatusCode
3611			}
3612			tracing.EndSpan(ctx, sc, err)
3613		}()
3614	}
3615	iter.i++
3616	if iter.i < len(iter.page.Values()) {
3617		return nil
3618	}
3619	err = iter.page.NextWithContext(ctx)
3620	if err != nil {
3621		iter.i--
3622		return err
3623	}
3624	iter.i = 0
3625	return nil
3626}
3627
3628// Next advances to the next value.  If there was an error making
3629// the request the iterator does not advance and the error is returned.
3630// Deprecated: Use NextWithContext() instead.
3631func (iter *WaitStatisticsResultListIterator) Next() error {
3632	return iter.NextWithContext(context.Background())
3633}
3634
3635// NotDone returns true if the enumeration should be started or is not yet complete.
3636func (iter WaitStatisticsResultListIterator) NotDone() bool {
3637	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3638}
3639
3640// Response returns the raw server response from the last page request.
3641func (iter WaitStatisticsResultListIterator) Response() WaitStatisticsResultList {
3642	return iter.page.Response()
3643}
3644
3645// Value returns the current value or a zero-initialized value if the
3646// iterator has advanced beyond the end of the collection.
3647func (iter WaitStatisticsResultListIterator) Value() WaitStatistic {
3648	if !iter.page.NotDone() {
3649		return WaitStatistic{}
3650	}
3651	return iter.page.Values()[iter.i]
3652}
3653
3654// Creates a new instance of the WaitStatisticsResultListIterator type.
3655func NewWaitStatisticsResultListIterator(page WaitStatisticsResultListPage) WaitStatisticsResultListIterator {
3656	return WaitStatisticsResultListIterator{page: page}
3657}
3658
3659// IsEmpty returns true if the ListResult contains no values.
3660func (wsrl WaitStatisticsResultList) IsEmpty() bool {
3661	return wsrl.Value == nil || len(*wsrl.Value) == 0
3662}
3663
3664// hasNextLink returns true if the NextLink is not empty.
3665func (wsrl WaitStatisticsResultList) hasNextLink() bool {
3666	return wsrl.NextLink != nil && len(*wsrl.NextLink) != 0
3667}
3668
3669// waitStatisticsResultListPreparer prepares a request to retrieve the next set of results.
3670// It returns nil if no more results exist.
3671func (wsrl WaitStatisticsResultList) waitStatisticsResultListPreparer(ctx context.Context) (*http.Request, error) {
3672	if !wsrl.hasNextLink() {
3673		return nil, nil
3674	}
3675	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3676		autorest.AsJSON(),
3677		autorest.AsGet(),
3678		autorest.WithBaseURL(to.String(wsrl.NextLink)))
3679}
3680
3681// WaitStatisticsResultListPage contains a page of WaitStatistic values.
3682type WaitStatisticsResultListPage struct {
3683	fn   func(context.Context, WaitStatisticsResultList) (WaitStatisticsResultList, error)
3684	wsrl WaitStatisticsResultList
3685}
3686
3687// NextWithContext advances to the next page of values.  If there was an error making
3688// the request the page does not advance and the error is returned.
3689func (page *WaitStatisticsResultListPage) NextWithContext(ctx context.Context) (err error) {
3690	if tracing.IsEnabled() {
3691		ctx = tracing.StartSpan(ctx, fqdn+"/WaitStatisticsResultListPage.NextWithContext")
3692		defer func() {
3693			sc := -1
3694			if page.Response().Response.Response != nil {
3695				sc = page.Response().Response.Response.StatusCode
3696			}
3697			tracing.EndSpan(ctx, sc, err)
3698		}()
3699	}
3700	for {
3701		next, err := page.fn(ctx, page.wsrl)
3702		if err != nil {
3703			return err
3704		}
3705		page.wsrl = next
3706		if !next.hasNextLink() || !next.IsEmpty() {
3707			break
3708		}
3709	}
3710	return nil
3711}
3712
3713// Next advances to the next page of values.  If there was an error making
3714// the request the page does not advance and the error is returned.
3715// Deprecated: Use NextWithContext() instead.
3716func (page *WaitStatisticsResultListPage) Next() error {
3717	return page.NextWithContext(context.Background())
3718}
3719
3720// NotDone returns true if the page enumeration should be started or is not yet complete.
3721func (page WaitStatisticsResultListPage) NotDone() bool {
3722	return !page.wsrl.IsEmpty()
3723}
3724
3725// Response returns the raw server response from the last page request.
3726func (page WaitStatisticsResultListPage) Response() WaitStatisticsResultList {
3727	return page.wsrl
3728}
3729
3730// Values returns the slice of values for the current page or nil if there are no values.
3731func (page WaitStatisticsResultListPage) Values() []WaitStatistic {
3732	if page.wsrl.IsEmpty() {
3733		return nil
3734	}
3735	return *page.wsrl.Value
3736}
3737
3738// Creates a new instance of the WaitStatisticsResultListPage type.
3739func NewWaitStatisticsResultListPage(cur WaitStatisticsResultList, getNextPage func(context.Context, WaitStatisticsResultList) (WaitStatisticsResultList, error)) WaitStatisticsResultListPage {
3740	return WaitStatisticsResultListPage{
3741		fn:   getNextPage,
3742		wsrl: cur,
3743	}
3744}
3745