{-# 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.CreateVirtualMFADevice
(
CreateVirtualMFADevice (..),
newCreateVirtualMFADevice,
createVirtualMFADevice_path,
createVirtualMFADevice_tags,
createVirtualMFADevice_virtualMFADeviceName,
CreateVirtualMFADeviceResponse (..),
newCreateVirtualMFADeviceResponse,
createVirtualMFADeviceResponse_httpStatus,
createVirtualMFADeviceResponse_virtualMFADevice,
)
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 CreateVirtualMFADevice = CreateVirtualMFADevice'
{
CreateVirtualMFADevice -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
CreateVirtualMFADevice -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateVirtualMFADevice -> Text
virtualMFADeviceName :: Prelude.Text
}
deriving (CreateVirtualMFADevice -> CreateVirtualMFADevice -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVirtualMFADevice -> CreateVirtualMFADevice -> Bool
$c/= :: CreateVirtualMFADevice -> CreateVirtualMFADevice -> Bool
== :: CreateVirtualMFADevice -> CreateVirtualMFADevice -> Bool
$c== :: CreateVirtualMFADevice -> CreateVirtualMFADevice -> Bool
Prelude.Eq, ReadPrec [CreateVirtualMFADevice]
ReadPrec CreateVirtualMFADevice
Int -> ReadS CreateVirtualMFADevice
ReadS [CreateVirtualMFADevice]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVirtualMFADevice]
$creadListPrec :: ReadPrec [CreateVirtualMFADevice]
readPrec :: ReadPrec CreateVirtualMFADevice
$creadPrec :: ReadPrec CreateVirtualMFADevice
readList :: ReadS [CreateVirtualMFADevice]
$creadList :: ReadS [CreateVirtualMFADevice]
readsPrec :: Int -> ReadS CreateVirtualMFADevice
$creadsPrec :: Int -> ReadS CreateVirtualMFADevice
Prelude.Read, Int -> CreateVirtualMFADevice -> ShowS
[CreateVirtualMFADevice] -> ShowS
CreateVirtualMFADevice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVirtualMFADevice] -> ShowS
$cshowList :: [CreateVirtualMFADevice] -> ShowS
show :: CreateVirtualMFADevice -> String
$cshow :: CreateVirtualMFADevice -> String
showsPrec :: Int -> CreateVirtualMFADevice -> ShowS
$cshowsPrec :: Int -> CreateVirtualMFADevice -> ShowS
Prelude.Show, forall x. Rep CreateVirtualMFADevice x -> CreateVirtualMFADevice
forall x. CreateVirtualMFADevice -> Rep CreateVirtualMFADevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateVirtualMFADevice x -> CreateVirtualMFADevice
$cfrom :: forall x. CreateVirtualMFADevice -> Rep CreateVirtualMFADevice x
Prelude.Generic)
newCreateVirtualMFADevice ::
Prelude.Text ->
CreateVirtualMFADevice
newCreateVirtualMFADevice :: Text -> CreateVirtualMFADevice
newCreateVirtualMFADevice Text
pVirtualMFADeviceName_ =
CreateVirtualMFADevice'
{ $sel:path:CreateVirtualMFADevice' :: Maybe Text
path = forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateVirtualMFADevice' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:virtualMFADeviceName:CreateVirtualMFADevice' :: Text
virtualMFADeviceName = Text
pVirtualMFADeviceName_
}
createVirtualMFADevice_path :: Lens.Lens' CreateVirtualMFADevice (Prelude.Maybe Prelude.Text)
createVirtualMFADevice_path :: Lens' CreateVirtualMFADevice (Maybe Text)
createVirtualMFADevice_path = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVirtualMFADevice' {Maybe Text
path :: Maybe Text
$sel:path:CreateVirtualMFADevice' :: CreateVirtualMFADevice -> Maybe Text
path} -> Maybe Text
path) (\s :: CreateVirtualMFADevice
s@CreateVirtualMFADevice' {} Maybe Text
a -> CreateVirtualMFADevice
s {$sel:path:CreateVirtualMFADevice' :: Maybe Text
path = Maybe Text
a} :: CreateVirtualMFADevice)
createVirtualMFADevice_tags :: Lens.Lens' CreateVirtualMFADevice (Prelude.Maybe [Tag])
createVirtualMFADevice_tags :: Lens' CreateVirtualMFADevice (Maybe [Tag])
createVirtualMFADevice_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVirtualMFADevice' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateVirtualMFADevice' :: CreateVirtualMFADevice -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateVirtualMFADevice
s@CreateVirtualMFADevice' {} Maybe [Tag]
a -> CreateVirtualMFADevice
s {$sel:tags:CreateVirtualMFADevice' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateVirtualMFADevice) 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
createVirtualMFADevice_virtualMFADeviceName :: Lens.Lens' CreateVirtualMFADevice Prelude.Text
createVirtualMFADevice_virtualMFADeviceName :: Lens' CreateVirtualMFADevice Text
createVirtualMFADevice_virtualMFADeviceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVirtualMFADevice' {Text
virtualMFADeviceName :: Text
$sel:virtualMFADeviceName:CreateVirtualMFADevice' :: CreateVirtualMFADevice -> Text
virtualMFADeviceName} -> Text
virtualMFADeviceName) (\s :: CreateVirtualMFADevice
s@CreateVirtualMFADevice' {} Text
a -> CreateVirtualMFADevice
s {$sel:virtualMFADeviceName:CreateVirtualMFADevice' :: Text
virtualMFADeviceName = Text
a} :: CreateVirtualMFADevice)
instance Core.AWSRequest CreateVirtualMFADevice where
type
AWSResponse CreateVirtualMFADevice =
CreateVirtualMFADeviceResponse
request :: (Service -> Service)
-> CreateVirtualMFADevice -> Request CreateVirtualMFADevice
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 CreateVirtualMFADevice
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateVirtualMFADevice)))
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
"CreateVirtualMFADeviceResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> VirtualMFADevice -> CreateVirtualMFADeviceResponse
CreateVirtualMFADeviceResponse'
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
"VirtualMFADevice")
)
instance Prelude.Hashable CreateVirtualMFADevice where
hashWithSalt :: Int -> CreateVirtualMFADevice -> Int
hashWithSalt Int
_salt CreateVirtualMFADevice' {Maybe [Tag]
Maybe Text
Text
virtualMFADeviceName :: Text
tags :: Maybe [Tag]
path :: Maybe Text
$sel:virtualMFADeviceName:CreateVirtualMFADevice' :: CreateVirtualMFADevice -> Text
$sel:tags:CreateVirtualMFADevice' :: CreateVirtualMFADevice -> Maybe [Tag]
$sel:path:CreateVirtualMFADevice' :: CreateVirtualMFADevice -> 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
virtualMFADeviceName
instance Prelude.NFData CreateVirtualMFADevice where
rnf :: CreateVirtualMFADevice -> ()
rnf CreateVirtualMFADevice' {Maybe [Tag]
Maybe Text
Text
virtualMFADeviceName :: Text
tags :: Maybe [Tag]
path :: Maybe Text
$sel:virtualMFADeviceName:CreateVirtualMFADevice' :: CreateVirtualMFADevice -> Text
$sel:tags:CreateVirtualMFADevice' :: CreateVirtualMFADevice -> Maybe [Tag]
$sel:path:CreateVirtualMFADevice' :: CreateVirtualMFADevice -> 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
virtualMFADeviceName
instance Data.ToHeaders CreateVirtualMFADevice where
toHeaders :: CreateVirtualMFADevice -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath CreateVirtualMFADevice where
toPath :: CreateVirtualMFADevice -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateVirtualMFADevice where
toQuery :: CreateVirtualMFADevice -> QueryString
toQuery CreateVirtualMFADevice' {Maybe [Tag]
Maybe Text
Text
virtualMFADeviceName :: Text
tags :: Maybe [Tag]
path :: Maybe Text
$sel:virtualMFADeviceName:CreateVirtualMFADevice' :: CreateVirtualMFADevice -> Text
$sel:tags:CreateVirtualMFADevice' :: CreateVirtualMFADevice -> Maybe [Tag]
$sel:path:CreateVirtualMFADevice' :: CreateVirtualMFADevice -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateVirtualMFADevice" :: 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
"VirtualMFADeviceName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
virtualMFADeviceName
]
data CreateVirtualMFADeviceResponse = CreateVirtualMFADeviceResponse'
{
CreateVirtualMFADeviceResponse -> Int
httpStatus :: Prelude.Int,
CreateVirtualMFADeviceResponse -> VirtualMFADevice
virtualMFADevice :: VirtualMFADevice
}
deriving (CreateVirtualMFADeviceResponse
-> CreateVirtualMFADeviceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVirtualMFADeviceResponse
-> CreateVirtualMFADeviceResponse -> Bool
$c/= :: CreateVirtualMFADeviceResponse
-> CreateVirtualMFADeviceResponse -> Bool
== :: CreateVirtualMFADeviceResponse
-> CreateVirtualMFADeviceResponse -> Bool
$c== :: CreateVirtualMFADeviceResponse
-> CreateVirtualMFADeviceResponse -> Bool
Prelude.Eq, Int -> CreateVirtualMFADeviceResponse -> ShowS
[CreateVirtualMFADeviceResponse] -> ShowS
CreateVirtualMFADeviceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVirtualMFADeviceResponse] -> ShowS
$cshowList :: [CreateVirtualMFADeviceResponse] -> ShowS
show :: CreateVirtualMFADeviceResponse -> String
$cshow :: CreateVirtualMFADeviceResponse -> String
showsPrec :: Int -> CreateVirtualMFADeviceResponse -> ShowS
$cshowsPrec :: Int -> CreateVirtualMFADeviceResponse -> ShowS
Prelude.Show, forall x.
Rep CreateVirtualMFADeviceResponse x
-> CreateVirtualMFADeviceResponse
forall x.
CreateVirtualMFADeviceResponse
-> Rep CreateVirtualMFADeviceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateVirtualMFADeviceResponse x
-> CreateVirtualMFADeviceResponse
$cfrom :: forall x.
CreateVirtualMFADeviceResponse
-> Rep CreateVirtualMFADeviceResponse x
Prelude.Generic)
newCreateVirtualMFADeviceResponse ::
Prelude.Int ->
VirtualMFADevice ->
CreateVirtualMFADeviceResponse
newCreateVirtualMFADeviceResponse :: Int -> VirtualMFADevice -> CreateVirtualMFADeviceResponse
newCreateVirtualMFADeviceResponse
Int
pHttpStatus_
VirtualMFADevice
pVirtualMFADevice_ =
CreateVirtualMFADeviceResponse'
{ $sel:httpStatus:CreateVirtualMFADeviceResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:virtualMFADevice:CreateVirtualMFADeviceResponse' :: VirtualMFADevice
virtualMFADevice = VirtualMFADevice
pVirtualMFADevice_
}
createVirtualMFADeviceResponse_httpStatus :: Lens.Lens' CreateVirtualMFADeviceResponse Prelude.Int
createVirtualMFADeviceResponse_httpStatus :: Lens' CreateVirtualMFADeviceResponse Int
createVirtualMFADeviceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVirtualMFADeviceResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateVirtualMFADeviceResponse' :: CreateVirtualMFADeviceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateVirtualMFADeviceResponse
s@CreateVirtualMFADeviceResponse' {} Int
a -> CreateVirtualMFADeviceResponse
s {$sel:httpStatus:CreateVirtualMFADeviceResponse' :: Int
httpStatus = Int
a} :: CreateVirtualMFADeviceResponse)
createVirtualMFADeviceResponse_virtualMFADevice :: Lens.Lens' CreateVirtualMFADeviceResponse VirtualMFADevice
createVirtualMFADeviceResponse_virtualMFADevice :: Lens' CreateVirtualMFADeviceResponse VirtualMFADevice
createVirtualMFADeviceResponse_virtualMFADevice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVirtualMFADeviceResponse' {VirtualMFADevice
virtualMFADevice :: VirtualMFADevice
$sel:virtualMFADevice:CreateVirtualMFADeviceResponse' :: CreateVirtualMFADeviceResponse -> VirtualMFADevice
virtualMFADevice} -> VirtualMFADevice
virtualMFADevice) (\s :: CreateVirtualMFADeviceResponse
s@CreateVirtualMFADeviceResponse' {} VirtualMFADevice
a -> CreateVirtualMFADeviceResponse
s {$sel:virtualMFADevice:CreateVirtualMFADeviceResponse' :: VirtualMFADevice
virtualMFADevice = VirtualMFADevice
a} :: CreateVirtualMFADeviceResponse)
instance
Prelude.NFData
CreateVirtualMFADeviceResponse
where
rnf :: CreateVirtualMFADeviceResponse -> ()
rnf CreateVirtualMFADeviceResponse' {Int
VirtualMFADevice
virtualMFADevice :: VirtualMFADevice
httpStatus :: Int
$sel:virtualMFADevice:CreateVirtualMFADeviceResponse' :: CreateVirtualMFADeviceResponse -> VirtualMFADevice
$sel:httpStatus:CreateVirtualMFADeviceResponse' :: CreateVirtualMFADeviceResponse -> 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 VirtualMFADevice
virtualMFADevice