Exemple #1
0
        public static DescribeAppsResponse Unmarshall(UnmarshallerContext _ctx)
        {
            DescribeAppsResponse describeAppsResponse = new DescribeAppsResponse();

            describeAppsResponse.HttpResponse = _ctx.HttpResponse;
            describeAppsResponse.RequestId    = _ctx.StringValue("DescribeApps.requestId");

            List <Dictionary <string, string> > describeAppsResponse_result = new List <Dictionary <string, string> >();

            for (int i = 0; i < _ctx.Length("DescribeApps.Result.Length"); i++)
            {
                Dictionary <string, string> tmp = new Dictionary <string, string>()
                {
                };
                foreach (var _item in _ctx.ResponseDictionary)
                {
                    string prefix = "DescribeApps.Result[" + i + "].";
                    if (_item.Key.IndexOf(prefix) == 0)
                    {
                        tmp.Add(_item.Key.Substring(prefix.Length), _item.Value);
                    }
                }
                if (tmp.Count > 0)
                {
                    describeAppsResponse_result.Add(tmp);
                }
            }
            describeAppsResponse.Result = describeAppsResponse_result;

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

            context.Read();

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

            context.Read();

            response.DescribeAppsResult = DescribeAppsResultUnmarshaller.GetInstance().Unmarshall(context);

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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Apps", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <App, AppUnmarshaller>(AppUnmarshaller.Instance);
                    response.Apps = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

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

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

            DescribeAppsResponse resp = new DescribeAppsResponse();
            DescribeAppsRequest  req  = new DescribeAppsRequest
            {
            };

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

            foreach (var obj in resp.Apps)
            {
                AddObject(obj);
            }
        }