{-# 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.SageMaker.CreateDeviceFleet
(
CreateDeviceFleet (..),
newCreateDeviceFleet,
createDeviceFleet_enableIotRoleAlias,
createDeviceFleet_description,
createDeviceFleet_tags,
createDeviceFleet_roleArn,
createDeviceFleet_deviceFleetName,
createDeviceFleet_outputConfig,
CreateDeviceFleetResponse (..),
newCreateDeviceFleetResponse,
)
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.SageMaker.Types
data CreateDeviceFleet = CreateDeviceFleet'
{
CreateDeviceFleet -> Maybe Bool
enableIotRoleAlias :: Prelude.Maybe Prelude.Bool,
CreateDeviceFleet -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
CreateDeviceFleet -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateDeviceFleet -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
CreateDeviceFleet -> Text
deviceFleetName :: Prelude.Text,
CreateDeviceFleet -> EdgeOutputConfig
outputConfig :: EdgeOutputConfig
}
deriving (CreateDeviceFleet -> CreateDeviceFleet -> Bool
(CreateDeviceFleet -> CreateDeviceFleet -> Bool)
-> (CreateDeviceFleet -> CreateDeviceFleet -> Bool)
-> Eq CreateDeviceFleet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDeviceFleet -> CreateDeviceFleet -> Bool
$c/= :: CreateDeviceFleet -> CreateDeviceFleet -> Bool
== :: CreateDeviceFleet -> CreateDeviceFleet -> Bool
$c== :: CreateDeviceFleet -> CreateDeviceFleet -> Bool
Prelude.Eq, ReadPrec [CreateDeviceFleet]
ReadPrec CreateDeviceFleet
Int -> ReadS CreateDeviceFleet
ReadS [CreateDeviceFleet]
(Int -> ReadS CreateDeviceFleet)
-> ReadS [CreateDeviceFleet]
-> ReadPrec CreateDeviceFleet
-> ReadPrec [CreateDeviceFleet]
-> Read CreateDeviceFleet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDeviceFleet]
$creadListPrec :: ReadPrec [CreateDeviceFleet]
readPrec :: ReadPrec CreateDeviceFleet
$creadPrec :: ReadPrec CreateDeviceFleet
readList :: ReadS [CreateDeviceFleet]
$creadList :: ReadS [CreateDeviceFleet]
readsPrec :: Int -> ReadS CreateDeviceFleet
$creadsPrec :: Int -> ReadS CreateDeviceFleet
Prelude.Read, Int -> CreateDeviceFleet -> ShowS
[CreateDeviceFleet] -> ShowS
CreateDeviceFleet -> String
(Int -> CreateDeviceFleet -> ShowS)
-> (CreateDeviceFleet -> String)
-> ([CreateDeviceFleet] -> ShowS)
-> Show CreateDeviceFleet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDeviceFleet] -> ShowS
$cshowList :: [CreateDeviceFleet] -> ShowS
show :: CreateDeviceFleet -> String
$cshow :: CreateDeviceFleet -> String
showsPrec :: Int -> CreateDeviceFleet -> ShowS
$cshowsPrec :: Int -> CreateDeviceFleet -> ShowS
Prelude.Show, (forall x. CreateDeviceFleet -> Rep CreateDeviceFleet x)
-> (forall x. Rep CreateDeviceFleet x -> CreateDeviceFleet)
-> Generic CreateDeviceFleet
forall x. Rep CreateDeviceFleet x -> CreateDeviceFleet
forall x. CreateDeviceFleet -> Rep CreateDeviceFleet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDeviceFleet x -> CreateDeviceFleet
$cfrom :: forall x. CreateDeviceFleet -> Rep CreateDeviceFleet x
Prelude.Generic)
newCreateDeviceFleet ::
Prelude.Text ->
EdgeOutputConfig ->
CreateDeviceFleet
newCreateDeviceFleet :: Text -> EdgeOutputConfig -> CreateDeviceFleet
newCreateDeviceFleet Text
pDeviceFleetName_ EdgeOutputConfig
pOutputConfig_ =
CreateDeviceFleet' :: Maybe Bool
-> Maybe Text
-> Maybe [Tag]
-> Maybe Text
-> Text
-> EdgeOutputConfig
-> CreateDeviceFleet
CreateDeviceFleet'
{ $sel:enableIotRoleAlias:CreateDeviceFleet' :: Maybe Bool
enableIotRoleAlias =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:description:CreateDeviceFleet' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateDeviceFleet' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:CreateDeviceFleet' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deviceFleetName:CreateDeviceFleet' :: Text
deviceFleetName = Text
pDeviceFleetName_,
$sel:outputConfig:CreateDeviceFleet' :: EdgeOutputConfig
outputConfig = EdgeOutputConfig
pOutputConfig_
}
createDeviceFleet_enableIotRoleAlias :: Lens.Lens' CreateDeviceFleet (Prelude.Maybe Prelude.Bool)
createDeviceFleet_enableIotRoleAlias :: (Maybe Bool -> f (Maybe Bool))
-> CreateDeviceFleet -> f CreateDeviceFleet
createDeviceFleet_enableIotRoleAlias = (CreateDeviceFleet -> Maybe Bool)
-> (CreateDeviceFleet -> Maybe Bool -> CreateDeviceFleet)
-> Lens
CreateDeviceFleet CreateDeviceFleet (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeviceFleet' {Maybe Bool
enableIotRoleAlias :: Maybe Bool
$sel:enableIotRoleAlias:CreateDeviceFleet' :: CreateDeviceFleet -> Maybe Bool
enableIotRoleAlias} -> Maybe Bool
enableIotRoleAlias) (\s :: CreateDeviceFleet
s@CreateDeviceFleet' {} Maybe Bool
a -> CreateDeviceFleet
s {$sel:enableIotRoleAlias:CreateDeviceFleet' :: Maybe Bool
enableIotRoleAlias = Maybe Bool
a} :: CreateDeviceFleet)
createDeviceFleet_description :: Lens.Lens' CreateDeviceFleet (Prelude.Maybe Prelude.Text)
createDeviceFleet_description :: (Maybe Text -> f (Maybe Text))
-> CreateDeviceFleet -> f CreateDeviceFleet
createDeviceFleet_description = (CreateDeviceFleet -> Maybe Text)
-> (CreateDeviceFleet -> Maybe Text -> CreateDeviceFleet)
-> Lens
CreateDeviceFleet CreateDeviceFleet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeviceFleet' {Maybe Text
description :: Maybe Text
$sel:description:CreateDeviceFleet' :: CreateDeviceFleet -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateDeviceFleet
s@CreateDeviceFleet' {} Maybe Text
a -> CreateDeviceFleet
s {$sel:description:CreateDeviceFleet' :: Maybe Text
description = Maybe Text
a} :: CreateDeviceFleet)
createDeviceFleet_tags :: Lens.Lens' CreateDeviceFleet (Prelude.Maybe [Tag])
createDeviceFleet_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDeviceFleet -> f CreateDeviceFleet
createDeviceFleet_tags = (CreateDeviceFleet -> Maybe [Tag])
-> (CreateDeviceFleet -> Maybe [Tag] -> CreateDeviceFleet)
-> Lens
CreateDeviceFleet CreateDeviceFleet (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeviceFleet' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateDeviceFleet' :: CreateDeviceFleet -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateDeviceFleet
s@CreateDeviceFleet' {} Maybe [Tag]
a -> CreateDeviceFleet
s {$sel:tags:CreateDeviceFleet' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateDeviceFleet) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDeviceFleet -> f CreateDeviceFleet)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDeviceFleet
-> f CreateDeviceFleet
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
createDeviceFleet_roleArn :: Lens.Lens' CreateDeviceFleet (Prelude.Maybe Prelude.Text)
createDeviceFleet_roleArn :: (Maybe Text -> f (Maybe Text))
-> CreateDeviceFleet -> f CreateDeviceFleet
createDeviceFleet_roleArn = (CreateDeviceFleet -> Maybe Text)
-> (CreateDeviceFleet -> Maybe Text -> CreateDeviceFleet)
-> Lens
CreateDeviceFleet CreateDeviceFleet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeviceFleet' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:CreateDeviceFleet' :: CreateDeviceFleet -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: CreateDeviceFleet
s@CreateDeviceFleet' {} Maybe Text
a -> CreateDeviceFleet
s {$sel:roleArn:CreateDeviceFleet' :: Maybe Text
roleArn = Maybe Text
a} :: CreateDeviceFleet)
createDeviceFleet_deviceFleetName :: Lens.Lens' CreateDeviceFleet Prelude.Text
createDeviceFleet_deviceFleetName :: (Text -> f Text) -> CreateDeviceFleet -> f CreateDeviceFleet
createDeviceFleet_deviceFleetName = (CreateDeviceFleet -> Text)
-> (CreateDeviceFleet -> Text -> CreateDeviceFleet)
-> Lens CreateDeviceFleet CreateDeviceFleet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeviceFleet' {Text
deviceFleetName :: Text
$sel:deviceFleetName:CreateDeviceFleet' :: CreateDeviceFleet -> Text
deviceFleetName} -> Text
deviceFleetName) (\s :: CreateDeviceFleet
s@CreateDeviceFleet' {} Text
a -> CreateDeviceFleet
s {$sel:deviceFleetName:CreateDeviceFleet' :: Text
deviceFleetName = Text
a} :: CreateDeviceFleet)
createDeviceFleet_outputConfig :: Lens.Lens' CreateDeviceFleet EdgeOutputConfig
createDeviceFleet_outputConfig :: (EdgeOutputConfig -> f EdgeOutputConfig)
-> CreateDeviceFleet -> f CreateDeviceFleet
createDeviceFleet_outputConfig = (CreateDeviceFleet -> EdgeOutputConfig)
-> (CreateDeviceFleet -> EdgeOutputConfig -> CreateDeviceFleet)
-> Lens
CreateDeviceFleet
CreateDeviceFleet
EdgeOutputConfig
EdgeOutputConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeviceFleet' {EdgeOutputConfig
outputConfig :: EdgeOutputConfig
$sel:outputConfig:CreateDeviceFleet' :: CreateDeviceFleet -> EdgeOutputConfig
outputConfig} -> EdgeOutputConfig
outputConfig) (\s :: CreateDeviceFleet
s@CreateDeviceFleet' {} EdgeOutputConfig
a -> CreateDeviceFleet
s {$sel:outputConfig:CreateDeviceFleet' :: EdgeOutputConfig
outputConfig = EdgeOutputConfig
a} :: CreateDeviceFleet)
instance Core.AWSRequest CreateDeviceFleet where
type
AWSResponse CreateDeviceFleet =
CreateDeviceFleetResponse
request :: CreateDeviceFleet -> Request CreateDeviceFleet
request = Service -> CreateDeviceFleet -> Request CreateDeviceFleet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateDeviceFleet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateDeviceFleet)))
response =
AWSResponse CreateDeviceFleet
-> Logger
-> Service
-> Proxy CreateDeviceFleet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateDeviceFleet)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse CreateDeviceFleet
CreateDeviceFleetResponse
CreateDeviceFleetResponse'
instance Prelude.Hashable CreateDeviceFleet
instance Prelude.NFData CreateDeviceFleet
instance Core.ToHeaders CreateDeviceFleet where
toHeaders :: CreateDeviceFleet -> [Header]
toHeaders =
[Header] -> CreateDeviceFleet -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"SageMaker.CreateDeviceFleet" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateDeviceFleet where
toJSON :: CreateDeviceFleet -> Value
toJSON CreateDeviceFleet' {Maybe Bool
Maybe [Tag]
Maybe Text
Text
EdgeOutputConfig
outputConfig :: EdgeOutputConfig
deviceFleetName :: Text
roleArn :: Maybe Text
tags :: Maybe [Tag]
description :: Maybe Text
enableIotRoleAlias :: Maybe Bool
$sel:outputConfig:CreateDeviceFleet' :: CreateDeviceFleet -> EdgeOutputConfig
$sel:deviceFleetName:CreateDeviceFleet' :: CreateDeviceFleet -> Text
$sel:roleArn:CreateDeviceFleet' :: CreateDeviceFleet -> Maybe Text
$sel:tags:CreateDeviceFleet' :: CreateDeviceFleet -> Maybe [Tag]
$sel:description:CreateDeviceFleet' :: CreateDeviceFleet -> Maybe Text
$sel:enableIotRoleAlias:CreateDeviceFleet' :: CreateDeviceFleet -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EnableIotRoleAlias" 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
enableIotRoleAlias,
(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
"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
"RoleArn" 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
roleArn,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DeviceFleetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceFleetName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"OutputConfig" Text -> EdgeOutputConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= EdgeOutputConfig
outputConfig)
]
)
instance Core.ToPath CreateDeviceFleet where
toPath :: CreateDeviceFleet -> ByteString
toPath = ByteString -> CreateDeviceFleet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateDeviceFleet where
toQuery :: CreateDeviceFleet -> QueryString
toQuery = QueryString -> CreateDeviceFleet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateDeviceFleetResponse = CreateDeviceFleetResponse'
{
}
deriving (CreateDeviceFleetResponse -> CreateDeviceFleetResponse -> Bool
(CreateDeviceFleetResponse -> CreateDeviceFleetResponse -> Bool)
-> (CreateDeviceFleetResponse -> CreateDeviceFleetResponse -> Bool)
-> Eq CreateDeviceFleetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDeviceFleetResponse -> CreateDeviceFleetResponse -> Bool
$c/= :: CreateDeviceFleetResponse -> CreateDeviceFleetResponse -> Bool
== :: CreateDeviceFleetResponse -> CreateDeviceFleetResponse -> Bool
$c== :: CreateDeviceFleetResponse -> CreateDeviceFleetResponse -> Bool
Prelude.Eq, ReadPrec [CreateDeviceFleetResponse]
ReadPrec CreateDeviceFleetResponse
Int -> ReadS CreateDeviceFleetResponse
ReadS [CreateDeviceFleetResponse]
(Int -> ReadS CreateDeviceFleetResponse)
-> ReadS [CreateDeviceFleetResponse]
-> ReadPrec CreateDeviceFleetResponse
-> ReadPrec [CreateDeviceFleetResponse]
-> Read CreateDeviceFleetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDeviceFleetResponse]
$creadListPrec :: ReadPrec [CreateDeviceFleetResponse]
readPrec :: ReadPrec CreateDeviceFleetResponse
$creadPrec :: ReadPrec CreateDeviceFleetResponse
readList :: ReadS [CreateDeviceFleetResponse]
$creadList :: ReadS [CreateDeviceFleetResponse]
readsPrec :: Int -> ReadS CreateDeviceFleetResponse
$creadsPrec :: Int -> ReadS CreateDeviceFleetResponse
Prelude.Read, Int -> CreateDeviceFleetResponse -> ShowS
[CreateDeviceFleetResponse] -> ShowS
CreateDeviceFleetResponse -> String
(Int -> CreateDeviceFleetResponse -> ShowS)
-> (CreateDeviceFleetResponse -> String)
-> ([CreateDeviceFleetResponse] -> ShowS)
-> Show CreateDeviceFleetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDeviceFleetResponse] -> ShowS
$cshowList :: [CreateDeviceFleetResponse] -> ShowS
show :: CreateDeviceFleetResponse -> String
$cshow :: CreateDeviceFleetResponse -> String
showsPrec :: Int -> CreateDeviceFleetResponse -> ShowS
$cshowsPrec :: Int -> CreateDeviceFleetResponse -> ShowS
Prelude.Show, (forall x.
CreateDeviceFleetResponse -> Rep CreateDeviceFleetResponse x)
-> (forall x.
Rep CreateDeviceFleetResponse x -> CreateDeviceFleetResponse)
-> Generic CreateDeviceFleetResponse
forall x.
Rep CreateDeviceFleetResponse x -> CreateDeviceFleetResponse
forall x.
CreateDeviceFleetResponse -> Rep CreateDeviceFleetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDeviceFleetResponse x -> CreateDeviceFleetResponse
$cfrom :: forall x.
CreateDeviceFleetResponse -> Rep CreateDeviceFleetResponse x
Prelude.Generic)
newCreateDeviceFleetResponse ::
CreateDeviceFleetResponse
newCreateDeviceFleetResponse :: CreateDeviceFleetResponse
newCreateDeviceFleetResponse =
CreateDeviceFleetResponse
CreateDeviceFleetResponse'
instance Prelude.NFData CreateDeviceFleetResponse