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