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