private Amazon.SSMIncidents.Model.UpdateResponsePlanResponse CallAWSServiceOperation(IAmazonSSMIncidents client, Amazon.SSMIncidents.Model.UpdateResponsePlanRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Systems Manager Incident Manager", "UpdateResponsePlan"); try { #if DESKTOP return(client.UpdateResponsePlan(request)); #elif CORECLR return(client.UpdateResponsePlanAsync(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.UpdateResponsePlanRequest(); if (cmdletContext.Action != null) { request.Actions = cmdletContext.Action; } 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.DisplayName != null) { request.DisplayName = cmdletContext.DisplayName; } if (cmdletContext.Engagement != null) { request.Engagements = cmdletContext.Engagement; } if (cmdletContext.IncidentTemplateDedupeString != null) { request.IncidentTemplateDedupeString = cmdletContext.IncidentTemplateDedupeString; } if (cmdletContext.IncidentTemplateImpact != null) { request.IncidentTemplateImpact = cmdletContext.IncidentTemplateImpact.Value; } if (cmdletContext.IncidentTemplateNotificationTarget != null) { request.IncidentTemplateNotificationTargets = cmdletContext.IncidentTemplateNotificationTarget; } if (cmdletContext.IncidentTemplateSummary != null) { request.IncidentTemplateSummary = cmdletContext.IncidentTemplateSummary; } if (cmdletContext.IncidentTemplateTitle != null) { request.IncidentTemplateTitle = cmdletContext.IncidentTemplateTitle; } 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); }