{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.S3.SelectObjectContent
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- This action 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, CSV, or Apache Parquet) of the object. Amazon S3 uses this
-- format 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.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- For more information about Amazon S3 Select, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/selecting-content-from-objects.html Selecting Content from Objects>
-- in the /Amazon S3 User Guide/.
--
-- For more information about using SQL with Amazon S3 Select, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html SQL Reference for Amazon S3 Select and S3 Glacier Select>
-- in the /Amazon S3 User Guide/.
--
-- __Permissions__
--
-- You must have @s3:GetObject@ permission for this operation. Amazon S3
-- Select does not support anonymous access. For more information about
-- permissions, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html Specifying Permissions in a Policy>
-- in the /Amazon S3 User Guide/.
--
-- /Object Data Formats/
--
-- You can use Amazon S3 Select to query objects that have the following
-- format properties:
--
-- -   /CSV, JSON, and Parquet/ - Objects must be in CSV, JSON, or Parquet
--     format.
--
-- -   /UTF-8/ - UTF-8 is the only encoding type Amazon S3 Select supports.
--
-- -   /GZIP or BZIP2/ - CSV and JSON files can be compressed using GZIP or
--     BZIP2. GZIP and BZIP2 are the only compression formats that Amazon
--     S3 Select supports for CSV and JSON files. Amazon S3 Select supports
--     columnar compression for Parquet using GZIP or Snappy. Amazon S3
--     Select does not support whole-object compression for Parquet
--     objects.
--
-- -   /Server-side encryption/ - Amazon S3 Select supports querying
--     objects that are protected with server-side encryption.
--
--     For objects that are encrypted with customer-provided encryption
--     keys (SSE-C), you must use HTTPS, and you must use the headers that
--     are documented in the
--     <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html GetObject>.
--     For more information about SSE-C, see
--     <https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html Server-Side Encryption (Using Customer-Provided Encryption Keys)>
--     in the /Amazon S3 User Guide/.
--
--     For objects that are encrypted with Amazon S3 managed encryption
--     keys (SSE-S3) and Amazon Web Services KMS keys (SSE-KMS),
--     server-side encryption is handled transparently, so you don\'t need
--     to specify anything. For more information about server-side
--     encryption, including SSE-S3 and SSE-KMS, see
--     <https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html Protecting Data Using Server-Side Encryption>
--     in the /Amazon S3 User Guide/.
--
-- __Working with the Response Body__
--
-- Given the response size is unknown, Amazon S3 Select streams the
-- response as a series of messages and includes a @Transfer-Encoding@
-- header with @chunked@ as its value in the response. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/RESTSelectObjectAppendix.html Appendix: SelectObjectContent Response>.
--
-- __GetObject Support__
--
-- The @SelectObjectContent@ action does not support the following
-- @GetObject@ functionality. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html GetObject>.
--
-- -   @Range@: Although you can specify a scan range for an Amazon S3
--     Select request (see
--     <https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html#AmazonS3-SelectObjectContent-request-ScanRange SelectObjectContentRequest - ScanRange>
--     in the request parameters), you cannot specify the range of bytes of
--     an object to return.
--
-- -   GLACIER, DEEP_ARCHIVE and REDUCED_REDUNDANCY storage classes: You
--     cannot specify the GLACIER, DEEP_ARCHIVE, or @REDUCED_REDUNDANCY@
--     storage classes. For more information, about storage classes see
--     <https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#storage-class-intro Storage Classes>
--     in the /Amazon S3 User Guide/.
--
-- __Special Errors__
--
-- For a list of special errors for this operation, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#SelectObjectContentErrorCodeList List of SELECT Object Content Error Codes>
--
-- __Related Resources__
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html GetObject>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html GetBucketLifecycleConfiguration>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html PutBucketLifecycleConfiguration>
module Amazonka.S3.SelectObjectContent
  ( -- * Creating a Request
    SelectObjectContent (..),
    newSelectObjectContent,

    -- * Request Lenses
    selectObjectContent_sSECustomerAlgorithm,
    selectObjectContent_sSECustomerKey,
    selectObjectContent_requestProgress,
    selectObjectContent_sSECustomerKeyMD5,
    selectObjectContent_scanRange,
    selectObjectContent_expectedBucketOwner,
    selectObjectContent_bucket,
    selectObjectContent_key,
    selectObjectContent_expression,
    selectObjectContent_expressionType,
    selectObjectContent_inputSerialization,
    selectObjectContent_outputSerialization,

    -- * Destructuring the Response
    SelectObjectContentResponse (..),
    newSelectObjectContentResponse,

    -- * Response Lenses
    selectObjectContentResponse_payload,
    selectObjectContentResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.S3.Types

-- | Request to filter 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 specify a data serialization format (JSON
-- or CSV) of the object. Amazon S3 uses this to parse object data into
-- records. It returns only records that match the specified SQL
-- expression. You must also specify the data serialization format for the
-- response. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectSELECTContent.html S3Select API Documentation>.
--
-- /See:/ 'newSelectObjectContent' smart constructor.
data SelectObjectContent = SelectObjectContent'
  { -- | The SSE Algorithm used to encrypt the object. For more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html Server-Side Encryption (Using Customer-Provided Encryption Keys>.
    SelectObjectContent -> Maybe Text
sSECustomerAlgorithm :: Prelude.Maybe Prelude.Text,
    -- | The SSE Customer Key. For more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html Server-Side Encryption (Using Customer-Provided Encryption Keys>.
    SelectObjectContent -> Maybe (Sensitive Text)
sSECustomerKey :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Specifies if periodic request progress information should be enabled.
    SelectObjectContent -> Maybe RequestProgress
requestProgress :: Prelude.Maybe RequestProgress,
    -- | The SSE Customer Key MD5. For more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html Server-Side Encryption (Using Customer-Provided Encryption Keys>.
    SelectObjectContent -> Maybe Text
sSECustomerKeyMD5 :: Prelude.Maybe Prelude.Text,
    -- | Specifies the byte range of the object to get the records from. A record
    -- is processed when its first byte is contained by the range. This
    -- parameter is optional, but when specified, it must not be empty. See RFC
    -- 2616, Section 14.35.1 about how to specify the start and end of the
    -- range.
    --
    -- @ScanRange@may be used in the following ways:
    --
    -- -   @\<scanrange>\<start>50\<\/start>\<end>100\<\/end>\<\/scanrange>@ -
    --     process only the records starting between the bytes 50 and 100
    --     (inclusive, counting from zero)
    --
    -- -   @\<scanrange>\<start>50\<\/start>\<\/scanrange>@ - process only the
    --     records starting after the byte 50
    --
    -- -   @\<scanrange>\<end>50\<\/end>\<\/scanrange>@ - process only the
    --     records within the last 50 bytes of the file.
    SelectObjectContent -> Maybe ScanRange
scanRange :: Prelude.Maybe ScanRange,
    -- | The account ID of the expected bucket owner. If the bucket is owned by a
    -- different account, the request will fail with an HTTP
    -- @403 (Access Denied)@ error.
    SelectObjectContent -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The S3 bucket.
    SelectObjectContent -> BucketName
bucket :: BucketName,
    -- | The object key.
    SelectObjectContent -> ObjectKey
key :: ObjectKey,
    -- | The expression that is used to query the object.
    SelectObjectContent -> Text
expression :: Prelude.Text,
    -- | The type of the provided expression (for example, SQL).
    SelectObjectContent -> ExpressionType
expressionType :: ExpressionType,
    -- | Describes the format of the data in the object that is being queried.
    SelectObjectContent -> InputSerialization
inputSerialization :: InputSerialization,
    -- | Describes the format of the data that you want Amazon S3 to return in
    -- response.
    SelectObjectContent -> OutputSerialization
outputSerialization :: OutputSerialization
  }
  deriving (SelectObjectContent -> SelectObjectContent -> Bool
(SelectObjectContent -> SelectObjectContent -> Bool)
-> (SelectObjectContent -> SelectObjectContent -> Bool)
-> Eq SelectObjectContent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SelectObjectContent -> SelectObjectContent -> Bool
$c/= :: SelectObjectContent -> SelectObjectContent -> Bool
== :: SelectObjectContent -> SelectObjectContent -> Bool
$c== :: SelectObjectContent -> SelectObjectContent -> Bool
Prelude.Eq, Int -> SelectObjectContent -> ShowS
[SelectObjectContent] -> ShowS
SelectObjectContent -> String
(Int -> SelectObjectContent -> ShowS)
-> (SelectObjectContent -> String)
-> ([SelectObjectContent] -> ShowS)
-> Show SelectObjectContent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SelectObjectContent] -> ShowS
$cshowList :: [SelectObjectContent] -> ShowS
show :: SelectObjectContent -> String
$cshow :: SelectObjectContent -> String
showsPrec :: Int -> SelectObjectContent -> ShowS
$cshowsPrec :: Int -> SelectObjectContent -> ShowS
Prelude.Show, (forall x. SelectObjectContent -> Rep SelectObjectContent x)
-> (forall x. Rep SelectObjectContent x -> SelectObjectContent)
-> Generic SelectObjectContent
forall x. Rep SelectObjectContent x -> SelectObjectContent
forall x. SelectObjectContent -> Rep SelectObjectContent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SelectObjectContent x -> SelectObjectContent
$cfrom :: forall x. SelectObjectContent -> Rep SelectObjectContent x
Prelude.Generic)

-- |
-- Create a value of 'SelectObjectContent' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'sSECustomerAlgorithm', 'selectObjectContent_sSECustomerAlgorithm' - The SSE Algorithm used to encrypt the object. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html Server-Side Encryption (Using Customer-Provided Encryption Keys>.
--
-- 'sSECustomerKey', 'selectObjectContent_sSECustomerKey' - The SSE Customer Key. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html Server-Side Encryption (Using Customer-Provided Encryption Keys>.
--
-- 'requestProgress', 'selectObjectContent_requestProgress' - Specifies if periodic request progress information should be enabled.
--
-- 'sSECustomerKeyMD5', 'selectObjectContent_sSECustomerKeyMD5' - The SSE Customer Key MD5. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html Server-Side Encryption (Using Customer-Provided Encryption Keys>.
--
-- 'scanRange', 'selectObjectContent_scanRange' - Specifies the byte range of the object to get the records from. A record
-- is processed when its first byte is contained by the range. This
-- parameter is optional, but when specified, it must not be empty. See RFC
-- 2616, Section 14.35.1 about how to specify the start and end of the
-- range.
--
-- @ScanRange@may be used in the following ways:
--
-- -   @\<scanrange>\<start>50\<\/start>\<end>100\<\/end>\<\/scanrange>@ -
--     process only the records starting between the bytes 50 and 100
--     (inclusive, counting from zero)
--
-- -   @\<scanrange>\<start>50\<\/start>\<\/scanrange>@ - process only the
--     records starting after the byte 50
--
-- -   @\<scanrange>\<end>50\<\/end>\<\/scanrange>@ - process only the
--     records within the last 50 bytes of the file.
--
-- 'expectedBucketOwner', 'selectObjectContent_expectedBucketOwner' - The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
--
-- 'bucket', 'selectObjectContent_bucket' - The S3 bucket.
--
-- 'key', 'selectObjectContent_key' - The object key.
--
-- 'expression', 'selectObjectContent_expression' - The expression that is used to query the object.
--
-- 'expressionType', 'selectObjectContent_expressionType' - The type of the provided expression (for example, SQL).
--
-- 'inputSerialization', 'selectObjectContent_inputSerialization' - Describes the format of the data in the object that is being queried.
--
-- 'outputSerialization', 'selectObjectContent_outputSerialization' - Describes the format of the data that you want Amazon S3 to return in
-- response.
newSelectObjectContent ::
  -- | 'bucket'
  BucketName ->
  -- | 'key'
  ObjectKey ->
  -- | 'expression'
  Prelude.Text ->
  -- | 'expressionType'
  ExpressionType ->
  -- | 'inputSerialization'
  InputSerialization ->
  -- | 'outputSerialization'
  OutputSerialization ->
  SelectObjectContent
newSelectObjectContent :: BucketName
-> ObjectKey
-> Text
-> ExpressionType
-> InputSerialization
-> OutputSerialization
-> SelectObjectContent
newSelectObjectContent
  BucketName
pBucket_
  ObjectKey
pKey_
  Text
pExpression_
  ExpressionType
pExpressionType_
  InputSerialization
pInputSerialization_
  OutputSerialization
pOutputSerialization_ =
    SelectObjectContent' :: Maybe Text
-> Maybe (Sensitive Text)
-> Maybe RequestProgress
-> Maybe Text
-> Maybe ScanRange
-> Maybe Text
-> BucketName
-> ObjectKey
-> Text
-> ExpressionType
-> InputSerialization
-> OutputSerialization
-> SelectObjectContent
SelectObjectContent'
      { $sel:sSECustomerAlgorithm:SelectObjectContent' :: Maybe Text
sSECustomerAlgorithm =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:sSECustomerKey:SelectObjectContent' :: Maybe (Sensitive Text)
sSECustomerKey = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:requestProgress:SelectObjectContent' :: Maybe RequestProgress
requestProgress = Maybe RequestProgress
forall a. Maybe a
Prelude.Nothing,
        $sel:sSECustomerKeyMD5:SelectObjectContent' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:scanRange:SelectObjectContent' :: Maybe ScanRange
scanRange = Maybe ScanRange
forall a. Maybe a
Prelude.Nothing,
        $sel:expectedBucketOwner:SelectObjectContent' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:bucket:SelectObjectContent' :: BucketName
bucket = BucketName
pBucket_,
        $sel:key:SelectObjectContent' :: ObjectKey
key = ObjectKey
pKey_,
        $sel:expression:SelectObjectContent' :: Text
expression = Text
pExpression_,
        $sel:expressionType:SelectObjectContent' :: ExpressionType
expressionType = ExpressionType
pExpressionType_,
        $sel:inputSerialization:SelectObjectContent' :: InputSerialization
inputSerialization = InputSerialization
pInputSerialization_,
        $sel:outputSerialization:SelectObjectContent' :: OutputSerialization
outputSerialization = OutputSerialization
pOutputSerialization_
      }

-- | The SSE Algorithm used to encrypt the object. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html Server-Side Encryption (Using Customer-Provided Encryption Keys>.
selectObjectContent_sSECustomerAlgorithm :: Lens.Lens' SelectObjectContent (Prelude.Maybe Prelude.Text)
selectObjectContent_sSECustomerAlgorithm :: (Maybe Text -> f (Maybe Text))
-> SelectObjectContent -> f SelectObjectContent
selectObjectContent_sSECustomerAlgorithm = (SelectObjectContent -> Maybe Text)
-> (SelectObjectContent -> Maybe Text -> SelectObjectContent)
-> Lens
     SelectObjectContent SelectObjectContent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContent' {Maybe Text
sSECustomerAlgorithm :: Maybe Text
$sel:sSECustomerAlgorithm:SelectObjectContent' :: SelectObjectContent -> Maybe Text
sSECustomerAlgorithm} -> Maybe Text
sSECustomerAlgorithm) (\s :: SelectObjectContent
s@SelectObjectContent' {} Maybe Text
a -> SelectObjectContent
s {$sel:sSECustomerAlgorithm:SelectObjectContent' :: Maybe Text
sSECustomerAlgorithm = Maybe Text
a} :: SelectObjectContent)

-- | The SSE Customer Key. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html Server-Side Encryption (Using Customer-Provided Encryption Keys>.
selectObjectContent_sSECustomerKey :: Lens.Lens' SelectObjectContent (Prelude.Maybe Prelude.Text)
selectObjectContent_sSECustomerKey :: (Maybe Text -> f (Maybe Text))
-> SelectObjectContent -> f SelectObjectContent
selectObjectContent_sSECustomerKey = (SelectObjectContent -> Maybe (Sensitive Text))
-> (SelectObjectContent
    -> Maybe (Sensitive Text) -> SelectObjectContent)
-> Lens
     SelectObjectContent
     SelectObjectContent
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContent' {Maybe (Sensitive Text)
sSECustomerKey :: Maybe (Sensitive Text)
$sel:sSECustomerKey:SelectObjectContent' :: SelectObjectContent -> Maybe (Sensitive Text)
sSECustomerKey} -> Maybe (Sensitive Text)
sSECustomerKey) (\s :: SelectObjectContent
s@SelectObjectContent' {} Maybe (Sensitive Text)
a -> SelectObjectContent
s {$sel:sSECustomerKey:SelectObjectContent' :: Maybe (Sensitive Text)
sSECustomerKey = Maybe (Sensitive Text)
a} :: SelectObjectContent) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> SelectObjectContent -> f SelectObjectContent)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> SelectObjectContent
-> f SelectObjectContent
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Specifies if periodic request progress information should be enabled.
selectObjectContent_requestProgress :: Lens.Lens' SelectObjectContent (Prelude.Maybe RequestProgress)
selectObjectContent_requestProgress :: (Maybe RequestProgress -> f (Maybe RequestProgress))
-> SelectObjectContent -> f SelectObjectContent
selectObjectContent_requestProgress = (SelectObjectContent -> Maybe RequestProgress)
-> (SelectObjectContent
    -> Maybe RequestProgress -> SelectObjectContent)
-> Lens
     SelectObjectContent
     SelectObjectContent
     (Maybe RequestProgress)
     (Maybe RequestProgress)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContent' {Maybe RequestProgress
requestProgress :: Maybe RequestProgress
$sel:requestProgress:SelectObjectContent' :: SelectObjectContent -> Maybe RequestProgress
requestProgress} -> Maybe RequestProgress
requestProgress) (\s :: SelectObjectContent
s@SelectObjectContent' {} Maybe RequestProgress
a -> SelectObjectContent
s {$sel:requestProgress:SelectObjectContent' :: Maybe RequestProgress
requestProgress = Maybe RequestProgress
a} :: SelectObjectContent)

-- | The SSE Customer Key MD5. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html Server-Side Encryption (Using Customer-Provided Encryption Keys>.
selectObjectContent_sSECustomerKeyMD5 :: Lens.Lens' SelectObjectContent (Prelude.Maybe Prelude.Text)
selectObjectContent_sSECustomerKeyMD5 :: (Maybe Text -> f (Maybe Text))
-> SelectObjectContent -> f SelectObjectContent
selectObjectContent_sSECustomerKeyMD5 = (SelectObjectContent -> Maybe Text)
-> (SelectObjectContent -> Maybe Text -> SelectObjectContent)
-> Lens
     SelectObjectContent SelectObjectContent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContent' {Maybe Text
sSECustomerKeyMD5 :: Maybe Text
$sel:sSECustomerKeyMD5:SelectObjectContent' :: SelectObjectContent -> Maybe Text
sSECustomerKeyMD5} -> Maybe Text
sSECustomerKeyMD5) (\s :: SelectObjectContent
s@SelectObjectContent' {} Maybe Text
a -> SelectObjectContent
s {$sel:sSECustomerKeyMD5:SelectObjectContent' :: Maybe Text
sSECustomerKeyMD5 = Maybe Text
a} :: SelectObjectContent)

-- | Specifies the byte range of the object to get the records from. A record
-- is processed when its first byte is contained by the range. This
-- parameter is optional, but when specified, it must not be empty. See RFC
-- 2616, Section 14.35.1 about how to specify the start and end of the
-- range.
--
-- @ScanRange@may be used in the following ways:
--
-- -   @\<scanrange>\<start>50\<\/start>\<end>100\<\/end>\<\/scanrange>@ -
--     process only the records starting between the bytes 50 and 100
--     (inclusive, counting from zero)
--
-- -   @\<scanrange>\<start>50\<\/start>\<\/scanrange>@ - process only the
--     records starting after the byte 50
--
-- -   @\<scanrange>\<end>50\<\/end>\<\/scanrange>@ - process only the
--     records within the last 50 bytes of the file.
selectObjectContent_scanRange :: Lens.Lens' SelectObjectContent (Prelude.Maybe ScanRange)
selectObjectContent_scanRange :: (Maybe ScanRange -> f (Maybe ScanRange))
-> SelectObjectContent -> f SelectObjectContent
selectObjectContent_scanRange = (SelectObjectContent -> Maybe ScanRange)
-> (SelectObjectContent -> Maybe ScanRange -> SelectObjectContent)
-> Lens
     SelectObjectContent
     SelectObjectContent
     (Maybe ScanRange)
     (Maybe ScanRange)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContent' {Maybe ScanRange
scanRange :: Maybe ScanRange
$sel:scanRange:SelectObjectContent' :: SelectObjectContent -> Maybe ScanRange
scanRange} -> Maybe ScanRange
scanRange) (\s :: SelectObjectContent
s@SelectObjectContent' {} Maybe ScanRange
a -> SelectObjectContent
s {$sel:scanRange:SelectObjectContent' :: Maybe ScanRange
scanRange = Maybe ScanRange
a} :: SelectObjectContent)

-- | The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
selectObjectContent_expectedBucketOwner :: Lens.Lens' SelectObjectContent (Prelude.Maybe Prelude.Text)
selectObjectContent_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> SelectObjectContent -> f SelectObjectContent
selectObjectContent_expectedBucketOwner = (SelectObjectContent -> Maybe Text)
-> (SelectObjectContent -> Maybe Text -> SelectObjectContent)
-> Lens
     SelectObjectContent SelectObjectContent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContent' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:SelectObjectContent' :: SelectObjectContent -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: SelectObjectContent
s@SelectObjectContent' {} Maybe Text
a -> SelectObjectContent
s {$sel:expectedBucketOwner:SelectObjectContent' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: SelectObjectContent)

-- | The S3 bucket.
selectObjectContent_bucket :: Lens.Lens' SelectObjectContent BucketName
selectObjectContent_bucket :: (BucketName -> f BucketName)
-> SelectObjectContent -> f SelectObjectContent
selectObjectContent_bucket = (SelectObjectContent -> BucketName)
-> (SelectObjectContent -> BucketName -> SelectObjectContent)
-> Lens
     SelectObjectContent SelectObjectContent BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContent' {BucketName
bucket :: BucketName
$sel:bucket:SelectObjectContent' :: SelectObjectContent -> BucketName
bucket} -> BucketName
bucket) (\s :: SelectObjectContent
s@SelectObjectContent' {} BucketName
a -> SelectObjectContent
s {$sel:bucket:SelectObjectContent' :: BucketName
bucket = BucketName
a} :: SelectObjectContent)

-- | The object key.
selectObjectContent_key :: Lens.Lens' SelectObjectContent ObjectKey
selectObjectContent_key :: (ObjectKey -> f ObjectKey)
-> SelectObjectContent -> f SelectObjectContent
selectObjectContent_key = (SelectObjectContent -> ObjectKey)
-> (SelectObjectContent -> ObjectKey -> SelectObjectContent)
-> Lens SelectObjectContent SelectObjectContent ObjectKey ObjectKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContent' {ObjectKey
key :: ObjectKey
$sel:key:SelectObjectContent' :: SelectObjectContent -> ObjectKey
key} -> ObjectKey
key) (\s :: SelectObjectContent
s@SelectObjectContent' {} ObjectKey
a -> SelectObjectContent
s {$sel:key:SelectObjectContent' :: ObjectKey
key = ObjectKey
a} :: SelectObjectContent)

-- | The expression that is used to query the object.
selectObjectContent_expression :: Lens.Lens' SelectObjectContent Prelude.Text
selectObjectContent_expression :: (Text -> f Text) -> SelectObjectContent -> f SelectObjectContent
selectObjectContent_expression = (SelectObjectContent -> Text)
-> (SelectObjectContent -> Text -> SelectObjectContent)
-> Lens SelectObjectContent SelectObjectContent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContent' {Text
expression :: Text
$sel:expression:SelectObjectContent' :: SelectObjectContent -> Text
expression} -> Text
expression) (\s :: SelectObjectContent
s@SelectObjectContent' {} Text
a -> SelectObjectContent
s {$sel:expression:SelectObjectContent' :: Text
expression = Text
a} :: SelectObjectContent)

-- | The type of the provided expression (for example, SQL).
selectObjectContent_expressionType :: Lens.Lens' SelectObjectContent ExpressionType
selectObjectContent_expressionType :: (ExpressionType -> f ExpressionType)
-> SelectObjectContent -> f SelectObjectContent
selectObjectContent_expressionType = (SelectObjectContent -> ExpressionType)
-> (SelectObjectContent -> ExpressionType -> SelectObjectContent)
-> Lens
     SelectObjectContent
     SelectObjectContent
     ExpressionType
     ExpressionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContent' {ExpressionType
expressionType :: ExpressionType
$sel:expressionType:SelectObjectContent' :: SelectObjectContent -> ExpressionType
expressionType} -> ExpressionType
expressionType) (\s :: SelectObjectContent
s@SelectObjectContent' {} ExpressionType
a -> SelectObjectContent
s {$sel:expressionType:SelectObjectContent' :: ExpressionType
expressionType = ExpressionType
a} :: SelectObjectContent)

-- | Describes the format of the data in the object that is being queried.
selectObjectContent_inputSerialization :: Lens.Lens' SelectObjectContent InputSerialization
selectObjectContent_inputSerialization :: (InputSerialization -> f InputSerialization)
-> SelectObjectContent -> f SelectObjectContent
selectObjectContent_inputSerialization = (SelectObjectContent -> InputSerialization)
-> (SelectObjectContent
    -> InputSerialization -> SelectObjectContent)
-> Lens
     SelectObjectContent
     SelectObjectContent
     InputSerialization
     InputSerialization
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContent' {InputSerialization
inputSerialization :: InputSerialization
$sel:inputSerialization:SelectObjectContent' :: SelectObjectContent -> InputSerialization
inputSerialization} -> InputSerialization
inputSerialization) (\s :: SelectObjectContent
s@SelectObjectContent' {} InputSerialization
a -> SelectObjectContent
s {$sel:inputSerialization:SelectObjectContent' :: InputSerialization
inputSerialization = InputSerialization
a} :: SelectObjectContent)

-- | Describes the format of the data that you want Amazon S3 to return in
-- response.
selectObjectContent_outputSerialization :: Lens.Lens' SelectObjectContent OutputSerialization
selectObjectContent_outputSerialization :: (OutputSerialization -> f OutputSerialization)
-> SelectObjectContent -> f SelectObjectContent
selectObjectContent_outputSerialization = (SelectObjectContent -> OutputSerialization)
-> (SelectObjectContent
    -> OutputSerialization -> SelectObjectContent)
-> Lens
     SelectObjectContent
     SelectObjectContent
     OutputSerialization
     OutputSerialization
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContent' {OutputSerialization
outputSerialization :: OutputSerialization
$sel:outputSerialization:SelectObjectContent' :: SelectObjectContent -> OutputSerialization
outputSerialization} -> OutputSerialization
outputSerialization) (\s :: SelectObjectContent
s@SelectObjectContent' {} OutputSerialization
a -> SelectObjectContent
s {$sel:outputSerialization:SelectObjectContent' :: OutputSerialization
outputSerialization = OutputSerialization
a} :: SelectObjectContent)

instance Core.AWSRequest SelectObjectContent where
  type
    AWSResponse SelectObjectContent =
      SelectObjectContentResponse
  request :: SelectObjectContent -> Request SelectObjectContent
request =
    Request SelectObjectContent -> Request SelectObjectContent
forall a. Request a -> Request a
Request.s3vhost
      (Request SelectObjectContent -> Request SelectObjectContent)
-> (SelectObjectContent -> Request SelectObjectContent)
-> SelectObjectContent
-> Request SelectObjectContent
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> SelectObjectContent -> Request SelectObjectContent
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.postXML Service
defaultService
  response :: Logger
-> Service
-> Proxy SelectObjectContent
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SelectObjectContent)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse SelectObjectContent))
-> Logger
-> Service
-> Proxy SelectObjectContent
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SelectObjectContent)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe SelectObjectContentEventStream
-> Int -> SelectObjectContentResponse
SelectObjectContentResponse'
            (Maybe SelectObjectContentEventStream
 -> Int -> SelectObjectContentResponse)
-> Either String (Maybe SelectObjectContentEventStream)
-> Either String (Int -> SelectObjectContentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node] -> Either String (Maybe SelectObjectContentEventStream)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
            Either String (Int -> SelectObjectContentResponse)
-> Either String Int -> Either String SelectObjectContentResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable SelectObjectContent

instance Prelude.NFData SelectObjectContent

instance Core.ToElement SelectObjectContent where
  toElement :: SelectObjectContent -> Element
toElement =
    Name -> SelectObjectContent -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
      Name
"{http://s3.amazonaws.com/doc/2006-03-01/}SelectObjectContentRequest"

instance Core.ToHeaders SelectObjectContent where
  toHeaders :: SelectObjectContent -> ResponseHeaders
toHeaders SelectObjectContent' {Maybe Text
Maybe (Sensitive Text)
Maybe RequestProgress
Maybe ScanRange
Text
ObjectKey
BucketName
ExpressionType
InputSerialization
OutputSerialization
outputSerialization :: OutputSerialization
inputSerialization :: InputSerialization
expressionType :: ExpressionType
expression :: Text
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
scanRange :: Maybe ScanRange
sSECustomerKeyMD5 :: Maybe Text
requestProgress :: Maybe RequestProgress
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
$sel:outputSerialization:SelectObjectContent' :: SelectObjectContent -> OutputSerialization
$sel:inputSerialization:SelectObjectContent' :: SelectObjectContent -> InputSerialization
$sel:expressionType:SelectObjectContent' :: SelectObjectContent -> ExpressionType
$sel:expression:SelectObjectContent' :: SelectObjectContent -> Text
$sel:key:SelectObjectContent' :: SelectObjectContent -> ObjectKey
$sel:bucket:SelectObjectContent' :: SelectObjectContent -> BucketName
$sel:expectedBucketOwner:SelectObjectContent' :: SelectObjectContent -> Maybe Text
$sel:scanRange:SelectObjectContent' :: SelectObjectContent -> Maybe ScanRange
$sel:sSECustomerKeyMD5:SelectObjectContent' :: SelectObjectContent -> Maybe Text
$sel:requestProgress:SelectObjectContent' :: SelectObjectContent -> Maybe RequestProgress
$sel:sSECustomerKey:SelectObjectContent' :: SelectObjectContent -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:SelectObjectContent' :: SelectObjectContent -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-server-side-encryption-customer-algorithm"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
sSECustomerAlgorithm,
        HeaderName
"x-amz-server-side-encryption-customer-key"
          HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
sSECustomerKey,
        HeaderName
"x-amz-server-side-encryption-customer-key-MD5"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
sSECustomerKeyMD5,
        HeaderName
"x-amz-expected-bucket-owner"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedBucketOwner
      ]

instance Core.ToPath SelectObjectContent where
  toPath :: SelectObjectContent -> ByteString
toPath SelectObjectContent' {Maybe Text
Maybe (Sensitive Text)
Maybe RequestProgress
Maybe ScanRange
Text
ObjectKey
BucketName
ExpressionType
InputSerialization
OutputSerialization
outputSerialization :: OutputSerialization
inputSerialization :: InputSerialization
expressionType :: ExpressionType
expression :: Text
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
scanRange :: Maybe ScanRange
sSECustomerKeyMD5 :: Maybe Text
requestProgress :: Maybe RequestProgress
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
$sel:outputSerialization:SelectObjectContent' :: SelectObjectContent -> OutputSerialization
$sel:inputSerialization:SelectObjectContent' :: SelectObjectContent -> InputSerialization
$sel:expressionType:SelectObjectContent' :: SelectObjectContent -> ExpressionType
$sel:expression:SelectObjectContent' :: SelectObjectContent -> Text
$sel:key:SelectObjectContent' :: SelectObjectContent -> ObjectKey
$sel:bucket:SelectObjectContent' :: SelectObjectContent -> BucketName
$sel:expectedBucketOwner:SelectObjectContent' :: SelectObjectContent -> Maybe Text
$sel:scanRange:SelectObjectContent' :: SelectObjectContent -> Maybe ScanRange
$sel:sSECustomerKeyMD5:SelectObjectContent' :: SelectObjectContent -> Maybe Text
$sel:requestProgress:SelectObjectContent' :: SelectObjectContent -> Maybe RequestProgress
$sel:sSECustomerKey:SelectObjectContent' :: SelectObjectContent -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:SelectObjectContent' :: SelectObjectContent -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket, ByteString
"/", ObjectKey -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ObjectKey
key]

instance Core.ToQuery SelectObjectContent where
  toQuery :: SelectObjectContent -> QueryString
toQuery =
    QueryString -> SelectObjectContent -> QueryString
forall a b. a -> b -> a
Prelude.const
      ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"select&select-type=2"])

instance Core.ToXML SelectObjectContent where
  toXML :: SelectObjectContent -> XML
toXML SelectObjectContent' {Maybe Text
Maybe (Sensitive Text)
Maybe RequestProgress
Maybe ScanRange
Text
ObjectKey
BucketName
ExpressionType
InputSerialization
OutputSerialization
outputSerialization :: OutputSerialization
inputSerialization :: InputSerialization
expressionType :: ExpressionType
expression :: Text
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
scanRange :: Maybe ScanRange
sSECustomerKeyMD5 :: Maybe Text
requestProgress :: Maybe RequestProgress
sSECustomerKey :: Maybe (Sensitive Text)
sSECustomerAlgorithm :: Maybe Text
$sel:outputSerialization:SelectObjectContent' :: SelectObjectContent -> OutputSerialization
$sel:inputSerialization:SelectObjectContent' :: SelectObjectContent -> InputSerialization
$sel:expressionType:SelectObjectContent' :: SelectObjectContent -> ExpressionType
$sel:expression:SelectObjectContent' :: SelectObjectContent -> Text
$sel:key:SelectObjectContent' :: SelectObjectContent -> ObjectKey
$sel:bucket:SelectObjectContent' :: SelectObjectContent -> BucketName
$sel:expectedBucketOwner:SelectObjectContent' :: SelectObjectContent -> Maybe Text
$sel:scanRange:SelectObjectContent' :: SelectObjectContent -> Maybe ScanRange
$sel:sSECustomerKeyMD5:SelectObjectContent' :: SelectObjectContent -> Maybe Text
$sel:requestProgress:SelectObjectContent' :: SelectObjectContent -> Maybe RequestProgress
$sel:sSECustomerKey:SelectObjectContent' :: SelectObjectContent -> Maybe (Sensitive Text)
$sel:sSECustomerAlgorithm:SelectObjectContent' :: SelectObjectContent -> Maybe Text
..} =
    [XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"RequestProgress" Name -> Maybe RequestProgress -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe RequestProgress
requestProgress,
        Name
"ScanRange" Name -> Maybe ScanRange -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe ScanRange
scanRange,
        Name
"Expression" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
expression,
        Name
"ExpressionType" Name -> ExpressionType -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= ExpressionType
expressionType,
        Name
"InputSerialization" Name -> InputSerialization -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= InputSerialization
inputSerialization,
        Name
"OutputSerialization" Name -> OutputSerialization -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= OutputSerialization
outputSerialization
      ]

-- | /See:/ 'newSelectObjectContentResponse' smart constructor.
data SelectObjectContentResponse = SelectObjectContentResponse'
  { -- | The array of results.
    SelectObjectContentResponse -> Maybe SelectObjectContentEventStream
payload :: Prelude.Maybe SelectObjectContentEventStream,
    -- | The response's http status code.
    SelectObjectContentResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SelectObjectContentResponse -> SelectObjectContentResponse -> Bool
(SelectObjectContentResponse
 -> SelectObjectContentResponse -> Bool)
-> (SelectObjectContentResponse
    -> SelectObjectContentResponse -> Bool)
-> Eq SelectObjectContentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SelectObjectContentResponse -> SelectObjectContentResponse -> Bool
$c/= :: SelectObjectContentResponse -> SelectObjectContentResponse -> Bool
== :: SelectObjectContentResponse -> SelectObjectContentResponse -> Bool
$c== :: SelectObjectContentResponse -> SelectObjectContentResponse -> Bool
Prelude.Eq, ReadPrec [SelectObjectContentResponse]
ReadPrec SelectObjectContentResponse
Int -> ReadS SelectObjectContentResponse
ReadS [SelectObjectContentResponse]
(Int -> ReadS SelectObjectContentResponse)
-> ReadS [SelectObjectContentResponse]
-> ReadPrec SelectObjectContentResponse
-> ReadPrec [SelectObjectContentResponse]
-> Read SelectObjectContentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SelectObjectContentResponse]
$creadListPrec :: ReadPrec [SelectObjectContentResponse]
readPrec :: ReadPrec SelectObjectContentResponse
$creadPrec :: ReadPrec SelectObjectContentResponse
readList :: ReadS [SelectObjectContentResponse]
$creadList :: ReadS [SelectObjectContentResponse]
readsPrec :: Int -> ReadS SelectObjectContentResponse
$creadsPrec :: Int -> ReadS SelectObjectContentResponse
Prelude.Read, Int -> SelectObjectContentResponse -> ShowS
[SelectObjectContentResponse] -> ShowS
SelectObjectContentResponse -> String
(Int -> SelectObjectContentResponse -> ShowS)
-> (SelectObjectContentResponse -> String)
-> ([SelectObjectContentResponse] -> ShowS)
-> Show SelectObjectContentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SelectObjectContentResponse] -> ShowS
$cshowList :: [SelectObjectContentResponse] -> ShowS
show :: SelectObjectContentResponse -> String
$cshow :: SelectObjectContentResponse -> String
showsPrec :: Int -> SelectObjectContentResponse -> ShowS
$cshowsPrec :: Int -> SelectObjectContentResponse -> ShowS
Prelude.Show, (forall x.
 SelectObjectContentResponse -> Rep SelectObjectContentResponse x)
-> (forall x.
    Rep SelectObjectContentResponse x -> SelectObjectContentResponse)
-> Generic SelectObjectContentResponse
forall x.
Rep SelectObjectContentResponse x -> SelectObjectContentResponse
forall x.
SelectObjectContentResponse -> Rep SelectObjectContentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SelectObjectContentResponse x -> SelectObjectContentResponse
$cfrom :: forall x.
SelectObjectContentResponse -> Rep SelectObjectContentResponse x
Prelude.Generic)

-- |
-- Create a value of 'SelectObjectContentResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'payload', 'selectObjectContentResponse_payload' - The array of results.
--
-- 'httpStatus', 'selectObjectContentResponse_httpStatus' - The response's http status code.
newSelectObjectContentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SelectObjectContentResponse
newSelectObjectContentResponse :: Int -> SelectObjectContentResponse
newSelectObjectContentResponse Int
pHttpStatus_ =
  SelectObjectContentResponse' :: Maybe SelectObjectContentEventStream
-> Int -> SelectObjectContentResponse
SelectObjectContentResponse'
    { $sel:payload:SelectObjectContentResponse' :: Maybe SelectObjectContentEventStream
payload =
        Maybe SelectObjectContentEventStream
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SelectObjectContentResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The array of results.
selectObjectContentResponse_payload :: Lens.Lens' SelectObjectContentResponse (Prelude.Maybe SelectObjectContentEventStream)
selectObjectContentResponse_payload :: (Maybe SelectObjectContentEventStream
 -> f (Maybe SelectObjectContentEventStream))
-> SelectObjectContentResponse -> f SelectObjectContentResponse
selectObjectContentResponse_payload = (SelectObjectContentResponse
 -> Maybe SelectObjectContentEventStream)
-> (SelectObjectContentResponse
    -> Maybe SelectObjectContentEventStream
    -> SelectObjectContentResponse)
-> Lens
     SelectObjectContentResponse
     SelectObjectContentResponse
     (Maybe SelectObjectContentEventStream)
     (Maybe SelectObjectContentEventStream)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContentResponse' {Maybe SelectObjectContentEventStream
payload :: Maybe SelectObjectContentEventStream
$sel:payload:SelectObjectContentResponse' :: SelectObjectContentResponse -> Maybe SelectObjectContentEventStream
payload} -> Maybe SelectObjectContentEventStream
payload) (\s :: SelectObjectContentResponse
s@SelectObjectContentResponse' {} Maybe SelectObjectContentEventStream
a -> SelectObjectContentResponse
s {$sel:payload:SelectObjectContentResponse' :: Maybe SelectObjectContentEventStream
payload = Maybe SelectObjectContentEventStream
a} :: SelectObjectContentResponse)

-- | The response's http status code.
selectObjectContentResponse_httpStatus :: Lens.Lens' SelectObjectContentResponse Prelude.Int
selectObjectContentResponse_httpStatus :: (Int -> f Int)
-> SelectObjectContentResponse -> f SelectObjectContentResponse
selectObjectContentResponse_httpStatus = (SelectObjectContentResponse -> Int)
-> (SelectObjectContentResponse
    -> Int -> SelectObjectContentResponse)
-> Lens
     SelectObjectContentResponse SelectObjectContentResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelectObjectContentResponse' {Int
httpStatus :: Int
$sel:httpStatus:SelectObjectContentResponse' :: SelectObjectContentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SelectObjectContentResponse
s@SelectObjectContentResponse' {} Int
a -> SelectObjectContentResponse
s {$sel:httpStatus:SelectObjectContentResponse' :: Int
httpStatus = Int
a} :: SelectObjectContentResponse)

instance Prelude.NFData SelectObjectContentResponse