{-# 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.Lightsail.CreateDiskFromSnapshot
(
CreateDiskFromSnapshot (..),
newCreateDiskFromSnapshot,
createDiskFromSnapshot_useLatestRestorableAutoSnapshot,
createDiskFromSnapshot_sourceDiskName,
createDiskFromSnapshot_addOns,
createDiskFromSnapshot_diskSnapshotName,
createDiskFromSnapshot_restoreDate,
createDiskFromSnapshot_tags,
createDiskFromSnapshot_diskName,
createDiskFromSnapshot_availabilityZone,
createDiskFromSnapshot_sizeInGb,
CreateDiskFromSnapshotResponse (..),
newCreateDiskFromSnapshotResponse,
createDiskFromSnapshotResponse_operations,
createDiskFromSnapshotResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateDiskFromSnapshot = CreateDiskFromSnapshot'
{
CreateDiskFromSnapshot -> Maybe Bool
useLatestRestorableAutoSnapshot :: Prelude.Maybe Prelude.Bool,
CreateDiskFromSnapshot -> Maybe Text
sourceDiskName :: Prelude.Maybe Prelude.Text,
CreateDiskFromSnapshot -> Maybe [AddOnRequest]
addOns :: Prelude.Maybe [AddOnRequest],
CreateDiskFromSnapshot -> Maybe Text
diskSnapshotName :: Prelude.Maybe Prelude.Text,
CreateDiskFromSnapshot -> Maybe Text
restoreDate :: Prelude.Maybe Prelude.Text,
CreateDiskFromSnapshot -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateDiskFromSnapshot -> Text
diskName :: Prelude.Text,
CreateDiskFromSnapshot -> Text
availabilityZone :: Prelude.Text,
CreateDiskFromSnapshot -> Int
sizeInGb :: Prelude.Int
}
deriving (CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool
(CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool)
-> (CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool)
-> Eq CreateDiskFromSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool
$c/= :: CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool
== :: CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool
$c== :: CreateDiskFromSnapshot -> CreateDiskFromSnapshot -> Bool
Prelude.Eq, ReadPrec [CreateDiskFromSnapshot]
ReadPrec CreateDiskFromSnapshot
Int -> ReadS CreateDiskFromSnapshot
ReadS [CreateDiskFromSnapshot]
(Int -> ReadS CreateDiskFromSnapshot)
-> ReadS [CreateDiskFromSnapshot]
-> ReadPrec CreateDiskFromSnapshot
-> ReadPrec [CreateDiskFromSnapshot]
-> Read CreateDiskFromSnapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDiskFromSnapshot]
$creadListPrec :: ReadPrec [CreateDiskFromSnapshot]
readPrec :: ReadPrec CreateDiskFromSnapshot
$creadPrec :: ReadPrec CreateDiskFromSnapshot
readList :: ReadS [CreateDiskFromSnapshot]
$creadList :: ReadS [CreateDiskFromSnapshot]
readsPrec :: Int -> ReadS CreateDiskFromSnapshot
$creadsPrec :: Int -> ReadS CreateDiskFromSnapshot
Prelude.Read, Int -> CreateDiskFromSnapshot -> ShowS
[CreateDiskFromSnapshot] -> ShowS
CreateDiskFromSnapshot -> String
(Int -> CreateDiskFromSnapshot -> ShowS)
-> (CreateDiskFromSnapshot -> String)
-> ([CreateDiskFromSnapshot] -> ShowS)
-> Show CreateDiskFromSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDiskFromSnapshot] -> ShowS
$cshowList :: [CreateDiskFromSnapshot] -> ShowS
show :: CreateDiskFromSnapshot -> String
$cshow :: CreateDiskFromSnapshot -> String
showsPrec :: Int -> CreateDiskFromSnapshot -> ShowS
$cshowsPrec :: Int -> CreateDiskFromSnapshot -> ShowS
Prelude.Show, (forall x. CreateDiskFromSnapshot -> Rep CreateDiskFromSnapshot x)
-> (forall x.
Rep CreateDiskFromSnapshot x -> CreateDiskFromSnapshot)
-> Generic CreateDiskFromSnapshot
forall x. Rep CreateDiskFromSnapshot x -> CreateDiskFromSnapshot
forall x. CreateDiskFromSnapshot -> Rep CreateDiskFromSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDiskFromSnapshot x -> CreateDiskFromSnapshot
$cfrom :: forall x. CreateDiskFromSnapshot -> Rep CreateDiskFromSnapshot x
Prelude.Generic)
newCreateDiskFromSnapshot ::
Prelude.Text ->
Prelude.Text ->
Prelude.Int ->
CreateDiskFromSnapshot
newCreateDiskFromSnapshot :: Text -> Text -> Int -> CreateDiskFromSnapshot
newCreateDiskFromSnapshot
Text
pDiskName_
Text
pAvailabilityZone_
Int
pSizeInGb_ =
CreateDiskFromSnapshot' :: Maybe Bool
-> Maybe Text
-> Maybe [AddOnRequest]
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> Int
-> CreateDiskFromSnapshot
CreateDiskFromSnapshot'
{ $sel:useLatestRestorableAutoSnapshot:CreateDiskFromSnapshot' :: Maybe Bool
useLatestRestorableAutoSnapshot =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:sourceDiskName:CreateDiskFromSnapshot' :: Maybe Text
sourceDiskName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:addOns:CreateDiskFromSnapshot' :: Maybe [AddOnRequest]
addOns = Maybe [AddOnRequest]
forall a. Maybe a
Prelude.Nothing,
$sel:diskSnapshotName:CreateDiskFromSnapshot' :: Maybe Text
diskSnapshotName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:restoreDate:CreateDiskFromSnapshot' :: Maybe Text
restoreDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateDiskFromSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:diskName:CreateDiskFromSnapshot' :: Text
diskName = Text
pDiskName_,
$sel:availabilityZone:CreateDiskFromSnapshot' :: Text
availabilityZone = Text
pAvailabilityZone_,
$sel:sizeInGb:CreateDiskFromSnapshot' :: Int
sizeInGb = Int
pSizeInGb_
}
createDiskFromSnapshot_useLatestRestorableAutoSnapshot :: Lens.Lens' CreateDiskFromSnapshot (Prelude.Maybe Prelude.Bool)
createDiskFromSnapshot_useLatestRestorableAutoSnapshot :: (Maybe Bool -> f (Maybe Bool))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_useLatestRestorableAutoSnapshot = (CreateDiskFromSnapshot -> Maybe Bool)
-> (CreateDiskFromSnapshot -> Maybe Bool -> CreateDiskFromSnapshot)
-> Lens
CreateDiskFromSnapshot
CreateDiskFromSnapshot
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Maybe Bool
useLatestRestorableAutoSnapshot :: Maybe Bool
$sel:useLatestRestorableAutoSnapshot:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Bool
useLatestRestorableAutoSnapshot} -> Maybe Bool
useLatestRestorableAutoSnapshot) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Maybe Bool
a -> CreateDiskFromSnapshot
s {$sel:useLatestRestorableAutoSnapshot:CreateDiskFromSnapshot' :: Maybe Bool
useLatestRestorableAutoSnapshot = Maybe Bool
a} :: CreateDiskFromSnapshot)
createDiskFromSnapshot_sourceDiskName :: Lens.Lens' CreateDiskFromSnapshot (Prelude.Maybe Prelude.Text)
createDiskFromSnapshot_sourceDiskName :: (Maybe Text -> f (Maybe Text))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_sourceDiskName = (CreateDiskFromSnapshot -> Maybe Text)
-> (CreateDiskFromSnapshot -> Maybe Text -> CreateDiskFromSnapshot)
-> Lens
CreateDiskFromSnapshot
CreateDiskFromSnapshot
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Maybe Text
sourceDiskName :: Maybe Text
$sel:sourceDiskName:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Text
sourceDiskName} -> Maybe Text
sourceDiskName) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Maybe Text
a -> CreateDiskFromSnapshot
s {$sel:sourceDiskName:CreateDiskFromSnapshot' :: Maybe Text
sourceDiskName = Maybe Text
a} :: CreateDiskFromSnapshot)
createDiskFromSnapshot_addOns :: Lens.Lens' CreateDiskFromSnapshot (Prelude.Maybe [AddOnRequest])
createDiskFromSnapshot_addOns :: (Maybe [AddOnRequest] -> f (Maybe [AddOnRequest]))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_addOns = (CreateDiskFromSnapshot -> Maybe [AddOnRequest])
-> (CreateDiskFromSnapshot
-> Maybe [AddOnRequest] -> CreateDiskFromSnapshot)
-> Lens
CreateDiskFromSnapshot
CreateDiskFromSnapshot
(Maybe [AddOnRequest])
(Maybe [AddOnRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Maybe [AddOnRequest]
addOns :: Maybe [AddOnRequest]
$sel:addOns:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe [AddOnRequest]
addOns} -> Maybe [AddOnRequest]
addOns) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Maybe [AddOnRequest]
a -> CreateDiskFromSnapshot
s {$sel:addOns:CreateDiskFromSnapshot' :: Maybe [AddOnRequest]
addOns = Maybe [AddOnRequest]
a} :: CreateDiskFromSnapshot) ((Maybe [AddOnRequest] -> f (Maybe [AddOnRequest]))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot)
-> ((Maybe [AddOnRequest] -> f (Maybe [AddOnRequest]))
-> Maybe [AddOnRequest] -> f (Maybe [AddOnRequest]))
-> (Maybe [AddOnRequest] -> f (Maybe [AddOnRequest]))
-> CreateDiskFromSnapshot
-> f CreateDiskFromSnapshot
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [AddOnRequest] [AddOnRequest] [AddOnRequest] [AddOnRequest]
-> Iso
(Maybe [AddOnRequest])
(Maybe [AddOnRequest])
(Maybe [AddOnRequest])
(Maybe [AddOnRequest])
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 [AddOnRequest] [AddOnRequest] [AddOnRequest] [AddOnRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDiskFromSnapshot_diskSnapshotName :: Lens.Lens' CreateDiskFromSnapshot (Prelude.Maybe Prelude.Text)
createDiskFromSnapshot_diskSnapshotName :: (Maybe Text -> f (Maybe Text))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_diskSnapshotName = (CreateDiskFromSnapshot -> Maybe Text)
-> (CreateDiskFromSnapshot -> Maybe Text -> CreateDiskFromSnapshot)
-> Lens
CreateDiskFromSnapshot
CreateDiskFromSnapshot
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Maybe Text
diskSnapshotName :: Maybe Text
$sel:diskSnapshotName:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Text
diskSnapshotName} -> Maybe Text
diskSnapshotName) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Maybe Text
a -> CreateDiskFromSnapshot
s {$sel:diskSnapshotName:CreateDiskFromSnapshot' :: Maybe Text
diskSnapshotName = Maybe Text
a} :: CreateDiskFromSnapshot)
createDiskFromSnapshot_restoreDate :: Lens.Lens' CreateDiskFromSnapshot (Prelude.Maybe Prelude.Text)
createDiskFromSnapshot_restoreDate :: (Maybe Text -> f (Maybe Text))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_restoreDate = (CreateDiskFromSnapshot -> Maybe Text)
-> (CreateDiskFromSnapshot -> Maybe Text -> CreateDiskFromSnapshot)
-> Lens
CreateDiskFromSnapshot
CreateDiskFromSnapshot
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Maybe Text
restoreDate :: Maybe Text
$sel:restoreDate:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Text
restoreDate} -> Maybe Text
restoreDate) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Maybe Text
a -> CreateDiskFromSnapshot
s {$sel:restoreDate:CreateDiskFromSnapshot' :: Maybe Text
restoreDate = Maybe Text
a} :: CreateDiskFromSnapshot)
createDiskFromSnapshot_tags :: Lens.Lens' CreateDiskFromSnapshot (Prelude.Maybe [Tag])
createDiskFromSnapshot_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_tags = (CreateDiskFromSnapshot -> Maybe [Tag])
-> (CreateDiskFromSnapshot
-> Maybe [Tag] -> CreateDiskFromSnapshot)
-> Lens
CreateDiskFromSnapshot
CreateDiskFromSnapshot
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Maybe [Tag]
a -> CreateDiskFromSnapshot
s {$sel:tags:CreateDiskFromSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateDiskFromSnapshot) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDiskFromSnapshot
-> f CreateDiskFromSnapshot
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
createDiskFromSnapshot_diskName :: Lens.Lens' CreateDiskFromSnapshot Prelude.Text
createDiskFromSnapshot_diskName :: (Text -> f Text)
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_diskName = (CreateDiskFromSnapshot -> Text)
-> (CreateDiskFromSnapshot -> Text -> CreateDiskFromSnapshot)
-> Lens CreateDiskFromSnapshot CreateDiskFromSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Text
diskName :: Text
$sel:diskName:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Text
diskName} -> Text
diskName) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Text
a -> CreateDiskFromSnapshot
s {$sel:diskName:CreateDiskFromSnapshot' :: Text
diskName = Text
a} :: CreateDiskFromSnapshot)
createDiskFromSnapshot_availabilityZone :: Lens.Lens' CreateDiskFromSnapshot Prelude.Text
createDiskFromSnapshot_availabilityZone :: (Text -> f Text)
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_availabilityZone = (CreateDiskFromSnapshot -> Text)
-> (CreateDiskFromSnapshot -> Text -> CreateDiskFromSnapshot)
-> Lens CreateDiskFromSnapshot CreateDiskFromSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Text
availabilityZone :: Text
$sel:availabilityZone:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Text
availabilityZone} -> Text
availabilityZone) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Text
a -> CreateDiskFromSnapshot
s {$sel:availabilityZone:CreateDiskFromSnapshot' :: Text
availabilityZone = Text
a} :: CreateDiskFromSnapshot)
createDiskFromSnapshot_sizeInGb :: Lens.Lens' CreateDiskFromSnapshot Prelude.Int
createDiskFromSnapshot_sizeInGb :: (Int -> f Int)
-> CreateDiskFromSnapshot -> f CreateDiskFromSnapshot
createDiskFromSnapshot_sizeInGb = (CreateDiskFromSnapshot -> Int)
-> (CreateDiskFromSnapshot -> Int -> CreateDiskFromSnapshot)
-> Lens CreateDiskFromSnapshot CreateDiskFromSnapshot Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshot' {Int
sizeInGb :: Int
$sel:sizeInGb:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Int
sizeInGb} -> Int
sizeInGb) (\s :: CreateDiskFromSnapshot
s@CreateDiskFromSnapshot' {} Int
a -> CreateDiskFromSnapshot
s {$sel:sizeInGb:CreateDiskFromSnapshot' :: Int
sizeInGb = Int
a} :: CreateDiskFromSnapshot)
instance Core.AWSRequest CreateDiskFromSnapshot where
type
AWSResponse CreateDiskFromSnapshot =
CreateDiskFromSnapshotResponse
request :: CreateDiskFromSnapshot -> Request CreateDiskFromSnapshot
request = Service -> CreateDiskFromSnapshot -> Request CreateDiskFromSnapshot
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateDiskFromSnapshot
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateDiskFromSnapshot)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateDiskFromSnapshot))
-> Logger
-> Service
-> Proxy CreateDiskFromSnapshot
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateDiskFromSnapshot)))
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 [Operation] -> Int -> CreateDiskFromSnapshotResponse
CreateDiskFromSnapshotResponse'
(Maybe [Operation] -> Int -> CreateDiskFromSnapshotResponse)
-> Either String (Maybe [Operation])
-> Either String (Int -> CreateDiskFromSnapshotResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Operation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"operations" Either String (Maybe (Maybe [Operation]))
-> Maybe [Operation] -> Either String (Maybe [Operation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Operation]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> CreateDiskFromSnapshotResponse)
-> Either String Int
-> Either String CreateDiskFromSnapshotResponse
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 CreateDiskFromSnapshot
instance Prelude.NFData CreateDiskFromSnapshot
instance Core.ToHeaders CreateDiskFromSnapshot where
toHeaders :: CreateDiskFromSnapshot -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateDiskFromSnapshot -> 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
"Lightsail_20161128.CreateDiskFromSnapshot" ::
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 CreateDiskFromSnapshot where
toJSON :: CreateDiskFromSnapshot -> Value
toJSON CreateDiskFromSnapshot' {Int
Maybe Bool
Maybe [AddOnRequest]
Maybe [Tag]
Maybe Text
Text
sizeInGb :: Int
availabilityZone :: Text
diskName :: Text
tags :: Maybe [Tag]
restoreDate :: Maybe Text
diskSnapshotName :: Maybe Text
addOns :: Maybe [AddOnRequest]
sourceDiskName :: Maybe Text
useLatestRestorableAutoSnapshot :: Maybe Bool
$sel:sizeInGb:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Int
$sel:availabilityZone:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Text
$sel:diskName:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Text
$sel:tags:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe [Tag]
$sel:restoreDate:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Text
$sel:diskSnapshotName:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Text
$sel:addOns:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe [AddOnRequest]
$sel:sourceDiskName:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Text
$sel:useLatestRestorableAutoSnapshot:CreateDiskFromSnapshot' :: CreateDiskFromSnapshot -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"useLatestRestorableAutoSnapshot" 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
useLatestRestorableAutoSnapshot,
(Text
"sourceDiskName" 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
sourceDiskName,
(Text
"addOns" Text -> [AddOnRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([AddOnRequest] -> Pair) -> Maybe [AddOnRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AddOnRequest]
addOns,
(Text
"diskSnapshotName" 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
diskSnapshotName,
(Text
"restoreDate" 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
restoreDate,
(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,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"diskName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
diskName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"availabilityZone" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
availabilityZone),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"sizeInGb" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
sizeInGb)
]
)
instance Core.ToPath CreateDiskFromSnapshot where
toPath :: CreateDiskFromSnapshot -> ByteString
toPath = ByteString -> CreateDiskFromSnapshot -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateDiskFromSnapshot where
toQuery :: CreateDiskFromSnapshot -> QueryString
toQuery = QueryString -> CreateDiskFromSnapshot -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateDiskFromSnapshotResponse = CreateDiskFromSnapshotResponse'
{
CreateDiskFromSnapshotResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
CreateDiskFromSnapshotResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateDiskFromSnapshotResponse
-> CreateDiskFromSnapshotResponse -> Bool
(CreateDiskFromSnapshotResponse
-> CreateDiskFromSnapshotResponse -> Bool)
-> (CreateDiskFromSnapshotResponse
-> CreateDiskFromSnapshotResponse -> Bool)
-> Eq CreateDiskFromSnapshotResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDiskFromSnapshotResponse
-> CreateDiskFromSnapshotResponse -> Bool
$c/= :: CreateDiskFromSnapshotResponse
-> CreateDiskFromSnapshotResponse -> Bool
== :: CreateDiskFromSnapshotResponse
-> CreateDiskFromSnapshotResponse -> Bool
$c== :: CreateDiskFromSnapshotResponse
-> CreateDiskFromSnapshotResponse -> Bool
Prelude.Eq, ReadPrec [CreateDiskFromSnapshotResponse]
ReadPrec CreateDiskFromSnapshotResponse
Int -> ReadS CreateDiskFromSnapshotResponse
ReadS [CreateDiskFromSnapshotResponse]
(Int -> ReadS CreateDiskFromSnapshotResponse)
-> ReadS [CreateDiskFromSnapshotResponse]
-> ReadPrec CreateDiskFromSnapshotResponse
-> ReadPrec [CreateDiskFromSnapshotResponse]
-> Read CreateDiskFromSnapshotResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDiskFromSnapshotResponse]
$creadListPrec :: ReadPrec [CreateDiskFromSnapshotResponse]
readPrec :: ReadPrec CreateDiskFromSnapshotResponse
$creadPrec :: ReadPrec CreateDiskFromSnapshotResponse
readList :: ReadS [CreateDiskFromSnapshotResponse]
$creadList :: ReadS [CreateDiskFromSnapshotResponse]
readsPrec :: Int -> ReadS CreateDiskFromSnapshotResponse
$creadsPrec :: Int -> ReadS CreateDiskFromSnapshotResponse
Prelude.Read, Int -> CreateDiskFromSnapshotResponse -> ShowS
[CreateDiskFromSnapshotResponse] -> ShowS
CreateDiskFromSnapshotResponse -> String
(Int -> CreateDiskFromSnapshotResponse -> ShowS)
-> (CreateDiskFromSnapshotResponse -> String)
-> ([CreateDiskFromSnapshotResponse] -> ShowS)
-> Show CreateDiskFromSnapshotResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDiskFromSnapshotResponse] -> ShowS
$cshowList :: [CreateDiskFromSnapshotResponse] -> ShowS
show :: CreateDiskFromSnapshotResponse -> String
$cshow :: CreateDiskFromSnapshotResponse -> String
showsPrec :: Int -> CreateDiskFromSnapshotResponse -> ShowS
$cshowsPrec :: Int -> CreateDiskFromSnapshotResponse -> ShowS
Prelude.Show, (forall x.
CreateDiskFromSnapshotResponse
-> Rep CreateDiskFromSnapshotResponse x)
-> (forall x.
Rep CreateDiskFromSnapshotResponse x
-> CreateDiskFromSnapshotResponse)
-> Generic CreateDiskFromSnapshotResponse
forall x.
Rep CreateDiskFromSnapshotResponse x
-> CreateDiskFromSnapshotResponse
forall x.
CreateDiskFromSnapshotResponse
-> Rep CreateDiskFromSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDiskFromSnapshotResponse x
-> CreateDiskFromSnapshotResponse
$cfrom :: forall x.
CreateDiskFromSnapshotResponse
-> Rep CreateDiskFromSnapshotResponse x
Prelude.Generic)
newCreateDiskFromSnapshotResponse ::
Prelude.Int ->
CreateDiskFromSnapshotResponse
newCreateDiskFromSnapshotResponse :: Int -> CreateDiskFromSnapshotResponse
newCreateDiskFromSnapshotResponse Int
pHttpStatus_ =
CreateDiskFromSnapshotResponse' :: Maybe [Operation] -> Int -> CreateDiskFromSnapshotResponse
CreateDiskFromSnapshotResponse'
{ $sel:operations:CreateDiskFromSnapshotResponse' :: Maybe [Operation]
operations =
Maybe [Operation]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateDiskFromSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createDiskFromSnapshotResponse_operations :: Lens.Lens' CreateDiskFromSnapshotResponse (Prelude.Maybe [Operation])
createDiskFromSnapshotResponse_operations :: (Maybe [Operation] -> f (Maybe [Operation]))
-> CreateDiskFromSnapshotResponse
-> f CreateDiskFromSnapshotResponse
createDiskFromSnapshotResponse_operations = (CreateDiskFromSnapshotResponse -> Maybe [Operation])
-> (CreateDiskFromSnapshotResponse
-> Maybe [Operation] -> CreateDiskFromSnapshotResponse)
-> Lens
CreateDiskFromSnapshotResponse
CreateDiskFromSnapshotResponse
(Maybe [Operation])
(Maybe [Operation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshotResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:CreateDiskFromSnapshotResponse' :: CreateDiskFromSnapshotResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: CreateDiskFromSnapshotResponse
s@CreateDiskFromSnapshotResponse' {} Maybe [Operation]
a -> CreateDiskFromSnapshotResponse
s {$sel:operations:CreateDiskFromSnapshotResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: CreateDiskFromSnapshotResponse) ((Maybe [Operation] -> f (Maybe [Operation]))
-> CreateDiskFromSnapshotResponse
-> f CreateDiskFromSnapshotResponse)
-> ((Maybe [Operation] -> f (Maybe [Operation]))
-> Maybe [Operation] -> f (Maybe [Operation]))
-> (Maybe [Operation] -> f (Maybe [Operation]))
-> CreateDiskFromSnapshotResponse
-> f CreateDiskFromSnapshotResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Operation] [Operation] [Operation] [Operation]
-> Iso
(Maybe [Operation])
(Maybe [Operation])
(Maybe [Operation])
(Maybe [Operation])
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 [Operation] [Operation] [Operation] [Operation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDiskFromSnapshotResponse_httpStatus :: Lens.Lens' CreateDiskFromSnapshotResponse Prelude.Int
createDiskFromSnapshotResponse_httpStatus :: (Int -> f Int)
-> CreateDiskFromSnapshotResponse
-> f CreateDiskFromSnapshotResponse
createDiskFromSnapshotResponse_httpStatus = (CreateDiskFromSnapshotResponse -> Int)
-> (CreateDiskFromSnapshotResponse
-> Int -> CreateDiskFromSnapshotResponse)
-> Lens
CreateDiskFromSnapshotResponse
CreateDiskFromSnapshotResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiskFromSnapshotResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDiskFromSnapshotResponse' :: CreateDiskFromSnapshotResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDiskFromSnapshotResponse
s@CreateDiskFromSnapshotResponse' {} Int
a -> CreateDiskFromSnapshotResponse
s {$sel:httpStatus:CreateDiskFromSnapshotResponse' :: Int
httpStatus = Int
a} :: CreateDiskFromSnapshotResponse)
instance
Prelude.NFData
CreateDiskFromSnapshotResponse