public void TestBatchDeleteAttributes() { List<ReplaceableAttribute> list = new List<ReplaceableAttribute> (); list.Add (new ReplaceableAttribute ("Test", "Test", true)); List<ReplaceableItem> items = new List<ReplaceableItem> (); ReplaceableItem item0 = new ReplaceableItem ("0", list); items.Add (item0); ReplaceableItem item1 = new ReplaceableItem ("1", list); items.Add (item1); BatchPutAttributesRequest request = new BatchPutAttributesRequest ("Test", items); BatchPutAttributesResponse response = Client.BatchPutAttributes (request).Result; Assert.AreEqual (HttpStatusCode.OK, response.HttpStatusCode); List<Attribute> list2 = new List<Attribute> (); list2.Add (new Attribute ("Test", "Test")); List<Item> items2 = new List<Item> (); items2.Add (new Item ("0", list2.ToArray ())); items2.Add (new Item ("1", list2.ToArray ())); BatchDeleteAttributesRequest request2 = new BatchDeleteAttributesRequest ("Test", items2); BatchDeleteAttributesResponse response2 = Client.BatchDeleteAttributes (request2).Result; Assert.AreEqual (HttpStatusCode.OK, response2.HttpStatusCode); }
public void Configure(BatchDeleteAttributesRequest request) { base.Configure (request); for (int itemCount = 0; itemCount < request.Items.Count; itemCount++) { Item item = request.Items [itemCount]; Arguments.Add ("Item." + (itemCount) + ".ItemName", item.Name); //TODO should this be implemtented? /*for (int attributeCount = 0; attributeCount < item.Attributes.Count; attributeCount++) { Attribute attribute = item.Attributes [attributeCount]; Arguments.Add ("Item." + (itemCount) + ".Attribute." + (attributeCount) + ".Name", attribute.Name); Arguments.Add ("Item." + (itemCount) + ".Attribute." + (attributeCount) + ".Value", attribute.Value); }*/ } }
public async Task<BatchDeleteAttributesResponse> BatchDeleteAttributes (BatchDeleteAttributesRequest request) { using (HttpClient Client = new HttpClient ()) { BatchDeleteAttributesRequestMarshaller marshaller = new BatchDeleteAttributesRequestMarshaller (); marshaller.Configure (request); HttpResponseMessage responseMessage; try { responseMessage = await Client.SendAsync (ConfigureClient (Client, marshaller)); } catch (WebException e) { throw new AWSConnectionException (e); } BatchDeleteAttributtesResponseUnMarshaller unmarshaler = new BatchDeleteAttributtesResponseUnMarshaller (); unmarshaler.Configure (responseMessage); return unmarshaler.UnMarshal (); } }