{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.IAM.CreateInstanceProfile
(
CreateInstanceProfile (..),
newCreateInstanceProfile,
createInstanceProfile_path,
createInstanceProfile_tags,
createInstanceProfile_instanceProfileName,
CreateInstanceProfileResponse (..),
newCreateInstanceProfileResponse,
createInstanceProfileResponse_httpStatus,
createInstanceProfileResponse_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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateInstanceProfile = CreateInstanceProfile'
{
CreateInstanceProfile -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
CreateInstanceProfile -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateInstanceProfile -> Text
instanceProfileName :: Prelude.Text
}
deriving (CreateInstanceProfile -> CreateInstanceProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInstanceProfile -> CreateInstanceProfile -> Bool
$c/= :: CreateInstanceProfile -> CreateInstanceProfile -> Bool
== :: CreateInstanceProfile -> CreateInstanceProfile -> Bool
$c== :: CreateInstanceProfile -> CreateInstanceProfile -> Bool
Prelude.Eq, ReadPrec [CreateInstanceProfile]
ReadPrec CreateInstanceProfile
Int -> ReadS CreateInstanceProfile
ReadS [CreateInstanceProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateInstanceProfile]
$creadListPrec :: ReadPrec [CreateInstanceProfile]
readPrec :: ReadPrec CreateInstanceProfile
$creadPrec :: ReadPrec CreateInstanceProfile
readList :: ReadS [CreateInstanceProfile]
$creadList :: ReadS [CreateInstanceProfile]
readsPrec :: Int -> ReadS CreateInstanceProfile
$creadsPrec :: Int -> ReadS CreateInstanceProfile
Prelude.Read, Int -> CreateInstanceProfile -> ShowS
[CreateInstanceProfile] -> ShowS
CreateInstanceProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInstanceProfile] -> ShowS
$cshowList :: [CreateInstanceProfile] -> ShowS
show :: CreateInstanceProfile -> String
$cshow :: CreateInstanceProfile -> String
showsPrec :: Int -> CreateInstanceProfile -> ShowS
$cshowsPrec :: Int -> CreateInstanceProfile -> ShowS
Prelude.Show, forall x. Rep CreateInstanceProfile x -> CreateInstanceProfile
forall x. CreateInstanceProfile -> Rep CreateInstanceProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateInstanceProfile x -> CreateInstanceProfile
$cfrom :: forall x. CreateInstanceProfile -> Rep CreateInstanceProfile x
Prelude.Generic)
newCreateInstanceProfile ::
Prelude.Text ->
CreateInstanceProfile
newCreateInstanceProfile :: Text -> CreateInstanceProfile
newCreateInstanceProfile Text
pInstanceProfileName_ =
CreateInstanceProfile'
{ $sel:path:CreateInstanceProfile' :: Maybe Text
path = forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateInstanceProfile' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:instanceProfileName:CreateInstanceProfile' :: Text
instanceProfileName = Text
pInstanceProfileName_
}
createInstanceProfile_path :: Lens.Lens' CreateInstanceProfile (Prelude.Maybe Prelude.Text)
createInstanceProfile_path :: Lens' CreateInstanceProfile (Maybe Text)
createInstanceProfile_path = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceProfile' {Maybe Text
path :: Maybe Text
$sel:path:CreateInstanceProfile' :: CreateInstanceProfile -> Maybe Text
path} -> Maybe Text
path) (\s :: CreateInstanceProfile
s@CreateInstanceProfile' {} Maybe Text
a -> CreateInstanceProfile
s {$sel:path:CreateInstanceProfile' :: Maybe Text
path = Maybe Text
a} :: CreateInstanceProfile)
createInstanceProfile_tags :: Lens.Lens' CreateInstanceProfile (Prelude.Maybe [Tag])
createInstanceProfile_tags :: Lens' CreateInstanceProfile (Maybe [Tag])
createInstanceProfile_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceProfile' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateInstanceProfile' :: CreateInstanceProfile -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateInstanceProfile
s@CreateInstanceProfile' {} Maybe [Tag]
a -> CreateInstanceProfile
s {$sel:tags:CreateInstanceProfile' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateInstanceProfile) 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
createInstanceProfile_instanceProfileName :: Lens.Lens' CreateInstanceProfile Prelude.Text
createInstanceProfile_instanceProfileName :: Lens' CreateInstanceProfile Text
createInstanceProfile_instanceProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceProfile' {Text
instanceProfileName :: Text
$sel:instanceProfileName:CreateInstanceProfile' :: CreateInstanceProfile -> Text
instanceProfileName} -> Text
instanceProfileName) (\s :: CreateInstanceProfile
s@CreateInstanceProfile' {} Text
a -> CreateInstanceProfile
s {$sel:instanceProfileName:CreateInstanceProfile' :: Text
instanceProfileName = Text
a} :: CreateInstanceProfile)
instance Core.AWSRequest CreateInstanceProfile where
type
AWSResponse CreateInstanceProfile =
CreateInstanceProfileResponse
request :: (Service -> Service)
-> CreateInstanceProfile -> Request CreateInstanceProfile
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateInstanceProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateInstanceProfile)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"CreateInstanceProfileResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> InstanceProfile -> CreateInstanceProfileResponse
CreateInstanceProfileResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
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
"InstanceProfile")
)
instance Prelude.Hashable CreateInstanceProfile where
hashWithSalt :: Int -> CreateInstanceProfile -> Int
hashWithSalt Int
_salt CreateInstanceProfile' {Maybe [Tag]
Maybe Text
Text
instanceProfileName :: Text
tags :: Maybe [Tag]
path :: Maybe Text
$sel:instanceProfileName:CreateInstanceProfile' :: CreateInstanceProfile -> Text
$sel:tags:CreateInstanceProfile' :: CreateInstanceProfile -> Maybe [Tag]
$sel:path:CreateInstanceProfile' :: CreateInstanceProfile -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
path
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceProfileName
instance Prelude.NFData CreateInstanceProfile where
rnf :: CreateInstanceProfile -> ()
rnf CreateInstanceProfile' {Maybe [Tag]
Maybe Text
Text
instanceProfileName :: Text
tags :: Maybe [Tag]
path :: Maybe Text
$sel:instanceProfileName:CreateInstanceProfile' :: CreateInstanceProfile -> Text
$sel:tags:CreateInstanceProfile' :: CreateInstanceProfile -> Maybe [Tag]
$sel:path:CreateInstanceProfile' :: CreateInstanceProfile -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
path
seq :: forall a b. a -> b -> b
`Prelude.seq` 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
instanceProfileName
instance Data.ToHeaders CreateInstanceProfile where
toHeaders :: CreateInstanceProfile -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath CreateInstanceProfile where
toPath :: CreateInstanceProfile -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateInstanceProfile where
toQuery :: CreateInstanceProfile -> QueryString
toQuery CreateInstanceProfile' {Maybe [Tag]
Maybe Text
Text
instanceProfileName :: Text
tags :: Maybe [Tag]
path :: Maybe Text
$sel:instanceProfileName:CreateInstanceProfile' :: CreateInstanceProfile -> Text
$sel:tags:CreateInstanceProfile' :: CreateInstanceProfile -> Maybe [Tag]
$sel:path:CreateInstanceProfile' :: CreateInstanceProfile -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateInstanceProfile" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"Path" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
path,
ByteString
"Tags"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
(forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
ByteString
"InstanceProfileName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
instanceProfileName
]
data CreateInstanceProfileResponse = CreateInstanceProfileResponse'
{
CreateInstanceProfileResponse -> Int
httpStatus :: Prelude.Int,
CreateInstanceProfileResponse -> InstanceProfile
instanceProfile :: InstanceProfile
}
deriving (CreateInstanceProfileResponse
-> CreateInstanceProfileResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInstanceProfileResponse
-> CreateInstanceProfileResponse -> Bool
$c/= :: CreateInstanceProfileResponse
-> CreateInstanceProfileResponse -> Bool
== :: CreateInstanceProfileResponse
-> CreateInstanceProfileResponse -> Bool
$c== :: CreateInstanceProfileResponse
-> CreateInstanceProfileResponse -> Bool
Prelude.Eq, ReadPrec [CreateInstanceProfileResponse]
ReadPrec CreateInstanceProfileResponse
Int -> ReadS CreateInstanceProfileResponse
ReadS [CreateInstanceProfileResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateInstanceProfileResponse]
$creadListPrec :: ReadPrec [CreateInstanceProfileResponse]
readPrec :: ReadPrec CreateInstanceProfileResponse
$creadPrec :: ReadPrec CreateInstanceProfileResponse
readList :: ReadS [CreateInstanceProfileResponse]
$creadList :: ReadS [CreateInstanceProfileResponse]
readsPrec :: Int -> ReadS CreateInstanceProfileResponse
$creadsPrec :: Int -> ReadS CreateInstanceProfileResponse
Prelude.Read, Int -> CreateInstanceProfileResponse -> ShowS
[CreateInstanceProfileResponse] -> ShowS
CreateInstanceProfileResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInstanceProfileResponse] -> ShowS
$cshowList :: [CreateInstanceProfileResponse] -> ShowS
show :: CreateInstanceProfileResponse -> String
$cshow :: CreateInstanceProfileResponse -> String
showsPrec :: Int -> CreateInstanceProfileResponse -> ShowS
$cshowsPrec :: Int -> CreateInstanceProfileResponse -> ShowS
Prelude.Show, forall x.
Rep CreateInstanceProfileResponse x
-> CreateInstanceProfileResponse
forall x.
CreateInstanceProfileResponse
-> Rep CreateInstanceProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateInstanceProfileResponse x
-> CreateInstanceProfileResponse
$cfrom :: forall x.
CreateInstanceProfileResponse
-> Rep CreateInstanceProfileResponse x
Prelude.Generic)
newCreateInstanceProfileResponse ::
Prelude.Int ->
InstanceProfile ->
CreateInstanceProfileResponse
newCreateInstanceProfileResponse :: Int -> InstanceProfile -> CreateInstanceProfileResponse
newCreateInstanceProfileResponse
Int
pHttpStatus_
InstanceProfile
pInstanceProfile_ =
CreateInstanceProfileResponse'
{ $sel:httpStatus:CreateInstanceProfileResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:instanceProfile:CreateInstanceProfileResponse' :: InstanceProfile
instanceProfile = InstanceProfile
pInstanceProfile_
}
createInstanceProfileResponse_httpStatus :: Lens.Lens' CreateInstanceProfileResponse Prelude.Int
createInstanceProfileResponse_httpStatus :: Lens' CreateInstanceProfileResponse Int
createInstanceProfileResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateInstanceProfileResponse' :: CreateInstanceProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateInstanceProfileResponse
s@CreateInstanceProfileResponse' {} Int
a -> CreateInstanceProfileResponse
s {$sel:httpStatus:CreateInstanceProfileResponse' :: Int
httpStatus = Int
a} :: CreateInstanceProfileResponse)
createInstanceProfileResponse_instanceProfile :: Lens.Lens' CreateInstanceProfileResponse InstanceProfile
createInstanceProfileResponse_instanceProfile :: Lens' CreateInstanceProfileResponse InstanceProfile
createInstanceProfileResponse_instanceProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceProfileResponse' {InstanceProfile
instanceProfile :: InstanceProfile
$sel:instanceProfile:CreateInstanceProfileResponse' :: CreateInstanceProfileResponse -> InstanceProfile
instanceProfile} -> InstanceProfile
instanceProfile) (\s :: CreateInstanceProfileResponse
s@CreateInstanceProfileResponse' {} InstanceProfile
a -> CreateInstanceProfileResponse
s {$sel:instanceProfile:CreateInstanceProfileResponse' :: InstanceProfile
instanceProfile = InstanceProfile
a} :: CreateInstanceProfileResponse)
instance Prelude.NFData CreateInstanceProfileResponse where
rnf :: CreateInstanceProfileResponse -> ()
rnf CreateInstanceProfileResponse' {Int
InstanceProfile
instanceProfile :: InstanceProfile
httpStatus :: Int
$sel:instanceProfile:CreateInstanceProfileResponse' :: CreateInstanceProfileResponse -> InstanceProfile
$sel:httpStatus:CreateInstanceProfileResponse' :: CreateInstanceProfileResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf InstanceProfile
instanceProfile