public static DescribeLocationsResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeLocationsResponse describeLocationsResponse = new DescribeLocationsResponse();

            describeLocationsResponse.HttpResponse = context.HttpResponse;
            describeLocationsResponse.StoreId      = context.StringValue("DescribeLocations.StoreId");

            List <DescribeLocationsResponse.DescribeLocations_LocationMsgItem> describeLocationsResponse_locationMsgItems = new List <DescribeLocationsResponse.DescribeLocations_LocationMsgItem>();

            for (int i = 0; i < context.Length("DescribeLocations.LocationMsgItems.Length"); i++)
            {
                DescribeLocationsResponse.DescribeLocations_LocationMsgItem locationMsgItem = new DescribeLocationsResponse.DescribeLocations_LocationMsgItem();
                locationMsgItem.Tag              = context.StringValue("DescribeLocations.LocationMsgItems[" + i + "].Tag");
                locationMsgItem.Id               = context.LongValue("DescribeLocations.LocationMsgItems[" + i + "].Id");
                locationMsgItem.ExtId            = context.StringValue("DescribeLocations.LocationMsgItems[" + i + "].ExtId");
                locationMsgItem.LocationType     = context.StringValue("DescribeLocations.LocationMsgItems[" + i + "].LocationType");
                locationMsgItem.Name             = context.StringValue("DescribeLocations.LocationMsgItems[" + i + "].Name");
                locationMsgItem.Status           = context.LongValue("DescribeLocations.LocationMsgItems[" + i + "].Status");
                locationMsgItem.GmtCreate        = context.StringValue("DescribeLocations.LocationMsgItems[" + i + "].GmtCreate");
                locationMsgItem.StoreId          = context.LongValue("DescribeLocations.LocationMsgItems[" + i + "].StoreId");
                locationMsgItem.GmtModified      = context.StringValue("DescribeLocations.LocationMsgItems[" + i + "].GmtModified");
                locationMsgItem.ParentLocationId = context.LongValue("DescribeLocations.LocationMsgItems[" + i + "].ParentLocationId");
                locationMsgItem.LayerType        = context.StringValue("DescribeLocations.LocationMsgItems[" + i + "].LayerType");

                List <DescribeLocationsResponse.DescribeLocations_LocationMsgItem.DescribeLocations_RectRoi> locationMsgItem_rectRois = new List <DescribeLocationsResponse.DescribeLocations_LocationMsgItem.DescribeLocations_RectRoi>();
                for (int j = 0; j < context.Length("DescribeLocations.LocationMsgItems[" + i + "].RectRois.Length"); j++)
                {
                    DescribeLocationsResponse.DescribeLocations_LocationMsgItem.DescribeLocations_RectRoi rectRoi = new DescribeLocationsResponse.DescribeLocations_LocationMsgItem.DescribeLocations_RectRoi();

                    DescribeLocationsResponse.DescribeLocations_LocationMsgItem.DescribeLocations_RectRoi.DescribeLocations_LeftTop leftTop = new DescribeLocationsResponse.DescribeLocations_LocationMsgItem.DescribeLocations_RectRoi.DescribeLocations_LeftTop();
                    leftTop.X       = context.FloatValue("DescribeLocations.LocationMsgItems[" + i + "].RectRois[" + j + "].LeftTop.X");
                    leftTop.Y       = context.FloatValue("DescribeLocations.LocationMsgItems[" + i + "].RectRois[" + j + "].LeftTop.Y");
                    rectRoi.LeftTop = leftTop;

                    DescribeLocationsResponse.DescribeLocations_LocationMsgItem.DescribeLocations_RectRoi.DescribeLocations_RightBottom rightBottom = new DescribeLocationsResponse.DescribeLocations_LocationMsgItem.DescribeLocations_RectRoi.DescribeLocations_RightBottom();
                    rightBottom.X       = context.FloatValue("DescribeLocations.LocationMsgItems[" + i + "].RectRois[" + j + "].RightBottom.X");
                    rightBottom.Y       = context.FloatValue("DescribeLocations.LocationMsgItems[" + i + "].RectRois[" + j + "].RightBottom.Y");
                    rectRoi.RightBottom = rightBottom;

                    List <DescribeLocationsResponse.DescribeLocations_LocationMsgItem.DescribeLocations_RectRoi.DescribeLocations_Point> rectRoi_points = new List <DescribeLocationsResponse.DescribeLocations_LocationMsgItem.DescribeLocations_RectRoi.DescribeLocations_Point>();
                    for (int k = 0; k < context.Length("DescribeLocations.LocationMsgItems[" + i + "].RectRois[" + j + "].Points.Length"); k++)
                    {
                        DescribeLocationsResponse.DescribeLocations_LocationMsgItem.DescribeLocations_RectRoi.DescribeLocations_Point point = new DescribeLocationsResponse.DescribeLocations_LocationMsgItem.DescribeLocations_RectRoi.DescribeLocations_Point();
                        point.X = context.FloatValue("DescribeLocations.LocationMsgItems[" + i + "].RectRois[" + j + "].Points[" + k + "].X");
                        point.Y = context.FloatValue("DescribeLocations.LocationMsgItems[" + i + "].RectRois[" + j + "].Points[" + k + "].Y");

                        rectRoi_points.Add(point);
                    }
                    rectRoi.Points = rectRoi_points;

                    locationMsgItem_rectRois.Add(rectRoi);
                }
                locationMsgItem.RectRois = locationMsgItem_rectRois;

                describeLocationsResponse_locationMsgItems.Add(locationMsgItem);
            }
            describeLocationsResponse.LocationMsgItems = describeLocationsResponse_locationMsgItems;

            return(describeLocationsResponse);
        }
Esempio n. 2
0
        public static DescribeLocationsResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeLocationsResponse describeLocationsResponse = new DescribeLocationsResponse();

            describeLocationsResponse.HttpResponse = context.HttpResponse;
            describeLocationsResponse.RequestId    = context.StringValue("DescribeLocations.RequestId");

            return(describeLocationsResponse);
        }
        public static DescribeLocationsResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeLocationsResponse describeLocationsResponse = new DescribeLocationsResponse();

            describeLocationsResponse.HttpResponse = context.HttpResponse;
            describeLocationsResponse.RequestId = context.StringValue("DescribeLocations.RequestId");

            return describeLocationsResponse;
        }
Esempio n. 4
0
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeLocationsResponse response = new DescribeLocationsResponse();

            context.Read();

            UnmarshallResult(context, response);
            return(response);
        }
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeLocationsResponse response = new DescribeLocationsResponse();

            context.Read();

            response.DescribeLocationsResult = DescribeLocationsResultUnmarshaller.GetInstance().Unmarshall(context);

            return(response);
        }
Esempio n. 6
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)
        {
            DescribeLocationsResponse response = new DescribeLocationsResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("locations", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <Location, LocationUnmarshaller>(LocationUnmarshaller.Instance);
                    response.Locations = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonDirectConnectConfig config = new AmazonDirectConnectConfig();

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

            DescribeLocationsResponse resp = new DescribeLocationsResponse();
            DescribeLocationsRequest  req  = new DescribeLocationsRequest
            {
            };

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

            foreach (var obj in resp.Locations)
            {
                AddObject(obj);
            }
        }
Esempio n. 8
0
        private static void UnmarshallResult(JsonUnmarshallerContext context, DescribeLocationsResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("locations", targetDepth))
                {
                    context.Read();
                    response.Locations = new List <Location>();
                    LocationUnmarshaller unmarshaller = LocationUnmarshaller.GetInstance();
                    while (context.Read())
                    {
                        JsonToken token = context.CurrentTokenType;
                        if (token == JsonToken.ArrayStart)
                        {
                            continue;
                        }
                        if (token == JsonToken.ArrayEnd)
                        {
                            break;
                        }
                        response.Locations.Add(unmarshaller.Unmarshall(context));
                    }
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return;
                }
            }

            return;
        }