-
Notifications
You must be signed in to change notification settings - Fork 815
/
models.go
5991 lines (5577 loc) · 213 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/cosmos-db/mgmt/2019-08-01/documentdb"
// CompositePathSortOrder enumerates the values for composite path sort order.
type CompositePathSortOrder string
const (
// Ascending ...
Ascending CompositePathSortOrder = "Ascending"
// Descending ...
Descending CompositePathSortOrder = "Descending"
)
// PossibleCompositePathSortOrderValues returns an array of possible values for the CompositePathSortOrder const type.
func PossibleCompositePathSortOrderValues() []CompositePathSortOrder {
return []CompositePathSortOrder{Ascending, Descending}
}
// ConflictResolutionMode enumerates the values for conflict resolution mode.
type ConflictResolutionMode string
const (
// Custom ...
Custom ConflictResolutionMode = "Custom"
// LastWriterWins ...
LastWriterWins ConflictResolutionMode = "LastWriterWins"
)
// PossibleConflictResolutionModeValues returns an array of possible values for the ConflictResolutionMode const type.
func PossibleConflictResolutionModeValues() []ConflictResolutionMode {
return []ConflictResolutionMode{Custom, LastWriterWins}
}
// ConnectorOffer enumerates the values for connector offer.
type ConnectorOffer string
const (
// Small ...
Small ConnectorOffer = "Small"
)
// PossibleConnectorOfferValues returns an array of possible values for the ConnectorOffer const type.
func PossibleConnectorOfferValues() []ConnectorOffer {
return []ConnectorOffer{Small}
}
// DatabaseAccountKind enumerates the values for database account kind.
type DatabaseAccountKind string
const (
// GlobalDocumentDB ...
GlobalDocumentDB DatabaseAccountKind = "GlobalDocumentDB"
// MongoDB ...
MongoDB DatabaseAccountKind = "MongoDB"
// Parse ...
Parse DatabaseAccountKind = "Parse"
)
// PossibleDatabaseAccountKindValues returns an array of possible values for the DatabaseAccountKind const type.
func PossibleDatabaseAccountKindValues() []DatabaseAccountKind {
return []DatabaseAccountKind{GlobalDocumentDB, MongoDB, Parse}
}
// DatabaseAccountOfferType enumerates the values for database account offer type.
type DatabaseAccountOfferType string
const (
// Standard ...
Standard DatabaseAccountOfferType = "Standard"
)
// PossibleDatabaseAccountOfferTypeValues returns an array of possible values for the DatabaseAccountOfferType const type.
func PossibleDatabaseAccountOfferTypeValues() []DatabaseAccountOfferType {
return []DatabaseAccountOfferType{Standard}
}
// DataType enumerates the values for data type.
type DataType string
const (
// LineString ...
LineString DataType = "LineString"
// MultiPolygon ...
MultiPolygon DataType = "MultiPolygon"
// Number ...
Number DataType = "Number"
// Point ...
Point DataType = "Point"
// Polygon ...
Polygon DataType = "Polygon"
// String ...
String DataType = "String"
)
// PossibleDataTypeValues returns an array of possible values for the DataType const type.
func PossibleDataTypeValues() []DataType {
return []DataType{LineString, MultiPolygon, Number, Point, Polygon, String}
}
// DefaultConsistencyLevel enumerates the values for default consistency level.
type DefaultConsistencyLevel string
const (
// BoundedStaleness ...
BoundedStaleness DefaultConsistencyLevel = "BoundedStaleness"
// ConsistentPrefix ...
ConsistentPrefix DefaultConsistencyLevel = "ConsistentPrefix"
// Eventual ...
Eventual DefaultConsistencyLevel = "Eventual"
// Session ...
Session DefaultConsistencyLevel = "Session"
// Strong ...
Strong DefaultConsistencyLevel = "Strong"
)
// PossibleDefaultConsistencyLevelValues returns an array of possible values for the DefaultConsistencyLevel const type.
func PossibleDefaultConsistencyLevelValues() []DefaultConsistencyLevel {
return []DefaultConsistencyLevel{BoundedStaleness, ConsistentPrefix, Eventual, Session, Strong}
}
// IndexingMode enumerates the values for indexing mode.
type IndexingMode string
const (
// Consistent ...
Consistent IndexingMode = "Consistent"
// Lazy ...
Lazy IndexingMode = "Lazy"
// None ...
None IndexingMode = "None"
)
// PossibleIndexingModeValues returns an array of possible values for the IndexingMode const type.
func PossibleIndexingModeValues() []IndexingMode {
return []IndexingMode{Consistent, Lazy, None}
}
// IndexKind enumerates the values for index kind.
type IndexKind string
const (
// Hash ...
Hash IndexKind = "Hash"
// Range ...
Range IndexKind = "Range"
// Spatial ...
Spatial IndexKind = "Spatial"
)
// PossibleIndexKindValues returns an array of possible values for the IndexKind const type.
func PossibleIndexKindValues() []IndexKind {
return []IndexKind{Hash, Range, Spatial}
}
// KeyKind enumerates the values for key kind.
type KeyKind string
const (
// Primary ...
Primary KeyKind = "primary"
// PrimaryReadonly ...
PrimaryReadonly KeyKind = "primaryReadonly"
// Secondary ...
Secondary KeyKind = "secondary"
// SecondaryReadonly ...
SecondaryReadonly KeyKind = "secondaryReadonly"
)
// PossibleKeyKindValues returns an array of possible values for the KeyKind const type.
func PossibleKeyKindValues() []KeyKind {
return []KeyKind{Primary, PrimaryReadonly, Secondary, SecondaryReadonly}
}
// PartitionKind enumerates the values for partition kind.
type PartitionKind string
const (
// PartitionKindHash ...
PartitionKindHash PartitionKind = "Hash"
// PartitionKindRange ...
PartitionKindRange PartitionKind = "Range"
)
// PossiblePartitionKindValues returns an array of possible values for the PartitionKind const type.
func PossiblePartitionKindValues() []PartitionKind {
return []PartitionKind{PartitionKindHash, PartitionKindRange}
}
// PrimaryAggregationType enumerates the values for primary aggregation type.
type PrimaryAggregationType string
const (
// PrimaryAggregationTypeAverage ...
PrimaryAggregationTypeAverage PrimaryAggregationType = "Average"
// PrimaryAggregationTypeLast ...
PrimaryAggregationTypeLast PrimaryAggregationType = "Last"
// PrimaryAggregationTypeMaximum ...
PrimaryAggregationTypeMaximum PrimaryAggregationType = "Maximum"
// PrimaryAggregationTypeMinimum ...
PrimaryAggregationTypeMinimum PrimaryAggregationType = "Minimum"
// PrimaryAggregationTypeNone ...
PrimaryAggregationTypeNone PrimaryAggregationType = "None"
// PrimaryAggregationTypeTotal ...
PrimaryAggregationTypeTotal PrimaryAggregationType = "Total"
)
// PossiblePrimaryAggregationTypeValues returns an array of possible values for the PrimaryAggregationType const type.
func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType {
return []PrimaryAggregationType{PrimaryAggregationTypeAverage, PrimaryAggregationTypeLast, PrimaryAggregationTypeMaximum, PrimaryAggregationTypeMinimum, PrimaryAggregationTypeNone, PrimaryAggregationTypeTotal}
}
// SpatialType enumerates the values for spatial type.
type SpatialType string
const (
// SpatialTypeLineString ...
SpatialTypeLineString SpatialType = "LineString"
// SpatialTypeMultiPolygon ...
SpatialTypeMultiPolygon SpatialType = "MultiPolygon"
// SpatialTypePoint ...
SpatialTypePoint SpatialType = "Point"
// SpatialTypePolygon ...
SpatialTypePolygon SpatialType = "Polygon"
)
// PossibleSpatialTypeValues returns an array of possible values for the SpatialType const type.
func PossibleSpatialTypeValues() []SpatialType {
return []SpatialType{SpatialTypeLineString, SpatialTypeMultiPolygon, SpatialTypePoint, SpatialTypePolygon}
}
// TriggerOperation enumerates the values for trigger operation.
type TriggerOperation string
const (
// All ...
All TriggerOperation = "All"
// Create ...
Create TriggerOperation = "Create"
// Delete ...
Delete TriggerOperation = "Delete"
// Replace ...
Replace TriggerOperation = "Replace"
// Update ...
Update TriggerOperation = "Update"
)
// PossibleTriggerOperationValues returns an array of possible values for the TriggerOperation const type.
func PossibleTriggerOperationValues() []TriggerOperation {
return []TriggerOperation{All, Create, Delete, Replace, Update}
}
// TriggerType enumerates the values for trigger type.
type TriggerType string
const (
// Post ...
Post TriggerType = "Post"
// Pre ...
Pre TriggerType = "Pre"
)
// PossibleTriggerTypeValues returns an array of possible values for the TriggerType const type.
func PossibleTriggerTypeValues() []TriggerType {
return []TriggerType{Post, Pre}
}
// UnitType enumerates the values for unit type.
type UnitType string
const (
// Bytes ...
Bytes UnitType = "Bytes"
// BytesPerSecond ...
BytesPerSecond UnitType = "BytesPerSecond"
// Count ...
Count UnitType = "Count"
// CountPerSecond ...
CountPerSecond UnitType = "CountPerSecond"
// Milliseconds ...
Milliseconds UnitType = "Milliseconds"
// Percent ...
Percent UnitType = "Percent"
// Seconds ...
Seconds UnitType = "Seconds"
)
// PossibleUnitTypeValues returns an array of possible values for the UnitType const type.
func PossibleUnitTypeValues() []UnitType {
return []UnitType{Bytes, BytesPerSecond, Count, CountPerSecond, Milliseconds, Percent, Seconds}
}
// 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)
}
// 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 map[string]*string `json:"options"`
}
// MarshalJSON is the custom marshaler for CassandraKeyspaceCreateUpdateProperties.
func (ckcup CassandraKeyspaceCreateUpdateProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ckcup.Resource != nil {
objectMap["resource"] = ckcup.Resource
}
if ckcup.Options != nil {
objectMap["options"] = ckcup.Options
}
return json.Marshal(objectMap)
}
// 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"`
}
// 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 map[string]*string `json:"options"`
}
// MarshalJSON is the custom marshaler for CassandraTableCreateUpdateProperties.
func (ctcup CassandraTableCreateUpdateProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ctcup.Resource != nil {
objectMap["resource"] = ctcup.Resource
}
if ctcup.Options != nil {
objectMap["options"] = ctcup.Options
}
return json.Marshal(objectMap)
}
// 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"`
}
// 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":