private static void UnmarshallResult(XmlUnmarshallerContext context, DescribeMetricCollectionTypesResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.ReadAtDepth(originalDepth)) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Granularities/member", targetDepth)) { var unmarshaller = MetricGranularityTypeUnmarshaller.Instance; var item = unmarshaller.Unmarshall(context); response.Granularities.Add(item); continue; } if (context.TestExpression("Metrics/member", targetDepth)) { var unmarshaller = MetricCollectionTypeUnmarshaller.Instance; var item = unmarshaller.Unmarshall(context); response.Metrics.Add(item); continue; } } } return; }
/// <summary> /// <para> Returns a list of metrics and a corresponding list of granularities for each metric. </para> /// </summary> /// /// <param name="describeMetricCollectionTypesRequest">Container for the necessary parameters to execute the DescribeMetricCollectionTypes /// service method on AmazonAutoScaling.</param> /// /// <returns>The response from the DescribeMetricCollectionTypes service method, as returned by AmazonAutoScaling.</returns> /// public DescribeMetricCollectionTypesResponse DescribeMetricCollectionTypes(DescribeMetricCollectionTypesRequest describeMetricCollectionTypesRequest) { IRequest <DescribeMetricCollectionTypesRequest> request = new DescribeMetricCollectionTypesRequestMarshaller().Marshall(describeMetricCollectionTypesRequest); DescribeMetricCollectionTypesResponse response = Invoke <DescribeMetricCollectionTypesRequest, DescribeMetricCollectionTypesResponse> (request, this.signer, DescribeMetricCollectionTypesResponseUnmarshaller.GetInstance()); return(response); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DescribeMetricCollectionTypesResponse response = new DescribeMetricCollectionTypesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if (context.TestExpression("DescribeMetricCollectionTypesResult", 2)) { UnmarshallResult(context, response); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context); } } } return(response); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DescribeMetricCollectionTypesResponse response = new DescribeMetricCollectionTypesResponse(); while (context.Read()) { if (context.IsStartElement) { if (context.TestExpression("DescribeMetricCollectionTypesResult", 2)) { response.DescribeMetricCollectionTypesResult = DescribeMetricCollectionTypesResultUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context); } } } return(response); }
private static void UnmarshallResult(XmlUnmarshallerContext context, DescribeMetricCollectionTypesResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Metrics/member", targetDepth)) { response.Metrics.Add(MetricCollectionTypeUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("Granularities/member", targetDepth)) { response.Granularities.Add(MetricGranularityTypeUnmarshaller.GetInstance().Unmarshall(context)); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }