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


            // populate InAppTemplateRequest
            var requestInAppTemplateRequestIsNull = true;

            request.InAppTemplateRequest = new Amazon.Pinpoint.Model.InAppTemplateRequest();
            List <Amazon.Pinpoint.Model.InAppMessageContent> requestInAppTemplateRequest_inAppTemplateRequest_Content = null;

            if (cmdletContext.InAppTemplateRequest_Content != null)
            {
                requestInAppTemplateRequest_inAppTemplateRequest_Content = cmdletContext.InAppTemplateRequest_Content;
            }
            if (requestInAppTemplateRequest_inAppTemplateRequest_Content != null)
            {
                request.InAppTemplateRequest.Content = requestInAppTemplateRequest_inAppTemplateRequest_Content;
                requestInAppTemplateRequestIsNull    = false;
            }
            Dictionary <System.String, System.String> requestInAppTemplateRequest_inAppTemplateRequest_CustomConfig = null;

            if (cmdletContext.InAppTemplateRequest_CustomConfig != null)
            {
                requestInAppTemplateRequest_inAppTemplateRequest_CustomConfig = cmdletContext.InAppTemplateRequest_CustomConfig;
            }
            if (requestInAppTemplateRequest_inAppTemplateRequest_CustomConfig != null)
            {
                request.InAppTemplateRequest.CustomConfig = requestInAppTemplateRequest_inAppTemplateRequest_CustomConfig;
                requestInAppTemplateRequestIsNull         = false;
            }
            Amazon.Pinpoint.Layout requestInAppTemplateRequest_inAppTemplateRequest_Layout = null;
            if (cmdletContext.InAppTemplateRequest_Layout != null)
            {
                requestInAppTemplateRequest_inAppTemplateRequest_Layout = cmdletContext.InAppTemplateRequest_Layout;
            }
            if (requestInAppTemplateRequest_inAppTemplateRequest_Layout != null)
            {
                request.InAppTemplateRequest.Layout = requestInAppTemplateRequest_inAppTemplateRequest_Layout;
                requestInAppTemplateRequestIsNull   = false;
            }
            Dictionary <System.String, System.String> requestInAppTemplateRequest_inAppTemplateRequest_Tag = null;

            if (cmdletContext.InAppTemplateRequest_Tag != null)
            {
                requestInAppTemplateRequest_inAppTemplateRequest_Tag = cmdletContext.InAppTemplateRequest_Tag;
            }
            if (requestInAppTemplateRequest_inAppTemplateRequest_Tag != null)
            {
                request.InAppTemplateRequest.Tags = requestInAppTemplateRequest_inAppTemplateRequest_Tag;
                requestInAppTemplateRequestIsNull = false;
            }
            System.String requestInAppTemplateRequest_inAppTemplateRequest_TemplateDescription = null;
            if (cmdletContext.InAppTemplateRequest_TemplateDescription != null)
            {
                requestInAppTemplateRequest_inAppTemplateRequest_TemplateDescription = cmdletContext.InAppTemplateRequest_TemplateDescription;
            }
            if (requestInAppTemplateRequest_inAppTemplateRequest_TemplateDescription != null)
            {
                request.InAppTemplateRequest.TemplateDescription = requestInAppTemplateRequest_inAppTemplateRequest_TemplateDescription;
                requestInAppTemplateRequestIsNull = false;
            }
            // determine if request.InAppTemplateRequest should be set to null
            if (requestInAppTemplateRequestIsNull)
            {
                request.InAppTemplateRequest = null;
            }
            if (cmdletContext.TemplateName != null)
            {
                request.TemplateName = cmdletContext.TemplateName;
            }

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