/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListTagsForResourceResponse response = new ListTagsForResourceResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Tags", targetDepth)) { var unmarshaller = new ListUnmarshaller <Tag, TagUnmarshaller>(TagUnmarshaller.Instance); response.Tags = unmarshaller.Unmarshall(context); continue; } } return(response); }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonDocDBConfig config = new AmazonDocDBConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonDocDBClient client = new AmazonDocDBClient(creds, config); ListTagsForResourceResponse resp = new ListTagsForResourceResponse(); ListTagsForResourceRequest req = new ListTagsForResourceRequest { }; resp = client.ListTagsForResource(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.TagList) { AddObject(obj); } }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListTagsForResourceResponse response = new ListTagsForResourceResponse(); while (context.Read()) { if (context.IsStartElement) { if (context.TestExpression("ListTagsForResourceResult", 2)) { response.ListTagsForResourceResult = ListTagsForResourceResultUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context); } } } return(response); }
private static void UnmarshallResult(XmlUnmarshallerContext context, ListTagsForResourceResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Tags", targetDepth)) { var unmarshaller = TagsUnmarshaller.Instance; response.Tags = unmarshaller.Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }