{-# 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.Connect.Types.KinesisFirehoseConfig
-- 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.Connect.Types.KinesisFirehoseConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Configuration information of a Kinesis Data Firehose delivery stream.
--
-- /See:/ 'newKinesisFirehoseConfig' smart constructor.
data KinesisFirehoseConfig = KinesisFirehoseConfig'
  { -- | The Amazon Resource Name (ARN) of the delivery stream.
    KinesisFirehoseConfig -> Text
firehoseArn :: Prelude.Text
  }
  deriving (KinesisFirehoseConfig -> KinesisFirehoseConfig -> Bool
(KinesisFirehoseConfig -> KinesisFirehoseConfig -> Bool)
-> (KinesisFirehoseConfig -> KinesisFirehoseConfig -> Bool)
-> Eq KinesisFirehoseConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisFirehoseConfig -> KinesisFirehoseConfig -> Bool
$c/= :: KinesisFirehoseConfig -> KinesisFirehoseConfig -> Bool
== :: KinesisFirehoseConfig -> KinesisFirehoseConfig -> Bool
$c== :: KinesisFirehoseConfig -> KinesisFirehoseConfig -> Bool
Prelude.Eq, ReadPrec [KinesisFirehoseConfig]
ReadPrec KinesisFirehoseConfig
Int -> ReadS KinesisFirehoseConfig
ReadS [KinesisFirehoseConfig]
(Int -> ReadS KinesisFirehoseConfig)
-> ReadS [KinesisFirehoseConfig]
-> ReadPrec KinesisFirehoseConfig
-> ReadPrec [KinesisFirehoseConfig]
-> Read KinesisFirehoseConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisFirehoseConfig]
$creadListPrec :: ReadPrec [KinesisFirehoseConfig]
readPrec :: ReadPrec KinesisFirehoseConfig
$creadPrec :: ReadPrec KinesisFirehoseConfig
readList :: ReadS [KinesisFirehoseConfig]
$creadList :: ReadS [KinesisFirehoseConfig]
readsPrec :: Int -> ReadS KinesisFirehoseConfig
$creadsPrec :: Int -> ReadS KinesisFirehoseConfig
Prelude.Read, Int -> KinesisFirehoseConfig -> ShowS
[KinesisFirehoseConfig] -> ShowS
KinesisFirehoseConfig -> String
(Int -> KinesisFirehoseConfig -> ShowS)
-> (KinesisFirehoseConfig -> String)
-> ([KinesisFirehoseConfig] -> ShowS)
-> Show KinesisFirehoseConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisFirehoseConfig] -> ShowS
$cshowList :: [KinesisFirehoseConfig] -> ShowS
show :: KinesisFirehoseConfig -> String
$cshow :: KinesisFirehoseConfig -> String
showsPrec :: Int -> KinesisFirehoseConfig -> ShowS
$cshowsPrec :: Int -> KinesisFirehoseConfig -> ShowS
Prelude.Show, (forall x. KinesisFirehoseConfig -> Rep KinesisFirehoseConfig x)
-> (forall x. Rep KinesisFirehoseConfig x -> KinesisFirehoseConfig)
-> Generic KinesisFirehoseConfig
forall x. Rep KinesisFirehoseConfig x -> KinesisFirehoseConfig
forall x. KinesisFirehoseConfig -> Rep KinesisFirehoseConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KinesisFirehoseConfig x -> KinesisFirehoseConfig
$cfrom :: forall x. KinesisFirehoseConfig -> Rep KinesisFirehoseConfig x
Prelude.Generic)

-- |
-- Create a value of 'KinesisFirehoseConfig' 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:
--
-- 'firehoseArn', 'kinesisFirehoseConfig_firehoseArn' - The Amazon Resource Name (ARN) of the delivery stream.
newKinesisFirehoseConfig ::
  -- | 'firehoseArn'
  Prelude.Text ->
  KinesisFirehoseConfig
newKinesisFirehoseConfig :: Text -> KinesisFirehoseConfig
newKinesisFirehoseConfig Text
pFirehoseArn_ =
  KinesisFirehoseConfig' :: Text -> KinesisFirehoseConfig
KinesisFirehoseConfig' {$sel:firehoseArn:KinesisFirehoseConfig' :: Text
firehoseArn = Text
pFirehoseArn_}

-- | The Amazon Resource Name (ARN) of the delivery stream.
kinesisFirehoseConfig_firehoseArn :: Lens.Lens' KinesisFirehoseConfig Prelude.Text
kinesisFirehoseConfig_firehoseArn :: (Text -> f Text)
-> KinesisFirehoseConfig -> f KinesisFirehoseConfig
kinesisFirehoseConfig_firehoseArn = (KinesisFirehoseConfig -> Text)
-> (KinesisFirehoseConfig -> Text -> KinesisFirehoseConfig)
-> Lens KinesisFirehoseConfig KinesisFirehoseConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisFirehoseConfig' {Text
firehoseArn :: Text
$sel:firehoseArn:KinesisFirehoseConfig' :: KinesisFirehoseConfig -> Text
firehoseArn} -> Text
firehoseArn) (\s :: KinesisFirehoseConfig
s@KinesisFirehoseConfig' {} Text
a -> KinesisFirehoseConfig
s {$sel:firehoseArn:KinesisFirehoseConfig' :: Text
firehoseArn = Text
a} :: KinesisFirehoseConfig)

instance Core.FromJSON KinesisFirehoseConfig where
  parseJSON :: Value -> Parser KinesisFirehoseConfig
parseJSON =
    String
-> (Object -> Parser KinesisFirehoseConfig)
-> Value
-> Parser KinesisFirehoseConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"KinesisFirehoseConfig"
      ( \Object
x ->
          Text -> KinesisFirehoseConfig
KinesisFirehoseConfig'
            (Text -> KinesisFirehoseConfig)
-> Parser Text -> Parser KinesisFirehoseConfig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"FirehoseArn")
      )

instance Prelude.Hashable KinesisFirehoseConfig

instance Prelude.NFData KinesisFirehoseConfig

instance Core.ToJSON KinesisFirehoseConfig where
  toJSON :: KinesisFirehoseConfig -> Value
toJSON KinesisFirehoseConfig' {Text
firehoseArn :: Text
$sel:firehoseArn:KinesisFirehoseConfig' :: KinesisFirehoseConfig -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FirehoseArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
firehoseArn)]
      )