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))); }
public static BatchWriteItemResponse Parse(Document?response) => response == null ? new BatchWriteItemResponse(null, null, null) : new BatchWriteItemResponse(CapacityParser.ParseTableConsumedCapacities(response), ItemCollectionMetricsParser.ParseMultipleItemCollectionMetrics(response), ParseFailedItems(response));
public static BatchGetItemResponse Parse(Document response) => new BatchGetItemResponse(CapacityParser.ParseTableConsumedCapacities(response), ParseProcessedItems(response), ParseFailedItems(response));