{-# 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.StorageGateway.CreateCachediSCSIVolume
(
CreateCachediSCSIVolume (..),
newCreateCachediSCSIVolume,
createCachediSCSIVolume_kmsKey,
createCachediSCSIVolume_sourceVolumeARN,
createCachediSCSIVolume_kmsEncrypted,
createCachediSCSIVolume_tags,
createCachediSCSIVolume_snapshotId,
createCachediSCSIVolume_gatewayARN,
createCachediSCSIVolume_volumeSizeInBytes,
createCachediSCSIVolume_targetName,
createCachediSCSIVolume_networkInterfaceId,
createCachediSCSIVolume_clientToken,
CreateCachediSCSIVolumeResponse (..),
newCreateCachediSCSIVolumeResponse,
createCachediSCSIVolumeResponse_targetARN,
createCachediSCSIVolumeResponse_volumeARN,
createCachediSCSIVolumeResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.StorageGateway.Types
data CreateCachediSCSIVolume = CreateCachediSCSIVolume'
{
CreateCachediSCSIVolume -> Maybe Text
kmsKey :: Prelude.Maybe Prelude.Text,
CreateCachediSCSIVolume -> Maybe Text
sourceVolumeARN :: Prelude.Maybe Prelude.Text,
CreateCachediSCSIVolume -> Maybe Bool
kmsEncrypted :: Prelude.Maybe Prelude.Bool,
CreateCachediSCSIVolume -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateCachediSCSIVolume -> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text,
CreateCachediSCSIVolume -> Text
gatewayARN :: Prelude.Text,
CreateCachediSCSIVolume -> Integer
volumeSizeInBytes :: Prelude.Integer,
CreateCachediSCSIVolume -> Text
targetName :: Prelude.Text,
CreateCachediSCSIVolume -> Text
networkInterfaceId :: Prelude.Text,
CreateCachediSCSIVolume -> Text
clientToken :: Prelude.Text
}
deriving (CreateCachediSCSIVolume -> CreateCachediSCSIVolume -> Bool
(CreateCachediSCSIVolume -> CreateCachediSCSIVolume -> Bool)
-> (CreateCachediSCSIVolume -> CreateCachediSCSIVolume -> Bool)
-> Eq CreateCachediSCSIVolume
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCachediSCSIVolume -> CreateCachediSCSIVolume -> Bool
$c/= :: CreateCachediSCSIVolume -> CreateCachediSCSIVolume -> Bool
== :: CreateCachediSCSIVolume -> CreateCachediSCSIVolume -> Bool
$c== :: CreateCachediSCSIVolume -> CreateCachediSCSIVolume -> Bool
Prelude.Eq, ReadPrec [CreateCachediSCSIVolume]
ReadPrec CreateCachediSCSIVolume
Int -> ReadS CreateCachediSCSIVolume
ReadS [CreateCachediSCSIVolume]
(Int -> ReadS CreateCachediSCSIVolume)
-> ReadS [CreateCachediSCSIVolume]
-> ReadPrec CreateCachediSCSIVolume
-> ReadPrec [CreateCachediSCSIVolume]
-> Read CreateCachediSCSIVolume
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCachediSCSIVolume]
$creadListPrec :: ReadPrec [CreateCachediSCSIVolume]
readPrec :: ReadPrec CreateCachediSCSIVolume
$creadPrec :: ReadPrec CreateCachediSCSIVolume
readList :: ReadS [CreateCachediSCSIVolume]
$creadList :: ReadS [CreateCachediSCSIVolume]
readsPrec :: Int -> ReadS CreateCachediSCSIVolume
$creadsPrec :: Int -> ReadS CreateCachediSCSIVolume
Prelude.Read, Int -> CreateCachediSCSIVolume -> ShowS
[CreateCachediSCSIVolume] -> ShowS
CreateCachediSCSIVolume -> String
(Int -> CreateCachediSCSIVolume -> ShowS)
-> (CreateCachediSCSIVolume -> String)
-> ([CreateCachediSCSIVolume] -> ShowS)
-> Show CreateCachediSCSIVolume
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCachediSCSIVolume] -> ShowS
$cshowList :: [CreateCachediSCSIVolume] -> ShowS
show :: CreateCachediSCSIVolume -> String
$cshow :: CreateCachediSCSIVolume -> String
showsPrec :: Int -> CreateCachediSCSIVolume -> ShowS
$cshowsPrec :: Int -> CreateCachediSCSIVolume -> ShowS
Prelude.Show, (forall x.
CreateCachediSCSIVolume -> Rep CreateCachediSCSIVolume x)
-> (forall x.
Rep CreateCachediSCSIVolume x -> CreateCachediSCSIVolume)
-> Generic CreateCachediSCSIVolume
forall x. Rep CreateCachediSCSIVolume x -> CreateCachediSCSIVolume
forall x. CreateCachediSCSIVolume -> Rep CreateCachediSCSIVolume x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCachediSCSIVolume x -> CreateCachediSCSIVolume
$cfrom :: forall x. CreateCachediSCSIVolume -> Rep CreateCachediSCSIVolume x
Prelude.Generic)
newCreateCachediSCSIVolume ::
Prelude.Text ->
Prelude.Integer ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateCachediSCSIVolume
newCreateCachediSCSIVolume :: Text -> Integer -> Text -> Text -> Text -> CreateCachediSCSIVolume
newCreateCachediSCSIVolume
Text
pGatewayARN_
Integer
pVolumeSizeInBytes_
Text
pTargetName_
Text
pNetworkInterfaceId_
Text
pClientToken_ =
CreateCachediSCSIVolume' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe [Tag]
-> Maybe Text
-> Text
-> Integer
-> Text
-> Text
-> Text
-> CreateCachediSCSIVolume
CreateCachediSCSIVolume'
{ $sel:kmsKey:CreateCachediSCSIVolume' :: Maybe Text
kmsKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sourceVolumeARN:CreateCachediSCSIVolume' :: Maybe Text
sourceVolumeARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:kmsEncrypted:CreateCachediSCSIVolume' :: Maybe Bool
kmsEncrypted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateCachediSCSIVolume' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:snapshotId:CreateCachediSCSIVolume' :: Maybe Text
snapshotId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gatewayARN:CreateCachediSCSIVolume' :: Text
gatewayARN = Text
pGatewayARN_,
$sel:volumeSizeInBytes:CreateCachediSCSIVolume' :: Integer
volumeSizeInBytes = Integer
pVolumeSizeInBytes_,
$sel:targetName:CreateCachediSCSIVolume' :: Text
targetName = Text
pTargetName_,
$sel:networkInterfaceId:CreateCachediSCSIVolume' :: Text
networkInterfaceId = Text
pNetworkInterfaceId_,
$sel:clientToken:CreateCachediSCSIVolume' :: Text
clientToken = Text
pClientToken_
}
createCachediSCSIVolume_kmsKey :: Lens.Lens' CreateCachediSCSIVolume (Prelude.Maybe Prelude.Text)
createCachediSCSIVolume_kmsKey :: (Maybe Text -> f (Maybe Text))
-> CreateCachediSCSIVolume -> f CreateCachediSCSIVolume
createCachediSCSIVolume_kmsKey = (CreateCachediSCSIVolume -> Maybe Text)
-> (CreateCachediSCSIVolume
-> Maybe Text -> CreateCachediSCSIVolume)
-> Lens
CreateCachediSCSIVolume
CreateCachediSCSIVolume
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolume' {Maybe Text
kmsKey :: Maybe Text
$sel:kmsKey:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Maybe Text
kmsKey} -> Maybe Text
kmsKey) (\s :: CreateCachediSCSIVolume
s@CreateCachediSCSIVolume' {} Maybe Text
a -> CreateCachediSCSIVolume
s {$sel:kmsKey:CreateCachediSCSIVolume' :: Maybe Text
kmsKey = Maybe Text
a} :: CreateCachediSCSIVolume)
createCachediSCSIVolume_sourceVolumeARN :: Lens.Lens' CreateCachediSCSIVolume (Prelude.Maybe Prelude.Text)
createCachediSCSIVolume_sourceVolumeARN :: (Maybe Text -> f (Maybe Text))
-> CreateCachediSCSIVolume -> f CreateCachediSCSIVolume
createCachediSCSIVolume_sourceVolumeARN = (CreateCachediSCSIVolume -> Maybe Text)
-> (CreateCachediSCSIVolume
-> Maybe Text -> CreateCachediSCSIVolume)
-> Lens
CreateCachediSCSIVolume
CreateCachediSCSIVolume
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolume' {Maybe Text
sourceVolumeARN :: Maybe Text
$sel:sourceVolumeARN:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Maybe Text
sourceVolumeARN} -> Maybe Text
sourceVolumeARN) (\s :: CreateCachediSCSIVolume
s@CreateCachediSCSIVolume' {} Maybe Text
a -> CreateCachediSCSIVolume
s {$sel:sourceVolumeARN:CreateCachediSCSIVolume' :: Maybe Text
sourceVolumeARN = Maybe Text
a} :: CreateCachediSCSIVolume)
createCachediSCSIVolume_kmsEncrypted :: Lens.Lens' CreateCachediSCSIVolume (Prelude.Maybe Prelude.Bool)
createCachediSCSIVolume_kmsEncrypted :: (Maybe Bool -> f (Maybe Bool))
-> CreateCachediSCSIVolume -> f CreateCachediSCSIVolume
createCachediSCSIVolume_kmsEncrypted = (CreateCachediSCSIVolume -> Maybe Bool)
-> (CreateCachediSCSIVolume
-> Maybe Bool -> CreateCachediSCSIVolume)
-> Lens
CreateCachediSCSIVolume
CreateCachediSCSIVolume
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolume' {Maybe Bool
kmsEncrypted :: Maybe Bool
$sel:kmsEncrypted:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Maybe Bool
kmsEncrypted} -> Maybe Bool
kmsEncrypted) (\s :: CreateCachediSCSIVolume
s@CreateCachediSCSIVolume' {} Maybe Bool
a -> CreateCachediSCSIVolume
s {$sel:kmsEncrypted:CreateCachediSCSIVolume' :: Maybe Bool
kmsEncrypted = Maybe Bool
a} :: CreateCachediSCSIVolume)
createCachediSCSIVolume_tags :: Lens.Lens' CreateCachediSCSIVolume (Prelude.Maybe [Tag])
createCachediSCSIVolume_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateCachediSCSIVolume -> f CreateCachediSCSIVolume
createCachediSCSIVolume_tags = (CreateCachediSCSIVolume -> Maybe [Tag])
-> (CreateCachediSCSIVolume
-> Maybe [Tag] -> CreateCachediSCSIVolume)
-> Lens
CreateCachediSCSIVolume
CreateCachediSCSIVolume
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolume' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateCachediSCSIVolume
s@CreateCachediSCSIVolume' {} Maybe [Tag]
a -> CreateCachediSCSIVolume
s {$sel:tags:CreateCachediSCSIVolume' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateCachediSCSIVolume) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateCachediSCSIVolume -> f CreateCachediSCSIVolume)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateCachediSCSIVolume
-> f CreateCachediSCSIVolume
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createCachediSCSIVolume_snapshotId :: Lens.Lens' CreateCachediSCSIVolume (Prelude.Maybe Prelude.Text)
createCachediSCSIVolume_snapshotId :: (Maybe Text -> f (Maybe Text))
-> CreateCachediSCSIVolume -> f CreateCachediSCSIVolume
createCachediSCSIVolume_snapshotId = (CreateCachediSCSIVolume -> Maybe Text)
-> (CreateCachediSCSIVolume
-> Maybe Text -> CreateCachediSCSIVolume)
-> Lens
CreateCachediSCSIVolume
CreateCachediSCSIVolume
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolume' {Maybe Text
snapshotId :: Maybe Text
$sel:snapshotId:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Maybe Text
snapshotId} -> Maybe Text
snapshotId) (\s :: CreateCachediSCSIVolume
s@CreateCachediSCSIVolume' {} Maybe Text
a -> CreateCachediSCSIVolume
s {$sel:snapshotId:CreateCachediSCSIVolume' :: Maybe Text
snapshotId = Maybe Text
a} :: CreateCachediSCSIVolume)
createCachediSCSIVolume_gatewayARN :: Lens.Lens' CreateCachediSCSIVolume Prelude.Text
createCachediSCSIVolume_gatewayARN :: (Text -> f Text)
-> CreateCachediSCSIVolume -> f CreateCachediSCSIVolume
createCachediSCSIVolume_gatewayARN = (CreateCachediSCSIVolume -> Text)
-> (CreateCachediSCSIVolume -> Text -> CreateCachediSCSIVolume)
-> Lens CreateCachediSCSIVolume CreateCachediSCSIVolume Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolume' {Text
gatewayARN :: Text
$sel:gatewayARN:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Text
gatewayARN} -> Text
gatewayARN) (\s :: CreateCachediSCSIVolume
s@CreateCachediSCSIVolume' {} Text
a -> CreateCachediSCSIVolume
s {$sel:gatewayARN:CreateCachediSCSIVolume' :: Text
gatewayARN = Text
a} :: CreateCachediSCSIVolume)
createCachediSCSIVolume_volumeSizeInBytes :: Lens.Lens' CreateCachediSCSIVolume Prelude.Integer
createCachediSCSIVolume_volumeSizeInBytes :: (Integer -> f Integer)
-> CreateCachediSCSIVolume -> f CreateCachediSCSIVolume
createCachediSCSIVolume_volumeSizeInBytes = (CreateCachediSCSIVolume -> Integer)
-> (CreateCachediSCSIVolume -> Integer -> CreateCachediSCSIVolume)
-> Lens
CreateCachediSCSIVolume CreateCachediSCSIVolume Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolume' {Integer
volumeSizeInBytes :: Integer
$sel:volumeSizeInBytes:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Integer
volumeSizeInBytes} -> Integer
volumeSizeInBytes) (\s :: CreateCachediSCSIVolume
s@CreateCachediSCSIVolume' {} Integer
a -> CreateCachediSCSIVolume
s {$sel:volumeSizeInBytes:CreateCachediSCSIVolume' :: Integer
volumeSizeInBytes = Integer
a} :: CreateCachediSCSIVolume)
createCachediSCSIVolume_targetName :: Lens.Lens' CreateCachediSCSIVolume Prelude.Text
createCachediSCSIVolume_targetName :: (Text -> f Text)
-> CreateCachediSCSIVolume -> f CreateCachediSCSIVolume
createCachediSCSIVolume_targetName = (CreateCachediSCSIVolume -> Text)
-> (CreateCachediSCSIVolume -> Text -> CreateCachediSCSIVolume)
-> Lens CreateCachediSCSIVolume CreateCachediSCSIVolume Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolume' {Text
targetName :: Text
$sel:targetName:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Text
targetName} -> Text
targetName) (\s :: CreateCachediSCSIVolume
s@CreateCachediSCSIVolume' {} Text
a -> CreateCachediSCSIVolume
s {$sel:targetName:CreateCachediSCSIVolume' :: Text
targetName = Text
a} :: CreateCachediSCSIVolume)
createCachediSCSIVolume_networkInterfaceId :: Lens.Lens' CreateCachediSCSIVolume Prelude.Text
createCachediSCSIVolume_networkInterfaceId :: (Text -> f Text)
-> CreateCachediSCSIVolume -> f CreateCachediSCSIVolume
createCachediSCSIVolume_networkInterfaceId = (CreateCachediSCSIVolume -> Text)
-> (CreateCachediSCSIVolume -> Text -> CreateCachediSCSIVolume)
-> Lens CreateCachediSCSIVolume CreateCachediSCSIVolume Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolume' {Text
networkInterfaceId :: Text
$sel:networkInterfaceId:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Text
networkInterfaceId} -> Text
networkInterfaceId) (\s :: CreateCachediSCSIVolume
s@CreateCachediSCSIVolume' {} Text
a -> CreateCachediSCSIVolume
s {$sel:networkInterfaceId:CreateCachediSCSIVolume' :: Text
networkInterfaceId = Text
a} :: CreateCachediSCSIVolume)
createCachediSCSIVolume_clientToken :: Lens.Lens' CreateCachediSCSIVolume Prelude.Text
createCachediSCSIVolume_clientToken :: (Text -> f Text)
-> CreateCachediSCSIVolume -> f CreateCachediSCSIVolume
createCachediSCSIVolume_clientToken = (CreateCachediSCSIVolume -> Text)
-> (CreateCachediSCSIVolume -> Text -> CreateCachediSCSIVolume)
-> Lens CreateCachediSCSIVolume CreateCachediSCSIVolume Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolume' {Text
clientToken :: Text
$sel:clientToken:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Text
clientToken} -> Text
clientToken) (\s :: CreateCachediSCSIVolume
s@CreateCachediSCSIVolume' {} Text
a -> CreateCachediSCSIVolume
s {$sel:clientToken:CreateCachediSCSIVolume' :: Text
clientToken = Text
a} :: CreateCachediSCSIVolume)
instance Core.AWSRequest CreateCachediSCSIVolume where
type
AWSResponse CreateCachediSCSIVolume =
CreateCachediSCSIVolumeResponse
request :: CreateCachediSCSIVolume -> Request CreateCachediSCSIVolume
request = Service
-> CreateCachediSCSIVolume -> Request CreateCachediSCSIVolume
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateCachediSCSIVolume
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateCachediSCSIVolume)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateCachediSCSIVolume))
-> Logger
-> Service
-> Proxy CreateCachediSCSIVolume
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateCachediSCSIVolume)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Maybe Text -> Int -> CreateCachediSCSIVolumeResponse
CreateCachediSCSIVolumeResponse'
(Maybe Text
-> Maybe Text -> Int -> CreateCachediSCSIVolumeResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Int -> CreateCachediSCSIVolumeResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TargetARN")
Either
String (Maybe Text -> Int -> CreateCachediSCSIVolumeResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateCachediSCSIVolumeResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"VolumeARN")
Either String (Int -> CreateCachediSCSIVolumeResponse)
-> Either String Int
-> Either String CreateCachediSCSIVolumeResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateCachediSCSIVolume
instance Prelude.NFData CreateCachediSCSIVolume
instance Core.ToHeaders CreateCachediSCSIVolume where
toHeaders :: CreateCachediSCSIVolume -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateCachediSCSIVolume -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"StorageGateway_20130630.CreateCachediSCSIVolume" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateCachediSCSIVolume where
toJSON :: CreateCachediSCSIVolume -> Value
toJSON CreateCachediSCSIVolume' {Integer
Maybe Bool
Maybe [Tag]
Maybe Text
Text
clientToken :: Text
networkInterfaceId :: Text
targetName :: Text
volumeSizeInBytes :: Integer
gatewayARN :: Text
snapshotId :: Maybe Text
tags :: Maybe [Tag]
kmsEncrypted :: Maybe Bool
sourceVolumeARN :: Maybe Text
kmsKey :: Maybe Text
$sel:clientToken:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Text
$sel:networkInterfaceId:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Text
$sel:targetName:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Text
$sel:volumeSizeInBytes:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Integer
$sel:gatewayARN:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Text
$sel:snapshotId:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Maybe Text
$sel:tags:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Maybe [Tag]
$sel:kmsEncrypted:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Maybe Bool
$sel:sourceVolumeARN:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Maybe Text
$sel:kmsKey:CreateCachediSCSIVolume' :: CreateCachediSCSIVolume -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"KMSKey" 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
kmsKey,
(Text
"SourceVolumeARN" 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
sourceVolumeARN,
(Text
"KMSEncrypted" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
kmsEncrypted,
(Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
(Text
"SnapshotId" 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
snapshotId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GatewayARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gatewayARN),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"VolumeSizeInBytes" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Integer
volumeSizeInBytes),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TargetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
targetName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"NetworkInterfaceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
networkInterfaceId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
]
)
instance Core.ToPath CreateCachediSCSIVolume where
toPath :: CreateCachediSCSIVolume -> ByteString
toPath = ByteString -> CreateCachediSCSIVolume -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateCachediSCSIVolume where
toQuery :: CreateCachediSCSIVolume -> QueryString
toQuery = QueryString -> CreateCachediSCSIVolume -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateCachediSCSIVolumeResponse = CreateCachediSCSIVolumeResponse'
{
CreateCachediSCSIVolumeResponse -> Maybe Text
targetARN :: Prelude.Maybe Prelude.Text,
CreateCachediSCSIVolumeResponse -> Maybe Text
volumeARN :: Prelude.Maybe Prelude.Text,
CreateCachediSCSIVolumeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateCachediSCSIVolumeResponse
-> CreateCachediSCSIVolumeResponse -> Bool
(CreateCachediSCSIVolumeResponse
-> CreateCachediSCSIVolumeResponse -> Bool)
-> (CreateCachediSCSIVolumeResponse
-> CreateCachediSCSIVolumeResponse -> Bool)
-> Eq CreateCachediSCSIVolumeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCachediSCSIVolumeResponse
-> CreateCachediSCSIVolumeResponse -> Bool
$c/= :: CreateCachediSCSIVolumeResponse
-> CreateCachediSCSIVolumeResponse -> Bool
== :: CreateCachediSCSIVolumeResponse
-> CreateCachediSCSIVolumeResponse -> Bool
$c== :: CreateCachediSCSIVolumeResponse
-> CreateCachediSCSIVolumeResponse -> Bool
Prelude.Eq, ReadPrec [CreateCachediSCSIVolumeResponse]
ReadPrec CreateCachediSCSIVolumeResponse
Int -> ReadS CreateCachediSCSIVolumeResponse
ReadS [CreateCachediSCSIVolumeResponse]
(Int -> ReadS CreateCachediSCSIVolumeResponse)
-> ReadS [CreateCachediSCSIVolumeResponse]
-> ReadPrec CreateCachediSCSIVolumeResponse
-> ReadPrec [CreateCachediSCSIVolumeResponse]
-> Read CreateCachediSCSIVolumeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCachediSCSIVolumeResponse]
$creadListPrec :: ReadPrec [CreateCachediSCSIVolumeResponse]
readPrec :: ReadPrec CreateCachediSCSIVolumeResponse
$creadPrec :: ReadPrec CreateCachediSCSIVolumeResponse
readList :: ReadS [CreateCachediSCSIVolumeResponse]
$creadList :: ReadS [CreateCachediSCSIVolumeResponse]
readsPrec :: Int -> ReadS CreateCachediSCSIVolumeResponse
$creadsPrec :: Int -> ReadS CreateCachediSCSIVolumeResponse
Prelude.Read, Int -> CreateCachediSCSIVolumeResponse -> ShowS
[CreateCachediSCSIVolumeResponse] -> ShowS
CreateCachediSCSIVolumeResponse -> String
(Int -> CreateCachediSCSIVolumeResponse -> ShowS)
-> (CreateCachediSCSIVolumeResponse -> String)
-> ([CreateCachediSCSIVolumeResponse] -> ShowS)
-> Show CreateCachediSCSIVolumeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCachediSCSIVolumeResponse] -> ShowS
$cshowList :: [CreateCachediSCSIVolumeResponse] -> ShowS
show :: CreateCachediSCSIVolumeResponse -> String
$cshow :: CreateCachediSCSIVolumeResponse -> String
showsPrec :: Int -> CreateCachediSCSIVolumeResponse -> ShowS
$cshowsPrec :: Int -> CreateCachediSCSIVolumeResponse -> ShowS
Prelude.Show, (forall x.
CreateCachediSCSIVolumeResponse
-> Rep CreateCachediSCSIVolumeResponse x)
-> (forall x.
Rep CreateCachediSCSIVolumeResponse x
-> CreateCachediSCSIVolumeResponse)
-> Generic CreateCachediSCSIVolumeResponse
forall x.
Rep CreateCachediSCSIVolumeResponse x
-> CreateCachediSCSIVolumeResponse
forall x.
CreateCachediSCSIVolumeResponse
-> Rep CreateCachediSCSIVolumeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCachediSCSIVolumeResponse x
-> CreateCachediSCSIVolumeResponse
$cfrom :: forall x.
CreateCachediSCSIVolumeResponse
-> Rep CreateCachediSCSIVolumeResponse x
Prelude.Generic)
newCreateCachediSCSIVolumeResponse ::
Prelude.Int ->
CreateCachediSCSIVolumeResponse
newCreateCachediSCSIVolumeResponse :: Int -> CreateCachediSCSIVolumeResponse
newCreateCachediSCSIVolumeResponse Int
pHttpStatus_ =
CreateCachediSCSIVolumeResponse' :: Maybe Text -> Maybe Text -> Int -> CreateCachediSCSIVolumeResponse
CreateCachediSCSIVolumeResponse'
{ $sel:targetARN:CreateCachediSCSIVolumeResponse' :: Maybe Text
targetARN =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:volumeARN:CreateCachediSCSIVolumeResponse' :: Maybe Text
volumeARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateCachediSCSIVolumeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createCachediSCSIVolumeResponse_targetARN :: Lens.Lens' CreateCachediSCSIVolumeResponse (Prelude.Maybe Prelude.Text)
createCachediSCSIVolumeResponse_targetARN :: (Maybe Text -> f (Maybe Text))
-> CreateCachediSCSIVolumeResponse
-> f CreateCachediSCSIVolumeResponse
createCachediSCSIVolumeResponse_targetARN = (CreateCachediSCSIVolumeResponse -> Maybe Text)
-> (CreateCachediSCSIVolumeResponse
-> Maybe Text -> CreateCachediSCSIVolumeResponse)
-> Lens
CreateCachediSCSIVolumeResponse
CreateCachediSCSIVolumeResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolumeResponse' {Maybe Text
targetARN :: Maybe Text
$sel:targetARN:CreateCachediSCSIVolumeResponse' :: CreateCachediSCSIVolumeResponse -> Maybe Text
targetARN} -> Maybe Text
targetARN) (\s :: CreateCachediSCSIVolumeResponse
s@CreateCachediSCSIVolumeResponse' {} Maybe Text
a -> CreateCachediSCSIVolumeResponse
s {$sel:targetARN:CreateCachediSCSIVolumeResponse' :: Maybe Text
targetARN = Maybe Text
a} :: CreateCachediSCSIVolumeResponse)
createCachediSCSIVolumeResponse_volumeARN :: Lens.Lens' CreateCachediSCSIVolumeResponse (Prelude.Maybe Prelude.Text)
createCachediSCSIVolumeResponse_volumeARN :: (Maybe Text -> f (Maybe Text))
-> CreateCachediSCSIVolumeResponse
-> f CreateCachediSCSIVolumeResponse
createCachediSCSIVolumeResponse_volumeARN = (CreateCachediSCSIVolumeResponse -> Maybe Text)
-> (CreateCachediSCSIVolumeResponse
-> Maybe Text -> CreateCachediSCSIVolumeResponse)
-> Lens
CreateCachediSCSIVolumeResponse
CreateCachediSCSIVolumeResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolumeResponse' {Maybe Text
volumeARN :: Maybe Text
$sel:volumeARN:CreateCachediSCSIVolumeResponse' :: CreateCachediSCSIVolumeResponse -> Maybe Text
volumeARN} -> Maybe Text
volumeARN) (\s :: CreateCachediSCSIVolumeResponse
s@CreateCachediSCSIVolumeResponse' {} Maybe Text
a -> CreateCachediSCSIVolumeResponse
s {$sel:volumeARN:CreateCachediSCSIVolumeResponse' :: Maybe Text
volumeARN = Maybe Text
a} :: CreateCachediSCSIVolumeResponse)
createCachediSCSIVolumeResponse_httpStatus :: Lens.Lens' CreateCachediSCSIVolumeResponse Prelude.Int
createCachediSCSIVolumeResponse_httpStatus :: (Int -> f Int)
-> CreateCachediSCSIVolumeResponse
-> f CreateCachediSCSIVolumeResponse
createCachediSCSIVolumeResponse_httpStatus = (CreateCachediSCSIVolumeResponse -> Int)
-> (CreateCachediSCSIVolumeResponse
-> Int -> CreateCachediSCSIVolumeResponse)
-> Lens
CreateCachediSCSIVolumeResponse
CreateCachediSCSIVolumeResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCachediSCSIVolumeResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateCachediSCSIVolumeResponse' :: CreateCachediSCSIVolumeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateCachediSCSIVolumeResponse
s@CreateCachediSCSIVolumeResponse' {} Int
a -> CreateCachediSCSIVolumeResponse
s {$sel:httpStatus:CreateCachediSCSIVolumeResponse' :: Int
httpStatus = Int
a} :: CreateCachediSCSIVolumeResponse)
instance
Prelude.NFData
CreateCachediSCSIVolumeResponse