{-# 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.CreateStorediSCSIVolume
(
CreateStorediSCSIVolume (..),
newCreateStorediSCSIVolume,
createStorediSCSIVolume_kmsKey,
createStorediSCSIVolume_kmsEncrypted,
createStorediSCSIVolume_tags,
createStorediSCSIVolume_snapshotId,
createStorediSCSIVolume_gatewayARN,
createStorediSCSIVolume_diskId,
createStorediSCSIVolume_preserveExistingData,
createStorediSCSIVolume_targetName,
createStorediSCSIVolume_networkInterfaceId,
CreateStorediSCSIVolumeResponse (..),
newCreateStorediSCSIVolumeResponse,
createStorediSCSIVolumeResponse_targetARN,
createStorediSCSIVolumeResponse_volumeARN,
createStorediSCSIVolumeResponse_volumeSizeInBytes,
createStorediSCSIVolumeResponse_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 CreateStorediSCSIVolume = CreateStorediSCSIVolume'
{
CreateStorediSCSIVolume -> Maybe Text
kmsKey :: Prelude.Maybe Prelude.Text,
CreateStorediSCSIVolume -> Maybe Bool
kmsEncrypted :: Prelude.Maybe Prelude.Bool,
CreateStorediSCSIVolume -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateStorediSCSIVolume -> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text,
CreateStorediSCSIVolume -> Text
gatewayARN :: Prelude.Text,
CreateStorediSCSIVolume -> Text
diskId :: Prelude.Text,
CreateStorediSCSIVolume -> Bool
preserveExistingData :: Prelude.Bool,
CreateStorediSCSIVolume -> Text
targetName :: Prelude.Text,
CreateStorediSCSIVolume -> Text
networkInterfaceId :: Prelude.Text
}
deriving (CreateStorediSCSIVolume -> CreateStorediSCSIVolume -> Bool
(CreateStorediSCSIVolume -> CreateStorediSCSIVolume -> Bool)
-> (CreateStorediSCSIVolume -> CreateStorediSCSIVolume -> Bool)
-> Eq CreateStorediSCSIVolume
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStorediSCSIVolume -> CreateStorediSCSIVolume -> Bool
$c/= :: CreateStorediSCSIVolume -> CreateStorediSCSIVolume -> Bool
== :: CreateStorediSCSIVolume -> CreateStorediSCSIVolume -> Bool
$c== :: CreateStorediSCSIVolume -> CreateStorediSCSIVolume -> Bool
Prelude.Eq, ReadPrec [CreateStorediSCSIVolume]
ReadPrec CreateStorediSCSIVolume
Int -> ReadS CreateStorediSCSIVolume
ReadS [CreateStorediSCSIVolume]
(Int -> ReadS CreateStorediSCSIVolume)
-> ReadS [CreateStorediSCSIVolume]
-> ReadPrec CreateStorediSCSIVolume
-> ReadPrec [CreateStorediSCSIVolume]
-> Read CreateStorediSCSIVolume
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStorediSCSIVolume]
$creadListPrec :: ReadPrec [CreateStorediSCSIVolume]
readPrec :: ReadPrec CreateStorediSCSIVolume
$creadPrec :: ReadPrec CreateStorediSCSIVolume
readList :: ReadS [CreateStorediSCSIVolume]
$creadList :: ReadS [CreateStorediSCSIVolume]
readsPrec :: Int -> ReadS CreateStorediSCSIVolume
$creadsPrec :: Int -> ReadS CreateStorediSCSIVolume
Prelude.Read, Int -> CreateStorediSCSIVolume -> ShowS
[CreateStorediSCSIVolume] -> ShowS
CreateStorediSCSIVolume -> String
(Int -> CreateStorediSCSIVolume -> ShowS)
-> (CreateStorediSCSIVolume -> String)
-> ([CreateStorediSCSIVolume] -> ShowS)
-> Show CreateStorediSCSIVolume
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStorediSCSIVolume] -> ShowS
$cshowList :: [CreateStorediSCSIVolume] -> ShowS
show :: CreateStorediSCSIVolume -> String
$cshow :: CreateStorediSCSIVolume -> String
showsPrec :: Int -> CreateStorediSCSIVolume -> ShowS
$cshowsPrec :: Int -> CreateStorediSCSIVolume -> ShowS
Prelude.Show, (forall x.
CreateStorediSCSIVolume -> Rep CreateStorediSCSIVolume x)
-> (forall x.
Rep CreateStorediSCSIVolume x -> CreateStorediSCSIVolume)
-> Generic CreateStorediSCSIVolume
forall x. Rep CreateStorediSCSIVolume x -> CreateStorediSCSIVolume
forall x. CreateStorediSCSIVolume -> Rep CreateStorediSCSIVolume x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateStorediSCSIVolume x -> CreateStorediSCSIVolume
$cfrom :: forall x. CreateStorediSCSIVolume -> Rep CreateStorediSCSIVolume x
Prelude.Generic)
newCreateStorediSCSIVolume ::
Prelude.Text ->
Prelude.Text ->
Prelude.Bool ->
Prelude.Text ->
Prelude.Text ->
CreateStorediSCSIVolume
newCreateStorediSCSIVolume :: Text -> Text -> Bool -> Text -> Text -> CreateStorediSCSIVolume
newCreateStorediSCSIVolume
Text
pGatewayARN_
Text
pDiskId_
Bool
pPreserveExistingData_
Text
pTargetName_
Text
pNetworkInterfaceId_ =
CreateStorediSCSIVolume' :: Maybe Text
-> Maybe Bool
-> Maybe [Tag]
-> Maybe Text
-> Text
-> Text
-> Bool
-> Text
-> Text
-> CreateStorediSCSIVolume
CreateStorediSCSIVolume'
{ $sel:kmsKey:CreateStorediSCSIVolume' :: Maybe Text
kmsKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:kmsEncrypted:CreateStorediSCSIVolume' :: Maybe Bool
kmsEncrypted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateStorediSCSIVolume' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:snapshotId:CreateStorediSCSIVolume' :: Maybe Text
snapshotId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gatewayARN:CreateStorediSCSIVolume' :: Text
gatewayARN = Text
pGatewayARN_,
$sel:diskId:CreateStorediSCSIVolume' :: Text
diskId = Text
pDiskId_,
$sel:preserveExistingData:CreateStorediSCSIVolume' :: Bool
preserveExistingData = Bool
pPreserveExistingData_,
$sel:targetName:CreateStorediSCSIVolume' :: Text
targetName = Text
pTargetName_,
$sel:networkInterfaceId:CreateStorediSCSIVolume' :: Text
networkInterfaceId = Text
pNetworkInterfaceId_
}
createStorediSCSIVolume_kmsKey :: Lens.Lens' CreateStorediSCSIVolume (Prelude.Maybe Prelude.Text)
createStorediSCSIVolume_kmsKey :: (Maybe Text -> f (Maybe Text))
-> CreateStorediSCSIVolume -> f CreateStorediSCSIVolume
createStorediSCSIVolume_kmsKey = (CreateStorediSCSIVolume -> Maybe Text)
-> (CreateStorediSCSIVolume
-> Maybe Text -> CreateStorediSCSIVolume)
-> Lens
CreateStorediSCSIVolume
CreateStorediSCSIVolume
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolume' {Maybe Text
kmsKey :: Maybe Text
$sel:kmsKey:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Maybe Text
kmsKey} -> Maybe Text
kmsKey) (\s :: CreateStorediSCSIVolume
s@CreateStorediSCSIVolume' {} Maybe Text
a -> CreateStorediSCSIVolume
s {$sel:kmsKey:CreateStorediSCSIVolume' :: Maybe Text
kmsKey = Maybe Text
a} :: CreateStorediSCSIVolume)
createStorediSCSIVolume_kmsEncrypted :: Lens.Lens' CreateStorediSCSIVolume (Prelude.Maybe Prelude.Bool)
createStorediSCSIVolume_kmsEncrypted :: (Maybe Bool -> f (Maybe Bool))
-> CreateStorediSCSIVolume -> f CreateStorediSCSIVolume
createStorediSCSIVolume_kmsEncrypted = (CreateStorediSCSIVolume -> Maybe Bool)
-> (CreateStorediSCSIVolume
-> Maybe Bool -> CreateStorediSCSIVolume)
-> Lens
CreateStorediSCSIVolume
CreateStorediSCSIVolume
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolume' {Maybe Bool
kmsEncrypted :: Maybe Bool
$sel:kmsEncrypted:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Maybe Bool
kmsEncrypted} -> Maybe Bool
kmsEncrypted) (\s :: CreateStorediSCSIVolume
s@CreateStorediSCSIVolume' {} Maybe Bool
a -> CreateStorediSCSIVolume
s {$sel:kmsEncrypted:CreateStorediSCSIVolume' :: Maybe Bool
kmsEncrypted = Maybe Bool
a} :: CreateStorediSCSIVolume)
createStorediSCSIVolume_tags :: Lens.Lens' CreateStorediSCSIVolume (Prelude.Maybe [Tag])
createStorediSCSIVolume_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateStorediSCSIVolume -> f CreateStorediSCSIVolume
createStorediSCSIVolume_tags = (CreateStorediSCSIVolume -> Maybe [Tag])
-> (CreateStorediSCSIVolume
-> Maybe [Tag] -> CreateStorediSCSIVolume)
-> Lens
CreateStorediSCSIVolume
CreateStorediSCSIVolume
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolume' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateStorediSCSIVolume
s@CreateStorediSCSIVolume' {} Maybe [Tag]
a -> CreateStorediSCSIVolume
s {$sel:tags:CreateStorediSCSIVolume' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateStorediSCSIVolume) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateStorediSCSIVolume -> f CreateStorediSCSIVolume)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateStorediSCSIVolume
-> f CreateStorediSCSIVolume
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
createStorediSCSIVolume_snapshotId :: Lens.Lens' CreateStorediSCSIVolume (Prelude.Maybe Prelude.Text)
createStorediSCSIVolume_snapshotId :: (Maybe Text -> f (Maybe Text))
-> CreateStorediSCSIVolume -> f CreateStorediSCSIVolume
createStorediSCSIVolume_snapshotId = (CreateStorediSCSIVolume -> Maybe Text)
-> (CreateStorediSCSIVolume
-> Maybe Text -> CreateStorediSCSIVolume)
-> Lens
CreateStorediSCSIVolume
CreateStorediSCSIVolume
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolume' {Maybe Text
snapshotId :: Maybe Text
$sel:snapshotId:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Maybe Text
snapshotId} -> Maybe Text
snapshotId) (\s :: CreateStorediSCSIVolume
s@CreateStorediSCSIVolume' {} Maybe Text
a -> CreateStorediSCSIVolume
s {$sel:snapshotId:CreateStorediSCSIVolume' :: Maybe Text
snapshotId = Maybe Text
a} :: CreateStorediSCSIVolume)
createStorediSCSIVolume_gatewayARN :: Lens.Lens' CreateStorediSCSIVolume Prelude.Text
createStorediSCSIVolume_gatewayARN :: (Text -> f Text)
-> CreateStorediSCSIVolume -> f CreateStorediSCSIVolume
createStorediSCSIVolume_gatewayARN = (CreateStorediSCSIVolume -> Text)
-> (CreateStorediSCSIVolume -> Text -> CreateStorediSCSIVolume)
-> Lens CreateStorediSCSIVolume CreateStorediSCSIVolume Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolume' {Text
gatewayARN :: Text
$sel:gatewayARN:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Text
gatewayARN} -> Text
gatewayARN) (\s :: CreateStorediSCSIVolume
s@CreateStorediSCSIVolume' {} Text
a -> CreateStorediSCSIVolume
s {$sel:gatewayARN:CreateStorediSCSIVolume' :: Text
gatewayARN = Text
a} :: CreateStorediSCSIVolume)
createStorediSCSIVolume_diskId :: Lens.Lens' CreateStorediSCSIVolume Prelude.Text
createStorediSCSIVolume_diskId :: (Text -> f Text)
-> CreateStorediSCSIVolume -> f CreateStorediSCSIVolume
createStorediSCSIVolume_diskId = (CreateStorediSCSIVolume -> Text)
-> (CreateStorediSCSIVolume -> Text -> CreateStorediSCSIVolume)
-> Lens CreateStorediSCSIVolume CreateStorediSCSIVolume Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolume' {Text
diskId :: Text
$sel:diskId:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Text
diskId} -> Text
diskId) (\s :: CreateStorediSCSIVolume
s@CreateStorediSCSIVolume' {} Text
a -> CreateStorediSCSIVolume
s {$sel:diskId:CreateStorediSCSIVolume' :: Text
diskId = Text
a} :: CreateStorediSCSIVolume)
createStorediSCSIVolume_preserveExistingData :: Lens.Lens' CreateStorediSCSIVolume Prelude.Bool
createStorediSCSIVolume_preserveExistingData :: (Bool -> f Bool)
-> CreateStorediSCSIVolume -> f CreateStorediSCSIVolume
createStorediSCSIVolume_preserveExistingData = (CreateStorediSCSIVolume -> Bool)
-> (CreateStorediSCSIVolume -> Bool -> CreateStorediSCSIVolume)
-> Lens CreateStorediSCSIVolume CreateStorediSCSIVolume Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolume' {Bool
preserveExistingData :: Bool
$sel:preserveExistingData:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Bool
preserveExistingData} -> Bool
preserveExistingData) (\s :: CreateStorediSCSIVolume
s@CreateStorediSCSIVolume' {} Bool
a -> CreateStorediSCSIVolume
s {$sel:preserveExistingData:CreateStorediSCSIVolume' :: Bool
preserveExistingData = Bool
a} :: CreateStorediSCSIVolume)
createStorediSCSIVolume_targetName :: Lens.Lens' CreateStorediSCSIVolume Prelude.Text
createStorediSCSIVolume_targetName :: (Text -> f Text)
-> CreateStorediSCSIVolume -> f CreateStorediSCSIVolume
createStorediSCSIVolume_targetName = (CreateStorediSCSIVolume -> Text)
-> (CreateStorediSCSIVolume -> Text -> CreateStorediSCSIVolume)
-> Lens CreateStorediSCSIVolume CreateStorediSCSIVolume Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolume' {Text
targetName :: Text
$sel:targetName:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Text
targetName} -> Text
targetName) (\s :: CreateStorediSCSIVolume
s@CreateStorediSCSIVolume' {} Text
a -> CreateStorediSCSIVolume
s {$sel:targetName:CreateStorediSCSIVolume' :: Text
targetName = Text
a} :: CreateStorediSCSIVolume)
createStorediSCSIVolume_networkInterfaceId :: Lens.Lens' CreateStorediSCSIVolume Prelude.Text
createStorediSCSIVolume_networkInterfaceId :: (Text -> f Text)
-> CreateStorediSCSIVolume -> f CreateStorediSCSIVolume
createStorediSCSIVolume_networkInterfaceId = (CreateStorediSCSIVolume -> Text)
-> (CreateStorediSCSIVolume -> Text -> CreateStorediSCSIVolume)
-> Lens CreateStorediSCSIVolume CreateStorediSCSIVolume Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolume' {Text
networkInterfaceId :: Text
$sel:networkInterfaceId:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Text
networkInterfaceId} -> Text
networkInterfaceId) (\s :: CreateStorediSCSIVolume
s@CreateStorediSCSIVolume' {} Text
a -> CreateStorediSCSIVolume
s {$sel:networkInterfaceId:CreateStorediSCSIVolume' :: Text
networkInterfaceId = Text
a} :: CreateStorediSCSIVolume)
instance Core.AWSRequest CreateStorediSCSIVolume where
type
AWSResponse CreateStorediSCSIVolume =
CreateStorediSCSIVolumeResponse
request :: CreateStorediSCSIVolume -> Request CreateStorediSCSIVolume
request = Service
-> CreateStorediSCSIVolume -> Request CreateStorediSCSIVolume
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateStorediSCSIVolume
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateStorediSCSIVolume)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateStorediSCSIVolume))
-> Logger
-> Service
-> Proxy CreateStorediSCSIVolume
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateStorediSCSIVolume)))
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
-> Maybe Integer
-> Int
-> CreateStorediSCSIVolumeResponse
CreateStorediSCSIVolumeResponse'
(Maybe Text
-> Maybe Text
-> Maybe Integer
-> Int
-> CreateStorediSCSIVolumeResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Integer -> Int -> CreateStorediSCSIVolumeResponse)
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
-> Maybe Integer -> Int -> CreateStorediSCSIVolumeResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Integer -> Int -> CreateStorediSCSIVolumeResponse)
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 (Maybe Integer -> Int -> CreateStorediSCSIVolumeResponse)
-> Either String (Maybe Integer)
-> Either String (Int -> CreateStorediSCSIVolumeResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"VolumeSizeInBytes")
Either String (Int -> CreateStorediSCSIVolumeResponse)
-> Either String Int
-> Either String CreateStorediSCSIVolumeResponse
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 CreateStorediSCSIVolume
instance Prelude.NFData CreateStorediSCSIVolume
instance Core.ToHeaders CreateStorediSCSIVolume where
toHeaders :: CreateStorediSCSIVolume -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateStorediSCSIVolume -> 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.CreateStorediSCSIVolume" ::
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 CreateStorediSCSIVolume where
toJSON :: CreateStorediSCSIVolume -> Value
toJSON CreateStorediSCSIVolume' {Bool
Maybe Bool
Maybe [Tag]
Maybe Text
Text
networkInterfaceId :: Text
targetName :: Text
preserveExistingData :: Bool
diskId :: Text
gatewayARN :: Text
snapshotId :: Maybe Text
tags :: Maybe [Tag]
kmsEncrypted :: Maybe Bool
kmsKey :: Maybe Text
$sel:networkInterfaceId:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Text
$sel:targetName:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Text
$sel:preserveExistingData:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Bool
$sel:diskId:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Text
$sel:gatewayARN:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Text
$sel:snapshotId:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Maybe Text
$sel:tags:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Maybe [Tag]
$sel:kmsEncrypted:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> Maybe Bool
$sel:kmsKey:CreateStorediSCSIVolume' :: CreateStorediSCSIVolume -> 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
"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
"DiskId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
diskId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"PreserveExistingData"
Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
preserveExistingData
),
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)
]
)
instance Core.ToPath CreateStorediSCSIVolume where
toPath :: CreateStorediSCSIVolume -> ByteString
toPath = ByteString -> CreateStorediSCSIVolume -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateStorediSCSIVolume where
toQuery :: CreateStorediSCSIVolume -> QueryString
toQuery = QueryString -> CreateStorediSCSIVolume -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateStorediSCSIVolumeResponse = CreateStorediSCSIVolumeResponse'
{
CreateStorediSCSIVolumeResponse -> Maybe Text
targetARN :: Prelude.Maybe Prelude.Text,
CreateStorediSCSIVolumeResponse -> Maybe Text
volumeARN :: Prelude.Maybe Prelude.Text,
CreateStorediSCSIVolumeResponse -> Maybe Integer
volumeSizeInBytes :: Prelude.Maybe Prelude.Integer,
CreateStorediSCSIVolumeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateStorediSCSIVolumeResponse
-> CreateStorediSCSIVolumeResponse -> Bool
(CreateStorediSCSIVolumeResponse
-> CreateStorediSCSIVolumeResponse -> Bool)
-> (CreateStorediSCSIVolumeResponse
-> CreateStorediSCSIVolumeResponse -> Bool)
-> Eq CreateStorediSCSIVolumeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateStorediSCSIVolumeResponse
-> CreateStorediSCSIVolumeResponse -> Bool
$c/= :: CreateStorediSCSIVolumeResponse
-> CreateStorediSCSIVolumeResponse -> Bool
== :: CreateStorediSCSIVolumeResponse
-> CreateStorediSCSIVolumeResponse -> Bool
$c== :: CreateStorediSCSIVolumeResponse
-> CreateStorediSCSIVolumeResponse -> Bool
Prelude.Eq, ReadPrec [CreateStorediSCSIVolumeResponse]
ReadPrec CreateStorediSCSIVolumeResponse
Int -> ReadS CreateStorediSCSIVolumeResponse
ReadS [CreateStorediSCSIVolumeResponse]
(Int -> ReadS CreateStorediSCSIVolumeResponse)
-> ReadS [CreateStorediSCSIVolumeResponse]
-> ReadPrec CreateStorediSCSIVolumeResponse
-> ReadPrec [CreateStorediSCSIVolumeResponse]
-> Read CreateStorediSCSIVolumeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateStorediSCSIVolumeResponse]
$creadListPrec :: ReadPrec [CreateStorediSCSIVolumeResponse]
readPrec :: ReadPrec CreateStorediSCSIVolumeResponse
$creadPrec :: ReadPrec CreateStorediSCSIVolumeResponse
readList :: ReadS [CreateStorediSCSIVolumeResponse]
$creadList :: ReadS [CreateStorediSCSIVolumeResponse]
readsPrec :: Int -> ReadS CreateStorediSCSIVolumeResponse
$creadsPrec :: Int -> ReadS CreateStorediSCSIVolumeResponse
Prelude.Read, Int -> CreateStorediSCSIVolumeResponse -> ShowS
[CreateStorediSCSIVolumeResponse] -> ShowS
CreateStorediSCSIVolumeResponse -> String
(Int -> CreateStorediSCSIVolumeResponse -> ShowS)
-> (CreateStorediSCSIVolumeResponse -> String)
-> ([CreateStorediSCSIVolumeResponse] -> ShowS)
-> Show CreateStorediSCSIVolumeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateStorediSCSIVolumeResponse] -> ShowS
$cshowList :: [CreateStorediSCSIVolumeResponse] -> ShowS
show :: CreateStorediSCSIVolumeResponse -> String
$cshow :: CreateStorediSCSIVolumeResponse -> String
showsPrec :: Int -> CreateStorediSCSIVolumeResponse -> ShowS
$cshowsPrec :: Int -> CreateStorediSCSIVolumeResponse -> ShowS
Prelude.Show, (forall x.
CreateStorediSCSIVolumeResponse
-> Rep CreateStorediSCSIVolumeResponse x)
-> (forall x.
Rep CreateStorediSCSIVolumeResponse x
-> CreateStorediSCSIVolumeResponse)
-> Generic CreateStorediSCSIVolumeResponse
forall x.
Rep CreateStorediSCSIVolumeResponse x
-> CreateStorediSCSIVolumeResponse
forall x.
CreateStorediSCSIVolumeResponse
-> Rep CreateStorediSCSIVolumeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateStorediSCSIVolumeResponse x
-> CreateStorediSCSIVolumeResponse
$cfrom :: forall x.
CreateStorediSCSIVolumeResponse
-> Rep CreateStorediSCSIVolumeResponse x
Prelude.Generic)
newCreateStorediSCSIVolumeResponse ::
Prelude.Int ->
CreateStorediSCSIVolumeResponse
newCreateStorediSCSIVolumeResponse :: Int -> CreateStorediSCSIVolumeResponse
newCreateStorediSCSIVolumeResponse Int
pHttpStatus_ =
CreateStorediSCSIVolumeResponse' :: Maybe Text
-> Maybe Text
-> Maybe Integer
-> Int
-> CreateStorediSCSIVolumeResponse
CreateStorediSCSIVolumeResponse'
{ $sel:targetARN:CreateStorediSCSIVolumeResponse' :: Maybe Text
targetARN =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:volumeARN:CreateStorediSCSIVolumeResponse' :: Maybe Text
volumeARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:volumeSizeInBytes:CreateStorediSCSIVolumeResponse' :: Maybe Integer
volumeSizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateStorediSCSIVolumeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createStorediSCSIVolumeResponse_targetARN :: Lens.Lens' CreateStorediSCSIVolumeResponse (Prelude.Maybe Prelude.Text)
createStorediSCSIVolumeResponse_targetARN :: (Maybe Text -> f (Maybe Text))
-> CreateStorediSCSIVolumeResponse
-> f CreateStorediSCSIVolumeResponse
createStorediSCSIVolumeResponse_targetARN = (CreateStorediSCSIVolumeResponse -> Maybe Text)
-> (CreateStorediSCSIVolumeResponse
-> Maybe Text -> CreateStorediSCSIVolumeResponse)
-> Lens
CreateStorediSCSIVolumeResponse
CreateStorediSCSIVolumeResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolumeResponse' {Maybe Text
targetARN :: Maybe Text
$sel:targetARN:CreateStorediSCSIVolumeResponse' :: CreateStorediSCSIVolumeResponse -> Maybe Text
targetARN} -> Maybe Text
targetARN) (\s :: CreateStorediSCSIVolumeResponse
s@CreateStorediSCSIVolumeResponse' {} Maybe Text
a -> CreateStorediSCSIVolumeResponse
s {$sel:targetARN:CreateStorediSCSIVolumeResponse' :: Maybe Text
targetARN = Maybe Text
a} :: CreateStorediSCSIVolumeResponse)
createStorediSCSIVolumeResponse_volumeARN :: Lens.Lens' CreateStorediSCSIVolumeResponse (Prelude.Maybe Prelude.Text)
createStorediSCSIVolumeResponse_volumeARN :: (Maybe Text -> f (Maybe Text))
-> CreateStorediSCSIVolumeResponse
-> f CreateStorediSCSIVolumeResponse
createStorediSCSIVolumeResponse_volumeARN = (CreateStorediSCSIVolumeResponse -> Maybe Text)
-> (CreateStorediSCSIVolumeResponse
-> Maybe Text -> CreateStorediSCSIVolumeResponse)
-> Lens
CreateStorediSCSIVolumeResponse
CreateStorediSCSIVolumeResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolumeResponse' {Maybe Text
volumeARN :: Maybe Text
$sel:volumeARN:CreateStorediSCSIVolumeResponse' :: CreateStorediSCSIVolumeResponse -> Maybe Text
volumeARN} -> Maybe Text
volumeARN) (\s :: CreateStorediSCSIVolumeResponse
s@CreateStorediSCSIVolumeResponse' {} Maybe Text
a -> CreateStorediSCSIVolumeResponse
s {$sel:volumeARN:CreateStorediSCSIVolumeResponse' :: Maybe Text
volumeARN = Maybe Text
a} :: CreateStorediSCSIVolumeResponse)
createStorediSCSIVolumeResponse_volumeSizeInBytes :: Lens.Lens' CreateStorediSCSIVolumeResponse (Prelude.Maybe Prelude.Integer)
createStorediSCSIVolumeResponse_volumeSizeInBytes :: (Maybe Integer -> f (Maybe Integer))
-> CreateStorediSCSIVolumeResponse
-> f CreateStorediSCSIVolumeResponse
createStorediSCSIVolumeResponse_volumeSizeInBytes = (CreateStorediSCSIVolumeResponse -> Maybe Integer)
-> (CreateStorediSCSIVolumeResponse
-> Maybe Integer -> CreateStorediSCSIVolumeResponse)
-> Lens
CreateStorediSCSIVolumeResponse
CreateStorediSCSIVolumeResponse
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolumeResponse' {Maybe Integer
volumeSizeInBytes :: Maybe Integer
$sel:volumeSizeInBytes:CreateStorediSCSIVolumeResponse' :: CreateStorediSCSIVolumeResponse -> Maybe Integer
volumeSizeInBytes} -> Maybe Integer
volumeSizeInBytes) (\s :: CreateStorediSCSIVolumeResponse
s@CreateStorediSCSIVolumeResponse' {} Maybe Integer
a -> CreateStorediSCSIVolumeResponse
s {$sel:volumeSizeInBytes:CreateStorediSCSIVolumeResponse' :: Maybe Integer
volumeSizeInBytes = Maybe Integer
a} :: CreateStorediSCSIVolumeResponse)
createStorediSCSIVolumeResponse_httpStatus :: Lens.Lens' CreateStorediSCSIVolumeResponse Prelude.Int
createStorediSCSIVolumeResponse_httpStatus :: (Int -> f Int)
-> CreateStorediSCSIVolumeResponse
-> f CreateStorediSCSIVolumeResponse
createStorediSCSIVolumeResponse_httpStatus = (CreateStorediSCSIVolumeResponse -> Int)
-> (CreateStorediSCSIVolumeResponse
-> Int -> CreateStorediSCSIVolumeResponse)
-> Lens
CreateStorediSCSIVolumeResponse
CreateStorediSCSIVolumeResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateStorediSCSIVolumeResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateStorediSCSIVolumeResponse' :: CreateStorediSCSIVolumeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateStorediSCSIVolumeResponse
s@CreateStorediSCSIVolumeResponse' {} Int
a -> CreateStorediSCSIVolumeResponse
s {$sel:httpStatus:CreateStorediSCSIVolumeResponse' :: Int
httpStatus = Int
a} :: CreateStorediSCSIVolumeResponse)
instance
Prelude.NFData
CreateStorediSCSIVolumeResponse