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

            if (cmdletContext.DisplayName != null)
            {
                request.DisplayName = cmdletContext.DisplayName;
            }
            if (cmdletContext.EndTime != null)
            {
                request.EndTime = cmdletContext.EndTime.Value;
            }
            if (cmdletContext.InputArtifact != null)
            {
                request.InputArtifacts = cmdletContext.InputArtifact;
            }
            if (cmdletContext.OutputArtifact != null)
            {
                request.OutputArtifacts = cmdletContext.OutputArtifact;
            }
            if (cmdletContext.Parameter != null)
            {
                request.Parameters = cmdletContext.Parameter;
            }
            if (cmdletContext.StartTime != null)
            {
                request.StartTime = cmdletContext.StartTime.Value;
            }

            // populate Status
            var requestStatusIsNull = true;

            request.Status = new Amazon.SageMaker.Model.TrialComponentStatus();
            System.String requestStatus_status_Message = null;
            if (cmdletContext.Status_Message != null)
            {
                requestStatus_status_Message = cmdletContext.Status_Message;
            }
            if (requestStatus_status_Message != null)
            {
                request.Status.Message = requestStatus_status_Message;
                requestStatusIsNull    = false;
            }
            Amazon.SageMaker.TrialComponentPrimaryStatus requestStatus_status_PrimaryStatus = null;
            if (cmdletContext.Status_PrimaryStatus != null)
            {
                requestStatus_status_PrimaryStatus = cmdletContext.Status_PrimaryStatus;
            }
            if (requestStatus_status_PrimaryStatus != null)
            {
                request.Status.PrimaryStatus = requestStatus_status_PrimaryStatus;
                requestStatusIsNull          = false;
            }
            // determine if request.Status should be set to null
            if (requestStatusIsNull)
            {
                request.Status = null;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }
            if (cmdletContext.TrialComponentName != null)
            {
                request.TrialComponentName = cmdletContext.TrialComponentName;
            }

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