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