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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Marker", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Marker = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("NotebookExecutions", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <NotebookExecutionSummary, NotebookExecutionSummaryUnmarshaller>(NotebookExecutionSummaryUnmarshaller.Instance);
                    response.NotebookExecutions = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
コード例 #2
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonElasticMapReduceConfig config = new AmazonElasticMapReduceConfig();

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

            ListNotebookExecutionsResponse resp = new ListNotebookExecutionsResponse();

            do
            {
                ListNotebookExecutionsRequest req = new ListNotebookExecutionsRequest
                {
                    Marker = resp.Marker
                };

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

                foreach (var obj in resp.NotebookExecutions)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.Marker));
        }