Example #1
0
        public async Task <GetItemResult> GetItemAsync(GetItemRequest request)
        {
            var httpRequest = Setup("GetItem", request.ToJson());

            var json = await SendAndReadJsonElementAsync(httpRequest).ConfigureAwait(false);

            return(GetItemResult.FromJsonElement(json));
        }
Example #2
0
        /*
         * public void DeleteTable()
         * {
         *  throw new NotImplementedException();
         * }
         *
         * public void DescribeTable()
         * {
         *  throw new NotImplementedException();
         * }
         */

        public async Task <GetItemResult> GetItemAsync(GetItemRequest request)
        {
            var httpRequest = Setup("GetItem", request.ToJson());

            var responseText = await SendAsync(httpRequest).ConfigureAwait(false);

            var responseJson = JsonObject.Parse(responseText);

            return(GetItemResult.FromJson(responseJson));
        }
Example #3
0
        public static GetItemResult FromJson(JsonObject json)
        {
            var result = new GetItemResult();

            if (json.ContainsKey("ConsumedCapacity"))
            {
                result.ConsumedCapacity = ConsumedCapacity.FromJson((JsonObject)json["ConsumedCapacity"]);
            }

            if (json.ContainsKey("Item"))
            {
                result.Item = AttributeCollection.FromJson((JsonObject)json["Item"]);
            }

            return(result);
        }
Example #4
0
        public static GetItemResult FromJson(JsonObject json)
        {
            var result = new GetItemResult();


            if (json.TryGetValue("ConsumedCapacity", out var consumedCapacityNode))
            {
                result.ConsumedCapacity = ConsumedCapacity.FromJson((JsonObject)consumedCapacityNode);
            }

            if (json.TryGetValue("Item", out var itemNode))
            {
                result.Item = AttributeCollection.FromJson((JsonObject)itemNode);
            }

            return(result);
        }