private Amazon.SSMIncidents.Model.UpdateIncidentRecordResponse CallAWSServiceOperation(IAmazonSSMIncidents client, Amazon.SSMIncidents.Model.UpdateIncidentRecordRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Systems Manager Incident Manager", "UpdateIncidentRecord");
     try
     {
         #if DESKTOP
         return(client.UpdateIncidentRecord(request));
         #elif CORECLR
         return(client.UpdateIncidentRecordAsync(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;
     }
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.SSMIncidents.Model.UpdateIncidentRecordRequest();

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

            // populate ChatChannel
            var requestChatChannelIsNull = true;

            request.ChatChannel = new Amazon.SSMIncidents.Model.ChatChannel();
            List <System.String> requestChatChannel_chatChannel_ChatbotSn = null;

            if (cmdletContext.ChatChannel_ChatbotSn != null)
            {
                requestChatChannel_chatChannel_ChatbotSn = cmdletContext.ChatChannel_ChatbotSn;
            }
            if (requestChatChannel_chatChannel_ChatbotSn != null)
            {
                request.ChatChannel.ChatbotSns = requestChatChannel_chatChannel_ChatbotSn;
                requestChatChannelIsNull       = false;
            }
            Amazon.SSMIncidents.Model.EmptyChatChannel requestChatChannel_chatChannel_Empty = null;
            if (cmdletContext.ChatChannel_Empty != null)
            {
                requestChatChannel_chatChannel_Empty = cmdletContext.ChatChannel_Empty;
            }
            if (requestChatChannel_chatChannel_Empty != null)
            {
                request.ChatChannel.Empty = requestChatChannel_chatChannel_Empty;
                requestChatChannelIsNull  = false;
            }
            // determine if request.ChatChannel should be set to null
            if (requestChatChannelIsNull)
            {
                request.ChatChannel = null;
            }
            if (cmdletContext.ClientToken != null)
            {
                request.ClientToken = cmdletContext.ClientToken;
            }
            if (cmdletContext.Impact != null)
            {
                request.Impact = cmdletContext.Impact.Value;
            }
            if (cmdletContext.NotificationTarget != null)
            {
                request.NotificationTargets = cmdletContext.NotificationTarget;
            }
            if (cmdletContext.Status != null)
            {
                request.Status = cmdletContext.Status;
            }
            if (cmdletContext.Summary != null)
            {
                request.Summary = cmdletContext.Summary;
            }
            if (cmdletContext.Title != null)
            {
                request.Title = cmdletContext.Title;
            }

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