private Amazon.Pinpoint.Model.UpdateVoiceTemplateResponse CallAWSServiceOperation(IAmazonPinpoint client, Amazon.Pinpoint.Model.UpdateVoiceTemplateRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Pinpoint", "UpdateVoiceTemplate");
     try
     {
         #if DESKTOP
         return(client.UpdateVoiceTemplate(request));
         #elif CORECLR
         return(client.UpdateVoiceTemplateAsync(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.Pinpoint.Model.UpdateVoiceTemplateRequest();

            if (cmdletContext.CreateNewVersion != null)
            {
                request.CreateNewVersion = cmdletContext.CreateNewVersion.Value;
            }
            if (cmdletContext.TemplateName != null)
            {
                request.TemplateName = cmdletContext.TemplateName;
            }
            if (cmdletContext.Version != null)
            {
                request.Version = cmdletContext.Version;
            }

            // populate VoiceTemplateRequest
            var requestVoiceTemplateRequestIsNull = true;

            request.VoiceTemplateRequest = new Amazon.Pinpoint.Model.VoiceTemplateRequest();
            System.String requestVoiceTemplateRequest_voiceTemplateRequest_Body = null;
            if (cmdletContext.VoiceTemplateRequest_Body != null)
            {
                requestVoiceTemplateRequest_voiceTemplateRequest_Body = cmdletContext.VoiceTemplateRequest_Body;
            }
            if (requestVoiceTemplateRequest_voiceTemplateRequest_Body != null)
            {
                request.VoiceTemplateRequest.Body = requestVoiceTemplateRequest_voiceTemplateRequest_Body;
                requestVoiceTemplateRequestIsNull = false;
            }
            System.String requestVoiceTemplateRequest_voiceTemplateRequest_DefaultSubstitution = null;
            if (cmdletContext.VoiceTemplateRequest_DefaultSubstitution != null)
            {
                requestVoiceTemplateRequest_voiceTemplateRequest_DefaultSubstitution = cmdletContext.VoiceTemplateRequest_DefaultSubstitution;
            }
            if (requestVoiceTemplateRequest_voiceTemplateRequest_DefaultSubstitution != null)
            {
                request.VoiceTemplateRequest.DefaultSubstitutions = requestVoiceTemplateRequest_voiceTemplateRequest_DefaultSubstitution;
                requestVoiceTemplateRequestIsNull = false;
            }
            System.String requestVoiceTemplateRequest_voiceTemplateRequest_LanguageCode = null;
            if (cmdletContext.VoiceTemplateRequest_LanguageCode != null)
            {
                requestVoiceTemplateRequest_voiceTemplateRequest_LanguageCode = cmdletContext.VoiceTemplateRequest_LanguageCode;
            }
            if (requestVoiceTemplateRequest_voiceTemplateRequest_LanguageCode != null)
            {
                request.VoiceTemplateRequest.LanguageCode = requestVoiceTemplateRequest_voiceTemplateRequest_LanguageCode;
                requestVoiceTemplateRequestIsNull         = false;
            }
            Dictionary <System.String, System.String> requestVoiceTemplateRequest_voiceTemplateRequest_Tag = null;

            if (cmdletContext.VoiceTemplateRequest_Tag != null)
            {
                requestVoiceTemplateRequest_voiceTemplateRequest_Tag = cmdletContext.VoiceTemplateRequest_Tag;
            }
            if (requestVoiceTemplateRequest_voiceTemplateRequest_Tag != null)
            {
                request.VoiceTemplateRequest.Tags = requestVoiceTemplateRequest_voiceTemplateRequest_Tag;
                requestVoiceTemplateRequestIsNull = false;
            }
            System.String requestVoiceTemplateRequest_voiceTemplateRequest_TemplateDescription = null;
            if (cmdletContext.VoiceTemplateRequest_TemplateDescription != null)
            {
                requestVoiceTemplateRequest_voiceTemplateRequest_TemplateDescription = cmdletContext.VoiceTemplateRequest_TemplateDescription;
            }
            if (requestVoiceTemplateRequest_voiceTemplateRequest_TemplateDescription != null)
            {
                request.VoiceTemplateRequest.TemplateDescription = requestVoiceTemplateRequest_voiceTemplateRequest_TemplateDescription;
                requestVoiceTemplateRequestIsNull = false;
            }
            System.String requestVoiceTemplateRequest_voiceTemplateRequest_VoiceId = null;
            if (cmdletContext.VoiceTemplateRequest_VoiceId != null)
            {
                requestVoiceTemplateRequest_voiceTemplateRequest_VoiceId = cmdletContext.VoiceTemplateRequest_VoiceId;
            }
            if (requestVoiceTemplateRequest_voiceTemplateRequest_VoiceId != null)
            {
                request.VoiceTemplateRequest.VoiceId = requestVoiceTemplateRequest_voiceTemplateRequest_VoiceId;
                requestVoiceTemplateRequestIsNull    = false;
            }
            // determine if request.VoiceTemplateRequest should be set to null
            if (requestVoiceTemplateRequestIsNull)
            {
                request.VoiceTemplateRequest = null;
            }

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