Container for the parameters to the CreateAccountAlias operation.

This action creates an alias for your AWS account. For information about using an AWS account alias, see Using an Alias for Your AWS Account ID in Using AWS Identity and Access Management .

Inheritance: AmazonIdentityManagementServiceRequest
コード例 #1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.IdentityManagement.Model.CreateAccountAliasRequest();

            if (cmdletContext.AccountAlias != null)
            {
                request.AccountAlias = cmdletContext.AccountAlias;
            }

            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);
        }
コード例 #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateAccountAlias operation.
        /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateAccountAlias 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<CreateAccountAliasResponse> CreateAccountAliasAsync(CreateAccountAliasRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateAccountAliasRequestMarshaller();
            var unmarshaller = CreateAccountAliasResponseUnmarshaller.Instance;

            return InvokeAsync<CreateAccountAliasRequest,CreateAccountAliasResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
コード例 #3
0
        internal CreateAccountAliasResponse CreateAccountAlias(CreateAccountAliasRequest request)
        {
            var marshaller = new CreateAccountAliasRequestMarshaller();
            var unmarshaller = CreateAccountAliasResponseUnmarshaller.Instance;

            return Invoke<CreateAccountAliasRequest,CreateAccountAliasResponse>(request, marshaller, unmarshaller);
        }
 IAsyncResult invokeCreateAccountAlias(CreateAccountAliasRequest createAccountAliasRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new CreateAccountAliasRequestMarshaller().Marshall(createAccountAliasRequest);
     var unmarshaller = CreateAccountAliasResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
 /// <summary>
 /// Initiates the asynchronous execution of the CreateAccountAlias operation.
 /// <seealso cref="Amazon.IdentityManagement.AmazonIdentityManagementService.CreateAccountAlias"/>
 /// </summary>
 /// 
 /// <param name="createAccountAliasRequest">Container for the necessary parameters to execute the CreateAccountAlias 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>
 public IAsyncResult BeginCreateAccountAlias(CreateAccountAliasRequest createAccountAliasRequest, AsyncCallback callback, object state)
 {
     return invokeCreateAccountAlias(createAccountAliasRequest, callback, state, false);
 }
 /// <summary>
 /// <para>This action creates an alias for your AWS account. For information about using an AWS account alias, see Using an Alias for Your AWS
 /// Account ID in <i>Using AWS Identity and Access Management</i> .</para>
 /// </summary>
 /// 
 /// <param name="createAccountAliasRequest">Container for the necessary parameters to execute the CreateAccountAlias service method on
 ///          AmazonIdentityManagementService.</param>
 /// 
 /// <exception cref="EntityAlreadyExistsException"/>
 public CreateAccountAliasResponse CreateAccountAlias(CreateAccountAliasRequest createAccountAliasRequest)
 {
     IAsyncResult asyncResult = invokeCreateAccountAlias(createAccountAliasRequest, null, null, true);
     return EndCreateAccountAlias(asyncResult);
 }
コード例 #7
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateAccountAlias operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateAccountAlias 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 EndCreateAccountAlias
        ///         operation.</returns>
        public IAsyncResult BeginCreateAccountAlias(CreateAccountAliasRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateAccountAliasRequestMarshaller();
            var unmarshaller = CreateAccountAliasResponseUnmarshaller.Instance;

            return BeginInvoke<CreateAccountAliasRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
コード例 #8
0
 private Amazon.IdentityManagement.Model.CreateAccountAliasResponse CallAWSServiceOperation(IAmazonIdentityManagementService client, Amazon.IdentityManagement.Model.CreateAccountAliasRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Identity and Access Management", "CreateAccountAlias");
     try
     {
         #if DESKTOP
         return(client.CreateAccountAlias(request));
         #elif CORECLR
         return(client.CreateAccountAliasAsync(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;
     }
 }
コード例 #9
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateAccountAlias operation.
        /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService.CreateAccountAlias"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateAccountAlias 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<CreateAccountAliasResponse> CreateAccountAliasAsync(CreateAccountAliasRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateAccountAliasRequestMarshaller();
            var unmarshaller = CreateAccountAliasResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, CreateAccountAliasRequest, CreateAccountAliasResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
コード例 #10
0
 /// <summary>
 /// Initiates the asynchronous execution of the CreateAccountAlias operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the CreateAccountAlias 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 CreateAccountAliasAsync(CreateAccountAliasRequest request, AmazonServiceCallback<CreateAccountAliasRequest, CreateAccountAliasResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new CreateAccountAliasRequestMarshaller();
     var unmarshaller = CreateAccountAliasResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<CreateAccountAliasRequest,CreateAccountAliasResponse> responseObject 
                     = new AmazonServiceResult<CreateAccountAliasRequest,CreateAccountAliasResponse>((CreateAccountAliasRequest)req, (CreateAccountAliasResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<CreateAccountAliasRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
コード例 #11
0
        /// <summary>
        /// <para>This action creates an alias for your AWS account. For information about using an AWS account alias, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html">Using an Alias for Your AWS Account ID</a> in <i>Using AWS
        /// Identity and Access Management</i> .</para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateAccountAlias service method on
        /// AmazonIdentityManagementService.</param>
        /// 
        /// <exception cref="T:Amazon.IdentityManagement.Model.LimitExceededException" />
        /// <exception cref="T:Amazon.IdentityManagement.Model.EntityAlreadyExistsException" />
		public CreateAccountAliasResponse CreateAccountAlias(CreateAccountAliasRequest request)
        {
            var task = CreateAccountAliasAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
コード例 #12
0
        /// <summary>
        /// <para>This action creates an alias for your AWS account. For information about using an AWS account alias, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html">Using an Alias for Your AWS Account ID</a> in <i>Using AWS
        /// Identity and Access Management</i> .</para>
        /// </summary>
        /// 
        /// <param name="createAccountAliasRequest">Container for the necessary parameters to execute the CreateAccountAlias service method on
        /// AmazonIdentityManagementService.</param>
        /// 
        /// <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<CreateAccountAliasResponse> CreateAccountAliasAsync(CreateAccountAliasRequest createAccountAliasRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateAccountAliasRequestMarshaller();
            var unmarshaller = CreateAccountAliasResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, CreateAccountAliasRequest, CreateAccountAliasResponse>(createAccountAliasRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
コード例 #13
0
		internal CreateAccountAliasResponse CreateAccountAlias(CreateAccountAliasRequest request)
        {
            var task = CreateAccountAliasAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
        IAsyncResult invokeCreateAccountAlias(CreateAccountAliasRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new CreateAccountAliasRequestMarshaller();
            var unmarshaller = CreateAccountAliasResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }
コード例 #15
0
 /// <summary>
 /// <para>This action creates an alias for your AWS account. For information about using an AWS account alias, see Using an Alias for Your AWS
 /// Account ID in <i>Using AWS Identity and Access Management</i> .</para>
 /// </summary>
 /// 
 /// <param name="createAccountAliasRequest">Container for the necessary parameters to execute the CreateAccountAlias service method on
 ///           AmazonIdentityManagementService.</param>
 /// 
 /// <exception cref="EntityAlreadyExistsException"/>
 public CreateAccountAliasResponse CreateAccountAlias(CreateAccountAliasRequest createAccountAliasRequest)
 {
     IRequest<CreateAccountAliasRequest> request = new CreateAccountAliasRequestMarshaller().Marshall(createAccountAliasRequest);
     CreateAccountAliasResponse response = Invoke<CreateAccountAliasRequest, CreateAccountAliasResponse> (request, this.signer, CreateAccountAliasResponseUnmarshaller.GetInstance());
     return response;
 }