def select_object_content(params = {}, options = {}, &block)
      params = params.dup
      event_stream_handler = case handler = params.delete(:event_stream_handler)
        when EventStreams::SelectObjectContentEventStream then handler
        when Proc then EventStreams::SelectObjectContentEventStream.new.tap(&handler)
        when nil then EventStreams::SelectObjectContentEventStream.new
        else
          msg = "expected :event_stream_handler to be a block or "\
            "instance of Aws::S3::EventStreams::SelectObjectContentEventStream"\
            ", got `#{handler.inspect}` instead"
          raise ArgumentError, msg
        end

      yield(event_stream_handler) if block_given?

      req = build_request(:select_object_content, params)

      req.context[:event_stream_handler] = event_stream_handler
      req.handlers.add(Aws::Binary::DecodeHandler, priority: 95)

      req.send_request(options, &block)
    end
def select_object_content(params = {}, options = {}, &block)
      params = params.dup
      event_stream_handler = case handler = params.delete(:event_stream_handler)
        when EventStreams::SelectObjectContentEventStream then handler
        when Proc then EventStreams::SelectObjectContentEventStream.new.tap(&handler)
        when nil then EventStreams::SelectObjectContentEventStream.new
        else
          msg = "expected :event_stream_handler to be a block or "\
            "instance of Aws::S3::EventStreams::SelectObjectContentEventStream"\
            ", got `#{handler.inspect}` instead"
          raise ArgumentError, msg
        end

      yield(event_stream_handler) if block_given?

      req = build_request(:select_object_content, params)

      req.context[:event_stream_handler] = event_stream_handler
      req.handlers.add(Aws::Binary::DecodeHandler, priority: 95)

      req.send_request(options, &block)
    end
This operation filters the contents of an Amazon S3 object based on a
 simple Structured Query Language (SQL) statement. In the request,
 along with the SQL expression, you must also specify a data
 serialization format (JSON or CSV) of the object. Amazon S3 uses this
 to parse object data into records, and returns only records that match
 the specified SQL expression. You must also specify the data
 serialization format for the response.

 @option params [required, String] :bucket
   The S3 bucket.

 @option params [required, String] :key
   The object key.

 @option params [String] :sse_customer_algorithm
   The SSE Algorithm used to encrypt the object. For more information,
   see [ Server-Side Encryption (Using Customer-Provided Encryption
   Keys][1].



   [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html

 @option params [String] :sse_customer_key
   The SSE Customer Key. For more information, see [ Server-Side
   Encryption (Using Customer-Provided Encryption Keys][1].



   [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html

 @option params [String] :sse_customer_key_md5
   The SSE Customer Key MD5. For more information, see [ Server-Side
   Encryption (Using Customer-Provided Encryption Keys][1].



   [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html

 @option params [required, String] :expression
   The expression that is used to query the object.

 @option params [required, String] :expression_type
   The type of the provided expression (for example., SQL).

 @option params [Types::RequestProgress] :request_progress
   Specifies if periodic request progress information should be enabled.

 @option params [required, Types::InputSerialization] :input_serialization
   Describes the format of the data in the object that is being queried.

 @option params [required, Types::OutputSerialization] :output_serialization
   Describes the format of the data that you want Amazon S3 to return in
   response.

 @return [Types::SelectObjectContentOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:

   * {Types::SelectObjectContentOutput#payload #payload} => Types::SelectObjectContentEventStream

 @example EventStream Operation Example

   You can process event once it arrives immediately, or wait until
   full response complete and iterate through eventstream enumerator.

   To interact with event immediately, you need to register #select_object_content
   with callbacks, callbacks can be register for specifc events or for all events,
   callback for errors in the event stream is also available for register.

   Callbacks can be passed in by `:event_stream_handler` option or within block
   statement attached to #select_object_content call directly. Hybrid pattern of both
   is also supported.

   `:event_stream_handler` option takes in either Proc object or
   Aws::S3::EventStreams::SelectObjectContentEventStream object.

   Usage pattern a): callbacks with a block attached to #select_object_content
     Example for registering callbacks for all event types and error event

     client.select_object_content( # params input# ) do |stream|
       stream.on_error_event do |event|
         # catch unmodeled error event in the stream
         raise event
         # => Aws::Errors::EventError
         # event.event_type => :error
         # event.error_code => String
         # event.error_message => String
       end

       stream.on_event do |event|
         # process all events arrive
         puts event.event_type
         ...
       end

     end

   Usage pattern b): pass in `:event_stream_handler` for #select_object_content

     1) create a Aws::S3::EventStreams::SelectObjectContentEventStream object
     Example for registering callbacks with specific events

       handler = Aws::S3::EventStreams::SelectObjectContentEventStream.new
       handler.on_records_event do |event|
         event # => Aws::S3::Types::Records
       end
       handler.on_stats_event do |event|
         event # => Aws::S3::Types::Stats
       end
       handler.on_progress_event do |event|
         event # => Aws::S3::Types::Progress
       end
       handler.on_cont_event do |event|
         event # => Aws::S3::Types::Cont
       end
       handler.on_end_event do |event|
         event # => Aws::S3::Types::End
       end

     client.select_object_content( # params input #, event_stream_handler: handler)

     2) use a Ruby Proc object
     Example for registering callbacks with specific events

     handler = Proc.new do |stream|
       stream.on_records_event do |event|
         event # => Aws::S3::Types::Records
       end
       stream.on_stats_event do |event|
         event # => Aws::S3::Types::Stats
       end
       stream.on_progress_event do |event|
         event # => Aws::S3::Types::Progress
       end
       stream.on_cont_event do |event|
         event # => Aws::S3::Types::Cont
       end
       stream.on_end_event do |event|
         event # => Aws::S3::Types::End
       end
     end

     client.select_object_content( # params input #, event_stream_handler: handler)

   Usage pattern c): hybird pattern of a) and b)

       handler = Aws::S3::EventStreams::SelectObjectContentEventStream.new
       handler.on_records_event do |event|
         event # => Aws::S3::Types::Records
       end
       handler.on_stats_event do |event|
         event # => Aws::S3::Types::Stats
       end
       handler.on_progress_event do |event|
         event # => Aws::S3::Types::Progress
       end
       handler.on_cont_event do |event|
         event # => Aws::S3::Types::Cont
       end
       handler.on_end_event do |event|
         event # => Aws::S3::Types::End
       end

     client.select_object_content( # params input #, event_stream_handler: handler) do |stream|
       stream.on_error_event do |event|
         # catch unmodeled error event in the stream
         raise event
         # => Aws::Errors::EventError
         # event.event_type => :error
         # event.error_code => String
         # event.error_message => String
       end
     end

   Besides above usage patterns for process events when they arrive immediately, you can also
   iterate through events after response complete.

   Events are available at resp.payload # => Enumerator
   For parameter input example, please refer to following request syntax

 @example Request syntax with placeholder values

   resp = client.select_object_content({
     bucket: "BucketName", # required
     key: "ObjectKey", # required
     sse_customer_algorithm: "SSECustomerAlgorithm",
     sse_customer_key: "SSECustomerKey",
     sse_customer_key_md5: "SSECustomerKeyMD5",
     expression: "Expression", # required
     expression_type: "SQL", # required, accepts SQL
     request_progress: {
       enabled: false,
     },
     input_serialization: { # required
       csv: {
         file_header_info: "USE", # accepts USE, IGNORE, NONE
         comments: "Comments",
         quote_escape_character: "QuoteEscapeCharacter",
         record_delimiter: "RecordDelimiter",
         field_delimiter: "FieldDelimiter",
         quote_character: "QuoteCharacter",
         allow_quoted_record_delimiter: false,
       },
       compression_type: "NONE", # accepts NONE, GZIP, BZIP2
       json: {
         type: "DOCUMENT", # accepts DOCUMENT, LINES
       },
       parquet: {
       },
     },
     output_serialization: { # required
       csv: {
         quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED
         quote_escape_character: "QuoteEscapeCharacter",
         record_delimiter: "RecordDelimiter",
         field_delimiter: "FieldDelimiter",
         quote_character: "QuoteCharacter",
       },
       json: {
         record_delimiter: "RecordDelimiter",
       },
     },
   })

 @example Response structure

   All events are available at resp.payload:
   resp.payload #=> Enumerator
   resp.payload.event_types #=> [:records, :stats, :progress, :cont, :end]

   For :records event available at #on_records_event callback and response eventstream enumerator:
   event.payload #=> IO

   For :stats event available at #on_stats_event callback and response eventstream enumerator:
   event.details.bytes_scanned #=> Integer
   event.details.bytes_processed #=> Integer
   event.details.bytes_returned #=> Integer

   For :progress event available at #on_progress_event callback and response eventstream enumerator:
   event.details.bytes_scanned #=> Integer
   event.details.bytes_processed #=> Integer
   event.details.bytes_returned #=> Integer

   For :cont event available at #on_cont_event callback and response eventstream enumerator:
    #=> EmptyStruct
   For :end event available at #on_end_event callback and response eventstream enumerator:
    #=> EmptyStruct

 @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SelectObjectContent AWS API Documentation

 @overload select_object_content(params = {})
 @param [Hash] params ({})