{-# 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.AppMesh.Types.AwsCloudMapInstanceAttribute where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsCloudMapInstanceAttribute = AwsCloudMapInstanceAttribute'
{
AwsCloudMapInstanceAttribute -> Text
key :: Prelude.Text,
AwsCloudMapInstanceAttribute -> Text
value :: Prelude.Text
}
deriving (AwsCloudMapInstanceAttribute
-> AwsCloudMapInstanceAttribute -> Bool
(AwsCloudMapInstanceAttribute
-> AwsCloudMapInstanceAttribute -> Bool)
-> (AwsCloudMapInstanceAttribute
-> AwsCloudMapInstanceAttribute -> Bool)
-> Eq AwsCloudMapInstanceAttribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsCloudMapInstanceAttribute
-> AwsCloudMapInstanceAttribute -> Bool
$c/= :: AwsCloudMapInstanceAttribute
-> AwsCloudMapInstanceAttribute -> Bool
== :: AwsCloudMapInstanceAttribute
-> AwsCloudMapInstanceAttribute -> Bool
$c== :: AwsCloudMapInstanceAttribute
-> AwsCloudMapInstanceAttribute -> Bool
Prelude.Eq, ReadPrec [AwsCloudMapInstanceAttribute]
ReadPrec AwsCloudMapInstanceAttribute
Int -> ReadS AwsCloudMapInstanceAttribute
ReadS [AwsCloudMapInstanceAttribute]
(Int -> ReadS AwsCloudMapInstanceAttribute)
-> ReadS [AwsCloudMapInstanceAttribute]
-> ReadPrec AwsCloudMapInstanceAttribute
-> ReadPrec [AwsCloudMapInstanceAttribute]
-> Read AwsCloudMapInstanceAttribute
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsCloudMapInstanceAttribute]
$creadListPrec :: ReadPrec [AwsCloudMapInstanceAttribute]
readPrec :: ReadPrec AwsCloudMapInstanceAttribute
$creadPrec :: ReadPrec AwsCloudMapInstanceAttribute
readList :: ReadS [AwsCloudMapInstanceAttribute]
$creadList :: ReadS [AwsCloudMapInstanceAttribute]
readsPrec :: Int -> ReadS AwsCloudMapInstanceAttribute
$creadsPrec :: Int -> ReadS AwsCloudMapInstanceAttribute
Prelude.Read, Int -> AwsCloudMapInstanceAttribute -> ShowS
[AwsCloudMapInstanceAttribute] -> ShowS
AwsCloudMapInstanceAttribute -> String
(Int -> AwsCloudMapInstanceAttribute -> ShowS)
-> (AwsCloudMapInstanceAttribute -> String)
-> ([AwsCloudMapInstanceAttribute] -> ShowS)
-> Show AwsCloudMapInstanceAttribute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsCloudMapInstanceAttribute] -> ShowS
$cshowList :: [AwsCloudMapInstanceAttribute] -> ShowS
show :: AwsCloudMapInstanceAttribute -> String
$cshow :: AwsCloudMapInstanceAttribute -> String
showsPrec :: Int -> AwsCloudMapInstanceAttribute -> ShowS
$cshowsPrec :: Int -> AwsCloudMapInstanceAttribute -> ShowS
Prelude.Show, (forall x.
AwsCloudMapInstanceAttribute -> Rep AwsCloudMapInstanceAttribute x)
-> (forall x.
Rep AwsCloudMapInstanceAttribute x -> AwsCloudMapInstanceAttribute)
-> Generic AwsCloudMapInstanceAttribute
forall x.
Rep AwsCloudMapInstanceAttribute x -> AwsCloudMapInstanceAttribute
forall x.
AwsCloudMapInstanceAttribute -> Rep AwsCloudMapInstanceAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsCloudMapInstanceAttribute x -> AwsCloudMapInstanceAttribute
$cfrom :: forall x.
AwsCloudMapInstanceAttribute -> Rep AwsCloudMapInstanceAttribute x
Prelude.Generic)
newAwsCloudMapInstanceAttribute ::
Prelude.Text ->
Prelude.Text ->
AwsCloudMapInstanceAttribute
newAwsCloudMapInstanceAttribute :: Text -> Text -> AwsCloudMapInstanceAttribute
newAwsCloudMapInstanceAttribute Text
pKey_ Text
pValue_ =
AwsCloudMapInstanceAttribute' :: Text -> Text -> AwsCloudMapInstanceAttribute
AwsCloudMapInstanceAttribute'
{ $sel:key:AwsCloudMapInstanceAttribute' :: Text
key = Text
pKey_,
$sel:value:AwsCloudMapInstanceAttribute' :: Text
value = Text
pValue_
}
awsCloudMapInstanceAttribute_key :: Lens.Lens' AwsCloudMapInstanceAttribute Prelude.Text
awsCloudMapInstanceAttribute_key :: (Text -> f Text)
-> AwsCloudMapInstanceAttribute -> f AwsCloudMapInstanceAttribute
awsCloudMapInstanceAttribute_key = (AwsCloudMapInstanceAttribute -> Text)
-> (AwsCloudMapInstanceAttribute
-> Text -> AwsCloudMapInstanceAttribute)
-> Lens
AwsCloudMapInstanceAttribute AwsCloudMapInstanceAttribute Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudMapInstanceAttribute' {Text
key :: Text
$sel:key:AwsCloudMapInstanceAttribute' :: AwsCloudMapInstanceAttribute -> Text
key} -> Text
key) (\s :: AwsCloudMapInstanceAttribute
s@AwsCloudMapInstanceAttribute' {} Text
a -> AwsCloudMapInstanceAttribute
s {$sel:key:AwsCloudMapInstanceAttribute' :: Text
key = Text
a} :: AwsCloudMapInstanceAttribute)
awsCloudMapInstanceAttribute_value :: Lens.Lens' AwsCloudMapInstanceAttribute Prelude.Text
awsCloudMapInstanceAttribute_value :: (Text -> f Text)
-> AwsCloudMapInstanceAttribute -> f AwsCloudMapInstanceAttribute
awsCloudMapInstanceAttribute_value = (AwsCloudMapInstanceAttribute -> Text)
-> (AwsCloudMapInstanceAttribute
-> Text -> AwsCloudMapInstanceAttribute)
-> Lens
AwsCloudMapInstanceAttribute AwsCloudMapInstanceAttribute Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudMapInstanceAttribute' {Text
value :: Text
$sel:value:AwsCloudMapInstanceAttribute' :: AwsCloudMapInstanceAttribute -> Text
value} -> Text
value) (\s :: AwsCloudMapInstanceAttribute
s@AwsCloudMapInstanceAttribute' {} Text
a -> AwsCloudMapInstanceAttribute
s {$sel:value:AwsCloudMapInstanceAttribute' :: Text
value = Text
a} :: AwsCloudMapInstanceAttribute)
instance Core.FromJSON AwsCloudMapInstanceAttribute where
parseJSON :: Value -> Parser AwsCloudMapInstanceAttribute
parseJSON =
String
-> (Object -> Parser AwsCloudMapInstanceAttribute)
-> Value
-> Parser AwsCloudMapInstanceAttribute
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsCloudMapInstanceAttribute"
( \Object
x ->
Text -> Text -> AwsCloudMapInstanceAttribute
AwsCloudMapInstanceAttribute'
(Text -> Text -> AwsCloudMapInstanceAttribute)
-> Parser Text -> Parser (Text -> AwsCloudMapInstanceAttribute)
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
"key") Parser (Text -> AwsCloudMapInstanceAttribute)
-> Parser Text -> Parser AwsCloudMapInstanceAttribute
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"value")
)
instance
Prelude.Hashable
AwsCloudMapInstanceAttribute
instance Prelude.NFData AwsCloudMapInstanceAttribute
instance Core.ToJSON AwsCloudMapInstanceAttribute where
toJSON :: AwsCloudMapInstanceAttribute -> Value
toJSON AwsCloudMapInstanceAttribute' {Text
value :: Text
key :: Text
$sel:value:AwsCloudMapInstanceAttribute' :: AwsCloudMapInstanceAttribute -> Text
$sel:key:AwsCloudMapInstanceAttribute' :: AwsCloudMapInstanceAttribute -> 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
"key" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
key),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"value" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
value)
]
)