/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeRuleResponse response = new DescribeRuleResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Arn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Arn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Description", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Description = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("EventPattern", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.EventPattern = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Name", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Name = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("RoleArn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.RoleArn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("ScheduleExpression", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.ScheduleExpression = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("State", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.State = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
        public static DescribeRuleResponse Unmarshall(UnmarshallerContext _ctx)
        {
            DescribeRuleResponse describeRuleResponse = new DescribeRuleResponse();

            describeRuleResponse.HttpResponse = _ctx.HttpResponse;
            describeRuleResponse.RequestId    = _ctx.StringValue("DescribeRule.requestId");
            describeRuleResponse.Code         = _ctx.StringValue("DescribeRule.code");
            describeRuleResponse.Message      = _ctx.StringValue("DescribeRule.message");

            DescribeRuleResponse.DescribeRule_Result result = new DescribeRuleResponse.DescribeRule_Result();
            result.GmtCreate            = _ctx.StringValue("DescribeRule.Result.gmtCreate");
            result.GmtModified          = _ctx.StringValue("DescribeRule.Result.gmtModified");
            result.RuleId               = _ctx.StringValue("DescribeRule.Result.ruleId");
            result.Status               = _ctx.StringValue("DescribeRule.Result.status");
            describeRuleResponse.Result = result;

            return(describeRuleResponse);
        }
Esempio n. 3
0
        public async Task OnGetAsync()
        {
            LogPageRequest(nameof(OnGetAsync));

            DescribeRuleRequest request = new DescribeRuleRequest
            {
                Name = SendEventRuleName,
            };
            DescribeRuleResponse response = await _cloudWatchEvents.DescribeRuleAsync(request);

            IsEnabled = (response.State == RuleState.ENABLED);

            await FillParameterValuesAsync(
                TargetPhoneNumberParameterName,
                MessageParameterName);

            PhoneNumber = _parameterValues[TargetPhoneNumberParameterName];
            Message     = _parameterValues[MessageParameterName];

            await FillPhoneNumberOptionsAsync();

            LogPageResponse(nameof(OnGetAsync));
        }