{-# 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.SecurityHub.Types.AwsIamInstanceProfileRole where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsIamInstanceProfileRole = AwsIamInstanceProfileRole'
{
AwsIamInstanceProfileRole -> Maybe Text
assumeRolePolicyDocument :: Prelude.Maybe Prelude.Text,
AwsIamInstanceProfileRole -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
AwsIamInstanceProfileRole -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
AwsIamInstanceProfileRole -> Maybe Text
createDate :: Prelude.Maybe Prelude.Text,
AwsIamInstanceProfileRole -> Maybe Text
roleName :: Prelude.Maybe Prelude.Text,
AwsIamInstanceProfileRole -> Maybe Text
roleId :: Prelude.Maybe Prelude.Text
}
deriving (AwsIamInstanceProfileRole -> AwsIamInstanceProfileRole -> Bool
(AwsIamInstanceProfileRole -> AwsIamInstanceProfileRole -> Bool)
-> (AwsIamInstanceProfileRole -> AwsIamInstanceProfileRole -> Bool)
-> Eq AwsIamInstanceProfileRole
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsIamInstanceProfileRole -> AwsIamInstanceProfileRole -> Bool
$c/= :: AwsIamInstanceProfileRole -> AwsIamInstanceProfileRole -> Bool
== :: AwsIamInstanceProfileRole -> AwsIamInstanceProfileRole -> Bool
$c== :: AwsIamInstanceProfileRole -> AwsIamInstanceProfileRole -> Bool
Prelude.Eq, ReadPrec [AwsIamInstanceProfileRole]
ReadPrec AwsIamInstanceProfileRole
Int -> ReadS AwsIamInstanceProfileRole
ReadS [AwsIamInstanceProfileRole]
(Int -> ReadS AwsIamInstanceProfileRole)
-> ReadS [AwsIamInstanceProfileRole]
-> ReadPrec AwsIamInstanceProfileRole
-> ReadPrec [AwsIamInstanceProfileRole]
-> Read AwsIamInstanceProfileRole
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsIamInstanceProfileRole]
$creadListPrec :: ReadPrec [AwsIamInstanceProfileRole]
readPrec :: ReadPrec AwsIamInstanceProfileRole
$creadPrec :: ReadPrec AwsIamInstanceProfileRole
readList :: ReadS [AwsIamInstanceProfileRole]
$creadList :: ReadS [AwsIamInstanceProfileRole]
readsPrec :: Int -> ReadS AwsIamInstanceProfileRole
$creadsPrec :: Int -> ReadS AwsIamInstanceProfileRole
Prelude.Read, Int -> AwsIamInstanceProfileRole -> ShowS
[AwsIamInstanceProfileRole] -> ShowS
AwsIamInstanceProfileRole -> String
(Int -> AwsIamInstanceProfileRole -> ShowS)
-> (AwsIamInstanceProfileRole -> String)
-> ([AwsIamInstanceProfileRole] -> ShowS)
-> Show AwsIamInstanceProfileRole
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsIamInstanceProfileRole] -> ShowS
$cshowList :: [AwsIamInstanceProfileRole] -> ShowS
show :: AwsIamInstanceProfileRole -> String
$cshow :: AwsIamInstanceProfileRole -> String
showsPrec :: Int -> AwsIamInstanceProfileRole -> ShowS
$cshowsPrec :: Int -> AwsIamInstanceProfileRole -> ShowS
Prelude.Show, (forall x.
AwsIamInstanceProfileRole -> Rep AwsIamInstanceProfileRole x)
-> (forall x.
Rep AwsIamInstanceProfileRole x -> AwsIamInstanceProfileRole)
-> Generic AwsIamInstanceProfileRole
forall x.
Rep AwsIamInstanceProfileRole x -> AwsIamInstanceProfileRole
forall x.
AwsIamInstanceProfileRole -> Rep AwsIamInstanceProfileRole x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsIamInstanceProfileRole x -> AwsIamInstanceProfileRole
$cfrom :: forall x.
AwsIamInstanceProfileRole -> Rep AwsIamInstanceProfileRole x
Prelude.Generic)
newAwsIamInstanceProfileRole ::
AwsIamInstanceProfileRole
newAwsIamInstanceProfileRole :: AwsIamInstanceProfileRole
newAwsIamInstanceProfileRole =
AwsIamInstanceProfileRole' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsIamInstanceProfileRole
AwsIamInstanceProfileRole'
{ $sel:assumeRolePolicyDocument:AwsIamInstanceProfileRole' :: Maybe Text
assumeRolePolicyDocument =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:AwsIamInstanceProfileRole' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:path:AwsIamInstanceProfileRole' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createDate:AwsIamInstanceProfileRole' :: Maybe Text
createDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleName:AwsIamInstanceProfileRole' :: Maybe Text
roleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleId:AwsIamInstanceProfileRole' :: Maybe Text
roleId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
awsIamInstanceProfileRole_assumeRolePolicyDocument :: Lens.Lens' AwsIamInstanceProfileRole (Prelude.Maybe Prelude.Text)
awsIamInstanceProfileRole_assumeRolePolicyDocument :: (Maybe Text -> f (Maybe Text))
-> AwsIamInstanceProfileRole -> f AwsIamInstanceProfileRole
awsIamInstanceProfileRole_assumeRolePolicyDocument = (AwsIamInstanceProfileRole -> Maybe Text)
-> (AwsIamInstanceProfileRole
-> Maybe Text -> AwsIamInstanceProfileRole)
-> Lens
AwsIamInstanceProfileRole
AwsIamInstanceProfileRole
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamInstanceProfileRole' {Maybe Text
assumeRolePolicyDocument :: Maybe Text
$sel:assumeRolePolicyDocument:AwsIamInstanceProfileRole' :: AwsIamInstanceProfileRole -> Maybe Text
assumeRolePolicyDocument} -> Maybe Text
assumeRolePolicyDocument) (\s :: AwsIamInstanceProfileRole
s@AwsIamInstanceProfileRole' {} Maybe Text
a -> AwsIamInstanceProfileRole
s {$sel:assumeRolePolicyDocument:AwsIamInstanceProfileRole' :: Maybe Text
assumeRolePolicyDocument = Maybe Text
a} :: AwsIamInstanceProfileRole)
awsIamInstanceProfileRole_arn :: Lens.Lens' AwsIamInstanceProfileRole (Prelude.Maybe Prelude.Text)
awsIamInstanceProfileRole_arn :: (Maybe Text -> f (Maybe Text))
-> AwsIamInstanceProfileRole -> f AwsIamInstanceProfileRole
awsIamInstanceProfileRole_arn = (AwsIamInstanceProfileRole -> Maybe Text)
-> (AwsIamInstanceProfileRole
-> Maybe Text -> AwsIamInstanceProfileRole)
-> Lens
AwsIamInstanceProfileRole
AwsIamInstanceProfileRole
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamInstanceProfileRole' {Maybe Text
arn :: Maybe Text
$sel:arn:AwsIamInstanceProfileRole' :: AwsIamInstanceProfileRole -> Maybe Text
arn} -> Maybe Text
arn) (\s :: AwsIamInstanceProfileRole
s@AwsIamInstanceProfileRole' {} Maybe Text
a -> AwsIamInstanceProfileRole
s {$sel:arn:AwsIamInstanceProfileRole' :: Maybe Text
arn = Maybe Text
a} :: AwsIamInstanceProfileRole)
awsIamInstanceProfileRole_path :: Lens.Lens' AwsIamInstanceProfileRole (Prelude.Maybe Prelude.Text)
awsIamInstanceProfileRole_path :: (Maybe Text -> f (Maybe Text))
-> AwsIamInstanceProfileRole -> f AwsIamInstanceProfileRole
awsIamInstanceProfileRole_path = (AwsIamInstanceProfileRole -> Maybe Text)
-> (AwsIamInstanceProfileRole
-> Maybe Text -> AwsIamInstanceProfileRole)
-> Lens
AwsIamInstanceProfileRole
AwsIamInstanceProfileRole
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamInstanceProfileRole' {Maybe Text
path :: Maybe Text
$sel:path:AwsIamInstanceProfileRole' :: AwsIamInstanceProfileRole -> Maybe Text
path} -> Maybe Text
path) (\s :: AwsIamInstanceProfileRole
s@AwsIamInstanceProfileRole' {} Maybe Text
a -> AwsIamInstanceProfileRole
s {$sel:path:AwsIamInstanceProfileRole' :: Maybe Text
path = Maybe Text
a} :: AwsIamInstanceProfileRole)
awsIamInstanceProfileRole_createDate :: Lens.Lens' AwsIamInstanceProfileRole (Prelude.Maybe Prelude.Text)
awsIamInstanceProfileRole_createDate :: (Maybe Text -> f (Maybe Text))
-> AwsIamInstanceProfileRole -> f AwsIamInstanceProfileRole
awsIamInstanceProfileRole_createDate = (AwsIamInstanceProfileRole -> Maybe Text)
-> (AwsIamInstanceProfileRole
-> Maybe Text -> AwsIamInstanceProfileRole)
-> Lens
AwsIamInstanceProfileRole
AwsIamInstanceProfileRole
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamInstanceProfileRole' {Maybe Text
createDate :: Maybe Text
$sel:createDate:AwsIamInstanceProfileRole' :: AwsIamInstanceProfileRole -> Maybe Text
createDate} -> Maybe Text
createDate) (\s :: AwsIamInstanceProfileRole
s@AwsIamInstanceProfileRole' {} Maybe Text
a -> AwsIamInstanceProfileRole
s {$sel:createDate:AwsIamInstanceProfileRole' :: Maybe Text
createDate = Maybe Text
a} :: AwsIamInstanceProfileRole)
awsIamInstanceProfileRole_roleName :: Lens.Lens' AwsIamInstanceProfileRole (Prelude.Maybe Prelude.Text)
awsIamInstanceProfileRole_roleName :: (Maybe Text -> f (Maybe Text))
-> AwsIamInstanceProfileRole -> f AwsIamInstanceProfileRole
awsIamInstanceProfileRole_roleName = (AwsIamInstanceProfileRole -> Maybe Text)
-> (AwsIamInstanceProfileRole
-> Maybe Text -> AwsIamInstanceProfileRole)
-> Lens
AwsIamInstanceProfileRole
AwsIamInstanceProfileRole
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamInstanceProfileRole' {Maybe Text
roleName :: Maybe Text
$sel:roleName:AwsIamInstanceProfileRole' :: AwsIamInstanceProfileRole -> Maybe Text
roleName} -> Maybe Text
roleName) (\s :: AwsIamInstanceProfileRole
s@AwsIamInstanceProfileRole' {} Maybe Text
a -> AwsIamInstanceProfileRole
s {$sel:roleName:AwsIamInstanceProfileRole' :: Maybe Text
roleName = Maybe Text
a} :: AwsIamInstanceProfileRole)
awsIamInstanceProfileRole_roleId :: Lens.Lens' AwsIamInstanceProfileRole (Prelude.Maybe Prelude.Text)
awsIamInstanceProfileRole_roleId :: (Maybe Text -> f (Maybe Text))
-> AwsIamInstanceProfileRole -> f AwsIamInstanceProfileRole
awsIamInstanceProfileRole_roleId = (AwsIamInstanceProfileRole -> Maybe Text)
-> (AwsIamInstanceProfileRole
-> Maybe Text -> AwsIamInstanceProfileRole)
-> Lens
AwsIamInstanceProfileRole
AwsIamInstanceProfileRole
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamInstanceProfileRole' {Maybe Text
roleId :: Maybe Text
$sel:roleId:AwsIamInstanceProfileRole' :: AwsIamInstanceProfileRole -> Maybe Text
roleId} -> Maybe Text
roleId) (\s :: AwsIamInstanceProfileRole
s@AwsIamInstanceProfileRole' {} Maybe Text
a -> AwsIamInstanceProfileRole
s {$sel:roleId:AwsIamInstanceProfileRole' :: Maybe Text
roleId = Maybe Text
a} :: AwsIamInstanceProfileRole)
instance Core.FromJSON AwsIamInstanceProfileRole where
parseJSON :: Value -> Parser AwsIamInstanceProfileRole
parseJSON =
String
-> (Object -> Parser AwsIamInstanceProfileRole)
-> Value
-> Parser AwsIamInstanceProfileRole
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsIamInstanceProfileRole"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsIamInstanceProfileRole
AwsIamInstanceProfileRole'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsIamInstanceProfileRole)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsIamInstanceProfileRole)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AssumeRolePolicyDocument")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsIamInstanceProfileRole)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsIamInstanceProfileRole)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsIamInstanceProfileRole)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> AwsIamInstanceProfileRole)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Path")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> AwsIamInstanceProfileRole)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AwsIamInstanceProfileRole)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreateDate")
Parser (Maybe Text -> Maybe Text -> AwsIamInstanceProfileRole)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsIamInstanceProfileRole)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RoleName")
Parser (Maybe Text -> AwsIamInstanceProfileRole)
-> Parser (Maybe Text) -> Parser AwsIamInstanceProfileRole
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RoleId")
)
instance Prelude.Hashable AwsIamInstanceProfileRole
instance Prelude.NFData AwsIamInstanceProfileRole
instance Core.ToJSON AwsIamInstanceProfileRole where
toJSON :: AwsIamInstanceProfileRole -> Value
toJSON AwsIamInstanceProfileRole' {Maybe Text
roleId :: Maybe Text
roleName :: Maybe Text
createDate :: Maybe Text
path :: Maybe Text
arn :: Maybe Text
assumeRolePolicyDocument :: Maybe Text
$sel:roleId:AwsIamInstanceProfileRole' :: AwsIamInstanceProfileRole -> Maybe Text
$sel:roleName:AwsIamInstanceProfileRole' :: AwsIamInstanceProfileRole -> Maybe Text
$sel:createDate:AwsIamInstanceProfileRole' :: AwsIamInstanceProfileRole -> Maybe Text
$sel:path:AwsIamInstanceProfileRole' :: AwsIamInstanceProfileRole -> Maybe Text
$sel:arn:AwsIamInstanceProfileRole' :: AwsIamInstanceProfileRole -> Maybe Text
$sel:assumeRolePolicyDocument:AwsIamInstanceProfileRole' :: AwsIamInstanceProfileRole -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AssumeRolePolicyDocument" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
assumeRolePolicyDocument,
(Text
"Arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
arn,
(Text
"Path" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
path,
(Text
"CreateDate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
createDate,
(Text
"RoleName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
roleName,
(Text
"RoleId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
roleId
]
)