{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Connect.Types.KinesisFirehoseConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$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 :: Lens' KinesisFirehoseConfig Text
kinesisFirehoseConfig_firehoseArn = 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 Data.FromJSON KinesisFirehoseConfig where
  parseJSON :: Value -> Parser KinesisFirehoseConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"KinesisFirehoseConfig"
      ( \Object
x ->
          Text -> KinesisFirehoseConfig
KinesisFirehoseConfig'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"FirehoseArn")
      )

instance Prelude.Hashable KinesisFirehoseConfig where
  hashWithSalt :: Int -> KinesisFirehoseConfig -> Int
hashWithSalt Int
_salt KinesisFirehoseConfig' {Text
firehoseArn :: Text
$sel:firehoseArn:KinesisFirehoseConfig' :: KinesisFirehoseConfig -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
firehoseArn

instance Prelude.NFData KinesisFirehoseConfig where
  rnf :: KinesisFirehoseConfig -> ()
rnf KinesisFirehoseConfig' {Text
firehoseArn :: Text
$sel:firehoseArn:KinesisFirehoseConfig' :: KinesisFirehoseConfig -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
firehoseArn

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