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/preview/cosmos-db/mgmt/2021-04-01-preview/documentdb"
22
23
24 type APIProperties struct {
25
26 ServerVersion ServerVersion `json:"serverVersion,omitempty"`
27 }
28
29
30
31 type ARMProxyResource struct {
32
33 ID *string `json:"id,omitempty"`
34
35 Name *string `json:"name,omitempty"`
36
37 Type *string `json:"type,omitempty"`
38 }
39
40
41 func (apr ARMProxyResource) MarshalJSON() ([]byte, error) {
42 objectMap := make(map[string]interface{})
43 return json.Marshal(objectMap)
44 }
45
46
47 type ARMResourceProperties struct {
48
49 ID *string `json:"id,omitempty"`
50
51 Name *string `json:"name,omitempty"`
52
53 Type *string `json:"type,omitempty"`
54
55 Location *string `json:"location,omitempty"`
56 Tags map[string]*string `json:"tags"`
57 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
58 }
59
60
61 func (arp ARMResourceProperties) MarshalJSON() ([]byte, error) {
62 objectMap := make(map[string]interface{})
63 if arp.Location != nil {
64 objectMap["location"] = arp.Location
65 }
66 if arp.Tags != nil {
67 objectMap["tags"] = arp.Tags
68 }
69 if arp.Identity != nil {
70 objectMap["identity"] = arp.Identity
71 }
72 return json.Marshal(objectMap)
73 }
74
75
76 type AutoscaleSettings struct {
77
78 MaxThroughput *int32 `json:"maxThroughput,omitempty"`
79 }
80
81
82 type AutoscaleSettingsResource struct {
83
84 MaxThroughput *int32 `json:"maxThroughput,omitempty"`
85
86 AutoUpgradePolicy *AutoUpgradePolicyResource `json:"autoUpgradePolicy,omitempty"`
87
88 TargetMaxThroughput *int32 `json:"targetMaxThroughput,omitempty"`
89 }
90
91
92 func (asr AutoscaleSettingsResource) MarshalJSON() ([]byte, error) {
93 objectMap := make(map[string]interface{})
94 if asr.MaxThroughput != nil {
95 objectMap["maxThroughput"] = asr.MaxThroughput
96 }
97 if asr.AutoUpgradePolicy != nil {
98 objectMap["autoUpgradePolicy"] = asr.AutoUpgradePolicy
99 }
100 return json.Marshal(objectMap)
101 }
102
103
104 type AutoUpgradePolicyResource struct {
105
106 ThroughputPolicy *ThroughputPolicyResource `json:"throughputPolicy,omitempty"`
107 }
108
109
110 type AzureEntityResource struct {
111
112 Etag *string `json:"etag,omitempty"`
113
114 ID *string `json:"id,omitempty"`
115
116 Name *string `json:"name,omitempty"`
117
118 Type *string `json:"type,omitempty"`
119 }
120
121
122 func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
123 objectMap := make(map[string]interface{})
124 return json.Marshal(objectMap)
125 }
126
127
128 type BackupInformation struct {
129 autorest.Response `json:"-"`
130 ContinuousBackupInformation *ContinuousBackupInformation `json:"continuousBackupInformation,omitempty"`
131 }
132
133
134 type BasicBackupPolicy interface {
135 AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool)
136 AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool)
137 AsBackupPolicy() (*BackupPolicy, bool)
138 }
139
140
141 type BackupPolicy struct {
142
143 Type Type `json:"type,omitempty"`
144 }
145
146 func unmarshalBasicBackupPolicy(body []byte) (BasicBackupPolicy, error) {
147 var m map[string]interface{}
148 err := json.Unmarshal(body, &m)
149 if err != nil {
150 return nil, err
151 }
152
153 switch m["type"] {
154 case string(TypePeriodic):
155 var pmbp PeriodicModeBackupPolicy
156 err := json.Unmarshal(body, &pmbp)
157 return pmbp, err
158 case string(TypeContinuous):
159 var cmbp ContinuousModeBackupPolicy
160 err := json.Unmarshal(body, &cmbp)
161 return cmbp, err
162 default:
163 var bp BackupPolicy
164 err := json.Unmarshal(body, &bp)
165 return bp, err
166 }
167 }
168 func unmarshalBasicBackupPolicyArray(body []byte) ([]BasicBackupPolicy, error) {
169 var rawMessages []*json.RawMessage
170 err := json.Unmarshal(body, &rawMessages)
171 if err != nil {
172 return nil, err
173 }
174
175 bpArray := make([]BasicBackupPolicy, len(rawMessages))
176
177 for index, rawMessage := range rawMessages {
178 bp, err := unmarshalBasicBackupPolicy(*rawMessage)
179 if err != nil {
180 return nil, err
181 }
182 bpArray[index] = bp
183 }
184 return bpArray, nil
185 }
186
187
188 func (bp BackupPolicy) MarshalJSON() ([]byte, error) {
189 bp.Type = TypeBackupPolicy
190 objectMap := make(map[string]interface{})
191 if bp.Type != "" {
192 objectMap["type"] = bp.Type
193 }
194 return json.Marshal(objectMap)
195 }
196
197
198 func (bp BackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) {
199 return nil, false
200 }
201
202
203 func (bp BackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) {
204 return nil, false
205 }
206
207
208 func (bp BackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) {
209 return &bp, true
210 }
211
212
213 func (bp BackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) {
214 return &bp, true
215 }
216
217
218 type BackupResource struct {
219 autorest.Response `json:"-"`
220 Properties *BackupResourceProperties `json:"properties,omitempty"`
221
222 ID *string `json:"id,omitempty"`
223
224 Name *string `json:"name,omitempty"`
225
226 Type *string `json:"type,omitempty"`
227 }
228
229
230 func (br BackupResource) MarshalJSON() ([]byte, error) {
231 objectMap := make(map[string]interface{})
232 if br.Properties != nil {
233 objectMap["properties"] = br.Properties
234 }
235 return json.Marshal(objectMap)
236 }
237
238
239 type BackupResourceProperties struct {
240
241 Timestamp *date.Time `json:"timestamp,omitempty"`
242 }
243
244
245 type Capability struct {
246
247 Name *string `json:"name,omitempty"`
248 }
249
250
251
252 type CassandraClustersCreateUpdateFuture struct {
253 azure.FutureAPI
254
255
256 Result func(CassandraClustersClient) (ClusterResource, error)
257 }
258
259
260 func (future *CassandraClustersCreateUpdateFuture) UnmarshalJSON(body []byte) error {
261 var azFuture azure.Future
262 if err := json.Unmarshal(body, &azFuture); err != nil {
263 return err
264 }
265 future.FutureAPI = &azFuture
266 future.Result = future.result
267 return nil
268 }
269
270
271 func (future *CassandraClustersCreateUpdateFuture) result(client CassandraClustersClient) (cr ClusterResource, err error) {
272 var done bool
273 done, err = future.DoneWithContext(context.Background(), client)
274 if err != nil {
275 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersCreateUpdateFuture", "Result", future.Response(), "Polling failure")
276 return
277 }
278 if !done {
279 cr.Response.Response = future.Response()
280 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersCreateUpdateFuture")
281 return
282 }
283 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
284 if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent {
285 cr, err = client.CreateUpdateResponder(cr.Response.Response)
286 if err != nil {
287 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersCreateUpdateFuture", "Result", cr.Response.Response, "Failure responding to request")
288 }
289 }
290 return
291 }
292
293
294
295 type CassandraClustersDeleteFuture struct {
296 azure.FutureAPI
297
298
299 Result func(CassandraClustersClient) (autorest.Response, error)
300 }
301
302
303 func (future *CassandraClustersDeleteFuture) UnmarshalJSON(body []byte) error {
304 var azFuture azure.Future
305 if err := json.Unmarshal(body, &azFuture); err != nil {
306 return err
307 }
308 future.FutureAPI = &azFuture
309 future.Result = future.result
310 return nil
311 }
312
313
314 func (future *CassandraClustersDeleteFuture) result(client CassandraClustersClient) (ar autorest.Response, err error) {
315 var done bool
316 done, err = future.DoneWithContext(context.Background(), client)
317 if err != nil {
318 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersDeleteFuture", "Result", future.Response(), "Polling failure")
319 return
320 }
321 if !done {
322 ar.Response = future.Response()
323 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersDeleteFuture")
324 return
325 }
326 ar.Response = future.Response()
327 return
328 }
329
330
331
332 type CassandraClustersFetchNodeStatusFuture struct {
333 azure.FutureAPI
334
335
336 Result func(CassandraClustersClient) (ClusterNodeStatus, error)
337 }
338
339
340 func (future *CassandraClustersFetchNodeStatusFuture) UnmarshalJSON(body []byte) error {
341 var azFuture azure.Future
342 if err := json.Unmarshal(body, &azFuture); err != nil {
343 return err
344 }
345 future.FutureAPI = &azFuture
346 future.Result = future.result
347 return nil
348 }
349
350
351 func (future *CassandraClustersFetchNodeStatusFuture) result(client CassandraClustersClient) (cns ClusterNodeStatus, err error) {
352 var done bool
353 done, err = future.DoneWithContext(context.Background(), client)
354 if err != nil {
355 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersFetchNodeStatusFuture", "Result", future.Response(), "Polling failure")
356 return
357 }
358 if !done {
359 cns.Response.Response = future.Response()
360 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersFetchNodeStatusFuture")
361 return
362 }
363 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
364 if cns.Response.Response, err = future.GetResult(sender); err == nil && cns.Response.Response.StatusCode != http.StatusNoContent {
365 cns, err = client.FetchNodeStatusResponder(cns.Response.Response)
366 if err != nil {
367 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersFetchNodeStatusFuture", "Result", cns.Response.Response, "Failure responding to request")
368 }
369 }
370 return
371 }
372
373
374
375 type CassandraClustersRequestRepairFuture struct {
376 azure.FutureAPI
377
378
379 Result func(CassandraClustersClient) (autorest.Response, error)
380 }
381
382
383 func (future *CassandraClustersRequestRepairFuture) UnmarshalJSON(body []byte) error {
384 var azFuture azure.Future
385 if err := json.Unmarshal(body, &azFuture); err != nil {
386 return err
387 }
388 future.FutureAPI = &azFuture
389 future.Result = future.result
390 return nil
391 }
392
393
394 func (future *CassandraClustersRequestRepairFuture) result(client CassandraClustersClient) (ar autorest.Response, err error) {
395 var done bool
396 done, err = future.DoneWithContext(context.Background(), client)
397 if err != nil {
398 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersRequestRepairFuture", "Result", future.Response(), "Polling failure")
399 return
400 }
401 if !done {
402 ar.Response = future.Response()
403 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersRequestRepairFuture")
404 return
405 }
406 ar.Response = future.Response()
407 return
408 }
409
410
411
412 type CassandraClustersUpdateFuture struct {
413 azure.FutureAPI
414
415
416 Result func(CassandraClustersClient) (ClusterResource, error)
417 }
418
419
420 func (future *CassandraClustersUpdateFuture) UnmarshalJSON(body []byte) error {
421 var azFuture azure.Future
422 if err := json.Unmarshal(body, &azFuture); err != nil {
423 return err
424 }
425 future.FutureAPI = &azFuture
426 future.Result = future.result
427 return nil
428 }
429
430
431 func (future *CassandraClustersUpdateFuture) result(client CassandraClustersClient) (cr ClusterResource, err error) {
432 var done bool
433 done, err = future.DoneWithContext(context.Background(), client)
434 if err != nil {
435 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersUpdateFuture", "Result", future.Response(), "Polling failure")
436 return
437 }
438 if !done {
439 cr.Response.Response = future.Response()
440 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersUpdateFuture")
441 return
442 }
443 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
444 if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent {
445 cr, err = client.UpdateResponder(cr.Response.Response)
446 if err != nil {
447 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersUpdateFuture", "Result", cr.Response.Response, "Failure responding to request")
448 }
449 }
450 return
451 }
452
453
454
455 type CassandraDataCentersCreateUpdateFuture struct {
456 azure.FutureAPI
457
458
459 Result func(CassandraDataCentersClient) (DataCenterResource, error)
460 }
461
462
463 func (future *CassandraDataCentersCreateUpdateFuture) UnmarshalJSON(body []byte) error {
464 var azFuture azure.Future
465 if err := json.Unmarshal(body, &azFuture); err != nil {
466 return err
467 }
468 future.FutureAPI = &azFuture
469 future.Result = future.result
470 return nil
471 }
472
473
474 func (future *CassandraDataCentersCreateUpdateFuture) result(client CassandraDataCentersClient) (dcr DataCenterResource, err error) {
475 var done bool
476 done, err = future.DoneWithContext(context.Background(), client)
477 if err != nil {
478 err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersCreateUpdateFuture", "Result", future.Response(), "Polling failure")
479 return
480 }
481 if !done {
482 dcr.Response.Response = future.Response()
483 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraDataCentersCreateUpdateFuture")
484 return
485 }
486 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
487 if dcr.Response.Response, err = future.GetResult(sender); err == nil && dcr.Response.Response.StatusCode != http.StatusNoContent {
488 dcr, err = client.CreateUpdateResponder(dcr.Response.Response)
489 if err != nil {
490 err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersCreateUpdateFuture", "Result", dcr.Response.Response, "Failure responding to request")
491 }
492 }
493 return
494 }
495
496
497
498 type CassandraDataCentersDeleteFuture struct {
499 azure.FutureAPI
500
501
502 Result func(CassandraDataCentersClient) (autorest.Response, error)
503 }
504
505
506 func (future *CassandraDataCentersDeleteFuture) UnmarshalJSON(body []byte) error {
507 var azFuture azure.Future
508 if err := json.Unmarshal(body, &azFuture); err != nil {
509 return err
510 }
511 future.FutureAPI = &azFuture
512 future.Result = future.result
513 return nil
514 }
515
516
517 func (future *CassandraDataCentersDeleteFuture) result(client CassandraDataCentersClient) (ar autorest.Response, err error) {
518 var done bool
519 done, err = future.DoneWithContext(context.Background(), client)
520 if err != nil {
521 err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersDeleteFuture", "Result", future.Response(), "Polling failure")
522 return
523 }
524 if !done {
525 ar.Response = future.Response()
526 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraDataCentersDeleteFuture")
527 return
528 }
529 ar.Response = future.Response()
530 return
531 }
532
533
534
535 type CassandraDataCentersUpdateFuture struct {
536 azure.FutureAPI
537
538
539 Result func(CassandraDataCentersClient) (DataCenterResource, error)
540 }
541
542
543 func (future *CassandraDataCentersUpdateFuture) UnmarshalJSON(body []byte) error {
544 var azFuture azure.Future
545 if err := json.Unmarshal(body, &azFuture); err != nil {
546 return err
547 }
548 future.FutureAPI = &azFuture
549 future.Result = future.result
550 return nil
551 }
552
553
554 func (future *CassandraDataCentersUpdateFuture) result(client CassandraDataCentersClient) (dcr DataCenterResource, err error) {
555 var done bool
556 done, err = future.DoneWithContext(context.Background(), client)
557 if err != nil {
558 err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersUpdateFuture", "Result", future.Response(), "Polling failure")
559 return
560 }
561 if !done {
562 dcr.Response.Response = future.Response()
563 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraDataCentersUpdateFuture")
564 return
565 }
566 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
567 if dcr.Response.Response, err = future.GetResult(sender); err == nil && dcr.Response.Response.StatusCode != http.StatusNoContent {
568 dcr, err = client.UpdateResponder(dcr.Response.Response)
569 if err != nil {
570 err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersUpdateFuture", "Result", dcr.Response.Response, "Failure responding to request")
571 }
572 }
573 return
574 }
575
576
577 type CassandraKeyspaceCreateUpdateParameters struct {
578
579 *CassandraKeyspaceCreateUpdateProperties `json:"properties,omitempty"`
580
581 ID *string `json:"id,omitempty"`
582
583 Name *string `json:"name,omitempty"`
584
585 Type *string `json:"type,omitempty"`
586
587 Location *string `json:"location,omitempty"`
588 Tags map[string]*string `json:"tags"`
589 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
590 }
591
592
593 func (ckcup CassandraKeyspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) {
594 objectMap := make(map[string]interface{})
595 if ckcup.CassandraKeyspaceCreateUpdateProperties != nil {
596 objectMap["properties"] = ckcup.CassandraKeyspaceCreateUpdateProperties
597 }
598 if ckcup.Location != nil {
599 objectMap["location"] = ckcup.Location
600 }
601 if ckcup.Tags != nil {
602 objectMap["tags"] = ckcup.Tags
603 }
604 if ckcup.Identity != nil {
605 objectMap["identity"] = ckcup.Identity
606 }
607 return json.Marshal(objectMap)
608 }
609
610
611 func (ckcup *CassandraKeyspaceCreateUpdateParameters) UnmarshalJSON(body []byte) error {
612 var m map[string]*json.RawMessage
613 err := json.Unmarshal(body, &m)
614 if err != nil {
615 return err
616 }
617 for k, v := range m {
618 switch k {
619 case "properties":
620 if v != nil {
621 var cassandraKeyspaceCreateUpdateProperties CassandraKeyspaceCreateUpdateProperties
622 err = json.Unmarshal(*v, &cassandraKeyspaceCreateUpdateProperties)
623 if err != nil {
624 return err
625 }
626 ckcup.CassandraKeyspaceCreateUpdateProperties = &cassandraKeyspaceCreateUpdateProperties
627 }
628 case "id":
629 if v != nil {
630 var ID string
631 err = json.Unmarshal(*v, &ID)
632 if err != nil {
633 return err
634 }
635 ckcup.ID = &ID
636 }
637 case "name":
638 if v != nil {
639 var name string
640 err = json.Unmarshal(*v, &name)
641 if err != nil {
642 return err
643 }
644 ckcup.Name = &name
645 }
646 case "type":
647 if v != nil {
648 var typeVar string
649 err = json.Unmarshal(*v, &typeVar)
650 if err != nil {
651 return err
652 }
653 ckcup.Type = &typeVar
654 }
655 case "location":
656 if v != nil {
657 var location string
658 err = json.Unmarshal(*v, &location)
659 if err != nil {
660 return err
661 }
662 ckcup.Location = &location
663 }
664 case "tags":
665 if v != nil {
666 var tags map[string]*string
667 err = json.Unmarshal(*v, &tags)
668 if err != nil {
669 return err
670 }
671 ckcup.Tags = tags
672 }
673 case "identity":
674 if v != nil {
675 var identity ManagedServiceIdentity
676 err = json.Unmarshal(*v, &identity)
677 if err != nil {
678 return err
679 }
680 ckcup.Identity = &identity
681 }
682 }
683 }
684
685 return nil
686 }
687
688
689
690 type CassandraKeyspaceCreateUpdateProperties struct {
691
692 Resource *CassandraKeyspaceResource `json:"resource,omitempty"`
693
694 Options *CreateUpdateOptions `json:"options,omitempty"`
695 }
696
697
698 type CassandraKeyspaceGetProperties struct {
699 Resource *CassandraKeyspaceGetPropertiesResource `json:"resource,omitempty"`
700 Options *CassandraKeyspaceGetPropertiesOptions `json:"options,omitempty"`
701 }
702
703
704 type CassandraKeyspaceGetPropertiesOptions struct {
705
706 Throughput *int32 `json:"throughput,omitempty"`
707
708 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
709 }
710
711
712 type CassandraKeyspaceGetPropertiesResource struct {
713
714 ID *string `json:"id,omitempty"`
715
716 Rid *string `json:"_rid,omitempty"`
717
718 Ts *float64 `json:"_ts,omitempty"`
719
720 Etag *string `json:"_etag,omitempty"`
721 }
722
723
724 func (ckgp CassandraKeyspaceGetPropertiesResource) MarshalJSON() ([]byte, error) {
725 objectMap := make(map[string]interface{})
726 if ckgp.ID != nil {
727 objectMap["id"] = ckgp.ID
728 }
729 return json.Marshal(objectMap)
730 }
731
732
733 type CassandraKeyspaceGetResults struct {
734 autorest.Response `json:"-"`
735
736 *CassandraKeyspaceGetProperties `json:"properties,omitempty"`
737
738 ID *string `json:"id,omitempty"`
739
740 Name *string `json:"name,omitempty"`
741
742 Type *string `json:"type,omitempty"`
743
744 Location *string `json:"location,omitempty"`
745 Tags map[string]*string `json:"tags"`
746 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
747 }
748
749
750 func (ckgr CassandraKeyspaceGetResults) MarshalJSON() ([]byte, error) {
751 objectMap := make(map[string]interface{})
752 if ckgr.CassandraKeyspaceGetProperties != nil {
753 objectMap["properties"] = ckgr.CassandraKeyspaceGetProperties
754 }
755 if ckgr.Location != nil {
756 objectMap["location"] = ckgr.Location
757 }
758 if ckgr.Tags != nil {
759 objectMap["tags"] = ckgr.Tags
760 }
761 if ckgr.Identity != nil {
762 objectMap["identity"] = ckgr.Identity
763 }
764 return json.Marshal(objectMap)
765 }
766
767
768 func (ckgr *CassandraKeyspaceGetResults) UnmarshalJSON(body []byte) error {
769 var m map[string]*json.RawMessage
770 err := json.Unmarshal(body, &m)
771 if err != nil {
772 return err
773 }
774 for k, v := range m {
775 switch k {
776 case "properties":
777 if v != nil {
778 var cassandraKeyspaceGetProperties CassandraKeyspaceGetProperties
779 err = json.Unmarshal(*v, &cassandraKeyspaceGetProperties)
780 if err != nil {
781 return err
782 }
783 ckgr.CassandraKeyspaceGetProperties = &cassandraKeyspaceGetProperties
784 }
785 case "id":
786 if v != nil {
787 var ID string
788 err = json.Unmarshal(*v, &ID)
789 if err != nil {
790 return err
791 }
792 ckgr.ID = &ID
793 }
794 case "name":
795 if v != nil {
796 var name string
797 err = json.Unmarshal(*v, &name)
798 if err != nil {
799 return err
800 }
801 ckgr.Name = &name
802 }
803 case "type":
804 if v != nil {
805 var typeVar string
806 err = json.Unmarshal(*v, &typeVar)
807 if err != nil {
808 return err
809 }
810 ckgr.Type = &typeVar
811 }
812 case "location":
813 if v != nil {
814 var location string
815 err = json.Unmarshal(*v, &location)
816 if err != nil {
817 return err
818 }
819 ckgr.Location = &location
820 }
821 case "tags":
822 if v != nil {
823 var tags map[string]*string
824 err = json.Unmarshal(*v, &tags)
825 if err != nil {
826 return err
827 }
828 ckgr.Tags = tags
829 }
830 case "identity":
831 if v != nil {
832 var identity ManagedServiceIdentity
833 err = json.Unmarshal(*v, &identity)
834 if err != nil {
835 return err
836 }
837 ckgr.Identity = &identity
838 }
839 }
840 }
841
842 return nil
843 }
844
845
846
847 type CassandraKeyspaceListResult struct {
848 autorest.Response `json:"-"`
849
850 Value *[]CassandraKeyspaceGetResults `json:"value,omitempty"`
851 }
852
853
854 func (cklr CassandraKeyspaceListResult) MarshalJSON() ([]byte, error) {
855 objectMap := make(map[string]interface{})
856 return json.Marshal(objectMap)
857 }
858
859
860 type CassandraKeyspaceResource struct {
861
862 ID *string `json:"id,omitempty"`
863 }
864
865
866 type CassandraPartitionKey struct {
867
868 Name *string `json:"name,omitempty"`
869 }
870
871
872
873 type CassandraResourcesCreateUpdateCassandraKeyspaceFuture struct {
874 azure.FutureAPI
875
876
877 Result func(CassandraResourcesClient) (CassandraKeyspaceGetResults, error)
878 }
879
880
881 func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error {
882 var azFuture azure.Future
883 if err := json.Unmarshal(body, &azFuture); err != nil {
884 return err
885 }
886 future.FutureAPI = &azFuture
887 future.Result = future.result
888 return nil
889 }
890
891
892 func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ckgr CassandraKeyspaceGetResults, err error) {
893 var done bool
894 done, err = future.DoneWithContext(context.Background(), client)
895 if err != nil {
896 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure")
897 return
898 }
899 if !done {
900 ckgr.Response.Response = future.Response()
901 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture")
902 return
903 }
904 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
905 if ckgr.Response.Response, err = future.GetResult(sender); err == nil && ckgr.Response.Response.StatusCode != http.StatusNoContent {
906 ckgr, err = client.CreateUpdateCassandraKeyspaceResponder(ckgr.Response.Response)
907 if err != nil {
908 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", ckgr.Response.Response, "Failure responding to request")
909 }
910 }
911 return
912 }
913
914
915
916 type CassandraResourcesCreateUpdateCassandraTableFuture struct {
917 azure.FutureAPI
918
919
920 Result func(CassandraResourcesClient) (CassandraTableGetResults, error)
921 }
922
923
924 func (future *CassandraResourcesCreateUpdateCassandraTableFuture) UnmarshalJSON(body []byte) error {
925 var azFuture azure.Future
926 if err := json.Unmarshal(body, &azFuture); err != nil {
927 return err
928 }
929 future.FutureAPI = &azFuture
930 future.Result = future.result
931 return nil
932 }
933
934
935 func (future *CassandraResourcesCreateUpdateCassandraTableFuture) result(client CassandraResourcesClient) (ctgr CassandraTableGetResults, err error) {
936 var done bool
937 done, err = future.DoneWithContext(context.Background(), client)
938 if err != nil {
939 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", future.Response(), "Polling failure")
940 return
941 }
942 if !done {
943 ctgr.Response.Response = future.Response()
944 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraTableFuture")
945 return
946 }
947 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
948 if ctgr.Response.Response, err = future.GetResult(sender); err == nil && ctgr.Response.Response.StatusCode != http.StatusNoContent {
949 ctgr, err = client.CreateUpdateCassandraTableResponder(ctgr.Response.Response)
950 if err != nil {
951 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", ctgr.Response.Response, "Failure responding to request")
952 }
953 }
954 return
955 }
956
957
958
959 type CassandraResourcesDeleteCassandraKeyspaceFuture struct {
960 azure.FutureAPI
961
962
963 Result func(CassandraResourcesClient) (autorest.Response, error)
964 }
965
966
967 func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error {
968 var azFuture azure.Future
969 if err := json.Unmarshal(body, &azFuture); err != nil {
970 return err
971 }
972 future.FutureAPI = &azFuture
973 future.Result = future.result
974 return nil
975 }
976
977
978 func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) {
979 var done bool
980 done, err = future.DoneWithContext(context.Background(), client)
981 if err != nil {
982 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure")
983 return
984 }
985 if !done {
986 ar.Response = future.Response()
987 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture")
988 return
989 }
990 ar.Response = future.Response()
991 return
992 }
993
994
995
996 type CassandraResourcesDeleteCassandraTableFuture struct {
997 azure.FutureAPI
998
999
1000 Result func(CassandraResourcesClient) (autorest.Response, error)
1001 }
1002
1003
1004 func (future *CassandraResourcesDeleteCassandraTableFuture) UnmarshalJSON(body []byte) error {
1005 var azFuture azure.Future
1006 if err := json.Unmarshal(body, &azFuture); err != nil {
1007 return err
1008 }
1009 future.FutureAPI = &azFuture
1010 future.Result = future.result
1011 return nil
1012 }
1013
1014
1015 func (future *CassandraResourcesDeleteCassandraTableFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) {
1016 var done bool
1017 done, err = future.DoneWithContext(context.Background(), client)
1018 if err != nil {
1019 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraTableFuture", "Result", future.Response(), "Polling failure")
1020 return
1021 }
1022 if !done {
1023 ar.Response = future.Response()
1024 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraTableFuture")
1025 return
1026 }
1027 ar.Response = future.Response()
1028 return
1029 }
1030
1031
1032
1033 type CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture struct {
1034 azure.FutureAPI
1035
1036
1037 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
1038 }
1039
1040
1041 func (future *CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture) UnmarshalJSON(body []byte) error {
1042 var azFuture azure.Future
1043 if err := json.Unmarshal(body, &azFuture); err != nil {
1044 return err
1045 }
1046 future.FutureAPI = &azFuture
1047 future.Result = future.result
1048 return nil
1049 }
1050
1051
1052 func (future *CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
1053 var done bool
1054 done, err = future.DoneWithContext(context.Background(), client)
1055 if err != nil {
1056 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture", "Result", future.Response(), "Polling failure")
1057 return
1058 }
1059 if !done {
1060 tsgr.Response.Response = future.Response()
1061 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture")
1062 return
1063 }
1064 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1065 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
1066 tsgr, err = client.MigrateCassandraKeyspaceToAutoscaleResponder(tsgr.Response.Response)
1067 if err != nil {
1068 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
1069 }
1070 }
1071 return
1072 }
1073
1074
1075
1076 type CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture struct {
1077 azure.FutureAPI
1078
1079
1080 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
1081 }
1082
1083
1084 func (future *CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture) UnmarshalJSON(body []byte) error {
1085 var azFuture azure.Future
1086 if err := json.Unmarshal(body, &azFuture); err != nil {
1087 return err
1088 }
1089 future.FutureAPI = &azFuture
1090 future.Result = future.result
1091 return nil
1092 }
1093
1094
1095 func (future *CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
1096 var done bool
1097 done, err = future.DoneWithContext(context.Background(), client)
1098 if err != nil {
1099 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture", "Result", future.Response(), "Polling failure")
1100 return
1101 }
1102 if !done {
1103 tsgr.Response.Response = future.Response()
1104 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture")
1105 return
1106 }
1107 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1108 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
1109 tsgr, err = client.MigrateCassandraKeyspaceToManualThroughputResponder(tsgr.Response.Response)
1110 if err != nil {
1111 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
1112 }
1113 }
1114 return
1115 }
1116
1117
1118
1119 type CassandraResourcesMigrateCassandraTableToAutoscaleFuture struct {
1120 azure.FutureAPI
1121
1122
1123 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
1124 }
1125
1126
1127 func (future *CassandraResourcesMigrateCassandraTableToAutoscaleFuture) UnmarshalJSON(body []byte) error {
1128 var azFuture azure.Future
1129 if err := json.Unmarshal(body, &azFuture); err != nil {
1130 return err
1131 }
1132 future.FutureAPI = &azFuture
1133 future.Result = future.result
1134 return nil
1135 }
1136
1137
1138 func (future *CassandraResourcesMigrateCassandraTableToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
1139 var done bool
1140 done, err = future.DoneWithContext(context.Background(), client)
1141 if err != nil {
1142 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture", "Result", future.Response(), "Polling failure")
1143 return
1144 }
1145 if !done {
1146 tsgr.Response.Response = future.Response()
1147 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture")
1148 return
1149 }
1150 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1151 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
1152 tsgr, err = client.MigrateCassandraTableToAutoscaleResponder(tsgr.Response.Response)
1153 if err != nil {
1154 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
1155 }
1156 }
1157 return
1158 }
1159
1160
1161
1162 type CassandraResourcesMigrateCassandraTableToManualThroughputFuture struct {
1163 azure.FutureAPI
1164
1165
1166 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
1167 }
1168
1169
1170 func (future *CassandraResourcesMigrateCassandraTableToManualThroughputFuture) UnmarshalJSON(body []byte) error {
1171 var azFuture azure.Future
1172 if err := json.Unmarshal(body, &azFuture); err != nil {
1173 return err
1174 }
1175 future.FutureAPI = &azFuture
1176 future.Result = future.result
1177 return nil
1178 }
1179
1180
1181 func (future *CassandraResourcesMigrateCassandraTableToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
1182 var done bool
1183 done, err = future.DoneWithContext(context.Background(), client)
1184 if err != nil {
1185 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture", "Result", future.Response(), "Polling failure")
1186 return
1187 }
1188 if !done {
1189 tsgr.Response.Response = future.Response()
1190 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture")
1191 return
1192 }
1193 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1194 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
1195 tsgr, err = client.MigrateCassandraTableToManualThroughputResponder(tsgr.Response.Response)
1196 if err != nil {
1197 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
1198 }
1199 }
1200 return
1201 }
1202
1203
1204
1205 type CassandraResourcesUpdateCassandraKeyspaceThroughputFuture struct {
1206 azure.FutureAPI
1207
1208
1209 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
1210 }
1211
1212
1213 func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) UnmarshalJSON(body []byte) error {
1214 var azFuture azure.Future
1215 if err := json.Unmarshal(body, &azFuture); err != nil {
1216 return err
1217 }
1218 future.FutureAPI = &azFuture
1219 future.Result = future.result
1220 return nil
1221 }
1222
1223
1224 func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
1225 var done bool
1226 done, err = future.DoneWithContext(context.Background(), client)
1227 if err != nil {
1228 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", future.Response(), "Polling failure")
1229 return
1230 }
1231 if !done {
1232 tsgr.Response.Response = future.Response()
1233 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture")
1234 return
1235 }
1236 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1237 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
1238 tsgr, err = client.UpdateCassandraKeyspaceThroughputResponder(tsgr.Response.Response)
1239 if err != nil {
1240 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
1241 }
1242 }
1243 return
1244 }
1245
1246
1247
1248 type CassandraResourcesUpdateCassandraTableThroughputFuture struct {
1249 azure.FutureAPI
1250
1251
1252 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
1253 }
1254
1255
1256 func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) UnmarshalJSON(body []byte) error {
1257 var azFuture azure.Future
1258 if err := json.Unmarshal(body, &azFuture); err != nil {
1259 return err
1260 }
1261 future.FutureAPI = &azFuture
1262 future.Result = future.result
1263 return nil
1264 }
1265
1266
1267 func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
1268 var done bool
1269 done, err = future.DoneWithContext(context.Background(), client)
1270 if err != nil {
1271 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", future.Response(), "Polling failure")
1272 return
1273 }
1274 if !done {
1275 tsgr.Response.Response = future.Response()
1276 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture")
1277 return
1278 }
1279 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1280 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
1281 tsgr, err = client.UpdateCassandraTableThroughputResponder(tsgr.Response.Response)
1282 if err != nil {
1283 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
1284 }
1285 }
1286 return
1287 }
1288
1289
1290 type CassandraSchema struct {
1291
1292 Columns *[]Column `json:"columns,omitempty"`
1293
1294 PartitionKeys *[]CassandraPartitionKey `json:"partitionKeys,omitempty"`
1295
1296 ClusterKeys *[]ClusterKey `json:"clusterKeys,omitempty"`
1297 }
1298
1299
1300 type CassandraTableCreateUpdateParameters struct {
1301
1302 *CassandraTableCreateUpdateProperties `json:"properties,omitempty"`
1303
1304 ID *string `json:"id,omitempty"`
1305
1306 Name *string `json:"name,omitempty"`
1307
1308 Type *string `json:"type,omitempty"`
1309
1310 Location *string `json:"location,omitempty"`
1311 Tags map[string]*string `json:"tags"`
1312 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
1313 }
1314
1315
1316 func (ctcup CassandraTableCreateUpdateParameters) MarshalJSON() ([]byte, error) {
1317 objectMap := make(map[string]interface{})
1318 if ctcup.CassandraTableCreateUpdateProperties != nil {
1319 objectMap["properties"] = ctcup.CassandraTableCreateUpdateProperties
1320 }
1321 if ctcup.Location != nil {
1322 objectMap["location"] = ctcup.Location
1323 }
1324 if ctcup.Tags != nil {
1325 objectMap["tags"] = ctcup.Tags
1326 }
1327 if ctcup.Identity != nil {
1328 objectMap["identity"] = ctcup.Identity
1329 }
1330 return json.Marshal(objectMap)
1331 }
1332
1333
1334 func (ctcup *CassandraTableCreateUpdateParameters) UnmarshalJSON(body []byte) error {
1335 var m map[string]*json.RawMessage
1336 err := json.Unmarshal(body, &m)
1337 if err != nil {
1338 return err
1339 }
1340 for k, v := range m {
1341 switch k {
1342 case "properties":
1343 if v != nil {
1344 var cassandraTableCreateUpdateProperties CassandraTableCreateUpdateProperties
1345 err = json.Unmarshal(*v, &cassandraTableCreateUpdateProperties)
1346 if err != nil {
1347 return err
1348 }
1349 ctcup.CassandraTableCreateUpdateProperties = &cassandraTableCreateUpdateProperties
1350 }
1351 case "id":
1352 if v != nil {
1353 var ID string
1354 err = json.Unmarshal(*v, &ID)
1355 if err != nil {
1356 return err
1357 }
1358 ctcup.ID = &ID
1359 }
1360 case "name":
1361 if v != nil {
1362 var name string
1363 err = json.Unmarshal(*v, &name)
1364 if err != nil {
1365 return err
1366 }
1367 ctcup.Name = &name
1368 }
1369 case "type":
1370 if v != nil {
1371 var typeVar string
1372 err = json.Unmarshal(*v, &typeVar)
1373 if err != nil {
1374 return err
1375 }
1376 ctcup.Type = &typeVar
1377 }
1378 case "location":
1379 if v != nil {
1380 var location string
1381 err = json.Unmarshal(*v, &location)
1382 if err != nil {
1383 return err
1384 }
1385 ctcup.Location = &location
1386 }
1387 case "tags":
1388 if v != nil {
1389 var tags map[string]*string
1390 err = json.Unmarshal(*v, &tags)
1391 if err != nil {
1392 return err
1393 }
1394 ctcup.Tags = tags
1395 }
1396 case "identity":
1397 if v != nil {
1398 var identity ManagedServiceIdentity
1399 err = json.Unmarshal(*v, &identity)
1400 if err != nil {
1401 return err
1402 }
1403 ctcup.Identity = &identity
1404 }
1405 }
1406 }
1407
1408 return nil
1409 }
1410
1411
1412 type CassandraTableCreateUpdateProperties struct {
1413
1414 Resource *CassandraTableResource `json:"resource,omitempty"`
1415
1416 Options *CreateUpdateOptions `json:"options,omitempty"`
1417 }
1418
1419
1420 type CassandraTableGetProperties struct {
1421 Resource *CassandraTableGetPropertiesResource `json:"resource,omitempty"`
1422 Options *CassandraTableGetPropertiesOptions `json:"options,omitempty"`
1423 }
1424
1425
1426 type CassandraTableGetPropertiesOptions struct {
1427
1428 Throughput *int32 `json:"throughput,omitempty"`
1429
1430 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
1431 }
1432
1433
1434 type CassandraTableGetPropertiesResource struct {
1435
1436 ID *string `json:"id,omitempty"`
1437
1438 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
1439
1440 Schema *CassandraSchema `json:"schema,omitempty"`
1441
1442 AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"`
1443
1444 Rid *string `json:"_rid,omitempty"`
1445
1446 Ts *float64 `json:"_ts,omitempty"`
1447
1448 Etag *string `json:"_etag,omitempty"`
1449 }
1450
1451
1452 func (ctgp CassandraTableGetPropertiesResource) MarshalJSON() ([]byte, error) {
1453 objectMap := make(map[string]interface{})
1454 if ctgp.ID != nil {
1455 objectMap["id"] = ctgp.ID
1456 }
1457 if ctgp.DefaultTTL != nil {
1458 objectMap["defaultTtl"] = ctgp.DefaultTTL
1459 }
1460 if ctgp.Schema != nil {
1461 objectMap["schema"] = ctgp.Schema
1462 }
1463 if ctgp.AnalyticalStorageTTL != nil {
1464 objectMap["analyticalStorageTtl"] = ctgp.AnalyticalStorageTTL
1465 }
1466 return json.Marshal(objectMap)
1467 }
1468
1469
1470 type CassandraTableGetResults struct {
1471 autorest.Response `json:"-"`
1472
1473 *CassandraTableGetProperties `json:"properties,omitempty"`
1474
1475 ID *string `json:"id,omitempty"`
1476
1477 Name *string `json:"name,omitempty"`
1478
1479 Type *string `json:"type,omitempty"`
1480
1481 Location *string `json:"location,omitempty"`
1482 Tags map[string]*string `json:"tags"`
1483 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
1484 }
1485
1486
1487 func (ctgr CassandraTableGetResults) MarshalJSON() ([]byte, error) {
1488 objectMap := make(map[string]interface{})
1489 if ctgr.CassandraTableGetProperties != nil {
1490 objectMap["properties"] = ctgr.CassandraTableGetProperties
1491 }
1492 if ctgr.Location != nil {
1493 objectMap["location"] = ctgr.Location
1494 }
1495 if ctgr.Tags != nil {
1496 objectMap["tags"] = ctgr.Tags
1497 }
1498 if ctgr.Identity != nil {
1499 objectMap["identity"] = ctgr.Identity
1500 }
1501 return json.Marshal(objectMap)
1502 }
1503
1504
1505 func (ctgr *CassandraTableGetResults) UnmarshalJSON(body []byte) error {
1506 var m map[string]*json.RawMessage
1507 err := json.Unmarshal(body, &m)
1508 if err != nil {
1509 return err
1510 }
1511 for k, v := range m {
1512 switch k {
1513 case "properties":
1514 if v != nil {
1515 var cassandraTableGetProperties CassandraTableGetProperties
1516 err = json.Unmarshal(*v, &cassandraTableGetProperties)
1517 if err != nil {
1518 return err
1519 }
1520 ctgr.CassandraTableGetProperties = &cassandraTableGetProperties
1521 }
1522 case "id":
1523 if v != nil {
1524 var ID string
1525 err = json.Unmarshal(*v, &ID)
1526 if err != nil {
1527 return err
1528 }
1529 ctgr.ID = &ID
1530 }
1531 case "name":
1532 if v != nil {
1533 var name string
1534 err = json.Unmarshal(*v, &name)
1535 if err != nil {
1536 return err
1537 }
1538 ctgr.Name = &name
1539 }
1540 case "type":
1541 if v != nil {
1542 var typeVar string
1543 err = json.Unmarshal(*v, &typeVar)
1544 if err != nil {
1545 return err
1546 }
1547 ctgr.Type = &typeVar
1548 }
1549 case "location":
1550 if v != nil {
1551 var location string
1552 err = json.Unmarshal(*v, &location)
1553 if err != nil {
1554 return err
1555 }
1556 ctgr.Location = &location
1557 }
1558 case "tags":
1559 if v != nil {
1560 var tags map[string]*string
1561 err = json.Unmarshal(*v, &tags)
1562 if err != nil {
1563 return err
1564 }
1565 ctgr.Tags = tags
1566 }
1567 case "identity":
1568 if v != nil {
1569 var identity ManagedServiceIdentity
1570 err = json.Unmarshal(*v, &identity)
1571 if err != nil {
1572 return err
1573 }
1574 ctgr.Identity = &identity
1575 }
1576 }
1577 }
1578
1579 return nil
1580 }
1581
1582
1583
1584 type CassandraTableListResult struct {
1585 autorest.Response `json:"-"`
1586
1587 Value *[]CassandraTableGetResults `json:"value,omitempty"`
1588 }
1589
1590
1591 func (ctlr CassandraTableListResult) MarshalJSON() ([]byte, error) {
1592 objectMap := make(map[string]interface{})
1593 return json.Marshal(objectMap)
1594 }
1595
1596
1597 type CassandraTableResource struct {
1598
1599 ID *string `json:"id,omitempty"`
1600
1601 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
1602
1603 Schema *CassandraSchema `json:"schema,omitempty"`
1604
1605 AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"`
1606 }
1607
1608
1609 type Certificate struct {
1610
1611 Pem *string `json:"pem,omitempty"`
1612 }
1613
1614
1615 type CloudError struct {
1616 Error *ErrorResponse `json:"error,omitempty"`
1617 }
1618
1619
1620 type ClusterKey struct {
1621
1622 Name *string `json:"name,omitempty"`
1623
1624 OrderBy *string `json:"orderBy,omitempty"`
1625 }
1626
1627
1628 type ClusterNodeStatus struct {
1629 autorest.Response `json:"-"`
1630
1631 Nodes *[]ClusterNodeStatusNodesItem `json:"nodes,omitempty"`
1632 }
1633
1634
1635 type ClusterNodeStatusNodesItem struct {
1636
1637 Datacenter *string `json:"datacenter,omitempty"`
1638
1639 Status NodeStatus `json:"status,omitempty"`
1640
1641 State NodeState `json:"state,omitempty"`
1642
1643 Address *string `json:"address,omitempty"`
1644
1645 Load *string `json:"load,omitempty"`
1646
1647 Tokens *[]string `json:"tokens,omitempty"`
1648
1649 Owns *float64 `json:"owns,omitempty"`
1650
1651 HostID *string `json:"hostId,omitempty"`
1652
1653 Rack *string `json:"rack,omitempty"`
1654 }
1655
1656
1657 type ClusterResource struct {
1658 autorest.Response `json:"-"`
1659
1660 Properties *ClusterResourceProperties `json:"properties,omitempty"`
1661
1662 ID *string `json:"id,omitempty"`
1663
1664 Name *string `json:"name,omitempty"`
1665
1666 Type *string `json:"type,omitempty"`
1667
1668 Location *string `json:"location,omitempty"`
1669 Tags map[string]*string `json:"tags"`
1670 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
1671 }
1672
1673
1674 func (cr ClusterResource) MarshalJSON() ([]byte, error) {
1675 objectMap := make(map[string]interface{})
1676 if cr.Properties != nil {
1677 objectMap["properties"] = cr.Properties
1678 }
1679 if cr.Location != nil {
1680 objectMap["location"] = cr.Location
1681 }
1682 if cr.Tags != nil {
1683 objectMap["tags"] = cr.Tags
1684 }
1685 if cr.Identity != nil {
1686 objectMap["identity"] = cr.Identity
1687 }
1688 return json.Marshal(objectMap)
1689 }
1690
1691
1692 type ClusterResourceProperties struct {
1693
1694 ProvisioningState ManagedCassandraProvisioningState `json:"provisioningState,omitempty"`
1695
1696 RestoreFromBackupID *string `json:"restoreFromBackupId,omitempty"`
1697
1698 DelegatedManagementSubnetID *string `json:"delegatedManagementSubnetId,omitempty"`
1699
1700 CassandraVersion *string `json:"cassandraVersion,omitempty"`
1701
1702 ClusterNameOverride *string `json:"clusterNameOverride,omitempty"`
1703
1704 AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"`
1705
1706 InitialCassandraAdminPassword *string `json:"initialCassandraAdminPassword,omitempty"`
1707
1708 HoursBetweenBackups *int32 `json:"hoursBetweenBackups,omitempty"`
1709
1710 PrometheusEndpoint *SeedNode `json:"prometheusEndpoint,omitempty"`
1711
1712 RepairEnabled *bool `json:"repairEnabled,omitempty"`
1713
1714 ClientCertificates *[]Certificate `json:"clientCertificates,omitempty"`
1715
1716 ExternalGossipCertificates *[]Certificate `json:"externalGossipCertificates,omitempty"`
1717
1718 GossipCertificates *[]Certificate `json:"gossipCertificates,omitempty"`
1719
1720 ExternalSeedNodes *[]SeedNode `json:"externalSeedNodes,omitempty"`
1721
1722 SeedNodes *[]SeedNode `json:"seedNodes,omitempty"`
1723 }
1724
1725
1726 func (cr ClusterResourceProperties) MarshalJSON() ([]byte, error) {
1727 objectMap := make(map[string]interface{})
1728 if cr.ProvisioningState != "" {
1729 objectMap["provisioningState"] = cr.ProvisioningState
1730 }
1731 if cr.RestoreFromBackupID != nil {
1732 objectMap["restoreFromBackupId"] = cr.RestoreFromBackupID
1733 }
1734 if cr.DelegatedManagementSubnetID != nil {
1735 objectMap["delegatedManagementSubnetId"] = cr.DelegatedManagementSubnetID
1736 }
1737 if cr.CassandraVersion != nil {
1738 objectMap["cassandraVersion"] = cr.CassandraVersion
1739 }
1740 if cr.ClusterNameOverride != nil {
1741 objectMap["clusterNameOverride"] = cr.ClusterNameOverride
1742 }
1743 if cr.AuthenticationMethod != "" {
1744 objectMap["authenticationMethod"] = cr.AuthenticationMethod
1745 }
1746 if cr.InitialCassandraAdminPassword != nil {
1747 objectMap["initialCassandraAdminPassword"] = cr.InitialCassandraAdminPassword
1748 }
1749 if cr.HoursBetweenBackups != nil {
1750 objectMap["hoursBetweenBackups"] = cr.HoursBetweenBackups
1751 }
1752 if cr.PrometheusEndpoint != nil {
1753 objectMap["prometheusEndpoint"] = cr.PrometheusEndpoint
1754 }
1755 if cr.RepairEnabled != nil {
1756 objectMap["repairEnabled"] = cr.RepairEnabled
1757 }
1758 if cr.ClientCertificates != nil {
1759 objectMap["clientCertificates"] = cr.ClientCertificates
1760 }
1761 if cr.ExternalGossipCertificates != nil {
1762 objectMap["externalGossipCertificates"] = cr.ExternalGossipCertificates
1763 }
1764 if cr.ExternalSeedNodes != nil {
1765 objectMap["externalSeedNodes"] = cr.ExternalSeedNodes
1766 }
1767 return json.Marshal(objectMap)
1768 }
1769
1770
1771 type Column struct {
1772
1773 Name *string `json:"name,omitempty"`
1774
1775 Type *string `json:"type,omitempty"`
1776 }
1777
1778
1779 type CompositePath struct {
1780
1781 Path *string `json:"path,omitempty"`
1782
1783 Order CompositePathSortOrder `json:"order,omitempty"`
1784 }
1785
1786
1787 type ConflictResolutionPolicy struct {
1788
1789 Mode ConflictResolutionMode `json:"mode,omitempty"`
1790
1791 ConflictResolutionPath *string `json:"conflictResolutionPath,omitempty"`
1792
1793 ConflictResolutionProcedure *string `json:"conflictResolutionProcedure,omitempty"`
1794 }
1795
1796
1797 type ConsistencyPolicy struct {
1798
1799 DefaultConsistencyLevel DefaultConsistencyLevel `json:"defaultConsistencyLevel,omitempty"`
1800
1801 MaxStalenessPrefix *int64 `json:"maxStalenessPrefix,omitempty"`
1802
1803 MaxIntervalInSeconds *int32 `json:"maxIntervalInSeconds,omitempty"`
1804 }
1805
1806
1807
1808 type ContainerPartitionKey struct {
1809
1810 Paths *[]string `json:"paths,omitempty"`
1811
1812 Kind PartitionKind `json:"kind,omitempty"`
1813
1814 Version *int32 `json:"version,omitempty"`
1815
1816 SystemKey *bool `json:"systemKey,omitempty"`
1817 }
1818
1819
1820 func (cpk ContainerPartitionKey) MarshalJSON() ([]byte, error) {
1821 objectMap := make(map[string]interface{})
1822 if cpk.Paths != nil {
1823 objectMap["paths"] = cpk.Paths
1824 }
1825 if cpk.Kind != "" {
1826 objectMap["kind"] = cpk.Kind
1827 }
1828 if cpk.Version != nil {
1829 objectMap["version"] = cpk.Version
1830 }
1831 return json.Marshal(objectMap)
1832 }
1833
1834
1835 type ContinuousBackupInformation struct {
1836
1837 LatestRestorableTimestamp *string `json:"latestRestorableTimestamp,omitempty"`
1838 }
1839
1840
1841 type ContinuousBackupRestoreLocation struct {
1842
1843 Location *string `json:"location,omitempty"`
1844 }
1845
1846
1847 type ContinuousModeBackupPolicy struct {
1848
1849 Type Type `json:"type,omitempty"`
1850 }
1851
1852
1853 func (cmbp ContinuousModeBackupPolicy) MarshalJSON() ([]byte, error) {
1854 cmbp.Type = TypeContinuous
1855 objectMap := make(map[string]interface{})
1856 if cmbp.Type != "" {
1857 objectMap["type"] = cmbp.Type
1858 }
1859 return json.Marshal(objectMap)
1860 }
1861
1862
1863 func (cmbp ContinuousModeBackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) {
1864 return nil, false
1865 }
1866
1867
1868 func (cmbp ContinuousModeBackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) {
1869 return &cmbp, true
1870 }
1871
1872
1873 func (cmbp ContinuousModeBackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) {
1874 return nil, false
1875 }
1876
1877
1878 func (cmbp ContinuousModeBackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) {
1879 return &cmbp, true
1880 }
1881
1882
1883 type CorsPolicy struct {
1884
1885 AllowedOrigins *string `json:"allowedOrigins,omitempty"`
1886
1887 AllowedMethods *string `json:"allowedMethods,omitempty"`
1888
1889 AllowedHeaders *string `json:"allowedHeaders,omitempty"`
1890
1891 ExposedHeaders *string `json:"exposedHeaders,omitempty"`
1892
1893 MaxAgeInSeconds *int64 `json:"maxAgeInSeconds,omitempty"`
1894 }
1895
1896
1897
1898 type CreateUpdateOptions struct {
1899
1900 Throughput *int32 `json:"throughput,omitempty"`
1901
1902 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
1903 }
1904
1905
1906 type DatabaseAccountConnectionString struct {
1907
1908 ConnectionString *string `json:"connectionString,omitempty"`
1909
1910 Description *string `json:"description,omitempty"`
1911 }
1912
1913
1914 func (dacs DatabaseAccountConnectionString) MarshalJSON() ([]byte, error) {
1915 objectMap := make(map[string]interface{})
1916 return json.Marshal(objectMap)
1917 }
1918
1919
1920 type DatabaseAccountCreateUpdateParameters struct {
1921
1922 Kind DatabaseAccountKind `json:"kind,omitempty"`
1923 Properties BasicDatabaseAccountCreateUpdateProperties `json:"properties,omitempty"`
1924
1925 ID *string `json:"id,omitempty"`
1926
1927 Name *string `json:"name,omitempty"`
1928
1929 Type *string `json:"type,omitempty"`
1930
1931 Location *string `json:"location,omitempty"`
1932 Tags map[string]*string `json:"tags"`
1933 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
1934 }
1935
1936
1937 func (dacup DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) {
1938 objectMap := make(map[string]interface{})
1939 if dacup.Kind != "" {
1940 objectMap["kind"] = dacup.Kind
1941 }
1942 objectMap["properties"] = dacup.Properties
1943 if dacup.Location != nil {
1944 objectMap["location"] = dacup.Location
1945 }
1946 if dacup.Tags != nil {
1947 objectMap["tags"] = dacup.Tags
1948 }
1949 if dacup.Identity != nil {
1950 objectMap["identity"] = dacup.Identity
1951 }
1952 return json.Marshal(objectMap)
1953 }
1954
1955
1956 func (dacup *DatabaseAccountCreateUpdateParameters) UnmarshalJSON(body []byte) error {
1957 var m map[string]*json.RawMessage
1958 err := json.Unmarshal(body, &m)
1959 if err != nil {
1960 return err
1961 }
1962 for k, v := range m {
1963 switch k {
1964 case "kind":
1965 if v != nil {
1966 var kind DatabaseAccountKind
1967 err = json.Unmarshal(*v, &kind)
1968 if err != nil {
1969 return err
1970 }
1971 dacup.Kind = kind
1972 }
1973 case "properties":
1974 if v != nil {
1975 properties, err := unmarshalBasicDatabaseAccountCreateUpdateProperties(*v)
1976 if err != nil {
1977 return err
1978 }
1979 dacup.Properties = properties
1980 }
1981 case "id":
1982 if v != nil {
1983 var ID string
1984 err = json.Unmarshal(*v, &ID)
1985 if err != nil {
1986 return err
1987 }
1988 dacup.ID = &ID
1989 }
1990 case "name":
1991 if v != nil {
1992 var name string
1993 err = json.Unmarshal(*v, &name)
1994 if err != nil {
1995 return err
1996 }
1997 dacup.Name = &name
1998 }
1999 case "type":
2000 if v != nil {
2001 var typeVar string
2002 err = json.Unmarshal(*v, &typeVar)
2003 if err != nil {
2004 return err
2005 }
2006 dacup.Type = &typeVar
2007 }
2008 case "location":
2009 if v != nil {
2010 var location string
2011 err = json.Unmarshal(*v, &location)
2012 if err != nil {
2013 return err
2014 }
2015 dacup.Location = &location
2016 }
2017 case "tags":
2018 if v != nil {
2019 var tags map[string]*string
2020 err = json.Unmarshal(*v, &tags)
2021 if err != nil {
2022 return err
2023 }
2024 dacup.Tags = tags
2025 }
2026 case "identity":
2027 if v != nil {
2028 var identity ManagedServiceIdentity
2029 err = json.Unmarshal(*v, &identity)
2030 if err != nil {
2031 return err
2032 }
2033 dacup.Identity = &identity
2034 }
2035 }
2036 }
2037
2038 return nil
2039 }
2040
2041
2042 type BasicDatabaseAccountCreateUpdateProperties interface {
2043 AsDefaultRequestDatabaseAccountCreateUpdateProperties() (*DefaultRequestDatabaseAccountCreateUpdateProperties, bool)
2044 AsRestoreReqeustDatabaseAccountCreateUpdateProperties() (*RestoreReqeustDatabaseAccountCreateUpdateProperties, bool)
2045 AsDatabaseAccountCreateUpdateProperties() (*DatabaseAccountCreateUpdateProperties, bool)
2046 }
2047
2048
2049 type DatabaseAccountCreateUpdateProperties struct {
2050
2051 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"`
2052
2053 Locations *[]Location `json:"locations,omitempty"`
2054
2055 DatabaseAccountOfferType *string `json:"databaseAccountOfferType,omitempty"`
2056
2057 IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"`
2058
2059 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
2060
2061 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`
2062
2063 Capabilities *[]Capability `json:"capabilities,omitempty"`
2064
2065 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
2066
2067 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`
2068
2069 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`
2070
2071 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"`
2072
2073 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`
2074
2075 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"`
2076
2077 DefaultIdentity *string `json:"defaultIdentity,omitempty"`
2078
2079 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
2080
2081 EnableFreeTier *bool `json:"enableFreeTier,omitempty"`
2082
2083 APIProperties *APIProperties `json:"apiProperties,omitempty"`
2084
2085 EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"`
2086
2087 BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"`
2088
2089 Cors *[]CorsPolicy `json:"cors,omitempty"`
2090
2091 NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"`
2092
2093 NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"`
2094
2095 CreateMode CreateModeBasicDatabaseAccountCreateUpdateProperties `json:"createMode,omitempty"`
2096 }
2097
2098 func unmarshalBasicDatabaseAccountCreateUpdateProperties(body []byte) (BasicDatabaseAccountCreateUpdateProperties, error) {
2099 var m map[string]interface{}
2100 err := json.Unmarshal(body, &m)
2101 if err != nil {
2102 return nil, err
2103 }
2104
2105 switch m["createMode"] {
2106 case string(CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeDefault):
2107 var drdacup DefaultRequestDatabaseAccountCreateUpdateProperties
2108 err := json.Unmarshal(body, &drdacup)
2109 return drdacup, err
2110 case string(CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeRestore):
2111 var rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties
2112 err := json.Unmarshal(body, &rrdacup)
2113 return rrdacup, err
2114 default:
2115 var dacup DatabaseAccountCreateUpdateProperties
2116 err := json.Unmarshal(body, &dacup)
2117 return dacup, err
2118 }
2119 }
2120 func unmarshalBasicDatabaseAccountCreateUpdatePropertiesArray(body []byte) ([]BasicDatabaseAccountCreateUpdateProperties, error) {
2121 var rawMessages []*json.RawMessage
2122 err := json.Unmarshal(body, &rawMessages)
2123 if err != nil {
2124 return nil, err
2125 }
2126
2127 dacupArray := make([]BasicDatabaseAccountCreateUpdateProperties, len(rawMessages))
2128
2129 for index, rawMessage := range rawMessages {
2130 dacup, err := unmarshalBasicDatabaseAccountCreateUpdateProperties(*rawMessage)
2131 if err != nil {
2132 return nil, err
2133 }
2134 dacupArray[index] = dacup
2135 }
2136 return dacupArray, nil
2137 }
2138
2139
2140 func (dacup DatabaseAccountCreateUpdateProperties) MarshalJSON() ([]byte, error) {
2141 dacup.CreateMode = CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeDatabaseAccountCreateUpdateProperties
2142 objectMap := make(map[string]interface{})
2143 if dacup.ConsistencyPolicy != nil {
2144 objectMap["consistencyPolicy"] = dacup.ConsistencyPolicy
2145 }
2146 if dacup.Locations != nil {
2147 objectMap["locations"] = dacup.Locations
2148 }
2149 if dacup.DatabaseAccountOfferType != nil {
2150 objectMap["databaseAccountOfferType"] = dacup.DatabaseAccountOfferType
2151 }
2152 if dacup.IPRules != nil {
2153 objectMap["ipRules"] = dacup.IPRules
2154 }
2155 if dacup.IsVirtualNetworkFilterEnabled != nil {
2156 objectMap["isVirtualNetworkFilterEnabled"] = dacup.IsVirtualNetworkFilterEnabled
2157 }
2158 if dacup.EnableAutomaticFailover != nil {
2159 objectMap["enableAutomaticFailover"] = dacup.EnableAutomaticFailover
2160 }
2161 if dacup.Capabilities != nil {
2162 objectMap["capabilities"] = dacup.Capabilities
2163 }
2164 if dacup.VirtualNetworkRules != nil {
2165 objectMap["virtualNetworkRules"] = dacup.VirtualNetworkRules
2166 }
2167 if dacup.EnableMultipleWriteLocations != nil {
2168 objectMap["enableMultipleWriteLocations"] = dacup.EnableMultipleWriteLocations
2169 }
2170 if dacup.EnableCassandraConnector != nil {
2171 objectMap["enableCassandraConnector"] = dacup.EnableCassandraConnector
2172 }
2173 if dacup.ConnectorOffer != "" {
2174 objectMap["connectorOffer"] = dacup.ConnectorOffer
2175 }
2176 if dacup.DisableKeyBasedMetadataWriteAccess != nil {
2177 objectMap["disableKeyBasedMetadataWriteAccess"] = dacup.DisableKeyBasedMetadataWriteAccess
2178 }
2179 if dacup.KeyVaultKeyURI != nil {
2180 objectMap["keyVaultKeyUri"] = dacup.KeyVaultKeyURI
2181 }
2182 if dacup.DefaultIdentity != nil {
2183 objectMap["defaultIdentity"] = dacup.DefaultIdentity
2184 }
2185 if dacup.PublicNetworkAccess != "" {
2186 objectMap["publicNetworkAccess"] = dacup.PublicNetworkAccess
2187 }
2188 if dacup.EnableFreeTier != nil {
2189 objectMap["enableFreeTier"] = dacup.EnableFreeTier
2190 }
2191 if dacup.APIProperties != nil {
2192 objectMap["apiProperties"] = dacup.APIProperties
2193 }
2194 if dacup.EnableAnalyticalStorage != nil {
2195 objectMap["enableAnalyticalStorage"] = dacup.EnableAnalyticalStorage
2196 }
2197 objectMap["backupPolicy"] = dacup.BackupPolicy
2198 if dacup.Cors != nil {
2199 objectMap["cors"] = dacup.Cors
2200 }
2201 if dacup.NetworkACLBypass != "" {
2202 objectMap["networkAclBypass"] = dacup.NetworkACLBypass
2203 }
2204 if dacup.NetworkACLBypassResourceIds != nil {
2205 objectMap["networkAclBypassResourceIds"] = dacup.NetworkACLBypassResourceIds
2206 }
2207 if dacup.CreateMode != "" {
2208 objectMap["createMode"] = dacup.CreateMode
2209 }
2210 return json.Marshal(objectMap)
2211 }
2212
2213
2214 func (dacup DatabaseAccountCreateUpdateProperties) AsDefaultRequestDatabaseAccountCreateUpdateProperties() (*DefaultRequestDatabaseAccountCreateUpdateProperties, bool) {
2215 return nil, false
2216 }
2217
2218
2219 func (dacup DatabaseAccountCreateUpdateProperties) AsRestoreReqeustDatabaseAccountCreateUpdateProperties() (*RestoreReqeustDatabaseAccountCreateUpdateProperties, bool) {
2220 return nil, false
2221 }
2222
2223
2224 func (dacup DatabaseAccountCreateUpdateProperties) AsDatabaseAccountCreateUpdateProperties() (*DatabaseAccountCreateUpdateProperties, bool) {
2225 return &dacup, true
2226 }
2227
2228
2229 func (dacup DatabaseAccountCreateUpdateProperties) AsBasicDatabaseAccountCreateUpdateProperties() (BasicDatabaseAccountCreateUpdateProperties, bool) {
2230 return &dacup, true
2231 }
2232
2233
2234 func (dacup *DatabaseAccountCreateUpdateProperties) UnmarshalJSON(body []byte) error {
2235 var m map[string]*json.RawMessage
2236 err := json.Unmarshal(body, &m)
2237 if err != nil {
2238 return err
2239 }
2240 for k, v := range m {
2241 switch k {
2242 case "consistencyPolicy":
2243 if v != nil {
2244 var consistencyPolicy ConsistencyPolicy
2245 err = json.Unmarshal(*v, &consistencyPolicy)
2246 if err != nil {
2247 return err
2248 }
2249 dacup.ConsistencyPolicy = &consistencyPolicy
2250 }
2251 case "locations":
2252 if v != nil {
2253 var locations []Location
2254 err = json.Unmarshal(*v, &locations)
2255 if err != nil {
2256 return err
2257 }
2258 dacup.Locations = &locations
2259 }
2260 case "databaseAccountOfferType":
2261 if v != nil {
2262 var databaseAccountOfferType string
2263 err = json.Unmarshal(*v, &databaseAccountOfferType)
2264 if err != nil {
2265 return err
2266 }
2267 dacup.DatabaseAccountOfferType = &databaseAccountOfferType
2268 }
2269 case "ipRules":
2270 if v != nil {
2271 var IPRules []IPAddressOrRange
2272 err = json.Unmarshal(*v, &IPRules)
2273 if err != nil {
2274 return err
2275 }
2276 dacup.IPRules = &IPRules
2277 }
2278 case "isVirtualNetworkFilterEnabled":
2279 if v != nil {
2280 var isVirtualNetworkFilterEnabled bool
2281 err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled)
2282 if err != nil {
2283 return err
2284 }
2285 dacup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
2286 }
2287 case "enableAutomaticFailover":
2288 if v != nil {
2289 var enableAutomaticFailover bool
2290 err = json.Unmarshal(*v, &enableAutomaticFailover)
2291 if err != nil {
2292 return err
2293 }
2294 dacup.EnableAutomaticFailover = &enableAutomaticFailover
2295 }
2296 case "capabilities":
2297 if v != nil {
2298 var capabilities []Capability
2299 err = json.Unmarshal(*v, &capabilities)
2300 if err != nil {
2301 return err
2302 }
2303 dacup.Capabilities = &capabilities
2304 }
2305 case "virtualNetworkRules":
2306 if v != nil {
2307 var virtualNetworkRules []VirtualNetworkRule
2308 err = json.Unmarshal(*v, &virtualNetworkRules)
2309 if err != nil {
2310 return err
2311 }
2312 dacup.VirtualNetworkRules = &virtualNetworkRules
2313 }
2314 case "enableMultipleWriteLocations":
2315 if v != nil {
2316 var enableMultipleWriteLocations bool
2317 err = json.Unmarshal(*v, &enableMultipleWriteLocations)
2318 if err != nil {
2319 return err
2320 }
2321 dacup.EnableMultipleWriteLocations = &enableMultipleWriteLocations
2322 }
2323 case "enableCassandraConnector":
2324 if v != nil {
2325 var enableCassandraConnector bool
2326 err = json.Unmarshal(*v, &enableCassandraConnector)
2327 if err != nil {
2328 return err
2329 }
2330 dacup.EnableCassandraConnector = &enableCassandraConnector
2331 }
2332 case "connectorOffer":
2333 if v != nil {
2334 var connectorOffer ConnectorOffer
2335 err = json.Unmarshal(*v, &connectorOffer)
2336 if err != nil {
2337 return err
2338 }
2339 dacup.ConnectorOffer = connectorOffer
2340 }
2341 case "disableKeyBasedMetadataWriteAccess":
2342 if v != nil {
2343 var disableKeyBasedMetadataWriteAccess bool
2344 err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess)
2345 if err != nil {
2346 return err
2347 }
2348 dacup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
2349 }
2350 case "keyVaultKeyUri":
2351 if v != nil {
2352 var keyVaultKeyURI string
2353 err = json.Unmarshal(*v, &keyVaultKeyURI)
2354 if err != nil {
2355 return err
2356 }
2357 dacup.KeyVaultKeyURI = &keyVaultKeyURI
2358 }
2359 case "defaultIdentity":
2360 if v != nil {
2361 var defaultIdentity string
2362 err = json.Unmarshal(*v, &defaultIdentity)
2363 if err != nil {
2364 return err
2365 }
2366 dacup.DefaultIdentity = &defaultIdentity
2367 }
2368 case "publicNetworkAccess":
2369 if v != nil {
2370 var publicNetworkAccess PublicNetworkAccess
2371 err = json.Unmarshal(*v, &publicNetworkAccess)
2372 if err != nil {
2373 return err
2374 }
2375 dacup.PublicNetworkAccess = publicNetworkAccess
2376 }
2377 case "enableFreeTier":
2378 if v != nil {
2379 var enableFreeTier bool
2380 err = json.Unmarshal(*v, &enableFreeTier)
2381 if err != nil {
2382 return err
2383 }
2384 dacup.EnableFreeTier = &enableFreeTier
2385 }
2386 case "apiProperties":
2387 if v != nil {
2388 var APIProperties APIProperties
2389 err = json.Unmarshal(*v, &APIProperties)
2390 if err != nil {
2391 return err
2392 }
2393 dacup.APIProperties = &APIProperties
2394 }
2395 case "enableAnalyticalStorage":
2396 if v != nil {
2397 var enableAnalyticalStorage bool
2398 err = json.Unmarshal(*v, &enableAnalyticalStorage)
2399 if err != nil {
2400 return err
2401 }
2402 dacup.EnableAnalyticalStorage = &enableAnalyticalStorage
2403 }
2404 case "backupPolicy":
2405 if v != nil {
2406 backupPolicy, err := unmarshalBasicBackupPolicy(*v)
2407 if err != nil {
2408 return err
2409 }
2410 dacup.BackupPolicy = backupPolicy
2411 }
2412 case "cors":
2413 if v != nil {
2414 var cors []CorsPolicy
2415 err = json.Unmarshal(*v, &cors)
2416 if err != nil {
2417 return err
2418 }
2419 dacup.Cors = &cors
2420 }
2421 case "networkAclBypass":
2422 if v != nil {
2423 var networkACLBypass NetworkACLBypass
2424 err = json.Unmarshal(*v, &networkACLBypass)
2425 if err != nil {
2426 return err
2427 }
2428 dacup.NetworkACLBypass = networkACLBypass
2429 }
2430 case "networkAclBypassResourceIds":
2431 if v != nil {
2432 var networkACLBypassResourceIds []string
2433 err = json.Unmarshal(*v, &networkACLBypassResourceIds)
2434 if err != nil {
2435 return err
2436 }
2437 dacup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds
2438 }
2439 case "createMode":
2440 if v != nil {
2441 var createMode CreateModeBasicDatabaseAccountCreateUpdateProperties
2442 err = json.Unmarshal(*v, &createMode)
2443 if err != nil {
2444 return err
2445 }
2446 dacup.CreateMode = createMode
2447 }
2448 }
2449 }
2450
2451 return nil
2452 }
2453
2454
2455 type DatabaseAccountGetProperties struct {
2456 ProvisioningState *string `json:"provisioningState,omitempty"`
2457
2458 DocumentEndpoint *string `json:"documentEndpoint,omitempty"`
2459
2460 DatabaseAccountOfferType DatabaseAccountOfferType `json:"databaseAccountOfferType,omitempty"`
2461
2462 IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"`
2463
2464 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
2465
2466 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`
2467
2468 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"`
2469
2470 Capabilities *[]Capability `json:"capabilities,omitempty"`
2471
2472 WriteLocations *[]Location `json:"writeLocations,omitempty"`
2473
2474 ReadLocations *[]Location `json:"readLocations,omitempty"`
2475
2476 Locations *[]Location `json:"locations,omitempty"`
2477
2478 FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"`
2479
2480 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
2481
2482 PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
2483
2484 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`
2485
2486 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`
2487
2488 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"`
2489
2490 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`
2491
2492 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"`
2493
2494 DefaultIdentity *string `json:"defaultIdentity,omitempty"`
2495
2496 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
2497
2498 EnableFreeTier *bool `json:"enableFreeTier,omitempty"`
2499
2500 APIProperties *APIProperties `json:"apiProperties,omitempty"`
2501
2502 EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"`
2503
2504 InstanceID *string `json:"instanceId,omitempty"`
2505
2506 CreateMode CreateMode `json:"createMode,omitempty"`
2507
2508 RestoreParameters *RestoreParameters `json:"restoreParameters,omitempty"`
2509
2510 BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"`
2511
2512 Cors *[]CorsPolicy `json:"cors,omitempty"`
2513
2514 NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"`
2515
2516 NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"`
2517 }
2518
2519
2520 func (dagp DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) {
2521 objectMap := make(map[string]interface{})
2522 if dagp.ProvisioningState != nil {
2523 objectMap["provisioningState"] = dagp.ProvisioningState
2524 }
2525 if dagp.IPRules != nil {
2526 objectMap["ipRules"] = dagp.IPRules
2527 }
2528 if dagp.IsVirtualNetworkFilterEnabled != nil {
2529 objectMap["isVirtualNetworkFilterEnabled"] = dagp.IsVirtualNetworkFilterEnabled
2530 }
2531 if dagp.EnableAutomaticFailover != nil {
2532 objectMap["enableAutomaticFailover"] = dagp.EnableAutomaticFailover
2533 }
2534 if dagp.ConsistencyPolicy != nil {
2535 objectMap["consistencyPolicy"] = dagp.ConsistencyPolicy
2536 }
2537 if dagp.Capabilities != nil {
2538 objectMap["capabilities"] = dagp.Capabilities
2539 }
2540 if dagp.VirtualNetworkRules != nil {
2541 objectMap["virtualNetworkRules"] = dagp.VirtualNetworkRules
2542 }
2543 if dagp.EnableMultipleWriteLocations != nil {
2544 objectMap["enableMultipleWriteLocations"] = dagp.EnableMultipleWriteLocations
2545 }
2546 if dagp.EnableCassandraConnector != nil {
2547 objectMap["enableCassandraConnector"] = dagp.EnableCassandraConnector
2548 }
2549 if dagp.ConnectorOffer != "" {
2550 objectMap["connectorOffer"] = dagp.ConnectorOffer
2551 }
2552 if dagp.DisableKeyBasedMetadataWriteAccess != nil {
2553 objectMap["disableKeyBasedMetadataWriteAccess"] = dagp.DisableKeyBasedMetadataWriteAccess
2554 }
2555 if dagp.KeyVaultKeyURI != nil {
2556 objectMap["keyVaultKeyUri"] = dagp.KeyVaultKeyURI
2557 }
2558 if dagp.DefaultIdentity != nil {
2559 objectMap["defaultIdentity"] = dagp.DefaultIdentity
2560 }
2561 if dagp.PublicNetworkAccess != "" {
2562 objectMap["publicNetworkAccess"] = dagp.PublicNetworkAccess
2563 }
2564 if dagp.EnableFreeTier != nil {
2565 objectMap["enableFreeTier"] = dagp.EnableFreeTier
2566 }
2567 if dagp.APIProperties != nil {
2568 objectMap["apiProperties"] = dagp.APIProperties
2569 }
2570 if dagp.EnableAnalyticalStorage != nil {
2571 objectMap["enableAnalyticalStorage"] = dagp.EnableAnalyticalStorage
2572 }
2573 if dagp.CreateMode != "" {
2574 objectMap["createMode"] = dagp.CreateMode
2575 }
2576 if dagp.RestoreParameters != nil {
2577 objectMap["restoreParameters"] = dagp.RestoreParameters
2578 }
2579 objectMap["backupPolicy"] = dagp.BackupPolicy
2580 if dagp.Cors != nil {
2581 objectMap["cors"] = dagp.Cors
2582 }
2583 if dagp.NetworkACLBypass != "" {
2584 objectMap["networkAclBypass"] = dagp.NetworkACLBypass
2585 }
2586 if dagp.NetworkACLBypassResourceIds != nil {
2587 objectMap["networkAclBypassResourceIds"] = dagp.NetworkACLBypassResourceIds
2588 }
2589 return json.Marshal(objectMap)
2590 }
2591
2592
2593 func (dagp *DatabaseAccountGetProperties) UnmarshalJSON(body []byte) error {
2594 var m map[string]*json.RawMessage
2595 err := json.Unmarshal(body, &m)
2596 if err != nil {
2597 return err
2598 }
2599 for k, v := range m {
2600 switch k {
2601 case "provisioningState":
2602 if v != nil {
2603 var provisioningState string
2604 err = json.Unmarshal(*v, &provisioningState)
2605 if err != nil {
2606 return err
2607 }
2608 dagp.ProvisioningState = &provisioningState
2609 }
2610 case "documentEndpoint":
2611 if v != nil {
2612 var documentEndpoint string
2613 err = json.Unmarshal(*v, &documentEndpoint)
2614 if err != nil {
2615 return err
2616 }
2617 dagp.DocumentEndpoint = &documentEndpoint
2618 }
2619 case "databaseAccountOfferType":
2620 if v != nil {
2621 var databaseAccountOfferType DatabaseAccountOfferType
2622 err = json.Unmarshal(*v, &databaseAccountOfferType)
2623 if err != nil {
2624 return err
2625 }
2626 dagp.DatabaseAccountOfferType = databaseAccountOfferType
2627 }
2628 case "ipRules":
2629 if v != nil {
2630 var IPRules []IPAddressOrRange
2631 err = json.Unmarshal(*v, &IPRules)
2632 if err != nil {
2633 return err
2634 }
2635 dagp.IPRules = &IPRules
2636 }
2637 case "isVirtualNetworkFilterEnabled":
2638 if v != nil {
2639 var isVirtualNetworkFilterEnabled bool
2640 err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled)
2641 if err != nil {
2642 return err
2643 }
2644 dagp.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
2645 }
2646 case "enableAutomaticFailover":
2647 if v != nil {
2648 var enableAutomaticFailover bool
2649 err = json.Unmarshal(*v, &enableAutomaticFailover)
2650 if err != nil {
2651 return err
2652 }
2653 dagp.EnableAutomaticFailover = &enableAutomaticFailover
2654 }
2655 case "consistencyPolicy":
2656 if v != nil {
2657 var consistencyPolicy ConsistencyPolicy
2658 err = json.Unmarshal(*v, &consistencyPolicy)
2659 if err != nil {
2660 return err
2661 }
2662 dagp.ConsistencyPolicy = &consistencyPolicy
2663 }
2664 case "capabilities":
2665 if v != nil {
2666 var capabilities []Capability
2667 err = json.Unmarshal(*v, &capabilities)
2668 if err != nil {
2669 return err
2670 }
2671 dagp.Capabilities = &capabilities
2672 }
2673 case "writeLocations":
2674 if v != nil {
2675 var writeLocations []Location
2676 err = json.Unmarshal(*v, &writeLocations)
2677 if err != nil {
2678 return err
2679 }
2680 dagp.WriteLocations = &writeLocations
2681 }
2682 case "readLocations":
2683 if v != nil {
2684 var readLocations []Location
2685 err = json.Unmarshal(*v, &readLocations)
2686 if err != nil {
2687 return err
2688 }
2689 dagp.ReadLocations = &readLocations
2690 }
2691 case "locations":
2692 if v != nil {
2693 var locations []Location
2694 err = json.Unmarshal(*v, &locations)
2695 if err != nil {
2696 return err
2697 }
2698 dagp.Locations = &locations
2699 }
2700 case "failoverPolicies":
2701 if v != nil {
2702 var failoverPolicies []FailoverPolicy
2703 err = json.Unmarshal(*v, &failoverPolicies)
2704 if err != nil {
2705 return err
2706 }
2707 dagp.FailoverPolicies = &failoverPolicies
2708 }
2709 case "virtualNetworkRules":
2710 if v != nil {
2711 var virtualNetworkRules []VirtualNetworkRule
2712 err = json.Unmarshal(*v, &virtualNetworkRules)
2713 if err != nil {
2714 return err
2715 }
2716 dagp.VirtualNetworkRules = &virtualNetworkRules
2717 }
2718 case "privateEndpointConnections":
2719 if v != nil {
2720 var privateEndpointConnections []PrivateEndpointConnection
2721 err = json.Unmarshal(*v, &privateEndpointConnections)
2722 if err != nil {
2723 return err
2724 }
2725 dagp.PrivateEndpointConnections = &privateEndpointConnections
2726 }
2727 case "enableMultipleWriteLocations":
2728 if v != nil {
2729 var enableMultipleWriteLocations bool
2730 err = json.Unmarshal(*v, &enableMultipleWriteLocations)
2731 if err != nil {
2732 return err
2733 }
2734 dagp.EnableMultipleWriteLocations = &enableMultipleWriteLocations
2735 }
2736 case "enableCassandraConnector":
2737 if v != nil {
2738 var enableCassandraConnector bool
2739 err = json.Unmarshal(*v, &enableCassandraConnector)
2740 if err != nil {
2741 return err
2742 }
2743 dagp.EnableCassandraConnector = &enableCassandraConnector
2744 }
2745 case "connectorOffer":
2746 if v != nil {
2747 var connectorOffer ConnectorOffer
2748 err = json.Unmarshal(*v, &connectorOffer)
2749 if err != nil {
2750 return err
2751 }
2752 dagp.ConnectorOffer = connectorOffer
2753 }
2754 case "disableKeyBasedMetadataWriteAccess":
2755 if v != nil {
2756 var disableKeyBasedMetadataWriteAccess bool
2757 err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess)
2758 if err != nil {
2759 return err
2760 }
2761 dagp.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
2762 }
2763 case "keyVaultKeyUri":
2764 if v != nil {
2765 var keyVaultKeyURI string
2766 err = json.Unmarshal(*v, &keyVaultKeyURI)
2767 if err != nil {
2768 return err
2769 }
2770 dagp.KeyVaultKeyURI = &keyVaultKeyURI
2771 }
2772 case "defaultIdentity":
2773 if v != nil {
2774 var defaultIdentity string
2775 err = json.Unmarshal(*v, &defaultIdentity)
2776 if err != nil {
2777 return err
2778 }
2779 dagp.DefaultIdentity = &defaultIdentity
2780 }
2781 case "publicNetworkAccess":
2782 if v != nil {
2783 var publicNetworkAccess PublicNetworkAccess
2784 err = json.Unmarshal(*v, &publicNetworkAccess)
2785 if err != nil {
2786 return err
2787 }
2788 dagp.PublicNetworkAccess = publicNetworkAccess
2789 }
2790 case "enableFreeTier":
2791 if v != nil {
2792 var enableFreeTier bool
2793 err = json.Unmarshal(*v, &enableFreeTier)
2794 if err != nil {
2795 return err
2796 }
2797 dagp.EnableFreeTier = &enableFreeTier
2798 }
2799 case "apiProperties":
2800 if v != nil {
2801 var APIProperties APIProperties
2802 err = json.Unmarshal(*v, &APIProperties)
2803 if err != nil {
2804 return err
2805 }
2806 dagp.APIProperties = &APIProperties
2807 }
2808 case "enableAnalyticalStorage":
2809 if v != nil {
2810 var enableAnalyticalStorage bool
2811 err = json.Unmarshal(*v, &enableAnalyticalStorage)
2812 if err != nil {
2813 return err
2814 }
2815 dagp.EnableAnalyticalStorage = &enableAnalyticalStorage
2816 }
2817 case "instanceId":
2818 if v != nil {
2819 var instanceID string
2820 err = json.Unmarshal(*v, &instanceID)
2821 if err != nil {
2822 return err
2823 }
2824 dagp.InstanceID = &instanceID
2825 }
2826 case "createMode":
2827 if v != nil {
2828 var createMode CreateMode
2829 err = json.Unmarshal(*v, &createMode)
2830 if err != nil {
2831 return err
2832 }
2833 dagp.CreateMode = createMode
2834 }
2835 case "restoreParameters":
2836 if v != nil {
2837 var restoreParameters RestoreParameters
2838 err = json.Unmarshal(*v, &restoreParameters)
2839 if err != nil {
2840 return err
2841 }
2842 dagp.RestoreParameters = &restoreParameters
2843 }
2844 case "backupPolicy":
2845 if v != nil {
2846 backupPolicy, err := unmarshalBasicBackupPolicy(*v)
2847 if err != nil {
2848 return err
2849 }
2850 dagp.BackupPolicy = backupPolicy
2851 }
2852 case "cors":
2853 if v != nil {
2854 var cors []CorsPolicy
2855 err = json.Unmarshal(*v, &cors)
2856 if err != nil {
2857 return err
2858 }
2859 dagp.Cors = &cors
2860 }
2861 case "networkAclBypass":
2862 if v != nil {
2863 var networkACLBypass NetworkACLBypass
2864 err = json.Unmarshal(*v, &networkACLBypass)
2865 if err != nil {
2866 return err
2867 }
2868 dagp.NetworkACLBypass = networkACLBypass
2869 }
2870 case "networkAclBypassResourceIds":
2871 if v != nil {
2872 var networkACLBypassResourceIds []string
2873 err = json.Unmarshal(*v, &networkACLBypassResourceIds)
2874 if err != nil {
2875 return err
2876 }
2877 dagp.NetworkACLBypassResourceIds = &networkACLBypassResourceIds
2878 }
2879 }
2880 }
2881
2882 return nil
2883 }
2884
2885
2886 type DatabaseAccountGetResults struct {
2887 autorest.Response `json:"-"`
2888
2889 Kind DatabaseAccountKind `json:"kind,omitempty"`
2890 *DatabaseAccountGetProperties `json:"properties,omitempty"`
2891
2892 SystemData *SystemData `json:"systemData,omitempty"`
2893
2894 ID *string `json:"id,omitempty"`
2895
2896 Name *string `json:"name,omitempty"`
2897
2898 Type *string `json:"type,omitempty"`
2899
2900 Location *string `json:"location,omitempty"`
2901 Tags map[string]*string `json:"tags"`
2902 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
2903 }
2904
2905
2906 func (dagr DatabaseAccountGetResults) MarshalJSON() ([]byte, error) {
2907 objectMap := make(map[string]interface{})
2908 if dagr.Kind != "" {
2909 objectMap["kind"] = dagr.Kind
2910 }
2911 if dagr.DatabaseAccountGetProperties != nil {
2912 objectMap["properties"] = dagr.DatabaseAccountGetProperties
2913 }
2914 if dagr.Location != nil {
2915 objectMap["location"] = dagr.Location
2916 }
2917 if dagr.Tags != nil {
2918 objectMap["tags"] = dagr.Tags
2919 }
2920 if dagr.Identity != nil {
2921 objectMap["identity"] = dagr.Identity
2922 }
2923 return json.Marshal(objectMap)
2924 }
2925
2926
2927 func (dagr *DatabaseAccountGetResults) UnmarshalJSON(body []byte) error {
2928 var m map[string]*json.RawMessage
2929 err := json.Unmarshal(body, &m)
2930 if err != nil {
2931 return err
2932 }
2933 for k, v := range m {
2934 switch k {
2935 case "kind":
2936 if v != nil {
2937 var kind DatabaseAccountKind
2938 err = json.Unmarshal(*v, &kind)
2939 if err != nil {
2940 return err
2941 }
2942 dagr.Kind = kind
2943 }
2944 case "properties":
2945 if v != nil {
2946 var databaseAccountGetProperties DatabaseAccountGetProperties
2947 err = json.Unmarshal(*v, &databaseAccountGetProperties)
2948 if err != nil {
2949 return err
2950 }
2951 dagr.DatabaseAccountGetProperties = &databaseAccountGetProperties
2952 }
2953 case "systemData":
2954 if v != nil {
2955 var systemData SystemData
2956 err = json.Unmarshal(*v, &systemData)
2957 if err != nil {
2958 return err
2959 }
2960 dagr.SystemData = &systemData
2961 }
2962 case "id":
2963 if v != nil {
2964 var ID string
2965 err = json.Unmarshal(*v, &ID)
2966 if err != nil {
2967 return err
2968 }
2969 dagr.ID = &ID
2970 }
2971 case "name":
2972 if v != nil {
2973 var name string
2974 err = json.Unmarshal(*v, &name)
2975 if err != nil {
2976 return err
2977 }
2978 dagr.Name = &name
2979 }
2980 case "type":
2981 if v != nil {
2982 var typeVar string
2983 err = json.Unmarshal(*v, &typeVar)
2984 if err != nil {
2985 return err
2986 }
2987 dagr.Type = &typeVar
2988 }
2989 case "location":
2990 if v != nil {
2991 var location string
2992 err = json.Unmarshal(*v, &location)
2993 if err != nil {
2994 return err
2995 }
2996 dagr.Location = &location
2997 }
2998 case "tags":
2999 if v != nil {
3000 var tags map[string]*string
3001 err = json.Unmarshal(*v, &tags)
3002 if err != nil {
3003 return err
3004 }
3005 dagr.Tags = tags
3006 }
3007 case "identity":
3008 if v != nil {
3009 var identity ManagedServiceIdentity
3010 err = json.Unmarshal(*v, &identity)
3011 if err != nil {
3012 return err
3013 }
3014 dagr.Identity = &identity
3015 }
3016 }
3017 }
3018
3019 return nil
3020 }
3021
3022
3023 type DatabaseAccountListConnectionStringsResult struct {
3024 autorest.Response `json:"-"`
3025
3026 ConnectionStrings *[]DatabaseAccountConnectionString `json:"connectionStrings,omitempty"`
3027 }
3028
3029
3030 type DatabaseAccountListKeysResult struct {
3031 autorest.Response `json:"-"`
3032
3033 PrimaryMasterKey *string `json:"primaryMasterKey,omitempty"`
3034
3035 SecondaryMasterKey *string `json:"secondaryMasterKey,omitempty"`
3036
3037 PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"`
3038
3039 SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"`
3040 }
3041
3042
3043 func (dalkr DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) {
3044 objectMap := make(map[string]interface{})
3045 return json.Marshal(objectMap)
3046 }
3047
3048
3049 type DatabaseAccountListReadOnlyKeysResult struct {
3050 autorest.Response `json:"-"`
3051
3052 PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"`
3053
3054 SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"`
3055 }
3056
3057
3058 func (dalrokr DatabaseAccountListReadOnlyKeysResult) MarshalJSON() ([]byte, error) {
3059 objectMap := make(map[string]interface{})
3060 return json.Marshal(objectMap)
3061 }
3062
3063
3064 type DatabaseAccountRegenerateKeyParameters struct {
3065
3066 KeyKind KeyKind `json:"keyKind,omitempty"`
3067 }
3068
3069
3070
3071 type DatabaseAccountsCreateOrUpdateFuture struct {
3072 azure.FutureAPI
3073
3074
3075 Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error)
3076 }
3077
3078
3079 func (future *DatabaseAccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
3080 var azFuture azure.Future
3081 if err := json.Unmarshal(body, &azFuture); err != nil {
3082 return err
3083 }
3084 future.FutureAPI = &azFuture
3085 future.Result = future.result
3086 return nil
3087 }
3088
3089
3090 func (future *DatabaseAccountsCreateOrUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) {
3091 var done bool
3092 done, err = future.DoneWithContext(context.Background(), client)
3093 if err != nil {
3094 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
3095 return
3096 }
3097 if !done {
3098 dagr.Response.Response = future.Response()
3099 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsCreateOrUpdateFuture")
3100 return
3101 }
3102 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3103 if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent {
3104 dagr, err = client.CreateOrUpdateResponder(dagr.Response.Response)
3105 if err != nil {
3106 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request")
3107 }
3108 }
3109 return
3110 }
3111
3112
3113
3114 type DatabaseAccountsDeleteFuture struct {
3115 azure.FutureAPI
3116
3117
3118 Result func(DatabaseAccountsClient) (autorest.Response, error)
3119 }
3120
3121
3122 func (future *DatabaseAccountsDeleteFuture) UnmarshalJSON(body []byte) error {
3123 var azFuture azure.Future
3124 if err := json.Unmarshal(body, &azFuture); err != nil {
3125 return err
3126 }
3127 future.FutureAPI = &azFuture
3128 future.Result = future.result
3129 return nil
3130 }
3131
3132
3133 func (future *DatabaseAccountsDeleteFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
3134 var done bool
3135 done, err = future.DoneWithContext(context.Background(), client)
3136 if err != nil {
3137 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteFuture", "Result", future.Response(), "Polling failure")
3138 return
3139 }
3140 if !done {
3141 ar.Response = future.Response()
3142 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsDeleteFuture")
3143 return
3144 }
3145 ar.Response = future.Response()
3146 return
3147 }
3148
3149
3150
3151 type DatabaseAccountsFailoverPriorityChangeFuture struct {
3152 azure.FutureAPI
3153
3154
3155 Result func(DatabaseAccountsClient) (autorest.Response, error)
3156 }
3157
3158
3159 func (future *DatabaseAccountsFailoverPriorityChangeFuture) UnmarshalJSON(body []byte) error {
3160 var azFuture azure.Future
3161 if err := json.Unmarshal(body, &azFuture); err != nil {
3162 return err
3163 }
3164 future.FutureAPI = &azFuture
3165 future.Result = future.result
3166 return nil
3167 }
3168
3169
3170 func (future *DatabaseAccountsFailoverPriorityChangeFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
3171 var done bool
3172 done, err = future.DoneWithContext(context.Background(), client)
3173 if err != nil {
3174 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", future.Response(), "Polling failure")
3175 return
3176 }
3177 if !done {
3178 ar.Response = future.Response()
3179 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsFailoverPriorityChangeFuture")
3180 return
3181 }
3182 ar.Response = future.Response()
3183 return
3184 }
3185
3186
3187
3188 type DatabaseAccountsListResult struct {
3189 autorest.Response `json:"-"`
3190
3191 Value *[]DatabaseAccountGetResults `json:"value,omitempty"`
3192 }
3193
3194
3195 func (dalr DatabaseAccountsListResult) MarshalJSON() ([]byte, error) {
3196 objectMap := make(map[string]interface{})
3197 return json.Marshal(objectMap)
3198 }
3199
3200
3201
3202 type DatabaseAccountsOfflineRegionFuture struct {
3203 azure.FutureAPI
3204
3205
3206 Result func(DatabaseAccountsClient) (autorest.Response, error)
3207 }
3208
3209
3210 func (future *DatabaseAccountsOfflineRegionFuture) UnmarshalJSON(body []byte) error {
3211 var azFuture azure.Future
3212 if err := json.Unmarshal(body, &azFuture); err != nil {
3213 return err
3214 }
3215 future.FutureAPI = &azFuture
3216 future.Result = future.result
3217 return nil
3218 }
3219
3220
3221 func (future *DatabaseAccountsOfflineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
3222 var done bool
3223 done, err = future.DoneWithContext(context.Background(), client)
3224 if err != nil {
3225 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOfflineRegionFuture", "Result", future.Response(), "Polling failure")
3226 return
3227 }
3228 if !done {
3229 ar.Response = future.Response()
3230 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOfflineRegionFuture")
3231 return
3232 }
3233 ar.Response = future.Response()
3234 return
3235 }
3236
3237
3238
3239 type DatabaseAccountsOnlineRegionFuture struct {
3240 azure.FutureAPI
3241
3242
3243 Result func(DatabaseAccountsClient) (autorest.Response, error)
3244 }
3245
3246
3247 func (future *DatabaseAccountsOnlineRegionFuture) UnmarshalJSON(body []byte) error {
3248 var azFuture azure.Future
3249 if err := json.Unmarshal(body, &azFuture); err != nil {
3250 return err
3251 }
3252 future.FutureAPI = &azFuture
3253 future.Result = future.result
3254 return nil
3255 }
3256
3257
3258 func (future *DatabaseAccountsOnlineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
3259 var done bool
3260 done, err = future.DoneWithContext(context.Background(), client)
3261 if err != nil {
3262 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOnlineRegionFuture", "Result", future.Response(), "Polling failure")
3263 return
3264 }
3265 if !done {
3266 ar.Response = future.Response()
3267 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOnlineRegionFuture")
3268 return
3269 }
3270 ar.Response = future.Response()
3271 return
3272 }
3273
3274
3275
3276 type DatabaseAccountsRegenerateKeyFuture struct {
3277 azure.FutureAPI
3278
3279
3280 Result func(DatabaseAccountsClient) (autorest.Response, error)
3281 }
3282
3283
3284 func (future *DatabaseAccountsRegenerateKeyFuture) UnmarshalJSON(body []byte) error {
3285 var azFuture azure.Future
3286 if err := json.Unmarshal(body, &azFuture); err != nil {
3287 return err
3288 }
3289 future.FutureAPI = &azFuture
3290 future.Result = future.result
3291 return nil
3292 }
3293
3294
3295 func (future *DatabaseAccountsRegenerateKeyFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
3296 var done bool
3297 done, err = future.DoneWithContext(context.Background(), client)
3298 if err != nil {
3299 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", future.Response(), "Polling failure")
3300 return
3301 }
3302 if !done {
3303 ar.Response = future.Response()
3304 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsRegenerateKeyFuture")
3305 return
3306 }
3307 ar.Response = future.Response()
3308 return
3309 }
3310
3311
3312
3313 type DatabaseAccountsUpdateFuture struct {
3314 azure.FutureAPI
3315
3316
3317 Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error)
3318 }
3319
3320
3321 func (future *DatabaseAccountsUpdateFuture) UnmarshalJSON(body []byte) error {
3322 var azFuture azure.Future
3323 if err := json.Unmarshal(body, &azFuture); err != nil {
3324 return err
3325 }
3326 future.FutureAPI = &azFuture
3327 future.Result = future.result
3328 return nil
3329 }
3330
3331
3332 func (future *DatabaseAccountsUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) {
3333 var done bool
3334 done, err = future.DoneWithContext(context.Background(), client)
3335 if err != nil {
3336 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", future.Response(), "Polling failure")
3337 return
3338 }
3339 if !done {
3340 dagr.Response.Response = future.Response()
3341 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsUpdateFuture")
3342 return
3343 }
3344 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3345 if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent {
3346 dagr, err = client.UpdateResponder(dagr.Response.Response)
3347 if err != nil {
3348 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request")
3349 }
3350 }
3351 return
3352 }
3353
3354
3355 type DatabaseAccountUpdateParameters struct {
3356 Tags map[string]*string `json:"tags"`
3357
3358 Location *string `json:"location,omitempty"`
3359 *DatabaseAccountUpdateProperties `json:"properties,omitempty"`
3360 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
3361 }
3362
3363
3364 func (daup DatabaseAccountUpdateParameters) MarshalJSON() ([]byte, error) {
3365 objectMap := make(map[string]interface{})
3366 if daup.Tags != nil {
3367 objectMap["tags"] = daup.Tags
3368 }
3369 if daup.Location != nil {
3370 objectMap["location"] = daup.Location
3371 }
3372 if daup.DatabaseAccountUpdateProperties != nil {
3373 objectMap["properties"] = daup.DatabaseAccountUpdateProperties
3374 }
3375 if daup.Identity != nil {
3376 objectMap["identity"] = daup.Identity
3377 }
3378 return json.Marshal(objectMap)
3379 }
3380
3381
3382 func (daup *DatabaseAccountUpdateParameters) UnmarshalJSON(body []byte) error {
3383 var m map[string]*json.RawMessage
3384 err := json.Unmarshal(body, &m)
3385 if err != nil {
3386 return err
3387 }
3388 for k, v := range m {
3389 switch k {
3390 case "tags":
3391 if v != nil {
3392 var tags map[string]*string
3393 err = json.Unmarshal(*v, &tags)
3394 if err != nil {
3395 return err
3396 }
3397 daup.Tags = tags
3398 }
3399 case "location":
3400 if v != nil {
3401 var location string
3402 err = json.Unmarshal(*v, &location)
3403 if err != nil {
3404 return err
3405 }
3406 daup.Location = &location
3407 }
3408 case "properties":
3409 if v != nil {
3410 var databaseAccountUpdateProperties DatabaseAccountUpdateProperties
3411 err = json.Unmarshal(*v, &databaseAccountUpdateProperties)
3412 if err != nil {
3413 return err
3414 }
3415 daup.DatabaseAccountUpdateProperties = &databaseAccountUpdateProperties
3416 }
3417 case "identity":
3418 if v != nil {
3419 var identity ManagedServiceIdentity
3420 err = json.Unmarshal(*v, &identity)
3421 if err != nil {
3422 return err
3423 }
3424 daup.Identity = &identity
3425 }
3426 }
3427 }
3428
3429 return nil
3430 }
3431
3432
3433 type DatabaseAccountUpdateProperties struct {
3434
3435 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"`
3436
3437 Locations *[]Location `json:"locations,omitempty"`
3438
3439 IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"`
3440
3441 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
3442
3443 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`
3444
3445 Capabilities *[]Capability `json:"capabilities,omitempty"`
3446
3447 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
3448
3449 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`
3450
3451 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`
3452
3453 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"`
3454
3455 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`
3456
3457 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"`
3458
3459 DefaultIdentity *string `json:"defaultIdentity,omitempty"`
3460
3461 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
3462
3463 EnableFreeTier *bool `json:"enableFreeTier,omitempty"`
3464
3465 APIProperties *APIProperties `json:"apiProperties,omitempty"`
3466
3467 EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"`
3468
3469 BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"`
3470
3471 Cors *[]CorsPolicy `json:"cors,omitempty"`
3472
3473 NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"`
3474
3475 NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"`
3476 }
3477
3478
3479 func (daup *DatabaseAccountUpdateProperties) UnmarshalJSON(body []byte) error {
3480 var m map[string]*json.RawMessage
3481 err := json.Unmarshal(body, &m)
3482 if err != nil {
3483 return err
3484 }
3485 for k, v := range m {
3486 switch k {
3487 case "consistencyPolicy":
3488 if v != nil {
3489 var consistencyPolicy ConsistencyPolicy
3490 err = json.Unmarshal(*v, &consistencyPolicy)
3491 if err != nil {
3492 return err
3493 }
3494 daup.ConsistencyPolicy = &consistencyPolicy
3495 }
3496 case "locations":
3497 if v != nil {
3498 var locations []Location
3499 err = json.Unmarshal(*v, &locations)
3500 if err != nil {
3501 return err
3502 }
3503 daup.Locations = &locations
3504 }
3505 case "ipRules":
3506 if v != nil {
3507 var IPRules []IPAddressOrRange
3508 err = json.Unmarshal(*v, &IPRules)
3509 if err != nil {
3510 return err
3511 }
3512 daup.IPRules = &IPRules
3513 }
3514 case "isVirtualNetworkFilterEnabled":
3515 if v != nil {
3516 var isVirtualNetworkFilterEnabled bool
3517 err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled)
3518 if err != nil {
3519 return err
3520 }
3521 daup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
3522 }
3523 case "enableAutomaticFailover":
3524 if v != nil {
3525 var enableAutomaticFailover bool
3526 err = json.Unmarshal(*v, &enableAutomaticFailover)
3527 if err != nil {
3528 return err
3529 }
3530 daup.EnableAutomaticFailover = &enableAutomaticFailover
3531 }
3532 case "capabilities":
3533 if v != nil {
3534 var capabilities []Capability
3535 err = json.Unmarshal(*v, &capabilities)
3536 if err != nil {
3537 return err
3538 }
3539 daup.Capabilities = &capabilities
3540 }
3541 case "virtualNetworkRules":
3542 if v != nil {
3543 var virtualNetworkRules []VirtualNetworkRule
3544 err = json.Unmarshal(*v, &virtualNetworkRules)
3545 if err != nil {
3546 return err
3547 }
3548 daup.VirtualNetworkRules = &virtualNetworkRules
3549 }
3550 case "enableMultipleWriteLocations":
3551 if v != nil {
3552 var enableMultipleWriteLocations bool
3553 err = json.Unmarshal(*v, &enableMultipleWriteLocations)
3554 if err != nil {
3555 return err
3556 }
3557 daup.EnableMultipleWriteLocations = &enableMultipleWriteLocations
3558 }
3559 case "enableCassandraConnector":
3560 if v != nil {
3561 var enableCassandraConnector bool
3562 err = json.Unmarshal(*v, &enableCassandraConnector)
3563 if err != nil {
3564 return err
3565 }
3566 daup.EnableCassandraConnector = &enableCassandraConnector
3567 }
3568 case "connectorOffer":
3569 if v != nil {
3570 var connectorOffer ConnectorOffer
3571 err = json.Unmarshal(*v, &connectorOffer)
3572 if err != nil {
3573 return err
3574 }
3575 daup.ConnectorOffer = connectorOffer
3576 }
3577 case "disableKeyBasedMetadataWriteAccess":
3578 if v != nil {
3579 var disableKeyBasedMetadataWriteAccess bool
3580 err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess)
3581 if err != nil {
3582 return err
3583 }
3584 daup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
3585 }
3586 case "keyVaultKeyUri":
3587 if v != nil {
3588 var keyVaultKeyURI string
3589 err = json.Unmarshal(*v, &keyVaultKeyURI)
3590 if err != nil {
3591 return err
3592 }
3593 daup.KeyVaultKeyURI = &keyVaultKeyURI
3594 }
3595 case "defaultIdentity":
3596 if v != nil {
3597 var defaultIdentity string
3598 err = json.Unmarshal(*v, &defaultIdentity)
3599 if err != nil {
3600 return err
3601 }
3602 daup.DefaultIdentity = &defaultIdentity
3603 }
3604 case "publicNetworkAccess":
3605 if v != nil {
3606 var publicNetworkAccess PublicNetworkAccess
3607 err = json.Unmarshal(*v, &publicNetworkAccess)
3608 if err != nil {
3609 return err
3610 }
3611 daup.PublicNetworkAccess = publicNetworkAccess
3612 }
3613 case "enableFreeTier":
3614 if v != nil {
3615 var enableFreeTier bool
3616 err = json.Unmarshal(*v, &enableFreeTier)
3617 if err != nil {
3618 return err
3619 }
3620 daup.EnableFreeTier = &enableFreeTier
3621 }
3622 case "apiProperties":
3623 if v != nil {
3624 var APIProperties APIProperties
3625 err = json.Unmarshal(*v, &APIProperties)
3626 if err != nil {
3627 return err
3628 }
3629 daup.APIProperties = &APIProperties
3630 }
3631 case "enableAnalyticalStorage":
3632 if v != nil {
3633 var enableAnalyticalStorage bool
3634 err = json.Unmarshal(*v, &enableAnalyticalStorage)
3635 if err != nil {
3636 return err
3637 }
3638 daup.EnableAnalyticalStorage = &enableAnalyticalStorage
3639 }
3640 case "backupPolicy":
3641 if v != nil {
3642 backupPolicy, err := unmarshalBasicBackupPolicy(*v)
3643 if err != nil {
3644 return err
3645 }
3646 daup.BackupPolicy = backupPolicy
3647 }
3648 case "cors":
3649 if v != nil {
3650 var cors []CorsPolicy
3651 err = json.Unmarshal(*v, &cors)
3652 if err != nil {
3653 return err
3654 }
3655 daup.Cors = &cors
3656 }
3657 case "networkAclBypass":
3658 if v != nil {
3659 var networkACLBypass NetworkACLBypass
3660 err = json.Unmarshal(*v, &networkACLBypass)
3661 if err != nil {
3662 return err
3663 }
3664 daup.NetworkACLBypass = networkACLBypass
3665 }
3666 case "networkAclBypassResourceIds":
3667 if v != nil {
3668 var networkACLBypassResourceIds []string
3669 err = json.Unmarshal(*v, &networkACLBypassResourceIds)
3670 if err != nil {
3671 return err
3672 }
3673 daup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds
3674 }
3675 }
3676 }
3677
3678 return nil
3679 }
3680
3681
3682 type DatabaseRestoreResource struct {
3683
3684 DatabaseName *string `json:"databaseName,omitempty"`
3685
3686 CollectionNames *[]string `json:"collectionNames,omitempty"`
3687 }
3688
3689
3690 type DataCenterResource struct {
3691 autorest.Response `json:"-"`
3692
3693 Properties *DataCenterResourceProperties `json:"properties,omitempty"`
3694
3695 ID *string `json:"id,omitempty"`
3696
3697 Name *string `json:"name,omitempty"`
3698
3699 Type *string `json:"type,omitempty"`
3700 }
3701
3702
3703 func (dcr DataCenterResource) MarshalJSON() ([]byte, error) {
3704 objectMap := make(map[string]interface{})
3705 if dcr.Properties != nil {
3706 objectMap["properties"] = dcr.Properties
3707 }
3708 return json.Marshal(objectMap)
3709 }
3710
3711
3712 type DataCenterResourceProperties struct {
3713
3714 ProvisioningState ManagedCassandraProvisioningState `json:"provisioningState,omitempty"`
3715
3716 DataCenterLocation *string `json:"dataCenterLocation,omitempty"`
3717
3718 DelegatedSubnetID *string `json:"delegatedSubnetId,omitempty"`
3719
3720 NodeCount *int32 `json:"nodeCount,omitempty"`
3721
3722 SeedNodes *[]SeedNode `json:"seedNodes,omitempty"`
3723
3724 Base64EncodedCassandraYamlFragment *string `json:"base64EncodedCassandraYamlFragment,omitempty"`
3725 }
3726
3727
3728 func (dcr DataCenterResourceProperties) MarshalJSON() ([]byte, error) {
3729 objectMap := make(map[string]interface{})
3730 if dcr.ProvisioningState != "" {
3731 objectMap["provisioningState"] = dcr.ProvisioningState
3732 }
3733 if dcr.DataCenterLocation != nil {
3734 objectMap["dataCenterLocation"] = dcr.DataCenterLocation
3735 }
3736 if dcr.DelegatedSubnetID != nil {
3737 objectMap["delegatedSubnetId"] = dcr.DelegatedSubnetID
3738 }
3739 if dcr.NodeCount != nil {
3740 objectMap["nodeCount"] = dcr.NodeCount
3741 }
3742 if dcr.Base64EncodedCassandraYamlFragment != nil {
3743 objectMap["base64EncodedCassandraYamlFragment"] = dcr.Base64EncodedCassandraYamlFragment
3744 }
3745 return json.Marshal(objectMap)
3746 }
3747
3748
3749 type DataTransferRegionalServiceResource struct {
3750
3751 Name *string `json:"name,omitempty"`
3752
3753 Location *string `json:"location,omitempty"`
3754
3755 Status ServiceStatus `json:"status,omitempty"`
3756 }
3757
3758
3759 func (dtrsr DataTransferRegionalServiceResource) MarshalJSON() ([]byte, error) {
3760 objectMap := make(map[string]interface{})
3761 return json.Marshal(objectMap)
3762 }
3763
3764
3765 type DataTransferServiceResource struct {
3766 Properties *DataTransferServiceResourceProperties `json:"properties,omitempty"`
3767 }
3768
3769
3770 type DataTransferServiceResourceProperties struct {
3771
3772 Locations *[]DataTransferRegionalServiceResource `json:"locations,omitempty"`
3773
3774 AdditionalProperties map[string]interface{} `json:""`
3775
3776 CreationTime *date.Time `json:"creationTime,omitempty"`
3777
3778 InstanceSize ServiceSize `json:"instanceSize,omitempty"`
3779
3780 InstanceCount *int32 `json:"instanceCount,omitempty"`
3781
3782 Status ServiceStatus `json:"status,omitempty"`
3783
3784 ServiceType ServiceTypeBasicServiceResourceProperties `json:"serviceType,omitempty"`
3785 }
3786
3787
3788 func (dtsrp DataTransferServiceResourceProperties) MarshalJSON() ([]byte, error) {
3789 dtsrp.ServiceType = ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransferServiceResourceProperties
3790 objectMap := make(map[string]interface{})
3791 if dtsrp.InstanceSize != "" {
3792 objectMap["instanceSize"] = dtsrp.InstanceSize
3793 }
3794 if dtsrp.InstanceCount != nil {
3795 objectMap["instanceCount"] = dtsrp.InstanceCount
3796 }
3797 if dtsrp.ServiceType != "" {
3798 objectMap["serviceType"] = dtsrp.ServiceType
3799 }
3800 for k, v := range dtsrp.AdditionalProperties {
3801 objectMap[k] = v
3802 }
3803 return json.Marshal(objectMap)
3804 }
3805
3806
3807 func (dtsrp DataTransferServiceResourceProperties) AsDataTransferServiceResourceProperties() (*DataTransferServiceResourceProperties, bool) {
3808 return &dtsrp, true
3809 }
3810
3811
3812 func (dtsrp DataTransferServiceResourceProperties) AsSQLDedicatedGatewayServiceResourceProperties() (*SQLDedicatedGatewayServiceResourceProperties, bool) {
3813 return nil, false
3814 }
3815
3816
3817 func (dtsrp DataTransferServiceResourceProperties) AsServiceResourceProperties() (*ServiceResourceProperties, bool) {
3818 return nil, false
3819 }
3820
3821
3822 func (dtsrp DataTransferServiceResourceProperties) AsBasicServiceResourceProperties() (BasicServiceResourceProperties, bool) {
3823 return &dtsrp, true
3824 }
3825
3826
3827 func (dtsrp *DataTransferServiceResourceProperties) UnmarshalJSON(body []byte) error {
3828 var m map[string]*json.RawMessage
3829 err := json.Unmarshal(body, &m)
3830 if err != nil {
3831 return err
3832 }
3833 for k, v := range m {
3834 switch k {
3835 case "locations":
3836 if v != nil {
3837 var locations []DataTransferRegionalServiceResource
3838 err = json.Unmarshal(*v, &locations)
3839 if err != nil {
3840 return err
3841 }
3842 dtsrp.Locations = &locations
3843 }
3844 default:
3845 if v != nil {
3846 var additionalProperties interface{}
3847 err = json.Unmarshal(*v, &additionalProperties)
3848 if err != nil {
3849 return err
3850 }
3851 if dtsrp.AdditionalProperties == nil {
3852 dtsrp.AdditionalProperties = make(map[string]interface{})
3853 }
3854 dtsrp.AdditionalProperties[k] = additionalProperties
3855 }
3856 case "creationTime":
3857 if v != nil {
3858 var creationTime date.Time
3859 err = json.Unmarshal(*v, &creationTime)
3860 if err != nil {
3861 return err
3862 }
3863 dtsrp.CreationTime = &creationTime
3864 }
3865 case "instanceSize":
3866 if v != nil {
3867 var instanceSize ServiceSize
3868 err = json.Unmarshal(*v, &instanceSize)
3869 if err != nil {
3870 return err
3871 }
3872 dtsrp.InstanceSize = instanceSize
3873 }
3874 case "instanceCount":
3875 if v != nil {
3876 var instanceCount int32
3877 err = json.Unmarshal(*v, &instanceCount)
3878 if err != nil {
3879 return err
3880 }
3881 dtsrp.InstanceCount = &instanceCount
3882 }
3883 case "status":
3884 if v != nil {
3885 var status ServiceStatus
3886 err = json.Unmarshal(*v, &status)
3887 if err != nil {
3888 return err
3889 }
3890 dtsrp.Status = status
3891 }
3892 case "serviceType":
3893 if v != nil {
3894 var serviceType ServiceTypeBasicServiceResourceProperties
3895 err = json.Unmarshal(*v, &serviceType)
3896 if err != nil {
3897 return err
3898 }
3899 dtsrp.ServiceType = serviceType
3900 }
3901 }
3902 }
3903
3904 return nil
3905 }
3906
3907
3908
3909 type DefaultRequestDatabaseAccountCreateUpdateProperties struct {
3910
3911 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"`
3912
3913 Locations *[]Location `json:"locations,omitempty"`
3914
3915 DatabaseAccountOfferType *string `json:"databaseAccountOfferType,omitempty"`
3916
3917 IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"`
3918
3919 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
3920
3921 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`
3922
3923 Capabilities *[]Capability `json:"capabilities,omitempty"`
3924
3925 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
3926
3927 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`
3928
3929 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`
3930
3931 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"`
3932
3933 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`
3934
3935 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"`
3936
3937 DefaultIdentity *string `json:"defaultIdentity,omitempty"`
3938
3939 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
3940
3941 EnableFreeTier *bool `json:"enableFreeTier,omitempty"`
3942
3943 APIProperties *APIProperties `json:"apiProperties,omitempty"`
3944
3945 EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"`
3946
3947 BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"`
3948
3949 Cors *[]CorsPolicy `json:"cors,omitempty"`
3950
3951 NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"`
3952
3953 NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"`
3954
3955 CreateMode CreateModeBasicDatabaseAccountCreateUpdateProperties `json:"createMode,omitempty"`
3956 }
3957
3958
3959 func (drdacup DefaultRequestDatabaseAccountCreateUpdateProperties) MarshalJSON() ([]byte, error) {
3960 drdacup.CreateMode = CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeDefault
3961 objectMap := make(map[string]interface{})
3962 if drdacup.ConsistencyPolicy != nil {
3963 objectMap["consistencyPolicy"] = drdacup.ConsistencyPolicy
3964 }
3965 if drdacup.Locations != nil {
3966 objectMap["locations"] = drdacup.Locations
3967 }
3968 if drdacup.DatabaseAccountOfferType != nil {
3969 objectMap["databaseAccountOfferType"] = drdacup.DatabaseAccountOfferType
3970 }
3971 if drdacup.IPRules != nil {
3972 objectMap["ipRules"] = drdacup.IPRules
3973 }
3974 if drdacup.IsVirtualNetworkFilterEnabled != nil {
3975 objectMap["isVirtualNetworkFilterEnabled"] = drdacup.IsVirtualNetworkFilterEnabled
3976 }
3977 if drdacup.EnableAutomaticFailover != nil {
3978 objectMap["enableAutomaticFailover"] = drdacup.EnableAutomaticFailover
3979 }
3980 if drdacup.Capabilities != nil {
3981 objectMap["capabilities"] = drdacup.Capabilities
3982 }
3983 if drdacup.VirtualNetworkRules != nil {
3984 objectMap["virtualNetworkRules"] = drdacup.VirtualNetworkRules
3985 }
3986 if drdacup.EnableMultipleWriteLocations != nil {
3987 objectMap["enableMultipleWriteLocations"] = drdacup.EnableMultipleWriteLocations
3988 }
3989 if drdacup.EnableCassandraConnector != nil {
3990 objectMap["enableCassandraConnector"] = drdacup.EnableCassandraConnector
3991 }
3992 if drdacup.ConnectorOffer != "" {
3993 objectMap["connectorOffer"] = drdacup.ConnectorOffer
3994 }
3995 if drdacup.DisableKeyBasedMetadataWriteAccess != nil {
3996 objectMap["disableKeyBasedMetadataWriteAccess"] = drdacup.DisableKeyBasedMetadataWriteAccess
3997 }
3998 if drdacup.KeyVaultKeyURI != nil {
3999 objectMap["keyVaultKeyUri"] = drdacup.KeyVaultKeyURI
4000 }
4001 if drdacup.DefaultIdentity != nil {
4002 objectMap["defaultIdentity"] = drdacup.DefaultIdentity
4003 }
4004 if drdacup.PublicNetworkAccess != "" {
4005 objectMap["publicNetworkAccess"] = drdacup.PublicNetworkAccess
4006 }
4007 if drdacup.EnableFreeTier != nil {
4008 objectMap["enableFreeTier"] = drdacup.EnableFreeTier
4009 }
4010 if drdacup.APIProperties != nil {
4011 objectMap["apiProperties"] = drdacup.APIProperties
4012 }
4013 if drdacup.EnableAnalyticalStorage != nil {
4014 objectMap["enableAnalyticalStorage"] = drdacup.EnableAnalyticalStorage
4015 }
4016 objectMap["backupPolicy"] = drdacup.BackupPolicy
4017 if drdacup.Cors != nil {
4018 objectMap["cors"] = drdacup.Cors
4019 }
4020 if drdacup.NetworkACLBypass != "" {
4021 objectMap["networkAclBypass"] = drdacup.NetworkACLBypass
4022 }
4023 if drdacup.NetworkACLBypassResourceIds != nil {
4024 objectMap["networkAclBypassResourceIds"] = drdacup.NetworkACLBypassResourceIds
4025 }
4026 if drdacup.CreateMode != "" {
4027 objectMap["createMode"] = drdacup.CreateMode
4028 }
4029 return json.Marshal(objectMap)
4030 }
4031
4032
4033 func (drdacup DefaultRequestDatabaseAccountCreateUpdateProperties) AsDefaultRequestDatabaseAccountCreateUpdateProperties() (*DefaultRequestDatabaseAccountCreateUpdateProperties, bool) {
4034 return &drdacup, true
4035 }
4036
4037
4038 func (drdacup DefaultRequestDatabaseAccountCreateUpdateProperties) AsRestoreReqeustDatabaseAccountCreateUpdateProperties() (*RestoreReqeustDatabaseAccountCreateUpdateProperties, bool) {
4039 return nil, false
4040 }
4041
4042
4043 func (drdacup DefaultRequestDatabaseAccountCreateUpdateProperties) AsDatabaseAccountCreateUpdateProperties() (*DatabaseAccountCreateUpdateProperties, bool) {
4044 return nil, false
4045 }
4046
4047
4048 func (drdacup DefaultRequestDatabaseAccountCreateUpdateProperties) AsBasicDatabaseAccountCreateUpdateProperties() (BasicDatabaseAccountCreateUpdateProperties, bool) {
4049 return &drdacup, true
4050 }
4051
4052
4053 func (drdacup *DefaultRequestDatabaseAccountCreateUpdateProperties) UnmarshalJSON(body []byte) error {
4054 var m map[string]*json.RawMessage
4055 err := json.Unmarshal(body, &m)
4056 if err != nil {
4057 return err
4058 }
4059 for k, v := range m {
4060 switch k {
4061 case "consistencyPolicy":
4062 if v != nil {
4063 var consistencyPolicy ConsistencyPolicy
4064 err = json.Unmarshal(*v, &consistencyPolicy)
4065 if err != nil {
4066 return err
4067 }
4068 drdacup.ConsistencyPolicy = &consistencyPolicy
4069 }
4070 case "locations":
4071 if v != nil {
4072 var locations []Location
4073 err = json.Unmarshal(*v, &locations)
4074 if err != nil {
4075 return err
4076 }
4077 drdacup.Locations = &locations
4078 }
4079 case "databaseAccountOfferType":
4080 if v != nil {
4081 var databaseAccountOfferType string
4082 err = json.Unmarshal(*v, &databaseAccountOfferType)
4083 if err != nil {
4084 return err
4085 }
4086 drdacup.DatabaseAccountOfferType = &databaseAccountOfferType
4087 }
4088 case "ipRules":
4089 if v != nil {
4090 var IPRules []IPAddressOrRange
4091 err = json.Unmarshal(*v, &IPRules)
4092 if err != nil {
4093 return err
4094 }
4095 drdacup.IPRules = &IPRules
4096 }
4097 case "isVirtualNetworkFilterEnabled":
4098 if v != nil {
4099 var isVirtualNetworkFilterEnabled bool
4100 err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled)
4101 if err != nil {
4102 return err
4103 }
4104 drdacup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
4105 }
4106 case "enableAutomaticFailover":
4107 if v != nil {
4108 var enableAutomaticFailover bool
4109 err = json.Unmarshal(*v, &enableAutomaticFailover)
4110 if err != nil {
4111 return err
4112 }
4113 drdacup.EnableAutomaticFailover = &enableAutomaticFailover
4114 }
4115 case "capabilities":
4116 if v != nil {
4117 var capabilities []Capability
4118 err = json.Unmarshal(*v, &capabilities)
4119 if err != nil {
4120 return err
4121 }
4122 drdacup.Capabilities = &capabilities
4123 }
4124 case "virtualNetworkRules":
4125 if v != nil {
4126 var virtualNetworkRules []VirtualNetworkRule
4127 err = json.Unmarshal(*v, &virtualNetworkRules)
4128 if err != nil {
4129 return err
4130 }
4131 drdacup.VirtualNetworkRules = &virtualNetworkRules
4132 }
4133 case "enableMultipleWriteLocations":
4134 if v != nil {
4135 var enableMultipleWriteLocations bool
4136 err = json.Unmarshal(*v, &enableMultipleWriteLocations)
4137 if err != nil {
4138 return err
4139 }
4140 drdacup.EnableMultipleWriteLocations = &enableMultipleWriteLocations
4141 }
4142 case "enableCassandraConnector":
4143 if v != nil {
4144 var enableCassandraConnector bool
4145 err = json.Unmarshal(*v, &enableCassandraConnector)
4146 if err != nil {
4147 return err
4148 }
4149 drdacup.EnableCassandraConnector = &enableCassandraConnector
4150 }
4151 case "connectorOffer":
4152 if v != nil {
4153 var connectorOffer ConnectorOffer
4154 err = json.Unmarshal(*v, &connectorOffer)
4155 if err != nil {
4156 return err
4157 }
4158 drdacup.ConnectorOffer = connectorOffer
4159 }
4160 case "disableKeyBasedMetadataWriteAccess":
4161 if v != nil {
4162 var disableKeyBasedMetadataWriteAccess bool
4163 err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess)
4164 if err != nil {
4165 return err
4166 }
4167 drdacup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
4168 }
4169 case "keyVaultKeyUri":
4170 if v != nil {
4171 var keyVaultKeyURI string
4172 err = json.Unmarshal(*v, &keyVaultKeyURI)
4173 if err != nil {
4174 return err
4175 }
4176 drdacup.KeyVaultKeyURI = &keyVaultKeyURI
4177 }
4178 case "defaultIdentity":
4179 if v != nil {
4180 var defaultIdentity string
4181 err = json.Unmarshal(*v, &defaultIdentity)
4182 if err != nil {
4183 return err
4184 }
4185 drdacup.DefaultIdentity = &defaultIdentity
4186 }
4187 case "publicNetworkAccess":
4188 if v != nil {
4189 var publicNetworkAccess PublicNetworkAccess
4190 err = json.Unmarshal(*v, &publicNetworkAccess)
4191 if err != nil {
4192 return err
4193 }
4194 drdacup.PublicNetworkAccess = publicNetworkAccess
4195 }
4196 case "enableFreeTier":
4197 if v != nil {
4198 var enableFreeTier bool
4199 err = json.Unmarshal(*v, &enableFreeTier)
4200 if err != nil {
4201 return err
4202 }
4203 drdacup.EnableFreeTier = &enableFreeTier
4204 }
4205 case "apiProperties":
4206 if v != nil {
4207 var APIProperties APIProperties
4208 err = json.Unmarshal(*v, &APIProperties)
4209 if err != nil {
4210 return err
4211 }
4212 drdacup.APIProperties = &APIProperties
4213 }
4214 case "enableAnalyticalStorage":
4215 if v != nil {
4216 var enableAnalyticalStorage bool
4217 err = json.Unmarshal(*v, &enableAnalyticalStorage)
4218 if err != nil {
4219 return err
4220 }
4221 drdacup.EnableAnalyticalStorage = &enableAnalyticalStorage
4222 }
4223 case "backupPolicy":
4224 if v != nil {
4225 backupPolicy, err := unmarshalBasicBackupPolicy(*v)
4226 if err != nil {
4227 return err
4228 }
4229 drdacup.BackupPolicy = backupPolicy
4230 }
4231 case "cors":
4232 if v != nil {
4233 var cors []CorsPolicy
4234 err = json.Unmarshal(*v, &cors)
4235 if err != nil {
4236 return err
4237 }
4238 drdacup.Cors = &cors
4239 }
4240 case "networkAclBypass":
4241 if v != nil {
4242 var networkACLBypass NetworkACLBypass
4243 err = json.Unmarshal(*v, &networkACLBypass)
4244 if err != nil {
4245 return err
4246 }
4247 drdacup.NetworkACLBypass = networkACLBypass
4248 }
4249 case "networkAclBypassResourceIds":
4250 if v != nil {
4251 var networkACLBypassResourceIds []string
4252 err = json.Unmarshal(*v, &networkACLBypassResourceIds)
4253 if err != nil {
4254 return err
4255 }
4256 drdacup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds
4257 }
4258 case "createMode":
4259 if v != nil {
4260 var createMode CreateModeBasicDatabaseAccountCreateUpdateProperties
4261 err = json.Unmarshal(*v, &createMode)
4262 if err != nil {
4263 return err
4264 }
4265 drdacup.CreateMode = createMode
4266 }
4267 }
4268 }
4269
4270 return nil
4271 }
4272
4273
4274 type ErrorResponse struct {
4275
4276 Code *string `json:"code,omitempty"`
4277
4278 Message *string `json:"message,omitempty"`
4279 }
4280
4281
4282 type ExcludedPath struct {
4283
4284 Path *string `json:"path,omitempty"`
4285 }
4286
4287
4288
4289 type ExtendedResourceProperties struct {
4290
4291 Rid *string `json:"_rid,omitempty"`
4292
4293 Ts *float64 `json:"_ts,omitempty"`
4294
4295 Etag *string `json:"_etag,omitempty"`
4296 }
4297
4298
4299 func (erp ExtendedResourceProperties) MarshalJSON() ([]byte, error) {
4300 objectMap := make(map[string]interface{})
4301 return json.Marshal(objectMap)
4302 }
4303
4304
4305 type FailoverPolicies struct {
4306
4307 FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"`
4308 }
4309
4310
4311 type FailoverPolicy struct {
4312
4313 ID *string `json:"id,omitempty"`
4314
4315 LocationName *string `json:"locationName,omitempty"`
4316
4317 FailoverPriority *int32 `json:"failoverPriority,omitempty"`
4318 }
4319
4320
4321 func (fp FailoverPolicy) MarshalJSON() ([]byte, error) {
4322 objectMap := make(map[string]interface{})
4323 if fp.LocationName != nil {
4324 objectMap["locationName"] = fp.LocationName
4325 }
4326 if fp.FailoverPriority != nil {
4327 objectMap["failoverPriority"] = fp.FailoverPriority
4328 }
4329 return json.Marshal(objectMap)
4330 }
4331
4332
4333 type GremlinDatabaseCreateUpdateParameters struct {
4334
4335 *GremlinDatabaseCreateUpdateProperties `json:"properties,omitempty"`
4336
4337 ID *string `json:"id,omitempty"`
4338
4339 Name *string `json:"name,omitempty"`
4340
4341 Type *string `json:"type,omitempty"`
4342
4343 Location *string `json:"location,omitempty"`
4344 Tags map[string]*string `json:"tags"`
4345 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
4346 }
4347
4348
4349 func (gdcup GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) {
4350 objectMap := make(map[string]interface{})
4351 if gdcup.GremlinDatabaseCreateUpdateProperties != nil {
4352 objectMap["properties"] = gdcup.GremlinDatabaseCreateUpdateProperties
4353 }
4354 if gdcup.Location != nil {
4355 objectMap["location"] = gdcup.Location
4356 }
4357 if gdcup.Tags != nil {
4358 objectMap["tags"] = gdcup.Tags
4359 }
4360 if gdcup.Identity != nil {
4361 objectMap["identity"] = gdcup.Identity
4362 }
4363 return json.Marshal(objectMap)
4364 }
4365
4366
4367 func (gdcup *GremlinDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error {
4368 var m map[string]*json.RawMessage
4369 err := json.Unmarshal(body, &m)
4370 if err != nil {
4371 return err
4372 }
4373 for k, v := range m {
4374 switch k {
4375 case "properties":
4376 if v != nil {
4377 var gremlinDatabaseCreateUpdateProperties GremlinDatabaseCreateUpdateProperties
4378 err = json.Unmarshal(*v, &gremlinDatabaseCreateUpdateProperties)
4379 if err != nil {
4380 return err
4381 }
4382 gdcup.GremlinDatabaseCreateUpdateProperties = &gremlinDatabaseCreateUpdateProperties
4383 }
4384 case "id":
4385 if v != nil {
4386 var ID string
4387 err = json.Unmarshal(*v, &ID)
4388 if err != nil {
4389 return err
4390 }
4391 gdcup.ID = &ID
4392 }
4393 case "name":
4394 if v != nil {
4395 var name string
4396 err = json.Unmarshal(*v, &name)
4397 if err != nil {
4398 return err
4399 }
4400 gdcup.Name = &name
4401 }
4402 case "type":
4403 if v != nil {
4404 var typeVar string
4405 err = json.Unmarshal(*v, &typeVar)
4406 if err != nil {
4407 return err
4408 }
4409 gdcup.Type = &typeVar
4410 }
4411 case "location":
4412 if v != nil {
4413 var location string
4414 err = json.Unmarshal(*v, &location)
4415 if err != nil {
4416 return err
4417 }
4418 gdcup.Location = &location
4419 }
4420 case "tags":
4421 if v != nil {
4422 var tags map[string]*string
4423 err = json.Unmarshal(*v, &tags)
4424 if err != nil {
4425 return err
4426 }
4427 gdcup.Tags = tags
4428 }
4429 case "identity":
4430 if v != nil {
4431 var identity ManagedServiceIdentity
4432 err = json.Unmarshal(*v, &identity)
4433 if err != nil {
4434 return err
4435 }
4436 gdcup.Identity = &identity
4437 }
4438 }
4439 }
4440
4441 return nil
4442 }
4443
4444
4445 type GremlinDatabaseCreateUpdateProperties struct {
4446
4447 Resource *GremlinDatabaseResource `json:"resource,omitempty"`
4448
4449 Options *CreateUpdateOptions `json:"options,omitempty"`
4450 }
4451
4452
4453 type GremlinDatabaseGetProperties struct {
4454 Resource *GremlinDatabaseGetPropertiesResource `json:"resource,omitempty"`
4455 Options *GremlinDatabaseGetPropertiesOptions `json:"options,omitempty"`
4456 }
4457
4458
4459 type GremlinDatabaseGetPropertiesOptions struct {
4460
4461 Throughput *int32 `json:"throughput,omitempty"`
4462
4463 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
4464 }
4465
4466
4467 type GremlinDatabaseGetPropertiesResource struct {
4468
4469 ID *string `json:"id,omitempty"`
4470
4471 Rid *string `json:"_rid,omitempty"`
4472
4473 Ts *float64 `json:"_ts,omitempty"`
4474
4475 Etag *string `json:"_etag,omitempty"`
4476 }
4477
4478
4479 func (gdgp GremlinDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) {
4480 objectMap := make(map[string]interface{})
4481 if gdgp.ID != nil {
4482 objectMap["id"] = gdgp.ID
4483 }
4484 return json.Marshal(objectMap)
4485 }
4486
4487
4488 type GremlinDatabaseGetResults struct {
4489 autorest.Response `json:"-"`
4490
4491 *GremlinDatabaseGetProperties `json:"properties,omitempty"`
4492
4493 ID *string `json:"id,omitempty"`
4494
4495 Name *string `json:"name,omitempty"`
4496
4497 Type *string `json:"type,omitempty"`
4498
4499 Location *string `json:"location,omitempty"`
4500 Tags map[string]*string `json:"tags"`
4501 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
4502 }
4503
4504
4505 func (gdgr GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) {
4506 objectMap := make(map[string]interface{})
4507 if gdgr.GremlinDatabaseGetProperties != nil {
4508 objectMap["properties"] = gdgr.GremlinDatabaseGetProperties
4509 }
4510 if gdgr.Location != nil {
4511 objectMap["location"] = gdgr.Location
4512 }
4513 if gdgr.Tags != nil {
4514 objectMap["tags"] = gdgr.Tags
4515 }
4516 if gdgr.Identity != nil {
4517 objectMap["identity"] = gdgr.Identity
4518 }
4519 return json.Marshal(objectMap)
4520 }
4521
4522
4523 func (gdgr *GremlinDatabaseGetResults) UnmarshalJSON(body []byte) error {
4524 var m map[string]*json.RawMessage
4525 err := json.Unmarshal(body, &m)
4526 if err != nil {
4527 return err
4528 }
4529 for k, v := range m {
4530 switch k {
4531 case "properties":
4532 if v != nil {
4533 var gremlinDatabaseGetProperties GremlinDatabaseGetProperties
4534 err = json.Unmarshal(*v, &gremlinDatabaseGetProperties)
4535 if err != nil {
4536 return err
4537 }
4538 gdgr.GremlinDatabaseGetProperties = &gremlinDatabaseGetProperties
4539 }
4540 case "id":
4541 if v != nil {
4542 var ID string
4543 err = json.Unmarshal(*v, &ID)
4544 if err != nil {
4545 return err
4546 }
4547 gdgr.ID = &ID
4548 }
4549 case "name":
4550 if v != nil {
4551 var name string
4552 err = json.Unmarshal(*v, &name)
4553 if err != nil {
4554 return err
4555 }
4556 gdgr.Name = &name
4557 }
4558 case "type":
4559 if v != nil {
4560 var typeVar string
4561 err = json.Unmarshal(*v, &typeVar)
4562 if err != nil {
4563 return err
4564 }
4565 gdgr.Type = &typeVar
4566 }
4567 case "location":
4568 if v != nil {
4569 var location string
4570 err = json.Unmarshal(*v, &location)
4571 if err != nil {
4572 return err
4573 }
4574 gdgr.Location = &location
4575 }
4576 case "tags":
4577 if v != nil {
4578 var tags map[string]*string
4579 err = json.Unmarshal(*v, &tags)
4580 if err != nil {
4581 return err
4582 }
4583 gdgr.Tags = tags
4584 }
4585 case "identity":
4586 if v != nil {
4587 var identity ManagedServiceIdentity
4588 err = json.Unmarshal(*v, &identity)
4589 if err != nil {
4590 return err
4591 }
4592 gdgr.Identity = &identity
4593 }
4594 }
4595 }
4596
4597 return nil
4598 }
4599
4600
4601
4602 type GremlinDatabaseListResult struct {
4603 autorest.Response `json:"-"`
4604
4605 Value *[]GremlinDatabaseGetResults `json:"value,omitempty"`
4606 }
4607
4608
4609 func (gdlr GremlinDatabaseListResult) MarshalJSON() ([]byte, error) {
4610 objectMap := make(map[string]interface{})
4611 return json.Marshal(objectMap)
4612 }
4613
4614
4615 type GremlinDatabaseResource struct {
4616
4617 ID *string `json:"id,omitempty"`
4618 }
4619
4620
4621 type GremlinGraphCreateUpdateParameters struct {
4622
4623 *GremlinGraphCreateUpdateProperties `json:"properties,omitempty"`
4624
4625 ID *string `json:"id,omitempty"`
4626
4627 Name *string `json:"name,omitempty"`
4628
4629 Type *string `json:"type,omitempty"`
4630
4631 Location *string `json:"location,omitempty"`
4632 Tags map[string]*string `json:"tags"`
4633 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
4634 }
4635
4636
4637 func (ggcup GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) {
4638 objectMap := make(map[string]interface{})
4639 if ggcup.GremlinGraphCreateUpdateProperties != nil {
4640 objectMap["properties"] = ggcup.GremlinGraphCreateUpdateProperties
4641 }
4642 if ggcup.Location != nil {
4643 objectMap["location"] = ggcup.Location
4644 }
4645 if ggcup.Tags != nil {
4646 objectMap["tags"] = ggcup.Tags
4647 }
4648 if ggcup.Identity != nil {
4649 objectMap["identity"] = ggcup.Identity
4650 }
4651 return json.Marshal(objectMap)
4652 }
4653
4654
4655 func (ggcup *GremlinGraphCreateUpdateParameters) UnmarshalJSON(body []byte) error {
4656 var m map[string]*json.RawMessage
4657 err := json.Unmarshal(body, &m)
4658 if err != nil {
4659 return err
4660 }
4661 for k, v := range m {
4662 switch k {
4663 case "properties":
4664 if v != nil {
4665 var gremlinGraphCreateUpdateProperties GremlinGraphCreateUpdateProperties
4666 err = json.Unmarshal(*v, &gremlinGraphCreateUpdateProperties)
4667 if err != nil {
4668 return err
4669 }
4670 ggcup.GremlinGraphCreateUpdateProperties = &gremlinGraphCreateUpdateProperties
4671 }
4672 case "id":
4673 if v != nil {
4674 var ID string
4675 err = json.Unmarshal(*v, &ID)
4676 if err != nil {
4677 return err
4678 }
4679 ggcup.ID = &ID
4680 }
4681 case "name":
4682 if v != nil {
4683 var name string
4684 err = json.Unmarshal(*v, &name)
4685 if err != nil {
4686 return err
4687 }
4688 ggcup.Name = &name
4689 }
4690 case "type":
4691 if v != nil {
4692 var typeVar string
4693 err = json.Unmarshal(*v, &typeVar)
4694 if err != nil {
4695 return err
4696 }
4697 ggcup.Type = &typeVar
4698 }
4699 case "location":
4700 if v != nil {
4701 var location string
4702 err = json.Unmarshal(*v, &location)
4703 if err != nil {
4704 return err
4705 }
4706 ggcup.Location = &location
4707 }
4708 case "tags":
4709 if v != nil {
4710 var tags map[string]*string
4711 err = json.Unmarshal(*v, &tags)
4712 if err != nil {
4713 return err
4714 }
4715 ggcup.Tags = tags
4716 }
4717 case "identity":
4718 if v != nil {
4719 var identity ManagedServiceIdentity
4720 err = json.Unmarshal(*v, &identity)
4721 if err != nil {
4722 return err
4723 }
4724 ggcup.Identity = &identity
4725 }
4726 }
4727 }
4728
4729 return nil
4730 }
4731
4732
4733 type GremlinGraphCreateUpdateProperties struct {
4734
4735 Resource *GremlinGraphResource `json:"resource,omitempty"`
4736
4737 Options *CreateUpdateOptions `json:"options,omitempty"`
4738 }
4739
4740
4741 type GremlinGraphGetProperties struct {
4742 Resource *GremlinGraphGetPropertiesResource `json:"resource,omitempty"`
4743 Options *GremlinGraphGetPropertiesOptions `json:"options,omitempty"`
4744 }
4745
4746
4747 type GremlinGraphGetPropertiesOptions struct {
4748
4749 Throughput *int32 `json:"throughput,omitempty"`
4750
4751 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
4752 }
4753
4754
4755 type GremlinGraphGetPropertiesResource struct {
4756
4757 ID *string `json:"id,omitempty"`
4758
4759 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
4760
4761 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
4762
4763 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
4764
4765 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
4766
4767 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
4768
4769 Rid *string `json:"_rid,omitempty"`
4770
4771 Ts *float64 `json:"_ts,omitempty"`
4772
4773 Etag *string `json:"_etag,omitempty"`
4774 }
4775
4776
4777 func (gggp GremlinGraphGetPropertiesResource) MarshalJSON() ([]byte, error) {
4778 objectMap := make(map[string]interface{})
4779 if gggp.ID != nil {
4780 objectMap["id"] = gggp.ID
4781 }
4782 if gggp.IndexingPolicy != nil {
4783 objectMap["indexingPolicy"] = gggp.IndexingPolicy
4784 }
4785 if gggp.PartitionKey != nil {
4786 objectMap["partitionKey"] = gggp.PartitionKey
4787 }
4788 if gggp.DefaultTTL != nil {
4789 objectMap["defaultTtl"] = gggp.DefaultTTL
4790 }
4791 if gggp.UniqueKeyPolicy != nil {
4792 objectMap["uniqueKeyPolicy"] = gggp.UniqueKeyPolicy
4793 }
4794 if gggp.ConflictResolutionPolicy != nil {
4795 objectMap["conflictResolutionPolicy"] = gggp.ConflictResolutionPolicy
4796 }
4797 return json.Marshal(objectMap)
4798 }
4799
4800
4801 type GremlinGraphGetResults struct {
4802 autorest.Response `json:"-"`
4803
4804 *GremlinGraphGetProperties `json:"properties,omitempty"`
4805
4806 ID *string `json:"id,omitempty"`
4807
4808 Name *string `json:"name,omitempty"`
4809
4810 Type *string `json:"type,omitempty"`
4811
4812 Location *string `json:"location,omitempty"`
4813 Tags map[string]*string `json:"tags"`
4814 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
4815 }
4816
4817
4818 func (gggr GremlinGraphGetResults) MarshalJSON() ([]byte, error) {
4819 objectMap := make(map[string]interface{})
4820 if gggr.GremlinGraphGetProperties != nil {
4821 objectMap["properties"] = gggr.GremlinGraphGetProperties
4822 }
4823 if gggr.Location != nil {
4824 objectMap["location"] = gggr.Location
4825 }
4826 if gggr.Tags != nil {
4827 objectMap["tags"] = gggr.Tags
4828 }
4829 if gggr.Identity != nil {
4830 objectMap["identity"] = gggr.Identity
4831 }
4832 return json.Marshal(objectMap)
4833 }
4834
4835
4836 func (gggr *GremlinGraphGetResults) UnmarshalJSON(body []byte) error {
4837 var m map[string]*json.RawMessage
4838 err := json.Unmarshal(body, &m)
4839 if err != nil {
4840 return err
4841 }
4842 for k, v := range m {
4843 switch k {
4844 case "properties":
4845 if v != nil {
4846 var gremlinGraphGetProperties GremlinGraphGetProperties
4847 err = json.Unmarshal(*v, &gremlinGraphGetProperties)
4848 if err != nil {
4849 return err
4850 }
4851 gggr.GremlinGraphGetProperties = &gremlinGraphGetProperties
4852 }
4853 case "id":
4854 if v != nil {
4855 var ID string
4856 err = json.Unmarshal(*v, &ID)
4857 if err != nil {
4858 return err
4859 }
4860 gggr.ID = &ID
4861 }
4862 case "name":
4863 if v != nil {
4864 var name string
4865 err = json.Unmarshal(*v, &name)
4866 if err != nil {
4867 return err
4868 }
4869 gggr.Name = &name
4870 }
4871 case "type":
4872 if v != nil {
4873 var typeVar string
4874 err = json.Unmarshal(*v, &typeVar)
4875 if err != nil {
4876 return err
4877 }
4878 gggr.Type = &typeVar
4879 }
4880 case "location":
4881 if v != nil {
4882 var location string
4883 err = json.Unmarshal(*v, &location)
4884 if err != nil {
4885 return err
4886 }
4887 gggr.Location = &location
4888 }
4889 case "tags":
4890 if v != nil {
4891 var tags map[string]*string
4892 err = json.Unmarshal(*v, &tags)
4893 if err != nil {
4894 return err
4895 }
4896 gggr.Tags = tags
4897 }
4898 case "identity":
4899 if v != nil {
4900 var identity ManagedServiceIdentity
4901 err = json.Unmarshal(*v, &identity)
4902 if err != nil {
4903 return err
4904 }
4905 gggr.Identity = &identity
4906 }
4907 }
4908 }
4909
4910 return nil
4911 }
4912
4913
4914 type GremlinGraphListResult struct {
4915 autorest.Response `json:"-"`
4916
4917 Value *[]GremlinGraphGetResults `json:"value,omitempty"`
4918 }
4919
4920
4921 func (gglr GremlinGraphListResult) MarshalJSON() ([]byte, error) {
4922 objectMap := make(map[string]interface{})
4923 return json.Marshal(objectMap)
4924 }
4925
4926
4927 type GremlinGraphResource struct {
4928
4929 ID *string `json:"id,omitempty"`
4930
4931 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
4932
4933 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
4934
4935 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
4936
4937 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
4938
4939 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
4940 }
4941
4942
4943
4944 type GremlinResourcesCreateUpdateGremlinDatabaseFuture struct {
4945 azure.FutureAPI
4946
4947
4948 Result func(GremlinResourcesClient) (GremlinDatabaseGetResults, error)
4949 }
4950
4951
4952 func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) UnmarshalJSON(body []byte) error {
4953 var azFuture azure.Future
4954 if err := json.Unmarshal(body, &azFuture); err != nil {
4955 return err
4956 }
4957 future.FutureAPI = &azFuture
4958 future.Result = future.result
4959 return nil
4960 }
4961
4962
4963 func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) result(client GremlinResourcesClient) (gdgr GremlinDatabaseGetResults, err error) {
4964 var done bool
4965 done, err = future.DoneWithContext(context.Background(), client)
4966 if err != nil {
4967 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", future.Response(), "Polling failure")
4968 return
4969 }
4970 if !done {
4971 gdgr.Response.Response = future.Response()
4972 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture")
4973 return
4974 }
4975 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4976 if gdgr.Response.Response, err = future.GetResult(sender); err == nil && gdgr.Response.Response.StatusCode != http.StatusNoContent {
4977 gdgr, err = client.CreateUpdateGremlinDatabaseResponder(gdgr.Response.Response)
4978 if err != nil {
4979 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", gdgr.Response.Response, "Failure responding to request")
4980 }
4981 }
4982 return
4983 }
4984
4985
4986
4987 type GremlinResourcesCreateUpdateGremlinGraphFuture struct {
4988 azure.FutureAPI
4989
4990
4991 Result func(GremlinResourcesClient) (GremlinGraphGetResults, error)
4992 }
4993
4994
4995 func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) UnmarshalJSON(body []byte) error {
4996 var azFuture azure.Future
4997 if err := json.Unmarshal(body, &azFuture); err != nil {
4998 return err
4999 }
5000 future.FutureAPI = &azFuture
5001 future.Result = future.result
5002 return nil
5003 }
5004
5005
5006 func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) result(client GremlinResourcesClient) (gggr GremlinGraphGetResults, err error) {
5007 var done bool
5008 done, err = future.DoneWithContext(context.Background(), client)
5009 if err != nil {
5010 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", future.Response(), "Polling failure")
5011 return
5012 }
5013 if !done {
5014 gggr.Response.Response = future.Response()
5015 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture")
5016 return
5017 }
5018 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5019 if gggr.Response.Response, err = future.GetResult(sender); err == nil && gggr.Response.Response.StatusCode != http.StatusNoContent {
5020 gggr, err = client.CreateUpdateGremlinGraphResponder(gggr.Response.Response)
5021 if err != nil {
5022 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", gggr.Response.Response, "Failure responding to request")
5023 }
5024 }
5025 return
5026 }
5027
5028
5029
5030 type GremlinResourcesDeleteGremlinDatabaseFuture struct {
5031 azure.FutureAPI
5032
5033
5034 Result func(GremlinResourcesClient) (autorest.Response, error)
5035 }
5036
5037
5038 func (future *GremlinResourcesDeleteGremlinDatabaseFuture) UnmarshalJSON(body []byte) error {
5039 var azFuture azure.Future
5040 if err := json.Unmarshal(body, &azFuture); err != nil {
5041 return err
5042 }
5043 future.FutureAPI = &azFuture
5044 future.Result = future.result
5045 return nil
5046 }
5047
5048
5049 func (future *GremlinResourcesDeleteGremlinDatabaseFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) {
5050 var done bool
5051 done, err = future.DoneWithContext(context.Background(), client)
5052 if err != nil {
5053 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinDatabaseFuture", "Result", future.Response(), "Polling failure")
5054 return
5055 }
5056 if !done {
5057 ar.Response = future.Response()
5058 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinDatabaseFuture")
5059 return
5060 }
5061 ar.Response = future.Response()
5062 return
5063 }
5064
5065
5066
5067 type GremlinResourcesDeleteGremlinGraphFuture struct {
5068 azure.FutureAPI
5069
5070
5071 Result func(GremlinResourcesClient) (autorest.Response, error)
5072 }
5073
5074
5075 func (future *GremlinResourcesDeleteGremlinGraphFuture) UnmarshalJSON(body []byte) error {
5076 var azFuture azure.Future
5077 if err := json.Unmarshal(body, &azFuture); err != nil {
5078 return err
5079 }
5080 future.FutureAPI = &azFuture
5081 future.Result = future.result
5082 return nil
5083 }
5084
5085
5086 func (future *GremlinResourcesDeleteGremlinGraphFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) {
5087 var done bool
5088 done, err = future.DoneWithContext(context.Background(), client)
5089 if err != nil {
5090 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinGraphFuture", "Result", future.Response(), "Polling failure")
5091 return
5092 }
5093 if !done {
5094 ar.Response = future.Response()
5095 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinGraphFuture")
5096 return
5097 }
5098 ar.Response = future.Response()
5099 return
5100 }
5101
5102
5103
5104 type GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture struct {
5105 azure.FutureAPI
5106
5107
5108 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
5109 }
5110
5111
5112 func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error {
5113 var azFuture azure.Future
5114 if err := json.Unmarshal(body, &azFuture); err != nil {
5115 return err
5116 }
5117 future.FutureAPI = &azFuture
5118 future.Result = future.result
5119 return nil
5120 }
5121
5122
5123 func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
5124 var done bool
5125 done, err = future.DoneWithContext(context.Background(), client)
5126 if err != nil {
5127 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure")
5128 return
5129 }
5130 if !done {
5131 tsgr.Response.Response = future.Response()
5132 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture")
5133 return
5134 }
5135 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5136 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
5137 tsgr, err = client.MigrateGremlinDatabaseToAutoscaleResponder(tsgr.Response.Response)
5138 if err != nil {
5139 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
5140 }
5141 }
5142 return
5143 }
5144
5145
5146
5147 type GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture struct {
5148 azure.FutureAPI
5149
5150
5151 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
5152 }
5153
5154
5155 func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error {
5156 var azFuture azure.Future
5157 if err := json.Unmarshal(body, &azFuture); err != nil {
5158 return err
5159 }
5160 future.FutureAPI = &azFuture
5161 future.Result = future.result
5162 return nil
5163 }
5164
5165
5166 func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
5167 var done bool
5168 done, err = future.DoneWithContext(context.Background(), client)
5169 if err != nil {
5170 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure")
5171 return
5172 }
5173 if !done {
5174 tsgr.Response.Response = future.Response()
5175 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture")
5176 return
5177 }
5178 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5179 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
5180 tsgr, err = client.MigrateGremlinDatabaseToManualThroughputResponder(tsgr.Response.Response)
5181 if err != nil {
5182 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
5183 }
5184 }
5185 return
5186 }
5187
5188
5189
5190 type GremlinResourcesMigrateGremlinGraphToAutoscaleFuture struct {
5191 azure.FutureAPI
5192
5193
5194 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
5195 }
5196
5197
5198 func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) UnmarshalJSON(body []byte) error {
5199 var azFuture azure.Future
5200 if err := json.Unmarshal(body, &azFuture); err != nil {
5201 return err
5202 }
5203 future.FutureAPI = &azFuture
5204 future.Result = future.result
5205 return nil
5206 }
5207
5208
5209 func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
5210 var done bool
5211 done, err = future.DoneWithContext(context.Background(), client)
5212 if err != nil {
5213 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", future.Response(), "Polling failure")
5214 return
5215 }
5216 if !done {
5217 tsgr.Response.Response = future.Response()
5218 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture")
5219 return
5220 }
5221 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5222 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
5223 tsgr, err = client.MigrateGremlinGraphToAutoscaleResponder(tsgr.Response.Response)
5224 if err != nil {
5225 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
5226 }
5227 }
5228 return
5229 }
5230
5231
5232
5233 type GremlinResourcesMigrateGremlinGraphToManualThroughputFuture struct {
5234 azure.FutureAPI
5235
5236
5237 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
5238 }
5239
5240
5241 func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) UnmarshalJSON(body []byte) error {
5242 var azFuture azure.Future
5243 if err := json.Unmarshal(body, &azFuture); err != nil {
5244 return err
5245 }
5246 future.FutureAPI = &azFuture
5247 future.Result = future.result
5248 return nil
5249 }
5250
5251
5252 func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
5253 var done bool
5254 done, err = future.DoneWithContext(context.Background(), client)
5255 if err != nil {
5256 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", future.Response(), "Polling failure")
5257 return
5258 }
5259 if !done {
5260 tsgr.Response.Response = future.Response()
5261 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture")
5262 return
5263 }
5264 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5265 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
5266 tsgr, err = client.MigrateGremlinGraphToManualThroughputResponder(tsgr.Response.Response)
5267 if err != nil {
5268 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
5269 }
5270 }
5271 return
5272 }
5273
5274
5275
5276 type GremlinResourcesUpdateGremlinDatabaseThroughputFuture struct {
5277 azure.FutureAPI
5278
5279
5280 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
5281 }
5282
5283
5284 func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) UnmarshalJSON(body []byte) error {
5285 var azFuture azure.Future
5286 if err := json.Unmarshal(body, &azFuture); err != nil {
5287 return err
5288 }
5289 future.FutureAPI = &azFuture
5290 future.Result = future.result
5291 return nil
5292 }
5293
5294
5295 func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
5296 var done bool
5297 done, err = future.DoneWithContext(context.Background(), client)
5298 if err != nil {
5299 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", future.Response(), "Polling failure")
5300 return
5301 }
5302 if !done {
5303 tsgr.Response.Response = future.Response()
5304 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture")
5305 return
5306 }
5307 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5308 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
5309 tsgr, err = client.UpdateGremlinDatabaseThroughputResponder(tsgr.Response.Response)
5310 if err != nil {
5311 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
5312 }
5313 }
5314 return
5315 }
5316
5317
5318
5319 type GremlinResourcesUpdateGremlinGraphThroughputFuture struct {
5320 azure.FutureAPI
5321
5322
5323 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
5324 }
5325
5326
5327 func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) UnmarshalJSON(body []byte) error {
5328 var azFuture azure.Future
5329 if err := json.Unmarshal(body, &azFuture); err != nil {
5330 return err
5331 }
5332 future.FutureAPI = &azFuture
5333 future.Result = future.result
5334 return nil
5335 }
5336
5337
5338 func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
5339 var done bool
5340 done, err = future.DoneWithContext(context.Background(), client)
5341 if err != nil {
5342 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", future.Response(), "Polling failure")
5343 return
5344 }
5345 if !done {
5346 tsgr.Response.Response = future.Response()
5347 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture")
5348 return
5349 }
5350 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5351 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
5352 tsgr, err = client.UpdateGremlinGraphThroughputResponder(tsgr.Response.Response)
5353 if err != nil {
5354 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
5355 }
5356 }
5357 return
5358 }
5359
5360
5361 type IncludedPath struct {
5362
5363 Path *string `json:"path,omitempty"`
5364
5365 Indexes *[]Indexes `json:"indexes,omitempty"`
5366 }
5367
5368
5369 type Indexes struct {
5370
5371 DataType DataType `json:"dataType,omitempty"`
5372
5373 Precision *int32 `json:"precision,omitempty"`
5374
5375 Kind IndexKind `json:"kind,omitempty"`
5376 }
5377
5378
5379 type IndexingPolicy struct {
5380
5381 Automatic *bool `json:"automatic,omitempty"`
5382
5383 IndexingMode IndexingMode `json:"indexingMode,omitempty"`
5384
5385 IncludedPaths *[]IncludedPath `json:"includedPaths,omitempty"`
5386
5387 ExcludedPaths *[]ExcludedPath `json:"excludedPaths,omitempty"`
5388
5389 CompositeIndexes *[][]CompositePath `json:"compositeIndexes,omitempty"`
5390
5391 SpatialIndexes *[]SpatialSpec `json:"spatialIndexes,omitempty"`
5392 }
5393
5394
5395 type IPAddressOrRange struct {
5396
5397 IPAddressOrRange *string `json:"ipAddressOrRange,omitempty"`
5398 }
5399
5400
5401 type ListBackups struct {
5402 autorest.Response `json:"-"`
5403
5404 Value *[]BackupResource `json:"value,omitempty"`
5405 }
5406
5407
5408 func (lb ListBackups) MarshalJSON() ([]byte, error) {
5409 objectMap := make(map[string]interface{})
5410 return json.Marshal(objectMap)
5411 }
5412
5413
5414 type ListClusters struct {
5415 autorest.Response `json:"-"`
5416
5417 Value *[]ClusterResource `json:"value,omitempty"`
5418 }
5419
5420
5421 type ListDataCenters struct {
5422 autorest.Response `json:"-"`
5423
5424 Value *[]DataCenterResource `json:"value,omitempty"`
5425 }
5426
5427
5428 func (ldc ListDataCenters) MarshalJSON() ([]byte, error) {
5429 objectMap := make(map[string]interface{})
5430 return json.Marshal(objectMap)
5431 }
5432
5433
5434 type Location struct {
5435
5436 ID *string `json:"id,omitempty"`
5437
5438 LocationName *string `json:"locationName,omitempty"`
5439
5440 DocumentEndpoint *string `json:"documentEndpoint,omitempty"`
5441 ProvisioningState *string `json:"provisioningState,omitempty"`
5442
5443 FailoverPriority *int32 `json:"failoverPriority,omitempty"`
5444
5445 IsZoneRedundant *bool `json:"isZoneRedundant,omitempty"`
5446 }
5447
5448
5449 func (l Location) MarshalJSON() ([]byte, error) {
5450 objectMap := make(map[string]interface{})
5451 if l.LocationName != nil {
5452 objectMap["locationName"] = l.LocationName
5453 }
5454 if l.ProvisioningState != nil {
5455 objectMap["provisioningState"] = l.ProvisioningState
5456 }
5457 if l.FailoverPriority != nil {
5458 objectMap["failoverPriority"] = l.FailoverPriority
5459 }
5460 if l.IsZoneRedundant != nil {
5461 objectMap["isZoneRedundant"] = l.IsZoneRedundant
5462 }
5463 return json.Marshal(objectMap)
5464 }
5465
5466
5467 type LocationGetResult struct {
5468 autorest.Response `json:"-"`
5469
5470 Properties *LocationProperties `json:"properties,omitempty"`
5471
5472 ID *string `json:"id,omitempty"`
5473
5474 Name *string `json:"name,omitempty"`
5475
5476 Type *string `json:"type,omitempty"`
5477 }
5478
5479
5480 func (lgr LocationGetResult) MarshalJSON() ([]byte, error) {
5481 objectMap := make(map[string]interface{})
5482 if lgr.Properties != nil {
5483 objectMap["properties"] = lgr.Properties
5484 }
5485 return json.Marshal(objectMap)
5486 }
5487
5488
5489 type LocationListResult struct {
5490 autorest.Response `json:"-"`
5491
5492 Value *[]LocationGetResult `json:"value,omitempty"`
5493 }
5494
5495
5496 func (llr LocationListResult) MarshalJSON() ([]byte, error) {
5497 objectMap := make(map[string]interface{})
5498 return json.Marshal(objectMap)
5499 }
5500
5501
5502 type LocationProperties struct {
5503
5504 Status *string `json:"status,omitempty"`
5505
5506 SupportsAvailabilityZone *bool `json:"supportsAvailabilityZone,omitempty"`
5507
5508 IsResidencyRestricted *bool `json:"isResidencyRestricted,omitempty"`
5509
5510 BackupStorageRedundancies *[]BackupStorageRedundancy `json:"backupStorageRedundancies,omitempty"`
5511 }
5512
5513
5514 func (lp LocationProperties) MarshalJSON() ([]byte, error) {
5515 objectMap := make(map[string]interface{})
5516 return json.Marshal(objectMap)
5517 }
5518
5519
5520 type ManagedServiceIdentity struct {
5521
5522 PrincipalID *string `json:"principalId,omitempty"`
5523
5524 TenantID *string `json:"tenantId,omitempty"`
5525
5526 Type ResourceIdentityType `json:"type,omitempty"`
5527
5528 UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"`
5529 }
5530
5531
5532 func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) {
5533 objectMap := make(map[string]interface{})
5534 if msi.Type != "" {
5535 objectMap["type"] = msi.Type
5536 }
5537 if msi.UserAssignedIdentities != nil {
5538 objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities
5539 }
5540 return json.Marshal(objectMap)
5541 }
5542
5543
5544 type ManagedServiceIdentityUserAssignedIdentitiesValue struct {
5545
5546 PrincipalID *string `json:"principalId,omitempty"`
5547
5548 ClientID *string `json:"clientId,omitempty"`
5549 }
5550
5551
5552 func (msiAiv ManagedServiceIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) {
5553 objectMap := make(map[string]interface{})
5554 return json.Marshal(objectMap)
5555 }
5556
5557
5558 type Metric struct {
5559
5560 StartTime *date.Time `json:"startTime,omitempty"`
5561
5562 EndTime *date.Time `json:"endTime,omitempty"`
5563
5564 TimeGrain *string `json:"timeGrain,omitempty"`
5565
5566 Unit UnitType `json:"unit,omitempty"`
5567
5568 Name *MetricName `json:"name,omitempty"`
5569
5570 MetricValues *[]MetricValue `json:"metricValues,omitempty"`
5571 }
5572
5573
5574 func (mVar Metric) MarshalJSON() ([]byte, error) {
5575 objectMap := make(map[string]interface{})
5576 if mVar.Unit != "" {
5577 objectMap["unit"] = mVar.Unit
5578 }
5579 return json.Marshal(objectMap)
5580 }
5581
5582
5583 type MetricAvailability struct {
5584
5585 TimeGrain *string `json:"timeGrain,omitempty"`
5586
5587 Retention *string `json:"retention,omitempty"`
5588 }
5589
5590
5591 func (ma MetricAvailability) MarshalJSON() ([]byte, error) {
5592 objectMap := make(map[string]interface{})
5593 return json.Marshal(objectMap)
5594 }
5595
5596
5597 type MetricDefinition struct {
5598
5599 MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
5600
5601 PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"`
5602
5603 Unit UnitType `json:"unit,omitempty"`
5604
5605 ResourceURI *string `json:"resourceUri,omitempty"`
5606
5607 Name *MetricName `json:"name,omitempty"`
5608 }
5609
5610
5611 func (md MetricDefinition) MarshalJSON() ([]byte, error) {
5612 objectMap := make(map[string]interface{})
5613 if md.Unit != "" {
5614 objectMap["unit"] = md.Unit
5615 }
5616 return json.Marshal(objectMap)
5617 }
5618
5619
5620 type MetricDefinitionsListResult struct {
5621 autorest.Response `json:"-"`
5622
5623 Value *[]MetricDefinition `json:"value,omitempty"`
5624 }
5625
5626
5627 func (mdlr MetricDefinitionsListResult) MarshalJSON() ([]byte, error) {
5628 objectMap := make(map[string]interface{})
5629 return json.Marshal(objectMap)
5630 }
5631
5632
5633 type MetricListResult struct {
5634 autorest.Response `json:"-"`
5635
5636 Value *[]Metric `json:"value,omitempty"`
5637 }
5638
5639
5640 func (mlr MetricListResult) MarshalJSON() ([]byte, error) {
5641 objectMap := make(map[string]interface{})
5642 return json.Marshal(objectMap)
5643 }
5644
5645
5646 type MetricName struct {
5647
5648 Value *string `json:"value,omitempty"`
5649
5650 LocalizedValue *string `json:"localizedValue,omitempty"`
5651 }
5652
5653
5654 func (mn MetricName) MarshalJSON() ([]byte, error) {
5655 objectMap := make(map[string]interface{})
5656 return json.Marshal(objectMap)
5657 }
5658
5659
5660 type MetricValue struct {
5661
5662 Count *float64 `json:"_count,omitempty"`
5663
5664 Average *float64 `json:"average,omitempty"`
5665
5666 Maximum *float64 `json:"maximum,omitempty"`
5667
5668 Minimum *float64 `json:"minimum,omitempty"`
5669
5670 Timestamp *date.Time `json:"timestamp,omitempty"`
5671
5672 Total *float64 `json:"total,omitempty"`
5673 }
5674
5675
5676 func (mv MetricValue) MarshalJSON() ([]byte, error) {
5677 objectMap := make(map[string]interface{})
5678 return json.Marshal(objectMap)
5679 }
5680
5681
5682 type MongoDBCollectionCreateUpdateParameters struct {
5683
5684 *MongoDBCollectionCreateUpdateProperties `json:"properties,omitempty"`
5685
5686 ID *string `json:"id,omitempty"`
5687
5688 Name *string `json:"name,omitempty"`
5689
5690 Type *string `json:"type,omitempty"`
5691
5692 Location *string `json:"location,omitempty"`
5693 Tags map[string]*string `json:"tags"`
5694 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
5695 }
5696
5697
5698 func (mdccup MongoDBCollectionCreateUpdateParameters) MarshalJSON() ([]byte, error) {
5699 objectMap := make(map[string]interface{})
5700 if mdccup.MongoDBCollectionCreateUpdateProperties != nil {
5701 objectMap["properties"] = mdccup.MongoDBCollectionCreateUpdateProperties
5702 }
5703 if mdccup.Location != nil {
5704 objectMap["location"] = mdccup.Location
5705 }
5706 if mdccup.Tags != nil {
5707 objectMap["tags"] = mdccup.Tags
5708 }
5709 if mdccup.Identity != nil {
5710 objectMap["identity"] = mdccup.Identity
5711 }
5712 return json.Marshal(objectMap)
5713 }
5714
5715
5716 func (mdccup *MongoDBCollectionCreateUpdateParameters) UnmarshalJSON(body []byte) error {
5717 var m map[string]*json.RawMessage
5718 err := json.Unmarshal(body, &m)
5719 if err != nil {
5720 return err
5721 }
5722 for k, v := range m {
5723 switch k {
5724 case "properties":
5725 if v != nil {
5726 var mongoDBCollectionCreateUpdateProperties MongoDBCollectionCreateUpdateProperties
5727 err = json.Unmarshal(*v, &mongoDBCollectionCreateUpdateProperties)
5728 if err != nil {
5729 return err
5730 }
5731 mdccup.MongoDBCollectionCreateUpdateProperties = &mongoDBCollectionCreateUpdateProperties
5732 }
5733 case "id":
5734 if v != nil {
5735 var ID string
5736 err = json.Unmarshal(*v, &ID)
5737 if err != nil {
5738 return err
5739 }
5740 mdccup.ID = &ID
5741 }
5742 case "name":
5743 if v != nil {
5744 var name string
5745 err = json.Unmarshal(*v, &name)
5746 if err != nil {
5747 return err
5748 }
5749 mdccup.Name = &name
5750 }
5751 case "type":
5752 if v != nil {
5753 var typeVar string
5754 err = json.Unmarshal(*v, &typeVar)
5755 if err != nil {
5756 return err
5757 }
5758 mdccup.Type = &typeVar
5759 }
5760 case "location":
5761 if v != nil {
5762 var location string
5763 err = json.Unmarshal(*v, &location)
5764 if err != nil {
5765 return err
5766 }
5767 mdccup.Location = &location
5768 }
5769 case "tags":
5770 if v != nil {
5771 var tags map[string]*string
5772 err = json.Unmarshal(*v, &tags)
5773 if err != nil {
5774 return err
5775 }
5776 mdccup.Tags = tags
5777 }
5778 case "identity":
5779 if v != nil {
5780 var identity ManagedServiceIdentity
5781 err = json.Unmarshal(*v, &identity)
5782 if err != nil {
5783 return err
5784 }
5785 mdccup.Identity = &identity
5786 }
5787 }
5788 }
5789
5790 return nil
5791 }
5792
5793
5794
5795 type MongoDBCollectionCreateUpdateProperties struct {
5796
5797 Resource *MongoDBCollectionResource `json:"resource,omitempty"`
5798
5799 Options *CreateUpdateOptions `json:"options,omitempty"`
5800 }
5801
5802
5803 type MongoDBCollectionGetProperties struct {
5804 Resource *MongoDBCollectionGetPropertiesResource `json:"resource,omitempty"`
5805 Options *MongoDBCollectionGetPropertiesOptions `json:"options,omitempty"`
5806 }
5807
5808
5809 type MongoDBCollectionGetPropertiesOptions struct {
5810
5811 Throughput *int32 `json:"throughput,omitempty"`
5812
5813 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
5814 }
5815
5816
5817 type MongoDBCollectionGetPropertiesResource struct {
5818
5819 ID *string `json:"id,omitempty"`
5820
5821 ShardKey map[string]*string `json:"shardKey"`
5822
5823 Indexes *[]MongoIndex `json:"indexes,omitempty"`
5824
5825 AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"`
5826
5827 Rid *string `json:"_rid,omitempty"`
5828
5829 Ts *float64 `json:"_ts,omitempty"`
5830
5831 Etag *string `json:"_etag,omitempty"`
5832 }
5833
5834
5835 func (mdcgp MongoDBCollectionGetPropertiesResource) MarshalJSON() ([]byte, error) {
5836 objectMap := make(map[string]interface{})
5837 if mdcgp.ID != nil {
5838 objectMap["id"] = mdcgp.ID
5839 }
5840 if mdcgp.ShardKey != nil {
5841 objectMap["shardKey"] = mdcgp.ShardKey
5842 }
5843 if mdcgp.Indexes != nil {
5844 objectMap["indexes"] = mdcgp.Indexes
5845 }
5846 if mdcgp.AnalyticalStorageTTL != nil {
5847 objectMap["analyticalStorageTtl"] = mdcgp.AnalyticalStorageTTL
5848 }
5849 return json.Marshal(objectMap)
5850 }
5851
5852
5853 type MongoDBCollectionGetResults struct {
5854 autorest.Response `json:"-"`
5855
5856 *MongoDBCollectionGetProperties `json:"properties,omitempty"`
5857
5858 ID *string `json:"id,omitempty"`
5859
5860 Name *string `json:"name,omitempty"`
5861
5862 Type *string `json:"type,omitempty"`
5863
5864 Location *string `json:"location,omitempty"`
5865 Tags map[string]*string `json:"tags"`
5866 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
5867 }
5868
5869
5870 func (mdcgr MongoDBCollectionGetResults) MarshalJSON() ([]byte, error) {
5871 objectMap := make(map[string]interface{})
5872 if mdcgr.MongoDBCollectionGetProperties != nil {
5873 objectMap["properties"] = mdcgr.MongoDBCollectionGetProperties
5874 }
5875 if mdcgr.Location != nil {
5876 objectMap["location"] = mdcgr.Location
5877 }
5878 if mdcgr.Tags != nil {
5879 objectMap["tags"] = mdcgr.Tags
5880 }
5881 if mdcgr.Identity != nil {
5882 objectMap["identity"] = mdcgr.Identity
5883 }
5884 return json.Marshal(objectMap)
5885 }
5886
5887
5888 func (mdcgr *MongoDBCollectionGetResults) UnmarshalJSON(body []byte) error {
5889 var m map[string]*json.RawMessage
5890 err := json.Unmarshal(body, &m)
5891 if err != nil {
5892 return err
5893 }
5894 for k, v := range m {
5895 switch k {
5896 case "properties":
5897 if v != nil {
5898 var mongoDBCollectionGetProperties MongoDBCollectionGetProperties
5899 err = json.Unmarshal(*v, &mongoDBCollectionGetProperties)
5900 if err != nil {
5901 return err
5902 }
5903 mdcgr.MongoDBCollectionGetProperties = &mongoDBCollectionGetProperties
5904 }
5905 case "id":
5906 if v != nil {
5907 var ID string
5908 err = json.Unmarshal(*v, &ID)
5909 if err != nil {
5910 return err
5911 }
5912 mdcgr.ID = &ID
5913 }
5914 case "name":
5915 if v != nil {
5916 var name string
5917 err = json.Unmarshal(*v, &name)
5918 if err != nil {
5919 return err
5920 }
5921 mdcgr.Name = &name
5922 }
5923 case "type":
5924 if v != nil {
5925 var typeVar string
5926 err = json.Unmarshal(*v, &typeVar)
5927 if err != nil {
5928 return err
5929 }
5930 mdcgr.Type = &typeVar
5931 }
5932 case "location":
5933 if v != nil {
5934 var location string
5935 err = json.Unmarshal(*v, &location)
5936 if err != nil {
5937 return err
5938 }
5939 mdcgr.Location = &location
5940 }
5941 case "tags":
5942 if v != nil {
5943 var tags map[string]*string
5944 err = json.Unmarshal(*v, &tags)
5945 if err != nil {
5946 return err
5947 }
5948 mdcgr.Tags = tags
5949 }
5950 case "identity":
5951 if v != nil {
5952 var identity ManagedServiceIdentity
5953 err = json.Unmarshal(*v, &identity)
5954 if err != nil {
5955 return err
5956 }
5957 mdcgr.Identity = &identity
5958 }
5959 }
5960 }
5961
5962 return nil
5963 }
5964
5965
5966
5967 type MongoDBCollectionListResult struct {
5968 autorest.Response `json:"-"`
5969
5970 Value *[]MongoDBCollectionGetResults `json:"value,omitempty"`
5971 }
5972
5973
5974 func (mdclr MongoDBCollectionListResult) MarshalJSON() ([]byte, error) {
5975 objectMap := make(map[string]interface{})
5976 return json.Marshal(objectMap)
5977 }
5978
5979
5980 type MongoDBCollectionResource struct {
5981
5982 ID *string `json:"id,omitempty"`
5983
5984 ShardKey map[string]*string `json:"shardKey"`
5985
5986 Indexes *[]MongoIndex `json:"indexes,omitempty"`
5987
5988 AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"`
5989 }
5990
5991
5992 func (mdcr MongoDBCollectionResource) MarshalJSON() ([]byte, error) {
5993 objectMap := make(map[string]interface{})
5994 if mdcr.ID != nil {
5995 objectMap["id"] = mdcr.ID
5996 }
5997 if mdcr.ShardKey != nil {
5998 objectMap["shardKey"] = mdcr.ShardKey
5999 }
6000 if mdcr.Indexes != nil {
6001 objectMap["indexes"] = mdcr.Indexes
6002 }
6003 if mdcr.AnalyticalStorageTTL != nil {
6004 objectMap["analyticalStorageTtl"] = mdcr.AnalyticalStorageTTL
6005 }
6006 return json.Marshal(objectMap)
6007 }
6008
6009
6010 type MongoDBDatabaseCreateUpdateParameters struct {
6011
6012 *MongoDBDatabaseCreateUpdateProperties `json:"properties,omitempty"`
6013
6014 ID *string `json:"id,omitempty"`
6015
6016 Name *string `json:"name,omitempty"`
6017
6018 Type *string `json:"type,omitempty"`
6019
6020 Location *string `json:"location,omitempty"`
6021 Tags map[string]*string `json:"tags"`
6022 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
6023 }
6024
6025
6026 func (mddcup MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) {
6027 objectMap := make(map[string]interface{})
6028 if mddcup.MongoDBDatabaseCreateUpdateProperties != nil {
6029 objectMap["properties"] = mddcup.MongoDBDatabaseCreateUpdateProperties
6030 }
6031 if mddcup.Location != nil {
6032 objectMap["location"] = mddcup.Location
6033 }
6034 if mddcup.Tags != nil {
6035 objectMap["tags"] = mddcup.Tags
6036 }
6037 if mddcup.Identity != nil {
6038 objectMap["identity"] = mddcup.Identity
6039 }
6040 return json.Marshal(objectMap)
6041 }
6042
6043
6044 func (mddcup *MongoDBDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error {
6045 var m map[string]*json.RawMessage
6046 err := json.Unmarshal(body, &m)
6047 if err != nil {
6048 return err
6049 }
6050 for k, v := range m {
6051 switch k {
6052 case "properties":
6053 if v != nil {
6054 var mongoDBDatabaseCreateUpdateProperties MongoDBDatabaseCreateUpdateProperties
6055 err = json.Unmarshal(*v, &mongoDBDatabaseCreateUpdateProperties)
6056 if err != nil {
6057 return err
6058 }
6059 mddcup.MongoDBDatabaseCreateUpdateProperties = &mongoDBDatabaseCreateUpdateProperties
6060 }
6061 case "id":
6062 if v != nil {
6063 var ID string
6064 err = json.Unmarshal(*v, &ID)
6065 if err != nil {
6066 return err
6067 }
6068 mddcup.ID = &ID
6069 }
6070 case "name":
6071 if v != nil {
6072 var name string
6073 err = json.Unmarshal(*v, &name)
6074 if err != nil {
6075 return err
6076 }
6077 mddcup.Name = &name
6078 }
6079 case "type":
6080 if v != nil {
6081 var typeVar string
6082 err = json.Unmarshal(*v, &typeVar)
6083 if err != nil {
6084 return err
6085 }
6086 mddcup.Type = &typeVar
6087 }
6088 case "location":
6089 if v != nil {
6090 var location string
6091 err = json.Unmarshal(*v, &location)
6092 if err != nil {
6093 return err
6094 }
6095 mddcup.Location = &location
6096 }
6097 case "tags":
6098 if v != nil {
6099 var tags map[string]*string
6100 err = json.Unmarshal(*v, &tags)
6101 if err != nil {
6102 return err
6103 }
6104 mddcup.Tags = tags
6105 }
6106 case "identity":
6107 if v != nil {
6108 var identity ManagedServiceIdentity
6109 err = json.Unmarshal(*v, &identity)
6110 if err != nil {
6111 return err
6112 }
6113 mddcup.Identity = &identity
6114 }
6115 }
6116 }
6117
6118 return nil
6119 }
6120
6121
6122 type MongoDBDatabaseCreateUpdateProperties struct {
6123
6124 Resource *MongoDBDatabaseResource `json:"resource,omitempty"`
6125
6126 Options *CreateUpdateOptions `json:"options,omitempty"`
6127 }
6128
6129
6130 type MongoDBDatabaseGetProperties struct {
6131 Resource *MongoDBDatabaseGetPropertiesResource `json:"resource,omitempty"`
6132 Options *MongoDBDatabaseGetPropertiesOptions `json:"options,omitempty"`
6133 }
6134
6135
6136 type MongoDBDatabaseGetPropertiesOptions struct {
6137
6138 Throughput *int32 `json:"throughput,omitempty"`
6139
6140 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
6141 }
6142
6143
6144 type MongoDBDatabaseGetPropertiesResource struct {
6145
6146 ID *string `json:"id,omitempty"`
6147
6148 Rid *string `json:"_rid,omitempty"`
6149
6150 Ts *float64 `json:"_ts,omitempty"`
6151
6152 Etag *string `json:"_etag,omitempty"`
6153 }
6154
6155
6156 func (mddgp MongoDBDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) {
6157 objectMap := make(map[string]interface{})
6158 if mddgp.ID != nil {
6159 objectMap["id"] = mddgp.ID
6160 }
6161 return json.Marshal(objectMap)
6162 }
6163
6164
6165 type MongoDBDatabaseGetResults struct {
6166 autorest.Response `json:"-"`
6167
6168 *MongoDBDatabaseGetProperties `json:"properties,omitempty"`
6169
6170 ID *string `json:"id,omitempty"`
6171
6172 Name *string `json:"name,omitempty"`
6173
6174 Type *string `json:"type,omitempty"`
6175
6176 Location *string `json:"location,omitempty"`
6177 Tags map[string]*string `json:"tags"`
6178 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
6179 }
6180
6181
6182 func (mddgr MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) {
6183 objectMap := make(map[string]interface{})
6184 if mddgr.MongoDBDatabaseGetProperties != nil {
6185 objectMap["properties"] = mddgr.MongoDBDatabaseGetProperties
6186 }
6187 if mddgr.Location != nil {
6188 objectMap["location"] = mddgr.Location
6189 }
6190 if mddgr.Tags != nil {
6191 objectMap["tags"] = mddgr.Tags
6192 }
6193 if mddgr.Identity != nil {
6194 objectMap["identity"] = mddgr.Identity
6195 }
6196 return json.Marshal(objectMap)
6197 }
6198
6199
6200 func (mddgr *MongoDBDatabaseGetResults) UnmarshalJSON(body []byte) error {
6201 var m map[string]*json.RawMessage
6202 err := json.Unmarshal(body, &m)
6203 if err != nil {
6204 return err
6205 }
6206 for k, v := range m {
6207 switch k {
6208 case "properties":
6209 if v != nil {
6210 var mongoDBDatabaseGetProperties MongoDBDatabaseGetProperties
6211 err = json.Unmarshal(*v, &mongoDBDatabaseGetProperties)
6212 if err != nil {
6213 return err
6214 }
6215 mddgr.MongoDBDatabaseGetProperties = &mongoDBDatabaseGetProperties
6216 }
6217 case "id":
6218 if v != nil {
6219 var ID string
6220 err = json.Unmarshal(*v, &ID)
6221 if err != nil {
6222 return err
6223 }
6224 mddgr.ID = &ID
6225 }
6226 case "name":
6227 if v != nil {
6228 var name string
6229 err = json.Unmarshal(*v, &name)
6230 if err != nil {
6231 return err
6232 }
6233 mddgr.Name = &name
6234 }
6235 case "type":
6236 if v != nil {
6237 var typeVar string
6238 err = json.Unmarshal(*v, &typeVar)
6239 if err != nil {
6240 return err
6241 }
6242 mddgr.Type = &typeVar
6243 }
6244 case "location":
6245 if v != nil {
6246 var location string
6247 err = json.Unmarshal(*v, &location)
6248 if err != nil {
6249 return err
6250 }
6251 mddgr.Location = &location
6252 }
6253 case "tags":
6254 if v != nil {
6255 var tags map[string]*string
6256 err = json.Unmarshal(*v, &tags)
6257 if err != nil {
6258 return err
6259 }
6260 mddgr.Tags = tags
6261 }
6262 case "identity":
6263 if v != nil {
6264 var identity ManagedServiceIdentity
6265 err = json.Unmarshal(*v, &identity)
6266 if err != nil {
6267 return err
6268 }
6269 mddgr.Identity = &identity
6270 }
6271 }
6272 }
6273
6274 return nil
6275 }
6276
6277
6278
6279 type MongoDBDatabaseListResult struct {
6280 autorest.Response `json:"-"`
6281
6282 Value *[]MongoDBDatabaseGetResults `json:"value,omitempty"`
6283 }
6284
6285
6286 func (mddlr MongoDBDatabaseListResult) MarshalJSON() ([]byte, error) {
6287 objectMap := make(map[string]interface{})
6288 return json.Marshal(objectMap)
6289 }
6290
6291
6292 type MongoDBDatabaseResource struct {
6293
6294 ID *string `json:"id,omitempty"`
6295 }
6296
6297
6298
6299 type MongoDBResourcesCreateUpdateMongoDBCollectionFuture struct {
6300 azure.FutureAPI
6301
6302
6303 Result func(MongoDBResourcesClient) (MongoDBCollectionGetResults, error)
6304 }
6305
6306
6307 func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) UnmarshalJSON(body []byte) error {
6308 var azFuture azure.Future
6309 if err := json.Unmarshal(body, &azFuture); err != nil {
6310 return err
6311 }
6312 future.FutureAPI = &azFuture
6313 future.Result = future.result
6314 return nil
6315 }
6316
6317
6318 func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) result(client MongoDBResourcesClient) (mdcgr MongoDBCollectionGetResults, err error) {
6319 var done bool
6320 done, err = future.DoneWithContext(context.Background(), client)
6321 if err != nil {
6322 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", future.Response(), "Polling failure")
6323 return
6324 }
6325 if !done {
6326 mdcgr.Response.Response = future.Response()
6327 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture")
6328 return
6329 }
6330 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6331 if mdcgr.Response.Response, err = future.GetResult(sender); err == nil && mdcgr.Response.Response.StatusCode != http.StatusNoContent {
6332 mdcgr, err = client.CreateUpdateMongoDBCollectionResponder(mdcgr.Response.Response)
6333 if err != nil {
6334 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", mdcgr.Response.Response, "Failure responding to request")
6335 }
6336 }
6337 return
6338 }
6339
6340
6341
6342 type MongoDBResourcesCreateUpdateMongoDBDatabaseFuture struct {
6343 azure.FutureAPI
6344
6345
6346 Result func(MongoDBResourcesClient) (MongoDBDatabaseGetResults, error)
6347 }
6348
6349
6350 func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error {
6351 var azFuture azure.Future
6352 if err := json.Unmarshal(body, &azFuture); err != nil {
6353 return err
6354 }
6355 future.FutureAPI = &azFuture
6356 future.Result = future.result
6357 return nil
6358 }
6359
6360
6361 func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (mddgr MongoDBDatabaseGetResults, err error) {
6362 var done bool
6363 done, err = future.DoneWithContext(context.Background(), client)
6364 if err != nil {
6365 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure")
6366 return
6367 }
6368 if !done {
6369 mddgr.Response.Response = future.Response()
6370 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture")
6371 return
6372 }
6373 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6374 if mddgr.Response.Response, err = future.GetResult(sender); err == nil && mddgr.Response.Response.StatusCode != http.StatusNoContent {
6375 mddgr, err = client.CreateUpdateMongoDBDatabaseResponder(mddgr.Response.Response)
6376 if err != nil {
6377 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", mddgr.Response.Response, "Failure responding to request")
6378 }
6379 }
6380 return
6381 }
6382
6383
6384
6385 type MongoDBResourcesDeleteMongoDBCollectionFuture struct {
6386 azure.FutureAPI
6387
6388
6389 Result func(MongoDBResourcesClient) (autorest.Response, error)
6390 }
6391
6392
6393 func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) UnmarshalJSON(body []byte) error {
6394 var azFuture azure.Future
6395 if err := json.Unmarshal(body, &azFuture); err != nil {
6396 return err
6397 }
6398 future.FutureAPI = &azFuture
6399 future.Result = future.result
6400 return nil
6401 }
6402
6403
6404 func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) {
6405 var done bool
6406 done, err = future.DoneWithContext(context.Background(), client)
6407 if err != nil {
6408 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture", "Result", future.Response(), "Polling failure")
6409 return
6410 }
6411 if !done {
6412 ar.Response = future.Response()
6413 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture")
6414 return
6415 }
6416 ar.Response = future.Response()
6417 return
6418 }
6419
6420
6421
6422 type MongoDBResourcesDeleteMongoDBDatabaseFuture struct {
6423 azure.FutureAPI
6424
6425
6426 Result func(MongoDBResourcesClient) (autorest.Response, error)
6427 }
6428
6429
6430 func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error {
6431 var azFuture azure.Future
6432 if err := json.Unmarshal(body, &azFuture); err != nil {
6433 return err
6434 }
6435 future.FutureAPI = &azFuture
6436 future.Result = future.result
6437 return nil
6438 }
6439
6440
6441 func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) {
6442 var done bool
6443 done, err = future.DoneWithContext(context.Background(), client)
6444 if err != nil {
6445 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure")
6446 return
6447 }
6448 if !done {
6449 ar.Response = future.Response()
6450 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture")
6451 return
6452 }
6453 ar.Response = future.Response()
6454 return
6455 }
6456
6457
6458
6459 type MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture struct {
6460 azure.FutureAPI
6461
6462
6463 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
6464 }
6465
6466
6467 func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) UnmarshalJSON(body []byte) error {
6468 var azFuture azure.Future
6469 if err := json.Unmarshal(body, &azFuture); err != nil {
6470 return err
6471 }
6472 future.FutureAPI = &azFuture
6473 future.Result = future.result
6474 return nil
6475 }
6476
6477
6478 func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
6479 var done bool
6480 done, err = future.DoneWithContext(context.Background(), client)
6481 if err != nil {
6482 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", future.Response(), "Polling failure")
6483 return
6484 }
6485 if !done {
6486 tsgr.Response.Response = future.Response()
6487 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture")
6488 return
6489 }
6490 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6491 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6492 tsgr, err = client.MigrateMongoDBCollectionToAutoscaleResponder(tsgr.Response.Response)
6493 if err != nil {
6494 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6495 }
6496 }
6497 return
6498 }
6499
6500
6501
6502 type MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture struct {
6503 azure.FutureAPI
6504
6505
6506 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
6507 }
6508
6509
6510 func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) UnmarshalJSON(body []byte) error {
6511 var azFuture azure.Future
6512 if err := json.Unmarshal(body, &azFuture); err != nil {
6513 return err
6514 }
6515 future.FutureAPI = &azFuture
6516 future.Result = future.result
6517 return nil
6518 }
6519
6520
6521 func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
6522 var done bool
6523 done, err = future.DoneWithContext(context.Background(), client)
6524 if err != nil {
6525 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", future.Response(), "Polling failure")
6526 return
6527 }
6528 if !done {
6529 tsgr.Response.Response = future.Response()
6530 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture")
6531 return
6532 }
6533 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6534 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6535 tsgr, err = client.MigrateMongoDBCollectionToManualThroughputResponder(tsgr.Response.Response)
6536 if err != nil {
6537 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6538 }
6539 }
6540 return
6541 }
6542
6543
6544
6545 type MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture struct {
6546 azure.FutureAPI
6547
6548
6549 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
6550 }
6551
6552
6553 func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error {
6554 var azFuture azure.Future
6555 if err := json.Unmarshal(body, &azFuture); err != nil {
6556 return err
6557 }
6558 future.FutureAPI = &azFuture
6559 future.Result = future.result
6560 return nil
6561 }
6562
6563
6564 func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
6565 var done bool
6566 done, err = future.DoneWithContext(context.Background(), client)
6567 if err != nil {
6568 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure")
6569 return
6570 }
6571 if !done {
6572 tsgr.Response.Response = future.Response()
6573 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture")
6574 return
6575 }
6576 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6577 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6578 tsgr, err = client.MigrateMongoDBDatabaseToAutoscaleResponder(tsgr.Response.Response)
6579 if err != nil {
6580 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6581 }
6582 }
6583 return
6584 }
6585
6586
6587
6588 type MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture struct {
6589 azure.FutureAPI
6590
6591
6592 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
6593 }
6594
6595
6596 func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error {
6597 var azFuture azure.Future
6598 if err := json.Unmarshal(body, &azFuture); err != nil {
6599 return err
6600 }
6601 future.FutureAPI = &azFuture
6602 future.Result = future.result
6603 return nil
6604 }
6605
6606
6607 func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
6608 var done bool
6609 done, err = future.DoneWithContext(context.Background(), client)
6610 if err != nil {
6611 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure")
6612 return
6613 }
6614 if !done {
6615 tsgr.Response.Response = future.Response()
6616 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture")
6617 return
6618 }
6619 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6620 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6621 tsgr, err = client.MigrateMongoDBDatabaseToManualThroughputResponder(tsgr.Response.Response)
6622 if err != nil {
6623 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6624 }
6625 }
6626 return
6627 }
6628
6629
6630
6631 type MongoDBResourcesUpdateMongoDBCollectionThroughputFuture struct {
6632 azure.FutureAPI
6633
6634
6635 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
6636 }
6637
6638
6639 func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) UnmarshalJSON(body []byte) error {
6640 var azFuture azure.Future
6641 if err := json.Unmarshal(body, &azFuture); err != nil {
6642 return err
6643 }
6644 future.FutureAPI = &azFuture
6645 future.Result = future.result
6646 return nil
6647 }
6648
6649
6650 func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
6651 var done bool
6652 done, err = future.DoneWithContext(context.Background(), client)
6653 if err != nil {
6654 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", future.Response(), "Polling failure")
6655 return
6656 }
6657 if !done {
6658 tsgr.Response.Response = future.Response()
6659 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture")
6660 return
6661 }
6662 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6663 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6664 tsgr, err = client.UpdateMongoDBCollectionThroughputResponder(tsgr.Response.Response)
6665 if err != nil {
6666 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6667 }
6668 }
6669 return
6670 }
6671
6672
6673
6674 type MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture struct {
6675 azure.FutureAPI
6676
6677
6678 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
6679 }
6680
6681
6682 func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) UnmarshalJSON(body []byte) error {
6683 var azFuture azure.Future
6684 if err := json.Unmarshal(body, &azFuture); err != nil {
6685 return err
6686 }
6687 future.FutureAPI = &azFuture
6688 future.Result = future.result
6689 return nil
6690 }
6691
6692
6693 func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
6694 var done bool
6695 done, err = future.DoneWithContext(context.Background(), client)
6696 if err != nil {
6697 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", future.Response(), "Polling failure")
6698 return
6699 }
6700 if !done {
6701 tsgr.Response.Response = future.Response()
6702 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture")
6703 return
6704 }
6705 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6706 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6707 tsgr, err = client.UpdateMongoDBDatabaseThroughputResponder(tsgr.Response.Response)
6708 if err != nil {
6709 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6710 }
6711 }
6712 return
6713 }
6714
6715
6716 type MongoIndex struct {
6717
6718 Key *MongoIndexKeys `json:"key,omitempty"`
6719
6720 Options *MongoIndexOptions `json:"options,omitempty"`
6721 }
6722
6723
6724 type MongoIndexKeys struct {
6725
6726 Keys *[]string `json:"keys,omitempty"`
6727 }
6728
6729
6730 type MongoIndexOptions struct {
6731
6732 ExpireAfterSeconds *int32 `json:"expireAfterSeconds,omitempty"`
6733
6734 Unique *bool `json:"unique,omitempty"`
6735 }
6736
6737
6738 type NotebookWorkspace struct {
6739 autorest.Response `json:"-"`
6740
6741 *NotebookWorkspaceProperties `json:"properties,omitempty"`
6742
6743 ID *string `json:"id,omitempty"`
6744
6745 Name *string `json:"name,omitempty"`
6746
6747 Type *string `json:"type,omitempty"`
6748 }
6749
6750
6751 func (nw NotebookWorkspace) MarshalJSON() ([]byte, error) {
6752 objectMap := make(map[string]interface{})
6753 if nw.NotebookWorkspaceProperties != nil {
6754 objectMap["properties"] = nw.NotebookWorkspaceProperties
6755 }
6756 return json.Marshal(objectMap)
6757 }
6758
6759
6760 func (nw *NotebookWorkspace) UnmarshalJSON(body []byte) error {
6761 var m map[string]*json.RawMessage
6762 err := json.Unmarshal(body, &m)
6763 if err != nil {
6764 return err
6765 }
6766 for k, v := range m {
6767 switch k {
6768 case "properties":
6769 if v != nil {
6770 var notebookWorkspaceProperties NotebookWorkspaceProperties
6771 err = json.Unmarshal(*v, ¬ebookWorkspaceProperties)
6772 if err != nil {
6773 return err
6774 }
6775 nw.NotebookWorkspaceProperties = ¬ebookWorkspaceProperties
6776 }
6777 case "id":
6778 if v != nil {
6779 var ID string
6780 err = json.Unmarshal(*v, &ID)
6781 if err != nil {
6782 return err
6783 }
6784 nw.ID = &ID
6785 }
6786 case "name":
6787 if v != nil {
6788 var name string
6789 err = json.Unmarshal(*v, &name)
6790 if err != nil {
6791 return err
6792 }
6793 nw.Name = &name
6794 }
6795 case "type":
6796 if v != nil {
6797 var typeVar string
6798 err = json.Unmarshal(*v, &typeVar)
6799 if err != nil {
6800 return err
6801 }
6802 nw.Type = &typeVar
6803 }
6804 }
6805 }
6806
6807 return nil
6808 }
6809
6810
6811 type NotebookWorkspaceConnectionInfoResult struct {
6812 autorest.Response `json:"-"`
6813
6814 AuthToken *string `json:"authToken,omitempty"`
6815
6816 NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"`
6817 }
6818
6819
6820 func (nwcir NotebookWorkspaceConnectionInfoResult) MarshalJSON() ([]byte, error) {
6821 objectMap := make(map[string]interface{})
6822 return json.Marshal(objectMap)
6823 }
6824
6825
6826 type NotebookWorkspaceCreateUpdateParameters struct {
6827
6828 ID *string `json:"id,omitempty"`
6829
6830 Name *string `json:"name,omitempty"`
6831
6832 Type *string `json:"type,omitempty"`
6833 }
6834
6835
6836 func (nwcup NotebookWorkspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) {
6837 objectMap := make(map[string]interface{})
6838 return json.Marshal(objectMap)
6839 }
6840
6841
6842 type NotebookWorkspaceListResult struct {
6843 autorest.Response `json:"-"`
6844
6845 Value *[]NotebookWorkspace `json:"value,omitempty"`
6846 }
6847
6848
6849 type NotebookWorkspaceProperties struct {
6850
6851 NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"`
6852
6853 Status *string `json:"status,omitempty"`
6854 }
6855
6856
6857 func (nwp NotebookWorkspaceProperties) MarshalJSON() ([]byte, error) {
6858 objectMap := make(map[string]interface{})
6859 return json.Marshal(objectMap)
6860 }
6861
6862
6863
6864 type NotebookWorkspacesCreateOrUpdateFuture struct {
6865 azure.FutureAPI
6866
6867
6868 Result func(NotebookWorkspacesClient) (NotebookWorkspace, error)
6869 }
6870
6871
6872 func (future *NotebookWorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
6873 var azFuture azure.Future
6874 if err := json.Unmarshal(body, &azFuture); err != nil {
6875 return err
6876 }
6877 future.FutureAPI = &azFuture
6878 future.Result = future.result
6879 return nil
6880 }
6881
6882
6883 func (future *NotebookWorkspacesCreateOrUpdateFuture) result(client NotebookWorkspacesClient) (nw NotebookWorkspace, err error) {
6884 var done bool
6885 done, err = future.DoneWithContext(context.Background(), client)
6886 if err != nil {
6887 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
6888 return
6889 }
6890 if !done {
6891 nw.Response.Response = future.Response()
6892 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesCreateOrUpdateFuture")
6893 return
6894 }
6895 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6896 if nw.Response.Response, err = future.GetResult(sender); err == nil && nw.Response.Response.StatusCode != http.StatusNoContent {
6897 nw, err = client.CreateOrUpdateResponder(nw.Response.Response)
6898 if err != nil {
6899 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", nw.Response.Response, "Failure responding to request")
6900 }
6901 }
6902 return
6903 }
6904
6905
6906
6907 type NotebookWorkspacesDeleteFuture struct {
6908 azure.FutureAPI
6909
6910
6911 Result func(NotebookWorkspacesClient) (autorest.Response, error)
6912 }
6913
6914
6915 func (future *NotebookWorkspacesDeleteFuture) UnmarshalJSON(body []byte) error {
6916 var azFuture azure.Future
6917 if err := json.Unmarshal(body, &azFuture); err != nil {
6918 return err
6919 }
6920 future.FutureAPI = &azFuture
6921 future.Result = future.result
6922 return nil
6923 }
6924
6925
6926 func (future *NotebookWorkspacesDeleteFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) {
6927 var done bool
6928 done, err = future.DoneWithContext(context.Background(), client)
6929 if err != nil {
6930 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesDeleteFuture", "Result", future.Response(), "Polling failure")
6931 return
6932 }
6933 if !done {
6934 ar.Response = future.Response()
6935 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesDeleteFuture")
6936 return
6937 }
6938 ar.Response = future.Response()
6939 return
6940 }
6941
6942
6943
6944 type NotebookWorkspacesRegenerateAuthTokenFuture struct {
6945 azure.FutureAPI
6946
6947
6948 Result func(NotebookWorkspacesClient) (autorest.Response, error)
6949 }
6950
6951
6952 func (future *NotebookWorkspacesRegenerateAuthTokenFuture) UnmarshalJSON(body []byte) error {
6953 var azFuture azure.Future
6954 if err := json.Unmarshal(body, &azFuture); err != nil {
6955 return err
6956 }
6957 future.FutureAPI = &azFuture
6958 future.Result = future.result
6959 return nil
6960 }
6961
6962
6963 func (future *NotebookWorkspacesRegenerateAuthTokenFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) {
6964 var done bool
6965 done, err = future.DoneWithContext(context.Background(), client)
6966 if err != nil {
6967 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesRegenerateAuthTokenFuture", "Result", future.Response(), "Polling failure")
6968 return
6969 }
6970 if !done {
6971 ar.Response = future.Response()
6972 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesRegenerateAuthTokenFuture")
6973 return
6974 }
6975 ar.Response = future.Response()
6976 return
6977 }
6978
6979
6980
6981 type NotebookWorkspacesStartFuture struct {
6982 azure.FutureAPI
6983
6984
6985 Result func(NotebookWorkspacesClient) (autorest.Response, error)
6986 }
6987
6988
6989 func (future *NotebookWorkspacesStartFuture) UnmarshalJSON(body []byte) error {
6990 var azFuture azure.Future
6991 if err := json.Unmarshal(body, &azFuture); err != nil {
6992 return err
6993 }
6994 future.FutureAPI = &azFuture
6995 future.Result = future.result
6996 return nil
6997 }
6998
6999
7000 func (future *NotebookWorkspacesStartFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) {
7001 var done bool
7002 done, err = future.DoneWithContext(context.Background(), client)
7003 if err != nil {
7004 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesStartFuture", "Result", future.Response(), "Polling failure")
7005 return
7006 }
7007 if !done {
7008 ar.Response = future.Response()
7009 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesStartFuture")
7010 return
7011 }
7012 ar.Response = future.Response()
7013 return
7014 }
7015
7016
7017 type Operation struct {
7018
7019 Name *string `json:"name,omitempty"`
7020
7021 Display *OperationDisplay `json:"display,omitempty"`
7022 }
7023
7024
7025 type OperationDisplay struct {
7026
7027 Provider *string `json:"Provider,omitempty"`
7028
7029 Resource *string `json:"Resource,omitempty"`
7030
7031 Operation *string `json:"Operation,omitempty"`
7032
7033 Description *string `json:"Description,omitempty"`
7034 }
7035
7036
7037
7038 type OperationListResult struct {
7039 autorest.Response `json:"-"`
7040
7041 Value *[]Operation `json:"value,omitempty"`
7042
7043 NextLink *string `json:"nextLink,omitempty"`
7044 }
7045
7046
7047 type OperationListResultIterator struct {
7048 i int
7049 page OperationListResultPage
7050 }
7051
7052
7053
7054 func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
7055 if tracing.IsEnabled() {
7056 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
7057 defer func() {
7058 sc := -1
7059 if iter.Response().Response.Response != nil {
7060 sc = iter.Response().Response.Response.StatusCode
7061 }
7062 tracing.EndSpan(ctx, sc, err)
7063 }()
7064 }
7065 iter.i++
7066 if iter.i < len(iter.page.Values()) {
7067 return nil
7068 }
7069 err = iter.page.NextWithContext(ctx)
7070 if err != nil {
7071 iter.i--
7072 return err
7073 }
7074 iter.i = 0
7075 return nil
7076 }
7077
7078
7079
7080
7081 func (iter *OperationListResultIterator) Next() error {
7082 return iter.NextWithContext(context.Background())
7083 }
7084
7085
7086 func (iter OperationListResultIterator) NotDone() bool {
7087 return iter.page.NotDone() && iter.i < len(iter.page.Values())
7088 }
7089
7090
7091 func (iter OperationListResultIterator) Response() OperationListResult {
7092 return iter.page.Response()
7093 }
7094
7095
7096
7097 func (iter OperationListResultIterator) Value() Operation {
7098 if !iter.page.NotDone() {
7099 return Operation{}
7100 }
7101 return iter.page.Values()[iter.i]
7102 }
7103
7104
7105 func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
7106 return OperationListResultIterator{page: page}
7107 }
7108
7109
7110 func (olr OperationListResult) IsEmpty() bool {
7111 return olr.Value == nil || len(*olr.Value) == 0
7112 }
7113
7114
7115 func (olr OperationListResult) hasNextLink() bool {
7116 return olr.NextLink != nil && len(*olr.NextLink) != 0
7117 }
7118
7119
7120
7121 func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
7122 if !olr.hasNextLink() {
7123 return nil, nil
7124 }
7125 return autorest.Prepare((&http.Request{}).WithContext(ctx),
7126 autorest.AsJSON(),
7127 autorest.AsGet(),
7128 autorest.WithBaseURL(to.String(olr.NextLink)))
7129 }
7130
7131
7132 type OperationListResultPage struct {
7133 fn func(context.Context, OperationListResult) (OperationListResult, error)
7134 olr OperationListResult
7135 }
7136
7137
7138
7139 func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
7140 if tracing.IsEnabled() {
7141 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
7142 defer func() {
7143 sc := -1
7144 if page.Response().Response.Response != nil {
7145 sc = page.Response().Response.Response.StatusCode
7146 }
7147 tracing.EndSpan(ctx, sc, err)
7148 }()
7149 }
7150 for {
7151 next, err := page.fn(ctx, page.olr)
7152 if err != nil {
7153 return err
7154 }
7155 page.olr = next
7156 if !next.hasNextLink() || !next.IsEmpty() {
7157 break
7158 }
7159 }
7160 return nil
7161 }
7162
7163
7164
7165
7166 func (page *OperationListResultPage) Next() error {
7167 return page.NextWithContext(context.Background())
7168 }
7169
7170
7171 func (page OperationListResultPage) NotDone() bool {
7172 return !page.olr.IsEmpty()
7173 }
7174
7175
7176 func (page OperationListResultPage) Response() OperationListResult {
7177 return page.olr
7178 }
7179
7180
7181 func (page OperationListResultPage) Values() []Operation {
7182 if page.olr.IsEmpty() {
7183 return nil
7184 }
7185 return *page.olr.Value
7186 }
7187
7188
7189 func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
7190 return OperationListResultPage{
7191 fn: getNextPage,
7192 olr: cur,
7193 }
7194 }
7195
7196
7197 type OptionsResource struct {
7198
7199 Throughput *int32 `json:"throughput,omitempty"`
7200
7201 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
7202 }
7203
7204
7205 type PartitionMetric struct {
7206
7207 PartitionID *string `json:"partitionId,omitempty"`
7208
7209 PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"`
7210
7211 StartTime *date.Time `json:"startTime,omitempty"`
7212
7213 EndTime *date.Time `json:"endTime,omitempty"`
7214
7215 TimeGrain *string `json:"timeGrain,omitempty"`
7216
7217 Unit UnitType `json:"unit,omitempty"`
7218
7219 Name *MetricName `json:"name,omitempty"`
7220
7221 MetricValues *[]MetricValue `json:"metricValues,omitempty"`
7222 }
7223
7224
7225 func (pm PartitionMetric) MarshalJSON() ([]byte, error) {
7226 objectMap := make(map[string]interface{})
7227 if pm.Unit != "" {
7228 objectMap["unit"] = pm.Unit
7229 }
7230 return json.Marshal(objectMap)
7231 }
7232
7233
7234 type PartitionMetricListResult struct {
7235 autorest.Response `json:"-"`
7236
7237 Value *[]PartitionMetric `json:"value,omitempty"`
7238 }
7239
7240
7241 func (pmlr PartitionMetricListResult) MarshalJSON() ([]byte, error) {
7242 objectMap := make(map[string]interface{})
7243 return json.Marshal(objectMap)
7244 }
7245
7246
7247 type PartitionUsage struct {
7248
7249 PartitionID *string `json:"partitionId,omitempty"`
7250
7251 PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"`
7252
7253 Unit UnitType `json:"unit,omitempty"`
7254
7255 Name *MetricName `json:"name,omitempty"`
7256
7257 QuotaPeriod *string `json:"quotaPeriod,omitempty"`
7258
7259 Limit *int64 `json:"limit,omitempty"`
7260
7261 CurrentValue *int64 `json:"currentValue,omitempty"`
7262 }
7263
7264
7265 func (pu PartitionUsage) MarshalJSON() ([]byte, error) {
7266 objectMap := make(map[string]interface{})
7267 if pu.Unit != "" {
7268 objectMap["unit"] = pu.Unit
7269 }
7270 return json.Marshal(objectMap)
7271 }
7272
7273
7274 type PartitionUsagesResult struct {
7275 autorest.Response `json:"-"`
7276
7277 Value *[]PartitionUsage `json:"value,omitempty"`
7278 }
7279
7280
7281 func (pur PartitionUsagesResult) MarshalJSON() ([]byte, error) {
7282 objectMap := make(map[string]interface{})
7283 return json.Marshal(objectMap)
7284 }
7285
7286
7287 type PercentileMetric struct {
7288
7289 StartTime *date.Time `json:"startTime,omitempty"`
7290
7291 EndTime *date.Time `json:"endTime,omitempty"`
7292
7293 TimeGrain *string `json:"timeGrain,omitempty"`
7294
7295 Unit UnitType `json:"unit,omitempty"`
7296
7297 Name *MetricName `json:"name,omitempty"`
7298
7299 MetricValues *[]PercentileMetricValue `json:"metricValues,omitempty"`
7300 }
7301
7302
7303 func (pm PercentileMetric) MarshalJSON() ([]byte, error) {
7304 objectMap := make(map[string]interface{})
7305 if pm.Unit != "" {
7306 objectMap["unit"] = pm.Unit
7307 }
7308 return json.Marshal(objectMap)
7309 }
7310
7311
7312 type PercentileMetricListResult struct {
7313 autorest.Response `json:"-"`
7314
7315 Value *[]PercentileMetric `json:"value,omitempty"`
7316 }
7317
7318
7319 func (pmlr PercentileMetricListResult) MarshalJSON() ([]byte, error) {
7320 objectMap := make(map[string]interface{})
7321 return json.Marshal(objectMap)
7322 }
7323
7324
7325 type PercentileMetricValue struct {
7326
7327 P10 *float64 `json:"P10,omitempty"`
7328
7329 P25 *float64 `json:"P25,omitempty"`
7330
7331 P50 *float64 `json:"P50,omitempty"`
7332
7333 P75 *float64 `json:"P75,omitempty"`
7334
7335 P90 *float64 `json:"P90,omitempty"`
7336
7337 P95 *float64 `json:"P95,omitempty"`
7338
7339 P99 *float64 `json:"P99,omitempty"`
7340
7341 Count *float64 `json:"_count,omitempty"`
7342
7343 Average *float64 `json:"average,omitempty"`
7344
7345 Maximum *float64 `json:"maximum,omitempty"`
7346
7347 Minimum *float64 `json:"minimum,omitempty"`
7348
7349 Timestamp *date.Time `json:"timestamp,omitempty"`
7350
7351 Total *float64 `json:"total,omitempty"`
7352 }
7353
7354
7355 func (pmv PercentileMetricValue) MarshalJSON() ([]byte, error) {
7356 objectMap := make(map[string]interface{})
7357 return json.Marshal(objectMap)
7358 }
7359
7360
7361 type PeriodicModeBackupPolicy struct {
7362
7363 PeriodicModeProperties *PeriodicModeProperties `json:"periodicModeProperties,omitempty"`
7364
7365 Type Type `json:"type,omitempty"`
7366 }
7367
7368
7369 func (pmbp PeriodicModeBackupPolicy) MarshalJSON() ([]byte, error) {
7370 pmbp.Type = TypePeriodic
7371 objectMap := make(map[string]interface{})
7372 if pmbp.PeriodicModeProperties != nil {
7373 objectMap["periodicModeProperties"] = pmbp.PeriodicModeProperties
7374 }
7375 if pmbp.Type != "" {
7376 objectMap["type"] = pmbp.Type
7377 }
7378 return json.Marshal(objectMap)
7379 }
7380
7381
7382 func (pmbp PeriodicModeBackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) {
7383 return &pmbp, true
7384 }
7385
7386
7387 func (pmbp PeriodicModeBackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) {
7388 return nil, false
7389 }
7390
7391
7392 func (pmbp PeriodicModeBackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) {
7393 return nil, false
7394 }
7395
7396
7397 func (pmbp PeriodicModeBackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) {
7398 return &pmbp, true
7399 }
7400
7401
7402 type PeriodicModeProperties struct {
7403
7404 BackupIntervalInMinutes *int32 `json:"backupIntervalInMinutes,omitempty"`
7405
7406 BackupRetentionIntervalInHours *int32 `json:"backupRetentionIntervalInHours,omitempty"`
7407
7408 BackupStorageRedundancy BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"`
7409 }
7410
7411
7412 type Permission struct {
7413
7414 DataActions *[]string `json:"dataActions,omitempty"`
7415
7416 NotDataActions *[]string `json:"notDataActions,omitempty"`
7417 }
7418
7419
7420 type PrivateEndpointConnection struct {
7421 autorest.Response `json:"-"`
7422
7423 *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
7424
7425 ID *string `json:"id,omitempty"`
7426
7427 Name *string `json:"name,omitempty"`
7428
7429 Type *string `json:"type,omitempty"`
7430 }
7431
7432
7433 func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
7434 objectMap := make(map[string]interface{})
7435 if pec.PrivateEndpointConnectionProperties != nil {
7436 objectMap["properties"] = pec.PrivateEndpointConnectionProperties
7437 }
7438 return json.Marshal(objectMap)
7439 }
7440
7441
7442 func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
7443 var m map[string]*json.RawMessage
7444 err := json.Unmarshal(body, &m)
7445 if err != nil {
7446 return err
7447 }
7448 for k, v := range m {
7449 switch k {
7450 case "properties":
7451 if v != nil {
7452 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
7453 err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
7454 if err != nil {
7455 return err
7456 }
7457 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
7458 }
7459 case "id":
7460 if v != nil {
7461 var ID string
7462 err = json.Unmarshal(*v, &ID)
7463 if err != nil {
7464 return err
7465 }
7466 pec.ID = &ID
7467 }
7468 case "name":
7469 if v != nil {
7470 var name string
7471 err = json.Unmarshal(*v, &name)
7472 if err != nil {
7473 return err
7474 }
7475 pec.Name = &name
7476 }
7477 case "type":
7478 if v != nil {
7479 var typeVar string
7480 err = json.Unmarshal(*v, &typeVar)
7481 if err != nil {
7482 return err
7483 }
7484 pec.Type = &typeVar
7485 }
7486 }
7487 }
7488
7489 return nil
7490 }
7491
7492
7493 type PrivateEndpointConnectionListResult struct {
7494 autorest.Response `json:"-"`
7495
7496 Value *[]PrivateEndpointConnection `json:"value,omitempty"`
7497 }
7498
7499
7500 type PrivateEndpointConnectionProperties struct {
7501
7502 PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"`
7503
7504 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`
7505
7506 GroupID *string `json:"groupId,omitempty"`
7507
7508 ProvisioningState *string `json:"provisioningState,omitempty"`
7509 }
7510
7511
7512
7513 type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
7514 azure.FutureAPI
7515
7516
7517 Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
7518 }
7519
7520
7521 func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
7522 var azFuture azure.Future
7523 if err := json.Unmarshal(body, &azFuture); err != nil {
7524 return err
7525 }
7526 future.FutureAPI = &azFuture
7527 future.Result = future.result
7528 return nil
7529 }
7530
7531
7532 func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
7533 var done bool
7534 done, err = future.DoneWithContext(context.Background(), client)
7535 if err != nil {
7536 err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
7537 return
7538 }
7539 if !done {
7540 pec.Response.Response = future.Response()
7541 err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture")
7542 return
7543 }
7544 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7545 if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
7546 pec, err = client.CreateOrUpdateResponder(pec.Response.Response)
7547 if err != nil {
7548 err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request")
7549 }
7550 }
7551 return
7552 }
7553
7554
7555
7556 type PrivateEndpointConnectionsDeleteFuture struct {
7557 azure.FutureAPI
7558
7559
7560 Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
7561 }
7562
7563
7564 func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
7565 var azFuture azure.Future
7566 if err := json.Unmarshal(body, &azFuture); err != nil {
7567 return err
7568 }
7569 future.FutureAPI = &azFuture
7570 future.Result = future.result
7571 return nil
7572 }
7573
7574
7575 func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
7576 var done bool
7577 done, err = future.DoneWithContext(context.Background(), client)
7578 if err != nil {
7579 err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
7580 return
7581 }
7582 if !done {
7583 ar.Response = future.Response()
7584 err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsDeleteFuture")
7585 return
7586 }
7587 ar.Response = future.Response()
7588 return
7589 }
7590
7591
7592 type PrivateEndpointProperty struct {
7593
7594 ID *string `json:"id,omitempty"`
7595 }
7596
7597
7598 type PrivateLinkResource struct {
7599 autorest.Response `json:"-"`
7600
7601 *PrivateLinkResourceProperties `json:"properties,omitempty"`
7602
7603 ID *string `json:"id,omitempty"`
7604
7605 Name *string `json:"name,omitempty"`
7606
7607 Type *string `json:"type,omitempty"`
7608 }
7609
7610
7611 func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
7612 objectMap := make(map[string]interface{})
7613 if plr.PrivateLinkResourceProperties != nil {
7614 objectMap["properties"] = plr.PrivateLinkResourceProperties
7615 }
7616 return json.Marshal(objectMap)
7617 }
7618
7619
7620 func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
7621 var m map[string]*json.RawMessage
7622 err := json.Unmarshal(body, &m)
7623 if err != nil {
7624 return err
7625 }
7626 for k, v := range m {
7627 switch k {
7628 case "properties":
7629 if v != nil {
7630 var privateLinkResourceProperties PrivateLinkResourceProperties
7631 err = json.Unmarshal(*v, &privateLinkResourceProperties)
7632 if err != nil {
7633 return err
7634 }
7635 plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
7636 }
7637 case "id":
7638 if v != nil {
7639 var ID string
7640 err = json.Unmarshal(*v, &ID)
7641 if err != nil {
7642 return err
7643 }
7644 plr.ID = &ID
7645 }
7646 case "name":
7647 if v != nil {
7648 var name string
7649 err = json.Unmarshal(*v, &name)
7650 if err != nil {
7651 return err
7652 }
7653 plr.Name = &name
7654 }
7655 case "type":
7656 if v != nil {
7657 var typeVar string
7658 err = json.Unmarshal(*v, &typeVar)
7659 if err != nil {
7660 return err
7661 }
7662 plr.Type = &typeVar
7663 }
7664 }
7665 }
7666
7667 return nil
7668 }
7669
7670
7671 type PrivateLinkResourceListResult struct {
7672 autorest.Response `json:"-"`
7673
7674 Value *[]PrivateLinkResource `json:"value,omitempty"`
7675 }
7676
7677
7678 type PrivateLinkResourceProperties struct {
7679
7680 GroupID *string `json:"groupId,omitempty"`
7681
7682 RequiredMembers *[]string `json:"requiredMembers,omitempty"`
7683
7684 RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
7685 }
7686
7687
7688 func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
7689 objectMap := make(map[string]interface{})
7690 return json.Marshal(objectMap)
7691 }
7692
7693
7694 type PrivateLinkServiceConnectionStateProperty struct {
7695
7696 Status *string `json:"status,omitempty"`
7697
7698 Description *string `json:"description,omitempty"`
7699
7700 ActionsRequired *string `json:"actionsRequired,omitempty"`
7701 }
7702
7703
7704 func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
7705 objectMap := make(map[string]interface{})
7706 if plscsp.Status != nil {
7707 objectMap["status"] = plscsp.Status
7708 }
7709 if plscsp.Description != nil {
7710 objectMap["description"] = plscsp.Description
7711 }
7712 return json.Marshal(objectMap)
7713 }
7714
7715
7716
7717 type ProxyResource struct {
7718
7719 ID *string `json:"id,omitempty"`
7720
7721 Name *string `json:"name,omitempty"`
7722
7723 Type *string `json:"type,omitempty"`
7724 }
7725
7726
7727 func (pr ProxyResource) MarshalJSON() ([]byte, error) {
7728 objectMap := make(map[string]interface{})
7729 return json.Marshal(objectMap)
7730 }
7731
7732
7733 type RegionalServiceResource struct {
7734
7735 Name *string `json:"name,omitempty"`
7736
7737 Location *string `json:"location,omitempty"`
7738
7739 Status ServiceStatus `json:"status,omitempty"`
7740 }
7741
7742
7743 func (rsr RegionalServiceResource) MarshalJSON() ([]byte, error) {
7744 objectMap := make(map[string]interface{})
7745 return json.Marshal(objectMap)
7746 }
7747
7748
7749 type RegionForOnlineOffline struct {
7750
7751 Region *string `json:"region,omitempty"`
7752 }
7753
7754
7755 type RepairPostBody struct {
7756
7757 Keyspace *string `json:"keyspace,omitempty"`
7758
7759 Tables *[]string `json:"tables,omitempty"`
7760 }
7761
7762
7763 type Resource struct {
7764
7765 ID *string `json:"id,omitempty"`
7766
7767 Name *string `json:"name,omitempty"`
7768
7769 Type *string `json:"type,omitempty"`
7770 }
7771
7772
7773 func (r Resource) MarshalJSON() ([]byte, error) {
7774 objectMap := make(map[string]interface{})
7775 return json.Marshal(objectMap)
7776 }
7777
7778
7779 type RestorableDatabaseAccountGetResult struct {
7780 autorest.Response `json:"-"`
7781
7782 *RestorableDatabaseAccountProperties `json:"properties,omitempty"`
7783
7784 ID *string `json:"id,omitempty"`
7785
7786 Name *string `json:"name,omitempty"`
7787
7788 Type *string `json:"type,omitempty"`
7789
7790 Location *string `json:"location,omitempty"`
7791 }
7792
7793
7794 func (rdagr RestorableDatabaseAccountGetResult) MarshalJSON() ([]byte, error) {
7795 objectMap := make(map[string]interface{})
7796 if rdagr.RestorableDatabaseAccountProperties != nil {
7797 objectMap["properties"] = rdagr.RestorableDatabaseAccountProperties
7798 }
7799 if rdagr.Location != nil {
7800 objectMap["location"] = rdagr.Location
7801 }
7802 return json.Marshal(objectMap)
7803 }
7804
7805
7806 func (rdagr *RestorableDatabaseAccountGetResult) UnmarshalJSON(body []byte) error {
7807 var m map[string]*json.RawMessage
7808 err := json.Unmarshal(body, &m)
7809 if err != nil {
7810 return err
7811 }
7812 for k, v := range m {
7813 switch k {
7814 case "properties":
7815 if v != nil {
7816 var restorableDatabaseAccountProperties RestorableDatabaseAccountProperties
7817 err = json.Unmarshal(*v, &restorableDatabaseAccountProperties)
7818 if err != nil {
7819 return err
7820 }
7821 rdagr.RestorableDatabaseAccountProperties = &restorableDatabaseAccountProperties
7822 }
7823 case "id":
7824 if v != nil {
7825 var ID string
7826 err = json.Unmarshal(*v, &ID)
7827 if err != nil {
7828 return err
7829 }
7830 rdagr.ID = &ID
7831 }
7832 case "name":
7833 if v != nil {
7834 var name string
7835 err = json.Unmarshal(*v, &name)
7836 if err != nil {
7837 return err
7838 }
7839 rdagr.Name = &name
7840 }
7841 case "type":
7842 if v != nil {
7843 var typeVar string
7844 err = json.Unmarshal(*v, &typeVar)
7845 if err != nil {
7846 return err
7847 }
7848 rdagr.Type = &typeVar
7849 }
7850 case "location":
7851 if v != nil {
7852 var location string
7853 err = json.Unmarshal(*v, &location)
7854 if err != nil {
7855 return err
7856 }
7857 rdagr.Location = &location
7858 }
7859 }
7860 }
7861
7862 return nil
7863 }
7864
7865
7866 type RestorableDatabaseAccountProperties struct {
7867
7868 AccountName *string `json:"accountName,omitempty"`
7869
7870 CreationTime *date.Time `json:"creationTime,omitempty"`
7871
7872 DeletionTime *date.Time `json:"deletionTime,omitempty"`
7873
7874 APIType APIType `json:"apiType,omitempty"`
7875
7876 RestorableLocations *[]RestorableLocationResource `json:"restorableLocations,omitempty"`
7877 }
7878
7879
7880 func (rdap RestorableDatabaseAccountProperties) MarshalJSON() ([]byte, error) {
7881 objectMap := make(map[string]interface{})
7882 if rdap.AccountName != nil {
7883 objectMap["accountName"] = rdap.AccountName
7884 }
7885 if rdap.CreationTime != nil {
7886 objectMap["creationTime"] = rdap.CreationTime
7887 }
7888 if rdap.DeletionTime != nil {
7889 objectMap["deletionTime"] = rdap.DeletionTime
7890 }
7891 return json.Marshal(objectMap)
7892 }
7893
7894
7895
7896 type RestorableDatabaseAccountsListResult struct {
7897 autorest.Response `json:"-"`
7898
7899 Value *[]RestorableDatabaseAccountGetResult `json:"value,omitempty"`
7900 }
7901
7902
7903 func (rdalr RestorableDatabaseAccountsListResult) MarshalJSON() ([]byte, error) {
7904 objectMap := make(map[string]interface{})
7905 return json.Marshal(objectMap)
7906 }
7907
7908
7909 type RestorableLocationResource struct {
7910
7911 LocationName *string `json:"locationName,omitempty"`
7912
7913 RegionalDatabaseAccountInstanceID *string `json:"regionalDatabaseAccountInstanceId,omitempty"`
7914
7915 CreationTime *date.Time `json:"creationTime,omitempty"`
7916
7917 DeletionTime *date.Time `json:"deletionTime,omitempty"`
7918 }
7919
7920
7921 func (rlr RestorableLocationResource) MarshalJSON() ([]byte, error) {
7922 objectMap := make(map[string]interface{})
7923 return json.Marshal(objectMap)
7924 }
7925
7926
7927 type RestorableMongodbCollectionGetResult struct {
7928
7929 *RestorableMongodbCollectionProperties `json:"properties,omitempty"`
7930
7931 ID *string `json:"id,omitempty"`
7932
7933 Name *string `json:"name,omitempty"`
7934
7935 Type *string `json:"type,omitempty"`
7936 }
7937
7938
7939 func (rmcgr RestorableMongodbCollectionGetResult) MarshalJSON() ([]byte, error) {
7940 objectMap := make(map[string]interface{})
7941 if rmcgr.RestorableMongodbCollectionProperties != nil {
7942 objectMap["properties"] = rmcgr.RestorableMongodbCollectionProperties
7943 }
7944 return json.Marshal(objectMap)
7945 }
7946
7947
7948 func (rmcgr *RestorableMongodbCollectionGetResult) UnmarshalJSON(body []byte) error {
7949 var m map[string]*json.RawMessage
7950 err := json.Unmarshal(body, &m)
7951 if err != nil {
7952 return err
7953 }
7954 for k, v := range m {
7955 switch k {
7956 case "properties":
7957 if v != nil {
7958 var restorableMongodbCollectionProperties RestorableMongodbCollectionProperties
7959 err = json.Unmarshal(*v, &restorableMongodbCollectionProperties)
7960 if err != nil {
7961 return err
7962 }
7963 rmcgr.RestorableMongodbCollectionProperties = &restorableMongodbCollectionProperties
7964 }
7965 case "id":
7966 if v != nil {
7967 var ID string
7968 err = json.Unmarshal(*v, &ID)
7969 if err != nil {
7970 return err
7971 }
7972 rmcgr.ID = &ID
7973 }
7974 case "name":
7975 if v != nil {
7976 var name string
7977 err = json.Unmarshal(*v, &name)
7978 if err != nil {
7979 return err
7980 }
7981 rmcgr.Name = &name
7982 }
7983 case "type":
7984 if v != nil {
7985 var typeVar string
7986 err = json.Unmarshal(*v, &typeVar)
7987 if err != nil {
7988 return err
7989 }
7990 rmcgr.Type = &typeVar
7991 }
7992 }
7993 }
7994
7995 return nil
7996 }
7997
7998
7999 type RestorableMongodbCollectionProperties struct {
8000
8001 Resource *RestorableMongodbCollectionPropertiesResource `json:"resource,omitempty"`
8002 }
8003
8004
8005
8006 type RestorableMongodbCollectionPropertiesResource struct {
8007
8008 Rid *string `json:"_rid,omitempty"`
8009
8010 OperationType OperationType `json:"operationType,omitempty"`
8011
8012 EventTimestamp *string `json:"eventTimestamp,omitempty"`
8013
8014 OwnerID *string `json:"ownerId,omitempty"`
8015
8016 OwnerResourceID *string `json:"ownerResourceId,omitempty"`
8017 }
8018
8019
8020 func (rmcp RestorableMongodbCollectionPropertiesResource) MarshalJSON() ([]byte, error) {
8021 objectMap := make(map[string]interface{})
8022 return json.Marshal(objectMap)
8023 }
8024
8025
8026
8027 type RestorableMongodbCollectionsListResult struct {
8028 autorest.Response `json:"-"`
8029
8030 Value *[]RestorableMongodbCollectionGetResult `json:"value,omitempty"`
8031 }
8032
8033
8034 func (rmclr RestorableMongodbCollectionsListResult) MarshalJSON() ([]byte, error) {
8035 objectMap := make(map[string]interface{})
8036 return json.Marshal(objectMap)
8037 }
8038
8039
8040 type RestorableMongodbDatabaseGetResult struct {
8041
8042 *RestorableMongodbDatabaseProperties `json:"properties,omitempty"`
8043
8044 ID *string `json:"id,omitempty"`
8045
8046 Name *string `json:"name,omitempty"`
8047
8048 Type *string `json:"type,omitempty"`
8049 }
8050
8051
8052 func (rmdgr RestorableMongodbDatabaseGetResult) MarshalJSON() ([]byte, error) {
8053 objectMap := make(map[string]interface{})
8054 if rmdgr.RestorableMongodbDatabaseProperties != nil {
8055 objectMap["properties"] = rmdgr.RestorableMongodbDatabaseProperties
8056 }
8057 return json.Marshal(objectMap)
8058 }
8059
8060
8061 func (rmdgr *RestorableMongodbDatabaseGetResult) UnmarshalJSON(body []byte) error {
8062 var m map[string]*json.RawMessage
8063 err := json.Unmarshal(body, &m)
8064 if err != nil {
8065 return err
8066 }
8067 for k, v := range m {
8068 switch k {
8069 case "properties":
8070 if v != nil {
8071 var restorableMongodbDatabaseProperties RestorableMongodbDatabaseProperties
8072 err = json.Unmarshal(*v, &restorableMongodbDatabaseProperties)
8073 if err != nil {
8074 return err
8075 }
8076 rmdgr.RestorableMongodbDatabaseProperties = &restorableMongodbDatabaseProperties
8077 }
8078 case "id":
8079 if v != nil {
8080 var ID string
8081 err = json.Unmarshal(*v, &ID)
8082 if err != nil {
8083 return err
8084 }
8085 rmdgr.ID = &ID
8086 }
8087 case "name":
8088 if v != nil {
8089 var name string
8090 err = json.Unmarshal(*v, &name)
8091 if err != nil {
8092 return err
8093 }
8094 rmdgr.Name = &name
8095 }
8096 case "type":
8097 if v != nil {
8098 var typeVar string
8099 err = json.Unmarshal(*v, &typeVar)
8100 if err != nil {
8101 return err
8102 }
8103 rmdgr.Type = &typeVar
8104 }
8105 }
8106 }
8107
8108 return nil
8109 }
8110
8111
8112 type RestorableMongodbDatabaseProperties struct {
8113
8114 Resource *RestorableMongodbDatabasePropertiesResource `json:"resource,omitempty"`
8115 }
8116
8117
8118 type RestorableMongodbDatabasePropertiesResource struct {
8119
8120 Rid *string `json:"_rid,omitempty"`
8121
8122 OperationType OperationType `json:"operationType,omitempty"`
8123
8124 EventTimestamp *string `json:"eventTimestamp,omitempty"`
8125
8126 OwnerID *string `json:"ownerId,omitempty"`
8127
8128 OwnerResourceID *string `json:"ownerResourceId,omitempty"`
8129 }
8130
8131
8132 func (rmdp RestorableMongodbDatabasePropertiesResource) MarshalJSON() ([]byte, error) {
8133 objectMap := make(map[string]interface{})
8134 return json.Marshal(objectMap)
8135 }
8136
8137
8138
8139 type RestorableMongodbDatabasesListResult struct {
8140 autorest.Response `json:"-"`
8141
8142 Value *[]RestorableMongodbDatabaseGetResult `json:"value,omitempty"`
8143 }
8144
8145
8146 func (rmdlr RestorableMongodbDatabasesListResult) MarshalJSON() ([]byte, error) {
8147 objectMap := make(map[string]interface{})
8148 return json.Marshal(objectMap)
8149 }
8150
8151
8152
8153 type RestorableMongodbResourcesListResult struct {
8154 autorest.Response `json:"-"`
8155
8156 Value *[]DatabaseRestoreResource `json:"value,omitempty"`
8157 }
8158
8159
8160 func (rmrlr RestorableMongodbResourcesListResult) MarshalJSON() ([]byte, error) {
8161 objectMap := make(map[string]interface{})
8162 return json.Marshal(objectMap)
8163 }
8164
8165
8166 type RestorableSQLContainerGetResult struct {
8167
8168 *RestorableSQLContainerProperties `json:"properties,omitempty"`
8169
8170 ID *string `json:"id,omitempty"`
8171
8172 Name *string `json:"name,omitempty"`
8173
8174 Type *string `json:"type,omitempty"`
8175 }
8176
8177
8178 func (rscgr RestorableSQLContainerGetResult) MarshalJSON() ([]byte, error) {
8179 objectMap := make(map[string]interface{})
8180 if rscgr.RestorableSQLContainerProperties != nil {
8181 objectMap["properties"] = rscgr.RestorableSQLContainerProperties
8182 }
8183 return json.Marshal(objectMap)
8184 }
8185
8186
8187 func (rscgr *RestorableSQLContainerGetResult) UnmarshalJSON(body []byte) error {
8188 var m map[string]*json.RawMessage
8189 err := json.Unmarshal(body, &m)
8190 if err != nil {
8191 return err
8192 }
8193 for k, v := range m {
8194 switch k {
8195 case "properties":
8196 if v != nil {
8197 var restorableSQLContainerProperties RestorableSQLContainerProperties
8198 err = json.Unmarshal(*v, &restorableSQLContainerProperties)
8199 if err != nil {
8200 return err
8201 }
8202 rscgr.RestorableSQLContainerProperties = &restorableSQLContainerProperties
8203 }
8204 case "id":
8205 if v != nil {
8206 var ID string
8207 err = json.Unmarshal(*v, &ID)
8208 if err != nil {
8209 return err
8210 }
8211 rscgr.ID = &ID
8212 }
8213 case "name":
8214 if v != nil {
8215 var name string
8216 err = json.Unmarshal(*v, &name)
8217 if err != nil {
8218 return err
8219 }
8220 rscgr.Name = &name
8221 }
8222 case "type":
8223 if v != nil {
8224 var typeVar string
8225 err = json.Unmarshal(*v, &typeVar)
8226 if err != nil {
8227 return err
8228 }
8229 rscgr.Type = &typeVar
8230 }
8231 }
8232 }
8233
8234 return nil
8235 }
8236
8237
8238 type RestorableSQLContainerProperties struct {
8239
8240 Resource *RestorableSQLContainerPropertiesResource `json:"resource,omitempty"`
8241 }
8242
8243
8244 type RestorableSQLContainerPropertiesResource struct {
8245
8246 Rid *string `json:"_rid,omitempty"`
8247
8248 OperationType OperationType `json:"operationType,omitempty"`
8249
8250 EventTimestamp *string `json:"eventTimestamp,omitempty"`
8251
8252 OwnerID *string `json:"ownerId,omitempty"`
8253
8254 OwnerResourceID *string `json:"ownerResourceId,omitempty"`
8255
8256 Container *RestorableSQLContainerPropertiesResourceContainer `json:"container,omitempty"`
8257 }
8258
8259
8260 func (rscp RestorableSQLContainerPropertiesResource) MarshalJSON() ([]byte, error) {
8261 objectMap := make(map[string]interface{})
8262 if rscp.Container != nil {
8263 objectMap["container"] = rscp.Container
8264 }
8265 return json.Marshal(objectMap)
8266 }
8267
8268
8269 type RestorableSQLContainerPropertiesResourceContainer struct {
8270
8271 ID *string `json:"id,omitempty"`
8272
8273 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
8274
8275 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
8276
8277 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
8278
8279 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
8280
8281 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
8282
8283 AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"`
8284
8285 Rid *string `json:"_rid,omitempty"`
8286
8287 Ts *float64 `json:"_ts,omitempty"`
8288
8289 Etag *string `json:"_etag,omitempty"`
8290
8291 Self *string `json:"_self,omitempty"`
8292 }
8293
8294
8295 func (rscp RestorableSQLContainerPropertiesResourceContainer) MarshalJSON() ([]byte, error) {
8296 objectMap := make(map[string]interface{})
8297 if rscp.ID != nil {
8298 objectMap["id"] = rscp.ID
8299 }
8300 if rscp.IndexingPolicy != nil {
8301 objectMap["indexingPolicy"] = rscp.IndexingPolicy
8302 }
8303 if rscp.PartitionKey != nil {
8304 objectMap["partitionKey"] = rscp.PartitionKey
8305 }
8306 if rscp.DefaultTTL != nil {
8307 objectMap["defaultTtl"] = rscp.DefaultTTL
8308 }
8309 if rscp.UniqueKeyPolicy != nil {
8310 objectMap["uniqueKeyPolicy"] = rscp.UniqueKeyPolicy
8311 }
8312 if rscp.ConflictResolutionPolicy != nil {
8313 objectMap["conflictResolutionPolicy"] = rscp.ConflictResolutionPolicy
8314 }
8315 if rscp.AnalyticalStorageTTL != nil {
8316 objectMap["analyticalStorageTtl"] = rscp.AnalyticalStorageTTL
8317 }
8318 return json.Marshal(objectMap)
8319 }
8320
8321
8322
8323 type RestorableSQLContainersListResult struct {
8324 autorest.Response `json:"-"`
8325
8326 Value *[]RestorableSQLContainerGetResult `json:"value,omitempty"`
8327 }
8328
8329
8330 func (rsclr RestorableSQLContainersListResult) MarshalJSON() ([]byte, error) {
8331 objectMap := make(map[string]interface{})
8332 return json.Marshal(objectMap)
8333 }
8334
8335
8336 type RestorableSQLDatabaseGetResult struct {
8337
8338 *RestorableSQLDatabaseProperties `json:"properties,omitempty"`
8339
8340 ID *string `json:"id,omitempty"`
8341
8342 Name *string `json:"name,omitempty"`
8343
8344 Type *string `json:"type,omitempty"`
8345 }
8346
8347
8348 func (rsdgr RestorableSQLDatabaseGetResult) MarshalJSON() ([]byte, error) {
8349 objectMap := make(map[string]interface{})
8350 if rsdgr.RestorableSQLDatabaseProperties != nil {
8351 objectMap["properties"] = rsdgr.RestorableSQLDatabaseProperties
8352 }
8353 return json.Marshal(objectMap)
8354 }
8355
8356
8357 func (rsdgr *RestorableSQLDatabaseGetResult) UnmarshalJSON(body []byte) error {
8358 var m map[string]*json.RawMessage
8359 err := json.Unmarshal(body, &m)
8360 if err != nil {
8361 return err
8362 }
8363 for k, v := range m {
8364 switch k {
8365 case "properties":
8366 if v != nil {
8367 var restorableSQLDatabaseProperties RestorableSQLDatabaseProperties
8368 err = json.Unmarshal(*v, &restorableSQLDatabaseProperties)
8369 if err != nil {
8370 return err
8371 }
8372 rsdgr.RestorableSQLDatabaseProperties = &restorableSQLDatabaseProperties
8373 }
8374 case "id":
8375 if v != nil {
8376 var ID string
8377 err = json.Unmarshal(*v, &ID)
8378 if err != nil {
8379 return err
8380 }
8381 rsdgr.ID = &ID
8382 }
8383 case "name":
8384 if v != nil {
8385 var name string
8386 err = json.Unmarshal(*v, &name)
8387 if err != nil {
8388 return err
8389 }
8390 rsdgr.Name = &name
8391 }
8392 case "type":
8393 if v != nil {
8394 var typeVar string
8395 err = json.Unmarshal(*v, &typeVar)
8396 if err != nil {
8397 return err
8398 }
8399 rsdgr.Type = &typeVar
8400 }
8401 }
8402 }
8403
8404 return nil
8405 }
8406
8407
8408 type RestorableSQLDatabaseProperties struct {
8409
8410 Resource *RestorableSQLDatabasePropertiesResource `json:"resource,omitempty"`
8411 }
8412
8413
8414 type RestorableSQLDatabasePropertiesResource struct {
8415
8416 Rid *string `json:"_rid,omitempty"`
8417
8418 OperationType OperationType `json:"operationType,omitempty"`
8419
8420 EventTimestamp *string `json:"eventTimestamp,omitempty"`
8421
8422 OwnerID *string `json:"ownerId,omitempty"`
8423
8424 OwnerResourceID *string `json:"ownerResourceId,omitempty"`
8425
8426 Database *RestorableSQLDatabasePropertiesResourceDatabase `json:"database,omitempty"`
8427 }
8428
8429
8430 func (rsdp RestorableSQLDatabasePropertiesResource) MarshalJSON() ([]byte, error) {
8431 objectMap := make(map[string]interface{})
8432 if rsdp.Database != nil {
8433 objectMap["database"] = rsdp.Database
8434 }
8435 return json.Marshal(objectMap)
8436 }
8437
8438
8439 type RestorableSQLDatabasePropertiesResourceDatabase struct {
8440
8441 ID *string `json:"id,omitempty"`
8442
8443 Rid *string `json:"_rid,omitempty"`
8444
8445 Ts *float64 `json:"_ts,omitempty"`
8446
8447 Etag *string `json:"_etag,omitempty"`
8448
8449 Colls *string `json:"_colls,omitempty"`
8450
8451 Users *string `json:"_users,omitempty"`
8452
8453 Self *string `json:"_self,omitempty"`
8454 }
8455
8456
8457 func (rsdp RestorableSQLDatabasePropertiesResourceDatabase) MarshalJSON() ([]byte, error) {
8458 objectMap := make(map[string]interface{})
8459 if rsdp.ID != nil {
8460 objectMap["id"] = rsdp.ID
8461 }
8462 return json.Marshal(objectMap)
8463 }
8464
8465
8466
8467 type RestorableSQLDatabasesListResult struct {
8468 autorest.Response `json:"-"`
8469
8470 Value *[]RestorableSQLDatabaseGetResult `json:"value,omitempty"`
8471 }
8472
8473
8474 func (rsdlr RestorableSQLDatabasesListResult) MarshalJSON() ([]byte, error) {
8475 objectMap := make(map[string]interface{})
8476 return json.Marshal(objectMap)
8477 }
8478
8479
8480
8481 type RestorableSQLResourcesListResult struct {
8482 autorest.Response `json:"-"`
8483
8484 Value *[]DatabaseRestoreResource `json:"value,omitempty"`
8485 }
8486
8487
8488 func (rsrlr RestorableSQLResourcesListResult) MarshalJSON() ([]byte, error) {
8489 objectMap := make(map[string]interface{})
8490 return json.Marshal(objectMap)
8491 }
8492
8493
8494 type RestoreParameters struct {
8495
8496 RestoreMode RestoreMode `json:"restoreMode,omitempty"`
8497
8498 RestoreSource *string `json:"restoreSource,omitempty"`
8499
8500 RestoreTimestampInUtc *date.Time `json:"restoreTimestampInUtc,omitempty"`
8501
8502 DatabasesToRestore *[]DatabaseRestoreResource `json:"databasesToRestore,omitempty"`
8503 }
8504
8505
8506
8507 type RestoreReqeustDatabaseAccountCreateUpdateProperties struct {
8508
8509 RestoreParameters *RestoreParameters `json:"restoreParameters,omitempty"`
8510
8511 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"`
8512
8513 Locations *[]Location `json:"locations,omitempty"`
8514
8515 DatabaseAccountOfferType *string `json:"databaseAccountOfferType,omitempty"`
8516
8517 IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"`
8518
8519 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
8520
8521 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`
8522
8523 Capabilities *[]Capability `json:"capabilities,omitempty"`
8524
8525 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
8526
8527 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`
8528
8529 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`
8530
8531 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"`
8532
8533 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`
8534
8535 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"`
8536
8537 DefaultIdentity *string `json:"defaultIdentity,omitempty"`
8538
8539 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
8540
8541 EnableFreeTier *bool `json:"enableFreeTier,omitempty"`
8542
8543 APIProperties *APIProperties `json:"apiProperties,omitempty"`
8544
8545 EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"`
8546
8547 BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"`
8548
8549 Cors *[]CorsPolicy `json:"cors,omitempty"`
8550
8551 NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"`
8552
8553 NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"`
8554
8555 CreateMode CreateModeBasicDatabaseAccountCreateUpdateProperties `json:"createMode,omitempty"`
8556 }
8557
8558
8559 func (rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties) MarshalJSON() ([]byte, error) {
8560 rrdacup.CreateMode = CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeRestore
8561 objectMap := make(map[string]interface{})
8562 if rrdacup.RestoreParameters != nil {
8563 objectMap["restoreParameters"] = rrdacup.RestoreParameters
8564 }
8565 if rrdacup.ConsistencyPolicy != nil {
8566 objectMap["consistencyPolicy"] = rrdacup.ConsistencyPolicy
8567 }
8568 if rrdacup.Locations != nil {
8569 objectMap["locations"] = rrdacup.Locations
8570 }
8571 if rrdacup.DatabaseAccountOfferType != nil {
8572 objectMap["databaseAccountOfferType"] = rrdacup.DatabaseAccountOfferType
8573 }
8574 if rrdacup.IPRules != nil {
8575 objectMap["ipRules"] = rrdacup.IPRules
8576 }
8577 if rrdacup.IsVirtualNetworkFilterEnabled != nil {
8578 objectMap["isVirtualNetworkFilterEnabled"] = rrdacup.IsVirtualNetworkFilterEnabled
8579 }
8580 if rrdacup.EnableAutomaticFailover != nil {
8581 objectMap["enableAutomaticFailover"] = rrdacup.EnableAutomaticFailover
8582 }
8583 if rrdacup.Capabilities != nil {
8584 objectMap["capabilities"] = rrdacup.Capabilities
8585 }
8586 if rrdacup.VirtualNetworkRules != nil {
8587 objectMap["virtualNetworkRules"] = rrdacup.VirtualNetworkRules
8588 }
8589 if rrdacup.EnableMultipleWriteLocations != nil {
8590 objectMap["enableMultipleWriteLocations"] = rrdacup.EnableMultipleWriteLocations
8591 }
8592 if rrdacup.EnableCassandraConnector != nil {
8593 objectMap["enableCassandraConnector"] = rrdacup.EnableCassandraConnector
8594 }
8595 if rrdacup.ConnectorOffer != "" {
8596 objectMap["connectorOffer"] = rrdacup.ConnectorOffer
8597 }
8598 if rrdacup.DisableKeyBasedMetadataWriteAccess != nil {
8599 objectMap["disableKeyBasedMetadataWriteAccess"] = rrdacup.DisableKeyBasedMetadataWriteAccess
8600 }
8601 if rrdacup.KeyVaultKeyURI != nil {
8602 objectMap["keyVaultKeyUri"] = rrdacup.KeyVaultKeyURI
8603 }
8604 if rrdacup.DefaultIdentity != nil {
8605 objectMap["defaultIdentity"] = rrdacup.DefaultIdentity
8606 }
8607 if rrdacup.PublicNetworkAccess != "" {
8608 objectMap["publicNetworkAccess"] = rrdacup.PublicNetworkAccess
8609 }
8610 if rrdacup.EnableFreeTier != nil {
8611 objectMap["enableFreeTier"] = rrdacup.EnableFreeTier
8612 }
8613 if rrdacup.APIProperties != nil {
8614 objectMap["apiProperties"] = rrdacup.APIProperties
8615 }
8616 if rrdacup.EnableAnalyticalStorage != nil {
8617 objectMap["enableAnalyticalStorage"] = rrdacup.EnableAnalyticalStorage
8618 }
8619 objectMap["backupPolicy"] = rrdacup.BackupPolicy
8620 if rrdacup.Cors != nil {
8621 objectMap["cors"] = rrdacup.Cors
8622 }
8623 if rrdacup.NetworkACLBypass != "" {
8624 objectMap["networkAclBypass"] = rrdacup.NetworkACLBypass
8625 }
8626 if rrdacup.NetworkACLBypassResourceIds != nil {
8627 objectMap["networkAclBypassResourceIds"] = rrdacup.NetworkACLBypassResourceIds
8628 }
8629 if rrdacup.CreateMode != "" {
8630 objectMap["createMode"] = rrdacup.CreateMode
8631 }
8632 return json.Marshal(objectMap)
8633 }
8634
8635
8636 func (rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties) AsDefaultRequestDatabaseAccountCreateUpdateProperties() (*DefaultRequestDatabaseAccountCreateUpdateProperties, bool) {
8637 return nil, false
8638 }
8639
8640
8641 func (rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties) AsRestoreReqeustDatabaseAccountCreateUpdateProperties() (*RestoreReqeustDatabaseAccountCreateUpdateProperties, bool) {
8642 return &rrdacup, true
8643 }
8644
8645
8646 func (rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties) AsDatabaseAccountCreateUpdateProperties() (*DatabaseAccountCreateUpdateProperties, bool) {
8647 return nil, false
8648 }
8649
8650
8651 func (rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties) AsBasicDatabaseAccountCreateUpdateProperties() (BasicDatabaseAccountCreateUpdateProperties, bool) {
8652 return &rrdacup, true
8653 }
8654
8655
8656 func (rrdacup *RestoreReqeustDatabaseAccountCreateUpdateProperties) UnmarshalJSON(body []byte) error {
8657 var m map[string]*json.RawMessage
8658 err := json.Unmarshal(body, &m)
8659 if err != nil {
8660 return err
8661 }
8662 for k, v := range m {
8663 switch k {
8664 case "restoreParameters":
8665 if v != nil {
8666 var restoreParameters RestoreParameters
8667 err = json.Unmarshal(*v, &restoreParameters)
8668 if err != nil {
8669 return err
8670 }
8671 rrdacup.RestoreParameters = &restoreParameters
8672 }
8673 case "consistencyPolicy":
8674 if v != nil {
8675 var consistencyPolicy ConsistencyPolicy
8676 err = json.Unmarshal(*v, &consistencyPolicy)
8677 if err != nil {
8678 return err
8679 }
8680 rrdacup.ConsistencyPolicy = &consistencyPolicy
8681 }
8682 case "locations":
8683 if v != nil {
8684 var locations []Location
8685 err = json.Unmarshal(*v, &locations)
8686 if err != nil {
8687 return err
8688 }
8689 rrdacup.Locations = &locations
8690 }
8691 case "databaseAccountOfferType":
8692 if v != nil {
8693 var databaseAccountOfferType string
8694 err = json.Unmarshal(*v, &databaseAccountOfferType)
8695 if err != nil {
8696 return err
8697 }
8698 rrdacup.DatabaseAccountOfferType = &databaseAccountOfferType
8699 }
8700 case "ipRules":
8701 if v != nil {
8702 var IPRules []IPAddressOrRange
8703 err = json.Unmarshal(*v, &IPRules)
8704 if err != nil {
8705 return err
8706 }
8707 rrdacup.IPRules = &IPRules
8708 }
8709 case "isVirtualNetworkFilterEnabled":
8710 if v != nil {
8711 var isVirtualNetworkFilterEnabled bool
8712 err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled)
8713 if err != nil {
8714 return err
8715 }
8716 rrdacup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
8717 }
8718 case "enableAutomaticFailover":
8719 if v != nil {
8720 var enableAutomaticFailover bool
8721 err = json.Unmarshal(*v, &enableAutomaticFailover)
8722 if err != nil {
8723 return err
8724 }
8725 rrdacup.EnableAutomaticFailover = &enableAutomaticFailover
8726 }
8727 case "capabilities":
8728 if v != nil {
8729 var capabilities []Capability
8730 err = json.Unmarshal(*v, &capabilities)
8731 if err != nil {
8732 return err
8733 }
8734 rrdacup.Capabilities = &capabilities
8735 }
8736 case "virtualNetworkRules":
8737 if v != nil {
8738 var virtualNetworkRules []VirtualNetworkRule
8739 err = json.Unmarshal(*v, &virtualNetworkRules)
8740 if err != nil {
8741 return err
8742 }
8743 rrdacup.VirtualNetworkRules = &virtualNetworkRules
8744 }
8745 case "enableMultipleWriteLocations":
8746 if v != nil {
8747 var enableMultipleWriteLocations bool
8748 err = json.Unmarshal(*v, &enableMultipleWriteLocations)
8749 if err != nil {
8750 return err
8751 }
8752 rrdacup.EnableMultipleWriteLocations = &enableMultipleWriteLocations
8753 }
8754 case "enableCassandraConnector":
8755 if v != nil {
8756 var enableCassandraConnector bool
8757 err = json.Unmarshal(*v, &enableCassandraConnector)
8758 if err != nil {
8759 return err
8760 }
8761 rrdacup.EnableCassandraConnector = &enableCassandraConnector
8762 }
8763 case "connectorOffer":
8764 if v != nil {
8765 var connectorOffer ConnectorOffer
8766 err = json.Unmarshal(*v, &connectorOffer)
8767 if err != nil {
8768 return err
8769 }
8770 rrdacup.ConnectorOffer = connectorOffer
8771 }
8772 case "disableKeyBasedMetadataWriteAccess":
8773 if v != nil {
8774 var disableKeyBasedMetadataWriteAccess bool
8775 err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess)
8776 if err != nil {
8777 return err
8778 }
8779 rrdacup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
8780 }
8781 case "keyVaultKeyUri":
8782 if v != nil {
8783 var keyVaultKeyURI string
8784 err = json.Unmarshal(*v, &keyVaultKeyURI)
8785 if err != nil {
8786 return err
8787 }
8788 rrdacup.KeyVaultKeyURI = &keyVaultKeyURI
8789 }
8790 case "defaultIdentity":
8791 if v != nil {
8792 var defaultIdentity string
8793 err = json.Unmarshal(*v, &defaultIdentity)
8794 if err != nil {
8795 return err
8796 }
8797 rrdacup.DefaultIdentity = &defaultIdentity
8798 }
8799 case "publicNetworkAccess":
8800 if v != nil {
8801 var publicNetworkAccess PublicNetworkAccess
8802 err = json.Unmarshal(*v, &publicNetworkAccess)
8803 if err != nil {
8804 return err
8805 }
8806 rrdacup.PublicNetworkAccess = publicNetworkAccess
8807 }
8808 case "enableFreeTier":
8809 if v != nil {
8810 var enableFreeTier bool
8811 err = json.Unmarshal(*v, &enableFreeTier)
8812 if err != nil {
8813 return err
8814 }
8815 rrdacup.EnableFreeTier = &enableFreeTier
8816 }
8817 case "apiProperties":
8818 if v != nil {
8819 var APIProperties APIProperties
8820 err = json.Unmarshal(*v, &APIProperties)
8821 if err != nil {
8822 return err
8823 }
8824 rrdacup.APIProperties = &APIProperties
8825 }
8826 case "enableAnalyticalStorage":
8827 if v != nil {
8828 var enableAnalyticalStorage bool
8829 err = json.Unmarshal(*v, &enableAnalyticalStorage)
8830 if err != nil {
8831 return err
8832 }
8833 rrdacup.EnableAnalyticalStorage = &enableAnalyticalStorage
8834 }
8835 case "backupPolicy":
8836 if v != nil {
8837 backupPolicy, err := unmarshalBasicBackupPolicy(*v)
8838 if err != nil {
8839 return err
8840 }
8841 rrdacup.BackupPolicy = backupPolicy
8842 }
8843 case "cors":
8844 if v != nil {
8845 var cors []CorsPolicy
8846 err = json.Unmarshal(*v, &cors)
8847 if err != nil {
8848 return err
8849 }
8850 rrdacup.Cors = &cors
8851 }
8852 case "networkAclBypass":
8853 if v != nil {
8854 var networkACLBypass NetworkACLBypass
8855 err = json.Unmarshal(*v, &networkACLBypass)
8856 if err != nil {
8857 return err
8858 }
8859 rrdacup.NetworkACLBypass = networkACLBypass
8860 }
8861 case "networkAclBypassResourceIds":
8862 if v != nil {
8863 var networkACLBypassResourceIds []string
8864 err = json.Unmarshal(*v, &networkACLBypassResourceIds)
8865 if err != nil {
8866 return err
8867 }
8868 rrdacup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds
8869 }
8870 case "createMode":
8871 if v != nil {
8872 var createMode CreateModeBasicDatabaseAccountCreateUpdateProperties
8873 err = json.Unmarshal(*v, &createMode)
8874 if err != nil {
8875 return err
8876 }
8877 rrdacup.CreateMode = createMode
8878 }
8879 }
8880 }
8881
8882 return nil
8883 }
8884
8885
8886 type SeedNode struct {
8887
8888 IPAddress *string `json:"ipAddress,omitempty"`
8889 }
8890
8891
8892
8893 type ServiceCreateFuture struct {
8894 azure.FutureAPI
8895
8896
8897 Result func(ServiceClient) (ServiceResource, error)
8898 }
8899
8900
8901 func (future *ServiceCreateFuture) UnmarshalJSON(body []byte) error {
8902 var azFuture azure.Future
8903 if err := json.Unmarshal(body, &azFuture); err != nil {
8904 return err
8905 }
8906 future.FutureAPI = &azFuture
8907 future.Result = future.result
8908 return nil
8909 }
8910
8911
8912 func (future *ServiceCreateFuture) result(client ServiceClient) (sr ServiceResource, err error) {
8913 var done bool
8914 done, err = future.DoneWithContext(context.Background(), client)
8915 if err != nil {
8916 err = autorest.NewErrorWithError(err, "documentdb.ServiceCreateFuture", "Result", future.Response(), "Polling failure")
8917 return
8918 }
8919 if !done {
8920 sr.Response.Response = future.Response()
8921 err = azure.NewAsyncOpIncompleteError("documentdb.ServiceCreateFuture")
8922 return
8923 }
8924 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8925 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
8926 sr, err = client.CreateResponder(sr.Response.Response)
8927 if err != nil {
8928 err = autorest.NewErrorWithError(err, "documentdb.ServiceCreateFuture", "Result", sr.Response.Response, "Failure responding to request")
8929 }
8930 }
8931 return
8932 }
8933
8934
8935
8936 type ServiceDeleteFuture struct {
8937 azure.FutureAPI
8938
8939
8940 Result func(ServiceClient) (autorest.Response, error)
8941 }
8942
8943
8944 func (future *ServiceDeleteFuture) UnmarshalJSON(body []byte) error {
8945 var azFuture azure.Future
8946 if err := json.Unmarshal(body, &azFuture); err != nil {
8947 return err
8948 }
8949 future.FutureAPI = &azFuture
8950 future.Result = future.result
8951 return nil
8952 }
8953
8954
8955 func (future *ServiceDeleteFuture) result(client ServiceClient) (ar autorest.Response, err error) {
8956 var done bool
8957 done, err = future.DoneWithContext(context.Background(), client)
8958 if err != nil {
8959 err = autorest.NewErrorWithError(err, "documentdb.ServiceDeleteFuture", "Result", future.Response(), "Polling failure")
8960 return
8961 }
8962 if !done {
8963 ar.Response = future.Response()
8964 err = azure.NewAsyncOpIncompleteError("documentdb.ServiceDeleteFuture")
8965 return
8966 }
8967 ar.Response = future.Response()
8968 return
8969 }
8970
8971
8972 type ServiceResource struct {
8973 autorest.Response `json:"-"`
8974 Properties BasicServiceResourceProperties `json:"properties,omitempty"`
8975
8976 ID *string `json:"id,omitempty"`
8977
8978 Name *string `json:"name,omitempty"`
8979
8980 Type *string `json:"type,omitempty"`
8981 }
8982
8983
8984 func (sr ServiceResource) MarshalJSON() ([]byte, error) {
8985 objectMap := make(map[string]interface{})
8986 objectMap["properties"] = sr.Properties
8987 return json.Marshal(objectMap)
8988 }
8989
8990
8991 func (sr *ServiceResource) UnmarshalJSON(body []byte) error {
8992 var m map[string]*json.RawMessage
8993 err := json.Unmarshal(body, &m)
8994 if err != nil {
8995 return err
8996 }
8997 for k, v := range m {
8998 switch k {
8999 case "properties":
9000 if v != nil {
9001 properties, err := unmarshalBasicServiceResourceProperties(*v)
9002 if err != nil {
9003 return err
9004 }
9005 sr.Properties = properties
9006 }
9007 case "id":
9008 if v != nil {
9009 var ID string
9010 err = json.Unmarshal(*v, &ID)
9011 if err != nil {
9012 return err
9013 }
9014 sr.ID = &ID
9015 }
9016 case "name":
9017 if v != nil {
9018 var name string
9019 err = json.Unmarshal(*v, &name)
9020 if err != nil {
9021 return err
9022 }
9023 sr.Name = &name
9024 }
9025 case "type":
9026 if v != nil {
9027 var typeVar string
9028 err = json.Unmarshal(*v, &typeVar)
9029 if err != nil {
9030 return err
9031 }
9032 sr.Type = &typeVar
9033 }
9034 }
9035 }
9036
9037 return nil
9038 }
9039
9040
9041
9042 type ServiceResourceListResult struct {
9043 autorest.Response `json:"-"`
9044
9045 Value *[]ServiceResource `json:"value,omitempty"`
9046 }
9047
9048
9049 func (srlr ServiceResourceListResult) MarshalJSON() ([]byte, error) {
9050 objectMap := make(map[string]interface{})
9051 return json.Marshal(objectMap)
9052 }
9053
9054
9055 type BasicServiceResourceProperties interface {
9056 AsDataTransferServiceResourceProperties() (*DataTransferServiceResourceProperties, bool)
9057 AsSQLDedicatedGatewayServiceResourceProperties() (*SQLDedicatedGatewayServiceResourceProperties, bool)
9058 AsServiceResourceProperties() (*ServiceResourceProperties, bool)
9059 }
9060
9061
9062 type ServiceResourceProperties struct {
9063
9064 AdditionalProperties map[string]interface{} `json:""`
9065
9066 CreationTime *date.Time `json:"creationTime,omitempty"`
9067
9068 InstanceSize ServiceSize `json:"instanceSize,omitempty"`
9069
9070 InstanceCount *int32 `json:"instanceCount,omitempty"`
9071
9072 Status ServiceStatus `json:"status,omitempty"`
9073
9074 ServiceType ServiceTypeBasicServiceResourceProperties `json:"serviceType,omitempty"`
9075 }
9076
9077 func unmarshalBasicServiceResourceProperties(body []byte) (BasicServiceResourceProperties, error) {
9078 var m map[string]interface{}
9079 err := json.Unmarshal(body, &m)
9080 if err != nil {
9081 return nil, err
9082 }
9083
9084 switch m["serviceType"] {
9085 case string(ServiceTypeBasicServiceResourcePropertiesServiceTypeDataTransferServiceResourceProperties):
9086 var dtsrp DataTransferServiceResourceProperties
9087 err := json.Unmarshal(body, &dtsrp)
9088 return dtsrp, err
9089 case string(ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGatewayServiceResourceProperties):
9090 var sdgsrp SQLDedicatedGatewayServiceResourceProperties
9091 err := json.Unmarshal(body, &sdgsrp)
9092 return sdgsrp, err
9093 default:
9094 var srp ServiceResourceProperties
9095 err := json.Unmarshal(body, &srp)
9096 return srp, err
9097 }
9098 }
9099 func unmarshalBasicServiceResourcePropertiesArray(body []byte) ([]BasicServiceResourceProperties, error) {
9100 var rawMessages []*json.RawMessage
9101 err := json.Unmarshal(body, &rawMessages)
9102 if err != nil {
9103 return nil, err
9104 }
9105
9106 srpArray := make([]BasicServiceResourceProperties, len(rawMessages))
9107
9108 for index, rawMessage := range rawMessages {
9109 srp, err := unmarshalBasicServiceResourceProperties(*rawMessage)
9110 if err != nil {
9111 return nil, err
9112 }
9113 srpArray[index] = srp
9114 }
9115 return srpArray, nil
9116 }
9117
9118
9119 func (srp ServiceResourceProperties) MarshalJSON() ([]byte, error) {
9120 srp.ServiceType = ServiceTypeBasicServiceResourcePropertiesServiceTypeServiceResourceProperties
9121 objectMap := make(map[string]interface{})
9122 if srp.InstanceSize != "" {
9123 objectMap["instanceSize"] = srp.InstanceSize
9124 }
9125 if srp.InstanceCount != nil {
9126 objectMap["instanceCount"] = srp.InstanceCount
9127 }
9128 if srp.ServiceType != "" {
9129 objectMap["serviceType"] = srp.ServiceType
9130 }
9131 for k, v := range srp.AdditionalProperties {
9132 objectMap[k] = v
9133 }
9134 return json.Marshal(objectMap)
9135 }
9136
9137
9138 func (srp ServiceResourceProperties) AsDataTransferServiceResourceProperties() (*DataTransferServiceResourceProperties, bool) {
9139 return nil, false
9140 }
9141
9142
9143 func (srp ServiceResourceProperties) AsSQLDedicatedGatewayServiceResourceProperties() (*SQLDedicatedGatewayServiceResourceProperties, bool) {
9144 return nil, false
9145 }
9146
9147
9148 func (srp ServiceResourceProperties) AsServiceResourceProperties() (*ServiceResourceProperties, bool) {
9149 return &srp, true
9150 }
9151
9152
9153 func (srp ServiceResourceProperties) AsBasicServiceResourceProperties() (BasicServiceResourceProperties, bool) {
9154 return &srp, true
9155 }
9156
9157
9158 func (srp *ServiceResourceProperties) UnmarshalJSON(body []byte) error {
9159 var m map[string]*json.RawMessage
9160 err := json.Unmarshal(body, &m)
9161 if err != nil {
9162 return err
9163 }
9164 for k, v := range m {
9165 switch k {
9166 default:
9167 if v != nil {
9168 var additionalProperties interface{}
9169 err = json.Unmarshal(*v, &additionalProperties)
9170 if err != nil {
9171 return err
9172 }
9173 if srp.AdditionalProperties == nil {
9174 srp.AdditionalProperties = make(map[string]interface{})
9175 }
9176 srp.AdditionalProperties[k] = additionalProperties
9177 }
9178 case "creationTime":
9179 if v != nil {
9180 var creationTime date.Time
9181 err = json.Unmarshal(*v, &creationTime)
9182 if err != nil {
9183 return err
9184 }
9185 srp.CreationTime = &creationTime
9186 }
9187 case "instanceSize":
9188 if v != nil {
9189 var instanceSize ServiceSize
9190 err = json.Unmarshal(*v, &instanceSize)
9191 if err != nil {
9192 return err
9193 }
9194 srp.InstanceSize = instanceSize
9195 }
9196 case "instanceCount":
9197 if v != nil {
9198 var instanceCount int32
9199 err = json.Unmarshal(*v, &instanceCount)
9200 if err != nil {
9201 return err
9202 }
9203 srp.InstanceCount = &instanceCount
9204 }
9205 case "status":
9206 if v != nil {
9207 var status ServiceStatus
9208 err = json.Unmarshal(*v, &status)
9209 if err != nil {
9210 return err
9211 }
9212 srp.Status = status
9213 }
9214 case "serviceType":
9215 if v != nil {
9216 var serviceType ServiceTypeBasicServiceResourceProperties
9217 err = json.Unmarshal(*v, &serviceType)
9218 if err != nil {
9219 return err
9220 }
9221 srp.ServiceType = serviceType
9222 }
9223 }
9224 }
9225
9226 return nil
9227 }
9228
9229
9230 type SpatialSpec struct {
9231
9232 Path *string `json:"path,omitempty"`
9233
9234 Types *[]SpatialType `json:"types,omitempty"`
9235 }
9236
9237
9238 type SQLContainerCreateUpdateParameters struct {
9239
9240 *SQLContainerCreateUpdateProperties `json:"properties,omitempty"`
9241
9242 ID *string `json:"id,omitempty"`
9243
9244 Name *string `json:"name,omitempty"`
9245
9246 Type *string `json:"type,omitempty"`
9247
9248 Location *string `json:"location,omitempty"`
9249 Tags map[string]*string `json:"tags"`
9250 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
9251 }
9252
9253
9254 func (sccup SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) {
9255 objectMap := make(map[string]interface{})
9256 if sccup.SQLContainerCreateUpdateProperties != nil {
9257 objectMap["properties"] = sccup.SQLContainerCreateUpdateProperties
9258 }
9259 if sccup.Location != nil {
9260 objectMap["location"] = sccup.Location
9261 }
9262 if sccup.Tags != nil {
9263 objectMap["tags"] = sccup.Tags
9264 }
9265 if sccup.Identity != nil {
9266 objectMap["identity"] = sccup.Identity
9267 }
9268 return json.Marshal(objectMap)
9269 }
9270
9271
9272 func (sccup *SQLContainerCreateUpdateParameters) UnmarshalJSON(body []byte) error {
9273 var m map[string]*json.RawMessage
9274 err := json.Unmarshal(body, &m)
9275 if err != nil {
9276 return err
9277 }
9278 for k, v := range m {
9279 switch k {
9280 case "properties":
9281 if v != nil {
9282 var SQLContainerCreateUpdateProperties SQLContainerCreateUpdateProperties
9283 err = json.Unmarshal(*v, &SQLContainerCreateUpdateProperties)
9284 if err != nil {
9285 return err
9286 }
9287 sccup.SQLContainerCreateUpdateProperties = &SQLContainerCreateUpdateProperties
9288 }
9289 case "id":
9290 if v != nil {
9291 var ID string
9292 err = json.Unmarshal(*v, &ID)
9293 if err != nil {
9294 return err
9295 }
9296 sccup.ID = &ID
9297 }
9298 case "name":
9299 if v != nil {
9300 var name string
9301 err = json.Unmarshal(*v, &name)
9302 if err != nil {
9303 return err
9304 }
9305 sccup.Name = &name
9306 }
9307 case "type":
9308 if v != nil {
9309 var typeVar string
9310 err = json.Unmarshal(*v, &typeVar)
9311 if err != nil {
9312 return err
9313 }
9314 sccup.Type = &typeVar
9315 }
9316 case "location":
9317 if v != nil {
9318 var location string
9319 err = json.Unmarshal(*v, &location)
9320 if err != nil {
9321 return err
9322 }
9323 sccup.Location = &location
9324 }
9325 case "tags":
9326 if v != nil {
9327 var tags map[string]*string
9328 err = json.Unmarshal(*v, &tags)
9329 if err != nil {
9330 return err
9331 }
9332 sccup.Tags = tags
9333 }
9334 case "identity":
9335 if v != nil {
9336 var identity ManagedServiceIdentity
9337 err = json.Unmarshal(*v, &identity)
9338 if err != nil {
9339 return err
9340 }
9341 sccup.Identity = &identity
9342 }
9343 }
9344 }
9345
9346 return nil
9347 }
9348
9349
9350 type SQLContainerCreateUpdateProperties struct {
9351
9352 Resource *SQLContainerResource `json:"resource,omitempty"`
9353
9354 Options *CreateUpdateOptions `json:"options,omitempty"`
9355 }
9356
9357
9358 type SQLContainerGetProperties struct {
9359 Resource *SQLContainerGetPropertiesResource `json:"resource,omitempty"`
9360 Options *SQLContainerGetPropertiesOptions `json:"options,omitempty"`
9361 }
9362
9363
9364 type SQLContainerGetPropertiesOptions struct {
9365
9366 Throughput *int32 `json:"throughput,omitempty"`
9367
9368 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
9369 }
9370
9371
9372 type SQLContainerGetPropertiesResource struct {
9373
9374 ID *string `json:"id,omitempty"`
9375
9376 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
9377
9378 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
9379
9380 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
9381
9382 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
9383
9384 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
9385
9386 AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"`
9387
9388 Rid *string `json:"_rid,omitempty"`
9389
9390 Ts *float64 `json:"_ts,omitempty"`
9391
9392 Etag *string `json:"_etag,omitempty"`
9393 }
9394
9395
9396 func (scgp SQLContainerGetPropertiesResource) MarshalJSON() ([]byte, error) {
9397 objectMap := make(map[string]interface{})
9398 if scgp.ID != nil {
9399 objectMap["id"] = scgp.ID
9400 }
9401 if scgp.IndexingPolicy != nil {
9402 objectMap["indexingPolicy"] = scgp.IndexingPolicy
9403 }
9404 if scgp.PartitionKey != nil {
9405 objectMap["partitionKey"] = scgp.PartitionKey
9406 }
9407 if scgp.DefaultTTL != nil {
9408 objectMap["defaultTtl"] = scgp.DefaultTTL
9409 }
9410 if scgp.UniqueKeyPolicy != nil {
9411 objectMap["uniqueKeyPolicy"] = scgp.UniqueKeyPolicy
9412 }
9413 if scgp.ConflictResolutionPolicy != nil {
9414 objectMap["conflictResolutionPolicy"] = scgp.ConflictResolutionPolicy
9415 }
9416 if scgp.AnalyticalStorageTTL != nil {
9417 objectMap["analyticalStorageTtl"] = scgp.AnalyticalStorageTTL
9418 }
9419 return json.Marshal(objectMap)
9420 }
9421
9422
9423 type SQLContainerGetResults struct {
9424 autorest.Response `json:"-"`
9425
9426 *SQLContainerGetProperties `json:"properties,omitempty"`
9427
9428 ID *string `json:"id,omitempty"`
9429
9430 Name *string `json:"name,omitempty"`
9431
9432 Type *string `json:"type,omitempty"`
9433
9434 Location *string `json:"location,omitempty"`
9435 Tags map[string]*string `json:"tags"`
9436 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
9437 }
9438
9439
9440 func (scgr SQLContainerGetResults) MarshalJSON() ([]byte, error) {
9441 objectMap := make(map[string]interface{})
9442 if scgr.SQLContainerGetProperties != nil {
9443 objectMap["properties"] = scgr.SQLContainerGetProperties
9444 }
9445 if scgr.Location != nil {
9446 objectMap["location"] = scgr.Location
9447 }
9448 if scgr.Tags != nil {
9449 objectMap["tags"] = scgr.Tags
9450 }
9451 if scgr.Identity != nil {
9452 objectMap["identity"] = scgr.Identity
9453 }
9454 return json.Marshal(objectMap)
9455 }
9456
9457
9458 func (scgr *SQLContainerGetResults) UnmarshalJSON(body []byte) error {
9459 var m map[string]*json.RawMessage
9460 err := json.Unmarshal(body, &m)
9461 if err != nil {
9462 return err
9463 }
9464 for k, v := range m {
9465 switch k {
9466 case "properties":
9467 if v != nil {
9468 var SQLContainerGetProperties SQLContainerGetProperties
9469 err = json.Unmarshal(*v, &SQLContainerGetProperties)
9470 if err != nil {
9471 return err
9472 }
9473 scgr.SQLContainerGetProperties = &SQLContainerGetProperties
9474 }
9475 case "id":
9476 if v != nil {
9477 var ID string
9478 err = json.Unmarshal(*v, &ID)
9479 if err != nil {
9480 return err
9481 }
9482 scgr.ID = &ID
9483 }
9484 case "name":
9485 if v != nil {
9486 var name string
9487 err = json.Unmarshal(*v, &name)
9488 if err != nil {
9489 return err
9490 }
9491 scgr.Name = &name
9492 }
9493 case "type":
9494 if v != nil {
9495 var typeVar string
9496 err = json.Unmarshal(*v, &typeVar)
9497 if err != nil {
9498 return err
9499 }
9500 scgr.Type = &typeVar
9501 }
9502 case "location":
9503 if v != nil {
9504 var location string
9505 err = json.Unmarshal(*v, &location)
9506 if err != nil {
9507 return err
9508 }
9509 scgr.Location = &location
9510 }
9511 case "tags":
9512 if v != nil {
9513 var tags map[string]*string
9514 err = json.Unmarshal(*v, &tags)
9515 if err != nil {
9516 return err
9517 }
9518 scgr.Tags = tags
9519 }
9520 case "identity":
9521 if v != nil {
9522 var identity ManagedServiceIdentity
9523 err = json.Unmarshal(*v, &identity)
9524 if err != nil {
9525 return err
9526 }
9527 scgr.Identity = &identity
9528 }
9529 }
9530 }
9531
9532 return nil
9533 }
9534
9535
9536 type SQLContainerListResult struct {
9537 autorest.Response `json:"-"`
9538
9539 Value *[]SQLContainerGetResults `json:"value,omitempty"`
9540 }
9541
9542
9543 func (sclr SQLContainerListResult) MarshalJSON() ([]byte, error) {
9544 objectMap := make(map[string]interface{})
9545 return json.Marshal(objectMap)
9546 }
9547
9548
9549 type SQLContainerResource struct {
9550
9551 ID *string `json:"id,omitempty"`
9552
9553 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
9554
9555 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
9556
9557 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
9558
9559 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
9560
9561 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
9562
9563 AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"`
9564 }
9565
9566
9567 type SQLDatabaseCreateUpdateParameters struct {
9568
9569 *SQLDatabaseCreateUpdateProperties `json:"properties,omitempty"`
9570
9571 ID *string `json:"id,omitempty"`
9572
9573 Name *string `json:"name,omitempty"`
9574
9575 Type *string `json:"type,omitempty"`
9576
9577 Location *string `json:"location,omitempty"`
9578 Tags map[string]*string `json:"tags"`
9579 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
9580 }
9581
9582
9583 func (sdcup SQLDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) {
9584 objectMap := make(map[string]interface{})
9585 if sdcup.SQLDatabaseCreateUpdateProperties != nil {
9586 objectMap["properties"] = sdcup.SQLDatabaseCreateUpdateProperties
9587 }
9588 if sdcup.Location != nil {
9589 objectMap["location"] = sdcup.Location
9590 }
9591 if sdcup.Tags != nil {
9592 objectMap["tags"] = sdcup.Tags
9593 }
9594 if sdcup.Identity != nil {
9595 objectMap["identity"] = sdcup.Identity
9596 }
9597 return json.Marshal(objectMap)
9598 }
9599
9600
9601 func (sdcup *SQLDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error {
9602 var m map[string]*json.RawMessage
9603 err := json.Unmarshal(body, &m)
9604 if err != nil {
9605 return err
9606 }
9607 for k, v := range m {
9608 switch k {
9609 case "properties":
9610 if v != nil {
9611 var SQLDatabaseCreateUpdateProperties SQLDatabaseCreateUpdateProperties
9612 err = json.Unmarshal(*v, &SQLDatabaseCreateUpdateProperties)
9613 if err != nil {
9614 return err
9615 }
9616 sdcup.SQLDatabaseCreateUpdateProperties = &SQLDatabaseCreateUpdateProperties
9617 }
9618 case "id":
9619 if v != nil {
9620 var ID string
9621 err = json.Unmarshal(*v, &ID)
9622 if err != nil {
9623 return err
9624 }
9625 sdcup.ID = &ID
9626 }
9627 case "name":
9628 if v != nil {
9629 var name string
9630 err = json.Unmarshal(*v, &name)
9631 if err != nil {
9632 return err
9633 }
9634 sdcup.Name = &name
9635 }
9636 case "type":
9637 if v != nil {
9638 var typeVar string
9639 err = json.Unmarshal(*v, &typeVar)
9640 if err != nil {
9641 return err
9642 }
9643 sdcup.Type = &typeVar
9644 }
9645 case "location":
9646 if v != nil {
9647 var location string
9648 err = json.Unmarshal(*v, &location)
9649 if err != nil {
9650 return err
9651 }
9652 sdcup.Location = &location
9653 }
9654 case "tags":
9655 if v != nil {
9656 var tags map[string]*string
9657 err = json.Unmarshal(*v, &tags)
9658 if err != nil {
9659 return err
9660 }
9661 sdcup.Tags = tags
9662 }
9663 case "identity":
9664 if v != nil {
9665 var identity ManagedServiceIdentity
9666 err = json.Unmarshal(*v, &identity)
9667 if err != nil {
9668 return err
9669 }
9670 sdcup.Identity = &identity
9671 }
9672 }
9673 }
9674
9675 return nil
9676 }
9677
9678
9679 type SQLDatabaseCreateUpdateProperties struct {
9680
9681 Resource *SQLDatabaseResource `json:"resource,omitempty"`
9682
9683 Options *CreateUpdateOptions `json:"options,omitempty"`
9684 }
9685
9686
9687 type SQLDatabaseGetProperties struct {
9688 Resource *SQLDatabaseGetPropertiesResource `json:"resource,omitempty"`
9689 Options *SQLDatabaseGetPropertiesOptions `json:"options,omitempty"`
9690 }
9691
9692
9693 type SQLDatabaseGetPropertiesOptions struct {
9694
9695 Throughput *int32 `json:"throughput,omitempty"`
9696
9697 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
9698 }
9699
9700
9701 type SQLDatabaseGetPropertiesResource struct {
9702
9703 ID *string `json:"id,omitempty"`
9704
9705 Rid *string `json:"_rid,omitempty"`
9706
9707 Ts *float64 `json:"_ts,omitempty"`
9708
9709 Etag *string `json:"_etag,omitempty"`
9710
9711 Colls *string `json:"_colls,omitempty"`
9712
9713 Users *string `json:"_users,omitempty"`
9714 }
9715
9716
9717 func (sdgp SQLDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) {
9718 objectMap := make(map[string]interface{})
9719 if sdgp.ID != nil {
9720 objectMap["id"] = sdgp.ID
9721 }
9722 if sdgp.Colls != nil {
9723 objectMap["_colls"] = sdgp.Colls
9724 }
9725 if sdgp.Users != nil {
9726 objectMap["_users"] = sdgp.Users
9727 }
9728 return json.Marshal(objectMap)
9729 }
9730
9731
9732 type SQLDatabaseGetResults struct {
9733 autorest.Response `json:"-"`
9734
9735 *SQLDatabaseGetProperties `json:"properties,omitempty"`
9736
9737 ID *string `json:"id,omitempty"`
9738
9739 Name *string `json:"name,omitempty"`
9740
9741 Type *string `json:"type,omitempty"`
9742
9743 Location *string `json:"location,omitempty"`
9744 Tags map[string]*string `json:"tags"`
9745 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
9746 }
9747
9748
9749 func (sdgr SQLDatabaseGetResults) MarshalJSON() ([]byte, error) {
9750 objectMap := make(map[string]interface{})
9751 if sdgr.SQLDatabaseGetProperties != nil {
9752 objectMap["properties"] = sdgr.SQLDatabaseGetProperties
9753 }
9754 if sdgr.Location != nil {
9755 objectMap["location"] = sdgr.Location
9756 }
9757 if sdgr.Tags != nil {
9758 objectMap["tags"] = sdgr.Tags
9759 }
9760 if sdgr.Identity != nil {
9761 objectMap["identity"] = sdgr.Identity
9762 }
9763 return json.Marshal(objectMap)
9764 }
9765
9766
9767 func (sdgr *SQLDatabaseGetResults) UnmarshalJSON(body []byte) error {
9768 var m map[string]*json.RawMessage
9769 err := json.Unmarshal(body, &m)
9770 if err != nil {
9771 return err
9772 }
9773 for k, v := range m {
9774 switch k {
9775 case "properties":
9776 if v != nil {
9777 var SQLDatabaseGetProperties SQLDatabaseGetProperties
9778 err = json.Unmarshal(*v, &SQLDatabaseGetProperties)
9779 if err != nil {
9780 return err
9781 }
9782 sdgr.SQLDatabaseGetProperties = &SQLDatabaseGetProperties
9783 }
9784 case "id":
9785 if v != nil {
9786 var ID string
9787 err = json.Unmarshal(*v, &ID)
9788 if err != nil {
9789 return err
9790 }
9791 sdgr.ID = &ID
9792 }
9793 case "name":
9794 if v != nil {
9795 var name string
9796 err = json.Unmarshal(*v, &name)
9797 if err != nil {
9798 return err
9799 }
9800 sdgr.Name = &name
9801 }
9802 case "type":
9803 if v != nil {
9804 var typeVar string
9805 err = json.Unmarshal(*v, &typeVar)
9806 if err != nil {
9807 return err
9808 }
9809 sdgr.Type = &typeVar
9810 }
9811 case "location":
9812 if v != nil {
9813 var location string
9814 err = json.Unmarshal(*v, &location)
9815 if err != nil {
9816 return err
9817 }
9818 sdgr.Location = &location
9819 }
9820 case "tags":
9821 if v != nil {
9822 var tags map[string]*string
9823 err = json.Unmarshal(*v, &tags)
9824 if err != nil {
9825 return err
9826 }
9827 sdgr.Tags = tags
9828 }
9829 case "identity":
9830 if v != nil {
9831 var identity ManagedServiceIdentity
9832 err = json.Unmarshal(*v, &identity)
9833 if err != nil {
9834 return err
9835 }
9836 sdgr.Identity = &identity
9837 }
9838 }
9839 }
9840
9841 return nil
9842 }
9843
9844
9845 type SQLDatabaseListResult struct {
9846 autorest.Response `json:"-"`
9847
9848 Value *[]SQLDatabaseGetResults `json:"value,omitempty"`
9849 }
9850
9851
9852 func (sdlr SQLDatabaseListResult) MarshalJSON() ([]byte, error) {
9853 objectMap := make(map[string]interface{})
9854 return json.Marshal(objectMap)
9855 }
9856
9857
9858 type SQLDatabaseResource struct {
9859
9860 ID *string `json:"id,omitempty"`
9861 }
9862
9863
9864 type SQLDedicatedGatewayRegionalServiceResource struct {
9865
9866 SQLDedicatedGatewayEndpoint *string `json:"sqlDedicatedGatewayEndpoint,omitempty"`
9867
9868 Name *string `json:"name,omitempty"`
9869
9870 Location *string `json:"location,omitempty"`
9871
9872 Status ServiceStatus `json:"status,omitempty"`
9873 }
9874
9875
9876 func (sdgrsr SQLDedicatedGatewayRegionalServiceResource) MarshalJSON() ([]byte, error) {
9877 objectMap := make(map[string]interface{})
9878 return json.Marshal(objectMap)
9879 }
9880
9881
9882 type SQLDedicatedGatewayServiceResource struct {
9883 Properties *SQLDedicatedGatewayServiceResourceProperties `json:"properties,omitempty"`
9884 }
9885
9886
9887 type SQLDedicatedGatewayServiceResourceProperties struct {
9888
9889 SQLDedicatedGatewayEndpoint *string `json:"sqlDedicatedGatewayEndpoint,omitempty"`
9890
9891 Locations *[]SQLDedicatedGatewayRegionalServiceResource `json:"locations,omitempty"`
9892
9893 AdditionalProperties map[string]interface{} `json:""`
9894
9895 CreationTime *date.Time `json:"creationTime,omitempty"`
9896
9897 InstanceSize ServiceSize `json:"instanceSize,omitempty"`
9898
9899 InstanceCount *int32 `json:"instanceCount,omitempty"`
9900
9901 Status ServiceStatus `json:"status,omitempty"`
9902
9903 ServiceType ServiceTypeBasicServiceResourceProperties `json:"serviceType,omitempty"`
9904 }
9905
9906
9907 func (sdgsrp SQLDedicatedGatewayServiceResourceProperties) MarshalJSON() ([]byte, error) {
9908 sdgsrp.ServiceType = ServiceTypeBasicServiceResourcePropertiesServiceTypeSQLDedicatedGatewayServiceResourceProperties
9909 objectMap := make(map[string]interface{})
9910 if sdgsrp.SQLDedicatedGatewayEndpoint != nil {
9911 objectMap["sqlDedicatedGatewayEndpoint"] = sdgsrp.SQLDedicatedGatewayEndpoint
9912 }
9913 if sdgsrp.InstanceSize != "" {
9914 objectMap["instanceSize"] = sdgsrp.InstanceSize
9915 }
9916 if sdgsrp.InstanceCount != nil {
9917 objectMap["instanceCount"] = sdgsrp.InstanceCount
9918 }
9919 if sdgsrp.ServiceType != "" {
9920 objectMap["serviceType"] = sdgsrp.ServiceType
9921 }
9922 for k, v := range sdgsrp.AdditionalProperties {
9923 objectMap[k] = v
9924 }
9925 return json.Marshal(objectMap)
9926 }
9927
9928
9929 func (sdgsrp SQLDedicatedGatewayServiceResourceProperties) AsDataTransferServiceResourceProperties() (*DataTransferServiceResourceProperties, bool) {
9930 return nil, false
9931 }
9932
9933
9934 func (sdgsrp SQLDedicatedGatewayServiceResourceProperties) AsSQLDedicatedGatewayServiceResourceProperties() (*SQLDedicatedGatewayServiceResourceProperties, bool) {
9935 return &sdgsrp, true
9936 }
9937
9938
9939 func (sdgsrp SQLDedicatedGatewayServiceResourceProperties) AsServiceResourceProperties() (*ServiceResourceProperties, bool) {
9940 return nil, false
9941 }
9942
9943
9944 func (sdgsrp SQLDedicatedGatewayServiceResourceProperties) AsBasicServiceResourceProperties() (BasicServiceResourceProperties, bool) {
9945 return &sdgsrp, true
9946 }
9947
9948
9949 func (sdgsrp *SQLDedicatedGatewayServiceResourceProperties) UnmarshalJSON(body []byte) error {
9950 var m map[string]*json.RawMessage
9951 err := json.Unmarshal(body, &m)
9952 if err != nil {
9953 return err
9954 }
9955 for k, v := range m {
9956 switch k {
9957 case "sqlDedicatedGatewayEndpoint":
9958 if v != nil {
9959 var SQLDedicatedGatewayEndpoint string
9960 err = json.Unmarshal(*v, &SQLDedicatedGatewayEndpoint)
9961 if err != nil {
9962 return err
9963 }
9964 sdgsrp.SQLDedicatedGatewayEndpoint = &SQLDedicatedGatewayEndpoint
9965 }
9966 case "locations":
9967 if v != nil {
9968 var locations []SQLDedicatedGatewayRegionalServiceResource
9969 err = json.Unmarshal(*v, &locations)
9970 if err != nil {
9971 return err
9972 }
9973 sdgsrp.Locations = &locations
9974 }
9975 default:
9976 if v != nil {
9977 var additionalProperties interface{}
9978 err = json.Unmarshal(*v, &additionalProperties)
9979 if err != nil {
9980 return err
9981 }
9982 if sdgsrp.AdditionalProperties == nil {
9983 sdgsrp.AdditionalProperties = make(map[string]interface{})
9984 }
9985 sdgsrp.AdditionalProperties[k] = additionalProperties
9986 }
9987 case "creationTime":
9988 if v != nil {
9989 var creationTime date.Time
9990 err = json.Unmarshal(*v, &creationTime)
9991 if err != nil {
9992 return err
9993 }
9994 sdgsrp.CreationTime = &creationTime
9995 }
9996 case "instanceSize":
9997 if v != nil {
9998 var instanceSize ServiceSize
9999 err = json.Unmarshal(*v, &instanceSize)
10000 if err != nil {
10001 return err
10002 }
10003 sdgsrp.InstanceSize = instanceSize
10004 }
10005 case "instanceCount":
10006 if v != nil {
10007 var instanceCount int32
10008 err = json.Unmarshal(*v, &instanceCount)
10009 if err != nil {
10010 return err
10011 }
10012 sdgsrp.InstanceCount = &instanceCount
10013 }
10014 case "status":
10015 if v != nil {
10016 var status ServiceStatus
10017 err = json.Unmarshal(*v, &status)
10018 if err != nil {
10019 return err
10020 }
10021 sdgsrp.Status = status
10022 }
10023 case "serviceType":
10024 if v != nil {
10025 var serviceType ServiceTypeBasicServiceResourceProperties
10026 err = json.Unmarshal(*v, &serviceType)
10027 if err != nil {
10028 return err
10029 }
10030 sdgsrp.ServiceType = serviceType
10031 }
10032 }
10033 }
10034
10035 return nil
10036 }
10037
10038
10039
10040 type SQLResourcesCreateUpdateSQLContainerFuture struct {
10041 azure.FutureAPI
10042
10043
10044 Result func(SQLResourcesClient) (SQLContainerGetResults, error)
10045 }
10046
10047
10048 func (future *SQLResourcesCreateUpdateSQLContainerFuture) UnmarshalJSON(body []byte) error {
10049 var azFuture azure.Future
10050 if err := json.Unmarshal(body, &azFuture); err != nil {
10051 return err
10052 }
10053 future.FutureAPI = &azFuture
10054 future.Result = future.result
10055 return nil
10056 }
10057
10058
10059 func (future *SQLResourcesCreateUpdateSQLContainerFuture) result(client SQLResourcesClient) (scgr SQLContainerGetResults, err error) {
10060 var done bool
10061 done, err = future.DoneWithContext(context.Background(), client)
10062 if err != nil {
10063 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", future.Response(), "Polling failure")
10064 return
10065 }
10066 if !done {
10067 scgr.Response.Response = future.Response()
10068 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLContainerFuture")
10069 return
10070 }
10071 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10072 if scgr.Response.Response, err = future.GetResult(sender); err == nil && scgr.Response.Response.StatusCode != http.StatusNoContent {
10073 scgr, err = client.CreateUpdateSQLContainerResponder(scgr.Response.Response)
10074 if err != nil {
10075 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", scgr.Response.Response, "Failure responding to request")
10076 }
10077 }
10078 return
10079 }
10080
10081
10082
10083 type SQLResourcesCreateUpdateSQLDatabaseFuture struct {
10084 azure.FutureAPI
10085
10086
10087 Result func(SQLResourcesClient) (SQLDatabaseGetResults, error)
10088 }
10089
10090
10091 func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) UnmarshalJSON(body []byte) error {
10092 var azFuture azure.Future
10093 if err := json.Unmarshal(body, &azFuture); err != nil {
10094 return err
10095 }
10096 future.FutureAPI = &azFuture
10097 future.Result = future.result
10098 return nil
10099 }
10100
10101
10102 func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) result(client SQLResourcesClient) (sdgr SQLDatabaseGetResults, err error) {
10103 var done bool
10104 done, err = future.DoneWithContext(context.Background(), client)
10105 if err != nil {
10106 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", future.Response(), "Polling failure")
10107 return
10108 }
10109 if !done {
10110 sdgr.Response.Response = future.Response()
10111 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture")
10112 return
10113 }
10114 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10115 if sdgr.Response.Response, err = future.GetResult(sender); err == nil && sdgr.Response.Response.StatusCode != http.StatusNoContent {
10116 sdgr, err = client.CreateUpdateSQLDatabaseResponder(sdgr.Response.Response)
10117 if err != nil {
10118 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", sdgr.Response.Response, "Failure responding to request")
10119 }
10120 }
10121 return
10122 }
10123
10124
10125
10126 type SQLResourcesCreateUpdateSQLRoleAssignmentFuture struct {
10127 azure.FutureAPI
10128
10129
10130 Result func(SQLResourcesClient) (SQLRoleAssignmentGetResults, error)
10131 }
10132
10133
10134 func (future *SQLResourcesCreateUpdateSQLRoleAssignmentFuture) UnmarshalJSON(body []byte) error {
10135 var azFuture azure.Future
10136 if err := json.Unmarshal(body, &azFuture); err != nil {
10137 return err
10138 }
10139 future.FutureAPI = &azFuture
10140 future.Result = future.result
10141 return nil
10142 }
10143
10144
10145 func (future *SQLResourcesCreateUpdateSQLRoleAssignmentFuture) result(client SQLResourcesClient) (sragr SQLRoleAssignmentGetResults, err error) {
10146 var done bool
10147 done, err = future.DoneWithContext(context.Background(), client)
10148 if err != nil {
10149 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture", "Result", future.Response(), "Polling failure")
10150 return
10151 }
10152 if !done {
10153 sragr.Response.Response = future.Response()
10154 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture")
10155 return
10156 }
10157 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10158 if sragr.Response.Response, err = future.GetResult(sender); err == nil && sragr.Response.Response.StatusCode != http.StatusNoContent {
10159 sragr, err = client.CreateUpdateSQLRoleAssignmentResponder(sragr.Response.Response)
10160 if err != nil {
10161 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture", "Result", sragr.Response.Response, "Failure responding to request")
10162 }
10163 }
10164 return
10165 }
10166
10167
10168
10169 type SQLResourcesCreateUpdateSQLRoleDefinitionFuture struct {
10170 azure.FutureAPI
10171
10172
10173 Result func(SQLResourcesClient) (SQLRoleDefinitionGetResults, error)
10174 }
10175
10176
10177 func (future *SQLResourcesCreateUpdateSQLRoleDefinitionFuture) UnmarshalJSON(body []byte) error {
10178 var azFuture azure.Future
10179 if err := json.Unmarshal(body, &azFuture); err != nil {
10180 return err
10181 }
10182 future.FutureAPI = &azFuture
10183 future.Result = future.result
10184 return nil
10185 }
10186
10187
10188 func (future *SQLResourcesCreateUpdateSQLRoleDefinitionFuture) result(client SQLResourcesClient) (srdgr SQLRoleDefinitionGetResults, err error) {
10189 var done bool
10190 done, err = future.DoneWithContext(context.Background(), client)
10191 if err != nil {
10192 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture", "Result", future.Response(), "Polling failure")
10193 return
10194 }
10195 if !done {
10196 srdgr.Response.Response = future.Response()
10197 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture")
10198 return
10199 }
10200 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10201 if srdgr.Response.Response, err = future.GetResult(sender); err == nil && srdgr.Response.Response.StatusCode != http.StatusNoContent {
10202 srdgr, err = client.CreateUpdateSQLRoleDefinitionResponder(srdgr.Response.Response)
10203 if err != nil {
10204 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture", "Result", srdgr.Response.Response, "Failure responding to request")
10205 }
10206 }
10207 return
10208 }
10209
10210
10211
10212 type SQLResourcesCreateUpdateSQLStoredProcedureFuture struct {
10213 azure.FutureAPI
10214
10215
10216 Result func(SQLResourcesClient) (SQLStoredProcedureGetResults, error)
10217 }
10218
10219
10220 func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error {
10221 var azFuture azure.Future
10222 if err := json.Unmarshal(body, &azFuture); err != nil {
10223 return err
10224 }
10225 future.FutureAPI = &azFuture
10226 future.Result = future.result
10227 return nil
10228 }
10229
10230
10231 func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) result(client SQLResourcesClient) (sspgr SQLStoredProcedureGetResults, err error) {
10232 var done bool
10233 done, err = future.DoneWithContext(context.Background(), client)
10234 if err != nil {
10235 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure")
10236 return
10237 }
10238 if !done {
10239 sspgr.Response.Response = future.Response()
10240 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture")
10241 return
10242 }
10243 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10244 if sspgr.Response.Response, err = future.GetResult(sender); err == nil && sspgr.Response.Response.StatusCode != http.StatusNoContent {
10245 sspgr, err = client.CreateUpdateSQLStoredProcedureResponder(sspgr.Response.Response)
10246 if err != nil {
10247 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", sspgr.Response.Response, "Failure responding to request")
10248 }
10249 }
10250 return
10251 }
10252
10253
10254
10255 type SQLResourcesCreateUpdateSQLTriggerFuture struct {
10256 azure.FutureAPI
10257
10258
10259 Result func(SQLResourcesClient) (SQLTriggerGetResults, error)
10260 }
10261
10262
10263 func (future *SQLResourcesCreateUpdateSQLTriggerFuture) UnmarshalJSON(body []byte) error {
10264 var azFuture azure.Future
10265 if err := json.Unmarshal(body, &azFuture); err != nil {
10266 return err
10267 }
10268 future.FutureAPI = &azFuture
10269 future.Result = future.result
10270 return nil
10271 }
10272
10273
10274 func (future *SQLResourcesCreateUpdateSQLTriggerFuture) result(client SQLResourcesClient) (stgr SQLTriggerGetResults, err error) {
10275 var done bool
10276 done, err = future.DoneWithContext(context.Background(), client)
10277 if err != nil {
10278 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", future.Response(), "Polling failure")
10279 return
10280 }
10281 if !done {
10282 stgr.Response.Response = future.Response()
10283 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLTriggerFuture")
10284 return
10285 }
10286 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10287 if stgr.Response.Response, err = future.GetResult(sender); err == nil && stgr.Response.Response.StatusCode != http.StatusNoContent {
10288 stgr, err = client.CreateUpdateSQLTriggerResponder(stgr.Response.Response)
10289 if err != nil {
10290 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", stgr.Response.Response, "Failure responding to request")
10291 }
10292 }
10293 return
10294 }
10295
10296
10297
10298 type SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture struct {
10299 azure.FutureAPI
10300
10301
10302 Result func(SQLResourcesClient) (SQLUserDefinedFunctionGetResults, error)
10303 }
10304
10305
10306 func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error {
10307 var azFuture azure.Future
10308 if err := json.Unmarshal(body, &azFuture); err != nil {
10309 return err
10310 }
10311 future.FutureAPI = &azFuture
10312 future.Result = future.result
10313 return nil
10314 }
10315
10316
10317 func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (sudfgr SQLUserDefinedFunctionGetResults, err error) {
10318 var done bool
10319 done, err = future.DoneWithContext(context.Background(), client)
10320 if err != nil {
10321 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure")
10322 return
10323 }
10324 if !done {
10325 sudfgr.Response.Response = future.Response()
10326 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture")
10327 return
10328 }
10329 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10330 if sudfgr.Response.Response, err = future.GetResult(sender); err == nil && sudfgr.Response.Response.StatusCode != http.StatusNoContent {
10331 sudfgr, err = client.CreateUpdateSQLUserDefinedFunctionResponder(sudfgr.Response.Response)
10332 if err != nil {
10333 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", sudfgr.Response.Response, "Failure responding to request")
10334 }
10335 }
10336 return
10337 }
10338
10339
10340
10341 type SQLResourcesDeleteSQLContainerFuture struct {
10342 azure.FutureAPI
10343
10344
10345 Result func(SQLResourcesClient) (autorest.Response, error)
10346 }
10347
10348
10349 func (future *SQLResourcesDeleteSQLContainerFuture) UnmarshalJSON(body []byte) error {
10350 var azFuture azure.Future
10351 if err := json.Unmarshal(body, &azFuture); err != nil {
10352 return err
10353 }
10354 future.FutureAPI = &azFuture
10355 future.Result = future.result
10356 return nil
10357 }
10358
10359
10360 func (future *SQLResourcesDeleteSQLContainerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
10361 var done bool
10362 done, err = future.DoneWithContext(context.Background(), client)
10363 if err != nil {
10364 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLContainerFuture", "Result", future.Response(), "Polling failure")
10365 return
10366 }
10367 if !done {
10368 ar.Response = future.Response()
10369 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLContainerFuture")
10370 return
10371 }
10372 ar.Response = future.Response()
10373 return
10374 }
10375
10376
10377
10378 type SQLResourcesDeleteSQLDatabaseFuture struct {
10379 azure.FutureAPI
10380
10381
10382 Result func(SQLResourcesClient) (autorest.Response, error)
10383 }
10384
10385
10386 func (future *SQLResourcesDeleteSQLDatabaseFuture) UnmarshalJSON(body []byte) error {
10387 var azFuture azure.Future
10388 if err := json.Unmarshal(body, &azFuture); err != nil {
10389 return err
10390 }
10391 future.FutureAPI = &azFuture
10392 future.Result = future.result
10393 return nil
10394 }
10395
10396
10397 func (future *SQLResourcesDeleteSQLDatabaseFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
10398 var done bool
10399 done, err = future.DoneWithContext(context.Background(), client)
10400 if err != nil {
10401 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLDatabaseFuture", "Result", future.Response(), "Polling failure")
10402 return
10403 }
10404 if !done {
10405 ar.Response = future.Response()
10406 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLDatabaseFuture")
10407 return
10408 }
10409 ar.Response = future.Response()
10410 return
10411 }
10412
10413
10414
10415 type SQLResourcesDeleteSQLRoleAssignmentFuture struct {
10416 azure.FutureAPI
10417
10418
10419 Result func(SQLResourcesClient) (autorest.Response, error)
10420 }
10421
10422
10423 func (future *SQLResourcesDeleteSQLRoleAssignmentFuture) UnmarshalJSON(body []byte) error {
10424 var azFuture azure.Future
10425 if err := json.Unmarshal(body, &azFuture); err != nil {
10426 return err
10427 }
10428 future.FutureAPI = &azFuture
10429 future.Result = future.result
10430 return nil
10431 }
10432
10433
10434 func (future *SQLResourcesDeleteSQLRoleAssignmentFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
10435 var done bool
10436 done, err = future.DoneWithContext(context.Background(), client)
10437 if err != nil {
10438 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLRoleAssignmentFuture", "Result", future.Response(), "Polling failure")
10439 return
10440 }
10441 if !done {
10442 ar.Response = future.Response()
10443 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLRoleAssignmentFuture")
10444 return
10445 }
10446 ar.Response = future.Response()
10447 return
10448 }
10449
10450
10451
10452 type SQLResourcesDeleteSQLRoleDefinitionFuture struct {
10453 azure.FutureAPI
10454
10455
10456 Result func(SQLResourcesClient) (autorest.Response, error)
10457 }
10458
10459
10460 func (future *SQLResourcesDeleteSQLRoleDefinitionFuture) UnmarshalJSON(body []byte) error {
10461 var azFuture azure.Future
10462 if err := json.Unmarshal(body, &azFuture); err != nil {
10463 return err
10464 }
10465 future.FutureAPI = &azFuture
10466 future.Result = future.result
10467 return nil
10468 }
10469
10470
10471 func (future *SQLResourcesDeleteSQLRoleDefinitionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
10472 var done bool
10473 done, err = future.DoneWithContext(context.Background(), client)
10474 if err != nil {
10475 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLRoleDefinitionFuture", "Result", future.Response(), "Polling failure")
10476 return
10477 }
10478 if !done {
10479 ar.Response = future.Response()
10480 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLRoleDefinitionFuture")
10481 return
10482 }
10483 ar.Response = future.Response()
10484 return
10485 }
10486
10487
10488
10489 type SQLResourcesDeleteSQLStoredProcedureFuture struct {
10490 azure.FutureAPI
10491
10492
10493 Result func(SQLResourcesClient) (autorest.Response, error)
10494 }
10495
10496
10497 func (future *SQLResourcesDeleteSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error {
10498 var azFuture azure.Future
10499 if err := json.Unmarshal(body, &azFuture); err != nil {
10500 return err
10501 }
10502 future.FutureAPI = &azFuture
10503 future.Result = future.result
10504 return nil
10505 }
10506
10507
10508 func (future *SQLResourcesDeleteSQLStoredProcedureFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
10509 var done bool
10510 done, err = future.DoneWithContext(context.Background(), client)
10511 if err != nil {
10512 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure")
10513 return
10514 }
10515 if !done {
10516 ar.Response = future.Response()
10517 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLStoredProcedureFuture")
10518 return
10519 }
10520 ar.Response = future.Response()
10521 return
10522 }
10523
10524
10525
10526 type SQLResourcesDeleteSQLTriggerFuture struct {
10527 azure.FutureAPI
10528
10529
10530 Result func(SQLResourcesClient) (autorest.Response, error)
10531 }
10532
10533
10534 func (future *SQLResourcesDeleteSQLTriggerFuture) UnmarshalJSON(body []byte) error {
10535 var azFuture azure.Future
10536 if err := json.Unmarshal(body, &azFuture); err != nil {
10537 return err
10538 }
10539 future.FutureAPI = &azFuture
10540 future.Result = future.result
10541 return nil
10542 }
10543
10544
10545 func (future *SQLResourcesDeleteSQLTriggerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
10546 var done bool
10547 done, err = future.DoneWithContext(context.Background(), client)
10548 if err != nil {
10549 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLTriggerFuture", "Result", future.Response(), "Polling failure")
10550 return
10551 }
10552 if !done {
10553 ar.Response = future.Response()
10554 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLTriggerFuture")
10555 return
10556 }
10557 ar.Response = future.Response()
10558 return
10559 }
10560
10561
10562
10563 type SQLResourcesDeleteSQLUserDefinedFunctionFuture struct {
10564 azure.FutureAPI
10565
10566
10567 Result func(SQLResourcesClient) (autorest.Response, error)
10568 }
10569
10570
10571 func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error {
10572 var azFuture azure.Future
10573 if err := json.Unmarshal(body, &azFuture); err != nil {
10574 return err
10575 }
10576 future.FutureAPI = &azFuture
10577 future.Result = future.result
10578 return nil
10579 }
10580
10581
10582 func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
10583 var done bool
10584 done, err = future.DoneWithContext(context.Background(), client)
10585 if err != nil {
10586 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure")
10587 return
10588 }
10589 if !done {
10590 ar.Response = future.Response()
10591 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture")
10592 return
10593 }
10594 ar.Response = future.Response()
10595 return
10596 }
10597
10598
10599
10600 type SQLResourcesMigrateSQLContainerToAutoscaleFuture struct {
10601 azure.FutureAPI
10602
10603
10604 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
10605 }
10606
10607
10608 func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) UnmarshalJSON(body []byte) error {
10609 var azFuture azure.Future
10610 if err := json.Unmarshal(body, &azFuture); err != nil {
10611 return err
10612 }
10613 future.FutureAPI = &azFuture
10614 future.Result = future.result
10615 return nil
10616 }
10617
10618
10619 func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
10620 var done bool
10621 done, err = future.DoneWithContext(context.Background(), client)
10622 if err != nil {
10623 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", future.Response(), "Polling failure")
10624 return
10625 }
10626 if !done {
10627 tsgr.Response.Response = future.Response()
10628 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture")
10629 return
10630 }
10631 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10632 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
10633 tsgr, err = client.MigrateSQLContainerToAutoscaleResponder(tsgr.Response.Response)
10634 if err != nil {
10635 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
10636 }
10637 }
10638 return
10639 }
10640
10641
10642
10643 type SQLResourcesMigrateSQLContainerToManualThroughputFuture struct {
10644 azure.FutureAPI
10645
10646
10647 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
10648 }
10649
10650
10651 func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) UnmarshalJSON(body []byte) error {
10652 var azFuture azure.Future
10653 if err := json.Unmarshal(body, &azFuture); err != nil {
10654 return err
10655 }
10656 future.FutureAPI = &azFuture
10657 future.Result = future.result
10658 return nil
10659 }
10660
10661
10662 func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
10663 var done bool
10664 done, err = future.DoneWithContext(context.Background(), client)
10665 if err != nil {
10666 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", future.Response(), "Polling failure")
10667 return
10668 }
10669 if !done {
10670 tsgr.Response.Response = future.Response()
10671 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture")
10672 return
10673 }
10674 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10675 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
10676 tsgr, err = client.MigrateSQLContainerToManualThroughputResponder(tsgr.Response.Response)
10677 if err != nil {
10678 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
10679 }
10680 }
10681 return
10682 }
10683
10684
10685
10686 type SQLResourcesMigrateSQLDatabaseToAutoscaleFuture struct {
10687 azure.FutureAPI
10688
10689
10690 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
10691 }
10692
10693
10694 func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error {
10695 var azFuture azure.Future
10696 if err := json.Unmarshal(body, &azFuture); err != nil {
10697 return err
10698 }
10699 future.FutureAPI = &azFuture
10700 future.Result = future.result
10701 return nil
10702 }
10703
10704
10705 func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
10706 var done bool
10707 done, err = future.DoneWithContext(context.Background(), client)
10708 if err != nil {
10709 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure")
10710 return
10711 }
10712 if !done {
10713 tsgr.Response.Response = future.Response()
10714 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture")
10715 return
10716 }
10717 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10718 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
10719 tsgr, err = client.MigrateSQLDatabaseToAutoscaleResponder(tsgr.Response.Response)
10720 if err != nil {
10721 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
10722 }
10723 }
10724 return
10725 }
10726
10727
10728
10729 type SQLResourcesMigrateSQLDatabaseToManualThroughputFuture struct {
10730 azure.FutureAPI
10731
10732
10733 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
10734 }
10735
10736
10737 func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error {
10738 var azFuture azure.Future
10739 if err := json.Unmarshal(body, &azFuture); err != nil {
10740 return err
10741 }
10742 future.FutureAPI = &azFuture
10743 future.Result = future.result
10744 return nil
10745 }
10746
10747
10748 func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
10749 var done bool
10750 done, err = future.DoneWithContext(context.Background(), client)
10751 if err != nil {
10752 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure")
10753 return
10754 }
10755 if !done {
10756 tsgr.Response.Response = future.Response()
10757 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture")
10758 return
10759 }
10760 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10761 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
10762 tsgr, err = client.MigrateSQLDatabaseToManualThroughputResponder(tsgr.Response.Response)
10763 if err != nil {
10764 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
10765 }
10766 }
10767 return
10768 }
10769
10770
10771
10772 type SQLResourcesRetrieveContinuousBackupInformationFuture struct {
10773 azure.FutureAPI
10774
10775
10776 Result func(SQLResourcesClient) (BackupInformation, error)
10777 }
10778
10779
10780 func (future *SQLResourcesRetrieveContinuousBackupInformationFuture) UnmarshalJSON(body []byte) error {
10781 var azFuture azure.Future
10782 if err := json.Unmarshal(body, &azFuture); err != nil {
10783 return err
10784 }
10785 future.FutureAPI = &azFuture
10786 future.Result = future.result
10787 return nil
10788 }
10789
10790
10791 func (future *SQLResourcesRetrieveContinuousBackupInformationFuture) result(client SQLResourcesClient) (bi BackupInformation, err error) {
10792 var done bool
10793 done, err = future.DoneWithContext(context.Background(), client)
10794 if err != nil {
10795 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesRetrieveContinuousBackupInformationFuture", "Result", future.Response(), "Polling failure")
10796 return
10797 }
10798 if !done {
10799 bi.Response.Response = future.Response()
10800 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesRetrieveContinuousBackupInformationFuture")
10801 return
10802 }
10803 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10804 if bi.Response.Response, err = future.GetResult(sender); err == nil && bi.Response.Response.StatusCode != http.StatusNoContent {
10805 bi, err = client.RetrieveContinuousBackupInformationResponder(bi.Response.Response)
10806 if err != nil {
10807 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesRetrieveContinuousBackupInformationFuture", "Result", bi.Response.Response, "Failure responding to request")
10808 }
10809 }
10810 return
10811 }
10812
10813
10814
10815 type SQLResourcesUpdateSQLContainerThroughputFuture struct {
10816 azure.FutureAPI
10817
10818
10819 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
10820 }
10821
10822
10823 func (future *SQLResourcesUpdateSQLContainerThroughputFuture) UnmarshalJSON(body []byte) error {
10824 var azFuture azure.Future
10825 if err := json.Unmarshal(body, &azFuture); err != nil {
10826 return err
10827 }
10828 future.FutureAPI = &azFuture
10829 future.Result = future.result
10830 return nil
10831 }
10832
10833
10834 func (future *SQLResourcesUpdateSQLContainerThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
10835 var done bool
10836 done, err = future.DoneWithContext(context.Background(), client)
10837 if err != nil {
10838 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", future.Response(), "Polling failure")
10839 return
10840 }
10841 if !done {
10842 tsgr.Response.Response = future.Response()
10843 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLContainerThroughputFuture")
10844 return
10845 }
10846 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10847 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
10848 tsgr, err = client.UpdateSQLContainerThroughputResponder(tsgr.Response.Response)
10849 if err != nil {
10850 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
10851 }
10852 }
10853 return
10854 }
10855
10856
10857
10858 type SQLResourcesUpdateSQLDatabaseThroughputFuture struct {
10859 azure.FutureAPI
10860
10861
10862 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
10863 }
10864
10865
10866 func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) UnmarshalJSON(body []byte) error {
10867 var azFuture azure.Future
10868 if err := json.Unmarshal(body, &azFuture); err != nil {
10869 return err
10870 }
10871 future.FutureAPI = &azFuture
10872 future.Result = future.result
10873 return nil
10874 }
10875
10876
10877 func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
10878 var done bool
10879 done, err = future.DoneWithContext(context.Background(), client)
10880 if err != nil {
10881 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", future.Response(), "Polling failure")
10882 return
10883 }
10884 if !done {
10885 tsgr.Response.Response = future.Response()
10886 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture")
10887 return
10888 }
10889 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10890 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
10891 tsgr, err = client.UpdateSQLDatabaseThroughputResponder(tsgr.Response.Response)
10892 if err != nil {
10893 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
10894 }
10895 }
10896 return
10897 }
10898
10899
10900
10901 type SQLRoleAssignmentCreateUpdateParameters struct {
10902
10903 *SQLRoleAssignmentResource `json:"properties,omitempty"`
10904 }
10905
10906
10907 func (sracup SQLRoleAssignmentCreateUpdateParameters) MarshalJSON() ([]byte, error) {
10908 objectMap := make(map[string]interface{})
10909 if sracup.SQLRoleAssignmentResource != nil {
10910 objectMap["properties"] = sracup.SQLRoleAssignmentResource
10911 }
10912 return json.Marshal(objectMap)
10913 }
10914
10915
10916 func (sracup *SQLRoleAssignmentCreateUpdateParameters) UnmarshalJSON(body []byte) error {
10917 var m map[string]*json.RawMessage
10918 err := json.Unmarshal(body, &m)
10919 if err != nil {
10920 return err
10921 }
10922 for k, v := range m {
10923 switch k {
10924 case "properties":
10925 if v != nil {
10926 var SQLRoleAssignmentResource SQLRoleAssignmentResource
10927 err = json.Unmarshal(*v, &SQLRoleAssignmentResource)
10928 if err != nil {
10929 return err
10930 }
10931 sracup.SQLRoleAssignmentResource = &SQLRoleAssignmentResource
10932 }
10933 }
10934 }
10935
10936 return nil
10937 }
10938
10939
10940 type SQLRoleAssignmentGetResults struct {
10941 autorest.Response `json:"-"`
10942
10943 *SQLRoleAssignmentResource `json:"properties,omitempty"`
10944
10945 ID *string `json:"id,omitempty"`
10946
10947 Name *string `json:"name,omitempty"`
10948
10949 Type *string `json:"type,omitempty"`
10950 }
10951
10952
10953 func (sragr SQLRoleAssignmentGetResults) MarshalJSON() ([]byte, error) {
10954 objectMap := make(map[string]interface{})
10955 if sragr.SQLRoleAssignmentResource != nil {
10956 objectMap["properties"] = sragr.SQLRoleAssignmentResource
10957 }
10958 return json.Marshal(objectMap)
10959 }
10960
10961
10962 func (sragr *SQLRoleAssignmentGetResults) UnmarshalJSON(body []byte) error {
10963 var m map[string]*json.RawMessage
10964 err := json.Unmarshal(body, &m)
10965 if err != nil {
10966 return err
10967 }
10968 for k, v := range m {
10969 switch k {
10970 case "properties":
10971 if v != nil {
10972 var SQLRoleAssignmentResource SQLRoleAssignmentResource
10973 err = json.Unmarshal(*v, &SQLRoleAssignmentResource)
10974 if err != nil {
10975 return err
10976 }
10977 sragr.SQLRoleAssignmentResource = &SQLRoleAssignmentResource
10978 }
10979 case "id":
10980 if v != nil {
10981 var ID string
10982 err = json.Unmarshal(*v, &ID)
10983 if err != nil {
10984 return err
10985 }
10986 sragr.ID = &ID
10987 }
10988 case "name":
10989 if v != nil {
10990 var name string
10991 err = json.Unmarshal(*v, &name)
10992 if err != nil {
10993 return err
10994 }
10995 sragr.Name = &name
10996 }
10997 case "type":
10998 if v != nil {
10999 var typeVar string
11000 err = json.Unmarshal(*v, &typeVar)
11001 if err != nil {
11002 return err
11003 }
11004 sragr.Type = &typeVar
11005 }
11006 }
11007 }
11008
11009 return nil
11010 }
11011
11012
11013 type SQLRoleAssignmentListResult struct {
11014 autorest.Response `json:"-"`
11015
11016 Value *[]SQLRoleAssignmentGetResults `json:"value,omitempty"`
11017 }
11018
11019
11020 func (sralr SQLRoleAssignmentListResult) MarshalJSON() ([]byte, error) {
11021 objectMap := make(map[string]interface{})
11022 return json.Marshal(objectMap)
11023 }
11024
11025
11026 type SQLRoleAssignmentResource struct {
11027
11028 RoleDefinitionID *string `json:"roleDefinitionId,omitempty"`
11029
11030 Scope *string `json:"scope,omitempty"`
11031
11032 PrincipalID *string `json:"principalId,omitempty"`
11033 }
11034
11035
11036
11037 type SQLRoleDefinitionCreateUpdateParameters struct {
11038
11039 *SQLRoleDefinitionResource `json:"properties,omitempty"`
11040 }
11041
11042
11043 func (srdcup SQLRoleDefinitionCreateUpdateParameters) MarshalJSON() ([]byte, error) {
11044 objectMap := make(map[string]interface{})
11045 if srdcup.SQLRoleDefinitionResource != nil {
11046 objectMap["properties"] = srdcup.SQLRoleDefinitionResource
11047 }
11048 return json.Marshal(objectMap)
11049 }
11050
11051
11052 func (srdcup *SQLRoleDefinitionCreateUpdateParameters) UnmarshalJSON(body []byte) error {
11053 var m map[string]*json.RawMessage
11054 err := json.Unmarshal(body, &m)
11055 if err != nil {
11056 return err
11057 }
11058 for k, v := range m {
11059 switch k {
11060 case "properties":
11061 if v != nil {
11062 var SQLRoleDefinitionResource SQLRoleDefinitionResource
11063 err = json.Unmarshal(*v, &SQLRoleDefinitionResource)
11064 if err != nil {
11065 return err
11066 }
11067 srdcup.SQLRoleDefinitionResource = &SQLRoleDefinitionResource
11068 }
11069 }
11070 }
11071
11072 return nil
11073 }
11074
11075
11076 type SQLRoleDefinitionGetResults struct {
11077 autorest.Response `json:"-"`
11078
11079 *SQLRoleDefinitionResource `json:"properties,omitempty"`
11080
11081 ID *string `json:"id,omitempty"`
11082
11083 Name *string `json:"name,omitempty"`
11084
11085 Type *string `json:"type,omitempty"`
11086 }
11087
11088
11089 func (srdgr SQLRoleDefinitionGetResults) MarshalJSON() ([]byte, error) {
11090 objectMap := make(map[string]interface{})
11091 if srdgr.SQLRoleDefinitionResource != nil {
11092 objectMap["properties"] = srdgr.SQLRoleDefinitionResource
11093 }
11094 return json.Marshal(objectMap)
11095 }
11096
11097
11098 func (srdgr *SQLRoleDefinitionGetResults) UnmarshalJSON(body []byte) error {
11099 var m map[string]*json.RawMessage
11100 err := json.Unmarshal(body, &m)
11101 if err != nil {
11102 return err
11103 }
11104 for k, v := range m {
11105 switch k {
11106 case "properties":
11107 if v != nil {
11108 var SQLRoleDefinitionResource SQLRoleDefinitionResource
11109 err = json.Unmarshal(*v, &SQLRoleDefinitionResource)
11110 if err != nil {
11111 return err
11112 }
11113 srdgr.SQLRoleDefinitionResource = &SQLRoleDefinitionResource
11114 }
11115 case "id":
11116 if v != nil {
11117 var ID string
11118 err = json.Unmarshal(*v, &ID)
11119 if err != nil {
11120 return err
11121 }
11122 srdgr.ID = &ID
11123 }
11124 case "name":
11125 if v != nil {
11126 var name string
11127 err = json.Unmarshal(*v, &name)
11128 if err != nil {
11129 return err
11130 }
11131 srdgr.Name = &name
11132 }
11133 case "type":
11134 if v != nil {
11135 var typeVar string
11136 err = json.Unmarshal(*v, &typeVar)
11137 if err != nil {
11138 return err
11139 }
11140 srdgr.Type = &typeVar
11141 }
11142 }
11143 }
11144
11145 return nil
11146 }
11147
11148
11149 type SQLRoleDefinitionListResult struct {
11150 autorest.Response `json:"-"`
11151
11152 Value *[]SQLRoleDefinitionGetResults `json:"value,omitempty"`
11153 }
11154
11155
11156 func (srdlr SQLRoleDefinitionListResult) MarshalJSON() ([]byte, error) {
11157 objectMap := make(map[string]interface{})
11158 return json.Marshal(objectMap)
11159 }
11160
11161
11162 type SQLRoleDefinitionResource struct {
11163
11164 RoleName *string `json:"roleName,omitempty"`
11165
11166 Type RoleDefinitionType `json:"type,omitempty"`
11167
11168 AssignableScopes *[]string `json:"assignableScopes,omitempty"`
11169
11170 Permissions *[]Permission `json:"permissions,omitempty"`
11171 }
11172
11173
11174 type SQLStoredProcedureCreateUpdateParameters struct {
11175
11176 *SQLStoredProcedureCreateUpdateProperties `json:"properties,omitempty"`
11177
11178 ID *string `json:"id,omitempty"`
11179
11180 Name *string `json:"name,omitempty"`
11181
11182 Type *string `json:"type,omitempty"`
11183
11184 Location *string `json:"location,omitempty"`
11185 Tags map[string]*string `json:"tags"`
11186 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
11187 }
11188
11189
11190 func (sspcup SQLStoredProcedureCreateUpdateParameters) MarshalJSON() ([]byte, error) {
11191 objectMap := make(map[string]interface{})
11192 if sspcup.SQLStoredProcedureCreateUpdateProperties != nil {
11193 objectMap["properties"] = sspcup.SQLStoredProcedureCreateUpdateProperties
11194 }
11195 if sspcup.Location != nil {
11196 objectMap["location"] = sspcup.Location
11197 }
11198 if sspcup.Tags != nil {
11199 objectMap["tags"] = sspcup.Tags
11200 }
11201 if sspcup.Identity != nil {
11202 objectMap["identity"] = sspcup.Identity
11203 }
11204 return json.Marshal(objectMap)
11205 }
11206
11207
11208 func (sspcup *SQLStoredProcedureCreateUpdateParameters) UnmarshalJSON(body []byte) error {
11209 var m map[string]*json.RawMessage
11210 err := json.Unmarshal(body, &m)
11211 if err != nil {
11212 return err
11213 }
11214 for k, v := range m {
11215 switch k {
11216 case "properties":
11217 if v != nil {
11218 var SQLStoredProcedureCreateUpdateProperties SQLStoredProcedureCreateUpdateProperties
11219 err = json.Unmarshal(*v, &SQLStoredProcedureCreateUpdateProperties)
11220 if err != nil {
11221 return err
11222 }
11223 sspcup.SQLStoredProcedureCreateUpdateProperties = &SQLStoredProcedureCreateUpdateProperties
11224 }
11225 case "id":
11226 if v != nil {
11227 var ID string
11228 err = json.Unmarshal(*v, &ID)
11229 if err != nil {
11230 return err
11231 }
11232 sspcup.ID = &ID
11233 }
11234 case "name":
11235 if v != nil {
11236 var name string
11237 err = json.Unmarshal(*v, &name)
11238 if err != nil {
11239 return err
11240 }
11241 sspcup.Name = &name
11242 }
11243 case "type":
11244 if v != nil {
11245 var typeVar string
11246 err = json.Unmarshal(*v, &typeVar)
11247 if err != nil {
11248 return err
11249 }
11250 sspcup.Type = &typeVar
11251 }
11252 case "location":
11253 if v != nil {
11254 var location string
11255 err = json.Unmarshal(*v, &location)
11256 if err != nil {
11257 return err
11258 }
11259 sspcup.Location = &location
11260 }
11261 case "tags":
11262 if v != nil {
11263 var tags map[string]*string
11264 err = json.Unmarshal(*v, &tags)
11265 if err != nil {
11266 return err
11267 }
11268 sspcup.Tags = tags
11269 }
11270 case "identity":
11271 if v != nil {
11272 var identity ManagedServiceIdentity
11273 err = json.Unmarshal(*v, &identity)
11274 if err != nil {
11275 return err
11276 }
11277 sspcup.Identity = &identity
11278 }
11279 }
11280 }
11281
11282 return nil
11283 }
11284
11285
11286
11287 type SQLStoredProcedureCreateUpdateProperties struct {
11288
11289 Resource *SQLStoredProcedureResource `json:"resource,omitempty"`
11290
11291 Options *CreateUpdateOptions `json:"options,omitempty"`
11292 }
11293
11294
11295 type SQLStoredProcedureGetProperties struct {
11296 Resource *SQLStoredProcedureGetPropertiesResource `json:"resource,omitempty"`
11297 }
11298
11299
11300 type SQLStoredProcedureGetPropertiesResource struct {
11301
11302 ID *string `json:"id,omitempty"`
11303
11304 Body *string `json:"body,omitempty"`
11305
11306 Rid *string `json:"_rid,omitempty"`
11307
11308 Ts *float64 `json:"_ts,omitempty"`
11309
11310 Etag *string `json:"_etag,omitempty"`
11311 }
11312
11313
11314 func (sspgp SQLStoredProcedureGetPropertiesResource) MarshalJSON() ([]byte, error) {
11315 objectMap := make(map[string]interface{})
11316 if sspgp.ID != nil {
11317 objectMap["id"] = sspgp.ID
11318 }
11319 if sspgp.Body != nil {
11320 objectMap["body"] = sspgp.Body
11321 }
11322 return json.Marshal(objectMap)
11323 }
11324
11325
11326 type SQLStoredProcedureGetResults struct {
11327 autorest.Response `json:"-"`
11328
11329 *SQLStoredProcedureGetProperties `json:"properties,omitempty"`
11330
11331 ID *string `json:"id,omitempty"`
11332
11333 Name *string `json:"name,omitempty"`
11334
11335 Type *string `json:"type,omitempty"`
11336
11337 Location *string `json:"location,omitempty"`
11338 Tags map[string]*string `json:"tags"`
11339 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
11340 }
11341
11342
11343 func (sspgr SQLStoredProcedureGetResults) MarshalJSON() ([]byte, error) {
11344 objectMap := make(map[string]interface{})
11345 if sspgr.SQLStoredProcedureGetProperties != nil {
11346 objectMap["properties"] = sspgr.SQLStoredProcedureGetProperties
11347 }
11348 if sspgr.Location != nil {
11349 objectMap["location"] = sspgr.Location
11350 }
11351 if sspgr.Tags != nil {
11352 objectMap["tags"] = sspgr.Tags
11353 }
11354 if sspgr.Identity != nil {
11355 objectMap["identity"] = sspgr.Identity
11356 }
11357 return json.Marshal(objectMap)
11358 }
11359
11360
11361 func (sspgr *SQLStoredProcedureGetResults) UnmarshalJSON(body []byte) error {
11362 var m map[string]*json.RawMessage
11363 err := json.Unmarshal(body, &m)
11364 if err != nil {
11365 return err
11366 }
11367 for k, v := range m {
11368 switch k {
11369 case "properties":
11370 if v != nil {
11371 var SQLStoredProcedureGetProperties SQLStoredProcedureGetProperties
11372 err = json.Unmarshal(*v, &SQLStoredProcedureGetProperties)
11373 if err != nil {
11374 return err
11375 }
11376 sspgr.SQLStoredProcedureGetProperties = &SQLStoredProcedureGetProperties
11377 }
11378 case "id":
11379 if v != nil {
11380 var ID string
11381 err = json.Unmarshal(*v, &ID)
11382 if err != nil {
11383 return err
11384 }
11385 sspgr.ID = &ID
11386 }
11387 case "name":
11388 if v != nil {
11389 var name string
11390 err = json.Unmarshal(*v, &name)
11391 if err != nil {
11392 return err
11393 }
11394 sspgr.Name = &name
11395 }
11396 case "type":
11397 if v != nil {
11398 var typeVar string
11399 err = json.Unmarshal(*v, &typeVar)
11400 if err != nil {
11401 return err
11402 }
11403 sspgr.Type = &typeVar
11404 }
11405 case "location":
11406 if v != nil {
11407 var location string
11408 err = json.Unmarshal(*v, &location)
11409 if err != nil {
11410 return err
11411 }
11412 sspgr.Location = &location
11413 }
11414 case "tags":
11415 if v != nil {
11416 var tags map[string]*string
11417 err = json.Unmarshal(*v, &tags)
11418 if err != nil {
11419 return err
11420 }
11421 sspgr.Tags = tags
11422 }
11423 case "identity":
11424 if v != nil {
11425 var identity ManagedServiceIdentity
11426 err = json.Unmarshal(*v, &identity)
11427 if err != nil {
11428 return err
11429 }
11430 sspgr.Identity = &identity
11431 }
11432 }
11433 }
11434
11435 return nil
11436 }
11437
11438
11439
11440 type SQLStoredProcedureListResult struct {
11441 autorest.Response `json:"-"`
11442
11443 Value *[]SQLStoredProcedureGetResults `json:"value,omitempty"`
11444 }
11445
11446
11447 func (ssplr SQLStoredProcedureListResult) MarshalJSON() ([]byte, error) {
11448 objectMap := make(map[string]interface{})
11449 return json.Marshal(objectMap)
11450 }
11451
11452
11453 type SQLStoredProcedureResource struct {
11454
11455 ID *string `json:"id,omitempty"`
11456
11457 Body *string `json:"body,omitempty"`
11458 }
11459
11460
11461 type SQLTriggerCreateUpdateParameters struct {
11462
11463 *SQLTriggerCreateUpdateProperties `json:"properties,omitempty"`
11464
11465 ID *string `json:"id,omitempty"`
11466
11467 Name *string `json:"name,omitempty"`
11468
11469 Type *string `json:"type,omitempty"`
11470
11471 Location *string `json:"location,omitempty"`
11472 Tags map[string]*string `json:"tags"`
11473 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
11474 }
11475
11476
11477 func (stcup SQLTriggerCreateUpdateParameters) MarshalJSON() ([]byte, error) {
11478 objectMap := make(map[string]interface{})
11479 if stcup.SQLTriggerCreateUpdateProperties != nil {
11480 objectMap["properties"] = stcup.SQLTriggerCreateUpdateProperties
11481 }
11482 if stcup.Location != nil {
11483 objectMap["location"] = stcup.Location
11484 }
11485 if stcup.Tags != nil {
11486 objectMap["tags"] = stcup.Tags
11487 }
11488 if stcup.Identity != nil {
11489 objectMap["identity"] = stcup.Identity
11490 }
11491 return json.Marshal(objectMap)
11492 }
11493
11494
11495 func (stcup *SQLTriggerCreateUpdateParameters) UnmarshalJSON(body []byte) error {
11496 var m map[string]*json.RawMessage
11497 err := json.Unmarshal(body, &m)
11498 if err != nil {
11499 return err
11500 }
11501 for k, v := range m {
11502 switch k {
11503 case "properties":
11504 if v != nil {
11505 var SQLTriggerCreateUpdateProperties SQLTriggerCreateUpdateProperties
11506 err = json.Unmarshal(*v, &SQLTriggerCreateUpdateProperties)
11507 if err != nil {
11508 return err
11509 }
11510 stcup.SQLTriggerCreateUpdateProperties = &SQLTriggerCreateUpdateProperties
11511 }
11512 case "id":
11513 if v != nil {
11514 var ID string
11515 err = json.Unmarshal(*v, &ID)
11516 if err != nil {
11517 return err
11518 }
11519 stcup.ID = &ID
11520 }
11521 case "name":
11522 if v != nil {
11523 var name string
11524 err = json.Unmarshal(*v, &name)
11525 if err != nil {
11526 return err
11527 }
11528 stcup.Name = &name
11529 }
11530 case "type":
11531 if v != nil {
11532 var typeVar string
11533 err = json.Unmarshal(*v, &typeVar)
11534 if err != nil {
11535 return err
11536 }
11537 stcup.Type = &typeVar
11538 }
11539 case "location":
11540 if v != nil {
11541 var location string
11542 err = json.Unmarshal(*v, &location)
11543 if err != nil {
11544 return err
11545 }
11546 stcup.Location = &location
11547 }
11548 case "tags":
11549 if v != nil {
11550 var tags map[string]*string
11551 err = json.Unmarshal(*v, &tags)
11552 if err != nil {
11553 return err
11554 }
11555 stcup.Tags = tags
11556 }
11557 case "identity":
11558 if v != nil {
11559 var identity ManagedServiceIdentity
11560 err = json.Unmarshal(*v, &identity)
11561 if err != nil {
11562 return err
11563 }
11564 stcup.Identity = &identity
11565 }
11566 }
11567 }
11568
11569 return nil
11570 }
11571
11572
11573 type SQLTriggerCreateUpdateProperties struct {
11574
11575 Resource *SQLTriggerResource `json:"resource,omitempty"`
11576
11577 Options *CreateUpdateOptions `json:"options,omitempty"`
11578 }
11579
11580
11581 type SQLTriggerGetProperties struct {
11582 Resource *SQLTriggerGetPropertiesResource `json:"resource,omitempty"`
11583 }
11584
11585
11586 type SQLTriggerGetPropertiesResource struct {
11587
11588 ID *string `json:"id,omitempty"`
11589
11590 Body *string `json:"body,omitempty"`
11591
11592 TriggerType TriggerType `json:"triggerType,omitempty"`
11593
11594 TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"`
11595
11596 Rid *string `json:"_rid,omitempty"`
11597
11598 Ts *float64 `json:"_ts,omitempty"`
11599
11600 Etag *string `json:"_etag,omitempty"`
11601 }
11602
11603
11604 func (stgp SQLTriggerGetPropertiesResource) MarshalJSON() ([]byte, error) {
11605 objectMap := make(map[string]interface{})
11606 if stgp.ID != nil {
11607 objectMap["id"] = stgp.ID
11608 }
11609 if stgp.Body != nil {
11610 objectMap["body"] = stgp.Body
11611 }
11612 if stgp.TriggerType != "" {
11613 objectMap["triggerType"] = stgp.TriggerType
11614 }
11615 if stgp.TriggerOperation != "" {
11616 objectMap["triggerOperation"] = stgp.TriggerOperation
11617 }
11618 return json.Marshal(objectMap)
11619 }
11620
11621
11622 type SQLTriggerGetResults struct {
11623 autorest.Response `json:"-"`
11624
11625 *SQLTriggerGetProperties `json:"properties,omitempty"`
11626
11627 ID *string `json:"id,omitempty"`
11628
11629 Name *string `json:"name,omitempty"`
11630
11631 Type *string `json:"type,omitempty"`
11632
11633 Location *string `json:"location,omitempty"`
11634 Tags map[string]*string `json:"tags"`
11635 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
11636 }
11637
11638
11639 func (stgr SQLTriggerGetResults) MarshalJSON() ([]byte, error) {
11640 objectMap := make(map[string]interface{})
11641 if stgr.SQLTriggerGetProperties != nil {
11642 objectMap["properties"] = stgr.SQLTriggerGetProperties
11643 }
11644 if stgr.Location != nil {
11645 objectMap["location"] = stgr.Location
11646 }
11647 if stgr.Tags != nil {
11648 objectMap["tags"] = stgr.Tags
11649 }
11650 if stgr.Identity != nil {
11651 objectMap["identity"] = stgr.Identity
11652 }
11653 return json.Marshal(objectMap)
11654 }
11655
11656
11657 func (stgr *SQLTriggerGetResults) UnmarshalJSON(body []byte) error {
11658 var m map[string]*json.RawMessage
11659 err := json.Unmarshal(body, &m)
11660 if err != nil {
11661 return err
11662 }
11663 for k, v := range m {
11664 switch k {
11665 case "properties":
11666 if v != nil {
11667 var SQLTriggerGetProperties SQLTriggerGetProperties
11668 err = json.Unmarshal(*v, &SQLTriggerGetProperties)
11669 if err != nil {
11670 return err
11671 }
11672 stgr.SQLTriggerGetProperties = &SQLTriggerGetProperties
11673 }
11674 case "id":
11675 if v != nil {
11676 var ID string
11677 err = json.Unmarshal(*v, &ID)
11678 if err != nil {
11679 return err
11680 }
11681 stgr.ID = &ID
11682 }
11683 case "name":
11684 if v != nil {
11685 var name string
11686 err = json.Unmarshal(*v, &name)
11687 if err != nil {
11688 return err
11689 }
11690 stgr.Name = &name
11691 }
11692 case "type":
11693 if v != nil {
11694 var typeVar string
11695 err = json.Unmarshal(*v, &typeVar)
11696 if err != nil {
11697 return err
11698 }
11699 stgr.Type = &typeVar
11700 }
11701 case "location":
11702 if v != nil {
11703 var location string
11704 err = json.Unmarshal(*v, &location)
11705 if err != nil {
11706 return err
11707 }
11708 stgr.Location = &location
11709 }
11710 case "tags":
11711 if v != nil {
11712 var tags map[string]*string
11713 err = json.Unmarshal(*v, &tags)
11714 if err != nil {
11715 return err
11716 }
11717 stgr.Tags = tags
11718 }
11719 case "identity":
11720 if v != nil {
11721 var identity ManagedServiceIdentity
11722 err = json.Unmarshal(*v, &identity)
11723 if err != nil {
11724 return err
11725 }
11726 stgr.Identity = &identity
11727 }
11728 }
11729 }
11730
11731 return nil
11732 }
11733
11734
11735 type SQLTriggerListResult struct {
11736 autorest.Response `json:"-"`
11737
11738 Value *[]SQLTriggerGetResults `json:"value,omitempty"`
11739 }
11740
11741
11742 func (stlr SQLTriggerListResult) MarshalJSON() ([]byte, error) {
11743 objectMap := make(map[string]interface{})
11744 return json.Marshal(objectMap)
11745 }
11746
11747
11748 type SQLTriggerResource struct {
11749
11750 ID *string `json:"id,omitempty"`
11751
11752 Body *string `json:"body,omitempty"`
11753
11754 TriggerType TriggerType `json:"triggerType,omitempty"`
11755
11756 TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"`
11757 }
11758
11759
11760
11761 type SQLUserDefinedFunctionCreateUpdateParameters struct {
11762
11763 *SQLUserDefinedFunctionCreateUpdateProperties `json:"properties,omitempty"`
11764
11765 ID *string `json:"id,omitempty"`
11766
11767 Name *string `json:"name,omitempty"`
11768
11769 Type *string `json:"type,omitempty"`
11770
11771 Location *string `json:"location,omitempty"`
11772 Tags map[string]*string `json:"tags"`
11773 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
11774 }
11775
11776
11777 func (sudfcup SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON() ([]byte, error) {
11778 objectMap := make(map[string]interface{})
11779 if sudfcup.SQLUserDefinedFunctionCreateUpdateProperties != nil {
11780 objectMap["properties"] = sudfcup.SQLUserDefinedFunctionCreateUpdateProperties
11781 }
11782 if sudfcup.Location != nil {
11783 objectMap["location"] = sudfcup.Location
11784 }
11785 if sudfcup.Tags != nil {
11786 objectMap["tags"] = sudfcup.Tags
11787 }
11788 if sudfcup.Identity != nil {
11789 objectMap["identity"] = sudfcup.Identity
11790 }
11791 return json.Marshal(objectMap)
11792 }
11793
11794
11795 func (sudfcup *SQLUserDefinedFunctionCreateUpdateParameters) UnmarshalJSON(body []byte) error {
11796 var m map[string]*json.RawMessage
11797 err := json.Unmarshal(body, &m)
11798 if err != nil {
11799 return err
11800 }
11801 for k, v := range m {
11802 switch k {
11803 case "properties":
11804 if v != nil {
11805 var SQLUserDefinedFunctionCreateUpdateProperties SQLUserDefinedFunctionCreateUpdateProperties
11806 err = json.Unmarshal(*v, &SQLUserDefinedFunctionCreateUpdateProperties)
11807 if err != nil {
11808 return err
11809 }
11810 sudfcup.SQLUserDefinedFunctionCreateUpdateProperties = &SQLUserDefinedFunctionCreateUpdateProperties
11811 }
11812 case "id":
11813 if v != nil {
11814 var ID string
11815 err = json.Unmarshal(*v, &ID)
11816 if err != nil {
11817 return err
11818 }
11819 sudfcup.ID = &ID
11820 }
11821 case "name":
11822 if v != nil {
11823 var name string
11824 err = json.Unmarshal(*v, &name)
11825 if err != nil {
11826 return err
11827 }
11828 sudfcup.Name = &name
11829 }
11830 case "type":
11831 if v != nil {
11832 var typeVar string
11833 err = json.Unmarshal(*v, &typeVar)
11834 if err != nil {
11835 return err
11836 }
11837 sudfcup.Type = &typeVar
11838 }
11839 case "location":
11840 if v != nil {
11841 var location string
11842 err = json.Unmarshal(*v, &location)
11843 if err != nil {
11844 return err
11845 }
11846 sudfcup.Location = &location
11847 }
11848 case "tags":
11849 if v != nil {
11850 var tags map[string]*string
11851 err = json.Unmarshal(*v, &tags)
11852 if err != nil {
11853 return err
11854 }
11855 sudfcup.Tags = tags
11856 }
11857 case "identity":
11858 if v != nil {
11859 var identity ManagedServiceIdentity
11860 err = json.Unmarshal(*v, &identity)
11861 if err != nil {
11862 return err
11863 }
11864 sudfcup.Identity = &identity
11865 }
11866 }
11867 }
11868
11869 return nil
11870 }
11871
11872
11873
11874 type SQLUserDefinedFunctionCreateUpdateProperties struct {
11875
11876 Resource *SQLUserDefinedFunctionResource `json:"resource,omitempty"`
11877
11878 Options *CreateUpdateOptions `json:"options,omitempty"`
11879 }
11880
11881
11882 type SQLUserDefinedFunctionGetProperties struct {
11883 Resource *SQLUserDefinedFunctionGetPropertiesResource `json:"resource,omitempty"`
11884 }
11885
11886
11887 type SQLUserDefinedFunctionGetPropertiesResource struct {
11888
11889 ID *string `json:"id,omitempty"`
11890
11891 Body *string `json:"body,omitempty"`
11892
11893 Rid *string `json:"_rid,omitempty"`
11894
11895 Ts *float64 `json:"_ts,omitempty"`
11896
11897 Etag *string `json:"_etag,omitempty"`
11898 }
11899
11900
11901 func (sudfgp SQLUserDefinedFunctionGetPropertiesResource) MarshalJSON() ([]byte, error) {
11902 objectMap := make(map[string]interface{})
11903 if sudfgp.ID != nil {
11904 objectMap["id"] = sudfgp.ID
11905 }
11906 if sudfgp.Body != nil {
11907 objectMap["body"] = sudfgp.Body
11908 }
11909 return json.Marshal(objectMap)
11910 }
11911
11912
11913 type SQLUserDefinedFunctionGetResults struct {
11914 autorest.Response `json:"-"`
11915
11916 *SQLUserDefinedFunctionGetProperties `json:"properties,omitempty"`
11917
11918 ID *string `json:"id,omitempty"`
11919
11920 Name *string `json:"name,omitempty"`
11921
11922 Type *string `json:"type,omitempty"`
11923
11924 Location *string `json:"location,omitempty"`
11925 Tags map[string]*string `json:"tags"`
11926 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
11927 }
11928
11929
11930 func (sudfgr SQLUserDefinedFunctionGetResults) MarshalJSON() ([]byte, error) {
11931 objectMap := make(map[string]interface{})
11932 if sudfgr.SQLUserDefinedFunctionGetProperties != nil {
11933 objectMap["properties"] = sudfgr.SQLUserDefinedFunctionGetProperties
11934 }
11935 if sudfgr.Location != nil {
11936 objectMap["location"] = sudfgr.Location
11937 }
11938 if sudfgr.Tags != nil {
11939 objectMap["tags"] = sudfgr.Tags
11940 }
11941 if sudfgr.Identity != nil {
11942 objectMap["identity"] = sudfgr.Identity
11943 }
11944 return json.Marshal(objectMap)
11945 }
11946
11947
11948 func (sudfgr *SQLUserDefinedFunctionGetResults) UnmarshalJSON(body []byte) error {
11949 var m map[string]*json.RawMessage
11950 err := json.Unmarshal(body, &m)
11951 if err != nil {
11952 return err
11953 }
11954 for k, v := range m {
11955 switch k {
11956 case "properties":
11957 if v != nil {
11958 var SQLUserDefinedFunctionGetProperties SQLUserDefinedFunctionGetProperties
11959 err = json.Unmarshal(*v, &SQLUserDefinedFunctionGetProperties)
11960 if err != nil {
11961 return err
11962 }
11963 sudfgr.SQLUserDefinedFunctionGetProperties = &SQLUserDefinedFunctionGetProperties
11964 }
11965 case "id":
11966 if v != nil {
11967 var ID string
11968 err = json.Unmarshal(*v, &ID)
11969 if err != nil {
11970 return err
11971 }
11972 sudfgr.ID = &ID
11973 }
11974 case "name":
11975 if v != nil {
11976 var name string
11977 err = json.Unmarshal(*v, &name)
11978 if err != nil {
11979 return err
11980 }
11981 sudfgr.Name = &name
11982 }
11983 case "type":
11984 if v != nil {
11985 var typeVar string
11986 err = json.Unmarshal(*v, &typeVar)
11987 if err != nil {
11988 return err
11989 }
11990 sudfgr.Type = &typeVar
11991 }
11992 case "location":
11993 if v != nil {
11994 var location string
11995 err = json.Unmarshal(*v, &location)
11996 if err != nil {
11997 return err
11998 }
11999 sudfgr.Location = &location
12000 }
12001 case "tags":
12002 if v != nil {
12003 var tags map[string]*string
12004 err = json.Unmarshal(*v, &tags)
12005 if err != nil {
12006 return err
12007 }
12008 sudfgr.Tags = tags
12009 }
12010 case "identity":
12011 if v != nil {
12012 var identity ManagedServiceIdentity
12013 err = json.Unmarshal(*v, &identity)
12014 if err != nil {
12015 return err
12016 }
12017 sudfgr.Identity = &identity
12018 }
12019 }
12020 }
12021
12022 return nil
12023 }
12024
12025
12026
12027 type SQLUserDefinedFunctionListResult struct {
12028 autorest.Response `json:"-"`
12029
12030 Value *[]SQLUserDefinedFunctionGetResults `json:"value,omitempty"`
12031 }
12032
12033
12034 func (sudflr SQLUserDefinedFunctionListResult) MarshalJSON() ([]byte, error) {
12035 objectMap := make(map[string]interface{})
12036 return json.Marshal(objectMap)
12037 }
12038
12039
12040 type SQLUserDefinedFunctionResource struct {
12041
12042 ID *string `json:"id,omitempty"`
12043
12044 Body *string `json:"body,omitempty"`
12045 }
12046
12047
12048 type SystemData struct {
12049
12050 CreatedBy *string `json:"createdBy,omitempty"`
12051
12052 CreatedByType CreatedByType `json:"createdByType,omitempty"`
12053
12054 CreatedAt *date.Time `json:"createdAt,omitempty"`
12055
12056 LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
12057
12058 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
12059
12060 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
12061 }
12062
12063
12064 type TableCreateUpdateParameters struct {
12065
12066 *TableCreateUpdateProperties `json:"properties,omitempty"`
12067
12068 ID *string `json:"id,omitempty"`
12069
12070 Name *string `json:"name,omitempty"`
12071
12072 Type *string `json:"type,omitempty"`
12073
12074 Location *string `json:"location,omitempty"`
12075 Tags map[string]*string `json:"tags"`
12076 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
12077 }
12078
12079
12080 func (tcup TableCreateUpdateParameters) MarshalJSON() ([]byte, error) {
12081 objectMap := make(map[string]interface{})
12082 if tcup.TableCreateUpdateProperties != nil {
12083 objectMap["properties"] = tcup.TableCreateUpdateProperties
12084 }
12085 if tcup.Location != nil {
12086 objectMap["location"] = tcup.Location
12087 }
12088 if tcup.Tags != nil {
12089 objectMap["tags"] = tcup.Tags
12090 }
12091 if tcup.Identity != nil {
12092 objectMap["identity"] = tcup.Identity
12093 }
12094 return json.Marshal(objectMap)
12095 }
12096
12097
12098 func (tcup *TableCreateUpdateParameters) UnmarshalJSON(body []byte) error {
12099 var m map[string]*json.RawMessage
12100 err := json.Unmarshal(body, &m)
12101 if err != nil {
12102 return err
12103 }
12104 for k, v := range m {
12105 switch k {
12106 case "properties":
12107 if v != nil {
12108 var tableCreateUpdateProperties TableCreateUpdateProperties
12109 err = json.Unmarshal(*v, &tableCreateUpdateProperties)
12110 if err != nil {
12111 return err
12112 }
12113 tcup.TableCreateUpdateProperties = &tableCreateUpdateProperties
12114 }
12115 case "id":
12116 if v != nil {
12117 var ID string
12118 err = json.Unmarshal(*v, &ID)
12119 if err != nil {
12120 return err
12121 }
12122 tcup.ID = &ID
12123 }
12124 case "name":
12125 if v != nil {
12126 var name string
12127 err = json.Unmarshal(*v, &name)
12128 if err != nil {
12129 return err
12130 }
12131 tcup.Name = &name
12132 }
12133 case "type":
12134 if v != nil {
12135 var typeVar string
12136 err = json.Unmarshal(*v, &typeVar)
12137 if err != nil {
12138 return err
12139 }
12140 tcup.Type = &typeVar
12141 }
12142 case "location":
12143 if v != nil {
12144 var location string
12145 err = json.Unmarshal(*v, &location)
12146 if err != nil {
12147 return err
12148 }
12149 tcup.Location = &location
12150 }
12151 case "tags":
12152 if v != nil {
12153 var tags map[string]*string
12154 err = json.Unmarshal(*v, &tags)
12155 if err != nil {
12156 return err
12157 }
12158 tcup.Tags = tags
12159 }
12160 case "identity":
12161 if v != nil {
12162 var identity ManagedServiceIdentity
12163 err = json.Unmarshal(*v, &identity)
12164 if err != nil {
12165 return err
12166 }
12167 tcup.Identity = &identity
12168 }
12169 }
12170 }
12171
12172 return nil
12173 }
12174
12175
12176 type TableCreateUpdateProperties struct {
12177
12178 Resource *TableResource `json:"resource,omitempty"`
12179
12180 Options *CreateUpdateOptions `json:"options,omitempty"`
12181 }
12182
12183
12184 type TableGetProperties struct {
12185 Resource *TableGetPropertiesResource `json:"resource,omitempty"`
12186 Options *TableGetPropertiesOptions `json:"options,omitempty"`
12187 }
12188
12189
12190 type TableGetPropertiesOptions struct {
12191
12192 Throughput *int32 `json:"throughput,omitempty"`
12193
12194 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
12195 }
12196
12197
12198 type TableGetPropertiesResource struct {
12199
12200 ID *string `json:"id,omitempty"`
12201
12202 Rid *string `json:"_rid,omitempty"`
12203
12204 Ts *float64 `json:"_ts,omitempty"`
12205
12206 Etag *string `json:"_etag,omitempty"`
12207 }
12208
12209
12210 func (tgp TableGetPropertiesResource) MarshalJSON() ([]byte, error) {
12211 objectMap := make(map[string]interface{})
12212 if tgp.ID != nil {
12213 objectMap["id"] = tgp.ID
12214 }
12215 return json.Marshal(objectMap)
12216 }
12217
12218
12219 type TableGetResults struct {
12220 autorest.Response `json:"-"`
12221
12222 *TableGetProperties `json:"properties,omitempty"`
12223
12224 ID *string `json:"id,omitempty"`
12225
12226 Name *string `json:"name,omitempty"`
12227
12228 Type *string `json:"type,omitempty"`
12229
12230 Location *string `json:"location,omitempty"`
12231 Tags map[string]*string `json:"tags"`
12232 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
12233 }
12234
12235
12236 func (tgr TableGetResults) MarshalJSON() ([]byte, error) {
12237 objectMap := make(map[string]interface{})
12238 if tgr.TableGetProperties != nil {
12239 objectMap["properties"] = tgr.TableGetProperties
12240 }
12241 if tgr.Location != nil {
12242 objectMap["location"] = tgr.Location
12243 }
12244 if tgr.Tags != nil {
12245 objectMap["tags"] = tgr.Tags
12246 }
12247 if tgr.Identity != nil {
12248 objectMap["identity"] = tgr.Identity
12249 }
12250 return json.Marshal(objectMap)
12251 }
12252
12253
12254 func (tgr *TableGetResults) UnmarshalJSON(body []byte) error {
12255 var m map[string]*json.RawMessage
12256 err := json.Unmarshal(body, &m)
12257 if err != nil {
12258 return err
12259 }
12260 for k, v := range m {
12261 switch k {
12262 case "properties":
12263 if v != nil {
12264 var tableGetProperties TableGetProperties
12265 err = json.Unmarshal(*v, &tableGetProperties)
12266 if err != nil {
12267 return err
12268 }
12269 tgr.TableGetProperties = &tableGetProperties
12270 }
12271 case "id":
12272 if v != nil {
12273 var ID string
12274 err = json.Unmarshal(*v, &ID)
12275 if err != nil {
12276 return err
12277 }
12278 tgr.ID = &ID
12279 }
12280 case "name":
12281 if v != nil {
12282 var name string
12283 err = json.Unmarshal(*v, &name)
12284 if err != nil {
12285 return err
12286 }
12287 tgr.Name = &name
12288 }
12289 case "type":
12290 if v != nil {
12291 var typeVar string
12292 err = json.Unmarshal(*v, &typeVar)
12293 if err != nil {
12294 return err
12295 }
12296 tgr.Type = &typeVar
12297 }
12298 case "location":
12299 if v != nil {
12300 var location string
12301 err = json.Unmarshal(*v, &location)
12302 if err != nil {
12303 return err
12304 }
12305 tgr.Location = &location
12306 }
12307 case "tags":
12308 if v != nil {
12309 var tags map[string]*string
12310 err = json.Unmarshal(*v, &tags)
12311 if err != nil {
12312 return err
12313 }
12314 tgr.Tags = tags
12315 }
12316 case "identity":
12317 if v != nil {
12318 var identity ManagedServiceIdentity
12319 err = json.Unmarshal(*v, &identity)
12320 if err != nil {
12321 return err
12322 }
12323 tgr.Identity = &identity
12324 }
12325 }
12326 }
12327
12328 return nil
12329 }
12330
12331
12332 type TableListResult struct {
12333 autorest.Response `json:"-"`
12334
12335 Value *[]TableGetResults `json:"value,omitempty"`
12336 }
12337
12338
12339 func (tlr TableListResult) MarshalJSON() ([]byte, error) {
12340 objectMap := make(map[string]interface{})
12341 return json.Marshal(objectMap)
12342 }
12343
12344
12345 type TableResource struct {
12346
12347 ID *string `json:"id,omitempty"`
12348 }
12349
12350
12351
12352 type TableResourcesCreateUpdateTableFuture struct {
12353 azure.FutureAPI
12354
12355
12356 Result func(TableResourcesClient) (TableGetResults, error)
12357 }
12358
12359
12360 func (future *TableResourcesCreateUpdateTableFuture) UnmarshalJSON(body []byte) error {
12361 var azFuture azure.Future
12362 if err := json.Unmarshal(body, &azFuture); err != nil {
12363 return err
12364 }
12365 future.FutureAPI = &azFuture
12366 future.Result = future.result
12367 return nil
12368 }
12369
12370
12371 func (future *TableResourcesCreateUpdateTableFuture) result(client TableResourcesClient) (tgr TableGetResults, err error) {
12372 var done bool
12373 done, err = future.DoneWithContext(context.Background(), client)
12374 if err != nil {
12375 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", future.Response(), "Polling failure")
12376 return
12377 }
12378 if !done {
12379 tgr.Response.Response = future.Response()
12380 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesCreateUpdateTableFuture")
12381 return
12382 }
12383 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12384 if tgr.Response.Response, err = future.GetResult(sender); err == nil && tgr.Response.Response.StatusCode != http.StatusNoContent {
12385 tgr, err = client.CreateUpdateTableResponder(tgr.Response.Response)
12386 if err != nil {
12387 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", tgr.Response.Response, "Failure responding to request")
12388 }
12389 }
12390 return
12391 }
12392
12393
12394
12395 type TableResourcesDeleteTableFuture struct {
12396 azure.FutureAPI
12397
12398
12399 Result func(TableResourcesClient) (autorest.Response, error)
12400 }
12401
12402
12403 func (future *TableResourcesDeleteTableFuture) UnmarshalJSON(body []byte) error {
12404 var azFuture azure.Future
12405 if err := json.Unmarshal(body, &azFuture); err != nil {
12406 return err
12407 }
12408 future.FutureAPI = &azFuture
12409 future.Result = future.result
12410 return nil
12411 }
12412
12413
12414 func (future *TableResourcesDeleteTableFuture) result(client TableResourcesClient) (ar autorest.Response, err error) {
12415 var done bool
12416 done, err = future.DoneWithContext(context.Background(), client)
12417 if err != nil {
12418 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesDeleteTableFuture", "Result", future.Response(), "Polling failure")
12419 return
12420 }
12421 if !done {
12422 ar.Response = future.Response()
12423 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesDeleteTableFuture")
12424 return
12425 }
12426 ar.Response = future.Response()
12427 return
12428 }
12429
12430
12431
12432 type TableResourcesMigrateTableToAutoscaleFuture struct {
12433 azure.FutureAPI
12434
12435
12436 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error)
12437 }
12438
12439
12440 func (future *TableResourcesMigrateTableToAutoscaleFuture) UnmarshalJSON(body []byte) error {
12441 var azFuture azure.Future
12442 if err := json.Unmarshal(body, &azFuture); err != nil {
12443 return err
12444 }
12445 future.FutureAPI = &azFuture
12446 future.Result = future.result
12447 return nil
12448 }
12449
12450
12451 func (future *TableResourcesMigrateTableToAutoscaleFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
12452 var done bool
12453 done, err = future.DoneWithContext(context.Background(), client)
12454 if err != nil {
12455 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", future.Response(), "Polling failure")
12456 return
12457 }
12458 if !done {
12459 tsgr.Response.Response = future.Response()
12460 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToAutoscaleFuture")
12461 return
12462 }
12463 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12464 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
12465 tsgr, err = client.MigrateTableToAutoscaleResponder(tsgr.Response.Response)
12466 if err != nil {
12467 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
12468 }
12469 }
12470 return
12471 }
12472
12473
12474
12475 type TableResourcesMigrateTableToManualThroughputFuture struct {
12476 azure.FutureAPI
12477
12478
12479 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error)
12480 }
12481
12482
12483 func (future *TableResourcesMigrateTableToManualThroughputFuture) UnmarshalJSON(body []byte) error {
12484 var azFuture azure.Future
12485 if err := json.Unmarshal(body, &azFuture); err != nil {
12486 return err
12487 }
12488 future.FutureAPI = &azFuture
12489 future.Result = future.result
12490 return nil
12491 }
12492
12493
12494 func (future *TableResourcesMigrateTableToManualThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
12495 var done bool
12496 done, err = future.DoneWithContext(context.Background(), client)
12497 if err != nil {
12498 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", future.Response(), "Polling failure")
12499 return
12500 }
12501 if !done {
12502 tsgr.Response.Response = future.Response()
12503 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToManualThroughputFuture")
12504 return
12505 }
12506 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12507 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
12508 tsgr, err = client.MigrateTableToManualThroughputResponder(tsgr.Response.Response)
12509 if err != nil {
12510 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
12511 }
12512 }
12513 return
12514 }
12515
12516
12517
12518 type TableResourcesUpdateTableThroughputFuture struct {
12519 azure.FutureAPI
12520
12521
12522 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error)
12523 }
12524
12525
12526 func (future *TableResourcesUpdateTableThroughputFuture) UnmarshalJSON(body []byte) error {
12527 var azFuture azure.Future
12528 if err := json.Unmarshal(body, &azFuture); err != nil {
12529 return err
12530 }
12531 future.FutureAPI = &azFuture
12532 future.Result = future.result
12533 return nil
12534 }
12535
12536
12537 func (future *TableResourcesUpdateTableThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
12538 var done bool
12539 done, err = future.DoneWithContext(context.Background(), client)
12540 if err != nil {
12541 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", future.Response(), "Polling failure")
12542 return
12543 }
12544 if !done {
12545 tsgr.Response.Response = future.Response()
12546 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesUpdateTableThroughputFuture")
12547 return
12548 }
12549 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12550 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
12551 tsgr, err = client.UpdateTableThroughputResponder(tsgr.Response.Response)
12552 if err != nil {
12553 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
12554 }
12555 }
12556 return
12557 }
12558
12559
12560 type ThroughputPolicyResource struct {
12561
12562 IsEnabled *bool `json:"isEnabled,omitempty"`
12563
12564 IncrementPercent *int32 `json:"incrementPercent,omitempty"`
12565 }
12566
12567
12568 type ThroughputSettingsGetProperties struct {
12569 Resource *ThroughputSettingsGetPropertiesResource `json:"resource,omitempty"`
12570 }
12571
12572
12573 type ThroughputSettingsGetPropertiesResource struct {
12574
12575 Throughput *int32 `json:"throughput,omitempty"`
12576
12577 AutoscaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"`
12578
12579 MinimumThroughput *string `json:"minimumThroughput,omitempty"`
12580
12581 OfferReplacePending *string `json:"offerReplacePending,omitempty"`
12582
12583 Rid *string `json:"_rid,omitempty"`
12584
12585 Ts *float64 `json:"_ts,omitempty"`
12586
12587 Etag *string `json:"_etag,omitempty"`
12588 }
12589
12590
12591 func (tsgp ThroughputSettingsGetPropertiesResource) MarshalJSON() ([]byte, error) {
12592 objectMap := make(map[string]interface{})
12593 if tsgp.Throughput != nil {
12594 objectMap["throughput"] = tsgp.Throughput
12595 }
12596 if tsgp.AutoscaleSettings != nil {
12597 objectMap["autoscaleSettings"] = tsgp.AutoscaleSettings
12598 }
12599 return json.Marshal(objectMap)
12600 }
12601
12602
12603 type ThroughputSettingsGetResults struct {
12604 autorest.Response `json:"-"`
12605
12606 *ThroughputSettingsGetProperties `json:"properties,omitempty"`
12607
12608 ID *string `json:"id,omitempty"`
12609
12610 Name *string `json:"name,omitempty"`
12611
12612 Type *string `json:"type,omitempty"`
12613
12614 Location *string `json:"location,omitempty"`
12615 Tags map[string]*string `json:"tags"`
12616 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
12617 }
12618
12619
12620 func (tsgr ThroughputSettingsGetResults) MarshalJSON() ([]byte, error) {
12621 objectMap := make(map[string]interface{})
12622 if tsgr.ThroughputSettingsGetProperties != nil {
12623 objectMap["properties"] = tsgr.ThroughputSettingsGetProperties
12624 }
12625 if tsgr.Location != nil {
12626 objectMap["location"] = tsgr.Location
12627 }
12628 if tsgr.Tags != nil {
12629 objectMap["tags"] = tsgr.Tags
12630 }
12631 if tsgr.Identity != nil {
12632 objectMap["identity"] = tsgr.Identity
12633 }
12634 return json.Marshal(objectMap)
12635 }
12636
12637
12638 func (tsgr *ThroughputSettingsGetResults) UnmarshalJSON(body []byte) error {
12639 var m map[string]*json.RawMessage
12640 err := json.Unmarshal(body, &m)
12641 if err != nil {
12642 return err
12643 }
12644 for k, v := range m {
12645 switch k {
12646 case "properties":
12647 if v != nil {
12648 var throughputSettingsGetProperties ThroughputSettingsGetProperties
12649 err = json.Unmarshal(*v, &throughputSettingsGetProperties)
12650 if err != nil {
12651 return err
12652 }
12653 tsgr.ThroughputSettingsGetProperties = &throughputSettingsGetProperties
12654 }
12655 case "id":
12656 if v != nil {
12657 var ID string
12658 err = json.Unmarshal(*v, &ID)
12659 if err != nil {
12660 return err
12661 }
12662 tsgr.ID = &ID
12663 }
12664 case "name":
12665 if v != nil {
12666 var name string
12667 err = json.Unmarshal(*v, &name)
12668 if err != nil {
12669 return err
12670 }
12671 tsgr.Name = &name
12672 }
12673 case "type":
12674 if v != nil {
12675 var typeVar string
12676 err = json.Unmarshal(*v, &typeVar)
12677 if err != nil {
12678 return err
12679 }
12680 tsgr.Type = &typeVar
12681 }
12682 case "location":
12683 if v != nil {
12684 var location string
12685 err = json.Unmarshal(*v, &location)
12686 if err != nil {
12687 return err
12688 }
12689 tsgr.Location = &location
12690 }
12691 case "tags":
12692 if v != nil {
12693 var tags map[string]*string
12694 err = json.Unmarshal(*v, &tags)
12695 if err != nil {
12696 return err
12697 }
12698 tsgr.Tags = tags
12699 }
12700 case "identity":
12701 if v != nil {
12702 var identity ManagedServiceIdentity
12703 err = json.Unmarshal(*v, &identity)
12704 if err != nil {
12705 return err
12706 }
12707 tsgr.Identity = &identity
12708 }
12709 }
12710 }
12711
12712 return nil
12713 }
12714
12715
12716
12717 type ThroughputSettingsResource struct {
12718
12719 Throughput *int32 `json:"throughput,omitempty"`
12720
12721 AutoscaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"`
12722
12723 MinimumThroughput *string `json:"minimumThroughput,omitempty"`
12724
12725 OfferReplacePending *string `json:"offerReplacePending,omitempty"`
12726 }
12727
12728
12729 func (tsr ThroughputSettingsResource) MarshalJSON() ([]byte, error) {
12730 objectMap := make(map[string]interface{})
12731 if tsr.Throughput != nil {
12732 objectMap["throughput"] = tsr.Throughput
12733 }
12734 if tsr.AutoscaleSettings != nil {
12735 objectMap["autoscaleSettings"] = tsr.AutoscaleSettings
12736 }
12737 return json.Marshal(objectMap)
12738 }
12739
12740
12741 type ThroughputSettingsUpdateParameters struct {
12742
12743 *ThroughputSettingsUpdateProperties `json:"properties,omitempty"`
12744
12745 ID *string `json:"id,omitempty"`
12746
12747 Name *string `json:"name,omitempty"`
12748
12749 Type *string `json:"type,omitempty"`
12750
12751 Location *string `json:"location,omitempty"`
12752 Tags map[string]*string `json:"tags"`
12753 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
12754 }
12755
12756
12757 func (tsup ThroughputSettingsUpdateParameters) MarshalJSON() ([]byte, error) {
12758 objectMap := make(map[string]interface{})
12759 if tsup.ThroughputSettingsUpdateProperties != nil {
12760 objectMap["properties"] = tsup.ThroughputSettingsUpdateProperties
12761 }
12762 if tsup.Location != nil {
12763 objectMap["location"] = tsup.Location
12764 }
12765 if tsup.Tags != nil {
12766 objectMap["tags"] = tsup.Tags
12767 }
12768 if tsup.Identity != nil {
12769 objectMap["identity"] = tsup.Identity
12770 }
12771 return json.Marshal(objectMap)
12772 }
12773
12774
12775 func (tsup *ThroughputSettingsUpdateParameters) UnmarshalJSON(body []byte) error {
12776 var m map[string]*json.RawMessage
12777 err := json.Unmarshal(body, &m)
12778 if err != nil {
12779 return err
12780 }
12781 for k, v := range m {
12782 switch k {
12783 case "properties":
12784 if v != nil {
12785 var throughputSettingsUpdateProperties ThroughputSettingsUpdateProperties
12786 err = json.Unmarshal(*v, &throughputSettingsUpdateProperties)
12787 if err != nil {
12788 return err
12789 }
12790 tsup.ThroughputSettingsUpdateProperties = &throughputSettingsUpdateProperties
12791 }
12792 case "id":
12793 if v != nil {
12794 var ID string
12795 err = json.Unmarshal(*v, &ID)
12796 if err != nil {
12797 return err
12798 }
12799 tsup.ID = &ID
12800 }
12801 case "name":
12802 if v != nil {
12803 var name string
12804 err = json.Unmarshal(*v, &name)
12805 if err != nil {
12806 return err
12807 }
12808 tsup.Name = &name
12809 }
12810 case "type":
12811 if v != nil {
12812 var typeVar string
12813 err = json.Unmarshal(*v, &typeVar)
12814 if err != nil {
12815 return err
12816 }
12817 tsup.Type = &typeVar
12818 }
12819 case "location":
12820 if v != nil {
12821 var location string
12822 err = json.Unmarshal(*v, &location)
12823 if err != nil {
12824 return err
12825 }
12826 tsup.Location = &location
12827 }
12828 case "tags":
12829 if v != nil {
12830 var tags map[string]*string
12831 err = json.Unmarshal(*v, &tags)
12832 if err != nil {
12833 return err
12834 }
12835 tsup.Tags = tags
12836 }
12837 case "identity":
12838 if v != nil {
12839 var identity ManagedServiceIdentity
12840 err = json.Unmarshal(*v, &identity)
12841 if err != nil {
12842 return err
12843 }
12844 tsup.Identity = &identity
12845 }
12846 }
12847 }
12848
12849 return nil
12850 }
12851
12852
12853 type ThroughputSettingsUpdateProperties struct {
12854
12855 Resource *ThroughputSettingsResource `json:"resource,omitempty"`
12856 }
12857
12858
12859
12860 type TrackedResource struct {
12861
12862 Tags map[string]*string `json:"tags"`
12863
12864 Location *string `json:"location,omitempty"`
12865
12866 ID *string `json:"id,omitempty"`
12867
12868 Name *string `json:"name,omitempty"`
12869
12870 Type *string `json:"type,omitempty"`
12871 }
12872
12873
12874 func (tr TrackedResource) MarshalJSON() ([]byte, error) {
12875 objectMap := make(map[string]interface{})
12876 if tr.Tags != nil {
12877 objectMap["tags"] = tr.Tags
12878 }
12879 if tr.Location != nil {
12880 objectMap["location"] = tr.Location
12881 }
12882 return json.Marshal(objectMap)
12883 }
12884
12885
12886
12887 type UniqueKey struct {
12888
12889 Paths *[]string `json:"paths,omitempty"`
12890 }
12891
12892
12893
12894 type UniqueKeyPolicy struct {
12895
12896 UniqueKeys *[]UniqueKey `json:"uniqueKeys,omitempty"`
12897 }
12898
12899
12900 type Usage struct {
12901
12902 Unit UnitType `json:"unit,omitempty"`
12903
12904 Name *MetricName `json:"name,omitempty"`
12905
12906 QuotaPeriod *string `json:"quotaPeriod,omitempty"`
12907
12908 Limit *int64 `json:"limit,omitempty"`
12909
12910 CurrentValue *int64 `json:"currentValue,omitempty"`
12911 }
12912
12913
12914 func (u Usage) MarshalJSON() ([]byte, error) {
12915 objectMap := make(map[string]interface{})
12916 if u.Unit != "" {
12917 objectMap["unit"] = u.Unit
12918 }
12919 return json.Marshal(objectMap)
12920 }
12921
12922
12923 type UsagesResult struct {
12924 autorest.Response `json:"-"`
12925
12926 Value *[]Usage `json:"value,omitempty"`
12927 }
12928
12929
12930 func (ur UsagesResult) MarshalJSON() ([]byte, error) {
12931 objectMap := make(map[string]interface{})
12932 return json.Marshal(objectMap)
12933 }
12934
12935
12936 type VirtualNetworkRule struct {
12937
12938 ID *string `json:"id,omitempty"`
12939
12940 IgnoreMissingVNetServiceEndpoint *bool `json:"ignoreMissingVNetServiceEndpoint,omitempty"`
12941 }
12942
View as plain text