public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonRoboMakerConfig config = new AmazonRoboMakerConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonRoboMakerClient client = new AmazonRoboMakerClient(creds, config); ListFleetsResponse resp = new ListFleetsResponse(); do { ListFleetsRequest req = new ListFleetsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListFleets(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.FleetDetails) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
/// <summary> /// Initiates the asynchronous execution of the ListFleets operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListFleets 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/worklink-2018-09-25/ListFleets">REST API Reference for ListFleets Operation</seealso> public virtual Task <ListFleetsResponse> ListFleetsAsync(ListFleetsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListFleetsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListFleetsResponseUnmarshaller.Instance; return(InvokeAsync <ListFleetsResponse>(request, options, cancellationToken)); }
internal virtual ListFleetsResponse ListFleets(ListFleetsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListFleetsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListFleetsResponseUnmarshaller.Instance; return(Invoke <ListFleetsResponse>(request, options)); }
/// <summary> /// Creates a new enumerable which will iterate over the responses received from the ListFleets operation. This enumerable /// will fetch more data from the server as needed. /// </summary> /// <param name="request">The request object containing the details to send</param> /// <param name="retryConfiguration">The configuration for retrying, may be null</param> /// <param name="cancellationToken">The cancellation token object</param> /// <returns>The enumerator, which supports a simple iteration over a collection of a specified type</returns> public IEnumerable <ListFleetsResponse> ListFleetsResponseEnumerator(ListFleetsRequest request, Common.Retry.RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default) { return(new Common.Utils.ResponseEnumerable <ListFleetsRequest, ListFleetsResponse>( response => response.OpcNextPage, input => { if (!string.IsNullOrEmpty(input)) { request.Page = input; } return request; }, request => client.ListFleets(request, retryConfiguration, cancellationToken) )); }
protected override void ProcessRecord() { base.ProcessRecord(); ListFleetsRequest request; try { request = new ListFleetsRequest { CompartmentId = CompartmentId, Id = Id, LifecycleState = LifecycleState, DisplayName = DisplayName, Limit = Limit, Page = Page, SortOrder = SortOrder, SortBy = SortBy, OpcRequestId = OpcRequestId }; IEnumerable <ListFleetsResponse> responses = GetRequestDelegate().Invoke(request); foreach (var item in responses) { response = item; WriteOutput(response, response.FleetCollection, 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 void ListFleetsAsync(ListFleetsRequest request, AmazonServiceCallback <ListFleetsRequest, ListFleetsResponse> callback, AsyncOptions options = null) { throw new System.NotImplementedException(); }