...

Source file src/github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers

     1  package mysqlflexibleservers
     2  
     3  // Copyright (c) Microsoft Corporation. All rights reserved.
     4  // Licensed under the MIT License. See License.txt in the project root for license information.
     5  //
     6  // Code generated by Microsoft (R) AutoRest Code Generator.
     7  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
     8  
     9  import (
    10  	"context"
    11  	"encoding/json"
    12  	"github.com/Azure/go-autorest/autorest"
    13  	"github.com/Azure/go-autorest/autorest/azure"
    14  	"github.com/Azure/go-autorest/autorest/date"
    15  	"github.com/Azure/go-autorest/autorest/to"
    16  	"github.com/Azure/go-autorest/tracing"
    17  	"net/http"
    18  )
    19  
    20  // The package's fully qualified name.
    21  const fqdn = "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers"
    22  
    23  // AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
    24  type AzureEntityResource struct {
    25  	// Etag - READ-ONLY; Resource Etag.
    26  	Etag *string `json:"etag,omitempty"`
    27  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    28  	ID *string `json:"id,omitempty"`
    29  	// Name - READ-ONLY; The name of the resource
    30  	Name *string `json:"name,omitempty"`
    31  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    32  	Type *string `json:"type,omitempty"`
    33  }
    34  
    35  // MarshalJSON is the custom marshaler for AzureEntityResource.
    36  func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
    37  	objectMap := make(map[string]interface{})
    38  	return json.Marshal(objectMap)
    39  }
    40  
    41  // Backup storage Profile properties of a server
    42  type Backup struct {
    43  	// BackupRetentionDays - Backup retention days for the server.
    44  	BackupRetentionDays *int32 `json:"backupRetentionDays,omitempty"`
    45  	// GeoRedundantBackup - Whether or not geo redundant backup is enabled. Possible values include: 'EnableStatusEnumEnabled', 'EnableStatusEnumDisabled'
    46  	GeoRedundantBackup EnableStatusEnum `json:"geoRedundantBackup,omitempty"`
    47  	// EarliestRestoreDate - READ-ONLY; Earliest restore point creation time (ISO8601 format)
    48  	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
    49  }
    50  
    51  // MarshalJSON is the custom marshaler for Backup.
    52  func (b Backup) MarshalJSON() ([]byte, error) {
    53  	objectMap := make(map[string]interface{})
    54  	if b.BackupRetentionDays != nil {
    55  		objectMap["backupRetentionDays"] = b.BackupRetentionDays
    56  	}
    57  	if b.GeoRedundantBackup != "" {
    58  		objectMap["geoRedundantBackup"] = b.GeoRedundantBackup
    59  	}
    60  	return json.Marshal(objectMap)
    61  }
    62  
    63  // CapabilitiesListResult location capability
    64  type CapabilitiesListResult struct {
    65  	autorest.Response `json:"-"`
    66  	// Value - READ-ONLY; A list of supported capabilities.
    67  	Value *[]CapabilityProperties `json:"value,omitempty"`
    68  	// NextLink - READ-ONLY; Link to retrieve next page of results.
    69  	NextLink *string `json:"nextLink,omitempty"`
    70  }
    71  
    72  // MarshalJSON is the custom marshaler for CapabilitiesListResult.
    73  func (clr CapabilitiesListResult) MarshalJSON() ([]byte, error) {
    74  	objectMap := make(map[string]interface{})
    75  	return json.Marshal(objectMap)
    76  }
    77  
    78  // CapabilitiesListResultIterator provides access to a complete listing of CapabilityProperties values.
    79  type CapabilitiesListResultIterator struct {
    80  	i    int
    81  	page CapabilitiesListResultPage
    82  }
    83  
    84  // NextWithContext advances to the next value.  If there was an error making
    85  // the request the iterator does not advance and the error is returned.
    86  func (iter *CapabilitiesListResultIterator) NextWithContext(ctx context.Context) (err error) {
    87  	if tracing.IsEnabled() {
    88  		ctx = tracing.StartSpan(ctx, fqdn+"/CapabilitiesListResultIterator.NextWithContext")
    89  		defer func() {
    90  			sc := -1
    91  			if iter.Response().Response.Response != nil {
    92  				sc = iter.Response().Response.Response.StatusCode
    93  			}
    94  			tracing.EndSpan(ctx, sc, err)
    95  		}()
    96  	}
    97  	iter.i++
    98  	if iter.i < len(iter.page.Values()) {
    99  		return nil
   100  	}
   101  	err = iter.page.NextWithContext(ctx)
   102  	if err != nil {
   103  		iter.i--
   104  		return err
   105  	}
   106  	iter.i = 0
   107  	return nil
   108  }
   109  
   110  // Next advances to the next value.  If there was an error making
   111  // the request the iterator does not advance and the error is returned.
   112  // Deprecated: Use NextWithContext() instead.
   113  func (iter *CapabilitiesListResultIterator) Next() error {
   114  	return iter.NextWithContext(context.Background())
   115  }
   116  
   117  // NotDone returns true if the enumeration should be started or is not yet complete.
   118  func (iter CapabilitiesListResultIterator) NotDone() bool {
   119  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   120  }
   121  
   122  // Response returns the raw server response from the last page request.
   123  func (iter CapabilitiesListResultIterator) Response() CapabilitiesListResult {
   124  	return iter.page.Response()
   125  }
   126  
   127  // Value returns the current value or a zero-initialized value if the
   128  // iterator has advanced beyond the end of the collection.
   129  func (iter CapabilitiesListResultIterator) Value() CapabilityProperties {
   130  	if !iter.page.NotDone() {
   131  		return CapabilityProperties{}
   132  	}
   133  	return iter.page.Values()[iter.i]
   134  }
   135  
   136  // Creates a new instance of the CapabilitiesListResultIterator type.
   137  func NewCapabilitiesListResultIterator(page CapabilitiesListResultPage) CapabilitiesListResultIterator {
   138  	return CapabilitiesListResultIterator{page: page}
   139  }
   140  
   141  // IsEmpty returns true if the ListResult contains no values.
   142  func (clr CapabilitiesListResult) IsEmpty() bool {
   143  	return clr.Value == nil || len(*clr.Value) == 0
   144  }
   145  
   146  // hasNextLink returns true if the NextLink is not empty.
   147  func (clr CapabilitiesListResult) hasNextLink() bool {
   148  	return clr.NextLink != nil && len(*clr.NextLink) != 0
   149  }
   150  
   151  // capabilitiesListResultPreparer prepares a request to retrieve the next set of results.
   152  // It returns nil if no more results exist.
   153  func (clr CapabilitiesListResult) capabilitiesListResultPreparer(ctx context.Context) (*http.Request, error) {
   154  	if !clr.hasNextLink() {
   155  		return nil, nil
   156  	}
   157  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   158  		autorest.AsJSON(),
   159  		autorest.AsGet(),
   160  		autorest.WithBaseURL(to.String(clr.NextLink)))
   161  }
   162  
   163  // CapabilitiesListResultPage contains a page of CapabilityProperties values.
   164  type CapabilitiesListResultPage struct {
   165  	fn  func(context.Context, CapabilitiesListResult) (CapabilitiesListResult, error)
   166  	clr CapabilitiesListResult
   167  }
   168  
   169  // NextWithContext advances to the next page of values.  If there was an error making
   170  // the request the page does not advance and the error is returned.
   171  func (page *CapabilitiesListResultPage) NextWithContext(ctx context.Context) (err error) {
   172  	if tracing.IsEnabled() {
   173  		ctx = tracing.StartSpan(ctx, fqdn+"/CapabilitiesListResultPage.NextWithContext")
   174  		defer func() {
   175  			sc := -1
   176  			if page.Response().Response.Response != nil {
   177  				sc = page.Response().Response.Response.StatusCode
   178  			}
   179  			tracing.EndSpan(ctx, sc, err)
   180  		}()
   181  	}
   182  	for {
   183  		next, err := page.fn(ctx, page.clr)
   184  		if err != nil {
   185  			return err
   186  		}
   187  		page.clr = next
   188  		if !next.hasNextLink() || !next.IsEmpty() {
   189  			break
   190  		}
   191  	}
   192  	return nil
   193  }
   194  
   195  // Next advances to the next page of values.  If there was an error making
   196  // the request the page does not advance and the error is returned.
   197  // Deprecated: Use NextWithContext() instead.
   198  func (page *CapabilitiesListResultPage) Next() error {
   199  	return page.NextWithContext(context.Background())
   200  }
   201  
   202  // NotDone returns true if the page enumeration should be started or is not yet complete.
   203  func (page CapabilitiesListResultPage) NotDone() bool {
   204  	return !page.clr.IsEmpty()
   205  }
   206  
   207  // Response returns the raw server response from the last page request.
   208  func (page CapabilitiesListResultPage) Response() CapabilitiesListResult {
   209  	return page.clr
   210  }
   211  
   212  // Values returns the slice of values for the current page or nil if there are no values.
   213  func (page CapabilitiesListResultPage) Values() []CapabilityProperties {
   214  	if page.clr.IsEmpty() {
   215  		return nil
   216  	}
   217  	return *page.clr.Value
   218  }
   219  
   220  // Creates a new instance of the CapabilitiesListResultPage type.
   221  func NewCapabilitiesListResultPage(cur CapabilitiesListResult, getNextPage func(context.Context, CapabilitiesListResult) (CapabilitiesListResult, error)) CapabilitiesListResultPage {
   222  	return CapabilitiesListResultPage{
   223  		fn:  getNextPage,
   224  		clr: cur,
   225  	}
   226  }
   227  
   228  // CapabilityProperties location capabilities.
   229  type CapabilityProperties struct {
   230  	// Zone - READ-ONLY; zone name
   231  	Zone *string `json:"zone,omitempty"`
   232  	// SupportedHAMode - READ-ONLY; Supported high availability mode
   233  	SupportedHAMode *[]string `json:"supportedHAMode,omitempty"`
   234  	// SupportedGeoBackupRegions - READ-ONLY; supported geo backup regions
   235  	SupportedGeoBackupRegions *[]string `json:"supportedGeoBackupRegions,omitempty"`
   236  	// SupportedFlexibleServerEditions - READ-ONLY; A list of supported flexible server editions.
   237  	SupportedFlexibleServerEditions *[]ServerEditionCapability `json:"supportedFlexibleServerEditions,omitempty"`
   238  }
   239  
   240  // MarshalJSON is the custom marshaler for CapabilityProperties.
   241  func (cp CapabilityProperties) MarshalJSON() ([]byte, error) {
   242  	objectMap := make(map[string]interface{})
   243  	return json.Marshal(objectMap)
   244  }
   245  
   246  // CloudError an error response from the Batch service.
   247  type CloudError struct {
   248  	// Error - The resource management error response.
   249  	Error *ErrorResponse `json:"error,omitempty"`
   250  }
   251  
   252  // Configuration represents a Configuration.
   253  type Configuration struct {
   254  	autorest.Response `json:"-"`
   255  	// ConfigurationProperties - The properties of a configuration.
   256  	*ConfigurationProperties `json:"properties,omitempty"`
   257  	// SystemData - READ-ONLY; The system metadata relating to this resource.
   258  	SystemData *SystemData `json:"systemData,omitempty"`
   259  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   260  	ID *string `json:"id,omitempty"`
   261  	// Name - READ-ONLY; The name of the resource
   262  	Name *string `json:"name,omitempty"`
   263  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   264  	Type *string `json:"type,omitempty"`
   265  }
   266  
   267  // MarshalJSON is the custom marshaler for Configuration.
   268  func (c Configuration) MarshalJSON() ([]byte, error) {
   269  	objectMap := make(map[string]interface{})
   270  	if c.ConfigurationProperties != nil {
   271  		objectMap["properties"] = c.ConfigurationProperties
   272  	}
   273  	return json.Marshal(objectMap)
   274  }
   275  
   276  // UnmarshalJSON is the custom unmarshaler for Configuration struct.
   277  func (c *Configuration) UnmarshalJSON(body []byte) error {
   278  	var m map[string]*json.RawMessage
   279  	err := json.Unmarshal(body, &m)
   280  	if err != nil {
   281  		return err
   282  	}
   283  	for k, v := range m {
   284  		switch k {
   285  		case "properties":
   286  			if v != nil {
   287  				var configurationProperties ConfigurationProperties
   288  				err = json.Unmarshal(*v, &configurationProperties)
   289  				if err != nil {
   290  					return err
   291  				}
   292  				c.ConfigurationProperties = &configurationProperties
   293  			}
   294  		case "systemData":
   295  			if v != nil {
   296  				var systemData SystemData
   297  				err = json.Unmarshal(*v, &systemData)
   298  				if err != nil {
   299  					return err
   300  				}
   301  				c.SystemData = &systemData
   302  			}
   303  		case "id":
   304  			if v != nil {
   305  				var ID string
   306  				err = json.Unmarshal(*v, &ID)
   307  				if err != nil {
   308  					return err
   309  				}
   310  				c.ID = &ID
   311  			}
   312  		case "name":
   313  			if v != nil {
   314  				var name string
   315  				err = json.Unmarshal(*v, &name)
   316  				if err != nil {
   317  					return err
   318  				}
   319  				c.Name = &name
   320  			}
   321  		case "type":
   322  			if v != nil {
   323  				var typeVar string
   324  				err = json.Unmarshal(*v, &typeVar)
   325  				if err != nil {
   326  					return err
   327  				}
   328  				c.Type = &typeVar
   329  			}
   330  		}
   331  	}
   332  
   333  	return nil
   334  }
   335  
   336  // ConfigurationForBatchUpdate represents a Configuration.
   337  type ConfigurationForBatchUpdate struct {
   338  	// Name - Name of the configuration.
   339  	Name *string `json:"name,omitempty"`
   340  	// ConfigurationForBatchUpdateProperties - The properties can be updated for a configuration.
   341  	*ConfigurationForBatchUpdateProperties `json:"properties,omitempty"`
   342  }
   343  
   344  // MarshalJSON is the custom marshaler for ConfigurationForBatchUpdate.
   345  func (cfbu ConfigurationForBatchUpdate) MarshalJSON() ([]byte, error) {
   346  	objectMap := make(map[string]interface{})
   347  	if cfbu.Name != nil {
   348  		objectMap["name"] = cfbu.Name
   349  	}
   350  	if cfbu.ConfigurationForBatchUpdateProperties != nil {
   351  		objectMap["properties"] = cfbu.ConfigurationForBatchUpdateProperties
   352  	}
   353  	return json.Marshal(objectMap)
   354  }
   355  
   356  // UnmarshalJSON is the custom unmarshaler for ConfigurationForBatchUpdate struct.
   357  func (cfbu *ConfigurationForBatchUpdate) UnmarshalJSON(body []byte) error {
   358  	var m map[string]*json.RawMessage
   359  	err := json.Unmarshal(body, &m)
   360  	if err != nil {
   361  		return err
   362  	}
   363  	for k, v := range m {
   364  		switch k {
   365  		case "name":
   366  			if v != nil {
   367  				var name string
   368  				err = json.Unmarshal(*v, &name)
   369  				if err != nil {
   370  					return err
   371  				}
   372  				cfbu.Name = &name
   373  			}
   374  		case "properties":
   375  			if v != nil {
   376  				var configurationForBatchUpdateProperties ConfigurationForBatchUpdateProperties
   377  				err = json.Unmarshal(*v, &configurationForBatchUpdateProperties)
   378  				if err != nil {
   379  					return err
   380  				}
   381  				cfbu.ConfigurationForBatchUpdateProperties = &configurationForBatchUpdateProperties
   382  			}
   383  		}
   384  	}
   385  
   386  	return nil
   387  }
   388  
   389  // ConfigurationForBatchUpdateProperties the properties can be updated for a configuration.
   390  type ConfigurationForBatchUpdateProperties struct {
   391  	// Value - Value of the configuration.
   392  	Value *string `json:"value,omitempty"`
   393  	// Source - Source of the configuration.
   394  	Source *string `json:"source,omitempty"`
   395  }
   396  
   397  // ConfigurationListForBatchUpdate a list of server configurations to update.
   398  type ConfigurationListForBatchUpdate struct {
   399  	// Value - The list of server configurations.
   400  	Value *[]ConfigurationForBatchUpdate `json:"value,omitempty"`
   401  }
   402  
   403  // ConfigurationListResult a list of server configurations.
   404  type ConfigurationListResult struct {
   405  	autorest.Response `json:"-"`
   406  	// Value - The list of server configurations.
   407  	Value *[]Configuration `json:"value,omitempty"`
   408  	// NextLink - The link used to get the next page of operations.
   409  	NextLink *string `json:"nextLink,omitempty"`
   410  }
   411  
   412  // ConfigurationListResultIterator provides access to a complete listing of Configuration values.
   413  type ConfigurationListResultIterator struct {
   414  	i    int
   415  	page ConfigurationListResultPage
   416  }
   417  
   418  // NextWithContext advances to the next value.  If there was an error making
   419  // the request the iterator does not advance and the error is returned.
   420  func (iter *ConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) {
   421  	if tracing.IsEnabled() {
   422  		ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationListResultIterator.NextWithContext")
   423  		defer func() {
   424  			sc := -1
   425  			if iter.Response().Response.Response != nil {
   426  				sc = iter.Response().Response.Response.StatusCode
   427  			}
   428  			tracing.EndSpan(ctx, sc, err)
   429  		}()
   430  	}
   431  	iter.i++
   432  	if iter.i < len(iter.page.Values()) {
   433  		return nil
   434  	}
   435  	err = iter.page.NextWithContext(ctx)
   436  	if err != nil {
   437  		iter.i--
   438  		return err
   439  	}
   440  	iter.i = 0
   441  	return nil
   442  }
   443  
   444  // Next advances to the next value.  If there was an error making
   445  // the request the iterator does not advance and the error is returned.
   446  // Deprecated: Use NextWithContext() instead.
   447  func (iter *ConfigurationListResultIterator) Next() error {
   448  	return iter.NextWithContext(context.Background())
   449  }
   450  
   451  // NotDone returns true if the enumeration should be started or is not yet complete.
   452  func (iter ConfigurationListResultIterator) NotDone() bool {
   453  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   454  }
   455  
   456  // Response returns the raw server response from the last page request.
   457  func (iter ConfigurationListResultIterator) Response() ConfigurationListResult {
   458  	return iter.page.Response()
   459  }
   460  
   461  // Value returns the current value or a zero-initialized value if the
   462  // iterator has advanced beyond the end of the collection.
   463  func (iter ConfigurationListResultIterator) Value() Configuration {
   464  	if !iter.page.NotDone() {
   465  		return Configuration{}
   466  	}
   467  	return iter.page.Values()[iter.i]
   468  }
   469  
   470  // Creates a new instance of the ConfigurationListResultIterator type.
   471  func NewConfigurationListResultIterator(page ConfigurationListResultPage) ConfigurationListResultIterator {
   472  	return ConfigurationListResultIterator{page: page}
   473  }
   474  
   475  // IsEmpty returns true if the ListResult contains no values.
   476  func (clr ConfigurationListResult) IsEmpty() bool {
   477  	return clr.Value == nil || len(*clr.Value) == 0
   478  }
   479  
   480  // hasNextLink returns true if the NextLink is not empty.
   481  func (clr ConfigurationListResult) hasNextLink() bool {
   482  	return clr.NextLink != nil && len(*clr.NextLink) != 0
   483  }
   484  
   485  // configurationListResultPreparer prepares a request to retrieve the next set of results.
   486  // It returns nil if no more results exist.
   487  func (clr ConfigurationListResult) configurationListResultPreparer(ctx context.Context) (*http.Request, error) {
   488  	if !clr.hasNextLink() {
   489  		return nil, nil
   490  	}
   491  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   492  		autorest.AsJSON(),
   493  		autorest.AsGet(),
   494  		autorest.WithBaseURL(to.String(clr.NextLink)))
   495  }
   496  
   497  // ConfigurationListResultPage contains a page of Configuration values.
   498  type ConfigurationListResultPage struct {
   499  	fn  func(context.Context, ConfigurationListResult) (ConfigurationListResult, error)
   500  	clr ConfigurationListResult
   501  }
   502  
   503  // NextWithContext advances to the next page of values.  If there was an error making
   504  // the request the page does not advance and the error is returned.
   505  func (page *ConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) {
   506  	if tracing.IsEnabled() {
   507  		ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationListResultPage.NextWithContext")
   508  		defer func() {
   509  			sc := -1
   510  			if page.Response().Response.Response != nil {
   511  				sc = page.Response().Response.Response.StatusCode
   512  			}
   513  			tracing.EndSpan(ctx, sc, err)
   514  		}()
   515  	}
   516  	for {
   517  		next, err := page.fn(ctx, page.clr)
   518  		if err != nil {
   519  			return err
   520  		}
   521  		page.clr = next
   522  		if !next.hasNextLink() || !next.IsEmpty() {
   523  			break
   524  		}
   525  	}
   526  	return nil
   527  }
   528  
   529  // Next advances to the next page of values.  If there was an error making
   530  // the request the page does not advance and the error is returned.
   531  // Deprecated: Use NextWithContext() instead.
   532  func (page *ConfigurationListResultPage) Next() error {
   533  	return page.NextWithContext(context.Background())
   534  }
   535  
   536  // NotDone returns true if the page enumeration should be started or is not yet complete.
   537  func (page ConfigurationListResultPage) NotDone() bool {
   538  	return !page.clr.IsEmpty()
   539  }
   540  
   541  // Response returns the raw server response from the last page request.
   542  func (page ConfigurationListResultPage) Response() ConfigurationListResult {
   543  	return page.clr
   544  }
   545  
   546  // Values returns the slice of values for the current page or nil if there are no values.
   547  func (page ConfigurationListResultPage) Values() []Configuration {
   548  	if page.clr.IsEmpty() {
   549  		return nil
   550  	}
   551  	return *page.clr.Value
   552  }
   553  
   554  // Creates a new instance of the ConfigurationListResultPage type.
   555  func NewConfigurationListResultPage(cur ConfigurationListResult, getNextPage func(context.Context, ConfigurationListResult) (ConfigurationListResult, error)) ConfigurationListResultPage {
   556  	return ConfigurationListResultPage{
   557  		fn:  getNextPage,
   558  		clr: cur,
   559  	}
   560  }
   561  
   562  // ConfigurationProperties the properties of a configuration.
   563  type ConfigurationProperties struct {
   564  	// Value - Value of the configuration.
   565  	Value *string `json:"value,omitempty"`
   566  	// Description - READ-ONLY; Description of the configuration.
   567  	Description *string `json:"description,omitempty"`
   568  	// DefaultValue - READ-ONLY; Default value of the configuration.
   569  	DefaultValue *string `json:"defaultValue,omitempty"`
   570  	// DataType - READ-ONLY; Data type of the configuration.
   571  	DataType *string `json:"dataType,omitempty"`
   572  	// AllowedValues - READ-ONLY; Allowed values of the configuration.
   573  	AllowedValues *string `json:"allowedValues,omitempty"`
   574  	// Source - Source of the configuration. Possible values include: 'ConfigurationSourceSystemDefault', 'ConfigurationSourceUserOverride'
   575  	Source ConfigurationSource `json:"source,omitempty"`
   576  	// IsReadOnly - READ-ONLY; If is the configuration read only. Possible values include: 'IsReadOnlyTrue', 'IsReadOnlyFalse'
   577  	IsReadOnly IsReadOnly `json:"isReadOnly,omitempty"`
   578  	// IsConfigPendingRestart - READ-ONLY; If is the configuration pending restart or not. Possible values include: 'IsConfigPendingRestartTrue', 'IsConfigPendingRestartFalse'
   579  	IsConfigPendingRestart IsConfigPendingRestart `json:"isConfigPendingRestart,omitempty"`
   580  	// IsDynamicConfig - READ-ONLY; If is the configuration dynamic. Possible values include: 'IsDynamicConfigTrue', 'IsDynamicConfigFalse'
   581  	IsDynamicConfig IsDynamicConfig `json:"isDynamicConfig,omitempty"`
   582  }
   583  
   584  // MarshalJSON is the custom marshaler for ConfigurationProperties.
   585  func (cp ConfigurationProperties) MarshalJSON() ([]byte, error) {
   586  	objectMap := make(map[string]interface{})
   587  	if cp.Value != nil {
   588  		objectMap["value"] = cp.Value
   589  	}
   590  	if cp.Source != "" {
   591  		objectMap["source"] = cp.Source
   592  	}
   593  	return json.Marshal(objectMap)
   594  }
   595  
   596  // ConfigurationsBatchUpdateFuture an abstraction for monitoring and retrieving the results of a
   597  // long-running operation.
   598  type ConfigurationsBatchUpdateFuture struct {
   599  	azure.FutureAPI
   600  	// Result returns the result of the asynchronous operation.
   601  	// If the operation has not completed it will return an error.
   602  	Result func(ConfigurationsClient) (ConfigurationListResult, error)
   603  }
   604  
   605  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   606  func (future *ConfigurationsBatchUpdateFuture) UnmarshalJSON(body []byte) error {
   607  	var azFuture azure.Future
   608  	if err := json.Unmarshal(body, &azFuture); err != nil {
   609  		return err
   610  	}
   611  	future.FutureAPI = &azFuture
   612  	future.Result = future.result
   613  	return nil
   614  }
   615  
   616  // result is the default implementation for ConfigurationsBatchUpdateFuture.Result.
   617  func (future *ConfigurationsBatchUpdateFuture) result(client ConfigurationsClient) (clr ConfigurationListResult, err error) {
   618  	var done bool
   619  	done, err = future.DoneWithContext(context.Background(), client)
   620  	if err != nil {
   621  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ConfigurationsBatchUpdateFuture", "Result", future.Response(), "Polling failure")
   622  		return
   623  	}
   624  	if !done {
   625  		clr.Response.Response = future.Response()
   626  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.ConfigurationsBatchUpdateFuture")
   627  		return
   628  	}
   629  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   630  	if clr.Response.Response, err = future.GetResult(sender); err == nil && clr.Response.Response.StatusCode != http.StatusNoContent {
   631  		clr, err = client.BatchUpdateResponder(clr.Response.Response)
   632  		if err != nil {
   633  			err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ConfigurationsBatchUpdateFuture", "Result", clr.Response.Response, "Failure responding to request")
   634  		}
   635  	}
   636  	return
   637  }
   638  
   639  // ConfigurationsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
   640  // operation.
   641  type ConfigurationsUpdateFuture struct {
   642  	azure.FutureAPI
   643  	// Result returns the result of the asynchronous operation.
   644  	// If the operation has not completed it will return an error.
   645  	Result func(ConfigurationsClient) (Configuration, error)
   646  }
   647  
   648  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   649  func (future *ConfigurationsUpdateFuture) UnmarshalJSON(body []byte) error {
   650  	var azFuture azure.Future
   651  	if err := json.Unmarshal(body, &azFuture); err != nil {
   652  		return err
   653  	}
   654  	future.FutureAPI = &azFuture
   655  	future.Result = future.result
   656  	return nil
   657  }
   658  
   659  // result is the default implementation for ConfigurationsUpdateFuture.Result.
   660  func (future *ConfigurationsUpdateFuture) result(client ConfigurationsClient) (c Configuration, err error) {
   661  	var done bool
   662  	done, err = future.DoneWithContext(context.Background(), client)
   663  	if err != nil {
   664  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ConfigurationsUpdateFuture", "Result", future.Response(), "Polling failure")
   665  		return
   666  	}
   667  	if !done {
   668  		c.Response.Response = future.Response()
   669  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.ConfigurationsUpdateFuture")
   670  		return
   671  	}
   672  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   673  	if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent {
   674  		c, err = client.UpdateResponder(c.Response.Response)
   675  		if err != nil {
   676  			err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ConfigurationsUpdateFuture", "Result", c.Response.Response, "Failure responding to request")
   677  		}
   678  	}
   679  	return
   680  }
   681  
   682  // Database represents a Database.
   683  type Database struct {
   684  	autorest.Response `json:"-"`
   685  	// DatabaseProperties - The properties of a database.
   686  	*DatabaseProperties `json:"properties,omitempty"`
   687  	// SystemData - READ-ONLY; The system metadata relating to this resource.
   688  	SystemData *SystemData `json:"systemData,omitempty"`
   689  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   690  	ID *string `json:"id,omitempty"`
   691  	// Name - READ-ONLY; The name of the resource
   692  	Name *string `json:"name,omitempty"`
   693  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   694  	Type *string `json:"type,omitempty"`
   695  }
   696  
   697  // MarshalJSON is the custom marshaler for Database.
   698  func (d Database) MarshalJSON() ([]byte, error) {
   699  	objectMap := make(map[string]interface{})
   700  	if d.DatabaseProperties != nil {
   701  		objectMap["properties"] = d.DatabaseProperties
   702  	}
   703  	return json.Marshal(objectMap)
   704  }
   705  
   706  // UnmarshalJSON is the custom unmarshaler for Database struct.
   707  func (d *Database) UnmarshalJSON(body []byte) error {
   708  	var m map[string]*json.RawMessage
   709  	err := json.Unmarshal(body, &m)
   710  	if err != nil {
   711  		return err
   712  	}
   713  	for k, v := range m {
   714  		switch k {
   715  		case "properties":
   716  			if v != nil {
   717  				var databaseProperties DatabaseProperties
   718  				err = json.Unmarshal(*v, &databaseProperties)
   719  				if err != nil {
   720  					return err
   721  				}
   722  				d.DatabaseProperties = &databaseProperties
   723  			}
   724  		case "systemData":
   725  			if v != nil {
   726  				var systemData SystemData
   727  				err = json.Unmarshal(*v, &systemData)
   728  				if err != nil {
   729  					return err
   730  				}
   731  				d.SystemData = &systemData
   732  			}
   733  		case "id":
   734  			if v != nil {
   735  				var ID string
   736  				err = json.Unmarshal(*v, &ID)
   737  				if err != nil {
   738  					return err
   739  				}
   740  				d.ID = &ID
   741  			}
   742  		case "name":
   743  			if v != nil {
   744  				var name string
   745  				err = json.Unmarshal(*v, &name)
   746  				if err != nil {
   747  					return err
   748  				}
   749  				d.Name = &name
   750  			}
   751  		case "type":
   752  			if v != nil {
   753  				var typeVar string
   754  				err = json.Unmarshal(*v, &typeVar)
   755  				if err != nil {
   756  					return err
   757  				}
   758  				d.Type = &typeVar
   759  			}
   760  		}
   761  	}
   762  
   763  	return nil
   764  }
   765  
   766  // DatabaseListResult a List of databases.
   767  type DatabaseListResult struct {
   768  	autorest.Response `json:"-"`
   769  	// Value - The list of databases housed in a server
   770  	Value *[]Database `json:"value,omitempty"`
   771  	// NextLink - The link used to get the next page of operations.
   772  	NextLink *string `json:"nextLink,omitempty"`
   773  }
   774  
   775  // DatabaseListResultIterator provides access to a complete listing of Database values.
   776  type DatabaseListResultIterator struct {
   777  	i    int
   778  	page DatabaseListResultPage
   779  }
   780  
   781  // NextWithContext advances to the next value.  If there was an error making
   782  // the request the iterator does not advance and the error is returned.
   783  func (iter *DatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
   784  	if tracing.IsEnabled() {
   785  		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseListResultIterator.NextWithContext")
   786  		defer func() {
   787  			sc := -1
   788  			if iter.Response().Response.Response != nil {
   789  				sc = iter.Response().Response.Response.StatusCode
   790  			}
   791  			tracing.EndSpan(ctx, sc, err)
   792  		}()
   793  	}
   794  	iter.i++
   795  	if iter.i < len(iter.page.Values()) {
   796  		return nil
   797  	}
   798  	err = iter.page.NextWithContext(ctx)
   799  	if err != nil {
   800  		iter.i--
   801  		return err
   802  	}
   803  	iter.i = 0
   804  	return nil
   805  }
   806  
   807  // Next advances to the next value.  If there was an error making
   808  // the request the iterator does not advance and the error is returned.
   809  // Deprecated: Use NextWithContext() instead.
   810  func (iter *DatabaseListResultIterator) Next() error {
   811  	return iter.NextWithContext(context.Background())
   812  }
   813  
   814  // NotDone returns true if the enumeration should be started or is not yet complete.
   815  func (iter DatabaseListResultIterator) NotDone() bool {
   816  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   817  }
   818  
   819  // Response returns the raw server response from the last page request.
   820  func (iter DatabaseListResultIterator) Response() DatabaseListResult {
   821  	return iter.page.Response()
   822  }
   823  
   824  // Value returns the current value or a zero-initialized value if the
   825  // iterator has advanced beyond the end of the collection.
   826  func (iter DatabaseListResultIterator) Value() Database {
   827  	if !iter.page.NotDone() {
   828  		return Database{}
   829  	}
   830  	return iter.page.Values()[iter.i]
   831  }
   832  
   833  // Creates a new instance of the DatabaseListResultIterator type.
   834  func NewDatabaseListResultIterator(page DatabaseListResultPage) DatabaseListResultIterator {
   835  	return DatabaseListResultIterator{page: page}
   836  }
   837  
   838  // IsEmpty returns true if the ListResult contains no values.
   839  func (dlr DatabaseListResult) IsEmpty() bool {
   840  	return dlr.Value == nil || len(*dlr.Value) == 0
   841  }
   842  
   843  // hasNextLink returns true if the NextLink is not empty.
   844  func (dlr DatabaseListResult) hasNextLink() bool {
   845  	return dlr.NextLink != nil && len(*dlr.NextLink) != 0
   846  }
   847  
   848  // databaseListResultPreparer prepares a request to retrieve the next set of results.
   849  // It returns nil if no more results exist.
   850  func (dlr DatabaseListResult) databaseListResultPreparer(ctx context.Context) (*http.Request, error) {
   851  	if !dlr.hasNextLink() {
   852  		return nil, nil
   853  	}
   854  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   855  		autorest.AsJSON(),
   856  		autorest.AsGet(),
   857  		autorest.WithBaseURL(to.String(dlr.NextLink)))
   858  }
   859  
   860  // DatabaseListResultPage contains a page of Database values.
   861  type DatabaseListResultPage struct {
   862  	fn  func(context.Context, DatabaseListResult) (DatabaseListResult, error)
   863  	dlr DatabaseListResult
   864  }
   865  
   866  // NextWithContext advances to the next page of values.  If there was an error making
   867  // the request the page does not advance and the error is returned.
   868  func (page *DatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
   869  	if tracing.IsEnabled() {
   870  		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseListResultPage.NextWithContext")
   871  		defer func() {
   872  			sc := -1
   873  			if page.Response().Response.Response != nil {
   874  				sc = page.Response().Response.Response.StatusCode
   875  			}
   876  			tracing.EndSpan(ctx, sc, err)
   877  		}()
   878  	}
   879  	for {
   880  		next, err := page.fn(ctx, page.dlr)
   881  		if err != nil {
   882  			return err
   883  		}
   884  		page.dlr = next
   885  		if !next.hasNextLink() || !next.IsEmpty() {
   886  			break
   887  		}
   888  	}
   889  	return nil
   890  }
   891  
   892  // Next advances to the next page of values.  If there was an error making
   893  // the request the page does not advance and the error is returned.
   894  // Deprecated: Use NextWithContext() instead.
   895  func (page *DatabaseListResultPage) Next() error {
   896  	return page.NextWithContext(context.Background())
   897  }
   898  
   899  // NotDone returns true if the page enumeration should be started or is not yet complete.
   900  func (page DatabaseListResultPage) NotDone() bool {
   901  	return !page.dlr.IsEmpty()
   902  }
   903  
   904  // Response returns the raw server response from the last page request.
   905  func (page DatabaseListResultPage) Response() DatabaseListResult {
   906  	return page.dlr
   907  }
   908  
   909  // Values returns the slice of values for the current page or nil if there are no values.
   910  func (page DatabaseListResultPage) Values() []Database {
   911  	if page.dlr.IsEmpty() {
   912  		return nil
   913  	}
   914  	return *page.dlr.Value
   915  }
   916  
   917  // Creates a new instance of the DatabaseListResultPage type.
   918  func NewDatabaseListResultPage(cur DatabaseListResult, getNextPage func(context.Context, DatabaseListResult) (DatabaseListResult, error)) DatabaseListResultPage {
   919  	return DatabaseListResultPage{
   920  		fn:  getNextPage,
   921  		dlr: cur,
   922  	}
   923  }
   924  
   925  // DatabaseProperties the properties of a database.
   926  type DatabaseProperties struct {
   927  	// Charset - The charset of the database.
   928  	Charset *string `json:"charset,omitempty"`
   929  	// Collation - The collation of the database.
   930  	Collation *string `json:"collation,omitempty"`
   931  }
   932  
   933  // DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
   934  // operation.
   935  type DatabasesCreateOrUpdateFuture struct {
   936  	azure.FutureAPI
   937  	// Result returns the result of the asynchronous operation.
   938  	// If the operation has not completed it will return an error.
   939  	Result func(DatabasesClient) (Database, error)
   940  }
   941  
   942  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   943  func (future *DatabasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
   944  	var azFuture azure.Future
   945  	if err := json.Unmarshal(body, &azFuture); err != nil {
   946  		return err
   947  	}
   948  	future.FutureAPI = &azFuture
   949  	future.Result = future.result
   950  	return nil
   951  }
   952  
   953  // result is the default implementation for DatabasesCreateOrUpdateFuture.Result.
   954  func (future *DatabasesCreateOrUpdateFuture) result(client DatabasesClient) (d Database, err error) {
   955  	var done bool
   956  	done, err = future.DoneWithContext(context.Background(), client)
   957  	if err != nil {
   958  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
   959  		return
   960  	}
   961  	if !done {
   962  		d.Response.Response = future.Response()
   963  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.DatabasesCreateOrUpdateFuture")
   964  		return
   965  	}
   966  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   967  	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
   968  		d, err = client.CreateOrUpdateResponder(d.Response.Response)
   969  		if err != nil {
   970  			err = autorest.NewErrorWithError(err, "mysqlflexibleservers.DatabasesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
   971  		}
   972  	}
   973  	return
   974  }
   975  
   976  // DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
   977  // operation.
   978  type DatabasesDeleteFuture struct {
   979  	azure.FutureAPI
   980  	// Result returns the result of the asynchronous operation.
   981  	// If the operation has not completed it will return an error.
   982  	Result func(DatabasesClient) (autorest.Response, error)
   983  }
   984  
   985  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   986  func (future *DatabasesDeleteFuture) UnmarshalJSON(body []byte) error {
   987  	var azFuture azure.Future
   988  	if err := json.Unmarshal(body, &azFuture); err != nil {
   989  		return err
   990  	}
   991  	future.FutureAPI = &azFuture
   992  	future.Result = future.result
   993  	return nil
   994  }
   995  
   996  // result is the default implementation for DatabasesDeleteFuture.Result.
   997  func (future *DatabasesDeleteFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
   998  	var done bool
   999  	done, err = future.DoneWithContext(context.Background(), client)
  1000  	if err != nil {
  1001  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure")
  1002  		return
  1003  	}
  1004  	if !done {
  1005  		ar.Response = future.Response()
  1006  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.DatabasesDeleteFuture")
  1007  		return
  1008  	}
  1009  	ar.Response = future.Response()
  1010  	return
  1011  }
  1012  
  1013  // DelegatedSubnetUsage delegated subnet usage data.
  1014  type DelegatedSubnetUsage struct {
  1015  	// SubnetName - READ-ONLY; name of the subnet
  1016  	SubnetName *string `json:"subnetName,omitempty"`
  1017  	// Usage - READ-ONLY; Number of used delegated subnets
  1018  	Usage *int64 `json:"usage,omitempty"`
  1019  }
  1020  
  1021  // MarshalJSON is the custom marshaler for DelegatedSubnetUsage.
  1022  func (dsu DelegatedSubnetUsage) MarshalJSON() ([]byte, error) {
  1023  	objectMap := make(map[string]interface{})
  1024  	return json.Marshal(objectMap)
  1025  }
  1026  
  1027  // ErrorAdditionalInfo the resource management error additional info.
  1028  type ErrorAdditionalInfo struct {
  1029  	// Type - READ-ONLY; The additional info type.
  1030  	Type *string `json:"type,omitempty"`
  1031  	// Info - READ-ONLY; The additional info.
  1032  	Info interface{} `json:"info,omitempty"`
  1033  }
  1034  
  1035  // MarshalJSON is the custom marshaler for ErrorAdditionalInfo.
  1036  func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
  1037  	objectMap := make(map[string]interface{})
  1038  	return json.Marshal(objectMap)
  1039  }
  1040  
  1041  // ErrorResponse common error response for all Azure Resource Manager APIs to return error details for
  1042  // failed operations. (This also follows the OData error response format.)
  1043  type ErrorResponse struct {
  1044  	// Code - READ-ONLY; The error code.
  1045  	Code *string `json:"code,omitempty"`
  1046  	// Message - READ-ONLY; The error message.
  1047  	Message *string `json:"message,omitempty"`
  1048  	// Target - READ-ONLY; The error target.
  1049  	Target *string `json:"target,omitempty"`
  1050  	// Details - READ-ONLY; The error details.
  1051  	Details *[]ErrorResponse `json:"details,omitempty"`
  1052  	// AdditionalInfo - READ-ONLY; The error additional info.
  1053  	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
  1054  }
  1055  
  1056  // MarshalJSON is the custom marshaler for ErrorResponse.
  1057  func (er ErrorResponse) MarshalJSON() ([]byte, error) {
  1058  	objectMap := make(map[string]interface{})
  1059  	return json.Marshal(objectMap)
  1060  }
  1061  
  1062  // FirewallRule represents a server firewall rule.
  1063  type FirewallRule struct {
  1064  	autorest.Response `json:"-"`
  1065  	// FirewallRuleProperties - The properties of a firewall rule.
  1066  	*FirewallRuleProperties `json:"properties,omitempty"`
  1067  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  1068  	SystemData *SystemData `json:"systemData,omitempty"`
  1069  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1070  	ID *string `json:"id,omitempty"`
  1071  	// Name - READ-ONLY; The name of the resource
  1072  	Name *string `json:"name,omitempty"`
  1073  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1074  	Type *string `json:"type,omitempty"`
  1075  }
  1076  
  1077  // MarshalJSON is the custom marshaler for FirewallRule.
  1078  func (fr FirewallRule) MarshalJSON() ([]byte, error) {
  1079  	objectMap := make(map[string]interface{})
  1080  	if fr.FirewallRuleProperties != nil {
  1081  		objectMap["properties"] = fr.FirewallRuleProperties
  1082  	}
  1083  	return json.Marshal(objectMap)
  1084  }
  1085  
  1086  // UnmarshalJSON is the custom unmarshaler for FirewallRule struct.
  1087  func (fr *FirewallRule) UnmarshalJSON(body []byte) error {
  1088  	var m map[string]*json.RawMessage
  1089  	err := json.Unmarshal(body, &m)
  1090  	if err != nil {
  1091  		return err
  1092  	}
  1093  	for k, v := range m {
  1094  		switch k {
  1095  		case "properties":
  1096  			if v != nil {
  1097  				var firewallRuleProperties FirewallRuleProperties
  1098  				err = json.Unmarshal(*v, &firewallRuleProperties)
  1099  				if err != nil {
  1100  					return err
  1101  				}
  1102  				fr.FirewallRuleProperties = &firewallRuleProperties
  1103  			}
  1104  		case "systemData":
  1105  			if v != nil {
  1106  				var systemData SystemData
  1107  				err = json.Unmarshal(*v, &systemData)
  1108  				if err != nil {
  1109  					return err
  1110  				}
  1111  				fr.SystemData = &systemData
  1112  			}
  1113  		case "id":
  1114  			if v != nil {
  1115  				var ID string
  1116  				err = json.Unmarshal(*v, &ID)
  1117  				if err != nil {
  1118  					return err
  1119  				}
  1120  				fr.ID = &ID
  1121  			}
  1122  		case "name":
  1123  			if v != nil {
  1124  				var name string
  1125  				err = json.Unmarshal(*v, &name)
  1126  				if err != nil {
  1127  					return err
  1128  				}
  1129  				fr.Name = &name
  1130  			}
  1131  		case "type":
  1132  			if v != nil {
  1133  				var typeVar string
  1134  				err = json.Unmarshal(*v, &typeVar)
  1135  				if err != nil {
  1136  					return err
  1137  				}
  1138  				fr.Type = &typeVar
  1139  			}
  1140  		}
  1141  	}
  1142  
  1143  	return nil
  1144  }
  1145  
  1146  // FirewallRuleListResult a list of firewall rules.
  1147  type FirewallRuleListResult struct {
  1148  	autorest.Response `json:"-"`
  1149  	// Value - The list of firewall rules in a server.
  1150  	Value *[]FirewallRule `json:"value,omitempty"`
  1151  	// NextLink - The link used to get the next page of operations.
  1152  	NextLink *string `json:"nextLink,omitempty"`
  1153  }
  1154  
  1155  // FirewallRuleListResultIterator provides access to a complete listing of FirewallRule values.
  1156  type FirewallRuleListResultIterator struct {
  1157  	i    int
  1158  	page FirewallRuleListResultPage
  1159  }
  1160  
  1161  // NextWithContext advances to the next value.  If there was an error making
  1162  // the request the iterator does not advance and the error is returned.
  1163  func (iter *FirewallRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1164  	if tracing.IsEnabled() {
  1165  		ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRuleListResultIterator.NextWithContext")
  1166  		defer func() {
  1167  			sc := -1
  1168  			if iter.Response().Response.Response != nil {
  1169  				sc = iter.Response().Response.Response.StatusCode
  1170  			}
  1171  			tracing.EndSpan(ctx, sc, err)
  1172  		}()
  1173  	}
  1174  	iter.i++
  1175  	if iter.i < len(iter.page.Values()) {
  1176  		return nil
  1177  	}
  1178  	err = iter.page.NextWithContext(ctx)
  1179  	if err != nil {
  1180  		iter.i--
  1181  		return err
  1182  	}
  1183  	iter.i = 0
  1184  	return nil
  1185  }
  1186  
  1187  // Next advances to the next value.  If there was an error making
  1188  // the request the iterator does not advance and the error is returned.
  1189  // Deprecated: Use NextWithContext() instead.
  1190  func (iter *FirewallRuleListResultIterator) Next() error {
  1191  	return iter.NextWithContext(context.Background())
  1192  }
  1193  
  1194  // NotDone returns true if the enumeration should be started or is not yet complete.
  1195  func (iter FirewallRuleListResultIterator) NotDone() bool {
  1196  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1197  }
  1198  
  1199  // Response returns the raw server response from the last page request.
  1200  func (iter FirewallRuleListResultIterator) Response() FirewallRuleListResult {
  1201  	return iter.page.Response()
  1202  }
  1203  
  1204  // Value returns the current value or a zero-initialized value if the
  1205  // iterator has advanced beyond the end of the collection.
  1206  func (iter FirewallRuleListResultIterator) Value() FirewallRule {
  1207  	if !iter.page.NotDone() {
  1208  		return FirewallRule{}
  1209  	}
  1210  	return iter.page.Values()[iter.i]
  1211  }
  1212  
  1213  // Creates a new instance of the FirewallRuleListResultIterator type.
  1214  func NewFirewallRuleListResultIterator(page FirewallRuleListResultPage) FirewallRuleListResultIterator {
  1215  	return FirewallRuleListResultIterator{page: page}
  1216  }
  1217  
  1218  // IsEmpty returns true if the ListResult contains no values.
  1219  func (frlr FirewallRuleListResult) IsEmpty() bool {
  1220  	return frlr.Value == nil || len(*frlr.Value) == 0
  1221  }
  1222  
  1223  // hasNextLink returns true if the NextLink is not empty.
  1224  func (frlr FirewallRuleListResult) hasNextLink() bool {
  1225  	return frlr.NextLink != nil && len(*frlr.NextLink) != 0
  1226  }
  1227  
  1228  // firewallRuleListResultPreparer prepares a request to retrieve the next set of results.
  1229  // It returns nil if no more results exist.
  1230  func (frlr FirewallRuleListResult) firewallRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
  1231  	if !frlr.hasNextLink() {
  1232  		return nil, nil
  1233  	}
  1234  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1235  		autorest.AsJSON(),
  1236  		autorest.AsGet(),
  1237  		autorest.WithBaseURL(to.String(frlr.NextLink)))
  1238  }
  1239  
  1240  // FirewallRuleListResultPage contains a page of FirewallRule values.
  1241  type FirewallRuleListResultPage struct {
  1242  	fn   func(context.Context, FirewallRuleListResult) (FirewallRuleListResult, error)
  1243  	frlr FirewallRuleListResult
  1244  }
  1245  
  1246  // NextWithContext advances to the next page of values.  If there was an error making
  1247  // the request the page does not advance and the error is returned.
  1248  func (page *FirewallRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
  1249  	if tracing.IsEnabled() {
  1250  		ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRuleListResultPage.NextWithContext")
  1251  		defer func() {
  1252  			sc := -1
  1253  			if page.Response().Response.Response != nil {
  1254  				sc = page.Response().Response.Response.StatusCode
  1255  			}
  1256  			tracing.EndSpan(ctx, sc, err)
  1257  		}()
  1258  	}
  1259  	for {
  1260  		next, err := page.fn(ctx, page.frlr)
  1261  		if err != nil {
  1262  			return err
  1263  		}
  1264  		page.frlr = next
  1265  		if !next.hasNextLink() || !next.IsEmpty() {
  1266  			break
  1267  		}
  1268  	}
  1269  	return nil
  1270  }
  1271  
  1272  // Next advances to the next page of values.  If there was an error making
  1273  // the request the page does not advance and the error is returned.
  1274  // Deprecated: Use NextWithContext() instead.
  1275  func (page *FirewallRuleListResultPage) Next() error {
  1276  	return page.NextWithContext(context.Background())
  1277  }
  1278  
  1279  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1280  func (page FirewallRuleListResultPage) NotDone() bool {
  1281  	return !page.frlr.IsEmpty()
  1282  }
  1283  
  1284  // Response returns the raw server response from the last page request.
  1285  func (page FirewallRuleListResultPage) Response() FirewallRuleListResult {
  1286  	return page.frlr
  1287  }
  1288  
  1289  // Values returns the slice of values for the current page or nil if there are no values.
  1290  func (page FirewallRuleListResultPage) Values() []FirewallRule {
  1291  	if page.frlr.IsEmpty() {
  1292  		return nil
  1293  	}
  1294  	return *page.frlr.Value
  1295  }
  1296  
  1297  // Creates a new instance of the FirewallRuleListResultPage type.
  1298  func NewFirewallRuleListResultPage(cur FirewallRuleListResult, getNextPage func(context.Context, FirewallRuleListResult) (FirewallRuleListResult, error)) FirewallRuleListResultPage {
  1299  	return FirewallRuleListResultPage{
  1300  		fn:   getNextPage,
  1301  		frlr: cur,
  1302  	}
  1303  }
  1304  
  1305  // FirewallRuleProperties the properties of a server firewall rule.
  1306  type FirewallRuleProperties struct {
  1307  	// StartIPAddress - The start IP address of the server firewall rule. Must be IPv4 format.
  1308  	StartIPAddress *string `json:"startIpAddress,omitempty"`
  1309  	// EndIPAddress - The end IP address of the server firewall rule. Must be IPv4 format.
  1310  	EndIPAddress *string `json:"endIpAddress,omitempty"`
  1311  }
  1312  
  1313  // FirewallRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
  1314  // long-running operation.
  1315  type FirewallRulesCreateOrUpdateFuture struct {
  1316  	azure.FutureAPI
  1317  	// Result returns the result of the asynchronous operation.
  1318  	// If the operation has not completed it will return an error.
  1319  	Result func(FirewallRulesClient) (FirewallRule, error)
  1320  }
  1321  
  1322  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1323  func (future *FirewallRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  1324  	var azFuture azure.Future
  1325  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1326  		return err
  1327  	}
  1328  	future.FutureAPI = &azFuture
  1329  	future.Result = future.result
  1330  	return nil
  1331  }
  1332  
  1333  // result is the default implementation for FirewallRulesCreateOrUpdateFuture.Result.
  1334  func (future *FirewallRulesCreateOrUpdateFuture) result(client FirewallRulesClient) (fr FirewallRule, err error) {
  1335  	var done bool
  1336  	done, err = future.DoneWithContext(context.Background(), client)
  1337  	if err != nil {
  1338  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.FirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  1339  		return
  1340  	}
  1341  	if !done {
  1342  		fr.Response.Response = future.Response()
  1343  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.FirewallRulesCreateOrUpdateFuture")
  1344  		return
  1345  	}
  1346  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1347  	if fr.Response.Response, err = future.GetResult(sender); err == nil && fr.Response.Response.StatusCode != http.StatusNoContent {
  1348  		fr, err = client.CreateOrUpdateResponder(fr.Response.Response)
  1349  		if err != nil {
  1350  			err = autorest.NewErrorWithError(err, "mysqlflexibleservers.FirewallRulesCreateOrUpdateFuture", "Result", fr.Response.Response, "Failure responding to request")
  1351  		}
  1352  	}
  1353  	return
  1354  }
  1355  
  1356  // FirewallRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  1357  // operation.
  1358  type FirewallRulesDeleteFuture struct {
  1359  	azure.FutureAPI
  1360  	// Result returns the result of the asynchronous operation.
  1361  	// If the operation has not completed it will return an error.
  1362  	Result func(FirewallRulesClient) (autorest.Response, error)
  1363  }
  1364  
  1365  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1366  func (future *FirewallRulesDeleteFuture) UnmarshalJSON(body []byte) error {
  1367  	var azFuture azure.Future
  1368  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1369  		return err
  1370  	}
  1371  	future.FutureAPI = &azFuture
  1372  	future.Result = future.result
  1373  	return nil
  1374  }
  1375  
  1376  // result is the default implementation for FirewallRulesDeleteFuture.Result.
  1377  func (future *FirewallRulesDeleteFuture) result(client FirewallRulesClient) (ar autorest.Response, err error) {
  1378  	var done bool
  1379  	done, err = future.DoneWithContext(context.Background(), client)
  1380  	if err != nil {
  1381  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.FirewallRulesDeleteFuture", "Result", future.Response(), "Polling failure")
  1382  		return
  1383  	}
  1384  	if !done {
  1385  		ar.Response = future.Response()
  1386  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.FirewallRulesDeleteFuture")
  1387  		return
  1388  	}
  1389  	ar.Response = future.Response()
  1390  	return
  1391  }
  1392  
  1393  // GetPrivateDNSZoneSuffixResponse the response of get private dns zone suffix.
  1394  type GetPrivateDNSZoneSuffixResponse struct {
  1395  	autorest.Response `json:"-"`
  1396  	// PrivateDNSZoneSuffix - Represents the private DNS zone suffix.
  1397  	PrivateDNSZoneSuffix *string `json:"privateDnsZoneSuffix,omitempty"`
  1398  }
  1399  
  1400  // HighAvailability network related properties of a server
  1401  type HighAvailability struct {
  1402  	// Mode - High availability mode for a server. Possible values include: 'HighAvailabilityModeDisabled', 'HighAvailabilityModeZoneRedundant', 'HighAvailabilityModeSameZone'
  1403  	Mode HighAvailabilityMode `json:"mode,omitempty"`
  1404  	// State - READ-ONLY; The state of server high availability. Possible values include: 'HighAvailabilityStateNotEnabled', 'HighAvailabilityStateCreatingStandby', 'HighAvailabilityStateHealthy', 'HighAvailabilityStateFailingOver', 'HighAvailabilityStateRemovingStandby'
  1405  	State HighAvailabilityState `json:"state,omitempty"`
  1406  	// StandbyAvailabilityZone - Availability zone of the standby server.
  1407  	StandbyAvailabilityZone *string `json:"standbyAvailabilityZone,omitempty"`
  1408  }
  1409  
  1410  // MarshalJSON is the custom marshaler for HighAvailability.
  1411  func (ha HighAvailability) MarshalJSON() ([]byte, error) {
  1412  	objectMap := make(map[string]interface{})
  1413  	if ha.Mode != "" {
  1414  		objectMap["mode"] = ha.Mode
  1415  	}
  1416  	if ha.StandbyAvailabilityZone != nil {
  1417  		objectMap["standbyAvailabilityZone"] = ha.StandbyAvailabilityZone
  1418  	}
  1419  	return json.Marshal(objectMap)
  1420  }
  1421  
  1422  // MaintenanceWindow maintenance window of a server.
  1423  type MaintenanceWindow struct {
  1424  	// CustomWindow - indicates whether custom window is enabled or disabled
  1425  	CustomWindow *string `json:"customWindow,omitempty"`
  1426  	// StartHour - start hour for maintenance window
  1427  	StartHour *int32 `json:"startHour,omitempty"`
  1428  	// StartMinute - start minute for maintenance window
  1429  	StartMinute *int32 `json:"startMinute,omitempty"`
  1430  	// DayOfWeek - day of week for maintenance window
  1431  	DayOfWeek *int32 `json:"dayOfWeek,omitempty"`
  1432  }
  1433  
  1434  // NameAvailability represents a resource name availability.
  1435  type NameAvailability struct {
  1436  	autorest.Response `json:"-"`
  1437  	// Message - Error Message.
  1438  	Message *string `json:"message,omitempty"`
  1439  	// NameAvailable - Indicates whether the resource name is available.
  1440  	NameAvailable *bool `json:"nameAvailable,omitempty"`
  1441  	// Reason - Reason for name being unavailable.
  1442  	Reason *string `json:"reason,omitempty"`
  1443  }
  1444  
  1445  // NameAvailabilityRequest request from client to check resource name availability.
  1446  type NameAvailabilityRequest struct {
  1447  	// Name - Resource name to verify.
  1448  	Name *string `json:"name,omitempty"`
  1449  	// Type - Resource type used for verification.
  1450  	Type *string `json:"type,omitempty"`
  1451  }
  1452  
  1453  // Network network related properties of a server
  1454  type Network struct {
  1455  	// PublicNetworkAccess - READ-ONLY; Whether or not public network access is allowed for this server. Value is 'Disabled' when server has VNet integration. Possible values include: 'EnableStatusEnumEnabled', 'EnableStatusEnumDisabled'
  1456  	PublicNetworkAccess EnableStatusEnum `json:"publicNetworkAccess,omitempty"`
  1457  	// DelegatedSubnetResourceID - Delegated subnet resource id used to setup vnet for a server.
  1458  	DelegatedSubnetResourceID *string `json:"delegatedSubnetResourceId,omitempty"`
  1459  	// PrivateDNSZoneResourceID - Private DNS zone resource id.
  1460  	PrivateDNSZoneResourceID *string `json:"privateDnsZoneResourceId,omitempty"`
  1461  }
  1462  
  1463  // MarshalJSON is the custom marshaler for Network.
  1464  func (n Network) MarshalJSON() ([]byte, error) {
  1465  	objectMap := make(map[string]interface{})
  1466  	if n.DelegatedSubnetResourceID != nil {
  1467  		objectMap["delegatedSubnetResourceId"] = n.DelegatedSubnetResourceID
  1468  	}
  1469  	if n.PrivateDNSZoneResourceID != nil {
  1470  		objectMap["privateDnsZoneResourceId"] = n.PrivateDNSZoneResourceID
  1471  	}
  1472  	return json.Marshal(objectMap)
  1473  }
  1474  
  1475  // Operation REST API operation definition.
  1476  type Operation struct {
  1477  	// Name - The name of the operation being performed on this particular object.
  1478  	Name *string `json:"name,omitempty"`
  1479  	// Display - The localized display information for this particular operation or action.
  1480  	Display *OperationDisplay `json:"display,omitempty"`
  1481  	// Origin - The intended executor of the operation.
  1482  	Origin *string `json:"origin,omitempty"`
  1483  	// Properties - Additional descriptions for the operation.
  1484  	Properties map[string]interface{} `json:"properties"`
  1485  }
  1486  
  1487  // MarshalJSON is the custom marshaler for Operation.
  1488  func (o Operation) MarshalJSON() ([]byte, error) {
  1489  	objectMap := make(map[string]interface{})
  1490  	if o.Name != nil {
  1491  		objectMap["name"] = o.Name
  1492  	}
  1493  	if o.Display != nil {
  1494  		objectMap["display"] = o.Display
  1495  	}
  1496  	if o.Origin != nil {
  1497  		objectMap["origin"] = o.Origin
  1498  	}
  1499  	if o.Properties != nil {
  1500  		objectMap["properties"] = o.Properties
  1501  	}
  1502  	return json.Marshal(objectMap)
  1503  }
  1504  
  1505  // OperationDisplay display metadata associated with the operation.
  1506  type OperationDisplay struct {
  1507  	// Provider - Operation resource provider name.
  1508  	Provider *string `json:"provider,omitempty"`
  1509  	// Resource - Resource on which the operation is performed.
  1510  	Resource *string `json:"resource,omitempty"`
  1511  	// Operation - Localized friendly name for the operation.
  1512  	Operation *string `json:"operation,omitempty"`
  1513  	// Description - Operation description.
  1514  	Description *string `json:"description,omitempty"`
  1515  }
  1516  
  1517  // OperationListResult a list of resource provider operations.
  1518  type OperationListResult struct {
  1519  	autorest.Response `json:"-"`
  1520  	// Value - Collection of available operation details
  1521  	Value *[]Operation `json:"value,omitempty"`
  1522  	// NextLink - URL client should use to fetch the next page (per server side paging).
  1523  	NextLink *string `json:"nextLink,omitempty"`
  1524  }
  1525  
  1526  // OperationListResultIterator provides access to a complete listing of Operation values.
  1527  type OperationListResultIterator struct {
  1528  	i    int
  1529  	page OperationListResultPage
  1530  }
  1531  
  1532  // NextWithContext advances to the next value.  If there was an error making
  1533  // the request the iterator does not advance and the error is returned.
  1534  func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1535  	if tracing.IsEnabled() {
  1536  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
  1537  		defer func() {
  1538  			sc := -1
  1539  			if iter.Response().Response.Response != nil {
  1540  				sc = iter.Response().Response.Response.StatusCode
  1541  			}
  1542  			tracing.EndSpan(ctx, sc, err)
  1543  		}()
  1544  	}
  1545  	iter.i++
  1546  	if iter.i < len(iter.page.Values()) {
  1547  		return nil
  1548  	}
  1549  	err = iter.page.NextWithContext(ctx)
  1550  	if err != nil {
  1551  		iter.i--
  1552  		return err
  1553  	}
  1554  	iter.i = 0
  1555  	return nil
  1556  }
  1557  
  1558  // Next advances to the next value.  If there was an error making
  1559  // the request the iterator does not advance and the error is returned.
  1560  // Deprecated: Use NextWithContext() instead.
  1561  func (iter *OperationListResultIterator) Next() error {
  1562  	return iter.NextWithContext(context.Background())
  1563  }
  1564  
  1565  // NotDone returns true if the enumeration should be started or is not yet complete.
  1566  func (iter OperationListResultIterator) NotDone() bool {
  1567  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1568  }
  1569  
  1570  // Response returns the raw server response from the last page request.
  1571  func (iter OperationListResultIterator) Response() OperationListResult {
  1572  	return iter.page.Response()
  1573  }
  1574  
  1575  // Value returns the current value or a zero-initialized value if the
  1576  // iterator has advanced beyond the end of the collection.
  1577  func (iter OperationListResultIterator) Value() Operation {
  1578  	if !iter.page.NotDone() {
  1579  		return Operation{}
  1580  	}
  1581  	return iter.page.Values()[iter.i]
  1582  }
  1583  
  1584  // Creates a new instance of the OperationListResultIterator type.
  1585  func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
  1586  	return OperationListResultIterator{page: page}
  1587  }
  1588  
  1589  // IsEmpty returns true if the ListResult contains no values.
  1590  func (olr OperationListResult) IsEmpty() bool {
  1591  	return olr.Value == nil || len(*olr.Value) == 0
  1592  }
  1593  
  1594  // hasNextLink returns true if the NextLink is not empty.
  1595  func (olr OperationListResult) hasNextLink() bool {
  1596  	return olr.NextLink != nil && len(*olr.NextLink) != 0
  1597  }
  1598  
  1599  // operationListResultPreparer prepares a request to retrieve the next set of results.
  1600  // It returns nil if no more results exist.
  1601  func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
  1602  	if !olr.hasNextLink() {
  1603  		return nil, nil
  1604  	}
  1605  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1606  		autorest.AsJSON(),
  1607  		autorest.AsGet(),
  1608  		autorest.WithBaseURL(to.String(olr.NextLink)))
  1609  }
  1610  
  1611  // OperationListResultPage contains a page of Operation values.
  1612  type OperationListResultPage struct {
  1613  	fn  func(context.Context, OperationListResult) (OperationListResult, error)
  1614  	olr OperationListResult
  1615  }
  1616  
  1617  // NextWithContext advances to the next page of values.  If there was an error making
  1618  // the request the page does not advance and the error is returned.
  1619  func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
  1620  	if tracing.IsEnabled() {
  1621  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
  1622  		defer func() {
  1623  			sc := -1
  1624  			if page.Response().Response.Response != nil {
  1625  				sc = page.Response().Response.Response.StatusCode
  1626  			}
  1627  			tracing.EndSpan(ctx, sc, err)
  1628  		}()
  1629  	}
  1630  	for {
  1631  		next, err := page.fn(ctx, page.olr)
  1632  		if err != nil {
  1633  			return err
  1634  		}
  1635  		page.olr = next
  1636  		if !next.hasNextLink() || !next.IsEmpty() {
  1637  			break
  1638  		}
  1639  	}
  1640  	return nil
  1641  }
  1642  
  1643  // Next advances to the next page of values.  If there was an error making
  1644  // the request the page does not advance and the error is returned.
  1645  // Deprecated: Use NextWithContext() instead.
  1646  func (page *OperationListResultPage) Next() error {
  1647  	return page.NextWithContext(context.Background())
  1648  }
  1649  
  1650  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1651  func (page OperationListResultPage) NotDone() bool {
  1652  	return !page.olr.IsEmpty()
  1653  }
  1654  
  1655  // Response returns the raw server response from the last page request.
  1656  func (page OperationListResultPage) Response() OperationListResult {
  1657  	return page.olr
  1658  }
  1659  
  1660  // Values returns the slice of values for the current page or nil if there are no values.
  1661  func (page OperationListResultPage) Values() []Operation {
  1662  	if page.olr.IsEmpty() {
  1663  		return nil
  1664  	}
  1665  	return *page.olr.Value
  1666  }
  1667  
  1668  // Creates a new instance of the OperationListResultPage type.
  1669  func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
  1670  	return OperationListResultPage{
  1671  		fn:  getNextPage,
  1672  		olr: cur,
  1673  	}
  1674  }
  1675  
  1676  // ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
  1677  // have tags and a location
  1678  type ProxyResource struct {
  1679  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1680  	ID *string `json:"id,omitempty"`
  1681  	// Name - READ-ONLY; The name of the resource
  1682  	Name *string `json:"name,omitempty"`
  1683  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1684  	Type *string `json:"type,omitempty"`
  1685  }
  1686  
  1687  // MarshalJSON is the custom marshaler for ProxyResource.
  1688  func (pr ProxyResource) MarshalJSON() ([]byte, error) {
  1689  	objectMap := make(map[string]interface{})
  1690  	return json.Marshal(objectMap)
  1691  }
  1692  
  1693  // Resource common fields that are returned in the response for all Azure Resource Manager resources
  1694  type Resource struct {
  1695  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1696  	ID *string `json:"id,omitempty"`
  1697  	// Name - READ-ONLY; The name of the resource
  1698  	Name *string `json:"name,omitempty"`
  1699  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1700  	Type *string `json:"type,omitempty"`
  1701  }
  1702  
  1703  // MarshalJSON is the custom marshaler for Resource.
  1704  func (r Resource) MarshalJSON() ([]byte, error) {
  1705  	objectMap := make(map[string]interface{})
  1706  	return json.Marshal(objectMap)
  1707  }
  1708  
  1709  // Server represents a server.
  1710  type Server struct {
  1711  	autorest.Response `json:"-"`
  1712  	// Sku - The SKU (pricing tier) of the server.
  1713  	Sku *Sku `json:"sku,omitempty"`
  1714  	// ServerProperties - Properties of the server.
  1715  	*ServerProperties `json:"properties,omitempty"`
  1716  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  1717  	SystemData *SystemData `json:"systemData,omitempty"`
  1718  	// Tags - Resource tags.
  1719  	Tags map[string]*string `json:"tags"`
  1720  	// Location - The geo-location where the resource lives
  1721  	Location *string `json:"location,omitempty"`
  1722  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1723  	ID *string `json:"id,omitempty"`
  1724  	// Name - READ-ONLY; The name of the resource
  1725  	Name *string `json:"name,omitempty"`
  1726  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1727  	Type *string `json:"type,omitempty"`
  1728  }
  1729  
  1730  // MarshalJSON is the custom marshaler for Server.
  1731  func (s Server) MarshalJSON() ([]byte, error) {
  1732  	objectMap := make(map[string]interface{})
  1733  	if s.Sku != nil {
  1734  		objectMap["sku"] = s.Sku
  1735  	}
  1736  	if s.ServerProperties != nil {
  1737  		objectMap["properties"] = s.ServerProperties
  1738  	}
  1739  	if s.Tags != nil {
  1740  		objectMap["tags"] = s.Tags
  1741  	}
  1742  	if s.Location != nil {
  1743  		objectMap["location"] = s.Location
  1744  	}
  1745  	return json.Marshal(objectMap)
  1746  }
  1747  
  1748  // UnmarshalJSON is the custom unmarshaler for Server struct.
  1749  func (s *Server) UnmarshalJSON(body []byte) error {
  1750  	var m map[string]*json.RawMessage
  1751  	err := json.Unmarshal(body, &m)
  1752  	if err != nil {
  1753  		return err
  1754  	}
  1755  	for k, v := range m {
  1756  		switch k {
  1757  		case "sku":
  1758  			if v != nil {
  1759  				var sku Sku
  1760  				err = json.Unmarshal(*v, &sku)
  1761  				if err != nil {
  1762  					return err
  1763  				}
  1764  				s.Sku = &sku
  1765  			}
  1766  		case "properties":
  1767  			if v != nil {
  1768  				var serverProperties ServerProperties
  1769  				err = json.Unmarshal(*v, &serverProperties)
  1770  				if err != nil {
  1771  					return err
  1772  				}
  1773  				s.ServerProperties = &serverProperties
  1774  			}
  1775  		case "systemData":
  1776  			if v != nil {
  1777  				var systemData SystemData
  1778  				err = json.Unmarshal(*v, &systemData)
  1779  				if err != nil {
  1780  					return err
  1781  				}
  1782  				s.SystemData = &systemData
  1783  			}
  1784  		case "tags":
  1785  			if v != nil {
  1786  				var tags map[string]*string
  1787  				err = json.Unmarshal(*v, &tags)
  1788  				if err != nil {
  1789  					return err
  1790  				}
  1791  				s.Tags = tags
  1792  			}
  1793  		case "location":
  1794  			if v != nil {
  1795  				var location string
  1796  				err = json.Unmarshal(*v, &location)
  1797  				if err != nil {
  1798  					return err
  1799  				}
  1800  				s.Location = &location
  1801  			}
  1802  		case "id":
  1803  			if v != nil {
  1804  				var ID string
  1805  				err = json.Unmarshal(*v, &ID)
  1806  				if err != nil {
  1807  					return err
  1808  				}
  1809  				s.ID = &ID
  1810  			}
  1811  		case "name":
  1812  			if v != nil {
  1813  				var name string
  1814  				err = json.Unmarshal(*v, &name)
  1815  				if err != nil {
  1816  					return err
  1817  				}
  1818  				s.Name = &name
  1819  			}
  1820  		case "type":
  1821  			if v != nil {
  1822  				var typeVar string
  1823  				err = json.Unmarshal(*v, &typeVar)
  1824  				if err != nil {
  1825  					return err
  1826  				}
  1827  				s.Type = &typeVar
  1828  			}
  1829  		}
  1830  	}
  1831  
  1832  	return nil
  1833  }
  1834  
  1835  // ServerBackup server backup properties
  1836  type ServerBackup struct {
  1837  	autorest.Response `json:"-"`
  1838  	// ServerBackupProperties - The properties of a server backup.
  1839  	*ServerBackupProperties `json:"properties,omitempty"`
  1840  	// SystemData - READ-ONLY; The system metadata relating to this resource.
  1841  	SystemData *SystemData `json:"systemData,omitempty"`
  1842  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  1843  	ID *string `json:"id,omitempty"`
  1844  	// Name - READ-ONLY; The name of the resource
  1845  	Name *string `json:"name,omitempty"`
  1846  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  1847  	Type *string `json:"type,omitempty"`
  1848  }
  1849  
  1850  // MarshalJSON is the custom marshaler for ServerBackup.
  1851  func (sb ServerBackup) MarshalJSON() ([]byte, error) {
  1852  	objectMap := make(map[string]interface{})
  1853  	if sb.ServerBackupProperties != nil {
  1854  		objectMap["properties"] = sb.ServerBackupProperties
  1855  	}
  1856  	return json.Marshal(objectMap)
  1857  }
  1858  
  1859  // UnmarshalJSON is the custom unmarshaler for ServerBackup struct.
  1860  func (sb *ServerBackup) UnmarshalJSON(body []byte) error {
  1861  	var m map[string]*json.RawMessage
  1862  	err := json.Unmarshal(body, &m)
  1863  	if err != nil {
  1864  		return err
  1865  	}
  1866  	for k, v := range m {
  1867  		switch k {
  1868  		case "properties":
  1869  			if v != nil {
  1870  				var serverBackupProperties ServerBackupProperties
  1871  				err = json.Unmarshal(*v, &serverBackupProperties)
  1872  				if err != nil {
  1873  					return err
  1874  				}
  1875  				sb.ServerBackupProperties = &serverBackupProperties
  1876  			}
  1877  		case "systemData":
  1878  			if v != nil {
  1879  				var systemData SystemData
  1880  				err = json.Unmarshal(*v, &systemData)
  1881  				if err != nil {
  1882  					return err
  1883  				}
  1884  				sb.SystemData = &systemData
  1885  			}
  1886  		case "id":
  1887  			if v != nil {
  1888  				var ID string
  1889  				err = json.Unmarshal(*v, &ID)
  1890  				if err != nil {
  1891  					return err
  1892  				}
  1893  				sb.ID = &ID
  1894  			}
  1895  		case "name":
  1896  			if v != nil {
  1897  				var name string
  1898  				err = json.Unmarshal(*v, &name)
  1899  				if err != nil {
  1900  					return err
  1901  				}
  1902  				sb.Name = &name
  1903  			}
  1904  		case "type":
  1905  			if v != nil {
  1906  				var typeVar string
  1907  				err = json.Unmarshal(*v, &typeVar)
  1908  				if err != nil {
  1909  					return err
  1910  				}
  1911  				sb.Type = &typeVar
  1912  			}
  1913  		}
  1914  	}
  1915  
  1916  	return nil
  1917  }
  1918  
  1919  // ServerBackupListResult a list of server backups.
  1920  type ServerBackupListResult struct {
  1921  	autorest.Response `json:"-"`
  1922  	// Value - The list of backups of a server.
  1923  	Value *[]ServerBackup `json:"value,omitempty"`
  1924  	// NextLink - The link used to get the next page of operations.
  1925  	NextLink *string `json:"nextLink,omitempty"`
  1926  }
  1927  
  1928  // ServerBackupListResultIterator provides access to a complete listing of ServerBackup values.
  1929  type ServerBackupListResultIterator struct {
  1930  	i    int
  1931  	page ServerBackupListResultPage
  1932  }
  1933  
  1934  // NextWithContext advances to the next value.  If there was an error making
  1935  // the request the iterator does not advance and the error is returned.
  1936  func (iter *ServerBackupListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1937  	if tracing.IsEnabled() {
  1938  		ctx = tracing.StartSpan(ctx, fqdn+"/ServerBackupListResultIterator.NextWithContext")
  1939  		defer func() {
  1940  			sc := -1
  1941  			if iter.Response().Response.Response != nil {
  1942  				sc = iter.Response().Response.Response.StatusCode
  1943  			}
  1944  			tracing.EndSpan(ctx, sc, err)
  1945  		}()
  1946  	}
  1947  	iter.i++
  1948  	if iter.i < len(iter.page.Values()) {
  1949  		return nil
  1950  	}
  1951  	err = iter.page.NextWithContext(ctx)
  1952  	if err != nil {
  1953  		iter.i--
  1954  		return err
  1955  	}
  1956  	iter.i = 0
  1957  	return nil
  1958  }
  1959  
  1960  // Next advances to the next value.  If there was an error making
  1961  // the request the iterator does not advance and the error is returned.
  1962  // Deprecated: Use NextWithContext() instead.
  1963  func (iter *ServerBackupListResultIterator) Next() error {
  1964  	return iter.NextWithContext(context.Background())
  1965  }
  1966  
  1967  // NotDone returns true if the enumeration should be started or is not yet complete.
  1968  func (iter ServerBackupListResultIterator) NotDone() bool {
  1969  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1970  }
  1971  
  1972  // Response returns the raw server response from the last page request.
  1973  func (iter ServerBackupListResultIterator) Response() ServerBackupListResult {
  1974  	return iter.page.Response()
  1975  }
  1976  
  1977  // Value returns the current value or a zero-initialized value if the
  1978  // iterator has advanced beyond the end of the collection.
  1979  func (iter ServerBackupListResultIterator) Value() ServerBackup {
  1980  	if !iter.page.NotDone() {
  1981  		return ServerBackup{}
  1982  	}
  1983  	return iter.page.Values()[iter.i]
  1984  }
  1985  
  1986  // Creates a new instance of the ServerBackupListResultIterator type.
  1987  func NewServerBackupListResultIterator(page ServerBackupListResultPage) ServerBackupListResultIterator {
  1988  	return ServerBackupListResultIterator{page: page}
  1989  }
  1990  
  1991  // IsEmpty returns true if the ListResult contains no values.
  1992  func (sblr ServerBackupListResult) IsEmpty() bool {
  1993  	return sblr.Value == nil || len(*sblr.Value) == 0
  1994  }
  1995  
  1996  // hasNextLink returns true if the NextLink is not empty.
  1997  func (sblr ServerBackupListResult) hasNextLink() bool {
  1998  	return sblr.NextLink != nil && len(*sblr.NextLink) != 0
  1999  }
  2000  
  2001  // serverBackupListResultPreparer prepares a request to retrieve the next set of results.
  2002  // It returns nil if no more results exist.
  2003  func (sblr ServerBackupListResult) serverBackupListResultPreparer(ctx context.Context) (*http.Request, error) {
  2004  	if !sblr.hasNextLink() {
  2005  		return nil, nil
  2006  	}
  2007  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2008  		autorest.AsJSON(),
  2009  		autorest.AsGet(),
  2010  		autorest.WithBaseURL(to.String(sblr.NextLink)))
  2011  }
  2012  
  2013  // ServerBackupListResultPage contains a page of ServerBackup values.
  2014  type ServerBackupListResultPage struct {
  2015  	fn   func(context.Context, ServerBackupListResult) (ServerBackupListResult, error)
  2016  	sblr ServerBackupListResult
  2017  }
  2018  
  2019  // NextWithContext advances to the next page of values.  If there was an error making
  2020  // the request the page does not advance and the error is returned.
  2021  func (page *ServerBackupListResultPage) NextWithContext(ctx context.Context) (err error) {
  2022  	if tracing.IsEnabled() {
  2023  		ctx = tracing.StartSpan(ctx, fqdn+"/ServerBackupListResultPage.NextWithContext")
  2024  		defer func() {
  2025  			sc := -1
  2026  			if page.Response().Response.Response != nil {
  2027  				sc = page.Response().Response.Response.StatusCode
  2028  			}
  2029  			tracing.EndSpan(ctx, sc, err)
  2030  		}()
  2031  	}
  2032  	for {
  2033  		next, err := page.fn(ctx, page.sblr)
  2034  		if err != nil {
  2035  			return err
  2036  		}
  2037  		page.sblr = next
  2038  		if !next.hasNextLink() || !next.IsEmpty() {
  2039  			break
  2040  		}
  2041  	}
  2042  	return nil
  2043  }
  2044  
  2045  // Next advances to the next page of values.  If there was an error making
  2046  // the request the page does not advance and the error is returned.
  2047  // Deprecated: Use NextWithContext() instead.
  2048  func (page *ServerBackupListResultPage) Next() error {
  2049  	return page.NextWithContext(context.Background())
  2050  }
  2051  
  2052  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2053  func (page ServerBackupListResultPage) NotDone() bool {
  2054  	return !page.sblr.IsEmpty()
  2055  }
  2056  
  2057  // Response returns the raw server response from the last page request.
  2058  func (page ServerBackupListResultPage) Response() ServerBackupListResult {
  2059  	return page.sblr
  2060  }
  2061  
  2062  // Values returns the slice of values for the current page or nil if there are no values.
  2063  func (page ServerBackupListResultPage) Values() []ServerBackup {
  2064  	if page.sblr.IsEmpty() {
  2065  		return nil
  2066  	}
  2067  	return *page.sblr.Value
  2068  }
  2069  
  2070  // Creates a new instance of the ServerBackupListResultPage type.
  2071  func NewServerBackupListResultPage(cur ServerBackupListResult, getNextPage func(context.Context, ServerBackupListResult) (ServerBackupListResult, error)) ServerBackupListResultPage {
  2072  	return ServerBackupListResultPage{
  2073  		fn:   getNextPage,
  2074  		sblr: cur,
  2075  	}
  2076  }
  2077  
  2078  // ServerBackupProperties the properties of a server backup.
  2079  type ServerBackupProperties struct {
  2080  	// BackupType - Backup type.
  2081  	BackupType *string `json:"backupType,omitempty"`
  2082  	// CompletedTime - Backup completed time (ISO8601 format).
  2083  	CompletedTime *date.Time `json:"completedTime,omitempty"`
  2084  	// Source - Backup source
  2085  	Source *string `json:"source,omitempty"`
  2086  }
  2087  
  2088  // ServerEditionCapability server edition capabilities.
  2089  type ServerEditionCapability struct {
  2090  	// Name - READ-ONLY; Server edition name
  2091  	Name *string `json:"name,omitempty"`
  2092  	// SupportedStorageEditions - READ-ONLY; A list of supported storage editions
  2093  	SupportedStorageEditions *[]StorageEditionCapability `json:"supportedStorageEditions,omitempty"`
  2094  	// SupportedServerVersions - READ-ONLY; A list of supported server versions.
  2095  	SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"`
  2096  }
  2097  
  2098  // MarshalJSON is the custom marshaler for ServerEditionCapability.
  2099  func (sec ServerEditionCapability) MarshalJSON() ([]byte, error) {
  2100  	objectMap := make(map[string]interface{})
  2101  	return json.Marshal(objectMap)
  2102  }
  2103  
  2104  // ServerForUpdate parameters allowed to update for a server.
  2105  type ServerForUpdate struct {
  2106  	// Sku - The SKU (pricing tier) of the server.
  2107  	Sku *Sku `json:"sku,omitempty"`
  2108  	// ServerPropertiesForUpdate - The properties that can be updated for a server.
  2109  	*ServerPropertiesForUpdate `json:"properties,omitempty"`
  2110  	// Tags - Application-specific metadata in the form of key-value pairs.
  2111  	Tags map[string]*string `json:"tags"`
  2112  }
  2113  
  2114  // MarshalJSON is the custom marshaler for ServerForUpdate.
  2115  func (sfu ServerForUpdate) MarshalJSON() ([]byte, error) {
  2116  	objectMap := make(map[string]interface{})
  2117  	if sfu.Sku != nil {
  2118  		objectMap["sku"] = sfu.Sku
  2119  	}
  2120  	if sfu.ServerPropertiesForUpdate != nil {
  2121  		objectMap["properties"] = sfu.ServerPropertiesForUpdate
  2122  	}
  2123  	if sfu.Tags != nil {
  2124  		objectMap["tags"] = sfu.Tags
  2125  	}
  2126  	return json.Marshal(objectMap)
  2127  }
  2128  
  2129  // UnmarshalJSON is the custom unmarshaler for ServerForUpdate struct.
  2130  func (sfu *ServerForUpdate) UnmarshalJSON(body []byte) error {
  2131  	var m map[string]*json.RawMessage
  2132  	err := json.Unmarshal(body, &m)
  2133  	if err != nil {
  2134  		return err
  2135  	}
  2136  	for k, v := range m {
  2137  		switch k {
  2138  		case "sku":
  2139  			if v != nil {
  2140  				var sku Sku
  2141  				err = json.Unmarshal(*v, &sku)
  2142  				if err != nil {
  2143  					return err
  2144  				}
  2145  				sfu.Sku = &sku
  2146  			}
  2147  		case "properties":
  2148  			if v != nil {
  2149  				var serverPropertiesForUpdate ServerPropertiesForUpdate
  2150  				err = json.Unmarshal(*v, &serverPropertiesForUpdate)
  2151  				if err != nil {
  2152  					return err
  2153  				}
  2154  				sfu.ServerPropertiesForUpdate = &serverPropertiesForUpdate
  2155  			}
  2156  		case "tags":
  2157  			if v != nil {
  2158  				var tags map[string]*string
  2159  				err = json.Unmarshal(*v, &tags)
  2160  				if err != nil {
  2161  					return err
  2162  				}
  2163  				sfu.Tags = tags
  2164  			}
  2165  		}
  2166  	}
  2167  
  2168  	return nil
  2169  }
  2170  
  2171  // ServerListResult a list of servers.
  2172  type ServerListResult struct {
  2173  	autorest.Response `json:"-"`
  2174  	// Value - The list of servers
  2175  	Value *[]Server `json:"value,omitempty"`
  2176  	// NextLink - The link used to get the next page of operations.
  2177  	NextLink *string `json:"nextLink,omitempty"`
  2178  }
  2179  
  2180  // ServerListResultIterator provides access to a complete listing of Server values.
  2181  type ServerListResultIterator struct {
  2182  	i    int
  2183  	page ServerListResultPage
  2184  }
  2185  
  2186  // NextWithContext advances to the next value.  If there was an error making
  2187  // the request the iterator does not advance and the error is returned.
  2188  func (iter *ServerListResultIterator) NextWithContext(ctx context.Context) (err error) {
  2189  	if tracing.IsEnabled() {
  2190  		ctx = tracing.StartSpan(ctx, fqdn+"/ServerListResultIterator.NextWithContext")
  2191  		defer func() {
  2192  			sc := -1
  2193  			if iter.Response().Response.Response != nil {
  2194  				sc = iter.Response().Response.Response.StatusCode
  2195  			}
  2196  			tracing.EndSpan(ctx, sc, err)
  2197  		}()
  2198  	}
  2199  	iter.i++
  2200  	if iter.i < len(iter.page.Values()) {
  2201  		return nil
  2202  	}
  2203  	err = iter.page.NextWithContext(ctx)
  2204  	if err != nil {
  2205  		iter.i--
  2206  		return err
  2207  	}
  2208  	iter.i = 0
  2209  	return nil
  2210  }
  2211  
  2212  // Next advances to the next value.  If there was an error making
  2213  // the request the iterator does not advance and the error is returned.
  2214  // Deprecated: Use NextWithContext() instead.
  2215  func (iter *ServerListResultIterator) Next() error {
  2216  	return iter.NextWithContext(context.Background())
  2217  }
  2218  
  2219  // NotDone returns true if the enumeration should be started or is not yet complete.
  2220  func (iter ServerListResultIterator) NotDone() bool {
  2221  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2222  }
  2223  
  2224  // Response returns the raw server response from the last page request.
  2225  func (iter ServerListResultIterator) Response() ServerListResult {
  2226  	return iter.page.Response()
  2227  }
  2228  
  2229  // Value returns the current value or a zero-initialized value if the
  2230  // iterator has advanced beyond the end of the collection.
  2231  func (iter ServerListResultIterator) Value() Server {
  2232  	if !iter.page.NotDone() {
  2233  		return Server{}
  2234  	}
  2235  	return iter.page.Values()[iter.i]
  2236  }
  2237  
  2238  // Creates a new instance of the ServerListResultIterator type.
  2239  func NewServerListResultIterator(page ServerListResultPage) ServerListResultIterator {
  2240  	return ServerListResultIterator{page: page}
  2241  }
  2242  
  2243  // IsEmpty returns true if the ListResult contains no values.
  2244  func (slr ServerListResult) IsEmpty() bool {
  2245  	return slr.Value == nil || len(*slr.Value) == 0
  2246  }
  2247  
  2248  // hasNextLink returns true if the NextLink is not empty.
  2249  func (slr ServerListResult) hasNextLink() bool {
  2250  	return slr.NextLink != nil && len(*slr.NextLink) != 0
  2251  }
  2252  
  2253  // serverListResultPreparer prepares a request to retrieve the next set of results.
  2254  // It returns nil if no more results exist.
  2255  func (slr ServerListResult) serverListResultPreparer(ctx context.Context) (*http.Request, error) {
  2256  	if !slr.hasNextLink() {
  2257  		return nil, nil
  2258  	}
  2259  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2260  		autorest.AsJSON(),
  2261  		autorest.AsGet(),
  2262  		autorest.WithBaseURL(to.String(slr.NextLink)))
  2263  }
  2264  
  2265  // ServerListResultPage contains a page of Server values.
  2266  type ServerListResultPage struct {
  2267  	fn  func(context.Context, ServerListResult) (ServerListResult, error)
  2268  	slr ServerListResult
  2269  }
  2270  
  2271  // NextWithContext advances to the next page of values.  If there was an error making
  2272  // the request the page does not advance and the error is returned.
  2273  func (page *ServerListResultPage) NextWithContext(ctx context.Context) (err error) {
  2274  	if tracing.IsEnabled() {
  2275  		ctx = tracing.StartSpan(ctx, fqdn+"/ServerListResultPage.NextWithContext")
  2276  		defer func() {
  2277  			sc := -1
  2278  			if page.Response().Response.Response != nil {
  2279  				sc = page.Response().Response.Response.StatusCode
  2280  			}
  2281  			tracing.EndSpan(ctx, sc, err)
  2282  		}()
  2283  	}
  2284  	for {
  2285  		next, err := page.fn(ctx, page.slr)
  2286  		if err != nil {
  2287  			return err
  2288  		}
  2289  		page.slr = next
  2290  		if !next.hasNextLink() || !next.IsEmpty() {
  2291  			break
  2292  		}
  2293  	}
  2294  	return nil
  2295  }
  2296  
  2297  // Next advances to the next page of values.  If there was an error making
  2298  // the request the page does not advance and the error is returned.
  2299  // Deprecated: Use NextWithContext() instead.
  2300  func (page *ServerListResultPage) Next() error {
  2301  	return page.NextWithContext(context.Background())
  2302  }
  2303  
  2304  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2305  func (page ServerListResultPage) NotDone() bool {
  2306  	return !page.slr.IsEmpty()
  2307  }
  2308  
  2309  // Response returns the raw server response from the last page request.
  2310  func (page ServerListResultPage) Response() ServerListResult {
  2311  	return page.slr
  2312  }
  2313  
  2314  // Values returns the slice of values for the current page or nil if there are no values.
  2315  func (page ServerListResultPage) Values() []Server {
  2316  	if page.slr.IsEmpty() {
  2317  		return nil
  2318  	}
  2319  	return *page.slr.Value
  2320  }
  2321  
  2322  // Creates a new instance of the ServerListResultPage type.
  2323  func NewServerListResultPage(cur ServerListResult, getNextPage func(context.Context, ServerListResult) (ServerListResult, error)) ServerListResultPage {
  2324  	return ServerListResultPage{
  2325  		fn:  getNextPage,
  2326  		slr: cur,
  2327  	}
  2328  }
  2329  
  2330  // ServerProperties the properties of a server.
  2331  type ServerProperties struct {
  2332  	// AdministratorLogin - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
  2333  	AdministratorLogin *string `json:"administratorLogin,omitempty"`
  2334  	// AdministratorLoginPassword - The password of the administrator login (required for server creation).
  2335  	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
  2336  	// Version - Server version. Possible values include: 'ServerVersionFiveFullStopSeven', 'ServerVersionEightFullStopZeroFullStopTwoOne'
  2337  	Version ServerVersion `json:"version,omitempty"`
  2338  	// AvailabilityZone - availability Zone information of the server.
  2339  	AvailabilityZone *string `json:"availabilityZone,omitempty"`
  2340  	// CreateMode - The mode to create a new MySQL server. Possible values include: 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeReplica', 'CreateModeGeoRestore'
  2341  	CreateMode CreateMode `json:"createMode,omitempty"`
  2342  	// SourceServerResourceID - The source MySQL server id.
  2343  	SourceServerResourceID *string `json:"sourceServerResourceId,omitempty"`
  2344  	// RestorePointInTime - Restore point creation time (ISO8601 format), specifying the time to restore from.
  2345  	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
  2346  	// ReplicationRole - The replication role. Possible values include: 'ReplicationRoleNone', 'ReplicationRoleSource', 'ReplicationRoleReplica'
  2347  	ReplicationRole ReplicationRole `json:"replicationRole,omitempty"`
  2348  	// ReplicaCapacity - READ-ONLY; The maximum number of replicas that a primary server can have.
  2349  	ReplicaCapacity *int32 `json:"replicaCapacity,omitempty"`
  2350  	// State - READ-ONLY; The state of a server. Possible values include: 'ServerStateReady', 'ServerStateDropping', 'ServerStateDisabled', 'ServerStateStarting', 'ServerStateStopping', 'ServerStateStopped', 'ServerStateUpdating'
  2351  	State ServerState `json:"state,omitempty"`
  2352  	// FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of a server.
  2353  	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
  2354  	// Storage - Storage related properties of a server.
  2355  	Storage *Storage `json:"storage,omitempty"`
  2356  	// Backup - Backup related properties of a server.
  2357  	Backup *Backup `json:"backup,omitempty"`
  2358  	// HighAvailability - High availability related properties of a server.
  2359  	HighAvailability *HighAvailability `json:"highAvailability,omitempty"`
  2360  	// Network - Network related properties of a server.
  2361  	Network *Network `json:"network,omitempty"`
  2362  	// MaintenanceWindow - Maintenance window of a server.
  2363  	MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
  2364  }
  2365  
  2366  // MarshalJSON is the custom marshaler for ServerProperties.
  2367  func (sp ServerProperties) MarshalJSON() ([]byte, error) {
  2368  	objectMap := make(map[string]interface{})
  2369  	if sp.AdministratorLogin != nil {
  2370  		objectMap["administratorLogin"] = sp.AdministratorLogin
  2371  	}
  2372  	if sp.AdministratorLoginPassword != nil {
  2373  		objectMap["administratorLoginPassword"] = sp.AdministratorLoginPassword
  2374  	}
  2375  	if sp.Version != "" {
  2376  		objectMap["version"] = sp.Version
  2377  	}
  2378  	if sp.AvailabilityZone != nil {
  2379  		objectMap["availabilityZone"] = sp.AvailabilityZone
  2380  	}
  2381  	if sp.CreateMode != "" {
  2382  		objectMap["createMode"] = sp.CreateMode
  2383  	}
  2384  	if sp.SourceServerResourceID != nil {
  2385  		objectMap["sourceServerResourceId"] = sp.SourceServerResourceID
  2386  	}
  2387  	if sp.RestorePointInTime != nil {
  2388  		objectMap["restorePointInTime"] = sp.RestorePointInTime
  2389  	}
  2390  	if sp.ReplicationRole != "" {
  2391  		objectMap["replicationRole"] = sp.ReplicationRole
  2392  	}
  2393  	if sp.Storage != nil {
  2394  		objectMap["storage"] = sp.Storage
  2395  	}
  2396  	if sp.Backup != nil {
  2397  		objectMap["backup"] = sp.Backup
  2398  	}
  2399  	if sp.HighAvailability != nil {
  2400  		objectMap["highAvailability"] = sp.HighAvailability
  2401  	}
  2402  	if sp.Network != nil {
  2403  		objectMap["network"] = sp.Network
  2404  	}
  2405  	if sp.MaintenanceWindow != nil {
  2406  		objectMap["maintenanceWindow"] = sp.MaintenanceWindow
  2407  	}
  2408  	return json.Marshal(objectMap)
  2409  }
  2410  
  2411  // ServerPropertiesForUpdate the properties that can be updated for a server.
  2412  type ServerPropertiesForUpdate struct {
  2413  	// AdministratorLoginPassword - The password of the administrator login.
  2414  	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
  2415  	// Storage - Storage related properties of a server.
  2416  	Storage *Storage `json:"storage,omitempty"`
  2417  	// Backup - Backup related properties of a server.
  2418  	Backup *Backup `json:"backup,omitempty"`
  2419  	// HighAvailability - High availability related properties of a server.
  2420  	HighAvailability *HighAvailability `json:"highAvailability,omitempty"`
  2421  	// MaintenanceWindow - Maintenance window of a server.
  2422  	MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
  2423  	// ReplicationRole - The replication role of the server. Possible values include: 'ReplicationRoleNone', 'ReplicationRoleSource', 'ReplicationRoleReplica'
  2424  	ReplicationRole ReplicationRole `json:"replicationRole,omitempty"`
  2425  }
  2426  
  2427  // ServerRestartParameter server restart parameters.
  2428  type ServerRestartParameter struct {
  2429  	// RestartWithFailover - Whether or not failover to standby server when restarting a server with high availability enabled. Possible values include: 'EnableStatusEnumEnabled', 'EnableStatusEnumDisabled'
  2430  	RestartWithFailover EnableStatusEnum `json:"restartWithFailover,omitempty"`
  2431  	// MaxFailoverSeconds - The maximum allowed failover time in seconds.
  2432  	MaxFailoverSeconds *int32 `json:"maxFailoverSeconds,omitempty"`
  2433  }
  2434  
  2435  // ServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running
  2436  // operation.
  2437  type ServersCreateFuture struct {
  2438  	azure.FutureAPI
  2439  	// Result returns the result of the asynchronous operation.
  2440  	// If the operation has not completed it will return an error.
  2441  	Result func(ServersClient) (Server, error)
  2442  }
  2443  
  2444  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2445  func (future *ServersCreateFuture) UnmarshalJSON(body []byte) error {
  2446  	var azFuture azure.Future
  2447  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2448  		return err
  2449  	}
  2450  	future.FutureAPI = &azFuture
  2451  	future.Result = future.result
  2452  	return nil
  2453  }
  2454  
  2455  // result is the default implementation for ServersCreateFuture.Result.
  2456  func (future *ServersCreateFuture) result(client ServersClient) (s Server, err error) {
  2457  	var done bool
  2458  	done, err = future.DoneWithContext(context.Background(), client)
  2459  	if err != nil {
  2460  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ServersCreateFuture", "Result", future.Response(), "Polling failure")
  2461  		return
  2462  	}
  2463  	if !done {
  2464  		s.Response.Response = future.Response()
  2465  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.ServersCreateFuture")
  2466  		return
  2467  	}
  2468  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2469  	if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
  2470  		s, err = client.CreateResponder(s.Response.Response)
  2471  		if err != nil {
  2472  			err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ServersCreateFuture", "Result", s.Response.Response, "Failure responding to request")
  2473  		}
  2474  	}
  2475  	return
  2476  }
  2477  
  2478  // ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  2479  // operation.
  2480  type ServersDeleteFuture struct {
  2481  	azure.FutureAPI
  2482  	// Result returns the result of the asynchronous operation.
  2483  	// If the operation has not completed it will return an error.
  2484  	Result func(ServersClient) (autorest.Response, error)
  2485  }
  2486  
  2487  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2488  func (future *ServersDeleteFuture) UnmarshalJSON(body []byte) error {
  2489  	var azFuture azure.Future
  2490  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2491  		return err
  2492  	}
  2493  	future.FutureAPI = &azFuture
  2494  	future.Result = future.result
  2495  	return nil
  2496  }
  2497  
  2498  // result is the default implementation for ServersDeleteFuture.Result.
  2499  func (future *ServersDeleteFuture) result(client ServersClient) (ar autorest.Response, err error) {
  2500  	var done bool
  2501  	done, err = future.DoneWithContext(context.Background(), client)
  2502  	if err != nil {
  2503  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ServersDeleteFuture", "Result", future.Response(), "Polling failure")
  2504  		return
  2505  	}
  2506  	if !done {
  2507  		ar.Response = future.Response()
  2508  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.ServersDeleteFuture")
  2509  		return
  2510  	}
  2511  	ar.Response = future.Response()
  2512  	return
  2513  }
  2514  
  2515  // ServersFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
  2516  // operation.
  2517  type ServersFailoverFuture struct {
  2518  	azure.FutureAPI
  2519  	// Result returns the result of the asynchronous operation.
  2520  	// If the operation has not completed it will return an error.
  2521  	Result func(ServersClient) (autorest.Response, error)
  2522  }
  2523  
  2524  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2525  func (future *ServersFailoverFuture) UnmarshalJSON(body []byte) error {
  2526  	var azFuture azure.Future
  2527  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2528  		return err
  2529  	}
  2530  	future.FutureAPI = &azFuture
  2531  	future.Result = future.result
  2532  	return nil
  2533  }
  2534  
  2535  // result is the default implementation for ServersFailoverFuture.Result.
  2536  func (future *ServersFailoverFuture) result(client ServersClient) (ar autorest.Response, err error) {
  2537  	var done bool
  2538  	done, err = future.DoneWithContext(context.Background(), client)
  2539  	if err != nil {
  2540  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ServersFailoverFuture", "Result", future.Response(), "Polling failure")
  2541  		return
  2542  	}
  2543  	if !done {
  2544  		ar.Response = future.Response()
  2545  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.ServersFailoverFuture")
  2546  		return
  2547  	}
  2548  	ar.Response = future.Response()
  2549  	return
  2550  }
  2551  
  2552  // ServersRestartFuture an abstraction for monitoring and retrieving the results of a long-running
  2553  // operation.
  2554  type ServersRestartFuture struct {
  2555  	azure.FutureAPI
  2556  	// Result returns the result of the asynchronous operation.
  2557  	// If the operation has not completed it will return an error.
  2558  	Result func(ServersClient) (autorest.Response, error)
  2559  }
  2560  
  2561  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2562  func (future *ServersRestartFuture) UnmarshalJSON(body []byte) error {
  2563  	var azFuture azure.Future
  2564  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2565  		return err
  2566  	}
  2567  	future.FutureAPI = &azFuture
  2568  	future.Result = future.result
  2569  	return nil
  2570  }
  2571  
  2572  // result is the default implementation for ServersRestartFuture.Result.
  2573  func (future *ServersRestartFuture) result(client ServersClient) (ar autorest.Response, err error) {
  2574  	var done bool
  2575  	done, err = future.DoneWithContext(context.Background(), client)
  2576  	if err != nil {
  2577  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ServersRestartFuture", "Result", future.Response(), "Polling failure")
  2578  		return
  2579  	}
  2580  	if !done {
  2581  		ar.Response = future.Response()
  2582  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.ServersRestartFuture")
  2583  		return
  2584  	}
  2585  	ar.Response = future.Response()
  2586  	return
  2587  }
  2588  
  2589  // ServersStartFuture an abstraction for monitoring and retrieving the results of a long-running operation.
  2590  type ServersStartFuture struct {
  2591  	azure.FutureAPI
  2592  	// Result returns the result of the asynchronous operation.
  2593  	// If the operation has not completed it will return an error.
  2594  	Result func(ServersClient) (autorest.Response, error)
  2595  }
  2596  
  2597  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2598  func (future *ServersStartFuture) UnmarshalJSON(body []byte) error {
  2599  	var azFuture azure.Future
  2600  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2601  		return err
  2602  	}
  2603  	future.FutureAPI = &azFuture
  2604  	future.Result = future.result
  2605  	return nil
  2606  }
  2607  
  2608  // result is the default implementation for ServersStartFuture.Result.
  2609  func (future *ServersStartFuture) result(client ServersClient) (ar autorest.Response, err error) {
  2610  	var done bool
  2611  	done, err = future.DoneWithContext(context.Background(), client)
  2612  	if err != nil {
  2613  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ServersStartFuture", "Result", future.Response(), "Polling failure")
  2614  		return
  2615  	}
  2616  	if !done {
  2617  		ar.Response = future.Response()
  2618  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.ServersStartFuture")
  2619  		return
  2620  	}
  2621  	ar.Response = future.Response()
  2622  	return
  2623  }
  2624  
  2625  // ServersStopFuture an abstraction for monitoring and retrieving the results of a long-running operation.
  2626  type ServersStopFuture struct {
  2627  	azure.FutureAPI
  2628  	// Result returns the result of the asynchronous operation.
  2629  	// If the operation has not completed it will return an error.
  2630  	Result func(ServersClient) (autorest.Response, error)
  2631  }
  2632  
  2633  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2634  func (future *ServersStopFuture) UnmarshalJSON(body []byte) error {
  2635  	var azFuture azure.Future
  2636  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2637  		return err
  2638  	}
  2639  	future.FutureAPI = &azFuture
  2640  	future.Result = future.result
  2641  	return nil
  2642  }
  2643  
  2644  // result is the default implementation for ServersStopFuture.Result.
  2645  func (future *ServersStopFuture) result(client ServersClient) (ar autorest.Response, err error) {
  2646  	var done bool
  2647  	done, err = future.DoneWithContext(context.Background(), client)
  2648  	if err != nil {
  2649  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ServersStopFuture", "Result", future.Response(), "Polling failure")
  2650  		return
  2651  	}
  2652  	if !done {
  2653  		ar.Response = future.Response()
  2654  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.ServersStopFuture")
  2655  		return
  2656  	}
  2657  	ar.Response = future.Response()
  2658  	return
  2659  }
  2660  
  2661  // ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
  2662  // operation.
  2663  type ServersUpdateFuture struct {
  2664  	azure.FutureAPI
  2665  	// Result returns the result of the asynchronous operation.
  2666  	// If the operation has not completed it will return an error.
  2667  	Result func(ServersClient) (Server, error)
  2668  }
  2669  
  2670  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2671  func (future *ServersUpdateFuture) UnmarshalJSON(body []byte) error {
  2672  	var azFuture azure.Future
  2673  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2674  		return err
  2675  	}
  2676  	future.FutureAPI = &azFuture
  2677  	future.Result = future.result
  2678  	return nil
  2679  }
  2680  
  2681  // result is the default implementation for ServersUpdateFuture.Result.
  2682  func (future *ServersUpdateFuture) result(client ServersClient) (s Server, err error) {
  2683  	var done bool
  2684  	done, err = future.DoneWithContext(context.Background(), client)
  2685  	if err != nil {
  2686  		err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ServersUpdateFuture", "Result", future.Response(), "Polling failure")
  2687  		return
  2688  	}
  2689  	if !done {
  2690  		s.Response.Response = future.Response()
  2691  		err = azure.NewAsyncOpIncompleteError("mysqlflexibleservers.ServersUpdateFuture")
  2692  		return
  2693  	}
  2694  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2695  	if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
  2696  		s, err = client.UpdateResponder(s.Response.Response)
  2697  		if err != nil {
  2698  			err = autorest.NewErrorWithError(err, "mysqlflexibleservers.ServersUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
  2699  		}
  2700  	}
  2701  	return
  2702  }
  2703  
  2704  // ServerVersionCapability server version capabilities.
  2705  type ServerVersionCapability struct {
  2706  	// Name - READ-ONLY; server version
  2707  	Name *string `json:"name,omitempty"`
  2708  	// SupportedSkus - READ-ONLY; A list of supported Skus
  2709  	SupportedSkus *[]SkuCapability `json:"supportedSkus,omitempty"`
  2710  }
  2711  
  2712  // MarshalJSON is the custom marshaler for ServerVersionCapability.
  2713  func (svc ServerVersionCapability) MarshalJSON() ([]byte, error) {
  2714  	objectMap := make(map[string]interface{})
  2715  	return json.Marshal(objectMap)
  2716  }
  2717  
  2718  // Sku billing information related properties of a server.
  2719  type Sku struct {
  2720  	// Name - The name of the sku, e.g. Standard_D32s_v3.
  2721  	Name *string `json:"name,omitempty"`
  2722  	// Tier - The tier of the particular SKU, e.g. GeneralPurpose. Possible values include: 'SkuTierBurstable', 'SkuTierGeneralPurpose', 'SkuTierMemoryOptimized'
  2723  	Tier SkuTier `json:"tier,omitempty"`
  2724  }
  2725  
  2726  // SkuCapability sku capability
  2727  type SkuCapability struct {
  2728  	// Name - READ-ONLY; vCore name
  2729  	Name *string `json:"name,omitempty"`
  2730  	// VCores - READ-ONLY; supported vCores
  2731  	VCores *int64 `json:"vCores,omitempty"`
  2732  	// SupportedIops - READ-ONLY; supported IOPS
  2733  	SupportedIops *int64 `json:"supportedIops,omitempty"`
  2734  	// SupportedMemoryPerVCoreMB - READ-ONLY; supported memory per vCore in MB
  2735  	SupportedMemoryPerVCoreMB *int64 `json:"supportedMemoryPerVCoreMB,omitempty"`
  2736  }
  2737  
  2738  // MarshalJSON is the custom marshaler for SkuCapability.
  2739  func (sc SkuCapability) MarshalJSON() ([]byte, error) {
  2740  	objectMap := make(map[string]interface{})
  2741  	return json.Marshal(objectMap)
  2742  }
  2743  
  2744  // Storage storage Profile properties of a server
  2745  type Storage struct {
  2746  	// StorageSizeGB - Max storage size allowed for a server.
  2747  	StorageSizeGB *int32 `json:"storageSizeGB,omitempty"`
  2748  	// Iops - Storage IOPS for a server.
  2749  	Iops *int32 `json:"iops,omitempty"`
  2750  	// AutoGrow - Enable Storage Auto Grow or not. Possible values include: 'EnableStatusEnumEnabled', 'EnableStatusEnumDisabled'
  2751  	AutoGrow EnableStatusEnum `json:"autoGrow,omitempty"`
  2752  	// StorageSku - READ-ONLY; The sku name of the server storage.
  2753  	StorageSku *string `json:"storageSku,omitempty"`
  2754  }
  2755  
  2756  // MarshalJSON is the custom marshaler for Storage.
  2757  func (s Storage) MarshalJSON() ([]byte, error) {
  2758  	objectMap := make(map[string]interface{})
  2759  	if s.StorageSizeGB != nil {
  2760  		objectMap["storageSizeGB"] = s.StorageSizeGB
  2761  	}
  2762  	if s.Iops != nil {
  2763  		objectMap["iops"] = s.Iops
  2764  	}
  2765  	if s.AutoGrow != "" {
  2766  		objectMap["autoGrow"] = s.AutoGrow
  2767  	}
  2768  	return json.Marshal(objectMap)
  2769  }
  2770  
  2771  // StorageEditionCapability storage edition capability
  2772  type StorageEditionCapability struct {
  2773  	// Name - READ-ONLY; storage edition name
  2774  	Name *string `json:"name,omitempty"`
  2775  	// MinStorageSize - READ-ONLY; The minimal supported storage size.
  2776  	MinStorageSize *int64 `json:"minStorageSize,omitempty"`
  2777  	// MaxStorageSize - READ-ONLY; The maximum supported storage size.
  2778  	MaxStorageSize *int64 `json:"maxStorageSize,omitempty"`
  2779  	// MinBackupRetentionDays - READ-ONLY; Minimal backup retention days
  2780  	MinBackupRetentionDays *int64 `json:"minBackupRetentionDays,omitempty"`
  2781  	// MaxBackupRetentionDays - READ-ONLY; Maximum backup retention days
  2782  	MaxBackupRetentionDays *int64 `json:"maxBackupRetentionDays,omitempty"`
  2783  }
  2784  
  2785  // MarshalJSON is the custom marshaler for StorageEditionCapability.
  2786  func (sec StorageEditionCapability) MarshalJSON() ([]byte, error) {
  2787  	objectMap := make(map[string]interface{})
  2788  	return json.Marshal(objectMap)
  2789  }
  2790  
  2791  // SystemData metadata pertaining to creation and last modification of the resource.
  2792  type SystemData struct {
  2793  	// CreatedBy - The identity that created the resource.
  2794  	CreatedBy *string `json:"createdBy,omitempty"`
  2795  	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  2796  	CreatedByType CreatedByType `json:"createdByType,omitempty"`
  2797  	// CreatedAt - The timestamp of resource creation (UTC).
  2798  	CreatedAt *date.Time `json:"createdAt,omitempty"`
  2799  	// LastModifiedBy - The identity that last modified the resource.
  2800  	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
  2801  	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  2802  	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
  2803  	// LastModifiedAt - The timestamp of resource last modification (UTC)
  2804  	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
  2805  }
  2806  
  2807  // TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
  2808  // which has 'tags' and a 'location'
  2809  type TrackedResource struct {
  2810  	// Tags - Resource tags.
  2811  	Tags map[string]*string `json:"tags"`
  2812  	// Location - The geo-location where the resource lives
  2813  	Location *string `json:"location,omitempty"`
  2814  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  2815  	ID *string `json:"id,omitempty"`
  2816  	// Name - READ-ONLY; The name of the resource
  2817  	Name *string `json:"name,omitempty"`
  2818  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  2819  	Type *string `json:"type,omitempty"`
  2820  }
  2821  
  2822  // MarshalJSON is the custom marshaler for TrackedResource.
  2823  func (tr TrackedResource) MarshalJSON() ([]byte, error) {
  2824  	objectMap := make(map[string]interface{})
  2825  	if tr.Tags != nil {
  2826  		objectMap["tags"] = tr.Tags
  2827  	}
  2828  	if tr.Location != nil {
  2829  		objectMap["location"] = tr.Location
  2830  	}
  2831  	return json.Marshal(objectMap)
  2832  }
  2833  
  2834  // VirtualNetworkSubnetUsageParameter virtual network subnet usage parameter
  2835  type VirtualNetworkSubnetUsageParameter struct {
  2836  	// VirtualNetworkResourceID - Virtual network resource id.
  2837  	VirtualNetworkResourceID *string `json:"virtualNetworkResourceId,omitempty"`
  2838  }
  2839  
  2840  // VirtualNetworkSubnetUsageResult virtual network subnet usage data.
  2841  type VirtualNetworkSubnetUsageResult struct {
  2842  	autorest.Response `json:"-"`
  2843  	// DelegatedSubnetsUsage - READ-ONLY; A list of delegated subnet usage
  2844  	DelegatedSubnetsUsage *[]DelegatedSubnetUsage `json:"delegatedSubnetsUsage,omitempty"`
  2845  }
  2846  
  2847  // MarshalJSON is the custom marshaler for VirtualNetworkSubnetUsageResult.
  2848  func (vnsur VirtualNetworkSubnetUsageResult) MarshalJSON() ([]byte, error) {
  2849  	objectMap := make(map[string]interface{})
  2850  	return json.Marshal(objectMap)
  2851  }
  2852  

View as plain text