private static void UnmarshallResult(XmlUnmarshallerContext context, DescribeAutoScalingNotificationTypesResponse 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("AutoScalingNotificationTypes/member", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; var item = unmarshaller.Unmarshall(context); response.AutoScalingNotificationTypes.Add(item); continue; } } } return; }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DescribeAutoScalingNotificationTypesResponse response = new DescribeAutoScalingNotificationTypesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if (context.TestExpression("DescribeAutoScalingNotificationTypesResult", 2)) { UnmarshallResult(context, response); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context); } } } return(response); }
/// <summary> /// Notification configuration window load event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void NcWindow_Loaded(object sender, RoutedEventArgs e) { try { AmazonAutoScalingConfig config = new AmazonAutoScalingConfig(); config.ServiceURL = ((ViewModel)this.DataContext).Region.Url; AmazonAutoScalingClient client = new AmazonAutoScalingClient(config); DescribeAutoScalingNotificationTypesRequest dasntreq = new DescribeAutoScalingNotificationTypesRequest(); DescribeAutoScalingNotificationTypesResponse dasntresp = client.DescribeAutoScalingNotificationTypes(dasntreq); foreach (string asnt in dasntresp.DescribeAutoScalingNotificationTypesResult.AutoScalingNotificationTypes) { this.notificationTypes.Add(asnt); } AmazonSimpleNotificationServiceConfig snsconfig = new AmazonSimpleNotificationServiceConfig(); config.ServiceURL = ((ViewModel)this.DataContext).Region.Url; AmazonSimpleNotificationServiceClient snsclient = new AmazonSimpleNotificationServiceClient(snsconfig); ListTopicsRequest ltrequest = new ListTopicsRequest(); ListTopicsResponse ltresp = snsclient.ListTopics(ltrequest); foreach (Topic topic in ltresp.ListTopicsResult.Topics) { this.snstopics.Add(topic.TopicArn); } rlbNcTypes.ItemsSource = this.notificationTypes; cboTopics.ItemsSource = this.snstopics; } catch { MessageBox.Show(Window.GetWindow(this), "Error occured while loading the notification configuration options.", "Error", MessageBoxButton.OK); this.Close(); } }
/// <summary> /// <para> Returns a list of all notification types that are supported by Auto Scaling. </para> <para> <i>What if the input is empty?</i> /// </para> /// </summary> /// /// <param name="describeAutoScalingNotificationTypesRequest">Container for the necessary parameters to execute the /// DescribeAutoScalingNotificationTypes service method on AmazonAutoScaling.</param> /// /// <returns>The response from the DescribeAutoScalingNotificationTypes service method, as returned by AmazonAutoScaling.</returns> /// public DescribeAutoScalingNotificationTypesResponse DescribeAutoScalingNotificationTypes(DescribeAutoScalingNotificationTypesRequest describeAutoScalingNotificationTypesRequest) { IRequest <DescribeAutoScalingNotificationTypesRequest> request = new DescribeAutoScalingNotificationTypesRequestMarshaller().Marshall(describeAutoScalingNotificationTypesRequest); DescribeAutoScalingNotificationTypesResponse response = Invoke <DescribeAutoScalingNotificationTypesRequest, DescribeAutoScalingNotificationTypesResponse> (request, this.signer, DescribeAutoScalingNotificationTypesResponseUnmarshaller.GetInstance()); return(response); }
private static void UnmarshallResult(XmlUnmarshallerContext context, DescribeAutoScalingNotificationTypesResponse 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("AutoScalingNotificationTypes/member", targetDepth)) { response.AutoScalingNotificationTypes.Add(StringUnmarshaller.GetInstance().Unmarshall(context)); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DescribeAutoScalingNotificationTypesResponse response = new DescribeAutoScalingNotificationTypesResponse(); while (context.Read()) { if (context.IsStartElement) { if (context.TestExpression("DescribeAutoScalingNotificationTypesResult", 2)) { response.DescribeAutoScalingNotificationTypesResult = DescribeAutoScalingNotificationTypesResultUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context); } } } return(response); }