@@ -499,6 +499,7 @@ module {:options "-functionSyntax:4"} JsonConfig {
499499 var compoundBeacons : seq < Types. CompoundBeacon> := [];
500500 var virtualFields : seq < Types. VirtualField> := [];
501501 var keySource : Option< Types. BeaconKeySource> := None;
502+ var numberOfBuckets: Option< Types. BucketCount> := None;
502503
503504 for i := 0 to |data. obj| {
504505 var obj := data. obj[i];
@@ -507,6 +508,13 @@ module {:options "-functionSyntax:4"} JsonConfig {
507508 case "standardBeacons" => standardBeacons :- GetStandardBeacons (obj.1);
508509 case "compoundBeacons" => compoundBeacons :- GetCompoundBeacons (obj.1);
509510 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);
510518 case _ => return Failure ("Unexpected part of a beacon version : '" + obj.0 + "'");
511519 }
512520 }
@@ -529,7 +537,8 @@ module {:options "-functionSyntax:4"} JsonConfig {
529537 compoundBeacons := OptSeq(compoundBeacons),
530538 virtualFields := OptSeq (virtualFields),
531539 encryptedParts := None,
532- signedParts := None
540+ signedParts := None,
541+ numberOfBuckets := numberOfBuckets
533542 )
534543 );
535544 }
@@ -628,7 +637,7 @@ module {:options "-functionSyntax:4"} JsonConfig {
628637 var results := prev;
629638 for i := 0 to |gsi| {
630639 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 {
632641 results := results + [DDB. AttributeDefinition (AttributeName := gsi[i].KeySchema[j].AttributeName, AttributeType := DDB.ScalarAttributeType.S)];
633642 }
634643 }
@@ -1096,6 +1105,8 @@ module {:options "-functionSyntax:4"} JsonConfig {
10961105 var name : string := "";
10971106 var length : int := - 1;
10981107 var loc : Option< Types. TerminalLocation> := None;
1108+ var numberOfBuckets: Option< Types. BucketCount> := None;
1109+
10991110 for i := 0 to |data. obj| {
11001111 var obj := data. obj[i];
11011112 match obj. 0 {
@@ -1109,12 +1120,19 @@ module {:options "-functionSyntax:4"} JsonConfig {
11091120 :- Need (obj.1.String?, "Standard Beacon Location must be a string");
11101121 :- Need (0 < |obj.1.str|, "Standard Beacon Location must nt be an empty string.");
11111122 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);
11121130 case _ => return Failure ("Unexpected part of a standard beacon : '" + data.obj[i].0 + "'");
11131131 }
11141132 }
11151133 :- Need (0 < |name|, "Each Standard Beacon needs a name.");
11161134 :- 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 ));
11181136 }
11191137
11201138 method GetGSIs (data : JSON ) returns (output : Result< seq < DDB. GlobalSecondaryIndex> , string > )
@@ -1152,10 +1170,15 @@ module {:options "-functionSyntax:4"} JsonConfig {
11521170 IndexName := data.arr[0].str,
11531171 KeySchema := schema,
11541172 Projection := DDB.Projection(
1155- ProjectionType := None ,
1173+ ProjectionType := Some(DDB.ProjectionType.ALL) ,
11561174 NonKeyAttributes := None
11571175 ),
1158- ProvisionedThroughput := None
1176+ ProvisionedThroughput := Some (
1177+ DDB.ProvisionedThroughput (
1178+ ReadCapacityUnits:= 5,
1179+ WriteCapacityUnits:= 5
1180+ )
1181+ )
11591182 ));
11601183 }
11611184
0 commit comments