Contains the response to a DescribePermissions request.
Inheritance: Amazon.Runtime.AmazonWebServiceResponse
コード例 #1
0
 public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
 {
   DescribePermissionsResponse response = new DescribePermissionsResponse();          
   
   context.Read();
   
   UnmarshallResult(context,response);
   return response;
 }
コード例 #2
0
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribePermissionsResponse response = new DescribePermissionsResponse();

              context.Read();

              response.DescribePermissionsResult = DescribePermissionsResultUnmarshaller.GetInstance().Unmarshall(context);

              return response;
        }
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribePermissionsResponse response = new DescribePermissionsResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;
            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Permissions", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller<Permission, PermissionUnmarshaller>(PermissionUnmarshaller.Instance);
                    response.Permissions = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return response;
        }
コード例 #4
0
       private static void UnmarshallResult(JsonUnmarshallerContext context,DescribePermissionsResponse response)
       {
         
           int originalDepth = context.CurrentDepth;
           int targetDepth = originalDepth + 1;
           while (context.Read())
           {
             
             if (context.TestExpression("Permissions", targetDepth))
             {
               context.Read();
               response.Permissions = new List<Permission>();
                       PermissionUnmarshaller unmarshaller = PermissionUnmarshaller.GetInstance();
               while (context.Read())
               {
                 JsonToken token = context.CurrentTokenType;                
                 if (token == JsonToken.ArrayStart)
                 {
                   continue;
                 }
                 if (token == JsonToken.ArrayEnd)
                 {
                   break;
                 }
                  response.Permissions.Add(unmarshaller.Unmarshall(context));
               }
               continue;
             }
 
               if (context.CurrentDepth <= originalDepth)
               {                   
                   return;
               }
           }
                       
           return;
       }