{-# 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.CreateAppImageConfig
(
CreateAppImageConfig (..),
newCreateAppImageConfig,
createAppImageConfig_kernelGatewayImageConfig,
createAppImageConfig_tags,
createAppImageConfig_appImageConfigName,
CreateAppImageConfigResponse (..),
newCreateAppImageConfigResponse,
createAppImageConfigResponse_appImageConfigArn,
createAppImageConfigResponse_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.SageMaker.Types
data CreateAppImageConfig = CreateAppImageConfig'
{
CreateAppImageConfig -> Maybe KernelGatewayImageConfig
kernelGatewayImageConfig :: Prelude.Maybe KernelGatewayImageConfig,
CreateAppImageConfig -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateAppImageConfig -> Text
appImageConfigName :: Prelude.Text
}
deriving (CreateAppImageConfig -> CreateAppImageConfig -> Bool
(CreateAppImageConfig -> CreateAppImageConfig -> Bool)
-> (CreateAppImageConfig -> CreateAppImageConfig -> Bool)
-> Eq CreateAppImageConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAppImageConfig -> CreateAppImageConfig -> Bool
$c/= :: CreateAppImageConfig -> CreateAppImageConfig -> Bool
== :: CreateAppImageConfig -> CreateAppImageConfig -> Bool
$c== :: CreateAppImageConfig -> CreateAppImageConfig -> Bool
Prelude.Eq, ReadPrec [CreateAppImageConfig]
ReadPrec CreateAppImageConfig
Int -> ReadS CreateAppImageConfig
ReadS [CreateAppImageConfig]
(Int -> ReadS CreateAppImageConfig)
-> ReadS [CreateAppImageConfig]
-> ReadPrec CreateAppImageConfig
-> ReadPrec [CreateAppImageConfig]
-> Read CreateAppImageConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAppImageConfig]
$creadListPrec :: ReadPrec [CreateAppImageConfig]
readPrec :: ReadPrec CreateAppImageConfig
$creadPrec :: ReadPrec CreateAppImageConfig
readList :: ReadS [CreateAppImageConfig]
$creadList :: ReadS [CreateAppImageConfig]
readsPrec :: Int -> ReadS CreateAppImageConfig
$creadsPrec :: Int -> ReadS CreateAppImageConfig
Prelude.Read, Int -> CreateAppImageConfig -> ShowS
[CreateAppImageConfig] -> ShowS
CreateAppImageConfig -> String
(Int -> CreateAppImageConfig -> ShowS)
-> (CreateAppImageConfig -> String)
-> ([CreateAppImageConfig] -> ShowS)
-> Show CreateAppImageConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAppImageConfig] -> ShowS
$cshowList :: [CreateAppImageConfig] -> ShowS
show :: CreateAppImageConfig -> String
$cshow :: CreateAppImageConfig -> String
showsPrec :: Int -> CreateAppImageConfig -> ShowS
$cshowsPrec :: Int -> CreateAppImageConfig -> ShowS
Prelude.Show, (forall x. CreateAppImageConfig -> Rep CreateAppImageConfig x)
-> (forall x. Rep CreateAppImageConfig x -> CreateAppImageConfig)
-> Generic CreateAppImageConfig
forall x. Rep CreateAppImageConfig x -> CreateAppImageConfig
forall x. CreateAppImageConfig -> Rep CreateAppImageConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAppImageConfig x -> CreateAppImageConfig
$cfrom :: forall x. CreateAppImageConfig -> Rep CreateAppImageConfig x
Prelude.Generic)
newCreateAppImageConfig ::
Prelude.Text ->
CreateAppImageConfig
newCreateAppImageConfig :: Text -> CreateAppImageConfig
newCreateAppImageConfig Text
pAppImageConfigName_ =
CreateAppImageConfig' :: Maybe KernelGatewayImageConfig
-> Maybe [Tag] -> Text -> CreateAppImageConfig
CreateAppImageConfig'
{ $sel:kernelGatewayImageConfig:CreateAppImageConfig' :: Maybe KernelGatewayImageConfig
kernelGatewayImageConfig =
Maybe KernelGatewayImageConfig
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateAppImageConfig' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:appImageConfigName:CreateAppImageConfig' :: Text
appImageConfigName = Text
pAppImageConfigName_
}
createAppImageConfig_kernelGatewayImageConfig :: Lens.Lens' CreateAppImageConfig (Prelude.Maybe KernelGatewayImageConfig)
createAppImageConfig_kernelGatewayImageConfig :: (Maybe KernelGatewayImageConfig
-> f (Maybe KernelGatewayImageConfig))
-> CreateAppImageConfig -> f CreateAppImageConfig
createAppImageConfig_kernelGatewayImageConfig = (CreateAppImageConfig -> Maybe KernelGatewayImageConfig)
-> (CreateAppImageConfig
-> Maybe KernelGatewayImageConfig -> CreateAppImageConfig)
-> Lens
CreateAppImageConfig
CreateAppImageConfig
(Maybe KernelGatewayImageConfig)
(Maybe KernelGatewayImageConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppImageConfig' {Maybe KernelGatewayImageConfig
kernelGatewayImageConfig :: Maybe KernelGatewayImageConfig
$sel:kernelGatewayImageConfig:CreateAppImageConfig' :: CreateAppImageConfig -> Maybe KernelGatewayImageConfig
kernelGatewayImageConfig} -> Maybe KernelGatewayImageConfig
kernelGatewayImageConfig) (\s :: CreateAppImageConfig
s@CreateAppImageConfig' {} Maybe KernelGatewayImageConfig
a -> CreateAppImageConfig
s {$sel:kernelGatewayImageConfig:CreateAppImageConfig' :: Maybe KernelGatewayImageConfig
kernelGatewayImageConfig = Maybe KernelGatewayImageConfig
a} :: CreateAppImageConfig)
createAppImageConfig_tags :: Lens.Lens' CreateAppImageConfig (Prelude.Maybe [Tag])
createAppImageConfig_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateAppImageConfig -> f CreateAppImageConfig
createAppImageConfig_tags = (CreateAppImageConfig -> Maybe [Tag])
-> (CreateAppImageConfig -> Maybe [Tag] -> CreateAppImageConfig)
-> Lens
CreateAppImageConfig
CreateAppImageConfig
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppImageConfig' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateAppImageConfig' :: CreateAppImageConfig -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateAppImageConfig
s@CreateAppImageConfig' {} Maybe [Tag]
a -> CreateAppImageConfig
s {$sel:tags:CreateAppImageConfig' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateAppImageConfig) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateAppImageConfig -> f CreateAppImageConfig)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateAppImageConfig
-> f CreateAppImageConfig
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
createAppImageConfig_appImageConfigName :: Lens.Lens' CreateAppImageConfig Prelude.Text
createAppImageConfig_appImageConfigName :: (Text -> f Text) -> CreateAppImageConfig -> f CreateAppImageConfig
createAppImageConfig_appImageConfigName = (CreateAppImageConfig -> Text)
-> (CreateAppImageConfig -> Text -> CreateAppImageConfig)
-> Lens CreateAppImageConfig CreateAppImageConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppImageConfig' {Text
appImageConfigName :: Text
$sel:appImageConfigName:CreateAppImageConfig' :: CreateAppImageConfig -> Text
appImageConfigName} -> Text
appImageConfigName) (\s :: CreateAppImageConfig
s@CreateAppImageConfig' {} Text
a -> CreateAppImageConfig
s {$sel:appImageConfigName:CreateAppImageConfig' :: Text
appImageConfigName = Text
a} :: CreateAppImageConfig)
instance Core.AWSRequest CreateAppImageConfig where
type
AWSResponse CreateAppImageConfig =
CreateAppImageConfigResponse
request :: CreateAppImageConfig -> Request CreateAppImageConfig
request = Service -> CreateAppImageConfig -> Request CreateAppImageConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateAppImageConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateAppImageConfig)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateAppImageConfig))
-> Logger
-> Service
-> Proxy CreateAppImageConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateAppImageConfig)))
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 -> CreateAppImageConfigResponse
CreateAppImageConfigResponse'
(Maybe Text -> Int -> CreateAppImageConfigResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateAppImageConfigResponse)
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
"AppImageConfigArn")
Either String (Int -> CreateAppImageConfigResponse)
-> Either String Int -> Either String CreateAppImageConfigResponse
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 CreateAppImageConfig
instance Prelude.NFData CreateAppImageConfig
instance Core.ToHeaders CreateAppImageConfig where
toHeaders :: CreateAppImageConfig -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateAppImageConfig -> 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
"SageMaker.CreateAppImageConfig" ::
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 CreateAppImageConfig where
toJSON :: CreateAppImageConfig -> Value
toJSON CreateAppImageConfig' {Maybe [Tag]
Maybe KernelGatewayImageConfig
Text
appImageConfigName :: Text
tags :: Maybe [Tag]
kernelGatewayImageConfig :: Maybe KernelGatewayImageConfig
$sel:appImageConfigName:CreateAppImageConfig' :: CreateAppImageConfig -> Text
$sel:tags:CreateAppImageConfig' :: CreateAppImageConfig -> Maybe [Tag]
$sel:kernelGatewayImageConfig:CreateAppImageConfig' :: CreateAppImageConfig -> Maybe KernelGatewayImageConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"KernelGatewayImageConfig" Text -> KernelGatewayImageConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(KernelGatewayImageConfig -> Pair)
-> Maybe KernelGatewayImageConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe KernelGatewayImageConfig
kernelGatewayImageConfig,
(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
"AppImageConfigName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
appImageConfigName)
]
)
instance Core.ToPath CreateAppImageConfig where
toPath :: CreateAppImageConfig -> ByteString
toPath = ByteString -> CreateAppImageConfig -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateAppImageConfig where
toQuery :: CreateAppImageConfig -> QueryString
toQuery = QueryString -> CreateAppImageConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateAppImageConfigResponse = CreateAppImageConfigResponse'
{
CreateAppImageConfigResponse -> Maybe Text
appImageConfigArn :: Prelude.Maybe Prelude.Text,
CreateAppImageConfigResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateAppImageConfigResponse
-> CreateAppImageConfigResponse -> Bool
(CreateAppImageConfigResponse
-> CreateAppImageConfigResponse -> Bool)
-> (CreateAppImageConfigResponse
-> CreateAppImageConfigResponse -> Bool)
-> Eq CreateAppImageConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAppImageConfigResponse
-> CreateAppImageConfigResponse -> Bool
$c/= :: CreateAppImageConfigResponse
-> CreateAppImageConfigResponse -> Bool
== :: CreateAppImageConfigResponse
-> CreateAppImageConfigResponse -> Bool
$c== :: CreateAppImageConfigResponse
-> CreateAppImageConfigResponse -> Bool
Prelude.Eq, ReadPrec [CreateAppImageConfigResponse]
ReadPrec CreateAppImageConfigResponse
Int -> ReadS CreateAppImageConfigResponse
ReadS [CreateAppImageConfigResponse]
(Int -> ReadS CreateAppImageConfigResponse)
-> ReadS [CreateAppImageConfigResponse]
-> ReadPrec CreateAppImageConfigResponse
-> ReadPrec [CreateAppImageConfigResponse]
-> Read CreateAppImageConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAppImageConfigResponse]
$creadListPrec :: ReadPrec [CreateAppImageConfigResponse]
readPrec :: ReadPrec CreateAppImageConfigResponse
$creadPrec :: ReadPrec CreateAppImageConfigResponse
readList :: ReadS [CreateAppImageConfigResponse]
$creadList :: ReadS [CreateAppImageConfigResponse]
readsPrec :: Int -> ReadS CreateAppImageConfigResponse
$creadsPrec :: Int -> ReadS CreateAppImageConfigResponse
Prelude.Read, Int -> CreateAppImageConfigResponse -> ShowS
[CreateAppImageConfigResponse] -> ShowS
CreateAppImageConfigResponse -> String
(Int -> CreateAppImageConfigResponse -> ShowS)
-> (CreateAppImageConfigResponse -> String)
-> ([CreateAppImageConfigResponse] -> ShowS)
-> Show CreateAppImageConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAppImageConfigResponse] -> ShowS
$cshowList :: [CreateAppImageConfigResponse] -> ShowS
show :: CreateAppImageConfigResponse -> String
$cshow :: CreateAppImageConfigResponse -> String
showsPrec :: Int -> CreateAppImageConfigResponse -> ShowS
$cshowsPrec :: Int -> CreateAppImageConfigResponse -> ShowS
Prelude.Show, (forall x.
CreateAppImageConfigResponse -> Rep CreateAppImageConfigResponse x)
-> (forall x.
Rep CreateAppImageConfigResponse x -> CreateAppImageConfigResponse)
-> Generic CreateAppImageConfigResponse
forall x.
Rep CreateAppImageConfigResponse x -> CreateAppImageConfigResponse
forall x.
CreateAppImageConfigResponse -> Rep CreateAppImageConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAppImageConfigResponse x -> CreateAppImageConfigResponse
$cfrom :: forall x.
CreateAppImageConfigResponse -> Rep CreateAppImageConfigResponse x
Prelude.Generic)
newCreateAppImageConfigResponse ::
Prelude.Int ->
CreateAppImageConfigResponse
newCreateAppImageConfigResponse :: Int -> CreateAppImageConfigResponse
newCreateAppImageConfigResponse Int
pHttpStatus_ =
CreateAppImageConfigResponse' :: Maybe Text -> Int -> CreateAppImageConfigResponse
CreateAppImageConfigResponse'
{ $sel:appImageConfigArn:CreateAppImageConfigResponse' :: Maybe Text
appImageConfigArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateAppImageConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createAppImageConfigResponse_appImageConfigArn :: Lens.Lens' CreateAppImageConfigResponse (Prelude.Maybe Prelude.Text)
createAppImageConfigResponse_appImageConfigArn :: (Maybe Text -> f (Maybe Text))
-> CreateAppImageConfigResponse -> f CreateAppImageConfigResponse
createAppImageConfigResponse_appImageConfigArn = (CreateAppImageConfigResponse -> Maybe Text)
-> (CreateAppImageConfigResponse
-> Maybe Text -> CreateAppImageConfigResponse)
-> Lens
CreateAppImageConfigResponse
CreateAppImageConfigResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppImageConfigResponse' {Maybe Text
appImageConfigArn :: Maybe Text
$sel:appImageConfigArn:CreateAppImageConfigResponse' :: CreateAppImageConfigResponse -> Maybe Text
appImageConfigArn} -> Maybe Text
appImageConfigArn) (\s :: CreateAppImageConfigResponse
s@CreateAppImageConfigResponse' {} Maybe Text
a -> CreateAppImageConfigResponse
s {$sel:appImageConfigArn:CreateAppImageConfigResponse' :: Maybe Text
appImageConfigArn = Maybe Text
a} :: CreateAppImageConfigResponse)
createAppImageConfigResponse_httpStatus :: Lens.Lens' CreateAppImageConfigResponse Prelude.Int
createAppImageConfigResponse_httpStatus :: (Int -> f Int)
-> CreateAppImageConfigResponse -> f CreateAppImageConfigResponse
createAppImageConfigResponse_httpStatus = (CreateAppImageConfigResponse -> Int)
-> (CreateAppImageConfigResponse
-> Int -> CreateAppImageConfigResponse)
-> Lens
CreateAppImageConfigResponse CreateAppImageConfigResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppImageConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateAppImageConfigResponse' :: CreateAppImageConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateAppImageConfigResponse
s@CreateAppImageConfigResponse' {} Int
a -> CreateAppImageConfigResponse
s {$sel:httpStatus:CreateAppImageConfigResponse' :: Int
httpStatus = Int
a} :: CreateAppImageConfigResponse)
instance Prelude.NFData CreateAppImageConfigResponse