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

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

-- |
-- Module      : Amazonka.DMS.Types.KinesisSettings
-- 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)
module Amazonka.DMS.Types.KinesisSettings where

import qualified Amazonka.Core as Core
import Amazonka.DMS.Types.MessageFormatValue
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides information that describes an Amazon Kinesis Data Stream
-- endpoint. This information includes the output format of records applied
-- to the endpoint and details of transaction and control table data
-- information.
--
-- /See:/ 'newKinesisSettings' smart constructor.
data KinesisSettings = KinesisSettings'
  { -- | Provides detailed transaction information from the source database. This
    -- information includes a commit timestamp, a log position, and values for
    -- @transaction_id@, previous @transaction_id@, and @transaction_record_id@
    -- (the record offset within a transaction). The default is @false@.
    KinesisSettings -> Maybe Bool
includeTransactionDetails :: Prelude.Maybe Prelude.Bool,
    -- | Includes any data definition language (DDL) operations that change the
    -- table in the control data, such as @rename-table@, @drop-table@,
    -- @add-column@, @drop-column@, and @rename-column@. The default is
    -- @false@.
    KinesisSettings -> Maybe Bool
includeTableAlterOperations :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Name (ARN) for the IAM role that DMS uses to write
    -- to the Kinesis data stream. The role must allow the @iam:PassRole@
    -- action.
    KinesisSettings -> Maybe Text
serviceAccessRoleArn :: Prelude.Maybe Prelude.Text,
    -- | Prefixes schema and table names to partition values, when the partition
    -- type is @primary-key-type@. Doing this increases data distribution among
    -- Kinesis shards. For example, suppose that a SysBench schema has
    -- thousands of tables and each table has only limited range for a primary
    -- key. In this case, the same primary key is sent from thousands of tables
    -- to the same shard, which causes throttling. The default is @false@.
    KinesisSettings -> Maybe Bool
partitionIncludeSchemaTable :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Name (ARN) for the Amazon Kinesis Data Streams
    -- endpoint.
    KinesisSettings -> Maybe Text
streamArn :: Prelude.Maybe Prelude.Text,
    -- | Shows detailed control information for table definition, column
    -- definition, and table and column changes in the Kinesis message output.
    -- The default is @false@.
    KinesisSettings -> Maybe Bool
includeControlDetails :: Prelude.Maybe Prelude.Bool,
    -- | Set this optional parameter to @true@ to avoid adding a \'0x\' prefix to
    -- raw data in hexadecimal format. For example, by default, DMS adds a
    -- \'0x\' prefix to the LOB column type in hexadecimal format moving from
    -- an Oracle source to an Amazon Kinesis target. Use the @NoHexPrefix@
    -- endpoint setting to enable migration of RAW data type columns without
    -- adding the \'0x\' prefix.
    KinesisSettings -> Maybe Bool
noHexPrefix :: Prelude.Maybe Prelude.Bool,
    -- | Shows the partition value within the Kinesis message output, unless the
    -- partition type is @schema-table-type@. The default is @false@.
    KinesisSettings -> Maybe Bool
includePartitionValue :: Prelude.Maybe Prelude.Bool,
    -- | The output format for the records created on the endpoint. The message
    -- format is @JSON@ (default) or @JSON_UNFORMATTED@ (a single line with no
    -- tab).
    KinesisSettings -> Maybe MessageFormatValue
messageFormat :: Prelude.Maybe MessageFormatValue,
    -- | Include NULL and empty columns for records migrated to the endpoint. The
    -- default is @false@.
    KinesisSettings -> Maybe Bool
includeNullAndEmpty :: Prelude.Maybe Prelude.Bool
  }
  deriving (KinesisSettings -> KinesisSettings -> Bool
(KinesisSettings -> KinesisSettings -> Bool)
-> (KinesisSettings -> KinesisSettings -> Bool)
-> Eq KinesisSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisSettings -> KinesisSettings -> Bool
$c/= :: KinesisSettings -> KinesisSettings -> Bool
== :: KinesisSettings -> KinesisSettings -> Bool
$c== :: KinesisSettings -> KinesisSettings -> Bool
Prelude.Eq, ReadPrec [KinesisSettings]
ReadPrec KinesisSettings
Int -> ReadS KinesisSettings
ReadS [KinesisSettings]
(Int -> ReadS KinesisSettings)
-> ReadS [KinesisSettings]
-> ReadPrec KinesisSettings
-> ReadPrec [KinesisSettings]
-> Read KinesisSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisSettings]
$creadListPrec :: ReadPrec [KinesisSettings]
readPrec :: ReadPrec KinesisSettings
$creadPrec :: ReadPrec KinesisSettings
readList :: ReadS [KinesisSettings]
$creadList :: ReadS [KinesisSettings]
readsPrec :: Int -> ReadS KinesisSettings
$creadsPrec :: Int -> ReadS KinesisSettings
Prelude.Read, Int -> KinesisSettings -> ShowS
[KinesisSettings] -> ShowS
KinesisSettings -> String
(Int -> KinesisSettings -> ShowS)
-> (KinesisSettings -> String)
-> ([KinesisSettings] -> ShowS)
-> Show KinesisSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisSettings] -> ShowS
$cshowList :: [KinesisSettings] -> ShowS
show :: KinesisSettings -> String
$cshow :: KinesisSettings -> String
showsPrec :: Int -> KinesisSettings -> ShowS
$cshowsPrec :: Int -> KinesisSettings -> ShowS
Prelude.Show, (forall x. KinesisSettings -> Rep KinesisSettings x)
-> (forall x. Rep KinesisSettings x -> KinesisSettings)
-> Generic KinesisSettings
forall x. Rep KinesisSettings x -> KinesisSettings
forall x. KinesisSettings -> Rep KinesisSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KinesisSettings x -> KinesisSettings
$cfrom :: forall x. KinesisSettings -> Rep KinesisSettings x
Prelude.Generic)

-- |
-- Create a value of 'KinesisSettings' 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:
--
-- 'includeTransactionDetails', 'kinesisSettings_includeTransactionDetails' - Provides detailed transaction information from the source database. This
-- information includes a commit timestamp, a log position, and values for
-- @transaction_id@, previous @transaction_id@, and @transaction_record_id@
-- (the record offset within a transaction). The default is @false@.
--
-- 'includeTableAlterOperations', 'kinesisSettings_includeTableAlterOperations' - Includes any data definition language (DDL) operations that change the
-- table in the control data, such as @rename-table@, @drop-table@,
-- @add-column@, @drop-column@, and @rename-column@. The default is
-- @false@.
--
-- 'serviceAccessRoleArn', 'kinesisSettings_serviceAccessRoleArn' - The Amazon Resource Name (ARN) for the IAM role that DMS uses to write
-- to the Kinesis data stream. The role must allow the @iam:PassRole@
-- action.
--
-- 'partitionIncludeSchemaTable', 'kinesisSettings_partitionIncludeSchemaTable' - Prefixes schema and table names to partition values, when the partition
-- type is @primary-key-type@. Doing this increases data distribution among
-- Kinesis shards. For example, suppose that a SysBench schema has
-- thousands of tables and each table has only limited range for a primary
-- key. In this case, the same primary key is sent from thousands of tables
-- to the same shard, which causes throttling. The default is @false@.
--
-- 'streamArn', 'kinesisSettings_streamArn' - The Amazon Resource Name (ARN) for the Amazon Kinesis Data Streams
-- endpoint.
--
-- 'includeControlDetails', 'kinesisSettings_includeControlDetails' - Shows detailed control information for table definition, column
-- definition, and table and column changes in the Kinesis message output.
-- The default is @false@.
--
-- 'noHexPrefix', 'kinesisSettings_noHexPrefix' - Set this optional parameter to @true@ to avoid adding a \'0x\' prefix to
-- raw data in hexadecimal format. For example, by default, DMS adds a
-- \'0x\' prefix to the LOB column type in hexadecimal format moving from
-- an Oracle source to an Amazon Kinesis target. Use the @NoHexPrefix@
-- endpoint setting to enable migration of RAW data type columns without
-- adding the \'0x\' prefix.
--
-- 'includePartitionValue', 'kinesisSettings_includePartitionValue' - Shows the partition value within the Kinesis message output, unless the
-- partition type is @schema-table-type@. The default is @false@.
--
-- 'messageFormat', 'kinesisSettings_messageFormat' - The output format for the records created on the endpoint. The message
-- format is @JSON@ (default) or @JSON_UNFORMATTED@ (a single line with no
-- tab).
--
-- 'includeNullAndEmpty', 'kinesisSettings_includeNullAndEmpty' - Include NULL and empty columns for records migrated to the endpoint. The
-- default is @false@.
newKinesisSettings ::
  KinesisSettings
newKinesisSettings :: KinesisSettings
newKinesisSettings =
  KinesisSettings' :: Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe MessageFormatValue
-> Maybe Bool
-> KinesisSettings
KinesisSettings'
    { $sel:includeTransactionDetails:KinesisSettings' :: Maybe Bool
includeTransactionDetails =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:includeTableAlterOperations:KinesisSettings' :: Maybe Bool
includeTableAlterOperations = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceAccessRoleArn:KinesisSettings' :: Maybe Text
serviceAccessRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:partitionIncludeSchemaTable:KinesisSettings' :: Maybe Bool
partitionIncludeSchemaTable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:streamArn:KinesisSettings' :: Maybe Text
streamArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:includeControlDetails:KinesisSettings' :: Maybe Bool
includeControlDetails = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:noHexPrefix:KinesisSettings' :: Maybe Bool
noHexPrefix = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:includePartitionValue:KinesisSettings' :: Maybe Bool
includePartitionValue = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:messageFormat:KinesisSettings' :: Maybe MessageFormatValue
messageFormat = Maybe MessageFormatValue
forall a. Maybe a
Prelude.Nothing,
      $sel:includeNullAndEmpty:KinesisSettings' :: Maybe Bool
includeNullAndEmpty = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Provides detailed transaction information from the source database. This
-- information includes a commit timestamp, a log position, and values for
-- @transaction_id@, previous @transaction_id@, and @transaction_record_id@
-- (the record offset within a transaction). The default is @false@.
kinesisSettings_includeTransactionDetails :: Lens.Lens' KinesisSettings (Prelude.Maybe Prelude.Bool)
kinesisSettings_includeTransactionDetails :: (Maybe Bool -> f (Maybe Bool))
-> KinesisSettings -> f KinesisSettings
kinesisSettings_includeTransactionDetails = (KinesisSettings -> Maybe Bool)
-> (KinesisSettings -> Maybe Bool -> KinesisSettings)
-> Lens KinesisSettings KinesisSettings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisSettings' {Maybe Bool
includeTransactionDetails :: Maybe Bool
$sel:includeTransactionDetails:KinesisSettings' :: KinesisSettings -> Maybe Bool
includeTransactionDetails} -> Maybe Bool
includeTransactionDetails) (\s :: KinesisSettings
s@KinesisSettings' {} Maybe Bool
a -> KinesisSettings
s {$sel:includeTransactionDetails:KinesisSettings' :: Maybe Bool
includeTransactionDetails = Maybe Bool
a} :: KinesisSettings)

-- | Includes any data definition language (DDL) operations that change the
-- table in the control data, such as @rename-table@, @drop-table@,
-- @add-column@, @drop-column@, and @rename-column@. The default is
-- @false@.
kinesisSettings_includeTableAlterOperations :: Lens.Lens' KinesisSettings (Prelude.Maybe Prelude.Bool)
kinesisSettings_includeTableAlterOperations :: (Maybe Bool -> f (Maybe Bool))
-> KinesisSettings -> f KinesisSettings
kinesisSettings_includeTableAlterOperations = (KinesisSettings -> Maybe Bool)
-> (KinesisSettings -> Maybe Bool -> KinesisSettings)
-> Lens KinesisSettings KinesisSettings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisSettings' {Maybe Bool
includeTableAlterOperations :: Maybe Bool
$sel:includeTableAlterOperations:KinesisSettings' :: KinesisSettings -> Maybe Bool
includeTableAlterOperations} -> Maybe Bool
includeTableAlterOperations) (\s :: KinesisSettings
s@KinesisSettings' {} Maybe Bool
a -> KinesisSettings
s {$sel:includeTableAlterOperations:KinesisSettings' :: Maybe Bool
includeTableAlterOperations = Maybe Bool
a} :: KinesisSettings)

-- | The Amazon Resource Name (ARN) for the IAM role that DMS uses to write
-- to the Kinesis data stream. The role must allow the @iam:PassRole@
-- action.
kinesisSettings_serviceAccessRoleArn :: Lens.Lens' KinesisSettings (Prelude.Maybe Prelude.Text)
kinesisSettings_serviceAccessRoleArn :: (Maybe Text -> f (Maybe Text))
-> KinesisSettings -> f KinesisSettings
kinesisSettings_serviceAccessRoleArn = (KinesisSettings -> Maybe Text)
-> (KinesisSettings -> Maybe Text -> KinesisSettings)
-> Lens KinesisSettings KinesisSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisSettings' {Maybe Text
serviceAccessRoleArn :: Maybe Text
$sel:serviceAccessRoleArn:KinesisSettings' :: KinesisSettings -> Maybe Text
serviceAccessRoleArn} -> Maybe Text
serviceAccessRoleArn) (\s :: KinesisSettings
s@KinesisSettings' {} Maybe Text
a -> KinesisSettings
s {$sel:serviceAccessRoleArn:KinesisSettings' :: Maybe Text
serviceAccessRoleArn = Maybe Text
a} :: KinesisSettings)

-- | Prefixes schema and table names to partition values, when the partition
-- type is @primary-key-type@. Doing this increases data distribution among
-- Kinesis shards. For example, suppose that a SysBench schema has
-- thousands of tables and each table has only limited range for a primary
-- key. In this case, the same primary key is sent from thousands of tables
-- to the same shard, which causes throttling. The default is @false@.
kinesisSettings_partitionIncludeSchemaTable :: Lens.Lens' KinesisSettings (Prelude.Maybe Prelude.Bool)
kinesisSettings_partitionIncludeSchemaTable :: (Maybe Bool -> f (Maybe Bool))
-> KinesisSettings -> f KinesisSettings
kinesisSettings_partitionIncludeSchemaTable = (KinesisSettings -> Maybe Bool)
-> (KinesisSettings -> Maybe Bool -> KinesisSettings)
-> Lens KinesisSettings KinesisSettings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisSettings' {Maybe Bool
partitionIncludeSchemaTable :: Maybe Bool
$sel:partitionIncludeSchemaTable:KinesisSettings' :: KinesisSettings -> Maybe Bool
partitionIncludeSchemaTable} -> Maybe Bool
partitionIncludeSchemaTable) (\s :: KinesisSettings
s@KinesisSettings' {} Maybe Bool
a -> KinesisSettings
s {$sel:partitionIncludeSchemaTable:KinesisSettings' :: Maybe Bool
partitionIncludeSchemaTable = Maybe Bool
a} :: KinesisSettings)

-- | The Amazon Resource Name (ARN) for the Amazon Kinesis Data Streams
-- endpoint.
kinesisSettings_streamArn :: Lens.Lens' KinesisSettings (Prelude.Maybe Prelude.Text)
kinesisSettings_streamArn :: (Maybe Text -> f (Maybe Text))
-> KinesisSettings -> f KinesisSettings
kinesisSettings_streamArn = (KinesisSettings -> Maybe Text)
-> (KinesisSettings -> Maybe Text -> KinesisSettings)
-> Lens KinesisSettings KinesisSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisSettings' {Maybe Text
streamArn :: Maybe Text
$sel:streamArn:KinesisSettings' :: KinesisSettings -> Maybe Text
streamArn} -> Maybe Text
streamArn) (\s :: KinesisSettings
s@KinesisSettings' {} Maybe Text
a -> KinesisSettings
s {$sel:streamArn:KinesisSettings' :: Maybe Text
streamArn = Maybe Text
a} :: KinesisSettings)

-- | Shows detailed control information for table definition, column
-- definition, and table and column changes in the Kinesis message output.
-- The default is @false@.
kinesisSettings_includeControlDetails :: Lens.Lens' KinesisSettings (Prelude.Maybe Prelude.Bool)
kinesisSettings_includeControlDetails :: (Maybe Bool -> f (Maybe Bool))
-> KinesisSettings -> f KinesisSettings
kinesisSettings_includeControlDetails = (KinesisSettings -> Maybe Bool)
-> (KinesisSettings -> Maybe Bool -> KinesisSettings)
-> Lens KinesisSettings KinesisSettings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisSettings' {Maybe Bool
includeControlDetails :: Maybe Bool
$sel:includeControlDetails:KinesisSettings' :: KinesisSettings -> Maybe Bool
includeControlDetails} -> Maybe Bool
includeControlDetails) (\s :: KinesisSettings
s@KinesisSettings' {} Maybe Bool
a -> KinesisSettings
s {$sel:includeControlDetails:KinesisSettings' :: Maybe Bool
includeControlDetails = Maybe Bool
a} :: KinesisSettings)

-- | Set this optional parameter to @true@ to avoid adding a \'0x\' prefix to
-- raw data in hexadecimal format. For example, by default, DMS adds a
-- \'0x\' prefix to the LOB column type in hexadecimal format moving from
-- an Oracle source to an Amazon Kinesis target. Use the @NoHexPrefix@
-- endpoint setting to enable migration of RAW data type columns without
-- adding the \'0x\' prefix.
kinesisSettings_noHexPrefix :: Lens.Lens' KinesisSettings (Prelude.Maybe Prelude.Bool)
kinesisSettings_noHexPrefix :: (Maybe Bool -> f (Maybe Bool))
-> KinesisSettings -> f KinesisSettings
kinesisSettings_noHexPrefix = (KinesisSettings -> Maybe Bool)
-> (KinesisSettings -> Maybe Bool -> KinesisSettings)
-> Lens KinesisSettings KinesisSettings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisSettings' {Maybe Bool
noHexPrefix :: Maybe Bool
$sel:noHexPrefix:KinesisSettings' :: KinesisSettings -> Maybe Bool
noHexPrefix} -> Maybe Bool
noHexPrefix) (\s :: KinesisSettings
s@KinesisSettings' {} Maybe Bool
a -> KinesisSettings
s {$sel:noHexPrefix:KinesisSettings' :: Maybe Bool
noHexPrefix = Maybe Bool
a} :: KinesisSettings)

-- | Shows the partition value within the Kinesis message output, unless the
-- partition type is @schema-table-type@. The default is @false@.
kinesisSettings_includePartitionValue :: Lens.Lens' KinesisSettings (Prelude.Maybe Prelude.Bool)
kinesisSettings_includePartitionValue :: (Maybe Bool -> f (Maybe Bool))
-> KinesisSettings -> f KinesisSettings
kinesisSettings_includePartitionValue = (KinesisSettings -> Maybe Bool)
-> (KinesisSettings -> Maybe Bool -> KinesisSettings)
-> Lens KinesisSettings KinesisSettings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisSettings' {Maybe Bool
includePartitionValue :: Maybe Bool
$sel:includePartitionValue:KinesisSettings' :: KinesisSettings -> Maybe Bool
includePartitionValue} -> Maybe Bool
includePartitionValue) (\s :: KinesisSettings
s@KinesisSettings' {} Maybe Bool
a -> KinesisSettings
s {$sel:includePartitionValue:KinesisSettings' :: Maybe Bool
includePartitionValue = Maybe Bool
a} :: KinesisSettings)

-- | The output format for the records created on the endpoint. The message
-- format is @JSON@ (default) or @JSON_UNFORMATTED@ (a single line with no
-- tab).
kinesisSettings_messageFormat :: Lens.Lens' KinesisSettings (Prelude.Maybe MessageFormatValue)
kinesisSettings_messageFormat :: (Maybe MessageFormatValue -> f (Maybe MessageFormatValue))
-> KinesisSettings -> f KinesisSettings
kinesisSettings_messageFormat = (KinesisSettings -> Maybe MessageFormatValue)
-> (KinesisSettings -> Maybe MessageFormatValue -> KinesisSettings)
-> Lens
     KinesisSettings
     KinesisSettings
     (Maybe MessageFormatValue)
     (Maybe MessageFormatValue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisSettings' {Maybe MessageFormatValue
messageFormat :: Maybe MessageFormatValue
$sel:messageFormat:KinesisSettings' :: KinesisSettings -> Maybe MessageFormatValue
messageFormat} -> Maybe MessageFormatValue
messageFormat) (\s :: KinesisSettings
s@KinesisSettings' {} Maybe MessageFormatValue
a -> KinesisSettings
s {$sel:messageFormat:KinesisSettings' :: Maybe MessageFormatValue
messageFormat = Maybe MessageFormatValue
a} :: KinesisSettings)

-- | Include NULL and empty columns for records migrated to the endpoint. The
-- default is @false@.
kinesisSettings_includeNullAndEmpty :: Lens.Lens' KinesisSettings (Prelude.Maybe Prelude.Bool)
kinesisSettings_includeNullAndEmpty :: (Maybe Bool -> f (Maybe Bool))
-> KinesisSettings -> f KinesisSettings
kinesisSettings_includeNullAndEmpty = (KinesisSettings -> Maybe Bool)
-> (KinesisSettings -> Maybe Bool -> KinesisSettings)
-> Lens KinesisSettings KinesisSettings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisSettings' {Maybe Bool
includeNullAndEmpty :: Maybe Bool
$sel:includeNullAndEmpty:KinesisSettings' :: KinesisSettings -> Maybe Bool
includeNullAndEmpty} -> Maybe Bool
includeNullAndEmpty) (\s :: KinesisSettings
s@KinesisSettings' {} Maybe Bool
a -> KinesisSettings
s {$sel:includeNullAndEmpty:KinesisSettings' :: Maybe Bool
includeNullAndEmpty = Maybe Bool
a} :: KinesisSettings)

instance Core.FromJSON KinesisSettings where
  parseJSON :: Value -> Parser KinesisSettings
parseJSON =
    String
-> (Object -> Parser KinesisSettings)
-> Value
-> Parser KinesisSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"KinesisSettings"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe MessageFormatValue
-> Maybe Bool
-> KinesisSettings
KinesisSettings'
            (Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe MessageFormatValue
 -> Maybe Bool
 -> KinesisSettings)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe MessageFormatValue
      -> Maybe Bool
      -> KinesisSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IncludeTransactionDetails")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe MessageFormatValue
   -> Maybe Bool
   -> KinesisSettings)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe MessageFormatValue
      -> Maybe Bool
      -> KinesisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IncludeTableAlterOperations")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe MessageFormatValue
   -> Maybe Bool
   -> KinesisSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe MessageFormatValue
      -> Maybe Bool
      -> KinesisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServiceAccessRoleArn")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe MessageFormatValue
   -> Maybe Bool
   -> KinesisSettings)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe MessageFormatValue
      -> Maybe Bool
      -> KinesisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PartitionIncludeSchemaTable")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe MessageFormatValue
   -> Maybe Bool
   -> KinesisSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe MessageFormatValue
      -> Maybe Bool
      -> KinesisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StreamArn")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe MessageFormatValue
   -> Maybe Bool
   -> KinesisSettings)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe MessageFormatValue
      -> Maybe Bool
      -> KinesisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IncludeControlDetails")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe MessageFormatValue
   -> Maybe Bool
   -> KinesisSettings)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe MessageFormatValue -> Maybe Bool -> KinesisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NoHexPrefix")
            Parser
  (Maybe Bool
   -> Maybe MessageFormatValue -> Maybe Bool -> KinesisSettings)
-> Parser (Maybe Bool)
-> Parser
     (Maybe MessageFormatValue -> Maybe Bool -> KinesisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IncludePartitionValue")
            Parser (Maybe MessageFormatValue -> Maybe Bool -> KinesisSettings)
-> Parser (Maybe MessageFormatValue)
-> Parser (Maybe Bool -> KinesisSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MessageFormatValue)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MessageFormat")
            Parser (Maybe Bool -> KinesisSettings)
-> Parser (Maybe Bool) -> Parser KinesisSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IncludeNullAndEmpty")
      )

instance Prelude.Hashable KinesisSettings

instance Prelude.NFData KinesisSettings

instance Core.ToJSON KinesisSettings where
  toJSON :: KinesisSettings -> Value
toJSON KinesisSettings' {Maybe Bool
Maybe Text
Maybe MessageFormatValue
includeNullAndEmpty :: Maybe Bool
messageFormat :: Maybe MessageFormatValue
includePartitionValue :: Maybe Bool
noHexPrefix :: Maybe Bool
includeControlDetails :: Maybe Bool
streamArn :: Maybe Text
partitionIncludeSchemaTable :: Maybe Bool
serviceAccessRoleArn :: Maybe Text
includeTableAlterOperations :: Maybe Bool
includeTransactionDetails :: Maybe Bool
$sel:includeNullAndEmpty:KinesisSettings' :: KinesisSettings -> Maybe Bool
$sel:messageFormat:KinesisSettings' :: KinesisSettings -> Maybe MessageFormatValue
$sel:includePartitionValue:KinesisSettings' :: KinesisSettings -> Maybe Bool
$sel:noHexPrefix:KinesisSettings' :: KinesisSettings -> Maybe Bool
$sel:includeControlDetails:KinesisSettings' :: KinesisSettings -> Maybe Bool
$sel:streamArn:KinesisSettings' :: KinesisSettings -> Maybe Text
$sel:partitionIncludeSchemaTable:KinesisSettings' :: KinesisSettings -> Maybe Bool
$sel:serviceAccessRoleArn:KinesisSettings' :: KinesisSettings -> Maybe Text
$sel:includeTableAlterOperations:KinesisSettings' :: KinesisSettings -> Maybe Bool
$sel:includeTransactionDetails:KinesisSettings' :: KinesisSettings -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"IncludeTransactionDetails" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeTransactionDetails,
            (Text
"IncludeTableAlterOperations" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeTableAlterOperations,
            (Text
"ServiceAccessRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
serviceAccessRoleArn,
            (Text
"PartitionIncludeSchemaTable" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
partitionIncludeSchemaTable,
            (Text
"StreamArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamArn,
            (Text
"IncludeControlDetails" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeControlDetails,
            (Text
"NoHexPrefix" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
noHexPrefix,
            (Text
"IncludePartitionValue" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includePartitionValue,
            (Text
"MessageFormat" Text -> MessageFormatValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MessageFormatValue -> Pair)
-> Maybe MessageFormatValue -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MessageFormatValue
messageFormat,
            (Text
"IncludeNullAndEmpty" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeNullAndEmpty
          ]
      )