/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { PutMetricAlarmResponse response = new PutMetricAlarmResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if (context.TestExpression("PutMetricAlarmResult", 2)) { UnmarshallResult(context, response); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context); } } } return(response); }
/// <summary> /// <para> Creates or updates an alarm and associates it with the /// specified Amazon CloudWatch metric. Optionally, this operation can /// associate one or more Amazon Simple Notification Service resources /// with the alarm. </para> <para> When this operation creates an alarm, /// the alarm state is immediately set to <c>INSUFFICIENT_DATA</c> . The /// alarm is evaluated and its <c>StateValue</c> is set appropriately. /// Any actions associated with the <c>StateValue</c> is then executed. /// </para> <para><b>NOTE:</b> When updating an existing alarm, its /// StateValue is left unchanged. </para> /// </summary> /// /// <param name="putMetricAlarmRequest">Container for the necessary /// parameters to execute the PutMetricAlarm service method on /// AmazonCloudWatch.</param> /// /// <exception cref="LimitExceededException"/> public PutMetricAlarmResponse PutMetricAlarm(PutMetricAlarmRequest putMetricAlarmRequest) { IRequest <PutMetricAlarmRequest> request = new PutMetricAlarmRequestMarshaller().Marshall(putMetricAlarmRequest); PutMetricAlarmResponse response = Invoke <PutMetricAlarmRequest, PutMetricAlarmResponse> (request, this.signer, PutMetricAlarmResponseUnmarshaller.GetInstance()); return(response); }
public static PutMetricAlarmResponse Unmarshall(UnmarshallerContext context) { PutMetricAlarmResponse putMetricAlarmResponse = new PutMetricAlarmResponse(); putMetricAlarmResponse.HttpResponse = context.HttpResponse; putMetricAlarmResponse.Success = context.BooleanValue("PutMetricAlarm.Success"); putMetricAlarmResponse.Code = context.StringValue("PutMetricAlarm.Code"); putMetricAlarmResponse.Message = context.StringValue("PutMetricAlarm.Message"); putMetricAlarmResponse.RequestId = context.StringValue("PutMetricAlarm.RequestId"); putMetricAlarmResponse.Datapoints = context.StringValue("PutMetricAlarm.Datapoints"); return(putMetricAlarmResponse); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { PutMetricAlarmResponse response = new PutMetricAlarmResponse(); while (context.Read()) { if (context.IsStartElement) { if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context); } } } return(response); }
private static void UnmarshallResult(XmlUnmarshallerContext context, PutMetricAlarmResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.ReadAtDepth(originalDepth)) { if (context.IsStartElement || context.IsAttribute) { } } return; }