internal ListOperationsResponse ListOperations(ListOperationsRequest request)
        {
            var marshaller   = new ListOperationsRequestMarshaller();
            var unmarshaller = ListOperationsResponseUnmarshaller.Instance;

            return(Invoke <ListOperationsRequest, ListOperationsResponse>(request, marshaller, unmarshaller));
        }
Example #2
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonServiceDiscoveryConfig config = new AmazonServiceDiscoveryConfig();

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

            ListOperationsResponse resp = new ListOperationsResponse();

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

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

                foreach (var obj in resp.Operations)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Example #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListOperations operation.
        /// <seealso cref="Amazon.Route53Domains.IAmazonRoute53Domains"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListOperations operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task <ListOperationsResponse> ListOperationsAsync(ListOperationsRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new ListOperationsRequestMarshaller();
            var unmarshaller = ListOperationsResponseUnmarshaller.Instance;

            return(Invoke <IRequest, ListOperationsRequest, ListOperationsResponse>(request, marshaller, unmarshaller, signer, cancellationToken));
        }
Example #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListOperations operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListOperations operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/ListOperations">REST API Reference for ListOperations Operation</seealso>
        public virtual Task <ListOperationsResponse> ListOperationsAsync(ListOperationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = ListOperationsRequestMarshaller.Instance;
            var unmarshaller = ListOperationsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListOperationsRequest, ListOperationsResponse>(request, marshaller,
                                                                               unmarshaller, cancellationToken));
        }
Example #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListOperations operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListOperations operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/ListOperations">REST API Reference for ListOperations Operation</seealso>
        public virtual Task <ListOperationsResponse> ListOperationsAsync(ListOperationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListOperationsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListOperationsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListOperationsResponse>(request, options, cancellationToken));
        }
Example #6
0
        internal virtual ListOperationsResponse ListOperations(ListOperationsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListOperationsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListOperationsResponseUnmarshaller.Instance;

            return(Invoke <ListOperationsResponse>(request, options));
        }
Example #7
0
        internal ListOperationsResponse ListOperations(ListOperationsRequest request)
        {
            var task = ListOperationsAsync(request);

            try
            {
                return(task.Result);
            }
            catch (AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return(null);
            }
        }
        public async Task <IActionResult> List([FromQuery] ListOperationsRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState.GetErrorMessages()));
            }

            var response = await _operationService.ListAsync(request);

            if (!response.IsValid)
            {
                return(BadRequest(response.Message));
            }
            return(Ok(response));
        }
Example #9
0
        /// <summary>Snippet for ListOperationsAsync</summary>
        public async Task ListOperationsAsync_RequestObject()
        {
            // Snippet: ListOperationsAsync(ListOperationsRequest,CallSettings)
            // Create client
            OperationsClient operationsClient = await OperationsClient.CreateAsync();

            // Initialize request argument(s)
            ListOperationsRequest request = new ListOperationsRequest
            {
                Name   = "",
                Filter = "",
            };
            // Make the request
            PagedAsyncEnumerable <ListOperationsResponse, Operation> response =
                operationsClient.ListOperationsAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Operation item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((ListOperationsResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Operation item in page)
                {
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page <Operation> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Operation item in singlePage)
            {
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
Example #10
0
        public async Task <ListResponse <OperationsListItemDto> > ListAsync(ListOperationsRequest request)
        {
            var paging = _mapper.Map <ListOperationsRequest, Paging>(request);
            var sort   = _mapper.Map <ListOperationsRequest, Sort>(request);
            var filter = _mapper.Map <ListOperationsRequest, OperationsFilter>(request);

            var operations = await _operationRepository.GetListAsync(filter, sort, paging);

            var operationsCount = await _operationRepository.CountAsync(filter);

            var operationsTotal = await _operationRepository.TotalAsync(filter);

            var operationsDtosList = _mapper.Map <List <Operation>, List <OperationsListItemDto> >(operations);

            return(new ListResponse <OperationsListItemDto>(operationsDtosList, operationsCount, operationsTotal));
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListOperationsRequest request;

            try
            {
                request = new ListOperationsRequest
                {
                    RegistryId         = RegistryId,
                    ConnectionKey      = ConnectionKey,
                    SchemaResourceName = SchemaResourceName,
                    OpcRequestId       = OpcRequestId,
                    Name       = Name,
                    Page       = Page,
                    Limit      = Limit,
                    SortBy     = SortBy,
                    SortOrder  = SortOrder,
                    EndpointId = EndpointId
                };
                IEnumerable <ListOperationsResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.OperationSummaryCollection, true);
                }
                if (!ParameterSetName.Equals(AllPageSet) && !ParameterSetName.Equals(LimitSet) && response.OpcNextPage != null)
                {
                    WriteWarning("This operation supports pagination and not all resources were returned. Re-run using the -All option to auto paginate and list all resources.");
                }
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
 public override Task <ListOperationsResponse> ListOperations(ListOperationsRequest request,
                                                              ServerCallContext context)
 {
     throw new RpcException(new Status(StatusCode.Unimplemented, "ListOperations not implemented"));
 }