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