@@ -42,8 +42,8 @@ public void UpdateRedirects(string kvsName, IReadOnlyDictionary<string, string>
4242 ConsoleApp . Log ( "Describing KeyValueStore" ) ;
4343 try
4444 {
45- var json = Capture ( "aws" , "cloudfront" , "describe-key-value-store" , "--name" , kvsName , "|" , "jq" , "-c" ) ;
46- var describeResponse = JsonSerializer . Deserialize < DescribeKeyValueStoreResponse > ( json , AwsCloudFrontKeyValueStoreJsonContext . Default . DescribeKeyValueStoreResponse ) ;
45+ var json = CaptureMultiple ( "aws" , "cloudfront" , "describe-key-value-store" , "--name" , kvsName ) ;
46+ var describeResponse = JsonSerializer . Deserialize < DescribeKeyValueStoreResponse > ( string . Concat ( json ) , AwsCloudFrontKeyValueStoreJsonContext . Default . DescribeKeyValueStoreResponse ) ;
4747 if ( describeResponse ? . ETag is not null && describeResponse . KeyValueStore is { ARN . Length : > 0 } )
4848 return ( describeResponse . KeyValueStore . ARN , describeResponse . ETag ) ;
4949
@@ -67,8 +67,8 @@ private HashSet<string> ListAllKeys(string kvsArn)
6767 {
6868 do
6969 {
70- var json = Capture ( "aws" , [ .. baseArgs , .. nextToken is not null ? ( string [ ] ) [ "--starting-token" , nextToken ] : [ ] , "|" , "jq" , "-c" ] ) ;
71- var response = JsonSerializer . Deserialize < ListKeysResponse > ( json , AwsCloudFrontKeyValueStoreJsonContext . Default . ListKeysResponse ) ;
70+ var json = CaptureMultiple ( "aws" , [ .. baseArgs , .. nextToken is not null ? ( string [ ] ) [ "--starting-token" , nextToken ] : [ ] ] ) ;
71+ var response = JsonSerializer . Deserialize < ListKeysResponse > ( string . Concat ( json ) , AwsCloudFrontKeyValueStoreJsonContext . Default . ListKeysResponse ) ;
7272
7373 if ( response ? . Items != null )
7474 {
@@ -108,9 +108,9 @@ private string ProcessBatchUpdates(
108108 AwsCloudFrontKeyValueStoreJsonContext . Default . ListDeleteKeyRequestListItem ) ,
109109 _ => string . Empty
110110 } ;
111- var responseJson = Capture ( false , 1 , "aws" , "cloudfront-keyvaluestore" , "update-keys" , "--kvs-arn" , kvsArn , "--if-match" , eTag ,
112- $ "--{ operation . ToString ( ) . ToLowerInvariant ( ) } ", "--payload" , payload , "|" , "jq" , "-c" ) ;
113- var updateResponse = JsonSerializer . Deserialize < UpdateKeysResponse > ( responseJson , AwsCloudFrontKeyValueStoreJsonContext . Default . UpdateKeysResponse ) ;
111+ var responseJson = CaptureMultiple ( false , 1 , "aws" , "cloudfront-keyvaluestore" , "update-keys" , "--kvs-arn" , kvsArn , "--if-match" , eTag ,
112+ $ "--{ operation . ToString ( ) . ToLowerInvariant ( ) } ", "--payload" , payload ) ;
113+ var updateResponse = JsonSerializer . Deserialize < UpdateKeysResponse > ( string . Concat ( responseJson ) , AwsCloudFrontKeyValueStoreJsonContext . Default . UpdateKeysResponse ) ;
114114
115115 if ( string . IsNullOrEmpty ( updateResponse ? . ETag ) )
116116 throw new Exception ( "Failed to get new ETag after update operation." ) ;
0 commit comments