/// <summary>
        /// Initiates the asynchronous execution of the UpdateAssociationStatus operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateAssociationStatus operation on AmazonSimpleSystemsManagementClient.</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 EndUpdateAssociationStatus
        ///         operation.</returns>
        public IAsyncResult BeginUpdateAssociationStatus(UpdateAssociationStatusRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new UpdateAssociationStatusRequestMarshaller();
            var unmarshaller = UpdateAssociationStatusResponseUnmarshaller.Instance;

            return BeginInvoke<UpdateAssociationStatusRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Updates the status of the SSM document associated with the specified instance.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the UpdateAssociationStatus service method.</param>
        /// 
        /// <returns>The response from the UpdateAssociationStatus service method, as returned by SimpleSystemsManagement.</returns>
        /// <exception cref="Amazon.SimpleSystemsManagement.Model.AssociationDoesNotExistException">
        /// The specified association does not exist.
        /// </exception>
        /// <exception cref="Amazon.SimpleSystemsManagement.Model.InternalServerErrorException">
        /// An error occurred on the server side.
        /// </exception>
        /// <exception cref="Amazon.SimpleSystemsManagement.Model.InvalidDocumentException">
        /// The specified document does not exist.
        /// </exception>
        /// <exception cref="Amazon.SimpleSystemsManagement.Model.InvalidInstanceIdException">
        /// The following problems can cause this exception:
        /// 
        ///  
        /// <para>
        /// You do not have permission to access the instance.
        /// </para>
        ///  
        /// <para>
        /// The SSM agent is not running. On managed instances and Linux instances, verify that
        /// the SSM agent is running. On EC2 Windows instances, verify that the EC2Config service
        /// is running.
        /// </para>
        ///  
        /// <para>
        /// The SSM agent or EC2Config service is not registered to the SSM endpoint. Try reinstalling
        /// the SSM agent or EC2Config service.
        /// </para>
        ///  
        /// <para>
        /// The instance is not in valid state. Valid states are: Running, Pending, Stopped, Stopping.
        /// Invalid states are: Shutting-down and Terminated.
        /// </para>
        /// </exception>
        /// <exception cref="Amazon.SimpleSystemsManagement.Model.StatusUnchangedException">
        /// The updated status is the same as the current status.
        /// </exception>
        /// <exception cref="Amazon.SimpleSystemsManagement.Model.TooManyUpdatesException">
        /// There are concurrent updates for a resource that supports one update at a time.
        /// </exception>
        public UpdateAssociationStatusResponse UpdateAssociationStatus(UpdateAssociationStatusRequest request)
        {
            var marshaller = new UpdateAssociationStatusRequestMarshaller();
            var unmarshaller = UpdateAssociationStatusResponseUnmarshaller.Instance;

            return Invoke<UpdateAssociationStatusRequest,UpdateAssociationStatusResponse>(request, marshaller, unmarshaller);
        }
 private Amazon.SimpleSystemsManagement.Model.UpdateAssociationStatusResponse CallAWSServiceOperation(IAmazonSimpleSystemsManagement client, Amazon.SimpleSystemsManagement.Model.UpdateAssociationStatusRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Systems Manager", "UpdateAssociationStatus");
     try
     {
         #if DESKTOP
         return(client.UpdateAssociationStatus(request));
         #elif CORECLR
         return(client.UpdateAssociationStatusAsync(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 UpdateAssociationStatus operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateAssociationStatus 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<UpdateAssociationStatusResponse> UpdateAssociationStatusAsync(UpdateAssociationStatusRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new UpdateAssociationStatusRequestMarshaller();
            var unmarshaller = UpdateAssociationStatusResponseUnmarshaller.Instance;

            return InvokeAsync<UpdateAssociationStatusRequest,UpdateAssociationStatusResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.SimpleSystemsManagement.Model.UpdateAssociationStatusRequest();


            // populate AssociationStatus
            var requestAssociationStatusIsNull = true;

            request.AssociationStatus = new Amazon.SimpleSystemsManagement.Model.AssociationStatus();
            System.String requestAssociationStatus_associationStatus_AdditionalInfo = null;
            if (cmdletContext.AssociationStatus_AdditionalInfo != null)
            {
                requestAssociationStatus_associationStatus_AdditionalInfo = cmdletContext.AssociationStatus_AdditionalInfo;
            }
            if (requestAssociationStatus_associationStatus_AdditionalInfo != null)
            {
                request.AssociationStatus.AdditionalInfo = requestAssociationStatus_associationStatus_AdditionalInfo;
                requestAssociationStatusIsNull           = false;
            }
            System.DateTime?requestAssociationStatus_associationStatus_Date = null;
            if (cmdletContext.AssociationStatus_Date != null)
            {
                requestAssociationStatus_associationStatus_Date = cmdletContext.AssociationStatus_Date.Value;
            }
            if (requestAssociationStatus_associationStatus_Date != null)
            {
                request.AssociationStatus.Date = requestAssociationStatus_associationStatus_Date.Value;
                requestAssociationStatusIsNull = false;
            }
            System.String requestAssociationStatus_associationStatus_Message = null;
            if (cmdletContext.AssociationStatus_Message != null)
            {
                requestAssociationStatus_associationStatus_Message = cmdletContext.AssociationStatus_Message;
            }
            if (requestAssociationStatus_associationStatus_Message != null)
            {
                request.AssociationStatus.Message = requestAssociationStatus_associationStatus_Message;
                requestAssociationStatusIsNull    = false;
            }
            Amazon.SimpleSystemsManagement.AssociationStatusName requestAssociationStatus_associationStatus_Name = null;
            if (cmdletContext.AssociationStatus_Name != null)
            {
                requestAssociationStatus_associationStatus_Name = cmdletContext.AssociationStatus_Name;
            }
            if (requestAssociationStatus_associationStatus_Name != null)
            {
                request.AssociationStatus.Name = requestAssociationStatus_associationStatus_Name;
                requestAssociationStatusIsNull = false;
            }
            // determine if request.AssociationStatus should be set to null
            if (requestAssociationStatusIsNull)
            {
                request.AssociationStatus = null;
            }
            if (cmdletContext.InstanceId != null)
            {
                request.InstanceId = cmdletContext.InstanceId;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }

            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);
        }