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/2019-08-01/documentdb"
22
23
24
25 type ARMProxyResource struct {
26
27 ID *string `json:"id,omitempty"`
28
29 Name *string `json:"name,omitempty"`
30
31 Type *string `json:"type,omitempty"`
32 }
33
34
35 func (apr ARMProxyResource) MarshalJSON() ([]byte, error) {
36 objectMap := make(map[string]interface{})
37 return json.Marshal(objectMap)
38 }
39
40
41 type ARMResourceProperties struct {
42
43 ID *string `json:"id,omitempty"`
44
45 Name *string `json:"name,omitempty"`
46
47 Type *string `json:"type,omitempty"`
48
49 Location *string `json:"location,omitempty"`
50 Tags map[string]*string `json:"tags"`
51 }
52
53
54 func (arp ARMResourceProperties) MarshalJSON() ([]byte, error) {
55 objectMap := make(map[string]interface{})
56 if arp.Location != nil {
57 objectMap["location"] = arp.Location
58 }
59 if arp.Tags != nil {
60 objectMap["tags"] = arp.Tags
61 }
62 return json.Marshal(objectMap)
63 }
64
65
66 type Capability struct {
67
68 Name *string `json:"name,omitempty"`
69 }
70
71
72 type CassandraKeyspaceCreateUpdateParameters struct {
73
74 *CassandraKeyspaceCreateUpdateProperties `json:"properties,omitempty"`
75
76 ID *string `json:"id,omitempty"`
77
78 Name *string `json:"name,omitempty"`
79
80 Type *string `json:"type,omitempty"`
81
82 Location *string `json:"location,omitempty"`
83 Tags map[string]*string `json:"tags"`
84 }
85
86
87 func (ckcup CassandraKeyspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) {
88 objectMap := make(map[string]interface{})
89 if ckcup.CassandraKeyspaceCreateUpdateProperties != nil {
90 objectMap["properties"] = ckcup.CassandraKeyspaceCreateUpdateProperties
91 }
92 if ckcup.Location != nil {
93 objectMap["location"] = ckcup.Location
94 }
95 if ckcup.Tags != nil {
96 objectMap["tags"] = ckcup.Tags
97 }
98 return json.Marshal(objectMap)
99 }
100
101
102 func (ckcup *CassandraKeyspaceCreateUpdateParameters) UnmarshalJSON(body []byte) error {
103 var m map[string]*json.RawMessage
104 err := json.Unmarshal(body, &m)
105 if err != nil {
106 return err
107 }
108 for k, v := range m {
109 switch k {
110 case "properties":
111 if v != nil {
112 var cassandraKeyspaceCreateUpdateProperties CassandraKeyspaceCreateUpdateProperties
113 err = json.Unmarshal(*v, &cassandraKeyspaceCreateUpdateProperties)
114 if err != nil {
115 return err
116 }
117 ckcup.CassandraKeyspaceCreateUpdateProperties = &cassandraKeyspaceCreateUpdateProperties
118 }
119 case "id":
120 if v != nil {
121 var ID string
122 err = json.Unmarshal(*v, &ID)
123 if err != nil {
124 return err
125 }
126 ckcup.ID = &ID
127 }
128 case "name":
129 if v != nil {
130 var name string
131 err = json.Unmarshal(*v, &name)
132 if err != nil {
133 return err
134 }
135 ckcup.Name = &name
136 }
137 case "type":
138 if v != nil {
139 var typeVar string
140 err = json.Unmarshal(*v, &typeVar)
141 if err != nil {
142 return err
143 }
144 ckcup.Type = &typeVar
145 }
146 case "location":
147 if v != nil {
148 var location string
149 err = json.Unmarshal(*v, &location)
150 if err != nil {
151 return err
152 }
153 ckcup.Location = &location
154 }
155 case "tags":
156 if v != nil {
157 var tags map[string]*string
158 err = json.Unmarshal(*v, &tags)
159 if err != nil {
160 return err
161 }
162 ckcup.Tags = tags
163 }
164 }
165 }
166
167 return nil
168 }
169
170
171
172 type CassandraKeyspaceCreateUpdateProperties struct {
173
174 Resource *CassandraKeyspaceResource `json:"resource,omitempty"`
175
176 Options map[string]*string `json:"options"`
177 }
178
179
180 func (ckcup CassandraKeyspaceCreateUpdateProperties) MarshalJSON() ([]byte, error) {
181 objectMap := make(map[string]interface{})
182 if ckcup.Resource != nil {
183 objectMap["resource"] = ckcup.Resource
184 }
185 if ckcup.Options != nil {
186 objectMap["options"] = ckcup.Options
187 }
188 return json.Marshal(objectMap)
189 }
190
191
192 type CassandraKeyspaceGetProperties struct {
193 Resource *CassandraKeyspaceGetPropertiesResource `json:"resource,omitempty"`
194 }
195
196
197 type CassandraKeyspaceGetPropertiesResource struct {
198
199 ID *string `json:"id,omitempty"`
200
201 Rid *string `json:"_rid,omitempty"`
202
203 Ts interface{} `json:"_ts,omitempty"`
204
205 Etag *string `json:"_etag,omitempty"`
206 }
207
208
209 func (ckgp CassandraKeyspaceGetPropertiesResource) MarshalJSON() ([]byte, error) {
210 objectMap := make(map[string]interface{})
211 if ckgp.ID != nil {
212 objectMap["id"] = ckgp.ID
213 }
214 return json.Marshal(objectMap)
215 }
216
217
218 type CassandraKeyspaceGetResults struct {
219 autorest.Response `json:"-"`
220
221 *CassandraKeyspaceGetProperties `json:"properties,omitempty"`
222
223 ID *string `json:"id,omitempty"`
224
225 Name *string `json:"name,omitempty"`
226
227 Type *string `json:"type,omitempty"`
228
229 Location *string `json:"location,omitempty"`
230 Tags map[string]*string `json:"tags"`
231 }
232
233
234 func (ckgr CassandraKeyspaceGetResults) MarshalJSON() ([]byte, error) {
235 objectMap := make(map[string]interface{})
236 if ckgr.CassandraKeyspaceGetProperties != nil {
237 objectMap["properties"] = ckgr.CassandraKeyspaceGetProperties
238 }
239 if ckgr.Location != nil {
240 objectMap["location"] = ckgr.Location
241 }
242 if ckgr.Tags != nil {
243 objectMap["tags"] = ckgr.Tags
244 }
245 return json.Marshal(objectMap)
246 }
247
248
249 func (ckgr *CassandraKeyspaceGetResults) UnmarshalJSON(body []byte) error {
250 var m map[string]*json.RawMessage
251 err := json.Unmarshal(body, &m)
252 if err != nil {
253 return err
254 }
255 for k, v := range m {
256 switch k {
257 case "properties":
258 if v != nil {
259 var cassandraKeyspaceGetProperties CassandraKeyspaceGetProperties
260 err = json.Unmarshal(*v, &cassandraKeyspaceGetProperties)
261 if err != nil {
262 return err
263 }
264 ckgr.CassandraKeyspaceGetProperties = &cassandraKeyspaceGetProperties
265 }
266 case "id":
267 if v != nil {
268 var ID string
269 err = json.Unmarshal(*v, &ID)
270 if err != nil {
271 return err
272 }
273 ckgr.ID = &ID
274 }
275 case "name":
276 if v != nil {
277 var name string
278 err = json.Unmarshal(*v, &name)
279 if err != nil {
280 return err
281 }
282 ckgr.Name = &name
283 }
284 case "type":
285 if v != nil {
286 var typeVar string
287 err = json.Unmarshal(*v, &typeVar)
288 if err != nil {
289 return err
290 }
291 ckgr.Type = &typeVar
292 }
293 case "location":
294 if v != nil {
295 var location string
296 err = json.Unmarshal(*v, &location)
297 if err != nil {
298 return err
299 }
300 ckgr.Location = &location
301 }
302 case "tags":
303 if v != nil {
304 var tags map[string]*string
305 err = json.Unmarshal(*v, &tags)
306 if err != nil {
307 return err
308 }
309 ckgr.Tags = tags
310 }
311 }
312 }
313
314 return nil
315 }
316
317
318
319 type CassandraKeyspaceListResult struct {
320 autorest.Response `json:"-"`
321
322 Value *[]CassandraKeyspaceGetResults `json:"value,omitempty"`
323 }
324
325
326 func (cklr CassandraKeyspaceListResult) MarshalJSON() ([]byte, error) {
327 objectMap := make(map[string]interface{})
328 return json.Marshal(objectMap)
329 }
330
331
332 type CassandraKeyspaceResource struct {
333
334 ID *string `json:"id,omitempty"`
335 }
336
337
338 type CassandraPartitionKey struct {
339
340 Name *string `json:"name,omitempty"`
341 }
342
343
344
345 type CassandraResourcesCreateUpdateCassandraKeyspaceFuture struct {
346 azure.FutureAPI
347
348
349 Result func(CassandraResourcesClient) (CassandraKeyspaceGetResults, error)
350 }
351
352
353 func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error {
354 var azFuture azure.Future
355 if err := json.Unmarshal(body, &azFuture); err != nil {
356 return err
357 }
358 future.FutureAPI = &azFuture
359 future.Result = future.result
360 return nil
361 }
362
363
364 func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ckgr CassandraKeyspaceGetResults, err error) {
365 var done bool
366 done, err = future.DoneWithContext(context.Background(), client)
367 if err != nil {
368 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure")
369 return
370 }
371 if !done {
372 ckgr.Response.Response = future.Response()
373 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture")
374 return
375 }
376 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
377 if ckgr.Response.Response, err = future.GetResult(sender); err == nil && ckgr.Response.Response.StatusCode != http.StatusNoContent {
378 ckgr, err = client.CreateUpdateCassandraKeyspaceResponder(ckgr.Response.Response)
379 if err != nil {
380 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", ckgr.Response.Response, "Failure responding to request")
381 }
382 }
383 return
384 }
385
386
387
388 type CassandraResourcesCreateUpdateCassandraTableFuture struct {
389 azure.FutureAPI
390
391
392 Result func(CassandraResourcesClient) (CassandraTableGetResults, error)
393 }
394
395
396 func (future *CassandraResourcesCreateUpdateCassandraTableFuture) UnmarshalJSON(body []byte) error {
397 var azFuture azure.Future
398 if err := json.Unmarshal(body, &azFuture); err != nil {
399 return err
400 }
401 future.FutureAPI = &azFuture
402 future.Result = future.result
403 return nil
404 }
405
406
407 func (future *CassandraResourcesCreateUpdateCassandraTableFuture) result(client CassandraResourcesClient) (ctgr CassandraTableGetResults, err error) {
408 var done bool
409 done, err = future.DoneWithContext(context.Background(), client)
410 if err != nil {
411 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", future.Response(), "Polling failure")
412 return
413 }
414 if !done {
415 ctgr.Response.Response = future.Response()
416 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraTableFuture")
417 return
418 }
419 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
420 if ctgr.Response.Response, err = future.GetResult(sender); err == nil && ctgr.Response.Response.StatusCode != http.StatusNoContent {
421 ctgr, err = client.CreateUpdateCassandraTableResponder(ctgr.Response.Response)
422 if err != nil {
423 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", ctgr.Response.Response, "Failure responding to request")
424 }
425 }
426 return
427 }
428
429
430
431 type CassandraResourcesDeleteCassandraKeyspaceFuture struct {
432 azure.FutureAPI
433
434
435 Result func(CassandraResourcesClient) (autorest.Response, error)
436 }
437
438
439 func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error {
440 var azFuture azure.Future
441 if err := json.Unmarshal(body, &azFuture); err != nil {
442 return err
443 }
444 future.FutureAPI = &azFuture
445 future.Result = future.result
446 return nil
447 }
448
449
450 func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) {
451 var done bool
452 done, err = future.DoneWithContext(context.Background(), client)
453 if err != nil {
454 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure")
455 return
456 }
457 if !done {
458 ar.Response = future.Response()
459 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture")
460 return
461 }
462 ar.Response = future.Response()
463 return
464 }
465
466
467
468 type CassandraResourcesDeleteCassandraTableFuture struct {
469 azure.FutureAPI
470
471
472 Result func(CassandraResourcesClient) (autorest.Response, error)
473 }
474
475
476 func (future *CassandraResourcesDeleteCassandraTableFuture) UnmarshalJSON(body []byte) error {
477 var azFuture azure.Future
478 if err := json.Unmarshal(body, &azFuture); err != nil {
479 return err
480 }
481 future.FutureAPI = &azFuture
482 future.Result = future.result
483 return nil
484 }
485
486
487 func (future *CassandraResourcesDeleteCassandraTableFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) {
488 var done bool
489 done, err = future.DoneWithContext(context.Background(), client)
490 if err != nil {
491 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraTableFuture", "Result", future.Response(), "Polling failure")
492 return
493 }
494 if !done {
495 ar.Response = future.Response()
496 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraTableFuture")
497 return
498 }
499 ar.Response = future.Response()
500 return
501 }
502
503
504
505 type CassandraResourcesUpdateCassandraKeyspaceThroughputFuture struct {
506 azure.FutureAPI
507
508
509 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
510 }
511
512
513 func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) UnmarshalJSON(body []byte) error {
514 var azFuture azure.Future
515 if err := json.Unmarshal(body, &azFuture); err != nil {
516 return err
517 }
518 future.FutureAPI = &azFuture
519 future.Result = future.result
520 return nil
521 }
522
523
524 func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
525 var done bool
526 done, err = future.DoneWithContext(context.Background(), client)
527 if err != nil {
528 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", future.Response(), "Polling failure")
529 return
530 }
531 if !done {
532 tsgr.Response.Response = future.Response()
533 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture")
534 return
535 }
536 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
537 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
538 tsgr, err = client.UpdateCassandraKeyspaceThroughputResponder(tsgr.Response.Response)
539 if err != nil {
540 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
541 }
542 }
543 return
544 }
545
546
547
548 type CassandraResourcesUpdateCassandraTableThroughputFuture struct {
549 azure.FutureAPI
550
551
552 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error)
553 }
554
555
556 func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) UnmarshalJSON(body []byte) error {
557 var azFuture azure.Future
558 if err := json.Unmarshal(body, &azFuture); err != nil {
559 return err
560 }
561 future.FutureAPI = &azFuture
562 future.Result = future.result
563 return nil
564 }
565
566
567 func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
568 var done bool
569 done, err = future.DoneWithContext(context.Background(), client)
570 if err != nil {
571 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", future.Response(), "Polling failure")
572 return
573 }
574 if !done {
575 tsgr.Response.Response = future.Response()
576 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture")
577 return
578 }
579 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
580 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
581 tsgr, err = client.UpdateCassandraTableThroughputResponder(tsgr.Response.Response)
582 if err != nil {
583 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
584 }
585 }
586 return
587 }
588
589
590 type CassandraSchema struct {
591
592 Columns *[]Column `json:"columns,omitempty"`
593
594 PartitionKeys *[]CassandraPartitionKey `json:"partitionKeys,omitempty"`
595
596 ClusterKeys *[]ClusterKey `json:"clusterKeys,omitempty"`
597 }
598
599
600 type CassandraTableCreateUpdateParameters struct {
601
602 *CassandraTableCreateUpdateProperties `json:"properties,omitempty"`
603
604 ID *string `json:"id,omitempty"`
605
606 Name *string `json:"name,omitempty"`
607
608 Type *string `json:"type,omitempty"`
609
610 Location *string `json:"location,omitempty"`
611 Tags map[string]*string `json:"tags"`
612 }
613
614
615 func (ctcup CassandraTableCreateUpdateParameters) MarshalJSON() ([]byte, error) {
616 objectMap := make(map[string]interface{})
617 if ctcup.CassandraTableCreateUpdateProperties != nil {
618 objectMap["properties"] = ctcup.CassandraTableCreateUpdateProperties
619 }
620 if ctcup.Location != nil {
621 objectMap["location"] = ctcup.Location
622 }
623 if ctcup.Tags != nil {
624 objectMap["tags"] = ctcup.Tags
625 }
626 return json.Marshal(objectMap)
627 }
628
629
630 func (ctcup *CassandraTableCreateUpdateParameters) UnmarshalJSON(body []byte) error {
631 var m map[string]*json.RawMessage
632 err := json.Unmarshal(body, &m)
633 if err != nil {
634 return err
635 }
636 for k, v := range m {
637 switch k {
638 case "properties":
639 if v != nil {
640 var cassandraTableCreateUpdateProperties CassandraTableCreateUpdateProperties
641 err = json.Unmarshal(*v, &cassandraTableCreateUpdateProperties)
642 if err != nil {
643 return err
644 }
645 ctcup.CassandraTableCreateUpdateProperties = &cassandraTableCreateUpdateProperties
646 }
647 case "id":
648 if v != nil {
649 var ID string
650 err = json.Unmarshal(*v, &ID)
651 if err != nil {
652 return err
653 }
654 ctcup.ID = &ID
655 }
656 case "name":
657 if v != nil {
658 var name string
659 err = json.Unmarshal(*v, &name)
660 if err != nil {
661 return err
662 }
663 ctcup.Name = &name
664 }
665 case "type":
666 if v != nil {
667 var typeVar string
668 err = json.Unmarshal(*v, &typeVar)
669 if err != nil {
670 return err
671 }
672 ctcup.Type = &typeVar
673 }
674 case "location":
675 if v != nil {
676 var location string
677 err = json.Unmarshal(*v, &location)
678 if err != nil {
679 return err
680 }
681 ctcup.Location = &location
682 }
683 case "tags":
684 if v != nil {
685 var tags map[string]*string
686 err = json.Unmarshal(*v, &tags)
687 if err != nil {
688 return err
689 }
690 ctcup.Tags = tags
691 }
692 }
693 }
694
695 return nil
696 }
697
698
699 type CassandraTableCreateUpdateProperties struct {
700
701 Resource *CassandraTableResource `json:"resource,omitempty"`
702
703 Options map[string]*string `json:"options"`
704 }
705
706
707 func (ctcup CassandraTableCreateUpdateProperties) MarshalJSON() ([]byte, error) {
708 objectMap := make(map[string]interface{})
709 if ctcup.Resource != nil {
710 objectMap["resource"] = ctcup.Resource
711 }
712 if ctcup.Options != nil {
713 objectMap["options"] = ctcup.Options
714 }
715 return json.Marshal(objectMap)
716 }
717
718
719 type CassandraTableGetProperties struct {
720 Resource *CassandraTableGetPropertiesResource `json:"resource,omitempty"`
721 }
722
723
724 type CassandraTableGetPropertiesResource struct {
725
726 ID *string `json:"id,omitempty"`
727
728 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
729
730 Schema *CassandraSchema `json:"schema,omitempty"`
731
732 Rid *string `json:"_rid,omitempty"`
733
734 Ts interface{} `json:"_ts,omitempty"`
735
736 Etag *string `json:"_etag,omitempty"`
737 }
738
739
740 func (ctgp CassandraTableGetPropertiesResource) MarshalJSON() ([]byte, error) {
741 objectMap := make(map[string]interface{})
742 if ctgp.ID != nil {
743 objectMap["id"] = ctgp.ID
744 }
745 if ctgp.DefaultTTL != nil {
746 objectMap["defaultTtl"] = ctgp.DefaultTTL
747 }
748 if ctgp.Schema != nil {
749 objectMap["schema"] = ctgp.Schema
750 }
751 return json.Marshal(objectMap)
752 }
753
754
755 type CassandraTableGetResults struct {
756 autorest.Response `json:"-"`
757
758 *CassandraTableGetProperties `json:"properties,omitempty"`
759
760 ID *string `json:"id,omitempty"`
761
762 Name *string `json:"name,omitempty"`
763
764 Type *string `json:"type,omitempty"`
765
766 Location *string `json:"location,omitempty"`
767 Tags map[string]*string `json:"tags"`
768 }
769
770
771 func (ctgr CassandraTableGetResults) MarshalJSON() ([]byte, error) {
772 objectMap := make(map[string]interface{})
773 if ctgr.CassandraTableGetProperties != nil {
774 objectMap["properties"] = ctgr.CassandraTableGetProperties
775 }
776 if ctgr.Location != nil {
777 objectMap["location"] = ctgr.Location
778 }
779 if ctgr.Tags != nil {
780 objectMap["tags"] = ctgr.Tags
781 }
782 return json.Marshal(objectMap)
783 }
784
785
786 func (ctgr *CassandraTableGetResults) UnmarshalJSON(body []byte) error {
787 var m map[string]*json.RawMessage
788 err := json.Unmarshal(body, &m)
789 if err != nil {
790 return err
791 }
792 for k, v := range m {
793 switch k {
794 case "properties":
795 if v != nil {
796 var cassandraTableGetProperties CassandraTableGetProperties
797 err = json.Unmarshal(*v, &cassandraTableGetProperties)
798 if err != nil {
799 return err
800 }
801 ctgr.CassandraTableGetProperties = &cassandraTableGetProperties
802 }
803 case "id":
804 if v != nil {
805 var ID string
806 err = json.Unmarshal(*v, &ID)
807 if err != nil {
808 return err
809 }
810 ctgr.ID = &ID
811 }
812 case "name":
813 if v != nil {
814 var name string
815 err = json.Unmarshal(*v, &name)
816 if err != nil {
817 return err
818 }
819 ctgr.Name = &name
820 }
821 case "type":
822 if v != nil {
823 var typeVar string
824 err = json.Unmarshal(*v, &typeVar)
825 if err != nil {
826 return err
827 }
828 ctgr.Type = &typeVar
829 }
830 case "location":
831 if v != nil {
832 var location string
833 err = json.Unmarshal(*v, &location)
834 if err != nil {
835 return err
836 }
837 ctgr.Location = &location
838 }
839 case "tags":
840 if v != nil {
841 var tags map[string]*string
842 err = json.Unmarshal(*v, &tags)
843 if err != nil {
844 return err
845 }
846 ctgr.Tags = tags
847 }
848 }
849 }
850
851 return nil
852 }
853
854
855
856 type CassandraTableListResult struct {
857 autorest.Response `json:"-"`
858
859 Value *[]CassandraTableGetResults `json:"value,omitempty"`
860 }
861
862
863 func (ctlr CassandraTableListResult) MarshalJSON() ([]byte, error) {
864 objectMap := make(map[string]interface{})
865 return json.Marshal(objectMap)
866 }
867
868
869 type CassandraTableResource struct {
870
871 ID *string `json:"id,omitempty"`
872
873 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
874
875 Schema *CassandraSchema `json:"schema,omitempty"`
876 }
877
878
879 type ClusterKey struct {
880
881 Name *string `json:"name,omitempty"`
882
883 OrderBy *string `json:"orderBy,omitempty"`
884 }
885
886
887 type Column struct {
888
889 Name *string `json:"name,omitempty"`
890
891 Type *string `json:"type,omitempty"`
892 }
893
894
895 type CompositePath struct {
896
897 Path *string `json:"path,omitempty"`
898
899 Order CompositePathSortOrder `json:"order,omitempty"`
900 }
901
902
903 type ConflictResolutionPolicy struct {
904
905 Mode ConflictResolutionMode `json:"mode,omitempty"`
906
907 ConflictResolutionPath *string `json:"conflictResolutionPath,omitempty"`
908
909 ConflictResolutionProcedure *string `json:"conflictResolutionProcedure,omitempty"`
910 }
911
912
913 type ConsistencyPolicy struct {
914
915 DefaultConsistencyLevel DefaultConsistencyLevel `json:"defaultConsistencyLevel,omitempty"`
916
917 MaxStalenessPrefix *int64 `json:"maxStalenessPrefix,omitempty"`
918
919 MaxIntervalInSeconds *int32 `json:"maxIntervalInSeconds,omitempty"`
920 }
921
922
923
924 type ContainerPartitionKey struct {
925
926 Paths *[]string `json:"paths,omitempty"`
927
928 Kind PartitionKind `json:"kind,omitempty"`
929
930 Version *int32 `json:"version,omitempty"`
931 }
932
933
934 type DatabaseAccountConnectionString struct {
935
936 ConnectionString *string `json:"connectionString,omitempty"`
937
938 Description *string `json:"description,omitempty"`
939 }
940
941
942 func (dacs DatabaseAccountConnectionString) MarshalJSON() ([]byte, error) {
943 objectMap := make(map[string]interface{})
944 return json.Marshal(objectMap)
945 }
946
947
948 type DatabaseAccountCreateUpdateParameters struct {
949
950 Kind DatabaseAccountKind `json:"kind,omitempty"`
951 *DatabaseAccountCreateUpdateProperties `json:"properties,omitempty"`
952
953 ID *string `json:"id,omitempty"`
954
955 Name *string `json:"name,omitempty"`
956
957 Type *string `json:"type,omitempty"`
958
959 Location *string `json:"location,omitempty"`
960 Tags map[string]*string `json:"tags"`
961 }
962
963
964 func (dacup DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) {
965 objectMap := make(map[string]interface{})
966 if dacup.Kind != "" {
967 objectMap["kind"] = dacup.Kind
968 }
969 if dacup.DatabaseAccountCreateUpdateProperties != nil {
970 objectMap["properties"] = dacup.DatabaseAccountCreateUpdateProperties
971 }
972 if dacup.Location != nil {
973 objectMap["location"] = dacup.Location
974 }
975 if dacup.Tags != nil {
976 objectMap["tags"] = dacup.Tags
977 }
978 return json.Marshal(objectMap)
979 }
980
981
982 func (dacup *DatabaseAccountCreateUpdateParameters) UnmarshalJSON(body []byte) error {
983 var m map[string]*json.RawMessage
984 err := json.Unmarshal(body, &m)
985 if err != nil {
986 return err
987 }
988 for k, v := range m {
989 switch k {
990 case "kind":
991 if v != nil {
992 var kind DatabaseAccountKind
993 err = json.Unmarshal(*v, &kind)
994 if err != nil {
995 return err
996 }
997 dacup.Kind = kind
998 }
999 case "properties":
1000 if v != nil {
1001 var databaseAccountCreateUpdateProperties DatabaseAccountCreateUpdateProperties
1002 err = json.Unmarshal(*v, &databaseAccountCreateUpdateProperties)
1003 if err != nil {
1004 return err
1005 }
1006 dacup.DatabaseAccountCreateUpdateProperties = &databaseAccountCreateUpdateProperties
1007 }
1008 case "id":
1009 if v != nil {
1010 var ID string
1011 err = json.Unmarshal(*v, &ID)
1012 if err != nil {
1013 return err
1014 }
1015 dacup.ID = &ID
1016 }
1017 case "name":
1018 if v != nil {
1019 var name string
1020 err = json.Unmarshal(*v, &name)
1021 if err != nil {
1022 return err
1023 }
1024 dacup.Name = &name
1025 }
1026 case "type":
1027 if v != nil {
1028 var typeVar string
1029 err = json.Unmarshal(*v, &typeVar)
1030 if err != nil {
1031 return err
1032 }
1033 dacup.Type = &typeVar
1034 }
1035 case "location":
1036 if v != nil {
1037 var location string
1038 err = json.Unmarshal(*v, &location)
1039 if err != nil {
1040 return err
1041 }
1042 dacup.Location = &location
1043 }
1044 case "tags":
1045 if v != nil {
1046 var tags map[string]*string
1047 err = json.Unmarshal(*v, &tags)
1048 if err != nil {
1049 return err
1050 }
1051 dacup.Tags = tags
1052 }
1053 }
1054 }
1055
1056 return nil
1057 }
1058
1059
1060 type DatabaseAccountCreateUpdateProperties struct {
1061
1062 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"`
1063
1064 Locations *[]Location `json:"locations,omitempty"`
1065
1066 DatabaseAccountOfferType *string `json:"databaseAccountOfferType,omitempty"`
1067
1068 IPRangeFilter *string `json:"ipRangeFilter,omitempty"`
1069
1070 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
1071
1072 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`
1073
1074 Capabilities *[]Capability `json:"capabilities,omitempty"`
1075
1076 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
1077
1078 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`
1079
1080 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`
1081
1082 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"`
1083
1084 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`
1085 }
1086
1087
1088 type DatabaseAccountGetProperties struct {
1089 ProvisioningState *string `json:"provisioningState,omitempty"`
1090
1091 DocumentEndpoint *string `json:"documentEndpoint,omitempty"`
1092
1093 DatabaseAccountOfferType DatabaseAccountOfferType `json:"databaseAccountOfferType,omitempty"`
1094
1095 IPRangeFilter *string `json:"ipRangeFilter,omitempty"`
1096
1097 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
1098
1099 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`
1100
1101 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"`
1102
1103 Capabilities *[]Capability `json:"capabilities,omitempty"`
1104
1105 WriteLocations *[]Location `json:"writeLocations,omitempty"`
1106
1107 ReadLocations *[]Location `json:"readLocations,omitempty"`
1108
1109 Locations *[]Location `json:"locations,omitempty"`
1110
1111 FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"`
1112
1113 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
1114
1115 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`
1116
1117 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`
1118
1119 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"`
1120
1121 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`
1122 }
1123
1124
1125 func (dagp DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) {
1126 objectMap := make(map[string]interface{})
1127 if dagp.ProvisioningState != nil {
1128 objectMap["provisioningState"] = dagp.ProvisioningState
1129 }
1130 if dagp.IPRangeFilter != nil {
1131 objectMap["ipRangeFilter"] = dagp.IPRangeFilter
1132 }
1133 if dagp.IsVirtualNetworkFilterEnabled != nil {
1134 objectMap["isVirtualNetworkFilterEnabled"] = dagp.IsVirtualNetworkFilterEnabled
1135 }
1136 if dagp.EnableAutomaticFailover != nil {
1137 objectMap["enableAutomaticFailover"] = dagp.EnableAutomaticFailover
1138 }
1139 if dagp.ConsistencyPolicy != nil {
1140 objectMap["consistencyPolicy"] = dagp.ConsistencyPolicy
1141 }
1142 if dagp.Capabilities != nil {
1143 objectMap["capabilities"] = dagp.Capabilities
1144 }
1145 if dagp.VirtualNetworkRules != nil {
1146 objectMap["virtualNetworkRules"] = dagp.VirtualNetworkRules
1147 }
1148 if dagp.EnableMultipleWriteLocations != nil {
1149 objectMap["enableMultipleWriteLocations"] = dagp.EnableMultipleWriteLocations
1150 }
1151 if dagp.EnableCassandraConnector != nil {
1152 objectMap["enableCassandraConnector"] = dagp.EnableCassandraConnector
1153 }
1154 if dagp.ConnectorOffer != "" {
1155 objectMap["connectorOffer"] = dagp.ConnectorOffer
1156 }
1157 if dagp.DisableKeyBasedMetadataWriteAccess != nil {
1158 objectMap["disableKeyBasedMetadataWriteAccess"] = dagp.DisableKeyBasedMetadataWriteAccess
1159 }
1160 return json.Marshal(objectMap)
1161 }
1162
1163
1164 type DatabaseAccountGetResults struct {
1165 autorest.Response `json:"-"`
1166
1167 Kind DatabaseAccountKind `json:"kind,omitempty"`
1168 *DatabaseAccountGetProperties `json:"properties,omitempty"`
1169
1170 ID *string `json:"id,omitempty"`
1171
1172 Name *string `json:"name,omitempty"`
1173
1174 Type *string `json:"type,omitempty"`
1175
1176 Location *string `json:"location,omitempty"`
1177 Tags map[string]*string `json:"tags"`
1178 }
1179
1180
1181 func (dagr DatabaseAccountGetResults) MarshalJSON() ([]byte, error) {
1182 objectMap := make(map[string]interface{})
1183 if dagr.Kind != "" {
1184 objectMap["kind"] = dagr.Kind
1185 }
1186 if dagr.DatabaseAccountGetProperties != nil {
1187 objectMap["properties"] = dagr.DatabaseAccountGetProperties
1188 }
1189 if dagr.Location != nil {
1190 objectMap["location"] = dagr.Location
1191 }
1192 if dagr.Tags != nil {
1193 objectMap["tags"] = dagr.Tags
1194 }
1195 return json.Marshal(objectMap)
1196 }
1197
1198
1199 func (dagr *DatabaseAccountGetResults) UnmarshalJSON(body []byte) error {
1200 var m map[string]*json.RawMessage
1201 err := json.Unmarshal(body, &m)
1202 if err != nil {
1203 return err
1204 }
1205 for k, v := range m {
1206 switch k {
1207 case "kind":
1208 if v != nil {
1209 var kind DatabaseAccountKind
1210 err = json.Unmarshal(*v, &kind)
1211 if err != nil {
1212 return err
1213 }
1214 dagr.Kind = kind
1215 }
1216 case "properties":
1217 if v != nil {
1218 var databaseAccountGetProperties DatabaseAccountGetProperties
1219 err = json.Unmarshal(*v, &databaseAccountGetProperties)
1220 if err != nil {
1221 return err
1222 }
1223 dagr.DatabaseAccountGetProperties = &databaseAccountGetProperties
1224 }
1225 case "id":
1226 if v != nil {
1227 var ID string
1228 err = json.Unmarshal(*v, &ID)
1229 if err != nil {
1230 return err
1231 }
1232 dagr.ID = &ID
1233 }
1234 case "name":
1235 if v != nil {
1236 var name string
1237 err = json.Unmarshal(*v, &name)
1238 if err != nil {
1239 return err
1240 }
1241 dagr.Name = &name
1242 }
1243 case "type":
1244 if v != nil {
1245 var typeVar string
1246 err = json.Unmarshal(*v, &typeVar)
1247 if err != nil {
1248 return err
1249 }
1250 dagr.Type = &typeVar
1251 }
1252 case "location":
1253 if v != nil {
1254 var location string
1255 err = json.Unmarshal(*v, &location)
1256 if err != nil {
1257 return err
1258 }
1259 dagr.Location = &location
1260 }
1261 case "tags":
1262 if v != nil {
1263 var tags map[string]*string
1264 err = json.Unmarshal(*v, &tags)
1265 if err != nil {
1266 return err
1267 }
1268 dagr.Tags = tags
1269 }
1270 }
1271 }
1272
1273 return nil
1274 }
1275
1276
1277 type DatabaseAccountListConnectionStringsResult struct {
1278 autorest.Response `json:"-"`
1279
1280 ConnectionStrings *[]DatabaseAccountConnectionString `json:"connectionStrings,omitempty"`
1281 }
1282
1283
1284 type DatabaseAccountListKeysResult struct {
1285 autorest.Response `json:"-"`
1286
1287 PrimaryMasterKey *string `json:"primaryMasterKey,omitempty"`
1288
1289 SecondaryMasterKey *string `json:"secondaryMasterKey,omitempty"`
1290
1291 PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"`
1292
1293 SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"`
1294 }
1295
1296
1297 func (dalkr DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) {
1298 objectMap := make(map[string]interface{})
1299 return json.Marshal(objectMap)
1300 }
1301
1302
1303 type DatabaseAccountListReadOnlyKeysResult struct {
1304 autorest.Response `json:"-"`
1305
1306 PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"`
1307
1308 SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"`
1309 }
1310
1311
1312 func (dalrokr DatabaseAccountListReadOnlyKeysResult) MarshalJSON() ([]byte, error) {
1313 objectMap := make(map[string]interface{})
1314 return json.Marshal(objectMap)
1315 }
1316
1317
1318 type DatabaseAccountRegenerateKeyParameters struct {
1319
1320 KeyKind KeyKind `json:"keyKind,omitempty"`
1321 }
1322
1323
1324
1325 type DatabaseAccountsCreateOrUpdateFuture struct {
1326 azure.FutureAPI
1327
1328
1329 Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error)
1330 }
1331
1332
1333 func (future *DatabaseAccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1334 var azFuture azure.Future
1335 if err := json.Unmarshal(body, &azFuture); err != nil {
1336 return err
1337 }
1338 future.FutureAPI = &azFuture
1339 future.Result = future.result
1340 return nil
1341 }
1342
1343
1344 func (future *DatabaseAccountsCreateOrUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) {
1345 var done bool
1346 done, err = future.DoneWithContext(context.Background(), client)
1347 if err != nil {
1348 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1349 return
1350 }
1351 if !done {
1352 dagr.Response.Response = future.Response()
1353 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsCreateOrUpdateFuture")
1354 return
1355 }
1356 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1357 if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent {
1358 dagr, err = client.CreateOrUpdateResponder(dagr.Response.Response)
1359 if err != nil {
1360 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request")
1361 }
1362 }
1363 return
1364 }
1365
1366
1367
1368 type DatabaseAccountsDeleteFuture struct {
1369 azure.FutureAPI
1370
1371
1372 Result func(DatabaseAccountsClient) (autorest.Response, error)
1373 }
1374
1375
1376 func (future *DatabaseAccountsDeleteFuture) UnmarshalJSON(body []byte) error {
1377 var azFuture azure.Future
1378 if err := json.Unmarshal(body, &azFuture); err != nil {
1379 return err
1380 }
1381 future.FutureAPI = &azFuture
1382 future.Result = future.result
1383 return nil
1384 }
1385
1386
1387 func (future *DatabaseAccountsDeleteFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
1388 var done bool
1389 done, err = future.DoneWithContext(context.Background(), client)
1390 if err != nil {
1391 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteFuture", "Result", future.Response(), "Polling failure")
1392 return
1393 }
1394 if !done {
1395 ar.Response = future.Response()
1396 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsDeleteFuture")
1397 return
1398 }
1399 ar.Response = future.Response()
1400 return
1401 }
1402
1403
1404
1405 type DatabaseAccountsFailoverPriorityChangeFuture struct {
1406 azure.FutureAPI
1407
1408
1409 Result func(DatabaseAccountsClient) (autorest.Response, error)
1410 }
1411
1412
1413 func (future *DatabaseAccountsFailoverPriorityChangeFuture) UnmarshalJSON(body []byte) error {
1414 var azFuture azure.Future
1415 if err := json.Unmarshal(body, &azFuture); err != nil {
1416 return err
1417 }
1418 future.FutureAPI = &azFuture
1419 future.Result = future.result
1420 return nil
1421 }
1422
1423
1424 func (future *DatabaseAccountsFailoverPriorityChangeFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
1425 var done bool
1426 done, err = future.DoneWithContext(context.Background(), client)
1427 if err != nil {
1428 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", future.Response(), "Polling failure")
1429 return
1430 }
1431 if !done {
1432 ar.Response = future.Response()
1433 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsFailoverPriorityChangeFuture")
1434 return
1435 }
1436 ar.Response = future.Response()
1437 return
1438 }
1439
1440
1441
1442 type DatabaseAccountsListResult struct {
1443 autorest.Response `json:"-"`
1444
1445 Value *[]DatabaseAccountGetResults `json:"value,omitempty"`
1446 }
1447
1448
1449 func (dalr DatabaseAccountsListResult) MarshalJSON() ([]byte, error) {
1450 objectMap := make(map[string]interface{})
1451 return json.Marshal(objectMap)
1452 }
1453
1454
1455
1456 type DatabaseAccountsOfflineRegionFuture struct {
1457 azure.FutureAPI
1458
1459
1460 Result func(DatabaseAccountsClient) (autorest.Response, error)
1461 }
1462
1463
1464 func (future *DatabaseAccountsOfflineRegionFuture) UnmarshalJSON(body []byte) error {
1465 var azFuture azure.Future
1466 if err := json.Unmarshal(body, &azFuture); err != nil {
1467 return err
1468 }
1469 future.FutureAPI = &azFuture
1470 future.Result = future.result
1471 return nil
1472 }
1473
1474
1475 func (future *DatabaseAccountsOfflineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
1476 var done bool
1477 done, err = future.DoneWithContext(context.Background(), client)
1478 if err != nil {
1479 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOfflineRegionFuture", "Result", future.Response(), "Polling failure")
1480 return
1481 }
1482 if !done {
1483 ar.Response = future.Response()
1484 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOfflineRegionFuture")
1485 return
1486 }
1487 ar.Response = future.Response()
1488 return
1489 }
1490
1491
1492
1493 type DatabaseAccountsOnlineRegionFuture struct {
1494 azure.FutureAPI
1495
1496
1497 Result func(DatabaseAccountsClient) (autorest.Response, error)
1498 }
1499
1500
1501 func (future *DatabaseAccountsOnlineRegionFuture) UnmarshalJSON(body []byte) error {
1502 var azFuture azure.Future
1503 if err := json.Unmarshal(body, &azFuture); err != nil {
1504 return err
1505 }
1506 future.FutureAPI = &azFuture
1507 future.Result = future.result
1508 return nil
1509 }
1510
1511
1512 func (future *DatabaseAccountsOnlineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
1513 var done bool
1514 done, err = future.DoneWithContext(context.Background(), client)
1515 if err != nil {
1516 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOnlineRegionFuture", "Result", future.Response(), "Polling failure")
1517 return
1518 }
1519 if !done {
1520 ar.Response = future.Response()
1521 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOnlineRegionFuture")
1522 return
1523 }
1524 ar.Response = future.Response()
1525 return
1526 }
1527
1528
1529
1530 type DatabaseAccountsRegenerateKeyFuture struct {
1531 azure.FutureAPI
1532
1533
1534 Result func(DatabaseAccountsClient) (autorest.Response, error)
1535 }
1536
1537
1538 func (future *DatabaseAccountsRegenerateKeyFuture) UnmarshalJSON(body []byte) error {
1539 var azFuture azure.Future
1540 if err := json.Unmarshal(body, &azFuture); err != nil {
1541 return err
1542 }
1543 future.FutureAPI = &azFuture
1544 future.Result = future.result
1545 return nil
1546 }
1547
1548
1549 func (future *DatabaseAccountsRegenerateKeyFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) {
1550 var done bool
1551 done, err = future.DoneWithContext(context.Background(), client)
1552 if err != nil {
1553 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", future.Response(), "Polling failure")
1554 return
1555 }
1556 if !done {
1557 ar.Response = future.Response()
1558 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsRegenerateKeyFuture")
1559 return
1560 }
1561 ar.Response = future.Response()
1562 return
1563 }
1564
1565
1566
1567 type DatabaseAccountsUpdateFuture struct {
1568 azure.FutureAPI
1569
1570
1571 Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error)
1572 }
1573
1574
1575 func (future *DatabaseAccountsUpdateFuture) UnmarshalJSON(body []byte) error {
1576 var azFuture azure.Future
1577 if err := json.Unmarshal(body, &azFuture); err != nil {
1578 return err
1579 }
1580 future.FutureAPI = &azFuture
1581 future.Result = future.result
1582 return nil
1583 }
1584
1585
1586 func (future *DatabaseAccountsUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) {
1587 var done bool
1588 done, err = future.DoneWithContext(context.Background(), client)
1589 if err != nil {
1590 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", future.Response(), "Polling failure")
1591 return
1592 }
1593 if !done {
1594 dagr.Response.Response = future.Response()
1595 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsUpdateFuture")
1596 return
1597 }
1598 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1599 if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent {
1600 dagr, err = client.UpdateResponder(dagr.Response.Response)
1601 if err != nil {
1602 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request")
1603 }
1604 }
1605 return
1606 }
1607
1608
1609 type DatabaseAccountUpdateParameters struct {
1610 Tags map[string]*string `json:"tags"`
1611
1612 Location *string `json:"location,omitempty"`
1613 *DatabaseAccountUpdateProperties `json:"properties,omitempty"`
1614 }
1615
1616
1617 func (daup DatabaseAccountUpdateParameters) MarshalJSON() ([]byte, error) {
1618 objectMap := make(map[string]interface{})
1619 if daup.Tags != nil {
1620 objectMap["tags"] = daup.Tags
1621 }
1622 if daup.Location != nil {
1623 objectMap["location"] = daup.Location
1624 }
1625 if daup.DatabaseAccountUpdateProperties != nil {
1626 objectMap["properties"] = daup.DatabaseAccountUpdateProperties
1627 }
1628 return json.Marshal(objectMap)
1629 }
1630
1631
1632 func (daup *DatabaseAccountUpdateParameters) UnmarshalJSON(body []byte) error {
1633 var m map[string]*json.RawMessage
1634 err := json.Unmarshal(body, &m)
1635 if err != nil {
1636 return err
1637 }
1638 for k, v := range m {
1639 switch k {
1640 case "tags":
1641 if v != nil {
1642 var tags map[string]*string
1643 err = json.Unmarshal(*v, &tags)
1644 if err != nil {
1645 return err
1646 }
1647 daup.Tags = tags
1648 }
1649 case "location":
1650 if v != nil {
1651 var location string
1652 err = json.Unmarshal(*v, &location)
1653 if err != nil {
1654 return err
1655 }
1656 daup.Location = &location
1657 }
1658 case "properties":
1659 if v != nil {
1660 var databaseAccountUpdateProperties DatabaseAccountUpdateProperties
1661 err = json.Unmarshal(*v, &databaseAccountUpdateProperties)
1662 if err != nil {
1663 return err
1664 }
1665 daup.DatabaseAccountUpdateProperties = &databaseAccountUpdateProperties
1666 }
1667 }
1668 }
1669
1670 return nil
1671 }
1672
1673
1674 type DatabaseAccountUpdateProperties struct {
1675
1676 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"`
1677
1678 Locations *[]Location `json:"locations,omitempty"`
1679
1680 IPRangeFilter *string `json:"ipRangeFilter,omitempty"`
1681
1682 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
1683
1684 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`
1685
1686 Capabilities *[]Capability `json:"capabilities,omitempty"`
1687
1688 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
1689
1690 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`
1691
1692 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`
1693
1694 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"`
1695
1696 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`
1697 }
1698
1699
1700 type ErrorResponse struct {
1701
1702 Code *string `json:"code,omitempty"`
1703
1704 Message *string `json:"message,omitempty"`
1705 }
1706
1707
1708 type ExcludedPath struct {
1709
1710 Path *string `json:"path,omitempty"`
1711 }
1712
1713
1714
1715 type ExtendedResourceProperties struct {
1716
1717 Rid *string `json:"_rid,omitempty"`
1718
1719 Ts interface{} `json:"_ts,omitempty"`
1720
1721 Etag *string `json:"_etag,omitempty"`
1722 }
1723
1724
1725 func (erp ExtendedResourceProperties) MarshalJSON() ([]byte, error) {
1726 objectMap := make(map[string]interface{})
1727 return json.Marshal(objectMap)
1728 }
1729
1730
1731 type FailoverPolicies struct {
1732
1733 FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"`
1734 }
1735
1736
1737 type FailoverPolicy struct {
1738
1739 ID *string `json:"id,omitempty"`
1740
1741 LocationName *string `json:"locationName,omitempty"`
1742
1743 FailoverPriority *int32 `json:"failoverPriority,omitempty"`
1744 }
1745
1746
1747 func (fp FailoverPolicy) MarshalJSON() ([]byte, error) {
1748 objectMap := make(map[string]interface{})
1749 if fp.LocationName != nil {
1750 objectMap["locationName"] = fp.LocationName
1751 }
1752 if fp.FailoverPriority != nil {
1753 objectMap["failoverPriority"] = fp.FailoverPriority
1754 }
1755 return json.Marshal(objectMap)
1756 }
1757
1758
1759 type GremlinDatabaseCreateUpdateParameters struct {
1760
1761 *GremlinDatabaseCreateUpdateProperties `json:"properties,omitempty"`
1762
1763 ID *string `json:"id,omitempty"`
1764
1765 Name *string `json:"name,omitempty"`
1766
1767 Type *string `json:"type,omitempty"`
1768
1769 Location *string `json:"location,omitempty"`
1770 Tags map[string]*string `json:"tags"`
1771 }
1772
1773
1774 func (gdcup GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) {
1775 objectMap := make(map[string]interface{})
1776 if gdcup.GremlinDatabaseCreateUpdateProperties != nil {
1777 objectMap["properties"] = gdcup.GremlinDatabaseCreateUpdateProperties
1778 }
1779 if gdcup.Location != nil {
1780 objectMap["location"] = gdcup.Location
1781 }
1782 if gdcup.Tags != nil {
1783 objectMap["tags"] = gdcup.Tags
1784 }
1785 return json.Marshal(objectMap)
1786 }
1787
1788
1789 func (gdcup *GremlinDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error {
1790 var m map[string]*json.RawMessage
1791 err := json.Unmarshal(body, &m)
1792 if err != nil {
1793 return err
1794 }
1795 for k, v := range m {
1796 switch k {
1797 case "properties":
1798 if v != nil {
1799 var gremlinDatabaseCreateUpdateProperties GremlinDatabaseCreateUpdateProperties
1800 err = json.Unmarshal(*v, &gremlinDatabaseCreateUpdateProperties)
1801 if err != nil {
1802 return err
1803 }
1804 gdcup.GremlinDatabaseCreateUpdateProperties = &gremlinDatabaseCreateUpdateProperties
1805 }
1806 case "id":
1807 if v != nil {
1808 var ID string
1809 err = json.Unmarshal(*v, &ID)
1810 if err != nil {
1811 return err
1812 }
1813 gdcup.ID = &ID
1814 }
1815 case "name":
1816 if v != nil {
1817 var name string
1818 err = json.Unmarshal(*v, &name)
1819 if err != nil {
1820 return err
1821 }
1822 gdcup.Name = &name
1823 }
1824 case "type":
1825 if v != nil {
1826 var typeVar string
1827 err = json.Unmarshal(*v, &typeVar)
1828 if err != nil {
1829 return err
1830 }
1831 gdcup.Type = &typeVar
1832 }
1833 case "location":
1834 if v != nil {
1835 var location string
1836 err = json.Unmarshal(*v, &location)
1837 if err != nil {
1838 return err
1839 }
1840 gdcup.Location = &location
1841 }
1842 case "tags":
1843 if v != nil {
1844 var tags map[string]*string
1845 err = json.Unmarshal(*v, &tags)
1846 if err != nil {
1847 return err
1848 }
1849 gdcup.Tags = tags
1850 }
1851 }
1852 }
1853
1854 return nil
1855 }
1856
1857
1858 type GremlinDatabaseCreateUpdateProperties struct {
1859
1860 Resource *GremlinDatabaseResource `json:"resource,omitempty"`
1861
1862 Options map[string]*string `json:"options"`
1863 }
1864
1865
1866 func (gdcup GremlinDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error) {
1867 objectMap := make(map[string]interface{})
1868 if gdcup.Resource != nil {
1869 objectMap["resource"] = gdcup.Resource
1870 }
1871 if gdcup.Options != nil {
1872 objectMap["options"] = gdcup.Options
1873 }
1874 return json.Marshal(objectMap)
1875 }
1876
1877
1878 type GremlinDatabaseGetProperties struct {
1879 Resource *GremlinDatabaseGetPropertiesResource `json:"resource,omitempty"`
1880 }
1881
1882
1883 type GremlinDatabaseGetPropertiesResource struct {
1884
1885 ID *string `json:"id,omitempty"`
1886
1887 Rid *string `json:"_rid,omitempty"`
1888
1889 Ts interface{} `json:"_ts,omitempty"`
1890
1891 Etag *string `json:"_etag,omitempty"`
1892 }
1893
1894
1895 func (gdgp GremlinDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) {
1896 objectMap := make(map[string]interface{})
1897 if gdgp.ID != nil {
1898 objectMap["id"] = gdgp.ID
1899 }
1900 return json.Marshal(objectMap)
1901 }
1902
1903
1904 type GremlinDatabaseGetResults struct {
1905 autorest.Response `json:"-"`
1906
1907 *GremlinDatabaseGetProperties `json:"properties,omitempty"`
1908
1909 ID *string `json:"id,omitempty"`
1910
1911 Name *string `json:"name,omitempty"`
1912
1913 Type *string `json:"type,omitempty"`
1914
1915 Location *string `json:"location,omitempty"`
1916 Tags map[string]*string `json:"tags"`
1917 }
1918
1919
1920 func (gdgr GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) {
1921 objectMap := make(map[string]interface{})
1922 if gdgr.GremlinDatabaseGetProperties != nil {
1923 objectMap["properties"] = gdgr.GremlinDatabaseGetProperties
1924 }
1925 if gdgr.Location != nil {
1926 objectMap["location"] = gdgr.Location
1927 }
1928 if gdgr.Tags != nil {
1929 objectMap["tags"] = gdgr.Tags
1930 }
1931 return json.Marshal(objectMap)
1932 }
1933
1934
1935 func (gdgr *GremlinDatabaseGetResults) UnmarshalJSON(body []byte) error {
1936 var m map[string]*json.RawMessage
1937 err := json.Unmarshal(body, &m)
1938 if err != nil {
1939 return err
1940 }
1941 for k, v := range m {
1942 switch k {
1943 case "properties":
1944 if v != nil {
1945 var gremlinDatabaseGetProperties GremlinDatabaseGetProperties
1946 err = json.Unmarshal(*v, &gremlinDatabaseGetProperties)
1947 if err != nil {
1948 return err
1949 }
1950 gdgr.GremlinDatabaseGetProperties = &gremlinDatabaseGetProperties
1951 }
1952 case "id":
1953 if v != nil {
1954 var ID string
1955 err = json.Unmarshal(*v, &ID)
1956 if err != nil {
1957 return err
1958 }
1959 gdgr.ID = &ID
1960 }
1961 case "name":
1962 if v != nil {
1963 var name string
1964 err = json.Unmarshal(*v, &name)
1965 if err != nil {
1966 return err
1967 }
1968 gdgr.Name = &name
1969 }
1970 case "type":
1971 if v != nil {
1972 var typeVar string
1973 err = json.Unmarshal(*v, &typeVar)
1974 if err != nil {
1975 return err
1976 }
1977 gdgr.Type = &typeVar
1978 }
1979 case "location":
1980 if v != nil {
1981 var location string
1982 err = json.Unmarshal(*v, &location)
1983 if err != nil {
1984 return err
1985 }
1986 gdgr.Location = &location
1987 }
1988 case "tags":
1989 if v != nil {
1990 var tags map[string]*string
1991 err = json.Unmarshal(*v, &tags)
1992 if err != nil {
1993 return err
1994 }
1995 gdgr.Tags = tags
1996 }
1997 }
1998 }
1999
2000 return nil
2001 }
2002
2003
2004
2005 type GremlinDatabaseListResult struct {
2006 autorest.Response `json:"-"`
2007
2008 Value *[]GremlinDatabaseGetResults `json:"value,omitempty"`
2009 }
2010
2011
2012 func (gdlr GremlinDatabaseListResult) MarshalJSON() ([]byte, error) {
2013 objectMap := make(map[string]interface{})
2014 return json.Marshal(objectMap)
2015 }
2016
2017
2018 type GremlinDatabaseResource struct {
2019
2020 ID *string `json:"id,omitempty"`
2021 }
2022
2023
2024 type GremlinGraphCreateUpdateParameters struct {
2025
2026 *GremlinGraphCreateUpdateProperties `json:"properties,omitempty"`
2027
2028 ID *string `json:"id,omitempty"`
2029
2030 Name *string `json:"name,omitempty"`
2031
2032 Type *string `json:"type,omitempty"`
2033
2034 Location *string `json:"location,omitempty"`
2035 Tags map[string]*string `json:"tags"`
2036 }
2037
2038
2039 func (ggcup GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) {
2040 objectMap := make(map[string]interface{})
2041 if ggcup.GremlinGraphCreateUpdateProperties != nil {
2042 objectMap["properties"] = ggcup.GremlinGraphCreateUpdateProperties
2043 }
2044 if ggcup.Location != nil {
2045 objectMap["location"] = ggcup.Location
2046 }
2047 if ggcup.Tags != nil {
2048 objectMap["tags"] = ggcup.Tags
2049 }
2050 return json.Marshal(objectMap)
2051 }
2052
2053
2054 func (ggcup *GremlinGraphCreateUpdateParameters) UnmarshalJSON(body []byte) error {
2055 var m map[string]*json.RawMessage
2056 err := json.Unmarshal(body, &m)
2057 if err != nil {
2058 return err
2059 }
2060 for k, v := range m {
2061 switch k {
2062 case "properties":
2063 if v != nil {
2064 var gremlinGraphCreateUpdateProperties GremlinGraphCreateUpdateProperties
2065 err = json.Unmarshal(*v, &gremlinGraphCreateUpdateProperties)
2066 if err != nil {
2067 return err
2068 }
2069 ggcup.GremlinGraphCreateUpdateProperties = &gremlinGraphCreateUpdateProperties
2070 }
2071 case "id":
2072 if v != nil {
2073 var ID string
2074 err = json.Unmarshal(*v, &ID)
2075 if err != nil {
2076 return err
2077 }
2078 ggcup.ID = &ID
2079 }
2080 case "name":
2081 if v != nil {
2082 var name string
2083 err = json.Unmarshal(*v, &name)
2084 if err != nil {
2085 return err
2086 }
2087 ggcup.Name = &name
2088 }
2089 case "type":
2090 if v != nil {
2091 var typeVar string
2092 err = json.Unmarshal(*v, &typeVar)
2093 if err != nil {
2094 return err
2095 }
2096 ggcup.Type = &typeVar
2097 }
2098 case "location":
2099 if v != nil {
2100 var location string
2101 err = json.Unmarshal(*v, &location)
2102 if err != nil {
2103 return err
2104 }
2105 ggcup.Location = &location
2106 }
2107 case "tags":
2108 if v != nil {
2109 var tags map[string]*string
2110 err = json.Unmarshal(*v, &tags)
2111 if err != nil {
2112 return err
2113 }
2114 ggcup.Tags = tags
2115 }
2116 }
2117 }
2118
2119 return nil
2120 }
2121
2122
2123 type GremlinGraphCreateUpdateProperties struct {
2124
2125 Resource *GremlinGraphResource `json:"resource,omitempty"`
2126
2127 Options map[string]*string `json:"options"`
2128 }
2129
2130
2131 func (ggcup GremlinGraphCreateUpdateProperties) MarshalJSON() ([]byte, error) {
2132 objectMap := make(map[string]interface{})
2133 if ggcup.Resource != nil {
2134 objectMap["resource"] = ggcup.Resource
2135 }
2136 if ggcup.Options != nil {
2137 objectMap["options"] = ggcup.Options
2138 }
2139 return json.Marshal(objectMap)
2140 }
2141
2142
2143 type GremlinGraphGetProperties struct {
2144 Resource *GremlinGraphGetPropertiesResource `json:"resource,omitempty"`
2145 }
2146
2147
2148 type GremlinGraphGetPropertiesResource struct {
2149
2150 ID *string `json:"id,omitempty"`
2151
2152 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
2153
2154 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
2155
2156 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
2157
2158 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
2159
2160 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
2161
2162 Rid *string `json:"_rid,omitempty"`
2163
2164 Ts interface{} `json:"_ts,omitempty"`
2165
2166 Etag *string `json:"_etag,omitempty"`
2167 }
2168
2169
2170 func (gggp GremlinGraphGetPropertiesResource) MarshalJSON() ([]byte, error) {
2171 objectMap := make(map[string]interface{})
2172 if gggp.ID != nil {
2173 objectMap["id"] = gggp.ID
2174 }
2175 if gggp.IndexingPolicy != nil {
2176 objectMap["indexingPolicy"] = gggp.IndexingPolicy
2177 }
2178 if gggp.PartitionKey != nil {
2179 objectMap["partitionKey"] = gggp.PartitionKey
2180 }
2181 if gggp.DefaultTTL != nil {
2182 objectMap["defaultTtl"] = gggp.DefaultTTL
2183 }
2184 if gggp.UniqueKeyPolicy != nil {
2185 objectMap["uniqueKeyPolicy"] = gggp.UniqueKeyPolicy
2186 }
2187 if gggp.ConflictResolutionPolicy != nil {
2188 objectMap["conflictResolutionPolicy"] = gggp.ConflictResolutionPolicy
2189 }
2190 return json.Marshal(objectMap)
2191 }
2192
2193
2194 type GremlinGraphGetResults struct {
2195 autorest.Response `json:"-"`
2196
2197 *GremlinGraphGetProperties `json:"properties,omitempty"`
2198
2199 ID *string `json:"id,omitempty"`
2200
2201 Name *string `json:"name,omitempty"`
2202
2203 Type *string `json:"type,omitempty"`
2204
2205 Location *string `json:"location,omitempty"`
2206 Tags map[string]*string `json:"tags"`
2207 }
2208
2209
2210 func (gggr GremlinGraphGetResults) MarshalJSON() ([]byte, error) {
2211 objectMap := make(map[string]interface{})
2212 if gggr.GremlinGraphGetProperties != nil {
2213 objectMap["properties"] = gggr.GremlinGraphGetProperties
2214 }
2215 if gggr.Location != nil {
2216 objectMap["location"] = gggr.Location
2217 }
2218 if gggr.Tags != nil {
2219 objectMap["tags"] = gggr.Tags
2220 }
2221 return json.Marshal(objectMap)
2222 }
2223
2224
2225 func (gggr *GremlinGraphGetResults) UnmarshalJSON(body []byte) error {
2226 var m map[string]*json.RawMessage
2227 err := json.Unmarshal(body, &m)
2228 if err != nil {
2229 return err
2230 }
2231 for k, v := range m {
2232 switch k {
2233 case "properties":
2234 if v != nil {
2235 var gremlinGraphGetProperties GremlinGraphGetProperties
2236 err = json.Unmarshal(*v, &gremlinGraphGetProperties)
2237 if err != nil {
2238 return err
2239 }
2240 gggr.GremlinGraphGetProperties = &gremlinGraphGetProperties
2241 }
2242 case "id":
2243 if v != nil {
2244 var ID string
2245 err = json.Unmarshal(*v, &ID)
2246 if err != nil {
2247 return err
2248 }
2249 gggr.ID = &ID
2250 }
2251 case "name":
2252 if v != nil {
2253 var name string
2254 err = json.Unmarshal(*v, &name)
2255 if err != nil {
2256 return err
2257 }
2258 gggr.Name = &name
2259 }
2260 case "type":
2261 if v != nil {
2262 var typeVar string
2263 err = json.Unmarshal(*v, &typeVar)
2264 if err != nil {
2265 return err
2266 }
2267 gggr.Type = &typeVar
2268 }
2269 case "location":
2270 if v != nil {
2271 var location string
2272 err = json.Unmarshal(*v, &location)
2273 if err != nil {
2274 return err
2275 }
2276 gggr.Location = &location
2277 }
2278 case "tags":
2279 if v != nil {
2280 var tags map[string]*string
2281 err = json.Unmarshal(*v, &tags)
2282 if err != nil {
2283 return err
2284 }
2285 gggr.Tags = tags
2286 }
2287 }
2288 }
2289
2290 return nil
2291 }
2292
2293
2294 type GremlinGraphListResult struct {
2295 autorest.Response `json:"-"`
2296
2297 Value *[]GremlinGraphGetResults `json:"value,omitempty"`
2298 }
2299
2300
2301 func (gglr GremlinGraphListResult) MarshalJSON() ([]byte, error) {
2302 objectMap := make(map[string]interface{})
2303 return json.Marshal(objectMap)
2304 }
2305
2306
2307 type GremlinGraphResource struct {
2308
2309 ID *string `json:"id,omitempty"`
2310
2311 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
2312
2313 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
2314
2315 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
2316
2317 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
2318
2319 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
2320 }
2321
2322
2323
2324 type GremlinResourcesCreateUpdateGremlinDatabaseFuture struct {
2325 azure.FutureAPI
2326
2327
2328 Result func(GremlinResourcesClient) (GremlinDatabaseGetResults, error)
2329 }
2330
2331
2332 func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) UnmarshalJSON(body []byte) error {
2333 var azFuture azure.Future
2334 if err := json.Unmarshal(body, &azFuture); err != nil {
2335 return err
2336 }
2337 future.FutureAPI = &azFuture
2338 future.Result = future.result
2339 return nil
2340 }
2341
2342
2343 func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) result(client GremlinResourcesClient) (gdgr GremlinDatabaseGetResults, err error) {
2344 var done bool
2345 done, err = future.DoneWithContext(context.Background(), client)
2346 if err != nil {
2347 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", future.Response(), "Polling failure")
2348 return
2349 }
2350 if !done {
2351 gdgr.Response.Response = future.Response()
2352 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture")
2353 return
2354 }
2355 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2356 if gdgr.Response.Response, err = future.GetResult(sender); err == nil && gdgr.Response.Response.StatusCode != http.StatusNoContent {
2357 gdgr, err = client.CreateUpdateGremlinDatabaseResponder(gdgr.Response.Response)
2358 if err != nil {
2359 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", gdgr.Response.Response, "Failure responding to request")
2360 }
2361 }
2362 return
2363 }
2364
2365
2366
2367 type GremlinResourcesCreateUpdateGremlinGraphFuture struct {
2368 azure.FutureAPI
2369
2370
2371 Result func(GremlinResourcesClient) (GremlinGraphGetResults, error)
2372 }
2373
2374
2375 func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) UnmarshalJSON(body []byte) error {
2376 var azFuture azure.Future
2377 if err := json.Unmarshal(body, &azFuture); err != nil {
2378 return err
2379 }
2380 future.FutureAPI = &azFuture
2381 future.Result = future.result
2382 return nil
2383 }
2384
2385
2386 func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) result(client GremlinResourcesClient) (gggr GremlinGraphGetResults, err error) {
2387 var done bool
2388 done, err = future.DoneWithContext(context.Background(), client)
2389 if err != nil {
2390 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", future.Response(), "Polling failure")
2391 return
2392 }
2393 if !done {
2394 gggr.Response.Response = future.Response()
2395 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture")
2396 return
2397 }
2398 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2399 if gggr.Response.Response, err = future.GetResult(sender); err == nil && gggr.Response.Response.StatusCode != http.StatusNoContent {
2400 gggr, err = client.CreateUpdateGremlinGraphResponder(gggr.Response.Response)
2401 if err != nil {
2402 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", gggr.Response.Response, "Failure responding to request")
2403 }
2404 }
2405 return
2406 }
2407
2408
2409
2410 type GremlinResourcesDeleteGremlinDatabaseFuture struct {
2411 azure.FutureAPI
2412
2413
2414 Result func(GremlinResourcesClient) (autorest.Response, error)
2415 }
2416
2417
2418 func (future *GremlinResourcesDeleteGremlinDatabaseFuture) UnmarshalJSON(body []byte) error {
2419 var azFuture azure.Future
2420 if err := json.Unmarshal(body, &azFuture); err != nil {
2421 return err
2422 }
2423 future.FutureAPI = &azFuture
2424 future.Result = future.result
2425 return nil
2426 }
2427
2428
2429 func (future *GremlinResourcesDeleteGremlinDatabaseFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) {
2430 var done bool
2431 done, err = future.DoneWithContext(context.Background(), client)
2432 if err != nil {
2433 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinDatabaseFuture", "Result", future.Response(), "Polling failure")
2434 return
2435 }
2436 if !done {
2437 ar.Response = future.Response()
2438 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinDatabaseFuture")
2439 return
2440 }
2441 ar.Response = future.Response()
2442 return
2443 }
2444
2445
2446
2447 type GremlinResourcesDeleteGremlinGraphFuture struct {
2448 azure.FutureAPI
2449
2450
2451 Result func(GremlinResourcesClient) (autorest.Response, error)
2452 }
2453
2454
2455 func (future *GremlinResourcesDeleteGremlinGraphFuture) UnmarshalJSON(body []byte) error {
2456 var azFuture azure.Future
2457 if err := json.Unmarshal(body, &azFuture); err != nil {
2458 return err
2459 }
2460 future.FutureAPI = &azFuture
2461 future.Result = future.result
2462 return nil
2463 }
2464
2465
2466 func (future *GremlinResourcesDeleteGremlinGraphFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) {
2467 var done bool
2468 done, err = future.DoneWithContext(context.Background(), client)
2469 if err != nil {
2470 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinGraphFuture", "Result", future.Response(), "Polling failure")
2471 return
2472 }
2473 if !done {
2474 ar.Response = future.Response()
2475 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinGraphFuture")
2476 return
2477 }
2478 ar.Response = future.Response()
2479 return
2480 }
2481
2482
2483
2484 type GremlinResourcesUpdateGremlinDatabaseThroughputFuture struct {
2485 azure.FutureAPI
2486
2487
2488 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
2489 }
2490
2491
2492 func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) UnmarshalJSON(body []byte) error {
2493 var azFuture azure.Future
2494 if err := json.Unmarshal(body, &azFuture); err != nil {
2495 return err
2496 }
2497 future.FutureAPI = &azFuture
2498 future.Result = future.result
2499 return nil
2500 }
2501
2502
2503 func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
2504 var done bool
2505 done, err = future.DoneWithContext(context.Background(), client)
2506 if err != nil {
2507 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", future.Response(), "Polling failure")
2508 return
2509 }
2510 if !done {
2511 tsgr.Response.Response = future.Response()
2512 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture")
2513 return
2514 }
2515 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2516 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
2517 tsgr, err = client.UpdateGremlinDatabaseThroughputResponder(tsgr.Response.Response)
2518 if err != nil {
2519 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
2520 }
2521 }
2522 return
2523 }
2524
2525
2526
2527 type GremlinResourcesUpdateGremlinGraphThroughputFuture struct {
2528 azure.FutureAPI
2529
2530
2531 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error)
2532 }
2533
2534
2535 func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) UnmarshalJSON(body []byte) error {
2536 var azFuture azure.Future
2537 if err := json.Unmarshal(body, &azFuture); err != nil {
2538 return err
2539 }
2540 future.FutureAPI = &azFuture
2541 future.Result = future.result
2542 return nil
2543 }
2544
2545
2546 func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
2547 var done bool
2548 done, err = future.DoneWithContext(context.Background(), client)
2549 if err != nil {
2550 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", future.Response(), "Polling failure")
2551 return
2552 }
2553 if !done {
2554 tsgr.Response.Response = future.Response()
2555 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture")
2556 return
2557 }
2558 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2559 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
2560 tsgr, err = client.UpdateGremlinGraphThroughputResponder(tsgr.Response.Response)
2561 if err != nil {
2562 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
2563 }
2564 }
2565 return
2566 }
2567
2568
2569 type IncludedPath struct {
2570
2571 Path *string `json:"path,omitempty"`
2572
2573 Indexes *[]Indexes `json:"indexes,omitempty"`
2574 }
2575
2576
2577 type Indexes struct {
2578
2579 DataType DataType `json:"dataType,omitempty"`
2580
2581 Precision *int32 `json:"precision,omitempty"`
2582
2583 Kind IndexKind `json:"kind,omitempty"`
2584 }
2585
2586
2587 type IndexingPolicy struct {
2588
2589 Automatic *bool `json:"automatic,omitempty"`
2590
2591 IndexingMode IndexingMode `json:"indexingMode,omitempty"`
2592
2593 IncludedPaths *[]IncludedPath `json:"includedPaths,omitempty"`
2594
2595 ExcludedPaths *[]ExcludedPath `json:"excludedPaths,omitempty"`
2596
2597 CompositeIndexes *[][]CompositePath `json:"compositeIndexes,omitempty"`
2598
2599 SpatialIndexes *[]SpatialSpec `json:"spatialIndexes,omitempty"`
2600 }
2601
2602
2603 type Location struct {
2604
2605 ID *string `json:"id,omitempty"`
2606
2607 LocationName *string `json:"locationName,omitempty"`
2608
2609 DocumentEndpoint *string `json:"documentEndpoint,omitempty"`
2610 ProvisioningState *string `json:"provisioningState,omitempty"`
2611
2612 FailoverPriority *int32 `json:"failoverPriority,omitempty"`
2613
2614 IsZoneRedundant *bool `json:"isZoneRedundant,omitempty"`
2615 }
2616
2617
2618 func (l Location) MarshalJSON() ([]byte, error) {
2619 objectMap := make(map[string]interface{})
2620 if l.LocationName != nil {
2621 objectMap["locationName"] = l.LocationName
2622 }
2623 if l.ProvisioningState != nil {
2624 objectMap["provisioningState"] = l.ProvisioningState
2625 }
2626 if l.FailoverPriority != nil {
2627 objectMap["failoverPriority"] = l.FailoverPriority
2628 }
2629 if l.IsZoneRedundant != nil {
2630 objectMap["isZoneRedundant"] = l.IsZoneRedundant
2631 }
2632 return json.Marshal(objectMap)
2633 }
2634
2635
2636 type Metric struct {
2637
2638 StartTime *date.Time `json:"startTime,omitempty"`
2639
2640 EndTime *date.Time `json:"endTime,omitempty"`
2641
2642 TimeGrain *string `json:"timeGrain,omitempty"`
2643
2644 Unit UnitType `json:"unit,omitempty"`
2645
2646 Name *MetricName `json:"name,omitempty"`
2647
2648 MetricValues *[]MetricValue `json:"metricValues,omitempty"`
2649 }
2650
2651
2652 func (mVar Metric) MarshalJSON() ([]byte, error) {
2653 objectMap := make(map[string]interface{})
2654 if mVar.Unit != "" {
2655 objectMap["unit"] = mVar.Unit
2656 }
2657 return json.Marshal(objectMap)
2658 }
2659
2660
2661 type MetricAvailability struct {
2662
2663 TimeGrain *string `json:"timeGrain,omitempty"`
2664
2665 Retention *string `json:"retention,omitempty"`
2666 }
2667
2668
2669 func (ma MetricAvailability) MarshalJSON() ([]byte, error) {
2670 objectMap := make(map[string]interface{})
2671 return json.Marshal(objectMap)
2672 }
2673
2674
2675 type MetricDefinition struct {
2676
2677 MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
2678
2679 PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"`
2680
2681 Unit UnitType `json:"unit,omitempty"`
2682
2683 ResourceURI *string `json:"resourceUri,omitempty"`
2684
2685 Name *MetricName `json:"name,omitempty"`
2686 }
2687
2688
2689 func (md MetricDefinition) MarshalJSON() ([]byte, error) {
2690 objectMap := make(map[string]interface{})
2691 if md.Unit != "" {
2692 objectMap["unit"] = md.Unit
2693 }
2694 return json.Marshal(objectMap)
2695 }
2696
2697
2698 type MetricDefinitionsListResult struct {
2699 autorest.Response `json:"-"`
2700
2701 Value *[]MetricDefinition `json:"value,omitempty"`
2702 }
2703
2704
2705 func (mdlr MetricDefinitionsListResult) MarshalJSON() ([]byte, error) {
2706 objectMap := make(map[string]interface{})
2707 return json.Marshal(objectMap)
2708 }
2709
2710
2711 type MetricListResult struct {
2712 autorest.Response `json:"-"`
2713
2714 Value *[]Metric `json:"value,omitempty"`
2715 }
2716
2717
2718 func (mlr MetricListResult) MarshalJSON() ([]byte, error) {
2719 objectMap := make(map[string]interface{})
2720 return json.Marshal(objectMap)
2721 }
2722
2723
2724 type MetricName struct {
2725
2726 Value *string `json:"value,omitempty"`
2727
2728 LocalizedValue *string `json:"localizedValue,omitempty"`
2729 }
2730
2731
2732 func (mn MetricName) MarshalJSON() ([]byte, error) {
2733 objectMap := make(map[string]interface{})
2734 return json.Marshal(objectMap)
2735 }
2736
2737
2738 type MetricValue struct {
2739
2740 Count *float64 `json:"_count,omitempty"`
2741
2742 Average *float64 `json:"average,omitempty"`
2743
2744 Maximum *float64 `json:"maximum,omitempty"`
2745
2746 Minimum *float64 `json:"minimum,omitempty"`
2747
2748 Timestamp *date.Time `json:"timestamp,omitempty"`
2749
2750 Total *float64 `json:"total,omitempty"`
2751 }
2752
2753
2754 func (mv MetricValue) MarshalJSON() ([]byte, error) {
2755 objectMap := make(map[string]interface{})
2756 return json.Marshal(objectMap)
2757 }
2758
2759
2760 type MongoDBCollectionCreateUpdateParameters struct {
2761
2762 *MongoDBCollectionCreateUpdateProperties `json:"properties,omitempty"`
2763
2764 ID *string `json:"id,omitempty"`
2765
2766 Name *string `json:"name,omitempty"`
2767
2768 Type *string `json:"type,omitempty"`
2769
2770 Location *string `json:"location,omitempty"`
2771 Tags map[string]*string `json:"tags"`
2772 }
2773
2774
2775 func (mdccup MongoDBCollectionCreateUpdateParameters) MarshalJSON() ([]byte, error) {
2776 objectMap := make(map[string]interface{})
2777 if mdccup.MongoDBCollectionCreateUpdateProperties != nil {
2778 objectMap["properties"] = mdccup.MongoDBCollectionCreateUpdateProperties
2779 }
2780 if mdccup.Location != nil {
2781 objectMap["location"] = mdccup.Location
2782 }
2783 if mdccup.Tags != nil {
2784 objectMap["tags"] = mdccup.Tags
2785 }
2786 return json.Marshal(objectMap)
2787 }
2788
2789
2790 func (mdccup *MongoDBCollectionCreateUpdateParameters) UnmarshalJSON(body []byte) error {
2791 var m map[string]*json.RawMessage
2792 err := json.Unmarshal(body, &m)
2793 if err != nil {
2794 return err
2795 }
2796 for k, v := range m {
2797 switch k {
2798 case "properties":
2799 if v != nil {
2800 var mongoDBCollectionCreateUpdateProperties MongoDBCollectionCreateUpdateProperties
2801 err = json.Unmarshal(*v, &mongoDBCollectionCreateUpdateProperties)
2802 if err != nil {
2803 return err
2804 }
2805 mdccup.MongoDBCollectionCreateUpdateProperties = &mongoDBCollectionCreateUpdateProperties
2806 }
2807 case "id":
2808 if v != nil {
2809 var ID string
2810 err = json.Unmarshal(*v, &ID)
2811 if err != nil {
2812 return err
2813 }
2814 mdccup.ID = &ID
2815 }
2816 case "name":
2817 if v != nil {
2818 var name string
2819 err = json.Unmarshal(*v, &name)
2820 if err != nil {
2821 return err
2822 }
2823 mdccup.Name = &name
2824 }
2825 case "type":
2826 if v != nil {
2827 var typeVar string
2828 err = json.Unmarshal(*v, &typeVar)
2829 if err != nil {
2830 return err
2831 }
2832 mdccup.Type = &typeVar
2833 }
2834 case "location":
2835 if v != nil {
2836 var location string
2837 err = json.Unmarshal(*v, &location)
2838 if err != nil {
2839 return err
2840 }
2841 mdccup.Location = &location
2842 }
2843 case "tags":
2844 if v != nil {
2845 var tags map[string]*string
2846 err = json.Unmarshal(*v, &tags)
2847 if err != nil {
2848 return err
2849 }
2850 mdccup.Tags = tags
2851 }
2852 }
2853 }
2854
2855 return nil
2856 }
2857
2858
2859
2860 type MongoDBCollectionCreateUpdateProperties struct {
2861
2862 Resource *MongoDBCollectionResource `json:"resource,omitempty"`
2863
2864 Options map[string]*string `json:"options"`
2865 }
2866
2867
2868 func (mdccup MongoDBCollectionCreateUpdateProperties) MarshalJSON() ([]byte, error) {
2869 objectMap := make(map[string]interface{})
2870 if mdccup.Resource != nil {
2871 objectMap["resource"] = mdccup.Resource
2872 }
2873 if mdccup.Options != nil {
2874 objectMap["options"] = mdccup.Options
2875 }
2876 return json.Marshal(objectMap)
2877 }
2878
2879
2880 type MongoDBCollectionGetProperties struct {
2881 Resource *MongoDBCollectionGetPropertiesResource `json:"resource,omitempty"`
2882 }
2883
2884
2885 type MongoDBCollectionGetPropertiesResource struct {
2886
2887 ID *string `json:"id,omitempty"`
2888
2889 ShardKey map[string]*string `json:"shardKey"`
2890
2891 Indexes *[]MongoIndex `json:"indexes,omitempty"`
2892
2893 Rid *string `json:"_rid,omitempty"`
2894
2895 Ts interface{} `json:"_ts,omitempty"`
2896
2897 Etag *string `json:"_etag,omitempty"`
2898 }
2899
2900
2901 func (mdcgp MongoDBCollectionGetPropertiesResource) MarshalJSON() ([]byte, error) {
2902 objectMap := make(map[string]interface{})
2903 if mdcgp.ID != nil {
2904 objectMap["id"] = mdcgp.ID
2905 }
2906 if mdcgp.ShardKey != nil {
2907 objectMap["shardKey"] = mdcgp.ShardKey
2908 }
2909 if mdcgp.Indexes != nil {
2910 objectMap["indexes"] = mdcgp.Indexes
2911 }
2912 return json.Marshal(objectMap)
2913 }
2914
2915
2916 type MongoDBCollectionGetResults struct {
2917 autorest.Response `json:"-"`
2918
2919 *MongoDBCollectionGetProperties `json:"properties,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 (mdcgr MongoDBCollectionGetResults) MarshalJSON() ([]byte, error) {
2933 objectMap := make(map[string]interface{})
2934 if mdcgr.MongoDBCollectionGetProperties != nil {
2935 objectMap["properties"] = mdcgr.MongoDBCollectionGetProperties
2936 }
2937 if mdcgr.Location != nil {
2938 objectMap["location"] = mdcgr.Location
2939 }
2940 if mdcgr.Tags != nil {
2941 objectMap["tags"] = mdcgr.Tags
2942 }
2943 return json.Marshal(objectMap)
2944 }
2945
2946
2947 func (mdcgr *MongoDBCollectionGetResults) UnmarshalJSON(body []byte) error {
2948 var m map[string]*json.RawMessage
2949 err := json.Unmarshal(body, &m)
2950 if err != nil {
2951 return err
2952 }
2953 for k, v := range m {
2954 switch k {
2955 case "properties":
2956 if v != nil {
2957 var mongoDBCollectionGetProperties MongoDBCollectionGetProperties
2958 err = json.Unmarshal(*v, &mongoDBCollectionGetProperties)
2959 if err != nil {
2960 return err
2961 }
2962 mdcgr.MongoDBCollectionGetProperties = &mongoDBCollectionGetProperties
2963 }
2964 case "id":
2965 if v != nil {
2966 var ID string
2967 err = json.Unmarshal(*v, &ID)
2968 if err != nil {
2969 return err
2970 }
2971 mdcgr.ID = &ID
2972 }
2973 case "name":
2974 if v != nil {
2975 var name string
2976 err = json.Unmarshal(*v, &name)
2977 if err != nil {
2978 return err
2979 }
2980 mdcgr.Name = &name
2981 }
2982 case "type":
2983 if v != nil {
2984 var typeVar string
2985 err = json.Unmarshal(*v, &typeVar)
2986 if err != nil {
2987 return err
2988 }
2989 mdcgr.Type = &typeVar
2990 }
2991 case "location":
2992 if v != nil {
2993 var location string
2994 err = json.Unmarshal(*v, &location)
2995 if err != nil {
2996 return err
2997 }
2998 mdcgr.Location = &location
2999 }
3000 case "tags":
3001 if v != nil {
3002 var tags map[string]*string
3003 err = json.Unmarshal(*v, &tags)
3004 if err != nil {
3005 return err
3006 }
3007 mdcgr.Tags = tags
3008 }
3009 }
3010 }
3011
3012 return nil
3013 }
3014
3015
3016
3017 type MongoDBCollectionListResult struct {
3018 autorest.Response `json:"-"`
3019
3020 Value *[]MongoDBCollectionGetResults `json:"value,omitempty"`
3021 }
3022
3023
3024 func (mdclr MongoDBCollectionListResult) MarshalJSON() ([]byte, error) {
3025 objectMap := make(map[string]interface{})
3026 return json.Marshal(objectMap)
3027 }
3028
3029
3030 type MongoDBCollectionResource struct {
3031
3032 ID *string `json:"id,omitempty"`
3033
3034 ShardKey map[string]*string `json:"shardKey"`
3035
3036 Indexes *[]MongoIndex `json:"indexes,omitempty"`
3037 }
3038
3039
3040 func (mdcr MongoDBCollectionResource) MarshalJSON() ([]byte, error) {
3041 objectMap := make(map[string]interface{})
3042 if mdcr.ID != nil {
3043 objectMap["id"] = mdcr.ID
3044 }
3045 if mdcr.ShardKey != nil {
3046 objectMap["shardKey"] = mdcr.ShardKey
3047 }
3048 if mdcr.Indexes != nil {
3049 objectMap["indexes"] = mdcr.Indexes
3050 }
3051 return json.Marshal(objectMap)
3052 }
3053
3054
3055 type MongoDBDatabaseCreateUpdateParameters struct {
3056
3057 *MongoDBDatabaseCreateUpdateProperties `json:"properties,omitempty"`
3058
3059 ID *string `json:"id,omitempty"`
3060
3061 Name *string `json:"name,omitempty"`
3062
3063 Type *string `json:"type,omitempty"`
3064
3065 Location *string `json:"location,omitempty"`
3066 Tags map[string]*string `json:"tags"`
3067 }
3068
3069
3070 func (mddcup MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) {
3071 objectMap := make(map[string]interface{})
3072 if mddcup.MongoDBDatabaseCreateUpdateProperties != nil {
3073 objectMap["properties"] = mddcup.MongoDBDatabaseCreateUpdateProperties
3074 }
3075 if mddcup.Location != nil {
3076 objectMap["location"] = mddcup.Location
3077 }
3078 if mddcup.Tags != nil {
3079 objectMap["tags"] = mddcup.Tags
3080 }
3081 return json.Marshal(objectMap)
3082 }
3083
3084
3085 func (mddcup *MongoDBDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error {
3086 var m map[string]*json.RawMessage
3087 err := json.Unmarshal(body, &m)
3088 if err != nil {
3089 return err
3090 }
3091 for k, v := range m {
3092 switch k {
3093 case "properties":
3094 if v != nil {
3095 var mongoDBDatabaseCreateUpdateProperties MongoDBDatabaseCreateUpdateProperties
3096 err = json.Unmarshal(*v, &mongoDBDatabaseCreateUpdateProperties)
3097 if err != nil {
3098 return err
3099 }
3100 mddcup.MongoDBDatabaseCreateUpdateProperties = &mongoDBDatabaseCreateUpdateProperties
3101 }
3102 case "id":
3103 if v != nil {
3104 var ID string
3105 err = json.Unmarshal(*v, &ID)
3106 if err != nil {
3107 return err
3108 }
3109 mddcup.ID = &ID
3110 }
3111 case "name":
3112 if v != nil {
3113 var name string
3114 err = json.Unmarshal(*v, &name)
3115 if err != nil {
3116 return err
3117 }
3118 mddcup.Name = &name
3119 }
3120 case "type":
3121 if v != nil {
3122 var typeVar string
3123 err = json.Unmarshal(*v, &typeVar)
3124 if err != nil {
3125 return err
3126 }
3127 mddcup.Type = &typeVar
3128 }
3129 case "location":
3130 if v != nil {
3131 var location string
3132 err = json.Unmarshal(*v, &location)
3133 if err != nil {
3134 return err
3135 }
3136 mddcup.Location = &location
3137 }
3138 case "tags":
3139 if v != nil {
3140 var tags map[string]*string
3141 err = json.Unmarshal(*v, &tags)
3142 if err != nil {
3143 return err
3144 }
3145 mddcup.Tags = tags
3146 }
3147 }
3148 }
3149
3150 return nil
3151 }
3152
3153
3154 type MongoDBDatabaseCreateUpdateProperties struct {
3155
3156 Resource *MongoDBDatabaseResource `json:"resource,omitempty"`
3157
3158 Options map[string]*string `json:"options"`
3159 }
3160
3161
3162 func (mddcup MongoDBDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error) {
3163 objectMap := make(map[string]interface{})
3164 if mddcup.Resource != nil {
3165 objectMap["resource"] = mddcup.Resource
3166 }
3167 if mddcup.Options != nil {
3168 objectMap["options"] = mddcup.Options
3169 }
3170 return json.Marshal(objectMap)
3171 }
3172
3173
3174 type MongoDBDatabaseGetProperties struct {
3175 Resource *MongoDBDatabaseGetPropertiesResource `json:"resource,omitempty"`
3176 }
3177
3178
3179 type MongoDBDatabaseGetPropertiesResource struct {
3180
3181 ID *string `json:"id,omitempty"`
3182
3183 Rid *string `json:"_rid,omitempty"`
3184
3185 Ts interface{} `json:"_ts,omitempty"`
3186
3187 Etag *string `json:"_etag,omitempty"`
3188 }
3189
3190
3191 func (mddgp MongoDBDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) {
3192 objectMap := make(map[string]interface{})
3193 if mddgp.ID != nil {
3194 objectMap["id"] = mddgp.ID
3195 }
3196 return json.Marshal(objectMap)
3197 }
3198
3199
3200 type MongoDBDatabaseGetResults struct {
3201 autorest.Response `json:"-"`
3202
3203 *MongoDBDatabaseGetProperties `json:"properties,omitempty"`
3204
3205 ID *string `json:"id,omitempty"`
3206
3207 Name *string `json:"name,omitempty"`
3208
3209 Type *string `json:"type,omitempty"`
3210
3211 Location *string `json:"location,omitempty"`
3212 Tags map[string]*string `json:"tags"`
3213 }
3214
3215
3216 func (mddgr MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) {
3217 objectMap := make(map[string]interface{})
3218 if mddgr.MongoDBDatabaseGetProperties != nil {
3219 objectMap["properties"] = mddgr.MongoDBDatabaseGetProperties
3220 }
3221 if mddgr.Location != nil {
3222 objectMap["location"] = mddgr.Location
3223 }
3224 if mddgr.Tags != nil {
3225 objectMap["tags"] = mddgr.Tags
3226 }
3227 return json.Marshal(objectMap)
3228 }
3229
3230
3231 func (mddgr *MongoDBDatabaseGetResults) UnmarshalJSON(body []byte) error {
3232 var m map[string]*json.RawMessage
3233 err := json.Unmarshal(body, &m)
3234 if err != nil {
3235 return err
3236 }
3237 for k, v := range m {
3238 switch k {
3239 case "properties":
3240 if v != nil {
3241 var mongoDBDatabaseGetProperties MongoDBDatabaseGetProperties
3242 err = json.Unmarshal(*v, &mongoDBDatabaseGetProperties)
3243 if err != nil {
3244 return err
3245 }
3246 mddgr.MongoDBDatabaseGetProperties = &mongoDBDatabaseGetProperties
3247 }
3248 case "id":
3249 if v != nil {
3250 var ID string
3251 err = json.Unmarshal(*v, &ID)
3252 if err != nil {
3253 return err
3254 }
3255 mddgr.ID = &ID
3256 }
3257 case "name":
3258 if v != nil {
3259 var name string
3260 err = json.Unmarshal(*v, &name)
3261 if err != nil {
3262 return err
3263 }
3264 mddgr.Name = &name
3265 }
3266 case "type":
3267 if v != nil {
3268 var typeVar string
3269 err = json.Unmarshal(*v, &typeVar)
3270 if err != nil {
3271 return err
3272 }
3273 mddgr.Type = &typeVar
3274 }
3275 case "location":
3276 if v != nil {
3277 var location string
3278 err = json.Unmarshal(*v, &location)
3279 if err != nil {
3280 return err
3281 }
3282 mddgr.Location = &location
3283 }
3284 case "tags":
3285 if v != nil {
3286 var tags map[string]*string
3287 err = json.Unmarshal(*v, &tags)
3288 if err != nil {
3289 return err
3290 }
3291 mddgr.Tags = tags
3292 }
3293 }
3294 }
3295
3296 return nil
3297 }
3298
3299
3300
3301 type MongoDBDatabaseListResult struct {
3302 autorest.Response `json:"-"`
3303
3304 Value *[]MongoDBDatabaseGetResults `json:"value,omitempty"`
3305 }
3306
3307
3308 func (mddlr MongoDBDatabaseListResult) MarshalJSON() ([]byte, error) {
3309 objectMap := make(map[string]interface{})
3310 return json.Marshal(objectMap)
3311 }
3312
3313
3314 type MongoDBDatabaseResource struct {
3315
3316 ID *string `json:"id,omitempty"`
3317 }
3318
3319
3320
3321 type MongoDBResourcesCreateUpdateMongoDBCollectionFuture struct {
3322 azure.FutureAPI
3323
3324
3325 Result func(MongoDBResourcesClient) (MongoDBCollectionGetResults, error)
3326 }
3327
3328
3329 func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) UnmarshalJSON(body []byte) error {
3330 var azFuture azure.Future
3331 if err := json.Unmarshal(body, &azFuture); err != nil {
3332 return err
3333 }
3334 future.FutureAPI = &azFuture
3335 future.Result = future.result
3336 return nil
3337 }
3338
3339
3340 func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) result(client MongoDBResourcesClient) (mdcgr MongoDBCollectionGetResults, err error) {
3341 var done bool
3342 done, err = future.DoneWithContext(context.Background(), client)
3343 if err != nil {
3344 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", future.Response(), "Polling failure")
3345 return
3346 }
3347 if !done {
3348 mdcgr.Response.Response = future.Response()
3349 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture")
3350 return
3351 }
3352 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3353 if mdcgr.Response.Response, err = future.GetResult(sender); err == nil && mdcgr.Response.Response.StatusCode != http.StatusNoContent {
3354 mdcgr, err = client.CreateUpdateMongoDBCollectionResponder(mdcgr.Response.Response)
3355 if err != nil {
3356 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", mdcgr.Response.Response, "Failure responding to request")
3357 }
3358 }
3359 return
3360 }
3361
3362
3363
3364 type MongoDBResourcesCreateUpdateMongoDBDatabaseFuture struct {
3365 azure.FutureAPI
3366
3367
3368 Result func(MongoDBResourcesClient) (MongoDBDatabaseGetResults, error)
3369 }
3370
3371
3372 func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error {
3373 var azFuture azure.Future
3374 if err := json.Unmarshal(body, &azFuture); err != nil {
3375 return err
3376 }
3377 future.FutureAPI = &azFuture
3378 future.Result = future.result
3379 return nil
3380 }
3381
3382
3383 func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (mddgr MongoDBDatabaseGetResults, err error) {
3384 var done bool
3385 done, err = future.DoneWithContext(context.Background(), client)
3386 if err != nil {
3387 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure")
3388 return
3389 }
3390 if !done {
3391 mddgr.Response.Response = future.Response()
3392 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture")
3393 return
3394 }
3395 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3396 if mddgr.Response.Response, err = future.GetResult(sender); err == nil && mddgr.Response.Response.StatusCode != http.StatusNoContent {
3397 mddgr, err = client.CreateUpdateMongoDBDatabaseResponder(mddgr.Response.Response)
3398 if err != nil {
3399 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", mddgr.Response.Response, "Failure responding to request")
3400 }
3401 }
3402 return
3403 }
3404
3405
3406
3407 type MongoDBResourcesDeleteMongoDBCollectionFuture struct {
3408 azure.FutureAPI
3409
3410
3411 Result func(MongoDBResourcesClient) (autorest.Response, error)
3412 }
3413
3414
3415 func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) UnmarshalJSON(body []byte) error {
3416 var azFuture azure.Future
3417 if err := json.Unmarshal(body, &azFuture); err != nil {
3418 return err
3419 }
3420 future.FutureAPI = &azFuture
3421 future.Result = future.result
3422 return nil
3423 }
3424
3425
3426 func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) {
3427 var done bool
3428 done, err = future.DoneWithContext(context.Background(), client)
3429 if err != nil {
3430 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture", "Result", future.Response(), "Polling failure")
3431 return
3432 }
3433 if !done {
3434 ar.Response = future.Response()
3435 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture")
3436 return
3437 }
3438 ar.Response = future.Response()
3439 return
3440 }
3441
3442
3443
3444 type MongoDBResourcesDeleteMongoDBDatabaseFuture struct {
3445 azure.FutureAPI
3446
3447
3448 Result func(MongoDBResourcesClient) (autorest.Response, error)
3449 }
3450
3451
3452 func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error {
3453 var azFuture azure.Future
3454 if err := json.Unmarshal(body, &azFuture); err != nil {
3455 return err
3456 }
3457 future.FutureAPI = &azFuture
3458 future.Result = future.result
3459 return nil
3460 }
3461
3462
3463 func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) {
3464 var done bool
3465 done, err = future.DoneWithContext(context.Background(), client)
3466 if err != nil {
3467 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure")
3468 return
3469 }
3470 if !done {
3471 ar.Response = future.Response()
3472 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture")
3473 return
3474 }
3475 ar.Response = future.Response()
3476 return
3477 }
3478
3479
3480
3481 type MongoDBResourcesUpdateMongoDBCollectionThroughputFuture struct {
3482 azure.FutureAPI
3483
3484
3485 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
3486 }
3487
3488
3489 func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) UnmarshalJSON(body []byte) error {
3490 var azFuture azure.Future
3491 if err := json.Unmarshal(body, &azFuture); err != nil {
3492 return err
3493 }
3494 future.FutureAPI = &azFuture
3495 future.Result = future.result
3496 return nil
3497 }
3498
3499
3500 func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
3501 var done bool
3502 done, err = future.DoneWithContext(context.Background(), client)
3503 if err != nil {
3504 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", future.Response(), "Polling failure")
3505 return
3506 }
3507 if !done {
3508 tsgr.Response.Response = future.Response()
3509 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture")
3510 return
3511 }
3512 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3513 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
3514 tsgr, err = client.UpdateMongoDBCollectionThroughputResponder(tsgr.Response.Response)
3515 if err != nil {
3516 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
3517 }
3518 }
3519 return
3520 }
3521
3522
3523
3524 type MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture struct {
3525 azure.FutureAPI
3526
3527
3528 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error)
3529 }
3530
3531
3532 func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) UnmarshalJSON(body []byte) error {
3533 var azFuture azure.Future
3534 if err := json.Unmarshal(body, &azFuture); err != nil {
3535 return err
3536 }
3537 future.FutureAPI = &azFuture
3538 future.Result = future.result
3539 return nil
3540 }
3541
3542
3543 func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
3544 var done bool
3545 done, err = future.DoneWithContext(context.Background(), client)
3546 if err != nil {
3547 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", future.Response(), "Polling failure")
3548 return
3549 }
3550 if !done {
3551 tsgr.Response.Response = future.Response()
3552 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture")
3553 return
3554 }
3555 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3556 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
3557 tsgr, err = client.UpdateMongoDBDatabaseThroughputResponder(tsgr.Response.Response)
3558 if err != nil {
3559 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
3560 }
3561 }
3562 return
3563 }
3564
3565
3566 type MongoIndex struct {
3567
3568 Key *MongoIndexKeys `json:"key,omitempty"`
3569
3570 Options *MongoIndexOptions `json:"options,omitempty"`
3571 }
3572
3573
3574 type MongoIndexKeys struct {
3575
3576 Keys *[]string `json:"keys,omitempty"`
3577 }
3578
3579
3580 type MongoIndexOptions struct {
3581
3582 ExpireAfterSeconds *int32 `json:"expireAfterSeconds,omitempty"`
3583
3584 Unique *bool `json:"unique,omitempty"`
3585 }
3586
3587
3588 type NotebookWorkspace struct {
3589 autorest.Response `json:"-"`
3590
3591 *NotebookWorkspaceProperties `json:"properties,omitempty"`
3592
3593 ID *string `json:"id,omitempty"`
3594
3595 Name *string `json:"name,omitempty"`
3596
3597 Type *string `json:"type,omitempty"`
3598 }
3599
3600
3601 func (nw NotebookWorkspace) MarshalJSON() ([]byte, error) {
3602 objectMap := make(map[string]interface{})
3603 if nw.NotebookWorkspaceProperties != nil {
3604 objectMap["properties"] = nw.NotebookWorkspaceProperties
3605 }
3606 return json.Marshal(objectMap)
3607 }
3608
3609
3610 func (nw *NotebookWorkspace) UnmarshalJSON(body []byte) error {
3611 var m map[string]*json.RawMessage
3612 err := json.Unmarshal(body, &m)
3613 if err != nil {
3614 return err
3615 }
3616 for k, v := range m {
3617 switch k {
3618 case "properties":
3619 if v != nil {
3620 var notebookWorkspaceProperties NotebookWorkspaceProperties
3621 err = json.Unmarshal(*v, ¬ebookWorkspaceProperties)
3622 if err != nil {
3623 return err
3624 }
3625 nw.NotebookWorkspaceProperties = ¬ebookWorkspaceProperties
3626 }
3627 case "id":
3628 if v != nil {
3629 var ID string
3630 err = json.Unmarshal(*v, &ID)
3631 if err != nil {
3632 return err
3633 }
3634 nw.ID = &ID
3635 }
3636 case "name":
3637 if v != nil {
3638 var name string
3639 err = json.Unmarshal(*v, &name)
3640 if err != nil {
3641 return err
3642 }
3643 nw.Name = &name
3644 }
3645 case "type":
3646 if v != nil {
3647 var typeVar string
3648 err = json.Unmarshal(*v, &typeVar)
3649 if err != nil {
3650 return err
3651 }
3652 nw.Type = &typeVar
3653 }
3654 }
3655 }
3656
3657 return nil
3658 }
3659
3660
3661 type NotebookWorkspaceConnectionInfoResult struct {
3662 autorest.Response `json:"-"`
3663
3664 AuthToken *string `json:"authToken,omitempty"`
3665
3666 NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"`
3667 }
3668
3669
3670 func (nwcir NotebookWorkspaceConnectionInfoResult) MarshalJSON() ([]byte, error) {
3671 objectMap := make(map[string]interface{})
3672 return json.Marshal(objectMap)
3673 }
3674
3675
3676 type NotebookWorkspaceCreateUpdateParameters struct {
3677
3678 ID *string `json:"id,omitempty"`
3679
3680 Name *string `json:"name,omitempty"`
3681
3682 Type *string `json:"type,omitempty"`
3683 }
3684
3685
3686 func (nwcup NotebookWorkspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) {
3687 objectMap := make(map[string]interface{})
3688 return json.Marshal(objectMap)
3689 }
3690
3691
3692 type NotebookWorkspaceListResult struct {
3693 autorest.Response `json:"-"`
3694
3695 Value *[]NotebookWorkspace `json:"value,omitempty"`
3696 }
3697
3698
3699 type NotebookWorkspaceProperties struct {
3700
3701 NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"`
3702
3703 Status *string `json:"status,omitempty"`
3704 }
3705
3706
3707 func (nwp NotebookWorkspaceProperties) MarshalJSON() ([]byte, error) {
3708 objectMap := make(map[string]interface{})
3709 return json.Marshal(objectMap)
3710 }
3711
3712
3713
3714 type NotebookWorkspacesCreateOrUpdateFuture struct {
3715 azure.FutureAPI
3716
3717
3718 Result func(NotebookWorkspacesClient) (NotebookWorkspace, error)
3719 }
3720
3721
3722 func (future *NotebookWorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
3723 var azFuture azure.Future
3724 if err := json.Unmarshal(body, &azFuture); err != nil {
3725 return err
3726 }
3727 future.FutureAPI = &azFuture
3728 future.Result = future.result
3729 return nil
3730 }
3731
3732
3733 func (future *NotebookWorkspacesCreateOrUpdateFuture) result(client NotebookWorkspacesClient) (nw NotebookWorkspace, err error) {
3734 var done bool
3735 done, err = future.DoneWithContext(context.Background(), client)
3736 if err != nil {
3737 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
3738 return
3739 }
3740 if !done {
3741 nw.Response.Response = future.Response()
3742 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesCreateOrUpdateFuture")
3743 return
3744 }
3745 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3746 if nw.Response.Response, err = future.GetResult(sender); err == nil && nw.Response.Response.StatusCode != http.StatusNoContent {
3747 nw, err = client.CreateOrUpdateResponder(nw.Response.Response)
3748 if err != nil {
3749 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", nw.Response.Response, "Failure responding to request")
3750 }
3751 }
3752 return
3753 }
3754
3755
3756
3757 type NotebookWorkspacesDeleteFuture struct {
3758 azure.FutureAPI
3759
3760
3761 Result func(NotebookWorkspacesClient) (autorest.Response, error)
3762 }
3763
3764
3765 func (future *NotebookWorkspacesDeleteFuture) UnmarshalJSON(body []byte) error {
3766 var azFuture azure.Future
3767 if err := json.Unmarshal(body, &azFuture); err != nil {
3768 return err
3769 }
3770 future.FutureAPI = &azFuture
3771 future.Result = future.result
3772 return nil
3773 }
3774
3775
3776 func (future *NotebookWorkspacesDeleteFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) {
3777 var done bool
3778 done, err = future.DoneWithContext(context.Background(), client)
3779 if err != nil {
3780 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesDeleteFuture", "Result", future.Response(), "Polling failure")
3781 return
3782 }
3783 if !done {
3784 ar.Response = future.Response()
3785 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesDeleteFuture")
3786 return
3787 }
3788 ar.Response = future.Response()
3789 return
3790 }
3791
3792
3793
3794 type NotebookWorkspacesRegenerateAuthTokenFuture struct {
3795 azure.FutureAPI
3796
3797
3798 Result func(NotebookWorkspacesClient) (autorest.Response, error)
3799 }
3800
3801
3802 func (future *NotebookWorkspacesRegenerateAuthTokenFuture) UnmarshalJSON(body []byte) error {
3803 var azFuture azure.Future
3804 if err := json.Unmarshal(body, &azFuture); err != nil {
3805 return err
3806 }
3807 future.FutureAPI = &azFuture
3808 future.Result = future.result
3809 return nil
3810 }
3811
3812
3813 func (future *NotebookWorkspacesRegenerateAuthTokenFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) {
3814 var done bool
3815 done, err = future.DoneWithContext(context.Background(), client)
3816 if err != nil {
3817 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesRegenerateAuthTokenFuture", "Result", future.Response(), "Polling failure")
3818 return
3819 }
3820 if !done {
3821 ar.Response = future.Response()
3822 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesRegenerateAuthTokenFuture")
3823 return
3824 }
3825 ar.Response = future.Response()
3826 return
3827 }
3828
3829
3830
3831 type NotebookWorkspacesStartFuture struct {
3832 azure.FutureAPI
3833
3834
3835 Result func(NotebookWorkspacesClient) (autorest.Response, error)
3836 }
3837
3838
3839 func (future *NotebookWorkspacesStartFuture) UnmarshalJSON(body []byte) error {
3840 var azFuture azure.Future
3841 if err := json.Unmarshal(body, &azFuture); err != nil {
3842 return err
3843 }
3844 future.FutureAPI = &azFuture
3845 future.Result = future.result
3846 return nil
3847 }
3848
3849
3850 func (future *NotebookWorkspacesStartFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) {
3851 var done bool
3852 done, err = future.DoneWithContext(context.Background(), client)
3853 if err != nil {
3854 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesStartFuture", "Result", future.Response(), "Polling failure")
3855 return
3856 }
3857 if !done {
3858 ar.Response = future.Response()
3859 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesStartFuture")
3860 return
3861 }
3862 ar.Response = future.Response()
3863 return
3864 }
3865
3866
3867 type Operation struct {
3868
3869 Name *string `json:"name,omitempty"`
3870
3871 Display *OperationDisplay `json:"display,omitempty"`
3872 }
3873
3874
3875 type OperationDisplay struct {
3876
3877 Provider *string `json:"Provider,omitempty"`
3878
3879 Resource *string `json:"Resource,omitempty"`
3880
3881 Operation *string `json:"Operation,omitempty"`
3882
3883 Description *string `json:"Description,omitempty"`
3884 }
3885
3886
3887
3888 type OperationListResult struct {
3889 autorest.Response `json:"-"`
3890
3891 Value *[]Operation `json:"value,omitempty"`
3892
3893 NextLink *string `json:"nextLink,omitempty"`
3894 }
3895
3896
3897 type OperationListResultIterator struct {
3898 i int
3899 page OperationListResultPage
3900 }
3901
3902
3903
3904 func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
3905 if tracing.IsEnabled() {
3906 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
3907 defer func() {
3908 sc := -1
3909 if iter.Response().Response.Response != nil {
3910 sc = iter.Response().Response.Response.StatusCode
3911 }
3912 tracing.EndSpan(ctx, sc, err)
3913 }()
3914 }
3915 iter.i++
3916 if iter.i < len(iter.page.Values()) {
3917 return nil
3918 }
3919 err = iter.page.NextWithContext(ctx)
3920 if err != nil {
3921 iter.i--
3922 return err
3923 }
3924 iter.i = 0
3925 return nil
3926 }
3927
3928
3929
3930
3931 func (iter *OperationListResultIterator) Next() error {
3932 return iter.NextWithContext(context.Background())
3933 }
3934
3935
3936 func (iter OperationListResultIterator) NotDone() bool {
3937 return iter.page.NotDone() && iter.i < len(iter.page.Values())
3938 }
3939
3940
3941 func (iter OperationListResultIterator) Response() OperationListResult {
3942 return iter.page.Response()
3943 }
3944
3945
3946
3947 func (iter OperationListResultIterator) Value() Operation {
3948 if !iter.page.NotDone() {
3949 return Operation{}
3950 }
3951 return iter.page.Values()[iter.i]
3952 }
3953
3954
3955 func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
3956 return OperationListResultIterator{page: page}
3957 }
3958
3959
3960 func (olr OperationListResult) IsEmpty() bool {
3961 return olr.Value == nil || len(*olr.Value) == 0
3962 }
3963
3964
3965 func (olr OperationListResult) hasNextLink() bool {
3966 return olr.NextLink != nil && len(*olr.NextLink) != 0
3967 }
3968
3969
3970
3971 func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
3972 if !olr.hasNextLink() {
3973 return nil, nil
3974 }
3975 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3976 autorest.AsJSON(),
3977 autorest.AsGet(),
3978 autorest.WithBaseURL(to.String(olr.NextLink)))
3979 }
3980
3981
3982 type OperationListResultPage struct {
3983 fn func(context.Context, OperationListResult) (OperationListResult, error)
3984 olr OperationListResult
3985 }
3986
3987
3988
3989 func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
3990 if tracing.IsEnabled() {
3991 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
3992 defer func() {
3993 sc := -1
3994 if page.Response().Response.Response != nil {
3995 sc = page.Response().Response.Response.StatusCode
3996 }
3997 tracing.EndSpan(ctx, sc, err)
3998 }()
3999 }
4000 for {
4001 next, err := page.fn(ctx, page.olr)
4002 if err != nil {
4003 return err
4004 }
4005 page.olr = next
4006 if !next.hasNextLink() || !next.IsEmpty() {
4007 break
4008 }
4009 }
4010 return nil
4011 }
4012
4013
4014
4015
4016 func (page *OperationListResultPage) Next() error {
4017 return page.NextWithContext(context.Background())
4018 }
4019
4020
4021 func (page OperationListResultPage) NotDone() bool {
4022 return !page.olr.IsEmpty()
4023 }
4024
4025
4026 func (page OperationListResultPage) Response() OperationListResult {
4027 return page.olr
4028 }
4029
4030
4031 func (page OperationListResultPage) Values() []Operation {
4032 if page.olr.IsEmpty() {
4033 return nil
4034 }
4035 return *page.olr.Value
4036 }
4037
4038
4039 func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
4040 return OperationListResultPage{
4041 fn: getNextPage,
4042 olr: cur,
4043 }
4044 }
4045
4046
4047 type PartitionMetric struct {
4048
4049 PartitionID *string `json:"partitionId,omitempty"`
4050
4051 PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"`
4052
4053 StartTime *date.Time `json:"startTime,omitempty"`
4054
4055 EndTime *date.Time `json:"endTime,omitempty"`
4056
4057 TimeGrain *string `json:"timeGrain,omitempty"`
4058
4059 Unit UnitType `json:"unit,omitempty"`
4060
4061 Name *MetricName `json:"name,omitempty"`
4062
4063 MetricValues *[]MetricValue `json:"metricValues,omitempty"`
4064 }
4065
4066
4067 func (pm PartitionMetric) MarshalJSON() ([]byte, error) {
4068 objectMap := make(map[string]interface{})
4069 if pm.Unit != "" {
4070 objectMap["unit"] = pm.Unit
4071 }
4072 return json.Marshal(objectMap)
4073 }
4074
4075
4076 type PartitionMetricListResult struct {
4077 autorest.Response `json:"-"`
4078
4079 Value *[]PartitionMetric `json:"value,omitempty"`
4080 }
4081
4082
4083 func (pmlr PartitionMetricListResult) MarshalJSON() ([]byte, error) {
4084 objectMap := make(map[string]interface{})
4085 return json.Marshal(objectMap)
4086 }
4087
4088
4089 type PartitionUsage struct {
4090
4091 PartitionID *string `json:"partitionId,omitempty"`
4092
4093 PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"`
4094
4095 Unit UnitType `json:"unit,omitempty"`
4096
4097 Name *MetricName `json:"name,omitempty"`
4098
4099 QuotaPeriod *string `json:"quotaPeriod,omitempty"`
4100
4101 Limit *int64 `json:"limit,omitempty"`
4102
4103 CurrentValue *int64 `json:"currentValue,omitempty"`
4104 }
4105
4106
4107 func (pu PartitionUsage) MarshalJSON() ([]byte, error) {
4108 objectMap := make(map[string]interface{})
4109 if pu.Unit != "" {
4110 objectMap["unit"] = pu.Unit
4111 }
4112 return json.Marshal(objectMap)
4113 }
4114
4115
4116 type PartitionUsagesResult struct {
4117 autorest.Response `json:"-"`
4118
4119 Value *[]PartitionUsage `json:"value,omitempty"`
4120 }
4121
4122
4123 func (pur PartitionUsagesResult) MarshalJSON() ([]byte, error) {
4124 objectMap := make(map[string]interface{})
4125 return json.Marshal(objectMap)
4126 }
4127
4128
4129 type PercentileMetric struct {
4130
4131 StartTime *date.Time `json:"startTime,omitempty"`
4132
4133 EndTime *date.Time `json:"endTime,omitempty"`
4134
4135 TimeGrain *string `json:"timeGrain,omitempty"`
4136
4137 Unit UnitType `json:"unit,omitempty"`
4138
4139 Name *MetricName `json:"name,omitempty"`
4140
4141 MetricValues *[]PercentileMetricValue `json:"metricValues,omitempty"`
4142 }
4143
4144
4145 func (pm PercentileMetric) MarshalJSON() ([]byte, error) {
4146 objectMap := make(map[string]interface{})
4147 if pm.Unit != "" {
4148 objectMap["unit"] = pm.Unit
4149 }
4150 return json.Marshal(objectMap)
4151 }
4152
4153
4154 type PercentileMetricListResult struct {
4155 autorest.Response `json:"-"`
4156
4157 Value *[]PercentileMetric `json:"value,omitempty"`
4158 }
4159
4160
4161 func (pmlr PercentileMetricListResult) MarshalJSON() ([]byte, error) {
4162 objectMap := make(map[string]interface{})
4163 return json.Marshal(objectMap)
4164 }
4165
4166
4167 type PercentileMetricValue struct {
4168
4169 P10 *float64 `json:"P10,omitempty"`
4170
4171 P25 *float64 `json:"P25,omitempty"`
4172
4173 P50 *float64 `json:"P50,omitempty"`
4174
4175 P75 *float64 `json:"P75,omitempty"`
4176
4177 P90 *float64 `json:"P90,omitempty"`
4178
4179 P95 *float64 `json:"P95,omitempty"`
4180
4181 P99 *float64 `json:"P99,omitempty"`
4182
4183 Count *float64 `json:"_count,omitempty"`
4184
4185 Average *float64 `json:"average,omitempty"`
4186
4187 Maximum *float64 `json:"maximum,omitempty"`
4188
4189 Minimum *float64 `json:"minimum,omitempty"`
4190
4191 Timestamp *date.Time `json:"timestamp,omitempty"`
4192
4193 Total *float64 `json:"total,omitempty"`
4194 }
4195
4196
4197 func (pmv PercentileMetricValue) MarshalJSON() ([]byte, error) {
4198 objectMap := make(map[string]interface{})
4199 return json.Marshal(objectMap)
4200 }
4201
4202
4203 type RegionForOnlineOffline struct {
4204
4205 Region *string `json:"region,omitempty"`
4206 }
4207
4208
4209 type SpatialSpec struct {
4210
4211 Path *string `json:"path,omitempty"`
4212
4213 Types *[]SpatialType `json:"types,omitempty"`
4214 }
4215
4216
4217 type SQLContainerCreateUpdateParameters struct {
4218
4219 *SQLContainerCreateUpdateProperties `json:"properties,omitempty"`
4220
4221 ID *string `json:"id,omitempty"`
4222
4223 Name *string `json:"name,omitempty"`
4224
4225 Type *string `json:"type,omitempty"`
4226
4227 Location *string `json:"location,omitempty"`
4228 Tags map[string]*string `json:"tags"`
4229 }
4230
4231
4232 func (sccup SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) {
4233 objectMap := make(map[string]interface{})
4234 if sccup.SQLContainerCreateUpdateProperties != nil {
4235 objectMap["properties"] = sccup.SQLContainerCreateUpdateProperties
4236 }
4237 if sccup.Location != nil {
4238 objectMap["location"] = sccup.Location
4239 }
4240 if sccup.Tags != nil {
4241 objectMap["tags"] = sccup.Tags
4242 }
4243 return json.Marshal(objectMap)
4244 }
4245
4246
4247 func (sccup *SQLContainerCreateUpdateParameters) UnmarshalJSON(body []byte) error {
4248 var m map[string]*json.RawMessage
4249 err := json.Unmarshal(body, &m)
4250 if err != nil {
4251 return err
4252 }
4253 for k, v := range m {
4254 switch k {
4255 case "properties":
4256 if v != nil {
4257 var SQLContainerCreateUpdateProperties SQLContainerCreateUpdateProperties
4258 err = json.Unmarshal(*v, &SQLContainerCreateUpdateProperties)
4259 if err != nil {
4260 return err
4261 }
4262 sccup.SQLContainerCreateUpdateProperties = &SQLContainerCreateUpdateProperties
4263 }
4264 case "id":
4265 if v != nil {
4266 var ID string
4267 err = json.Unmarshal(*v, &ID)
4268 if err != nil {
4269 return err
4270 }
4271 sccup.ID = &ID
4272 }
4273 case "name":
4274 if v != nil {
4275 var name string
4276 err = json.Unmarshal(*v, &name)
4277 if err != nil {
4278 return err
4279 }
4280 sccup.Name = &name
4281 }
4282 case "type":
4283 if v != nil {
4284 var typeVar string
4285 err = json.Unmarshal(*v, &typeVar)
4286 if err != nil {
4287 return err
4288 }
4289 sccup.Type = &typeVar
4290 }
4291 case "location":
4292 if v != nil {
4293 var location string
4294 err = json.Unmarshal(*v, &location)
4295 if err != nil {
4296 return err
4297 }
4298 sccup.Location = &location
4299 }
4300 case "tags":
4301 if v != nil {
4302 var tags map[string]*string
4303 err = json.Unmarshal(*v, &tags)
4304 if err != nil {
4305 return err
4306 }
4307 sccup.Tags = tags
4308 }
4309 }
4310 }
4311
4312 return nil
4313 }
4314
4315
4316 type SQLContainerCreateUpdateProperties struct {
4317
4318 Resource *SQLContainerResource `json:"resource,omitempty"`
4319
4320 Options map[string]*string `json:"options"`
4321 }
4322
4323
4324 func (sccup SQLContainerCreateUpdateProperties) MarshalJSON() ([]byte, error) {
4325 objectMap := make(map[string]interface{})
4326 if sccup.Resource != nil {
4327 objectMap["resource"] = sccup.Resource
4328 }
4329 if sccup.Options != nil {
4330 objectMap["options"] = sccup.Options
4331 }
4332 return json.Marshal(objectMap)
4333 }
4334
4335
4336 type SQLContainerGetProperties struct {
4337 Resource *SQLContainerGetPropertiesResource `json:"resource,omitempty"`
4338 }
4339
4340
4341 type SQLContainerGetPropertiesResource struct {
4342
4343 ID *string `json:"id,omitempty"`
4344
4345 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
4346
4347 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
4348
4349 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
4350
4351 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
4352
4353 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
4354
4355 Rid *string `json:"_rid,omitempty"`
4356
4357 Ts interface{} `json:"_ts,omitempty"`
4358
4359 Etag *string `json:"_etag,omitempty"`
4360 }
4361
4362
4363 func (scgp SQLContainerGetPropertiesResource) MarshalJSON() ([]byte, error) {
4364 objectMap := make(map[string]interface{})
4365 if scgp.ID != nil {
4366 objectMap["id"] = scgp.ID
4367 }
4368 if scgp.IndexingPolicy != nil {
4369 objectMap["indexingPolicy"] = scgp.IndexingPolicy
4370 }
4371 if scgp.PartitionKey != nil {
4372 objectMap["partitionKey"] = scgp.PartitionKey
4373 }
4374 if scgp.DefaultTTL != nil {
4375 objectMap["defaultTtl"] = scgp.DefaultTTL
4376 }
4377 if scgp.UniqueKeyPolicy != nil {
4378 objectMap["uniqueKeyPolicy"] = scgp.UniqueKeyPolicy
4379 }
4380 if scgp.ConflictResolutionPolicy != nil {
4381 objectMap["conflictResolutionPolicy"] = scgp.ConflictResolutionPolicy
4382 }
4383 return json.Marshal(objectMap)
4384 }
4385
4386
4387 type SQLContainerGetResults struct {
4388 autorest.Response `json:"-"`
4389
4390 *SQLContainerGetProperties `json:"properties,omitempty"`
4391
4392 ID *string `json:"id,omitempty"`
4393
4394 Name *string `json:"name,omitempty"`
4395
4396 Type *string `json:"type,omitempty"`
4397
4398 Location *string `json:"location,omitempty"`
4399 Tags map[string]*string `json:"tags"`
4400 }
4401
4402
4403 func (scgr SQLContainerGetResults) MarshalJSON() ([]byte, error) {
4404 objectMap := make(map[string]interface{})
4405 if scgr.SQLContainerGetProperties != nil {
4406 objectMap["properties"] = scgr.SQLContainerGetProperties
4407 }
4408 if scgr.Location != nil {
4409 objectMap["location"] = scgr.Location
4410 }
4411 if scgr.Tags != nil {
4412 objectMap["tags"] = scgr.Tags
4413 }
4414 return json.Marshal(objectMap)
4415 }
4416
4417
4418 func (scgr *SQLContainerGetResults) UnmarshalJSON(body []byte) error {
4419 var m map[string]*json.RawMessage
4420 err := json.Unmarshal(body, &m)
4421 if err != nil {
4422 return err
4423 }
4424 for k, v := range m {
4425 switch k {
4426 case "properties":
4427 if v != nil {
4428 var SQLContainerGetProperties SQLContainerGetProperties
4429 err = json.Unmarshal(*v, &SQLContainerGetProperties)
4430 if err != nil {
4431 return err
4432 }
4433 scgr.SQLContainerGetProperties = &SQLContainerGetProperties
4434 }
4435 case "id":
4436 if v != nil {
4437 var ID string
4438 err = json.Unmarshal(*v, &ID)
4439 if err != nil {
4440 return err
4441 }
4442 scgr.ID = &ID
4443 }
4444 case "name":
4445 if v != nil {
4446 var name string
4447 err = json.Unmarshal(*v, &name)
4448 if err != nil {
4449 return err
4450 }
4451 scgr.Name = &name
4452 }
4453 case "type":
4454 if v != nil {
4455 var typeVar string
4456 err = json.Unmarshal(*v, &typeVar)
4457 if err != nil {
4458 return err
4459 }
4460 scgr.Type = &typeVar
4461 }
4462 case "location":
4463 if v != nil {
4464 var location string
4465 err = json.Unmarshal(*v, &location)
4466 if err != nil {
4467 return err
4468 }
4469 scgr.Location = &location
4470 }
4471 case "tags":
4472 if v != nil {
4473 var tags map[string]*string
4474 err = json.Unmarshal(*v, &tags)
4475 if err != nil {
4476 return err
4477 }
4478 scgr.Tags = tags
4479 }
4480 }
4481 }
4482
4483 return nil
4484 }
4485
4486
4487 type SQLContainerListResult struct {
4488 autorest.Response `json:"-"`
4489
4490 Value *[]SQLContainerGetResults `json:"value,omitempty"`
4491 }
4492
4493
4494 func (sclr SQLContainerListResult) MarshalJSON() ([]byte, error) {
4495 objectMap := make(map[string]interface{})
4496 return json.Marshal(objectMap)
4497 }
4498
4499
4500 type SQLContainerResource struct {
4501
4502 ID *string `json:"id,omitempty"`
4503
4504 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`
4505
4506 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`
4507
4508 DefaultTTL *int32 `json:"defaultTtl,omitempty"`
4509
4510 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
4511
4512 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
4513 }
4514
4515
4516 type SQLDatabaseCreateUpdateParameters struct {
4517
4518 *SQLDatabaseCreateUpdateProperties `json:"properties,omitempty"`
4519
4520 ID *string `json:"id,omitempty"`
4521
4522 Name *string `json:"name,omitempty"`
4523
4524 Type *string `json:"type,omitempty"`
4525
4526 Location *string `json:"location,omitempty"`
4527 Tags map[string]*string `json:"tags"`
4528 }
4529
4530
4531 func (sdcup SQLDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) {
4532 objectMap := make(map[string]interface{})
4533 if sdcup.SQLDatabaseCreateUpdateProperties != nil {
4534 objectMap["properties"] = sdcup.SQLDatabaseCreateUpdateProperties
4535 }
4536 if sdcup.Location != nil {
4537 objectMap["location"] = sdcup.Location
4538 }
4539 if sdcup.Tags != nil {
4540 objectMap["tags"] = sdcup.Tags
4541 }
4542 return json.Marshal(objectMap)
4543 }
4544
4545
4546 func (sdcup *SQLDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error {
4547 var m map[string]*json.RawMessage
4548 err := json.Unmarshal(body, &m)
4549 if err != nil {
4550 return err
4551 }
4552 for k, v := range m {
4553 switch k {
4554 case "properties":
4555 if v != nil {
4556 var SQLDatabaseCreateUpdateProperties SQLDatabaseCreateUpdateProperties
4557 err = json.Unmarshal(*v, &SQLDatabaseCreateUpdateProperties)
4558 if err != nil {
4559 return err
4560 }
4561 sdcup.SQLDatabaseCreateUpdateProperties = &SQLDatabaseCreateUpdateProperties
4562 }
4563 case "id":
4564 if v != nil {
4565 var ID string
4566 err = json.Unmarshal(*v, &ID)
4567 if err != nil {
4568 return err
4569 }
4570 sdcup.ID = &ID
4571 }
4572 case "name":
4573 if v != nil {
4574 var name string
4575 err = json.Unmarshal(*v, &name)
4576 if err != nil {
4577 return err
4578 }
4579 sdcup.Name = &name
4580 }
4581 case "type":
4582 if v != nil {
4583 var typeVar string
4584 err = json.Unmarshal(*v, &typeVar)
4585 if err != nil {
4586 return err
4587 }
4588 sdcup.Type = &typeVar
4589 }
4590 case "location":
4591 if v != nil {
4592 var location string
4593 err = json.Unmarshal(*v, &location)
4594 if err != nil {
4595 return err
4596 }
4597 sdcup.Location = &location
4598 }
4599 case "tags":
4600 if v != nil {
4601 var tags map[string]*string
4602 err = json.Unmarshal(*v, &tags)
4603 if err != nil {
4604 return err
4605 }
4606 sdcup.Tags = tags
4607 }
4608 }
4609 }
4610
4611 return nil
4612 }
4613
4614
4615 type SQLDatabaseCreateUpdateProperties struct {
4616
4617 Resource *SQLDatabaseResource `json:"resource,omitempty"`
4618
4619 Options map[string]*string `json:"options"`
4620 }
4621
4622
4623 func (sdcup SQLDatabaseCreateUpdateProperties) MarshalJSON() ([]byte, error) {
4624 objectMap := make(map[string]interface{})
4625 if sdcup.Resource != nil {
4626 objectMap["resource"] = sdcup.Resource
4627 }
4628 if sdcup.Options != nil {
4629 objectMap["options"] = sdcup.Options
4630 }
4631 return json.Marshal(objectMap)
4632 }
4633
4634
4635 type SQLDatabaseGetProperties struct {
4636 Resource *SQLDatabaseGetPropertiesResource `json:"resource,omitempty"`
4637 }
4638
4639
4640 type SQLDatabaseGetPropertiesResource struct {
4641
4642 ID *string `json:"id,omitempty"`
4643
4644 Rid *string `json:"_rid,omitempty"`
4645
4646 Ts interface{} `json:"_ts,omitempty"`
4647
4648 Etag *string `json:"_etag,omitempty"`
4649
4650 Colls *string `json:"_colls,omitempty"`
4651
4652 Users *string `json:"_users,omitempty"`
4653 }
4654
4655
4656 func (sdgp SQLDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) {
4657 objectMap := make(map[string]interface{})
4658 if sdgp.ID != nil {
4659 objectMap["id"] = sdgp.ID
4660 }
4661 if sdgp.Colls != nil {
4662 objectMap["_colls"] = sdgp.Colls
4663 }
4664 if sdgp.Users != nil {
4665 objectMap["_users"] = sdgp.Users
4666 }
4667 return json.Marshal(objectMap)
4668 }
4669
4670
4671 type SQLDatabaseGetResults struct {
4672 autorest.Response `json:"-"`
4673
4674 *SQLDatabaseGetProperties `json:"properties,omitempty"`
4675
4676 ID *string `json:"id,omitempty"`
4677
4678 Name *string `json:"name,omitempty"`
4679
4680 Type *string `json:"type,omitempty"`
4681
4682 Location *string `json:"location,omitempty"`
4683 Tags map[string]*string `json:"tags"`
4684 }
4685
4686
4687 func (sdgr SQLDatabaseGetResults) MarshalJSON() ([]byte, error) {
4688 objectMap := make(map[string]interface{})
4689 if sdgr.SQLDatabaseGetProperties != nil {
4690 objectMap["properties"] = sdgr.SQLDatabaseGetProperties
4691 }
4692 if sdgr.Location != nil {
4693 objectMap["location"] = sdgr.Location
4694 }
4695 if sdgr.Tags != nil {
4696 objectMap["tags"] = sdgr.Tags
4697 }
4698 return json.Marshal(objectMap)
4699 }
4700
4701
4702 func (sdgr *SQLDatabaseGetResults) UnmarshalJSON(body []byte) error {
4703 var m map[string]*json.RawMessage
4704 err := json.Unmarshal(body, &m)
4705 if err != nil {
4706 return err
4707 }
4708 for k, v := range m {
4709 switch k {
4710 case "properties":
4711 if v != nil {
4712 var SQLDatabaseGetProperties SQLDatabaseGetProperties
4713 err = json.Unmarshal(*v, &SQLDatabaseGetProperties)
4714 if err != nil {
4715 return err
4716 }
4717 sdgr.SQLDatabaseGetProperties = &SQLDatabaseGetProperties
4718 }
4719 case "id":
4720 if v != nil {
4721 var ID string
4722 err = json.Unmarshal(*v, &ID)
4723 if err != nil {
4724 return err
4725 }
4726 sdgr.ID = &ID
4727 }
4728 case "name":
4729 if v != nil {
4730 var name string
4731 err = json.Unmarshal(*v, &name)
4732 if err != nil {
4733 return err
4734 }
4735 sdgr.Name = &name
4736 }
4737 case "type":
4738 if v != nil {
4739 var typeVar string
4740 err = json.Unmarshal(*v, &typeVar)
4741 if err != nil {
4742 return err
4743 }
4744 sdgr.Type = &typeVar
4745 }
4746 case "location":
4747 if v != nil {
4748 var location string
4749 err = json.Unmarshal(*v, &location)
4750 if err != nil {
4751 return err
4752 }
4753 sdgr.Location = &location
4754 }
4755 case "tags":
4756 if v != nil {
4757 var tags map[string]*string
4758 err = json.Unmarshal(*v, &tags)
4759 if err != nil {
4760 return err
4761 }
4762 sdgr.Tags = tags
4763 }
4764 }
4765 }
4766
4767 return nil
4768 }
4769
4770
4771 type SQLDatabaseListResult struct {
4772 autorest.Response `json:"-"`
4773
4774 Value *[]SQLDatabaseGetResults `json:"value,omitempty"`
4775 }
4776
4777
4778 func (sdlr SQLDatabaseListResult) MarshalJSON() ([]byte, error) {
4779 objectMap := make(map[string]interface{})
4780 return json.Marshal(objectMap)
4781 }
4782
4783
4784 type SQLDatabaseResource struct {
4785
4786 ID *string `json:"id,omitempty"`
4787 }
4788
4789
4790
4791 type SQLResourcesCreateUpdateSQLContainerFuture struct {
4792 azure.FutureAPI
4793
4794
4795 Result func(SQLResourcesClient) (SQLContainerGetResults, error)
4796 }
4797
4798
4799 func (future *SQLResourcesCreateUpdateSQLContainerFuture) UnmarshalJSON(body []byte) error {
4800 var azFuture azure.Future
4801 if err := json.Unmarshal(body, &azFuture); err != nil {
4802 return err
4803 }
4804 future.FutureAPI = &azFuture
4805 future.Result = future.result
4806 return nil
4807 }
4808
4809
4810 func (future *SQLResourcesCreateUpdateSQLContainerFuture) result(client SQLResourcesClient) (scgr SQLContainerGetResults, err error) {
4811 var done bool
4812 done, err = future.DoneWithContext(context.Background(), client)
4813 if err != nil {
4814 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", future.Response(), "Polling failure")
4815 return
4816 }
4817 if !done {
4818 scgr.Response.Response = future.Response()
4819 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLContainerFuture")
4820 return
4821 }
4822 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4823 if scgr.Response.Response, err = future.GetResult(sender); err == nil && scgr.Response.Response.StatusCode != http.StatusNoContent {
4824 scgr, err = client.CreateUpdateSQLContainerResponder(scgr.Response.Response)
4825 if err != nil {
4826 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", scgr.Response.Response, "Failure responding to request")
4827 }
4828 }
4829 return
4830 }
4831
4832
4833
4834 type SQLResourcesCreateUpdateSQLDatabaseFuture struct {
4835 azure.FutureAPI
4836
4837
4838 Result func(SQLResourcesClient) (SQLDatabaseGetResults, error)
4839 }
4840
4841
4842 func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) UnmarshalJSON(body []byte) error {
4843 var azFuture azure.Future
4844 if err := json.Unmarshal(body, &azFuture); err != nil {
4845 return err
4846 }
4847 future.FutureAPI = &azFuture
4848 future.Result = future.result
4849 return nil
4850 }
4851
4852
4853 func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) result(client SQLResourcesClient) (sdgr SQLDatabaseGetResults, err error) {
4854 var done bool
4855 done, err = future.DoneWithContext(context.Background(), client)
4856 if err != nil {
4857 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", future.Response(), "Polling failure")
4858 return
4859 }
4860 if !done {
4861 sdgr.Response.Response = future.Response()
4862 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture")
4863 return
4864 }
4865 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4866 if sdgr.Response.Response, err = future.GetResult(sender); err == nil && sdgr.Response.Response.StatusCode != http.StatusNoContent {
4867 sdgr, err = client.CreateUpdateSQLDatabaseResponder(sdgr.Response.Response)
4868 if err != nil {
4869 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", sdgr.Response.Response, "Failure responding to request")
4870 }
4871 }
4872 return
4873 }
4874
4875
4876
4877 type SQLResourcesCreateUpdateSQLStoredProcedureFuture struct {
4878 azure.FutureAPI
4879
4880
4881 Result func(SQLResourcesClient) (SQLStoredProcedureGetResults, error)
4882 }
4883
4884
4885 func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error {
4886 var azFuture azure.Future
4887 if err := json.Unmarshal(body, &azFuture); err != nil {
4888 return err
4889 }
4890 future.FutureAPI = &azFuture
4891 future.Result = future.result
4892 return nil
4893 }
4894
4895
4896 func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) result(client SQLResourcesClient) (sspgr SQLStoredProcedureGetResults, err error) {
4897 var done bool
4898 done, err = future.DoneWithContext(context.Background(), client)
4899 if err != nil {
4900 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure")
4901 return
4902 }
4903 if !done {
4904 sspgr.Response.Response = future.Response()
4905 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture")
4906 return
4907 }
4908 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4909 if sspgr.Response.Response, err = future.GetResult(sender); err == nil && sspgr.Response.Response.StatusCode != http.StatusNoContent {
4910 sspgr, err = client.CreateUpdateSQLStoredProcedureResponder(sspgr.Response.Response)
4911 if err != nil {
4912 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", sspgr.Response.Response, "Failure responding to request")
4913 }
4914 }
4915 return
4916 }
4917
4918
4919
4920 type SQLResourcesCreateUpdateSQLTriggerFuture struct {
4921 azure.FutureAPI
4922
4923
4924 Result func(SQLResourcesClient) (SQLTriggerGetResults, error)
4925 }
4926
4927
4928 func (future *SQLResourcesCreateUpdateSQLTriggerFuture) UnmarshalJSON(body []byte) error {
4929 var azFuture azure.Future
4930 if err := json.Unmarshal(body, &azFuture); err != nil {
4931 return err
4932 }
4933 future.FutureAPI = &azFuture
4934 future.Result = future.result
4935 return nil
4936 }
4937
4938
4939 func (future *SQLResourcesCreateUpdateSQLTriggerFuture) result(client SQLResourcesClient) (stgr SQLTriggerGetResults, err error) {
4940 var done bool
4941 done, err = future.DoneWithContext(context.Background(), client)
4942 if err != nil {
4943 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", future.Response(), "Polling failure")
4944 return
4945 }
4946 if !done {
4947 stgr.Response.Response = future.Response()
4948 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLTriggerFuture")
4949 return
4950 }
4951 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4952 if stgr.Response.Response, err = future.GetResult(sender); err == nil && stgr.Response.Response.StatusCode != http.StatusNoContent {
4953 stgr, err = client.CreateUpdateSQLTriggerResponder(stgr.Response.Response)
4954 if err != nil {
4955 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", stgr.Response.Response, "Failure responding to request")
4956 }
4957 }
4958 return
4959 }
4960
4961
4962
4963 type SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture struct {
4964 azure.FutureAPI
4965
4966
4967 Result func(SQLResourcesClient) (SQLUserDefinedFunctionGetResults, error)
4968 }
4969
4970
4971 func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error {
4972 var azFuture azure.Future
4973 if err := json.Unmarshal(body, &azFuture); err != nil {
4974 return err
4975 }
4976 future.FutureAPI = &azFuture
4977 future.Result = future.result
4978 return nil
4979 }
4980
4981
4982 func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (sudfgr SQLUserDefinedFunctionGetResults, err error) {
4983 var done bool
4984 done, err = future.DoneWithContext(context.Background(), client)
4985 if err != nil {
4986 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure")
4987 return
4988 }
4989 if !done {
4990 sudfgr.Response.Response = future.Response()
4991 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture")
4992 return
4993 }
4994 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4995 if sudfgr.Response.Response, err = future.GetResult(sender); err == nil && sudfgr.Response.Response.StatusCode != http.StatusNoContent {
4996 sudfgr, err = client.CreateUpdateSQLUserDefinedFunctionResponder(sudfgr.Response.Response)
4997 if err != nil {
4998 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", sudfgr.Response.Response, "Failure responding to request")
4999 }
5000 }
5001 return
5002 }
5003
5004
5005
5006 type SQLResourcesDeleteSQLContainerFuture struct {
5007 azure.FutureAPI
5008
5009
5010 Result func(SQLResourcesClient) (autorest.Response, error)
5011 }
5012
5013
5014 func (future *SQLResourcesDeleteSQLContainerFuture) UnmarshalJSON(body []byte) error {
5015 var azFuture azure.Future
5016 if err := json.Unmarshal(body, &azFuture); err != nil {
5017 return err
5018 }
5019 future.FutureAPI = &azFuture
5020 future.Result = future.result
5021 return nil
5022 }
5023
5024
5025 func (future *SQLResourcesDeleteSQLContainerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
5026 var done bool
5027 done, err = future.DoneWithContext(context.Background(), client)
5028 if err != nil {
5029 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLContainerFuture", "Result", future.Response(), "Polling failure")
5030 return
5031 }
5032 if !done {
5033 ar.Response = future.Response()
5034 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLContainerFuture")
5035 return
5036 }
5037 ar.Response = future.Response()
5038 return
5039 }
5040
5041
5042
5043 type SQLResourcesDeleteSQLDatabaseFuture struct {
5044 azure.FutureAPI
5045
5046
5047 Result func(SQLResourcesClient) (autorest.Response, error)
5048 }
5049
5050
5051 func (future *SQLResourcesDeleteSQLDatabaseFuture) UnmarshalJSON(body []byte) error {
5052 var azFuture azure.Future
5053 if err := json.Unmarshal(body, &azFuture); err != nil {
5054 return err
5055 }
5056 future.FutureAPI = &azFuture
5057 future.Result = future.result
5058 return nil
5059 }
5060
5061
5062 func (future *SQLResourcesDeleteSQLDatabaseFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
5063 var done bool
5064 done, err = future.DoneWithContext(context.Background(), client)
5065 if err != nil {
5066 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLDatabaseFuture", "Result", future.Response(), "Polling failure")
5067 return
5068 }
5069 if !done {
5070 ar.Response = future.Response()
5071 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLDatabaseFuture")
5072 return
5073 }
5074 ar.Response = future.Response()
5075 return
5076 }
5077
5078
5079
5080 type SQLResourcesDeleteSQLStoredProcedureFuture struct {
5081 azure.FutureAPI
5082
5083
5084 Result func(SQLResourcesClient) (autorest.Response, error)
5085 }
5086
5087
5088 func (future *SQLResourcesDeleteSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error {
5089 var azFuture azure.Future
5090 if err := json.Unmarshal(body, &azFuture); err != nil {
5091 return err
5092 }
5093 future.FutureAPI = &azFuture
5094 future.Result = future.result
5095 return nil
5096 }
5097
5098
5099 func (future *SQLResourcesDeleteSQLStoredProcedureFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
5100 var done bool
5101 done, err = future.DoneWithContext(context.Background(), client)
5102 if err != nil {
5103 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure")
5104 return
5105 }
5106 if !done {
5107 ar.Response = future.Response()
5108 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLStoredProcedureFuture")
5109 return
5110 }
5111 ar.Response = future.Response()
5112 return
5113 }
5114
5115
5116
5117 type SQLResourcesDeleteSQLTriggerFuture struct {
5118 azure.FutureAPI
5119
5120
5121 Result func(SQLResourcesClient) (autorest.Response, error)
5122 }
5123
5124
5125 func (future *SQLResourcesDeleteSQLTriggerFuture) UnmarshalJSON(body []byte) error {
5126 var azFuture azure.Future
5127 if err := json.Unmarshal(body, &azFuture); err != nil {
5128 return err
5129 }
5130 future.FutureAPI = &azFuture
5131 future.Result = future.result
5132 return nil
5133 }
5134
5135
5136 func (future *SQLResourcesDeleteSQLTriggerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
5137 var done bool
5138 done, err = future.DoneWithContext(context.Background(), client)
5139 if err != nil {
5140 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLTriggerFuture", "Result", future.Response(), "Polling failure")
5141 return
5142 }
5143 if !done {
5144 ar.Response = future.Response()
5145 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLTriggerFuture")
5146 return
5147 }
5148 ar.Response = future.Response()
5149 return
5150 }
5151
5152
5153
5154 type SQLResourcesDeleteSQLUserDefinedFunctionFuture struct {
5155 azure.FutureAPI
5156
5157
5158 Result func(SQLResourcesClient) (autorest.Response, error)
5159 }
5160
5161
5162 func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error {
5163 var azFuture azure.Future
5164 if err := json.Unmarshal(body, &azFuture); err != nil {
5165 return err
5166 }
5167 future.FutureAPI = &azFuture
5168 future.Result = future.result
5169 return nil
5170 }
5171
5172
5173 func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) {
5174 var done bool
5175 done, err = future.DoneWithContext(context.Background(), client)
5176 if err != nil {
5177 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure")
5178 return
5179 }
5180 if !done {
5181 ar.Response = future.Response()
5182 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture")
5183 return
5184 }
5185 ar.Response = future.Response()
5186 return
5187 }
5188
5189
5190
5191 type SQLResourcesUpdateSQLContainerThroughputFuture struct {
5192 azure.FutureAPI
5193
5194
5195 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
5196 }
5197
5198
5199 func (future *SQLResourcesUpdateSQLContainerThroughputFuture) UnmarshalJSON(body []byte) error {
5200 var azFuture azure.Future
5201 if err := json.Unmarshal(body, &azFuture); err != nil {
5202 return err
5203 }
5204 future.FutureAPI = &azFuture
5205 future.Result = future.result
5206 return nil
5207 }
5208
5209
5210 func (future *SQLResourcesUpdateSQLContainerThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
5211 var done bool
5212 done, err = future.DoneWithContext(context.Background(), client)
5213 if err != nil {
5214 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", future.Response(), "Polling failure")
5215 return
5216 }
5217 if !done {
5218 tsgr.Response.Response = future.Response()
5219 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLContainerThroughputFuture")
5220 return
5221 }
5222 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5223 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
5224 tsgr, err = client.UpdateSQLContainerThroughputResponder(tsgr.Response.Response)
5225 if err != nil {
5226 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
5227 }
5228 }
5229 return
5230 }
5231
5232
5233
5234 type SQLResourcesUpdateSQLDatabaseThroughputFuture struct {
5235 azure.FutureAPI
5236
5237
5238 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error)
5239 }
5240
5241
5242 func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) UnmarshalJSON(body []byte) error {
5243 var azFuture azure.Future
5244 if err := json.Unmarshal(body, &azFuture); err != nil {
5245 return err
5246 }
5247 future.FutureAPI = &azFuture
5248 future.Result = future.result
5249 return nil
5250 }
5251
5252
5253 func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
5254 var done bool
5255 done, err = future.DoneWithContext(context.Background(), client)
5256 if err != nil {
5257 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", future.Response(), "Polling failure")
5258 return
5259 }
5260 if !done {
5261 tsgr.Response.Response = future.Response()
5262 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture")
5263 return
5264 }
5265 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5266 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
5267 tsgr, err = client.UpdateSQLDatabaseThroughputResponder(tsgr.Response.Response)
5268 if err != nil {
5269 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
5270 }
5271 }
5272 return
5273 }
5274
5275
5276 type SQLStoredProcedureCreateUpdateParameters struct {
5277
5278 *SQLStoredProcedureCreateUpdateProperties `json:"properties,omitempty"`
5279
5280 ID *string `json:"id,omitempty"`
5281
5282 Name *string `json:"name,omitempty"`
5283
5284 Type *string `json:"type,omitempty"`
5285
5286 Location *string `json:"location,omitempty"`
5287 Tags map[string]*string `json:"tags"`
5288 }
5289
5290
5291 func (sspcup SQLStoredProcedureCreateUpdateParameters) MarshalJSON() ([]byte, error) {
5292 objectMap := make(map[string]interface{})
5293 if sspcup.SQLStoredProcedureCreateUpdateProperties != nil {
5294 objectMap["properties"] = sspcup.SQLStoredProcedureCreateUpdateProperties
5295 }
5296 if sspcup.Location != nil {
5297 objectMap["location"] = sspcup.Location
5298 }
5299 if sspcup.Tags != nil {
5300 objectMap["tags"] = sspcup.Tags
5301 }
5302 return json.Marshal(objectMap)
5303 }
5304
5305
5306 func (sspcup *SQLStoredProcedureCreateUpdateParameters) UnmarshalJSON(body []byte) error {
5307 var m map[string]*json.RawMessage
5308 err := json.Unmarshal(body, &m)
5309 if err != nil {
5310 return err
5311 }
5312 for k, v := range m {
5313 switch k {
5314 case "properties":
5315 if v != nil {
5316 var SQLStoredProcedureCreateUpdateProperties SQLStoredProcedureCreateUpdateProperties
5317 err = json.Unmarshal(*v, &SQLStoredProcedureCreateUpdateProperties)
5318 if err != nil {
5319 return err
5320 }
5321 sspcup.SQLStoredProcedureCreateUpdateProperties = &SQLStoredProcedureCreateUpdateProperties
5322 }
5323 case "id":
5324 if v != nil {
5325 var ID string
5326 err = json.Unmarshal(*v, &ID)
5327 if err != nil {
5328 return err
5329 }
5330 sspcup.ID = &ID
5331 }
5332 case "name":
5333 if v != nil {
5334 var name string
5335 err = json.Unmarshal(*v, &name)
5336 if err != nil {
5337 return err
5338 }
5339 sspcup.Name = &name
5340 }
5341 case "type":
5342 if v != nil {
5343 var typeVar string
5344 err = json.Unmarshal(*v, &typeVar)
5345 if err != nil {
5346 return err
5347 }
5348 sspcup.Type = &typeVar
5349 }
5350 case "location":
5351 if v != nil {
5352 var location string
5353 err = json.Unmarshal(*v, &location)
5354 if err != nil {
5355 return err
5356 }
5357 sspcup.Location = &location
5358 }
5359 case "tags":
5360 if v != nil {
5361 var tags map[string]*string
5362 err = json.Unmarshal(*v, &tags)
5363 if err != nil {
5364 return err
5365 }
5366 sspcup.Tags = tags
5367 }
5368 }
5369 }
5370
5371 return nil
5372 }
5373
5374
5375
5376 type SQLStoredProcedureCreateUpdateProperties struct {
5377
5378 Resource *SQLStoredProcedureResource `json:"resource,omitempty"`
5379
5380 Options map[string]*string `json:"options"`
5381 }
5382
5383
5384 func (sspcup SQLStoredProcedureCreateUpdateProperties) MarshalJSON() ([]byte, error) {
5385 objectMap := make(map[string]interface{})
5386 if sspcup.Resource != nil {
5387 objectMap["resource"] = sspcup.Resource
5388 }
5389 if sspcup.Options != nil {
5390 objectMap["options"] = sspcup.Options
5391 }
5392 return json.Marshal(objectMap)
5393 }
5394
5395
5396 type SQLStoredProcedureGetProperties struct {
5397 Resource *SQLStoredProcedureGetPropertiesResource `json:"resource,omitempty"`
5398 }
5399
5400
5401 type SQLStoredProcedureGetPropertiesResource struct {
5402
5403 ID *string `json:"id,omitempty"`
5404
5405 Body *string `json:"body,omitempty"`
5406
5407 Rid *string `json:"_rid,omitempty"`
5408
5409 Ts interface{} `json:"_ts,omitempty"`
5410
5411 Etag *string `json:"_etag,omitempty"`
5412 }
5413
5414
5415 func (sspgp SQLStoredProcedureGetPropertiesResource) MarshalJSON() ([]byte, error) {
5416 objectMap := make(map[string]interface{})
5417 if sspgp.ID != nil {
5418 objectMap["id"] = sspgp.ID
5419 }
5420 if sspgp.Body != nil {
5421 objectMap["body"] = sspgp.Body
5422 }
5423 return json.Marshal(objectMap)
5424 }
5425
5426
5427 type SQLStoredProcedureGetResults struct {
5428 autorest.Response `json:"-"`
5429
5430 *SQLStoredProcedureGetProperties `json:"properties,omitempty"`
5431
5432 ID *string `json:"id,omitempty"`
5433
5434 Name *string `json:"name,omitempty"`
5435
5436 Type *string `json:"type,omitempty"`
5437
5438 Location *string `json:"location,omitempty"`
5439 Tags map[string]*string `json:"tags"`
5440 }
5441
5442
5443 func (sspgr SQLStoredProcedureGetResults) MarshalJSON() ([]byte, error) {
5444 objectMap := make(map[string]interface{})
5445 if sspgr.SQLStoredProcedureGetProperties != nil {
5446 objectMap["properties"] = sspgr.SQLStoredProcedureGetProperties
5447 }
5448 if sspgr.Location != nil {
5449 objectMap["location"] = sspgr.Location
5450 }
5451 if sspgr.Tags != nil {
5452 objectMap["tags"] = sspgr.Tags
5453 }
5454 return json.Marshal(objectMap)
5455 }
5456
5457
5458 func (sspgr *SQLStoredProcedureGetResults) UnmarshalJSON(body []byte) error {
5459 var m map[string]*json.RawMessage
5460 err := json.Unmarshal(body, &m)
5461 if err != nil {
5462 return err
5463 }
5464 for k, v := range m {
5465 switch k {
5466 case "properties":
5467 if v != nil {
5468 var SQLStoredProcedureGetProperties SQLStoredProcedureGetProperties
5469 err = json.Unmarshal(*v, &SQLStoredProcedureGetProperties)
5470 if err != nil {
5471 return err
5472 }
5473 sspgr.SQLStoredProcedureGetProperties = &SQLStoredProcedureGetProperties
5474 }
5475 case "id":
5476 if v != nil {
5477 var ID string
5478 err = json.Unmarshal(*v, &ID)
5479 if err != nil {
5480 return err
5481 }
5482 sspgr.ID = &ID
5483 }
5484 case "name":
5485 if v != nil {
5486 var name string
5487 err = json.Unmarshal(*v, &name)
5488 if err != nil {
5489 return err
5490 }
5491 sspgr.Name = &name
5492 }
5493 case "type":
5494 if v != nil {
5495 var typeVar string
5496 err = json.Unmarshal(*v, &typeVar)
5497 if err != nil {
5498 return err
5499 }
5500 sspgr.Type = &typeVar
5501 }
5502 case "location":
5503 if v != nil {
5504 var location string
5505 err = json.Unmarshal(*v, &location)
5506 if err != nil {
5507 return err
5508 }
5509 sspgr.Location = &location
5510 }
5511 case "tags":
5512 if v != nil {
5513 var tags map[string]*string
5514 err = json.Unmarshal(*v, &tags)
5515 if err != nil {
5516 return err
5517 }
5518 sspgr.Tags = tags
5519 }
5520 }
5521 }
5522
5523 return nil
5524 }
5525
5526
5527
5528 type SQLStoredProcedureListResult struct {
5529 autorest.Response `json:"-"`
5530
5531 Value *[]SQLStoredProcedureGetResults `json:"value,omitempty"`
5532 }
5533
5534
5535 func (ssplr SQLStoredProcedureListResult) MarshalJSON() ([]byte, error) {
5536 objectMap := make(map[string]interface{})
5537 return json.Marshal(objectMap)
5538 }
5539
5540
5541 type SQLStoredProcedureResource struct {
5542
5543 ID *string `json:"id,omitempty"`
5544
5545 Body *string `json:"body,omitempty"`
5546 }
5547
5548
5549 type SQLTriggerCreateUpdateParameters struct {
5550
5551 *SQLTriggerCreateUpdateProperties `json:"properties,omitempty"`
5552
5553 ID *string `json:"id,omitempty"`
5554
5555 Name *string `json:"name,omitempty"`
5556
5557 Type *string `json:"type,omitempty"`
5558
5559 Location *string `json:"location,omitempty"`
5560 Tags map[string]*string `json:"tags"`
5561 }
5562
5563
5564 func (stcup SQLTriggerCreateUpdateParameters) MarshalJSON() ([]byte, error) {
5565 objectMap := make(map[string]interface{})
5566 if stcup.SQLTriggerCreateUpdateProperties != nil {
5567 objectMap["properties"] = stcup.SQLTriggerCreateUpdateProperties
5568 }
5569 if stcup.Location != nil {
5570 objectMap["location"] = stcup.Location
5571 }
5572 if stcup.Tags != nil {
5573 objectMap["tags"] = stcup.Tags
5574 }
5575 return json.Marshal(objectMap)
5576 }
5577
5578
5579 func (stcup *SQLTriggerCreateUpdateParameters) UnmarshalJSON(body []byte) error {
5580 var m map[string]*json.RawMessage
5581 err := json.Unmarshal(body, &m)
5582 if err != nil {
5583 return err
5584 }
5585 for k, v := range m {
5586 switch k {
5587 case "properties":
5588 if v != nil {
5589 var SQLTriggerCreateUpdateProperties SQLTriggerCreateUpdateProperties
5590 err = json.Unmarshal(*v, &SQLTriggerCreateUpdateProperties)
5591 if err != nil {
5592 return err
5593 }
5594 stcup.SQLTriggerCreateUpdateProperties = &SQLTriggerCreateUpdateProperties
5595 }
5596 case "id":
5597 if v != nil {
5598 var ID string
5599 err = json.Unmarshal(*v, &ID)
5600 if err != nil {
5601 return err
5602 }
5603 stcup.ID = &ID
5604 }
5605 case "name":
5606 if v != nil {
5607 var name string
5608 err = json.Unmarshal(*v, &name)
5609 if err != nil {
5610 return err
5611 }
5612 stcup.Name = &name
5613 }
5614 case "type":
5615 if v != nil {
5616 var typeVar string
5617 err = json.Unmarshal(*v, &typeVar)
5618 if err != nil {
5619 return err
5620 }
5621 stcup.Type = &typeVar
5622 }
5623 case "location":
5624 if v != nil {
5625 var location string
5626 err = json.Unmarshal(*v, &location)
5627 if err != nil {
5628 return err
5629 }
5630 stcup.Location = &location
5631 }
5632 case "tags":
5633 if v != nil {
5634 var tags map[string]*string
5635 err = json.Unmarshal(*v, &tags)
5636 if err != nil {
5637 return err
5638 }
5639 stcup.Tags = tags
5640 }
5641 }
5642 }
5643
5644 return nil
5645 }
5646
5647
5648 type SQLTriggerCreateUpdateProperties struct {
5649
5650 Resource *SQLTriggerResource `json:"resource,omitempty"`
5651
5652 Options map[string]*string `json:"options"`
5653 }
5654
5655
5656 func (stcup SQLTriggerCreateUpdateProperties) MarshalJSON() ([]byte, error) {
5657 objectMap := make(map[string]interface{})
5658 if stcup.Resource != nil {
5659 objectMap["resource"] = stcup.Resource
5660 }
5661 if stcup.Options != nil {
5662 objectMap["options"] = stcup.Options
5663 }
5664 return json.Marshal(objectMap)
5665 }
5666
5667
5668 type SQLTriggerGetProperties struct {
5669 Resource *SQLTriggerGetPropertiesResource `json:"resource,omitempty"`
5670 }
5671
5672
5673 type SQLTriggerGetPropertiesResource struct {
5674
5675 ID *string `json:"id,omitempty"`
5676
5677 Body *string `json:"body,omitempty"`
5678
5679 TriggerType TriggerType `json:"triggerType,omitempty"`
5680
5681 TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"`
5682
5683 Rid *string `json:"_rid,omitempty"`
5684
5685 Ts interface{} `json:"_ts,omitempty"`
5686
5687 Etag *string `json:"_etag,omitempty"`
5688 }
5689
5690
5691 func (stgp SQLTriggerGetPropertiesResource) MarshalJSON() ([]byte, error) {
5692 objectMap := make(map[string]interface{})
5693 if stgp.ID != nil {
5694 objectMap["id"] = stgp.ID
5695 }
5696 if stgp.Body != nil {
5697 objectMap["body"] = stgp.Body
5698 }
5699 if stgp.TriggerType != "" {
5700 objectMap["triggerType"] = stgp.TriggerType
5701 }
5702 if stgp.TriggerOperation != "" {
5703 objectMap["triggerOperation"] = stgp.TriggerOperation
5704 }
5705 return json.Marshal(objectMap)
5706 }
5707
5708
5709 type SQLTriggerGetResults struct {
5710 autorest.Response `json:"-"`
5711
5712 *SQLTriggerGetProperties `json:"properties,omitempty"`
5713
5714 ID *string `json:"id,omitempty"`
5715
5716 Name *string `json:"name,omitempty"`
5717
5718 Type *string `json:"type,omitempty"`
5719
5720 Location *string `json:"location,omitempty"`
5721 Tags map[string]*string `json:"tags"`
5722 }
5723
5724
5725 func (stgr SQLTriggerGetResults) MarshalJSON() ([]byte, error) {
5726 objectMap := make(map[string]interface{})
5727 if stgr.SQLTriggerGetProperties != nil {
5728 objectMap["properties"] = stgr.SQLTriggerGetProperties
5729 }
5730 if stgr.Location != nil {
5731 objectMap["location"] = stgr.Location
5732 }
5733 if stgr.Tags != nil {
5734 objectMap["tags"] = stgr.Tags
5735 }
5736 return json.Marshal(objectMap)
5737 }
5738
5739
5740 func (stgr *SQLTriggerGetResults) UnmarshalJSON(body []byte) error {
5741 var m map[string]*json.RawMessage
5742 err := json.Unmarshal(body, &m)
5743 if err != nil {
5744 return err
5745 }
5746 for k, v := range m {
5747 switch k {
5748 case "properties":
5749 if v != nil {
5750 var SQLTriggerGetProperties SQLTriggerGetProperties
5751 err = json.Unmarshal(*v, &SQLTriggerGetProperties)
5752 if err != nil {
5753 return err
5754 }
5755 stgr.SQLTriggerGetProperties = &SQLTriggerGetProperties
5756 }
5757 case "id":
5758 if v != nil {
5759 var ID string
5760 err = json.Unmarshal(*v, &ID)
5761 if err != nil {
5762 return err
5763 }
5764 stgr.ID = &ID
5765 }
5766 case "name":
5767 if v != nil {
5768 var name string
5769 err = json.Unmarshal(*v, &name)
5770 if err != nil {
5771 return err
5772 }
5773 stgr.Name = &name
5774 }
5775 case "type":
5776 if v != nil {
5777 var typeVar string
5778 err = json.Unmarshal(*v, &typeVar)
5779 if err != nil {
5780 return err
5781 }
5782 stgr.Type = &typeVar
5783 }
5784 case "location":
5785 if v != nil {
5786 var location string
5787 err = json.Unmarshal(*v, &location)
5788 if err != nil {
5789 return err
5790 }
5791 stgr.Location = &location
5792 }
5793 case "tags":
5794 if v != nil {
5795 var tags map[string]*string
5796 err = json.Unmarshal(*v, &tags)
5797 if err != nil {
5798 return err
5799 }
5800 stgr.Tags = tags
5801 }
5802 }
5803 }
5804
5805 return nil
5806 }
5807
5808
5809 type SQLTriggerListResult struct {
5810 autorest.Response `json:"-"`
5811
5812 Value *[]SQLTriggerGetResults `json:"value,omitempty"`
5813 }
5814
5815
5816 func (stlr SQLTriggerListResult) MarshalJSON() ([]byte, error) {
5817 objectMap := make(map[string]interface{})
5818 return json.Marshal(objectMap)
5819 }
5820
5821
5822 type SQLTriggerResource struct {
5823
5824 ID *string `json:"id,omitempty"`
5825
5826 Body *string `json:"body,omitempty"`
5827
5828 TriggerType TriggerType `json:"triggerType,omitempty"`
5829
5830 TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"`
5831 }
5832
5833
5834
5835 type SQLUserDefinedFunctionCreateUpdateParameters struct {
5836
5837 *SQLUserDefinedFunctionCreateUpdateProperties `json:"properties,omitempty"`
5838
5839 ID *string `json:"id,omitempty"`
5840
5841 Name *string `json:"name,omitempty"`
5842
5843 Type *string `json:"type,omitempty"`
5844
5845 Location *string `json:"location,omitempty"`
5846 Tags map[string]*string `json:"tags"`
5847 }
5848
5849
5850 func (sudfcup SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON() ([]byte, error) {
5851 objectMap := make(map[string]interface{})
5852 if sudfcup.SQLUserDefinedFunctionCreateUpdateProperties != nil {
5853 objectMap["properties"] = sudfcup.SQLUserDefinedFunctionCreateUpdateProperties
5854 }
5855 if sudfcup.Location != nil {
5856 objectMap["location"] = sudfcup.Location
5857 }
5858 if sudfcup.Tags != nil {
5859 objectMap["tags"] = sudfcup.Tags
5860 }
5861 return json.Marshal(objectMap)
5862 }
5863
5864
5865 func (sudfcup *SQLUserDefinedFunctionCreateUpdateParameters) UnmarshalJSON(body []byte) error {
5866 var m map[string]*json.RawMessage
5867 err := json.Unmarshal(body, &m)
5868 if err != nil {
5869 return err
5870 }
5871 for k, v := range m {
5872 switch k {
5873 case "properties":
5874 if v != nil {
5875 var SQLUserDefinedFunctionCreateUpdateProperties SQLUserDefinedFunctionCreateUpdateProperties
5876 err = json.Unmarshal(*v, &SQLUserDefinedFunctionCreateUpdateProperties)
5877 if err != nil {
5878 return err
5879 }
5880 sudfcup.SQLUserDefinedFunctionCreateUpdateProperties = &SQLUserDefinedFunctionCreateUpdateProperties
5881 }
5882 case "id":
5883 if v != nil {
5884 var ID string
5885 err = json.Unmarshal(*v, &ID)
5886 if err != nil {
5887 return err
5888 }
5889 sudfcup.ID = &ID
5890 }
5891 case "name":
5892 if v != nil {
5893 var name string
5894 err = json.Unmarshal(*v, &name)
5895 if err != nil {
5896 return err
5897 }
5898 sudfcup.Name = &name
5899 }
5900 case "type":
5901 if v != nil {
5902 var typeVar string
5903 err = json.Unmarshal(*v, &typeVar)
5904 if err != nil {
5905 return err
5906 }
5907 sudfcup.Type = &typeVar
5908 }
5909 case "location":
5910 if v != nil {
5911 var location string
5912 err = json.Unmarshal(*v, &location)
5913 if err != nil {
5914 return err
5915 }
5916 sudfcup.Location = &location
5917 }
5918 case "tags":
5919 if v != nil {
5920 var tags map[string]*string
5921 err = json.Unmarshal(*v, &tags)
5922 if err != nil {
5923 return err
5924 }
5925 sudfcup.Tags = tags
5926 }
5927 }
5928 }
5929
5930 return nil
5931 }
5932
5933
5934
5935 type SQLUserDefinedFunctionCreateUpdateProperties struct {
5936
5937 Resource *SQLUserDefinedFunctionResource `json:"resource,omitempty"`
5938
5939 Options map[string]*string `json:"options"`
5940 }
5941
5942
5943 func (sudfcup SQLUserDefinedFunctionCreateUpdateProperties) MarshalJSON() ([]byte, error) {
5944 objectMap := make(map[string]interface{})
5945 if sudfcup.Resource != nil {
5946 objectMap["resource"] = sudfcup.Resource
5947 }
5948 if sudfcup.Options != nil {
5949 objectMap["options"] = sudfcup.Options
5950 }
5951 return json.Marshal(objectMap)
5952 }
5953
5954
5955 type SQLUserDefinedFunctionGetProperties struct {
5956 Resource *SQLUserDefinedFunctionGetPropertiesResource `json:"resource,omitempty"`
5957 }
5958
5959
5960 type SQLUserDefinedFunctionGetPropertiesResource struct {
5961
5962 ID *string `json:"id,omitempty"`
5963
5964 Body *string `json:"body,omitempty"`
5965
5966 Rid *string `json:"_rid,omitempty"`
5967
5968 Ts interface{} `json:"_ts,omitempty"`
5969
5970 Etag *string `json:"_etag,omitempty"`
5971 }
5972
5973
5974 func (sudfgp SQLUserDefinedFunctionGetPropertiesResource) MarshalJSON() ([]byte, error) {
5975 objectMap := make(map[string]interface{})
5976 if sudfgp.ID != nil {
5977 objectMap["id"] = sudfgp.ID
5978 }
5979 if sudfgp.Body != nil {
5980 objectMap["body"] = sudfgp.Body
5981 }
5982 return json.Marshal(objectMap)
5983 }
5984
5985
5986 type SQLUserDefinedFunctionGetResults struct {
5987 autorest.Response `json:"-"`
5988
5989 *SQLUserDefinedFunctionGetProperties `json:"properties,omitempty"`
5990
5991 ID *string `json:"id,omitempty"`
5992
5993 Name *string `json:"name,omitempty"`
5994
5995 Type *string `json:"type,omitempty"`
5996
5997 Location *string `json:"location,omitempty"`
5998 Tags map[string]*string `json:"tags"`
5999 }
6000
6001
6002 func (sudfgr SQLUserDefinedFunctionGetResults) MarshalJSON() ([]byte, error) {
6003 objectMap := make(map[string]interface{})
6004 if sudfgr.SQLUserDefinedFunctionGetProperties != nil {
6005 objectMap["properties"] = sudfgr.SQLUserDefinedFunctionGetProperties
6006 }
6007 if sudfgr.Location != nil {
6008 objectMap["location"] = sudfgr.Location
6009 }
6010 if sudfgr.Tags != nil {
6011 objectMap["tags"] = sudfgr.Tags
6012 }
6013 return json.Marshal(objectMap)
6014 }
6015
6016
6017 func (sudfgr *SQLUserDefinedFunctionGetResults) UnmarshalJSON(body []byte) error {
6018 var m map[string]*json.RawMessage
6019 err := json.Unmarshal(body, &m)
6020 if err != nil {
6021 return err
6022 }
6023 for k, v := range m {
6024 switch k {
6025 case "properties":
6026 if v != nil {
6027 var SQLUserDefinedFunctionGetProperties SQLUserDefinedFunctionGetProperties
6028 err = json.Unmarshal(*v, &SQLUserDefinedFunctionGetProperties)
6029 if err != nil {
6030 return err
6031 }
6032 sudfgr.SQLUserDefinedFunctionGetProperties = &SQLUserDefinedFunctionGetProperties
6033 }
6034 case "id":
6035 if v != nil {
6036 var ID string
6037 err = json.Unmarshal(*v, &ID)
6038 if err != nil {
6039 return err
6040 }
6041 sudfgr.ID = &ID
6042 }
6043 case "name":
6044 if v != nil {
6045 var name string
6046 err = json.Unmarshal(*v, &name)
6047 if err != nil {
6048 return err
6049 }
6050 sudfgr.Name = &name
6051 }
6052 case "type":
6053 if v != nil {
6054 var typeVar string
6055 err = json.Unmarshal(*v, &typeVar)
6056 if err != nil {
6057 return err
6058 }
6059 sudfgr.Type = &typeVar
6060 }
6061 case "location":
6062 if v != nil {
6063 var location string
6064 err = json.Unmarshal(*v, &location)
6065 if err != nil {
6066 return err
6067 }
6068 sudfgr.Location = &location
6069 }
6070 case "tags":
6071 if v != nil {
6072 var tags map[string]*string
6073 err = json.Unmarshal(*v, &tags)
6074 if err != nil {
6075 return err
6076 }
6077 sudfgr.Tags = tags
6078 }
6079 }
6080 }
6081
6082 return nil
6083 }
6084
6085
6086
6087 type SQLUserDefinedFunctionListResult struct {
6088 autorest.Response `json:"-"`
6089
6090 Value *[]SQLUserDefinedFunctionGetResults `json:"value,omitempty"`
6091 }
6092
6093
6094 func (sudflr SQLUserDefinedFunctionListResult) MarshalJSON() ([]byte, error) {
6095 objectMap := make(map[string]interface{})
6096 return json.Marshal(objectMap)
6097 }
6098
6099
6100 type SQLUserDefinedFunctionResource struct {
6101
6102 ID *string `json:"id,omitempty"`
6103
6104 Body *string `json:"body,omitempty"`
6105 }
6106
6107
6108 type TableCreateUpdateParameters struct {
6109
6110 *TableCreateUpdateProperties `json:"properties,omitempty"`
6111
6112 ID *string `json:"id,omitempty"`
6113
6114 Name *string `json:"name,omitempty"`
6115
6116 Type *string `json:"type,omitempty"`
6117
6118 Location *string `json:"location,omitempty"`
6119 Tags map[string]*string `json:"tags"`
6120 }
6121
6122
6123 func (tcup TableCreateUpdateParameters) MarshalJSON() ([]byte, error) {
6124 objectMap := make(map[string]interface{})
6125 if tcup.TableCreateUpdateProperties != nil {
6126 objectMap["properties"] = tcup.TableCreateUpdateProperties
6127 }
6128 if tcup.Location != nil {
6129 objectMap["location"] = tcup.Location
6130 }
6131 if tcup.Tags != nil {
6132 objectMap["tags"] = tcup.Tags
6133 }
6134 return json.Marshal(objectMap)
6135 }
6136
6137
6138 func (tcup *TableCreateUpdateParameters) UnmarshalJSON(body []byte) error {
6139 var m map[string]*json.RawMessage
6140 err := json.Unmarshal(body, &m)
6141 if err != nil {
6142 return err
6143 }
6144 for k, v := range m {
6145 switch k {
6146 case "properties":
6147 if v != nil {
6148 var tableCreateUpdateProperties TableCreateUpdateProperties
6149 err = json.Unmarshal(*v, &tableCreateUpdateProperties)
6150 if err != nil {
6151 return err
6152 }
6153 tcup.TableCreateUpdateProperties = &tableCreateUpdateProperties
6154 }
6155 case "id":
6156 if v != nil {
6157 var ID string
6158 err = json.Unmarshal(*v, &ID)
6159 if err != nil {
6160 return err
6161 }
6162 tcup.ID = &ID
6163 }
6164 case "name":
6165 if v != nil {
6166 var name string
6167 err = json.Unmarshal(*v, &name)
6168 if err != nil {
6169 return err
6170 }
6171 tcup.Name = &name
6172 }
6173 case "type":
6174 if v != nil {
6175 var typeVar string
6176 err = json.Unmarshal(*v, &typeVar)
6177 if err != nil {
6178 return err
6179 }
6180 tcup.Type = &typeVar
6181 }
6182 case "location":
6183 if v != nil {
6184 var location string
6185 err = json.Unmarshal(*v, &location)
6186 if err != nil {
6187 return err
6188 }
6189 tcup.Location = &location
6190 }
6191 case "tags":
6192 if v != nil {
6193 var tags map[string]*string
6194 err = json.Unmarshal(*v, &tags)
6195 if err != nil {
6196 return err
6197 }
6198 tcup.Tags = tags
6199 }
6200 }
6201 }
6202
6203 return nil
6204 }
6205
6206
6207 type TableCreateUpdateProperties struct {
6208
6209 Resource *TableResource `json:"resource,omitempty"`
6210
6211 Options map[string]*string `json:"options"`
6212 }
6213
6214
6215 func (tcup TableCreateUpdateProperties) MarshalJSON() ([]byte, error) {
6216 objectMap := make(map[string]interface{})
6217 if tcup.Resource != nil {
6218 objectMap["resource"] = tcup.Resource
6219 }
6220 if tcup.Options != nil {
6221 objectMap["options"] = tcup.Options
6222 }
6223 return json.Marshal(objectMap)
6224 }
6225
6226
6227 type TableGetProperties struct {
6228 Resource *TableGetPropertiesResource `json:"resource,omitempty"`
6229 }
6230
6231
6232 type TableGetPropertiesResource struct {
6233
6234 ID *string `json:"id,omitempty"`
6235
6236 Rid *string `json:"_rid,omitempty"`
6237
6238 Ts interface{} `json:"_ts,omitempty"`
6239
6240 Etag *string `json:"_etag,omitempty"`
6241 }
6242
6243
6244 func (tgp TableGetPropertiesResource) MarshalJSON() ([]byte, error) {
6245 objectMap := make(map[string]interface{})
6246 if tgp.ID != nil {
6247 objectMap["id"] = tgp.ID
6248 }
6249 return json.Marshal(objectMap)
6250 }
6251
6252
6253 type TableGetResults struct {
6254 autorest.Response `json:"-"`
6255
6256 *TableGetProperties `json:"properties,omitempty"`
6257
6258 ID *string `json:"id,omitempty"`
6259
6260 Name *string `json:"name,omitempty"`
6261
6262 Type *string `json:"type,omitempty"`
6263
6264 Location *string `json:"location,omitempty"`
6265 Tags map[string]*string `json:"tags"`
6266 }
6267
6268
6269 func (tgr TableGetResults) MarshalJSON() ([]byte, error) {
6270 objectMap := make(map[string]interface{})
6271 if tgr.TableGetProperties != nil {
6272 objectMap["properties"] = tgr.TableGetProperties
6273 }
6274 if tgr.Location != nil {
6275 objectMap["location"] = tgr.Location
6276 }
6277 if tgr.Tags != nil {
6278 objectMap["tags"] = tgr.Tags
6279 }
6280 return json.Marshal(objectMap)
6281 }
6282
6283
6284 func (tgr *TableGetResults) UnmarshalJSON(body []byte) error {
6285 var m map[string]*json.RawMessage
6286 err := json.Unmarshal(body, &m)
6287 if err != nil {
6288 return err
6289 }
6290 for k, v := range m {
6291 switch k {
6292 case "properties":
6293 if v != nil {
6294 var tableGetProperties TableGetProperties
6295 err = json.Unmarshal(*v, &tableGetProperties)
6296 if err != nil {
6297 return err
6298 }
6299 tgr.TableGetProperties = &tableGetProperties
6300 }
6301 case "id":
6302 if v != nil {
6303 var ID string
6304 err = json.Unmarshal(*v, &ID)
6305 if err != nil {
6306 return err
6307 }
6308 tgr.ID = &ID
6309 }
6310 case "name":
6311 if v != nil {
6312 var name string
6313 err = json.Unmarshal(*v, &name)
6314 if err != nil {
6315 return err
6316 }
6317 tgr.Name = &name
6318 }
6319 case "type":
6320 if v != nil {
6321 var typeVar string
6322 err = json.Unmarshal(*v, &typeVar)
6323 if err != nil {
6324 return err
6325 }
6326 tgr.Type = &typeVar
6327 }
6328 case "location":
6329 if v != nil {
6330 var location string
6331 err = json.Unmarshal(*v, &location)
6332 if err != nil {
6333 return err
6334 }
6335 tgr.Location = &location
6336 }
6337 case "tags":
6338 if v != nil {
6339 var tags map[string]*string
6340 err = json.Unmarshal(*v, &tags)
6341 if err != nil {
6342 return err
6343 }
6344 tgr.Tags = tags
6345 }
6346 }
6347 }
6348
6349 return nil
6350 }
6351
6352
6353 type TableListResult struct {
6354 autorest.Response `json:"-"`
6355
6356 Value *[]TableGetResults `json:"value,omitempty"`
6357 }
6358
6359
6360 func (tlr TableListResult) MarshalJSON() ([]byte, error) {
6361 objectMap := make(map[string]interface{})
6362 return json.Marshal(objectMap)
6363 }
6364
6365
6366 type TableResource struct {
6367
6368 ID *string `json:"id,omitempty"`
6369 }
6370
6371
6372
6373 type TableResourcesCreateUpdateTableFuture struct {
6374 azure.FutureAPI
6375
6376
6377 Result func(TableResourcesClient) (TableGetResults, error)
6378 }
6379
6380
6381 func (future *TableResourcesCreateUpdateTableFuture) UnmarshalJSON(body []byte) error {
6382 var azFuture azure.Future
6383 if err := json.Unmarshal(body, &azFuture); err != nil {
6384 return err
6385 }
6386 future.FutureAPI = &azFuture
6387 future.Result = future.result
6388 return nil
6389 }
6390
6391
6392 func (future *TableResourcesCreateUpdateTableFuture) result(client TableResourcesClient) (tgr TableGetResults, err error) {
6393 var done bool
6394 done, err = future.DoneWithContext(context.Background(), client)
6395 if err != nil {
6396 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", future.Response(), "Polling failure")
6397 return
6398 }
6399 if !done {
6400 tgr.Response.Response = future.Response()
6401 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesCreateUpdateTableFuture")
6402 return
6403 }
6404 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6405 if tgr.Response.Response, err = future.GetResult(sender); err == nil && tgr.Response.Response.StatusCode != http.StatusNoContent {
6406 tgr, err = client.CreateUpdateTableResponder(tgr.Response.Response)
6407 if err != nil {
6408 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", tgr.Response.Response, "Failure responding to request")
6409 }
6410 }
6411 return
6412 }
6413
6414
6415
6416 type TableResourcesDeleteTableFuture struct {
6417 azure.FutureAPI
6418
6419
6420 Result func(TableResourcesClient) (autorest.Response, error)
6421 }
6422
6423
6424 func (future *TableResourcesDeleteTableFuture) UnmarshalJSON(body []byte) error {
6425 var azFuture azure.Future
6426 if err := json.Unmarshal(body, &azFuture); err != nil {
6427 return err
6428 }
6429 future.FutureAPI = &azFuture
6430 future.Result = future.result
6431 return nil
6432 }
6433
6434
6435 func (future *TableResourcesDeleteTableFuture) result(client TableResourcesClient) (ar autorest.Response, err error) {
6436 var done bool
6437 done, err = future.DoneWithContext(context.Background(), client)
6438 if err != nil {
6439 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesDeleteTableFuture", "Result", future.Response(), "Polling failure")
6440 return
6441 }
6442 if !done {
6443 ar.Response = future.Response()
6444 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesDeleteTableFuture")
6445 return
6446 }
6447 ar.Response = future.Response()
6448 return
6449 }
6450
6451
6452
6453 type TableResourcesUpdateTableThroughputFuture struct {
6454 azure.FutureAPI
6455
6456
6457 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error)
6458 }
6459
6460
6461 func (future *TableResourcesUpdateTableThroughputFuture) UnmarshalJSON(body []byte) error {
6462 var azFuture azure.Future
6463 if err := json.Unmarshal(body, &azFuture); err != nil {
6464 return err
6465 }
6466 future.FutureAPI = &azFuture
6467 future.Result = future.result
6468 return nil
6469 }
6470
6471
6472 func (future *TableResourcesUpdateTableThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
6473 var done bool
6474 done, err = future.DoneWithContext(context.Background(), client)
6475 if err != nil {
6476 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", future.Response(), "Polling failure")
6477 return
6478 }
6479 if !done {
6480 tsgr.Response.Response = future.Response()
6481 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesUpdateTableThroughputFuture")
6482 return
6483 }
6484 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6485 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
6486 tsgr, err = client.UpdateTableThroughputResponder(tsgr.Response.Response)
6487 if err != nil {
6488 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
6489 }
6490 }
6491 return
6492 }
6493
6494
6495 type ThroughputSettingsGetProperties struct {
6496 Resource *ThroughputSettingsGetPropertiesResource `json:"resource,omitempty"`
6497 }
6498
6499
6500 type ThroughputSettingsGetPropertiesResource struct {
6501
6502 Throughput *int32 `json:"throughput,omitempty"`
6503
6504 MinimumThroughput *string `json:"minimumThroughput,omitempty"`
6505
6506 OfferReplacePending *string `json:"offerReplacePending,omitempty"`
6507
6508 Rid *string `json:"_rid,omitempty"`
6509
6510 Ts interface{} `json:"_ts,omitempty"`
6511
6512 Etag *string `json:"_etag,omitempty"`
6513 }
6514
6515
6516 func (tsgp ThroughputSettingsGetPropertiesResource) MarshalJSON() ([]byte, error) {
6517 objectMap := make(map[string]interface{})
6518 if tsgp.Throughput != nil {
6519 objectMap["throughput"] = tsgp.Throughput
6520 }
6521 return json.Marshal(objectMap)
6522 }
6523
6524
6525 type ThroughputSettingsGetResults struct {
6526 autorest.Response `json:"-"`
6527
6528 *ThroughputSettingsGetProperties `json:"properties,omitempty"`
6529
6530 ID *string `json:"id,omitempty"`
6531
6532 Name *string `json:"name,omitempty"`
6533
6534 Type *string `json:"type,omitempty"`
6535
6536 Location *string `json:"location,omitempty"`
6537 Tags map[string]*string `json:"tags"`
6538 }
6539
6540
6541 func (tsgr ThroughputSettingsGetResults) MarshalJSON() ([]byte, error) {
6542 objectMap := make(map[string]interface{})
6543 if tsgr.ThroughputSettingsGetProperties != nil {
6544 objectMap["properties"] = tsgr.ThroughputSettingsGetProperties
6545 }
6546 if tsgr.Location != nil {
6547 objectMap["location"] = tsgr.Location
6548 }
6549 if tsgr.Tags != nil {
6550 objectMap["tags"] = tsgr.Tags
6551 }
6552 return json.Marshal(objectMap)
6553 }
6554
6555
6556 func (tsgr *ThroughputSettingsGetResults) UnmarshalJSON(body []byte) error {
6557 var m map[string]*json.RawMessage
6558 err := json.Unmarshal(body, &m)
6559 if err != nil {
6560 return err
6561 }
6562 for k, v := range m {
6563 switch k {
6564 case "properties":
6565 if v != nil {
6566 var throughputSettingsGetProperties ThroughputSettingsGetProperties
6567 err = json.Unmarshal(*v, &throughputSettingsGetProperties)
6568 if err != nil {
6569 return err
6570 }
6571 tsgr.ThroughputSettingsGetProperties = &throughputSettingsGetProperties
6572 }
6573 case "id":
6574 if v != nil {
6575 var ID string
6576 err = json.Unmarshal(*v, &ID)
6577 if err != nil {
6578 return err
6579 }
6580 tsgr.ID = &ID
6581 }
6582 case "name":
6583 if v != nil {
6584 var name string
6585 err = json.Unmarshal(*v, &name)
6586 if err != nil {
6587 return err
6588 }
6589 tsgr.Name = &name
6590 }
6591 case "type":
6592 if v != nil {
6593 var typeVar string
6594 err = json.Unmarshal(*v, &typeVar)
6595 if err != nil {
6596 return err
6597 }
6598 tsgr.Type = &typeVar
6599 }
6600 case "location":
6601 if v != nil {
6602 var location string
6603 err = json.Unmarshal(*v, &location)
6604 if err != nil {
6605 return err
6606 }
6607 tsgr.Location = &location
6608 }
6609 case "tags":
6610 if v != nil {
6611 var tags map[string]*string
6612 err = json.Unmarshal(*v, &tags)
6613 if err != nil {
6614 return err
6615 }
6616 tsgr.Tags = tags
6617 }
6618 }
6619 }
6620
6621 return nil
6622 }
6623
6624
6625 type ThroughputSettingsResource struct {
6626
6627 Throughput *int32 `json:"throughput,omitempty"`
6628
6629 MinimumThroughput *string `json:"minimumThroughput,omitempty"`
6630
6631 OfferReplacePending *string `json:"offerReplacePending,omitempty"`
6632 }
6633
6634
6635 func (tsr ThroughputSettingsResource) MarshalJSON() ([]byte, error) {
6636 objectMap := make(map[string]interface{})
6637 if tsr.Throughput != nil {
6638 objectMap["throughput"] = tsr.Throughput
6639 }
6640 return json.Marshal(objectMap)
6641 }
6642
6643
6644 type ThroughputSettingsUpdateParameters struct {
6645
6646 *ThroughputSettingsUpdateProperties `json:"properties,omitempty"`
6647
6648 ID *string `json:"id,omitempty"`
6649
6650 Name *string `json:"name,omitempty"`
6651
6652 Type *string `json:"type,omitempty"`
6653
6654 Location *string `json:"location,omitempty"`
6655 Tags map[string]*string `json:"tags"`
6656 }
6657
6658
6659 func (tsup ThroughputSettingsUpdateParameters) MarshalJSON() ([]byte, error) {
6660 objectMap := make(map[string]interface{})
6661 if tsup.ThroughputSettingsUpdateProperties != nil {
6662 objectMap["properties"] = tsup.ThroughputSettingsUpdateProperties
6663 }
6664 if tsup.Location != nil {
6665 objectMap["location"] = tsup.Location
6666 }
6667 if tsup.Tags != nil {
6668 objectMap["tags"] = tsup.Tags
6669 }
6670 return json.Marshal(objectMap)
6671 }
6672
6673
6674 func (tsup *ThroughputSettingsUpdateParameters) UnmarshalJSON(body []byte) error {
6675 var m map[string]*json.RawMessage
6676 err := json.Unmarshal(body, &m)
6677 if err != nil {
6678 return err
6679 }
6680 for k, v := range m {
6681 switch k {
6682 case "properties":
6683 if v != nil {
6684 var throughputSettingsUpdateProperties ThroughputSettingsUpdateProperties
6685 err = json.Unmarshal(*v, &throughputSettingsUpdateProperties)
6686 if err != nil {
6687 return err
6688 }
6689 tsup.ThroughputSettingsUpdateProperties = &throughputSettingsUpdateProperties
6690 }
6691 case "id":
6692 if v != nil {
6693 var ID string
6694 err = json.Unmarshal(*v, &ID)
6695 if err != nil {
6696 return err
6697 }
6698 tsup.ID = &ID
6699 }
6700 case "name":
6701 if v != nil {
6702 var name string
6703 err = json.Unmarshal(*v, &name)
6704 if err != nil {
6705 return err
6706 }
6707 tsup.Name = &name
6708 }
6709 case "type":
6710 if v != nil {
6711 var typeVar string
6712 err = json.Unmarshal(*v, &typeVar)
6713 if err != nil {
6714 return err
6715 }
6716 tsup.Type = &typeVar
6717 }
6718 case "location":
6719 if v != nil {
6720 var location string
6721 err = json.Unmarshal(*v, &location)
6722 if err != nil {
6723 return err
6724 }
6725 tsup.Location = &location
6726 }
6727 case "tags":
6728 if v != nil {
6729 var tags map[string]*string
6730 err = json.Unmarshal(*v, &tags)
6731 if err != nil {
6732 return err
6733 }
6734 tsup.Tags = tags
6735 }
6736 }
6737 }
6738
6739 return nil
6740 }
6741
6742
6743 type ThroughputSettingsUpdateProperties struct {
6744
6745 Resource *ThroughputSettingsResource `json:"resource,omitempty"`
6746 }
6747
6748
6749
6750 type UniqueKey struct {
6751
6752 Paths *[]string `json:"paths,omitempty"`
6753 }
6754
6755
6756
6757 type UniqueKeyPolicy struct {
6758
6759 UniqueKeys *[]UniqueKey `json:"uniqueKeys,omitempty"`
6760 }
6761
6762
6763 type Usage struct {
6764
6765 Unit UnitType `json:"unit,omitempty"`
6766
6767 Name *MetricName `json:"name,omitempty"`
6768
6769 QuotaPeriod *string `json:"quotaPeriod,omitempty"`
6770
6771 Limit *int64 `json:"limit,omitempty"`
6772
6773 CurrentValue *int64 `json:"currentValue,omitempty"`
6774 }
6775
6776
6777 func (u Usage) MarshalJSON() ([]byte, error) {
6778 objectMap := make(map[string]interface{})
6779 if u.Unit != "" {
6780 objectMap["unit"] = u.Unit
6781 }
6782 return json.Marshal(objectMap)
6783 }
6784
6785
6786 type UsagesResult struct {
6787 autorest.Response `json:"-"`
6788
6789 Value *[]Usage `json:"value,omitempty"`
6790 }
6791
6792
6793 func (ur UsagesResult) MarshalJSON() ([]byte, error) {
6794 objectMap := make(map[string]interface{})
6795 return json.Marshal(objectMap)
6796 }
6797
6798
6799 type VirtualNetworkRule struct {
6800
6801 ID *string `json:"id,omitempty"`
6802
6803 IgnoreMissingVNetServiceEndpoint *bool `json:"ignoreMissingVNetServiceEndpoint,omitempty"`
6804 }
6805
View as plain text