public static DescribeNetworkInterfacePermissionsResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeNetworkInterfacePermissionsResponse describeNetworkInterfacePermissionsResponse = new DescribeNetworkInterfacePermissionsResponse();

            describeNetworkInterfacePermissionsResponse.HttpResponse = context.HttpResponse;
            describeNetworkInterfacePermissionsResponse.RequestId    = context.StringValue("DescribeNetworkInterfacePermissions.RequestId");
            describeNetworkInterfacePermissionsResponse.TotalCount   = context.IntegerValue("DescribeNetworkInterfacePermissions.TotalCount");
            describeNetworkInterfacePermissionsResponse.PageNumber   = context.IntegerValue("DescribeNetworkInterfacePermissions.PageNumber");
            describeNetworkInterfacePermissionsResponse.PageSize     = context.IntegerValue("DescribeNetworkInterfacePermissions.PageSize");

            List <DescribeNetworkInterfacePermissionsResponse.DescribeNetworkInterfacePermissions_NetworkInterfacePermission> describeNetworkInterfacePermissionsResponse_networkInterfacePermissions = new List <DescribeNetworkInterfacePermissionsResponse.DescribeNetworkInterfacePermissions_NetworkInterfacePermission>();

            for (int i = 0; i < context.Length("DescribeNetworkInterfacePermissions.NetworkInterfacePermissions.Length"); i++)
            {
                DescribeNetworkInterfacePermissionsResponse.DescribeNetworkInterfacePermissions_NetworkInterfacePermission networkInterfacePermission = new DescribeNetworkInterfacePermissionsResponse.DescribeNetworkInterfacePermissions_NetworkInterfacePermission();
                networkInterfacePermission.AccountId                    = context.LongValue("DescribeNetworkInterfacePermissions.NetworkInterfacePermissions[" + i + "].AccountId");
                networkInterfacePermission.ServiceName                  = context.StringValue("DescribeNetworkInterfacePermissions.NetworkInterfacePermissions[" + i + "].ServiceName");
                networkInterfacePermission.NetworkInterfaceId           = context.StringValue("DescribeNetworkInterfacePermissions.NetworkInterfacePermissions[" + i + "].NetworkInterfaceId");
                networkInterfacePermission.NetworkInterfacePermissionId = context.StringValue("DescribeNetworkInterfacePermissions.NetworkInterfacePermissions[" + i + "].NetworkInterfacePermissionId");
                networkInterfacePermission.Permission                   = context.StringValue("DescribeNetworkInterfacePermissions.NetworkInterfacePermissions[" + i + "].Permission");
                networkInterfacePermission.PermissionState              = context.StringValue("DescribeNetworkInterfacePermissions.NetworkInterfacePermissions[" + i + "].PermissionState");

                describeNetworkInterfacePermissionsResponse_networkInterfacePermissions.Add(networkInterfacePermission);
            }
            describeNetworkInterfacePermissionsResponse.NetworkInterfacePermissions = describeNetworkInterfacePermissionsResponse_networkInterfacePermissions;

            return(describeNetworkInterfacePermissionsResponse);
        }
Beispiel #2
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonEC2Config config = new AmazonEC2Config();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonEC2Client client = new AmazonEC2Client(creds, config);

            DescribeNetworkInterfacePermissionsResponse resp = new DescribeNetworkInterfacePermissionsResponse();

            do
            {
                DescribeNetworkInterfacePermissionsRequest req = new DescribeNetworkInterfacePermissionsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.DescribeNetworkInterfacePermissions(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.NetworkInterfacePermissions)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Beispiel #3
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeNetworkInterfacePermissionsResponse response = new DescribeNetworkInterfacePermissionsResponse();

            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("networkInterfacePermissions/item", targetDepth))
                    {
                        var unmarshaller = NetworkInterfacePermissionUnmarshaller.Instance;
                        var item         = unmarshaller.Unmarshall(context);
                        response.NetworkInterfacePermissions.Add(item);
                        continue;
                    }
                    if (context.TestExpression("nextToken", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.NextToken = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
            }

            return(response);
        }