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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("NextToken", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.NextToken = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Status", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Status = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("TranscriptionJobSummaries", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <TranscriptionJobSummary, TranscriptionJobSummaryUnmarshaller>(TranscriptionJobSummaryUnmarshaller.Instance);
                    response.TranscriptionJobSummaries = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Exemplo n.º 2
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonTranscribeServiceConfig config = new AmazonTranscribeServiceConfig();

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

            ListTranscriptionJobsResponse resp = new ListTranscriptionJobsResponse();

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

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

                foreach (var obj in resp.TranscriptionJobSummaries)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Exemplo n.º 3
0
        public async void setFromListJobs()
        {
            ListTranscriptionJobsResponse jobsResponse = await awsServices.getListJobsTranscribe();

            List <TranscriptionJobSummary> jobsSummary = jobsResponse.TranscriptionJobSummaries;

            if (jobsSummary.Count != 0)
            {
                bool validate = formTranscribe.updateComboNameJobs(jobsSummary);
            }
        }