@@ -499,6 +499,7 @@ module {:options "-functionSyntax:4"} JsonConfig {
499
499
var compoundBeacons : seq < Types. CompoundBeacon> := [];
500
500
var virtualFields : seq < Types. VirtualField> := [];
501
501
var keySource : Option< Types. BeaconKeySource> := None;
502
+ var numberOfBuckets: Option< Types. BucketCount> := None;
502
503
503
504
for i := 0 to |data. obj| {
504
505
var obj := data. obj[i];
@@ -507,6 +508,13 @@ module {:options "-functionSyntax:4"} JsonConfig {
507
508
case "standardBeacons" => standardBeacons :- GetStandardBeacons (obj.1);
508
509
case "compoundBeacons" => compoundBeacons :- GetCompoundBeacons (obj.1);
509
510
case "virtualFields" => virtualFields :- GetVirtualFields (obj.1);
511
+ case "numberOfBuckets" =>
512
+ :- Need (obj.1.Number?, "numberOfBuckets must be of type Number.");
513
+ var num :- DecimalToNat (obj.1.num);
514
+ expect 0 < num < INT32_MAX_LIMIT;
515
+ var num2 := num as int32;
516
+ expect Types. IsValid_BucketCount (num2);
517
+ numberOfBuckets := Some (num as Types.BucketCount);
510
518
case _ => return Failure ("Unexpected part of a beacon version : '" + obj.0 + "'");
511
519
}
512
520
}
@@ -529,7 +537,8 @@ module {:options "-functionSyntax:4"} JsonConfig {
529
537
compoundBeacons := OptSeq(compoundBeacons),
530
538
virtualFields := OptSeq (virtualFields),
531
539
encryptedParts := None,
532
- signedParts := None
540
+ signedParts := None,
541
+ numberOfBuckets := numberOfBuckets
533
542
)
534
543
);
535
544
}
@@ -628,7 +637,7 @@ module {:options "-functionSyntax:4"} JsonConfig {
628
637
var results := prev;
629
638
for i := 0 to |gsi| {
630
639
for j := 0 to |gsi[i]. KeySchema| {
631
- if forall k < - prev :: k. AttributeName != gsi[i]. KeySchema[j]. AttributeName {
640
+ if forall k < - results :: k. AttributeName != gsi[i]. KeySchema[j]. AttributeName {
632
641
results := results + [DDB. AttributeDefinition (AttributeName := gsi[i].KeySchema[j].AttributeName, AttributeType := DDB.ScalarAttributeType.S)];
633
642
}
634
643
}
@@ -1096,6 +1105,8 @@ module {:options "-functionSyntax:4"} JsonConfig {
1096
1105
var name : string := "";
1097
1106
var length : int := - 1;
1098
1107
var loc : Option< Types. TerminalLocation> := None;
1108
+ var numberOfBuckets: Option< Types. BucketCount> := None;
1109
+
1099
1110
for i := 0 to |data. obj| {
1100
1111
var obj := data. obj[i];
1101
1112
match obj. 0 {
@@ -1109,12 +1120,19 @@ module {:options "-functionSyntax:4"} JsonConfig {
1109
1120
:- Need (obj.1.String?, "Standard Beacon Location must be a string");
1110
1121
:- Need (0 < |obj.1.str|, "Standard Beacon Location must nt be an empty string.");
1111
1122
loc := Some (obj.1.str);
1123
+ case "numberOfBuckets" =>
1124
+ :- Need (obj.1.Number?, "numberOfBuckets must be of type Number.");
1125
+ var num :- DecimalToNat (obj.1.num);
1126
+ expect 0 < num < INT32_MAX_LIMIT;
1127
+ var num2 := num as int32;
1128
+ expect Types. IsValid_BucketCount (num2);
1129
+ numberOfBuckets := Some (num as Types.BucketCount);
1112
1130
case _ => return Failure ("Unexpected part of a standard beacon : '" + data.obj[i].0 + "'");
1113
1131
}
1114
1132
}
1115
1133
:- Need (0 < |name|, "Each Standard Beacon needs a name.");
1116
1134
:- Need (0 < length < 100 && Types.IsValid_BeaconBitLength(length as int32), "Each Standard Beacon needs a length between 1 and 63. ");
1117
- return Success (Types.StandardBeacon(name := name, length := length as Types.BeaconBitLength, loc := loc, style := None));
1135
+ return Success (Types.StandardBeacon(name := name, length := length as Types.BeaconBitLength, loc := loc, style := None, numberOfBuckets := numberOfBuckets ));
1118
1136
}
1119
1137
1120
1138
method GetGSIs (data : JSON ) returns (output : Result< seq < DDB. GlobalSecondaryIndex> , string > )
@@ -1152,10 +1170,15 @@ module {:options "-functionSyntax:4"} JsonConfig {
1152
1170
IndexName := data.arr[0].str,
1153
1171
KeySchema := schema,
1154
1172
Projection := DDB.Projection(
1155
- ProjectionType := None ,
1173
+ ProjectionType := Some(DDB.ProjectionType.ALL) ,
1156
1174
NonKeyAttributes := None
1157
1175
),
1158
- ProvisionedThroughput := None
1176
+ ProvisionedThroughput := Some (
1177
+ DDB.ProvisionedThroughput (
1178
+ ReadCapacityUnits:= 5,
1179
+ WriteCapacityUnits:= 5
1180
+ )
1181
+ )
1159
1182
));
1160
1183
}
1161
1184
0 commit comments