private Amazon.SageMaker.Model.RenderUiTemplateResponse CallAWSServiceOperation(IAmazonSageMaker client, Amazon.SageMaker.Model.RenderUiTemplateRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon SageMaker Service", "RenderUiTemplate");
     try
     {
         #if DESKTOP
         return(client.RenderUiTemplate(request));
         #elif CORECLR
         return(client.RenderUiTemplateAsync(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.SageMaker.Model.RenderUiTemplateRequest();

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

            // populate Task
            var requestTaskIsNull = true;

            request.Task = new Amazon.SageMaker.Model.RenderableTask();
            System.String requestTask_task_Input = null;
            if (cmdletContext.Task_Input != null)
            {
                requestTask_task_Input = cmdletContext.Task_Input;
            }
            if (requestTask_task_Input != null)
            {
                request.Task.Input = requestTask_task_Input;
                requestTaskIsNull  = false;
            }
            // determine if request.Task should be set to null
            if (requestTaskIsNull)
            {
                request.Task = null;
            }

            // populate UiTemplate
            var requestUiTemplateIsNull = true;

            request.UiTemplate = new Amazon.SageMaker.Model.UiTemplate();
            System.String requestUiTemplate_uiTemplate_Content = null;
            if (cmdletContext.UiTemplate_Content != null)
            {
                requestUiTemplate_uiTemplate_Content = cmdletContext.UiTemplate_Content;
            }
            if (requestUiTemplate_uiTemplate_Content != null)
            {
                request.UiTemplate.Content = requestUiTemplate_uiTemplate_Content;
                requestUiTemplateIsNull    = false;
            }
            // determine if request.UiTemplate should be set to null
            if (requestUiTemplateIsNull)
            {
                request.UiTemplate = 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);
        }