public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.APIGateway.Model.GetApiKeysRequest(); if (cmdletContext.CustomerId != null) { request.CustomerId = cmdletContext.CustomerId; } if (cmdletContext.IncludeValue != null) { request.IncludeValues = cmdletContext.IncludeValue.Value; } if (cmdletContext.Limit != null) { request.Limit = cmdletContext.Limit.Value; } if (cmdletContext.NameQuery != null) { request.NameQuery = cmdletContext.NameQuery; } if (cmdletContext.Position != null) { request.Position = cmdletContext.Position; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// Initiates the asynchronous execution of the GetApiKeys operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetApiKeys 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<GetApiKeysResponse> GetApiKeysAsync(GetApiKeysRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetApiKeysRequestMarshaller(); var unmarshaller = GetApiKeysResponseUnmarshaller.Instance; return InvokeAsync<GetApiKeysRequest,GetApiKeysResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal GetApiKeysResponse GetApiKeys(GetApiKeysRequest request) { var marshaller = new GetApiKeysRequestMarshaller(); var unmarshaller = GetApiKeysResponseUnmarshaller.Instance; return Invoke<GetApiKeysRequest,GetApiKeysResponse>(request, marshaller, unmarshaller); }
private Amazon.APIGateway.Model.GetApiKeysResponse CallAWSServiceOperation(IAmazonAPIGateway client, Amazon.APIGateway.Model.GetApiKeysRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon API Gateway", "GetApiKeys"); try { #if DESKTOP return(client.GetApiKeys(request)); #elif CORECLR return(client.GetApiKeysAsync(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.APIGateway.Model.GetApiKeysRequest(); if (cmdletContext.CustomerId != null) { request.CustomerId = cmdletContext.CustomerId; } if (cmdletContext.IncludeValue != null) { request.IncludeValues = cmdletContext.IncludeValue.Value; } if (cmdletContext.Limit != null) { request.Limit = cmdletContext.Limit.Value; } if (cmdletContext.NameQuery != null) { request.NameQuery = cmdletContext.NameQuery; } // Initialize loop variant and commence piping var _nextToken = cmdletContext.Position; var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.Position)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.Position = _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.Position; } 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> /// Initiates the asynchronous execution of the GetApiKeys operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetApiKeys operation on AmazonAPIGatewayClient.</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 EndGetApiKeys /// operation.</returns> public IAsyncResult BeginGetApiKeys(GetApiKeysRequest request, AsyncCallback callback, object state) { var marshaller = new GetApiKeysRequestMarshaller(); var unmarshaller = GetApiKeysResponseUnmarshaller.Instance; return BeginInvoke<GetApiKeysRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Paginator for GetApiKeys operation ///</summary> public IGetApiKeysPaginator GetApiKeys(GetApiKeysRequest request) { return(new GetApiKeysPaginator(this.client, request)); }
internal GetApiKeysPaginator(IAmazonAPIGateway client, GetApiKeysRequest request) { this._client = client; this._request = request; }