Beispiel #1
0
        public async Task ShouldGetActionWithMultipleMatterIds()
        {
            using (var authDelegatingHandler = new AuthDelegatingHandler()
            {
                InnerHandler = _handler
            })
                using (var httpClient = new HttpClient(authDelegatingHandler))
                    using (var memoryCache = new MemoryCache(new MemoryCacheOptions()))
                    {
                        var fakeClock           = new FakeClock(Instant.FromUtc(2019, 05, 07, 2, 3));
                        var testTokenRepository = new TestTokenSetRepository();
                        var testTokenSet        = GetTestTokenSet();
                        await testTokenRepository.AddOrUpdateTokenSet(testTokenSet);

                        var options            = new ActionstepServiceConfigurationOptions("clientId", "clientSecret");
                        var actionstepService  = new ActionstepService(new NullLogger <ActionstepService>(), httpClient, options, testTokenRepository, fakeClock, memoryCache);
                        var listActionsRequest = new ListActionsRequest();
                        listActionsRequest.ActionstepIds.AddRange(new[] { 1, 7 });
                        listActionsRequest.TokenSetQuery = new TokenSetQuery(testTokenSet.UserId, testTokenSet.OrgKey);

                        var response = await actionstepService.Handle <ListActionsResponse>(listActionsRequest);

                        Assert.Equal(2, response.Actions.Count);
                        Assert.True(response.Actions.Exists(a => a.Id == 1));
                        Assert.True(response.Actions.Exists(a => a.Id == 7));
                    }
        }
        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);

            ListActionsResponse resp = new ListActionsResponse();

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

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

                foreach (var obj in resp.ActionSummaries)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        /// <summary>
        /// Lists the available FIS actions.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListActions service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the ListActions service method, as returned by FIS.</returns>
        /// <exception cref="Amazon.FIS.Model.ValidationException">
        /// The specified input is not valid, or fails to satisfy the constraints for the request.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/fis-2020-12-01/ListActions">REST API Reference for ListActions Operation</seealso>
        public virtual Task <ListActionsResponse> ListActionsAsync(ListActionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListActionsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListActionsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListActionsResponse>(request, options, cancellationToken));
        }
        internal virtual ListActionsResponse ListActions(ListActionsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListActionsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListActionsResponseUnmarshaller.Instance;

            return(Invoke <ListActionsResponse>(request, options));
        }