Пример #1
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)
        {
            DescribeACLsResponse response = new DescribeACLsResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("ACLs", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <ACL, ACLUnmarshaller>(ACLUnmarshaller.Instance);
                    response.ACLs = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("NextToken", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.NextToken = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Пример #2
0
        public static DescribeACLsResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeACLsResponse describeACLsResponse = new DescribeACLsResponse();

            describeACLsResponse.HttpResponse = context.HttpResponse;
            describeACLsResponse.RequestId    = context.StringValue("DescribeACLs.RequestId");
            describeACLsResponse.TotalCount   = context.IntegerValue("DescribeACLs.TotalCount");
            describeACLsResponse.PageNumber   = context.IntegerValue("DescribeACLs.PageNumber");
            describeACLsResponse.PageSize     = context.IntegerValue("DescribeACLs.PageSize");

            List <DescribeACLsResponse.DescribeACLs_Acl> describeACLsResponse_acls = new List <DescribeACLsResponse.DescribeACLs_Acl>();

            for (int i = 0; i < context.Length("DescribeACLs.Acls.Length"); i++)
            {
                DescribeACLsResponse.DescribeACLs_Acl acl = new DescribeACLsResponse.DescribeACLs_Acl();
                acl.AclId    = context.StringValue("DescribeACLs.Acls[" + i + "].AclId");
                acl.Name     = context.StringValue("DescribeACLs.Acls[" + i + "].Name");
                acl.SagCount = context.StringValue("DescribeACLs.Acls[" + i + "].SagCount");

                describeACLsResponse_acls.Add(acl);
            }
            describeACLsResponse.Acls = describeACLsResponse_acls;

            return(describeACLsResponse);
        }