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