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