Exemplo n.º 1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonSageMakerConfig config = new AmazonSageMakerConfig();

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

            ListAlgorithmsResponse resp = new ListAlgorithmsResponse();

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

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

                foreach (var obj in resp.AlgorithmSummaryList)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 列出当前Region支持的加密方式
        /// </summary>
        /// <param name="req"><see cref="ListAlgorithmsRequest"/></param>
        /// <returns><see cref="ListAlgorithmsResponse"/></returns>
        public ListAlgorithmsResponse ListAlgorithmsSync(ListAlgorithmsRequest req)
        {
            JsonResponseModel <ListAlgorithmsResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "ListAlgorithms");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <ListAlgorithmsResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }