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);
        }
        public object Execute(ExecutorContext context)
        {
            System.IO.MemoryStream _ImageContentStream = null;

            try
            {
                var cmdletContext = context as CmdletContext;
                // create request
                var request = new Amazon.Rekognition.Model.DetectTextRequest();


                // populate Filters
                var requestFiltersIsNull = true;
                request.Filters = new Amazon.Rekognition.Model.DetectTextFilters();
                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;
                }

                // populate Image
                var requestImageIsNull = true;
                request.Image = new Amazon.Rekognition.Model.Image();
                System.IO.MemoryStream requestImage_imageContent = null;
                if (cmdletContext.ImageContent != null)
                {
                    _ImageContentStream       = new System.IO.MemoryStream(cmdletContext.ImageContent);
                    requestImage_imageContent = _ImageContentStream;
                }
                if (requestImage_imageContent != null)
                {
                    request.Image.Bytes = requestImage_imageContent;
                    requestImageIsNull  = false;
                }
                Amazon.Rekognition.Model.S3Object requestImage_image_S3Object = null;

                // populate S3Object
                var requestImage_image_S3ObjectIsNull = true;
                requestImage_image_S3Object = new Amazon.Rekognition.Model.S3Object();
                System.String requestImage_image_S3Object_imageBucket = null;
                if (cmdletContext.ImageBucket != null)
                {
                    requestImage_image_S3Object_imageBucket = cmdletContext.ImageBucket;
                }
                if (requestImage_image_S3Object_imageBucket != null)
                {
                    requestImage_image_S3Object.Bucket = requestImage_image_S3Object_imageBucket;
                    requestImage_image_S3ObjectIsNull  = false;
                }
                System.String requestImage_image_S3Object_imageName = null;
                if (cmdletContext.ImageName != null)
                {
                    requestImage_image_S3Object_imageName = cmdletContext.ImageName;
                }
                if (requestImage_image_S3Object_imageName != null)
                {
                    requestImage_image_S3Object.Name  = requestImage_image_S3Object_imageName;
                    requestImage_image_S3ObjectIsNull = false;
                }
                System.String requestImage_image_S3Object_imageVersion = null;
                if (cmdletContext.ImageVersion != null)
                {
                    requestImage_image_S3Object_imageVersion = cmdletContext.ImageVersion;
                }
                if (requestImage_image_S3Object_imageVersion != null)
                {
                    requestImage_image_S3Object.Version = requestImage_image_S3Object_imageVersion;
                    requestImage_image_S3ObjectIsNull   = false;
                }
                // determine if requestImage_image_S3Object should be set to null
                if (requestImage_image_S3ObjectIsNull)
                {
                    requestImage_image_S3Object = null;
                }
                if (requestImage_image_S3Object != null)
                {
                    request.Image.S3Object = requestImage_image_S3Object;
                    requestImageIsNull     = false;
                }
                // determine if request.Image should be set to null
                if (requestImageIsNull)
                {
                    request.Image = 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);
            }
            finally
            {
                if (_ImageContentStream != null)
                {
                    _ImageContentStream.Dispose();
                }
            }
        }