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

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

            // populate EmailChannelRequest
            var requestEmailChannelRequestIsNull = true;

            request.EmailChannelRequest = new Amazon.Pinpoint.Model.EmailChannelRequest();
            System.String requestEmailChannelRequest_emailChannelRequest_ConfigurationSet = null;
            if (cmdletContext.EmailChannelRequest_ConfigurationSet != null)
            {
                requestEmailChannelRequest_emailChannelRequest_ConfigurationSet = cmdletContext.EmailChannelRequest_ConfigurationSet;
            }
            if (requestEmailChannelRequest_emailChannelRequest_ConfigurationSet != null)
            {
                request.EmailChannelRequest.ConfigurationSet = requestEmailChannelRequest_emailChannelRequest_ConfigurationSet;
                requestEmailChannelRequestIsNull             = false;
            }
            System.Boolean?requestEmailChannelRequest_emailChannelRequest_Enabled = null;
            if (cmdletContext.EmailChannelRequest_Enabled != null)
            {
                requestEmailChannelRequest_emailChannelRequest_Enabled = cmdletContext.EmailChannelRequest_Enabled.Value;
            }
            if (requestEmailChannelRequest_emailChannelRequest_Enabled != null)
            {
                request.EmailChannelRequest.Enabled = requestEmailChannelRequest_emailChannelRequest_Enabled.Value;
                requestEmailChannelRequestIsNull    = false;
            }
            System.String requestEmailChannelRequest_emailChannelRequest_FromAddress = null;
            if (cmdletContext.EmailChannelRequest_FromAddress != null)
            {
                requestEmailChannelRequest_emailChannelRequest_FromAddress = cmdletContext.EmailChannelRequest_FromAddress;
            }
            if (requestEmailChannelRequest_emailChannelRequest_FromAddress != null)
            {
                request.EmailChannelRequest.FromAddress = requestEmailChannelRequest_emailChannelRequest_FromAddress;
                requestEmailChannelRequestIsNull        = false;
            }
            System.String requestEmailChannelRequest_emailChannelRequest_Identity = null;
            if (cmdletContext.EmailChannelRequest_Identity != null)
            {
                requestEmailChannelRequest_emailChannelRequest_Identity = cmdletContext.EmailChannelRequest_Identity;
            }
            if (requestEmailChannelRequest_emailChannelRequest_Identity != null)
            {
                request.EmailChannelRequest.Identity = requestEmailChannelRequest_emailChannelRequest_Identity;
                requestEmailChannelRequestIsNull     = false;
            }
            System.String requestEmailChannelRequest_emailChannelRequest_RoleArn = null;
            if (cmdletContext.EmailChannelRequest_RoleArn != null)
            {
                requestEmailChannelRequest_emailChannelRequest_RoleArn = cmdletContext.EmailChannelRequest_RoleArn;
            }
            if (requestEmailChannelRequest_emailChannelRequest_RoleArn != null)
            {
                request.EmailChannelRequest.RoleArn = requestEmailChannelRequest_emailChannelRequest_RoleArn;
                requestEmailChannelRequestIsNull    = false;
            }
            // determine if request.EmailChannelRequest should be set to null
            if (requestEmailChannelRequestIsNull)
            {
                request.EmailChannelRequest = 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);
        }