public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.IdentityManagement.Model.UploadSigningCertificateRequest(); if (cmdletContext.CertificateBody != null) { request.CertificateBody = cmdletContext.CertificateBody; } if (cmdletContext.UserName != null) { request.UserName = cmdletContext.UserName; } 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 UploadSigningCertificate operation. /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UploadSigningCertificate 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<UploadSigningCertificateResponse> UploadSigningCertificateAsync(UploadSigningCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UploadSigningCertificateRequestMarshaller(); var unmarshaller = UploadSigningCertificateResponseUnmarshaller.Instance; return InvokeAsync<UploadSigningCertificateRequest,UploadSigningCertificateResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal UploadSigningCertificateResponse UploadSigningCertificate(UploadSigningCertificateRequest request) { var marshaller = new UploadSigningCertificateRequestMarshaller(); var unmarshaller = UploadSigningCertificateResponseUnmarshaller.Instance; return Invoke<UploadSigningCertificateRequest,UploadSigningCertificateResponse>(request, marshaller, unmarshaller); }
IAsyncResult invokeUploadSigningCertificate(UploadSigningCertificateRequest uploadSigningCertificateRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new UploadSigningCertificateRequestMarshaller().Marshall(uploadSigningCertificateRequest); var unmarshaller = UploadSigningCertificateResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Uploads an X.509 signing certificate and associates it with the specified user. Some AWS services use X.509 signing certificates to /// validate requests that are signed with a corresponding private key. When you upload the certificate, its default status is <c>Active</c> /// .</para> <para>If the <c>UserName</c> field is not specified, the user name is determined implicitly based on the AWS Access Key ID used to /// sign the request. Because this action works for access keys under the AWS account, this API can be used to manage root credentials even if /// the AWS account has no associated users.</para> <para><b>NOTE:</b>Because the body of a X.509 certificate can be large, you should use POST /// rather than GET when calling UploadSigningCertificate. For information about setting up signatures and authorization through the API, go to /// Signing AWS API Requests in the AWS General Reference. For general information about using the Query API with IAM, go to Making Query /// Requests in Using IAM.</para> /// </summary> /// /// <param name="uploadSigningCertificateRequest">Container for the necessary parameters to execute the UploadSigningCertificate service method /// on AmazonIdentityManagementService.</param> /// /// <returns>The response from the UploadSigningCertificate service method, as returned by AmazonIdentityManagementService.</returns> /// /// <exception cref="DuplicateCertificateException"/> /// <exception cref="InvalidCertificateException"/> /// <exception cref="MalformedCertificateException"/> /// <exception cref="NoSuchEntityException"/> /// <exception cref="LimitExceededException"/> /// <exception cref="EntityAlreadyExistsException"/> public UploadSigningCertificateResponse UploadSigningCertificate(UploadSigningCertificateRequest uploadSigningCertificateRequest) { IAsyncResult asyncResult = invokeUploadSigningCertificate(uploadSigningCertificateRequest, null, null, true); return EndUploadSigningCertificate(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the UploadSigningCertificate operation. /// <seealso cref="Amazon.IdentityManagement.AmazonIdentityManagementService.UploadSigningCertificate"/> /// </summary> /// /// <param name="uploadSigningCertificateRequest">Container for the necessary parameters to execute the UploadSigningCertificate 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 /// EndUploadSigningCertificate operation.</returns> public IAsyncResult BeginUploadSigningCertificate(UploadSigningCertificateRequest uploadSigningCertificateRequest, AsyncCallback callback, object state) { return invokeUploadSigningCertificate(uploadSigningCertificateRequest, callback, state, false); }
/// <summary> /// Initiates the asynchronous execution of the UploadSigningCertificate operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UploadSigningCertificate 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 EndUploadSigningCertificate /// operation.</returns> public IAsyncResult BeginUploadSigningCertificate(UploadSigningCertificateRequest request, AsyncCallback callback, object state) { var marshaller = new UploadSigningCertificateRequestMarshaller(); var unmarshaller = UploadSigningCertificateResponseUnmarshaller.Instance; return BeginInvoke<UploadSigningCertificateRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para>Uploads an X.509 signing certificate and associates it with the /// specified User. Some AWS services use X.509 signing certificates to /// validate requests that are signed with a corresponding private key. /// When you upload the certificate, its default status is <c>Active</c> /// .</para> <para>If the <c>UserName</c> field is not specified, the User /// name is determined implicitly based on the AWS Access Key ID used to /// sign the request. Because this action works for access keys under the /// AWS Account, this API can be used to manage root credentials even if /// the AWS Account has no associated Users.</para> /// <para><b>NOTE:</b>Because the body of a X.509 certificate can be /// large, you should use POST rather than GET when calling /// UploadSigningCertificate. For more information, see Using the Query /// API in Using AWS Identity and Access Management.</para> /// </summary> /// /// <param name="uploadSigningCertificateRequest">Container for the /// necessary parameters to execute the UploadSigningCertificate service /// method on AmazonIdentityManagementService.</param> /// /// <returns>The response from the UploadSigningCertificate service /// method, as returned by AmazonIdentityManagementService.</returns> /// /// <exception cref="DuplicateCertificateException"/> /// <exception cref="InvalidCertificateException"/> /// <exception cref="MalformedCertificateException"/> /// <exception cref="NoSuchEntityException"/> /// <exception cref="LimitExceededException"/> /// <exception cref="EntityAlreadyExistsException"/> public UploadSigningCertificateResponse UploadSigningCertificate(UploadSigningCertificateRequest uploadSigningCertificateRequest) { IRequest<UploadSigningCertificateRequest> request = new UploadSigningCertificateRequestMarshaller().Marshall(uploadSigningCertificateRequest); UploadSigningCertificateResponse response = Invoke<UploadSigningCertificateRequest, UploadSigningCertificateResponse> (request, this.signer, UploadSigningCertificateResponseUnmarshaller.GetInstance()); return response; }
/// <summary> /// Initiates the asynchronous execution of the UploadSigningCertificate operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UploadSigningCertificate 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 UploadSigningCertificateAsync(UploadSigningCertificateRequest request, AmazonServiceCallback<UploadSigningCertificateRequest, UploadSigningCertificateResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new UploadSigningCertificateRequestMarshaller(); var unmarshaller = UploadSigningCertificateResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<UploadSigningCertificateRequest,UploadSigningCertificateResponse> responseObject = new AmazonServiceResult<UploadSigningCertificateRequest,UploadSigningCertificateResponse>((UploadSigningCertificateRequest)req, (UploadSigningCertificateResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<UploadSigningCertificateRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Initiates the asynchronous execution of the UploadSigningCertificate operation. /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService.UploadSigningCertificate"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UploadSigningCertificate 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<UploadSigningCertificateResponse> UploadSigningCertificateAsync(UploadSigningCertificateRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UploadSigningCertificateRequestMarshaller(); var unmarshaller = UploadSigningCertificateResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, UploadSigningCertificateRequest, UploadSigningCertificateResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para>Uploads an X.509 signing certificate and associates it with the specified user. Some AWS services use X.509 signing certificates to /// validate requests that are signed with a corresponding private key. When you upload the certificate, its default status is <c>Active</c> /// .</para> <para>If the <c>UserName</c> field is not specified, the user name is determined implicitly based on the AWS access key ID used to /// sign the request. Because this action works for access keys under the AWS account, this API can be used to manage root credentials even if /// the AWS account has no associated users.</para> <para><b>NOTE:</b>Because the body of a X.509 certificate can be large, you should use POST /// rather than GET when calling UploadSigningCertificate. For information about setting up signatures and authorization through the API, go to /// Signing AWS API Requests in the AWS General Reference. For general information about using the Query API with IAM, go to Making Query /// Requests in Using IAM.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UploadSigningCertificate service method /// on AmazonIdentityManagementService.</param> /// /// <returns>The response from the UploadSigningCertificate service method, as returned by AmazonIdentityManagementService.</returns> /// /// <exception cref="T:Amazon.IdentityManagement.Model.DuplicateCertificateException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.InvalidCertificateException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.MalformedCertificateException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.LimitExceededException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.EntityAlreadyExistsException" /> public UploadSigningCertificateResponse UploadSigningCertificate(UploadSigningCertificateRequest request) { var task = UploadSigningCertificateAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para>Uploads an X.509 signing certificate and associates it with the specified user. Some AWS services use X.509 signing certificates to /// validate requests that are signed with a corresponding private key. When you upload the certificate, its default status is <c>Active</c> /// .</para> <para>If the <c>UserName</c> field is not specified, the user name is determined implicitly based on the AWS access key ID used to /// sign the request. Because this action works for access keys under the AWS account, this API can be used to manage root credentials even if /// the AWS account has no associated users.</para> <para><b>NOTE:</b>Because the body of a X.509 certificate can be large, you should use POST /// rather than GET when calling UploadSigningCertificate. For information about setting up signatures and authorization through the API, go to /// Signing AWS API Requests in the AWS General Reference. For general information about using the Query API with IAM, go to Making Query /// Requests in Using IAM.</para> /// </summary> /// /// <param name="uploadSigningCertificateRequest">Container for the necessary parameters to execute the UploadSigningCertificate service method /// on AmazonIdentityManagementService.</param> /// /// <returns>The response from the UploadSigningCertificate service method, as returned by AmazonIdentityManagementService.</returns> /// /// <exception cref="T:Amazon.IdentityManagement.Model.DuplicateCertificateException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.InvalidCertificateException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.MalformedCertificateException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.LimitExceededException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.EntityAlreadyExistsException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<UploadSigningCertificateResponse> UploadSigningCertificateAsync(UploadSigningCertificateRequest uploadSigningCertificateRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UploadSigningCertificateRequestMarshaller(); var unmarshaller = UploadSigningCertificateResponseUnmarshaller.GetInstance(); return Invoke<IRequest, UploadSigningCertificateRequest, UploadSigningCertificateResponse>(uploadSigningCertificateRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal UploadSigningCertificateResponse UploadSigningCertificate(UploadSigningCertificateRequest request) { var task = UploadSigningCertificateAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
private Amazon.IdentityManagement.Model.UploadSigningCertificateResponse CallAWSServiceOperation(IAmazonIdentityManagementService client, Amazon.IdentityManagement.Model.UploadSigningCertificateRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Identity and Access Management", "UploadSigningCertificate"); try { #if DESKTOP return(client.UploadSigningCertificate(request)); #elif CORECLR return(client.UploadSigningCertificateAsync(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; } }
IAsyncResult invokeUploadSigningCertificate(UploadSigningCertificateRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new UploadSigningCertificateRequestMarshaller(); var unmarshaller = UploadSigningCertificateResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }