1 package documentdb
2
3
4
5
6
7
8
9 import (
10 "context"
11 "encoding/json"
12 "github.com/Azure/go-autorest/autorest"
13 "github.com/Azure/go-autorest/autorest/azure"
14 "github.com/Azure/go-autorest/autorest/date"
15 "github.com/Azure/go-autorest/autorest/to"
16 "github.com/Azure/go-autorest/tracing"
17 "net/http"
18 )
19
20
21 const fqdn = "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-10-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 ErrorResponse struct {
3839
3840 Code *string `json:"code,omitempty"`
3841
3842 Message *string `json:"message,omitempty"`
3843 }
3844
3845
3846 type ExcludedPath struct {
3847
3848 Path *string `json:"path,omitempty"`
3849 }
3850
3851
3852
3853 type ExtendedResourceProperties struct {
3854
3855 Rid *string `json:"_rid,omitempty"`
3856
3857 Ts *float64 `json:"_ts,omitempty"`
3858
3859 Etag *string `json:"_etag,omitempty"`
3860 }
3861
3862
3863 func (erp ExtendedResourceProperties) MarshalJSON() ([]byte, error) {
3864 objectMap := make(map[string]interface{})
3865 return json.Marshal(objectMap)
3866 }
3867
3868
3869 type FailoverPolicies struct {
3870
3871 FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"`
3872 }
3873
3874
3875 type FailoverPolicy struct {
3876
3877 ID *string `json:"id,omitempty"`
3878
3879 LocationName *string `json:"locationName,omitempty"`
3880
3881 FailoverPriority *int32 `json:"failoverPriority,omitempty"`
3882 }
3883
3884
3885 func (fp FailoverPolicy) MarshalJSON() ([]byte, error) {
3886 objectMap := make(map[string]interface{})
3887 if fp.LocationName != nil {
3888 objectMap["locationName"] = fp.LocationName
3889 }
3890 if fp.FailoverPriority != nil {
3891 objectMap["failoverPriority"] = fp.FailoverPriority
3892 }
3893 return json.Marshal(objectMap)
3894 }
3895
3896
3897 type GremlinDatabaseCreateUpdateParameters struct {
3898
3899 *GremlinDatabaseCreateUpdateProperties `json:"properties,omitempty"`
3900
3901 ID *string `json:"id,omitempty"`
3902
3903 Name *string `json:"name,omitempty"`
3904
3905 Type *string `json:"type,omitempty"`
3906
3907 Location *string `json:"location,omitempty"`
3908 Tags map[string]*string `json:"tags"`
3909 }
3910
3911
3912 func (gdcup GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) {
3913 objectMap := make(map[string]interface{})
3914 if gdcup.GremlinDatabaseCreateUpdateProperties != nil {
3915 objectMap["properties"] = gdcup.GremlinDatabaseCreateUpdateProperties
3916 }
3917 if gdcup.Location != nil {
3918 objectMap["location"] = gdcup.Location
3919 }
3920 if gdcup.Tags != nil {
3921 objectMap["tags"] = gdcup.Tags
3922 }
3923 return json.Marshal(objectMap)
3924 }
3925
3926
3927 func (gdcup *GremlinDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error {
3928 var m map[string]*json.RawMessage
3929 err := json.Unmarshal(body, &m)
3930 if err != nil {
3931 return err
3932 }
3933 for k, v := range m {
3934 switch k {
3935 case "properties":
3936 if v != nil {
3937 var gremlinDatabaseCreateUpdateProperties GremlinDatabaseCreateUpdateProperties
3938 err = json.Unmarshal(*v, &gremlinDatabaseCreateUpdateProperties)
3939 if err != nil {
3940 return err
3941 }
3942 gdcup.GremlinDatabaseCreateUpdateProperties = &gremlinDatabaseCreateUpdateProperties
3943 }
3944 case "id":
3945 if v != nil {
3946 var ID string
3947 err = json.Unmarshal(*v, &ID)
3948 if err != nil {
3949 return err
3950 }
3951 gdcup.ID = &ID
3952 }
3953 case "name":
3954 if v != nil {
3955 var name string
3956 err = json.Unmarshal(*v, &name)
3957 if err != nil {
3958 return err
3959 }
3960 gdcup.Name = &name
3961 }
3962 case "type":
3963 if v != nil {
3964 var typeVar string
3965 err = json.Unmarshal(*v, &typeVar)
3966 if err != nil {
3967 return err
3968 }
3969 gdcup.Type = &typeVar
3970 }
3971 case "location":
3972 if v != nil {
3973 var location string
3974 err = json.Unmarshal(*v, &location)
3975 if err != nil {
3976 return err
3977 }
3978 gdcup.Location = &location
3979 }
3980 case "tags":
3981 if v != nil {
3982 var tags map[string]*string
3983 err = json.Unmarshal(*v, &tags)
3984 if err != nil {
3985 return err
3986 }
3987 gdcup.Tags = tags
3988 }
3989 }
3990 }
3991
3992 return nil
3993 }
3994
3995
3996 type GremlinDatabaseCreateUpdateProperties struct {
3997
3998 Resource *GremlinDatabaseResource `json:"resource,omitempty"`
3999
4000 Options *CreateUpdateOptions `json:"options,omitempty"`
4001 }
4002
4003
4004 type GremlinDatabaseGetProperties struct {
4005 Resource *GremlinDatabaseGetPropertiesResource `json:"resource,omitempty"`
4006 Options *GremlinDatabaseGetPropertiesOptions `json:"options,omitempty"`
4007 }
4008
4009
4010 type GremlinDatabaseGetPropertiesOptions struct {
4011
4012 Throughput *int32 `json:"throughput,omitempty"`
4013
4014 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
4015 }
4016
4017
4018 type GremlinDatabaseGetPropertiesResource struct {
4019
4020 ID *string `json:"id,omitempty"`
4021
4022 Rid *string `json:"_rid,omitempty"`
4023
4024 Ts *float64 `json:"_ts,omitempty"`
4025
4026 Etag *string `json:"_etag,omitempty"`
4027 }
4028
4029
4030 func (gdgp GremlinDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) {
4031 objectMap := make(map[string]interface{})
4032 if gdgp.ID != nil {
4033 objectMap["id"] = gdgp.ID
4034 }
4035 return json.Marshal(objectMap)
4036 }
4037
4038
4039 type GremlinDatabaseGetResults struct {
4040 autorest.Response `json:"-"`
4041
4042 *GremlinDatabaseGetProperties `json:"properties,omitempty"`
4043
4044 ID *string `json:"id,omitempty"`
4045
4046 Name *string `json:"name,omitempty"`
4047
4048 Type *string `json:"type,omitempty"`
4049
4050 Location *string `json:"location,omitempty"`
4051 Tags map[string]*string `json:"tags"`
4052 }
4053
4054
4055 func (gdgr GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) {
4056 objectMap := make(map[string]interface{})
4057 if gdgr.GremlinDatabaseGetProperties != nil {
4058 objectMap["properties"] = gdgr.GremlinDatabaseGetProperties
4059 }
4060 if gdgr.Location != nil {
4061 objectMap["location"] = gdgr.Location
4062 }
4063 if gdgr.Tags != nil {
4064 objectMap["tags"] = gdgr.Tags
4065 }
4066 return json.Marshal(objectMap)
4067 }
4068
4069
4070 func (gdgr *GremlinDatabaseGetResults) UnmarshalJSON(body []byte) error {
4071 var m map[string]*json.RawMessage
4072 err := json.Unmarshal(body, &m)
4073 if err != nil {
4074 return err
4075 }
4076 for k, v := range m {
4077 switch k {
4078 case "properties":
4079 if v != nil {
4080 var gremlinDatabaseGetProperties GremlinDatabaseGetProperties
4081 err = json.Unmarshal(*v, &gremlinDatabaseGetProperties)
4082 if err != nil {
4083 return err
4084 }
4085 gdgr.GremlinDatabaseGetProperties = &gremlinDatabaseGetProperties
4086 }
4087 case "id":
4088 if v != nil {
4089 var ID string
4090 err = json.Unmarshal(*v, &ID)
4091 if err != nil {
4092 return err
4093 }
4094 gdgr.ID = &ID
4095 }
4096 case "name":
4097 if v != nil {
4098 var name string
4099 err = json.Unmarshal(*v, &name)
4100 if err != nil {
4101 return err
4102 }
4103 gdgr.Name = &name
4104 }
4105 case "type":
4106 if v != nil {
4107 var typeVar string
4108 err = json.Unmarshal(*v, &typeVar)
4109 if err != nil {
4110 return err
4111 }
4112 gdgr.Type = &typeVar
4113 }
4114 case "location":
4115 if v != nil {
4116 var location string
4117 err = json.Unmarshal(*v, &location)
4118 if err != nil {
4119 return err
4120 }
4121 gdgr.Location = &location
4122 }
4123 case "tags":
4124 if v != nil {
4125 var tags map[string]*string
4126 err = json.Unmarshal(*v, &tags)
4127 if err != nil {
4128 return err
4129 }
4130 gdgr.Tags = tags
4131 }
4132 }
4133 }
4134
4135 return nil
4136 }
4137
4138
4139
4140 type GremlinDatabaseListResult struct {
4141 autorest.Response `json:"-"`
4142
4143 Value *[]GremlinDatabaseGetResults `json:"value,omitempty"`
4144 }
4145
4146
4147 func (gdlr GremlinDatabaseListResult) MarshalJSON() ([]byte, error) {
4148 objectMap := make(map[string]interface{})
4149 return json.Marshal(objectMap)
4150 }
4151
4152
4153 type GremlinDatabaseResource struct {
4154
4155 ID *string `json:"id,omitempty"`
4156 }
4157
4158
4159 type GremlinGraphCreateUpdateParameters struct {
4160
4161 *GremlinGraphCreateUpdateProperties `json:"properties,omitempty"`
4162
4163 ID *string `json:"id,omitempty"`
4164
4165 Name *string `json:"name,omitempty"`
4166
4167 Type *string `json:"type,omitempty"`
4168
4169 Location *string `json:"location,omitempty"`
4170 Tags map[string]*string `json:"tags"`
4171 }
4172
4173
4174 func (ggcup GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) {
4175 objectMap := make(map[string]interface{})
4176 if ggcup.GremlinGraphCreateUpdateProperties != nil {
4177 objectMap["properties"] = ggcup.GremlinGraphCreateUpdateProperties
4178 }
4179 if ggcup.Location != nil {
4180 objectMap["location"] = ggcup.Location
4181 }
4182 if ggcup.Tags != nil {
4183 objectMap["tags"] = ggcup.Tags
4184 }
4185 return json.Marshal(objectMap)
4186 }
4187
4188
4189 func (ggcup *GremlinGraphCreateUpdateParameters) UnmarshalJSON(body []byte) error {
4190 var m map[string]*json.RawMessage
4191 err := json.Unmarshal(body, &m)
4192 if err != nil {
4193 return err
4194 }
4195 for k, v := range m {
4196 switch k {
4197 case "properties":
4198 if v != nil {
4199 var gremlinGraphCreateUpdateProperties GremlinGraphCreateUpdateProperties
4200 err = json.Unmarshal(*v, &gremlinGraphCreateUpdateProperties)
4201 if err != nil {
4202 return err
4203 }
4204 ggcup.GremlinGraphCreateUpdateProperties = &gremlinGraphCreateUpdateProperties
4205 }
4206 case "id":
4207 if v != nil {
4208 var ID string
4209 err = json.Unmarshal(*v, &ID)
4210 if err != nil {
4211 return err
4212 }
4213 ggcup.ID = &ID
4214 }
4215 case "name":
4216 if v != nil {
4217 var name string
4218 err = json.Unmarshal(*v, &name)
4219 if err != nil {
4220 return err
4221 }
4222 ggcup.Name = &name
4223 }
4224 case "type":
4225 if v != nil {
4226 var typeVar string
4227 err = json.Unmarshal(*v, &typeVar)
4228 if err != nil {
4229 return err
4230 }
4231 ggcup.Type = &typeVar
4232 }
4233 case "location":
4234 if v != nil {
4235 var location string
4236 err = json.Unmarshal(*v, &location)
4237 if err != nil {
4238 return err
4239 }
4240 ggcup.Location = &location
4241 }
4242 case "tags":
4243 if v != nil {
4244 var tags map[string]*string
4245 err = json.Unmarshal(*v, &tags)
4246 if err != nil {
4247 return err
4248 }
4249 ggcup.Tags = tags
4250 }
4251 }
4252 }
4253
4254 return nil
4255 }
4256
4257
4258 type GremlinGraphCreateUpdateProperties struct {
4259
4260 Resource *GremlinGraphResource `json:"resource,omitempty"`
4261
4262 Options *CreateUpdateOptions `json:"options,omitempty"`
4263 }
4264
4265
4266 type GremlinGraphGetProperties struct {
4267 Resource *GremlinGraphGetPropertiesResource `json:"resource,omitempty"`
4268 Options *GremlinGraphGetPropertiesOptions `json:"options,omitempty"`
4269 }
4270
4271
4272 type GremlinGraphGetPropertiesOptions struct {
4273
4274 Throughput *int32 `json:"throughput,omitempty"`
4275
4276 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
4277 }
4278
4279
4280 type GremlinGraphGetPropertiesResource struct {
4281
4282 ID *string `json:"id,omitempty"`
4283
4284 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
4285
4286 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
4287
4288 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
4289
4290 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
4291
4292 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
4293
4294 Rid *string `json:"_rid,omitempty"`
4295
4296 Ts *float64 `json:"_ts,omitempty"`
4297
4298 Etag *string `json:"_etag,omitempty"`
4299 }
4300
4301
4302 func (gggp GremlinGraphGetPropertiesResource) MarshalJSON() ([]byte, error) {
4303 objectMap := make(map[string]interface{})
4304 if gggp.ID != nil {
4305 objectMap["id"] = gggp.ID
4306 }
4307 if gggp.IndexingPolicy != nil {
4308 objectMap["indexingPolicy"] = gggp.IndexingPolicy
4309 }
4310 if gggp.PartitionKey != nil {
4311 objectMap["partitionKey"] = gggp.PartitionKey
4312 }
4313 if gggp.DefaultTTL != nil {
4314 objectMap["defaultTtl"] = gggp.DefaultTTL
4315 }
4316 if gggp.UniqueKeyPolicy != nil {
4317 objectMap["uniqueKeyPolicy"] = gggp.UniqueKeyPolicy
4318 }
4319 if gggp.ConflictResolutionPolicy != nil {
4320 objectMap["conflictResolutionPolicy"] = gggp.ConflictResolutionPolicy
4321 }
4322 return json.Marshal(objectMap)
4323 }
4324
4325
4326 type GremlinGraphGetResults struct {
4327 autorest.Response `json:"-"`
4328
4329 *GremlinGraphGetProperties `json:"properties,omitempty"`
4330
4331 ID *string `json:"id,omitempty"`
4332
4333 Name *string `json:"name,omitempty"`
4334
4335 Type *string `json:"type,omitempty"`
4336
4337 Location *string `json:"location,omitempty"`
4338 Tags map[string]*string `json:"tags"`
4339 }
4340
4341
4342 func (gggr GremlinGraphGetResults) MarshalJSON() ([]byte, error) {
4343 objectMap := make(map[string]interface{})
4344 if gggr.GremlinGraphGetProperties != nil {
4345 objectMap["properties"] = gggr.GremlinGraphGetProperties
4346 }
4347 if gggr.Location != nil {
4348 objectMap["location"] = gggr.Location
4349 }
4350 if gggr.Tags != nil {
4351 objectMap["tags"] = gggr.Tags
4352 }
4353 return json.Marshal(objectMap)
4354 }
4355
4356
4357 func (gggr *GremlinGraphGetResults) UnmarshalJSON(body []byte) error {
4358 var m map[string]*json.RawMessage
4359 err := json.Unmarshal(body, &m)
4360 if err != nil {
4361 return err
4362 }
4363 for k, v := range m {
4364 switch k {
4365 case "properties":
4366 if v != nil {
4367 var gremlinGraphGetProperties GremlinGraphGetProperties
4368 err = json.Unmarshal(*v, &gremlinGraphGetProperties)
4369 if err != nil {
4370 return err
4371 }
4372 gggr.GremlinGraphGetProperties = &gremlinGraphGetProperties
4373 }
4374 case "id":
4375 if v != nil {
4376 var ID string
4377 err = json.Unmarshal(*v, &ID)
4378 if err != nil {
4379 return err
4380 }
4381 gggr.ID = &ID
4382 }
4383 case "name":
4384 if v != nil {
4385 var name string
4386 err = json.Unmarshal(*v, &name)
4387 if err != nil {
4388 return err
4389 }
4390 gggr.Name = &name
4391 }
4392 case "type":
4393 if v != nil {
4394 var typeVar string
4395 err = json.Unmarshal(*v, &typeVar)
4396 if err != nil {
4397 return err
4398 }
4399 gggr.Type = &typeVar
4400 }
4401 case "location":
4402 if v != nil {
4403 var location string
4404 err = json.Unmarshal(*v, &location)
4405 if err != nil {
4406 return err
4407 }
4408 gggr.Location = &location
4409 }
4410 case "tags":
4411 if v != nil {
4412 var tags map[string]*string
4413 err = json.Unmarshal(*v, &tags)
4414 if err != nil {
4415 return err
4416 }
4417 gggr.Tags = tags
4418 }
4419 }
4420 }
4421
4422 return nil
4423 }
4424
4425
4426 type GremlinGraphListResult struct {
4427 autorest.Response `json:"-"`
4428
4429 Value *[]GremlinGraphGetResults `json:"value,omitempty"`
4430 }
4431
4432
4433 func (gglr GremlinGraphListResult) MarshalJSON() ([]byte, error) {
4434 objectMap := make(map[string]interface{})
4435 return json.Marshal(objectMap)
4436 }
4437
4438
4439 type GremlinGraphResource struct {
4440
4441 ID *string `json:"id,omitempty"`
4442
4443 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
4444
4445 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
4446
4447 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
4448
4449 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
4450
4451 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
4452 }
4453
4454
4455
4456 type GremlinResourcesCreateUpdateGremlinDatabaseFuture struct {
4457 azure.FutureAPI
4458
4459
4460 Result func(GremlinResourcesClient) (GremlinDatabaseGetResults, error)
4461 }
4462
4463
4464 func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) UnmarshalJSON(body []byte) error {
4465 var azFuture azure.Future
4466 if err := json.Unmarshal(body, &azFuture); err != nil {
4467 return err
4468 }
4469 future.FutureAPI = &azFuture
4470 future.Result = future.result
4471 return nil
4472 }
4473
4474
4475 func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) result(client GremlinResourcesClient) (gdgr GremlinDatabaseGetResults, err error) {
4476 var done bool
4477 done, err = future.DoneWithContext(context.Background(), client)
4478 if err != nil {
4479 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", future.Response(), "Polling failure")
4480 return
4481 }
4482 if !done {
4483 gdgr.Response.Response = future.Response()
4484 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture")
4485 return
4486 }
4487 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4488 if gdgr.Response.Response, err = future.GetResult(sender); err == nil && gdgr.Response.Response.StatusCode != http.StatusNoContent {
4489 gdgr, err = client.CreateUpdateGremlinDatabaseResponder(gdgr.Response.Response)
4490 if err != nil {
4491 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", gdgr.Response.Response, "Failure responding to request")
4492 }
4493 }
4494 return
4495 }
4496
4497
4498
4499 type GremlinResourcesCreateUpdateGremlinGraphFuture struct {
4500 azure.FutureAPI
4501
4502
4503 Result func(GremlinResourcesClient) (GremlinGraphGetResults, error)
4504 }
4505
4506
4507 func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) UnmarshalJSON(body []byte) error {
4508 var azFuture azure.Future
4509 if err := json.Unmarshal(body, &azFuture); err != nil {
4510 return err
4511 }
4512 future.FutureAPI = &azFuture
4513 future.Result = future.result
4514 return nil
4515 }
4516
4517
4518 func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) result(client GremlinResourcesClient) (gggr GremlinGraphGetResults, err error) {
4519 var done bool
4520 done, err = future.DoneWithContext(context.Background(), client)
4521 if err != nil {
4522 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", future.Response(), "Polling failure")
4523 return
4524 }
4525 if !done {
4526 gggr.Response.Response = future.Response()
4527 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture")
4528 return
4529 }
4530 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4531 if gggr.Response.Response, err = future.GetResult(sender); err == nil && gggr.Response.Response.StatusCode != http.StatusNoContent {
4532 gggr, err = client.CreateUpdateGremlinGraphResponder(gggr.Response.Response)
4533 if err != nil {
4534 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", gggr.Response.Response, "Failure responding to request")
4535 }
4536 }
4537 return
4538 }
4539
4540
4541
4542 type GremlinResourcesDeleteGremlinDatabaseFuture struct {
4543 azure.FutureAPI
4544
4545
4546 Result func(GremlinResourcesClient) (autorest.Response, error)
4547 }
4548
4549
4550 func (future *GremlinResourcesDeleteGremlinDatabaseFuture) UnmarshalJSON(body []byte) error {
4551 var azFuture azure.Future
4552 if err := json.Unmarshal(body, &azFuture); err != nil {
4553 return err
4554 }
4555 future.FutureAPI = &azFuture
4556 future.Result = future.result
4557 return nil
4558 }
4559
4560
4561 func (future *GremlinResourcesDeleteGremlinDatabaseFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) {
4562 var done bool
4563 done, err = future.DoneWithContext(context.Background(), client)
4564 if err != nil {
4565 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinDatabaseFuture", "Result", future.Response(), "Polling failure")
4566 return
4567 }
4568 if !done {
4569 ar.Response = future.Response()
4570 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinDatabaseFuture")
4571 return
4572 }
4573 ar.Response = future.Response()
4574 return
4575 }
4576
4577
4578
4579 type GremlinResourcesDeleteGremlinGraphFuture struct {
4580 azure.FutureAPI
4581
4582
4583 Result func(GremlinResourcesClient) (autorest.Response, error)
4584 }
4585
4586
4587 func (future *GremlinResourcesDeleteGremlinGraphFuture) UnmarshalJSON(body []byte) error {
4588 var azFuture azure.Future
4589 if err := json.Unmarshal(body, &azFuture); err != nil {
4590 return err
4591 }
4592 future.FutureAPI = &azFuture
4593 future.Result = future.result
4594 return nil
4595 }
4596
4597
4598 func (future *GremlinResourcesDeleteGremlinGraphFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) {
4599 var done bool
4600 done, err = future.DoneWithContext(context.Background(), client)
4601 if err != nil {
4602 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinGraphFuture", "Result", future.Response(), "Polling failure")
4603 return
4604 }
4605 if !done {
4606 ar.Response = future.Response()
4607 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinGraphFuture")
4608 return
4609 }
4610 ar.Response = future.Response()
4611 return
4612 }
4613
4614
4615
4616 type GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture struct {
4617 azure.FutureAPI
4618
4619
4620 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
4621 }
4622
4623
4624 func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error {
4625 var azFuture azure.Future
4626 if err := json.Unmarshal(body, &azFuture); err != nil {
4627 return err
4628 }
4629 future.FutureAPI = &azFuture
4630 future.Result = future.result
4631 return nil
4632 }
4633
4634
4635 func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
4636 var done bool
4637 done, err = future.DoneWithContext(context.Background(), client)
4638 if err != nil {
4639 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure")
4640 return
4641 }
4642 if !done {
4643 tsgr.Response.Response = future.Response()
4644 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture")
4645 return
4646 }
4647 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4648 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
4649 tsgr, err = client.MigrateGremlinDatabaseToAutoscaleResponder(tsgr.Response.Response)
4650 if err != nil {
4651 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
4652 }
4653 }
4654 return
4655 }
4656
4657
4658
4659 type GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture struct {
4660 azure.FutureAPI
4661
4662
4663 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
4664 }
4665
4666
4667 func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error {
4668 var azFuture azure.Future
4669 if err := json.Unmarshal(body, &azFuture); err != nil {
4670 return err
4671 }
4672 future.FutureAPI = &azFuture
4673 future.Result = future.result
4674 return nil
4675 }
4676
4677
4678 func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
4679 var done bool
4680 done, err = future.DoneWithContext(context.Background(), client)
4681 if err != nil {
4682 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure")
4683 return
4684 }
4685 if !done {
4686 tsgr.Response.Response = future.Response()
4687 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture")
4688 return
4689 }
4690 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4691 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
4692 tsgr, err = client.MigrateGremlinDatabaseToManualThroughputResponder(tsgr.Response.Response)
4693 if err != nil {
4694 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
4695 }
4696 }
4697 return
4698 }
4699
4700
4701
4702 type GremlinResourcesMigrateGremlinGraphToAutoscaleFuture struct {
4703 azure.FutureAPI
4704
4705
4706 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
4707 }
4708
4709
4710 func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) UnmarshalJSON(body []byte) error {
4711 var azFuture azure.Future
4712 if err := json.Unmarshal(body, &azFuture); err != nil {
4713 return err
4714 }
4715 future.FutureAPI = &azFuture
4716 future.Result = future.result
4717 return nil
4718 }
4719
4720
4721 func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
4722 var done bool
4723 done, err = future.DoneWithContext(context.Background(), client)
4724 if err != nil {
4725 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", future.Response(), "Polling failure")
4726 return
4727 }
4728 if !done {
4729 tsgr.Response.Response = future.Response()
4730 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture")
4731 return
4732 }
4733 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4734 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
4735 tsgr, err = client.MigrateGremlinGraphToAutoscaleResponder(tsgr.Response.Response)
4736 if err != nil {
4737 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
4738 }
4739 }
4740 return
4741 }
4742
4743
4744
4745 type GremlinResourcesMigrateGremlinGraphToManualThroughputFuture struct {
4746 azure.FutureAPI
4747
4748
4749 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
4750 }
4751
4752
4753 func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) UnmarshalJSON(body []byte) error {
4754 var azFuture azure.Future
4755 if err := json.Unmarshal(body, &azFuture); err != nil {
4756 return err
4757 }
4758 future.FutureAPI = &azFuture
4759 future.Result = future.result
4760 return nil
4761 }
4762
4763
4764 func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
4765 var done bool
4766 done, err = future.DoneWithContext(context.Background(), client)
4767 if err != nil {
4768 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", future.Response(), "Polling failure")
4769 return
4770 }
4771 if !done {
4772 tsgr.Response.Response = future.Response()
4773 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture")
4774 return
4775 }
4776 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4777 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
4778 tsgr, err = client.MigrateGremlinGraphToManualThroughputResponder(tsgr.Response.Response)
4779 if err != nil {
4780 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
4781 }
4782 }
4783 return
4784 }
4785
4786
4787
4788 type GremlinResourcesUpdateGremlinDatabaseThroughputFuture struct {
4789 azure.FutureAPI
4790
4791
4792 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
4793 }
4794
4795
4796 func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) UnmarshalJSON(body []byte) error {
4797 var azFuture azure.Future
4798 if err := json.Unmarshal(body, &azFuture); err != nil {
4799 return err
4800 }
4801 future.FutureAPI = &azFuture
4802 future.Result = future.result
4803 return nil
4804 }
4805
4806
4807 func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
4808 var done bool
4809 done, err = future.DoneWithContext(context.Background(), client)
4810 if err != nil {
4811 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", future.Response(), "Polling failure")
4812 return
4813 }
4814 if !done {
4815 tsgr.Response.Response = future.Response()
4816 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture")
4817 return
4818 }
4819 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4820 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
4821 tsgr, err = client.UpdateGremlinDatabaseThroughputResponder(tsgr.Response.Response)
4822 if err != nil {
4823 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
4824 }
4825 }
4826 return
4827 }
4828
4829
4830
4831 type GremlinResourcesUpdateGremlinGraphThroughputFuture struct {
4832 azure.FutureAPI
4833
4834
4835 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
4836 }
4837
4838
4839 func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) UnmarshalJSON(body []byte) error {
4840 var azFuture azure.Future
4841 if err := json.Unmarshal(body, &azFuture); err != nil {
4842 return err
4843 }
4844 future.FutureAPI = &azFuture
4845 future.Result = future.result
4846 return nil
4847 }
4848
4849
4850 func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
4851 var done bool
4852 done, err = future.DoneWithContext(context.Background(), client)
4853 if err != nil {
4854 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", future.Response(), "Polling failure")
4855 return
4856 }
4857 if !done {
4858 tsgr.Response.Response = future.Response()
4859 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture")
4860 return
4861 }
4862 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4863 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
4864 tsgr, err = client.UpdateGremlinGraphThroughputResponder(tsgr.Response.Response)
4865 if err != nil {
4866 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
4867 }
4868 }
4869 return
4870 }
4871
4872
4873 type IncludedPath struct {
4874
4875 Path *string `json:"path,omitempty"`
4876
4877 Indexes *[]Indexes `json:"indexes,omitempty"`
4878 }
4879
4880
4881 type Indexes struct {
4882
4883 DataType DataType `json:"dataType,omitempty"`
4884
4885 Precision *int32 `json:"precision,omitempty"`
4886
4887 Kind IndexKind `json:"kind,omitempty"`
4888 }
4889
4890
4891 type IndexingPolicy struct {
4892
4893 Automatic *bool `json:"automatic,omitempty"`
4894
4895 IndexingMode IndexingMode `json:"indexingMode,omitempty"`
4896
4897 IncludedPaths *[]IncludedPath `json:"includedPaths,omitempty"`
4898
4899 ExcludedPaths *[]ExcludedPath `json:"excludedPaths,omitempty"`
4900
4901 CompositeIndexes *[][]CompositePath `json:"compositeIndexes,omitempty"`
4902
4903 SpatialIndexes *[]SpatialSpec `json:"spatialIndexes,omitempty"`
4904 }
4905
4906
4907 type IPAddressOrRange struct {
4908
4909 IPAddressOrRange *string `json:"ipAddressOrRange,omitempty"`
4910 }
4911
4912
4913 type ListClusters struct {
4914 autorest.Response `json:"-"`
4915
4916 Value *[]ClusterResource `json:"value,omitempty"`
4917 }
4918
4919
4920 type ListDataCenters struct {
4921 autorest.Response `json:"-"`
4922
4923 Value *[]DataCenterResource `json:"value,omitempty"`
4924 }
4925
4926
4927 func (ldc ListDataCenters) MarshalJSON() ([]byte, error) {
4928 objectMap := make(map[string]interface{})
4929 return json.Marshal(objectMap)
4930 }
4931
4932
4933 type Location struct {
4934
4935 ID *string `json:"id,omitempty"`
4936
4937 LocationName *string `json:"locationName,omitempty"`
4938
4939 DocumentEndpoint *string `json:"documentEndpoint,omitempty"`
4940 ProvisioningState *string `json:"provisioningState,omitempty"`
4941
4942 FailoverPriority *int32 `json:"failoverPriority,omitempty"`
4943
4944 IsZoneRedundant *bool `json:"isZoneRedundant,omitempty"`
4945 }
4946
4947
4948 func (l Location) MarshalJSON() ([]byte, error) {
4949 objectMap := make(map[string]interface{})
4950 if l.LocationName != nil {
4951 objectMap["locationName"] = l.LocationName
4952 }
4953 if l.ProvisioningState != nil {
4954 objectMap["provisioningState"] = l.ProvisioningState
4955 }
4956 if l.FailoverPriority != nil {
4957 objectMap["failoverPriority"] = l.FailoverPriority
4958 }
4959 if l.IsZoneRedundant != nil {
4960 objectMap["isZoneRedundant"] = l.IsZoneRedundant
4961 }
4962 return json.Marshal(objectMap)
4963 }
4964
4965
4966 type LocationGetResult struct {
4967 autorest.Response `json:"-"`
4968
4969 Properties *LocationProperties `json:"properties,omitempty"`
4970
4971 ID *string `json:"id,omitempty"`
4972
4973 Name *string `json:"name,omitempty"`
4974
4975 Type *string `json:"type,omitempty"`
4976 }
4977
4978
4979 func (lgr LocationGetResult) MarshalJSON() ([]byte, error) {
4980 objectMap := make(map[string]interface{})
4981 if lgr.Properties != nil {
4982 objectMap["properties"] = lgr.Properties
4983 }
4984 return json.Marshal(objectMap)
4985 }
4986
4987
4988 type LocationListResult struct {
4989 autorest.Response `json:"-"`
4990
4991 Value *[]LocationGetResult `json:"value,omitempty"`
4992 }
4993
4994
4995 func (llr LocationListResult) MarshalJSON() ([]byte, error) {
4996 objectMap := make(map[string]interface{})
4997 return json.Marshal(objectMap)
4998 }
4999
5000
5001 type LocationProperties struct {
5002
5003 SupportsAvailabilityZone *bool `json:"supportsAvailabilityZone,omitempty"`
5004
5005 IsResidencyRestricted *bool `json:"isResidencyRestricted,omitempty"`
5006
5007 BackupStorageRedundancies *[]BackupStorageRedundancy `json:"backupStorageRedundancies,omitempty"`
5008 }
5009
5010
5011 func (lp LocationProperties) MarshalJSON() ([]byte, error) {
5012 objectMap := make(map[string]interface{})
5013 return json.Marshal(objectMap)
5014 }
5015
5016
5017 type ManagedCassandraARMResourceProperties struct {
5018
5019 ID *string `json:"id,omitempty"`
5020
5021 Name *string `json:"name,omitempty"`
5022
5023 Type *string `json:"type,omitempty"`
5024
5025 Location *string `json:"location,omitempty"`
5026 Tags map[string]*string `json:"tags"`
5027 Identity *ManagedCassandraManagedServiceIdentity `json:"identity,omitempty"`
5028 }
5029
5030
5031 func (mcarp ManagedCassandraARMResourceProperties) MarshalJSON() ([]byte, error) {
5032 objectMap := make(map[string]interface{})
5033 if mcarp.Location != nil {
5034 objectMap["location"] = mcarp.Location
5035 }
5036 if mcarp.Tags != nil {
5037 objectMap["tags"] = mcarp.Tags
5038 }
5039 if mcarp.Identity != nil {
5040 objectMap["identity"] = mcarp.Identity
5041 }
5042 return json.Marshal(objectMap)
5043 }
5044
5045
5046 type ManagedCassandraManagedServiceIdentity struct {
5047
5048 PrincipalID *string `json:"principalId,omitempty"`
5049
5050 TenantID *string `json:"tenantId,omitempty"`
5051
5052 Type ManagedCassandraResourceIdentityType `json:"type,omitempty"`
5053 }
5054
5055
5056 func (mcmsi ManagedCassandraManagedServiceIdentity) MarshalJSON() ([]byte, error) {
5057 objectMap := make(map[string]interface{})
5058 if mcmsi.Type != "" {
5059 objectMap["type"] = mcmsi.Type
5060 }
5061 return json.Marshal(objectMap)
5062 }
5063
5064
5065 type ManagedCassandraReaperStatus struct {
5066 Healthy *bool `json:"healthy,omitempty"`
5067 RepairRunIds map[string]*string `json:"repairRunIds"`
5068 RepairSchedules map[string]*string `json:"repairSchedules"`
5069 }
5070
5071
5072 func (mcrs ManagedCassandraReaperStatus) MarshalJSON() ([]byte, error) {
5073 objectMap := make(map[string]interface{})
5074 if mcrs.Healthy != nil {
5075 objectMap["healthy"] = mcrs.Healthy
5076 }
5077 if mcrs.RepairRunIds != nil {
5078 objectMap["repairRunIds"] = mcrs.RepairRunIds
5079 }
5080 if mcrs.RepairSchedules != nil {
5081 objectMap["repairSchedules"] = mcrs.RepairSchedules
5082 }
5083 return json.Marshal(objectMap)
5084 }
5085
5086
5087 type ManagedServiceIdentity struct {
5088
5089 PrincipalID *string `json:"principalId,omitempty"`
5090
5091 TenantID *string `json:"tenantId,omitempty"`
5092
5093 Type ResourceIdentityType `json:"type,omitempty"`
5094
5095 UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"`
5096 }
5097
5098
5099 func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) {
5100 objectMap := make(map[string]interface{})
5101 if msi.Type != "" {
5102 objectMap["type"] = msi.Type
5103 }
5104 if msi.UserAssignedIdentities != nil {
5105 objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities
5106 }
5107 return json.Marshal(objectMap)
5108 }
5109
5110
5111 type ManagedServiceIdentityUserAssignedIdentitiesValue struct {
5112
5113 PrincipalID *string `json:"principalId,omitempty"`
5114
5115 ClientID *string `json:"clientId,omitempty"`
5116 }
5117
5118
5119 func (msiAiv ManagedServiceIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) {
5120 objectMap := make(map[string]interface{})
5121 return json.Marshal(objectMap)
5122 }
5123
5124
5125 type Metric struct {
5126
5127 StartTime *date.Time `json:"startTime,omitempty"`
5128
5129 EndTime *date.Time `json:"endTime,omitempty"`
5130
5131 TimeGrain *string `json:"timeGrain,omitempty"`
5132
5133 Unit UnitType `json:"unit,omitempty"`
5134
5135 Name *MetricName `json:"name,omitempty"`
5136
5137 MetricValues *[]MetricValue `json:"metricValues,omitempty"`
5138 }
5139
5140
5141 func (mVar Metric) MarshalJSON() ([]byte, error) {
5142 objectMap := make(map[string]interface{})
5143 if mVar.Unit != "" {
5144 objectMap["unit"] = mVar.Unit
5145 }
5146 return json.Marshal(objectMap)
5147 }
5148
5149
5150 type MetricAvailability struct {
5151
5152 TimeGrain *string `json:"timeGrain,omitempty"`
5153
5154 Retention *string `json:"retention,omitempty"`
5155 }
5156
5157
5158 func (ma MetricAvailability) MarshalJSON() ([]byte, error) {
5159 objectMap := make(map[string]interface{})
5160 return json.Marshal(objectMap)
5161 }
5162
5163
5164 type MetricDefinition struct {
5165
5166 MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
5167
5168 PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"`
5169
5170 Unit UnitType `json:"unit,omitempty"`
5171
5172 ResourceURI *string `json:"resourceUri,omitempty"`
5173
5174 Name *MetricName `json:"name,omitempty"`
5175 }
5176
5177
5178 func (md MetricDefinition) MarshalJSON() ([]byte, error) {
5179 objectMap := make(map[string]interface{})
5180 if md.Unit != "" {
5181 objectMap["unit"] = md.Unit
5182 }
5183 return json.Marshal(objectMap)
5184 }
5185
5186
5187 type MetricDefinitionsListResult struct {
5188 autorest.Response `json:"-"`
5189
5190 Value *[]MetricDefinition `json:"value,omitempty"`
5191 }
5192
5193
5194 func (mdlr MetricDefinitionsListResult) MarshalJSON() ([]byte, error) {
5195 objectMap := make(map[string]interface{})
5196 return json.Marshal(objectMap)
5197 }
5198
5199
5200 type MetricListResult struct {
5201 autorest.Response `json:"-"`
5202
5203 Value *[]Metric `json:"value,omitempty"`
5204 }
5205
5206
5207 func (mlr MetricListResult) MarshalJSON() ([]byte, error) {
5208 objectMap := make(map[string]interface{})
5209 return json.Marshal(objectMap)
5210 }
5211
5212
5213 type MetricName struct {
5214
5215 Value *string `json:"value,omitempty"`
5216
5217 LocalizedValue *string `json:"localizedValue,omitempty"`
5218 }
5219
5220
5221 func (mn MetricName) MarshalJSON() ([]byte, error) {
5222 objectMap := make(map[string]interface{})
5223 return json.Marshal(objectMap)
5224 }
5225
5226
5227 type MetricValue struct {
5228
5229 Count *float64 `json:"_count,omitempty"`
5230
5231 Average *float64 `json:"average,omitempty"`
5232
5233 Maximum *float64 `json:"maximum,omitempty"`
5234
5235 Minimum *float64 `json:"minimum,omitempty"`
5236
5237 Timestamp *date.Time `json:"timestamp,omitempty"`
5238
5239 Total *float64 `json:"total,omitempty"`
5240 }
5241
5242
5243 func (mv MetricValue) MarshalJSON() ([]byte, error) {
5244 objectMap := make(map[string]interface{})
5245 return json.Marshal(objectMap)
5246 }
5247
5248
5249 type MongoDBCollectionCreateUpdateParameters struct {
5250
5251 *MongoDBCollectionCreateUpdateProperties `json:"properties,omitempty"`
5252
5253 ID *string `json:"id,omitempty"`
5254
5255 Name *string `json:"name,omitempty"`
5256
5257 Type *string `json:"type,omitempty"`
5258
5259 Location *string `json:"location,omitempty"`
5260 Tags map[string]*string `json:"tags"`
5261 }
5262
5263
5264 func (mdccup MongoDBCollectionCreateUpdateParameters) MarshalJSON() ([]byte, error) {
5265 objectMap := make(map[string]interface{})
5266 if mdccup.MongoDBCollectionCreateUpdateProperties != nil {
5267 objectMap["properties"] = mdccup.MongoDBCollectionCreateUpdateProperties
5268 }
5269 if mdccup.Location != nil {
5270 objectMap["location"] = mdccup.Location
5271 }
5272 if mdccup.Tags != nil {
5273 objectMap["tags"] = mdccup.Tags
5274 }
5275 return json.Marshal(objectMap)
5276 }
5277
5278
5279 func (mdccup *MongoDBCollectionCreateUpdateParameters) UnmarshalJSON(body []byte) error {
5280 var m map[string]*json.RawMessage
5281 err := json.Unmarshal(body, &m)
5282 if err != nil {
5283 return err
5284 }
5285 for k, v := range m {
5286 switch k {
5287 case "properties":
5288 if v != nil {
5289 var mongoDBCollectionCreateUpdateProperties MongoDBCollectionCreateUpdateProperties
5290 err = json.Unmarshal(*v, &mongoDBCollectionCreateUpdateProperties)
5291 if err != nil {
5292 return err
5293 }
5294 mdccup.MongoDBCollectionCreateUpdateProperties = &mongoDBCollectionCreateUpdateProperties
5295 }
5296 case "id":
5297 if v != nil {
5298 var ID string
5299 err = json.Unmarshal(*v, &ID)
5300 if err != nil {
5301 return err
5302 }
5303 mdccup.ID = &ID
5304 }
5305 case "name":
5306 if v != nil {
5307 var name string
5308 err = json.Unmarshal(*v, &name)
5309 if err != nil {
5310 return err
5311 }
5312 mdccup.Name = &name
5313 }
5314 case "type":
5315 if v != nil {
5316 var typeVar string
5317 err = json.Unmarshal(*v, &typeVar)
5318 if err != nil {
5319 return err
5320 }
5321 mdccup.Type = &typeVar
5322 }
5323 case "location":
5324 if v != nil {
5325 var location string
5326 err = json.Unmarshal(*v, &location)
5327 if err != nil {
5328 return err
5329 }
5330 mdccup.Location = &location
5331 }
5332 case "tags":
5333 if v != nil {
5334 var tags map[string]*string
5335 err = json.Unmarshal(*v, &tags)
5336 if err != nil {
5337 return err
5338 }
5339 mdccup.Tags = tags
5340 }
5341 }
5342 }
5343
5344 return nil
5345 }
5346
5347
5348
5349 type MongoDBCollectionCreateUpdateProperties struct {
5350
5351 Resource *MongoDBCollectionResource `json:"resource,omitempty"`
5352
5353 Options *CreateUpdateOptions `json:"options,omitempty"`
5354 }
5355
5356
5357 type MongoDBCollectionGetProperties struct {
5358 Resource *MongoDBCollectionGetPropertiesResource `json:"resource,omitempty"`
5359 Options *MongoDBCollectionGetPropertiesOptions `json:"options,omitempty"`
5360 }
5361
5362
5363 type MongoDBCollectionGetPropertiesOptions struct {
5364
5365 Throughput *int32 `json:"throughput,omitempty"`
5366
5367 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
5368 }
5369
5370
5371 type MongoDBCollectionGetPropertiesResource struct {
5372
5373 ID *string `json:"id,omitempty"`
5374
5375 ShardKey map[string]*string `json:"shardKey"`
5376
5377 Indexes *[]MongoIndex `json:"indexes,omitempty"`
5378
5379 AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"`
5380
5381 Rid *string `json:"_rid,omitempty"`
5382
5383 Ts *float64 `json:"_ts,omitempty"`
5384
5385 Etag *string `json:"_etag,omitempty"`
5386 }
5387
5388
5389 func (mdcgp MongoDBCollectionGetPropertiesResource) MarshalJSON() ([]byte, error) {
5390 objectMap := make(map[string]interface{})
5391 if mdcgp.ID != nil {
5392 objectMap["id"] = mdcgp.ID
5393 }
5394 if mdcgp.ShardKey != nil {
5395 objectMap["shardKey"] = mdcgp.ShardKey
5396 }
5397 if mdcgp.Indexes != nil {
5398 objectMap["indexes"] = mdcgp.Indexes
5399 }
5400 if mdcgp.AnalyticalStorageTTL != nil {
5401 objectMap["analyticalStorageTtl"] = mdcgp.AnalyticalStorageTTL
5402 }
5403 return json.Marshal(objectMap)
5404 }
5405
5406
5407 type MongoDBCollectionGetResults struct {
5408 autorest.Response `json:"-"`
5409
5410 *MongoDBCollectionGetProperties `json:"properties,omitempty"`
5411
5412 ID *string `json:"id,omitempty"`
5413
5414 Name *string `json:"name,omitempty"`
5415
5416 Type *string `json:"type,omitempty"`
5417
5418 Location *string `json:"location,omitempty"`
5419 Tags map[string]*string `json:"tags"`
5420 }
5421
5422
5423 func (mdcgr MongoDBCollectionGetResults) MarshalJSON() ([]byte, error) {
5424 objectMap := make(map[string]interface{})
5425 if mdcgr.MongoDBCollectionGetProperties != nil {
5426 objectMap["properties"] = mdcgr.MongoDBCollectionGetProperties
5427 }
5428 if mdcgr.Location != nil {
5429 objectMap["location"] = mdcgr.Location
5430 }
5431 if mdcgr.Tags != nil {
5432 objectMap["tags"] = mdcgr.Tags
5433 }
5434 return json.Marshal(objectMap)
5435 }
5436
5437
5438 func (mdcgr *MongoDBCollectionGetResults) UnmarshalJSON(body []byte) error {
5439 var m map[string]*json.RawMessage
5440 err := json.Unmarshal(body, &m)
5441 if err != nil {
5442 return err
5443 }
5444 for k, v := range m {
5445 switch k {
5446 case "properties":
5447 if v != nil {
5448 var mongoDBCollectionGetProperties MongoDBCollectionGetProperties
5449 err = json.Unmarshal(*v, &mongoDBCollectionGetProperties)
5450 if err != nil {
5451 return err
5452 }
5453 mdcgr.MongoDBCollectionGetProperties = &mongoDBCollectionGetProperties
5454 }
5455 case "id":
5456 if v != nil {
5457 var ID string
5458 err = json.Unmarshal(*v, &ID)
5459 if err != nil {
5460 return err
5461 }
5462 mdcgr.ID = &ID
5463 }
5464 case "name":
5465 if v != nil {
5466 var name string
5467 err = json.Unmarshal(*v, &name)
5468 if err != nil {
5469 return err
5470 }
5471 mdcgr.Name = &name
5472 }
5473 case "type":
5474 if v != nil {
5475 var typeVar string
5476 err = json.Unmarshal(*v, &typeVar)
5477 if err != nil {
5478 return err
5479 }
5480 mdcgr.Type = &typeVar
5481 }
5482 case "location":
5483 if v != nil {
5484 var location string
5485 err = json.Unmarshal(*v, &location)
5486 if err != nil {
5487 return err
5488 }
5489 mdcgr.Location = &location
5490 }
5491 case "tags":
5492 if v != nil {
5493 var tags map[string]*string
5494 err = json.Unmarshal(*v, &tags)
5495 if err != nil {
5496 return err
5497 }
5498 mdcgr.Tags = tags
5499 }
5500 }
5501 }
5502
5503 return nil
5504 }
5505
5506
5507
5508 type MongoDBCollectionListResult struct {
5509 autorest.Response `json:"-"`
5510
5511 Value *[]MongoDBCollectionGetResults `json:"value,omitempty"`
5512 }
5513
5514
5515 func (mdclr MongoDBCollectionListResult) MarshalJSON() ([]byte, error) {
5516 objectMap := make(map[string]interface{})
5517 return json.Marshal(objectMap)
5518 }
5519
5520
5521 type MongoDBCollectionResource struct {
5522
5523 ID *string `json:"id,omitempty"`
5524
5525 ShardKey map[string]*string `json:"shardKey"`
5526
5527 Indexes *[]MongoIndex `json:"indexes,omitempty"`
5528
5529 AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"`
5530 }
5531
5532
5533 func (mdcr MongoDBCollectionResource) MarshalJSON() ([]byte, error) {
5534 objectMap := make(map[string]interface{})
5535 if mdcr.ID != nil {
5536 objectMap["id"] = mdcr.ID
5537 }
5538 if mdcr.ShardKey != nil {
5539 objectMap["shardKey"] = mdcr.ShardKey
5540 }
5541 if mdcr.Indexes != nil {
5542 objectMap["indexes"] = mdcr.Indexes
5543 }
5544 if mdcr.AnalyticalStorageTTL != nil {
5545 objectMap["analyticalStorageTtl"] = mdcr.AnalyticalStorageTTL
5546 }
5547 return json.Marshal(objectMap)
5548 }
5549
5550
5551 type MongoDBDatabaseCreateUpdateParameters struct {
5552
5553 *MongoDBDatabaseCreateUpdateProperties `json:"properties,omitempty"`
5554
5555 ID *string `json:"id,omitempty"`
5556
5557 Name *string `json:"name,omitempty"`
5558
5559 Type *string `json:"type,omitempty"`
5560
5561 Location *string `json:"location,omitempty"`
5562 Tags map[string]*string `json:"tags"`
5563 }
5564
5565
5566 func (mddcup MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) {
5567 objectMap := make(map[string]interface{})
5568 if mddcup.MongoDBDatabaseCreateUpdateProperties != nil {
5569 objectMap["properties"] = mddcup.MongoDBDatabaseCreateUpdateProperties
5570 }
5571 if mddcup.Location != nil {
5572 objectMap["location"] = mddcup.Location
5573 }
5574 if mddcup.Tags != nil {
5575 objectMap["tags"] = mddcup.Tags
5576 }
5577 return json.Marshal(objectMap)
5578 }
5579
5580
5581 func (mddcup *MongoDBDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error {
5582 var m map[string]*json.RawMessage
5583 err := json.Unmarshal(body, &m)
5584 if err != nil {
5585 return err
5586 }
5587 for k, v := range m {
5588 switch k {
5589 case "properties":
5590 if v != nil {
5591 var mongoDBDatabaseCreateUpdateProperties MongoDBDatabaseCreateUpdateProperties
5592 err = json.Unmarshal(*v, &mongoDBDatabaseCreateUpdateProperties)
5593 if err != nil {
5594 return err
5595 }
5596 mddcup.MongoDBDatabaseCreateUpdateProperties = &mongoDBDatabaseCreateUpdateProperties
5597 }
5598 case "id":
5599 if v != nil {
5600 var ID string
5601 err = json.Unmarshal(*v, &ID)
5602 if err != nil {
5603 return err
5604 }
5605 mddcup.ID = &ID
5606 }
5607 case "name":
5608 if v != nil {
5609 var name string
5610 err = json.Unmarshal(*v, &name)
5611 if err != nil {
5612 return err
5613 }
5614 mddcup.Name = &name
5615 }
5616 case "type":
5617 if v != nil {
5618 var typeVar string
5619 err = json.Unmarshal(*v, &typeVar)
5620 if err != nil {
5621 return err
5622 }
5623 mddcup.Type = &typeVar
5624 }
5625 case "location":
5626 if v != nil {
5627 var location string
5628 err = json.Unmarshal(*v, &location)
5629 if err != nil {
5630 return err
5631 }
5632 mddcup.Location = &location
5633 }
5634 case "tags":
5635 if v != nil {
5636 var tags map[string]*string
5637 err = json.Unmarshal(*v, &tags)
5638 if err != nil {
5639 return err
5640 }
5641 mddcup.Tags = tags
5642 }
5643 }
5644 }
5645
5646 return nil
5647 }
5648
5649
5650 type MongoDBDatabaseCreateUpdateProperties struct {
5651
5652 Resource *MongoDBDatabaseResource `json:"resource,omitempty"`
5653
5654 Options *CreateUpdateOptions `json:"options,omitempty"`
5655 }
5656
5657
5658 type MongoDBDatabaseGetProperties struct {
5659 Resource *MongoDBDatabaseGetPropertiesResource `json:"resource,omitempty"`
5660 Options *MongoDBDatabaseGetPropertiesOptions `json:"options,omitempty"`
5661 }
5662
5663
5664 type MongoDBDatabaseGetPropertiesOptions struct {
5665
5666 Throughput *int32 `json:"throughput,omitempty"`
5667
5668 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
5669 }
5670
5671
5672 type MongoDBDatabaseGetPropertiesResource struct {
5673
5674 ID *string `json:"id,omitempty"`
5675
5676 Rid *string `json:"_rid,omitempty"`
5677
5678 Ts *float64 `json:"_ts,omitempty"`
5679
5680 Etag *string `json:"_etag,omitempty"`
5681 }
5682
5683
5684 func (mddgp MongoDBDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) {
5685 objectMap := make(map[string]interface{})
5686 if mddgp.ID != nil {
5687 objectMap["id"] = mddgp.ID
5688 }
5689 return json.Marshal(objectMap)
5690 }
5691
5692
5693 type MongoDBDatabaseGetResults struct {
5694 autorest.Response `json:"-"`
5695
5696 *MongoDBDatabaseGetProperties `json:"properties,omitempty"`
5697
5698 ID *string `json:"id,omitempty"`
5699
5700 Name *string `json:"name,omitempty"`
5701
5702 Type *string `json:"type,omitempty"`
5703
5704 Location *string `json:"location,omitempty"`
5705 Tags map[string]*string `json:"tags"`
5706 }
5707
5708
5709 func (mddgr MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) {
5710 objectMap := make(map[string]interface{})
5711 if mddgr.MongoDBDatabaseGetProperties != nil {
5712 objectMap["properties"] = mddgr.MongoDBDatabaseGetProperties
5713 }
5714 if mddgr.Location != nil {
5715 objectMap["location"] = mddgr.Location
5716 }
5717 if mddgr.Tags != nil {
5718 objectMap["tags"] = mddgr.Tags
5719 }
5720 return json.Marshal(objectMap)
5721 }
5722
5723
5724 func (mddgr *MongoDBDatabaseGetResults) UnmarshalJSON(body []byte) error {
5725 var m map[string]*json.RawMessage
5726 err := json.Unmarshal(body, &m)
5727 if err != nil {
5728 return err
5729 }
5730 for k, v := range m {
5731 switch k {
5732 case "properties":
5733 if v != nil {
5734 var mongoDBDatabaseGetProperties MongoDBDatabaseGetProperties
5735 err = json.Unmarshal(*v, &mongoDBDatabaseGetProperties)
5736 if err != nil {
5737 return err
5738 }
5739 mddgr.MongoDBDatabaseGetProperties = &mongoDBDatabaseGetProperties
5740 }
5741 case "id":
5742 if v != nil {
5743 var ID string
5744 err = json.Unmarshal(*v, &ID)
5745 if err != nil {
5746 return err
5747 }
5748 mddgr.ID = &ID
5749 }
5750 case "name":
5751 if v != nil {
5752 var name string
5753 err = json.Unmarshal(*v, &name)
5754 if err != nil {
5755 return err
5756 }
5757 mddgr.Name = &name
5758 }
5759 case "type":
5760 if v != nil {
5761 var typeVar string
5762 err = json.Unmarshal(*v, &typeVar)
5763 if err != nil {
5764 return err
5765 }
5766 mddgr.Type = &typeVar
5767 }
5768 case "location":
5769 if v != nil {
5770 var location string
5771 err = json.Unmarshal(*v, &location)
5772 if err != nil {
5773 return err
5774 }
5775 mddgr.Location = &location
5776 }
5777 case "tags":
5778 if v != nil {
5779 var tags map[string]*string
5780 err = json.Unmarshal(*v, &tags)
5781 if err != nil {
5782 return err
5783 }
5784 mddgr.Tags = tags
5785 }
5786 }
5787 }
5788
5789 return nil
5790 }
5791
5792
5793
5794 type MongoDBDatabaseListResult struct {
5795 autorest.Response `json:"-"`
5796
5797 Value *[]MongoDBDatabaseGetResults `json:"value,omitempty"`
5798 }
5799
5800
5801 func (mddlr MongoDBDatabaseListResult) MarshalJSON() ([]byte, error) {
5802 objectMap := make(map[string]interface{})
5803 return json.Marshal(objectMap)
5804 }
5805
5806
5807 type MongoDBDatabaseResource struct {
5808
5809 ID *string `json:"id,omitempty"`
5810 }
5811
5812
5813
5814 type MongoDBResourcesCreateUpdateMongoDBCollectionFuture struct {
5815 azure.FutureAPI
5816
5817
5818 Result func(MongoDBResourcesClient) (MongoDBCollectionGetResults, error)
5819 }
5820
5821
5822 func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) UnmarshalJSON(body []byte) error {
5823 var azFuture azure.Future
5824 if err := json.Unmarshal(body, &azFuture); err != nil {
5825 return err
5826 }
5827 future.FutureAPI = &azFuture
5828 future.Result = future.result
5829 return nil
5830 }
5831
5832
5833 func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) result(client MongoDBResourcesClient) (mdcgr MongoDBCollectionGetResults, err error) {
5834 var done bool
5835 done, err = future.DoneWithContext(context.Background(), client)
5836 if err != nil {
5837 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", future.Response(), "Polling failure")
5838 return
5839 }
5840 if !done {
5841 mdcgr.Response.Response = future.Response()
5842 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture")
5843 return
5844 }
5845 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5846 if mdcgr.Response.Response, err = future.GetResult(sender); err == nil && mdcgr.Response.Response.StatusCode != http.StatusNoContent {
5847 mdcgr, err = client.CreateUpdateMongoDBCollectionResponder(mdcgr.Response.Response)
5848 if err != nil {
5849 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", mdcgr.Response.Response, "Failure responding to request")
5850 }
5851 }
5852 return
5853 }
5854
5855
5856
5857 type MongoDBResourcesCreateUpdateMongoDBDatabaseFuture struct {
5858 azure.FutureAPI
5859
5860
5861 Result func(MongoDBResourcesClient) (MongoDBDatabaseGetResults, error)
5862 }
5863
5864
5865 func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error {
5866 var azFuture azure.Future
5867 if err := json.Unmarshal(body, &azFuture); err != nil {
5868 return err
5869 }
5870 future.FutureAPI = &azFuture
5871 future.Result = future.result
5872 return nil
5873 }
5874
5875
5876 func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (mddgr MongoDBDatabaseGetResults, err error) {
5877 var done bool
5878 done, err = future.DoneWithContext(context.Background(), client)
5879 if err != nil {
5880 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure")
5881 return
5882 }
5883 if !done {
5884 mddgr.Response.Response = future.Response()
5885 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture")
5886 return
5887 }
5888 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5889 if mddgr.Response.Response, err = future.GetResult(sender); err == nil && mddgr.Response.Response.StatusCode != http.StatusNoContent {
5890 mddgr, err = client.CreateUpdateMongoDBDatabaseResponder(mddgr.Response.Response)
5891 if err != nil {
5892 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", mddgr.Response.Response, "Failure responding to request")
5893 }
5894 }
5895 return
5896 }
5897
5898
5899
5900 type MongoDBResourcesDeleteMongoDBCollectionFuture struct {
5901 azure.FutureAPI
5902
5903
5904 Result func(MongoDBResourcesClient) (autorest.Response, error)
5905 }
5906
5907
5908 func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) UnmarshalJSON(body []byte) error {
5909 var azFuture azure.Future
5910 if err := json.Unmarshal(body, &azFuture); err != nil {
5911 return err
5912 }
5913 future.FutureAPI = &azFuture
5914 future.Result = future.result
5915 return nil
5916 }
5917
5918
5919 func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) {
5920 var done bool
5921 done, err = future.DoneWithContext(context.Background(), client)
5922 if err != nil {
5923 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture", "Result", future.Response(), "Polling failure")
5924 return
5925 }
5926 if !done {
5927 ar.Response = future.Response()
5928 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture")
5929 return
5930 }
5931 ar.Response = future.Response()
5932 return
5933 }
5934
5935
5936
5937 type MongoDBResourcesDeleteMongoDBDatabaseFuture struct {
5938 azure.FutureAPI
5939
5940
5941 Result func(MongoDBResourcesClient) (autorest.Response, error)
5942 }
5943
5944
5945 func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error {
5946 var azFuture azure.Future
5947 if err := json.Unmarshal(body, &azFuture); err != nil {
5948 return err
5949 }
5950 future.FutureAPI = &azFuture
5951 future.Result = future.result
5952 return nil
5953 }
5954
5955
5956 func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) {
5957 var done bool
5958 done, err = future.DoneWithContext(context.Background(), client)
5959 if err != nil {
5960 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure")
5961 return
5962 }
5963 if !done {
5964 ar.Response = future.Response()
5965 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture")
5966 return
5967 }
5968 ar.Response = future.Response()
5969 return
5970 }
5971
5972
5973
5974 type MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture struct {
5975 azure.FutureAPI
5976
5977
5978 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
5979 }
5980
5981
5982 func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) UnmarshalJSON(body []byte) error {
5983 var azFuture azure.Future
5984 if err := json.Unmarshal(body, &azFuture); err != nil {
5985 return err
5986 }
5987 future.FutureAPI = &azFuture
5988 future.Result = future.result
5989 return nil
5990 }
5991
5992
5993 func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
5994 var done bool
5995 done, err = future.DoneWithContext(context.Background(), client)
5996 if err != nil {
5997 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", future.Response(), "Polling failure")
5998 return
5999 }
6000 if !done {
6001 tsgr.Response.Response = future.Response()
6002 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture")
6003 return
6004 }
6005 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6006 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6007 tsgr, err = client.MigrateMongoDBCollectionToAutoscaleResponder(tsgr.Response.Response)
6008 if err != nil {
6009 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6010 }
6011 }
6012 return
6013 }
6014
6015
6016
6017 type MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture struct {
6018 azure.FutureAPI
6019
6020
6021 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
6022 }
6023
6024
6025 func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) UnmarshalJSON(body []byte) error {
6026 var azFuture azure.Future
6027 if err := json.Unmarshal(body, &azFuture); err != nil {
6028 return err
6029 }
6030 future.FutureAPI = &azFuture
6031 future.Result = future.result
6032 return nil
6033 }
6034
6035
6036 func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
6037 var done bool
6038 done, err = future.DoneWithContext(context.Background(), client)
6039 if err != nil {
6040 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", future.Response(), "Polling failure")
6041 return
6042 }
6043 if !done {
6044 tsgr.Response.Response = future.Response()
6045 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture")
6046 return
6047 }
6048 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6049 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6050 tsgr, err = client.MigrateMongoDBCollectionToManualThroughputResponder(tsgr.Response.Response)
6051 if err != nil {
6052 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6053 }
6054 }
6055 return
6056 }
6057
6058
6059
6060 type MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture struct {
6061 azure.FutureAPI
6062
6063
6064 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
6065 }
6066
6067
6068 func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error {
6069 var azFuture azure.Future
6070 if err := json.Unmarshal(body, &azFuture); err != nil {
6071 return err
6072 }
6073 future.FutureAPI = &azFuture
6074 future.Result = future.result
6075 return nil
6076 }
6077
6078
6079 func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
6080 var done bool
6081 done, err = future.DoneWithContext(context.Background(), client)
6082 if err != nil {
6083 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure")
6084 return
6085 }
6086 if !done {
6087 tsgr.Response.Response = future.Response()
6088 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture")
6089 return
6090 }
6091 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6092 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6093 tsgr, err = client.MigrateMongoDBDatabaseToAutoscaleResponder(tsgr.Response.Response)
6094 if err != nil {
6095 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6096 }
6097 }
6098 return
6099 }
6100
6101
6102
6103 type MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture struct {
6104 azure.FutureAPI
6105
6106
6107 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
6108 }
6109
6110
6111 func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error {
6112 var azFuture azure.Future
6113 if err := json.Unmarshal(body, &azFuture); err != nil {
6114 return err
6115 }
6116 future.FutureAPI = &azFuture
6117 future.Result = future.result
6118 return nil
6119 }
6120
6121
6122 func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
6123 var done bool
6124 done, err = future.DoneWithContext(context.Background(), client)
6125 if err != nil {
6126 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure")
6127 return
6128 }
6129 if !done {
6130 tsgr.Response.Response = future.Response()
6131 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture")
6132 return
6133 }
6134 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6135 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6136 tsgr, err = client.MigrateMongoDBDatabaseToManualThroughputResponder(tsgr.Response.Response)
6137 if err != nil {
6138 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6139 }
6140 }
6141 return
6142 }
6143
6144
6145
6146 type MongoDBResourcesRetrieveContinuousBackupInformationFuture struct {
6147 azure.FutureAPI
6148
6149
6150 Result func(MongoDBResourcesClient) (BackupInformation, error)
6151 }
6152
6153
6154 func (future *MongoDBResourcesRetrieveContinuousBackupInformationFuture) UnmarshalJSON(body []byte) error {
6155 var azFuture azure.Future
6156 if err := json.Unmarshal(body, &azFuture); err != nil {
6157 return err
6158 }
6159 future.FutureAPI = &azFuture
6160 future.Result = future.result
6161 return nil
6162 }
6163
6164
6165 func (future *MongoDBResourcesRetrieveContinuousBackupInformationFuture) result(client MongoDBResourcesClient) (bi BackupInformation, err error) {
6166 var done bool
6167 done, err = future.DoneWithContext(context.Background(), client)
6168 if err != nil {
6169 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesRetrieveContinuousBackupInformationFuture", "Result", future.Response(), "Polling failure")
6170 return
6171 }
6172 if !done {
6173 bi.Response.Response = future.Response()
6174 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesRetrieveContinuousBackupInformationFuture")
6175 return
6176 }
6177 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6178 if bi.Response.Response, err = future.GetResult(sender); err == nil && bi.Response.Response.StatusCode != http.StatusNoContent {
6179 bi, err = client.RetrieveContinuousBackupInformationResponder(bi.Response.Response)
6180 if err != nil {
6181 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesRetrieveContinuousBackupInformationFuture", "Result", bi.Response.Response, "Failure responding to request")
6182 }
6183 }
6184 return
6185 }
6186
6187
6188
6189 type MongoDBResourcesUpdateMongoDBCollectionThroughputFuture struct {
6190 azure.FutureAPI
6191
6192
6193 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
6194 }
6195
6196
6197 func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) UnmarshalJSON(body []byte) error {
6198 var azFuture azure.Future
6199 if err := json.Unmarshal(body, &azFuture); err != nil {
6200 return err
6201 }
6202 future.FutureAPI = &azFuture
6203 future.Result = future.result
6204 return nil
6205 }
6206
6207
6208 func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
6209 var done bool
6210 done, err = future.DoneWithContext(context.Background(), client)
6211 if err != nil {
6212 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", future.Response(), "Polling failure")
6213 return
6214 }
6215 if !done {
6216 tsgr.Response.Response = future.Response()
6217 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture")
6218 return
6219 }
6220 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6221 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6222 tsgr, err = client.UpdateMongoDBCollectionThroughputResponder(tsgr.Response.Response)
6223 if err != nil {
6224 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6225 }
6226 }
6227 return
6228 }
6229
6230
6231
6232 type MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture struct {
6233 azure.FutureAPI
6234
6235
6236 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
6237 }
6238
6239
6240 func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) UnmarshalJSON(body []byte) error {
6241 var azFuture azure.Future
6242 if err := json.Unmarshal(body, &azFuture); err != nil {
6243 return err
6244 }
6245 future.FutureAPI = &azFuture
6246 future.Result = future.result
6247 return nil
6248 }
6249
6250
6251 func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
6252 var done bool
6253 done, err = future.DoneWithContext(context.Background(), client)
6254 if err != nil {
6255 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", future.Response(), "Polling failure")
6256 return
6257 }
6258 if !done {
6259 tsgr.Response.Response = future.Response()
6260 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture")
6261 return
6262 }
6263 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6264 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6265 tsgr, err = client.UpdateMongoDBDatabaseThroughputResponder(tsgr.Response.Response)
6266 if err != nil {
6267 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6268 }
6269 }
6270 return
6271 }
6272
6273
6274 type MongoIndex struct {
6275
6276 Key *MongoIndexKeys `json:"key,omitempty"`
6277
6278 Options *MongoIndexOptions `json:"options,omitempty"`
6279 }
6280
6281
6282 type MongoIndexKeys struct {
6283
6284 Keys *[]string `json:"keys,omitempty"`
6285 }
6286
6287
6288 type MongoIndexOptions struct {
6289
6290 ExpireAfterSeconds *int32 `json:"expireAfterSeconds,omitempty"`
6291
6292 Unique *bool `json:"unique,omitempty"`
6293 }
6294
6295
6296 type NotebookWorkspace struct {
6297 autorest.Response `json:"-"`
6298
6299 *NotebookWorkspaceProperties `json:"properties,omitempty"`
6300
6301 ID *string `json:"id,omitempty"`
6302
6303 Name *string `json:"name,omitempty"`
6304
6305 Type *string `json:"type,omitempty"`
6306 }
6307
6308
6309 func (nw NotebookWorkspace) MarshalJSON() ([]byte, error) {
6310 objectMap := make(map[string]interface{})
6311 if nw.NotebookWorkspaceProperties != nil {
6312 objectMap["properties"] = nw.NotebookWorkspaceProperties
6313 }
6314 return json.Marshal(objectMap)
6315 }
6316
6317
6318 func (nw *NotebookWorkspace) UnmarshalJSON(body []byte) error {
6319 var m map[string]*json.RawMessage
6320 err := json.Unmarshal(body, &m)
6321 if err != nil {
6322 return err
6323 }
6324 for k, v := range m {
6325 switch k {
6326 case "properties":
6327 if v != nil {
6328 var notebookWorkspaceProperties NotebookWorkspaceProperties
6329 err = json.Unmarshal(*v, ¬ebookWorkspaceProperties)
6330 if err != nil {
6331 return err
6332 }
6333 nw.NotebookWorkspaceProperties = ¬ebookWorkspaceProperties
6334 }
6335 case "id":
6336 if v != nil {
6337 var ID string
6338 err = json.Unmarshal(*v, &ID)
6339 if err != nil {
6340 return err
6341 }
6342 nw.ID = &ID
6343 }
6344 case "name":
6345 if v != nil {
6346 var name string
6347 err = json.Unmarshal(*v, &name)
6348 if err != nil {
6349 return err
6350 }
6351 nw.Name = &name
6352 }
6353 case "type":
6354 if v != nil {
6355 var typeVar string
6356 err = json.Unmarshal(*v, &typeVar)
6357 if err != nil {
6358 return err
6359 }
6360 nw.Type = &typeVar
6361 }
6362 }
6363 }
6364
6365 return nil
6366 }
6367
6368
6369 type NotebookWorkspaceConnectionInfoResult struct {
6370 autorest.Response `json:"-"`
6371
6372 AuthToken *string `json:"authToken,omitempty"`
6373
6374 NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"`
6375 }
6376
6377
6378 func (nwcir NotebookWorkspaceConnectionInfoResult) MarshalJSON() ([]byte, error) {
6379 objectMap := make(map[string]interface{})
6380 return json.Marshal(objectMap)
6381 }
6382
6383
6384 type NotebookWorkspaceCreateUpdateParameters struct {
6385
6386 ID *string `json:"id,omitempty"`
6387
6388 Name *string `json:"name,omitempty"`
6389
6390 Type *string `json:"type,omitempty"`
6391 }
6392
6393
6394 func (nwcup NotebookWorkspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) {
6395 objectMap := make(map[string]interface{})
6396 return json.Marshal(objectMap)
6397 }
6398
6399
6400 type NotebookWorkspaceListResult struct {
6401 autorest.Response `json:"-"`
6402
6403 Value *[]NotebookWorkspace `json:"value,omitempty"`
6404 }
6405
6406
6407 type NotebookWorkspaceProperties struct {
6408
6409 NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"`
6410
6411 Status *string `json:"status,omitempty"`
6412 }
6413
6414
6415 func (nwp NotebookWorkspaceProperties) MarshalJSON() ([]byte, error) {
6416 objectMap := make(map[string]interface{})
6417 return json.Marshal(objectMap)
6418 }
6419
6420
6421
6422 type NotebookWorkspacesCreateOrUpdateFuture struct {
6423 azure.FutureAPI
6424
6425
6426 Result func(NotebookWorkspacesClient) (NotebookWorkspace, error)
6427 }
6428
6429
6430 func (future *NotebookWorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
6431 var azFuture azure.Future
6432 if err := json.Unmarshal(body, &azFuture); err != nil {
6433 return err
6434 }
6435 future.FutureAPI = &azFuture
6436 future.Result = future.result
6437 return nil
6438 }
6439
6440
6441 func (future *NotebookWorkspacesCreateOrUpdateFuture) result(client NotebookWorkspacesClient) (nw NotebookWorkspace, err error) {
6442 var done bool
6443 done, err = future.DoneWithContext(context.Background(), client)
6444 if err != nil {
6445 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
6446 return
6447 }
6448 if !done {
6449 nw.Response.Response = future.Response()
6450 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesCreateOrUpdateFuture")
6451 return
6452 }
6453 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6454 if nw.Response.Response, err = future.GetResult(sender); err == nil && nw.Response.Response.StatusCode != http.StatusNoContent {
6455 nw, err = client.CreateOrUpdateResponder(nw.Response.Response)
6456 if err != nil {
6457 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", nw.Response.Response, "Failure responding to request")
6458 }
6459 }
6460 return
6461 }
6462
6463
6464
6465 type NotebookWorkspacesDeleteFuture struct {
6466 azure.FutureAPI
6467
6468
6469 Result func(NotebookWorkspacesClient) (autorest.Response, error)
6470 }
6471
6472
6473 func (future *NotebookWorkspacesDeleteFuture) UnmarshalJSON(body []byte) error {
6474 var azFuture azure.Future
6475 if err := json.Unmarshal(body, &azFuture); err != nil {
6476 return err
6477 }
6478 future.FutureAPI = &azFuture
6479 future.Result = future.result
6480 return nil
6481 }
6482
6483
6484 func (future *NotebookWorkspacesDeleteFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) {
6485 var done bool
6486 done, err = future.DoneWithContext(context.Background(), client)
6487 if err != nil {
6488 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesDeleteFuture", "Result", future.Response(), "Polling failure")
6489 return
6490 }
6491 if !done {
6492 ar.Response = future.Response()
6493 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesDeleteFuture")
6494 return
6495 }
6496 ar.Response = future.Response()
6497 return
6498 }
6499
6500
6501
6502 type NotebookWorkspacesRegenerateAuthTokenFuture struct {
6503 azure.FutureAPI
6504
6505
6506 Result func(NotebookWorkspacesClient) (autorest.Response, error)
6507 }
6508
6509
6510 func (future *NotebookWorkspacesRegenerateAuthTokenFuture) UnmarshalJSON(body []byte) error {
6511 var azFuture azure.Future
6512 if err := json.Unmarshal(body, &azFuture); err != nil {
6513 return err
6514 }
6515 future.FutureAPI = &azFuture
6516 future.Result = future.result
6517 return nil
6518 }
6519
6520
6521 func (future *NotebookWorkspacesRegenerateAuthTokenFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) {
6522 var done bool
6523 done, err = future.DoneWithContext(context.Background(), client)
6524 if err != nil {
6525 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesRegenerateAuthTokenFuture", "Result", future.Response(), "Polling failure")
6526 return
6527 }
6528 if !done {
6529 ar.Response = future.Response()
6530 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesRegenerateAuthTokenFuture")
6531 return
6532 }
6533 ar.Response = future.Response()
6534 return
6535 }
6536
6537
6538
6539 type NotebookWorkspacesStartFuture struct {
6540 azure.FutureAPI
6541
6542
6543 Result func(NotebookWorkspacesClient) (autorest.Response, error)
6544 }
6545
6546
6547 func (future *NotebookWorkspacesStartFuture) UnmarshalJSON(body []byte) error {
6548 var azFuture azure.Future
6549 if err := json.Unmarshal(body, &azFuture); err != nil {
6550 return err
6551 }
6552 future.FutureAPI = &azFuture
6553 future.Result = future.result
6554 return nil
6555 }
6556
6557
6558 func (future *NotebookWorkspacesStartFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) {
6559 var done bool
6560 done, err = future.DoneWithContext(context.Background(), client)
6561 if err != nil {
6562 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesStartFuture", "Result", future.Response(), "Polling failure")
6563 return
6564 }
6565 if !done {
6566 ar.Response = future.Response()
6567 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesStartFuture")
6568 return
6569 }
6570 ar.Response = future.Response()
6571 return
6572 }
6573
6574
6575 type Operation struct {
6576
6577 Name *string `json:"name,omitempty"`
6578
6579 Display *OperationDisplay `json:"display,omitempty"`
6580 }
6581
6582
6583 type OperationDisplay struct {
6584
6585 Provider *string `json:"Provider,omitempty"`
6586
6587 Resource *string `json:"Resource,omitempty"`
6588
6589 Operation *string `json:"Operation,omitempty"`
6590
6591 Description *string `json:"Description,omitempty"`
6592 }
6593
6594
6595
6596 type OperationListResult struct {
6597 autorest.Response `json:"-"`
6598
6599 Value *[]Operation `json:"value,omitempty"`
6600
6601 NextLink *string `json:"nextLink,omitempty"`
6602 }
6603
6604
6605 type OperationListResultIterator struct {
6606 i int
6607 page OperationListResultPage
6608 }
6609
6610
6611
6612 func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
6613 if tracing.IsEnabled() {
6614 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
6615 defer func() {
6616 sc := -1
6617 if iter.Response().Response.Response != nil {
6618 sc = iter.Response().Response.Response.StatusCode
6619 }
6620 tracing.EndSpan(ctx, sc, err)
6621 }()
6622 }
6623 iter.i++
6624 if iter.i < len(iter.page.Values()) {
6625 return nil
6626 }
6627 err = iter.page.NextWithContext(ctx)
6628 if err != nil {
6629 iter.i--
6630 return err
6631 }
6632 iter.i = 0
6633 return nil
6634 }
6635
6636
6637
6638
6639 func (iter *OperationListResultIterator) Next() error {
6640 return iter.NextWithContext(context.Background())
6641 }
6642
6643
6644 func (iter OperationListResultIterator) NotDone() bool {
6645 return iter.page.NotDone() && iter.i < len(iter.page.Values())
6646 }
6647
6648
6649 func (iter OperationListResultIterator) Response() OperationListResult {
6650 return iter.page.Response()
6651 }
6652
6653
6654
6655 func (iter OperationListResultIterator) Value() Operation {
6656 if !iter.page.NotDone() {
6657 return Operation{}
6658 }
6659 return iter.page.Values()[iter.i]
6660 }
6661
6662
6663 func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
6664 return OperationListResultIterator{page: page}
6665 }
6666
6667
6668 func (olr OperationListResult) IsEmpty() bool {
6669 return olr.Value == nil || len(*olr.Value) == 0
6670 }
6671
6672
6673 func (olr OperationListResult) hasNextLink() bool {
6674 return olr.NextLink != nil && len(*olr.NextLink) != 0
6675 }
6676
6677
6678
6679 func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
6680 if !olr.hasNextLink() {
6681 return nil, nil
6682 }
6683 return autorest.Prepare((&http.Request{}).WithContext(ctx),
6684 autorest.AsJSON(),
6685 autorest.AsGet(),
6686 autorest.WithBaseURL(to.String(olr.NextLink)))
6687 }
6688
6689
6690 type OperationListResultPage struct {
6691 fn func(context.Context, OperationListResult) (OperationListResult, error)
6692 olr OperationListResult
6693 }
6694
6695
6696
6697 func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
6698 if tracing.IsEnabled() {
6699 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
6700 defer func() {
6701 sc := -1
6702 if page.Response().Response.Response != nil {
6703 sc = page.Response().Response.Response.StatusCode
6704 }
6705 tracing.EndSpan(ctx, sc, err)
6706 }()
6707 }
6708 for {
6709 next, err := page.fn(ctx, page.olr)
6710 if err != nil {
6711 return err
6712 }
6713 page.olr = next
6714 if !next.hasNextLink() || !next.IsEmpty() {
6715 break
6716 }
6717 }
6718 return nil
6719 }
6720
6721
6722
6723
6724 func (page *OperationListResultPage) Next() error {
6725 return page.NextWithContext(context.Background())
6726 }
6727
6728
6729 func (page OperationListResultPage) NotDone() bool {
6730 return !page.olr.IsEmpty()
6731 }
6732
6733
6734 func (page OperationListResultPage) Response() OperationListResult {
6735 return page.olr
6736 }
6737
6738
6739 func (page OperationListResultPage) Values() []Operation {
6740 if page.olr.IsEmpty() {
6741 return nil
6742 }
6743 return *page.olr.Value
6744 }
6745
6746
6747 func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
6748 return OperationListResultPage{
6749 fn: getNextPage,
6750 olr: cur,
6751 }
6752 }
6753
6754
6755 type OptionsResource struct {
6756
6757 Throughput *int32 `json:"throughput,omitempty"`
6758
6759 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
6760 }
6761
6762
6763 type PartitionMetric struct {
6764
6765 PartitionID *string `json:"partitionId,omitempty"`
6766
6767 PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"`
6768
6769 StartTime *date.Time `json:"startTime,omitempty"`
6770
6771 EndTime *date.Time `json:"endTime,omitempty"`
6772
6773 TimeGrain *string `json:"timeGrain,omitempty"`
6774
6775 Unit UnitType `json:"unit,omitempty"`
6776
6777 Name *MetricName `json:"name,omitempty"`
6778
6779 MetricValues *[]MetricValue `json:"metricValues,omitempty"`
6780 }
6781
6782
6783 func (pm PartitionMetric) MarshalJSON() ([]byte, error) {
6784 objectMap := make(map[string]interface{})
6785 if pm.Unit != "" {
6786 objectMap["unit"] = pm.Unit
6787 }
6788 return json.Marshal(objectMap)
6789 }
6790
6791
6792 type PartitionMetricListResult struct {
6793 autorest.Response `json:"-"`
6794
6795 Value *[]PartitionMetric `json:"value,omitempty"`
6796 }
6797
6798
6799 func (pmlr PartitionMetricListResult) MarshalJSON() ([]byte, error) {
6800 objectMap := make(map[string]interface{})
6801 return json.Marshal(objectMap)
6802 }
6803
6804
6805 type PartitionUsage struct {
6806
6807 PartitionID *string `json:"partitionId,omitempty"`
6808
6809 PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"`
6810
6811 Unit UnitType `json:"unit,omitempty"`
6812
6813 Name *MetricName `json:"name,omitempty"`
6814
6815 QuotaPeriod *string `json:"quotaPeriod,omitempty"`
6816
6817 Limit *int64 `json:"limit,omitempty"`
6818
6819 CurrentValue *int64 `json:"currentValue,omitempty"`
6820 }
6821
6822
6823 func (pu PartitionUsage) MarshalJSON() ([]byte, error) {
6824 objectMap := make(map[string]interface{})
6825 if pu.Unit != "" {
6826 objectMap["unit"] = pu.Unit
6827 }
6828 return json.Marshal(objectMap)
6829 }
6830
6831
6832 type PartitionUsagesResult struct {
6833 autorest.Response `json:"-"`
6834
6835 Value *[]PartitionUsage `json:"value,omitempty"`
6836 }
6837
6838
6839 func (pur PartitionUsagesResult) MarshalJSON() ([]byte, error) {
6840 objectMap := make(map[string]interface{})
6841 return json.Marshal(objectMap)
6842 }
6843
6844
6845 type PercentileMetric struct {
6846
6847 StartTime *date.Time `json:"startTime,omitempty"`
6848
6849 EndTime *date.Time `json:"endTime,omitempty"`
6850
6851 TimeGrain *string `json:"timeGrain,omitempty"`
6852
6853 Unit UnitType `json:"unit,omitempty"`
6854
6855 Name *MetricName `json:"name,omitempty"`
6856
6857 MetricValues *[]PercentileMetricValue `json:"metricValues,omitempty"`
6858 }
6859
6860
6861 func (pm PercentileMetric) MarshalJSON() ([]byte, error) {
6862 objectMap := make(map[string]interface{})
6863 if pm.Unit != "" {
6864 objectMap["unit"] = pm.Unit
6865 }
6866 return json.Marshal(objectMap)
6867 }
6868
6869
6870 type PercentileMetricListResult struct {
6871 autorest.Response `json:"-"`
6872
6873 Value *[]PercentileMetric `json:"value,omitempty"`
6874 }
6875
6876
6877 func (pmlr PercentileMetricListResult) MarshalJSON() ([]byte, error) {
6878 objectMap := make(map[string]interface{})
6879 return json.Marshal(objectMap)
6880 }
6881
6882
6883 type PercentileMetricValue struct {
6884
6885 P10 *float64 `json:"P10,omitempty"`
6886
6887 P25 *float64 `json:"P25,omitempty"`
6888
6889 P50 *float64 `json:"P50,omitempty"`
6890
6891 P75 *float64 `json:"P75,omitempty"`
6892
6893 P90 *float64 `json:"P90,omitempty"`
6894
6895 P95 *float64 `json:"P95,omitempty"`
6896
6897 P99 *float64 `json:"P99,omitempty"`
6898
6899 Count *float64 `json:"_count,omitempty"`
6900
6901 Average *float64 `json:"average,omitempty"`
6902
6903 Maximum *float64 `json:"maximum,omitempty"`
6904
6905 Minimum *float64 `json:"minimum,omitempty"`
6906
6907 Timestamp *date.Time `json:"timestamp,omitempty"`
6908
6909 Total *float64 `json:"total,omitempty"`
6910 }
6911
6912
6913 func (pmv PercentileMetricValue) MarshalJSON() ([]byte, error) {
6914 objectMap := make(map[string]interface{})
6915 return json.Marshal(objectMap)
6916 }
6917
6918
6919 type PeriodicModeBackupPolicy struct {
6920
6921 PeriodicModeProperties *PeriodicModeProperties `json:"periodicModeProperties,omitempty"`
6922
6923 MigrationState *BackupPolicyMigrationState `json:"migrationState,omitempty"`
6924
6925 Type Type `json:"type,omitempty"`
6926 }
6927
6928
6929 func (pmbp PeriodicModeBackupPolicy) MarshalJSON() ([]byte, error) {
6930 pmbp.Type = TypePeriodic
6931 objectMap := make(map[string]interface{})
6932 if pmbp.PeriodicModeProperties != nil {
6933 objectMap["periodicModeProperties"] = pmbp.PeriodicModeProperties
6934 }
6935 if pmbp.MigrationState != nil {
6936 objectMap["migrationState"] = pmbp.MigrationState
6937 }
6938 if pmbp.Type != "" {
6939 objectMap["type"] = pmbp.Type
6940 }
6941 return json.Marshal(objectMap)
6942 }
6943
6944
6945 func (pmbp PeriodicModeBackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) {
6946 return &pmbp, true
6947 }
6948
6949
6950 func (pmbp PeriodicModeBackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) {
6951 return nil, false
6952 }
6953
6954
6955 func (pmbp PeriodicModeBackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) {
6956 return nil, false
6957 }
6958
6959
6960 func (pmbp PeriodicModeBackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) {
6961 return &pmbp, true
6962 }
6963
6964
6965 type PeriodicModeProperties struct {
6966
6967 BackupIntervalInMinutes *int32 `json:"backupIntervalInMinutes,omitempty"`
6968
6969 BackupRetentionIntervalInHours *int32 `json:"backupRetentionIntervalInHours,omitempty"`
6970
6971 BackupStorageRedundancy BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"`
6972 }
6973
6974
6975 type Permission struct {
6976
6977 DataActions *[]string `json:"dataActions,omitempty"`
6978
6979 NotDataActions *[]string `json:"notDataActions,omitempty"`
6980 }
6981
6982
6983 type PrivateEndpointConnection struct {
6984 autorest.Response `json:"-"`
6985
6986 *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
6987
6988 ID *string `json:"id,omitempty"`
6989
6990 Name *string `json:"name,omitempty"`
6991
6992 Type *string `json:"type,omitempty"`
6993 }
6994
6995
6996 func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
6997 objectMap := make(map[string]interface{})
6998 if pec.PrivateEndpointConnectionProperties != nil {
6999 objectMap["properties"] = pec.PrivateEndpointConnectionProperties
7000 }
7001 return json.Marshal(objectMap)
7002 }
7003
7004
7005 func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
7006 var m map[string]*json.RawMessage
7007 err := json.Unmarshal(body, &m)
7008 if err != nil {
7009 return err
7010 }
7011 for k, v := range m {
7012 switch k {
7013 case "properties":
7014 if v != nil {
7015 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
7016 err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
7017 if err != nil {
7018 return err
7019 }
7020 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
7021 }
7022 case "id":
7023 if v != nil {
7024 var ID string
7025 err = json.Unmarshal(*v, &ID)
7026 if err != nil {
7027 return err
7028 }
7029 pec.ID = &ID
7030 }
7031 case "name":
7032 if v != nil {
7033 var name string
7034 err = json.Unmarshal(*v, &name)
7035 if err != nil {
7036 return err
7037 }
7038 pec.Name = &name
7039 }
7040 case "type":
7041 if v != nil {
7042 var typeVar string
7043 err = json.Unmarshal(*v, &typeVar)
7044 if err != nil {
7045 return err
7046 }
7047 pec.Type = &typeVar
7048 }
7049 }
7050 }
7051
7052 return nil
7053 }
7054
7055
7056 type PrivateEndpointConnectionListResult struct {
7057 autorest.Response `json:"-"`
7058
7059 Value *[]PrivateEndpointConnection `json:"value,omitempty"`
7060 }
7061
7062
7063 type PrivateEndpointConnectionProperties struct {
7064
7065 PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"`
7066
7067 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`
7068
7069 GroupID *string `json:"groupId,omitempty"`
7070
7071 ProvisioningState *string `json:"provisioningState,omitempty"`
7072 }
7073
7074
7075
7076 type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
7077 azure.FutureAPI
7078
7079
7080 Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
7081 }
7082
7083
7084 func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
7085 var azFuture azure.Future
7086 if err := json.Unmarshal(body, &azFuture); err != nil {
7087 return err
7088 }
7089 future.FutureAPI = &azFuture
7090 future.Result = future.result
7091 return nil
7092 }
7093
7094
7095 func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
7096 var done bool
7097 done, err = future.DoneWithContext(context.Background(), client)
7098 if err != nil {
7099 err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
7100 return
7101 }
7102 if !done {
7103 pec.Response.Response = future.Response()
7104 err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture")
7105 return
7106 }
7107 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7108 if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
7109 pec, err = client.CreateOrUpdateResponder(pec.Response.Response)
7110 if err != nil {
7111 err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request")
7112 }
7113 }
7114 return
7115 }
7116
7117
7118
7119 type PrivateEndpointConnectionsDeleteFuture struct {
7120 azure.FutureAPI
7121
7122
7123 Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
7124 }
7125
7126
7127 func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
7128 var azFuture azure.Future
7129 if err := json.Unmarshal(body, &azFuture); err != nil {
7130 return err
7131 }
7132 future.FutureAPI = &azFuture
7133 future.Result = future.result
7134 return nil
7135 }
7136
7137
7138 func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
7139 var done bool
7140 done, err = future.DoneWithContext(context.Background(), client)
7141 if err != nil {
7142 err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
7143 return
7144 }
7145 if !done {
7146 ar.Response = future.Response()
7147 err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsDeleteFuture")
7148 return
7149 }
7150 ar.Response = future.Response()
7151 return
7152 }
7153
7154
7155 type PrivateEndpointProperty struct {
7156
7157 ID *string `json:"id,omitempty"`
7158 }
7159
7160
7161 type PrivateLinkResource struct {
7162 autorest.Response `json:"-"`
7163
7164 *PrivateLinkResourceProperties `json:"properties,omitempty"`
7165
7166 ID *string `json:"id,omitempty"`
7167
7168 Name *string `json:"name,omitempty"`
7169
7170 Type *string `json:"type,omitempty"`
7171 }
7172
7173
7174 func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
7175 objectMap := make(map[string]interface{})
7176 if plr.PrivateLinkResourceProperties != nil {
7177 objectMap["properties"] = plr.PrivateLinkResourceProperties
7178 }
7179 return json.Marshal(objectMap)
7180 }
7181
7182
7183 func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
7184 var m map[string]*json.RawMessage
7185 err := json.Unmarshal(body, &m)
7186 if err != nil {
7187 return err
7188 }
7189 for k, v := range m {
7190 switch k {
7191 case "properties":
7192 if v != nil {
7193 var privateLinkResourceProperties PrivateLinkResourceProperties
7194 err = json.Unmarshal(*v, &privateLinkResourceProperties)
7195 if err != nil {
7196 return err
7197 }
7198 plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
7199 }
7200 case "id":
7201 if v != nil {
7202 var ID string
7203 err = json.Unmarshal(*v, &ID)
7204 if err != nil {
7205 return err
7206 }
7207 plr.ID = &ID
7208 }
7209 case "name":
7210 if v != nil {
7211 var name string
7212 err = json.Unmarshal(*v, &name)
7213 if err != nil {
7214 return err
7215 }
7216 plr.Name = &name
7217 }
7218 case "type":
7219 if v != nil {
7220 var typeVar string
7221 err = json.Unmarshal(*v, &typeVar)
7222 if err != nil {
7223 return err
7224 }
7225 plr.Type = &typeVar
7226 }
7227 }
7228 }
7229
7230 return nil
7231 }
7232
7233
7234 type PrivateLinkResourceListResult struct {
7235 autorest.Response `json:"-"`
7236
7237 Value *[]PrivateLinkResource `json:"value,omitempty"`
7238 }
7239
7240
7241 type PrivateLinkResourceProperties struct {
7242
7243 GroupID *string `json:"groupId,omitempty"`
7244
7245 RequiredMembers *[]string `json:"requiredMembers,omitempty"`
7246
7247 RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
7248 }
7249
7250
7251 func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
7252 objectMap := make(map[string]interface{})
7253 return json.Marshal(objectMap)
7254 }
7255
7256
7257 type PrivateLinkServiceConnectionStateProperty struct {
7258
7259 Status *string `json:"status,omitempty"`
7260
7261 Description *string `json:"description,omitempty"`
7262
7263 ActionsRequired *string `json:"actionsRequired,omitempty"`
7264 }
7265
7266
7267 func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
7268 objectMap := make(map[string]interface{})
7269 if plscsp.Status != nil {
7270 objectMap["status"] = plscsp.Status
7271 }
7272 if plscsp.Description != nil {
7273 objectMap["description"] = plscsp.Description
7274 }
7275 return json.Marshal(objectMap)
7276 }
7277
7278
7279
7280 type ProxyResource struct {
7281
7282 ID *string `json:"id,omitempty"`
7283
7284 Name *string `json:"name,omitempty"`
7285
7286 Type *string `json:"type,omitempty"`
7287 }
7288
7289
7290 func (pr ProxyResource) MarshalJSON() ([]byte, error) {
7291 objectMap := make(map[string]interface{})
7292 return json.Marshal(objectMap)
7293 }
7294
7295
7296 type RegionForOnlineOffline struct {
7297
7298 Region *string `json:"region,omitempty"`
7299 }
7300
7301
7302 type Resource struct {
7303
7304 ID *string `json:"id,omitempty"`
7305
7306 Name *string `json:"name,omitempty"`
7307
7308 Type *string `json:"type,omitempty"`
7309 }
7310
7311
7312 func (r Resource) MarshalJSON() ([]byte, error) {
7313 objectMap := make(map[string]interface{})
7314 return json.Marshal(objectMap)
7315 }
7316
7317
7318 type RestorableDatabaseAccountGetResult struct {
7319 autorest.Response `json:"-"`
7320
7321 *RestorableDatabaseAccountProperties `json:"properties,omitempty"`
7322
7323 ID *string `json:"id,omitempty"`
7324
7325 Name *string `json:"name,omitempty"`
7326
7327 Type *string `json:"type,omitempty"`
7328
7329 Location *string `json:"location,omitempty"`
7330 }
7331
7332
7333 func (rdagr RestorableDatabaseAccountGetResult) MarshalJSON() ([]byte, error) {
7334 objectMap := make(map[string]interface{})
7335 if rdagr.RestorableDatabaseAccountProperties != nil {
7336 objectMap["properties"] = rdagr.RestorableDatabaseAccountProperties
7337 }
7338 if rdagr.Location != nil {
7339 objectMap["location"] = rdagr.Location
7340 }
7341 return json.Marshal(objectMap)
7342 }
7343
7344
7345 func (rdagr *RestorableDatabaseAccountGetResult) UnmarshalJSON(body []byte) error {
7346 var m map[string]*json.RawMessage
7347 err := json.Unmarshal(body, &m)
7348 if err != nil {
7349 return err
7350 }
7351 for k, v := range m {
7352 switch k {
7353 case "properties":
7354 if v != nil {
7355 var restorableDatabaseAccountProperties RestorableDatabaseAccountProperties
7356 err = json.Unmarshal(*v, &restorableDatabaseAccountProperties)
7357 if err != nil {
7358 return err
7359 }
7360 rdagr.RestorableDatabaseAccountProperties = &restorableDatabaseAccountProperties
7361 }
7362 case "id":
7363 if v != nil {
7364 var ID string
7365 err = json.Unmarshal(*v, &ID)
7366 if err != nil {
7367 return err
7368 }
7369 rdagr.ID = &ID
7370 }
7371 case "name":
7372 if v != nil {
7373 var name string
7374 err = json.Unmarshal(*v, &name)
7375 if err != nil {
7376 return err
7377 }
7378 rdagr.Name = &name
7379 }
7380 case "type":
7381 if v != nil {
7382 var typeVar string
7383 err = json.Unmarshal(*v, &typeVar)
7384 if err != nil {
7385 return err
7386 }
7387 rdagr.Type = &typeVar
7388 }
7389 case "location":
7390 if v != nil {
7391 var location string
7392 err = json.Unmarshal(*v, &location)
7393 if err != nil {
7394 return err
7395 }
7396 rdagr.Location = &location
7397 }
7398 }
7399 }
7400
7401 return nil
7402 }
7403
7404
7405 type RestorableDatabaseAccountProperties struct {
7406
7407 AccountName *string `json:"accountName,omitempty"`
7408
7409 CreationTime *date.Time `json:"creationTime,omitempty"`
7410
7411 DeletionTime *date.Time `json:"deletionTime,omitempty"`
7412
7413 APIType APIType `json:"apiType,omitempty"`
7414
7415 RestorableLocations *[]RestorableLocationResource `json:"restorableLocations,omitempty"`
7416 }
7417
7418
7419 func (rdap RestorableDatabaseAccountProperties) MarshalJSON() ([]byte, error) {
7420 objectMap := make(map[string]interface{})
7421 if rdap.AccountName != nil {
7422 objectMap["accountName"] = rdap.AccountName
7423 }
7424 if rdap.CreationTime != nil {
7425 objectMap["creationTime"] = rdap.CreationTime
7426 }
7427 if rdap.DeletionTime != nil {
7428 objectMap["deletionTime"] = rdap.DeletionTime
7429 }
7430 return json.Marshal(objectMap)
7431 }
7432
7433
7434
7435 type RestorableDatabaseAccountsListResult struct {
7436 autorest.Response `json:"-"`
7437
7438 Value *[]RestorableDatabaseAccountGetResult `json:"value,omitempty"`
7439 }
7440
7441
7442 func (rdalr RestorableDatabaseAccountsListResult) MarshalJSON() ([]byte, error) {
7443 objectMap := make(map[string]interface{})
7444 return json.Marshal(objectMap)
7445 }
7446
7447
7448 type RestorableLocationResource struct {
7449
7450 LocationName *string `json:"locationName,omitempty"`
7451
7452 RegionalDatabaseAccountInstanceID *string `json:"regionalDatabaseAccountInstanceId,omitempty"`
7453
7454 CreationTime *date.Time `json:"creationTime,omitempty"`
7455
7456 DeletionTime *date.Time `json:"deletionTime,omitempty"`
7457 }
7458
7459
7460 func (rlr RestorableLocationResource) MarshalJSON() ([]byte, error) {
7461 objectMap := make(map[string]interface{})
7462 return json.Marshal(objectMap)
7463 }
7464
7465
7466 type RestorableMongodbCollectionGetResult struct {
7467
7468 *RestorableMongodbCollectionProperties `json:"properties,omitempty"`
7469
7470 ID *string `json:"id,omitempty"`
7471
7472 Name *string `json:"name,omitempty"`
7473
7474 Type *string `json:"type,omitempty"`
7475 }
7476
7477
7478 func (rmcgr RestorableMongodbCollectionGetResult) MarshalJSON() ([]byte, error) {
7479 objectMap := make(map[string]interface{})
7480 if rmcgr.RestorableMongodbCollectionProperties != nil {
7481 objectMap["properties"] = rmcgr.RestorableMongodbCollectionProperties
7482 }
7483 return json.Marshal(objectMap)
7484 }
7485
7486
7487 func (rmcgr *RestorableMongodbCollectionGetResult) UnmarshalJSON(body []byte) error {
7488 var m map[string]*json.RawMessage
7489 err := json.Unmarshal(body, &m)
7490 if err != nil {
7491 return err
7492 }
7493 for k, v := range m {
7494 switch k {
7495 case "properties":
7496 if v != nil {
7497 var restorableMongodbCollectionProperties RestorableMongodbCollectionProperties
7498 err = json.Unmarshal(*v, &restorableMongodbCollectionProperties)
7499 if err != nil {
7500 return err
7501 }
7502 rmcgr.RestorableMongodbCollectionProperties = &restorableMongodbCollectionProperties
7503 }
7504 case "id":
7505 if v != nil {
7506 var ID string
7507 err = json.Unmarshal(*v, &ID)
7508 if err != nil {
7509 return err
7510 }
7511 rmcgr.ID = &ID
7512 }
7513 case "name":
7514 if v != nil {
7515 var name string
7516 err = json.Unmarshal(*v, &name)
7517 if err != nil {
7518 return err
7519 }
7520 rmcgr.Name = &name
7521 }
7522 case "type":
7523 if v != nil {
7524 var typeVar string
7525 err = json.Unmarshal(*v, &typeVar)
7526 if err != nil {
7527 return err
7528 }
7529 rmcgr.Type = &typeVar
7530 }
7531 }
7532 }
7533
7534 return nil
7535 }
7536
7537
7538 type RestorableMongodbCollectionProperties struct {
7539
7540 Resource *RestorableMongodbCollectionPropertiesResource `json:"resource,omitempty"`
7541 }
7542
7543
7544
7545 type RestorableMongodbCollectionPropertiesResource struct {
7546
7547 Rid *string `json:"_rid,omitempty"`
7548
7549 OperationType OperationType `json:"operationType,omitempty"`
7550
7551 EventTimestamp *string `json:"eventTimestamp,omitempty"`
7552
7553 OwnerID *string `json:"ownerId,omitempty"`
7554
7555 OwnerResourceID *string `json:"ownerResourceId,omitempty"`
7556 }
7557
7558
7559 func (rmcp RestorableMongodbCollectionPropertiesResource) MarshalJSON() ([]byte, error) {
7560 objectMap := make(map[string]interface{})
7561 return json.Marshal(objectMap)
7562 }
7563
7564
7565
7566 type RestorableMongodbCollectionsListResult struct {
7567 autorest.Response `json:"-"`
7568
7569 Value *[]RestorableMongodbCollectionGetResult `json:"value,omitempty"`
7570 }
7571
7572
7573 func (rmclr RestorableMongodbCollectionsListResult) MarshalJSON() ([]byte, error) {
7574 objectMap := make(map[string]interface{})
7575 return json.Marshal(objectMap)
7576 }
7577
7578
7579 type RestorableMongodbDatabaseGetResult struct {
7580
7581 *RestorableMongodbDatabaseProperties `json:"properties,omitempty"`
7582
7583 ID *string `json:"id,omitempty"`
7584
7585 Name *string `json:"name,omitempty"`
7586
7587 Type *string `json:"type,omitempty"`
7588 }
7589
7590
7591 func (rmdgr RestorableMongodbDatabaseGetResult) MarshalJSON() ([]byte, error) {
7592 objectMap := make(map[string]interface{})
7593 if rmdgr.RestorableMongodbDatabaseProperties != nil {
7594 objectMap["properties"] = rmdgr.RestorableMongodbDatabaseProperties
7595 }
7596 return json.Marshal(objectMap)
7597 }
7598
7599
7600 func (rmdgr *RestorableMongodbDatabaseGetResult) UnmarshalJSON(body []byte) error {
7601 var m map[string]*json.RawMessage
7602 err := json.Unmarshal(body, &m)
7603 if err != nil {
7604 return err
7605 }
7606 for k, v := range m {
7607 switch k {
7608 case "properties":
7609 if v != nil {
7610 var restorableMongodbDatabaseProperties RestorableMongodbDatabaseProperties
7611 err = json.Unmarshal(*v, &restorableMongodbDatabaseProperties)
7612 if err != nil {
7613 return err
7614 }
7615 rmdgr.RestorableMongodbDatabaseProperties = &restorableMongodbDatabaseProperties
7616 }
7617 case "id":
7618 if v != nil {
7619 var ID string
7620 err = json.Unmarshal(*v, &ID)
7621 if err != nil {
7622 return err
7623 }
7624 rmdgr.ID = &ID
7625 }
7626 case "name":
7627 if v != nil {
7628 var name string
7629 err = json.Unmarshal(*v, &name)
7630 if err != nil {
7631 return err
7632 }
7633 rmdgr.Name = &name
7634 }
7635 case "type":
7636 if v != nil {
7637 var typeVar string
7638 err = json.Unmarshal(*v, &typeVar)
7639 if err != nil {
7640 return err
7641 }
7642 rmdgr.Type = &typeVar
7643 }
7644 }
7645 }
7646
7647 return nil
7648 }
7649
7650
7651 type RestorableMongodbDatabaseProperties struct {
7652
7653 Resource *RestorableMongodbDatabasePropertiesResource `json:"resource,omitempty"`
7654 }
7655
7656
7657 type RestorableMongodbDatabasePropertiesResource struct {
7658
7659 Rid *string `json:"_rid,omitempty"`
7660
7661 OperationType OperationType `json:"operationType,omitempty"`
7662
7663 EventTimestamp *string `json:"eventTimestamp,omitempty"`
7664
7665 OwnerID *string `json:"ownerId,omitempty"`
7666
7667 OwnerResourceID *string `json:"ownerResourceId,omitempty"`
7668 }
7669
7670
7671 func (rmdp RestorableMongodbDatabasePropertiesResource) MarshalJSON() ([]byte, error) {
7672 objectMap := make(map[string]interface{})
7673 return json.Marshal(objectMap)
7674 }
7675
7676
7677
7678 type RestorableMongodbDatabasesListResult struct {
7679 autorest.Response `json:"-"`
7680
7681 Value *[]RestorableMongodbDatabaseGetResult `json:"value,omitempty"`
7682 }
7683
7684
7685 func (rmdlr RestorableMongodbDatabasesListResult) MarshalJSON() ([]byte, error) {
7686 objectMap := make(map[string]interface{})
7687 return json.Marshal(objectMap)
7688 }
7689
7690
7691
7692 type RestorableMongodbResourcesListResult struct {
7693 autorest.Response `json:"-"`
7694
7695 Value *[]DatabaseRestoreResource `json:"value,omitempty"`
7696 }
7697
7698
7699 func (rmrlr RestorableMongodbResourcesListResult) MarshalJSON() ([]byte, error) {
7700 objectMap := make(map[string]interface{})
7701 return json.Marshal(objectMap)
7702 }
7703
7704
7705 type RestorableSQLContainerGetResult struct {
7706
7707 *RestorableSQLContainerProperties `json:"properties,omitempty"`
7708
7709 ID *string `json:"id,omitempty"`
7710
7711 Name *string `json:"name,omitempty"`
7712
7713 Type *string `json:"type,omitempty"`
7714 }
7715
7716
7717 func (rscgr RestorableSQLContainerGetResult) MarshalJSON() ([]byte, error) {
7718 objectMap := make(map[string]interface{})
7719 if rscgr.RestorableSQLContainerProperties != nil {
7720 objectMap["properties"] = rscgr.RestorableSQLContainerProperties
7721 }
7722 return json.Marshal(objectMap)
7723 }
7724
7725
7726 func (rscgr *RestorableSQLContainerGetResult) UnmarshalJSON(body []byte) error {
7727 var m map[string]*json.RawMessage
7728 err := json.Unmarshal(body, &m)
7729 if err != nil {
7730 return err
7731 }
7732 for k, v := range m {
7733 switch k {
7734 case "properties":
7735 if v != nil {
7736 var restorableSQLContainerProperties RestorableSQLContainerProperties
7737 err = json.Unmarshal(*v, &restorableSQLContainerProperties)
7738 if err != nil {
7739 return err
7740 }
7741 rscgr.RestorableSQLContainerProperties = &restorableSQLContainerProperties
7742 }
7743 case "id":
7744 if v != nil {
7745 var ID string
7746 err = json.Unmarshal(*v, &ID)
7747 if err != nil {
7748 return err
7749 }
7750 rscgr.ID = &ID
7751 }
7752 case "name":
7753 if v != nil {
7754 var name string
7755 err = json.Unmarshal(*v, &name)
7756 if err != nil {
7757 return err
7758 }
7759 rscgr.Name = &name
7760 }
7761 case "type":
7762 if v != nil {
7763 var typeVar string
7764 err = json.Unmarshal(*v, &typeVar)
7765 if err != nil {
7766 return err
7767 }
7768 rscgr.Type = &typeVar
7769 }
7770 }
7771 }
7772
7773 return nil
7774 }
7775
7776
7777 type RestorableSQLContainerProperties struct {
7778
7779 Resource *RestorableSQLContainerPropertiesResource `json:"resource,omitempty"`
7780 }
7781
7782
7783 type RestorableSQLContainerPropertiesResource struct {
7784
7785 Rid *string `json:"_rid,omitempty"`
7786
7787 OperationType OperationType `json:"operationType,omitempty"`
7788
7789 EventTimestamp *string `json:"eventTimestamp,omitempty"`
7790
7791 OwnerID *string `json:"ownerId,omitempty"`
7792
7793 OwnerResourceID *string `json:"ownerResourceId,omitempty"`
7794
7795 Container *RestorableSQLContainerPropertiesResourceContainer `json:"container,omitempty"`
7796 }
7797
7798
7799 func (rscp RestorableSQLContainerPropertiesResource) MarshalJSON() ([]byte, error) {
7800 objectMap := make(map[string]interface{})
7801 if rscp.Container != nil {
7802 objectMap["container"] = rscp.Container
7803 }
7804 return json.Marshal(objectMap)
7805 }
7806
7807
7808 type RestorableSQLContainerPropertiesResourceContainer struct {
7809
7810 ID *string `json:"id,omitempty"`
7811
7812 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
7813
7814 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
7815
7816 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
7817
7818 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
7819
7820 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
7821
7822 AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"`
7823
7824 Rid *string `json:"_rid,omitempty"`
7825
7826 Ts *float64 `json:"_ts,omitempty"`
7827
7828 Etag *string `json:"_etag,omitempty"`
7829
7830 Self *string `json:"_self,omitempty"`
7831 }
7832
7833
7834 func (rscp RestorableSQLContainerPropertiesResourceContainer) MarshalJSON() ([]byte, error) {
7835 objectMap := make(map[string]interface{})
7836 if rscp.ID != nil {
7837 objectMap["id"] = rscp.ID
7838 }
7839 if rscp.IndexingPolicy != nil {
7840 objectMap["indexingPolicy"] = rscp.IndexingPolicy
7841 }
7842 if rscp.PartitionKey != nil {
7843 objectMap["partitionKey"] = rscp.PartitionKey
7844 }
7845 if rscp.DefaultTTL != nil {
7846 objectMap["defaultTtl"] = rscp.DefaultTTL
7847 }
7848 if rscp.UniqueKeyPolicy != nil {
7849 objectMap["uniqueKeyPolicy"] = rscp.UniqueKeyPolicy
7850 }
7851 if rscp.ConflictResolutionPolicy != nil {
7852 objectMap["conflictResolutionPolicy"] = rscp.ConflictResolutionPolicy
7853 }
7854 if rscp.AnalyticalStorageTTL != nil {
7855 objectMap["analyticalStorageTtl"] = rscp.AnalyticalStorageTTL
7856 }
7857 return json.Marshal(objectMap)
7858 }
7859
7860
7861
7862 type RestorableSQLContainersListResult struct {
7863 autorest.Response `json:"-"`
7864
7865 Value *[]RestorableSQLContainerGetResult `json:"value,omitempty"`
7866 }
7867
7868
7869 func (rsclr RestorableSQLContainersListResult) MarshalJSON() ([]byte, error) {
7870 objectMap := make(map[string]interface{})
7871 return json.Marshal(objectMap)
7872 }
7873
7874
7875 type RestorableSQLDatabaseGetResult struct {
7876
7877 *RestorableSQLDatabaseProperties `json:"properties,omitempty"`
7878
7879 ID *string `json:"id,omitempty"`
7880
7881 Name *string `json:"name,omitempty"`
7882
7883 Type *string `json:"type,omitempty"`
7884 }
7885
7886
7887 func (rsdgr RestorableSQLDatabaseGetResult) MarshalJSON() ([]byte, error) {
7888 objectMap := make(map[string]interface{})
7889 if rsdgr.RestorableSQLDatabaseProperties != nil {
7890 objectMap["properties"] = rsdgr.RestorableSQLDatabaseProperties
7891 }
7892 return json.Marshal(objectMap)
7893 }
7894
7895
7896 func (rsdgr *RestorableSQLDatabaseGetResult) UnmarshalJSON(body []byte) error {
7897 var m map[string]*json.RawMessage
7898 err := json.Unmarshal(body, &m)
7899 if err != nil {
7900 return err
7901 }
7902 for k, v := range m {
7903 switch k {
7904 case "properties":
7905 if v != nil {
7906 var restorableSQLDatabaseProperties RestorableSQLDatabaseProperties
7907 err = json.Unmarshal(*v, &restorableSQLDatabaseProperties)
7908 if err != nil {
7909 return err
7910 }
7911 rsdgr.RestorableSQLDatabaseProperties = &restorableSQLDatabaseProperties
7912 }
7913 case "id":
7914 if v != nil {
7915 var ID string
7916 err = json.Unmarshal(*v, &ID)
7917 if err != nil {
7918 return err
7919 }
7920 rsdgr.ID = &ID
7921 }
7922 case "name":
7923 if v != nil {
7924 var name string
7925 err = json.Unmarshal(*v, &name)
7926 if err != nil {
7927 return err
7928 }
7929 rsdgr.Name = &name
7930 }
7931 case "type":
7932 if v != nil {
7933 var typeVar string
7934 err = json.Unmarshal(*v, &typeVar)
7935 if err != nil {
7936 return err
7937 }
7938 rsdgr.Type = &typeVar
7939 }
7940 }
7941 }
7942
7943 return nil
7944 }
7945
7946
7947 type RestorableSQLDatabaseProperties struct {
7948
7949 Resource *RestorableSQLDatabasePropertiesResource `json:"resource,omitempty"`
7950 }
7951
7952
7953 type RestorableSQLDatabasePropertiesResource struct {
7954
7955 Rid *string `json:"_rid,omitempty"`
7956
7957 OperationType OperationType `json:"operationType,omitempty"`
7958
7959 EventTimestamp *string `json:"eventTimestamp,omitempty"`
7960
7961 OwnerID *string `json:"ownerId,omitempty"`
7962
7963 OwnerResourceID *string `json:"ownerResourceId,omitempty"`
7964
7965 Database *RestorableSQLDatabasePropertiesResourceDatabase `json:"database,omitempty"`
7966 }
7967
7968
7969 func (rsdp RestorableSQLDatabasePropertiesResource) MarshalJSON() ([]byte, error) {
7970 objectMap := make(map[string]interface{})
7971 if rsdp.Database != nil {
7972 objectMap["database"] = rsdp.Database
7973 }
7974 return json.Marshal(objectMap)
7975 }
7976
7977
7978 type RestorableSQLDatabasePropertiesResourceDatabase struct {
7979
7980 ID *string `json:"id,omitempty"`
7981
7982 Rid *string `json:"_rid,omitempty"`
7983
7984 Ts *float64 `json:"_ts,omitempty"`
7985
7986 Etag *string `json:"_etag,omitempty"`
7987
7988 Colls *string `json:"_colls,omitempty"`
7989
7990 Users *string `json:"_users,omitempty"`
7991
7992 Self *string `json:"_self,omitempty"`
7993 }
7994
7995
7996 func (rsdp RestorableSQLDatabasePropertiesResourceDatabase) MarshalJSON() ([]byte, error) {
7997 objectMap := make(map[string]interface{})
7998 if rsdp.ID != nil {
7999 objectMap["id"] = rsdp.ID
8000 }
8001 return json.Marshal(objectMap)
8002 }
8003
8004
8005
8006 type RestorableSQLDatabasesListResult struct {
8007 autorest.Response `json:"-"`
8008
8009 Value *[]RestorableSQLDatabaseGetResult `json:"value,omitempty"`
8010 }
8011
8012
8013 func (rsdlr RestorableSQLDatabasesListResult) MarshalJSON() ([]byte, error) {
8014 objectMap := make(map[string]interface{})
8015 return json.Marshal(objectMap)
8016 }
8017
8018
8019
8020 type RestorableSQLResourcesListResult struct {
8021 autorest.Response `json:"-"`
8022
8023 Value *[]DatabaseRestoreResource `json:"value,omitempty"`
8024 }
8025
8026
8027 func (rsrlr RestorableSQLResourcesListResult) MarshalJSON() ([]byte, error) {
8028 objectMap := make(map[string]interface{})
8029 return json.Marshal(objectMap)
8030 }
8031
8032
8033 type RestoreParameters struct {
8034
8035 RestoreMode RestoreMode `json:"restoreMode,omitempty"`
8036
8037 RestoreSource *string `json:"restoreSource,omitempty"`
8038
8039 RestoreTimestampInUtc *date.Time `json:"restoreTimestampInUtc,omitempty"`
8040
8041 DatabasesToRestore *[]DatabaseRestoreResource `json:"databasesToRestore,omitempty"`
8042 }
8043
8044
8045 type SeedNode struct {
8046
8047 IPAddress *string `json:"ipAddress,omitempty"`
8048 }
8049
8050
8051 type SpatialSpec struct {
8052
8053 Path *string `json:"path,omitempty"`
8054
8055 Types *[]SpatialType `json:"types,omitempty"`
8056 }
8057
8058
8059 type SQLContainerCreateUpdateParameters struct {
8060
8061 *SQLContainerCreateUpdateProperties `json:"properties,omitempty"`
8062
8063 ID *string `json:"id,omitempty"`
8064
8065 Name *string `json:"name,omitempty"`
8066
8067 Type *string `json:"type,omitempty"`
8068
8069 Location *string `json:"location,omitempty"`
8070 Tags map[string]*string `json:"tags"`
8071 }
8072
8073
8074 func (sccup SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) {
8075 objectMap := make(map[string]interface{})
8076 if sccup.SQLContainerCreateUpdateProperties != nil {
8077 objectMap["properties"] = sccup.SQLContainerCreateUpdateProperties
8078 }
8079 if sccup.Location != nil {
8080 objectMap["location"] = sccup.Location
8081 }
8082 if sccup.Tags != nil {
8083 objectMap["tags"] = sccup.Tags
8084 }
8085 return json.Marshal(objectMap)
8086 }
8087
8088
8089 func (sccup *SQLContainerCreateUpdateParameters) UnmarshalJSON(body []byte) error {
8090 var m map[string]*json.RawMessage
8091 err := json.Unmarshal(body, &m)
8092 if err != nil {
8093 return err
8094 }
8095 for k, v := range m {
8096 switch k {
8097 case "properties":
8098 if v != nil {
8099 var SQLContainerCreateUpdateProperties SQLContainerCreateUpdateProperties
8100 err = json.Unmarshal(*v, &SQLContainerCreateUpdateProperties)
8101 if err != nil {
8102 return err
8103 }
8104 sccup.SQLContainerCreateUpdateProperties = &SQLContainerCreateUpdateProperties
8105 }
8106 case "id":
8107 if v != nil {
8108 var ID string
8109 err = json.Unmarshal(*v, &ID)
8110 if err != nil {
8111 return err
8112 }
8113 sccup.ID = &ID
8114 }
8115 case "name":
8116 if v != nil {
8117 var name string
8118 err = json.Unmarshal(*v, &name)
8119 if err != nil {
8120 return err
8121 }
8122 sccup.Name = &name
8123 }
8124 case "type":
8125 if v != nil {
8126 var typeVar string
8127 err = json.Unmarshal(*v, &typeVar)
8128 if err != nil {
8129 return err
8130 }
8131 sccup.Type = &typeVar
8132 }
8133 case "location":
8134 if v != nil {
8135 var location string
8136 err = json.Unmarshal(*v, &location)
8137 if err != nil {
8138 return err
8139 }
8140 sccup.Location = &location
8141 }
8142 case "tags":
8143 if v != nil {
8144 var tags map[string]*string
8145 err = json.Unmarshal(*v, &tags)
8146 if err != nil {
8147 return err
8148 }
8149 sccup.Tags = tags
8150 }
8151 }
8152 }
8153
8154 return nil
8155 }
8156
8157
8158 type SQLContainerCreateUpdateProperties struct {
8159
8160 Resource *SQLContainerResource `json:"resource,omitempty"`
8161
8162 Options *CreateUpdateOptions `json:"options,omitempty"`
8163 }
8164
8165
8166 type SQLContainerGetProperties struct {
8167 Resource *SQLContainerGetPropertiesResource `json:"resource,omitempty"`
8168 Options *SQLContainerGetPropertiesOptions `json:"options,omitempty"`
8169 }
8170
8171
8172 type SQLContainerGetPropertiesOptions struct {
8173
8174 Throughput *int32 `json:"throughput,omitempty"`
8175
8176 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
8177 }
8178
8179
8180 type SQLContainerGetPropertiesResource struct {
8181
8182 ID *string `json:"id,omitempty"`
8183
8184 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
8185
8186 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
8187
8188 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
8189
8190 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
8191
8192 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
8193
8194 AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"`
8195
8196 Rid *string `json:"_rid,omitempty"`
8197
8198 Ts *float64 `json:"_ts,omitempty"`
8199
8200 Etag *string `json:"_etag,omitempty"`
8201 }
8202
8203
8204 func (scgp SQLContainerGetPropertiesResource) MarshalJSON() ([]byte, error) {
8205 objectMap := make(map[string]interface{})
8206 if scgp.ID != nil {
8207 objectMap["id"] = scgp.ID
8208 }
8209 if scgp.IndexingPolicy != nil {
8210 objectMap["indexingPolicy"] = scgp.IndexingPolicy
8211 }
8212 if scgp.PartitionKey != nil {
8213 objectMap["partitionKey"] = scgp.PartitionKey
8214 }
8215 if scgp.DefaultTTL != nil {
8216 objectMap["defaultTtl"] = scgp.DefaultTTL
8217 }
8218 if scgp.UniqueKeyPolicy != nil {
8219 objectMap["uniqueKeyPolicy"] = scgp.UniqueKeyPolicy
8220 }
8221 if scgp.ConflictResolutionPolicy != nil {
8222 objectMap["conflictResolutionPolicy"] = scgp.ConflictResolutionPolicy
8223 }
8224 if scgp.AnalyticalStorageTTL != nil {
8225 objectMap["analyticalStorageTtl"] = scgp.AnalyticalStorageTTL
8226 }
8227 return json.Marshal(objectMap)
8228 }
8229
8230
8231 type SQLContainerGetResults struct {
8232 autorest.Response `json:"-"`
8233
8234 *SQLContainerGetProperties `json:"properties,omitempty"`
8235
8236 ID *string `json:"id,omitempty"`
8237
8238 Name *string `json:"name,omitempty"`
8239
8240 Type *string `json:"type,omitempty"`
8241
8242 Location *string `json:"location,omitempty"`
8243 Tags map[string]*string `json:"tags"`
8244 }
8245
8246
8247 func (scgr SQLContainerGetResults) MarshalJSON() ([]byte, error) {
8248 objectMap := make(map[string]interface{})
8249 if scgr.SQLContainerGetProperties != nil {
8250 objectMap["properties"] = scgr.SQLContainerGetProperties
8251 }
8252 if scgr.Location != nil {
8253 objectMap["location"] = scgr.Location
8254 }
8255 if scgr.Tags != nil {
8256 objectMap["tags"] = scgr.Tags
8257 }
8258 return json.Marshal(objectMap)
8259 }
8260
8261
8262 func (scgr *SQLContainerGetResults) UnmarshalJSON(body []byte) error {
8263 var m map[string]*json.RawMessage
8264 err := json.Unmarshal(body, &m)
8265 if err != nil {
8266 return err
8267 }
8268 for k, v := range m {
8269 switch k {
8270 case "properties":
8271 if v != nil {
8272 var SQLContainerGetProperties SQLContainerGetProperties
8273 err = json.Unmarshal(*v, &SQLContainerGetProperties)
8274 if err != nil {
8275 return err
8276 }
8277 scgr.SQLContainerGetProperties = &SQLContainerGetProperties
8278 }
8279 case "id":
8280 if v != nil {
8281 var ID string
8282 err = json.Unmarshal(*v, &ID)
8283 if err != nil {
8284 return err
8285 }
8286 scgr.ID = &ID
8287 }
8288 case "name":
8289 if v != nil {
8290 var name string
8291 err = json.Unmarshal(*v, &name)
8292 if err != nil {
8293 return err
8294 }
8295 scgr.Name = &name
8296 }
8297 case "type":
8298 if v != nil {
8299 var typeVar string
8300 err = json.Unmarshal(*v, &typeVar)
8301 if err != nil {
8302 return err
8303 }
8304 scgr.Type = &typeVar
8305 }
8306 case "location":
8307 if v != nil {
8308 var location string
8309 err = json.Unmarshal(*v, &location)
8310 if err != nil {
8311 return err
8312 }
8313 scgr.Location = &location
8314 }
8315 case "tags":
8316 if v != nil {
8317 var tags map[string]*string
8318 err = json.Unmarshal(*v, &tags)
8319 if err != nil {
8320 return err
8321 }
8322 scgr.Tags = tags
8323 }
8324 }
8325 }
8326
8327 return nil
8328 }
8329
8330
8331 type SQLContainerListResult struct {
8332 autorest.Response `json:"-"`
8333
8334 Value *[]SQLContainerGetResults `json:"value,omitempty"`
8335 }
8336
8337
8338 func (sclr SQLContainerListResult) MarshalJSON() ([]byte, error) {
8339 objectMap := make(map[string]interface{})
8340 return json.Marshal(objectMap)
8341 }
8342
8343
8344 type SQLContainerResource struct {
8345
8346 ID *string `json:"id,omitempty"`
8347
8348 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
8349
8350 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
8351
8352 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
8353
8354 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
8355
8356 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
8357
8358 AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"`
8359 }
8360
8361
8362 type SQLDatabaseCreateUpdateParameters struct {
8363
8364 *SQLDatabaseCreateUpdateProperties `json:"properties,omitempty"`
8365
8366 ID *string `json:"id,omitempty"`
8367
8368 Name *string `json:"name,omitempty"`
8369
8370 Type *string `json:"type,omitempty"`
8371
8372 Location *string `json:"location,omitempty"`
8373 Tags map[string]*string `json:"tags"`
8374 }
8375
8376
8377 func (sdcup SQLDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) {
8378 objectMap := make(map[string]interface{})
8379 if sdcup.SQLDatabaseCreateUpdateProperties != nil {
8380 objectMap["properties"] = sdcup.SQLDatabaseCreateUpdateProperties
8381 }
8382 if sdcup.Location != nil {
8383 objectMap["location"] = sdcup.Location
8384 }
8385 if sdcup.Tags != nil {
8386 objectMap["tags"] = sdcup.Tags
8387 }
8388 return json.Marshal(objectMap)
8389 }
8390
8391
8392 func (sdcup *SQLDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error {
8393 var m map[string]*json.RawMessage
8394 err := json.Unmarshal(body, &m)
8395 if err != nil {
8396 return err
8397 }
8398 for k, v := range m {
8399 switch k {
8400 case "properties":
8401 if v != nil {
8402 var SQLDatabaseCreateUpdateProperties SQLDatabaseCreateUpdateProperties
8403 err = json.Unmarshal(*v, &SQLDatabaseCreateUpdateProperties)
8404 if err != nil {
8405 return err
8406 }
8407 sdcup.SQLDatabaseCreateUpdateProperties = &SQLDatabaseCreateUpdateProperties
8408 }
8409 case "id":
8410 if v != nil {
8411 var ID string
8412 err = json.Unmarshal(*v, &ID)
8413 if err != nil {
8414 return err
8415 }
8416 sdcup.ID = &ID
8417 }
8418 case "name":
8419 if v != nil {
8420 var name string
8421 err = json.Unmarshal(*v, &name)
8422 if err != nil {
8423 return err
8424 }
8425 sdcup.Name = &name
8426 }
8427 case "type":
8428 if v != nil {
8429 var typeVar string
8430 err = json.Unmarshal(*v, &typeVar)
8431 if err != nil {
8432 return err
8433 }
8434 sdcup.Type = &typeVar
8435 }
8436 case "location":
8437 if v != nil {
8438 var location string
8439 err = json.Unmarshal(*v, &location)
8440 if err != nil {
8441 return err
8442 }
8443 sdcup.Location = &location
8444 }
8445 case "tags":
8446 if v != nil {
8447 var tags map[string]*string
8448 err = json.Unmarshal(*v, &tags)
8449 if err != nil {
8450 return err
8451 }
8452 sdcup.Tags = tags
8453 }
8454 }
8455 }
8456
8457 return nil
8458 }
8459
8460
8461 type SQLDatabaseCreateUpdateProperties struct {
8462
8463 Resource *SQLDatabaseResource `json:"resource,omitempty"`
8464
8465 Options *CreateUpdateOptions `json:"options,omitempty"`
8466 }
8467
8468
8469 type SQLDatabaseGetProperties struct {
8470 Resource *SQLDatabaseGetPropertiesResource `json:"resource,omitempty"`
8471 Options *SQLDatabaseGetPropertiesOptions `json:"options,omitempty"`
8472 }
8473
8474
8475 type SQLDatabaseGetPropertiesOptions struct {
8476
8477 Throughput *int32 `json:"throughput,omitempty"`
8478
8479 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
8480 }
8481
8482
8483 type SQLDatabaseGetPropertiesResource struct {
8484
8485 ID *string `json:"id,omitempty"`
8486
8487 Rid *string `json:"_rid,omitempty"`
8488
8489 Ts *float64 `json:"_ts,omitempty"`
8490
8491 Etag *string `json:"_etag,omitempty"`
8492
8493 Colls *string `json:"_colls,omitempty"`
8494
8495 Users *string `json:"_users,omitempty"`
8496 }
8497
8498
8499 func (sdgp SQLDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) {
8500 objectMap := make(map[string]interface{})
8501 if sdgp.ID != nil {
8502 objectMap["id"] = sdgp.ID
8503 }
8504 if sdgp.Colls != nil {
8505 objectMap["_colls"] = sdgp.Colls
8506 }
8507 if sdgp.Users != nil {
8508 objectMap["_users"] = sdgp.Users
8509 }
8510 return json.Marshal(objectMap)
8511 }
8512
8513
8514 type SQLDatabaseGetResults struct {
8515 autorest.Response `json:"-"`
8516
8517 *SQLDatabaseGetProperties `json:"properties,omitempty"`
8518
8519 ID *string `json:"id,omitempty"`
8520
8521 Name *string `json:"name,omitempty"`
8522
8523 Type *string `json:"type,omitempty"`
8524
8525 Location *string `json:"location,omitempty"`
8526 Tags map[string]*string `json:"tags"`
8527 }
8528
8529
8530 func (sdgr SQLDatabaseGetResults) MarshalJSON() ([]byte, error) {
8531 objectMap := make(map[string]interface{})
8532 if sdgr.SQLDatabaseGetProperties != nil {
8533 objectMap["properties"] = sdgr.SQLDatabaseGetProperties
8534 }
8535 if sdgr.Location != nil {
8536 objectMap["location"] = sdgr.Location
8537 }
8538 if sdgr.Tags != nil {
8539 objectMap["tags"] = sdgr.Tags
8540 }
8541 return json.Marshal(objectMap)
8542 }
8543
8544
8545 func (sdgr *SQLDatabaseGetResults) UnmarshalJSON(body []byte) error {
8546 var m map[string]*json.RawMessage
8547 err := json.Unmarshal(body, &m)
8548 if err != nil {
8549 return err
8550 }
8551 for k, v := range m {
8552 switch k {
8553 case "properties":
8554 if v != nil {
8555 var SQLDatabaseGetProperties SQLDatabaseGetProperties
8556 err = json.Unmarshal(*v, &SQLDatabaseGetProperties)
8557 if err != nil {
8558 return err
8559 }
8560 sdgr.SQLDatabaseGetProperties = &SQLDatabaseGetProperties
8561 }
8562 case "id":
8563 if v != nil {
8564 var ID string
8565 err = json.Unmarshal(*v, &ID)
8566 if err != nil {
8567 return err
8568 }
8569 sdgr.ID = &ID
8570 }
8571 case "name":
8572 if v != nil {
8573 var name string
8574 err = json.Unmarshal(*v, &name)
8575 if err != nil {
8576 return err
8577 }
8578 sdgr.Name = &name
8579 }
8580 case "type":
8581 if v != nil {
8582 var typeVar string
8583 err = json.Unmarshal(*v, &typeVar)
8584 if err != nil {
8585 return err
8586 }
8587 sdgr.Type = &typeVar
8588 }
8589 case "location":
8590 if v != nil {
8591 var location string
8592 err = json.Unmarshal(*v, &location)
8593 if err != nil {
8594 return err
8595 }
8596 sdgr.Location = &location
8597 }
8598 case "tags":
8599 if v != nil {
8600 var tags map[string]*string
8601 err = json.Unmarshal(*v, &tags)
8602 if err != nil {
8603 return err
8604 }
8605 sdgr.Tags = tags
8606 }
8607 }
8608 }
8609
8610 return nil
8611 }
8612
8613
8614 type SQLDatabaseListResult struct {
8615 autorest.Response `json:"-"`
8616
8617 Value *[]SQLDatabaseGetResults `json:"value,omitempty"`
8618 }
8619
8620
8621 func (sdlr SQLDatabaseListResult) MarshalJSON() ([]byte, error) {
8622 objectMap := make(map[string]interface{})
8623 return json.Marshal(objectMap)
8624 }
8625
8626
8627 type SQLDatabaseResource struct {
8628
8629 ID *string `json:"id,omitempty"`
8630 }
8631
8632
8633
8634 type SQLResourcesCreateUpdateSQLContainerFuture struct {
8635 azure.FutureAPI
8636
8637
8638 Result func(SQLResourcesClient) (SQLContainerGetResults, error)
8639 }
8640
8641
8642 func (future *SQLResourcesCreateUpdateSQLContainerFuture) UnmarshalJSON(body []byte) error {
8643 var azFuture azure.Future
8644 if err := json.Unmarshal(body, &azFuture); err != nil {
8645 return err
8646 }
8647 future.FutureAPI = &azFuture
8648 future.Result = future.result
8649 return nil
8650 }
8651
8652
8653 func (future *SQLResourcesCreateUpdateSQLContainerFuture) result(client SQLResourcesClient) (scgr SQLContainerGetResults, err error) {
8654 var done bool
8655 done, err = future.DoneWithContext(context.Background(), client)
8656 if err != nil {
8657 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", future.Response(), "Polling failure")
8658 return
8659 }
8660 if !done {
8661 scgr.Response.Response = future.Response()
8662 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLContainerFuture")
8663 return
8664 }
8665 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8666 if scgr.Response.Response, err = future.GetResult(sender); err == nil && scgr.Response.Response.StatusCode != http.StatusNoContent {
8667 scgr, err = client.CreateUpdateSQLContainerResponder(scgr.Response.Response)
8668 if err != nil {
8669 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", scgr.Response.Response, "Failure responding to request")
8670 }
8671 }
8672 return
8673 }
8674
8675
8676
8677 type SQLResourcesCreateUpdateSQLDatabaseFuture struct {
8678 azure.FutureAPI
8679
8680
8681 Result func(SQLResourcesClient) (SQLDatabaseGetResults, error)
8682 }
8683
8684
8685 func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) UnmarshalJSON(body []byte) error {
8686 var azFuture azure.Future
8687 if err := json.Unmarshal(body, &azFuture); err != nil {
8688 return err
8689 }
8690 future.FutureAPI = &azFuture
8691 future.Result = future.result
8692 return nil
8693 }
8694
8695
8696 func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) result(client SQLResourcesClient) (sdgr SQLDatabaseGetResults, err error) {
8697 var done bool
8698 done, err = future.DoneWithContext(context.Background(), client)
8699 if err != nil {
8700 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", future.Response(), "Polling failure")
8701 return
8702 }
8703 if !done {
8704 sdgr.Response.Response = future.Response()
8705 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture")
8706 return
8707 }
8708 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8709 if sdgr.Response.Response, err = future.GetResult(sender); err == nil && sdgr.Response.Response.StatusCode != http.StatusNoContent {
8710 sdgr, err = client.CreateUpdateSQLDatabaseResponder(sdgr.Response.Response)
8711 if err != nil {
8712 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", sdgr.Response.Response, "Failure responding to request")
8713 }
8714 }
8715 return
8716 }
8717
8718
8719
8720 type SQLResourcesCreateUpdateSQLRoleAssignmentFuture struct {
8721 azure.FutureAPI
8722
8723
8724 Result func(SQLResourcesClient) (SQLRoleAssignmentGetResults, error)
8725 }
8726
8727
8728 func (future *SQLResourcesCreateUpdateSQLRoleAssignmentFuture) UnmarshalJSON(body []byte) error {
8729 var azFuture azure.Future
8730 if err := json.Unmarshal(body, &azFuture); err != nil {
8731 return err
8732 }
8733 future.FutureAPI = &azFuture
8734 future.Result = future.result
8735 return nil
8736 }
8737
8738
8739 func (future *SQLResourcesCreateUpdateSQLRoleAssignmentFuture) result(client SQLResourcesClient) (sragr SQLRoleAssignmentGetResults, err error) {
8740 var done bool
8741 done, err = future.DoneWithContext(context.Background(), client)
8742 if err != nil {
8743 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture", "Result", future.Response(), "Polling failure")
8744 return
8745 }
8746 if !done {
8747 sragr.Response.Response = future.Response()
8748 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture")
8749 return
8750 }
8751 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8752 if sragr.Response.Response, err = future.GetResult(sender); err == nil && sragr.Response.Response.StatusCode != http.StatusNoContent {
8753 sragr, err = client.CreateUpdateSQLRoleAssignmentResponder(sragr.Response.Response)
8754 if err != nil {
8755 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture", "Result", sragr.Response.Response, "Failure responding to request")
8756 }
8757 }
8758 return
8759 }
8760
8761
8762
8763 type SQLResourcesCreateUpdateSQLRoleDefinitionFuture struct {
8764 azure.FutureAPI
8765
8766
8767 Result func(SQLResourcesClient) (SQLRoleDefinitionGetResults, error)
8768 }
8769
8770
8771 func (future *SQLResourcesCreateUpdateSQLRoleDefinitionFuture) UnmarshalJSON(body []byte) error {
8772 var azFuture azure.Future
8773 if err := json.Unmarshal(body, &azFuture); err != nil {
8774 return err
8775 }
8776 future.FutureAPI = &azFuture
8777 future.Result = future.result
8778 return nil
8779 }
8780
8781
8782 func (future *SQLResourcesCreateUpdateSQLRoleDefinitionFuture) result(client SQLResourcesClient) (srdgr SQLRoleDefinitionGetResults, err error) {
8783 var done bool
8784 done, err = future.DoneWithContext(context.Background(), client)
8785 if err != nil {
8786 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture", "Result", future.Response(), "Polling failure")
8787 return
8788 }
8789 if !done {
8790 srdgr.Response.Response = future.Response()
8791 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture")
8792 return
8793 }
8794 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8795 if srdgr.Response.Response, err = future.GetResult(sender); err == nil && srdgr.Response.Response.StatusCode != http.StatusNoContent {
8796 srdgr, err = client.CreateUpdateSQLRoleDefinitionResponder(srdgr.Response.Response)
8797 if err != nil {
8798 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture", "Result", srdgr.Response.Response, "Failure responding to request")
8799 }
8800 }
8801 return
8802 }
8803
8804
8805
8806 type SQLResourcesCreateUpdateSQLStoredProcedureFuture struct {
8807 azure.FutureAPI
8808
8809
8810 Result func(SQLResourcesClient) (SQLStoredProcedureGetResults, error)
8811 }
8812
8813
8814 func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error {
8815 var azFuture azure.Future
8816 if err := json.Unmarshal(body, &azFuture); err != nil {
8817 return err
8818 }
8819 future.FutureAPI = &azFuture
8820 future.Result = future.result
8821 return nil
8822 }
8823
8824
8825 func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) result(client SQLResourcesClient) (sspgr SQLStoredProcedureGetResults, err error) {
8826 var done bool
8827 done, err = future.DoneWithContext(context.Background(), client)
8828 if err != nil {
8829 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure")
8830 return
8831 }
8832 if !done {
8833 sspgr.Response.Response = future.Response()
8834 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture")
8835 return
8836 }
8837 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8838 if sspgr.Response.Response, err = future.GetResult(sender); err == nil && sspgr.Response.Response.StatusCode != http.StatusNoContent {
8839 sspgr, err = client.CreateUpdateSQLStoredProcedureResponder(sspgr.Response.Response)
8840 if err != nil {
8841 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", sspgr.Response.Response, "Failure responding to request")
8842 }
8843 }
8844 return
8845 }
8846
8847
8848
8849 type SQLResourcesCreateUpdateSQLTriggerFuture struct {
8850 azure.FutureAPI
8851
8852
8853 Result func(SQLResourcesClient) (SQLTriggerGetResults, error)
8854 }
8855
8856
8857 func (future *SQLResourcesCreateUpdateSQLTriggerFuture) UnmarshalJSON(body []byte) error {
8858 var azFuture azure.Future
8859 if err := json.Unmarshal(body, &azFuture); err != nil {
8860 return err
8861 }
8862 future.FutureAPI = &azFuture
8863 future.Result = future.result
8864 return nil
8865 }
8866
8867
8868 func (future *SQLResourcesCreateUpdateSQLTriggerFuture) result(client SQLResourcesClient) (stgr SQLTriggerGetResults, err error) {
8869 var done bool
8870 done, err = future.DoneWithContext(context.Background(), client)
8871 if err != nil {
8872 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", future.Response(), "Polling failure")
8873 return
8874 }
8875 if !done {
8876 stgr.Response.Response = future.Response()
8877 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLTriggerFuture")
8878 return
8879 }
8880 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8881 if stgr.Response.Response, err = future.GetResult(sender); err == nil && stgr.Response.Response.StatusCode != http.StatusNoContent {
8882 stgr, err = client.CreateUpdateSQLTriggerResponder(stgr.Response.Response)
8883 if err != nil {
8884 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", stgr.Response.Response, "Failure responding to request")
8885 }
8886 }
8887 return
8888 }
8889
8890
8891
8892 type SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture struct {
8893 azure.FutureAPI
8894
8895
8896 Result func(SQLResourcesClient) (SQLUserDefinedFunctionGetResults, error)
8897 }
8898
8899
8900 func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error {
8901 var azFuture azure.Future
8902 if err := json.Unmarshal(body, &azFuture); err != nil {
8903 return err
8904 }
8905 future.FutureAPI = &azFuture
8906 future.Result = future.result
8907 return nil
8908 }
8909
8910
8911 func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (sudfgr SQLUserDefinedFunctionGetResults, err error) {
8912 var done bool
8913 done, err = future.DoneWithContext(context.Background(), client)
8914 if err != nil {
8915 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure")
8916 return
8917 }
8918 if !done {
8919 sudfgr.Response.Response = future.Response()
8920 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture")
8921 return
8922 }
8923 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8924 if sudfgr.Response.Response, err = future.GetResult(sender); err == nil && sudfgr.Response.Response.StatusCode != http.StatusNoContent {
8925 sudfgr, err = client.CreateUpdateSQLUserDefinedFunctionResponder(sudfgr.Response.Response)
8926 if err != nil {
8927 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", sudfgr.Response.Response, "Failure responding to request")
8928 }
8929 }
8930 return
8931 }
8932
8933
8934
8935 type SQLResourcesDeleteSQLContainerFuture struct {
8936 azure.FutureAPI
8937
8938
8939 Result func(SQLResourcesClient) (autorest.Response, error)
8940 }
8941
8942
8943 func (future *SQLResourcesDeleteSQLContainerFuture) UnmarshalJSON(body []byte) error {
8944 var azFuture azure.Future
8945 if err := json.Unmarshal(body, &azFuture); err != nil {
8946 return err
8947 }
8948 future.FutureAPI = &azFuture
8949 future.Result = future.result
8950 return nil
8951 }
8952
8953
8954 func (future *SQLResourcesDeleteSQLContainerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
8955 var done bool
8956 done, err = future.DoneWithContext(context.Background(), client)
8957 if err != nil {
8958 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLContainerFuture", "Result", future.Response(), "Polling failure")
8959 return
8960 }
8961 if !done {
8962 ar.Response = future.Response()
8963 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLContainerFuture")
8964 return
8965 }
8966 ar.Response = future.Response()
8967 return
8968 }
8969
8970
8971
8972 type SQLResourcesDeleteSQLDatabaseFuture struct {
8973 azure.FutureAPI
8974
8975
8976 Result func(SQLResourcesClient) (autorest.Response, error)
8977 }
8978
8979
8980 func (future *SQLResourcesDeleteSQLDatabaseFuture) UnmarshalJSON(body []byte) error {
8981 var azFuture azure.Future
8982 if err := json.Unmarshal(body, &azFuture); err != nil {
8983 return err
8984 }
8985 future.FutureAPI = &azFuture
8986 future.Result = future.result
8987 return nil
8988 }
8989
8990
8991 func (future *SQLResourcesDeleteSQLDatabaseFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
8992 var done bool
8993 done, err = future.DoneWithContext(context.Background(), client)
8994 if err != nil {
8995 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLDatabaseFuture", "Result", future.Response(), "Polling failure")
8996 return
8997 }
8998 if !done {
8999 ar.Response = future.Response()
9000 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLDatabaseFuture")
9001 return
9002 }
9003 ar.Response = future.Response()
9004 return
9005 }
9006
9007
9008
9009 type SQLResourcesDeleteSQLRoleAssignmentFuture struct {
9010 azure.FutureAPI
9011
9012
9013 Result func(SQLResourcesClient) (autorest.Response, error)
9014 }
9015
9016
9017 func (future *SQLResourcesDeleteSQLRoleAssignmentFuture) UnmarshalJSON(body []byte) error {
9018 var azFuture azure.Future
9019 if err := json.Unmarshal(body, &azFuture); err != nil {
9020 return err
9021 }
9022 future.FutureAPI = &azFuture
9023 future.Result = future.result
9024 return nil
9025 }
9026
9027
9028 func (future *SQLResourcesDeleteSQLRoleAssignmentFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
9029 var done bool
9030 done, err = future.DoneWithContext(context.Background(), client)
9031 if err != nil {
9032 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLRoleAssignmentFuture", "Result", future.Response(), "Polling failure")
9033 return
9034 }
9035 if !done {
9036 ar.Response = future.Response()
9037 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLRoleAssignmentFuture")
9038 return
9039 }
9040 ar.Response = future.Response()
9041 return
9042 }
9043
9044
9045
9046 type SQLResourcesDeleteSQLRoleDefinitionFuture struct {
9047 azure.FutureAPI
9048
9049
9050 Result func(SQLResourcesClient) (autorest.Response, error)
9051 }
9052
9053
9054 func (future *SQLResourcesDeleteSQLRoleDefinitionFuture) UnmarshalJSON(body []byte) error {
9055 var azFuture azure.Future
9056 if err := json.Unmarshal(body, &azFuture); err != nil {
9057 return err
9058 }
9059 future.FutureAPI = &azFuture
9060 future.Result = future.result
9061 return nil
9062 }
9063
9064
9065 func (future *SQLResourcesDeleteSQLRoleDefinitionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
9066 var done bool
9067 done, err = future.DoneWithContext(context.Background(), client)
9068 if err != nil {
9069 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLRoleDefinitionFuture", "Result", future.Response(), "Polling failure")
9070 return
9071 }
9072 if !done {
9073 ar.Response = future.Response()
9074 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLRoleDefinitionFuture")
9075 return
9076 }
9077 ar.Response = future.Response()
9078 return
9079 }
9080
9081
9082
9083 type SQLResourcesDeleteSQLStoredProcedureFuture struct {
9084 azure.FutureAPI
9085
9086
9087 Result func(SQLResourcesClient) (autorest.Response, error)
9088 }
9089
9090
9091 func (future *SQLResourcesDeleteSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error {
9092 var azFuture azure.Future
9093 if err := json.Unmarshal(body, &azFuture); err != nil {
9094 return err
9095 }
9096 future.FutureAPI = &azFuture
9097 future.Result = future.result
9098 return nil
9099 }
9100
9101
9102 func (future *SQLResourcesDeleteSQLStoredProcedureFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
9103 var done bool
9104 done, err = future.DoneWithContext(context.Background(), client)
9105 if err != nil {
9106 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure")
9107 return
9108 }
9109 if !done {
9110 ar.Response = future.Response()
9111 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLStoredProcedureFuture")
9112 return
9113 }
9114 ar.Response = future.Response()
9115 return
9116 }
9117
9118
9119
9120 type SQLResourcesDeleteSQLTriggerFuture struct {
9121 azure.FutureAPI
9122
9123
9124 Result func(SQLResourcesClient) (autorest.Response, error)
9125 }
9126
9127
9128 func (future *SQLResourcesDeleteSQLTriggerFuture) UnmarshalJSON(body []byte) error {
9129 var azFuture azure.Future
9130 if err := json.Unmarshal(body, &azFuture); err != nil {
9131 return err
9132 }
9133 future.FutureAPI = &azFuture
9134 future.Result = future.result
9135 return nil
9136 }
9137
9138
9139 func (future *SQLResourcesDeleteSQLTriggerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
9140 var done bool
9141 done, err = future.DoneWithContext(context.Background(), client)
9142 if err != nil {
9143 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLTriggerFuture", "Result", future.Response(), "Polling failure")
9144 return
9145 }
9146 if !done {
9147 ar.Response = future.Response()
9148 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLTriggerFuture")
9149 return
9150 }
9151 ar.Response = future.Response()
9152 return
9153 }
9154
9155
9156
9157 type SQLResourcesDeleteSQLUserDefinedFunctionFuture struct {
9158 azure.FutureAPI
9159
9160
9161 Result func(SQLResourcesClient) (autorest.Response, error)
9162 }
9163
9164
9165 func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error {
9166 var azFuture azure.Future
9167 if err := json.Unmarshal(body, &azFuture); err != nil {
9168 return err
9169 }
9170 future.FutureAPI = &azFuture
9171 future.Result = future.result
9172 return nil
9173 }
9174
9175
9176 func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
9177 var done bool
9178 done, err = future.DoneWithContext(context.Background(), client)
9179 if err != nil {
9180 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure")
9181 return
9182 }
9183 if !done {
9184 ar.Response = future.Response()
9185 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture")
9186 return
9187 }
9188 ar.Response = future.Response()
9189 return
9190 }
9191
9192
9193
9194 type SQLResourcesMigrateSQLContainerToAutoscaleFuture struct {
9195 azure.FutureAPI
9196
9197
9198 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
9199 }
9200
9201
9202 func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) UnmarshalJSON(body []byte) error {
9203 var azFuture azure.Future
9204 if err := json.Unmarshal(body, &azFuture); err != nil {
9205 return err
9206 }
9207 future.FutureAPI = &azFuture
9208 future.Result = future.result
9209 return nil
9210 }
9211
9212
9213 func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
9214 var done bool
9215 done, err = future.DoneWithContext(context.Background(), client)
9216 if err != nil {
9217 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", future.Response(), "Polling failure")
9218 return
9219 }
9220 if !done {
9221 tsgr.Response.Response = future.Response()
9222 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture")
9223 return
9224 }
9225 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9226 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
9227 tsgr, err = client.MigrateSQLContainerToAutoscaleResponder(tsgr.Response.Response)
9228 if err != nil {
9229 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
9230 }
9231 }
9232 return
9233 }
9234
9235
9236
9237 type SQLResourcesMigrateSQLContainerToManualThroughputFuture struct {
9238 azure.FutureAPI
9239
9240
9241 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
9242 }
9243
9244
9245 func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) UnmarshalJSON(body []byte) error {
9246 var azFuture azure.Future
9247 if err := json.Unmarshal(body, &azFuture); err != nil {
9248 return err
9249 }
9250 future.FutureAPI = &azFuture
9251 future.Result = future.result
9252 return nil
9253 }
9254
9255
9256 func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
9257 var done bool
9258 done, err = future.DoneWithContext(context.Background(), client)
9259 if err != nil {
9260 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", future.Response(), "Polling failure")
9261 return
9262 }
9263 if !done {
9264 tsgr.Response.Response = future.Response()
9265 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture")
9266 return
9267 }
9268 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9269 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
9270 tsgr, err = client.MigrateSQLContainerToManualThroughputResponder(tsgr.Response.Response)
9271 if err != nil {
9272 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
9273 }
9274 }
9275 return
9276 }
9277
9278
9279
9280 type SQLResourcesMigrateSQLDatabaseToAutoscaleFuture struct {
9281 azure.FutureAPI
9282
9283
9284 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
9285 }
9286
9287
9288 func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error {
9289 var azFuture azure.Future
9290 if err := json.Unmarshal(body, &azFuture); err != nil {
9291 return err
9292 }
9293 future.FutureAPI = &azFuture
9294 future.Result = future.result
9295 return nil
9296 }
9297
9298
9299 func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
9300 var done bool
9301 done, err = future.DoneWithContext(context.Background(), client)
9302 if err != nil {
9303 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure")
9304 return
9305 }
9306 if !done {
9307 tsgr.Response.Response = future.Response()
9308 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture")
9309 return
9310 }
9311 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9312 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
9313 tsgr, err = client.MigrateSQLDatabaseToAutoscaleResponder(tsgr.Response.Response)
9314 if err != nil {
9315 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
9316 }
9317 }
9318 return
9319 }
9320
9321
9322
9323 type SQLResourcesMigrateSQLDatabaseToManualThroughputFuture struct {
9324 azure.FutureAPI
9325
9326
9327 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
9328 }
9329
9330
9331 func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error {
9332 var azFuture azure.Future
9333 if err := json.Unmarshal(body, &azFuture); err != nil {
9334 return err
9335 }
9336 future.FutureAPI = &azFuture
9337 future.Result = future.result
9338 return nil
9339 }
9340
9341
9342 func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
9343 var done bool
9344 done, err = future.DoneWithContext(context.Background(), client)
9345 if err != nil {
9346 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure")
9347 return
9348 }
9349 if !done {
9350 tsgr.Response.Response = future.Response()
9351 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture")
9352 return
9353 }
9354 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9355 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
9356 tsgr, err = client.MigrateSQLDatabaseToManualThroughputResponder(tsgr.Response.Response)
9357 if err != nil {
9358 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
9359 }
9360 }
9361 return
9362 }
9363
9364
9365
9366 type SQLResourcesRetrieveContinuousBackupInformationFuture struct {
9367 azure.FutureAPI
9368
9369
9370 Result func(SQLResourcesClient) (BackupInformation, error)
9371 }
9372
9373
9374 func (future *SQLResourcesRetrieveContinuousBackupInformationFuture) UnmarshalJSON(body []byte) error {
9375 var azFuture azure.Future
9376 if err := json.Unmarshal(body, &azFuture); err != nil {
9377 return err
9378 }
9379 future.FutureAPI = &azFuture
9380 future.Result = future.result
9381 return nil
9382 }
9383
9384
9385 func (future *SQLResourcesRetrieveContinuousBackupInformationFuture) result(client SQLResourcesClient) (bi BackupInformation, err error) {
9386 var done bool
9387 done, err = future.DoneWithContext(context.Background(), client)
9388 if err != nil {
9389 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesRetrieveContinuousBackupInformationFuture", "Result", future.Response(), "Polling failure")
9390 return
9391 }
9392 if !done {
9393 bi.Response.Response = future.Response()
9394 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesRetrieveContinuousBackupInformationFuture")
9395 return
9396 }
9397 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9398 if bi.Response.Response, err = future.GetResult(sender); err == nil && bi.Response.Response.StatusCode != http.StatusNoContent {
9399 bi, err = client.RetrieveContinuousBackupInformationResponder(bi.Response.Response)
9400 if err != nil {
9401 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesRetrieveContinuousBackupInformationFuture", "Result", bi.Response.Response, "Failure responding to request")
9402 }
9403 }
9404 return
9405 }
9406
9407
9408
9409 type SQLResourcesUpdateSQLContainerThroughputFuture struct {
9410 azure.FutureAPI
9411
9412
9413 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
9414 }
9415
9416
9417 func (future *SQLResourcesUpdateSQLContainerThroughputFuture) UnmarshalJSON(body []byte) error {
9418 var azFuture azure.Future
9419 if err := json.Unmarshal(body, &azFuture); err != nil {
9420 return err
9421 }
9422 future.FutureAPI = &azFuture
9423 future.Result = future.result
9424 return nil
9425 }
9426
9427
9428 func (future *SQLResourcesUpdateSQLContainerThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
9429 var done bool
9430 done, err = future.DoneWithContext(context.Background(), client)
9431 if err != nil {
9432 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", future.Response(), "Polling failure")
9433 return
9434 }
9435 if !done {
9436 tsgr.Response.Response = future.Response()
9437 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLContainerThroughputFuture")
9438 return
9439 }
9440 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9441 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
9442 tsgr, err = client.UpdateSQLContainerThroughputResponder(tsgr.Response.Response)
9443 if err != nil {
9444 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
9445 }
9446 }
9447 return
9448 }
9449
9450
9451
9452 type SQLResourcesUpdateSQLDatabaseThroughputFuture struct {
9453 azure.FutureAPI
9454
9455
9456 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
9457 }
9458
9459
9460 func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) UnmarshalJSON(body []byte) error {
9461 var azFuture azure.Future
9462 if err := json.Unmarshal(body, &azFuture); err != nil {
9463 return err
9464 }
9465 future.FutureAPI = &azFuture
9466 future.Result = future.result
9467 return nil
9468 }
9469
9470
9471 func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
9472 var done bool
9473 done, err = future.DoneWithContext(context.Background(), client)
9474 if err != nil {
9475 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", future.Response(), "Polling failure")
9476 return
9477 }
9478 if !done {
9479 tsgr.Response.Response = future.Response()
9480 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture")
9481 return
9482 }
9483 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9484 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
9485 tsgr, err = client.UpdateSQLDatabaseThroughputResponder(tsgr.Response.Response)
9486 if err != nil {
9487 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
9488 }
9489 }
9490 return
9491 }
9492
9493
9494
9495 type SQLRoleAssignmentCreateUpdateParameters struct {
9496
9497 *SQLRoleAssignmentResource `json:"properties,omitempty"`
9498 }
9499
9500
9501 func (sracup SQLRoleAssignmentCreateUpdateParameters) MarshalJSON() ([]byte, error) {
9502 objectMap := make(map[string]interface{})
9503 if sracup.SQLRoleAssignmentResource != nil {
9504 objectMap["properties"] = sracup.SQLRoleAssignmentResource
9505 }
9506 return json.Marshal(objectMap)
9507 }
9508
9509
9510 func (sracup *SQLRoleAssignmentCreateUpdateParameters) UnmarshalJSON(body []byte) error {
9511 var m map[string]*json.RawMessage
9512 err := json.Unmarshal(body, &m)
9513 if err != nil {
9514 return err
9515 }
9516 for k, v := range m {
9517 switch k {
9518 case "properties":
9519 if v != nil {
9520 var SQLRoleAssignmentResource SQLRoleAssignmentResource
9521 err = json.Unmarshal(*v, &SQLRoleAssignmentResource)
9522 if err != nil {
9523 return err
9524 }
9525 sracup.SQLRoleAssignmentResource = &SQLRoleAssignmentResource
9526 }
9527 }
9528 }
9529
9530 return nil
9531 }
9532
9533
9534 type SQLRoleAssignmentGetResults struct {
9535 autorest.Response `json:"-"`
9536
9537 *SQLRoleAssignmentResource `json:"properties,omitempty"`
9538
9539 ID *string `json:"id,omitempty"`
9540
9541 Name *string `json:"name,omitempty"`
9542
9543 Type *string `json:"type,omitempty"`
9544 }
9545
9546
9547 func (sragr SQLRoleAssignmentGetResults) MarshalJSON() ([]byte, error) {
9548 objectMap := make(map[string]interface{})
9549 if sragr.SQLRoleAssignmentResource != nil {
9550 objectMap["properties"] = sragr.SQLRoleAssignmentResource
9551 }
9552 return json.Marshal(objectMap)
9553 }
9554
9555
9556 func (sragr *SQLRoleAssignmentGetResults) UnmarshalJSON(body []byte) error {
9557 var m map[string]*json.RawMessage
9558 err := json.Unmarshal(body, &m)
9559 if err != nil {
9560 return err
9561 }
9562 for k, v := range m {
9563 switch k {
9564 case "properties":
9565 if v != nil {
9566 var SQLRoleAssignmentResource SQLRoleAssignmentResource
9567 err = json.Unmarshal(*v, &SQLRoleAssignmentResource)
9568 if err != nil {
9569 return err
9570 }
9571 sragr.SQLRoleAssignmentResource = &SQLRoleAssignmentResource
9572 }
9573 case "id":
9574 if v != nil {
9575 var ID string
9576 err = json.Unmarshal(*v, &ID)
9577 if err != nil {
9578 return err
9579 }
9580 sragr.ID = &ID
9581 }
9582 case "name":
9583 if v != nil {
9584 var name string
9585 err = json.Unmarshal(*v, &name)
9586 if err != nil {
9587 return err
9588 }
9589 sragr.Name = &name
9590 }
9591 case "type":
9592 if v != nil {
9593 var typeVar string
9594 err = json.Unmarshal(*v, &typeVar)
9595 if err != nil {
9596 return err
9597 }
9598 sragr.Type = &typeVar
9599 }
9600 }
9601 }
9602
9603 return nil
9604 }
9605
9606
9607 type SQLRoleAssignmentListResult struct {
9608 autorest.Response `json:"-"`
9609
9610 Value *[]SQLRoleAssignmentGetResults `json:"value,omitempty"`
9611 }
9612
9613
9614 func (sralr SQLRoleAssignmentListResult) MarshalJSON() ([]byte, error) {
9615 objectMap := make(map[string]interface{})
9616 return json.Marshal(objectMap)
9617 }
9618
9619
9620 type SQLRoleAssignmentResource struct {
9621
9622 RoleDefinitionID *string `json:"roleDefinitionId,omitempty"`
9623
9624 Scope *string `json:"scope,omitempty"`
9625
9626 PrincipalID *string `json:"principalId,omitempty"`
9627 }
9628
9629
9630
9631 type SQLRoleDefinitionCreateUpdateParameters struct {
9632
9633 *SQLRoleDefinitionResource `json:"properties,omitempty"`
9634 }
9635
9636
9637 func (srdcup SQLRoleDefinitionCreateUpdateParameters) MarshalJSON() ([]byte, error) {
9638 objectMap := make(map[string]interface{})
9639 if srdcup.SQLRoleDefinitionResource != nil {
9640 objectMap["properties"] = srdcup.SQLRoleDefinitionResource
9641 }
9642 return json.Marshal(objectMap)
9643 }
9644
9645
9646 func (srdcup *SQLRoleDefinitionCreateUpdateParameters) UnmarshalJSON(body []byte) error {
9647 var m map[string]*json.RawMessage
9648 err := json.Unmarshal(body, &m)
9649 if err != nil {
9650 return err
9651 }
9652 for k, v := range m {
9653 switch k {
9654 case "properties":
9655 if v != nil {
9656 var SQLRoleDefinitionResource SQLRoleDefinitionResource
9657 err = json.Unmarshal(*v, &SQLRoleDefinitionResource)
9658 if err != nil {
9659 return err
9660 }
9661 srdcup.SQLRoleDefinitionResource = &SQLRoleDefinitionResource
9662 }
9663 }
9664 }
9665
9666 return nil
9667 }
9668
9669
9670 type SQLRoleDefinitionGetResults struct {
9671 autorest.Response `json:"-"`
9672
9673 *SQLRoleDefinitionResource `json:"properties,omitempty"`
9674
9675 ID *string `json:"id,omitempty"`
9676
9677 Name *string `json:"name,omitempty"`
9678
9679 Type *string `json:"type,omitempty"`
9680 }
9681
9682
9683 func (srdgr SQLRoleDefinitionGetResults) MarshalJSON() ([]byte, error) {
9684 objectMap := make(map[string]interface{})
9685 if srdgr.SQLRoleDefinitionResource != nil {
9686 objectMap["properties"] = srdgr.SQLRoleDefinitionResource
9687 }
9688 return json.Marshal(objectMap)
9689 }
9690
9691
9692 func (srdgr *SQLRoleDefinitionGetResults) UnmarshalJSON(body []byte) error {
9693 var m map[string]*json.RawMessage
9694 err := json.Unmarshal(body, &m)
9695 if err != nil {
9696 return err
9697 }
9698 for k, v := range m {
9699 switch k {
9700 case "properties":
9701 if v != nil {
9702 var SQLRoleDefinitionResource SQLRoleDefinitionResource
9703 err = json.Unmarshal(*v, &SQLRoleDefinitionResource)
9704 if err != nil {
9705 return err
9706 }
9707 srdgr.SQLRoleDefinitionResource = &SQLRoleDefinitionResource
9708 }
9709 case "id":
9710 if v != nil {
9711 var ID string
9712 err = json.Unmarshal(*v, &ID)
9713 if err != nil {
9714 return err
9715 }
9716 srdgr.ID = &ID
9717 }
9718 case "name":
9719 if v != nil {
9720 var name string
9721 err = json.Unmarshal(*v, &name)
9722 if err != nil {
9723 return err
9724 }
9725 srdgr.Name = &name
9726 }
9727 case "type":
9728 if v != nil {
9729 var typeVar string
9730 err = json.Unmarshal(*v, &typeVar)
9731 if err != nil {
9732 return err
9733 }
9734 srdgr.Type = &typeVar
9735 }
9736 }
9737 }
9738
9739 return nil
9740 }
9741
9742
9743 type SQLRoleDefinitionListResult struct {
9744 autorest.Response `json:"-"`
9745
9746 Value *[]SQLRoleDefinitionGetResults `json:"value,omitempty"`
9747 }
9748
9749
9750 func (srdlr SQLRoleDefinitionListResult) MarshalJSON() ([]byte, error) {
9751 objectMap := make(map[string]interface{})
9752 return json.Marshal(objectMap)
9753 }
9754
9755
9756 type SQLRoleDefinitionResource struct {
9757
9758 RoleName *string `json:"roleName,omitempty"`
9759
9760 Type RoleDefinitionType `json:"type,omitempty"`
9761
9762 AssignableScopes *[]string `json:"assignableScopes,omitempty"`
9763
9764 Permissions *[]Permission `json:"permissions,omitempty"`
9765 }
9766
9767
9768 type SQLStoredProcedureCreateUpdateParameters struct {
9769
9770 *SQLStoredProcedureCreateUpdateProperties `json:"properties,omitempty"`
9771
9772 ID *string `json:"id,omitempty"`
9773
9774 Name *string `json:"name,omitempty"`
9775
9776 Type *string `json:"type,omitempty"`
9777
9778 Location *string `json:"location,omitempty"`
9779 Tags map[string]*string `json:"tags"`
9780 }
9781
9782
9783 func (sspcup SQLStoredProcedureCreateUpdateParameters) MarshalJSON() ([]byte, error) {
9784 objectMap := make(map[string]interface{})
9785 if sspcup.SQLStoredProcedureCreateUpdateProperties != nil {
9786 objectMap["properties"] = sspcup.SQLStoredProcedureCreateUpdateProperties
9787 }
9788 if sspcup.Location != nil {
9789 objectMap["location"] = sspcup.Location
9790 }
9791 if sspcup.Tags != nil {
9792 objectMap["tags"] = sspcup.Tags
9793 }
9794 return json.Marshal(objectMap)
9795 }
9796
9797
9798 func (sspcup *SQLStoredProcedureCreateUpdateParameters) UnmarshalJSON(body []byte) error {
9799 var m map[string]*json.RawMessage
9800 err := json.Unmarshal(body, &m)
9801 if err != nil {
9802 return err
9803 }
9804 for k, v := range m {
9805 switch k {
9806 case "properties":
9807 if v != nil {
9808 var SQLStoredProcedureCreateUpdateProperties SQLStoredProcedureCreateUpdateProperties
9809 err = json.Unmarshal(*v, &SQLStoredProcedureCreateUpdateProperties)
9810 if err != nil {
9811 return err
9812 }
9813 sspcup.SQLStoredProcedureCreateUpdateProperties = &SQLStoredProcedureCreateUpdateProperties
9814 }
9815 case "id":
9816 if v != nil {
9817 var ID string
9818 err = json.Unmarshal(*v, &ID)
9819 if err != nil {
9820 return err
9821 }
9822 sspcup.ID = &ID
9823 }
9824 case "name":
9825 if v != nil {
9826 var name string
9827 err = json.Unmarshal(*v, &name)
9828 if err != nil {
9829 return err
9830 }
9831 sspcup.Name = &name
9832 }
9833 case "type":
9834 if v != nil {
9835 var typeVar string
9836 err = json.Unmarshal(*v, &typeVar)
9837 if err != nil {
9838 return err
9839 }
9840 sspcup.Type = &typeVar
9841 }
9842 case "location":
9843 if v != nil {
9844 var location string
9845 err = json.Unmarshal(*v, &location)
9846 if err != nil {
9847 return err
9848 }
9849 sspcup.Location = &location
9850 }
9851 case "tags":
9852 if v != nil {
9853 var tags map[string]*string
9854 err = json.Unmarshal(*v, &tags)
9855 if err != nil {
9856 return err
9857 }
9858 sspcup.Tags = tags
9859 }
9860 }
9861 }
9862
9863 return nil
9864 }
9865
9866
9867
9868 type SQLStoredProcedureCreateUpdateProperties struct {
9869
9870 Resource *SQLStoredProcedureResource `json:"resource,omitempty"`
9871
9872 Options *CreateUpdateOptions `json:"options,omitempty"`
9873 }
9874
9875
9876 type SQLStoredProcedureGetProperties struct {
9877 Resource *SQLStoredProcedureGetPropertiesResource `json:"resource,omitempty"`
9878 }
9879
9880
9881 type SQLStoredProcedureGetPropertiesResource struct {
9882
9883 ID *string `json:"id,omitempty"`
9884
9885 Body *string `json:"body,omitempty"`
9886
9887 Rid *string `json:"_rid,omitempty"`
9888
9889 Ts *float64 `json:"_ts,omitempty"`
9890
9891 Etag *string `json:"_etag,omitempty"`
9892 }
9893
9894
9895 func (sspgp SQLStoredProcedureGetPropertiesResource) MarshalJSON() ([]byte, error) {
9896 objectMap := make(map[string]interface{})
9897 if sspgp.ID != nil {
9898 objectMap["id"] = sspgp.ID
9899 }
9900 if sspgp.Body != nil {
9901 objectMap["body"] = sspgp.Body
9902 }
9903 return json.Marshal(objectMap)
9904 }
9905
9906
9907 type SQLStoredProcedureGetResults struct {
9908 autorest.Response `json:"-"`
9909
9910 *SQLStoredProcedureGetProperties `json:"properties,omitempty"`
9911
9912 ID *string `json:"id,omitempty"`
9913
9914 Name *string `json:"name,omitempty"`
9915
9916 Type *string `json:"type,omitempty"`
9917
9918 Location *string `json:"location,omitempty"`
9919 Tags map[string]*string `json:"tags"`
9920 }
9921
9922
9923 func (sspgr SQLStoredProcedureGetResults) MarshalJSON() ([]byte, error) {
9924 objectMap := make(map[string]interface{})
9925 if sspgr.SQLStoredProcedureGetProperties != nil {
9926 objectMap["properties"] = sspgr.SQLStoredProcedureGetProperties
9927 }
9928 if sspgr.Location != nil {
9929 objectMap["location"] = sspgr.Location
9930 }
9931 if sspgr.Tags != nil {
9932 objectMap["tags"] = sspgr.Tags
9933 }
9934 return json.Marshal(objectMap)
9935 }
9936
9937
9938 func (sspgr *SQLStoredProcedureGetResults) UnmarshalJSON(body []byte) error {
9939 var m map[string]*json.RawMessage
9940 err := json.Unmarshal(body, &m)
9941 if err != nil {
9942 return err
9943 }
9944 for k, v := range m {
9945 switch k {
9946 case "properties":
9947 if v != nil {
9948 var SQLStoredProcedureGetProperties SQLStoredProcedureGetProperties
9949 err = json.Unmarshal(*v, &SQLStoredProcedureGetProperties)
9950 if err != nil {
9951 return err
9952 }
9953 sspgr.SQLStoredProcedureGetProperties = &SQLStoredProcedureGetProperties
9954 }
9955 case "id":
9956 if v != nil {
9957 var ID string
9958 err = json.Unmarshal(*v, &ID)
9959 if err != nil {
9960 return err
9961 }
9962 sspgr.ID = &ID
9963 }
9964 case "name":
9965 if v != nil {
9966 var name string
9967 err = json.Unmarshal(*v, &name)
9968 if err != nil {
9969 return err
9970 }
9971 sspgr.Name = &name
9972 }
9973 case "type":
9974 if v != nil {
9975 var typeVar string
9976 err = json.Unmarshal(*v, &typeVar)
9977 if err != nil {
9978 return err
9979 }
9980 sspgr.Type = &typeVar
9981 }
9982 case "location":
9983 if v != nil {
9984 var location string
9985 err = json.Unmarshal(*v, &location)
9986 if err != nil {
9987 return err
9988 }
9989 sspgr.Location = &location
9990 }
9991 case "tags":
9992 if v != nil {
9993 var tags map[string]*string
9994 err = json.Unmarshal(*v, &tags)
9995 if err != nil {
9996 return err
9997 }
9998 sspgr.Tags = tags
9999 }
10000 }
10001 }
10002
10003 return nil
10004 }
10005
10006
10007
10008 type SQLStoredProcedureListResult struct {
10009 autorest.Response `json:"-"`
10010
10011 Value *[]SQLStoredProcedureGetResults `json:"value,omitempty"`
10012 }
10013
10014
10015 func (ssplr SQLStoredProcedureListResult) MarshalJSON() ([]byte, error) {
10016 objectMap := make(map[string]interface{})
10017 return json.Marshal(objectMap)
10018 }
10019
10020
10021 type SQLStoredProcedureResource struct {
10022
10023 ID *string `json:"id,omitempty"`
10024
10025 Body *string `json:"body,omitempty"`
10026 }
10027
10028
10029 type SQLTriggerCreateUpdateParameters struct {
10030
10031 *SQLTriggerCreateUpdateProperties `json:"properties,omitempty"`
10032
10033 ID *string `json:"id,omitempty"`
10034
10035 Name *string `json:"name,omitempty"`
10036
10037 Type *string `json:"type,omitempty"`
10038
10039 Location *string `json:"location,omitempty"`
10040 Tags map[string]*string `json:"tags"`
10041 }
10042
10043
10044 func (stcup SQLTriggerCreateUpdateParameters) MarshalJSON() ([]byte, error) {
10045 objectMap := make(map[string]interface{})
10046 if stcup.SQLTriggerCreateUpdateProperties != nil {
10047 objectMap["properties"] = stcup.SQLTriggerCreateUpdateProperties
10048 }
10049 if stcup.Location != nil {
10050 objectMap["location"] = stcup.Location
10051 }
10052 if stcup.Tags != nil {
10053 objectMap["tags"] = stcup.Tags
10054 }
10055 return json.Marshal(objectMap)
10056 }
10057
10058
10059 func (stcup *SQLTriggerCreateUpdateParameters) UnmarshalJSON(body []byte) error {
10060 var m map[string]*json.RawMessage
10061 err := json.Unmarshal(body, &m)
10062 if err != nil {
10063 return err
10064 }
10065 for k, v := range m {
10066 switch k {
10067 case "properties":
10068 if v != nil {
10069 var SQLTriggerCreateUpdateProperties SQLTriggerCreateUpdateProperties
10070 err = json.Unmarshal(*v, &SQLTriggerCreateUpdateProperties)
10071 if err != nil {
10072 return err
10073 }
10074 stcup.SQLTriggerCreateUpdateProperties = &SQLTriggerCreateUpdateProperties
10075 }
10076 case "id":
10077 if v != nil {
10078 var ID string
10079 err = json.Unmarshal(*v, &ID)
10080 if err != nil {
10081 return err
10082 }
10083 stcup.ID = &ID
10084 }
10085 case "name":
10086 if v != nil {
10087 var name string
10088 err = json.Unmarshal(*v, &name)
10089 if err != nil {
10090 return err
10091 }
10092 stcup.Name = &name
10093 }
10094 case "type":
10095 if v != nil {
10096 var typeVar string
10097 err = json.Unmarshal(*v, &typeVar)
10098 if err != nil {
10099 return err
10100 }
10101 stcup.Type = &typeVar
10102 }
10103 case "location":
10104 if v != nil {
10105 var location string
10106 err = json.Unmarshal(*v, &location)
10107 if err != nil {
10108 return err
10109 }
10110 stcup.Location = &location
10111 }
10112 case "tags":
10113 if v != nil {
10114 var tags map[string]*string
10115 err = json.Unmarshal(*v, &tags)
10116 if err != nil {
10117 return err
10118 }
10119 stcup.Tags = tags
10120 }
10121 }
10122 }
10123
10124 return nil
10125 }
10126
10127
10128 type SQLTriggerCreateUpdateProperties struct {
10129
10130 Resource *SQLTriggerResource `json:"resource,omitempty"`
10131
10132 Options *CreateUpdateOptions `json:"options,omitempty"`
10133 }
10134
10135
10136 type SQLTriggerGetProperties struct {
10137 Resource *SQLTriggerGetPropertiesResource `json:"resource,omitempty"`
10138 }
10139
10140
10141 type SQLTriggerGetPropertiesResource struct {
10142
10143 ID *string `json:"id,omitempty"`
10144
10145 Body *string `json:"body,omitempty"`
10146
10147 TriggerType TriggerType `json:"triggerType,omitempty"`
10148
10149 TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"`
10150
10151 Rid *string `json:"_rid,omitempty"`
10152
10153 Ts *float64 `json:"_ts,omitempty"`
10154
10155 Etag *string `json:"_etag,omitempty"`
10156 }
10157
10158
10159 func (stgp SQLTriggerGetPropertiesResource) MarshalJSON() ([]byte, error) {
10160 objectMap := make(map[string]interface{})
10161 if stgp.ID != nil {
10162 objectMap["id"] = stgp.ID
10163 }
10164 if stgp.Body != nil {
10165 objectMap["body"] = stgp.Body
10166 }
10167 if stgp.TriggerType != "" {
10168 objectMap["triggerType"] = stgp.TriggerType
10169 }
10170 if stgp.TriggerOperation != "" {
10171 objectMap["triggerOperation"] = stgp.TriggerOperation
10172 }
10173 return json.Marshal(objectMap)
10174 }
10175
10176
10177 type SQLTriggerGetResults struct {
10178 autorest.Response `json:"-"`
10179
10180 *SQLTriggerGetProperties `json:"properties,omitempty"`
10181
10182 ID *string `json:"id,omitempty"`
10183
10184 Name *string `json:"name,omitempty"`
10185
10186 Type *string `json:"type,omitempty"`
10187
10188 Location *string `json:"location,omitempty"`
10189 Tags map[string]*string `json:"tags"`
10190 }
10191
10192
10193 func (stgr SQLTriggerGetResults) MarshalJSON() ([]byte, error) {
10194 objectMap := make(map[string]interface{})
10195 if stgr.SQLTriggerGetProperties != nil {
10196 objectMap["properties"] = stgr.SQLTriggerGetProperties
10197 }
10198 if stgr.Location != nil {
10199 objectMap["location"] = stgr.Location
10200 }
10201 if stgr.Tags != nil {
10202 objectMap["tags"] = stgr.Tags
10203 }
10204 return json.Marshal(objectMap)
10205 }
10206
10207
10208 func (stgr *SQLTriggerGetResults) UnmarshalJSON(body []byte) error {
10209 var m map[string]*json.RawMessage
10210 err := json.Unmarshal(body, &m)
10211 if err != nil {
10212 return err
10213 }
10214 for k, v := range m {
10215 switch k {
10216 case "properties":
10217 if v != nil {
10218 var SQLTriggerGetProperties SQLTriggerGetProperties
10219 err = json.Unmarshal(*v, &SQLTriggerGetProperties)
10220 if err != nil {
10221 return err
10222 }
10223 stgr.SQLTriggerGetProperties = &SQLTriggerGetProperties
10224 }
10225 case "id":
10226 if v != nil {
10227 var ID string
10228 err = json.Unmarshal(*v, &ID)
10229 if err != nil {
10230 return err
10231 }
10232 stgr.ID = &ID
10233 }
10234 case "name":
10235 if v != nil {
10236 var name string
10237 err = json.Unmarshal(*v, &name)
10238 if err != nil {
10239 return err
10240 }
10241 stgr.Name = &name
10242 }
10243 case "type":
10244 if v != nil {
10245 var typeVar string
10246 err = json.Unmarshal(*v, &typeVar)
10247 if err != nil {
10248 return err
10249 }
10250 stgr.Type = &typeVar
10251 }
10252 case "location":
10253 if v != nil {
10254 var location string
10255 err = json.Unmarshal(*v, &location)
10256 if err != nil {
10257 return err
10258 }
10259 stgr.Location = &location
10260 }
10261 case "tags":
10262 if v != nil {
10263 var tags map[string]*string
10264 err = json.Unmarshal(*v, &tags)
10265 if err != nil {
10266 return err
10267 }
10268 stgr.Tags = tags
10269 }
10270 }
10271 }
10272
10273 return nil
10274 }
10275
10276
10277 type SQLTriggerListResult struct {
10278 autorest.Response `json:"-"`
10279
10280 Value *[]SQLTriggerGetResults `json:"value,omitempty"`
10281 }
10282
10283
10284 func (stlr SQLTriggerListResult) MarshalJSON() ([]byte, error) {
10285 objectMap := make(map[string]interface{})
10286 return json.Marshal(objectMap)
10287 }
10288
10289
10290 type SQLTriggerResource struct {
10291
10292 ID *string `json:"id,omitempty"`
10293
10294 Body *string `json:"body,omitempty"`
10295
10296 TriggerType TriggerType `json:"triggerType,omitempty"`
10297
10298 TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"`
10299 }
10300
10301
10302
10303 type SQLUserDefinedFunctionCreateUpdateParameters struct {
10304
10305 *SQLUserDefinedFunctionCreateUpdateProperties `json:"properties,omitempty"`
10306
10307 ID *string `json:"id,omitempty"`
10308
10309 Name *string `json:"name,omitempty"`
10310
10311 Type *string `json:"type,omitempty"`
10312
10313 Location *string `json:"location,omitempty"`
10314 Tags map[string]*string `json:"tags"`
10315 }
10316
10317
10318 func (sudfcup SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON() ([]byte, error) {
10319 objectMap := make(map[string]interface{})
10320 if sudfcup.SQLUserDefinedFunctionCreateUpdateProperties != nil {
10321 objectMap["properties"] = sudfcup.SQLUserDefinedFunctionCreateUpdateProperties
10322 }
10323 if sudfcup.Location != nil {
10324 objectMap["location"] = sudfcup.Location
10325 }
10326 if sudfcup.Tags != nil {
10327 objectMap["tags"] = sudfcup.Tags
10328 }
10329 return json.Marshal(objectMap)
10330 }
10331
10332
10333 func (sudfcup *SQLUserDefinedFunctionCreateUpdateParameters) UnmarshalJSON(body []byte) error {
10334 var m map[string]*json.RawMessage
10335 err := json.Unmarshal(body, &m)
10336 if err != nil {
10337 return err
10338 }
10339 for k, v := range m {
10340 switch k {
10341 case "properties":
10342 if v != nil {
10343 var SQLUserDefinedFunctionCreateUpdateProperties SQLUserDefinedFunctionCreateUpdateProperties
10344 err = json.Unmarshal(*v, &SQLUserDefinedFunctionCreateUpdateProperties)
10345 if err != nil {
10346 return err
10347 }
10348 sudfcup.SQLUserDefinedFunctionCreateUpdateProperties = &SQLUserDefinedFunctionCreateUpdateProperties
10349 }
10350 case "id":
10351 if v != nil {
10352 var ID string
10353 err = json.Unmarshal(*v, &ID)
10354 if err != nil {
10355 return err
10356 }
10357 sudfcup.ID = &ID
10358 }
10359 case "name":
10360 if v != nil {
10361 var name string
10362 err = json.Unmarshal(*v, &name)
10363 if err != nil {
10364 return err
10365 }
10366 sudfcup.Name = &name
10367 }
10368 case "type":
10369 if v != nil {
10370 var typeVar string
10371 err = json.Unmarshal(*v, &typeVar)
10372 if err != nil {
10373 return err
10374 }
10375 sudfcup.Type = &typeVar
10376 }
10377 case "location":
10378 if v != nil {
10379 var location string
10380 err = json.Unmarshal(*v, &location)
10381 if err != nil {
10382 return err
10383 }
10384 sudfcup.Location = &location
10385 }
10386 case "tags":
10387 if v != nil {
10388 var tags map[string]*string
10389 err = json.Unmarshal(*v, &tags)
10390 if err != nil {
10391 return err
10392 }
10393 sudfcup.Tags = tags
10394 }
10395 }
10396 }
10397
10398 return nil
10399 }
10400
10401
10402
10403 type SQLUserDefinedFunctionCreateUpdateProperties struct {
10404
10405 Resource *SQLUserDefinedFunctionResource `json:"resource,omitempty"`
10406
10407 Options *CreateUpdateOptions `json:"options,omitempty"`
10408 }
10409
10410
10411 type SQLUserDefinedFunctionGetProperties struct {
10412 Resource *SQLUserDefinedFunctionGetPropertiesResource `json:"resource,omitempty"`
10413 }
10414
10415
10416 type SQLUserDefinedFunctionGetPropertiesResource struct {
10417
10418 ID *string `json:"id,omitempty"`
10419
10420 Body *string `json:"body,omitempty"`
10421
10422 Rid *string `json:"_rid,omitempty"`
10423
10424 Ts *float64 `json:"_ts,omitempty"`
10425
10426 Etag *string `json:"_etag,omitempty"`
10427 }
10428
10429
10430 func (sudfgp SQLUserDefinedFunctionGetPropertiesResource) MarshalJSON() ([]byte, error) {
10431 objectMap := make(map[string]interface{})
10432 if sudfgp.ID != nil {
10433 objectMap["id"] = sudfgp.ID
10434 }
10435 if sudfgp.Body != nil {
10436 objectMap["body"] = sudfgp.Body
10437 }
10438 return json.Marshal(objectMap)
10439 }
10440
10441
10442 type SQLUserDefinedFunctionGetResults struct {
10443 autorest.Response `json:"-"`
10444
10445 *SQLUserDefinedFunctionGetProperties `json:"properties,omitempty"`
10446
10447 ID *string `json:"id,omitempty"`
10448
10449 Name *string `json:"name,omitempty"`
10450
10451 Type *string `json:"type,omitempty"`
10452
10453 Location *string `json:"location,omitempty"`
10454 Tags map[string]*string `json:"tags"`
10455 }
10456
10457
10458 func (sudfgr SQLUserDefinedFunctionGetResults) MarshalJSON() ([]byte, error) {
10459 objectMap := make(map[string]interface{})
10460 if sudfgr.SQLUserDefinedFunctionGetProperties != nil {
10461 objectMap["properties"] = sudfgr.SQLUserDefinedFunctionGetProperties
10462 }
10463 if sudfgr.Location != nil {
10464 objectMap["location"] = sudfgr.Location
10465 }
10466 if sudfgr.Tags != nil {
10467 objectMap["tags"] = sudfgr.Tags
10468 }
10469 return json.Marshal(objectMap)
10470 }
10471
10472
10473 func (sudfgr *SQLUserDefinedFunctionGetResults) UnmarshalJSON(body []byte) error {
10474 var m map[string]*json.RawMessage
10475 err := json.Unmarshal(body, &m)
10476 if err != nil {
10477 return err
10478 }
10479 for k, v := range m {
10480 switch k {
10481 case "properties":
10482 if v != nil {
10483 var SQLUserDefinedFunctionGetProperties SQLUserDefinedFunctionGetProperties
10484 err = json.Unmarshal(*v, &SQLUserDefinedFunctionGetProperties)
10485 if err != nil {
10486 return err
10487 }
10488 sudfgr.SQLUserDefinedFunctionGetProperties = &SQLUserDefinedFunctionGetProperties
10489 }
10490 case "id":
10491 if v != nil {
10492 var ID string
10493 err = json.Unmarshal(*v, &ID)
10494 if err != nil {
10495 return err
10496 }
10497 sudfgr.ID = &ID
10498 }
10499 case "name":
10500 if v != nil {
10501 var name string
10502 err = json.Unmarshal(*v, &name)
10503 if err != nil {
10504 return err
10505 }
10506 sudfgr.Name = &name
10507 }
10508 case "type":
10509 if v != nil {
10510 var typeVar string
10511 err = json.Unmarshal(*v, &typeVar)
10512 if err != nil {
10513 return err
10514 }
10515 sudfgr.Type = &typeVar
10516 }
10517 case "location":
10518 if v != nil {
10519 var location string
10520 err = json.Unmarshal(*v, &location)
10521 if err != nil {
10522 return err
10523 }
10524 sudfgr.Location = &location
10525 }
10526 case "tags":
10527 if v != nil {
10528 var tags map[string]*string
10529 err = json.Unmarshal(*v, &tags)
10530 if err != nil {
10531 return err
10532 }
10533 sudfgr.Tags = tags
10534 }
10535 }
10536 }
10537
10538 return nil
10539 }
10540
10541
10542
10543 type SQLUserDefinedFunctionListResult struct {
10544 autorest.Response `json:"-"`
10545
10546 Value *[]SQLUserDefinedFunctionGetResults `json:"value,omitempty"`
10547 }
10548
10549
10550 func (sudflr SQLUserDefinedFunctionListResult) MarshalJSON() ([]byte, error) {
10551 objectMap := make(map[string]interface{})
10552 return json.Marshal(objectMap)
10553 }
10554
10555
10556 type SQLUserDefinedFunctionResource struct {
10557
10558 ID *string `json:"id,omitempty"`
10559
10560 Body *string `json:"body,omitempty"`
10561 }
10562
10563
10564 type SystemData struct {
10565
10566 CreatedBy *string `json:"createdBy,omitempty"`
10567
10568 CreatedByType CreatedByType `json:"createdByType,omitempty"`
10569
10570 CreatedAt *date.Time `json:"createdAt,omitempty"`
10571
10572 LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
10573
10574 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
10575
10576 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
10577 }
10578
10579
10580 type TableCreateUpdateParameters struct {
10581
10582 *TableCreateUpdateProperties `json:"properties,omitempty"`
10583
10584 ID *string `json:"id,omitempty"`
10585
10586 Name *string `json:"name,omitempty"`
10587
10588 Type *string `json:"type,omitempty"`
10589
10590 Location *string `json:"location,omitempty"`
10591 Tags map[string]*string `json:"tags"`
10592 }
10593
10594
10595 func (tcup TableCreateUpdateParameters) MarshalJSON() ([]byte, error) {
10596 objectMap := make(map[string]interface{})
10597 if tcup.TableCreateUpdateProperties != nil {
10598 objectMap["properties"] = tcup.TableCreateUpdateProperties
10599 }
10600 if tcup.Location != nil {
10601 objectMap["location"] = tcup.Location
10602 }
10603 if tcup.Tags != nil {
10604 objectMap["tags"] = tcup.Tags
10605 }
10606 return json.Marshal(objectMap)
10607 }
10608
10609
10610 func (tcup *TableCreateUpdateParameters) UnmarshalJSON(body []byte) error {
10611 var m map[string]*json.RawMessage
10612 err := json.Unmarshal(body, &m)
10613 if err != nil {
10614 return err
10615 }
10616 for k, v := range m {
10617 switch k {
10618 case "properties":
10619 if v != nil {
10620 var tableCreateUpdateProperties TableCreateUpdateProperties
10621 err = json.Unmarshal(*v, &tableCreateUpdateProperties)
10622 if err != nil {
10623 return err
10624 }
10625 tcup.TableCreateUpdateProperties = &tableCreateUpdateProperties
10626 }
10627 case "id":
10628 if v != nil {
10629 var ID string
10630 err = json.Unmarshal(*v, &ID)
10631 if err != nil {
10632 return err
10633 }
10634 tcup.ID = &ID
10635 }
10636 case "name":
10637 if v != nil {
10638 var name string
10639 err = json.Unmarshal(*v, &name)
10640 if err != nil {
10641 return err
10642 }
10643 tcup.Name = &name
10644 }
10645 case "type":
10646 if v != nil {
10647 var typeVar string
10648 err = json.Unmarshal(*v, &typeVar)
10649 if err != nil {
10650 return err
10651 }
10652 tcup.Type = &typeVar
10653 }
10654 case "location":
10655 if v != nil {
10656 var location string
10657 err = json.Unmarshal(*v, &location)
10658 if err != nil {
10659 return err
10660 }
10661 tcup.Location = &location
10662 }
10663 case "tags":
10664 if v != nil {
10665 var tags map[string]*string
10666 err = json.Unmarshal(*v, &tags)
10667 if err != nil {
10668 return err
10669 }
10670 tcup.Tags = tags
10671 }
10672 }
10673 }
10674
10675 return nil
10676 }
10677
10678
10679 type TableCreateUpdateProperties struct {
10680
10681 Resource *TableResource `json:"resource,omitempty"`
10682
10683 Options *CreateUpdateOptions `json:"options,omitempty"`
10684 }
10685
10686
10687 type TableGetProperties struct {
10688 Resource *TableGetPropertiesResource `json:"resource,omitempty"`
10689 Options *TableGetPropertiesOptions `json:"options,omitempty"`
10690 }
10691
10692
10693 type TableGetPropertiesOptions struct {
10694
10695 Throughput *int32 `json:"throughput,omitempty"`
10696
10697 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"`
10698 }
10699
10700
10701 type TableGetPropertiesResource struct {
10702
10703 ID *string `json:"id,omitempty"`
10704
10705 Rid *string `json:"_rid,omitempty"`
10706
10707 Ts *float64 `json:"_ts,omitempty"`
10708
10709 Etag *string `json:"_etag,omitempty"`
10710 }
10711
10712
10713 func (tgp TableGetPropertiesResource) MarshalJSON() ([]byte, error) {
10714 objectMap := make(map[string]interface{})
10715 if tgp.ID != nil {
10716 objectMap["id"] = tgp.ID
10717 }
10718 return json.Marshal(objectMap)
10719 }
10720
10721
10722 type TableGetResults struct {
10723 autorest.Response `json:"-"`
10724
10725 *TableGetProperties `json:"properties,omitempty"`
10726
10727 ID *string `json:"id,omitempty"`
10728
10729 Name *string `json:"name,omitempty"`
10730
10731 Type *string `json:"type,omitempty"`
10732
10733 Location *string `json:"location,omitempty"`
10734 Tags map[string]*string `json:"tags"`
10735 }
10736
10737
10738 func (tgr TableGetResults) MarshalJSON() ([]byte, error) {
10739 objectMap := make(map[string]interface{})
10740 if tgr.TableGetProperties != nil {
10741 objectMap["properties"] = tgr.TableGetProperties
10742 }
10743 if tgr.Location != nil {
10744 objectMap["location"] = tgr.Location
10745 }
10746 if tgr.Tags != nil {
10747 objectMap["tags"] = tgr.Tags
10748 }
10749 return json.Marshal(objectMap)
10750 }
10751
10752
10753 func (tgr *TableGetResults) UnmarshalJSON(body []byte) error {
10754 var m map[string]*json.RawMessage
10755 err := json.Unmarshal(body, &m)
10756 if err != nil {
10757 return err
10758 }
10759 for k, v := range m {
10760 switch k {
10761 case "properties":
10762 if v != nil {
10763 var tableGetProperties TableGetProperties
10764 err = json.Unmarshal(*v, &tableGetProperties)
10765 if err != nil {
10766 return err
10767 }
10768 tgr.TableGetProperties = &tableGetProperties
10769 }
10770 case "id":
10771 if v != nil {
10772 var ID string
10773 err = json.Unmarshal(*v, &ID)
10774 if err != nil {
10775 return err
10776 }
10777 tgr.ID = &ID
10778 }
10779 case "name":
10780 if v != nil {
10781 var name string
10782 err = json.Unmarshal(*v, &name)
10783 if err != nil {
10784 return err
10785 }
10786 tgr.Name = &name
10787 }
10788 case "type":
10789 if v != nil {
10790 var typeVar string
10791 err = json.Unmarshal(*v, &typeVar)
10792 if err != nil {
10793 return err
10794 }
10795 tgr.Type = &typeVar
10796 }
10797 case "location":
10798 if v != nil {
10799 var location string
10800 err = json.Unmarshal(*v, &location)
10801 if err != nil {
10802 return err
10803 }
10804 tgr.Location = &location
10805 }
10806 case "tags":
10807 if v != nil {
10808 var tags map[string]*string
10809 err = json.Unmarshal(*v, &tags)
10810 if err != nil {
10811 return err
10812 }
10813 tgr.Tags = tags
10814 }
10815 }
10816 }
10817
10818 return nil
10819 }
10820
10821
10822 type TableListResult struct {
10823 autorest.Response `json:"-"`
10824
10825 Value *[]TableGetResults `json:"value,omitempty"`
10826 }
10827
10828
10829 func (tlr TableListResult) MarshalJSON() ([]byte, error) {
10830 objectMap := make(map[string]interface{})
10831 return json.Marshal(objectMap)
10832 }
10833
10834
10835 type TableResource struct {
10836
10837 ID *string `json:"id,omitempty"`
10838 }
10839
10840
10841
10842 type TableResourcesCreateUpdateTableFuture struct {
10843 azure.FutureAPI
10844
10845
10846 Result func(TableResourcesClient) (TableGetResults, error)
10847 }
10848
10849
10850 func (future *TableResourcesCreateUpdateTableFuture) UnmarshalJSON(body []byte) error {
10851 var azFuture azure.Future
10852 if err := json.Unmarshal(body, &azFuture); err != nil {
10853 return err
10854 }
10855 future.FutureAPI = &azFuture
10856 future.Result = future.result
10857 return nil
10858 }
10859
10860
10861 func (future *TableResourcesCreateUpdateTableFuture) result(client TableResourcesClient) (tgr TableGetResults, err error) {
10862 var done bool
10863 done, err = future.DoneWithContext(context.Background(), client)
10864 if err != nil {
10865 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", future.Response(), "Polling failure")
10866 return
10867 }
10868 if !done {
10869 tgr.Response.Response = future.Response()
10870 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesCreateUpdateTableFuture")
10871 return
10872 }
10873 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10874 if tgr.Response.Response, err = future.GetResult(sender); err == nil && tgr.Response.Response.StatusCode != http.StatusNoContent {
10875 tgr, err = client.CreateUpdateTableResponder(tgr.Response.Response)
10876 if err != nil {
10877 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", tgr.Response.Response, "Failure responding to request")
10878 }
10879 }
10880 return
10881 }
10882
10883
10884
10885 type TableResourcesDeleteTableFuture struct {
10886 azure.FutureAPI
10887
10888
10889 Result func(TableResourcesClient) (autorest.Response, error)
10890 }
10891
10892
10893 func (future *TableResourcesDeleteTableFuture) UnmarshalJSON(body []byte) error {
10894 var azFuture azure.Future
10895 if err := json.Unmarshal(body, &azFuture); err != nil {
10896 return err
10897 }
10898 future.FutureAPI = &azFuture
10899 future.Result = future.result
10900 return nil
10901 }
10902
10903
10904 func (future *TableResourcesDeleteTableFuture) result(client TableResourcesClient) (ar autorest.Response, err error) {
10905 var done bool
10906 done, err = future.DoneWithContext(context.Background(), client)
10907 if err != nil {
10908 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesDeleteTableFuture", "Result", future.Response(), "Polling failure")
10909 return
10910 }
10911 if !done {
10912 ar.Response = future.Response()
10913 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesDeleteTableFuture")
10914 return
10915 }
10916 ar.Response = future.Response()
10917 return
10918 }
10919
10920
10921
10922 type TableResourcesMigrateTableToAutoscaleFuture struct {
10923 azure.FutureAPI
10924
10925
10926 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error)
10927 }
10928
10929
10930 func (future *TableResourcesMigrateTableToAutoscaleFuture) UnmarshalJSON(body []byte) error {
10931 var azFuture azure.Future
10932 if err := json.Unmarshal(body, &azFuture); err != nil {
10933 return err
10934 }
10935 future.FutureAPI = &azFuture
10936 future.Result = future.result
10937 return nil
10938 }
10939
10940
10941 func (future *TableResourcesMigrateTableToAutoscaleFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
10942 var done bool
10943 done, err = future.DoneWithContext(context.Background(), client)
10944 if err != nil {
10945 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", future.Response(), "Polling failure")
10946 return
10947 }
10948 if !done {
10949 tsgr.Response.Response = future.Response()
10950 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToAutoscaleFuture")
10951 return
10952 }
10953 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10954 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
10955 tsgr, err = client.MigrateTableToAutoscaleResponder(tsgr.Response.Response)
10956 if err != nil {
10957 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request")
10958 }
10959 }
10960 return
10961 }
10962
10963
10964
10965 type TableResourcesMigrateTableToManualThroughputFuture struct {
10966 azure.FutureAPI
10967
10968
10969 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error)
10970 }
10971
10972
10973 func (future *TableResourcesMigrateTableToManualThroughputFuture) UnmarshalJSON(body []byte) error {
10974 var azFuture azure.Future
10975 if err := json.Unmarshal(body, &azFuture); err != nil {
10976 return err
10977 }
10978 future.FutureAPI = &azFuture
10979 future.Result = future.result
10980 return nil
10981 }
10982
10983
10984 func (future *TableResourcesMigrateTableToManualThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
10985 var done bool
10986 done, err = future.DoneWithContext(context.Background(), client)
10987 if err != nil {
10988 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", future.Response(), "Polling failure")
10989 return
10990 }
10991 if !done {
10992 tsgr.Response.Response = future.Response()
10993 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToManualThroughputFuture")
10994 return
10995 }
10996 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10997 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
10998 tsgr, err = client.MigrateTableToManualThroughputResponder(tsgr.Response.Response)
10999 if err != nil {
11000 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
11001 }
11002 }
11003 return
11004 }
11005
11006
11007
11008 type TableResourcesUpdateTableThroughputFuture struct {
11009 azure.FutureAPI
11010
11011
11012 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error)
11013 }
11014
11015
11016 func (future *TableResourcesUpdateTableThroughputFuture) UnmarshalJSON(body []byte) error {
11017 var azFuture azure.Future
11018 if err := json.Unmarshal(body, &azFuture); err != nil {
11019 return err
11020 }
11021 future.FutureAPI = &azFuture
11022 future.Result = future.result
11023 return nil
11024 }
11025
11026
11027 func (future *TableResourcesUpdateTableThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
11028 var done bool
11029 done, err = future.DoneWithContext(context.Background(), client)
11030 if err != nil {
11031 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", future.Response(), "Polling failure")
11032 return
11033 }
11034 if !done {
11035 tsgr.Response.Response = future.Response()
11036 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesUpdateTableThroughputFuture")
11037 return
11038 }
11039 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11040 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
11041 tsgr, err = client.UpdateTableThroughputResponder(tsgr.Response.Response)
11042 if err != nil {
11043 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
11044 }
11045 }
11046 return
11047 }
11048
11049
11050 type ThroughputPolicyResource struct {
11051
11052 IsEnabled *bool `json:"isEnabled,omitempty"`
11053
11054 IncrementPercent *int32 `json:"incrementPercent,omitempty"`
11055 }
11056
11057
11058 type ThroughputSettingsGetProperties struct {
11059 Resource *ThroughputSettingsGetPropertiesResource `json:"resource,omitempty"`
11060 }
11061
11062
11063 type ThroughputSettingsGetPropertiesResource struct {
11064
11065 Throughput *int32 `json:"throughput,omitempty"`
11066
11067 AutoscaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"`
11068
11069 MinimumThroughput *string `json:"minimumThroughput,omitempty"`
11070
11071 OfferReplacePending *string `json:"offerReplacePending,omitempty"`
11072
11073 Rid *string `json:"_rid,omitempty"`
11074
11075 Ts *float64 `json:"_ts,omitempty"`
11076
11077 Etag *string `json:"_etag,omitempty"`
11078 }
11079
11080
11081 func (tsgp ThroughputSettingsGetPropertiesResource) MarshalJSON() ([]byte, error) {
11082 objectMap := make(map[string]interface{})
11083 if tsgp.Throughput != nil {
11084 objectMap["throughput"] = tsgp.Throughput
11085 }
11086 if tsgp.AutoscaleSettings != nil {
11087 objectMap["autoscaleSettings"] = tsgp.AutoscaleSettings
11088 }
11089 return json.Marshal(objectMap)
11090 }
11091
11092
11093 type ThroughputSettingsGetResults struct {
11094 autorest.Response `json:"-"`
11095
11096 *ThroughputSettingsGetProperties `json:"properties,omitempty"`
11097
11098 ID *string `json:"id,omitempty"`
11099
11100 Name *string `json:"name,omitempty"`
11101
11102 Type *string `json:"type,omitempty"`
11103
11104 Location *string `json:"location,omitempty"`
11105 Tags map[string]*string `json:"tags"`
11106 }
11107
11108
11109 func (tsgr ThroughputSettingsGetResults) MarshalJSON() ([]byte, error) {
11110 objectMap := make(map[string]interface{})
11111 if tsgr.ThroughputSettingsGetProperties != nil {
11112 objectMap["properties"] = tsgr.ThroughputSettingsGetProperties
11113 }
11114 if tsgr.Location != nil {
11115 objectMap["location"] = tsgr.Location
11116 }
11117 if tsgr.Tags != nil {
11118 objectMap["tags"] = tsgr.Tags
11119 }
11120 return json.Marshal(objectMap)
11121 }
11122
11123
11124 func (tsgr *ThroughputSettingsGetResults) UnmarshalJSON(body []byte) error {
11125 var m map[string]*json.RawMessage
11126 err := json.Unmarshal(body, &m)
11127 if err != nil {
11128 return err
11129 }
11130 for k, v := range m {
11131 switch k {
11132 case "properties":
11133 if v != nil {
11134 var throughputSettingsGetProperties ThroughputSettingsGetProperties
11135 err = json.Unmarshal(*v, &throughputSettingsGetProperties)
11136 if err != nil {
11137 return err
11138 }
11139 tsgr.ThroughputSettingsGetProperties = &throughputSettingsGetProperties
11140 }
11141 case "id":
11142 if v != nil {
11143 var ID string
11144 err = json.Unmarshal(*v, &ID)
11145 if err != nil {
11146 return err
11147 }
11148 tsgr.ID = &ID
11149 }
11150 case "name":
11151 if v != nil {
11152 var name string
11153 err = json.Unmarshal(*v, &name)
11154 if err != nil {
11155 return err
11156 }
11157 tsgr.Name = &name
11158 }
11159 case "type":
11160 if v != nil {
11161 var typeVar string
11162 err = json.Unmarshal(*v, &typeVar)
11163 if err != nil {
11164 return err
11165 }
11166 tsgr.Type = &typeVar
11167 }
11168 case "location":
11169 if v != nil {
11170 var location string
11171 err = json.Unmarshal(*v, &location)
11172 if err != nil {
11173 return err
11174 }
11175 tsgr.Location = &location
11176 }
11177 case "tags":
11178 if v != nil {
11179 var tags map[string]*string
11180 err = json.Unmarshal(*v, &tags)
11181 if err != nil {
11182 return err
11183 }
11184 tsgr.Tags = tags
11185 }
11186 }
11187 }
11188
11189 return nil
11190 }
11191
11192
11193
11194 type ThroughputSettingsResource struct {
11195
11196 Throughput *int32 `json:"throughput,omitempty"`
11197
11198 AutoscaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"`
11199
11200 MinimumThroughput *string `json:"minimumThroughput,omitempty"`
11201
11202 OfferReplacePending *string `json:"offerReplacePending,omitempty"`
11203 }
11204
11205
11206 func (tsr ThroughputSettingsResource) MarshalJSON() ([]byte, error) {
11207 objectMap := make(map[string]interface{})
11208 if tsr.Throughput != nil {
11209 objectMap["throughput"] = tsr.Throughput
11210 }
11211 if tsr.AutoscaleSettings != nil {
11212 objectMap["autoscaleSettings"] = tsr.AutoscaleSettings
11213 }
11214 return json.Marshal(objectMap)
11215 }
11216
11217
11218 type ThroughputSettingsUpdateParameters struct {
11219
11220 *ThroughputSettingsUpdateProperties `json:"properties,omitempty"`
11221
11222 ID *string `json:"id,omitempty"`
11223
11224 Name *string `json:"name,omitempty"`
11225
11226 Type *string `json:"type,omitempty"`
11227
11228 Location *string `json:"location,omitempty"`
11229 Tags map[string]*string `json:"tags"`
11230 }
11231
11232
11233 func (tsup ThroughputSettingsUpdateParameters) MarshalJSON() ([]byte, error) {
11234 objectMap := make(map[string]interface{})
11235 if tsup.ThroughputSettingsUpdateProperties != nil {
11236 objectMap["properties"] = tsup.ThroughputSettingsUpdateProperties
11237 }
11238 if tsup.Location != nil {
11239 objectMap["location"] = tsup.Location
11240 }
11241 if tsup.Tags != nil {
11242 objectMap["tags"] = tsup.Tags
11243 }
11244 return json.Marshal(objectMap)
11245 }
11246
11247
11248 func (tsup *ThroughputSettingsUpdateParameters) UnmarshalJSON(body []byte) error {
11249 var m map[string]*json.RawMessage
11250 err := json.Unmarshal(body, &m)
11251 if err != nil {
11252 return err
11253 }
11254 for k, v := range m {
11255 switch k {
11256 case "properties":
11257 if v != nil {
11258 var throughputSettingsUpdateProperties ThroughputSettingsUpdateProperties
11259 err = json.Unmarshal(*v, &throughputSettingsUpdateProperties)
11260 if err != nil {
11261 return err
11262 }
11263 tsup.ThroughputSettingsUpdateProperties = &throughputSettingsUpdateProperties
11264 }
11265 case "id":
11266 if v != nil {
11267 var ID string
11268 err = json.Unmarshal(*v, &ID)
11269 if err != nil {
11270 return err
11271 }
11272 tsup.ID = &ID
11273 }
11274 case "name":
11275 if v != nil {
11276 var name string
11277 err = json.Unmarshal(*v, &name)
11278 if err != nil {
11279 return err
11280 }
11281 tsup.Name = &name
11282 }
11283 case "type":
11284 if v != nil {
11285 var typeVar string
11286 err = json.Unmarshal(*v, &typeVar)
11287 if err != nil {
11288 return err
11289 }
11290 tsup.Type = &typeVar
11291 }
11292 case "location":
11293 if v != nil {
11294 var location string
11295 err = json.Unmarshal(*v, &location)
11296 if err != nil {
11297 return err
11298 }
11299 tsup.Location = &location
11300 }
11301 case "tags":
11302 if v != nil {
11303 var tags map[string]*string
11304 err = json.Unmarshal(*v, &tags)
11305 if err != nil {
11306 return err
11307 }
11308 tsup.Tags = tags
11309 }
11310 }
11311 }
11312
11313 return nil
11314 }
11315
11316
11317 type ThroughputSettingsUpdateProperties struct {
11318
11319 Resource *ThroughputSettingsResource `json:"resource,omitempty"`
11320 }
11321
11322
11323
11324 type TrackedResource struct {
11325
11326 Tags map[string]*string `json:"tags"`
11327
11328 Location *string `json:"location,omitempty"`
11329
11330 ID *string `json:"id,omitempty"`
11331
11332 Name *string `json:"name,omitempty"`
11333
11334 Type *string `json:"type,omitempty"`
11335 }
11336
11337
11338 func (tr TrackedResource) MarshalJSON() ([]byte, error) {
11339 objectMap := make(map[string]interface{})
11340 if tr.Tags != nil {
11341 objectMap["tags"] = tr.Tags
11342 }
11343 if tr.Location != nil {
11344 objectMap["location"] = tr.Location
11345 }
11346 return json.Marshal(objectMap)
11347 }
11348
11349
11350
11351 type UniqueKey struct {
11352
11353 Paths *[]string `json:"paths,omitempty"`
11354 }
11355
11356
11357
11358 type UniqueKeyPolicy struct {
11359
11360 UniqueKeys *[]UniqueKey `json:"uniqueKeys,omitempty"`
11361 }
11362
11363
11364 type Usage struct {
11365
11366 Unit UnitType `json:"unit,omitempty"`
11367
11368 Name *MetricName `json:"name,omitempty"`
11369
11370 QuotaPeriod *string `json:"quotaPeriod,omitempty"`
11371
11372 Limit *int64 `json:"limit,omitempty"`
11373
11374 CurrentValue *int64 `json:"currentValue,omitempty"`
11375 }
11376
11377
11378 func (u Usage) MarshalJSON() ([]byte, error) {
11379 objectMap := make(map[string]interface{})
11380 if u.Unit != "" {
11381 objectMap["unit"] = u.Unit
11382 }
11383 return json.Marshal(objectMap)
11384 }
11385
11386
11387 type UsagesResult struct {
11388 autorest.Response `json:"-"`
11389
11390 Value *[]Usage `json:"value,omitempty"`
11391 }
11392
11393
11394 func (ur UsagesResult) MarshalJSON() ([]byte, error) {
11395 objectMap := make(map[string]interface{})
11396 return json.Marshal(objectMap)
11397 }
11398
11399
11400 type VirtualNetworkRule struct {
11401
11402 ID *string `json:"id,omitempty"`
11403
11404 IgnoreMissingVNetServiceEndpoint *bool `json:"ignoreMissingVNetServiceEndpoint,omitempty"`
11405 }
11406
View as plain text