示例#1
0
        public static TransactGetItemsResponse Parse(Document response)
        {
            var responsesArray = response.TryGetValue("Responses", out var responsesAttribute)
                ? (IReadOnlyList <AttributeValue>)responsesAttribute.AsListAttribute().Items
                : Array.Empty <AttributeValue>();

            var items = new Document[responsesArray.Count];

            for (var i = 0; i < responsesArray.Count; i++)
            {
                items[i] = responsesArray[i].AsDocument()["Item"].AsDocument();
            }

            return(new TransactGetItemsResponse(items, CapacityParser.ParseTableConsumedCapacities(response)));
        }
示例#2
0
 public static BatchWriteItemResponse Parse(Document?response) =>
 response == null
         ? new BatchWriteItemResponse(null, null, null)
         : new BatchWriteItemResponse(CapacityParser.ParseTableConsumedCapacities(response), ItemCollectionMetricsParser.ParseMultipleItemCollectionMetrics(response),
                                      ParseFailedItems(response));
示例#3
0
 public static BatchGetItemResponse Parse(Document response) => new BatchGetItemResponse(CapacityParser.ParseTableConsumedCapacities(response),
                                                                                         ParseProcessedItems(response), ParseFailedItems(response));