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