public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.IdentityManagement.Model.GetServerCertificateRequest(); if (cmdletContext.ServerCertificateName != null) { request.ServerCertificateName = cmdletContext.ServerCertificateName; } 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 GetServerCertificate operation. /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetServerCertificate 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<GetServerCertificateResponse> GetServerCertificateAsync(GetServerCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetServerCertificateRequestMarshaller(); var unmarshaller = GetServerCertificateResponseUnmarshaller.Instance; return InvokeAsync<GetServerCertificateRequest,GetServerCertificateResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal GetServerCertificateResponse GetServerCertificate(GetServerCertificateRequest request) { var marshaller = new GetServerCertificateRequestMarshaller(); var unmarshaller = GetServerCertificateResponseUnmarshaller.Instance; return Invoke<GetServerCertificateRequest,GetServerCertificateResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the GetServerCertificate operation. /// <seealso cref="Amazon.IdentityManagement.AmazonIdentityManagementService.GetServerCertificate"/> /// </summary> /// /// <param name="getServerCertificateRequest">Container for the necessary parameters to execute the GetServerCertificate operation on /// AmazonIdentityManagementService.</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 /// EndGetServerCertificate operation.</returns> public IAsyncResult BeginGetServerCertificate(GetServerCertificateRequest getServerCertificateRequest, AsyncCallback callback, object state) { return invokeGetServerCertificate(getServerCertificateRequest, callback, state, false); }
IAsyncResult invokeGetServerCertificate(GetServerCertificateRequest getServerCertificateRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new GetServerCertificateRequestMarshaller().Marshall(getServerCertificateRequest); var unmarshaller = GetServerCertificateResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Retrieves information about the specified server certificate.</para> /// </summary> /// /// <param name="getServerCertificateRequest">Container for the necessary parameters to execute the GetServerCertificate service method on /// AmazonIdentityManagementService.</param> /// /// <returns>The response from the GetServerCertificate service method, as returned by AmazonIdentityManagementService.</returns> /// /// <exception cref="NoSuchEntityException"/> public GetServerCertificateResponse GetServerCertificate(GetServerCertificateRequest getServerCertificateRequest) { IAsyncResult asyncResult = invokeGetServerCertificate(getServerCertificateRequest, null, null, true); return EndGetServerCertificate(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the GetServerCertificate operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetServerCertificate operation on AmazonIdentityManagementServiceClient.</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 EndGetServerCertificate /// operation.</returns> public IAsyncResult BeginGetServerCertificate(GetServerCertificateRequest request, AsyncCallback callback, object state) { var marshaller = new GetServerCertificateRequestMarshaller(); var unmarshaller = GetServerCertificateResponseUnmarshaller.Instance; return BeginInvoke<GetServerCertificateRequest>(request, marshaller, unmarshaller, callback, state); }
private Amazon.IdentityManagement.Model.GetServerCertificateResponse CallAWSServiceOperation(IAmazonIdentityManagementService client, Amazon.IdentityManagement.Model.GetServerCertificateRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Identity and Access Management", "GetServerCertificate"); try { #if DESKTOP return(client.GetServerCertificate(request)); #elif CORECLR return(client.GetServerCertificateAsync(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; } }
/// <summary> /// Initiates the asynchronous execution of the GetServerCertificate operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetServerCertificate operation on AmazonIdentityManagementServiceClient.</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 GetServerCertificateAsync(GetServerCertificateRequest request, AmazonServiceCallback<GetServerCertificateRequest, GetServerCertificateResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new GetServerCertificateRequestMarshaller(); var unmarshaller = GetServerCertificateResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<GetServerCertificateRequest,GetServerCertificateResponse> responseObject = new AmazonServiceResult<GetServerCertificateRequest,GetServerCertificateResponse>((GetServerCertificateRequest)req, (GetServerCertificateResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<GetServerCertificateRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// <para>Retrieves information about the specified server /// certificate.</para> /// </summary> /// /// <param name="getServerCertificateRequest">Container for the necessary /// parameters to execute the GetServerCertificate service method on /// AmazonIdentityManagementService.</param> /// /// <returns>The response from the GetServerCertificate service method, as /// returned by AmazonIdentityManagementService.</returns> /// /// <exception cref="NoSuchEntityException"/> public GetServerCertificateResponse GetServerCertificate(GetServerCertificateRequest getServerCertificateRequest) { IRequest<GetServerCertificateRequest> request = new GetServerCertificateRequestMarshaller().Marshall(getServerCertificateRequest); GetServerCertificateResponse response = Invoke<GetServerCertificateRequest, GetServerCertificateResponse> (request, this.signer, GetServerCertificateResponseUnmarshaller.GetInstance()); return response; }
/// <summary> /// Initiates the asynchronous execution of the GetServerCertificate operation. /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService.GetServerCertificate"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetServerCertificate 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 async Task<GetServerCertificateResponse> GetServerCertificateAsync(GetServerCertificateRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetServerCertificateRequestMarshaller(); var unmarshaller = GetServerCertificateResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, GetServerCertificateRequest, GetServerCertificateResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para>Retrieves information about the specified server certificate.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetServerCertificate service method on /// AmazonIdentityManagementService.</param> /// /// <returns>The response from the GetServerCertificate service method, as returned by AmazonIdentityManagementService.</returns> /// /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" /> public GetServerCertificateResponse GetServerCertificate(GetServerCertificateRequest request) { var task = GetServerCertificateAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para>Retrieves information about the specified server certificate.</para> /// </summary> /// /// <param name="getServerCertificateRequest">Container for the necessary parameters to execute the GetServerCertificate service method on /// AmazonIdentityManagementService.</param> /// /// <returns>The response from the GetServerCertificate service method, as returned by AmazonIdentityManagementService.</returns> /// /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<GetServerCertificateResponse> GetServerCertificateAsync(GetServerCertificateRequest getServerCertificateRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetServerCertificateRequestMarshaller(); var unmarshaller = GetServerCertificateResponseUnmarshaller.GetInstance(); return Invoke<IRequest, GetServerCertificateRequest, GetServerCertificateResponse>(getServerCertificateRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal GetServerCertificateResponse GetServerCertificate(GetServerCertificateRequest request) { var task = GetServerCertificateAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeGetServerCertificate(GetServerCertificateRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new GetServerCertificateRequestMarshaller(); var unmarshaller = GetServerCertificateResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }