You must use AWS Developer credentials to call this API.
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; var useParameterSelect = this.Select.StartsWith("^"); // create request and set iteration invariants var request = new Amazon.CognitoIdentity.Model.ListIdentityPoolsRequest(); if (cmdletContext.MaxResult != null) { request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToServiceTypeInt32(cmdletContext.MaxResult.Value); } // Initialize loop variant and commence piping var _nextToken = cmdletContext.NextToken; var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.NextToken = _nextToken; CmdletOutput output; try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; if (!useParameterSelect) { pipelineOutput = cmdletContext.Select(response, this); } output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; _nextToken = response.NextToken; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return(null); }
/// <summary> /// Lists all of the Cognito identity pools registered for your account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListIdentityPools service method.</param> /// /// <returns>The response from the ListIdentityPools service method, as returned by CognitoIdentity.</returns> /// <exception cref="Amazon.CognitoIdentity.Model.InternalErrorException"> /// Thrown when the service encounters an error during processing the request. /// </exception> /// <exception cref="Amazon.CognitoIdentity.Model.InvalidParameterException"> /// Thrown for missing or bad input parameter(s). /// </exception> /// <exception cref="Amazon.CognitoIdentity.Model.NotAuthorizedException"> /// Thrown when a user is not authorized to access the requested resource. /// </exception> /// <exception cref="Amazon.CognitoIdentity.Model.TooManyRequestsException"> /// Thrown when a request is throttled. /// </exception> internal ListIdentityPoolsResponse ListIdentityPools(ListIdentityPoolsRequest request) { var marshaller = new ListIdentityPoolsRequestMarshaller(); var unmarshaller = ListIdentityPoolsResponseUnmarshaller.Instance; return Invoke<ListIdentityPoolsRequest,ListIdentityPoolsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the ListIdentityPools operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListIdentityPools operation on AmazonCognitoIdentityClient.</param> /// <param name="callback">An Action delegate that is invoked when the operation completes.</param> /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public void ListIdentityPoolsAsync(ListIdentityPoolsRequest request, AmazonServiceCallback<ListIdentityPoolsRequest, ListIdentityPoolsResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new ListIdentityPoolsRequestMarshaller(); var unmarshaller = ListIdentityPoolsResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<ListIdentityPoolsRequest,ListIdentityPoolsResponse> responseObject = new AmazonServiceResult<ListIdentityPoolsRequest,ListIdentityPoolsResponse>((ListIdentityPoolsRequest)req, (ListIdentityPoolsResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<ListIdentityPoolsRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Initiates the asynchronous execution of the ListIdentityPools operation. /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity.ListIdentityPools"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListIdentityPools 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<ListIdentityPoolsResponse> ListIdentityPoolsAsync(ListIdentityPoolsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListIdentityPoolsRequestMarshaller(); var unmarshaller = ListIdentityPoolsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ListIdentityPoolsRequest, ListIdentityPoolsResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Lists all of the Cognito identity pools registered for your account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListIdentityPools service method.</param> /// /// <returns>The response from the ListIdentityPools service method, as returned by CognitoIdentity.</returns> /// <exception cref="T:Amazon.CognitoIdentity.Model.InternalErrorException"> /// Thrown when the service encounters an error during processing the request. /// </exception> /// <exception cref="T:Amazon.CognitoIdentity.Model.InvalidParameterException"> /// Thrown for missing or bad input parameter(s). /// </exception> /// <exception cref="T:Amazon.CognitoIdentity.Model.NotAuthorizedException"> /// Thrown when a user is not authorized to access the requested resource. /// </exception> /// <exception cref="T:Amazon.CognitoIdentity.Model.TooManyRequestsException"> /// Thrown when a request is throttled. /// </exception> public ListIdentityPoolsResponse ListIdentityPools(ListIdentityPoolsRequest request) { var task = ListIdentityPoolsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
private Amazon.CognitoIdentity.Model.ListIdentityPoolsResponse CallAWSServiceOperation(IAmazonCognitoIdentity client, Amazon.CognitoIdentity.Model.ListIdentityPoolsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Cognito Identity", "ListIdentityPools"); try { #if DESKTOP return(client.ListIdentityPools(request)); #elif CORECLR return(client.ListIdentityPoolsAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; var useParameterSelect = this.Select.StartsWith("^"); // create request and set iteration invariants var request = new Amazon.CognitoIdentity.Model.ListIdentityPoolsRequest(); // Initialize loop variants and commence piping System.String _nextToken = null; int? _emitLimit = null; int _retrievedSoFar = 0; if (AutoIterationHelpers.HasValue(cmdletContext.NextToken)) { _nextToken = cmdletContext.NextToken; } if (AutoIterationHelpers.HasValue(cmdletContext.MaxResult)) { // The service has a maximum page size of 60. If the user has // asked for more items than page max, and there is no page size // configured, we rely on the service ignoring the set maximum // and giving us 60 items back. If a page size is set, that will // be used to configure the pagination. // We'll make further calls to satisfy the user's request. _emitLimit = cmdletContext.MaxResult; } var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.NextToken = _nextToken; if (_emitLimit.HasValue) { int correctPageSize = AutoIterationHelpers.Min(60, _emitLimit.Value); request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToInt32(correctPageSize); } else { request.MaxResults = AutoIterationHelpers.ConvertEmitLimitToInt32(60); } CmdletOutput output; try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; if (!useParameterSelect) { pipelineOutput = cmdletContext.Select(response, this); } output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; int _receivedThisCall = response.IdentityPools.Count; _nextToken = response.NextToken; _retrievedSoFar += _receivedThisCall; if (_emitLimit.HasValue) { _emitLimit -= _receivedThisCall; } } catch (Exception e) { if (_retrievedSoFar == 0 || !_emitLimit.HasValue) { output = new CmdletOutput { ErrorResponse = e }; } else { break; } } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken) && (!_emitLimit.HasValue || _emitLimit.Value >= 1)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return(null); }
/// <summary> /// Initiates the asynchronous execution of the ListIdentityPools operation. /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListIdentityPools operation on AmazonCognitoIdentityClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListIdentityPools /// operation.</returns> public IAsyncResult BeginListIdentityPools(ListIdentityPoolsRequest request, AsyncCallback callback, object state) { var marshaller = new ListIdentityPoolsRequestMarshaller(); var unmarshaller = ListIdentityPoolsResponseUnmarshaller.Instance; return BeginInvoke<ListIdentityPoolsRequest>(request, marshaller, unmarshaller, callback, state); }
private IEnumerable<IdentityPoolShortDescription> GetAllPoolsHelper() { var request = new ListIdentityPoolsRequest { MaxResults = MaxResults }; ListIdentityPoolsResponse result; do { result = Client.ListIdentityPools(request); foreach (var pool in result.IdentityPools) { Assert.IsNotNull(pool); Assert.IsFalse(string.IsNullOrEmpty(pool.IdentityPoolId)); Assert.IsFalse(string.IsNullOrEmpty(pool.IdentityPoolName)); yield return pool; } request.NextToken = result.NextToken; } while (!string.IsNullOrEmpty(result.NextToken)); }
/// <summary> /// Initiates the asynchronous execution of the ListIdentityPools operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListIdentityPools 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<ListIdentityPoolsResponse> ListIdentityPoolsAsync(ListIdentityPoolsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListIdentityPoolsRequestMarshaller(); var unmarshaller = ListIdentityPoolsResponseUnmarshaller.Instance; return InvokeAsync<ListIdentityPoolsRequest,ListIdentityPoolsResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal ListIdentityPoolsPaginator(IAmazonCognitoIdentity client, ListIdentityPoolsRequest request) { this._client = client; this._request = request; }
/// <summary> /// Paginator for ListIdentityPools operation ///</summary> public IListIdentityPoolsPaginator ListIdentityPools(ListIdentityPoolsRequest request) { return(new ListIdentityPoolsPaginator(this.client, request)); }
IAsyncResult invokeListIdentityPools(ListIdentityPoolsRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new ListIdentityPoolsRequestMarshaller(); var unmarshaller = ListIdentityPoolsResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the ListIdentityPools operation. /// <seealso cref="Amazon.CognitoIdentity.IAmazonCognitoIdentity"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListIdentityPools operation on AmazonCognitoIdentityClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListIdentityPools /// operation.</returns> public IAsyncResult BeginListIdentityPools(ListIdentityPoolsRequest request, AsyncCallback callback, object state) { return invokeListIdentityPools(request, callback, state, false); }
/// <summary> /// Lists all of the Cognito identity pools registered for your account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListIdentityPools service method.</param> /// /// <returns>The response from the ListIdentityPools service method, as returned by CognitoIdentity.</returns> /// <exception cref="InternalErrorException"> /// Thrown when the service encounters an error during processing the request. /// </exception> /// <exception cref="InvalidParameterException"> /// Thrown for missing or bad input parameter(s). /// </exception> /// <exception cref="NotAuthorizedException"> /// Thrown when a user is not authorized to access the requested resource. /// </exception> /// <exception cref="TooManyRequestsException"> /// Thrown when a request is throttled. /// </exception> public ListIdentityPoolsResponse ListIdentityPools(ListIdentityPoolsRequest request) { IAsyncResult asyncResult = invokeListIdentityPools(request, null, null, true); return EndListIdentityPools(asyncResult); }