forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
6304 lines (5895 loc) · 226 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package documentdb
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/cosmos-db/mgmt/2019-12-12-preview/documentdb"
// ARMProxyResource the resource model definition for a ARM proxy resource. It will have everything other
// than required location and tags
type ARMProxyResource struct {
// ID - READ-ONLY; The unique resource identifier of the database account.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the database account.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of Azure resource.
Type *string `json:"type,omitempty"`
}
// ARMResourceProperties the core properties of ARM resources.
type ARMResourceProperties struct {
// ID - READ-ONLY; The unique resource identifier of the ARM resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the ARM resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of Azure resource.
Type *string `json:"type,omitempty"`
// Location - The location of the resource group to which the resource belongs.
Location *string `json:"location,omitempty"`
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for ARMResourceProperties.
func (arp ARMResourceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if arp.Location != nil {
objectMap["location"] = arp.Location
}
if arp.Tags != nil {
objectMap["tags"] = arp.Tags
}
return json.Marshal(objectMap)
}
// AutoUpgradePolicyResource cosmos DB resource auto-upgrade policy
type AutoUpgradePolicyResource struct {
// ThroughputPolicy - Represents throughput policy which service must adhere to for auto-upgrade
ThroughputPolicy *ThroughputPolicyResource `json:"throughputPolicy,omitempty"`
}
// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
type AzureEntityResource struct {
// Etag - READ-ONLY; Resource Etag.
Etag *string `json:"etag,omitempty"`
// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `json:"type,omitempty"`
}
// Capability cosmos DB capability object
type Capability struct {
// Name - Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin".
Name *string `json:"name,omitempty"`
}
// CassandraKeyspaceCreateUpdateParameters parameters to create and update Cosmos DB Cassandra keyspace.
type CassandraKeyspaceCreateUpdateParameters struct {
// CassandraKeyspaceCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra keyspace.
*CassandraKeyspaceCreateUpdateProperties `json:"properties,omitempty"`
// ID - READ-ONLY; The unique resource identifier of the ARM resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the ARM resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of Azure resource.
Type *string `json:"type,omitempty"`
// Location - The location of the resource group to which the resource belongs.
Location *string `json:"location,omitempty"`
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for CassandraKeyspaceCreateUpdateParameters.
func (ckcup CassandraKeyspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ckcup.CassandraKeyspaceCreateUpdateProperties != nil {
objectMap["properties"] = ckcup.CassandraKeyspaceCreateUpdateProperties
}
if ckcup.Location != nil {
objectMap["location"] = ckcup.Location
}
if ckcup.Tags != nil {
objectMap["tags"] = ckcup.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for CassandraKeyspaceCreateUpdateParameters struct.
func (ckcup *CassandraKeyspaceCreateUpdateParameters) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var cassandraKeyspaceCreateUpdateProperties CassandraKeyspaceCreateUpdateProperties
err = json.Unmarshal(*v, &cassandraKeyspaceCreateUpdateProperties)
if err != nil {
return err
}
ckcup.CassandraKeyspaceCreateUpdateProperties = &cassandraKeyspaceCreateUpdateProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ckcup.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ckcup.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ckcup.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
ckcup.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
ckcup.Tags = tags
}
}
}
return nil
}
// CassandraKeyspaceCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra
// keyspace.
type CassandraKeyspaceCreateUpdateProperties struct {
// Resource - The standard JSON format of a Cassandra keyspace
Resource *CassandraKeyspaceResource `json:"resource,omitempty"`
// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
Options *CreateUpdateOptions `json:"options,omitempty"`
}
// CassandraKeyspaceGetProperties the properties of an Azure Cosmos DB Cassandra keyspace
type CassandraKeyspaceGetProperties struct {
Resource *CassandraKeyspaceGetPropertiesResource `json:"resource,omitempty"`
}
// CassandraKeyspaceGetPropertiesResource ...
type CassandraKeyspaceGetPropertiesResource struct {
// ID - Name of the Cosmos DB Cassandra keyspace
ID *string `json:"id,omitempty"`
// Rid - READ-ONLY; A system generated property. A unique identifier.
Rid *string `json:"_rid,omitempty"`
// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
Ts interface{} `json:"_ts,omitempty"`
// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
Etag *string `json:"_etag,omitempty"`
}
// MarshalJSON is the custom marshaler for CassandraKeyspaceGetPropertiesResource.
func (ckgp CassandraKeyspaceGetPropertiesResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ckgp.ID != nil {
objectMap["id"] = ckgp.ID
}
return json.Marshal(objectMap)
}
// CassandraKeyspaceGetResults an Azure Cosmos DB Cassandra keyspace.
type CassandraKeyspaceGetResults struct {
autorest.Response `json:"-"`
// CassandraKeyspaceGetProperties - The properties of an Azure Cosmos DB Cassandra keyspace
*CassandraKeyspaceGetProperties `json:"properties,omitempty"`
// ID - READ-ONLY; The unique resource identifier of the ARM resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the ARM resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of Azure resource.
Type *string `json:"type,omitempty"`
// Location - The location of the resource group to which the resource belongs.
Location *string `json:"location,omitempty"`
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for CassandraKeyspaceGetResults.
func (ckgr CassandraKeyspaceGetResults) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ckgr.CassandraKeyspaceGetProperties != nil {
objectMap["properties"] = ckgr.CassandraKeyspaceGetProperties
}
if ckgr.Location != nil {
objectMap["location"] = ckgr.Location
}
if ckgr.Tags != nil {
objectMap["tags"] = ckgr.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for CassandraKeyspaceGetResults struct.
func (ckgr *CassandraKeyspaceGetResults) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var cassandraKeyspaceGetProperties CassandraKeyspaceGetProperties
err = json.Unmarshal(*v, &cassandraKeyspaceGetProperties)
if err != nil {
return err
}
ckgr.CassandraKeyspaceGetProperties = &cassandraKeyspaceGetProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ckgr.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ckgr.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ckgr.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
ckgr.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
ckgr.Tags = tags
}
}
}
return nil
}
// CassandraKeyspaceListResult the List operation response, that contains the Cassandra keyspaces and their
// properties.
type CassandraKeyspaceListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; List of Cassandra keyspaces and their properties.
Value *[]CassandraKeyspaceGetResults `json:"value,omitempty"`
}
// CassandraKeyspaceResource cosmos DB Cassandra keyspace resource object
type CassandraKeyspaceResource struct {
// ID - Name of the Cosmos DB Cassandra keyspace
ID *string `json:"id,omitempty"`
}
// CassandraPartitionKey cosmos DB Cassandra table partition key
type CassandraPartitionKey struct {
// Name - Name of the Cosmos DB Cassandra table partition key
Name *string `json:"name,omitempty"`
}
// CassandraResourcesCreateUpdateCassandraKeyspaceFuture an abstraction for monitoring and retrieving the
// results of a long-running operation.
type CassandraResourcesCreateUpdateCassandraKeyspaceFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) Result(client CassandraResourcesClient) (ckgr CassandraKeyspaceGetResults, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ckgr.Response.Response, err = future.GetResult(sender); err == nil && ckgr.Response.Response.StatusCode != http.StatusNoContent {
ckgr, err = client.CreateUpdateCassandraKeyspaceResponder(ckgr.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", ckgr.Response.Response, "Failure responding to request")
}
}
return
}
// CassandraResourcesCreateUpdateCassandraTableFuture an abstraction for monitoring and retrieving the
// results of a long-running operation.
type CassandraResourcesCreateUpdateCassandraTableFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *CassandraResourcesCreateUpdateCassandraTableFuture) Result(client CassandraResourcesClient) (ctgr CassandraTableGetResults, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraTableFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ctgr.Response.Response, err = future.GetResult(sender); err == nil && ctgr.Response.Response.StatusCode != http.StatusNoContent {
ctgr, err = client.CreateUpdateCassandraTableResponder(ctgr.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", ctgr.Response.Response, "Failure responding to request")
}
}
return
}
// CassandraResourcesDeleteCassandraKeyspaceFuture an abstraction for monitoring and retrieving the results
// of a long-running operation.
type CassandraResourcesDeleteCassandraKeyspaceFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) Result(client CassandraResourcesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture")
return
}
ar.Response = future.Response()
return
}
// CassandraResourcesDeleteCassandraTableFuture an abstraction for monitoring and retrieving the results of
// a long-running operation.
type CassandraResourcesDeleteCassandraTableFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *CassandraResourcesDeleteCassandraTableFuture) Result(client CassandraResourcesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraTableFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraTableFuture")
return
}
ar.Response = future.Response()
return
}
// CassandraResourcesUpdateCassandraKeyspaceThroughputFuture an abstraction for monitoring and retrieving
// the results of a long-running operation.
type CassandraResourcesUpdateCassandraKeyspaceThroughputFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) Result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
tsgr, err = client.UpdateCassandraKeyspaceThroughputResponder(tsgr.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
}
}
return
}
// CassandraResourcesUpdateCassandraTableThroughputFuture an abstraction for monitoring and retrieving the
// results of a long-running operation.
type CassandraResourcesUpdateCassandraTableThroughputFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) Result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent {
tsgr, err = client.UpdateCassandraTableThroughputResponder(tsgr.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request")
}
}
return
}
// CassandraSchema cosmos DB Cassandra table schema
type CassandraSchema struct {
// Columns - List of Cassandra table columns.
Columns *[]Column `json:"columns,omitempty"`
// PartitionKeys - List of partition key.
PartitionKeys *[]CassandraPartitionKey `json:"partitionKeys,omitempty"`
// ClusterKeys - List of cluster key.
ClusterKeys *[]ClusterKey `json:"clusterKeys,omitempty"`
}
// CassandraTableCreateUpdateParameters parameters to create and update Cosmos DB Cassandra table.
type CassandraTableCreateUpdateParameters struct {
// CassandraTableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra table.
*CassandraTableCreateUpdateProperties `json:"properties,omitempty"`
// ID - READ-ONLY; The unique resource identifier of the ARM resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the ARM resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of Azure resource.
Type *string `json:"type,omitempty"`
// Location - The location of the resource group to which the resource belongs.
Location *string `json:"location,omitempty"`
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for CassandraTableCreateUpdateParameters.
func (ctcup CassandraTableCreateUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ctcup.CassandraTableCreateUpdateProperties != nil {
objectMap["properties"] = ctcup.CassandraTableCreateUpdateProperties
}
if ctcup.Location != nil {
objectMap["location"] = ctcup.Location
}
if ctcup.Tags != nil {
objectMap["tags"] = ctcup.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for CassandraTableCreateUpdateParameters struct.
func (ctcup *CassandraTableCreateUpdateParameters) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var cassandraTableCreateUpdateProperties CassandraTableCreateUpdateProperties
err = json.Unmarshal(*v, &cassandraTableCreateUpdateProperties)
if err != nil {
return err
}
ctcup.CassandraTableCreateUpdateProperties = &cassandraTableCreateUpdateProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ctcup.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ctcup.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ctcup.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
ctcup.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
ctcup.Tags = tags
}
}
}
return nil
}
// CassandraTableCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra table.
type CassandraTableCreateUpdateProperties struct {
// Resource - The standard JSON format of a Cassandra table
Resource *CassandraTableResource `json:"resource,omitempty"`
// Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
Options *CreateUpdateOptions `json:"options,omitempty"`
}
// CassandraTableGetProperties the properties of an Azure Cosmos DB Cassandra table
type CassandraTableGetProperties struct {
Resource *CassandraTableGetPropertiesResource `json:"resource,omitempty"`
}
// CassandraTableGetPropertiesResource ...
type CassandraTableGetPropertiesResource struct {
// ID - Name of the Cosmos DB Cassandra table
ID *string `json:"id,omitempty"`
// DefaultTTL - Time to live of the Cosmos DB Cassandra table
DefaultTTL *int32 `json:"defaultTtl,omitempty"`
// Schema - Schema of the Cosmos DB Cassandra table
Schema *CassandraSchema `json:"schema,omitempty"`
// Rid - READ-ONLY; A system generated property. A unique identifier.
Rid *string `json:"_rid,omitempty"`
// Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource.
Ts interface{} `json:"_ts,omitempty"`
// Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control.
Etag *string `json:"_etag,omitempty"`
}
// MarshalJSON is the custom marshaler for CassandraTableGetPropertiesResource.
func (ctgp CassandraTableGetPropertiesResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ctgp.ID != nil {
objectMap["id"] = ctgp.ID
}
if ctgp.DefaultTTL != nil {
objectMap["defaultTtl"] = ctgp.DefaultTTL
}
if ctgp.Schema != nil {
objectMap["schema"] = ctgp.Schema
}
return json.Marshal(objectMap)
}
// CassandraTableGetResults an Azure Cosmos DB Cassandra table.
type CassandraTableGetResults struct {
autorest.Response `json:"-"`
// CassandraTableGetProperties - The properties of an Azure Cosmos DB Cassandra table
*CassandraTableGetProperties `json:"properties,omitempty"`
// ID - READ-ONLY; The unique resource identifier of the ARM resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the ARM resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of Azure resource.
Type *string `json:"type,omitempty"`
// Location - The location of the resource group to which the resource belongs.
Location *string `json:"location,omitempty"`
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for CassandraTableGetResults.
func (ctgr CassandraTableGetResults) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ctgr.CassandraTableGetProperties != nil {
objectMap["properties"] = ctgr.CassandraTableGetProperties
}
if ctgr.Location != nil {
objectMap["location"] = ctgr.Location
}
if ctgr.Tags != nil {
objectMap["tags"] = ctgr.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for CassandraTableGetResults struct.
func (ctgr *CassandraTableGetResults) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var cassandraTableGetProperties CassandraTableGetProperties
err = json.Unmarshal(*v, &cassandraTableGetProperties)
if err != nil {
return err
}
ctgr.CassandraTableGetProperties = &cassandraTableGetProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ctgr.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ctgr.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ctgr.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
ctgr.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
ctgr.Tags = tags
}
}
}
return nil
}
// CassandraTableListResult the List operation response, that contains the Cassandra tables and their
// properties.
type CassandraTableListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; List of Cassandra tables and their properties.
Value *[]CassandraTableGetResults `json:"value,omitempty"`
}
// CassandraTableResource cosmos DB Cassandra table resource object
type CassandraTableResource struct {
// ID - Name of the Cosmos DB Cassandra table
ID *string `json:"id,omitempty"`
// DefaultTTL - Time to live of the Cosmos DB Cassandra table
DefaultTTL *int32 `json:"defaultTtl,omitempty"`
// Schema - Schema of the Cosmos DB Cassandra table
Schema *CassandraSchema `json:"schema,omitempty"`
}
// ClusterKey cosmos DB Cassandra table cluster key
type ClusterKey struct {
// Name - Name of the Cosmos DB Cassandra table cluster key
Name *string `json:"name,omitempty"`
// OrderBy - Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc"
OrderBy *string `json:"orderBy,omitempty"`
}
// Column cosmos DB Cassandra table column
type Column struct {
// Name - Name of the Cosmos DB Cassandra table column
Name *string `json:"name,omitempty"`
// Type - Type of the Cosmos DB Cassandra table column
Type *string `json:"type,omitempty"`
}
// CompositePath ...
type CompositePath struct {
// Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
Path *string `json:"path,omitempty"`
// Order - Sort order for composite paths. Possible values include: 'Ascending', 'Descending'
Order CompositePathSortOrder `json:"order,omitempty"`
}
// ConflictResolutionPolicy the conflict resolution policy for the container.
type ConflictResolutionPolicy struct {
// Mode - Indicates the conflict resolution mode. Possible values include: 'LastWriterWins', 'Custom'
Mode ConflictResolutionMode `json:"mode,omitempty"`
// ConflictResolutionPath - The conflict resolution path in the case of LastWriterWins mode.
ConflictResolutionPath *string `json:"conflictResolutionPath,omitempty"`
// ConflictResolutionProcedure - The procedure to resolve conflicts in the case of custom mode.
ConflictResolutionProcedure *string `json:"conflictResolutionProcedure,omitempty"`
}
// ConsistencyPolicy the consistency policy for the Cosmos DB database account.
type ConsistencyPolicy struct {
// DefaultConsistencyLevel - The default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix'
DefaultConsistencyLevel DefaultConsistencyLevel `json:"defaultConsistencyLevel,omitempty"`
// MaxStalenessPrefix - When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.
MaxStalenessPrefix *int64 `json:"maxStalenessPrefix,omitempty"`
// MaxIntervalInSeconds - When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.
MaxIntervalInSeconds *int32 `json:"maxIntervalInSeconds,omitempty"`
}
// ContainerPartitionKey the configuration of the partition key to be used for partitioning data into
// multiple partitions
type ContainerPartitionKey struct {
// Paths - List of paths using which data within the container can be partitioned
Paths *[]string `json:"paths,omitempty"`
// Kind - Indicates the kind of algorithm used for partitioning. Possible values include: 'PartitionKindHash', 'PartitionKindRange'
Kind PartitionKind `json:"kind,omitempty"`
// Version - Indicates the version of the partition key definition
Version *int32 `json:"version,omitempty"`
}
// CreateUpdateOptions createUpdateOptions are a list of key-value pairs that describe the resource.
// Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput"
type CreateUpdateOptions struct {
// AdditionalProperties - Unmatched properties from the message are deserialized this collection
AdditionalProperties map[string]*string `json:""`
// Throughput - Request Units per second. For example, "throughput": "10000".
Throughput *string `json:"throughput,omitempty"`
}
// MarshalJSON is the custom marshaler for CreateUpdateOptions.
func (cuo CreateUpdateOptions) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if cuo.Throughput != nil {
objectMap["throughput"] = cuo.Throughput
}
for k, v := range cuo.AdditionalProperties {
objectMap[k] = v
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for CreateUpdateOptions struct.
func (cuo *CreateUpdateOptions) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
default:
if v != nil {
var additionalProperties string
err = json.Unmarshal(*v, &additionalProperties)
if err != nil {
return err
}
if cuo.AdditionalProperties == nil {
cuo.AdditionalProperties = make(map[string]*string)
}
cuo.AdditionalProperties[k] = &additionalProperties
}
case "throughput":
if v != nil {
var throughput string
err = json.Unmarshal(*v, &throughput)
if err != nil {
return err
}
cuo.Throughput = &throughput
}
}
}
return nil
}
// DatabaseAccountConnectionString connection string for the Cosmos DB account
type DatabaseAccountConnectionString struct {
// ConnectionString - READ-ONLY; Value of the connection string
ConnectionString *string `json:"connectionString,omitempty"`
// Description - READ-ONLY; Description of the connection string
Description *string `json:"description,omitempty"`
}
// DatabaseAccountCreateUpdateParameters parameters to create and update Cosmos DB database accounts.
type DatabaseAccountCreateUpdateParameters struct {
// Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'
Kind DatabaseAccountKind `json:"kind,omitempty"`
*DatabaseAccountCreateUpdateProperties `json:"properties,omitempty"`
// ID - READ-ONLY; The unique resource identifier of the ARM resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the ARM resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of Azure resource.
Type *string `json:"type,omitempty"`
// Location - The location of the resource group to which the resource belongs.
Location *string `json:"location,omitempty"`
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for DatabaseAccountCreateUpdateParameters.
func (dacup DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if dacup.Kind != "" {
objectMap["kind"] = dacup.Kind
}
if dacup.DatabaseAccountCreateUpdateProperties != nil {
objectMap["properties"] = dacup.DatabaseAccountCreateUpdateProperties
}
if dacup.Location != nil {
objectMap["location"] = dacup.Location
}
if dacup.Tags != nil {
objectMap["tags"] = dacup.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for DatabaseAccountCreateUpdateParameters struct.
func (dacup *DatabaseAccountCreateUpdateParameters) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "kind":
if v != nil {
var kind DatabaseAccountKind
err = json.Unmarshal(*v, &kind)
if err != nil {
return err
}
dacup.Kind = kind
}
case "properties":
if v != nil {
var databaseAccountCreateUpdateProperties DatabaseAccountCreateUpdateProperties
err = json.Unmarshal(*v, &databaseAccountCreateUpdateProperties)
if err != nil {
return err
}
dacup.DatabaseAccountCreateUpdateProperties = &databaseAccountCreateUpdateProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
dacup.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
dacup.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
dacup.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
dacup.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string