private Amazon.Rekognition.Model.StartTextDetectionResponse CallAWSServiceOperation(IAmazonRekognition client, Amazon.Rekognition.Model.StartTextDetectionRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Rekognition", "StartTextDetection");
     try
     {
         #if DESKTOP
         return(client.StartTextDetection(request));
         #elif CORECLR
         return(client.StartTextDetectionAsync(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.Rekognition.Model.StartTextDetectionRequest();

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

            // populate Filters
            var requestFiltersIsNull = true;

            request.Filters = new Amazon.Rekognition.Model.StartTextDetectionFilters();
            List <Amazon.Rekognition.Model.RegionOfInterest> requestFilters_filters_RegionsOfInterest = null;

            if (cmdletContext.Filters_RegionsOfInterest != null)
            {
                requestFilters_filters_RegionsOfInterest = cmdletContext.Filters_RegionsOfInterest;
            }
            if (requestFilters_filters_RegionsOfInterest != null)
            {
                request.Filters.RegionsOfInterest = requestFilters_filters_RegionsOfInterest;
                requestFiltersIsNull = false;
            }
            Amazon.Rekognition.Model.DetectionFilter requestFilters_filters_WordFilter = null;

            // populate WordFilter
            var requestFilters_filters_WordFilterIsNull = true;

            requestFilters_filters_WordFilter = new Amazon.Rekognition.Model.DetectionFilter();
            System.Single?requestFilters_filters_WordFilter_wordFilter_MinBoundingBoxHeight = null;
            if (cmdletContext.WordFilter_MinBoundingBoxHeight != null)
            {
                requestFilters_filters_WordFilter_wordFilter_MinBoundingBoxHeight = cmdletContext.WordFilter_MinBoundingBoxHeight.Value;
            }
            if (requestFilters_filters_WordFilter_wordFilter_MinBoundingBoxHeight != null)
            {
                requestFilters_filters_WordFilter.MinBoundingBoxHeight = requestFilters_filters_WordFilter_wordFilter_MinBoundingBoxHeight.Value;
                requestFilters_filters_WordFilterIsNull = false;
            }
            System.Single?requestFilters_filters_WordFilter_wordFilter_MinBoundingBoxWidth = null;
            if (cmdletContext.WordFilter_MinBoundingBoxWidth != null)
            {
                requestFilters_filters_WordFilter_wordFilter_MinBoundingBoxWidth = cmdletContext.WordFilter_MinBoundingBoxWidth.Value;
            }
            if (requestFilters_filters_WordFilter_wordFilter_MinBoundingBoxWidth != null)
            {
                requestFilters_filters_WordFilter.MinBoundingBoxWidth = requestFilters_filters_WordFilter_wordFilter_MinBoundingBoxWidth.Value;
                requestFilters_filters_WordFilterIsNull = false;
            }
            System.Single?requestFilters_filters_WordFilter_wordFilter_MinConfidence = null;
            if (cmdletContext.WordFilter_MinConfidence != null)
            {
                requestFilters_filters_WordFilter_wordFilter_MinConfidence = cmdletContext.WordFilter_MinConfidence.Value;
            }
            if (requestFilters_filters_WordFilter_wordFilter_MinConfidence != null)
            {
                requestFilters_filters_WordFilter.MinConfidence = requestFilters_filters_WordFilter_wordFilter_MinConfidence.Value;
                requestFilters_filters_WordFilterIsNull         = false;
            }
            // determine if requestFilters_filters_WordFilter should be set to null
            if (requestFilters_filters_WordFilterIsNull)
            {
                requestFilters_filters_WordFilter = null;
            }
            if (requestFilters_filters_WordFilter != null)
            {
                request.Filters.WordFilter = requestFilters_filters_WordFilter;
                requestFiltersIsNull       = false;
            }
            // determine if request.Filters should be set to null
            if (requestFiltersIsNull)
            {
                request.Filters = null;
            }
            if (cmdletContext.JobTag != null)
            {
                request.JobTag = cmdletContext.JobTag;
            }

            // populate NotificationChannel
            var requestNotificationChannelIsNull = true;

            request.NotificationChannel = new Amazon.Rekognition.Model.NotificationChannel();
            System.String requestNotificationChannel_notificationChannel_RoleArn = null;
            if (cmdletContext.NotificationChannel_RoleArn != null)
            {
                requestNotificationChannel_notificationChannel_RoleArn = cmdletContext.NotificationChannel_RoleArn;
            }
            if (requestNotificationChannel_notificationChannel_RoleArn != null)
            {
                request.NotificationChannel.RoleArn = requestNotificationChannel_notificationChannel_RoleArn;
                requestNotificationChannelIsNull    = false;
            }
            System.String requestNotificationChannel_notificationChannel_SNSTopicArn = null;
            if (cmdletContext.NotificationChannel_SNSTopicArn != null)
            {
                requestNotificationChannel_notificationChannel_SNSTopicArn = cmdletContext.NotificationChannel_SNSTopicArn;
            }
            if (requestNotificationChannel_notificationChannel_SNSTopicArn != null)
            {
                request.NotificationChannel.SNSTopicArn = requestNotificationChannel_notificationChannel_SNSTopicArn;
                requestNotificationChannelIsNull        = false;
            }
            // determine if request.NotificationChannel should be set to null
            if (requestNotificationChannelIsNull)
            {
                request.NotificationChannel = null;
            }
            if (cmdletContext.Video != null)
            {
                request.Video = cmdletContext.Video;
            }

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