{-# 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.Firehose.Types.HttpEndpointCommonAttribute where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HttpEndpointCommonAttribute = HttpEndpointCommonAttribute'
{
HttpEndpointCommonAttribute -> Sensitive Text
attributeName :: Core.Sensitive Prelude.Text,
HttpEndpointCommonAttribute -> Sensitive Text
attributeValue :: Core.Sensitive Prelude.Text
}
deriving (HttpEndpointCommonAttribute -> HttpEndpointCommonAttribute -> Bool
(HttpEndpointCommonAttribute
-> HttpEndpointCommonAttribute -> Bool)
-> (HttpEndpointCommonAttribute
-> HttpEndpointCommonAttribute -> Bool)
-> Eq HttpEndpointCommonAttribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HttpEndpointCommonAttribute -> HttpEndpointCommonAttribute -> Bool
$c/= :: HttpEndpointCommonAttribute -> HttpEndpointCommonAttribute -> Bool
== :: HttpEndpointCommonAttribute -> HttpEndpointCommonAttribute -> Bool
$c== :: HttpEndpointCommonAttribute -> HttpEndpointCommonAttribute -> Bool
Prelude.Eq, Int -> HttpEndpointCommonAttribute -> ShowS
[HttpEndpointCommonAttribute] -> ShowS
HttpEndpointCommonAttribute -> String
(Int -> HttpEndpointCommonAttribute -> ShowS)
-> (HttpEndpointCommonAttribute -> String)
-> ([HttpEndpointCommonAttribute] -> ShowS)
-> Show HttpEndpointCommonAttribute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HttpEndpointCommonAttribute] -> ShowS
$cshowList :: [HttpEndpointCommonAttribute] -> ShowS
show :: HttpEndpointCommonAttribute -> String
$cshow :: HttpEndpointCommonAttribute -> String
showsPrec :: Int -> HttpEndpointCommonAttribute -> ShowS
$cshowsPrec :: Int -> HttpEndpointCommonAttribute -> ShowS
Prelude.Show, (forall x.
HttpEndpointCommonAttribute -> Rep HttpEndpointCommonAttribute x)
-> (forall x.
Rep HttpEndpointCommonAttribute x -> HttpEndpointCommonAttribute)
-> Generic HttpEndpointCommonAttribute
forall x.
Rep HttpEndpointCommonAttribute x -> HttpEndpointCommonAttribute
forall x.
HttpEndpointCommonAttribute -> Rep HttpEndpointCommonAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HttpEndpointCommonAttribute x -> HttpEndpointCommonAttribute
$cfrom :: forall x.
HttpEndpointCommonAttribute -> Rep HttpEndpointCommonAttribute x
Prelude.Generic)
newHttpEndpointCommonAttribute ::
Prelude.Text ->
Prelude.Text ->
HttpEndpointCommonAttribute
newHttpEndpointCommonAttribute :: Text -> Text -> HttpEndpointCommonAttribute
newHttpEndpointCommonAttribute
Text
pAttributeName_
Text
pAttributeValue_ =
HttpEndpointCommonAttribute' :: Sensitive Text -> Sensitive Text -> HttpEndpointCommonAttribute
HttpEndpointCommonAttribute'
{ $sel:attributeName:HttpEndpointCommonAttribute' :: Sensitive Text
attributeName =
Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pAttributeName_,
$sel:attributeValue:HttpEndpointCommonAttribute' :: Sensitive Text
attributeValue =
Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pAttributeValue_
}
httpEndpointCommonAttribute_attributeName :: Lens.Lens' HttpEndpointCommonAttribute Prelude.Text
httpEndpointCommonAttribute_attributeName :: (Text -> f Text)
-> HttpEndpointCommonAttribute -> f HttpEndpointCommonAttribute
httpEndpointCommonAttribute_attributeName = (HttpEndpointCommonAttribute -> Sensitive Text)
-> (HttpEndpointCommonAttribute
-> Sensitive Text -> HttpEndpointCommonAttribute)
-> Lens
HttpEndpointCommonAttribute
HttpEndpointCommonAttribute
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpEndpointCommonAttribute' {Sensitive Text
attributeName :: Sensitive Text
$sel:attributeName:HttpEndpointCommonAttribute' :: HttpEndpointCommonAttribute -> Sensitive Text
attributeName} -> Sensitive Text
attributeName) (\s :: HttpEndpointCommonAttribute
s@HttpEndpointCommonAttribute' {} Sensitive Text
a -> HttpEndpointCommonAttribute
s {$sel:attributeName:HttpEndpointCommonAttribute' :: Sensitive Text
attributeName = Sensitive Text
a} :: HttpEndpointCommonAttribute) ((Sensitive Text -> f (Sensitive Text))
-> HttpEndpointCommonAttribute -> f HttpEndpointCommonAttribute)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> HttpEndpointCommonAttribute
-> f HttpEndpointCommonAttribute
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
httpEndpointCommonAttribute_attributeValue :: Lens.Lens' HttpEndpointCommonAttribute Prelude.Text
httpEndpointCommonAttribute_attributeValue :: (Text -> f Text)
-> HttpEndpointCommonAttribute -> f HttpEndpointCommonAttribute
httpEndpointCommonAttribute_attributeValue = (HttpEndpointCommonAttribute -> Sensitive Text)
-> (HttpEndpointCommonAttribute
-> Sensitive Text -> HttpEndpointCommonAttribute)
-> Lens
HttpEndpointCommonAttribute
HttpEndpointCommonAttribute
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpEndpointCommonAttribute' {Sensitive Text
attributeValue :: Sensitive Text
$sel:attributeValue:HttpEndpointCommonAttribute' :: HttpEndpointCommonAttribute -> Sensitive Text
attributeValue} -> Sensitive Text
attributeValue) (\s :: HttpEndpointCommonAttribute
s@HttpEndpointCommonAttribute' {} Sensitive Text
a -> HttpEndpointCommonAttribute
s {$sel:attributeValue:HttpEndpointCommonAttribute' :: Sensitive Text
attributeValue = Sensitive Text
a} :: HttpEndpointCommonAttribute) ((Sensitive Text -> f (Sensitive Text))
-> HttpEndpointCommonAttribute -> f HttpEndpointCommonAttribute)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> HttpEndpointCommonAttribute
-> f HttpEndpointCommonAttribute
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Core.FromJSON HttpEndpointCommonAttribute where
parseJSON :: Value -> Parser HttpEndpointCommonAttribute
parseJSON =
String
-> (Object -> Parser HttpEndpointCommonAttribute)
-> Value
-> Parser HttpEndpointCommonAttribute
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HttpEndpointCommonAttribute"
( \Object
x ->
Sensitive Text -> Sensitive Text -> HttpEndpointCommonAttribute
HttpEndpointCommonAttribute'
(Sensitive Text -> Sensitive Text -> HttpEndpointCommonAttribute)
-> Parser (Sensitive Text)
-> Parser (Sensitive Text -> HttpEndpointCommonAttribute)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Sensitive Text)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AttributeName")
Parser (Sensitive Text -> HttpEndpointCommonAttribute)
-> Parser (Sensitive Text) -> Parser HttpEndpointCommonAttribute
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Sensitive Text)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AttributeValue")
)
instance Prelude.Hashable HttpEndpointCommonAttribute
instance Prelude.NFData HttpEndpointCommonAttribute
instance Core.ToJSON HttpEndpointCommonAttribute where
toJSON :: HttpEndpointCommonAttribute -> Value
toJSON HttpEndpointCommonAttribute' {Sensitive Text
attributeValue :: Sensitive Text
attributeName :: Sensitive Text
$sel:attributeValue:HttpEndpointCommonAttribute' :: HttpEndpointCommonAttribute -> Sensitive Text
$sel:attributeName:HttpEndpointCommonAttribute' :: HttpEndpointCommonAttribute -> Sensitive 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
"AttributeName" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
attributeName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AttributeValue" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
attributeValue)
]
)