{-# 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 #-}
module Amazonka.IVS.Types.StreamKey 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
data StreamKey = StreamKey'
{
StreamKey -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
StreamKey -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
StreamKey -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
StreamKey -> Maybe (Sensitive Text)
value :: Prelude.Maybe (Data.Sensitive Prelude.Text)
}
deriving (StreamKey -> StreamKey -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamKey -> StreamKey -> Bool
$c/= :: StreamKey -> StreamKey -> Bool
== :: StreamKey -> StreamKey -> Bool
$c== :: StreamKey -> StreamKey -> Bool
Prelude.Eq, Int -> StreamKey -> ShowS
[StreamKey] -> ShowS
StreamKey -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamKey] -> ShowS
$cshowList :: [StreamKey] -> ShowS
show :: StreamKey -> String
$cshow :: StreamKey -> String
showsPrec :: Int -> StreamKey -> ShowS
$cshowsPrec :: Int -> StreamKey -> ShowS
Prelude.Show, forall x. Rep StreamKey x -> StreamKey
forall x. StreamKey -> Rep StreamKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StreamKey x -> StreamKey
$cfrom :: forall x. StreamKey -> Rep StreamKey x
Prelude.Generic)
newStreamKey ::
StreamKey
newStreamKey :: StreamKey
newStreamKey =
StreamKey'
{ $sel:arn:StreamKey' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:StreamKey' :: Maybe Text
channelArn = forall a. Maybe a
Prelude.Nothing,
$sel:tags:StreamKey' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:value:StreamKey' :: Maybe (Sensitive Text)
value = forall a. Maybe a
Prelude.Nothing
}
streamKey_arn :: Lens.Lens' StreamKey (Prelude.Maybe Prelude.Text)
streamKey_arn :: Lens' StreamKey (Maybe Text)
streamKey_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamKey' {Maybe Text
arn :: Maybe Text
$sel:arn:StreamKey' :: StreamKey -> Maybe Text
arn} -> Maybe Text
arn) (\s :: StreamKey
s@StreamKey' {} Maybe Text
a -> StreamKey
s {$sel:arn:StreamKey' :: Maybe Text
arn = Maybe Text
a} :: StreamKey)
streamKey_channelArn :: Lens.Lens' StreamKey (Prelude.Maybe Prelude.Text)
streamKey_channelArn :: Lens' StreamKey (Maybe Text)
streamKey_channelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamKey' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:StreamKey' :: StreamKey -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: StreamKey
s@StreamKey' {} Maybe Text
a -> StreamKey
s {$sel:channelArn:StreamKey' :: Maybe Text
channelArn = Maybe Text
a} :: StreamKey)
streamKey_tags :: Lens.Lens' StreamKey (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
streamKey_tags :: Lens' StreamKey (Maybe (HashMap Text Text))
streamKey_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamKey' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:StreamKey' :: StreamKey -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: StreamKey
s@StreamKey' {} Maybe (HashMap Text Text)
a -> StreamKey
s {$sel:tags:StreamKey' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: StreamKey) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
streamKey_value :: Lens.Lens' StreamKey (Prelude.Maybe Prelude.Text)
streamKey_value :: Lens' StreamKey (Maybe Text)
streamKey_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamKey' {Maybe (Sensitive Text)
value :: Maybe (Sensitive Text)
$sel:value:StreamKey' :: StreamKey -> Maybe (Sensitive Text)
value} -> Maybe (Sensitive Text)
value) (\s :: StreamKey
s@StreamKey' {} Maybe (Sensitive Text)
a -> StreamKey
s {$sel:value:StreamKey' :: Maybe (Sensitive Text)
value = Maybe (Sensitive Text)
a} :: StreamKey) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Data.FromJSON StreamKey where
parseJSON :: Value -> Parser StreamKey
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StreamKey"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe (Sensitive Text)
-> StreamKey
StreamKey'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"channelArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"value")
)
instance Prelude.Hashable StreamKey where
hashWithSalt :: Int -> StreamKey -> Int
hashWithSalt Int
_salt StreamKey' {Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
value :: Maybe (Sensitive Text)
tags :: Maybe (HashMap Text Text)
channelArn :: Maybe Text
arn :: Maybe Text
$sel:value:StreamKey' :: StreamKey -> Maybe (Sensitive Text)
$sel:tags:StreamKey' :: StreamKey -> Maybe (HashMap Text Text)
$sel:channelArn:StreamKey' :: StreamKey -> Maybe Text
$sel:arn:StreamKey' :: StreamKey -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
channelArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
value
instance Prelude.NFData StreamKey where
rnf :: StreamKey -> ()
rnf StreamKey' {Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
value :: Maybe (Sensitive Text)
tags :: Maybe (HashMap Text Text)
channelArn :: Maybe Text
arn :: Maybe Text
$sel:value:StreamKey' :: StreamKey -> Maybe (Sensitive Text)
$sel:tags:StreamKey' :: StreamKey -> Maybe (HashMap Text Text)
$sel:channelArn:StreamKey' :: StreamKey -> Maybe Text
$sel:arn:StreamKey' :: StreamKey -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
channelArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
value