Container for the parameters to the ResyncMFADevice operation.

Synchronizes the specified MFA device with AWS servers.

Наследование: AmazonIdentityManagementServiceRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.IdentityManagement.Model.ResyncMFADeviceRequest();

            if (cmdletContext.AuthenticationCode1 != null)
            {
                request.AuthenticationCode1 = cmdletContext.AuthenticationCode1;
            }
            if (cmdletContext.AuthenticationCode2 != null)
            {
                request.AuthenticationCode2 = cmdletContext.AuthenticationCode2;
            }
            if (cmdletContext.SerialNumber != null)
            {
                request.SerialNumber = cmdletContext.SerialNumber;
            }
            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);
        }
 private Amazon.IdentityManagement.Model.ResyncMFADeviceResponse CallAWSServiceOperation(IAmazonIdentityManagementService client, Amazon.IdentityManagement.Model.ResyncMFADeviceRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Identity and Access Management", "ResyncMFADevice");
     try
     {
         #if DESKTOP
         return(client.ResyncMFADevice(request));
         #elif CORECLR
         return(client.ResyncMFADeviceAsync(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;
     }
 }
        internal ResyncMFADeviceResponse ResyncMFADevice(ResyncMFADeviceRequest request)
        {
            var marshaller = new ResyncMFADeviceRequestMarshaller();
            var unmarshaller = ResyncMFADeviceResponseUnmarshaller.Instance;

            return Invoke<ResyncMFADeviceRequest,ResyncMFADeviceResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ResyncMFADevice operation.
        /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ResyncMFADevice 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<ResyncMFADeviceResponse> ResyncMFADeviceAsync(ResyncMFADeviceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ResyncMFADeviceRequestMarshaller();
            var unmarshaller = ResyncMFADeviceResponseUnmarshaller.Instance;

            return InvokeAsync<ResyncMFADeviceRequest,ResyncMFADeviceResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
 /// <summary>
 /// <para>Synchronizes the specified MFA device with AWS servers.</para>
 /// </summary>
 /// 
 /// <param name="resyncMFADeviceRequest">Container for the necessary parameters to execute the ResyncMFADevice service method on
 ///          AmazonIdentityManagementService.</param>
 /// 
 /// <exception cref="NoSuchEntityException"/>
 /// <exception cref="InvalidAuthenticationCodeException"/>
 public ResyncMFADeviceResponse ResyncMFADevice(ResyncMFADeviceRequest resyncMFADeviceRequest)
 {
     IAsyncResult asyncResult = invokeResyncMFADevice(resyncMFADeviceRequest, null, null, true);
     return EndResyncMFADevice(asyncResult);
 }
 IAsyncResult invokeResyncMFADevice(ResyncMFADeviceRequest resyncMFADeviceRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new ResyncMFADeviceRequestMarshaller().Marshall(resyncMFADeviceRequest);
     var unmarshaller = ResyncMFADeviceResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
        /// <summary>
        /// Initiates the asynchronous execution of the ResyncMFADevice operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ResyncMFADevice 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 EndResyncMFADevice
        ///         operation.</returns>
        public IAsyncResult BeginResyncMFADevice(ResyncMFADeviceRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new ResyncMFADeviceRequestMarshaller();
            var unmarshaller = ResyncMFADeviceResponseUnmarshaller.Instance;

            return BeginInvoke<ResyncMFADeviceRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 /// <summary>
 /// Initiates the asynchronous execution of the ResyncMFADevice operation.
 /// <seealso cref="Amazon.IdentityManagement.AmazonIdentityManagementService.ResyncMFADevice"/>
 /// </summary>
 /// 
 /// <param name="resyncMFADeviceRequest">Container for the necessary parameters to execute the ResyncMFADevice 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 BeginResyncMFADevice(ResyncMFADeviceRequest resyncMFADeviceRequest, AsyncCallback callback, object state)
 {
     return invokeResyncMFADevice(resyncMFADeviceRequest, callback, state, false);
 }
 /// <summary>
 /// Initiates the asynchronous execution of the ResyncMFADevice operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the ResyncMFADevice 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 ResyncMFADeviceAsync(ResyncMFADeviceRequest request, AmazonServiceCallback<ResyncMFADeviceRequest, ResyncMFADeviceResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new ResyncMFADeviceRequestMarshaller();
     var unmarshaller = ResyncMFADeviceResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<ResyncMFADeviceRequest,ResyncMFADeviceResponse> responseObject 
                     = new AmazonServiceResult<ResyncMFADeviceRequest,ResyncMFADeviceResponse>((ResyncMFADeviceRequest)req, (ResyncMFADeviceResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<ResyncMFADeviceRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
 /// <summary>
 /// <para>Synchronizes the specified MFA device with AWS servers.</para>
 /// </summary>
 /// 
 /// <param name="resyncMFADeviceRequest">Container for the necessary
 ///           parameters to execute the ResyncMFADevice service method on
 ///           AmazonIdentityManagementService.</param>
 /// 
 /// <exception cref="NoSuchEntityException"/>
 /// <exception cref="InvalidAuthenticationCodeException"/>
 public ResyncMFADeviceResponse ResyncMFADevice(ResyncMFADeviceRequest resyncMFADeviceRequest)
 {
     IRequest<ResyncMFADeviceRequest> request = new ResyncMFADeviceRequestMarshaller().Marshall(resyncMFADeviceRequest);
     ResyncMFADeviceResponse response = Invoke<ResyncMFADeviceRequest, ResyncMFADeviceResponse> (request, this.signer, ResyncMFADeviceResponseUnmarshaller.GetInstance());
     return response;
 }
        /// <summary>
        /// Initiates the asynchronous execution of the ResyncMFADevice operation.
        /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService.ResyncMFADevice"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ResyncMFADevice 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<ResyncMFADeviceResponse> ResyncMFADeviceAsync(ResyncMFADeviceRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ResyncMFADeviceRequestMarshaller();
            var unmarshaller = ResyncMFADeviceResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, ResyncMFADeviceRequest, ResyncMFADeviceResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
        /// <summary>
        /// <para>Synchronizes the specified MFA device with AWS servers.</para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ResyncMFADevice service method on
        /// AmazonIdentityManagementService.</param>
        /// 
        /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" />
        /// <exception cref="T:Amazon.IdentityManagement.Model.InvalidAuthenticationCodeException" />
        /// <exception cref="T:Amazon.IdentityManagement.Model.LimitExceededException" />
		public ResyncMFADeviceResponse ResyncMFADevice(ResyncMFADeviceRequest request)
        {
            var task = ResyncMFADeviceAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
Пример #13
0
        /// <summary>
        /// <para>Synchronizes the specified MFA device with AWS servers.</para>
        /// </summary>
        /// 
        /// <param name="resyncMFADeviceRequest">Container for the necessary parameters to execute the ResyncMFADevice service method on
        /// AmazonIdentityManagementService.</param>
        /// 
        /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" />
        /// <exception cref="T:Amazon.IdentityManagement.Model.InvalidAuthenticationCodeException" />
        /// <exception cref="T:Amazon.IdentityManagement.Model.LimitExceededException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<ResyncMFADeviceResponse> ResyncMFADeviceAsync(ResyncMFADeviceRequest resyncMFADeviceRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ResyncMFADeviceRequestMarshaller();
            var unmarshaller = ResyncMFADeviceResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, ResyncMFADeviceRequest, ResyncMFADeviceResponse>(resyncMFADeviceRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
Пример #14
0
		internal ResyncMFADeviceResponse ResyncMFADevice(ResyncMFADeviceRequest request)
        {
            var task = ResyncMFADeviceAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
        IAsyncResult invokeResyncMFADevice(ResyncMFADeviceRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new ResyncMFADeviceRequestMarshaller();
            var unmarshaller = ResyncMFADeviceResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }