{-# 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.Snowball.CreateCluster
(
CreateCluster (..),
newCreateCluster,
createCluster_kmsKeyARN,
createCluster_remoteManagement,
createCluster_notification,
createCluster_forwardingAddressId,
createCluster_onDeviceServiceConfiguration,
createCluster_description,
createCluster_taxDocuments,
createCluster_jobType,
createCluster_resources,
createCluster_addressId,
createCluster_roleARN,
createCluster_snowballType,
createCluster_shippingOption,
CreateClusterResponse (..),
newCreateClusterResponse,
createClusterResponse_clusterId,
createClusterResponse_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.Snowball.Types
data CreateCluster = CreateCluster'
{
CreateCluster -> Maybe Text
kmsKeyARN :: Prelude.Maybe Prelude.Text,
CreateCluster -> Maybe RemoteManagement
remoteManagement :: Prelude.Maybe RemoteManagement,
CreateCluster -> Maybe Notification
notification :: Prelude.Maybe Notification,
CreateCluster -> Maybe Text
forwardingAddressId :: Prelude.Maybe Prelude.Text,
CreateCluster -> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration :: Prelude.Maybe OnDeviceServiceConfiguration,
CreateCluster -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
CreateCluster -> Maybe TaxDocuments
taxDocuments :: Prelude.Maybe TaxDocuments,
CreateCluster -> JobType
jobType :: JobType,
CreateCluster -> JobResource
resources :: JobResource,
CreateCluster -> Text
addressId :: Prelude.Text,
CreateCluster -> Text
roleARN :: Prelude.Text,
CreateCluster -> SnowballType
snowballType :: SnowballType,
CreateCluster -> ShippingOption
shippingOption :: ShippingOption
}
deriving (CreateCluster -> CreateCluster -> Bool
(CreateCluster -> CreateCluster -> Bool)
-> (CreateCluster -> CreateCluster -> Bool) -> Eq CreateCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCluster -> CreateCluster -> Bool
$c/= :: CreateCluster -> CreateCluster -> Bool
== :: CreateCluster -> CreateCluster -> Bool
$c== :: CreateCluster -> CreateCluster -> Bool
Prelude.Eq, ReadPrec [CreateCluster]
ReadPrec CreateCluster
Int -> ReadS CreateCluster
ReadS [CreateCluster]
(Int -> ReadS CreateCluster)
-> ReadS [CreateCluster]
-> ReadPrec CreateCluster
-> ReadPrec [CreateCluster]
-> Read CreateCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCluster]
$creadListPrec :: ReadPrec [CreateCluster]
readPrec :: ReadPrec CreateCluster
$creadPrec :: ReadPrec CreateCluster
readList :: ReadS [CreateCluster]
$creadList :: ReadS [CreateCluster]
readsPrec :: Int -> ReadS CreateCluster
$creadsPrec :: Int -> ReadS CreateCluster
Prelude.Read, Int -> CreateCluster -> ShowS
[CreateCluster] -> ShowS
CreateCluster -> String
(Int -> CreateCluster -> ShowS)
-> (CreateCluster -> String)
-> ([CreateCluster] -> ShowS)
-> Show CreateCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCluster] -> ShowS
$cshowList :: [CreateCluster] -> ShowS
show :: CreateCluster -> String
$cshow :: CreateCluster -> String
showsPrec :: Int -> CreateCluster -> ShowS
$cshowsPrec :: Int -> CreateCluster -> ShowS
Prelude.Show, (forall x. CreateCluster -> Rep CreateCluster x)
-> (forall x. Rep CreateCluster x -> CreateCluster)
-> Generic CreateCluster
forall x. Rep CreateCluster x -> CreateCluster
forall x. CreateCluster -> Rep CreateCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCluster x -> CreateCluster
$cfrom :: forall x. CreateCluster -> Rep CreateCluster x
Prelude.Generic)
newCreateCluster ::
JobType ->
JobResource ->
Prelude.Text ->
Prelude.Text ->
SnowballType ->
ShippingOption ->
CreateCluster
newCreateCluster :: JobType
-> JobResource
-> Text
-> Text
-> SnowballType
-> ShippingOption
-> CreateCluster
newCreateCluster
JobType
pJobType_
JobResource
pResources_
Text
pAddressId_
Text
pRoleARN_
SnowballType
pSnowballType_
ShippingOption
pShippingOption_ =
CreateCluster' :: Maybe Text
-> Maybe RemoteManagement
-> Maybe Notification
-> Maybe Text
-> Maybe OnDeviceServiceConfiguration
-> Maybe Text
-> Maybe TaxDocuments
-> JobType
-> JobResource
-> Text
-> Text
-> SnowballType
-> ShippingOption
-> CreateCluster
CreateCluster'
{ $sel:kmsKeyARN:CreateCluster' :: Maybe Text
kmsKeyARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:remoteManagement:CreateCluster' :: Maybe RemoteManagement
remoteManagement = Maybe RemoteManagement
forall a. Maybe a
Prelude.Nothing,
$sel:notification:CreateCluster' :: Maybe Notification
notification = Maybe Notification
forall a. Maybe a
Prelude.Nothing,
$sel:forwardingAddressId:CreateCluster' :: Maybe Text
forwardingAddressId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:onDeviceServiceConfiguration:CreateCluster' :: Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration = Maybe OnDeviceServiceConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:description:CreateCluster' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:taxDocuments:CreateCluster' :: Maybe TaxDocuments
taxDocuments = Maybe TaxDocuments
forall a. Maybe a
Prelude.Nothing,
$sel:jobType:CreateCluster' :: JobType
jobType = JobType
pJobType_,
$sel:resources:CreateCluster' :: JobResource
resources = JobResource
pResources_,
$sel:addressId:CreateCluster' :: Text
addressId = Text
pAddressId_,
$sel:roleARN:CreateCluster' :: Text
roleARN = Text
pRoleARN_,
$sel:snowballType:CreateCluster' :: SnowballType
snowballType = SnowballType
pSnowballType_,
$sel:shippingOption:CreateCluster' :: ShippingOption
shippingOption = ShippingOption
pShippingOption_
}
createCluster_kmsKeyARN :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_kmsKeyARN :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_kmsKeyARN = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
kmsKeyARN :: Maybe Text
$sel:kmsKeyARN:CreateCluster' :: CreateCluster -> Maybe Text
kmsKeyARN} -> Maybe Text
kmsKeyARN) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:kmsKeyARN:CreateCluster' :: Maybe Text
kmsKeyARN = Maybe Text
a} :: CreateCluster)
createCluster_remoteManagement :: Lens.Lens' CreateCluster (Prelude.Maybe RemoteManagement)
createCluster_remoteManagement :: (Maybe RemoteManagement -> f (Maybe RemoteManagement))
-> CreateCluster -> f CreateCluster
createCluster_remoteManagement = (CreateCluster -> Maybe RemoteManagement)
-> (CreateCluster -> Maybe RemoteManagement -> CreateCluster)
-> Lens
CreateCluster
CreateCluster
(Maybe RemoteManagement)
(Maybe RemoteManagement)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe RemoteManagement
remoteManagement :: Maybe RemoteManagement
$sel:remoteManagement:CreateCluster' :: CreateCluster -> Maybe RemoteManagement
remoteManagement} -> Maybe RemoteManagement
remoteManagement) (\s :: CreateCluster
s@CreateCluster' {} Maybe RemoteManagement
a -> CreateCluster
s {$sel:remoteManagement:CreateCluster' :: Maybe RemoteManagement
remoteManagement = Maybe RemoteManagement
a} :: CreateCluster)
createCluster_notification :: Lens.Lens' CreateCluster (Prelude.Maybe Notification)
createCluster_notification :: (Maybe Notification -> f (Maybe Notification))
-> CreateCluster -> f CreateCluster
createCluster_notification = (CreateCluster -> Maybe Notification)
-> (CreateCluster -> Maybe Notification -> CreateCluster)
-> Lens
CreateCluster
CreateCluster
(Maybe Notification)
(Maybe Notification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Notification
notification :: Maybe Notification
$sel:notification:CreateCluster' :: CreateCluster -> Maybe Notification
notification} -> Maybe Notification
notification) (\s :: CreateCluster
s@CreateCluster' {} Maybe Notification
a -> CreateCluster
s {$sel:notification:CreateCluster' :: Maybe Notification
notification = Maybe Notification
a} :: CreateCluster)
createCluster_forwardingAddressId :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_forwardingAddressId :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_forwardingAddressId = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
forwardingAddressId :: Maybe Text
$sel:forwardingAddressId:CreateCluster' :: CreateCluster -> Maybe Text
forwardingAddressId} -> Maybe Text
forwardingAddressId) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:forwardingAddressId:CreateCluster' :: Maybe Text
forwardingAddressId = Maybe Text
a} :: CreateCluster)
createCluster_onDeviceServiceConfiguration :: Lens.Lens' CreateCluster (Prelude.Maybe OnDeviceServiceConfiguration)
createCluster_onDeviceServiceConfiguration :: (Maybe OnDeviceServiceConfiguration
-> f (Maybe OnDeviceServiceConfiguration))
-> CreateCluster -> f CreateCluster
createCluster_onDeviceServiceConfiguration = (CreateCluster -> Maybe OnDeviceServiceConfiguration)
-> (CreateCluster
-> Maybe OnDeviceServiceConfiguration -> CreateCluster)
-> Lens
CreateCluster
CreateCluster
(Maybe OnDeviceServiceConfiguration)
(Maybe OnDeviceServiceConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration :: Maybe OnDeviceServiceConfiguration
$sel:onDeviceServiceConfiguration:CreateCluster' :: CreateCluster -> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration} -> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration) (\s :: CreateCluster
s@CreateCluster' {} Maybe OnDeviceServiceConfiguration
a -> CreateCluster
s {$sel:onDeviceServiceConfiguration:CreateCluster' :: Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration = Maybe OnDeviceServiceConfiguration
a} :: CreateCluster)
createCluster_description :: Lens.Lens' CreateCluster (Prelude.Maybe Prelude.Text)
createCluster_description :: (Maybe Text -> f (Maybe Text)) -> CreateCluster -> f CreateCluster
createCluster_description = (CreateCluster -> Maybe Text)
-> (CreateCluster -> Maybe Text -> CreateCluster)
-> Lens CreateCluster CreateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe Text
description :: Maybe Text
$sel:description:CreateCluster' :: CreateCluster -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateCluster
s@CreateCluster' {} Maybe Text
a -> CreateCluster
s {$sel:description:CreateCluster' :: Maybe Text
description = Maybe Text
a} :: CreateCluster)
createCluster_taxDocuments :: Lens.Lens' CreateCluster (Prelude.Maybe TaxDocuments)
createCluster_taxDocuments :: (Maybe TaxDocuments -> f (Maybe TaxDocuments))
-> CreateCluster -> f CreateCluster
createCluster_taxDocuments = (CreateCluster -> Maybe TaxDocuments)
-> (CreateCluster -> Maybe TaxDocuments -> CreateCluster)
-> Lens
CreateCluster
CreateCluster
(Maybe TaxDocuments)
(Maybe TaxDocuments)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Maybe TaxDocuments
taxDocuments :: Maybe TaxDocuments
$sel:taxDocuments:CreateCluster' :: CreateCluster -> Maybe TaxDocuments
taxDocuments} -> Maybe TaxDocuments
taxDocuments) (\s :: CreateCluster
s@CreateCluster' {} Maybe TaxDocuments
a -> CreateCluster
s {$sel:taxDocuments:CreateCluster' :: Maybe TaxDocuments
taxDocuments = Maybe TaxDocuments
a} :: CreateCluster)
createCluster_jobType :: Lens.Lens' CreateCluster JobType
createCluster_jobType :: (JobType -> f JobType) -> CreateCluster -> f CreateCluster
createCluster_jobType = (CreateCluster -> JobType)
-> (CreateCluster -> JobType -> CreateCluster)
-> Lens CreateCluster CreateCluster JobType JobType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {JobType
jobType :: JobType
$sel:jobType:CreateCluster' :: CreateCluster -> JobType
jobType} -> JobType
jobType) (\s :: CreateCluster
s@CreateCluster' {} JobType
a -> CreateCluster
s {$sel:jobType:CreateCluster' :: JobType
jobType = JobType
a} :: CreateCluster)
createCluster_resources :: Lens.Lens' CreateCluster JobResource
createCluster_resources :: (JobResource -> f JobResource) -> CreateCluster -> f CreateCluster
createCluster_resources = (CreateCluster -> JobResource)
-> (CreateCluster -> JobResource -> CreateCluster)
-> Lens CreateCluster CreateCluster JobResource JobResource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {JobResource
resources :: JobResource
$sel:resources:CreateCluster' :: CreateCluster -> JobResource
resources} -> JobResource
resources) (\s :: CreateCluster
s@CreateCluster' {} JobResource
a -> CreateCluster
s {$sel:resources:CreateCluster' :: JobResource
resources = JobResource
a} :: CreateCluster)
createCluster_addressId :: Lens.Lens' CreateCluster Prelude.Text
createCluster_addressId :: (Text -> f Text) -> CreateCluster -> f CreateCluster
createCluster_addressId = (CreateCluster -> Text)
-> (CreateCluster -> Text -> CreateCluster)
-> Lens CreateCluster CreateCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Text
addressId :: Text
$sel:addressId:CreateCluster' :: CreateCluster -> Text
addressId} -> Text
addressId) (\s :: CreateCluster
s@CreateCluster' {} Text
a -> CreateCluster
s {$sel:addressId:CreateCluster' :: Text
addressId = Text
a} :: CreateCluster)
createCluster_roleARN :: Lens.Lens' CreateCluster Prelude.Text
createCluster_roleARN :: (Text -> f Text) -> CreateCluster -> f CreateCluster
createCluster_roleARN = (CreateCluster -> Text)
-> (CreateCluster -> Text -> CreateCluster)
-> Lens CreateCluster CreateCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {Text
roleARN :: Text
$sel:roleARN:CreateCluster' :: CreateCluster -> Text
roleARN} -> Text
roleARN) (\s :: CreateCluster
s@CreateCluster' {} Text
a -> CreateCluster
s {$sel:roleARN:CreateCluster' :: Text
roleARN = Text
a} :: CreateCluster)
createCluster_snowballType :: Lens.Lens' CreateCluster SnowballType
createCluster_snowballType :: (SnowballType -> f SnowballType)
-> CreateCluster -> f CreateCluster
createCluster_snowballType = (CreateCluster -> SnowballType)
-> (CreateCluster -> SnowballType -> CreateCluster)
-> Lens CreateCluster CreateCluster SnowballType SnowballType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {SnowballType
snowballType :: SnowballType
$sel:snowballType:CreateCluster' :: CreateCluster -> SnowballType
snowballType} -> SnowballType
snowballType) (\s :: CreateCluster
s@CreateCluster' {} SnowballType
a -> CreateCluster
s {$sel:snowballType:CreateCluster' :: SnowballType
snowballType = SnowballType
a} :: CreateCluster)
createCluster_shippingOption :: Lens.Lens' CreateCluster ShippingOption
createCluster_shippingOption :: (ShippingOption -> f ShippingOption)
-> CreateCluster -> f CreateCluster
createCluster_shippingOption = (CreateCluster -> ShippingOption)
-> (CreateCluster -> ShippingOption -> CreateCluster)
-> Lens CreateCluster CreateCluster ShippingOption ShippingOption
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCluster' {ShippingOption
shippingOption :: ShippingOption
$sel:shippingOption:CreateCluster' :: CreateCluster -> ShippingOption
shippingOption} -> ShippingOption
shippingOption) (\s :: CreateCluster
s@CreateCluster' {} ShippingOption
a -> CreateCluster
s {$sel:shippingOption:CreateCluster' :: ShippingOption
shippingOption = ShippingOption
a} :: CreateCluster)
instance Core.AWSRequest CreateCluster where
type
AWSResponse CreateCluster =
CreateClusterResponse
request :: CreateCluster -> Request CreateCluster
request = Service -> CreateCluster -> Request CreateCluster
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateCluster)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateCluster))
-> Logger
-> Service
-> Proxy CreateCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateCluster)))
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 -> Int -> CreateClusterResponse
CreateClusterResponse'
(Maybe Text -> Int -> CreateClusterResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateClusterResponse)
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
"ClusterId")
Either String (Int -> CreateClusterResponse)
-> Either String Int -> Either String CreateClusterResponse
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 CreateCluster
instance Prelude.NFData CreateCluster
instance Core.ToHeaders CreateCluster where
toHeaders :: CreateCluster -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateCluster -> 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
"AWSIESnowballJobManagementService.CreateCluster" ::
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 CreateCluster where
toJSON :: CreateCluster -> Value
toJSON CreateCluster' {Maybe Text
Maybe Notification
Maybe RemoteManagement
Maybe OnDeviceServiceConfiguration
Maybe TaxDocuments
Text
JobType
ShippingOption
SnowballType
JobResource
shippingOption :: ShippingOption
snowballType :: SnowballType
roleARN :: Text
addressId :: Text
resources :: JobResource
jobType :: JobType
taxDocuments :: Maybe TaxDocuments
description :: Maybe Text
onDeviceServiceConfiguration :: Maybe OnDeviceServiceConfiguration
forwardingAddressId :: Maybe Text
notification :: Maybe Notification
remoteManagement :: Maybe RemoteManagement
kmsKeyARN :: Maybe Text
$sel:shippingOption:CreateCluster' :: CreateCluster -> ShippingOption
$sel:snowballType:CreateCluster' :: CreateCluster -> SnowballType
$sel:roleARN:CreateCluster' :: CreateCluster -> Text
$sel:addressId:CreateCluster' :: CreateCluster -> Text
$sel:resources:CreateCluster' :: CreateCluster -> JobResource
$sel:jobType:CreateCluster' :: CreateCluster -> JobType
$sel:taxDocuments:CreateCluster' :: CreateCluster -> Maybe TaxDocuments
$sel:description:CreateCluster' :: CreateCluster -> Maybe Text
$sel:onDeviceServiceConfiguration:CreateCluster' :: CreateCluster -> Maybe OnDeviceServiceConfiguration
$sel:forwardingAddressId:CreateCluster' :: CreateCluster -> Maybe Text
$sel:notification:CreateCluster' :: CreateCluster -> Maybe Notification
$sel:remoteManagement:CreateCluster' :: CreateCluster -> Maybe RemoteManagement
$sel:kmsKeyARN:CreateCluster' :: CreateCluster -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"KmsKeyARN" 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
kmsKeyARN,
(Text
"RemoteManagement" Text -> RemoteManagement -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(RemoteManagement -> Pair) -> Maybe RemoteManagement -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RemoteManagement
remoteManagement,
(Text
"Notification" Text -> Notification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Notification -> Pair) -> Maybe Notification -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Notification
notification,
(Text
"ForwardingAddressId" 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
forwardingAddressId,
(Text
"OnDeviceServiceConfiguration" Text -> OnDeviceServiceConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(OnDeviceServiceConfiguration -> Pair)
-> Maybe OnDeviceServiceConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration,
(Text
"Description" 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
description,
(Text
"TaxDocuments" Text -> TaxDocuments -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TaxDocuments -> Pair) -> Maybe TaxDocuments -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TaxDocuments
taxDocuments,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"JobType" Text -> JobType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= JobType
jobType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Resources" Text -> JobResource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= JobResource
resources),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AddressId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
addressId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleARN),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SnowballType" Text -> SnowballType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SnowballType
snowballType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ShippingOption" Text -> ShippingOption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ShippingOption
shippingOption)
]
)
instance Core.ToPath CreateCluster where
toPath :: CreateCluster -> ByteString
toPath = ByteString -> CreateCluster -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateCluster where
toQuery :: CreateCluster -> QueryString
toQuery = QueryString -> CreateCluster -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateClusterResponse = CreateClusterResponse'
{
CreateClusterResponse -> Maybe Text
clusterId :: Prelude.Maybe Prelude.Text,
CreateClusterResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateClusterResponse -> CreateClusterResponse -> Bool
(CreateClusterResponse -> CreateClusterResponse -> Bool)
-> (CreateClusterResponse -> CreateClusterResponse -> Bool)
-> Eq CreateClusterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateClusterResponse -> CreateClusterResponse -> Bool
$c/= :: CreateClusterResponse -> CreateClusterResponse -> Bool
== :: CreateClusterResponse -> CreateClusterResponse -> Bool
$c== :: CreateClusterResponse -> CreateClusterResponse -> Bool
Prelude.Eq, ReadPrec [CreateClusterResponse]
ReadPrec CreateClusterResponse
Int -> ReadS CreateClusterResponse
ReadS [CreateClusterResponse]
(Int -> ReadS CreateClusterResponse)
-> ReadS [CreateClusterResponse]
-> ReadPrec CreateClusterResponse
-> ReadPrec [CreateClusterResponse]
-> Read CreateClusterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateClusterResponse]
$creadListPrec :: ReadPrec [CreateClusterResponse]
readPrec :: ReadPrec CreateClusterResponse
$creadPrec :: ReadPrec CreateClusterResponse
readList :: ReadS [CreateClusterResponse]
$creadList :: ReadS [CreateClusterResponse]
readsPrec :: Int -> ReadS CreateClusterResponse
$creadsPrec :: Int -> ReadS CreateClusterResponse
Prelude.Read, Int -> CreateClusterResponse -> ShowS
[CreateClusterResponse] -> ShowS
CreateClusterResponse -> String
(Int -> CreateClusterResponse -> ShowS)
-> (CreateClusterResponse -> String)
-> ([CreateClusterResponse] -> ShowS)
-> Show CreateClusterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateClusterResponse] -> ShowS
$cshowList :: [CreateClusterResponse] -> ShowS
show :: CreateClusterResponse -> String
$cshow :: CreateClusterResponse -> String
showsPrec :: Int -> CreateClusterResponse -> ShowS
$cshowsPrec :: Int -> CreateClusterResponse -> ShowS
Prelude.Show, (forall x. CreateClusterResponse -> Rep CreateClusterResponse x)
-> (forall x. Rep CreateClusterResponse x -> CreateClusterResponse)
-> Generic CreateClusterResponse
forall x. Rep CreateClusterResponse x -> CreateClusterResponse
forall x. CreateClusterResponse -> Rep CreateClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateClusterResponse x -> CreateClusterResponse
$cfrom :: forall x. CreateClusterResponse -> Rep CreateClusterResponse x
Prelude.Generic)
newCreateClusterResponse ::
Prelude.Int ->
CreateClusterResponse
newCreateClusterResponse :: Int -> CreateClusterResponse
newCreateClusterResponse Int
pHttpStatus_ =
CreateClusterResponse' :: Maybe Text -> Int -> CreateClusterResponse
CreateClusterResponse'
{ $sel:clusterId:CreateClusterResponse' :: Maybe Text
clusterId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createClusterResponse_clusterId :: Lens.Lens' CreateClusterResponse (Prelude.Maybe Prelude.Text)
createClusterResponse_clusterId :: (Maybe Text -> f (Maybe Text))
-> CreateClusterResponse -> f CreateClusterResponse
createClusterResponse_clusterId = (CreateClusterResponse -> Maybe Text)
-> (CreateClusterResponse -> Maybe Text -> CreateClusterResponse)
-> Lens
CreateClusterResponse
CreateClusterResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterResponse' {Maybe Text
clusterId :: Maybe Text
$sel:clusterId:CreateClusterResponse' :: CreateClusterResponse -> Maybe Text
clusterId} -> Maybe Text
clusterId) (\s :: CreateClusterResponse
s@CreateClusterResponse' {} Maybe Text
a -> CreateClusterResponse
s {$sel:clusterId:CreateClusterResponse' :: Maybe Text
clusterId = Maybe Text
a} :: CreateClusterResponse)
createClusterResponse_httpStatus :: Lens.Lens' CreateClusterResponse Prelude.Int
createClusterResponse_httpStatus :: (Int -> f Int) -> CreateClusterResponse -> f CreateClusterResponse
createClusterResponse_httpStatus = (CreateClusterResponse -> Int)
-> (CreateClusterResponse -> Int -> CreateClusterResponse)
-> Lens CreateClusterResponse CreateClusterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClusterResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateClusterResponse' :: CreateClusterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateClusterResponse
s@CreateClusterResponse' {} Int
a -> CreateClusterResponse
s {$sel:httpStatus:CreateClusterResponse' :: Int
httpStatus = Int
a} :: CreateClusterResponse)
instance Prelude.NFData CreateClusterResponse