public static GetDomainResponse Unmarshall(UnmarshallerContext context)
        {
            GetDomainResponse getDomainResponse = new GetDomainResponse();

            getDomainResponse.HttpResponse  = context.HttpResponse;
            getDomainResponse.RequestId     = context.StringValue("GetDomain.RequestId");
            getDomainResponse.ResultCode    = context.StringValue("GetDomain.ResultCode");
            getDomainResponse.ResultMessage = context.StringValue("GetDomain.ResultMessage");
            getDomainResponse.Success       = context.StringValue("GetDomain.Success");
            getDomainResponse.TransactionId = context.StringValue("GetDomain.TransactionId");

            List <GetDomainResponse.GetDomain_Data> getDomainResponse_domain = new List <GetDomainResponse.GetDomain_Data>();

            for (int i = 0; i < context.Length("GetDomain.Domain.Length"); i++)
            {
                GetDomainResponse.GetDomain_Data data = new GetDomainResponse.GetDomain_Data();
                data.DomainName = context.StringValue("GetDomain.Domain[" + i + "].DomainName");
                data.Exists     = context.StringValue("GetDomain.Domain[" + i + "].Exists");
                data.Message    = context.StringValue("GetDomain.Domain[" + i + "].Message");

                getDomainResponse_domain.Add(data);
            }
            getDomainResponse.Domain = getDomainResponse_domain;

            return(getDomainResponse);
        }
        public static GetDomainResponse Unmarshall(UnmarshallerContext _ctx)
        {
            GetDomainResponse getDomainResponse = new GetDomainResponse();

            getDomainResponse.HttpResponse = _ctx.HttpResponse;
            getDomainResponse.RequestId    = _ctx.StringValue("GetDomain.requestId");
            getDomainResponse.Result       = _ctx.StringValue("GetDomain.result");

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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("domain", targetDepth))
                {
                    var unmarshaller = DomainUnmarshaller.Instance;
                    response.Domain = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Exemple #4
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            GetDomainResponse response = new GetDomainResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("CreatedAt", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.CreatedAt = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("DeadLetterQueueUrl", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.DeadLetterQueueUrl = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("DefaultEncryptionKey", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.DefaultEncryptionKey = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("DefaultExpirationDays", targetDepth))
                {
                    var unmarshaller = IntUnmarshaller.Instance;
                    response.DefaultExpirationDays = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("DomainName", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.DomainName = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("LastUpdatedAt", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.LastUpdatedAt = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Matching", targetDepth))
                {
                    var unmarshaller = MatchingResponseUnmarshaller.Instance;
                    response.Matching = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Stats", targetDepth))
                {
                    var unmarshaller = DomainStatsUnmarshaller.Instance;
                    response.Stats = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Tags", targetDepth))
                {
                    var unmarshaller = new DictionaryUnmarshaller <string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
                    response.Tags = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }