...

Source file src/github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-03-15/documentdb/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-03-15/documentdb

     1  package documentdb
     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/cosmos-db/mgmt/2021-03-15/documentdb"
    22  
    23  // APIProperties ...
    24  type APIProperties struct {
    25  	// ServerVersion - Describes the ServerVersion of an a MongoDB account. Possible values include: 'ThreeFullStopTwo', 'ThreeFullStopSix', 'FourFullStopZero'
    26  	ServerVersion ServerVersion `json:"serverVersion,omitempty"`
    27  }
    28  
    29  // ARMProxyResource the resource model definition for a ARM proxy resource. It will have everything other
    30  // than required location and tags
    31  type ARMProxyResource struct {
    32  	// ID - READ-ONLY; The unique resource identifier of the database account.
    33  	ID *string `json:"id,omitempty"`
    34  	// Name - READ-ONLY; The name of the database account.
    35  	Name *string `json:"name,omitempty"`
    36  	// Type - READ-ONLY; The type of Azure resource.
    37  	Type *string `json:"type,omitempty"`
    38  }
    39  
    40  // MarshalJSON is the custom marshaler for ARMProxyResource.
    41  func (apr ARMProxyResource) MarshalJSON() ([]byte, error) {
    42  	objectMap := make(map[string]interface{})
    43  	return json.Marshal(objectMap)
    44  }
    45  
    46  // ARMResourceProperties the core properties of ARM resources.
    47  type ARMResourceProperties struct {
    48  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
    49  	ID *string `json:"id,omitempty"`
    50  	// Name - READ-ONLY; The name of the ARM resource.
    51  	Name *string `json:"name,omitempty"`
    52  	// Type - READ-ONLY; The type of Azure resource.
    53  	Type *string `json:"type,omitempty"`
    54  	// Location - The location of the resource group to which the resource belongs.
    55  	Location *string            `json:"location,omitempty"`
    56  	Tags     map[string]*string `json:"tags"`
    57  }
    58  
    59  // MarshalJSON is the custom marshaler for ARMResourceProperties.
    60  func (arp ARMResourceProperties) MarshalJSON() ([]byte, error) {
    61  	objectMap := make(map[string]interface{})
    62  	if arp.Location != nil {
    63  		objectMap["location"] = arp.Location
    64  	}
    65  	if arp.Tags != nil {
    66  		objectMap["tags"] = arp.Tags
    67  	}
    68  	return json.Marshal(objectMap)
    69  }
    70  
    71  // AutoscaleSettings ...
    72  type AutoscaleSettings struct {
    73  	// MaxThroughput - Represents maximum throughput, the resource can scale up to.
    74  	MaxThroughput *int32 `json:"maxThroughput,omitempty"`
    75  }
    76  
    77  // AutoscaleSettingsResource cosmos DB provisioned throughput settings object
    78  type AutoscaleSettingsResource struct {
    79  	// MaxThroughput - Represents maximum throughput container can scale up to.
    80  	MaxThroughput *int32 `json:"maxThroughput,omitempty"`
    81  	// AutoUpgradePolicy - Cosmos DB resource auto-upgrade policy
    82  	AutoUpgradePolicy *AutoUpgradePolicyResource `json:"autoUpgradePolicy,omitempty"`
    83  	// TargetMaxThroughput - READ-ONLY; Represents target maximum throughput container can scale up to once offer is no longer in pending state.
    84  	TargetMaxThroughput *int32 `json:"targetMaxThroughput,omitempty"`
    85  }
    86  
    87  // MarshalJSON is the custom marshaler for AutoscaleSettingsResource.
    88  func (asr AutoscaleSettingsResource) MarshalJSON() ([]byte, error) {
    89  	objectMap := make(map[string]interface{})
    90  	if asr.MaxThroughput != nil {
    91  		objectMap["maxThroughput"] = asr.MaxThroughput
    92  	}
    93  	if asr.AutoUpgradePolicy != nil {
    94  		objectMap["autoUpgradePolicy"] = asr.AutoUpgradePolicy
    95  	}
    96  	return json.Marshal(objectMap)
    97  }
    98  
    99  // AutoUpgradePolicyResource cosmos DB resource auto-upgrade policy
   100  type AutoUpgradePolicyResource struct {
   101  	// ThroughputPolicy - Represents throughput policy which service must adhere to for auto-upgrade
   102  	ThroughputPolicy *ThroughputPolicyResource `json:"throughputPolicy,omitempty"`
   103  }
   104  
   105  // AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
   106  type AzureEntityResource struct {
   107  	// Etag - READ-ONLY; Resource Etag.
   108  	Etag *string `json:"etag,omitempty"`
   109  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
   110  	ID *string `json:"id,omitempty"`
   111  	// Name - READ-ONLY; The name of the resource
   112  	Name *string `json:"name,omitempty"`
   113  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
   114  	Type *string `json:"type,omitempty"`
   115  }
   116  
   117  // MarshalJSON is the custom marshaler for AzureEntityResource.
   118  func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
   119  	objectMap := make(map[string]interface{})
   120  	return json.Marshal(objectMap)
   121  }
   122  
   123  // BasicBackupPolicy the object representing the policy for taking backups on an account.
   124  type BasicBackupPolicy interface {
   125  	AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool)
   126  	AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool)
   127  	AsBackupPolicy() (*BackupPolicy, bool)
   128  }
   129  
   130  // BackupPolicy the object representing the policy for taking backups on an account.
   131  type BackupPolicy struct {
   132  	// Type - Possible values include: 'TypeBackupPolicy', 'TypePeriodic', 'TypeContinuous'
   133  	Type Type `json:"type,omitempty"`
   134  }
   135  
   136  func unmarshalBasicBackupPolicy(body []byte) (BasicBackupPolicy, error) {
   137  	var m map[string]interface{}
   138  	err := json.Unmarshal(body, &m)
   139  	if err != nil {
   140  		return nil, err
   141  	}
   142  
   143  	switch m["type"] {
   144  	case string(TypePeriodic):
   145  		var pmbp PeriodicModeBackupPolicy
   146  		err := json.Unmarshal(body, &pmbp)
   147  		return pmbp, err
   148  	case string(TypeContinuous):
   149  		var cmbp ContinuousModeBackupPolicy
   150  		err := json.Unmarshal(body, &cmbp)
   151  		return cmbp, err
   152  	default:
   153  		var bp BackupPolicy
   154  		err := json.Unmarshal(body, &bp)
   155  		return bp, err
   156  	}
   157  }
   158  func unmarshalBasicBackupPolicyArray(body []byte) ([]BasicBackupPolicy, error) {
   159  	var rawMessages []*json.RawMessage
   160  	err := json.Unmarshal(body, &rawMessages)
   161  	if err != nil {
   162  		return nil, err
   163  	}
   164  
   165  	bpArray := make([]BasicBackupPolicy, len(rawMessages))
   166  
   167  	for index, rawMessage := range rawMessages {
   168  		bp, err := unmarshalBasicBackupPolicy(*rawMessage)
   169  		if err != nil {
   170  			return nil, err
   171  		}
   172  		bpArray[index] = bp
   173  	}
   174  	return bpArray, nil
   175  }
   176  
   177  // MarshalJSON is the custom marshaler for BackupPolicy.
   178  func (bp BackupPolicy) MarshalJSON() ([]byte, error) {
   179  	bp.Type = TypeBackupPolicy
   180  	objectMap := make(map[string]interface{})
   181  	if bp.Type != "" {
   182  		objectMap["type"] = bp.Type
   183  	}
   184  	return json.Marshal(objectMap)
   185  }
   186  
   187  // AsPeriodicModeBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy.
   188  func (bp BackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) {
   189  	return nil, false
   190  }
   191  
   192  // AsContinuousModeBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy.
   193  func (bp BackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) {
   194  	return nil, false
   195  }
   196  
   197  // AsBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy.
   198  func (bp BackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) {
   199  	return &bp, true
   200  }
   201  
   202  // AsBasicBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy.
   203  func (bp BackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) {
   204  	return &bp, true
   205  }
   206  
   207  // Capability cosmos DB capability object
   208  type Capability struct {
   209  	// Name - Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin".
   210  	Name *string `json:"name,omitempty"`
   211  }
   212  
   213  // CassandraKeyspaceCreateUpdateParameters parameters to create and update Cosmos DB Cassandra keyspace.
   214  type CassandraKeyspaceCreateUpdateParameters struct {
   215  	// CassandraKeyspaceCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra keyspace.
   216  	*CassandraKeyspaceCreateUpdateProperties `json:"properties,omitempty"`
   217  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
   218  	ID *string `json:"id,omitempty"`
   219  	// Name - READ-ONLY; The name of the ARM resource.
   220  	Name *string `json:"name,omitempty"`
   221  	// Type - READ-ONLY; The type of Azure resource.
   222  	Type *string `json:"type,omitempty"`
   223  	// Location - The location of the resource group to which the resource belongs.
   224  	Location *string            `json:"location,omitempty"`
   225  	Tags     map[string]*string `json:"tags"`
   226  }
   227  
   228  // MarshalJSON is the custom marshaler for CassandraKeyspaceCreateUpdateParameters.
   229  func (ckcup CassandraKeyspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) {
   230  	objectMap := make(map[string]interface{})
   231  	if ckcup.CassandraKeyspaceCreateUpdateProperties != nil {
   232  		objectMap["properties"] = ckcup.CassandraKeyspaceCreateUpdateProperties
   233  	}
   234  	if ckcup.Location != nil {
   235  		objectMap["location"] = ckcup.Location
   236  	}
   237  	if ckcup.Tags != nil {
   238  		objectMap["tags"] = ckcup.Tags
   239  	}
   240  	return json.Marshal(objectMap)
   241  }
   242  
   243  // UnmarshalJSON is the custom unmarshaler for CassandraKeyspaceCreateUpdateParameters struct.
   244  func (ckcup *CassandraKeyspaceCreateUpdateParameters) UnmarshalJSON(body []byte) error {
   245  	var m map[string]*json.RawMessage
   246  	err := json.Unmarshal(body, &m)
   247  	if err != nil {
   248  		return err
   249  	}
   250  	for k, v := range m {
   251  		switch k {
   252  		case "properties":
   253  			if v != nil {
   254  				var cassandraKeyspaceCreateUpdateProperties CassandraKeyspaceCreateUpdateProperties
   255  				err = json.Unmarshal(*v, &cassandraKeyspaceCreateUpdateProperties)
   256  				if err != nil {
   257  					return err
   258  				}
   259  				ckcup.CassandraKeyspaceCreateUpdateProperties = &cassandraKeyspaceCreateUpdateProperties
   260  			}
   261  		case "id":
   262  			if v != nil {
   263  				var ID string
   264  				err = json.Unmarshal(*v, &ID)
   265  				if err != nil {
   266  					return err
   267  				}
   268  				ckcup.ID = &ID
   269  			}
   270  		case "name":
   271  			if v != nil {
   272  				var name string
   273  				err = json.Unmarshal(*v, &name)
   274  				if err != nil {
   275  					return err
   276  				}
   277  				ckcup.Name = &name
   278  			}
   279  		case "type":
   280  			if v != nil {
   281  				var typeVar string
   282  				err = json.Unmarshal(*v, &typeVar)
   283  				if err != nil {
   284  					return err
   285  				}
   286  				ckcup.Type = &typeVar
   287  			}
   288  		case "location":
   289  			if v != nil {
   290  				var location string
   291  				err = json.Unmarshal(*v, &location)
   292  				if err != nil {
   293  					return err
   294  				}
   295  				ckcup.Location = &location
   296  			}
   297  		case "tags":
   298  			if v != nil {
   299  				var tags map[string]*string
   300  				err = json.Unmarshal(*v, &tags)
   301  				if err != nil {
   302  					return err
   303  				}
   304  				ckcup.Tags = tags
   305  			}
   306  		}
   307  	}
   308  
   309  	return nil
   310  }
   311  
   312  // CassandraKeyspaceCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra
   313  // keyspace.
   314  type CassandraKeyspaceCreateUpdateProperties struct {
   315  	// Resource - The standard JSON format of a Cassandra keyspace
   316  	Resource *CassandraKeyspaceResource `json:"resource,omitempty"`
   317  	// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
   318  	Options *CreateUpdateOptions `json:"options,omitempty"`
   319  }
   320  
   321  // CassandraKeyspaceGetProperties the properties of an Azure Cosmos DB Cassandra keyspace
   322  type CassandraKeyspaceGetProperties struct {
   323  	Resource *CassandraKeyspaceGetPropertiesResource `json:"resource,omitempty"`
   324  	Options  *CassandraKeyspaceGetPropertiesOptions  `json:"options,omitempty"`
   325  }
   326  
   327  // CassandraKeyspaceGetPropertiesOptions ...
   328  type CassandraKeyspaceGetPropertiesOptions struct {
   329  	// Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details.
   330  	Throughput *int32 `json:"throughput,omitempty"`
   331  	// AutoscaleSettings - Specifies the Autoscale settings.
   332  	AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
   333  }
   334  
   335  // CassandraKeyspaceGetPropertiesResource ...
   336  type CassandraKeyspaceGetPropertiesResource struct {
   337  	// ID - Name of the Cosmos DB Cassandra keyspace
   338  	ID *string `json:"id,omitempty"`
   339  	// Rid - READ-ONLY; A system generated property. A unique identifier.
   340  	Rid *string `json:"_rid,omitempty"`
   341  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
   342  	Ts *float64 `json:"_ts,omitempty"`
   343  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
   344  	Etag *string `json:"_etag,omitempty"`
   345  }
   346  
   347  // MarshalJSON is the custom marshaler for CassandraKeyspaceGetPropertiesResource.
   348  func (ckgp CassandraKeyspaceGetPropertiesResource) MarshalJSON() ([]byte, error) {
   349  	objectMap := make(map[string]interface{})
   350  	if ckgp.ID != nil {
   351  		objectMap["id"] = ckgp.ID
   352  	}
   353  	return json.Marshal(objectMap)
   354  }
   355  
   356  // CassandraKeyspaceGetResults an Azure Cosmos DB Cassandra keyspace.
   357  type CassandraKeyspaceGetResults struct {
   358  	autorest.Response `json:"-"`
   359  	// CassandraKeyspaceGetProperties - The properties of an Azure Cosmos DB Cassandra keyspace
   360  	*CassandraKeyspaceGetProperties `json:"properties,omitempty"`
   361  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
   362  	ID *string `json:"id,omitempty"`
   363  	// Name - READ-ONLY; The name of the ARM resource.
   364  	Name *string `json:"name,omitempty"`
   365  	// Type - READ-ONLY; The type of Azure resource.
   366  	Type *string `json:"type,omitempty"`
   367  	// Location - The location of the resource group to which the resource belongs.
   368  	Location *string            `json:"location,omitempty"`
   369  	Tags     map[string]*string `json:"tags"`
   370  }
   371  
   372  // MarshalJSON is the custom marshaler for CassandraKeyspaceGetResults.
   373  func (ckgr CassandraKeyspaceGetResults) MarshalJSON() ([]byte, error) {
   374  	objectMap := make(map[string]interface{})
   375  	if ckgr.CassandraKeyspaceGetProperties != nil {
   376  		objectMap["properties"] = ckgr.CassandraKeyspaceGetProperties
   377  	}
   378  	if ckgr.Location != nil {
   379  		objectMap["location"] = ckgr.Location
   380  	}
   381  	if ckgr.Tags != nil {
   382  		objectMap["tags"] = ckgr.Tags
   383  	}
   384  	return json.Marshal(objectMap)
   385  }
   386  
   387  // UnmarshalJSON is the custom unmarshaler for CassandraKeyspaceGetResults struct.
   388  func (ckgr *CassandraKeyspaceGetResults) UnmarshalJSON(body []byte) error {
   389  	var m map[string]*json.RawMessage
   390  	err := json.Unmarshal(body, &m)
   391  	if err != nil {
   392  		return err
   393  	}
   394  	for k, v := range m {
   395  		switch k {
   396  		case "properties":
   397  			if v != nil {
   398  				var cassandraKeyspaceGetProperties CassandraKeyspaceGetProperties
   399  				err = json.Unmarshal(*v, &cassandraKeyspaceGetProperties)
   400  				if err != nil {
   401  					return err
   402  				}
   403  				ckgr.CassandraKeyspaceGetProperties = &cassandraKeyspaceGetProperties
   404  			}
   405  		case "id":
   406  			if v != nil {
   407  				var ID string
   408  				err = json.Unmarshal(*v, &ID)
   409  				if err != nil {
   410  					return err
   411  				}
   412  				ckgr.ID = &ID
   413  			}
   414  		case "name":
   415  			if v != nil {
   416  				var name string
   417  				err = json.Unmarshal(*v, &name)
   418  				if err != nil {
   419  					return err
   420  				}
   421  				ckgr.Name = &name
   422  			}
   423  		case "type":
   424  			if v != nil {
   425  				var typeVar string
   426  				err = json.Unmarshal(*v, &typeVar)
   427  				if err != nil {
   428  					return err
   429  				}
   430  				ckgr.Type = &typeVar
   431  			}
   432  		case "location":
   433  			if v != nil {
   434  				var location string
   435  				err = json.Unmarshal(*v, &location)
   436  				if err != nil {
   437  					return err
   438  				}
   439  				ckgr.Location = &location
   440  			}
   441  		case "tags":
   442  			if v != nil {
   443  				var tags map[string]*string
   444  				err = json.Unmarshal(*v, &tags)
   445  				if err != nil {
   446  					return err
   447  				}
   448  				ckgr.Tags = tags
   449  			}
   450  		}
   451  	}
   452  
   453  	return nil
   454  }
   455  
   456  // CassandraKeyspaceListResult the List operation response, that contains the Cassandra keyspaces and their
   457  // properties.
   458  type CassandraKeyspaceListResult struct {
   459  	autorest.Response `json:"-"`
   460  	// Value - READ-ONLY; List of Cassandra keyspaces and their properties.
   461  	Value *[]CassandraKeyspaceGetResults `json:"value,omitempty"`
   462  }
   463  
   464  // MarshalJSON is the custom marshaler for CassandraKeyspaceListResult.
   465  func (cklr CassandraKeyspaceListResult) MarshalJSON() ([]byte, error) {
   466  	objectMap := make(map[string]interface{})
   467  	return json.Marshal(objectMap)
   468  }
   469  
   470  // CassandraKeyspaceResource cosmos DB Cassandra keyspace resource object
   471  type CassandraKeyspaceResource struct {
   472  	// ID - Name of the Cosmos DB Cassandra keyspace
   473  	ID *string `json:"id,omitempty"`
   474  }
   475  
   476  // CassandraPartitionKey cosmos DB Cassandra table partition key
   477  type CassandraPartitionKey struct {
   478  	// Name - Name of the Cosmos DB Cassandra table partition key
   479  	Name *string `json:"name,omitempty"`
   480  }
   481  
   482  // CassandraResourcesCreateUpdateCassandraKeyspaceFuture an abstraction for monitoring and retrieving the
   483  // results of a long-running operation.
   484  type CassandraResourcesCreateUpdateCassandraKeyspaceFuture struct {
   485  	azure.FutureAPI
   486  	// Result returns the result of the asynchronous operation.
   487  	// If the operation has not completed it will return an error.
   488  	Result func(CassandraResourcesClient) (CassandraKeyspaceGetResults, error)
   489  }
   490  
   491  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   492  func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error {
   493  	var azFuture azure.Future
   494  	if err := json.Unmarshal(body, &azFuture); err != nil {
   495  		return err
   496  	}
   497  	future.FutureAPI = &azFuture
   498  	future.Result = future.result
   499  	return nil
   500  }
   501  
   502  // result is the default implementation for CassandraResourcesCreateUpdateCassandraKeyspaceFuture.Result.
   503  func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ckgr CassandraKeyspaceGetResults, err error) {
   504  	var done bool
   505  	done, err = future.DoneWithContext(context.Background(), client)
   506  	if err != nil {
   507  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure")
   508  		return
   509  	}
   510  	if !done {
   511  		ckgr.Response.Response = future.Response()
   512  		err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture")
   513  		return
   514  	}
   515  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   516  	if ckgr.Response.Response, err = future.GetResult(sender); err == nil && ckgr.Response.Response.StatusCode != http.StatusNoContent {
   517  		ckgr, err = client.CreateUpdateCassandraKeyspaceResponder(ckgr.Response.Response)
   518  		if err != nil {
   519  			err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", ckgr.Response.Response, "Failure responding to request")
   520  		}
   521  	}
   522  	return
   523  }
   524  
   525  // CassandraResourcesCreateUpdateCassandraTableFuture an abstraction for monitoring and retrieving the
   526  // results of a long-running operation.
   527  type CassandraResourcesCreateUpdateCassandraTableFuture struct {
   528  	azure.FutureAPI
   529  	// Result returns the result of the asynchronous operation.
   530  	// If the operation has not completed it will return an error.
   531  	Result func(CassandraResourcesClient) (CassandraTableGetResults, error)
   532  }
   533  
   534  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   535  func (future *CassandraResourcesCreateUpdateCassandraTableFuture) UnmarshalJSON(body []byte) error {
   536  	var azFuture azure.Future
   537  	if err := json.Unmarshal(body, &azFuture); err != nil {
   538  		return err
   539  	}
   540  	future.FutureAPI = &azFuture
   541  	future.Result = future.result
   542  	return nil
   543  }
   544  
   545  // result is the default implementation for CassandraResourcesCreateUpdateCassandraTableFuture.Result.
   546  func (future *CassandraResourcesCreateUpdateCassandraTableFuture) result(client CassandraResourcesClient) (ctgr CassandraTableGetResults, err error) {
   547  	var done bool
   548  	done, err = future.DoneWithContext(context.Background(), client)
   549  	if err != nil {
   550  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", future.Response(), "Polling failure")
   551  		return
   552  	}
   553  	if !done {
   554  		ctgr.Response.Response = future.Response()
   555  		err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraTableFuture")
   556  		return
   557  	}
   558  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   559  	if ctgr.Response.Response, err = future.GetResult(sender); err == nil && ctgr.Response.Response.StatusCode != http.StatusNoContent {
   560  		ctgr, err = client.CreateUpdateCassandraTableResponder(ctgr.Response.Response)
   561  		if err != nil {
   562  			err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", ctgr.Response.Response, "Failure responding to request")
   563  		}
   564  	}
   565  	return
   566  }
   567  
   568  // CassandraResourcesDeleteCassandraKeyspaceFuture an abstraction for monitoring and retrieving the results
   569  // of a long-running operation.
   570  type CassandraResourcesDeleteCassandraKeyspaceFuture struct {
   571  	azure.FutureAPI
   572  	// Result returns the result of the asynchronous operation.
   573  	// If the operation has not completed it will return an error.
   574  	Result func(CassandraResourcesClient) (autorest.Response, error)
   575  }
   576  
   577  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   578  func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error {
   579  	var azFuture azure.Future
   580  	if err := json.Unmarshal(body, &azFuture); err != nil {
   581  		return err
   582  	}
   583  	future.FutureAPI = &azFuture
   584  	future.Result = future.result
   585  	return nil
   586  }
   587  
   588  // result is the default implementation for CassandraResourcesDeleteCassandraKeyspaceFuture.Result.
   589  func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) {
   590  	var done bool
   591  	done, err = future.DoneWithContext(context.Background(), client)
   592  	if err != nil {
   593  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure")
   594  		return
   595  	}
   596  	if !done {
   597  		ar.Response = future.Response()
   598  		err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture")
   599  		return
   600  	}
   601  	ar.Response = future.Response()
   602  	return
   603  }
   604  
   605  // CassandraResourcesDeleteCassandraTableFuture an abstraction for monitoring and retrieving the results of
   606  // a long-running operation.
   607  type CassandraResourcesDeleteCassandraTableFuture struct {
   608  	azure.FutureAPI
   609  	// Result returns the result of the asynchronous operation.
   610  	// If the operation has not completed it will return an error.
   611  	Result func(CassandraResourcesClient) (autorest.Response, error)
   612  }
   613  
   614  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   615  func (future *CassandraResourcesDeleteCassandraTableFuture) UnmarshalJSON(body []byte) error {
   616  	var azFuture azure.Future
   617  	if err := json.Unmarshal(body, &azFuture); err != nil {
   618  		return err
   619  	}
   620  	future.FutureAPI = &azFuture
   621  	future.Result = future.result
   622  	return nil
   623  }
   624  
   625  // result is the default implementation for CassandraResourcesDeleteCassandraTableFuture.Result.
   626  func (future *CassandraResourcesDeleteCassandraTableFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) {
   627  	var done bool
   628  	done, err = future.DoneWithContext(context.Background(), client)
   629  	if err != nil {
   630  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraTableFuture", "Result", future.Response(), "Polling failure")
   631  		return
   632  	}
   633  	if !done {
   634  		ar.Response = future.Response()
   635  		err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraTableFuture")
   636  		return
   637  	}
   638  	ar.Response = future.Response()
   639  	return
   640  }
   641  
   642  // CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture an abstraction for monitoring and retrieving
   643  // the results of a long-running operation.
   644  type CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture struct {
   645  	azure.FutureAPI
   646  	// Result returns the result of the asynchronous operation.
   647  	// If the operation has not completed it will return an error.
   648  	Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
   649  }
   650  
   651  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   652  func (future *CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture) UnmarshalJSON(body []byte) error {
   653  	var azFuture azure.Future
   654  	if err := json.Unmarshal(body, &azFuture); err != nil {
   655  		return err
   656  	}
   657  	future.FutureAPI = &azFuture
   658  	future.Result = future.result
   659  	return nil
   660  }
   661  
   662  // result is the default implementation for CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture.Result.
   663  func (future *CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
   664  	var done bool
   665  	done, err = future.DoneWithContext(context.Background(), client)
   666  	if err != nil {
   667  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture", "Result", future.Response(), "Polling failure")
   668  		return
   669  	}
   670  	if !done {
   671  		tsgr.Response.Response = future.Response()
   672  		err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture")
   673  		return
   674  	}
   675  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   676  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
   677  		tsgr, err = client.MigrateCassandraKeyspaceToAutoscaleResponder(tsgr.Response.Response)
   678  		if err != nil {
   679  			err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
   680  		}
   681  	}
   682  	return
   683  }
   684  
   685  // CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture an abstraction for monitoring and
   686  // retrieving the results of a long-running operation.
   687  type CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture struct {
   688  	azure.FutureAPI
   689  	// Result returns the result of the asynchronous operation.
   690  	// If the operation has not completed it will return an error.
   691  	Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
   692  }
   693  
   694  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   695  func (future *CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture) UnmarshalJSON(body []byte) error {
   696  	var azFuture azure.Future
   697  	if err := json.Unmarshal(body, &azFuture); err != nil {
   698  		return err
   699  	}
   700  	future.FutureAPI = &azFuture
   701  	future.Result = future.result
   702  	return nil
   703  }
   704  
   705  // result is the default implementation for CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture.Result.
   706  func (future *CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
   707  	var done bool
   708  	done, err = future.DoneWithContext(context.Background(), client)
   709  	if err != nil {
   710  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture", "Result", future.Response(), "Polling failure")
   711  		return
   712  	}
   713  	if !done {
   714  		tsgr.Response.Response = future.Response()
   715  		err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture")
   716  		return
   717  	}
   718  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   719  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
   720  		tsgr, err = client.MigrateCassandraKeyspaceToManualThroughputResponder(tsgr.Response.Response)
   721  		if err != nil {
   722  			err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
   723  		}
   724  	}
   725  	return
   726  }
   727  
   728  // CassandraResourcesMigrateCassandraTableToAutoscaleFuture an abstraction for monitoring and retrieving
   729  // the results of a long-running operation.
   730  type CassandraResourcesMigrateCassandraTableToAutoscaleFuture struct {
   731  	azure.FutureAPI
   732  	// Result returns the result of the asynchronous operation.
   733  	// If the operation has not completed it will return an error.
   734  	Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
   735  }
   736  
   737  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   738  func (future *CassandraResourcesMigrateCassandraTableToAutoscaleFuture) UnmarshalJSON(body []byte) error {
   739  	var azFuture azure.Future
   740  	if err := json.Unmarshal(body, &azFuture); err != nil {
   741  		return err
   742  	}
   743  	future.FutureAPI = &azFuture
   744  	future.Result = future.result
   745  	return nil
   746  }
   747  
   748  // result is the default implementation for CassandraResourcesMigrateCassandraTableToAutoscaleFuture.Result.
   749  func (future *CassandraResourcesMigrateCassandraTableToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
   750  	var done bool
   751  	done, err = future.DoneWithContext(context.Background(), client)
   752  	if err != nil {
   753  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture", "Result", future.Response(), "Polling failure")
   754  		return
   755  	}
   756  	if !done {
   757  		tsgr.Response.Response = future.Response()
   758  		err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture")
   759  		return
   760  	}
   761  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   762  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
   763  		tsgr, err = client.MigrateCassandraTableToAutoscaleResponder(tsgr.Response.Response)
   764  		if err != nil {
   765  			err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
   766  		}
   767  	}
   768  	return
   769  }
   770  
   771  // CassandraResourcesMigrateCassandraTableToManualThroughputFuture an abstraction for monitoring and
   772  // retrieving the results of a long-running operation.
   773  type CassandraResourcesMigrateCassandraTableToManualThroughputFuture struct {
   774  	azure.FutureAPI
   775  	// Result returns the result of the asynchronous operation.
   776  	// If the operation has not completed it will return an error.
   777  	Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
   778  }
   779  
   780  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   781  func (future *CassandraResourcesMigrateCassandraTableToManualThroughputFuture) UnmarshalJSON(body []byte) error {
   782  	var azFuture azure.Future
   783  	if err := json.Unmarshal(body, &azFuture); err != nil {
   784  		return err
   785  	}
   786  	future.FutureAPI = &azFuture
   787  	future.Result = future.result
   788  	return nil
   789  }
   790  
   791  // result is the default implementation for CassandraResourcesMigrateCassandraTableToManualThroughputFuture.Result.
   792  func (future *CassandraResourcesMigrateCassandraTableToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
   793  	var done bool
   794  	done, err = future.DoneWithContext(context.Background(), client)
   795  	if err != nil {
   796  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture", "Result", future.Response(), "Polling failure")
   797  		return
   798  	}
   799  	if !done {
   800  		tsgr.Response.Response = future.Response()
   801  		err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture")
   802  		return
   803  	}
   804  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   805  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
   806  		tsgr, err = client.MigrateCassandraTableToManualThroughputResponder(tsgr.Response.Response)
   807  		if err != nil {
   808  			err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
   809  		}
   810  	}
   811  	return
   812  }
   813  
   814  // CassandraResourcesUpdateCassandraKeyspaceThroughputFuture an abstraction for monitoring and retrieving
   815  // the results of a long-running operation.
   816  type CassandraResourcesUpdateCassandraKeyspaceThroughputFuture struct {
   817  	azure.FutureAPI
   818  	// Result returns the result of the asynchronous operation.
   819  	// If the operation has not completed it will return an error.
   820  	Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
   821  }
   822  
   823  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   824  func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) UnmarshalJSON(body []byte) error {
   825  	var azFuture azure.Future
   826  	if err := json.Unmarshal(body, &azFuture); err != nil {
   827  		return err
   828  	}
   829  	future.FutureAPI = &azFuture
   830  	future.Result = future.result
   831  	return nil
   832  }
   833  
   834  // result is the default implementation for CassandraResourcesUpdateCassandraKeyspaceThroughputFuture.Result.
   835  func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
   836  	var done bool
   837  	done, err = future.DoneWithContext(context.Background(), client)
   838  	if err != nil {
   839  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", future.Response(), "Polling failure")
   840  		return
   841  	}
   842  	if !done {
   843  		tsgr.Response.Response = future.Response()
   844  		err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture")
   845  		return
   846  	}
   847  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   848  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
   849  		tsgr, err = client.UpdateCassandraKeyspaceThroughputResponder(tsgr.Response.Response)
   850  		if err != nil {
   851  			err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
   852  		}
   853  	}
   854  	return
   855  }
   856  
   857  // CassandraResourcesUpdateCassandraTableThroughputFuture an abstraction for monitoring and retrieving the
   858  // results of a long-running operation.
   859  type CassandraResourcesUpdateCassandraTableThroughputFuture struct {
   860  	azure.FutureAPI
   861  	// Result returns the result of the asynchronous operation.
   862  	// If the operation has not completed it will return an error.
   863  	Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
   864  }
   865  
   866  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   867  func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) UnmarshalJSON(body []byte) error {
   868  	var azFuture azure.Future
   869  	if err := json.Unmarshal(body, &azFuture); err != nil {
   870  		return err
   871  	}
   872  	future.FutureAPI = &azFuture
   873  	future.Result = future.result
   874  	return nil
   875  }
   876  
   877  // result is the default implementation for CassandraResourcesUpdateCassandraTableThroughputFuture.Result.
   878  func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
   879  	var done bool
   880  	done, err = future.DoneWithContext(context.Background(), client)
   881  	if err != nil {
   882  		err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", future.Response(), "Polling failure")
   883  		return
   884  	}
   885  	if !done {
   886  		tsgr.Response.Response = future.Response()
   887  		err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture")
   888  		return
   889  	}
   890  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   891  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
   892  		tsgr, err = client.UpdateCassandraTableThroughputResponder(tsgr.Response.Response)
   893  		if err != nil {
   894  			err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
   895  		}
   896  	}
   897  	return
   898  }
   899  
   900  // CassandraSchema cosmos DB Cassandra table schema
   901  type CassandraSchema struct {
   902  	// Columns - List of Cassandra table columns.
   903  	Columns *[]Column `json:"columns,omitempty"`
   904  	// PartitionKeys - List of partition key.
   905  	PartitionKeys *[]CassandraPartitionKey `json:"partitionKeys,omitempty"`
   906  	// ClusterKeys - List of cluster key.
   907  	ClusterKeys *[]ClusterKey `json:"clusterKeys,omitempty"`
   908  }
   909  
   910  // CassandraTableCreateUpdateParameters parameters to create and update Cosmos DB Cassandra table.
   911  type CassandraTableCreateUpdateParameters struct {
   912  	// CassandraTableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra table.
   913  	*CassandraTableCreateUpdateProperties `json:"properties,omitempty"`
   914  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
   915  	ID *string `json:"id,omitempty"`
   916  	// Name - READ-ONLY; The name of the ARM resource.
   917  	Name *string `json:"name,omitempty"`
   918  	// Type - READ-ONLY; The type of Azure resource.
   919  	Type *string `json:"type,omitempty"`
   920  	// Location - The location of the resource group to which the resource belongs.
   921  	Location *string            `json:"location,omitempty"`
   922  	Tags     map[string]*string `json:"tags"`
   923  }
   924  
   925  // MarshalJSON is the custom marshaler for CassandraTableCreateUpdateParameters.
   926  func (ctcup CassandraTableCreateUpdateParameters) MarshalJSON() ([]byte, error) {
   927  	objectMap := make(map[string]interface{})
   928  	if ctcup.CassandraTableCreateUpdateProperties != nil {
   929  		objectMap["properties"] = ctcup.CassandraTableCreateUpdateProperties
   930  	}
   931  	if ctcup.Location != nil {
   932  		objectMap["location"] = ctcup.Location
   933  	}
   934  	if ctcup.Tags != nil {
   935  		objectMap["tags"] = ctcup.Tags
   936  	}
   937  	return json.Marshal(objectMap)
   938  }
   939  
   940  // UnmarshalJSON is the custom unmarshaler for CassandraTableCreateUpdateParameters struct.
   941  func (ctcup *CassandraTableCreateUpdateParameters) UnmarshalJSON(body []byte) error {
   942  	var m map[string]*json.RawMessage
   943  	err := json.Unmarshal(body, &m)
   944  	if err != nil {
   945  		return err
   946  	}
   947  	for k, v := range m {
   948  		switch k {
   949  		case "properties":
   950  			if v != nil {
   951  				var cassandraTableCreateUpdateProperties CassandraTableCreateUpdateProperties
   952  				err = json.Unmarshal(*v, &cassandraTableCreateUpdateProperties)
   953  				if err != nil {
   954  					return err
   955  				}
   956  				ctcup.CassandraTableCreateUpdateProperties = &cassandraTableCreateUpdateProperties
   957  			}
   958  		case "id":
   959  			if v != nil {
   960  				var ID string
   961  				err = json.Unmarshal(*v, &ID)
   962  				if err != nil {
   963  					return err
   964  				}
   965  				ctcup.ID = &ID
   966  			}
   967  		case "name":
   968  			if v != nil {
   969  				var name string
   970  				err = json.Unmarshal(*v, &name)
   971  				if err != nil {
   972  					return err
   973  				}
   974  				ctcup.Name = &name
   975  			}
   976  		case "type":
   977  			if v != nil {
   978  				var typeVar string
   979  				err = json.Unmarshal(*v, &typeVar)
   980  				if err != nil {
   981  					return err
   982  				}
   983  				ctcup.Type = &typeVar
   984  			}
   985  		case "location":
   986  			if v != nil {
   987  				var location string
   988  				err = json.Unmarshal(*v, &location)
   989  				if err != nil {
   990  					return err
   991  				}
   992  				ctcup.Location = &location
   993  			}
   994  		case "tags":
   995  			if v != nil {
   996  				var tags map[string]*string
   997  				err = json.Unmarshal(*v, &tags)
   998  				if err != nil {
   999  					return err
  1000  				}
  1001  				ctcup.Tags = tags
  1002  			}
  1003  		}
  1004  	}
  1005  
  1006  	return nil
  1007  }
  1008  
  1009  // CassandraTableCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra table.
  1010  type CassandraTableCreateUpdateProperties struct {
  1011  	// Resource - The standard JSON format of a Cassandra table
  1012  	Resource *CassandraTableResource `json:"resource,omitempty"`
  1013  	// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
  1014  	Options *CreateUpdateOptions `json:"options,omitempty"`
  1015  }
  1016  
  1017  // CassandraTableGetProperties the properties of an Azure Cosmos DB Cassandra table
  1018  type CassandraTableGetProperties struct {
  1019  	Resource *CassandraTableGetPropertiesResource `json:"resource,omitempty"`
  1020  	Options  *CassandraTableGetPropertiesOptions  `json:"options,omitempty"`
  1021  }
  1022  
  1023  // CassandraTableGetPropertiesOptions ...
  1024  type CassandraTableGetPropertiesOptions struct {
  1025  	// Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details.
  1026  	Throughput *int32 `json:"throughput,omitempty"`
  1027  	// AutoscaleSettings - Specifies the Autoscale settings.
  1028  	AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
  1029  }
  1030  
  1031  // CassandraTableGetPropertiesResource ...
  1032  type CassandraTableGetPropertiesResource struct {
  1033  	// ID - Name of the Cosmos DB Cassandra table
  1034  	ID *string `json:"id,omitempty"`
  1035  	// DefaultTTL - Time to live of the Cosmos DB Cassandra table
  1036  	DefaultTTL *int32 `json:"defaultTtl,omitempty"`
  1037  	// Schema - Schema of the Cosmos DB Cassandra table
  1038  	Schema *CassandraSchema `json:"schema,omitempty"`
  1039  	// AnalyticalStorageTTL - Analytical TTL.
  1040  	AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"`
  1041  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  1042  	Rid *string `json:"_rid,omitempty"`
  1043  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  1044  	Ts *float64 `json:"_ts,omitempty"`
  1045  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  1046  	Etag *string `json:"_etag,omitempty"`
  1047  }
  1048  
  1049  // MarshalJSON is the custom marshaler for CassandraTableGetPropertiesResource.
  1050  func (ctgp CassandraTableGetPropertiesResource) MarshalJSON() ([]byte, error) {
  1051  	objectMap := make(map[string]interface{})
  1052  	if ctgp.ID != nil {
  1053  		objectMap["id"] = ctgp.ID
  1054  	}
  1055  	if ctgp.DefaultTTL != nil {
  1056  		objectMap["defaultTtl"] = ctgp.DefaultTTL
  1057  	}
  1058  	if ctgp.Schema != nil {
  1059  		objectMap["schema"] = ctgp.Schema
  1060  	}
  1061  	if ctgp.AnalyticalStorageTTL != nil {
  1062  		objectMap["analyticalStorageTtl"] = ctgp.AnalyticalStorageTTL
  1063  	}
  1064  	return json.Marshal(objectMap)
  1065  }
  1066  
  1067  // CassandraTableGetResults an Azure Cosmos DB Cassandra table.
  1068  type CassandraTableGetResults struct {
  1069  	autorest.Response `json:"-"`
  1070  	// CassandraTableGetProperties - The properties of an Azure Cosmos DB Cassandra table
  1071  	*CassandraTableGetProperties `json:"properties,omitempty"`
  1072  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  1073  	ID *string `json:"id,omitempty"`
  1074  	// Name - READ-ONLY; The name of the ARM resource.
  1075  	Name *string `json:"name,omitempty"`
  1076  	// Type - READ-ONLY; The type of Azure resource.
  1077  	Type *string `json:"type,omitempty"`
  1078  	// Location - The location of the resource group to which the resource belongs.
  1079  	Location *string            `json:"location,omitempty"`
  1080  	Tags     map[string]*string `json:"tags"`
  1081  }
  1082  
  1083  // MarshalJSON is the custom marshaler for CassandraTableGetResults.
  1084  func (ctgr CassandraTableGetResults) MarshalJSON() ([]byte, error) {
  1085  	objectMap := make(map[string]interface{})
  1086  	if ctgr.CassandraTableGetProperties != nil {
  1087  		objectMap["properties"] = ctgr.CassandraTableGetProperties
  1088  	}
  1089  	if ctgr.Location != nil {
  1090  		objectMap["location"] = ctgr.Location
  1091  	}
  1092  	if ctgr.Tags != nil {
  1093  		objectMap["tags"] = ctgr.Tags
  1094  	}
  1095  	return json.Marshal(objectMap)
  1096  }
  1097  
  1098  // UnmarshalJSON is the custom unmarshaler for CassandraTableGetResults struct.
  1099  func (ctgr *CassandraTableGetResults) UnmarshalJSON(body []byte) error {
  1100  	var m map[string]*json.RawMessage
  1101  	err := json.Unmarshal(body, &m)
  1102  	if err != nil {
  1103  		return err
  1104  	}
  1105  	for k, v := range m {
  1106  		switch k {
  1107  		case "properties":
  1108  			if v != nil {
  1109  				var cassandraTableGetProperties CassandraTableGetProperties
  1110  				err = json.Unmarshal(*v, &cassandraTableGetProperties)
  1111  				if err != nil {
  1112  					return err
  1113  				}
  1114  				ctgr.CassandraTableGetProperties = &cassandraTableGetProperties
  1115  			}
  1116  		case "id":
  1117  			if v != nil {
  1118  				var ID string
  1119  				err = json.Unmarshal(*v, &ID)
  1120  				if err != nil {
  1121  					return err
  1122  				}
  1123  				ctgr.ID = &ID
  1124  			}
  1125  		case "name":
  1126  			if v != nil {
  1127  				var name string
  1128  				err = json.Unmarshal(*v, &name)
  1129  				if err != nil {
  1130  					return err
  1131  				}
  1132  				ctgr.Name = &name
  1133  			}
  1134  		case "type":
  1135  			if v != nil {
  1136  				var typeVar string
  1137  				err = json.Unmarshal(*v, &typeVar)
  1138  				if err != nil {
  1139  					return err
  1140  				}
  1141  				ctgr.Type = &typeVar
  1142  			}
  1143  		case "location":
  1144  			if v != nil {
  1145  				var location string
  1146  				err = json.Unmarshal(*v, &location)
  1147  				if err != nil {
  1148  					return err
  1149  				}
  1150  				ctgr.Location = &location
  1151  			}
  1152  		case "tags":
  1153  			if v != nil {
  1154  				var tags map[string]*string
  1155  				err = json.Unmarshal(*v, &tags)
  1156  				if err != nil {
  1157  					return err
  1158  				}
  1159  				ctgr.Tags = tags
  1160  			}
  1161  		}
  1162  	}
  1163  
  1164  	return nil
  1165  }
  1166  
  1167  // CassandraTableListResult the List operation response, that contains the Cassandra tables and their
  1168  // properties.
  1169  type CassandraTableListResult struct {
  1170  	autorest.Response `json:"-"`
  1171  	// Value - READ-ONLY; List of Cassandra tables and their properties.
  1172  	Value *[]CassandraTableGetResults `json:"value,omitempty"`
  1173  }
  1174  
  1175  // MarshalJSON is the custom marshaler for CassandraTableListResult.
  1176  func (ctlr CassandraTableListResult) MarshalJSON() ([]byte, error) {
  1177  	objectMap := make(map[string]interface{})
  1178  	return json.Marshal(objectMap)
  1179  }
  1180  
  1181  // CassandraTableResource cosmos DB Cassandra table resource object
  1182  type CassandraTableResource struct {
  1183  	// ID - Name of the Cosmos DB Cassandra table
  1184  	ID *string `json:"id,omitempty"`
  1185  	// DefaultTTL - Time to live of the Cosmos DB Cassandra table
  1186  	DefaultTTL *int32 `json:"defaultTtl,omitempty"`
  1187  	// Schema - Schema of the Cosmos DB Cassandra table
  1188  	Schema *CassandraSchema `json:"schema,omitempty"`
  1189  	// AnalyticalStorageTTL - Analytical TTL.
  1190  	AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"`
  1191  }
  1192  
  1193  // ClusterKey cosmos DB Cassandra table cluster key
  1194  type ClusterKey struct {
  1195  	// Name - Name of the Cosmos DB Cassandra table cluster key
  1196  	Name *string `json:"name,omitempty"`
  1197  	// OrderBy - Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc"
  1198  	OrderBy *string `json:"orderBy,omitempty"`
  1199  }
  1200  
  1201  // Column cosmos DB Cassandra table column
  1202  type Column struct {
  1203  	// Name - Name of the Cosmos DB Cassandra table column
  1204  	Name *string `json:"name,omitempty"`
  1205  	// Type - Type of the Cosmos DB Cassandra table column
  1206  	Type *string `json:"type,omitempty"`
  1207  }
  1208  
  1209  // CompositePath ...
  1210  type CompositePath struct {
  1211  	// Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
  1212  	Path *string `json:"path,omitempty"`
  1213  	// Order - Sort order for composite paths. Possible values include: 'Ascending', 'Descending'
  1214  	Order CompositePathSortOrder `json:"order,omitempty"`
  1215  }
  1216  
  1217  // ConflictResolutionPolicy the conflict resolution policy for the container.
  1218  type ConflictResolutionPolicy struct {
  1219  	// Mode - Indicates the conflict resolution mode. Possible values include: 'LastWriterWins', 'Custom'
  1220  	Mode ConflictResolutionMode `json:"mode,omitempty"`
  1221  	// ConflictResolutionPath - The conflict resolution path in the case of LastWriterWins mode.
  1222  	ConflictResolutionPath *string `json:"conflictResolutionPath,omitempty"`
  1223  	// ConflictResolutionProcedure - The procedure to resolve conflicts in the case of custom mode.
  1224  	ConflictResolutionProcedure *string `json:"conflictResolutionProcedure,omitempty"`
  1225  }
  1226  
  1227  // ConsistencyPolicy the consistency policy for the Cosmos DB database account.
  1228  type ConsistencyPolicy struct {
  1229  	// DefaultConsistencyLevel - The default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix'
  1230  	DefaultConsistencyLevel DefaultConsistencyLevel `json:"defaultConsistencyLevel,omitempty"`
  1231  	// MaxStalenessPrefix - When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.
  1232  	MaxStalenessPrefix *int64 `json:"maxStalenessPrefix,omitempty"`
  1233  	// MaxIntervalInSeconds - When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.
  1234  	MaxIntervalInSeconds *int32 `json:"maxIntervalInSeconds,omitempty"`
  1235  }
  1236  
  1237  // ContainerPartitionKey the configuration of the partition key to be used for partitioning data into
  1238  // multiple partitions
  1239  type ContainerPartitionKey struct {
  1240  	// Paths - List of paths using which data within the container can be partitioned
  1241  	Paths *[]string `json:"paths,omitempty"`
  1242  	// Kind - Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create. Possible values include: 'PartitionKindHash', 'PartitionKindRange', 'PartitionKindMultiHash'
  1243  	Kind PartitionKind `json:"kind,omitempty"`
  1244  	// Version - Indicates the version of the partition key definition
  1245  	Version *int32 `json:"version,omitempty"`
  1246  	// SystemKey - READ-ONLY; Indicates if the container is using a system generated partition key
  1247  	SystemKey *bool `json:"systemKey,omitempty"`
  1248  }
  1249  
  1250  // MarshalJSON is the custom marshaler for ContainerPartitionKey.
  1251  func (cpk ContainerPartitionKey) MarshalJSON() ([]byte, error) {
  1252  	objectMap := make(map[string]interface{})
  1253  	if cpk.Paths != nil {
  1254  		objectMap["paths"] = cpk.Paths
  1255  	}
  1256  	if cpk.Kind != "" {
  1257  		objectMap["kind"] = cpk.Kind
  1258  	}
  1259  	if cpk.Version != nil {
  1260  		objectMap["version"] = cpk.Version
  1261  	}
  1262  	return json.Marshal(objectMap)
  1263  }
  1264  
  1265  // ContinuousModeBackupPolicy the object representing continuous mode backup policy.
  1266  type ContinuousModeBackupPolicy struct {
  1267  	// Type - Possible values include: 'TypeBackupPolicy', 'TypePeriodic', 'TypeContinuous'
  1268  	Type Type `json:"type,omitempty"`
  1269  }
  1270  
  1271  // MarshalJSON is the custom marshaler for ContinuousModeBackupPolicy.
  1272  func (cmbp ContinuousModeBackupPolicy) MarshalJSON() ([]byte, error) {
  1273  	cmbp.Type = TypeContinuous
  1274  	objectMap := make(map[string]interface{})
  1275  	if cmbp.Type != "" {
  1276  		objectMap["type"] = cmbp.Type
  1277  	}
  1278  	return json.Marshal(objectMap)
  1279  }
  1280  
  1281  // AsPeriodicModeBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy.
  1282  func (cmbp ContinuousModeBackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) {
  1283  	return nil, false
  1284  }
  1285  
  1286  // AsContinuousModeBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy.
  1287  func (cmbp ContinuousModeBackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) {
  1288  	return &cmbp, true
  1289  }
  1290  
  1291  // AsBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy.
  1292  func (cmbp ContinuousModeBackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) {
  1293  	return nil, false
  1294  }
  1295  
  1296  // AsBasicBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy.
  1297  func (cmbp ContinuousModeBackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) {
  1298  	return &cmbp, true
  1299  }
  1300  
  1301  // CorsPolicy the CORS policy for the Cosmos DB database account.
  1302  type CorsPolicy struct {
  1303  	// AllowedOrigins - The origin domains that are permitted to make a request against the service via CORS.
  1304  	AllowedOrigins *string `json:"allowedOrigins,omitempty"`
  1305  	// AllowedMethods - The methods (HTTP request verbs) that the origin domain may use for a CORS request.
  1306  	AllowedMethods *string `json:"allowedMethods,omitempty"`
  1307  	// AllowedHeaders - The request headers that the origin domain may specify on the CORS request.
  1308  	AllowedHeaders *string `json:"allowedHeaders,omitempty"`
  1309  	// ExposedHeaders - The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
  1310  	ExposedHeaders *string `json:"exposedHeaders,omitempty"`
  1311  	// MaxAgeInSeconds - The maximum amount time that a browser should cache the preflight OPTIONS request.
  1312  	MaxAgeInSeconds *int64 `json:"maxAgeInSeconds,omitempty"`
  1313  }
  1314  
  1315  // CreateUpdateOptions createUpdateOptions are a list of key-value pairs that describe the resource.
  1316  // Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput"
  1317  type CreateUpdateOptions struct {
  1318  	// Throughput - Request Units per second. For example, "throughput": 10000.
  1319  	Throughput *int32 `json:"throughput,omitempty"`
  1320  	// AutoscaleSettings - Specifies the Autoscale settings.
  1321  	AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
  1322  }
  1323  
  1324  // DatabaseAccountConnectionString connection string for the Cosmos DB account
  1325  type DatabaseAccountConnectionString struct {
  1326  	// ConnectionString - READ-ONLY; Value of the connection string
  1327  	ConnectionString *string `json:"connectionString,omitempty"`
  1328  	// Description - READ-ONLY; Description of the connection string
  1329  	Description *string `json:"description,omitempty"`
  1330  }
  1331  
  1332  // MarshalJSON is the custom marshaler for DatabaseAccountConnectionString.
  1333  func (dacs DatabaseAccountConnectionString) MarshalJSON() ([]byte, error) {
  1334  	objectMap := make(map[string]interface{})
  1335  	return json.Marshal(objectMap)
  1336  }
  1337  
  1338  // DatabaseAccountCreateUpdateParameters parameters to create and update Cosmos DB database accounts.
  1339  type DatabaseAccountCreateUpdateParameters struct {
  1340  	// Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'
  1341  	Kind                                   DatabaseAccountKind     `json:"kind,omitempty"`
  1342  	Identity                               *ManagedServiceIdentity `json:"identity,omitempty"`
  1343  	*DatabaseAccountCreateUpdateProperties `json:"properties,omitempty"`
  1344  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  1345  	ID *string `json:"id,omitempty"`
  1346  	// Name - READ-ONLY; The name of the ARM resource.
  1347  	Name *string `json:"name,omitempty"`
  1348  	// Type - READ-ONLY; The type of Azure resource.
  1349  	Type *string `json:"type,omitempty"`
  1350  	// Location - The location of the resource group to which the resource belongs.
  1351  	Location *string            `json:"location,omitempty"`
  1352  	Tags     map[string]*string `json:"tags"`
  1353  }
  1354  
  1355  // MarshalJSON is the custom marshaler for DatabaseAccountCreateUpdateParameters.
  1356  func (dacup DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) {
  1357  	objectMap := make(map[string]interface{})
  1358  	if dacup.Kind != "" {
  1359  		objectMap["kind"] = dacup.Kind
  1360  	}
  1361  	if dacup.Identity != nil {
  1362  		objectMap["identity"] = dacup.Identity
  1363  	}
  1364  	if dacup.DatabaseAccountCreateUpdateProperties != nil {
  1365  		objectMap["properties"] = dacup.DatabaseAccountCreateUpdateProperties
  1366  	}
  1367  	if dacup.Location != nil {
  1368  		objectMap["location"] = dacup.Location
  1369  	}
  1370  	if dacup.Tags != nil {
  1371  		objectMap["tags"] = dacup.Tags
  1372  	}
  1373  	return json.Marshal(objectMap)
  1374  }
  1375  
  1376  // UnmarshalJSON is the custom unmarshaler for DatabaseAccountCreateUpdateParameters struct.
  1377  func (dacup *DatabaseAccountCreateUpdateParameters) UnmarshalJSON(body []byte) error {
  1378  	var m map[string]*json.RawMessage
  1379  	err := json.Unmarshal(body, &m)
  1380  	if err != nil {
  1381  		return err
  1382  	}
  1383  	for k, v := range m {
  1384  		switch k {
  1385  		case "kind":
  1386  			if v != nil {
  1387  				var kind DatabaseAccountKind
  1388  				err = json.Unmarshal(*v, &kind)
  1389  				if err != nil {
  1390  					return err
  1391  				}
  1392  				dacup.Kind = kind
  1393  			}
  1394  		case "identity":
  1395  			if v != nil {
  1396  				var identity ManagedServiceIdentity
  1397  				err = json.Unmarshal(*v, &identity)
  1398  				if err != nil {
  1399  					return err
  1400  				}
  1401  				dacup.Identity = &identity
  1402  			}
  1403  		case "properties":
  1404  			if v != nil {
  1405  				var databaseAccountCreateUpdateProperties DatabaseAccountCreateUpdateProperties
  1406  				err = json.Unmarshal(*v, &databaseAccountCreateUpdateProperties)
  1407  				if err != nil {
  1408  					return err
  1409  				}
  1410  				dacup.DatabaseAccountCreateUpdateProperties = &databaseAccountCreateUpdateProperties
  1411  			}
  1412  		case "id":
  1413  			if v != nil {
  1414  				var ID string
  1415  				err = json.Unmarshal(*v, &ID)
  1416  				if err != nil {
  1417  					return err
  1418  				}
  1419  				dacup.ID = &ID
  1420  			}
  1421  		case "name":
  1422  			if v != nil {
  1423  				var name string
  1424  				err = json.Unmarshal(*v, &name)
  1425  				if err != nil {
  1426  					return err
  1427  				}
  1428  				dacup.Name = &name
  1429  			}
  1430  		case "type":
  1431  			if v != nil {
  1432  				var typeVar string
  1433  				err = json.Unmarshal(*v, &typeVar)
  1434  				if err != nil {
  1435  					return err
  1436  				}
  1437  				dacup.Type = &typeVar
  1438  			}
  1439  		case "location":
  1440  			if v != nil {
  1441  				var location string
  1442  				err = json.Unmarshal(*v, &location)
  1443  				if err != nil {
  1444  					return err
  1445  				}
  1446  				dacup.Location = &location
  1447  			}
  1448  		case "tags":
  1449  			if v != nil {
  1450  				var tags map[string]*string
  1451  				err = json.Unmarshal(*v, &tags)
  1452  				if err != nil {
  1453  					return err
  1454  				}
  1455  				dacup.Tags = tags
  1456  			}
  1457  		}
  1458  	}
  1459  
  1460  	return nil
  1461  }
  1462  
  1463  // DatabaseAccountCreateUpdateProperties properties to create and update Azure Cosmos DB database accounts.
  1464  type DatabaseAccountCreateUpdateProperties struct {
  1465  	// ConsistencyPolicy - The consistency policy for the Cosmos DB account.
  1466  	ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"`
  1467  	// Locations - An array that contains the georeplication locations enabled for the Cosmos DB account.
  1468  	Locations *[]Location `json:"locations,omitempty"`
  1469  	// DatabaseAccountOfferType - The offer type for the database
  1470  	DatabaseAccountOfferType *string `json:"databaseAccountOfferType,omitempty"`
  1471  	// IPRules - List of IpRules.
  1472  	IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"`
  1473  	// IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules.
  1474  	IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
  1475  	// EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account.
  1476  	EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`
  1477  	// Capabilities - List of Cosmos DB capabilities for the account
  1478  	Capabilities *[]Capability `json:"capabilities,omitempty"`
  1479  	// VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account.
  1480  	VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
  1481  	// EnableMultipleWriteLocations - Enables the account to write in multiple locations
  1482  	EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`
  1483  	// EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account
  1484  	EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`
  1485  	// ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small'
  1486  	ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"`
  1487  	// DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys
  1488  	DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`
  1489  	// KeyVaultKeyURI - The URI of the key vault
  1490  	KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"`
  1491  	// DefaultIdentity - The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more.
  1492  	DefaultIdentity *string `json:"defaultIdentity,omitempty"`
  1493  	// PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled'
  1494  	PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
  1495  	// EnableFreeTier - Flag to indicate whether Free Tier is enabled.
  1496  	EnableFreeTier *bool `json:"enableFreeTier,omitempty"`
  1497  	// APIProperties - API specific properties. Currently, supported only for MongoDB API.
  1498  	APIProperties *APIProperties `json:"apiProperties,omitempty"`
  1499  	// EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics.
  1500  	EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"`
  1501  	// BackupPolicy - The object representing the policy for taking backups on an account.
  1502  	BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"`
  1503  	// Cors - The CORS policy for the Cosmos DB database account.
  1504  	Cors *[]CorsPolicy `json:"cors,omitempty"`
  1505  	// NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices'
  1506  	NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"`
  1507  	// NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account.
  1508  	NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"`
  1509  }
  1510  
  1511  // UnmarshalJSON is the custom unmarshaler for DatabaseAccountCreateUpdateProperties struct.
  1512  func (dacup *DatabaseAccountCreateUpdateProperties) UnmarshalJSON(body []byte) error {
  1513  	var m map[string]*json.RawMessage
  1514  	err := json.Unmarshal(body, &m)
  1515  	if err != nil {
  1516  		return err
  1517  	}
  1518  	for k, v := range m {
  1519  		switch k {
  1520  		case "consistencyPolicy":
  1521  			if v != nil {
  1522  				var consistencyPolicy ConsistencyPolicy
  1523  				err = json.Unmarshal(*v, &consistencyPolicy)
  1524  				if err != nil {
  1525  					return err
  1526  				}
  1527  				dacup.ConsistencyPolicy = &consistencyPolicy
  1528  			}
  1529  		case "locations":
  1530  			if v != nil {
  1531  				var locations []Location
  1532  				err = json.Unmarshal(*v, &locations)
  1533  				if err != nil {
  1534  					return err
  1535  				}
  1536  				dacup.Locations = &locations
  1537  			}
  1538  		case "databaseAccountOfferType":
  1539  			if v != nil {
  1540  				var databaseAccountOfferType string
  1541  				err = json.Unmarshal(*v, &databaseAccountOfferType)
  1542  				if err != nil {
  1543  					return err
  1544  				}
  1545  				dacup.DatabaseAccountOfferType = &databaseAccountOfferType
  1546  			}
  1547  		case "ipRules":
  1548  			if v != nil {
  1549  				var IPRules []IPAddressOrRange
  1550  				err = json.Unmarshal(*v, &IPRules)
  1551  				if err != nil {
  1552  					return err
  1553  				}
  1554  				dacup.IPRules = &IPRules
  1555  			}
  1556  		case "isVirtualNetworkFilterEnabled":
  1557  			if v != nil {
  1558  				var isVirtualNetworkFilterEnabled bool
  1559  				err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled)
  1560  				if err != nil {
  1561  					return err
  1562  				}
  1563  				dacup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
  1564  			}
  1565  		case "enableAutomaticFailover":
  1566  			if v != nil {
  1567  				var enableAutomaticFailover bool
  1568  				err = json.Unmarshal(*v, &enableAutomaticFailover)
  1569  				if err != nil {
  1570  					return err
  1571  				}
  1572  				dacup.EnableAutomaticFailover = &enableAutomaticFailover
  1573  			}
  1574  		case "capabilities":
  1575  			if v != nil {
  1576  				var capabilities []Capability
  1577  				err = json.Unmarshal(*v, &capabilities)
  1578  				if err != nil {
  1579  					return err
  1580  				}
  1581  				dacup.Capabilities = &capabilities
  1582  			}
  1583  		case "virtualNetworkRules":
  1584  			if v != nil {
  1585  				var virtualNetworkRules []VirtualNetworkRule
  1586  				err = json.Unmarshal(*v, &virtualNetworkRules)
  1587  				if err != nil {
  1588  					return err
  1589  				}
  1590  				dacup.VirtualNetworkRules = &virtualNetworkRules
  1591  			}
  1592  		case "enableMultipleWriteLocations":
  1593  			if v != nil {
  1594  				var enableMultipleWriteLocations bool
  1595  				err = json.Unmarshal(*v, &enableMultipleWriteLocations)
  1596  				if err != nil {
  1597  					return err
  1598  				}
  1599  				dacup.EnableMultipleWriteLocations = &enableMultipleWriteLocations
  1600  			}
  1601  		case "enableCassandraConnector":
  1602  			if v != nil {
  1603  				var enableCassandraConnector bool
  1604  				err = json.Unmarshal(*v, &enableCassandraConnector)
  1605  				if err != nil {
  1606  					return err
  1607  				}
  1608  				dacup.EnableCassandraConnector = &enableCassandraConnector
  1609  			}
  1610  		case "connectorOffer":
  1611  			if v != nil {
  1612  				var connectorOffer ConnectorOffer
  1613  				err = json.Unmarshal(*v, &connectorOffer)
  1614  				if err != nil {
  1615  					return err
  1616  				}
  1617  				dacup.ConnectorOffer = connectorOffer
  1618  			}
  1619  		case "disableKeyBasedMetadataWriteAccess":
  1620  			if v != nil {
  1621  				var disableKeyBasedMetadataWriteAccess bool
  1622  				err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess)
  1623  				if err != nil {
  1624  					return err
  1625  				}
  1626  				dacup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
  1627  			}
  1628  		case "keyVaultKeyUri":
  1629  			if v != nil {
  1630  				var keyVaultKeyURI string
  1631  				err = json.Unmarshal(*v, &keyVaultKeyURI)
  1632  				if err != nil {
  1633  					return err
  1634  				}
  1635  				dacup.KeyVaultKeyURI = &keyVaultKeyURI
  1636  			}
  1637  		case "defaultIdentity":
  1638  			if v != nil {
  1639  				var defaultIdentity string
  1640  				err = json.Unmarshal(*v, &defaultIdentity)
  1641  				if err != nil {
  1642  					return err
  1643  				}
  1644  				dacup.DefaultIdentity = &defaultIdentity
  1645  			}
  1646  		case "publicNetworkAccess":
  1647  			if v != nil {
  1648  				var publicNetworkAccess PublicNetworkAccess
  1649  				err = json.Unmarshal(*v, &publicNetworkAccess)
  1650  				if err != nil {
  1651  					return err
  1652  				}
  1653  				dacup.PublicNetworkAccess = publicNetworkAccess
  1654  			}
  1655  		case "enableFreeTier":
  1656  			if v != nil {
  1657  				var enableFreeTier bool
  1658  				err = json.Unmarshal(*v, &enableFreeTier)
  1659  				if err != nil {
  1660  					return err
  1661  				}
  1662  				dacup.EnableFreeTier = &enableFreeTier
  1663  			}
  1664  		case "apiProperties":
  1665  			if v != nil {
  1666  				var APIProperties APIProperties
  1667  				err = json.Unmarshal(*v, &APIProperties)
  1668  				if err != nil {
  1669  					return err
  1670  				}
  1671  				dacup.APIProperties = &APIProperties
  1672  			}
  1673  		case "enableAnalyticalStorage":
  1674  			if v != nil {
  1675  				var enableAnalyticalStorage bool
  1676  				err = json.Unmarshal(*v, &enableAnalyticalStorage)
  1677  				if err != nil {
  1678  					return err
  1679  				}
  1680  				dacup.EnableAnalyticalStorage = &enableAnalyticalStorage
  1681  			}
  1682  		case "backupPolicy":
  1683  			if v != nil {
  1684  				backupPolicy, err := unmarshalBasicBackupPolicy(*v)
  1685  				if err != nil {
  1686  					return err
  1687  				}
  1688  				dacup.BackupPolicy = backupPolicy
  1689  			}
  1690  		case "cors":
  1691  			if v != nil {
  1692  				var cors []CorsPolicy
  1693  				err = json.Unmarshal(*v, &cors)
  1694  				if err != nil {
  1695  					return err
  1696  				}
  1697  				dacup.Cors = &cors
  1698  			}
  1699  		case "networkAclBypass":
  1700  			if v != nil {
  1701  				var networkACLBypass NetworkACLBypass
  1702  				err = json.Unmarshal(*v, &networkACLBypass)
  1703  				if err != nil {
  1704  					return err
  1705  				}
  1706  				dacup.NetworkACLBypass = networkACLBypass
  1707  			}
  1708  		case "networkAclBypassResourceIds":
  1709  			if v != nil {
  1710  				var networkACLBypassResourceIds []string
  1711  				err = json.Unmarshal(*v, &networkACLBypassResourceIds)
  1712  				if err != nil {
  1713  					return err
  1714  				}
  1715  				dacup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds
  1716  			}
  1717  		}
  1718  	}
  1719  
  1720  	return nil
  1721  }
  1722  
  1723  // DatabaseAccountGetProperties properties for the database account.
  1724  type DatabaseAccountGetProperties struct {
  1725  	ProvisioningState *string `json:"provisioningState,omitempty"`
  1726  	// DocumentEndpoint - READ-ONLY; The connection endpoint for the Cosmos DB database account.
  1727  	DocumentEndpoint *string `json:"documentEndpoint,omitempty"`
  1728  	// DatabaseAccountOfferType - READ-ONLY; The offer type for the Cosmos DB database account. Default value: Standard. Possible values include: 'Standard'
  1729  	DatabaseAccountOfferType DatabaseAccountOfferType `json:"databaseAccountOfferType,omitempty"`
  1730  	// IPRules - List of IpRules.
  1731  	IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"`
  1732  	// IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules.
  1733  	IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
  1734  	// EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account.
  1735  	EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`
  1736  	// ConsistencyPolicy - The consistency policy for the Cosmos DB database account.
  1737  	ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"`
  1738  	// Capabilities - List of Cosmos DB capabilities for the account
  1739  	Capabilities *[]Capability `json:"capabilities,omitempty"`
  1740  	// WriteLocations - READ-ONLY; An array that contains the write location for the Cosmos DB account.
  1741  	WriteLocations *[]Location `json:"writeLocations,omitempty"`
  1742  	// ReadLocations - READ-ONLY; An array that contains of the read locations enabled for the Cosmos DB account.
  1743  	ReadLocations *[]Location `json:"readLocations,omitempty"`
  1744  	// Locations - READ-ONLY; An array that contains all of the locations enabled for the Cosmos DB account.
  1745  	Locations *[]Location `json:"locations,omitempty"`
  1746  	// FailoverPolicies - READ-ONLY; An array that contains the regions ordered by their failover priorities.
  1747  	FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"`
  1748  	// VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account.
  1749  	VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
  1750  	// PrivateEndpointConnections - READ-ONLY; List of Private Endpoint Connections configured for the Cosmos DB account.
  1751  	PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
  1752  	// EnableMultipleWriteLocations - Enables the account to write in multiple locations
  1753  	EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`
  1754  	// EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account
  1755  	EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`
  1756  	// ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small'
  1757  	ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"`
  1758  	// DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys
  1759  	DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`
  1760  	// KeyVaultKeyURI - The URI of the key vault
  1761  	KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"`
  1762  	// DefaultIdentity - The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more.
  1763  	DefaultIdentity *string `json:"defaultIdentity,omitempty"`
  1764  	// PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled'
  1765  	PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
  1766  	// EnableFreeTier - Flag to indicate whether Free Tier is enabled.
  1767  	EnableFreeTier *bool `json:"enableFreeTier,omitempty"`
  1768  	// APIProperties - API specific properties.
  1769  	APIProperties *APIProperties `json:"apiProperties,omitempty"`
  1770  	// EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics.
  1771  	EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"`
  1772  	// BackupPolicy - The object representing the policy for taking backups on an account.
  1773  	BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"`
  1774  	// Cors - The CORS policy for the Cosmos DB database account.
  1775  	Cors *[]CorsPolicy `json:"cors,omitempty"`
  1776  	// NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices'
  1777  	NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"`
  1778  	// NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account.
  1779  	NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"`
  1780  }
  1781  
  1782  // MarshalJSON is the custom marshaler for DatabaseAccountGetProperties.
  1783  func (dagp DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) {
  1784  	objectMap := make(map[string]interface{})
  1785  	if dagp.ProvisioningState != nil {
  1786  		objectMap["provisioningState"] = dagp.ProvisioningState
  1787  	}
  1788  	if dagp.IPRules != nil {
  1789  		objectMap["ipRules"] = dagp.IPRules
  1790  	}
  1791  	if dagp.IsVirtualNetworkFilterEnabled != nil {
  1792  		objectMap["isVirtualNetworkFilterEnabled"] = dagp.IsVirtualNetworkFilterEnabled
  1793  	}
  1794  	if dagp.EnableAutomaticFailover != nil {
  1795  		objectMap["enableAutomaticFailover"] = dagp.EnableAutomaticFailover
  1796  	}
  1797  	if dagp.ConsistencyPolicy != nil {
  1798  		objectMap["consistencyPolicy"] = dagp.ConsistencyPolicy
  1799  	}
  1800  	if dagp.Capabilities != nil {
  1801  		objectMap["capabilities"] = dagp.Capabilities
  1802  	}
  1803  	if dagp.VirtualNetworkRules != nil {
  1804  		objectMap["virtualNetworkRules"] = dagp.VirtualNetworkRules
  1805  	}
  1806  	if dagp.EnableMultipleWriteLocations != nil {
  1807  		objectMap["enableMultipleWriteLocations"] = dagp.EnableMultipleWriteLocations
  1808  	}
  1809  	if dagp.EnableCassandraConnector != nil {
  1810  		objectMap["enableCassandraConnector"] = dagp.EnableCassandraConnector
  1811  	}
  1812  	if dagp.ConnectorOffer != "" {
  1813  		objectMap["connectorOffer"] = dagp.ConnectorOffer
  1814  	}
  1815  	if dagp.DisableKeyBasedMetadataWriteAccess != nil {
  1816  		objectMap["disableKeyBasedMetadataWriteAccess"] = dagp.DisableKeyBasedMetadataWriteAccess
  1817  	}
  1818  	if dagp.KeyVaultKeyURI != nil {
  1819  		objectMap["keyVaultKeyUri"] = dagp.KeyVaultKeyURI
  1820  	}
  1821  	if dagp.DefaultIdentity != nil {
  1822  		objectMap["defaultIdentity"] = dagp.DefaultIdentity
  1823  	}
  1824  	if dagp.PublicNetworkAccess != "" {
  1825  		objectMap["publicNetworkAccess"] = dagp.PublicNetworkAccess
  1826  	}
  1827  	if dagp.EnableFreeTier != nil {
  1828  		objectMap["enableFreeTier"] = dagp.EnableFreeTier
  1829  	}
  1830  	if dagp.APIProperties != nil {
  1831  		objectMap["apiProperties"] = dagp.APIProperties
  1832  	}
  1833  	if dagp.EnableAnalyticalStorage != nil {
  1834  		objectMap["enableAnalyticalStorage"] = dagp.EnableAnalyticalStorage
  1835  	}
  1836  	objectMap["backupPolicy"] = dagp.BackupPolicy
  1837  	if dagp.Cors != nil {
  1838  		objectMap["cors"] = dagp.Cors
  1839  	}
  1840  	if dagp.NetworkACLBypass != "" {
  1841  		objectMap["networkAclBypass"] = dagp.NetworkACLBypass
  1842  	}
  1843  	if dagp.NetworkACLBypassResourceIds != nil {
  1844  		objectMap["networkAclBypassResourceIds"] = dagp.NetworkACLBypassResourceIds
  1845  	}
  1846  	return json.Marshal(objectMap)
  1847  }
  1848  
  1849  // UnmarshalJSON is the custom unmarshaler for DatabaseAccountGetProperties struct.
  1850  func (dagp *DatabaseAccountGetProperties) UnmarshalJSON(body []byte) error {
  1851  	var m map[string]*json.RawMessage
  1852  	err := json.Unmarshal(body, &m)
  1853  	if err != nil {
  1854  		return err
  1855  	}
  1856  	for k, v := range m {
  1857  		switch k {
  1858  		case "provisioningState":
  1859  			if v != nil {
  1860  				var provisioningState string
  1861  				err = json.Unmarshal(*v, &provisioningState)
  1862  				if err != nil {
  1863  					return err
  1864  				}
  1865  				dagp.ProvisioningState = &provisioningState
  1866  			}
  1867  		case "documentEndpoint":
  1868  			if v != nil {
  1869  				var documentEndpoint string
  1870  				err = json.Unmarshal(*v, &documentEndpoint)
  1871  				if err != nil {
  1872  					return err
  1873  				}
  1874  				dagp.DocumentEndpoint = &documentEndpoint
  1875  			}
  1876  		case "databaseAccountOfferType":
  1877  			if v != nil {
  1878  				var databaseAccountOfferType DatabaseAccountOfferType
  1879  				err = json.Unmarshal(*v, &databaseAccountOfferType)
  1880  				if err != nil {
  1881  					return err
  1882  				}
  1883  				dagp.DatabaseAccountOfferType = databaseAccountOfferType
  1884  			}
  1885  		case "ipRules":
  1886  			if v != nil {
  1887  				var IPRules []IPAddressOrRange
  1888  				err = json.Unmarshal(*v, &IPRules)
  1889  				if err != nil {
  1890  					return err
  1891  				}
  1892  				dagp.IPRules = &IPRules
  1893  			}
  1894  		case "isVirtualNetworkFilterEnabled":
  1895  			if v != nil {
  1896  				var isVirtualNetworkFilterEnabled bool
  1897  				err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled)
  1898  				if err != nil {
  1899  					return err
  1900  				}
  1901  				dagp.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
  1902  			}
  1903  		case "enableAutomaticFailover":
  1904  			if v != nil {
  1905  				var enableAutomaticFailover bool
  1906  				err = json.Unmarshal(*v, &enableAutomaticFailover)
  1907  				if err != nil {
  1908  					return err
  1909  				}
  1910  				dagp.EnableAutomaticFailover = &enableAutomaticFailover
  1911  			}
  1912  		case "consistencyPolicy":
  1913  			if v != nil {
  1914  				var consistencyPolicy ConsistencyPolicy
  1915  				err = json.Unmarshal(*v, &consistencyPolicy)
  1916  				if err != nil {
  1917  					return err
  1918  				}
  1919  				dagp.ConsistencyPolicy = &consistencyPolicy
  1920  			}
  1921  		case "capabilities":
  1922  			if v != nil {
  1923  				var capabilities []Capability
  1924  				err = json.Unmarshal(*v, &capabilities)
  1925  				if err != nil {
  1926  					return err
  1927  				}
  1928  				dagp.Capabilities = &capabilities
  1929  			}
  1930  		case "writeLocations":
  1931  			if v != nil {
  1932  				var writeLocations []Location
  1933  				err = json.Unmarshal(*v, &writeLocations)
  1934  				if err != nil {
  1935  					return err
  1936  				}
  1937  				dagp.WriteLocations = &writeLocations
  1938  			}
  1939  		case "readLocations":
  1940  			if v != nil {
  1941  				var readLocations []Location
  1942  				err = json.Unmarshal(*v, &readLocations)
  1943  				if err != nil {
  1944  					return err
  1945  				}
  1946  				dagp.ReadLocations = &readLocations
  1947  			}
  1948  		case "locations":
  1949  			if v != nil {
  1950  				var locations []Location
  1951  				err = json.Unmarshal(*v, &locations)
  1952  				if err != nil {
  1953  					return err
  1954  				}
  1955  				dagp.Locations = &locations
  1956  			}
  1957  		case "failoverPolicies":
  1958  			if v != nil {
  1959  				var failoverPolicies []FailoverPolicy
  1960  				err = json.Unmarshal(*v, &failoverPolicies)
  1961  				if err != nil {
  1962  					return err
  1963  				}
  1964  				dagp.FailoverPolicies = &failoverPolicies
  1965  			}
  1966  		case "virtualNetworkRules":
  1967  			if v != nil {
  1968  				var virtualNetworkRules []VirtualNetworkRule
  1969  				err = json.Unmarshal(*v, &virtualNetworkRules)
  1970  				if err != nil {
  1971  					return err
  1972  				}
  1973  				dagp.VirtualNetworkRules = &virtualNetworkRules
  1974  			}
  1975  		case "privateEndpointConnections":
  1976  			if v != nil {
  1977  				var privateEndpointConnections []PrivateEndpointConnection
  1978  				err = json.Unmarshal(*v, &privateEndpointConnections)
  1979  				if err != nil {
  1980  					return err
  1981  				}
  1982  				dagp.PrivateEndpointConnections = &privateEndpointConnections
  1983  			}
  1984  		case "enableMultipleWriteLocations":
  1985  			if v != nil {
  1986  				var enableMultipleWriteLocations bool
  1987  				err = json.Unmarshal(*v, &enableMultipleWriteLocations)
  1988  				if err != nil {
  1989  					return err
  1990  				}
  1991  				dagp.EnableMultipleWriteLocations = &enableMultipleWriteLocations
  1992  			}
  1993  		case "enableCassandraConnector":
  1994  			if v != nil {
  1995  				var enableCassandraConnector bool
  1996  				err = json.Unmarshal(*v, &enableCassandraConnector)
  1997  				if err != nil {
  1998  					return err
  1999  				}
  2000  				dagp.EnableCassandraConnector = &enableCassandraConnector
  2001  			}
  2002  		case "connectorOffer":
  2003  			if v != nil {
  2004  				var connectorOffer ConnectorOffer
  2005  				err = json.Unmarshal(*v, &connectorOffer)
  2006  				if err != nil {
  2007  					return err
  2008  				}
  2009  				dagp.ConnectorOffer = connectorOffer
  2010  			}
  2011  		case "disableKeyBasedMetadataWriteAccess":
  2012  			if v != nil {
  2013  				var disableKeyBasedMetadataWriteAccess bool
  2014  				err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess)
  2015  				if err != nil {
  2016  					return err
  2017  				}
  2018  				dagp.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
  2019  			}
  2020  		case "keyVaultKeyUri":
  2021  			if v != nil {
  2022  				var keyVaultKeyURI string
  2023  				err = json.Unmarshal(*v, &keyVaultKeyURI)
  2024  				if err != nil {
  2025  					return err
  2026  				}
  2027  				dagp.KeyVaultKeyURI = &keyVaultKeyURI
  2028  			}
  2029  		case "defaultIdentity":
  2030  			if v != nil {
  2031  				var defaultIdentity string
  2032  				err = json.Unmarshal(*v, &defaultIdentity)
  2033  				if err != nil {
  2034  					return err
  2035  				}
  2036  				dagp.DefaultIdentity = &defaultIdentity
  2037  			}
  2038  		case "publicNetworkAccess":
  2039  			if v != nil {
  2040  				var publicNetworkAccess PublicNetworkAccess
  2041  				err = json.Unmarshal(*v, &publicNetworkAccess)
  2042  				if err != nil {
  2043  					return err
  2044  				}
  2045  				dagp.PublicNetworkAccess = publicNetworkAccess
  2046  			}
  2047  		case "enableFreeTier":
  2048  			if v != nil {
  2049  				var enableFreeTier bool
  2050  				err = json.Unmarshal(*v, &enableFreeTier)
  2051  				if err != nil {
  2052  					return err
  2053  				}
  2054  				dagp.EnableFreeTier = &enableFreeTier
  2055  			}
  2056  		case "apiProperties":
  2057  			if v != nil {
  2058  				var APIProperties APIProperties
  2059  				err = json.Unmarshal(*v, &APIProperties)
  2060  				if err != nil {
  2061  					return err
  2062  				}
  2063  				dagp.APIProperties = &APIProperties
  2064  			}
  2065  		case "enableAnalyticalStorage":
  2066  			if v != nil {
  2067  				var enableAnalyticalStorage bool
  2068  				err = json.Unmarshal(*v, &enableAnalyticalStorage)
  2069  				if err != nil {
  2070  					return err
  2071  				}
  2072  				dagp.EnableAnalyticalStorage = &enableAnalyticalStorage
  2073  			}
  2074  		case "backupPolicy":
  2075  			if v != nil {
  2076  				backupPolicy, err := unmarshalBasicBackupPolicy(*v)
  2077  				if err != nil {
  2078  					return err
  2079  				}
  2080  				dagp.BackupPolicy = backupPolicy
  2081  			}
  2082  		case "cors":
  2083  			if v != nil {
  2084  				var cors []CorsPolicy
  2085  				err = json.Unmarshal(*v, &cors)
  2086  				if err != nil {
  2087  					return err
  2088  				}
  2089  				dagp.Cors = &cors
  2090  			}
  2091  		case "networkAclBypass":
  2092  			if v != nil {
  2093  				var networkACLBypass NetworkACLBypass
  2094  				err = json.Unmarshal(*v, &networkACLBypass)
  2095  				if err != nil {
  2096  					return err
  2097  				}
  2098  				dagp.NetworkACLBypass = networkACLBypass
  2099  			}
  2100  		case "networkAclBypassResourceIds":
  2101  			if v != nil {
  2102  				var networkACLBypassResourceIds []string
  2103  				err = json.Unmarshal(*v, &networkACLBypassResourceIds)
  2104  				if err != nil {
  2105  					return err
  2106  				}
  2107  				dagp.NetworkACLBypassResourceIds = &networkACLBypassResourceIds
  2108  			}
  2109  		}
  2110  	}
  2111  
  2112  	return nil
  2113  }
  2114  
  2115  // DatabaseAccountGetResults an Azure Cosmos DB database account.
  2116  type DatabaseAccountGetResults struct {
  2117  	autorest.Response `json:"-"`
  2118  	// Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'
  2119  	Kind                          DatabaseAccountKind     `json:"kind,omitempty"`
  2120  	Identity                      *ManagedServiceIdentity `json:"identity,omitempty"`
  2121  	*DatabaseAccountGetProperties `json:"properties,omitempty"`
  2122  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  2123  	ID *string `json:"id,omitempty"`
  2124  	// Name - READ-ONLY; The name of the ARM resource.
  2125  	Name *string `json:"name,omitempty"`
  2126  	// Type - READ-ONLY; The type of Azure resource.
  2127  	Type *string `json:"type,omitempty"`
  2128  	// Location - The location of the resource group to which the resource belongs.
  2129  	Location *string            `json:"location,omitempty"`
  2130  	Tags     map[string]*string `json:"tags"`
  2131  }
  2132  
  2133  // MarshalJSON is the custom marshaler for DatabaseAccountGetResults.
  2134  func (dagr DatabaseAccountGetResults) MarshalJSON() ([]byte, error) {
  2135  	objectMap := make(map[string]interface{})
  2136  	if dagr.Kind != "" {
  2137  		objectMap["kind"] = dagr.Kind
  2138  	}
  2139  	if dagr.Identity != nil {
  2140  		objectMap["identity"] = dagr.Identity
  2141  	}
  2142  	if dagr.DatabaseAccountGetProperties != nil {
  2143  		objectMap["properties"] = dagr.DatabaseAccountGetProperties
  2144  	}
  2145  	if dagr.Location != nil {
  2146  		objectMap["location"] = dagr.Location
  2147  	}
  2148  	if dagr.Tags != nil {
  2149  		objectMap["tags"] = dagr.Tags
  2150  	}
  2151  	return json.Marshal(objectMap)
  2152  }
  2153  
  2154  // UnmarshalJSON is the custom unmarshaler for DatabaseAccountGetResults struct.
  2155  func (dagr *DatabaseAccountGetResults) UnmarshalJSON(body []byte) error {
  2156  	var m map[string]*json.RawMessage
  2157  	err := json.Unmarshal(body, &m)
  2158  	if err != nil {
  2159  		return err
  2160  	}
  2161  	for k, v := range m {
  2162  		switch k {
  2163  		case "kind":
  2164  			if v != nil {
  2165  				var kind DatabaseAccountKind
  2166  				err = json.Unmarshal(*v, &kind)
  2167  				if err != nil {
  2168  					return err
  2169  				}
  2170  				dagr.Kind = kind
  2171  			}
  2172  		case "identity":
  2173  			if v != nil {
  2174  				var identity ManagedServiceIdentity
  2175  				err = json.Unmarshal(*v, &identity)
  2176  				if err != nil {
  2177  					return err
  2178  				}
  2179  				dagr.Identity = &identity
  2180  			}
  2181  		case "properties":
  2182  			if v != nil {
  2183  				var databaseAccountGetProperties DatabaseAccountGetProperties
  2184  				err = json.Unmarshal(*v, &databaseAccountGetProperties)
  2185  				if err != nil {
  2186  					return err
  2187  				}
  2188  				dagr.DatabaseAccountGetProperties = &databaseAccountGetProperties
  2189  			}
  2190  		case "id":
  2191  			if v != nil {
  2192  				var ID string
  2193  				err = json.Unmarshal(*v, &ID)
  2194  				if err != nil {
  2195  					return err
  2196  				}
  2197  				dagr.ID = &ID
  2198  			}
  2199  		case "name":
  2200  			if v != nil {
  2201  				var name string
  2202  				err = json.Unmarshal(*v, &name)
  2203  				if err != nil {
  2204  					return err
  2205  				}
  2206  				dagr.Name = &name
  2207  			}
  2208  		case "type":
  2209  			if v != nil {
  2210  				var typeVar string
  2211  				err = json.Unmarshal(*v, &typeVar)
  2212  				if err != nil {
  2213  					return err
  2214  				}
  2215  				dagr.Type = &typeVar
  2216  			}
  2217  		case "location":
  2218  			if v != nil {
  2219  				var location string
  2220  				err = json.Unmarshal(*v, &location)
  2221  				if err != nil {
  2222  					return err
  2223  				}
  2224  				dagr.Location = &location
  2225  			}
  2226  		case "tags":
  2227  			if v != nil {
  2228  				var tags map[string]*string
  2229  				err = json.Unmarshal(*v, &tags)
  2230  				if err != nil {
  2231  					return err
  2232  				}
  2233  				dagr.Tags = tags
  2234  			}
  2235  		}
  2236  	}
  2237  
  2238  	return nil
  2239  }
  2240  
  2241  // DatabaseAccountListConnectionStringsResult the connection strings for the given database account.
  2242  type DatabaseAccountListConnectionStringsResult struct {
  2243  	autorest.Response `json:"-"`
  2244  	// ConnectionStrings - An array that contains the connection strings for the Cosmos DB account.
  2245  	ConnectionStrings *[]DatabaseAccountConnectionString `json:"connectionStrings,omitempty"`
  2246  }
  2247  
  2248  // DatabaseAccountListKeysResult the access keys for the given database account.
  2249  type DatabaseAccountListKeysResult struct {
  2250  	autorest.Response `json:"-"`
  2251  	// PrimaryMasterKey - READ-ONLY; Base 64 encoded value of the primary read-write key.
  2252  	PrimaryMasterKey *string `json:"primaryMasterKey,omitempty"`
  2253  	// SecondaryMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-write key.
  2254  	SecondaryMasterKey *string `json:"secondaryMasterKey,omitempty"`
  2255  	// PrimaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the primary read-only key.
  2256  	PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"`
  2257  	// SecondaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-only key.
  2258  	SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"`
  2259  }
  2260  
  2261  // MarshalJSON is the custom marshaler for DatabaseAccountListKeysResult.
  2262  func (dalkr DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) {
  2263  	objectMap := make(map[string]interface{})
  2264  	return json.Marshal(objectMap)
  2265  }
  2266  
  2267  // DatabaseAccountListReadOnlyKeysResult the read-only access keys for the given database account.
  2268  type DatabaseAccountListReadOnlyKeysResult struct {
  2269  	autorest.Response `json:"-"`
  2270  	// PrimaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the primary read-only key.
  2271  	PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"`
  2272  	// SecondaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-only key.
  2273  	SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"`
  2274  }
  2275  
  2276  // MarshalJSON is the custom marshaler for DatabaseAccountListReadOnlyKeysResult.
  2277  func (dalrokr DatabaseAccountListReadOnlyKeysResult) MarshalJSON() ([]byte, error) {
  2278  	objectMap := make(map[string]interface{})
  2279  	return json.Marshal(objectMap)
  2280  }
  2281  
  2282  // DatabaseAccountRegenerateKeyParameters parameters to regenerate the keys within the database account.
  2283  type DatabaseAccountRegenerateKeyParameters struct {
  2284  	// KeyKind - The access key to regenerate. Possible values include: 'Primary', 'Secondary', 'PrimaryReadonly', 'SecondaryReadonly'
  2285  	KeyKind KeyKind `json:"keyKind,omitempty"`
  2286  }
  2287  
  2288  // DatabaseAccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
  2289  // long-running operation.
  2290  type DatabaseAccountsCreateOrUpdateFuture struct {
  2291  	azure.FutureAPI
  2292  	// Result returns the result of the asynchronous operation.
  2293  	// If the operation has not completed it will return an error.
  2294  	Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error)
  2295  }
  2296  
  2297  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2298  func (future *DatabaseAccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  2299  	var azFuture azure.Future
  2300  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2301  		return err
  2302  	}
  2303  	future.FutureAPI = &azFuture
  2304  	future.Result = future.result
  2305  	return nil
  2306  }
  2307  
  2308  // result is the default implementation for DatabaseAccountsCreateOrUpdateFuture.Result.
  2309  func (future *DatabaseAccountsCreateOrUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) {
  2310  	var done bool
  2311  	done, err = future.DoneWithContext(context.Background(), client)
  2312  	if err != nil {
  2313  		err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  2314  		return
  2315  	}
  2316  	if !done {
  2317  		dagr.Response.Response = future.Response()
  2318  		err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsCreateOrUpdateFuture")
  2319  		return
  2320  	}
  2321  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2322  	if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent {
  2323  		dagr, err = client.CreateOrUpdateResponder(dagr.Response.Response)
  2324  		if err != nil {
  2325  			err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request")
  2326  		}
  2327  	}
  2328  	return
  2329  }
  2330  
  2331  // DatabaseAccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  2332  // operation.
  2333  type DatabaseAccountsDeleteFuture struct {
  2334  	azure.FutureAPI
  2335  	// Result returns the result of the asynchronous operation.
  2336  	// If the operation has not completed it will return an error.
  2337  	Result func(DatabaseAccountsClient) (autorest.Response, error)
  2338  }
  2339  
  2340  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2341  func (future *DatabaseAccountsDeleteFuture) UnmarshalJSON(body []byte) error {
  2342  	var azFuture azure.Future
  2343  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2344  		return err
  2345  	}
  2346  	future.FutureAPI = &azFuture
  2347  	future.Result = future.result
  2348  	return nil
  2349  }
  2350  
  2351  // result is the default implementation for DatabaseAccountsDeleteFuture.Result.
  2352  func (future *DatabaseAccountsDeleteFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
  2353  	var done bool
  2354  	done, err = future.DoneWithContext(context.Background(), client)
  2355  	if err != nil {
  2356  		err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteFuture", "Result", future.Response(), "Polling failure")
  2357  		return
  2358  	}
  2359  	if !done {
  2360  		ar.Response = future.Response()
  2361  		err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsDeleteFuture")
  2362  		return
  2363  	}
  2364  	ar.Response = future.Response()
  2365  	return
  2366  }
  2367  
  2368  // DatabaseAccountsFailoverPriorityChangeFuture an abstraction for monitoring and retrieving the results of
  2369  // a long-running operation.
  2370  type DatabaseAccountsFailoverPriorityChangeFuture struct {
  2371  	azure.FutureAPI
  2372  	// Result returns the result of the asynchronous operation.
  2373  	// If the operation has not completed it will return an error.
  2374  	Result func(DatabaseAccountsClient) (autorest.Response, error)
  2375  }
  2376  
  2377  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2378  func (future *DatabaseAccountsFailoverPriorityChangeFuture) UnmarshalJSON(body []byte) error {
  2379  	var azFuture azure.Future
  2380  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2381  		return err
  2382  	}
  2383  	future.FutureAPI = &azFuture
  2384  	future.Result = future.result
  2385  	return nil
  2386  }
  2387  
  2388  // result is the default implementation for DatabaseAccountsFailoverPriorityChangeFuture.Result.
  2389  func (future *DatabaseAccountsFailoverPriorityChangeFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
  2390  	var done bool
  2391  	done, err = future.DoneWithContext(context.Background(), client)
  2392  	if err != nil {
  2393  		err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", future.Response(), "Polling failure")
  2394  		return
  2395  	}
  2396  	if !done {
  2397  		ar.Response = future.Response()
  2398  		err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsFailoverPriorityChangeFuture")
  2399  		return
  2400  	}
  2401  	ar.Response = future.Response()
  2402  	return
  2403  }
  2404  
  2405  // DatabaseAccountsListResult the List operation response, that contains the database accounts and their
  2406  // properties.
  2407  type DatabaseAccountsListResult struct {
  2408  	autorest.Response `json:"-"`
  2409  	// Value - READ-ONLY; List of database account and their properties.
  2410  	Value *[]DatabaseAccountGetResults `json:"value,omitempty"`
  2411  }
  2412  
  2413  // MarshalJSON is the custom marshaler for DatabaseAccountsListResult.
  2414  func (dalr DatabaseAccountsListResult) MarshalJSON() ([]byte, error) {
  2415  	objectMap := make(map[string]interface{})
  2416  	return json.Marshal(objectMap)
  2417  }
  2418  
  2419  // DatabaseAccountsOfflineRegionFuture an abstraction for monitoring and retrieving the results of a
  2420  // long-running operation.
  2421  type DatabaseAccountsOfflineRegionFuture struct {
  2422  	azure.FutureAPI
  2423  	// Result returns the result of the asynchronous operation.
  2424  	// If the operation has not completed it will return an error.
  2425  	Result func(DatabaseAccountsClient) (autorest.Response, error)
  2426  }
  2427  
  2428  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2429  func (future *DatabaseAccountsOfflineRegionFuture) UnmarshalJSON(body []byte) error {
  2430  	var azFuture azure.Future
  2431  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2432  		return err
  2433  	}
  2434  	future.FutureAPI = &azFuture
  2435  	future.Result = future.result
  2436  	return nil
  2437  }
  2438  
  2439  // result is the default implementation for DatabaseAccountsOfflineRegionFuture.Result.
  2440  func (future *DatabaseAccountsOfflineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
  2441  	var done bool
  2442  	done, err = future.DoneWithContext(context.Background(), client)
  2443  	if err != nil {
  2444  		err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOfflineRegionFuture", "Result", future.Response(), "Polling failure")
  2445  		return
  2446  	}
  2447  	if !done {
  2448  		ar.Response = future.Response()
  2449  		err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOfflineRegionFuture")
  2450  		return
  2451  	}
  2452  	ar.Response = future.Response()
  2453  	return
  2454  }
  2455  
  2456  // DatabaseAccountsOnlineRegionFuture an abstraction for monitoring and retrieving the results of a
  2457  // long-running operation.
  2458  type DatabaseAccountsOnlineRegionFuture struct {
  2459  	azure.FutureAPI
  2460  	// Result returns the result of the asynchronous operation.
  2461  	// If the operation has not completed it will return an error.
  2462  	Result func(DatabaseAccountsClient) (autorest.Response, error)
  2463  }
  2464  
  2465  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2466  func (future *DatabaseAccountsOnlineRegionFuture) UnmarshalJSON(body []byte) error {
  2467  	var azFuture azure.Future
  2468  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2469  		return err
  2470  	}
  2471  	future.FutureAPI = &azFuture
  2472  	future.Result = future.result
  2473  	return nil
  2474  }
  2475  
  2476  // result is the default implementation for DatabaseAccountsOnlineRegionFuture.Result.
  2477  func (future *DatabaseAccountsOnlineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
  2478  	var done bool
  2479  	done, err = future.DoneWithContext(context.Background(), client)
  2480  	if err != nil {
  2481  		err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOnlineRegionFuture", "Result", future.Response(), "Polling failure")
  2482  		return
  2483  	}
  2484  	if !done {
  2485  		ar.Response = future.Response()
  2486  		err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOnlineRegionFuture")
  2487  		return
  2488  	}
  2489  	ar.Response = future.Response()
  2490  	return
  2491  }
  2492  
  2493  // DatabaseAccountsRegenerateKeyFuture an abstraction for monitoring and retrieving the results of a
  2494  // long-running operation.
  2495  type DatabaseAccountsRegenerateKeyFuture struct {
  2496  	azure.FutureAPI
  2497  	// Result returns the result of the asynchronous operation.
  2498  	// If the operation has not completed it will return an error.
  2499  	Result func(DatabaseAccountsClient) (autorest.Response, error)
  2500  }
  2501  
  2502  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2503  func (future *DatabaseAccountsRegenerateKeyFuture) UnmarshalJSON(body []byte) error {
  2504  	var azFuture azure.Future
  2505  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2506  		return err
  2507  	}
  2508  	future.FutureAPI = &azFuture
  2509  	future.Result = future.result
  2510  	return nil
  2511  }
  2512  
  2513  // result is the default implementation for DatabaseAccountsRegenerateKeyFuture.Result.
  2514  func (future *DatabaseAccountsRegenerateKeyFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
  2515  	var done bool
  2516  	done, err = future.DoneWithContext(context.Background(), client)
  2517  	if err != nil {
  2518  		err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", future.Response(), "Polling failure")
  2519  		return
  2520  	}
  2521  	if !done {
  2522  		ar.Response = future.Response()
  2523  		err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsRegenerateKeyFuture")
  2524  		return
  2525  	}
  2526  	ar.Response = future.Response()
  2527  	return
  2528  }
  2529  
  2530  // DatabaseAccountsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
  2531  // operation.
  2532  type DatabaseAccountsUpdateFuture struct {
  2533  	azure.FutureAPI
  2534  	// Result returns the result of the asynchronous operation.
  2535  	// If the operation has not completed it will return an error.
  2536  	Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error)
  2537  }
  2538  
  2539  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2540  func (future *DatabaseAccountsUpdateFuture) UnmarshalJSON(body []byte) error {
  2541  	var azFuture azure.Future
  2542  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2543  		return err
  2544  	}
  2545  	future.FutureAPI = &azFuture
  2546  	future.Result = future.result
  2547  	return nil
  2548  }
  2549  
  2550  // result is the default implementation for DatabaseAccountsUpdateFuture.Result.
  2551  func (future *DatabaseAccountsUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) {
  2552  	var done bool
  2553  	done, err = future.DoneWithContext(context.Background(), client)
  2554  	if err != nil {
  2555  		err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", future.Response(), "Polling failure")
  2556  		return
  2557  	}
  2558  	if !done {
  2559  		dagr.Response.Response = future.Response()
  2560  		err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsUpdateFuture")
  2561  		return
  2562  	}
  2563  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2564  	if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent {
  2565  		dagr, err = client.UpdateResponder(dagr.Response.Response)
  2566  		if err != nil {
  2567  			err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request")
  2568  		}
  2569  	}
  2570  	return
  2571  }
  2572  
  2573  // DatabaseAccountUpdateParameters parameters for patching Azure Cosmos DB database account properties.
  2574  type DatabaseAccountUpdateParameters struct {
  2575  	Tags map[string]*string `json:"tags"`
  2576  	// Location - The location of the resource group to which the resource belongs.
  2577  	Location                         *string                 `json:"location,omitempty"`
  2578  	Identity                         *ManagedServiceIdentity `json:"identity,omitempty"`
  2579  	*DatabaseAccountUpdateProperties `json:"properties,omitempty"`
  2580  }
  2581  
  2582  // MarshalJSON is the custom marshaler for DatabaseAccountUpdateParameters.
  2583  func (daup DatabaseAccountUpdateParameters) MarshalJSON() ([]byte, error) {
  2584  	objectMap := make(map[string]interface{})
  2585  	if daup.Tags != nil {
  2586  		objectMap["tags"] = daup.Tags
  2587  	}
  2588  	if daup.Location != nil {
  2589  		objectMap["location"] = daup.Location
  2590  	}
  2591  	if daup.Identity != nil {
  2592  		objectMap["identity"] = daup.Identity
  2593  	}
  2594  	if daup.DatabaseAccountUpdateProperties != nil {
  2595  		objectMap["properties"] = daup.DatabaseAccountUpdateProperties
  2596  	}
  2597  	return json.Marshal(objectMap)
  2598  }
  2599  
  2600  // UnmarshalJSON is the custom unmarshaler for DatabaseAccountUpdateParameters struct.
  2601  func (daup *DatabaseAccountUpdateParameters) UnmarshalJSON(body []byte) error {
  2602  	var m map[string]*json.RawMessage
  2603  	err := json.Unmarshal(body, &m)
  2604  	if err != nil {
  2605  		return err
  2606  	}
  2607  	for k, v := range m {
  2608  		switch k {
  2609  		case "tags":
  2610  			if v != nil {
  2611  				var tags map[string]*string
  2612  				err = json.Unmarshal(*v, &tags)
  2613  				if err != nil {
  2614  					return err
  2615  				}
  2616  				daup.Tags = tags
  2617  			}
  2618  		case "location":
  2619  			if v != nil {
  2620  				var location string
  2621  				err = json.Unmarshal(*v, &location)
  2622  				if err != nil {
  2623  					return err
  2624  				}
  2625  				daup.Location = &location
  2626  			}
  2627  		case "identity":
  2628  			if v != nil {
  2629  				var identity ManagedServiceIdentity
  2630  				err = json.Unmarshal(*v, &identity)
  2631  				if err != nil {
  2632  					return err
  2633  				}
  2634  				daup.Identity = &identity
  2635  			}
  2636  		case "properties":
  2637  			if v != nil {
  2638  				var databaseAccountUpdateProperties DatabaseAccountUpdateProperties
  2639  				err = json.Unmarshal(*v, &databaseAccountUpdateProperties)
  2640  				if err != nil {
  2641  					return err
  2642  				}
  2643  				daup.DatabaseAccountUpdateProperties = &databaseAccountUpdateProperties
  2644  			}
  2645  		}
  2646  	}
  2647  
  2648  	return nil
  2649  }
  2650  
  2651  // DatabaseAccountUpdateProperties properties to update Azure Cosmos DB database accounts.
  2652  type DatabaseAccountUpdateProperties struct {
  2653  	// ConsistencyPolicy - The consistency policy for the Cosmos DB account.
  2654  	ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"`
  2655  	// Locations - An array that contains the georeplication locations enabled for the Cosmos DB account.
  2656  	Locations *[]Location `json:"locations,omitempty"`
  2657  	// IPRules - List of IpRules.
  2658  	IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"`
  2659  	// IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules.
  2660  	IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
  2661  	// EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account.
  2662  	EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`
  2663  	// Capabilities - List of Cosmos DB capabilities for the account
  2664  	Capabilities *[]Capability `json:"capabilities,omitempty"`
  2665  	// VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account.
  2666  	VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
  2667  	// EnableMultipleWriteLocations - Enables the account to write in multiple locations
  2668  	EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`
  2669  	// EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account
  2670  	EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`
  2671  	// ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small'
  2672  	ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"`
  2673  	// DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys
  2674  	DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`
  2675  	// KeyVaultKeyURI - The URI of the key vault
  2676  	KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"`
  2677  	// DefaultIdentity - The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more.
  2678  	DefaultIdentity *string `json:"defaultIdentity,omitempty"`
  2679  	// PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled'
  2680  	PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
  2681  	// EnableFreeTier - Flag to indicate whether Free Tier is enabled.
  2682  	EnableFreeTier *bool `json:"enableFreeTier,omitempty"`
  2683  	// APIProperties - API specific properties. Currently, supported only for MongoDB API.
  2684  	APIProperties *APIProperties `json:"apiProperties,omitempty"`
  2685  	// EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics.
  2686  	EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"`
  2687  	// BackupPolicy - The object representing the policy for taking backups on an account.
  2688  	BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"`
  2689  	// Cors - The CORS policy for the Cosmos DB database account.
  2690  	Cors *[]CorsPolicy `json:"cors,omitempty"`
  2691  	// NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices'
  2692  	NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"`
  2693  	// NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account.
  2694  	NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"`
  2695  }
  2696  
  2697  // UnmarshalJSON is the custom unmarshaler for DatabaseAccountUpdateProperties struct.
  2698  func (daup *DatabaseAccountUpdateProperties) UnmarshalJSON(body []byte) error {
  2699  	var m map[string]*json.RawMessage
  2700  	err := json.Unmarshal(body, &m)
  2701  	if err != nil {
  2702  		return err
  2703  	}
  2704  	for k, v := range m {
  2705  		switch k {
  2706  		case "consistencyPolicy":
  2707  			if v != nil {
  2708  				var consistencyPolicy ConsistencyPolicy
  2709  				err = json.Unmarshal(*v, &consistencyPolicy)
  2710  				if err != nil {
  2711  					return err
  2712  				}
  2713  				daup.ConsistencyPolicy = &consistencyPolicy
  2714  			}
  2715  		case "locations":
  2716  			if v != nil {
  2717  				var locations []Location
  2718  				err = json.Unmarshal(*v, &locations)
  2719  				if err != nil {
  2720  					return err
  2721  				}
  2722  				daup.Locations = &locations
  2723  			}
  2724  		case "ipRules":
  2725  			if v != nil {
  2726  				var IPRules []IPAddressOrRange
  2727  				err = json.Unmarshal(*v, &IPRules)
  2728  				if err != nil {
  2729  					return err
  2730  				}
  2731  				daup.IPRules = &IPRules
  2732  			}
  2733  		case "isVirtualNetworkFilterEnabled":
  2734  			if v != nil {
  2735  				var isVirtualNetworkFilterEnabled bool
  2736  				err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled)
  2737  				if err != nil {
  2738  					return err
  2739  				}
  2740  				daup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
  2741  			}
  2742  		case "enableAutomaticFailover":
  2743  			if v != nil {
  2744  				var enableAutomaticFailover bool
  2745  				err = json.Unmarshal(*v, &enableAutomaticFailover)
  2746  				if err != nil {
  2747  					return err
  2748  				}
  2749  				daup.EnableAutomaticFailover = &enableAutomaticFailover
  2750  			}
  2751  		case "capabilities":
  2752  			if v != nil {
  2753  				var capabilities []Capability
  2754  				err = json.Unmarshal(*v, &capabilities)
  2755  				if err != nil {
  2756  					return err
  2757  				}
  2758  				daup.Capabilities = &capabilities
  2759  			}
  2760  		case "virtualNetworkRules":
  2761  			if v != nil {
  2762  				var virtualNetworkRules []VirtualNetworkRule
  2763  				err = json.Unmarshal(*v, &virtualNetworkRules)
  2764  				if err != nil {
  2765  					return err
  2766  				}
  2767  				daup.VirtualNetworkRules = &virtualNetworkRules
  2768  			}
  2769  		case "enableMultipleWriteLocations":
  2770  			if v != nil {
  2771  				var enableMultipleWriteLocations bool
  2772  				err = json.Unmarshal(*v, &enableMultipleWriteLocations)
  2773  				if err != nil {
  2774  					return err
  2775  				}
  2776  				daup.EnableMultipleWriteLocations = &enableMultipleWriteLocations
  2777  			}
  2778  		case "enableCassandraConnector":
  2779  			if v != nil {
  2780  				var enableCassandraConnector bool
  2781  				err = json.Unmarshal(*v, &enableCassandraConnector)
  2782  				if err != nil {
  2783  					return err
  2784  				}
  2785  				daup.EnableCassandraConnector = &enableCassandraConnector
  2786  			}
  2787  		case "connectorOffer":
  2788  			if v != nil {
  2789  				var connectorOffer ConnectorOffer
  2790  				err = json.Unmarshal(*v, &connectorOffer)
  2791  				if err != nil {
  2792  					return err
  2793  				}
  2794  				daup.ConnectorOffer = connectorOffer
  2795  			}
  2796  		case "disableKeyBasedMetadataWriteAccess":
  2797  			if v != nil {
  2798  				var disableKeyBasedMetadataWriteAccess bool
  2799  				err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess)
  2800  				if err != nil {
  2801  					return err
  2802  				}
  2803  				daup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
  2804  			}
  2805  		case "keyVaultKeyUri":
  2806  			if v != nil {
  2807  				var keyVaultKeyURI string
  2808  				err = json.Unmarshal(*v, &keyVaultKeyURI)
  2809  				if err != nil {
  2810  					return err
  2811  				}
  2812  				daup.KeyVaultKeyURI = &keyVaultKeyURI
  2813  			}
  2814  		case "defaultIdentity":
  2815  			if v != nil {
  2816  				var defaultIdentity string
  2817  				err = json.Unmarshal(*v, &defaultIdentity)
  2818  				if err != nil {
  2819  					return err
  2820  				}
  2821  				daup.DefaultIdentity = &defaultIdentity
  2822  			}
  2823  		case "publicNetworkAccess":
  2824  			if v != nil {
  2825  				var publicNetworkAccess PublicNetworkAccess
  2826  				err = json.Unmarshal(*v, &publicNetworkAccess)
  2827  				if err != nil {
  2828  					return err
  2829  				}
  2830  				daup.PublicNetworkAccess = publicNetworkAccess
  2831  			}
  2832  		case "enableFreeTier":
  2833  			if v != nil {
  2834  				var enableFreeTier bool
  2835  				err = json.Unmarshal(*v, &enableFreeTier)
  2836  				if err != nil {
  2837  					return err
  2838  				}
  2839  				daup.EnableFreeTier = &enableFreeTier
  2840  			}
  2841  		case "apiProperties":
  2842  			if v != nil {
  2843  				var APIProperties APIProperties
  2844  				err = json.Unmarshal(*v, &APIProperties)
  2845  				if err != nil {
  2846  					return err
  2847  				}
  2848  				daup.APIProperties = &APIProperties
  2849  			}
  2850  		case "enableAnalyticalStorage":
  2851  			if v != nil {
  2852  				var enableAnalyticalStorage bool
  2853  				err = json.Unmarshal(*v, &enableAnalyticalStorage)
  2854  				if err != nil {
  2855  					return err
  2856  				}
  2857  				daup.EnableAnalyticalStorage = &enableAnalyticalStorage
  2858  			}
  2859  		case "backupPolicy":
  2860  			if v != nil {
  2861  				backupPolicy, err := unmarshalBasicBackupPolicy(*v)
  2862  				if err != nil {
  2863  					return err
  2864  				}
  2865  				daup.BackupPolicy = backupPolicy
  2866  			}
  2867  		case "cors":
  2868  			if v != nil {
  2869  				var cors []CorsPolicy
  2870  				err = json.Unmarshal(*v, &cors)
  2871  				if err != nil {
  2872  					return err
  2873  				}
  2874  				daup.Cors = &cors
  2875  			}
  2876  		case "networkAclBypass":
  2877  			if v != nil {
  2878  				var networkACLBypass NetworkACLBypass
  2879  				err = json.Unmarshal(*v, &networkACLBypass)
  2880  				if err != nil {
  2881  					return err
  2882  				}
  2883  				daup.NetworkACLBypass = networkACLBypass
  2884  			}
  2885  		case "networkAclBypassResourceIds":
  2886  			if v != nil {
  2887  				var networkACLBypassResourceIds []string
  2888  				err = json.Unmarshal(*v, &networkACLBypassResourceIds)
  2889  				if err != nil {
  2890  					return err
  2891  				}
  2892  				daup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds
  2893  			}
  2894  		}
  2895  	}
  2896  
  2897  	return nil
  2898  }
  2899  
  2900  // ErrorResponse error Response.
  2901  type ErrorResponse struct {
  2902  	// Code - Error code.
  2903  	Code *string `json:"code,omitempty"`
  2904  	// Message - Error message indicating why the operation failed.
  2905  	Message *string `json:"message,omitempty"`
  2906  }
  2907  
  2908  // ErrorResponseUpdatedFormat an error response from the service.
  2909  type ErrorResponseUpdatedFormat struct {
  2910  	Error *ErrorResponse `json:"error,omitempty"`
  2911  }
  2912  
  2913  // ExcludedPath ...
  2914  type ExcludedPath struct {
  2915  	// Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
  2916  	Path *string `json:"path,omitempty"`
  2917  }
  2918  
  2919  // ExtendedResourceProperties the system generated resource properties associated with SQL databases, SQL
  2920  // containers, Gremlin databases and Gremlin graphs.
  2921  type ExtendedResourceProperties struct {
  2922  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  2923  	Rid *string `json:"_rid,omitempty"`
  2924  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  2925  	Ts *float64 `json:"_ts,omitempty"`
  2926  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  2927  	Etag *string `json:"_etag,omitempty"`
  2928  }
  2929  
  2930  // MarshalJSON is the custom marshaler for ExtendedResourceProperties.
  2931  func (erp ExtendedResourceProperties) MarshalJSON() ([]byte, error) {
  2932  	objectMap := make(map[string]interface{})
  2933  	return json.Marshal(objectMap)
  2934  }
  2935  
  2936  // FailoverPolicies the list of new failover policies for the failover priority change.
  2937  type FailoverPolicies struct {
  2938  	// FailoverPolicies - List of failover policies.
  2939  	FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"`
  2940  }
  2941  
  2942  // FailoverPolicy the failover policy for a given region of a database account.
  2943  type FailoverPolicy struct {
  2944  	// ID - READ-ONLY; The unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>.
  2945  	ID *string `json:"id,omitempty"`
  2946  	// LocationName - The name of the region in which the database account exists.
  2947  	LocationName *string `json:"locationName,omitempty"`
  2948  	// FailoverPriority - The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
  2949  	FailoverPriority *int32 `json:"failoverPriority,omitempty"`
  2950  }
  2951  
  2952  // MarshalJSON is the custom marshaler for FailoverPolicy.
  2953  func (fp FailoverPolicy) MarshalJSON() ([]byte, error) {
  2954  	objectMap := make(map[string]interface{})
  2955  	if fp.LocationName != nil {
  2956  		objectMap["locationName"] = fp.LocationName
  2957  	}
  2958  	if fp.FailoverPriority != nil {
  2959  		objectMap["failoverPriority"] = fp.FailoverPriority
  2960  	}
  2961  	return json.Marshal(objectMap)
  2962  }
  2963  
  2964  // GremlinDatabaseCreateUpdateParameters parameters to create and update Cosmos DB Gremlin database.
  2965  type GremlinDatabaseCreateUpdateParameters struct {
  2966  	// GremlinDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin database.
  2967  	*GremlinDatabaseCreateUpdateProperties `json:"properties,omitempty"`
  2968  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  2969  	ID *string `json:"id,omitempty"`
  2970  	// Name - READ-ONLY; The name of the ARM resource.
  2971  	Name *string `json:"name,omitempty"`
  2972  	// Type - READ-ONLY; The type of Azure resource.
  2973  	Type *string `json:"type,omitempty"`
  2974  	// Location - The location of the resource group to which the resource belongs.
  2975  	Location *string            `json:"location,omitempty"`
  2976  	Tags     map[string]*string `json:"tags"`
  2977  }
  2978  
  2979  // MarshalJSON is the custom marshaler for GremlinDatabaseCreateUpdateParameters.
  2980  func (gdcup GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) {
  2981  	objectMap := make(map[string]interface{})
  2982  	if gdcup.GremlinDatabaseCreateUpdateProperties != nil {
  2983  		objectMap["properties"] = gdcup.GremlinDatabaseCreateUpdateProperties
  2984  	}
  2985  	if gdcup.Location != nil {
  2986  		objectMap["location"] = gdcup.Location
  2987  	}
  2988  	if gdcup.Tags != nil {
  2989  		objectMap["tags"] = gdcup.Tags
  2990  	}
  2991  	return json.Marshal(objectMap)
  2992  }
  2993  
  2994  // UnmarshalJSON is the custom unmarshaler for GremlinDatabaseCreateUpdateParameters struct.
  2995  func (gdcup *GremlinDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error {
  2996  	var m map[string]*json.RawMessage
  2997  	err := json.Unmarshal(body, &m)
  2998  	if err != nil {
  2999  		return err
  3000  	}
  3001  	for k, v := range m {
  3002  		switch k {
  3003  		case "properties":
  3004  			if v != nil {
  3005  				var gremlinDatabaseCreateUpdateProperties GremlinDatabaseCreateUpdateProperties
  3006  				err = json.Unmarshal(*v, &gremlinDatabaseCreateUpdateProperties)
  3007  				if err != nil {
  3008  					return err
  3009  				}
  3010  				gdcup.GremlinDatabaseCreateUpdateProperties = &gremlinDatabaseCreateUpdateProperties
  3011  			}
  3012  		case "id":
  3013  			if v != nil {
  3014  				var ID string
  3015  				err = json.Unmarshal(*v, &ID)
  3016  				if err != nil {
  3017  					return err
  3018  				}
  3019  				gdcup.ID = &ID
  3020  			}
  3021  		case "name":
  3022  			if v != nil {
  3023  				var name string
  3024  				err = json.Unmarshal(*v, &name)
  3025  				if err != nil {
  3026  					return err
  3027  				}
  3028  				gdcup.Name = &name
  3029  			}
  3030  		case "type":
  3031  			if v != nil {
  3032  				var typeVar string
  3033  				err = json.Unmarshal(*v, &typeVar)
  3034  				if err != nil {
  3035  					return err
  3036  				}
  3037  				gdcup.Type = &typeVar
  3038  			}
  3039  		case "location":
  3040  			if v != nil {
  3041  				var location string
  3042  				err = json.Unmarshal(*v, &location)
  3043  				if err != nil {
  3044  					return err
  3045  				}
  3046  				gdcup.Location = &location
  3047  			}
  3048  		case "tags":
  3049  			if v != nil {
  3050  				var tags map[string]*string
  3051  				err = json.Unmarshal(*v, &tags)
  3052  				if err != nil {
  3053  					return err
  3054  				}
  3055  				gdcup.Tags = tags
  3056  			}
  3057  		}
  3058  	}
  3059  
  3060  	return nil
  3061  }
  3062  
  3063  // GremlinDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB Gremlin database.
  3064  type GremlinDatabaseCreateUpdateProperties struct {
  3065  	// Resource - The standard JSON format of a Gremlin database
  3066  	Resource *GremlinDatabaseResource `json:"resource,omitempty"`
  3067  	// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
  3068  	Options *CreateUpdateOptions `json:"options,omitempty"`
  3069  }
  3070  
  3071  // GremlinDatabaseGetProperties the properties of an Azure Cosmos DB SQL database
  3072  type GremlinDatabaseGetProperties struct {
  3073  	Resource *GremlinDatabaseGetPropertiesResource `json:"resource,omitempty"`
  3074  	Options  *GremlinDatabaseGetPropertiesOptions  `json:"options,omitempty"`
  3075  }
  3076  
  3077  // GremlinDatabaseGetPropertiesOptions ...
  3078  type GremlinDatabaseGetPropertiesOptions struct {
  3079  	// Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details.
  3080  	Throughput *int32 `json:"throughput,omitempty"`
  3081  	// AutoscaleSettings - Specifies the Autoscale settings.
  3082  	AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
  3083  }
  3084  
  3085  // GremlinDatabaseGetPropertiesResource ...
  3086  type GremlinDatabaseGetPropertiesResource struct {
  3087  	// ID - Name of the Cosmos DB Gremlin database
  3088  	ID *string `json:"id,omitempty"`
  3089  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  3090  	Rid *string `json:"_rid,omitempty"`
  3091  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  3092  	Ts *float64 `json:"_ts,omitempty"`
  3093  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  3094  	Etag *string `json:"_etag,omitempty"`
  3095  }
  3096  
  3097  // MarshalJSON is the custom marshaler for GremlinDatabaseGetPropertiesResource.
  3098  func (gdgp GremlinDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) {
  3099  	objectMap := make(map[string]interface{})
  3100  	if gdgp.ID != nil {
  3101  		objectMap["id"] = gdgp.ID
  3102  	}
  3103  	return json.Marshal(objectMap)
  3104  }
  3105  
  3106  // GremlinDatabaseGetResults an Azure Cosmos DB Gremlin database.
  3107  type GremlinDatabaseGetResults struct {
  3108  	autorest.Response `json:"-"`
  3109  	// GremlinDatabaseGetProperties - The properties of an Azure Cosmos DB SQL database
  3110  	*GremlinDatabaseGetProperties `json:"properties,omitempty"`
  3111  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  3112  	ID *string `json:"id,omitempty"`
  3113  	// Name - READ-ONLY; The name of the ARM resource.
  3114  	Name *string `json:"name,omitempty"`
  3115  	// Type - READ-ONLY; The type of Azure resource.
  3116  	Type *string `json:"type,omitempty"`
  3117  	// Location - The location of the resource group to which the resource belongs.
  3118  	Location *string            `json:"location,omitempty"`
  3119  	Tags     map[string]*string `json:"tags"`
  3120  }
  3121  
  3122  // MarshalJSON is the custom marshaler for GremlinDatabaseGetResults.
  3123  func (gdgr GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) {
  3124  	objectMap := make(map[string]interface{})
  3125  	if gdgr.GremlinDatabaseGetProperties != nil {
  3126  		objectMap["properties"] = gdgr.GremlinDatabaseGetProperties
  3127  	}
  3128  	if gdgr.Location != nil {
  3129  		objectMap["location"] = gdgr.Location
  3130  	}
  3131  	if gdgr.Tags != nil {
  3132  		objectMap["tags"] = gdgr.Tags
  3133  	}
  3134  	return json.Marshal(objectMap)
  3135  }
  3136  
  3137  // UnmarshalJSON is the custom unmarshaler for GremlinDatabaseGetResults struct.
  3138  func (gdgr *GremlinDatabaseGetResults) UnmarshalJSON(body []byte) error {
  3139  	var m map[string]*json.RawMessage
  3140  	err := json.Unmarshal(body, &m)
  3141  	if err != nil {
  3142  		return err
  3143  	}
  3144  	for k, v := range m {
  3145  		switch k {
  3146  		case "properties":
  3147  			if v != nil {
  3148  				var gremlinDatabaseGetProperties GremlinDatabaseGetProperties
  3149  				err = json.Unmarshal(*v, &gremlinDatabaseGetProperties)
  3150  				if err != nil {
  3151  					return err
  3152  				}
  3153  				gdgr.GremlinDatabaseGetProperties = &gremlinDatabaseGetProperties
  3154  			}
  3155  		case "id":
  3156  			if v != nil {
  3157  				var ID string
  3158  				err = json.Unmarshal(*v, &ID)
  3159  				if err != nil {
  3160  					return err
  3161  				}
  3162  				gdgr.ID = &ID
  3163  			}
  3164  		case "name":
  3165  			if v != nil {
  3166  				var name string
  3167  				err = json.Unmarshal(*v, &name)
  3168  				if err != nil {
  3169  					return err
  3170  				}
  3171  				gdgr.Name = &name
  3172  			}
  3173  		case "type":
  3174  			if v != nil {
  3175  				var typeVar string
  3176  				err = json.Unmarshal(*v, &typeVar)
  3177  				if err != nil {
  3178  					return err
  3179  				}
  3180  				gdgr.Type = &typeVar
  3181  			}
  3182  		case "location":
  3183  			if v != nil {
  3184  				var location string
  3185  				err = json.Unmarshal(*v, &location)
  3186  				if err != nil {
  3187  					return err
  3188  				}
  3189  				gdgr.Location = &location
  3190  			}
  3191  		case "tags":
  3192  			if v != nil {
  3193  				var tags map[string]*string
  3194  				err = json.Unmarshal(*v, &tags)
  3195  				if err != nil {
  3196  					return err
  3197  				}
  3198  				gdgr.Tags = tags
  3199  			}
  3200  		}
  3201  	}
  3202  
  3203  	return nil
  3204  }
  3205  
  3206  // GremlinDatabaseListResult the List operation response, that contains the Gremlin databases and their
  3207  // properties.
  3208  type GremlinDatabaseListResult struct {
  3209  	autorest.Response `json:"-"`
  3210  	// Value - READ-ONLY; List of Gremlin databases and their properties.
  3211  	Value *[]GremlinDatabaseGetResults `json:"value,omitempty"`
  3212  }
  3213  
  3214  // MarshalJSON is the custom marshaler for GremlinDatabaseListResult.
  3215  func (gdlr GremlinDatabaseListResult) MarshalJSON() ([]byte, error) {
  3216  	objectMap := make(map[string]interface{})
  3217  	return json.Marshal(objectMap)
  3218  }
  3219  
  3220  // GremlinDatabaseResource cosmos DB Gremlin database resource object
  3221  type GremlinDatabaseResource struct {
  3222  	// ID - Name of the Cosmos DB Gremlin database
  3223  	ID *string `json:"id,omitempty"`
  3224  }
  3225  
  3226  // GremlinGraphCreateUpdateParameters parameters to create and update Cosmos DB Gremlin graph.
  3227  type GremlinGraphCreateUpdateParameters struct {
  3228  	// GremlinGraphCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin graph.
  3229  	*GremlinGraphCreateUpdateProperties `json:"properties,omitempty"`
  3230  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  3231  	ID *string `json:"id,omitempty"`
  3232  	// Name - READ-ONLY; The name of the ARM resource.
  3233  	Name *string `json:"name,omitempty"`
  3234  	// Type - READ-ONLY; The type of Azure resource.
  3235  	Type *string `json:"type,omitempty"`
  3236  	// Location - The location of the resource group to which the resource belongs.
  3237  	Location *string            `json:"location,omitempty"`
  3238  	Tags     map[string]*string `json:"tags"`
  3239  }
  3240  
  3241  // MarshalJSON is the custom marshaler for GremlinGraphCreateUpdateParameters.
  3242  func (ggcup GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) {
  3243  	objectMap := make(map[string]interface{})
  3244  	if ggcup.GremlinGraphCreateUpdateProperties != nil {
  3245  		objectMap["properties"] = ggcup.GremlinGraphCreateUpdateProperties
  3246  	}
  3247  	if ggcup.Location != nil {
  3248  		objectMap["location"] = ggcup.Location
  3249  	}
  3250  	if ggcup.Tags != nil {
  3251  		objectMap["tags"] = ggcup.Tags
  3252  	}
  3253  	return json.Marshal(objectMap)
  3254  }
  3255  
  3256  // UnmarshalJSON is the custom unmarshaler for GremlinGraphCreateUpdateParameters struct.
  3257  func (ggcup *GremlinGraphCreateUpdateParameters) UnmarshalJSON(body []byte) error {
  3258  	var m map[string]*json.RawMessage
  3259  	err := json.Unmarshal(body, &m)
  3260  	if err != nil {
  3261  		return err
  3262  	}
  3263  	for k, v := range m {
  3264  		switch k {
  3265  		case "properties":
  3266  			if v != nil {
  3267  				var gremlinGraphCreateUpdateProperties GremlinGraphCreateUpdateProperties
  3268  				err = json.Unmarshal(*v, &gremlinGraphCreateUpdateProperties)
  3269  				if err != nil {
  3270  					return err
  3271  				}
  3272  				ggcup.GremlinGraphCreateUpdateProperties = &gremlinGraphCreateUpdateProperties
  3273  			}
  3274  		case "id":
  3275  			if v != nil {
  3276  				var ID string
  3277  				err = json.Unmarshal(*v, &ID)
  3278  				if err != nil {
  3279  					return err
  3280  				}
  3281  				ggcup.ID = &ID
  3282  			}
  3283  		case "name":
  3284  			if v != nil {
  3285  				var name string
  3286  				err = json.Unmarshal(*v, &name)
  3287  				if err != nil {
  3288  					return err
  3289  				}
  3290  				ggcup.Name = &name
  3291  			}
  3292  		case "type":
  3293  			if v != nil {
  3294  				var typeVar string
  3295  				err = json.Unmarshal(*v, &typeVar)
  3296  				if err != nil {
  3297  					return err
  3298  				}
  3299  				ggcup.Type = &typeVar
  3300  			}
  3301  		case "location":
  3302  			if v != nil {
  3303  				var location string
  3304  				err = json.Unmarshal(*v, &location)
  3305  				if err != nil {
  3306  					return err
  3307  				}
  3308  				ggcup.Location = &location
  3309  			}
  3310  		case "tags":
  3311  			if v != nil {
  3312  				var tags map[string]*string
  3313  				err = json.Unmarshal(*v, &tags)
  3314  				if err != nil {
  3315  					return err
  3316  				}
  3317  				ggcup.Tags = tags
  3318  			}
  3319  		}
  3320  	}
  3321  
  3322  	return nil
  3323  }
  3324  
  3325  // GremlinGraphCreateUpdateProperties properties to create and update Azure Cosmos DB Gremlin graph.
  3326  type GremlinGraphCreateUpdateProperties struct {
  3327  	// Resource - The standard JSON format of a Gremlin graph
  3328  	Resource *GremlinGraphResource `json:"resource,omitempty"`
  3329  	// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
  3330  	Options *CreateUpdateOptions `json:"options,omitempty"`
  3331  }
  3332  
  3333  // GremlinGraphGetProperties the properties of an Azure Cosmos DB Gremlin graph
  3334  type GremlinGraphGetProperties struct {
  3335  	Resource *GremlinGraphGetPropertiesResource `json:"resource,omitempty"`
  3336  	Options  *GremlinGraphGetPropertiesOptions  `json:"options,omitempty"`
  3337  }
  3338  
  3339  // GremlinGraphGetPropertiesOptions ...
  3340  type GremlinGraphGetPropertiesOptions struct {
  3341  	// Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details.
  3342  	Throughput *int32 `json:"throughput,omitempty"`
  3343  	// AutoscaleSettings - Specifies the Autoscale settings.
  3344  	AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
  3345  }
  3346  
  3347  // GremlinGraphGetPropertiesResource ...
  3348  type GremlinGraphGetPropertiesResource struct {
  3349  	// ID - Name of the Cosmos DB Gremlin graph
  3350  	ID *string `json:"id,omitempty"`
  3351  	// IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph
  3352  	IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
  3353  	// PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions
  3354  	PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
  3355  	// DefaultTTL - Default time to live
  3356  	DefaultTTL *int32 `json:"defaultTtl,omitempty"`
  3357  	// UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service.
  3358  	UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
  3359  	// ConflictResolutionPolicy - The conflict resolution policy for the graph.
  3360  	ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
  3361  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  3362  	Rid *string `json:"_rid,omitempty"`
  3363  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  3364  	Ts *float64 `json:"_ts,omitempty"`
  3365  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  3366  	Etag *string `json:"_etag,omitempty"`
  3367  }
  3368  
  3369  // MarshalJSON is the custom marshaler for GremlinGraphGetPropertiesResource.
  3370  func (gggp GremlinGraphGetPropertiesResource) MarshalJSON() ([]byte, error) {
  3371  	objectMap := make(map[string]interface{})
  3372  	if gggp.ID != nil {
  3373  		objectMap["id"] = gggp.ID
  3374  	}
  3375  	if gggp.IndexingPolicy != nil {
  3376  		objectMap["indexingPolicy"] = gggp.IndexingPolicy
  3377  	}
  3378  	if gggp.PartitionKey != nil {
  3379  		objectMap["partitionKey"] = gggp.PartitionKey
  3380  	}
  3381  	if gggp.DefaultTTL != nil {
  3382  		objectMap["defaultTtl"] = gggp.DefaultTTL
  3383  	}
  3384  	if gggp.UniqueKeyPolicy != nil {
  3385  		objectMap["uniqueKeyPolicy"] = gggp.UniqueKeyPolicy
  3386  	}
  3387  	if gggp.ConflictResolutionPolicy != nil {
  3388  		objectMap["conflictResolutionPolicy"] = gggp.ConflictResolutionPolicy
  3389  	}
  3390  	return json.Marshal(objectMap)
  3391  }
  3392  
  3393  // GremlinGraphGetResults an Azure Cosmos DB Gremlin graph.
  3394  type GremlinGraphGetResults struct {
  3395  	autorest.Response `json:"-"`
  3396  	// GremlinGraphGetProperties - The properties of an Azure Cosmos DB Gremlin graph
  3397  	*GremlinGraphGetProperties `json:"properties,omitempty"`
  3398  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  3399  	ID *string `json:"id,omitempty"`
  3400  	// Name - READ-ONLY; The name of the ARM resource.
  3401  	Name *string `json:"name,omitempty"`
  3402  	// Type - READ-ONLY; The type of Azure resource.
  3403  	Type *string `json:"type,omitempty"`
  3404  	// Location - The location of the resource group to which the resource belongs.
  3405  	Location *string            `json:"location,omitempty"`
  3406  	Tags     map[string]*string `json:"tags"`
  3407  }
  3408  
  3409  // MarshalJSON is the custom marshaler for GremlinGraphGetResults.
  3410  func (gggr GremlinGraphGetResults) MarshalJSON() ([]byte, error) {
  3411  	objectMap := make(map[string]interface{})
  3412  	if gggr.GremlinGraphGetProperties != nil {
  3413  		objectMap["properties"] = gggr.GremlinGraphGetProperties
  3414  	}
  3415  	if gggr.Location != nil {
  3416  		objectMap["location"] = gggr.Location
  3417  	}
  3418  	if gggr.Tags != nil {
  3419  		objectMap["tags"] = gggr.Tags
  3420  	}
  3421  	return json.Marshal(objectMap)
  3422  }
  3423  
  3424  // UnmarshalJSON is the custom unmarshaler for GremlinGraphGetResults struct.
  3425  func (gggr *GremlinGraphGetResults) UnmarshalJSON(body []byte) error {
  3426  	var m map[string]*json.RawMessage
  3427  	err := json.Unmarshal(body, &m)
  3428  	if err != nil {
  3429  		return err
  3430  	}
  3431  	for k, v := range m {
  3432  		switch k {
  3433  		case "properties":
  3434  			if v != nil {
  3435  				var gremlinGraphGetProperties GremlinGraphGetProperties
  3436  				err = json.Unmarshal(*v, &gremlinGraphGetProperties)
  3437  				if err != nil {
  3438  					return err
  3439  				}
  3440  				gggr.GremlinGraphGetProperties = &gremlinGraphGetProperties
  3441  			}
  3442  		case "id":
  3443  			if v != nil {
  3444  				var ID string
  3445  				err = json.Unmarshal(*v, &ID)
  3446  				if err != nil {
  3447  					return err
  3448  				}
  3449  				gggr.ID = &ID
  3450  			}
  3451  		case "name":
  3452  			if v != nil {
  3453  				var name string
  3454  				err = json.Unmarshal(*v, &name)
  3455  				if err != nil {
  3456  					return err
  3457  				}
  3458  				gggr.Name = &name
  3459  			}
  3460  		case "type":
  3461  			if v != nil {
  3462  				var typeVar string
  3463  				err = json.Unmarshal(*v, &typeVar)
  3464  				if err != nil {
  3465  					return err
  3466  				}
  3467  				gggr.Type = &typeVar
  3468  			}
  3469  		case "location":
  3470  			if v != nil {
  3471  				var location string
  3472  				err = json.Unmarshal(*v, &location)
  3473  				if err != nil {
  3474  					return err
  3475  				}
  3476  				gggr.Location = &location
  3477  			}
  3478  		case "tags":
  3479  			if v != nil {
  3480  				var tags map[string]*string
  3481  				err = json.Unmarshal(*v, &tags)
  3482  				if err != nil {
  3483  					return err
  3484  				}
  3485  				gggr.Tags = tags
  3486  			}
  3487  		}
  3488  	}
  3489  
  3490  	return nil
  3491  }
  3492  
  3493  // GremlinGraphListResult the List operation response, that contains the graphs and their properties.
  3494  type GremlinGraphListResult struct {
  3495  	autorest.Response `json:"-"`
  3496  	// Value - READ-ONLY; List of graphs and their properties.
  3497  	Value *[]GremlinGraphGetResults `json:"value,omitempty"`
  3498  }
  3499  
  3500  // MarshalJSON is the custom marshaler for GremlinGraphListResult.
  3501  func (gglr GremlinGraphListResult) MarshalJSON() ([]byte, error) {
  3502  	objectMap := make(map[string]interface{})
  3503  	return json.Marshal(objectMap)
  3504  }
  3505  
  3506  // GremlinGraphResource cosmos DB Gremlin graph resource object
  3507  type GremlinGraphResource struct {
  3508  	// ID - Name of the Cosmos DB Gremlin graph
  3509  	ID *string `json:"id,omitempty"`
  3510  	// IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph
  3511  	IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
  3512  	// PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions
  3513  	PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
  3514  	// DefaultTTL - Default time to live
  3515  	DefaultTTL *int32 `json:"defaultTtl,omitempty"`
  3516  	// UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service.
  3517  	UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
  3518  	// ConflictResolutionPolicy - The conflict resolution policy for the graph.
  3519  	ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
  3520  }
  3521  
  3522  // GremlinResourcesCreateUpdateGremlinDatabaseFuture an abstraction for monitoring and retrieving the
  3523  // results of a long-running operation.
  3524  type GremlinResourcesCreateUpdateGremlinDatabaseFuture struct {
  3525  	azure.FutureAPI
  3526  	// Result returns the result of the asynchronous operation.
  3527  	// If the operation has not completed it will return an error.
  3528  	Result func(GremlinResourcesClient) (GremlinDatabaseGetResults, error)
  3529  }
  3530  
  3531  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3532  func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) UnmarshalJSON(body []byte) error {
  3533  	var azFuture azure.Future
  3534  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3535  		return err
  3536  	}
  3537  	future.FutureAPI = &azFuture
  3538  	future.Result = future.result
  3539  	return nil
  3540  }
  3541  
  3542  // result is the default implementation for GremlinResourcesCreateUpdateGremlinDatabaseFuture.Result.
  3543  func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) result(client GremlinResourcesClient) (gdgr GremlinDatabaseGetResults, err error) {
  3544  	var done bool
  3545  	done, err = future.DoneWithContext(context.Background(), client)
  3546  	if err != nil {
  3547  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", future.Response(), "Polling failure")
  3548  		return
  3549  	}
  3550  	if !done {
  3551  		gdgr.Response.Response = future.Response()
  3552  		err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture")
  3553  		return
  3554  	}
  3555  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3556  	if gdgr.Response.Response, err = future.GetResult(sender); err == nil && gdgr.Response.Response.StatusCode != http.StatusNoContent {
  3557  		gdgr, err = client.CreateUpdateGremlinDatabaseResponder(gdgr.Response.Response)
  3558  		if err != nil {
  3559  			err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", gdgr.Response.Response, "Failure responding to request")
  3560  		}
  3561  	}
  3562  	return
  3563  }
  3564  
  3565  // GremlinResourcesCreateUpdateGremlinGraphFuture an abstraction for monitoring and retrieving the results
  3566  // of a long-running operation.
  3567  type GremlinResourcesCreateUpdateGremlinGraphFuture struct {
  3568  	azure.FutureAPI
  3569  	// Result returns the result of the asynchronous operation.
  3570  	// If the operation has not completed it will return an error.
  3571  	Result func(GremlinResourcesClient) (GremlinGraphGetResults, error)
  3572  }
  3573  
  3574  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3575  func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) UnmarshalJSON(body []byte) error {
  3576  	var azFuture azure.Future
  3577  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3578  		return err
  3579  	}
  3580  	future.FutureAPI = &azFuture
  3581  	future.Result = future.result
  3582  	return nil
  3583  }
  3584  
  3585  // result is the default implementation for GremlinResourcesCreateUpdateGremlinGraphFuture.Result.
  3586  func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) result(client GremlinResourcesClient) (gggr GremlinGraphGetResults, err error) {
  3587  	var done bool
  3588  	done, err = future.DoneWithContext(context.Background(), client)
  3589  	if err != nil {
  3590  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", future.Response(), "Polling failure")
  3591  		return
  3592  	}
  3593  	if !done {
  3594  		gggr.Response.Response = future.Response()
  3595  		err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture")
  3596  		return
  3597  	}
  3598  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3599  	if gggr.Response.Response, err = future.GetResult(sender); err == nil && gggr.Response.Response.StatusCode != http.StatusNoContent {
  3600  		gggr, err = client.CreateUpdateGremlinGraphResponder(gggr.Response.Response)
  3601  		if err != nil {
  3602  			err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", gggr.Response.Response, "Failure responding to request")
  3603  		}
  3604  	}
  3605  	return
  3606  }
  3607  
  3608  // GremlinResourcesDeleteGremlinDatabaseFuture an abstraction for monitoring and retrieving the results of
  3609  // a long-running operation.
  3610  type GremlinResourcesDeleteGremlinDatabaseFuture struct {
  3611  	azure.FutureAPI
  3612  	// Result returns the result of the asynchronous operation.
  3613  	// If the operation has not completed it will return an error.
  3614  	Result func(GremlinResourcesClient) (autorest.Response, error)
  3615  }
  3616  
  3617  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3618  func (future *GremlinResourcesDeleteGremlinDatabaseFuture) UnmarshalJSON(body []byte) error {
  3619  	var azFuture azure.Future
  3620  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3621  		return err
  3622  	}
  3623  	future.FutureAPI = &azFuture
  3624  	future.Result = future.result
  3625  	return nil
  3626  }
  3627  
  3628  // result is the default implementation for GremlinResourcesDeleteGremlinDatabaseFuture.Result.
  3629  func (future *GremlinResourcesDeleteGremlinDatabaseFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) {
  3630  	var done bool
  3631  	done, err = future.DoneWithContext(context.Background(), client)
  3632  	if err != nil {
  3633  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinDatabaseFuture", "Result", future.Response(), "Polling failure")
  3634  		return
  3635  	}
  3636  	if !done {
  3637  		ar.Response = future.Response()
  3638  		err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinDatabaseFuture")
  3639  		return
  3640  	}
  3641  	ar.Response = future.Response()
  3642  	return
  3643  }
  3644  
  3645  // GremlinResourcesDeleteGremlinGraphFuture an abstraction for monitoring and retrieving the results of a
  3646  // long-running operation.
  3647  type GremlinResourcesDeleteGremlinGraphFuture struct {
  3648  	azure.FutureAPI
  3649  	// Result returns the result of the asynchronous operation.
  3650  	// If the operation has not completed it will return an error.
  3651  	Result func(GremlinResourcesClient) (autorest.Response, error)
  3652  }
  3653  
  3654  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3655  func (future *GremlinResourcesDeleteGremlinGraphFuture) UnmarshalJSON(body []byte) error {
  3656  	var azFuture azure.Future
  3657  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3658  		return err
  3659  	}
  3660  	future.FutureAPI = &azFuture
  3661  	future.Result = future.result
  3662  	return nil
  3663  }
  3664  
  3665  // result is the default implementation for GremlinResourcesDeleteGremlinGraphFuture.Result.
  3666  func (future *GremlinResourcesDeleteGremlinGraphFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) {
  3667  	var done bool
  3668  	done, err = future.DoneWithContext(context.Background(), client)
  3669  	if err != nil {
  3670  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinGraphFuture", "Result", future.Response(), "Polling failure")
  3671  		return
  3672  	}
  3673  	if !done {
  3674  		ar.Response = future.Response()
  3675  		err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinGraphFuture")
  3676  		return
  3677  	}
  3678  	ar.Response = future.Response()
  3679  	return
  3680  }
  3681  
  3682  // GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the
  3683  // results of a long-running operation.
  3684  type GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture struct {
  3685  	azure.FutureAPI
  3686  	// Result returns the result of the asynchronous operation.
  3687  	// If the operation has not completed it will return an error.
  3688  	Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
  3689  }
  3690  
  3691  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3692  func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error {
  3693  	var azFuture azure.Future
  3694  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3695  		return err
  3696  	}
  3697  	future.FutureAPI = &azFuture
  3698  	future.Result = future.result
  3699  	return nil
  3700  }
  3701  
  3702  // result is the default implementation for GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture.Result.
  3703  func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  3704  	var done bool
  3705  	done, err = future.DoneWithContext(context.Background(), client)
  3706  	if err != nil {
  3707  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure")
  3708  		return
  3709  	}
  3710  	if !done {
  3711  		tsgr.Response.Response = future.Response()
  3712  		err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture")
  3713  		return
  3714  	}
  3715  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3716  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  3717  		tsgr, err = client.MigrateGremlinDatabaseToAutoscaleResponder(tsgr.Response.Response)
  3718  		if err != nil {
  3719  			err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  3720  		}
  3721  	}
  3722  	return
  3723  }
  3724  
  3725  // GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture an abstraction for monitoring and
  3726  // retrieving the results of a long-running operation.
  3727  type GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture struct {
  3728  	azure.FutureAPI
  3729  	// Result returns the result of the asynchronous operation.
  3730  	// If the operation has not completed it will return an error.
  3731  	Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
  3732  }
  3733  
  3734  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3735  func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error {
  3736  	var azFuture azure.Future
  3737  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3738  		return err
  3739  	}
  3740  	future.FutureAPI = &azFuture
  3741  	future.Result = future.result
  3742  	return nil
  3743  }
  3744  
  3745  // result is the default implementation for GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture.Result.
  3746  func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  3747  	var done bool
  3748  	done, err = future.DoneWithContext(context.Background(), client)
  3749  	if err != nil {
  3750  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure")
  3751  		return
  3752  	}
  3753  	if !done {
  3754  		tsgr.Response.Response = future.Response()
  3755  		err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture")
  3756  		return
  3757  	}
  3758  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3759  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  3760  		tsgr, err = client.MigrateGremlinDatabaseToManualThroughputResponder(tsgr.Response.Response)
  3761  		if err != nil {
  3762  			err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  3763  		}
  3764  	}
  3765  	return
  3766  }
  3767  
  3768  // GremlinResourcesMigrateGremlinGraphToAutoscaleFuture an abstraction for monitoring and retrieving the
  3769  // results of a long-running operation.
  3770  type GremlinResourcesMigrateGremlinGraphToAutoscaleFuture struct {
  3771  	azure.FutureAPI
  3772  	// Result returns the result of the asynchronous operation.
  3773  	// If the operation has not completed it will return an error.
  3774  	Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
  3775  }
  3776  
  3777  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3778  func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) UnmarshalJSON(body []byte) error {
  3779  	var azFuture azure.Future
  3780  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3781  		return err
  3782  	}
  3783  	future.FutureAPI = &azFuture
  3784  	future.Result = future.result
  3785  	return nil
  3786  }
  3787  
  3788  // result is the default implementation for GremlinResourcesMigrateGremlinGraphToAutoscaleFuture.Result.
  3789  func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  3790  	var done bool
  3791  	done, err = future.DoneWithContext(context.Background(), client)
  3792  	if err != nil {
  3793  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", future.Response(), "Polling failure")
  3794  		return
  3795  	}
  3796  	if !done {
  3797  		tsgr.Response.Response = future.Response()
  3798  		err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture")
  3799  		return
  3800  	}
  3801  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3802  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  3803  		tsgr, err = client.MigrateGremlinGraphToAutoscaleResponder(tsgr.Response.Response)
  3804  		if err != nil {
  3805  			err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  3806  		}
  3807  	}
  3808  	return
  3809  }
  3810  
  3811  // GremlinResourcesMigrateGremlinGraphToManualThroughputFuture an abstraction for monitoring and retrieving
  3812  // the results of a long-running operation.
  3813  type GremlinResourcesMigrateGremlinGraphToManualThroughputFuture struct {
  3814  	azure.FutureAPI
  3815  	// Result returns the result of the asynchronous operation.
  3816  	// If the operation has not completed it will return an error.
  3817  	Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
  3818  }
  3819  
  3820  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3821  func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) UnmarshalJSON(body []byte) error {
  3822  	var azFuture azure.Future
  3823  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3824  		return err
  3825  	}
  3826  	future.FutureAPI = &azFuture
  3827  	future.Result = future.result
  3828  	return nil
  3829  }
  3830  
  3831  // result is the default implementation for GremlinResourcesMigrateGremlinGraphToManualThroughputFuture.Result.
  3832  func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  3833  	var done bool
  3834  	done, err = future.DoneWithContext(context.Background(), client)
  3835  	if err != nil {
  3836  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", future.Response(), "Polling failure")
  3837  		return
  3838  	}
  3839  	if !done {
  3840  		tsgr.Response.Response = future.Response()
  3841  		err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture")
  3842  		return
  3843  	}
  3844  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3845  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  3846  		tsgr, err = client.MigrateGremlinGraphToManualThroughputResponder(tsgr.Response.Response)
  3847  		if err != nil {
  3848  			err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  3849  		}
  3850  	}
  3851  	return
  3852  }
  3853  
  3854  // GremlinResourcesUpdateGremlinDatabaseThroughputFuture an abstraction for monitoring and retrieving the
  3855  // results of a long-running operation.
  3856  type GremlinResourcesUpdateGremlinDatabaseThroughputFuture struct {
  3857  	azure.FutureAPI
  3858  	// Result returns the result of the asynchronous operation.
  3859  	// If the operation has not completed it will return an error.
  3860  	Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
  3861  }
  3862  
  3863  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3864  func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) UnmarshalJSON(body []byte) error {
  3865  	var azFuture azure.Future
  3866  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3867  		return err
  3868  	}
  3869  	future.FutureAPI = &azFuture
  3870  	future.Result = future.result
  3871  	return nil
  3872  }
  3873  
  3874  // result is the default implementation for GremlinResourcesUpdateGremlinDatabaseThroughputFuture.Result.
  3875  func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  3876  	var done bool
  3877  	done, err = future.DoneWithContext(context.Background(), client)
  3878  	if err != nil {
  3879  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", future.Response(), "Polling failure")
  3880  		return
  3881  	}
  3882  	if !done {
  3883  		tsgr.Response.Response = future.Response()
  3884  		err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture")
  3885  		return
  3886  	}
  3887  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3888  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  3889  		tsgr, err = client.UpdateGremlinDatabaseThroughputResponder(tsgr.Response.Response)
  3890  		if err != nil {
  3891  			err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  3892  		}
  3893  	}
  3894  	return
  3895  }
  3896  
  3897  // GremlinResourcesUpdateGremlinGraphThroughputFuture an abstraction for monitoring and retrieving the
  3898  // results of a long-running operation.
  3899  type GremlinResourcesUpdateGremlinGraphThroughputFuture struct {
  3900  	azure.FutureAPI
  3901  	// Result returns the result of the asynchronous operation.
  3902  	// If the operation has not completed it will return an error.
  3903  	Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
  3904  }
  3905  
  3906  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3907  func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) UnmarshalJSON(body []byte) error {
  3908  	var azFuture azure.Future
  3909  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3910  		return err
  3911  	}
  3912  	future.FutureAPI = &azFuture
  3913  	future.Result = future.result
  3914  	return nil
  3915  }
  3916  
  3917  // result is the default implementation for GremlinResourcesUpdateGremlinGraphThroughputFuture.Result.
  3918  func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  3919  	var done bool
  3920  	done, err = future.DoneWithContext(context.Background(), client)
  3921  	if err != nil {
  3922  		err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", future.Response(), "Polling failure")
  3923  		return
  3924  	}
  3925  	if !done {
  3926  		tsgr.Response.Response = future.Response()
  3927  		err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture")
  3928  		return
  3929  	}
  3930  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  3931  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  3932  		tsgr, err = client.UpdateGremlinGraphThroughputResponder(tsgr.Response.Response)
  3933  		if err != nil {
  3934  			err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  3935  		}
  3936  	}
  3937  	return
  3938  }
  3939  
  3940  // IncludedPath the paths that are included in indexing
  3941  type IncludedPath struct {
  3942  	// Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
  3943  	Path *string `json:"path,omitempty"`
  3944  	// Indexes - List of indexes for this path
  3945  	Indexes *[]Indexes `json:"indexes,omitempty"`
  3946  }
  3947  
  3948  // Indexes the indexes for the path.
  3949  type Indexes struct {
  3950  	// DataType - The datatype for which the indexing behavior is applied to. Possible values include: 'String', 'Number', 'Point', 'Polygon', 'LineString', 'MultiPolygon'
  3951  	DataType DataType `json:"dataType,omitempty"`
  3952  	// Precision - The precision of the index. -1 is maximum precision.
  3953  	Precision *int32 `json:"precision,omitempty"`
  3954  	// Kind - Indicates the type of index. Possible values include: 'Hash', 'Range', 'Spatial'
  3955  	Kind IndexKind `json:"kind,omitempty"`
  3956  }
  3957  
  3958  // IndexingPolicy cosmos DB indexing policy
  3959  type IndexingPolicy struct {
  3960  	// Automatic - Indicates if the indexing policy is automatic
  3961  	Automatic *bool `json:"automatic,omitempty"`
  3962  	// IndexingMode - Indicates the indexing mode. Possible values include: 'Consistent', 'Lazy', 'None'
  3963  	IndexingMode IndexingMode `json:"indexingMode,omitempty"`
  3964  	// IncludedPaths - List of paths to include in the indexing
  3965  	IncludedPaths *[]IncludedPath `json:"includedPaths,omitempty"`
  3966  	// ExcludedPaths - List of paths to exclude from indexing
  3967  	ExcludedPaths *[]ExcludedPath `json:"excludedPaths,omitempty"`
  3968  	// CompositeIndexes - List of composite path list
  3969  	CompositeIndexes *[][]CompositePath `json:"compositeIndexes,omitempty"`
  3970  	// SpatialIndexes - List of spatial specifics
  3971  	SpatialIndexes *[]SpatialSpec `json:"spatialIndexes,omitempty"`
  3972  }
  3973  
  3974  // IPAddressOrRange ipAddressOrRange object
  3975  type IPAddressOrRange struct {
  3976  	// IPAddressOrRange - A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be well-formatted and cannot be contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245” or “23.40.210.0/8”.
  3977  	IPAddressOrRange *string `json:"ipAddressOrRange,omitempty"`
  3978  }
  3979  
  3980  // Location a region in which the Azure Cosmos DB database account is deployed.
  3981  type Location struct {
  3982  	// ID - READ-ONLY; The unique identifier of the region within the database account. Example: <accountName>-<locationName>.
  3983  	ID *string `json:"id,omitempty"`
  3984  	// LocationName - The name of the region.
  3985  	LocationName *string `json:"locationName,omitempty"`
  3986  	// DocumentEndpoint - READ-ONLY; The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/
  3987  	DocumentEndpoint  *string `json:"documentEndpoint,omitempty"`
  3988  	ProvisioningState *string `json:"provisioningState,omitempty"`
  3989  	// FailoverPriority - The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.
  3990  	FailoverPriority *int32 `json:"failoverPriority,omitempty"`
  3991  	// IsZoneRedundant - Flag to indicate whether or not this region is an AvailabilityZone region
  3992  	IsZoneRedundant *bool `json:"isZoneRedundant,omitempty"`
  3993  }
  3994  
  3995  // MarshalJSON is the custom marshaler for Location.
  3996  func (l Location) MarshalJSON() ([]byte, error) {
  3997  	objectMap := make(map[string]interface{})
  3998  	if l.LocationName != nil {
  3999  		objectMap["locationName"] = l.LocationName
  4000  	}
  4001  	if l.ProvisioningState != nil {
  4002  		objectMap["provisioningState"] = l.ProvisioningState
  4003  	}
  4004  	if l.FailoverPriority != nil {
  4005  		objectMap["failoverPriority"] = l.FailoverPriority
  4006  	}
  4007  	if l.IsZoneRedundant != nil {
  4008  		objectMap["isZoneRedundant"] = l.IsZoneRedundant
  4009  	}
  4010  	return json.Marshal(objectMap)
  4011  }
  4012  
  4013  // ManagedServiceIdentity identity for the resource.
  4014  type ManagedServiceIdentity struct {
  4015  	// PrincipalID - READ-ONLY; The principal id of the system assigned identity. This property will only be provided for a system assigned identity.
  4016  	PrincipalID *string `json:"principalId,omitempty"`
  4017  	// TenantID - READ-ONLY; The tenant id of the system assigned identity. This property will only be provided for a system assigned identity.
  4018  	TenantID *string `json:"tenantId,omitempty"`
  4019  	// Type - The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone'
  4020  	Type ResourceIdentityType `json:"type,omitempty"`
  4021  	// UserAssignedIdentities - The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
  4022  	UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"`
  4023  }
  4024  
  4025  // MarshalJSON is the custom marshaler for ManagedServiceIdentity.
  4026  func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) {
  4027  	objectMap := make(map[string]interface{})
  4028  	if msi.Type != "" {
  4029  		objectMap["type"] = msi.Type
  4030  	}
  4031  	if msi.UserAssignedIdentities != nil {
  4032  		objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities
  4033  	}
  4034  	return json.Marshal(objectMap)
  4035  }
  4036  
  4037  // ManagedServiceIdentityUserAssignedIdentitiesValue ...
  4038  type ManagedServiceIdentityUserAssignedIdentitiesValue struct {
  4039  	// PrincipalID - READ-ONLY; The principal id of user assigned identity.
  4040  	PrincipalID *string `json:"principalId,omitempty"`
  4041  	// ClientID - READ-ONLY; The client id of user assigned identity.
  4042  	ClientID *string `json:"clientId,omitempty"`
  4043  }
  4044  
  4045  // MarshalJSON is the custom marshaler for ManagedServiceIdentityUserAssignedIdentitiesValue.
  4046  func (msiAiv ManagedServiceIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) {
  4047  	objectMap := make(map[string]interface{})
  4048  	return json.Marshal(objectMap)
  4049  }
  4050  
  4051  // Metric metric data
  4052  type Metric struct {
  4053  	// StartTime - READ-ONLY; The start time for the metric (ISO-8601 format).
  4054  	StartTime *date.Time `json:"startTime,omitempty"`
  4055  	// EndTime - READ-ONLY; The end time for the metric (ISO-8601 format).
  4056  	EndTime *date.Time `json:"endTime,omitempty"`
  4057  	// TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values.
  4058  	TimeGrain *string `json:"timeGrain,omitempty"`
  4059  	// Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'
  4060  	Unit UnitType `json:"unit,omitempty"`
  4061  	// Name - READ-ONLY; The name information for the metric.
  4062  	Name *MetricName `json:"name,omitempty"`
  4063  	// MetricValues - READ-ONLY; The metric values for the specified time window and timestep.
  4064  	MetricValues *[]MetricValue `json:"metricValues,omitempty"`
  4065  }
  4066  
  4067  // MarshalJSON is the custom marshaler for Metric.
  4068  func (mVar Metric) MarshalJSON() ([]byte, error) {
  4069  	objectMap := make(map[string]interface{})
  4070  	if mVar.Unit != "" {
  4071  		objectMap["unit"] = mVar.Unit
  4072  	}
  4073  	return json.Marshal(objectMap)
  4074  }
  4075  
  4076  // MetricAvailability the availability of the metric.
  4077  type MetricAvailability struct {
  4078  	// TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values.
  4079  	TimeGrain *string `json:"timeGrain,omitempty"`
  4080  	// Retention - READ-ONLY; The retention for the metric values.
  4081  	Retention *string `json:"retention,omitempty"`
  4082  }
  4083  
  4084  // MarshalJSON is the custom marshaler for MetricAvailability.
  4085  func (ma MetricAvailability) MarshalJSON() ([]byte, error) {
  4086  	objectMap := make(map[string]interface{})
  4087  	return json.Marshal(objectMap)
  4088  }
  4089  
  4090  // MetricDefinition the definition of a metric.
  4091  type MetricDefinition struct {
  4092  	// MetricAvailabilities - READ-ONLY; The list of metric availabilities for the account.
  4093  	MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
  4094  	// PrimaryAggregationType - READ-ONLY; The primary aggregation type of the metric. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeTotal', 'PrimaryAggregationTypeMinimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeLast'
  4095  	PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"`
  4096  	// Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'
  4097  	Unit UnitType `json:"unit,omitempty"`
  4098  	// ResourceURI - READ-ONLY; The resource uri of the database.
  4099  	ResourceURI *string `json:"resourceUri,omitempty"`
  4100  	// Name - READ-ONLY; The name information for the metric.
  4101  	Name *MetricName `json:"name,omitempty"`
  4102  }
  4103  
  4104  // MarshalJSON is the custom marshaler for MetricDefinition.
  4105  func (md MetricDefinition) MarshalJSON() ([]byte, error) {
  4106  	objectMap := make(map[string]interface{})
  4107  	if md.Unit != "" {
  4108  		objectMap["unit"] = md.Unit
  4109  	}
  4110  	return json.Marshal(objectMap)
  4111  }
  4112  
  4113  // MetricDefinitionsListResult the response to a list metric definitions request.
  4114  type MetricDefinitionsListResult struct {
  4115  	autorest.Response `json:"-"`
  4116  	// Value - READ-ONLY; The list of metric definitions for the account.
  4117  	Value *[]MetricDefinition `json:"value,omitempty"`
  4118  }
  4119  
  4120  // MarshalJSON is the custom marshaler for MetricDefinitionsListResult.
  4121  func (mdlr MetricDefinitionsListResult) MarshalJSON() ([]byte, error) {
  4122  	objectMap := make(map[string]interface{})
  4123  	return json.Marshal(objectMap)
  4124  }
  4125  
  4126  // MetricListResult the response to a list metrics request.
  4127  type MetricListResult struct {
  4128  	autorest.Response `json:"-"`
  4129  	// Value - READ-ONLY; The list of metrics for the account.
  4130  	Value *[]Metric `json:"value,omitempty"`
  4131  }
  4132  
  4133  // MarshalJSON is the custom marshaler for MetricListResult.
  4134  func (mlr MetricListResult) MarshalJSON() ([]byte, error) {
  4135  	objectMap := make(map[string]interface{})
  4136  	return json.Marshal(objectMap)
  4137  }
  4138  
  4139  // MetricName a metric name.
  4140  type MetricName struct {
  4141  	// Value - READ-ONLY; The name of the metric.
  4142  	Value *string `json:"value,omitempty"`
  4143  	// LocalizedValue - READ-ONLY; The friendly name of the metric.
  4144  	LocalizedValue *string `json:"localizedValue,omitempty"`
  4145  }
  4146  
  4147  // MarshalJSON is the custom marshaler for MetricName.
  4148  func (mn MetricName) MarshalJSON() ([]byte, error) {
  4149  	objectMap := make(map[string]interface{})
  4150  	return json.Marshal(objectMap)
  4151  }
  4152  
  4153  // MetricValue represents metrics values.
  4154  type MetricValue struct {
  4155  	// Count - READ-ONLY; The number of values for the metric.
  4156  	Count *float64 `json:"_count,omitempty"`
  4157  	// Average - READ-ONLY; The average value of the metric.
  4158  	Average *float64 `json:"average,omitempty"`
  4159  	// Maximum - READ-ONLY; The max value of the metric.
  4160  	Maximum *float64 `json:"maximum,omitempty"`
  4161  	// Minimum - READ-ONLY; The min value of the metric.
  4162  	Minimum *float64 `json:"minimum,omitempty"`
  4163  	// Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format).
  4164  	Timestamp *date.Time `json:"timestamp,omitempty"`
  4165  	// Total - READ-ONLY; The total value of the metric.
  4166  	Total *float64 `json:"total,omitempty"`
  4167  }
  4168  
  4169  // MarshalJSON is the custom marshaler for MetricValue.
  4170  func (mv MetricValue) MarshalJSON() ([]byte, error) {
  4171  	objectMap := make(map[string]interface{})
  4172  	return json.Marshal(objectMap)
  4173  }
  4174  
  4175  // MongoDBCollectionCreateUpdateParameters parameters to create and update Cosmos DB MongoDB collection.
  4176  type MongoDBCollectionCreateUpdateParameters struct {
  4177  	// MongoDBCollectionCreateUpdateProperties - Properties to create and update Azure Cosmos DB MongoDB collection.
  4178  	*MongoDBCollectionCreateUpdateProperties `json:"properties,omitempty"`
  4179  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  4180  	ID *string `json:"id,omitempty"`
  4181  	// Name - READ-ONLY; The name of the ARM resource.
  4182  	Name *string `json:"name,omitempty"`
  4183  	// Type - READ-ONLY; The type of Azure resource.
  4184  	Type *string `json:"type,omitempty"`
  4185  	// Location - The location of the resource group to which the resource belongs.
  4186  	Location *string            `json:"location,omitempty"`
  4187  	Tags     map[string]*string `json:"tags"`
  4188  }
  4189  
  4190  // MarshalJSON is the custom marshaler for MongoDBCollectionCreateUpdateParameters.
  4191  func (mdccup MongoDBCollectionCreateUpdateParameters) MarshalJSON() ([]byte, error) {
  4192  	objectMap := make(map[string]interface{})
  4193  	if mdccup.MongoDBCollectionCreateUpdateProperties != nil {
  4194  		objectMap["properties"] = mdccup.MongoDBCollectionCreateUpdateProperties
  4195  	}
  4196  	if mdccup.Location != nil {
  4197  		objectMap["location"] = mdccup.Location
  4198  	}
  4199  	if mdccup.Tags != nil {
  4200  		objectMap["tags"] = mdccup.Tags
  4201  	}
  4202  	return json.Marshal(objectMap)
  4203  }
  4204  
  4205  // UnmarshalJSON is the custom unmarshaler for MongoDBCollectionCreateUpdateParameters struct.
  4206  func (mdccup *MongoDBCollectionCreateUpdateParameters) UnmarshalJSON(body []byte) error {
  4207  	var m map[string]*json.RawMessage
  4208  	err := json.Unmarshal(body, &m)
  4209  	if err != nil {
  4210  		return err
  4211  	}
  4212  	for k, v := range m {
  4213  		switch k {
  4214  		case "properties":
  4215  			if v != nil {
  4216  				var mongoDBCollectionCreateUpdateProperties MongoDBCollectionCreateUpdateProperties
  4217  				err = json.Unmarshal(*v, &mongoDBCollectionCreateUpdateProperties)
  4218  				if err != nil {
  4219  					return err
  4220  				}
  4221  				mdccup.MongoDBCollectionCreateUpdateProperties = &mongoDBCollectionCreateUpdateProperties
  4222  			}
  4223  		case "id":
  4224  			if v != nil {
  4225  				var ID string
  4226  				err = json.Unmarshal(*v, &ID)
  4227  				if err != nil {
  4228  					return err
  4229  				}
  4230  				mdccup.ID = &ID
  4231  			}
  4232  		case "name":
  4233  			if v != nil {
  4234  				var name string
  4235  				err = json.Unmarshal(*v, &name)
  4236  				if err != nil {
  4237  					return err
  4238  				}
  4239  				mdccup.Name = &name
  4240  			}
  4241  		case "type":
  4242  			if v != nil {
  4243  				var typeVar string
  4244  				err = json.Unmarshal(*v, &typeVar)
  4245  				if err != nil {
  4246  					return err
  4247  				}
  4248  				mdccup.Type = &typeVar
  4249  			}
  4250  		case "location":
  4251  			if v != nil {
  4252  				var location string
  4253  				err = json.Unmarshal(*v, &location)
  4254  				if err != nil {
  4255  					return err
  4256  				}
  4257  				mdccup.Location = &location
  4258  			}
  4259  		case "tags":
  4260  			if v != nil {
  4261  				var tags map[string]*string
  4262  				err = json.Unmarshal(*v, &tags)
  4263  				if err != nil {
  4264  					return err
  4265  				}
  4266  				mdccup.Tags = tags
  4267  			}
  4268  		}
  4269  	}
  4270  
  4271  	return nil
  4272  }
  4273  
  4274  // MongoDBCollectionCreateUpdateProperties properties to create and update Azure Cosmos DB MongoDB
  4275  // collection.
  4276  type MongoDBCollectionCreateUpdateProperties struct {
  4277  	// Resource - The standard JSON format of a MongoDB collection
  4278  	Resource *MongoDBCollectionResource `json:"resource,omitempty"`
  4279  	// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
  4280  	Options *CreateUpdateOptions `json:"options,omitempty"`
  4281  }
  4282  
  4283  // MongoDBCollectionGetProperties the properties of an Azure Cosmos DB MongoDB collection
  4284  type MongoDBCollectionGetProperties struct {
  4285  	Resource *MongoDBCollectionGetPropertiesResource `json:"resource,omitempty"`
  4286  	Options  *MongoDBCollectionGetPropertiesOptions  `json:"options,omitempty"`
  4287  }
  4288  
  4289  // MongoDBCollectionGetPropertiesOptions ...
  4290  type MongoDBCollectionGetPropertiesOptions struct {
  4291  	// Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details.
  4292  	Throughput *int32 `json:"throughput,omitempty"`
  4293  	// AutoscaleSettings - Specifies the Autoscale settings.
  4294  	AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
  4295  }
  4296  
  4297  // MongoDBCollectionGetPropertiesResource ...
  4298  type MongoDBCollectionGetPropertiesResource struct {
  4299  	// ID - Name of the Cosmos DB MongoDB collection
  4300  	ID *string `json:"id,omitempty"`
  4301  	// ShardKey - A key-value pair of shard keys to be applied for the request.
  4302  	ShardKey map[string]*string `json:"shardKey"`
  4303  	// Indexes - List of index keys
  4304  	Indexes *[]MongoIndex `json:"indexes,omitempty"`
  4305  	// AnalyticalStorageTTL - Analytical TTL.
  4306  	AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"`
  4307  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  4308  	Rid *string `json:"_rid,omitempty"`
  4309  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  4310  	Ts *float64 `json:"_ts,omitempty"`
  4311  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  4312  	Etag *string `json:"_etag,omitempty"`
  4313  }
  4314  
  4315  // MarshalJSON is the custom marshaler for MongoDBCollectionGetPropertiesResource.
  4316  func (mdcgp MongoDBCollectionGetPropertiesResource) MarshalJSON() ([]byte, error) {
  4317  	objectMap := make(map[string]interface{})
  4318  	if mdcgp.ID != nil {
  4319  		objectMap["id"] = mdcgp.ID
  4320  	}
  4321  	if mdcgp.ShardKey != nil {
  4322  		objectMap["shardKey"] = mdcgp.ShardKey
  4323  	}
  4324  	if mdcgp.Indexes != nil {
  4325  		objectMap["indexes"] = mdcgp.Indexes
  4326  	}
  4327  	if mdcgp.AnalyticalStorageTTL != nil {
  4328  		objectMap["analyticalStorageTtl"] = mdcgp.AnalyticalStorageTTL
  4329  	}
  4330  	return json.Marshal(objectMap)
  4331  }
  4332  
  4333  // MongoDBCollectionGetResults an Azure Cosmos DB MongoDB collection.
  4334  type MongoDBCollectionGetResults struct {
  4335  	autorest.Response `json:"-"`
  4336  	// MongoDBCollectionGetProperties - The properties of an Azure Cosmos DB MongoDB collection
  4337  	*MongoDBCollectionGetProperties `json:"properties,omitempty"`
  4338  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  4339  	ID *string `json:"id,omitempty"`
  4340  	// Name - READ-ONLY; The name of the ARM resource.
  4341  	Name *string `json:"name,omitempty"`
  4342  	// Type - READ-ONLY; The type of Azure resource.
  4343  	Type *string `json:"type,omitempty"`
  4344  	// Location - The location of the resource group to which the resource belongs.
  4345  	Location *string            `json:"location,omitempty"`
  4346  	Tags     map[string]*string `json:"tags"`
  4347  }
  4348  
  4349  // MarshalJSON is the custom marshaler for MongoDBCollectionGetResults.
  4350  func (mdcgr MongoDBCollectionGetResults) MarshalJSON() ([]byte, error) {
  4351  	objectMap := make(map[string]interface{})
  4352  	if mdcgr.MongoDBCollectionGetProperties != nil {
  4353  		objectMap["properties"] = mdcgr.MongoDBCollectionGetProperties
  4354  	}
  4355  	if mdcgr.Location != nil {
  4356  		objectMap["location"] = mdcgr.Location
  4357  	}
  4358  	if mdcgr.Tags != nil {
  4359  		objectMap["tags"] = mdcgr.Tags
  4360  	}
  4361  	return json.Marshal(objectMap)
  4362  }
  4363  
  4364  // UnmarshalJSON is the custom unmarshaler for MongoDBCollectionGetResults struct.
  4365  func (mdcgr *MongoDBCollectionGetResults) UnmarshalJSON(body []byte) error {
  4366  	var m map[string]*json.RawMessage
  4367  	err := json.Unmarshal(body, &m)
  4368  	if err != nil {
  4369  		return err
  4370  	}
  4371  	for k, v := range m {
  4372  		switch k {
  4373  		case "properties":
  4374  			if v != nil {
  4375  				var mongoDBCollectionGetProperties MongoDBCollectionGetProperties
  4376  				err = json.Unmarshal(*v, &mongoDBCollectionGetProperties)
  4377  				if err != nil {
  4378  					return err
  4379  				}
  4380  				mdcgr.MongoDBCollectionGetProperties = &mongoDBCollectionGetProperties
  4381  			}
  4382  		case "id":
  4383  			if v != nil {
  4384  				var ID string
  4385  				err = json.Unmarshal(*v, &ID)
  4386  				if err != nil {
  4387  					return err
  4388  				}
  4389  				mdcgr.ID = &ID
  4390  			}
  4391  		case "name":
  4392  			if v != nil {
  4393  				var name string
  4394  				err = json.Unmarshal(*v, &name)
  4395  				if err != nil {
  4396  					return err
  4397  				}
  4398  				mdcgr.Name = &name
  4399  			}
  4400  		case "type":
  4401  			if v != nil {
  4402  				var typeVar string
  4403  				err = json.Unmarshal(*v, &typeVar)
  4404  				if err != nil {
  4405  					return err
  4406  				}
  4407  				mdcgr.Type = &typeVar
  4408  			}
  4409  		case "location":
  4410  			if v != nil {
  4411  				var location string
  4412  				err = json.Unmarshal(*v, &location)
  4413  				if err != nil {
  4414  					return err
  4415  				}
  4416  				mdcgr.Location = &location
  4417  			}
  4418  		case "tags":
  4419  			if v != nil {
  4420  				var tags map[string]*string
  4421  				err = json.Unmarshal(*v, &tags)
  4422  				if err != nil {
  4423  					return err
  4424  				}
  4425  				mdcgr.Tags = tags
  4426  			}
  4427  		}
  4428  	}
  4429  
  4430  	return nil
  4431  }
  4432  
  4433  // MongoDBCollectionListResult the List operation response, that contains the MongoDB collections and their
  4434  // properties.
  4435  type MongoDBCollectionListResult struct {
  4436  	autorest.Response `json:"-"`
  4437  	// Value - READ-ONLY; List of MongoDB collections and their properties.
  4438  	Value *[]MongoDBCollectionGetResults `json:"value,omitempty"`
  4439  }
  4440  
  4441  // MarshalJSON is the custom marshaler for MongoDBCollectionListResult.
  4442  func (mdclr MongoDBCollectionListResult) MarshalJSON() ([]byte, error) {
  4443  	objectMap := make(map[string]interface{})
  4444  	return json.Marshal(objectMap)
  4445  }
  4446  
  4447  // MongoDBCollectionResource cosmos DB MongoDB collection resource object
  4448  type MongoDBCollectionResource struct {
  4449  	// ID - Name of the Cosmos DB MongoDB collection
  4450  	ID *string `json:"id,omitempty"`
  4451  	// ShardKey - A key-value pair of shard keys to be applied for the request.
  4452  	ShardKey map[string]*string `json:"shardKey"`
  4453  	// Indexes - List of index keys
  4454  	Indexes *[]MongoIndex `json:"indexes,omitempty"`
  4455  	// AnalyticalStorageTTL - Analytical TTL.
  4456  	AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"`
  4457  }
  4458  
  4459  // MarshalJSON is the custom marshaler for MongoDBCollectionResource.
  4460  func (mdcr MongoDBCollectionResource) MarshalJSON() ([]byte, error) {
  4461  	objectMap := make(map[string]interface{})
  4462  	if mdcr.ID != nil {
  4463  		objectMap["id"] = mdcr.ID
  4464  	}
  4465  	if mdcr.ShardKey != nil {
  4466  		objectMap["shardKey"] = mdcr.ShardKey
  4467  	}
  4468  	if mdcr.Indexes != nil {
  4469  		objectMap["indexes"] = mdcr.Indexes
  4470  	}
  4471  	if mdcr.AnalyticalStorageTTL != nil {
  4472  		objectMap["analyticalStorageTtl"] = mdcr.AnalyticalStorageTTL
  4473  	}
  4474  	return json.Marshal(objectMap)
  4475  }
  4476  
  4477  // MongoDBDatabaseCreateUpdateParameters parameters to create and update Cosmos DB MongoDB database.
  4478  type MongoDBDatabaseCreateUpdateParameters struct {
  4479  	// MongoDBDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB MongoDB database.
  4480  	*MongoDBDatabaseCreateUpdateProperties `json:"properties,omitempty"`
  4481  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  4482  	ID *string `json:"id,omitempty"`
  4483  	// Name - READ-ONLY; The name of the ARM resource.
  4484  	Name *string `json:"name,omitempty"`
  4485  	// Type - READ-ONLY; The type of Azure resource.
  4486  	Type *string `json:"type,omitempty"`
  4487  	// Location - The location of the resource group to which the resource belongs.
  4488  	Location *string            `json:"location,omitempty"`
  4489  	Tags     map[string]*string `json:"tags"`
  4490  }
  4491  
  4492  // MarshalJSON is the custom marshaler for MongoDBDatabaseCreateUpdateParameters.
  4493  func (mddcup MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) {
  4494  	objectMap := make(map[string]interface{})
  4495  	if mddcup.MongoDBDatabaseCreateUpdateProperties != nil {
  4496  		objectMap["properties"] = mddcup.MongoDBDatabaseCreateUpdateProperties
  4497  	}
  4498  	if mddcup.Location != nil {
  4499  		objectMap["location"] = mddcup.Location
  4500  	}
  4501  	if mddcup.Tags != nil {
  4502  		objectMap["tags"] = mddcup.Tags
  4503  	}
  4504  	return json.Marshal(objectMap)
  4505  }
  4506  
  4507  // UnmarshalJSON is the custom unmarshaler for MongoDBDatabaseCreateUpdateParameters struct.
  4508  func (mddcup *MongoDBDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error {
  4509  	var m map[string]*json.RawMessage
  4510  	err := json.Unmarshal(body, &m)
  4511  	if err != nil {
  4512  		return err
  4513  	}
  4514  	for k, v := range m {
  4515  		switch k {
  4516  		case "properties":
  4517  			if v != nil {
  4518  				var mongoDBDatabaseCreateUpdateProperties MongoDBDatabaseCreateUpdateProperties
  4519  				err = json.Unmarshal(*v, &mongoDBDatabaseCreateUpdateProperties)
  4520  				if err != nil {
  4521  					return err
  4522  				}
  4523  				mddcup.MongoDBDatabaseCreateUpdateProperties = &mongoDBDatabaseCreateUpdateProperties
  4524  			}
  4525  		case "id":
  4526  			if v != nil {
  4527  				var ID string
  4528  				err = json.Unmarshal(*v, &ID)
  4529  				if err != nil {
  4530  					return err
  4531  				}
  4532  				mddcup.ID = &ID
  4533  			}
  4534  		case "name":
  4535  			if v != nil {
  4536  				var name string
  4537  				err = json.Unmarshal(*v, &name)
  4538  				if err != nil {
  4539  					return err
  4540  				}
  4541  				mddcup.Name = &name
  4542  			}
  4543  		case "type":
  4544  			if v != nil {
  4545  				var typeVar string
  4546  				err = json.Unmarshal(*v, &typeVar)
  4547  				if err != nil {
  4548  					return err
  4549  				}
  4550  				mddcup.Type = &typeVar
  4551  			}
  4552  		case "location":
  4553  			if v != nil {
  4554  				var location string
  4555  				err = json.Unmarshal(*v, &location)
  4556  				if err != nil {
  4557  					return err
  4558  				}
  4559  				mddcup.Location = &location
  4560  			}
  4561  		case "tags":
  4562  			if v != nil {
  4563  				var tags map[string]*string
  4564  				err = json.Unmarshal(*v, &tags)
  4565  				if err != nil {
  4566  					return err
  4567  				}
  4568  				mddcup.Tags = tags
  4569  			}
  4570  		}
  4571  	}
  4572  
  4573  	return nil
  4574  }
  4575  
  4576  // MongoDBDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB MongoDB database.
  4577  type MongoDBDatabaseCreateUpdateProperties struct {
  4578  	// Resource - The standard JSON format of a MongoDB database
  4579  	Resource *MongoDBDatabaseResource `json:"resource,omitempty"`
  4580  	// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
  4581  	Options *CreateUpdateOptions `json:"options,omitempty"`
  4582  }
  4583  
  4584  // MongoDBDatabaseGetProperties the properties of an Azure Cosmos DB MongoDB database
  4585  type MongoDBDatabaseGetProperties struct {
  4586  	Resource *MongoDBDatabaseGetPropertiesResource `json:"resource,omitempty"`
  4587  	Options  *MongoDBDatabaseGetPropertiesOptions  `json:"options,omitempty"`
  4588  }
  4589  
  4590  // MongoDBDatabaseGetPropertiesOptions ...
  4591  type MongoDBDatabaseGetPropertiesOptions struct {
  4592  	// Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details.
  4593  	Throughput *int32 `json:"throughput,omitempty"`
  4594  	// AutoscaleSettings - Specifies the Autoscale settings.
  4595  	AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
  4596  }
  4597  
  4598  // MongoDBDatabaseGetPropertiesResource ...
  4599  type MongoDBDatabaseGetPropertiesResource struct {
  4600  	// ID - Name of the Cosmos DB MongoDB database
  4601  	ID *string `json:"id,omitempty"`
  4602  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  4603  	Rid *string `json:"_rid,omitempty"`
  4604  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  4605  	Ts *float64 `json:"_ts,omitempty"`
  4606  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  4607  	Etag *string `json:"_etag,omitempty"`
  4608  }
  4609  
  4610  // MarshalJSON is the custom marshaler for MongoDBDatabaseGetPropertiesResource.
  4611  func (mddgp MongoDBDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) {
  4612  	objectMap := make(map[string]interface{})
  4613  	if mddgp.ID != nil {
  4614  		objectMap["id"] = mddgp.ID
  4615  	}
  4616  	return json.Marshal(objectMap)
  4617  }
  4618  
  4619  // MongoDBDatabaseGetResults an Azure Cosmos DB MongoDB database.
  4620  type MongoDBDatabaseGetResults struct {
  4621  	autorest.Response `json:"-"`
  4622  	// MongoDBDatabaseGetProperties - The properties of an Azure Cosmos DB MongoDB database
  4623  	*MongoDBDatabaseGetProperties `json:"properties,omitempty"`
  4624  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  4625  	ID *string `json:"id,omitempty"`
  4626  	// Name - READ-ONLY; The name of the ARM resource.
  4627  	Name *string `json:"name,omitempty"`
  4628  	// Type - READ-ONLY; The type of Azure resource.
  4629  	Type *string `json:"type,omitempty"`
  4630  	// Location - The location of the resource group to which the resource belongs.
  4631  	Location *string            `json:"location,omitempty"`
  4632  	Tags     map[string]*string `json:"tags"`
  4633  }
  4634  
  4635  // MarshalJSON is the custom marshaler for MongoDBDatabaseGetResults.
  4636  func (mddgr MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) {
  4637  	objectMap := make(map[string]interface{})
  4638  	if mddgr.MongoDBDatabaseGetProperties != nil {
  4639  		objectMap["properties"] = mddgr.MongoDBDatabaseGetProperties
  4640  	}
  4641  	if mddgr.Location != nil {
  4642  		objectMap["location"] = mddgr.Location
  4643  	}
  4644  	if mddgr.Tags != nil {
  4645  		objectMap["tags"] = mddgr.Tags
  4646  	}
  4647  	return json.Marshal(objectMap)
  4648  }
  4649  
  4650  // UnmarshalJSON is the custom unmarshaler for MongoDBDatabaseGetResults struct.
  4651  func (mddgr *MongoDBDatabaseGetResults) UnmarshalJSON(body []byte) error {
  4652  	var m map[string]*json.RawMessage
  4653  	err := json.Unmarshal(body, &m)
  4654  	if err != nil {
  4655  		return err
  4656  	}
  4657  	for k, v := range m {
  4658  		switch k {
  4659  		case "properties":
  4660  			if v != nil {
  4661  				var mongoDBDatabaseGetProperties MongoDBDatabaseGetProperties
  4662  				err = json.Unmarshal(*v, &mongoDBDatabaseGetProperties)
  4663  				if err != nil {
  4664  					return err
  4665  				}
  4666  				mddgr.MongoDBDatabaseGetProperties = &mongoDBDatabaseGetProperties
  4667  			}
  4668  		case "id":
  4669  			if v != nil {
  4670  				var ID string
  4671  				err = json.Unmarshal(*v, &ID)
  4672  				if err != nil {
  4673  					return err
  4674  				}
  4675  				mddgr.ID = &ID
  4676  			}
  4677  		case "name":
  4678  			if v != nil {
  4679  				var name string
  4680  				err = json.Unmarshal(*v, &name)
  4681  				if err != nil {
  4682  					return err
  4683  				}
  4684  				mddgr.Name = &name
  4685  			}
  4686  		case "type":
  4687  			if v != nil {
  4688  				var typeVar string
  4689  				err = json.Unmarshal(*v, &typeVar)
  4690  				if err != nil {
  4691  					return err
  4692  				}
  4693  				mddgr.Type = &typeVar
  4694  			}
  4695  		case "location":
  4696  			if v != nil {
  4697  				var location string
  4698  				err = json.Unmarshal(*v, &location)
  4699  				if err != nil {
  4700  					return err
  4701  				}
  4702  				mddgr.Location = &location
  4703  			}
  4704  		case "tags":
  4705  			if v != nil {
  4706  				var tags map[string]*string
  4707  				err = json.Unmarshal(*v, &tags)
  4708  				if err != nil {
  4709  					return err
  4710  				}
  4711  				mddgr.Tags = tags
  4712  			}
  4713  		}
  4714  	}
  4715  
  4716  	return nil
  4717  }
  4718  
  4719  // MongoDBDatabaseListResult the List operation response, that contains the MongoDB databases and their
  4720  // properties.
  4721  type MongoDBDatabaseListResult struct {
  4722  	autorest.Response `json:"-"`
  4723  	// Value - READ-ONLY; List of MongoDB databases and their properties.
  4724  	Value *[]MongoDBDatabaseGetResults `json:"value,omitempty"`
  4725  }
  4726  
  4727  // MarshalJSON is the custom marshaler for MongoDBDatabaseListResult.
  4728  func (mddlr MongoDBDatabaseListResult) MarshalJSON() ([]byte, error) {
  4729  	objectMap := make(map[string]interface{})
  4730  	return json.Marshal(objectMap)
  4731  }
  4732  
  4733  // MongoDBDatabaseResource cosmos DB MongoDB database resource object
  4734  type MongoDBDatabaseResource struct {
  4735  	// ID - Name of the Cosmos DB MongoDB database
  4736  	ID *string `json:"id,omitempty"`
  4737  }
  4738  
  4739  // MongoDBResourcesCreateUpdateMongoDBCollectionFuture an abstraction for monitoring and retrieving the
  4740  // results of a long-running operation.
  4741  type MongoDBResourcesCreateUpdateMongoDBCollectionFuture struct {
  4742  	azure.FutureAPI
  4743  	// Result returns the result of the asynchronous operation.
  4744  	// If the operation has not completed it will return an error.
  4745  	Result func(MongoDBResourcesClient) (MongoDBCollectionGetResults, error)
  4746  }
  4747  
  4748  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  4749  func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) UnmarshalJSON(body []byte) error {
  4750  	var azFuture azure.Future
  4751  	if err := json.Unmarshal(body, &azFuture); err != nil {
  4752  		return err
  4753  	}
  4754  	future.FutureAPI = &azFuture
  4755  	future.Result = future.result
  4756  	return nil
  4757  }
  4758  
  4759  // result is the default implementation for MongoDBResourcesCreateUpdateMongoDBCollectionFuture.Result.
  4760  func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) result(client MongoDBResourcesClient) (mdcgr MongoDBCollectionGetResults, err error) {
  4761  	var done bool
  4762  	done, err = future.DoneWithContext(context.Background(), client)
  4763  	if err != nil {
  4764  		err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", future.Response(), "Polling failure")
  4765  		return
  4766  	}
  4767  	if !done {
  4768  		mdcgr.Response.Response = future.Response()
  4769  		err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture")
  4770  		return
  4771  	}
  4772  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  4773  	if mdcgr.Response.Response, err = future.GetResult(sender); err == nil && mdcgr.Response.Response.StatusCode != http.StatusNoContent {
  4774  		mdcgr, err = client.CreateUpdateMongoDBCollectionResponder(mdcgr.Response.Response)
  4775  		if err != nil {
  4776  			err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", mdcgr.Response.Response, "Failure responding to request")
  4777  		}
  4778  	}
  4779  	return
  4780  }
  4781  
  4782  // MongoDBResourcesCreateUpdateMongoDBDatabaseFuture an abstraction for monitoring and retrieving the
  4783  // results of a long-running operation.
  4784  type MongoDBResourcesCreateUpdateMongoDBDatabaseFuture struct {
  4785  	azure.FutureAPI
  4786  	// Result returns the result of the asynchronous operation.
  4787  	// If the operation has not completed it will return an error.
  4788  	Result func(MongoDBResourcesClient) (MongoDBDatabaseGetResults, error)
  4789  }
  4790  
  4791  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  4792  func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error {
  4793  	var azFuture azure.Future
  4794  	if err := json.Unmarshal(body, &azFuture); err != nil {
  4795  		return err
  4796  	}
  4797  	future.FutureAPI = &azFuture
  4798  	future.Result = future.result
  4799  	return nil
  4800  }
  4801  
  4802  // result is the default implementation for MongoDBResourcesCreateUpdateMongoDBDatabaseFuture.Result.
  4803  func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (mddgr MongoDBDatabaseGetResults, err error) {
  4804  	var done bool
  4805  	done, err = future.DoneWithContext(context.Background(), client)
  4806  	if err != nil {
  4807  		err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure")
  4808  		return
  4809  	}
  4810  	if !done {
  4811  		mddgr.Response.Response = future.Response()
  4812  		err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture")
  4813  		return
  4814  	}
  4815  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  4816  	if mddgr.Response.Response, err = future.GetResult(sender); err == nil && mddgr.Response.Response.StatusCode != http.StatusNoContent {
  4817  		mddgr, err = client.CreateUpdateMongoDBDatabaseResponder(mddgr.Response.Response)
  4818  		if err != nil {
  4819  			err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", mddgr.Response.Response, "Failure responding to request")
  4820  		}
  4821  	}
  4822  	return
  4823  }
  4824  
  4825  // MongoDBResourcesDeleteMongoDBCollectionFuture an abstraction for monitoring and retrieving the results
  4826  // of a long-running operation.
  4827  type MongoDBResourcesDeleteMongoDBCollectionFuture struct {
  4828  	azure.FutureAPI
  4829  	// Result returns the result of the asynchronous operation.
  4830  	// If the operation has not completed it will return an error.
  4831  	Result func(MongoDBResourcesClient) (autorest.Response, error)
  4832  }
  4833  
  4834  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  4835  func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) UnmarshalJSON(body []byte) error {
  4836  	var azFuture azure.Future
  4837  	if err := json.Unmarshal(body, &azFuture); err != nil {
  4838  		return err
  4839  	}
  4840  	future.FutureAPI = &azFuture
  4841  	future.Result = future.result
  4842  	return nil
  4843  }
  4844  
  4845  // result is the default implementation for MongoDBResourcesDeleteMongoDBCollectionFuture.Result.
  4846  func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) {
  4847  	var done bool
  4848  	done, err = future.DoneWithContext(context.Background(), client)
  4849  	if err != nil {
  4850  		err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture", "Result", future.Response(), "Polling failure")
  4851  		return
  4852  	}
  4853  	if !done {
  4854  		ar.Response = future.Response()
  4855  		err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture")
  4856  		return
  4857  	}
  4858  	ar.Response = future.Response()
  4859  	return
  4860  }
  4861  
  4862  // MongoDBResourcesDeleteMongoDBDatabaseFuture an abstraction for monitoring and retrieving the results of
  4863  // a long-running operation.
  4864  type MongoDBResourcesDeleteMongoDBDatabaseFuture struct {
  4865  	azure.FutureAPI
  4866  	// Result returns the result of the asynchronous operation.
  4867  	// If the operation has not completed it will return an error.
  4868  	Result func(MongoDBResourcesClient) (autorest.Response, error)
  4869  }
  4870  
  4871  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  4872  func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error {
  4873  	var azFuture azure.Future
  4874  	if err := json.Unmarshal(body, &azFuture); err != nil {
  4875  		return err
  4876  	}
  4877  	future.FutureAPI = &azFuture
  4878  	future.Result = future.result
  4879  	return nil
  4880  }
  4881  
  4882  // result is the default implementation for MongoDBResourcesDeleteMongoDBDatabaseFuture.Result.
  4883  func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) {
  4884  	var done bool
  4885  	done, err = future.DoneWithContext(context.Background(), client)
  4886  	if err != nil {
  4887  		err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure")
  4888  		return
  4889  	}
  4890  	if !done {
  4891  		ar.Response = future.Response()
  4892  		err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture")
  4893  		return
  4894  	}
  4895  	ar.Response = future.Response()
  4896  	return
  4897  }
  4898  
  4899  // MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture an abstraction for monitoring and retrieving
  4900  // the results of a long-running operation.
  4901  type MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture struct {
  4902  	azure.FutureAPI
  4903  	// Result returns the result of the asynchronous operation.
  4904  	// If the operation has not completed it will return an error.
  4905  	Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
  4906  }
  4907  
  4908  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  4909  func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) UnmarshalJSON(body []byte) error {
  4910  	var azFuture azure.Future
  4911  	if err := json.Unmarshal(body, &azFuture); err != nil {
  4912  		return err
  4913  	}
  4914  	future.FutureAPI = &azFuture
  4915  	future.Result = future.result
  4916  	return nil
  4917  }
  4918  
  4919  // result is the default implementation for MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture.Result.
  4920  func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  4921  	var done bool
  4922  	done, err = future.DoneWithContext(context.Background(), client)
  4923  	if err != nil {
  4924  		err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", future.Response(), "Polling failure")
  4925  		return
  4926  	}
  4927  	if !done {
  4928  		tsgr.Response.Response = future.Response()
  4929  		err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture")
  4930  		return
  4931  	}
  4932  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  4933  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  4934  		tsgr, err = client.MigrateMongoDBCollectionToAutoscaleResponder(tsgr.Response.Response)
  4935  		if err != nil {
  4936  			err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  4937  		}
  4938  	}
  4939  	return
  4940  }
  4941  
  4942  // MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture an abstraction for monitoring and
  4943  // retrieving the results of a long-running operation.
  4944  type MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture struct {
  4945  	azure.FutureAPI
  4946  	// Result returns the result of the asynchronous operation.
  4947  	// If the operation has not completed it will return an error.
  4948  	Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
  4949  }
  4950  
  4951  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  4952  func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) UnmarshalJSON(body []byte) error {
  4953  	var azFuture azure.Future
  4954  	if err := json.Unmarshal(body, &azFuture); err != nil {
  4955  		return err
  4956  	}
  4957  	future.FutureAPI = &azFuture
  4958  	future.Result = future.result
  4959  	return nil
  4960  }
  4961  
  4962  // result is the default implementation for MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture.Result.
  4963  func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  4964  	var done bool
  4965  	done, err = future.DoneWithContext(context.Background(), client)
  4966  	if err != nil {
  4967  		err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", future.Response(), "Polling failure")
  4968  		return
  4969  	}
  4970  	if !done {
  4971  		tsgr.Response.Response = future.Response()
  4972  		err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture")
  4973  		return
  4974  	}
  4975  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  4976  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  4977  		tsgr, err = client.MigrateMongoDBCollectionToManualThroughputResponder(tsgr.Response.Response)
  4978  		if err != nil {
  4979  			err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  4980  		}
  4981  	}
  4982  	return
  4983  }
  4984  
  4985  // MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the
  4986  // results of a long-running operation.
  4987  type MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture struct {
  4988  	azure.FutureAPI
  4989  	// Result returns the result of the asynchronous operation.
  4990  	// If the operation has not completed it will return an error.
  4991  	Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
  4992  }
  4993  
  4994  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  4995  func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error {
  4996  	var azFuture azure.Future
  4997  	if err := json.Unmarshal(body, &azFuture); err != nil {
  4998  		return err
  4999  	}
  5000  	future.FutureAPI = &azFuture
  5001  	future.Result = future.result
  5002  	return nil
  5003  }
  5004  
  5005  // result is the default implementation for MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture.Result.
  5006  func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  5007  	var done bool
  5008  	done, err = future.DoneWithContext(context.Background(), client)
  5009  	if err != nil {
  5010  		err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure")
  5011  		return
  5012  	}
  5013  	if !done {
  5014  		tsgr.Response.Response = future.Response()
  5015  		err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture")
  5016  		return
  5017  	}
  5018  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  5019  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  5020  		tsgr, err = client.MigrateMongoDBDatabaseToAutoscaleResponder(tsgr.Response.Response)
  5021  		if err != nil {
  5022  			err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  5023  		}
  5024  	}
  5025  	return
  5026  }
  5027  
  5028  // MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture an abstraction for monitoring and
  5029  // retrieving the results of a long-running operation.
  5030  type MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture struct {
  5031  	azure.FutureAPI
  5032  	// Result returns the result of the asynchronous operation.
  5033  	// If the operation has not completed it will return an error.
  5034  	Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
  5035  }
  5036  
  5037  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5038  func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error {
  5039  	var azFuture azure.Future
  5040  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5041  		return err
  5042  	}
  5043  	future.FutureAPI = &azFuture
  5044  	future.Result = future.result
  5045  	return nil
  5046  }
  5047  
  5048  // result is the default implementation for MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture.Result.
  5049  func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  5050  	var done bool
  5051  	done, err = future.DoneWithContext(context.Background(), client)
  5052  	if err != nil {
  5053  		err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure")
  5054  		return
  5055  	}
  5056  	if !done {
  5057  		tsgr.Response.Response = future.Response()
  5058  		err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture")
  5059  		return
  5060  	}
  5061  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  5062  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  5063  		tsgr, err = client.MigrateMongoDBDatabaseToManualThroughputResponder(tsgr.Response.Response)
  5064  		if err != nil {
  5065  			err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  5066  		}
  5067  	}
  5068  	return
  5069  }
  5070  
  5071  // MongoDBResourcesUpdateMongoDBCollectionThroughputFuture an abstraction for monitoring and retrieving the
  5072  // results of a long-running operation.
  5073  type MongoDBResourcesUpdateMongoDBCollectionThroughputFuture struct {
  5074  	azure.FutureAPI
  5075  	// Result returns the result of the asynchronous operation.
  5076  	// If the operation has not completed it will return an error.
  5077  	Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
  5078  }
  5079  
  5080  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5081  func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) UnmarshalJSON(body []byte) error {
  5082  	var azFuture azure.Future
  5083  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5084  		return err
  5085  	}
  5086  	future.FutureAPI = &azFuture
  5087  	future.Result = future.result
  5088  	return nil
  5089  }
  5090  
  5091  // result is the default implementation for MongoDBResourcesUpdateMongoDBCollectionThroughputFuture.Result.
  5092  func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  5093  	var done bool
  5094  	done, err = future.DoneWithContext(context.Background(), client)
  5095  	if err != nil {
  5096  		err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", future.Response(), "Polling failure")
  5097  		return
  5098  	}
  5099  	if !done {
  5100  		tsgr.Response.Response = future.Response()
  5101  		err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture")
  5102  		return
  5103  	}
  5104  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  5105  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  5106  		tsgr, err = client.UpdateMongoDBCollectionThroughputResponder(tsgr.Response.Response)
  5107  		if err != nil {
  5108  			err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  5109  		}
  5110  	}
  5111  	return
  5112  }
  5113  
  5114  // MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture an abstraction for monitoring and retrieving the
  5115  // results of a long-running operation.
  5116  type MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture struct {
  5117  	azure.FutureAPI
  5118  	// Result returns the result of the asynchronous operation.
  5119  	// If the operation has not completed it will return an error.
  5120  	Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
  5121  }
  5122  
  5123  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5124  func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) UnmarshalJSON(body []byte) error {
  5125  	var azFuture azure.Future
  5126  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5127  		return err
  5128  	}
  5129  	future.FutureAPI = &azFuture
  5130  	future.Result = future.result
  5131  	return nil
  5132  }
  5133  
  5134  // result is the default implementation for MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture.Result.
  5135  func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  5136  	var done bool
  5137  	done, err = future.DoneWithContext(context.Background(), client)
  5138  	if err != nil {
  5139  		err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", future.Response(), "Polling failure")
  5140  		return
  5141  	}
  5142  	if !done {
  5143  		tsgr.Response.Response = future.Response()
  5144  		err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture")
  5145  		return
  5146  	}
  5147  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  5148  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  5149  		tsgr, err = client.UpdateMongoDBDatabaseThroughputResponder(tsgr.Response.Response)
  5150  		if err != nil {
  5151  			err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  5152  		}
  5153  	}
  5154  	return
  5155  }
  5156  
  5157  // MongoIndex cosmos DB MongoDB collection index key
  5158  type MongoIndex struct {
  5159  	// Key - Cosmos DB MongoDB collection index keys
  5160  	Key *MongoIndexKeys `json:"key,omitempty"`
  5161  	// Options - Cosmos DB MongoDB collection index key options
  5162  	Options *MongoIndexOptions `json:"options,omitempty"`
  5163  }
  5164  
  5165  // MongoIndexKeys cosmos DB MongoDB collection resource object
  5166  type MongoIndexKeys struct {
  5167  	// Keys - List of keys for each MongoDB collection in the Azure Cosmos DB service
  5168  	Keys *[]string `json:"keys,omitempty"`
  5169  }
  5170  
  5171  // MongoIndexOptions cosmos DB MongoDB collection index options
  5172  type MongoIndexOptions struct {
  5173  	// ExpireAfterSeconds - Expire after seconds
  5174  	ExpireAfterSeconds *int32 `json:"expireAfterSeconds,omitempty"`
  5175  	// Unique - Is unique or not
  5176  	Unique *bool `json:"unique,omitempty"`
  5177  }
  5178  
  5179  // NotebookWorkspace a notebook workspace resource
  5180  type NotebookWorkspace struct {
  5181  	autorest.Response `json:"-"`
  5182  	// NotebookWorkspaceProperties - Resource properties.
  5183  	*NotebookWorkspaceProperties `json:"properties,omitempty"`
  5184  	// ID - READ-ONLY; The unique resource identifier of the database account.
  5185  	ID *string `json:"id,omitempty"`
  5186  	// Name - READ-ONLY; The name of the database account.
  5187  	Name *string `json:"name,omitempty"`
  5188  	// Type - READ-ONLY; The type of Azure resource.
  5189  	Type *string `json:"type,omitempty"`
  5190  }
  5191  
  5192  // MarshalJSON is the custom marshaler for NotebookWorkspace.
  5193  func (nw NotebookWorkspace) MarshalJSON() ([]byte, error) {
  5194  	objectMap := make(map[string]interface{})
  5195  	if nw.NotebookWorkspaceProperties != nil {
  5196  		objectMap["properties"] = nw.NotebookWorkspaceProperties
  5197  	}
  5198  	return json.Marshal(objectMap)
  5199  }
  5200  
  5201  // UnmarshalJSON is the custom unmarshaler for NotebookWorkspace struct.
  5202  func (nw *NotebookWorkspace) UnmarshalJSON(body []byte) error {
  5203  	var m map[string]*json.RawMessage
  5204  	err := json.Unmarshal(body, &m)
  5205  	if err != nil {
  5206  		return err
  5207  	}
  5208  	for k, v := range m {
  5209  		switch k {
  5210  		case "properties":
  5211  			if v != nil {
  5212  				var notebookWorkspaceProperties NotebookWorkspaceProperties
  5213  				err = json.Unmarshal(*v, &notebookWorkspaceProperties)
  5214  				if err != nil {
  5215  					return err
  5216  				}
  5217  				nw.NotebookWorkspaceProperties = &notebookWorkspaceProperties
  5218  			}
  5219  		case "id":
  5220  			if v != nil {
  5221  				var ID string
  5222  				err = json.Unmarshal(*v, &ID)
  5223  				if err != nil {
  5224  					return err
  5225  				}
  5226  				nw.ID = &ID
  5227  			}
  5228  		case "name":
  5229  			if v != nil {
  5230  				var name string
  5231  				err = json.Unmarshal(*v, &name)
  5232  				if err != nil {
  5233  					return err
  5234  				}
  5235  				nw.Name = &name
  5236  			}
  5237  		case "type":
  5238  			if v != nil {
  5239  				var typeVar string
  5240  				err = json.Unmarshal(*v, &typeVar)
  5241  				if err != nil {
  5242  					return err
  5243  				}
  5244  				nw.Type = &typeVar
  5245  			}
  5246  		}
  5247  	}
  5248  
  5249  	return nil
  5250  }
  5251  
  5252  // NotebookWorkspaceConnectionInfoResult the connection info for the given notebook workspace
  5253  type NotebookWorkspaceConnectionInfoResult struct {
  5254  	autorest.Response `json:"-"`
  5255  	// AuthToken - READ-ONLY; Specifies auth token used for connecting to Notebook server (uses token-based auth).
  5256  	AuthToken *string `json:"authToken,omitempty"`
  5257  	// NotebookServerEndpoint - READ-ONLY; Specifies the endpoint of Notebook server.
  5258  	NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"`
  5259  }
  5260  
  5261  // MarshalJSON is the custom marshaler for NotebookWorkspaceConnectionInfoResult.
  5262  func (nwcir NotebookWorkspaceConnectionInfoResult) MarshalJSON() ([]byte, error) {
  5263  	objectMap := make(map[string]interface{})
  5264  	return json.Marshal(objectMap)
  5265  }
  5266  
  5267  // NotebookWorkspaceCreateUpdateParameters parameters to create a notebook workspace resource
  5268  type NotebookWorkspaceCreateUpdateParameters struct {
  5269  	// ID - READ-ONLY; The unique resource identifier of the database account.
  5270  	ID *string `json:"id,omitempty"`
  5271  	// Name - READ-ONLY; The name of the database account.
  5272  	Name *string `json:"name,omitempty"`
  5273  	// Type - READ-ONLY; The type of Azure resource.
  5274  	Type *string `json:"type,omitempty"`
  5275  }
  5276  
  5277  // MarshalJSON is the custom marshaler for NotebookWorkspaceCreateUpdateParameters.
  5278  func (nwcup NotebookWorkspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) {
  5279  	objectMap := make(map[string]interface{})
  5280  	return json.Marshal(objectMap)
  5281  }
  5282  
  5283  // NotebookWorkspaceListResult a list of notebook workspace resources
  5284  type NotebookWorkspaceListResult struct {
  5285  	autorest.Response `json:"-"`
  5286  	// Value - Array of notebook workspace resources
  5287  	Value *[]NotebookWorkspace `json:"value,omitempty"`
  5288  }
  5289  
  5290  // NotebookWorkspaceProperties properties of a notebook workspace resource.
  5291  type NotebookWorkspaceProperties struct {
  5292  	// NotebookServerEndpoint - READ-ONLY; Specifies the endpoint of Notebook server.
  5293  	NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"`
  5294  	// Status - READ-ONLY; Status of the notebook workspace. Possible values are: Creating, Online, Deleting, Failed, Updating.
  5295  	Status *string `json:"status,omitempty"`
  5296  }
  5297  
  5298  // MarshalJSON is the custom marshaler for NotebookWorkspaceProperties.
  5299  func (nwp NotebookWorkspaceProperties) MarshalJSON() ([]byte, error) {
  5300  	objectMap := make(map[string]interface{})
  5301  	return json.Marshal(objectMap)
  5302  }
  5303  
  5304  // NotebookWorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
  5305  // long-running operation.
  5306  type NotebookWorkspacesCreateOrUpdateFuture struct {
  5307  	azure.FutureAPI
  5308  	// Result returns the result of the asynchronous operation.
  5309  	// If the operation has not completed it will return an error.
  5310  	Result func(NotebookWorkspacesClient) (NotebookWorkspace, error)
  5311  }
  5312  
  5313  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5314  func (future *NotebookWorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  5315  	var azFuture azure.Future
  5316  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5317  		return err
  5318  	}
  5319  	future.FutureAPI = &azFuture
  5320  	future.Result = future.result
  5321  	return nil
  5322  }
  5323  
  5324  // result is the default implementation for NotebookWorkspacesCreateOrUpdateFuture.Result.
  5325  func (future *NotebookWorkspacesCreateOrUpdateFuture) result(client NotebookWorkspacesClient) (nw NotebookWorkspace, err error) {
  5326  	var done bool
  5327  	done, err = future.DoneWithContext(context.Background(), client)
  5328  	if err != nil {
  5329  		err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  5330  		return
  5331  	}
  5332  	if !done {
  5333  		nw.Response.Response = future.Response()
  5334  		err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesCreateOrUpdateFuture")
  5335  		return
  5336  	}
  5337  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  5338  	if nw.Response.Response, err = future.GetResult(sender); err == nil && nw.Response.Response.StatusCode != http.StatusNoContent {
  5339  		nw, err = client.CreateOrUpdateResponder(nw.Response.Response)
  5340  		if err != nil {
  5341  			err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", nw.Response.Response, "Failure responding to request")
  5342  		}
  5343  	}
  5344  	return
  5345  }
  5346  
  5347  // NotebookWorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a
  5348  // long-running operation.
  5349  type NotebookWorkspacesDeleteFuture struct {
  5350  	azure.FutureAPI
  5351  	// Result returns the result of the asynchronous operation.
  5352  	// If the operation has not completed it will return an error.
  5353  	Result func(NotebookWorkspacesClient) (autorest.Response, error)
  5354  }
  5355  
  5356  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5357  func (future *NotebookWorkspacesDeleteFuture) UnmarshalJSON(body []byte) error {
  5358  	var azFuture azure.Future
  5359  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5360  		return err
  5361  	}
  5362  	future.FutureAPI = &azFuture
  5363  	future.Result = future.result
  5364  	return nil
  5365  }
  5366  
  5367  // result is the default implementation for NotebookWorkspacesDeleteFuture.Result.
  5368  func (future *NotebookWorkspacesDeleteFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) {
  5369  	var done bool
  5370  	done, err = future.DoneWithContext(context.Background(), client)
  5371  	if err != nil {
  5372  		err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesDeleteFuture", "Result", future.Response(), "Polling failure")
  5373  		return
  5374  	}
  5375  	if !done {
  5376  		ar.Response = future.Response()
  5377  		err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesDeleteFuture")
  5378  		return
  5379  	}
  5380  	ar.Response = future.Response()
  5381  	return
  5382  }
  5383  
  5384  // NotebookWorkspacesRegenerateAuthTokenFuture an abstraction for monitoring and retrieving the results of
  5385  // a long-running operation.
  5386  type NotebookWorkspacesRegenerateAuthTokenFuture struct {
  5387  	azure.FutureAPI
  5388  	// Result returns the result of the asynchronous operation.
  5389  	// If the operation has not completed it will return an error.
  5390  	Result func(NotebookWorkspacesClient) (autorest.Response, error)
  5391  }
  5392  
  5393  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5394  func (future *NotebookWorkspacesRegenerateAuthTokenFuture) UnmarshalJSON(body []byte) error {
  5395  	var azFuture azure.Future
  5396  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5397  		return err
  5398  	}
  5399  	future.FutureAPI = &azFuture
  5400  	future.Result = future.result
  5401  	return nil
  5402  }
  5403  
  5404  // result is the default implementation for NotebookWorkspacesRegenerateAuthTokenFuture.Result.
  5405  func (future *NotebookWorkspacesRegenerateAuthTokenFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) {
  5406  	var done bool
  5407  	done, err = future.DoneWithContext(context.Background(), client)
  5408  	if err != nil {
  5409  		err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesRegenerateAuthTokenFuture", "Result", future.Response(), "Polling failure")
  5410  		return
  5411  	}
  5412  	if !done {
  5413  		ar.Response = future.Response()
  5414  		err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesRegenerateAuthTokenFuture")
  5415  		return
  5416  	}
  5417  	ar.Response = future.Response()
  5418  	return
  5419  }
  5420  
  5421  // NotebookWorkspacesStartFuture an abstraction for monitoring and retrieving the results of a long-running
  5422  // operation.
  5423  type NotebookWorkspacesStartFuture struct {
  5424  	azure.FutureAPI
  5425  	// Result returns the result of the asynchronous operation.
  5426  	// If the operation has not completed it will return an error.
  5427  	Result func(NotebookWorkspacesClient) (autorest.Response, error)
  5428  }
  5429  
  5430  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5431  func (future *NotebookWorkspacesStartFuture) UnmarshalJSON(body []byte) error {
  5432  	var azFuture azure.Future
  5433  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5434  		return err
  5435  	}
  5436  	future.FutureAPI = &azFuture
  5437  	future.Result = future.result
  5438  	return nil
  5439  }
  5440  
  5441  // result is the default implementation for NotebookWorkspacesStartFuture.Result.
  5442  func (future *NotebookWorkspacesStartFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) {
  5443  	var done bool
  5444  	done, err = future.DoneWithContext(context.Background(), client)
  5445  	if err != nil {
  5446  		err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesStartFuture", "Result", future.Response(), "Polling failure")
  5447  		return
  5448  	}
  5449  	if !done {
  5450  		ar.Response = future.Response()
  5451  		err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesStartFuture")
  5452  		return
  5453  	}
  5454  	ar.Response = future.Response()
  5455  	return
  5456  }
  5457  
  5458  // Operation REST API operation
  5459  type Operation struct {
  5460  	// Name - Operation name: {provider}/{resource}/{operation}
  5461  	Name *string `json:"name,omitempty"`
  5462  	// Display - The object that represents the operation.
  5463  	Display *OperationDisplay `json:"display,omitempty"`
  5464  }
  5465  
  5466  // OperationDisplay the object that represents the operation.
  5467  type OperationDisplay struct {
  5468  	// Provider - Service provider: Microsoft.ResourceProvider
  5469  	Provider *string `json:"Provider,omitempty"`
  5470  	// Resource - Resource on which the operation is performed: Profile, endpoint, etc.
  5471  	Resource *string `json:"Resource,omitempty"`
  5472  	// Operation - Operation type: Read, write, delete, etc.
  5473  	Operation *string `json:"Operation,omitempty"`
  5474  	// Description - Description of operation
  5475  	Description *string `json:"Description,omitempty"`
  5476  }
  5477  
  5478  // OperationListResult result of the request to list Resource Provider operations. It contains a list of
  5479  // operations and a URL link to get the next set of results.
  5480  type OperationListResult struct {
  5481  	autorest.Response `json:"-"`
  5482  	// Value - List of operations supported by the Resource Provider.
  5483  	Value *[]Operation `json:"value,omitempty"`
  5484  	// NextLink - URL to get the next set of operation list results if there are any.
  5485  	NextLink *string `json:"nextLink,omitempty"`
  5486  }
  5487  
  5488  // OperationListResultIterator provides access to a complete listing of Operation values.
  5489  type OperationListResultIterator struct {
  5490  	i    int
  5491  	page OperationListResultPage
  5492  }
  5493  
  5494  // NextWithContext advances to the next value.  If there was an error making
  5495  // the request the iterator does not advance and the error is returned.
  5496  func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
  5497  	if tracing.IsEnabled() {
  5498  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
  5499  		defer func() {
  5500  			sc := -1
  5501  			if iter.Response().Response.Response != nil {
  5502  				sc = iter.Response().Response.Response.StatusCode
  5503  			}
  5504  			tracing.EndSpan(ctx, sc, err)
  5505  		}()
  5506  	}
  5507  	iter.i++
  5508  	if iter.i < len(iter.page.Values()) {
  5509  		return nil
  5510  	}
  5511  	err = iter.page.NextWithContext(ctx)
  5512  	if err != nil {
  5513  		iter.i--
  5514  		return err
  5515  	}
  5516  	iter.i = 0
  5517  	return nil
  5518  }
  5519  
  5520  // Next advances to the next value.  If there was an error making
  5521  // the request the iterator does not advance and the error is returned.
  5522  // Deprecated: Use NextWithContext() instead.
  5523  func (iter *OperationListResultIterator) Next() error {
  5524  	return iter.NextWithContext(context.Background())
  5525  }
  5526  
  5527  // NotDone returns true if the enumeration should be started or is not yet complete.
  5528  func (iter OperationListResultIterator) NotDone() bool {
  5529  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  5530  }
  5531  
  5532  // Response returns the raw server response from the last page request.
  5533  func (iter OperationListResultIterator) Response() OperationListResult {
  5534  	return iter.page.Response()
  5535  }
  5536  
  5537  // Value returns the current value or a zero-initialized value if the
  5538  // iterator has advanced beyond the end of the collection.
  5539  func (iter OperationListResultIterator) Value() Operation {
  5540  	if !iter.page.NotDone() {
  5541  		return Operation{}
  5542  	}
  5543  	return iter.page.Values()[iter.i]
  5544  }
  5545  
  5546  // Creates a new instance of the OperationListResultIterator type.
  5547  func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
  5548  	return OperationListResultIterator{page: page}
  5549  }
  5550  
  5551  // IsEmpty returns true if the ListResult contains no values.
  5552  func (olr OperationListResult) IsEmpty() bool {
  5553  	return olr.Value == nil || len(*olr.Value) == 0
  5554  }
  5555  
  5556  // hasNextLink returns true if the NextLink is not empty.
  5557  func (olr OperationListResult) hasNextLink() bool {
  5558  	return olr.NextLink != nil && len(*olr.NextLink) != 0
  5559  }
  5560  
  5561  // operationListResultPreparer prepares a request to retrieve the next set of results.
  5562  // It returns nil if no more results exist.
  5563  func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
  5564  	if !olr.hasNextLink() {
  5565  		return nil, nil
  5566  	}
  5567  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  5568  		autorest.AsJSON(),
  5569  		autorest.AsGet(),
  5570  		autorest.WithBaseURL(to.String(olr.NextLink)))
  5571  }
  5572  
  5573  // OperationListResultPage contains a page of Operation values.
  5574  type OperationListResultPage struct {
  5575  	fn  func(context.Context, OperationListResult) (OperationListResult, error)
  5576  	olr OperationListResult
  5577  }
  5578  
  5579  // NextWithContext advances to the next page of values.  If there was an error making
  5580  // the request the page does not advance and the error is returned.
  5581  func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
  5582  	if tracing.IsEnabled() {
  5583  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
  5584  		defer func() {
  5585  			sc := -1
  5586  			if page.Response().Response.Response != nil {
  5587  				sc = page.Response().Response.Response.StatusCode
  5588  			}
  5589  			tracing.EndSpan(ctx, sc, err)
  5590  		}()
  5591  	}
  5592  	for {
  5593  		next, err := page.fn(ctx, page.olr)
  5594  		if err != nil {
  5595  			return err
  5596  		}
  5597  		page.olr = next
  5598  		if !next.hasNextLink() || !next.IsEmpty() {
  5599  			break
  5600  		}
  5601  	}
  5602  	return nil
  5603  }
  5604  
  5605  // Next advances to the next page of values.  If there was an error making
  5606  // the request the page does not advance and the error is returned.
  5607  // Deprecated: Use NextWithContext() instead.
  5608  func (page *OperationListResultPage) Next() error {
  5609  	return page.NextWithContext(context.Background())
  5610  }
  5611  
  5612  // NotDone returns true if the page enumeration should be started or is not yet complete.
  5613  func (page OperationListResultPage) NotDone() bool {
  5614  	return !page.olr.IsEmpty()
  5615  }
  5616  
  5617  // Response returns the raw server response from the last page request.
  5618  func (page OperationListResultPage) Response() OperationListResult {
  5619  	return page.olr
  5620  }
  5621  
  5622  // Values returns the slice of values for the current page or nil if there are no values.
  5623  func (page OperationListResultPage) Values() []Operation {
  5624  	if page.olr.IsEmpty() {
  5625  		return nil
  5626  	}
  5627  	return *page.olr.Value
  5628  }
  5629  
  5630  // Creates a new instance of the OperationListResultPage type.
  5631  func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
  5632  	return OperationListResultPage{
  5633  		fn:  getNextPage,
  5634  		olr: cur,
  5635  	}
  5636  }
  5637  
  5638  // OptionsResource cosmos DB options resource object
  5639  type OptionsResource struct {
  5640  	// Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details.
  5641  	Throughput *int32 `json:"throughput,omitempty"`
  5642  	// AutoscaleSettings - Specifies the Autoscale settings.
  5643  	AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
  5644  }
  5645  
  5646  // PartitionMetric the metric values for a single partition.
  5647  type PartitionMetric struct {
  5648  	// PartitionID - READ-ONLY; The partition id (GUID identifier) of the metric values.
  5649  	PartitionID *string `json:"partitionId,omitempty"`
  5650  	// PartitionKeyRangeID - READ-ONLY; The partition key range id (integer identifier) of the metric values.
  5651  	PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"`
  5652  	// StartTime - READ-ONLY; The start time for the metric (ISO-8601 format).
  5653  	StartTime *date.Time `json:"startTime,omitempty"`
  5654  	// EndTime - READ-ONLY; The end time for the metric (ISO-8601 format).
  5655  	EndTime *date.Time `json:"endTime,omitempty"`
  5656  	// TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values.
  5657  	TimeGrain *string `json:"timeGrain,omitempty"`
  5658  	// Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'
  5659  	Unit UnitType `json:"unit,omitempty"`
  5660  	// Name - READ-ONLY; The name information for the metric.
  5661  	Name *MetricName `json:"name,omitempty"`
  5662  	// MetricValues - READ-ONLY; The metric values for the specified time window and timestep.
  5663  	MetricValues *[]MetricValue `json:"metricValues,omitempty"`
  5664  }
  5665  
  5666  // MarshalJSON is the custom marshaler for PartitionMetric.
  5667  func (pm PartitionMetric) MarshalJSON() ([]byte, error) {
  5668  	objectMap := make(map[string]interface{})
  5669  	if pm.Unit != "" {
  5670  		objectMap["unit"] = pm.Unit
  5671  	}
  5672  	return json.Marshal(objectMap)
  5673  }
  5674  
  5675  // PartitionMetricListResult the response to a list partition metrics request.
  5676  type PartitionMetricListResult struct {
  5677  	autorest.Response `json:"-"`
  5678  	// Value - READ-ONLY; The list of partition-level metrics for the account.
  5679  	Value *[]PartitionMetric `json:"value,omitempty"`
  5680  }
  5681  
  5682  // MarshalJSON is the custom marshaler for PartitionMetricListResult.
  5683  func (pmlr PartitionMetricListResult) MarshalJSON() ([]byte, error) {
  5684  	objectMap := make(map[string]interface{})
  5685  	return json.Marshal(objectMap)
  5686  }
  5687  
  5688  // PartitionUsage the partition level usage data for a usage request.
  5689  type PartitionUsage struct {
  5690  	// PartitionID - READ-ONLY; The partition id (GUID identifier) of the usages.
  5691  	PartitionID *string `json:"partitionId,omitempty"`
  5692  	// PartitionKeyRangeID - READ-ONLY; The partition key range id (integer identifier) of the usages.
  5693  	PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"`
  5694  	// Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'
  5695  	Unit UnitType `json:"unit,omitempty"`
  5696  	// Name - READ-ONLY; The name information for the metric.
  5697  	Name *MetricName `json:"name,omitempty"`
  5698  	// QuotaPeriod - READ-ONLY; The quota period used to summarize the usage values.
  5699  	QuotaPeriod *string `json:"quotaPeriod,omitempty"`
  5700  	// Limit - READ-ONLY; Maximum value for this metric
  5701  	Limit *int64 `json:"limit,omitempty"`
  5702  	// CurrentValue - READ-ONLY; Current value for this metric
  5703  	CurrentValue *int64 `json:"currentValue,omitempty"`
  5704  }
  5705  
  5706  // MarshalJSON is the custom marshaler for PartitionUsage.
  5707  func (pu PartitionUsage) MarshalJSON() ([]byte, error) {
  5708  	objectMap := make(map[string]interface{})
  5709  	if pu.Unit != "" {
  5710  		objectMap["unit"] = pu.Unit
  5711  	}
  5712  	return json.Marshal(objectMap)
  5713  }
  5714  
  5715  // PartitionUsagesResult the response to a list partition level usage request.
  5716  type PartitionUsagesResult struct {
  5717  	autorest.Response `json:"-"`
  5718  	// Value - READ-ONLY; The list of partition-level usages for the database. A usage is a point in time metric
  5719  	Value *[]PartitionUsage `json:"value,omitempty"`
  5720  }
  5721  
  5722  // MarshalJSON is the custom marshaler for PartitionUsagesResult.
  5723  func (pur PartitionUsagesResult) MarshalJSON() ([]byte, error) {
  5724  	objectMap := make(map[string]interface{})
  5725  	return json.Marshal(objectMap)
  5726  }
  5727  
  5728  // PercentileMetric percentile Metric data
  5729  type PercentileMetric struct {
  5730  	// StartTime - READ-ONLY; The start time for the metric (ISO-8601 format).
  5731  	StartTime *date.Time `json:"startTime,omitempty"`
  5732  	// EndTime - READ-ONLY; The end time for the metric (ISO-8601 format).
  5733  	EndTime *date.Time `json:"endTime,omitempty"`
  5734  	// TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values.
  5735  	TimeGrain *string `json:"timeGrain,omitempty"`
  5736  	// Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'
  5737  	Unit UnitType `json:"unit,omitempty"`
  5738  	// Name - READ-ONLY; The name information for the metric.
  5739  	Name *MetricName `json:"name,omitempty"`
  5740  	// MetricValues - READ-ONLY; The percentile metric values for the specified time window and timestep.
  5741  	MetricValues *[]PercentileMetricValue `json:"metricValues,omitempty"`
  5742  }
  5743  
  5744  // MarshalJSON is the custom marshaler for PercentileMetric.
  5745  func (pm PercentileMetric) MarshalJSON() ([]byte, error) {
  5746  	objectMap := make(map[string]interface{})
  5747  	if pm.Unit != "" {
  5748  		objectMap["unit"] = pm.Unit
  5749  	}
  5750  	return json.Marshal(objectMap)
  5751  }
  5752  
  5753  // PercentileMetricListResult the response to a list percentile metrics request.
  5754  type PercentileMetricListResult struct {
  5755  	autorest.Response `json:"-"`
  5756  	// Value - READ-ONLY; The list of percentile metrics for the account.
  5757  	Value *[]PercentileMetric `json:"value,omitempty"`
  5758  }
  5759  
  5760  // MarshalJSON is the custom marshaler for PercentileMetricListResult.
  5761  func (pmlr PercentileMetricListResult) MarshalJSON() ([]byte, error) {
  5762  	objectMap := make(map[string]interface{})
  5763  	return json.Marshal(objectMap)
  5764  }
  5765  
  5766  // PercentileMetricValue represents percentile metrics values.
  5767  type PercentileMetricValue struct {
  5768  	// P10 - READ-ONLY; The 10th percentile value for the metric.
  5769  	P10 *float64 `json:"P10,omitempty"`
  5770  	// P25 - READ-ONLY; The 25th percentile value for the metric.
  5771  	P25 *float64 `json:"P25,omitempty"`
  5772  	// P50 - READ-ONLY; The 50th percentile value for the metric.
  5773  	P50 *float64 `json:"P50,omitempty"`
  5774  	// P75 - READ-ONLY; The 75th percentile value for the metric.
  5775  	P75 *float64 `json:"P75,omitempty"`
  5776  	// P90 - READ-ONLY; The 90th percentile value for the metric.
  5777  	P90 *float64 `json:"P90,omitempty"`
  5778  	// P95 - READ-ONLY; The 95th percentile value for the metric.
  5779  	P95 *float64 `json:"P95,omitempty"`
  5780  	// P99 - READ-ONLY; The 99th percentile value for the metric.
  5781  	P99 *float64 `json:"P99,omitempty"`
  5782  	// Count - READ-ONLY; The number of values for the metric.
  5783  	Count *float64 `json:"_count,omitempty"`
  5784  	// Average - READ-ONLY; The average value of the metric.
  5785  	Average *float64 `json:"average,omitempty"`
  5786  	// Maximum - READ-ONLY; The max value of the metric.
  5787  	Maximum *float64 `json:"maximum,omitempty"`
  5788  	// Minimum - READ-ONLY; The min value of the metric.
  5789  	Minimum *float64 `json:"minimum,omitempty"`
  5790  	// Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format).
  5791  	Timestamp *date.Time `json:"timestamp,omitempty"`
  5792  	// Total - READ-ONLY; The total value of the metric.
  5793  	Total *float64 `json:"total,omitempty"`
  5794  }
  5795  
  5796  // MarshalJSON is the custom marshaler for PercentileMetricValue.
  5797  func (pmv PercentileMetricValue) MarshalJSON() ([]byte, error) {
  5798  	objectMap := make(map[string]interface{})
  5799  	return json.Marshal(objectMap)
  5800  }
  5801  
  5802  // PeriodicModeBackupPolicy the object representing periodic mode backup policy.
  5803  type PeriodicModeBackupPolicy struct {
  5804  	// PeriodicModeProperties - Configuration values for periodic mode backup
  5805  	PeriodicModeProperties *PeriodicModeProperties `json:"periodicModeProperties,omitempty"`
  5806  	// Type - Possible values include: 'TypeBackupPolicy', 'TypePeriodic', 'TypeContinuous'
  5807  	Type Type `json:"type,omitempty"`
  5808  }
  5809  
  5810  // MarshalJSON is the custom marshaler for PeriodicModeBackupPolicy.
  5811  func (pmbp PeriodicModeBackupPolicy) MarshalJSON() ([]byte, error) {
  5812  	pmbp.Type = TypePeriodic
  5813  	objectMap := make(map[string]interface{})
  5814  	if pmbp.PeriodicModeProperties != nil {
  5815  		objectMap["periodicModeProperties"] = pmbp.PeriodicModeProperties
  5816  	}
  5817  	if pmbp.Type != "" {
  5818  		objectMap["type"] = pmbp.Type
  5819  	}
  5820  	return json.Marshal(objectMap)
  5821  }
  5822  
  5823  // AsPeriodicModeBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy.
  5824  func (pmbp PeriodicModeBackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) {
  5825  	return &pmbp, true
  5826  }
  5827  
  5828  // AsContinuousModeBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy.
  5829  func (pmbp PeriodicModeBackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) {
  5830  	return nil, false
  5831  }
  5832  
  5833  // AsBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy.
  5834  func (pmbp PeriodicModeBackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) {
  5835  	return nil, false
  5836  }
  5837  
  5838  // AsBasicBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy.
  5839  func (pmbp PeriodicModeBackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) {
  5840  	return &pmbp, true
  5841  }
  5842  
  5843  // PeriodicModeProperties configuration values for periodic mode backup
  5844  type PeriodicModeProperties struct {
  5845  	// BackupIntervalInMinutes - An integer representing the interval in minutes between two backups
  5846  	BackupIntervalInMinutes *int32 `json:"backupIntervalInMinutes,omitempty"`
  5847  	// BackupRetentionIntervalInHours - An integer representing the time (in hours) that each backup is retained
  5848  	BackupRetentionIntervalInHours *int32 `json:"backupRetentionIntervalInHours,omitempty"`
  5849  }
  5850  
  5851  // PrivateEndpointConnection a private endpoint connection
  5852  type PrivateEndpointConnection struct {
  5853  	autorest.Response `json:"-"`
  5854  	// PrivateEndpointConnectionProperties - Resource properties.
  5855  	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
  5856  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  5857  	ID *string `json:"id,omitempty"`
  5858  	// Name - READ-ONLY; The name of the resource
  5859  	Name *string `json:"name,omitempty"`
  5860  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  5861  	Type *string `json:"type,omitempty"`
  5862  }
  5863  
  5864  // MarshalJSON is the custom marshaler for PrivateEndpointConnection.
  5865  func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
  5866  	objectMap := make(map[string]interface{})
  5867  	if pec.PrivateEndpointConnectionProperties != nil {
  5868  		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
  5869  	}
  5870  	return json.Marshal(objectMap)
  5871  }
  5872  
  5873  // UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
  5874  func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
  5875  	var m map[string]*json.RawMessage
  5876  	err := json.Unmarshal(body, &m)
  5877  	if err != nil {
  5878  		return err
  5879  	}
  5880  	for k, v := range m {
  5881  		switch k {
  5882  		case "properties":
  5883  			if v != nil {
  5884  				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
  5885  				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
  5886  				if err != nil {
  5887  					return err
  5888  				}
  5889  				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
  5890  			}
  5891  		case "id":
  5892  			if v != nil {
  5893  				var ID string
  5894  				err = json.Unmarshal(*v, &ID)
  5895  				if err != nil {
  5896  					return err
  5897  				}
  5898  				pec.ID = &ID
  5899  			}
  5900  		case "name":
  5901  			if v != nil {
  5902  				var name string
  5903  				err = json.Unmarshal(*v, &name)
  5904  				if err != nil {
  5905  					return err
  5906  				}
  5907  				pec.Name = &name
  5908  			}
  5909  		case "type":
  5910  			if v != nil {
  5911  				var typeVar string
  5912  				err = json.Unmarshal(*v, &typeVar)
  5913  				if err != nil {
  5914  					return err
  5915  				}
  5916  				pec.Type = &typeVar
  5917  			}
  5918  		}
  5919  	}
  5920  
  5921  	return nil
  5922  }
  5923  
  5924  // PrivateEndpointConnectionListResult a list of private endpoint connections
  5925  type PrivateEndpointConnectionListResult struct {
  5926  	autorest.Response `json:"-"`
  5927  	// Value - Array of private endpoint connections
  5928  	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
  5929  }
  5930  
  5931  // PrivateEndpointConnectionProperties properties of a private endpoint connection.
  5932  type PrivateEndpointConnectionProperties struct {
  5933  	// PrivateEndpoint - Private endpoint which the connection belongs to.
  5934  	PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"`
  5935  	// PrivateLinkServiceConnectionState - Connection State of the Private Endpoint Connection.
  5936  	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`
  5937  	// GroupID - Group id of the private endpoint.
  5938  	GroupID *string `json:"groupId,omitempty"`
  5939  	// ProvisioningState - Provisioning state of the private endpoint.
  5940  	ProvisioningState *string `json:"provisioningState,omitempty"`
  5941  }
  5942  
  5943  // PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
  5944  // of a long-running operation.
  5945  type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
  5946  	azure.FutureAPI
  5947  	// Result returns the result of the asynchronous operation.
  5948  	// If the operation has not completed it will return an error.
  5949  	Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
  5950  }
  5951  
  5952  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5953  func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  5954  	var azFuture azure.Future
  5955  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5956  		return err
  5957  	}
  5958  	future.FutureAPI = &azFuture
  5959  	future.Result = future.result
  5960  	return nil
  5961  }
  5962  
  5963  // result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result.
  5964  func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
  5965  	var done bool
  5966  	done, err = future.DoneWithContext(context.Background(), client)
  5967  	if err != nil {
  5968  		err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  5969  		return
  5970  	}
  5971  	if !done {
  5972  		pec.Response.Response = future.Response()
  5973  		err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture")
  5974  		return
  5975  	}
  5976  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  5977  	if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
  5978  		pec, err = client.CreateOrUpdateResponder(pec.Response.Response)
  5979  		if err != nil {
  5980  			err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request")
  5981  		}
  5982  	}
  5983  	return
  5984  }
  5985  
  5986  // PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
  5987  // long-running operation.
  5988  type PrivateEndpointConnectionsDeleteFuture struct {
  5989  	azure.FutureAPI
  5990  	// Result returns the result of the asynchronous operation.
  5991  	// If the operation has not completed it will return an error.
  5992  	Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
  5993  }
  5994  
  5995  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5996  func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
  5997  	var azFuture azure.Future
  5998  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5999  		return err
  6000  	}
  6001  	future.FutureAPI = &azFuture
  6002  	future.Result = future.result
  6003  	return nil
  6004  }
  6005  
  6006  // result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result.
  6007  func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
  6008  	var done bool
  6009  	done, err = future.DoneWithContext(context.Background(), client)
  6010  	if err != nil {
  6011  		err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
  6012  		return
  6013  	}
  6014  	if !done {
  6015  		ar.Response = future.Response()
  6016  		err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsDeleteFuture")
  6017  		return
  6018  	}
  6019  	ar.Response = future.Response()
  6020  	return
  6021  }
  6022  
  6023  // PrivateEndpointProperty private endpoint which the connection belongs to.
  6024  type PrivateEndpointProperty struct {
  6025  	// ID - Resource id of the private endpoint.
  6026  	ID *string `json:"id,omitempty"`
  6027  }
  6028  
  6029  // PrivateLinkResource a private link resource
  6030  type PrivateLinkResource struct {
  6031  	autorest.Response `json:"-"`
  6032  	// PrivateLinkResourceProperties - Resource properties.
  6033  	*PrivateLinkResourceProperties `json:"properties,omitempty"`
  6034  	// ID - READ-ONLY; The unique resource identifier of the database account.
  6035  	ID *string `json:"id,omitempty"`
  6036  	// Name - READ-ONLY; The name of the database account.
  6037  	Name *string `json:"name,omitempty"`
  6038  	// Type - READ-ONLY; The type of Azure resource.
  6039  	Type *string `json:"type,omitempty"`
  6040  }
  6041  
  6042  // MarshalJSON is the custom marshaler for PrivateLinkResource.
  6043  func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
  6044  	objectMap := make(map[string]interface{})
  6045  	if plr.PrivateLinkResourceProperties != nil {
  6046  		objectMap["properties"] = plr.PrivateLinkResourceProperties
  6047  	}
  6048  	return json.Marshal(objectMap)
  6049  }
  6050  
  6051  // UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct.
  6052  func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
  6053  	var m map[string]*json.RawMessage
  6054  	err := json.Unmarshal(body, &m)
  6055  	if err != nil {
  6056  		return err
  6057  	}
  6058  	for k, v := range m {
  6059  		switch k {
  6060  		case "properties":
  6061  			if v != nil {
  6062  				var privateLinkResourceProperties PrivateLinkResourceProperties
  6063  				err = json.Unmarshal(*v, &privateLinkResourceProperties)
  6064  				if err != nil {
  6065  					return err
  6066  				}
  6067  				plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
  6068  			}
  6069  		case "id":
  6070  			if v != nil {
  6071  				var ID string
  6072  				err = json.Unmarshal(*v, &ID)
  6073  				if err != nil {
  6074  					return err
  6075  				}
  6076  				plr.ID = &ID
  6077  			}
  6078  		case "name":
  6079  			if v != nil {
  6080  				var name string
  6081  				err = json.Unmarshal(*v, &name)
  6082  				if err != nil {
  6083  					return err
  6084  				}
  6085  				plr.Name = &name
  6086  			}
  6087  		case "type":
  6088  			if v != nil {
  6089  				var typeVar string
  6090  				err = json.Unmarshal(*v, &typeVar)
  6091  				if err != nil {
  6092  					return err
  6093  				}
  6094  				plr.Type = &typeVar
  6095  			}
  6096  		}
  6097  	}
  6098  
  6099  	return nil
  6100  }
  6101  
  6102  // PrivateLinkResourceListResult a list of private link resources
  6103  type PrivateLinkResourceListResult struct {
  6104  	autorest.Response `json:"-"`
  6105  	// Value - Array of private link resources
  6106  	Value *[]PrivateLinkResource `json:"value,omitempty"`
  6107  }
  6108  
  6109  // PrivateLinkResourceProperties properties of a private link resource.
  6110  type PrivateLinkResourceProperties struct {
  6111  	// GroupID - READ-ONLY; The private link resource group id.
  6112  	GroupID *string `json:"groupId,omitempty"`
  6113  	// RequiredMembers - READ-ONLY; The private link resource required member names.
  6114  	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
  6115  	// RequiredZoneNames - READ-ONLY; The private link resource required zone names.
  6116  	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
  6117  }
  6118  
  6119  // MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
  6120  func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
  6121  	objectMap := make(map[string]interface{})
  6122  	return json.Marshal(objectMap)
  6123  }
  6124  
  6125  // PrivateLinkServiceConnectionStateProperty connection State of the Private Endpoint Connection.
  6126  type PrivateLinkServiceConnectionStateProperty struct {
  6127  	// Status - The private link service connection status.
  6128  	Status *string `json:"status,omitempty"`
  6129  	// Description - The private link service connection description.
  6130  	Description *string `json:"description,omitempty"`
  6131  	// ActionsRequired - READ-ONLY; Any action that is required beyond basic workflow (approve/ reject/ disconnect)
  6132  	ActionsRequired *string `json:"actionsRequired,omitempty"`
  6133  }
  6134  
  6135  // MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty.
  6136  func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
  6137  	objectMap := make(map[string]interface{})
  6138  	if plscsp.Status != nil {
  6139  		objectMap["status"] = plscsp.Status
  6140  	}
  6141  	if plscsp.Description != nil {
  6142  		objectMap["description"] = plscsp.Description
  6143  	}
  6144  	return json.Marshal(objectMap)
  6145  }
  6146  
  6147  // ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
  6148  // have tags and a location
  6149  type ProxyResource struct {
  6150  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  6151  	ID *string `json:"id,omitempty"`
  6152  	// Name - READ-ONLY; The name of the resource
  6153  	Name *string `json:"name,omitempty"`
  6154  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  6155  	Type *string `json:"type,omitempty"`
  6156  }
  6157  
  6158  // MarshalJSON is the custom marshaler for ProxyResource.
  6159  func (pr ProxyResource) MarshalJSON() ([]byte, error) {
  6160  	objectMap := make(map[string]interface{})
  6161  	return json.Marshal(objectMap)
  6162  }
  6163  
  6164  // RegionForOnlineOffline cosmos DB region to online or offline.
  6165  type RegionForOnlineOffline struct {
  6166  	// Region - Cosmos DB region, with spaces between words and each word capitalized.
  6167  	Region *string `json:"region,omitempty"`
  6168  }
  6169  
  6170  // Resource common fields that are returned in the response for all Azure Resource Manager resources
  6171  type Resource struct {
  6172  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  6173  	ID *string `json:"id,omitempty"`
  6174  	// Name - READ-ONLY; The name of the resource
  6175  	Name *string `json:"name,omitempty"`
  6176  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  6177  	Type *string `json:"type,omitempty"`
  6178  }
  6179  
  6180  // MarshalJSON is the custom marshaler for Resource.
  6181  func (r Resource) MarshalJSON() ([]byte, error) {
  6182  	objectMap := make(map[string]interface{})
  6183  	return json.Marshal(objectMap)
  6184  }
  6185  
  6186  // SpatialSpec ...
  6187  type SpatialSpec struct {
  6188  	// Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
  6189  	Path *string `json:"path,omitempty"`
  6190  	// Types - List of path's spatial type
  6191  	Types *[]SpatialType `json:"types,omitempty"`
  6192  }
  6193  
  6194  // SQLContainerCreateUpdateParameters parameters to create and update Cosmos DB container.
  6195  type SQLContainerCreateUpdateParameters struct {
  6196  	// SQLContainerCreateUpdateProperties - Properties to create and update Azure Cosmos DB container.
  6197  	*SQLContainerCreateUpdateProperties `json:"properties,omitempty"`
  6198  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  6199  	ID *string `json:"id,omitempty"`
  6200  	// Name - READ-ONLY; The name of the ARM resource.
  6201  	Name *string `json:"name,omitempty"`
  6202  	// Type - READ-ONLY; The type of Azure resource.
  6203  	Type *string `json:"type,omitempty"`
  6204  	// Location - The location of the resource group to which the resource belongs.
  6205  	Location *string            `json:"location,omitempty"`
  6206  	Tags     map[string]*string `json:"tags"`
  6207  }
  6208  
  6209  // MarshalJSON is the custom marshaler for SQLContainerCreateUpdateParameters.
  6210  func (sccup SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) {
  6211  	objectMap := make(map[string]interface{})
  6212  	if sccup.SQLContainerCreateUpdateProperties != nil {
  6213  		objectMap["properties"] = sccup.SQLContainerCreateUpdateProperties
  6214  	}
  6215  	if sccup.Location != nil {
  6216  		objectMap["location"] = sccup.Location
  6217  	}
  6218  	if sccup.Tags != nil {
  6219  		objectMap["tags"] = sccup.Tags
  6220  	}
  6221  	return json.Marshal(objectMap)
  6222  }
  6223  
  6224  // UnmarshalJSON is the custom unmarshaler for SQLContainerCreateUpdateParameters struct.
  6225  func (sccup *SQLContainerCreateUpdateParameters) UnmarshalJSON(body []byte) error {
  6226  	var m map[string]*json.RawMessage
  6227  	err := json.Unmarshal(body, &m)
  6228  	if err != nil {
  6229  		return err
  6230  	}
  6231  	for k, v := range m {
  6232  		switch k {
  6233  		case "properties":
  6234  			if v != nil {
  6235  				var SQLContainerCreateUpdateProperties SQLContainerCreateUpdateProperties
  6236  				err = json.Unmarshal(*v, &SQLContainerCreateUpdateProperties)
  6237  				if err != nil {
  6238  					return err
  6239  				}
  6240  				sccup.SQLContainerCreateUpdateProperties = &SQLContainerCreateUpdateProperties
  6241  			}
  6242  		case "id":
  6243  			if v != nil {
  6244  				var ID string
  6245  				err = json.Unmarshal(*v, &ID)
  6246  				if err != nil {
  6247  					return err
  6248  				}
  6249  				sccup.ID = &ID
  6250  			}
  6251  		case "name":
  6252  			if v != nil {
  6253  				var name string
  6254  				err = json.Unmarshal(*v, &name)
  6255  				if err != nil {
  6256  					return err
  6257  				}
  6258  				sccup.Name = &name
  6259  			}
  6260  		case "type":
  6261  			if v != nil {
  6262  				var typeVar string
  6263  				err = json.Unmarshal(*v, &typeVar)
  6264  				if err != nil {
  6265  					return err
  6266  				}
  6267  				sccup.Type = &typeVar
  6268  			}
  6269  		case "location":
  6270  			if v != nil {
  6271  				var location string
  6272  				err = json.Unmarshal(*v, &location)
  6273  				if err != nil {
  6274  					return err
  6275  				}
  6276  				sccup.Location = &location
  6277  			}
  6278  		case "tags":
  6279  			if v != nil {
  6280  				var tags map[string]*string
  6281  				err = json.Unmarshal(*v, &tags)
  6282  				if err != nil {
  6283  					return err
  6284  				}
  6285  				sccup.Tags = tags
  6286  			}
  6287  		}
  6288  	}
  6289  
  6290  	return nil
  6291  }
  6292  
  6293  // SQLContainerCreateUpdateProperties properties to create and update Azure Cosmos DB container.
  6294  type SQLContainerCreateUpdateProperties struct {
  6295  	// Resource - The standard JSON format of a container
  6296  	Resource *SQLContainerResource `json:"resource,omitempty"`
  6297  	// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
  6298  	Options *CreateUpdateOptions `json:"options,omitempty"`
  6299  }
  6300  
  6301  // SQLContainerGetProperties the properties of an Azure Cosmos DB container
  6302  type SQLContainerGetProperties struct {
  6303  	Resource *SQLContainerGetPropertiesResource `json:"resource,omitempty"`
  6304  	Options  *SQLContainerGetPropertiesOptions  `json:"options,omitempty"`
  6305  }
  6306  
  6307  // SQLContainerGetPropertiesOptions ...
  6308  type SQLContainerGetPropertiesOptions struct {
  6309  	// Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details.
  6310  	Throughput *int32 `json:"throughput,omitempty"`
  6311  	// AutoscaleSettings - Specifies the Autoscale settings.
  6312  	AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
  6313  }
  6314  
  6315  // SQLContainerGetPropertiesResource ...
  6316  type SQLContainerGetPropertiesResource struct {
  6317  	// ID - Name of the Cosmos DB SQL container
  6318  	ID *string `json:"id,omitempty"`
  6319  	// IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container
  6320  	IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
  6321  	// PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions
  6322  	PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
  6323  	// DefaultTTL - Default time to live
  6324  	DefaultTTL *int32 `json:"defaultTtl,omitempty"`
  6325  	// UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service.
  6326  	UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
  6327  	// ConflictResolutionPolicy - The conflict resolution policy for the container.
  6328  	ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
  6329  	// AnalyticalStorageTTL - Analytical TTL.
  6330  	AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"`
  6331  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  6332  	Rid *string `json:"_rid,omitempty"`
  6333  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  6334  	Ts *float64 `json:"_ts,omitempty"`
  6335  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  6336  	Etag *string `json:"_etag,omitempty"`
  6337  }
  6338  
  6339  // MarshalJSON is the custom marshaler for SQLContainerGetPropertiesResource.
  6340  func (scgp SQLContainerGetPropertiesResource) MarshalJSON() ([]byte, error) {
  6341  	objectMap := make(map[string]interface{})
  6342  	if scgp.ID != nil {
  6343  		objectMap["id"] = scgp.ID
  6344  	}
  6345  	if scgp.IndexingPolicy != nil {
  6346  		objectMap["indexingPolicy"] = scgp.IndexingPolicy
  6347  	}
  6348  	if scgp.PartitionKey != nil {
  6349  		objectMap["partitionKey"] = scgp.PartitionKey
  6350  	}
  6351  	if scgp.DefaultTTL != nil {
  6352  		objectMap["defaultTtl"] = scgp.DefaultTTL
  6353  	}
  6354  	if scgp.UniqueKeyPolicy != nil {
  6355  		objectMap["uniqueKeyPolicy"] = scgp.UniqueKeyPolicy
  6356  	}
  6357  	if scgp.ConflictResolutionPolicy != nil {
  6358  		objectMap["conflictResolutionPolicy"] = scgp.ConflictResolutionPolicy
  6359  	}
  6360  	if scgp.AnalyticalStorageTTL != nil {
  6361  		objectMap["analyticalStorageTtl"] = scgp.AnalyticalStorageTTL
  6362  	}
  6363  	return json.Marshal(objectMap)
  6364  }
  6365  
  6366  // SQLContainerGetResults an Azure Cosmos DB container.
  6367  type SQLContainerGetResults struct {
  6368  	autorest.Response `json:"-"`
  6369  	// SQLContainerGetProperties - The properties of an Azure Cosmos DB container
  6370  	*SQLContainerGetProperties `json:"properties,omitempty"`
  6371  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  6372  	ID *string `json:"id,omitempty"`
  6373  	// Name - READ-ONLY; The name of the ARM resource.
  6374  	Name *string `json:"name,omitempty"`
  6375  	// Type - READ-ONLY; The type of Azure resource.
  6376  	Type *string `json:"type,omitempty"`
  6377  	// Location - The location of the resource group to which the resource belongs.
  6378  	Location *string            `json:"location,omitempty"`
  6379  	Tags     map[string]*string `json:"tags"`
  6380  }
  6381  
  6382  // MarshalJSON is the custom marshaler for SQLContainerGetResults.
  6383  func (scgr SQLContainerGetResults) MarshalJSON() ([]byte, error) {
  6384  	objectMap := make(map[string]interface{})
  6385  	if scgr.SQLContainerGetProperties != nil {
  6386  		objectMap["properties"] = scgr.SQLContainerGetProperties
  6387  	}
  6388  	if scgr.Location != nil {
  6389  		objectMap["location"] = scgr.Location
  6390  	}
  6391  	if scgr.Tags != nil {
  6392  		objectMap["tags"] = scgr.Tags
  6393  	}
  6394  	return json.Marshal(objectMap)
  6395  }
  6396  
  6397  // UnmarshalJSON is the custom unmarshaler for SQLContainerGetResults struct.
  6398  func (scgr *SQLContainerGetResults) UnmarshalJSON(body []byte) error {
  6399  	var m map[string]*json.RawMessage
  6400  	err := json.Unmarshal(body, &m)
  6401  	if err != nil {
  6402  		return err
  6403  	}
  6404  	for k, v := range m {
  6405  		switch k {
  6406  		case "properties":
  6407  			if v != nil {
  6408  				var SQLContainerGetProperties SQLContainerGetProperties
  6409  				err = json.Unmarshal(*v, &SQLContainerGetProperties)
  6410  				if err != nil {
  6411  					return err
  6412  				}
  6413  				scgr.SQLContainerGetProperties = &SQLContainerGetProperties
  6414  			}
  6415  		case "id":
  6416  			if v != nil {
  6417  				var ID string
  6418  				err = json.Unmarshal(*v, &ID)
  6419  				if err != nil {
  6420  					return err
  6421  				}
  6422  				scgr.ID = &ID
  6423  			}
  6424  		case "name":
  6425  			if v != nil {
  6426  				var name string
  6427  				err = json.Unmarshal(*v, &name)
  6428  				if err != nil {
  6429  					return err
  6430  				}
  6431  				scgr.Name = &name
  6432  			}
  6433  		case "type":
  6434  			if v != nil {
  6435  				var typeVar string
  6436  				err = json.Unmarshal(*v, &typeVar)
  6437  				if err != nil {
  6438  					return err
  6439  				}
  6440  				scgr.Type = &typeVar
  6441  			}
  6442  		case "location":
  6443  			if v != nil {
  6444  				var location string
  6445  				err = json.Unmarshal(*v, &location)
  6446  				if err != nil {
  6447  					return err
  6448  				}
  6449  				scgr.Location = &location
  6450  			}
  6451  		case "tags":
  6452  			if v != nil {
  6453  				var tags map[string]*string
  6454  				err = json.Unmarshal(*v, &tags)
  6455  				if err != nil {
  6456  					return err
  6457  				}
  6458  				scgr.Tags = tags
  6459  			}
  6460  		}
  6461  	}
  6462  
  6463  	return nil
  6464  }
  6465  
  6466  // SQLContainerListResult the List operation response, that contains the containers and their properties.
  6467  type SQLContainerListResult struct {
  6468  	autorest.Response `json:"-"`
  6469  	// Value - READ-ONLY; List of containers and their properties.
  6470  	Value *[]SQLContainerGetResults `json:"value,omitempty"`
  6471  }
  6472  
  6473  // MarshalJSON is the custom marshaler for SQLContainerListResult.
  6474  func (sclr SQLContainerListResult) MarshalJSON() ([]byte, error) {
  6475  	objectMap := make(map[string]interface{})
  6476  	return json.Marshal(objectMap)
  6477  }
  6478  
  6479  // SQLContainerResource cosmos DB SQL container resource object
  6480  type SQLContainerResource struct {
  6481  	// ID - Name of the Cosmos DB SQL container
  6482  	ID *string `json:"id,omitempty"`
  6483  	// IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container
  6484  	IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
  6485  	// PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions
  6486  	PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
  6487  	// DefaultTTL - Default time to live
  6488  	DefaultTTL *int32 `json:"defaultTtl,omitempty"`
  6489  	// UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service.
  6490  	UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
  6491  	// ConflictResolutionPolicy - The conflict resolution policy for the container.
  6492  	ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
  6493  	// AnalyticalStorageTTL - Analytical TTL.
  6494  	AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"`
  6495  }
  6496  
  6497  // SQLDatabaseCreateUpdateParameters parameters to create and update Cosmos DB SQL database.
  6498  type SQLDatabaseCreateUpdateParameters struct {
  6499  	// SQLDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB SQL database.
  6500  	*SQLDatabaseCreateUpdateProperties `json:"properties,omitempty"`
  6501  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  6502  	ID *string `json:"id,omitempty"`
  6503  	// Name - READ-ONLY; The name of the ARM resource.
  6504  	Name *string `json:"name,omitempty"`
  6505  	// Type - READ-ONLY; The type of Azure resource.
  6506  	Type *string `json:"type,omitempty"`
  6507  	// Location - The location of the resource group to which the resource belongs.
  6508  	Location *string            `json:"location,omitempty"`
  6509  	Tags     map[string]*string `json:"tags"`
  6510  }
  6511  
  6512  // MarshalJSON is the custom marshaler for SQLDatabaseCreateUpdateParameters.
  6513  func (sdcup SQLDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) {
  6514  	objectMap := make(map[string]interface{})
  6515  	if sdcup.SQLDatabaseCreateUpdateProperties != nil {
  6516  		objectMap["properties"] = sdcup.SQLDatabaseCreateUpdateProperties
  6517  	}
  6518  	if sdcup.Location != nil {
  6519  		objectMap["location"] = sdcup.Location
  6520  	}
  6521  	if sdcup.Tags != nil {
  6522  		objectMap["tags"] = sdcup.Tags
  6523  	}
  6524  	return json.Marshal(objectMap)
  6525  }
  6526  
  6527  // UnmarshalJSON is the custom unmarshaler for SQLDatabaseCreateUpdateParameters struct.
  6528  func (sdcup *SQLDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error {
  6529  	var m map[string]*json.RawMessage
  6530  	err := json.Unmarshal(body, &m)
  6531  	if err != nil {
  6532  		return err
  6533  	}
  6534  	for k, v := range m {
  6535  		switch k {
  6536  		case "properties":
  6537  			if v != nil {
  6538  				var SQLDatabaseCreateUpdateProperties SQLDatabaseCreateUpdateProperties
  6539  				err = json.Unmarshal(*v, &SQLDatabaseCreateUpdateProperties)
  6540  				if err != nil {
  6541  					return err
  6542  				}
  6543  				sdcup.SQLDatabaseCreateUpdateProperties = &SQLDatabaseCreateUpdateProperties
  6544  			}
  6545  		case "id":
  6546  			if v != nil {
  6547  				var ID string
  6548  				err = json.Unmarshal(*v, &ID)
  6549  				if err != nil {
  6550  					return err
  6551  				}
  6552  				sdcup.ID = &ID
  6553  			}
  6554  		case "name":
  6555  			if v != nil {
  6556  				var name string
  6557  				err = json.Unmarshal(*v, &name)
  6558  				if err != nil {
  6559  					return err
  6560  				}
  6561  				sdcup.Name = &name
  6562  			}
  6563  		case "type":
  6564  			if v != nil {
  6565  				var typeVar string
  6566  				err = json.Unmarshal(*v, &typeVar)
  6567  				if err != nil {
  6568  					return err
  6569  				}
  6570  				sdcup.Type = &typeVar
  6571  			}
  6572  		case "location":
  6573  			if v != nil {
  6574  				var location string
  6575  				err = json.Unmarshal(*v, &location)
  6576  				if err != nil {
  6577  					return err
  6578  				}
  6579  				sdcup.Location = &location
  6580  			}
  6581  		case "tags":
  6582  			if v != nil {
  6583  				var tags map[string]*string
  6584  				err = json.Unmarshal(*v, &tags)
  6585  				if err != nil {
  6586  					return err
  6587  				}
  6588  				sdcup.Tags = tags
  6589  			}
  6590  		}
  6591  	}
  6592  
  6593  	return nil
  6594  }
  6595  
  6596  // SQLDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB SQL database.
  6597  type SQLDatabaseCreateUpdateProperties struct {
  6598  	// Resource - The standard JSON format of a SQL database
  6599  	Resource *SQLDatabaseResource `json:"resource,omitempty"`
  6600  	// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
  6601  	Options *CreateUpdateOptions `json:"options,omitempty"`
  6602  }
  6603  
  6604  // SQLDatabaseGetProperties the properties of an Azure Cosmos DB SQL database
  6605  type SQLDatabaseGetProperties struct {
  6606  	Resource *SQLDatabaseGetPropertiesResource `json:"resource,omitempty"`
  6607  	Options  *SQLDatabaseGetPropertiesOptions  `json:"options,omitempty"`
  6608  }
  6609  
  6610  // SQLDatabaseGetPropertiesOptions ...
  6611  type SQLDatabaseGetPropertiesOptions struct {
  6612  	// Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details.
  6613  	Throughput *int32 `json:"throughput,omitempty"`
  6614  	// AutoscaleSettings - Specifies the Autoscale settings.
  6615  	AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
  6616  }
  6617  
  6618  // SQLDatabaseGetPropertiesResource ...
  6619  type SQLDatabaseGetPropertiesResource struct {
  6620  	// ID - Name of the Cosmos DB SQL database
  6621  	ID *string `json:"id,omitempty"`
  6622  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  6623  	Rid *string `json:"_rid,omitempty"`
  6624  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  6625  	Ts *float64 `json:"_ts,omitempty"`
  6626  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  6627  	Etag *string `json:"_etag,omitempty"`
  6628  	// Colls - A system generated property that specified the addressable path of the collections resource.
  6629  	Colls *string `json:"_colls,omitempty"`
  6630  	// Users - A system generated property that specifies the addressable path of the users resource.
  6631  	Users *string `json:"_users,omitempty"`
  6632  }
  6633  
  6634  // MarshalJSON is the custom marshaler for SQLDatabaseGetPropertiesResource.
  6635  func (sdgp SQLDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) {
  6636  	objectMap := make(map[string]interface{})
  6637  	if sdgp.ID != nil {
  6638  		objectMap["id"] = sdgp.ID
  6639  	}
  6640  	if sdgp.Colls != nil {
  6641  		objectMap["_colls"] = sdgp.Colls
  6642  	}
  6643  	if sdgp.Users != nil {
  6644  		objectMap["_users"] = sdgp.Users
  6645  	}
  6646  	return json.Marshal(objectMap)
  6647  }
  6648  
  6649  // SQLDatabaseGetResults an Azure Cosmos DB SQL database.
  6650  type SQLDatabaseGetResults struct {
  6651  	autorest.Response `json:"-"`
  6652  	// SQLDatabaseGetProperties - The properties of an Azure Cosmos DB SQL database
  6653  	*SQLDatabaseGetProperties `json:"properties,omitempty"`
  6654  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  6655  	ID *string `json:"id,omitempty"`
  6656  	// Name - READ-ONLY; The name of the ARM resource.
  6657  	Name *string `json:"name,omitempty"`
  6658  	// Type - READ-ONLY; The type of Azure resource.
  6659  	Type *string `json:"type,omitempty"`
  6660  	// Location - The location of the resource group to which the resource belongs.
  6661  	Location *string            `json:"location,omitempty"`
  6662  	Tags     map[string]*string `json:"tags"`
  6663  }
  6664  
  6665  // MarshalJSON is the custom marshaler for SQLDatabaseGetResults.
  6666  func (sdgr SQLDatabaseGetResults) MarshalJSON() ([]byte, error) {
  6667  	objectMap := make(map[string]interface{})
  6668  	if sdgr.SQLDatabaseGetProperties != nil {
  6669  		objectMap["properties"] = sdgr.SQLDatabaseGetProperties
  6670  	}
  6671  	if sdgr.Location != nil {
  6672  		objectMap["location"] = sdgr.Location
  6673  	}
  6674  	if sdgr.Tags != nil {
  6675  		objectMap["tags"] = sdgr.Tags
  6676  	}
  6677  	return json.Marshal(objectMap)
  6678  }
  6679  
  6680  // UnmarshalJSON is the custom unmarshaler for SQLDatabaseGetResults struct.
  6681  func (sdgr *SQLDatabaseGetResults) UnmarshalJSON(body []byte) error {
  6682  	var m map[string]*json.RawMessage
  6683  	err := json.Unmarshal(body, &m)
  6684  	if err != nil {
  6685  		return err
  6686  	}
  6687  	for k, v := range m {
  6688  		switch k {
  6689  		case "properties":
  6690  			if v != nil {
  6691  				var SQLDatabaseGetProperties SQLDatabaseGetProperties
  6692  				err = json.Unmarshal(*v, &SQLDatabaseGetProperties)
  6693  				if err != nil {
  6694  					return err
  6695  				}
  6696  				sdgr.SQLDatabaseGetProperties = &SQLDatabaseGetProperties
  6697  			}
  6698  		case "id":
  6699  			if v != nil {
  6700  				var ID string
  6701  				err = json.Unmarshal(*v, &ID)
  6702  				if err != nil {
  6703  					return err
  6704  				}
  6705  				sdgr.ID = &ID
  6706  			}
  6707  		case "name":
  6708  			if v != nil {
  6709  				var name string
  6710  				err = json.Unmarshal(*v, &name)
  6711  				if err != nil {
  6712  					return err
  6713  				}
  6714  				sdgr.Name = &name
  6715  			}
  6716  		case "type":
  6717  			if v != nil {
  6718  				var typeVar string
  6719  				err = json.Unmarshal(*v, &typeVar)
  6720  				if err != nil {
  6721  					return err
  6722  				}
  6723  				sdgr.Type = &typeVar
  6724  			}
  6725  		case "location":
  6726  			if v != nil {
  6727  				var location string
  6728  				err = json.Unmarshal(*v, &location)
  6729  				if err != nil {
  6730  					return err
  6731  				}
  6732  				sdgr.Location = &location
  6733  			}
  6734  		case "tags":
  6735  			if v != nil {
  6736  				var tags map[string]*string
  6737  				err = json.Unmarshal(*v, &tags)
  6738  				if err != nil {
  6739  					return err
  6740  				}
  6741  				sdgr.Tags = tags
  6742  			}
  6743  		}
  6744  	}
  6745  
  6746  	return nil
  6747  }
  6748  
  6749  // SQLDatabaseListResult the List operation response, that contains the SQL databases and their properties.
  6750  type SQLDatabaseListResult struct {
  6751  	autorest.Response `json:"-"`
  6752  	// Value - READ-ONLY; List of SQL databases and their properties.
  6753  	Value *[]SQLDatabaseGetResults `json:"value,omitempty"`
  6754  }
  6755  
  6756  // MarshalJSON is the custom marshaler for SQLDatabaseListResult.
  6757  func (sdlr SQLDatabaseListResult) MarshalJSON() ([]byte, error) {
  6758  	objectMap := make(map[string]interface{})
  6759  	return json.Marshal(objectMap)
  6760  }
  6761  
  6762  // SQLDatabaseResource cosmos DB SQL database resource object
  6763  type SQLDatabaseResource struct {
  6764  	// ID - Name of the Cosmos DB SQL database
  6765  	ID *string `json:"id,omitempty"`
  6766  }
  6767  
  6768  // SQLResourcesCreateUpdateSQLContainerFuture an abstraction for monitoring and retrieving the results of a
  6769  // long-running operation.
  6770  type SQLResourcesCreateUpdateSQLContainerFuture struct {
  6771  	azure.FutureAPI
  6772  	// Result returns the result of the asynchronous operation.
  6773  	// If the operation has not completed it will return an error.
  6774  	Result func(SQLResourcesClient) (SQLContainerGetResults, error)
  6775  }
  6776  
  6777  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  6778  func (future *SQLResourcesCreateUpdateSQLContainerFuture) UnmarshalJSON(body []byte) error {
  6779  	var azFuture azure.Future
  6780  	if err := json.Unmarshal(body, &azFuture); err != nil {
  6781  		return err
  6782  	}
  6783  	future.FutureAPI = &azFuture
  6784  	future.Result = future.result
  6785  	return nil
  6786  }
  6787  
  6788  // result is the default implementation for SQLResourcesCreateUpdateSQLContainerFuture.Result.
  6789  func (future *SQLResourcesCreateUpdateSQLContainerFuture) result(client SQLResourcesClient) (scgr SQLContainerGetResults, err error) {
  6790  	var done bool
  6791  	done, err = future.DoneWithContext(context.Background(), client)
  6792  	if err != nil {
  6793  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", future.Response(), "Polling failure")
  6794  		return
  6795  	}
  6796  	if !done {
  6797  		scgr.Response.Response = future.Response()
  6798  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLContainerFuture")
  6799  		return
  6800  	}
  6801  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  6802  	if scgr.Response.Response, err = future.GetResult(sender); err == nil && scgr.Response.Response.StatusCode != http.StatusNoContent {
  6803  		scgr, err = client.CreateUpdateSQLContainerResponder(scgr.Response.Response)
  6804  		if err != nil {
  6805  			err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", scgr.Response.Response, "Failure responding to request")
  6806  		}
  6807  	}
  6808  	return
  6809  }
  6810  
  6811  // SQLResourcesCreateUpdateSQLDatabaseFuture an abstraction for monitoring and retrieving the results of a
  6812  // long-running operation.
  6813  type SQLResourcesCreateUpdateSQLDatabaseFuture struct {
  6814  	azure.FutureAPI
  6815  	// Result returns the result of the asynchronous operation.
  6816  	// If the operation has not completed it will return an error.
  6817  	Result func(SQLResourcesClient) (SQLDatabaseGetResults, error)
  6818  }
  6819  
  6820  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  6821  func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) UnmarshalJSON(body []byte) error {
  6822  	var azFuture azure.Future
  6823  	if err := json.Unmarshal(body, &azFuture); err != nil {
  6824  		return err
  6825  	}
  6826  	future.FutureAPI = &azFuture
  6827  	future.Result = future.result
  6828  	return nil
  6829  }
  6830  
  6831  // result is the default implementation for SQLResourcesCreateUpdateSQLDatabaseFuture.Result.
  6832  func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) result(client SQLResourcesClient) (sdgr SQLDatabaseGetResults, err error) {
  6833  	var done bool
  6834  	done, err = future.DoneWithContext(context.Background(), client)
  6835  	if err != nil {
  6836  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", future.Response(), "Polling failure")
  6837  		return
  6838  	}
  6839  	if !done {
  6840  		sdgr.Response.Response = future.Response()
  6841  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture")
  6842  		return
  6843  	}
  6844  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  6845  	if sdgr.Response.Response, err = future.GetResult(sender); err == nil && sdgr.Response.Response.StatusCode != http.StatusNoContent {
  6846  		sdgr, err = client.CreateUpdateSQLDatabaseResponder(sdgr.Response.Response)
  6847  		if err != nil {
  6848  			err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", sdgr.Response.Response, "Failure responding to request")
  6849  		}
  6850  	}
  6851  	return
  6852  }
  6853  
  6854  // SQLResourcesCreateUpdateSQLStoredProcedureFuture an abstraction for monitoring and retrieving the
  6855  // results of a long-running operation.
  6856  type SQLResourcesCreateUpdateSQLStoredProcedureFuture struct {
  6857  	azure.FutureAPI
  6858  	// Result returns the result of the asynchronous operation.
  6859  	// If the operation has not completed it will return an error.
  6860  	Result func(SQLResourcesClient) (SQLStoredProcedureGetResults, error)
  6861  }
  6862  
  6863  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  6864  func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error {
  6865  	var azFuture azure.Future
  6866  	if err := json.Unmarshal(body, &azFuture); err != nil {
  6867  		return err
  6868  	}
  6869  	future.FutureAPI = &azFuture
  6870  	future.Result = future.result
  6871  	return nil
  6872  }
  6873  
  6874  // result is the default implementation for SQLResourcesCreateUpdateSQLStoredProcedureFuture.Result.
  6875  func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) result(client SQLResourcesClient) (sspgr SQLStoredProcedureGetResults, err error) {
  6876  	var done bool
  6877  	done, err = future.DoneWithContext(context.Background(), client)
  6878  	if err != nil {
  6879  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure")
  6880  		return
  6881  	}
  6882  	if !done {
  6883  		sspgr.Response.Response = future.Response()
  6884  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture")
  6885  		return
  6886  	}
  6887  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  6888  	if sspgr.Response.Response, err = future.GetResult(sender); err == nil && sspgr.Response.Response.StatusCode != http.StatusNoContent {
  6889  		sspgr, err = client.CreateUpdateSQLStoredProcedureResponder(sspgr.Response.Response)
  6890  		if err != nil {
  6891  			err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", sspgr.Response.Response, "Failure responding to request")
  6892  		}
  6893  	}
  6894  	return
  6895  }
  6896  
  6897  // SQLResourcesCreateUpdateSQLTriggerFuture an abstraction for monitoring and retrieving the results of a
  6898  // long-running operation.
  6899  type SQLResourcesCreateUpdateSQLTriggerFuture struct {
  6900  	azure.FutureAPI
  6901  	// Result returns the result of the asynchronous operation.
  6902  	// If the operation has not completed it will return an error.
  6903  	Result func(SQLResourcesClient) (SQLTriggerGetResults, error)
  6904  }
  6905  
  6906  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  6907  func (future *SQLResourcesCreateUpdateSQLTriggerFuture) UnmarshalJSON(body []byte) error {
  6908  	var azFuture azure.Future
  6909  	if err := json.Unmarshal(body, &azFuture); err != nil {
  6910  		return err
  6911  	}
  6912  	future.FutureAPI = &azFuture
  6913  	future.Result = future.result
  6914  	return nil
  6915  }
  6916  
  6917  // result is the default implementation for SQLResourcesCreateUpdateSQLTriggerFuture.Result.
  6918  func (future *SQLResourcesCreateUpdateSQLTriggerFuture) result(client SQLResourcesClient) (stgr SQLTriggerGetResults, err error) {
  6919  	var done bool
  6920  	done, err = future.DoneWithContext(context.Background(), client)
  6921  	if err != nil {
  6922  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", future.Response(), "Polling failure")
  6923  		return
  6924  	}
  6925  	if !done {
  6926  		stgr.Response.Response = future.Response()
  6927  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLTriggerFuture")
  6928  		return
  6929  	}
  6930  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  6931  	if stgr.Response.Response, err = future.GetResult(sender); err == nil && stgr.Response.Response.StatusCode != http.StatusNoContent {
  6932  		stgr, err = client.CreateUpdateSQLTriggerResponder(stgr.Response.Response)
  6933  		if err != nil {
  6934  			err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", stgr.Response.Response, "Failure responding to request")
  6935  		}
  6936  	}
  6937  	return
  6938  }
  6939  
  6940  // SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture an abstraction for monitoring and retrieving the
  6941  // results of a long-running operation.
  6942  type SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture struct {
  6943  	azure.FutureAPI
  6944  	// Result returns the result of the asynchronous operation.
  6945  	// If the operation has not completed it will return an error.
  6946  	Result func(SQLResourcesClient) (SQLUserDefinedFunctionGetResults, error)
  6947  }
  6948  
  6949  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  6950  func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error {
  6951  	var azFuture azure.Future
  6952  	if err := json.Unmarshal(body, &azFuture); err != nil {
  6953  		return err
  6954  	}
  6955  	future.FutureAPI = &azFuture
  6956  	future.Result = future.result
  6957  	return nil
  6958  }
  6959  
  6960  // result is the default implementation for SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture.Result.
  6961  func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (sudfgr SQLUserDefinedFunctionGetResults, err error) {
  6962  	var done bool
  6963  	done, err = future.DoneWithContext(context.Background(), client)
  6964  	if err != nil {
  6965  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure")
  6966  		return
  6967  	}
  6968  	if !done {
  6969  		sudfgr.Response.Response = future.Response()
  6970  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture")
  6971  		return
  6972  	}
  6973  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  6974  	if sudfgr.Response.Response, err = future.GetResult(sender); err == nil && sudfgr.Response.Response.StatusCode != http.StatusNoContent {
  6975  		sudfgr, err = client.CreateUpdateSQLUserDefinedFunctionResponder(sudfgr.Response.Response)
  6976  		if err != nil {
  6977  			err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", sudfgr.Response.Response, "Failure responding to request")
  6978  		}
  6979  	}
  6980  	return
  6981  }
  6982  
  6983  // SQLResourcesDeleteSQLContainerFuture an abstraction for monitoring and retrieving the results of a
  6984  // long-running operation.
  6985  type SQLResourcesDeleteSQLContainerFuture struct {
  6986  	azure.FutureAPI
  6987  	// Result returns the result of the asynchronous operation.
  6988  	// If the operation has not completed it will return an error.
  6989  	Result func(SQLResourcesClient) (autorest.Response, error)
  6990  }
  6991  
  6992  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  6993  func (future *SQLResourcesDeleteSQLContainerFuture) UnmarshalJSON(body []byte) error {
  6994  	var azFuture azure.Future
  6995  	if err := json.Unmarshal(body, &azFuture); err != nil {
  6996  		return err
  6997  	}
  6998  	future.FutureAPI = &azFuture
  6999  	future.Result = future.result
  7000  	return nil
  7001  }
  7002  
  7003  // result is the default implementation for SQLResourcesDeleteSQLContainerFuture.Result.
  7004  func (future *SQLResourcesDeleteSQLContainerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
  7005  	var done bool
  7006  	done, err = future.DoneWithContext(context.Background(), client)
  7007  	if err != nil {
  7008  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLContainerFuture", "Result", future.Response(), "Polling failure")
  7009  		return
  7010  	}
  7011  	if !done {
  7012  		ar.Response = future.Response()
  7013  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLContainerFuture")
  7014  		return
  7015  	}
  7016  	ar.Response = future.Response()
  7017  	return
  7018  }
  7019  
  7020  // SQLResourcesDeleteSQLDatabaseFuture an abstraction for monitoring and retrieving the results of a
  7021  // long-running operation.
  7022  type SQLResourcesDeleteSQLDatabaseFuture struct {
  7023  	azure.FutureAPI
  7024  	// Result returns the result of the asynchronous operation.
  7025  	// If the operation has not completed it will return an error.
  7026  	Result func(SQLResourcesClient) (autorest.Response, error)
  7027  }
  7028  
  7029  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7030  func (future *SQLResourcesDeleteSQLDatabaseFuture) UnmarshalJSON(body []byte) error {
  7031  	var azFuture azure.Future
  7032  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7033  		return err
  7034  	}
  7035  	future.FutureAPI = &azFuture
  7036  	future.Result = future.result
  7037  	return nil
  7038  }
  7039  
  7040  // result is the default implementation for SQLResourcesDeleteSQLDatabaseFuture.Result.
  7041  func (future *SQLResourcesDeleteSQLDatabaseFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
  7042  	var done bool
  7043  	done, err = future.DoneWithContext(context.Background(), client)
  7044  	if err != nil {
  7045  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLDatabaseFuture", "Result", future.Response(), "Polling failure")
  7046  		return
  7047  	}
  7048  	if !done {
  7049  		ar.Response = future.Response()
  7050  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLDatabaseFuture")
  7051  		return
  7052  	}
  7053  	ar.Response = future.Response()
  7054  	return
  7055  }
  7056  
  7057  // SQLResourcesDeleteSQLStoredProcedureFuture an abstraction for monitoring and retrieving the results of a
  7058  // long-running operation.
  7059  type SQLResourcesDeleteSQLStoredProcedureFuture struct {
  7060  	azure.FutureAPI
  7061  	// Result returns the result of the asynchronous operation.
  7062  	// If the operation has not completed it will return an error.
  7063  	Result func(SQLResourcesClient) (autorest.Response, error)
  7064  }
  7065  
  7066  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7067  func (future *SQLResourcesDeleteSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error {
  7068  	var azFuture azure.Future
  7069  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7070  		return err
  7071  	}
  7072  	future.FutureAPI = &azFuture
  7073  	future.Result = future.result
  7074  	return nil
  7075  }
  7076  
  7077  // result is the default implementation for SQLResourcesDeleteSQLStoredProcedureFuture.Result.
  7078  func (future *SQLResourcesDeleteSQLStoredProcedureFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
  7079  	var done bool
  7080  	done, err = future.DoneWithContext(context.Background(), client)
  7081  	if err != nil {
  7082  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure")
  7083  		return
  7084  	}
  7085  	if !done {
  7086  		ar.Response = future.Response()
  7087  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLStoredProcedureFuture")
  7088  		return
  7089  	}
  7090  	ar.Response = future.Response()
  7091  	return
  7092  }
  7093  
  7094  // SQLResourcesDeleteSQLTriggerFuture an abstraction for monitoring and retrieving the results of a
  7095  // long-running operation.
  7096  type SQLResourcesDeleteSQLTriggerFuture struct {
  7097  	azure.FutureAPI
  7098  	// Result returns the result of the asynchronous operation.
  7099  	// If the operation has not completed it will return an error.
  7100  	Result func(SQLResourcesClient) (autorest.Response, error)
  7101  }
  7102  
  7103  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7104  func (future *SQLResourcesDeleteSQLTriggerFuture) UnmarshalJSON(body []byte) error {
  7105  	var azFuture azure.Future
  7106  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7107  		return err
  7108  	}
  7109  	future.FutureAPI = &azFuture
  7110  	future.Result = future.result
  7111  	return nil
  7112  }
  7113  
  7114  // result is the default implementation for SQLResourcesDeleteSQLTriggerFuture.Result.
  7115  func (future *SQLResourcesDeleteSQLTriggerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
  7116  	var done bool
  7117  	done, err = future.DoneWithContext(context.Background(), client)
  7118  	if err != nil {
  7119  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLTriggerFuture", "Result", future.Response(), "Polling failure")
  7120  		return
  7121  	}
  7122  	if !done {
  7123  		ar.Response = future.Response()
  7124  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLTriggerFuture")
  7125  		return
  7126  	}
  7127  	ar.Response = future.Response()
  7128  	return
  7129  }
  7130  
  7131  // SQLResourcesDeleteSQLUserDefinedFunctionFuture an abstraction for monitoring and retrieving the results
  7132  // of a long-running operation.
  7133  type SQLResourcesDeleteSQLUserDefinedFunctionFuture struct {
  7134  	azure.FutureAPI
  7135  	// Result returns the result of the asynchronous operation.
  7136  	// If the operation has not completed it will return an error.
  7137  	Result func(SQLResourcesClient) (autorest.Response, error)
  7138  }
  7139  
  7140  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7141  func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error {
  7142  	var azFuture azure.Future
  7143  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7144  		return err
  7145  	}
  7146  	future.FutureAPI = &azFuture
  7147  	future.Result = future.result
  7148  	return nil
  7149  }
  7150  
  7151  // result is the default implementation for SQLResourcesDeleteSQLUserDefinedFunctionFuture.Result.
  7152  func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
  7153  	var done bool
  7154  	done, err = future.DoneWithContext(context.Background(), client)
  7155  	if err != nil {
  7156  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure")
  7157  		return
  7158  	}
  7159  	if !done {
  7160  		ar.Response = future.Response()
  7161  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture")
  7162  		return
  7163  	}
  7164  	ar.Response = future.Response()
  7165  	return
  7166  }
  7167  
  7168  // SQLResourcesMigrateSQLContainerToAutoscaleFuture an abstraction for monitoring and retrieving the
  7169  // results of a long-running operation.
  7170  type SQLResourcesMigrateSQLContainerToAutoscaleFuture struct {
  7171  	azure.FutureAPI
  7172  	// Result returns the result of the asynchronous operation.
  7173  	// If the operation has not completed it will return an error.
  7174  	Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
  7175  }
  7176  
  7177  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7178  func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) UnmarshalJSON(body []byte) error {
  7179  	var azFuture azure.Future
  7180  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7181  		return err
  7182  	}
  7183  	future.FutureAPI = &azFuture
  7184  	future.Result = future.result
  7185  	return nil
  7186  }
  7187  
  7188  // result is the default implementation for SQLResourcesMigrateSQLContainerToAutoscaleFuture.Result.
  7189  func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  7190  	var done bool
  7191  	done, err = future.DoneWithContext(context.Background(), client)
  7192  	if err != nil {
  7193  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", future.Response(), "Polling failure")
  7194  		return
  7195  	}
  7196  	if !done {
  7197  		tsgr.Response.Response = future.Response()
  7198  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture")
  7199  		return
  7200  	}
  7201  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  7202  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  7203  		tsgr, err = client.MigrateSQLContainerToAutoscaleResponder(tsgr.Response.Response)
  7204  		if err != nil {
  7205  			err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  7206  		}
  7207  	}
  7208  	return
  7209  }
  7210  
  7211  // SQLResourcesMigrateSQLContainerToManualThroughputFuture an abstraction for monitoring and retrieving the
  7212  // results of a long-running operation.
  7213  type SQLResourcesMigrateSQLContainerToManualThroughputFuture struct {
  7214  	azure.FutureAPI
  7215  	// Result returns the result of the asynchronous operation.
  7216  	// If the operation has not completed it will return an error.
  7217  	Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
  7218  }
  7219  
  7220  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7221  func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) UnmarshalJSON(body []byte) error {
  7222  	var azFuture azure.Future
  7223  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7224  		return err
  7225  	}
  7226  	future.FutureAPI = &azFuture
  7227  	future.Result = future.result
  7228  	return nil
  7229  }
  7230  
  7231  // result is the default implementation for SQLResourcesMigrateSQLContainerToManualThroughputFuture.Result.
  7232  func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  7233  	var done bool
  7234  	done, err = future.DoneWithContext(context.Background(), client)
  7235  	if err != nil {
  7236  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", future.Response(), "Polling failure")
  7237  		return
  7238  	}
  7239  	if !done {
  7240  		tsgr.Response.Response = future.Response()
  7241  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture")
  7242  		return
  7243  	}
  7244  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  7245  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  7246  		tsgr, err = client.MigrateSQLContainerToManualThroughputResponder(tsgr.Response.Response)
  7247  		if err != nil {
  7248  			err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  7249  		}
  7250  	}
  7251  	return
  7252  }
  7253  
  7254  // SQLResourcesMigrateSQLDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the results
  7255  // of a long-running operation.
  7256  type SQLResourcesMigrateSQLDatabaseToAutoscaleFuture struct {
  7257  	azure.FutureAPI
  7258  	// Result returns the result of the asynchronous operation.
  7259  	// If the operation has not completed it will return an error.
  7260  	Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
  7261  }
  7262  
  7263  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7264  func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error {
  7265  	var azFuture azure.Future
  7266  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7267  		return err
  7268  	}
  7269  	future.FutureAPI = &azFuture
  7270  	future.Result = future.result
  7271  	return nil
  7272  }
  7273  
  7274  // result is the default implementation for SQLResourcesMigrateSQLDatabaseToAutoscaleFuture.Result.
  7275  func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  7276  	var done bool
  7277  	done, err = future.DoneWithContext(context.Background(), client)
  7278  	if err != nil {
  7279  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure")
  7280  		return
  7281  	}
  7282  	if !done {
  7283  		tsgr.Response.Response = future.Response()
  7284  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture")
  7285  		return
  7286  	}
  7287  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  7288  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  7289  		tsgr, err = client.MigrateSQLDatabaseToAutoscaleResponder(tsgr.Response.Response)
  7290  		if err != nil {
  7291  			err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  7292  		}
  7293  	}
  7294  	return
  7295  }
  7296  
  7297  // SQLResourcesMigrateSQLDatabaseToManualThroughputFuture an abstraction for monitoring and retrieving the
  7298  // results of a long-running operation.
  7299  type SQLResourcesMigrateSQLDatabaseToManualThroughputFuture struct {
  7300  	azure.FutureAPI
  7301  	// Result returns the result of the asynchronous operation.
  7302  	// If the operation has not completed it will return an error.
  7303  	Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
  7304  }
  7305  
  7306  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7307  func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error {
  7308  	var azFuture azure.Future
  7309  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7310  		return err
  7311  	}
  7312  	future.FutureAPI = &azFuture
  7313  	future.Result = future.result
  7314  	return nil
  7315  }
  7316  
  7317  // result is the default implementation for SQLResourcesMigrateSQLDatabaseToManualThroughputFuture.Result.
  7318  func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  7319  	var done bool
  7320  	done, err = future.DoneWithContext(context.Background(), client)
  7321  	if err != nil {
  7322  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure")
  7323  		return
  7324  	}
  7325  	if !done {
  7326  		tsgr.Response.Response = future.Response()
  7327  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture")
  7328  		return
  7329  	}
  7330  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  7331  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  7332  		tsgr, err = client.MigrateSQLDatabaseToManualThroughputResponder(tsgr.Response.Response)
  7333  		if err != nil {
  7334  			err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  7335  		}
  7336  	}
  7337  	return
  7338  }
  7339  
  7340  // SQLResourcesUpdateSQLContainerThroughputFuture an abstraction for monitoring and retrieving the results
  7341  // of a long-running operation.
  7342  type SQLResourcesUpdateSQLContainerThroughputFuture struct {
  7343  	azure.FutureAPI
  7344  	// Result returns the result of the asynchronous operation.
  7345  	// If the operation has not completed it will return an error.
  7346  	Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
  7347  }
  7348  
  7349  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7350  func (future *SQLResourcesUpdateSQLContainerThroughputFuture) UnmarshalJSON(body []byte) error {
  7351  	var azFuture azure.Future
  7352  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7353  		return err
  7354  	}
  7355  	future.FutureAPI = &azFuture
  7356  	future.Result = future.result
  7357  	return nil
  7358  }
  7359  
  7360  // result is the default implementation for SQLResourcesUpdateSQLContainerThroughputFuture.Result.
  7361  func (future *SQLResourcesUpdateSQLContainerThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  7362  	var done bool
  7363  	done, err = future.DoneWithContext(context.Background(), client)
  7364  	if err != nil {
  7365  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", future.Response(), "Polling failure")
  7366  		return
  7367  	}
  7368  	if !done {
  7369  		tsgr.Response.Response = future.Response()
  7370  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLContainerThroughputFuture")
  7371  		return
  7372  	}
  7373  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  7374  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  7375  		tsgr, err = client.UpdateSQLContainerThroughputResponder(tsgr.Response.Response)
  7376  		if err != nil {
  7377  			err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  7378  		}
  7379  	}
  7380  	return
  7381  }
  7382  
  7383  // SQLResourcesUpdateSQLDatabaseThroughputFuture an abstraction for monitoring and retrieving the results
  7384  // of a long-running operation.
  7385  type SQLResourcesUpdateSQLDatabaseThroughputFuture struct {
  7386  	azure.FutureAPI
  7387  	// Result returns the result of the asynchronous operation.
  7388  	// If the operation has not completed it will return an error.
  7389  	Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
  7390  }
  7391  
  7392  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  7393  func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) UnmarshalJSON(body []byte) error {
  7394  	var azFuture azure.Future
  7395  	if err := json.Unmarshal(body, &azFuture); err != nil {
  7396  		return err
  7397  	}
  7398  	future.FutureAPI = &azFuture
  7399  	future.Result = future.result
  7400  	return nil
  7401  }
  7402  
  7403  // result is the default implementation for SQLResourcesUpdateSQLDatabaseThroughputFuture.Result.
  7404  func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  7405  	var done bool
  7406  	done, err = future.DoneWithContext(context.Background(), client)
  7407  	if err != nil {
  7408  		err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", future.Response(), "Polling failure")
  7409  		return
  7410  	}
  7411  	if !done {
  7412  		tsgr.Response.Response = future.Response()
  7413  		err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture")
  7414  		return
  7415  	}
  7416  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  7417  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  7418  		tsgr, err = client.UpdateSQLDatabaseThroughputResponder(tsgr.Response.Response)
  7419  		if err != nil {
  7420  			err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  7421  		}
  7422  	}
  7423  	return
  7424  }
  7425  
  7426  // SQLStoredProcedureCreateUpdateParameters parameters to create and update Cosmos DB storedProcedure.
  7427  type SQLStoredProcedureCreateUpdateParameters struct {
  7428  	// SQLStoredProcedureCreateUpdateProperties - Properties to create and update Azure Cosmos DB storedProcedure.
  7429  	*SQLStoredProcedureCreateUpdateProperties `json:"properties,omitempty"`
  7430  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  7431  	ID *string `json:"id,omitempty"`
  7432  	// Name - READ-ONLY; The name of the ARM resource.
  7433  	Name *string `json:"name,omitempty"`
  7434  	// Type - READ-ONLY; The type of Azure resource.
  7435  	Type *string `json:"type,omitempty"`
  7436  	// Location - The location of the resource group to which the resource belongs.
  7437  	Location *string            `json:"location,omitempty"`
  7438  	Tags     map[string]*string `json:"tags"`
  7439  }
  7440  
  7441  // MarshalJSON is the custom marshaler for SQLStoredProcedureCreateUpdateParameters.
  7442  func (sspcup SQLStoredProcedureCreateUpdateParameters) MarshalJSON() ([]byte, error) {
  7443  	objectMap := make(map[string]interface{})
  7444  	if sspcup.SQLStoredProcedureCreateUpdateProperties != nil {
  7445  		objectMap["properties"] = sspcup.SQLStoredProcedureCreateUpdateProperties
  7446  	}
  7447  	if sspcup.Location != nil {
  7448  		objectMap["location"] = sspcup.Location
  7449  	}
  7450  	if sspcup.Tags != nil {
  7451  		objectMap["tags"] = sspcup.Tags
  7452  	}
  7453  	return json.Marshal(objectMap)
  7454  }
  7455  
  7456  // UnmarshalJSON is the custom unmarshaler for SQLStoredProcedureCreateUpdateParameters struct.
  7457  func (sspcup *SQLStoredProcedureCreateUpdateParameters) UnmarshalJSON(body []byte) error {
  7458  	var m map[string]*json.RawMessage
  7459  	err := json.Unmarshal(body, &m)
  7460  	if err != nil {
  7461  		return err
  7462  	}
  7463  	for k, v := range m {
  7464  		switch k {
  7465  		case "properties":
  7466  			if v != nil {
  7467  				var SQLStoredProcedureCreateUpdateProperties SQLStoredProcedureCreateUpdateProperties
  7468  				err = json.Unmarshal(*v, &SQLStoredProcedureCreateUpdateProperties)
  7469  				if err != nil {
  7470  					return err
  7471  				}
  7472  				sspcup.SQLStoredProcedureCreateUpdateProperties = &SQLStoredProcedureCreateUpdateProperties
  7473  			}
  7474  		case "id":
  7475  			if v != nil {
  7476  				var ID string
  7477  				err = json.Unmarshal(*v, &ID)
  7478  				if err != nil {
  7479  					return err
  7480  				}
  7481  				sspcup.ID = &ID
  7482  			}
  7483  		case "name":
  7484  			if v != nil {
  7485  				var name string
  7486  				err = json.Unmarshal(*v, &name)
  7487  				if err != nil {
  7488  					return err
  7489  				}
  7490  				sspcup.Name = &name
  7491  			}
  7492  		case "type":
  7493  			if v != nil {
  7494  				var typeVar string
  7495  				err = json.Unmarshal(*v, &typeVar)
  7496  				if err != nil {
  7497  					return err
  7498  				}
  7499  				sspcup.Type = &typeVar
  7500  			}
  7501  		case "location":
  7502  			if v != nil {
  7503  				var location string
  7504  				err = json.Unmarshal(*v, &location)
  7505  				if err != nil {
  7506  					return err
  7507  				}
  7508  				sspcup.Location = &location
  7509  			}
  7510  		case "tags":
  7511  			if v != nil {
  7512  				var tags map[string]*string
  7513  				err = json.Unmarshal(*v, &tags)
  7514  				if err != nil {
  7515  					return err
  7516  				}
  7517  				sspcup.Tags = tags
  7518  			}
  7519  		}
  7520  	}
  7521  
  7522  	return nil
  7523  }
  7524  
  7525  // SQLStoredProcedureCreateUpdateProperties properties to create and update Azure Cosmos DB
  7526  // storedProcedure.
  7527  type SQLStoredProcedureCreateUpdateProperties struct {
  7528  	// Resource - The standard JSON format of a storedProcedure
  7529  	Resource *SQLStoredProcedureResource `json:"resource,omitempty"`
  7530  	// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
  7531  	Options *CreateUpdateOptions `json:"options,omitempty"`
  7532  }
  7533  
  7534  // SQLStoredProcedureGetProperties the properties of an Azure Cosmos DB StoredProcedure
  7535  type SQLStoredProcedureGetProperties struct {
  7536  	Resource *SQLStoredProcedureGetPropertiesResource `json:"resource,omitempty"`
  7537  }
  7538  
  7539  // SQLStoredProcedureGetPropertiesResource ...
  7540  type SQLStoredProcedureGetPropertiesResource struct {
  7541  	// ID - Name of the Cosmos DB SQL storedProcedure
  7542  	ID *string `json:"id,omitempty"`
  7543  	// Body - Body of the Stored Procedure
  7544  	Body *string `json:"body,omitempty"`
  7545  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  7546  	Rid *string `json:"_rid,omitempty"`
  7547  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  7548  	Ts *float64 `json:"_ts,omitempty"`
  7549  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  7550  	Etag *string `json:"_etag,omitempty"`
  7551  }
  7552  
  7553  // MarshalJSON is the custom marshaler for SQLStoredProcedureGetPropertiesResource.
  7554  func (sspgp SQLStoredProcedureGetPropertiesResource) MarshalJSON() ([]byte, error) {
  7555  	objectMap := make(map[string]interface{})
  7556  	if sspgp.ID != nil {
  7557  		objectMap["id"] = sspgp.ID
  7558  	}
  7559  	if sspgp.Body != nil {
  7560  		objectMap["body"] = sspgp.Body
  7561  	}
  7562  	return json.Marshal(objectMap)
  7563  }
  7564  
  7565  // SQLStoredProcedureGetResults an Azure Cosmos DB storedProcedure.
  7566  type SQLStoredProcedureGetResults struct {
  7567  	autorest.Response `json:"-"`
  7568  	// SQLStoredProcedureGetProperties - The properties of an Azure Cosmos DB storedProcedure
  7569  	*SQLStoredProcedureGetProperties `json:"properties,omitempty"`
  7570  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  7571  	ID *string `json:"id,omitempty"`
  7572  	// Name - READ-ONLY; The name of the ARM resource.
  7573  	Name *string `json:"name,omitempty"`
  7574  	// Type - READ-ONLY; The type of Azure resource.
  7575  	Type *string `json:"type,omitempty"`
  7576  	// Location - The location of the resource group to which the resource belongs.
  7577  	Location *string            `json:"location,omitempty"`
  7578  	Tags     map[string]*string `json:"tags"`
  7579  }
  7580  
  7581  // MarshalJSON is the custom marshaler for SQLStoredProcedureGetResults.
  7582  func (sspgr SQLStoredProcedureGetResults) MarshalJSON() ([]byte, error) {
  7583  	objectMap := make(map[string]interface{})
  7584  	if sspgr.SQLStoredProcedureGetProperties != nil {
  7585  		objectMap["properties"] = sspgr.SQLStoredProcedureGetProperties
  7586  	}
  7587  	if sspgr.Location != nil {
  7588  		objectMap["location"] = sspgr.Location
  7589  	}
  7590  	if sspgr.Tags != nil {
  7591  		objectMap["tags"] = sspgr.Tags
  7592  	}
  7593  	return json.Marshal(objectMap)
  7594  }
  7595  
  7596  // UnmarshalJSON is the custom unmarshaler for SQLStoredProcedureGetResults struct.
  7597  func (sspgr *SQLStoredProcedureGetResults) UnmarshalJSON(body []byte) error {
  7598  	var m map[string]*json.RawMessage
  7599  	err := json.Unmarshal(body, &m)
  7600  	if err != nil {
  7601  		return err
  7602  	}
  7603  	for k, v := range m {
  7604  		switch k {
  7605  		case "properties":
  7606  			if v != nil {
  7607  				var SQLStoredProcedureGetProperties SQLStoredProcedureGetProperties
  7608  				err = json.Unmarshal(*v, &SQLStoredProcedureGetProperties)
  7609  				if err != nil {
  7610  					return err
  7611  				}
  7612  				sspgr.SQLStoredProcedureGetProperties = &SQLStoredProcedureGetProperties
  7613  			}
  7614  		case "id":
  7615  			if v != nil {
  7616  				var ID string
  7617  				err = json.Unmarshal(*v, &ID)
  7618  				if err != nil {
  7619  					return err
  7620  				}
  7621  				sspgr.ID = &ID
  7622  			}
  7623  		case "name":
  7624  			if v != nil {
  7625  				var name string
  7626  				err = json.Unmarshal(*v, &name)
  7627  				if err != nil {
  7628  					return err
  7629  				}
  7630  				sspgr.Name = &name
  7631  			}
  7632  		case "type":
  7633  			if v != nil {
  7634  				var typeVar string
  7635  				err = json.Unmarshal(*v, &typeVar)
  7636  				if err != nil {
  7637  					return err
  7638  				}
  7639  				sspgr.Type = &typeVar
  7640  			}
  7641  		case "location":
  7642  			if v != nil {
  7643  				var location string
  7644  				err = json.Unmarshal(*v, &location)
  7645  				if err != nil {
  7646  					return err
  7647  				}
  7648  				sspgr.Location = &location
  7649  			}
  7650  		case "tags":
  7651  			if v != nil {
  7652  				var tags map[string]*string
  7653  				err = json.Unmarshal(*v, &tags)
  7654  				if err != nil {
  7655  					return err
  7656  				}
  7657  				sspgr.Tags = tags
  7658  			}
  7659  		}
  7660  	}
  7661  
  7662  	return nil
  7663  }
  7664  
  7665  // SQLStoredProcedureListResult the List operation response, that contains the storedProcedures and their
  7666  // properties.
  7667  type SQLStoredProcedureListResult struct {
  7668  	autorest.Response `json:"-"`
  7669  	// Value - READ-ONLY; List of storedProcedures and their properties.
  7670  	Value *[]SQLStoredProcedureGetResults `json:"value,omitempty"`
  7671  }
  7672  
  7673  // MarshalJSON is the custom marshaler for SQLStoredProcedureListResult.
  7674  func (ssplr SQLStoredProcedureListResult) MarshalJSON() ([]byte, error) {
  7675  	objectMap := make(map[string]interface{})
  7676  	return json.Marshal(objectMap)
  7677  }
  7678  
  7679  // SQLStoredProcedureResource cosmos DB SQL storedProcedure resource object
  7680  type SQLStoredProcedureResource struct {
  7681  	// ID - Name of the Cosmos DB SQL storedProcedure
  7682  	ID *string `json:"id,omitempty"`
  7683  	// Body - Body of the Stored Procedure
  7684  	Body *string `json:"body,omitempty"`
  7685  }
  7686  
  7687  // SQLTriggerCreateUpdateParameters parameters to create and update Cosmos DB trigger.
  7688  type SQLTriggerCreateUpdateParameters struct {
  7689  	// SQLTriggerCreateUpdateProperties - Properties to create and update Azure Cosmos DB trigger.
  7690  	*SQLTriggerCreateUpdateProperties `json:"properties,omitempty"`
  7691  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  7692  	ID *string `json:"id,omitempty"`
  7693  	// Name - READ-ONLY; The name of the ARM resource.
  7694  	Name *string `json:"name,omitempty"`
  7695  	// Type - READ-ONLY; The type of Azure resource.
  7696  	Type *string `json:"type,omitempty"`
  7697  	// Location - The location of the resource group to which the resource belongs.
  7698  	Location *string            `json:"location,omitempty"`
  7699  	Tags     map[string]*string `json:"tags"`
  7700  }
  7701  
  7702  // MarshalJSON is the custom marshaler for SQLTriggerCreateUpdateParameters.
  7703  func (stcup SQLTriggerCreateUpdateParameters) MarshalJSON() ([]byte, error) {
  7704  	objectMap := make(map[string]interface{})
  7705  	if stcup.SQLTriggerCreateUpdateProperties != nil {
  7706  		objectMap["properties"] = stcup.SQLTriggerCreateUpdateProperties
  7707  	}
  7708  	if stcup.Location != nil {
  7709  		objectMap["location"] = stcup.Location
  7710  	}
  7711  	if stcup.Tags != nil {
  7712  		objectMap["tags"] = stcup.Tags
  7713  	}
  7714  	return json.Marshal(objectMap)
  7715  }
  7716  
  7717  // UnmarshalJSON is the custom unmarshaler for SQLTriggerCreateUpdateParameters struct.
  7718  func (stcup *SQLTriggerCreateUpdateParameters) UnmarshalJSON(body []byte) error {
  7719  	var m map[string]*json.RawMessage
  7720  	err := json.Unmarshal(body, &m)
  7721  	if err != nil {
  7722  		return err
  7723  	}
  7724  	for k, v := range m {
  7725  		switch k {
  7726  		case "properties":
  7727  			if v != nil {
  7728  				var SQLTriggerCreateUpdateProperties SQLTriggerCreateUpdateProperties
  7729  				err = json.Unmarshal(*v, &SQLTriggerCreateUpdateProperties)
  7730  				if err != nil {
  7731  					return err
  7732  				}
  7733  				stcup.SQLTriggerCreateUpdateProperties = &SQLTriggerCreateUpdateProperties
  7734  			}
  7735  		case "id":
  7736  			if v != nil {
  7737  				var ID string
  7738  				err = json.Unmarshal(*v, &ID)
  7739  				if err != nil {
  7740  					return err
  7741  				}
  7742  				stcup.ID = &ID
  7743  			}
  7744  		case "name":
  7745  			if v != nil {
  7746  				var name string
  7747  				err = json.Unmarshal(*v, &name)
  7748  				if err != nil {
  7749  					return err
  7750  				}
  7751  				stcup.Name = &name
  7752  			}
  7753  		case "type":
  7754  			if v != nil {
  7755  				var typeVar string
  7756  				err = json.Unmarshal(*v, &typeVar)
  7757  				if err != nil {
  7758  					return err
  7759  				}
  7760  				stcup.Type = &typeVar
  7761  			}
  7762  		case "location":
  7763  			if v != nil {
  7764  				var location string
  7765  				err = json.Unmarshal(*v, &location)
  7766  				if err != nil {
  7767  					return err
  7768  				}
  7769  				stcup.Location = &location
  7770  			}
  7771  		case "tags":
  7772  			if v != nil {
  7773  				var tags map[string]*string
  7774  				err = json.Unmarshal(*v, &tags)
  7775  				if err != nil {
  7776  					return err
  7777  				}
  7778  				stcup.Tags = tags
  7779  			}
  7780  		}
  7781  	}
  7782  
  7783  	return nil
  7784  }
  7785  
  7786  // SQLTriggerCreateUpdateProperties properties to create and update Azure Cosmos DB trigger.
  7787  type SQLTriggerCreateUpdateProperties struct {
  7788  	// Resource - The standard JSON format of a trigger
  7789  	Resource *SQLTriggerResource `json:"resource,omitempty"`
  7790  	// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
  7791  	Options *CreateUpdateOptions `json:"options,omitempty"`
  7792  }
  7793  
  7794  // SQLTriggerGetProperties the properties of an Azure Cosmos DB trigger
  7795  type SQLTriggerGetProperties struct {
  7796  	Resource *SQLTriggerGetPropertiesResource `json:"resource,omitempty"`
  7797  }
  7798  
  7799  // SQLTriggerGetPropertiesResource ...
  7800  type SQLTriggerGetPropertiesResource struct {
  7801  	// ID - Name of the Cosmos DB SQL trigger
  7802  	ID *string `json:"id,omitempty"`
  7803  	// Body - Body of the Trigger
  7804  	Body *string `json:"body,omitempty"`
  7805  	// TriggerType - Type of the Trigger. Possible values include: 'Pre', 'Post'
  7806  	TriggerType TriggerType `json:"triggerType,omitempty"`
  7807  	// TriggerOperation - The operation the trigger is associated with. Possible values include: 'All', 'Create', 'Update', 'Delete', 'Replace'
  7808  	TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"`
  7809  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  7810  	Rid *string `json:"_rid,omitempty"`
  7811  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  7812  	Ts *float64 `json:"_ts,omitempty"`
  7813  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  7814  	Etag *string `json:"_etag,omitempty"`
  7815  }
  7816  
  7817  // MarshalJSON is the custom marshaler for SQLTriggerGetPropertiesResource.
  7818  func (stgp SQLTriggerGetPropertiesResource) MarshalJSON() ([]byte, error) {
  7819  	objectMap := make(map[string]interface{})
  7820  	if stgp.ID != nil {
  7821  		objectMap["id"] = stgp.ID
  7822  	}
  7823  	if stgp.Body != nil {
  7824  		objectMap["body"] = stgp.Body
  7825  	}
  7826  	if stgp.TriggerType != "" {
  7827  		objectMap["triggerType"] = stgp.TriggerType
  7828  	}
  7829  	if stgp.TriggerOperation != "" {
  7830  		objectMap["triggerOperation"] = stgp.TriggerOperation
  7831  	}
  7832  	return json.Marshal(objectMap)
  7833  }
  7834  
  7835  // SQLTriggerGetResults an Azure Cosmos DB trigger.
  7836  type SQLTriggerGetResults struct {
  7837  	autorest.Response `json:"-"`
  7838  	// SQLTriggerGetProperties - The properties of an Azure Cosmos DB trigger
  7839  	*SQLTriggerGetProperties `json:"properties,omitempty"`
  7840  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  7841  	ID *string `json:"id,omitempty"`
  7842  	// Name - READ-ONLY; The name of the ARM resource.
  7843  	Name *string `json:"name,omitempty"`
  7844  	// Type - READ-ONLY; The type of Azure resource.
  7845  	Type *string `json:"type,omitempty"`
  7846  	// Location - The location of the resource group to which the resource belongs.
  7847  	Location *string            `json:"location,omitempty"`
  7848  	Tags     map[string]*string `json:"tags"`
  7849  }
  7850  
  7851  // MarshalJSON is the custom marshaler for SQLTriggerGetResults.
  7852  func (stgr SQLTriggerGetResults) MarshalJSON() ([]byte, error) {
  7853  	objectMap := make(map[string]interface{})
  7854  	if stgr.SQLTriggerGetProperties != nil {
  7855  		objectMap["properties"] = stgr.SQLTriggerGetProperties
  7856  	}
  7857  	if stgr.Location != nil {
  7858  		objectMap["location"] = stgr.Location
  7859  	}
  7860  	if stgr.Tags != nil {
  7861  		objectMap["tags"] = stgr.Tags
  7862  	}
  7863  	return json.Marshal(objectMap)
  7864  }
  7865  
  7866  // UnmarshalJSON is the custom unmarshaler for SQLTriggerGetResults struct.
  7867  func (stgr *SQLTriggerGetResults) UnmarshalJSON(body []byte) error {
  7868  	var m map[string]*json.RawMessage
  7869  	err := json.Unmarshal(body, &m)
  7870  	if err != nil {
  7871  		return err
  7872  	}
  7873  	for k, v := range m {
  7874  		switch k {
  7875  		case "properties":
  7876  			if v != nil {
  7877  				var SQLTriggerGetProperties SQLTriggerGetProperties
  7878  				err = json.Unmarshal(*v, &SQLTriggerGetProperties)
  7879  				if err != nil {
  7880  					return err
  7881  				}
  7882  				stgr.SQLTriggerGetProperties = &SQLTriggerGetProperties
  7883  			}
  7884  		case "id":
  7885  			if v != nil {
  7886  				var ID string
  7887  				err = json.Unmarshal(*v, &ID)
  7888  				if err != nil {
  7889  					return err
  7890  				}
  7891  				stgr.ID = &ID
  7892  			}
  7893  		case "name":
  7894  			if v != nil {
  7895  				var name string
  7896  				err = json.Unmarshal(*v, &name)
  7897  				if err != nil {
  7898  					return err
  7899  				}
  7900  				stgr.Name = &name
  7901  			}
  7902  		case "type":
  7903  			if v != nil {
  7904  				var typeVar string
  7905  				err = json.Unmarshal(*v, &typeVar)
  7906  				if err != nil {
  7907  					return err
  7908  				}
  7909  				stgr.Type = &typeVar
  7910  			}
  7911  		case "location":
  7912  			if v != nil {
  7913  				var location string
  7914  				err = json.Unmarshal(*v, &location)
  7915  				if err != nil {
  7916  					return err
  7917  				}
  7918  				stgr.Location = &location
  7919  			}
  7920  		case "tags":
  7921  			if v != nil {
  7922  				var tags map[string]*string
  7923  				err = json.Unmarshal(*v, &tags)
  7924  				if err != nil {
  7925  					return err
  7926  				}
  7927  				stgr.Tags = tags
  7928  			}
  7929  		}
  7930  	}
  7931  
  7932  	return nil
  7933  }
  7934  
  7935  // SQLTriggerListResult the List operation response, that contains the triggers and their properties.
  7936  type SQLTriggerListResult struct {
  7937  	autorest.Response `json:"-"`
  7938  	// Value - READ-ONLY; List of triggers and their properties.
  7939  	Value *[]SQLTriggerGetResults `json:"value,omitempty"`
  7940  }
  7941  
  7942  // MarshalJSON is the custom marshaler for SQLTriggerListResult.
  7943  func (stlr SQLTriggerListResult) MarshalJSON() ([]byte, error) {
  7944  	objectMap := make(map[string]interface{})
  7945  	return json.Marshal(objectMap)
  7946  }
  7947  
  7948  // SQLTriggerResource cosmos DB SQL trigger resource object
  7949  type SQLTriggerResource struct {
  7950  	// ID - Name of the Cosmos DB SQL trigger
  7951  	ID *string `json:"id,omitempty"`
  7952  	// Body - Body of the Trigger
  7953  	Body *string `json:"body,omitempty"`
  7954  	// TriggerType - Type of the Trigger. Possible values include: 'Pre', 'Post'
  7955  	TriggerType TriggerType `json:"triggerType,omitempty"`
  7956  	// TriggerOperation - The operation the trigger is associated with. Possible values include: 'All', 'Create', 'Update', 'Delete', 'Replace'
  7957  	TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"`
  7958  }
  7959  
  7960  // SQLUserDefinedFunctionCreateUpdateParameters parameters to create and update Cosmos DB
  7961  // userDefinedFunction.
  7962  type SQLUserDefinedFunctionCreateUpdateParameters struct {
  7963  	// SQLUserDefinedFunctionCreateUpdateProperties - Properties to create and update Azure Cosmos DB userDefinedFunction.
  7964  	*SQLUserDefinedFunctionCreateUpdateProperties `json:"properties,omitempty"`
  7965  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  7966  	ID *string `json:"id,omitempty"`
  7967  	// Name - READ-ONLY; The name of the ARM resource.
  7968  	Name *string `json:"name,omitempty"`
  7969  	// Type - READ-ONLY; The type of Azure resource.
  7970  	Type *string `json:"type,omitempty"`
  7971  	// Location - The location of the resource group to which the resource belongs.
  7972  	Location *string            `json:"location,omitempty"`
  7973  	Tags     map[string]*string `json:"tags"`
  7974  }
  7975  
  7976  // MarshalJSON is the custom marshaler for SQLUserDefinedFunctionCreateUpdateParameters.
  7977  func (sudfcup SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON() ([]byte, error) {
  7978  	objectMap := make(map[string]interface{})
  7979  	if sudfcup.SQLUserDefinedFunctionCreateUpdateProperties != nil {
  7980  		objectMap["properties"] = sudfcup.SQLUserDefinedFunctionCreateUpdateProperties
  7981  	}
  7982  	if sudfcup.Location != nil {
  7983  		objectMap["location"] = sudfcup.Location
  7984  	}
  7985  	if sudfcup.Tags != nil {
  7986  		objectMap["tags"] = sudfcup.Tags
  7987  	}
  7988  	return json.Marshal(objectMap)
  7989  }
  7990  
  7991  // UnmarshalJSON is the custom unmarshaler for SQLUserDefinedFunctionCreateUpdateParameters struct.
  7992  func (sudfcup *SQLUserDefinedFunctionCreateUpdateParameters) UnmarshalJSON(body []byte) error {
  7993  	var m map[string]*json.RawMessage
  7994  	err := json.Unmarshal(body, &m)
  7995  	if err != nil {
  7996  		return err
  7997  	}
  7998  	for k, v := range m {
  7999  		switch k {
  8000  		case "properties":
  8001  			if v != nil {
  8002  				var SQLUserDefinedFunctionCreateUpdateProperties SQLUserDefinedFunctionCreateUpdateProperties
  8003  				err = json.Unmarshal(*v, &SQLUserDefinedFunctionCreateUpdateProperties)
  8004  				if err != nil {
  8005  					return err
  8006  				}
  8007  				sudfcup.SQLUserDefinedFunctionCreateUpdateProperties = &SQLUserDefinedFunctionCreateUpdateProperties
  8008  			}
  8009  		case "id":
  8010  			if v != nil {
  8011  				var ID string
  8012  				err = json.Unmarshal(*v, &ID)
  8013  				if err != nil {
  8014  					return err
  8015  				}
  8016  				sudfcup.ID = &ID
  8017  			}
  8018  		case "name":
  8019  			if v != nil {
  8020  				var name string
  8021  				err = json.Unmarshal(*v, &name)
  8022  				if err != nil {
  8023  					return err
  8024  				}
  8025  				sudfcup.Name = &name
  8026  			}
  8027  		case "type":
  8028  			if v != nil {
  8029  				var typeVar string
  8030  				err = json.Unmarshal(*v, &typeVar)
  8031  				if err != nil {
  8032  					return err
  8033  				}
  8034  				sudfcup.Type = &typeVar
  8035  			}
  8036  		case "location":
  8037  			if v != nil {
  8038  				var location string
  8039  				err = json.Unmarshal(*v, &location)
  8040  				if err != nil {
  8041  					return err
  8042  				}
  8043  				sudfcup.Location = &location
  8044  			}
  8045  		case "tags":
  8046  			if v != nil {
  8047  				var tags map[string]*string
  8048  				err = json.Unmarshal(*v, &tags)
  8049  				if err != nil {
  8050  					return err
  8051  				}
  8052  				sudfcup.Tags = tags
  8053  			}
  8054  		}
  8055  	}
  8056  
  8057  	return nil
  8058  }
  8059  
  8060  // SQLUserDefinedFunctionCreateUpdateProperties properties to create and update Azure Cosmos DB
  8061  // userDefinedFunction.
  8062  type SQLUserDefinedFunctionCreateUpdateProperties struct {
  8063  	// Resource - The standard JSON format of a userDefinedFunction
  8064  	Resource *SQLUserDefinedFunctionResource `json:"resource,omitempty"`
  8065  	// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
  8066  	Options *CreateUpdateOptions `json:"options,omitempty"`
  8067  }
  8068  
  8069  // SQLUserDefinedFunctionGetProperties the properties of an Azure Cosmos DB userDefinedFunction
  8070  type SQLUserDefinedFunctionGetProperties struct {
  8071  	Resource *SQLUserDefinedFunctionGetPropertiesResource `json:"resource,omitempty"`
  8072  }
  8073  
  8074  // SQLUserDefinedFunctionGetPropertiesResource ...
  8075  type SQLUserDefinedFunctionGetPropertiesResource struct {
  8076  	// ID - Name of the Cosmos DB SQL userDefinedFunction
  8077  	ID *string `json:"id,omitempty"`
  8078  	// Body - Body of the User Defined Function
  8079  	Body *string `json:"body,omitempty"`
  8080  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  8081  	Rid *string `json:"_rid,omitempty"`
  8082  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  8083  	Ts *float64 `json:"_ts,omitempty"`
  8084  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  8085  	Etag *string `json:"_etag,omitempty"`
  8086  }
  8087  
  8088  // MarshalJSON is the custom marshaler for SQLUserDefinedFunctionGetPropertiesResource.
  8089  func (sudfgp SQLUserDefinedFunctionGetPropertiesResource) MarshalJSON() ([]byte, error) {
  8090  	objectMap := make(map[string]interface{})
  8091  	if sudfgp.ID != nil {
  8092  		objectMap["id"] = sudfgp.ID
  8093  	}
  8094  	if sudfgp.Body != nil {
  8095  		objectMap["body"] = sudfgp.Body
  8096  	}
  8097  	return json.Marshal(objectMap)
  8098  }
  8099  
  8100  // SQLUserDefinedFunctionGetResults an Azure Cosmos DB userDefinedFunction.
  8101  type SQLUserDefinedFunctionGetResults struct {
  8102  	autorest.Response `json:"-"`
  8103  	// SQLUserDefinedFunctionGetProperties - The properties of an Azure Cosmos DB userDefinedFunction
  8104  	*SQLUserDefinedFunctionGetProperties `json:"properties,omitempty"`
  8105  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  8106  	ID *string `json:"id,omitempty"`
  8107  	// Name - READ-ONLY; The name of the ARM resource.
  8108  	Name *string `json:"name,omitempty"`
  8109  	// Type - READ-ONLY; The type of Azure resource.
  8110  	Type *string `json:"type,omitempty"`
  8111  	// Location - The location of the resource group to which the resource belongs.
  8112  	Location *string            `json:"location,omitempty"`
  8113  	Tags     map[string]*string `json:"tags"`
  8114  }
  8115  
  8116  // MarshalJSON is the custom marshaler for SQLUserDefinedFunctionGetResults.
  8117  func (sudfgr SQLUserDefinedFunctionGetResults) MarshalJSON() ([]byte, error) {
  8118  	objectMap := make(map[string]interface{})
  8119  	if sudfgr.SQLUserDefinedFunctionGetProperties != nil {
  8120  		objectMap["properties"] = sudfgr.SQLUserDefinedFunctionGetProperties
  8121  	}
  8122  	if sudfgr.Location != nil {
  8123  		objectMap["location"] = sudfgr.Location
  8124  	}
  8125  	if sudfgr.Tags != nil {
  8126  		objectMap["tags"] = sudfgr.Tags
  8127  	}
  8128  	return json.Marshal(objectMap)
  8129  }
  8130  
  8131  // UnmarshalJSON is the custom unmarshaler for SQLUserDefinedFunctionGetResults struct.
  8132  func (sudfgr *SQLUserDefinedFunctionGetResults) UnmarshalJSON(body []byte) error {
  8133  	var m map[string]*json.RawMessage
  8134  	err := json.Unmarshal(body, &m)
  8135  	if err != nil {
  8136  		return err
  8137  	}
  8138  	for k, v := range m {
  8139  		switch k {
  8140  		case "properties":
  8141  			if v != nil {
  8142  				var SQLUserDefinedFunctionGetProperties SQLUserDefinedFunctionGetProperties
  8143  				err = json.Unmarshal(*v, &SQLUserDefinedFunctionGetProperties)
  8144  				if err != nil {
  8145  					return err
  8146  				}
  8147  				sudfgr.SQLUserDefinedFunctionGetProperties = &SQLUserDefinedFunctionGetProperties
  8148  			}
  8149  		case "id":
  8150  			if v != nil {
  8151  				var ID string
  8152  				err = json.Unmarshal(*v, &ID)
  8153  				if err != nil {
  8154  					return err
  8155  				}
  8156  				sudfgr.ID = &ID
  8157  			}
  8158  		case "name":
  8159  			if v != nil {
  8160  				var name string
  8161  				err = json.Unmarshal(*v, &name)
  8162  				if err != nil {
  8163  					return err
  8164  				}
  8165  				sudfgr.Name = &name
  8166  			}
  8167  		case "type":
  8168  			if v != nil {
  8169  				var typeVar string
  8170  				err = json.Unmarshal(*v, &typeVar)
  8171  				if err != nil {
  8172  					return err
  8173  				}
  8174  				sudfgr.Type = &typeVar
  8175  			}
  8176  		case "location":
  8177  			if v != nil {
  8178  				var location string
  8179  				err = json.Unmarshal(*v, &location)
  8180  				if err != nil {
  8181  					return err
  8182  				}
  8183  				sudfgr.Location = &location
  8184  			}
  8185  		case "tags":
  8186  			if v != nil {
  8187  				var tags map[string]*string
  8188  				err = json.Unmarshal(*v, &tags)
  8189  				if err != nil {
  8190  					return err
  8191  				}
  8192  				sudfgr.Tags = tags
  8193  			}
  8194  		}
  8195  	}
  8196  
  8197  	return nil
  8198  }
  8199  
  8200  // SQLUserDefinedFunctionListResult the List operation response, that contains the userDefinedFunctions and
  8201  // their properties.
  8202  type SQLUserDefinedFunctionListResult struct {
  8203  	autorest.Response `json:"-"`
  8204  	// Value - READ-ONLY; List of userDefinedFunctions and their properties.
  8205  	Value *[]SQLUserDefinedFunctionGetResults `json:"value,omitempty"`
  8206  }
  8207  
  8208  // MarshalJSON is the custom marshaler for SQLUserDefinedFunctionListResult.
  8209  func (sudflr SQLUserDefinedFunctionListResult) MarshalJSON() ([]byte, error) {
  8210  	objectMap := make(map[string]interface{})
  8211  	return json.Marshal(objectMap)
  8212  }
  8213  
  8214  // SQLUserDefinedFunctionResource cosmos DB SQL userDefinedFunction resource object
  8215  type SQLUserDefinedFunctionResource struct {
  8216  	// ID - Name of the Cosmos DB SQL userDefinedFunction
  8217  	ID *string `json:"id,omitempty"`
  8218  	// Body - Body of the User Defined Function
  8219  	Body *string `json:"body,omitempty"`
  8220  }
  8221  
  8222  // TableCreateUpdateParameters parameters to create and update Cosmos DB Table.
  8223  type TableCreateUpdateParameters struct {
  8224  	// TableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Table.
  8225  	*TableCreateUpdateProperties `json:"properties,omitempty"`
  8226  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  8227  	ID *string `json:"id,omitempty"`
  8228  	// Name - READ-ONLY; The name of the ARM resource.
  8229  	Name *string `json:"name,omitempty"`
  8230  	// Type - READ-ONLY; The type of Azure resource.
  8231  	Type *string `json:"type,omitempty"`
  8232  	// Location - The location of the resource group to which the resource belongs.
  8233  	Location *string            `json:"location,omitempty"`
  8234  	Tags     map[string]*string `json:"tags"`
  8235  }
  8236  
  8237  // MarshalJSON is the custom marshaler for TableCreateUpdateParameters.
  8238  func (tcup TableCreateUpdateParameters) MarshalJSON() ([]byte, error) {
  8239  	objectMap := make(map[string]interface{})
  8240  	if tcup.TableCreateUpdateProperties != nil {
  8241  		objectMap["properties"] = tcup.TableCreateUpdateProperties
  8242  	}
  8243  	if tcup.Location != nil {
  8244  		objectMap["location"] = tcup.Location
  8245  	}
  8246  	if tcup.Tags != nil {
  8247  		objectMap["tags"] = tcup.Tags
  8248  	}
  8249  	return json.Marshal(objectMap)
  8250  }
  8251  
  8252  // UnmarshalJSON is the custom unmarshaler for TableCreateUpdateParameters struct.
  8253  func (tcup *TableCreateUpdateParameters) UnmarshalJSON(body []byte) error {
  8254  	var m map[string]*json.RawMessage
  8255  	err := json.Unmarshal(body, &m)
  8256  	if err != nil {
  8257  		return err
  8258  	}
  8259  	for k, v := range m {
  8260  		switch k {
  8261  		case "properties":
  8262  			if v != nil {
  8263  				var tableCreateUpdateProperties TableCreateUpdateProperties
  8264  				err = json.Unmarshal(*v, &tableCreateUpdateProperties)
  8265  				if err != nil {
  8266  					return err
  8267  				}
  8268  				tcup.TableCreateUpdateProperties = &tableCreateUpdateProperties
  8269  			}
  8270  		case "id":
  8271  			if v != nil {
  8272  				var ID string
  8273  				err = json.Unmarshal(*v, &ID)
  8274  				if err != nil {
  8275  					return err
  8276  				}
  8277  				tcup.ID = &ID
  8278  			}
  8279  		case "name":
  8280  			if v != nil {
  8281  				var name string
  8282  				err = json.Unmarshal(*v, &name)
  8283  				if err != nil {
  8284  					return err
  8285  				}
  8286  				tcup.Name = &name
  8287  			}
  8288  		case "type":
  8289  			if v != nil {
  8290  				var typeVar string
  8291  				err = json.Unmarshal(*v, &typeVar)
  8292  				if err != nil {
  8293  					return err
  8294  				}
  8295  				tcup.Type = &typeVar
  8296  			}
  8297  		case "location":
  8298  			if v != nil {
  8299  				var location string
  8300  				err = json.Unmarshal(*v, &location)
  8301  				if err != nil {
  8302  					return err
  8303  				}
  8304  				tcup.Location = &location
  8305  			}
  8306  		case "tags":
  8307  			if v != nil {
  8308  				var tags map[string]*string
  8309  				err = json.Unmarshal(*v, &tags)
  8310  				if err != nil {
  8311  					return err
  8312  				}
  8313  				tcup.Tags = tags
  8314  			}
  8315  		}
  8316  	}
  8317  
  8318  	return nil
  8319  }
  8320  
  8321  // TableCreateUpdateProperties properties to create and update Azure Cosmos DB Table.
  8322  type TableCreateUpdateProperties struct {
  8323  	// Resource - The standard JSON format of a Table
  8324  	Resource *TableResource `json:"resource,omitempty"`
  8325  	// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
  8326  	Options *CreateUpdateOptions `json:"options,omitempty"`
  8327  }
  8328  
  8329  // TableGetProperties the properties of an Azure Cosmos Table
  8330  type TableGetProperties struct {
  8331  	Resource *TableGetPropertiesResource `json:"resource,omitempty"`
  8332  	Options  *TableGetPropertiesOptions  `json:"options,omitempty"`
  8333  }
  8334  
  8335  // TableGetPropertiesOptions ...
  8336  type TableGetPropertiesOptions struct {
  8337  	// Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details.
  8338  	Throughput *int32 `json:"throughput,omitempty"`
  8339  	// AutoscaleSettings - Specifies the Autoscale settings.
  8340  	AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
  8341  }
  8342  
  8343  // TableGetPropertiesResource ...
  8344  type TableGetPropertiesResource struct {
  8345  	// ID - Name of the Cosmos DB table
  8346  	ID *string `json:"id,omitempty"`
  8347  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  8348  	Rid *string `json:"_rid,omitempty"`
  8349  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  8350  	Ts *float64 `json:"_ts,omitempty"`
  8351  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  8352  	Etag *string `json:"_etag,omitempty"`
  8353  }
  8354  
  8355  // MarshalJSON is the custom marshaler for TableGetPropertiesResource.
  8356  func (tgp TableGetPropertiesResource) MarshalJSON() ([]byte, error) {
  8357  	objectMap := make(map[string]interface{})
  8358  	if tgp.ID != nil {
  8359  		objectMap["id"] = tgp.ID
  8360  	}
  8361  	return json.Marshal(objectMap)
  8362  }
  8363  
  8364  // TableGetResults an Azure Cosmos DB Table.
  8365  type TableGetResults struct {
  8366  	autorest.Response `json:"-"`
  8367  	// TableGetProperties - The properties of an Azure Cosmos DB Table
  8368  	*TableGetProperties `json:"properties,omitempty"`
  8369  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  8370  	ID *string `json:"id,omitempty"`
  8371  	// Name - READ-ONLY; The name of the ARM resource.
  8372  	Name *string `json:"name,omitempty"`
  8373  	// Type - READ-ONLY; The type of Azure resource.
  8374  	Type *string `json:"type,omitempty"`
  8375  	// Location - The location of the resource group to which the resource belongs.
  8376  	Location *string            `json:"location,omitempty"`
  8377  	Tags     map[string]*string `json:"tags"`
  8378  }
  8379  
  8380  // MarshalJSON is the custom marshaler for TableGetResults.
  8381  func (tgr TableGetResults) MarshalJSON() ([]byte, error) {
  8382  	objectMap := make(map[string]interface{})
  8383  	if tgr.TableGetProperties != nil {
  8384  		objectMap["properties"] = tgr.TableGetProperties
  8385  	}
  8386  	if tgr.Location != nil {
  8387  		objectMap["location"] = tgr.Location
  8388  	}
  8389  	if tgr.Tags != nil {
  8390  		objectMap["tags"] = tgr.Tags
  8391  	}
  8392  	return json.Marshal(objectMap)
  8393  }
  8394  
  8395  // UnmarshalJSON is the custom unmarshaler for TableGetResults struct.
  8396  func (tgr *TableGetResults) UnmarshalJSON(body []byte) error {
  8397  	var m map[string]*json.RawMessage
  8398  	err := json.Unmarshal(body, &m)
  8399  	if err != nil {
  8400  		return err
  8401  	}
  8402  	for k, v := range m {
  8403  		switch k {
  8404  		case "properties":
  8405  			if v != nil {
  8406  				var tableGetProperties TableGetProperties
  8407  				err = json.Unmarshal(*v, &tableGetProperties)
  8408  				if err != nil {
  8409  					return err
  8410  				}
  8411  				tgr.TableGetProperties = &tableGetProperties
  8412  			}
  8413  		case "id":
  8414  			if v != nil {
  8415  				var ID string
  8416  				err = json.Unmarshal(*v, &ID)
  8417  				if err != nil {
  8418  					return err
  8419  				}
  8420  				tgr.ID = &ID
  8421  			}
  8422  		case "name":
  8423  			if v != nil {
  8424  				var name string
  8425  				err = json.Unmarshal(*v, &name)
  8426  				if err != nil {
  8427  					return err
  8428  				}
  8429  				tgr.Name = &name
  8430  			}
  8431  		case "type":
  8432  			if v != nil {
  8433  				var typeVar string
  8434  				err = json.Unmarshal(*v, &typeVar)
  8435  				if err != nil {
  8436  					return err
  8437  				}
  8438  				tgr.Type = &typeVar
  8439  			}
  8440  		case "location":
  8441  			if v != nil {
  8442  				var location string
  8443  				err = json.Unmarshal(*v, &location)
  8444  				if err != nil {
  8445  					return err
  8446  				}
  8447  				tgr.Location = &location
  8448  			}
  8449  		case "tags":
  8450  			if v != nil {
  8451  				var tags map[string]*string
  8452  				err = json.Unmarshal(*v, &tags)
  8453  				if err != nil {
  8454  					return err
  8455  				}
  8456  				tgr.Tags = tags
  8457  			}
  8458  		}
  8459  	}
  8460  
  8461  	return nil
  8462  }
  8463  
  8464  // TableListResult the List operation response, that contains the Table and their properties.
  8465  type TableListResult struct {
  8466  	autorest.Response `json:"-"`
  8467  	// Value - READ-ONLY; List of Table and their properties.
  8468  	Value *[]TableGetResults `json:"value,omitempty"`
  8469  }
  8470  
  8471  // MarshalJSON is the custom marshaler for TableListResult.
  8472  func (tlr TableListResult) MarshalJSON() ([]byte, error) {
  8473  	objectMap := make(map[string]interface{})
  8474  	return json.Marshal(objectMap)
  8475  }
  8476  
  8477  // TableResource cosmos DB table resource object
  8478  type TableResource struct {
  8479  	// ID - Name of the Cosmos DB table
  8480  	ID *string `json:"id,omitempty"`
  8481  }
  8482  
  8483  // TableResourcesCreateUpdateTableFuture an abstraction for monitoring and retrieving the results of a
  8484  // long-running operation.
  8485  type TableResourcesCreateUpdateTableFuture struct {
  8486  	azure.FutureAPI
  8487  	// Result returns the result of the asynchronous operation.
  8488  	// If the operation has not completed it will return an error.
  8489  	Result func(TableResourcesClient) (TableGetResults, error)
  8490  }
  8491  
  8492  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8493  func (future *TableResourcesCreateUpdateTableFuture) UnmarshalJSON(body []byte) error {
  8494  	var azFuture azure.Future
  8495  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8496  		return err
  8497  	}
  8498  	future.FutureAPI = &azFuture
  8499  	future.Result = future.result
  8500  	return nil
  8501  }
  8502  
  8503  // result is the default implementation for TableResourcesCreateUpdateTableFuture.Result.
  8504  func (future *TableResourcesCreateUpdateTableFuture) result(client TableResourcesClient) (tgr TableGetResults, err error) {
  8505  	var done bool
  8506  	done, err = future.DoneWithContext(context.Background(), client)
  8507  	if err != nil {
  8508  		err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", future.Response(), "Polling failure")
  8509  		return
  8510  	}
  8511  	if !done {
  8512  		tgr.Response.Response = future.Response()
  8513  		err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesCreateUpdateTableFuture")
  8514  		return
  8515  	}
  8516  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  8517  	if tgr.Response.Response, err = future.GetResult(sender); err == nil && tgr.Response.Response.StatusCode != http.StatusNoContent {
  8518  		tgr, err = client.CreateUpdateTableResponder(tgr.Response.Response)
  8519  		if err != nil {
  8520  			err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", tgr.Response.Response, "Failure responding to request")
  8521  		}
  8522  	}
  8523  	return
  8524  }
  8525  
  8526  // TableResourcesDeleteTableFuture an abstraction for monitoring and retrieving the results of a
  8527  // long-running operation.
  8528  type TableResourcesDeleteTableFuture struct {
  8529  	azure.FutureAPI
  8530  	// Result returns the result of the asynchronous operation.
  8531  	// If the operation has not completed it will return an error.
  8532  	Result func(TableResourcesClient) (autorest.Response, error)
  8533  }
  8534  
  8535  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8536  func (future *TableResourcesDeleteTableFuture) UnmarshalJSON(body []byte) error {
  8537  	var azFuture azure.Future
  8538  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8539  		return err
  8540  	}
  8541  	future.FutureAPI = &azFuture
  8542  	future.Result = future.result
  8543  	return nil
  8544  }
  8545  
  8546  // result is the default implementation for TableResourcesDeleteTableFuture.Result.
  8547  func (future *TableResourcesDeleteTableFuture) result(client TableResourcesClient) (ar autorest.Response, err error) {
  8548  	var done bool
  8549  	done, err = future.DoneWithContext(context.Background(), client)
  8550  	if err != nil {
  8551  		err = autorest.NewErrorWithError(err, "documentdb.TableResourcesDeleteTableFuture", "Result", future.Response(), "Polling failure")
  8552  		return
  8553  	}
  8554  	if !done {
  8555  		ar.Response = future.Response()
  8556  		err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesDeleteTableFuture")
  8557  		return
  8558  	}
  8559  	ar.Response = future.Response()
  8560  	return
  8561  }
  8562  
  8563  // TableResourcesMigrateTableToAutoscaleFuture an abstraction for monitoring and retrieving the results of
  8564  // a long-running operation.
  8565  type TableResourcesMigrateTableToAutoscaleFuture struct {
  8566  	azure.FutureAPI
  8567  	// Result returns the result of the asynchronous operation.
  8568  	// If the operation has not completed it will return an error.
  8569  	Result func(TableResourcesClient) (ThroughputSettingsGetResults, error)
  8570  }
  8571  
  8572  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8573  func (future *TableResourcesMigrateTableToAutoscaleFuture) UnmarshalJSON(body []byte) error {
  8574  	var azFuture azure.Future
  8575  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8576  		return err
  8577  	}
  8578  	future.FutureAPI = &azFuture
  8579  	future.Result = future.result
  8580  	return nil
  8581  }
  8582  
  8583  // result is the default implementation for TableResourcesMigrateTableToAutoscaleFuture.Result.
  8584  func (future *TableResourcesMigrateTableToAutoscaleFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  8585  	var done bool
  8586  	done, err = future.DoneWithContext(context.Background(), client)
  8587  	if err != nil {
  8588  		err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", future.Response(), "Polling failure")
  8589  		return
  8590  	}
  8591  	if !done {
  8592  		tsgr.Response.Response = future.Response()
  8593  		err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToAutoscaleFuture")
  8594  		return
  8595  	}
  8596  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  8597  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  8598  		tsgr, err = client.MigrateTableToAutoscaleResponder(tsgr.Response.Response)
  8599  		if err != nil {
  8600  			err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  8601  		}
  8602  	}
  8603  	return
  8604  }
  8605  
  8606  // TableResourcesMigrateTableToManualThroughputFuture an abstraction for monitoring and retrieving the
  8607  // results of a long-running operation.
  8608  type TableResourcesMigrateTableToManualThroughputFuture struct {
  8609  	azure.FutureAPI
  8610  	// Result returns the result of the asynchronous operation.
  8611  	// If the operation has not completed it will return an error.
  8612  	Result func(TableResourcesClient) (ThroughputSettingsGetResults, error)
  8613  }
  8614  
  8615  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8616  func (future *TableResourcesMigrateTableToManualThroughputFuture) UnmarshalJSON(body []byte) error {
  8617  	var azFuture azure.Future
  8618  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8619  		return err
  8620  	}
  8621  	future.FutureAPI = &azFuture
  8622  	future.Result = future.result
  8623  	return nil
  8624  }
  8625  
  8626  // result is the default implementation for TableResourcesMigrateTableToManualThroughputFuture.Result.
  8627  func (future *TableResourcesMigrateTableToManualThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  8628  	var done bool
  8629  	done, err = future.DoneWithContext(context.Background(), client)
  8630  	if err != nil {
  8631  		err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", future.Response(), "Polling failure")
  8632  		return
  8633  	}
  8634  	if !done {
  8635  		tsgr.Response.Response = future.Response()
  8636  		err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToManualThroughputFuture")
  8637  		return
  8638  	}
  8639  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  8640  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  8641  		tsgr, err = client.MigrateTableToManualThroughputResponder(tsgr.Response.Response)
  8642  		if err != nil {
  8643  			err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  8644  		}
  8645  	}
  8646  	return
  8647  }
  8648  
  8649  // TableResourcesUpdateTableThroughputFuture an abstraction for monitoring and retrieving the results of a
  8650  // long-running operation.
  8651  type TableResourcesUpdateTableThroughputFuture struct {
  8652  	azure.FutureAPI
  8653  	// Result returns the result of the asynchronous operation.
  8654  	// If the operation has not completed it will return an error.
  8655  	Result func(TableResourcesClient) (ThroughputSettingsGetResults, error)
  8656  }
  8657  
  8658  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  8659  func (future *TableResourcesUpdateTableThroughputFuture) UnmarshalJSON(body []byte) error {
  8660  	var azFuture azure.Future
  8661  	if err := json.Unmarshal(body, &azFuture); err != nil {
  8662  		return err
  8663  	}
  8664  	future.FutureAPI = &azFuture
  8665  	future.Result = future.result
  8666  	return nil
  8667  }
  8668  
  8669  // result is the default implementation for TableResourcesUpdateTableThroughputFuture.Result.
  8670  func (future *TableResourcesUpdateTableThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
  8671  	var done bool
  8672  	done, err = future.DoneWithContext(context.Background(), client)
  8673  	if err != nil {
  8674  		err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", future.Response(), "Polling failure")
  8675  		return
  8676  	}
  8677  	if !done {
  8678  		tsgr.Response.Response = future.Response()
  8679  		err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesUpdateTableThroughputFuture")
  8680  		return
  8681  	}
  8682  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  8683  	if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
  8684  		tsgr, err = client.UpdateTableThroughputResponder(tsgr.Response.Response)
  8685  		if err != nil {
  8686  			err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
  8687  		}
  8688  	}
  8689  	return
  8690  }
  8691  
  8692  // ThroughputPolicyResource cosmos DB resource throughput policy
  8693  type ThroughputPolicyResource struct {
  8694  	// IsEnabled - Determines whether the ThroughputPolicy is active or not
  8695  	IsEnabled *bool `json:"isEnabled,omitempty"`
  8696  	// IncrementPercent - Represents the percentage by which throughput can increase every time throughput policy kicks in.
  8697  	IncrementPercent *int32 `json:"incrementPercent,omitempty"`
  8698  }
  8699  
  8700  // ThroughputSettingsGetProperties the properties of an Azure Cosmos DB resource throughput
  8701  type ThroughputSettingsGetProperties struct {
  8702  	Resource *ThroughputSettingsGetPropertiesResource `json:"resource,omitempty"`
  8703  }
  8704  
  8705  // ThroughputSettingsGetPropertiesResource ...
  8706  type ThroughputSettingsGetPropertiesResource struct {
  8707  	// Throughput - Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both.
  8708  	Throughput *int32 `json:"throughput,omitempty"`
  8709  	// AutoscaleSettings - Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both.
  8710  	AutoscaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"`
  8711  	// MinimumThroughput - READ-ONLY; The minimum throughput of the resource
  8712  	MinimumThroughput *string `json:"minimumThroughput,omitempty"`
  8713  	// OfferReplacePending - READ-ONLY; The throughput replace is pending
  8714  	OfferReplacePending *string `json:"offerReplacePending,omitempty"`
  8715  	// Rid - READ-ONLY; A system generated property. A unique identifier.
  8716  	Rid *string `json:"_rid,omitempty"`
  8717  	// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
  8718  	Ts *float64 `json:"_ts,omitempty"`
  8719  	// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
  8720  	Etag *string `json:"_etag,omitempty"`
  8721  }
  8722  
  8723  // MarshalJSON is the custom marshaler for ThroughputSettingsGetPropertiesResource.
  8724  func (tsgp ThroughputSettingsGetPropertiesResource) MarshalJSON() ([]byte, error) {
  8725  	objectMap := make(map[string]interface{})
  8726  	if tsgp.Throughput != nil {
  8727  		objectMap["throughput"] = tsgp.Throughput
  8728  	}
  8729  	if tsgp.AutoscaleSettings != nil {
  8730  		objectMap["autoscaleSettings"] = tsgp.AutoscaleSettings
  8731  	}
  8732  	return json.Marshal(objectMap)
  8733  }
  8734  
  8735  // ThroughputSettingsGetResults an Azure Cosmos DB resource throughput.
  8736  type ThroughputSettingsGetResults struct {
  8737  	autorest.Response `json:"-"`
  8738  	// ThroughputSettingsGetProperties - The properties of an Azure Cosmos DB resource throughput
  8739  	*ThroughputSettingsGetProperties `json:"properties,omitempty"`
  8740  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  8741  	ID *string `json:"id,omitempty"`
  8742  	// Name - READ-ONLY; The name of the ARM resource.
  8743  	Name *string `json:"name,omitempty"`
  8744  	// Type - READ-ONLY; The type of Azure resource.
  8745  	Type *string `json:"type,omitempty"`
  8746  	// Location - The location of the resource group to which the resource belongs.
  8747  	Location *string            `json:"location,omitempty"`
  8748  	Tags     map[string]*string `json:"tags"`
  8749  }
  8750  
  8751  // MarshalJSON is the custom marshaler for ThroughputSettingsGetResults.
  8752  func (tsgr ThroughputSettingsGetResults) MarshalJSON() ([]byte, error) {
  8753  	objectMap := make(map[string]interface{})
  8754  	if tsgr.ThroughputSettingsGetProperties != nil {
  8755  		objectMap["properties"] = tsgr.ThroughputSettingsGetProperties
  8756  	}
  8757  	if tsgr.Location != nil {
  8758  		objectMap["location"] = tsgr.Location
  8759  	}
  8760  	if tsgr.Tags != nil {
  8761  		objectMap["tags"] = tsgr.Tags
  8762  	}
  8763  	return json.Marshal(objectMap)
  8764  }
  8765  
  8766  // UnmarshalJSON is the custom unmarshaler for ThroughputSettingsGetResults struct.
  8767  func (tsgr *ThroughputSettingsGetResults) UnmarshalJSON(body []byte) error {
  8768  	var m map[string]*json.RawMessage
  8769  	err := json.Unmarshal(body, &m)
  8770  	if err != nil {
  8771  		return err
  8772  	}
  8773  	for k, v := range m {
  8774  		switch k {
  8775  		case "properties":
  8776  			if v != nil {
  8777  				var throughputSettingsGetProperties ThroughputSettingsGetProperties
  8778  				err = json.Unmarshal(*v, &throughputSettingsGetProperties)
  8779  				if err != nil {
  8780  					return err
  8781  				}
  8782  				tsgr.ThroughputSettingsGetProperties = &throughputSettingsGetProperties
  8783  			}
  8784  		case "id":
  8785  			if v != nil {
  8786  				var ID string
  8787  				err = json.Unmarshal(*v, &ID)
  8788  				if err != nil {
  8789  					return err
  8790  				}
  8791  				tsgr.ID = &ID
  8792  			}
  8793  		case "name":
  8794  			if v != nil {
  8795  				var name string
  8796  				err = json.Unmarshal(*v, &name)
  8797  				if err != nil {
  8798  					return err
  8799  				}
  8800  				tsgr.Name = &name
  8801  			}
  8802  		case "type":
  8803  			if v != nil {
  8804  				var typeVar string
  8805  				err = json.Unmarshal(*v, &typeVar)
  8806  				if err != nil {
  8807  					return err
  8808  				}
  8809  				tsgr.Type = &typeVar
  8810  			}
  8811  		case "location":
  8812  			if v != nil {
  8813  				var location string
  8814  				err = json.Unmarshal(*v, &location)
  8815  				if err != nil {
  8816  					return err
  8817  				}
  8818  				tsgr.Location = &location
  8819  			}
  8820  		case "tags":
  8821  			if v != nil {
  8822  				var tags map[string]*string
  8823  				err = json.Unmarshal(*v, &tags)
  8824  				if err != nil {
  8825  					return err
  8826  				}
  8827  				tsgr.Tags = tags
  8828  			}
  8829  		}
  8830  	}
  8831  
  8832  	return nil
  8833  }
  8834  
  8835  // ThroughputSettingsResource cosmos DB resource throughput object. Either throughput is required or
  8836  // autoscaleSettings is required, but not both.
  8837  type ThroughputSettingsResource struct {
  8838  	// Throughput - Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both.
  8839  	Throughput *int32 `json:"throughput,omitempty"`
  8840  	// AutoscaleSettings - Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both.
  8841  	AutoscaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"`
  8842  	// MinimumThroughput - READ-ONLY; The minimum throughput of the resource
  8843  	MinimumThroughput *string `json:"minimumThroughput,omitempty"`
  8844  	// OfferReplacePending - READ-ONLY; The throughput replace is pending
  8845  	OfferReplacePending *string `json:"offerReplacePending,omitempty"`
  8846  }
  8847  
  8848  // MarshalJSON is the custom marshaler for ThroughputSettingsResource.
  8849  func (tsr ThroughputSettingsResource) MarshalJSON() ([]byte, error) {
  8850  	objectMap := make(map[string]interface{})
  8851  	if tsr.Throughput != nil {
  8852  		objectMap["throughput"] = tsr.Throughput
  8853  	}
  8854  	if tsr.AutoscaleSettings != nil {
  8855  		objectMap["autoscaleSettings"] = tsr.AutoscaleSettings
  8856  	}
  8857  	return json.Marshal(objectMap)
  8858  }
  8859  
  8860  // ThroughputSettingsUpdateParameters parameters to update Cosmos DB resource throughput.
  8861  type ThroughputSettingsUpdateParameters struct {
  8862  	// ThroughputSettingsUpdateProperties - Properties to update Azure Cosmos DB resource throughput.
  8863  	*ThroughputSettingsUpdateProperties `json:"properties,omitempty"`
  8864  	// ID - READ-ONLY; The unique resource identifier of the ARM resource.
  8865  	ID *string `json:"id,omitempty"`
  8866  	// Name - READ-ONLY; The name of the ARM resource.
  8867  	Name *string `json:"name,omitempty"`
  8868  	// Type - READ-ONLY; The type of Azure resource.
  8869  	Type *string `json:"type,omitempty"`
  8870  	// Location - The location of the resource group to which the resource belongs.
  8871  	Location *string            `json:"location,omitempty"`
  8872  	Tags     map[string]*string `json:"tags"`
  8873  }
  8874  
  8875  // MarshalJSON is the custom marshaler for ThroughputSettingsUpdateParameters.
  8876  func (tsup ThroughputSettingsUpdateParameters) MarshalJSON() ([]byte, error) {
  8877  	objectMap := make(map[string]interface{})
  8878  	if tsup.ThroughputSettingsUpdateProperties != nil {
  8879  		objectMap["properties"] = tsup.ThroughputSettingsUpdateProperties
  8880  	}
  8881  	if tsup.Location != nil {
  8882  		objectMap["location"] = tsup.Location
  8883  	}
  8884  	if tsup.Tags != nil {
  8885  		objectMap["tags"] = tsup.Tags
  8886  	}
  8887  	return json.Marshal(objectMap)
  8888  }
  8889  
  8890  // UnmarshalJSON is the custom unmarshaler for ThroughputSettingsUpdateParameters struct.
  8891  func (tsup *ThroughputSettingsUpdateParameters) UnmarshalJSON(body []byte) error {
  8892  	var m map[string]*json.RawMessage
  8893  	err := json.Unmarshal(body, &m)
  8894  	if err != nil {
  8895  		return err
  8896  	}
  8897  	for k, v := range m {
  8898  		switch k {
  8899  		case "properties":
  8900  			if v != nil {
  8901  				var throughputSettingsUpdateProperties ThroughputSettingsUpdateProperties
  8902  				err = json.Unmarshal(*v, &throughputSettingsUpdateProperties)
  8903  				if err != nil {
  8904  					return err
  8905  				}
  8906  				tsup.ThroughputSettingsUpdateProperties = &throughputSettingsUpdateProperties
  8907  			}
  8908  		case "id":
  8909  			if v != nil {
  8910  				var ID string
  8911  				err = json.Unmarshal(*v, &ID)
  8912  				if err != nil {
  8913  					return err
  8914  				}
  8915  				tsup.ID = &ID
  8916  			}
  8917  		case "name":
  8918  			if v != nil {
  8919  				var name string
  8920  				err = json.Unmarshal(*v, &name)
  8921  				if err != nil {
  8922  					return err
  8923  				}
  8924  				tsup.Name = &name
  8925  			}
  8926  		case "type":
  8927  			if v != nil {
  8928  				var typeVar string
  8929  				err = json.Unmarshal(*v, &typeVar)
  8930  				if err != nil {
  8931  					return err
  8932  				}
  8933  				tsup.Type = &typeVar
  8934  			}
  8935  		case "location":
  8936  			if v != nil {
  8937  				var location string
  8938  				err = json.Unmarshal(*v, &location)
  8939  				if err != nil {
  8940  					return err
  8941  				}
  8942  				tsup.Location = &location
  8943  			}
  8944  		case "tags":
  8945  			if v != nil {
  8946  				var tags map[string]*string
  8947  				err = json.Unmarshal(*v, &tags)
  8948  				if err != nil {
  8949  					return err
  8950  				}
  8951  				tsup.Tags = tags
  8952  			}
  8953  		}
  8954  	}
  8955  
  8956  	return nil
  8957  }
  8958  
  8959  // ThroughputSettingsUpdateProperties properties to update Azure Cosmos DB resource throughput.
  8960  type ThroughputSettingsUpdateProperties struct {
  8961  	// Resource - The standard JSON format of a resource throughput
  8962  	Resource *ThroughputSettingsResource `json:"resource,omitempty"`
  8963  }
  8964  
  8965  // TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
  8966  // which has 'tags' and a 'location'
  8967  type TrackedResource struct {
  8968  	// Tags - Resource tags.
  8969  	Tags map[string]*string `json:"tags"`
  8970  	// Location - The geo-location where the resource lives
  8971  	Location *string `json:"location,omitempty"`
  8972  	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
  8973  	ID *string `json:"id,omitempty"`
  8974  	// Name - READ-ONLY; The name of the resource
  8975  	Name *string `json:"name,omitempty"`
  8976  	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
  8977  	Type *string `json:"type,omitempty"`
  8978  }
  8979  
  8980  // MarshalJSON is the custom marshaler for TrackedResource.
  8981  func (tr TrackedResource) MarshalJSON() ([]byte, error) {
  8982  	objectMap := make(map[string]interface{})
  8983  	if tr.Tags != nil {
  8984  		objectMap["tags"] = tr.Tags
  8985  	}
  8986  	if tr.Location != nil {
  8987  		objectMap["location"] = tr.Location
  8988  	}
  8989  	return json.Marshal(objectMap)
  8990  }
  8991  
  8992  // UniqueKey the unique key on that enforces uniqueness constraint on documents in the collection in the
  8993  // Azure Cosmos DB service.
  8994  type UniqueKey struct {
  8995  	// Paths - List of paths must be unique for each document in the Azure Cosmos DB service
  8996  	Paths *[]string `json:"paths,omitempty"`
  8997  }
  8998  
  8999  // UniqueKeyPolicy the unique key policy configuration for specifying uniqueness constraints on documents
  9000  // in the collection in the Azure Cosmos DB service.
  9001  type UniqueKeyPolicy struct {
  9002  	// UniqueKeys - List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.
  9003  	UniqueKeys *[]UniqueKey `json:"uniqueKeys,omitempty"`
  9004  }
  9005  
  9006  // Usage the usage data for a usage request.
  9007  type Usage struct {
  9008  	// Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'
  9009  	Unit UnitType `json:"unit,omitempty"`
  9010  	// Name - READ-ONLY; The name information for the metric.
  9011  	Name *MetricName `json:"name,omitempty"`
  9012  	// QuotaPeriod - READ-ONLY; The quota period used to summarize the usage values.
  9013  	QuotaPeriod *string `json:"quotaPeriod,omitempty"`
  9014  	// Limit - READ-ONLY; Maximum value for this metric
  9015  	Limit *int64 `json:"limit,omitempty"`
  9016  	// CurrentValue - READ-ONLY; Current value for this metric
  9017  	CurrentValue *int64 `json:"currentValue,omitempty"`
  9018  }
  9019  
  9020  // MarshalJSON is the custom marshaler for Usage.
  9021  func (u Usage) MarshalJSON() ([]byte, error) {
  9022  	objectMap := make(map[string]interface{})
  9023  	if u.Unit != "" {
  9024  		objectMap["unit"] = u.Unit
  9025  	}
  9026  	return json.Marshal(objectMap)
  9027  }
  9028  
  9029  // UsagesResult the response to a list usage request.
  9030  type UsagesResult struct {
  9031  	autorest.Response `json:"-"`
  9032  	// Value - READ-ONLY; The list of usages for the database. A usage is a point in time metric
  9033  	Value *[]Usage `json:"value,omitempty"`
  9034  }
  9035  
  9036  // MarshalJSON is the custom marshaler for UsagesResult.
  9037  func (ur UsagesResult) MarshalJSON() ([]byte, error) {
  9038  	objectMap := make(map[string]interface{})
  9039  	return json.Marshal(objectMap)
  9040  }
  9041  
  9042  // VirtualNetworkRule virtual Network ACL Rule object
  9043  type VirtualNetworkRule struct {
  9044  	// ID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
  9045  	ID *string `json:"id,omitempty"`
  9046  	// IgnoreMissingVNetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled.
  9047  	IgnoreMissingVNetServiceEndpoint *bool `json:"ignoreMissingVNetServiceEndpoint,omitempty"`
  9048  }
  9049  

View as plain text