{-# 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.IAM.Types.InstanceProfile where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types.Role
import Amazonka.IAM.Types.Tag
import qualified Amazonka.Prelude as Prelude
data InstanceProfile = InstanceProfile'
{
InstanceProfile -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
InstanceProfile -> Text
path :: Prelude.Text,
InstanceProfile -> Text
instanceProfileName :: Prelude.Text,
InstanceProfile -> Text
instanceProfileId :: Prelude.Text,
InstanceProfile -> Text
arn :: Prelude.Text,
InstanceProfile -> ISO8601
createDate :: Data.ISO8601,
InstanceProfile -> [Role]
roles :: [Role]
}
deriving (InstanceProfile -> InstanceProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceProfile -> InstanceProfile -> Bool
$c/= :: InstanceProfile -> InstanceProfile -> Bool
== :: InstanceProfile -> InstanceProfile -> Bool
$c== :: InstanceProfile -> InstanceProfile -> Bool
Prelude.Eq, ReadPrec [InstanceProfile]
ReadPrec InstanceProfile
Int -> ReadS InstanceProfile
ReadS [InstanceProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceProfile]
$creadListPrec :: ReadPrec [InstanceProfile]
readPrec :: ReadPrec InstanceProfile
$creadPrec :: ReadPrec InstanceProfile
readList :: ReadS [InstanceProfile]
$creadList :: ReadS [InstanceProfile]
readsPrec :: Int -> ReadS InstanceProfile
$creadsPrec :: Int -> ReadS InstanceProfile
Prelude.Read, Int -> InstanceProfile -> ShowS
[InstanceProfile] -> ShowS
InstanceProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceProfile] -> ShowS
$cshowList :: [InstanceProfile] -> ShowS
show :: InstanceProfile -> String
$cshow :: InstanceProfile -> String
showsPrec :: Int -> InstanceProfile -> ShowS
$cshowsPrec :: Int -> InstanceProfile -> ShowS
Prelude.Show, forall x. Rep InstanceProfile x -> InstanceProfile
forall x. InstanceProfile -> Rep InstanceProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceProfile x -> InstanceProfile
$cfrom :: forall x. InstanceProfile -> Rep InstanceProfile x
Prelude.Generic)
newInstanceProfile ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
InstanceProfile
newInstanceProfile :: Text -> Text -> Text -> Text -> UTCTime -> InstanceProfile
newInstanceProfile
Text
pPath_
Text
pInstanceProfileName_
Text
pInstanceProfileId_
Text
pArn_
UTCTime
pCreateDate_ =
InstanceProfile'
{ $sel:tags:InstanceProfile' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:path:InstanceProfile' :: Text
path = Text
pPath_,
$sel:instanceProfileName:InstanceProfile' :: Text
instanceProfileName = Text
pInstanceProfileName_,
$sel:instanceProfileId:InstanceProfile' :: Text
instanceProfileId = Text
pInstanceProfileId_,
$sel:arn:InstanceProfile' :: Text
arn = Text
pArn_,
$sel:createDate:InstanceProfile' :: ISO8601
createDate = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreateDate_,
$sel:roles:InstanceProfile' :: [Role]
roles = forall a. Monoid a => a
Prelude.mempty
}
instanceProfile_tags :: Lens.Lens' InstanceProfile (Prelude.Maybe [Tag])
instanceProfile_tags :: Lens' InstanceProfile (Maybe [Tag])
instanceProfile_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:InstanceProfile' :: InstanceProfile -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: InstanceProfile
s@InstanceProfile' {} Maybe [Tag]
a -> InstanceProfile
s {$sel:tags:InstanceProfile' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: InstanceProfile) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instanceProfile_path :: Lens.Lens' InstanceProfile Prelude.Text
instanceProfile_path :: Lens' InstanceProfile Text
instanceProfile_path = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {Text
path :: Text
$sel:path:InstanceProfile' :: InstanceProfile -> Text
path} -> Text
path) (\s :: InstanceProfile
s@InstanceProfile' {} Text
a -> InstanceProfile
s {$sel:path:InstanceProfile' :: Text
path = Text
a} :: InstanceProfile)
instanceProfile_instanceProfileName :: Lens.Lens' InstanceProfile Prelude.Text
instanceProfile_instanceProfileName :: Lens' InstanceProfile Text
instanceProfile_instanceProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {Text
instanceProfileName :: Text
$sel:instanceProfileName:InstanceProfile' :: InstanceProfile -> Text
instanceProfileName} -> Text
instanceProfileName) (\s :: InstanceProfile
s@InstanceProfile' {} Text
a -> InstanceProfile
s {$sel:instanceProfileName:InstanceProfile' :: Text
instanceProfileName = Text
a} :: InstanceProfile)
instanceProfile_instanceProfileId :: Lens.Lens' InstanceProfile Prelude.Text
instanceProfile_instanceProfileId :: Lens' InstanceProfile Text
instanceProfile_instanceProfileId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {Text
instanceProfileId :: Text
$sel:instanceProfileId:InstanceProfile' :: InstanceProfile -> Text
instanceProfileId} -> Text
instanceProfileId) (\s :: InstanceProfile
s@InstanceProfile' {} Text
a -> InstanceProfile
s {$sel:instanceProfileId:InstanceProfile' :: Text
instanceProfileId = Text
a} :: InstanceProfile)
instanceProfile_arn :: Lens.Lens' InstanceProfile Prelude.Text
instanceProfile_arn :: Lens' InstanceProfile Text
instanceProfile_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {Text
arn :: Text
$sel:arn:InstanceProfile' :: InstanceProfile -> Text
arn} -> Text
arn) (\s :: InstanceProfile
s@InstanceProfile' {} Text
a -> InstanceProfile
s {$sel:arn:InstanceProfile' :: Text
arn = Text
a} :: InstanceProfile)
instanceProfile_createDate :: Lens.Lens' InstanceProfile Prelude.UTCTime
instanceProfile_createDate :: Lens' InstanceProfile UTCTime
instanceProfile_createDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {ISO8601
createDate :: ISO8601
$sel:createDate:InstanceProfile' :: InstanceProfile -> ISO8601
createDate} -> ISO8601
createDate) (\s :: InstanceProfile
s@InstanceProfile' {} ISO8601
a -> InstanceProfile
s {$sel:createDate:InstanceProfile' :: ISO8601
createDate = ISO8601
a} :: InstanceProfile) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instanceProfile_roles :: Lens.Lens' InstanceProfile [Role]
instanceProfile_roles :: Lens' InstanceProfile [Role]
instanceProfile_roles = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {[Role]
roles :: [Role]
$sel:roles:InstanceProfile' :: InstanceProfile -> [Role]
roles} -> [Role]
roles) (\s :: InstanceProfile
s@InstanceProfile' {} [Role]
a -> InstanceProfile
s {$sel:roles:InstanceProfile' :: [Role]
roles = [Role]
a} :: InstanceProfile) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromXML InstanceProfile where
parseXML :: [Node] -> Either String InstanceProfile
parseXML [Node]
x =
Maybe [Tag]
-> Text
-> Text
-> Text
-> Text
-> ISO8601
-> [Role]
-> InstanceProfile
InstanceProfile'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Tags"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Path")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"InstanceProfileName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"InstanceProfileId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"CreateDate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Roles"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member"
)
instance Prelude.Hashable InstanceProfile where
hashWithSalt :: Int -> InstanceProfile -> Int
hashWithSalt Int
_salt InstanceProfile' {[Role]
Maybe [Tag]
Text
ISO8601
roles :: [Role]
createDate :: ISO8601
arn :: Text
instanceProfileId :: Text
instanceProfileName :: Text
path :: Text
tags :: Maybe [Tag]
$sel:roles:InstanceProfile' :: InstanceProfile -> [Role]
$sel:createDate:InstanceProfile' :: InstanceProfile -> ISO8601
$sel:arn:InstanceProfile' :: InstanceProfile -> Text
$sel:instanceProfileId:InstanceProfile' :: InstanceProfile -> Text
$sel:instanceProfileName:InstanceProfile' :: InstanceProfile -> Text
$sel:path:InstanceProfile' :: InstanceProfile -> Text
$sel:tags:InstanceProfile' :: InstanceProfile -> Maybe [Tag]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
path
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceProfileName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceProfileId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
createDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Role]
roles
instance Prelude.NFData InstanceProfile where
rnf :: InstanceProfile -> ()
rnf InstanceProfile' {[Role]
Maybe [Tag]
Text
ISO8601
roles :: [Role]
createDate :: ISO8601
arn :: Text
instanceProfileId :: Text
instanceProfileName :: Text
path :: Text
tags :: Maybe [Tag]
$sel:roles:InstanceProfile' :: InstanceProfile -> [Role]
$sel:createDate:InstanceProfile' :: InstanceProfile -> ISO8601
$sel:arn:InstanceProfile' :: InstanceProfile -> Text
$sel:instanceProfileId:InstanceProfile' :: InstanceProfile -> Text
$sel:instanceProfileName:InstanceProfile' :: InstanceProfile -> Text
$sel:path:InstanceProfile' :: InstanceProfile -> Text
$sel:tags:InstanceProfile' :: InstanceProfile -> Maybe [Tag]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
path
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceProfileName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceProfileId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
createDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Role]
roles