private Amazon.ComprehendMedical.Model.StartPHIDetectionJobResponse CallAWSServiceOperation(IAmazonComprehendMedical client, Amazon.ComprehendMedical.Model.StartPHIDetectionJobRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Comprehend Medical", "StartPHIDetectionJob");
     try
     {
         #if DESKTOP
         return(client.StartPHIDetectionJob(request));
         #elif CORECLR
         return(client.StartPHIDetectionJobAsync(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.ComprehendMedical.Model.StartPHIDetectionJobRequest();

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

            // populate InputDataConfig
            var requestInputDataConfigIsNull = true;

            request.InputDataConfig = new Amazon.ComprehendMedical.Model.InputDataConfig();
            System.String requestInputDataConfig_inputDataConfig_S3Bucket = null;
            if (cmdletContext.InputDataConfig_S3Bucket != null)
            {
                requestInputDataConfig_inputDataConfig_S3Bucket = cmdletContext.InputDataConfig_S3Bucket;
            }
            if (requestInputDataConfig_inputDataConfig_S3Bucket != null)
            {
                request.InputDataConfig.S3Bucket = requestInputDataConfig_inputDataConfig_S3Bucket;
                requestInputDataConfigIsNull     = false;
            }
            System.String requestInputDataConfig_inputDataConfig_S3Key = null;
            if (cmdletContext.InputDataConfig_S3Key != null)
            {
                requestInputDataConfig_inputDataConfig_S3Key = cmdletContext.InputDataConfig_S3Key;
            }
            if (requestInputDataConfig_inputDataConfig_S3Key != null)
            {
                request.InputDataConfig.S3Key = requestInputDataConfig_inputDataConfig_S3Key;
                requestInputDataConfigIsNull  = false;
            }
            // determine if request.InputDataConfig should be set to null
            if (requestInputDataConfigIsNull)
            {
                request.InputDataConfig = null;
            }
            if (cmdletContext.JobName != null)
            {
                request.JobName = cmdletContext.JobName;
            }
            if (cmdletContext.KMSKey != null)
            {
                request.KMSKey = cmdletContext.KMSKey;
            }
            if (cmdletContext.LanguageCode != null)
            {
                request.LanguageCode = cmdletContext.LanguageCode;
            }

            // populate OutputDataConfig
            var requestOutputDataConfigIsNull = true;

            request.OutputDataConfig = new Amazon.ComprehendMedical.Model.OutputDataConfig();
            System.String requestOutputDataConfig_outputDataConfig_S3Bucket = null;
            if (cmdletContext.OutputDataConfig_S3Bucket != null)
            {
                requestOutputDataConfig_outputDataConfig_S3Bucket = cmdletContext.OutputDataConfig_S3Bucket;
            }
            if (requestOutputDataConfig_outputDataConfig_S3Bucket != null)
            {
                request.OutputDataConfig.S3Bucket = requestOutputDataConfig_outputDataConfig_S3Bucket;
                requestOutputDataConfigIsNull     = false;
            }
            System.String requestOutputDataConfig_outputDataConfig_S3Key = null;
            if (cmdletContext.OutputDataConfig_S3Key != null)
            {
                requestOutputDataConfig_outputDataConfig_S3Key = cmdletContext.OutputDataConfig_S3Key;
            }
            if (requestOutputDataConfig_outputDataConfig_S3Key != null)
            {
                request.OutputDataConfig.S3Key = requestOutputDataConfig_outputDataConfig_S3Key;
                requestOutputDataConfigIsNull  = false;
            }
            // determine if request.OutputDataConfig should be set to null
            if (requestOutputDataConfigIsNull)
            {
                request.OutputDataConfig = 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);
        }