public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonRekognitionConfig config = new AmazonRekognitionConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonRekognitionClient client = new AmazonRekognitionClient(creds, config); DescribeProjectsResponse resp = new DescribeProjectsResponse(); do { DescribeProjectsRequest req = new DescribeProjectsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.DescribeProjects(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.ProjectDescriptions) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
/// <summary> /// 支持根据多种条件过滤出项目列表。 /// </summary> /// <param name="req"><see cref="DescribeProjectsRequest"/></param> /// <returns><see cref="DescribeProjectsResponse"/></returns> public DescribeProjectsResponse DescribeProjectsSync(DescribeProjectsRequest req) { JsonResponseModel <DescribeProjectsResponse> rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeProjects"); rsp = JsonConvert.DeserializeObject <JsonResponseModel <DescribeProjectsResponse> >(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return(rsp.Response); }