{-# 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.CreateModelPackageGroup
(
CreateModelPackageGroup (..),
newCreateModelPackageGroup,
createModelPackageGroup_modelPackageGroupDescription,
createModelPackageGroup_tags,
createModelPackageGroup_modelPackageGroupName,
CreateModelPackageGroupResponse (..),
newCreateModelPackageGroupResponse,
createModelPackageGroupResponse_httpStatus,
createModelPackageGroupResponse_modelPackageGroupArn,
)
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 CreateModelPackageGroup = CreateModelPackageGroup'
{
CreateModelPackageGroup -> Maybe Text
modelPackageGroupDescription :: Prelude.Maybe Prelude.Text,
CreateModelPackageGroup -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateModelPackageGroup -> Text
modelPackageGroupName :: Prelude.Text
}
deriving (CreateModelPackageGroup -> CreateModelPackageGroup -> Bool
(CreateModelPackageGroup -> CreateModelPackageGroup -> Bool)
-> (CreateModelPackageGroup -> CreateModelPackageGroup -> Bool)
-> Eq CreateModelPackageGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateModelPackageGroup -> CreateModelPackageGroup -> Bool
$c/= :: CreateModelPackageGroup -> CreateModelPackageGroup -> Bool
== :: CreateModelPackageGroup -> CreateModelPackageGroup -> Bool
$c== :: CreateModelPackageGroup -> CreateModelPackageGroup -> Bool
Prelude.Eq, ReadPrec [CreateModelPackageGroup]
ReadPrec CreateModelPackageGroup
Int -> ReadS CreateModelPackageGroup
ReadS [CreateModelPackageGroup]
(Int -> ReadS CreateModelPackageGroup)
-> ReadS [CreateModelPackageGroup]
-> ReadPrec CreateModelPackageGroup
-> ReadPrec [CreateModelPackageGroup]
-> Read CreateModelPackageGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateModelPackageGroup]
$creadListPrec :: ReadPrec [CreateModelPackageGroup]
readPrec :: ReadPrec CreateModelPackageGroup
$creadPrec :: ReadPrec CreateModelPackageGroup
readList :: ReadS [CreateModelPackageGroup]
$creadList :: ReadS [CreateModelPackageGroup]
readsPrec :: Int -> ReadS CreateModelPackageGroup
$creadsPrec :: Int -> ReadS CreateModelPackageGroup
Prelude.Read, Int -> CreateModelPackageGroup -> ShowS
[CreateModelPackageGroup] -> ShowS
CreateModelPackageGroup -> String
(Int -> CreateModelPackageGroup -> ShowS)
-> (CreateModelPackageGroup -> String)
-> ([CreateModelPackageGroup] -> ShowS)
-> Show CreateModelPackageGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateModelPackageGroup] -> ShowS
$cshowList :: [CreateModelPackageGroup] -> ShowS
show :: CreateModelPackageGroup -> String
$cshow :: CreateModelPackageGroup -> String
showsPrec :: Int -> CreateModelPackageGroup -> ShowS
$cshowsPrec :: Int -> CreateModelPackageGroup -> ShowS
Prelude.Show, (forall x.
CreateModelPackageGroup -> Rep CreateModelPackageGroup x)
-> (forall x.
Rep CreateModelPackageGroup x -> CreateModelPackageGroup)
-> Generic CreateModelPackageGroup
forall x. Rep CreateModelPackageGroup x -> CreateModelPackageGroup
forall x. CreateModelPackageGroup -> Rep CreateModelPackageGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateModelPackageGroup x -> CreateModelPackageGroup
$cfrom :: forall x. CreateModelPackageGroup -> Rep CreateModelPackageGroup x
Prelude.Generic)
newCreateModelPackageGroup ::
Prelude.Text ->
CreateModelPackageGroup
newCreateModelPackageGroup :: Text -> CreateModelPackageGroup
newCreateModelPackageGroup Text
pModelPackageGroupName_ =
CreateModelPackageGroup' :: Maybe Text -> Maybe [Tag] -> Text -> CreateModelPackageGroup
CreateModelPackageGroup'
{ $sel:modelPackageGroupDescription:CreateModelPackageGroup' :: Maybe Text
modelPackageGroupDescription =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateModelPackageGroup' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:modelPackageGroupName:CreateModelPackageGroup' :: Text
modelPackageGroupName = Text
pModelPackageGroupName_
}
createModelPackageGroup_modelPackageGroupDescription :: Lens.Lens' CreateModelPackageGroup (Prelude.Maybe Prelude.Text)
createModelPackageGroup_modelPackageGroupDescription :: (Maybe Text -> f (Maybe Text))
-> CreateModelPackageGroup -> f CreateModelPackageGroup
createModelPackageGroup_modelPackageGroupDescription = (CreateModelPackageGroup -> Maybe Text)
-> (CreateModelPackageGroup
-> Maybe Text -> CreateModelPackageGroup)
-> Lens
CreateModelPackageGroup
CreateModelPackageGroup
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModelPackageGroup' {Maybe Text
modelPackageGroupDescription :: Maybe Text
$sel:modelPackageGroupDescription:CreateModelPackageGroup' :: CreateModelPackageGroup -> Maybe Text
modelPackageGroupDescription} -> Maybe Text
modelPackageGroupDescription) (\s :: CreateModelPackageGroup
s@CreateModelPackageGroup' {} Maybe Text
a -> CreateModelPackageGroup
s {$sel:modelPackageGroupDescription:CreateModelPackageGroup' :: Maybe Text
modelPackageGroupDescription = Maybe Text
a} :: CreateModelPackageGroup)
createModelPackageGroup_tags :: Lens.Lens' CreateModelPackageGroup (Prelude.Maybe [Tag])
createModelPackageGroup_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateModelPackageGroup -> f CreateModelPackageGroup
createModelPackageGroup_tags = (CreateModelPackageGroup -> Maybe [Tag])
-> (CreateModelPackageGroup
-> Maybe [Tag] -> CreateModelPackageGroup)
-> Lens
CreateModelPackageGroup
CreateModelPackageGroup
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModelPackageGroup' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateModelPackageGroup' :: CreateModelPackageGroup -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateModelPackageGroup
s@CreateModelPackageGroup' {} Maybe [Tag]
a -> CreateModelPackageGroup
s {$sel:tags:CreateModelPackageGroup' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateModelPackageGroup) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateModelPackageGroup -> f CreateModelPackageGroup)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateModelPackageGroup
-> f CreateModelPackageGroup
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
createModelPackageGroup_modelPackageGroupName :: Lens.Lens' CreateModelPackageGroup Prelude.Text
createModelPackageGroup_modelPackageGroupName :: (Text -> f Text)
-> CreateModelPackageGroup -> f CreateModelPackageGroup
createModelPackageGroup_modelPackageGroupName = (CreateModelPackageGroup -> Text)
-> (CreateModelPackageGroup -> Text -> CreateModelPackageGroup)
-> Lens CreateModelPackageGroup CreateModelPackageGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModelPackageGroup' {Text
modelPackageGroupName :: Text
$sel:modelPackageGroupName:CreateModelPackageGroup' :: CreateModelPackageGroup -> Text
modelPackageGroupName} -> Text
modelPackageGroupName) (\s :: CreateModelPackageGroup
s@CreateModelPackageGroup' {} Text
a -> CreateModelPackageGroup
s {$sel:modelPackageGroupName:CreateModelPackageGroup' :: Text
modelPackageGroupName = Text
a} :: CreateModelPackageGroup)
instance Core.AWSRequest CreateModelPackageGroup where
type
AWSResponse CreateModelPackageGroup =
CreateModelPackageGroupResponse
request :: CreateModelPackageGroup -> Request CreateModelPackageGroup
request = Service
-> CreateModelPackageGroup -> Request CreateModelPackageGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateModelPackageGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateModelPackageGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateModelPackageGroup))
-> Logger
-> Service
-> Proxy CreateModelPackageGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateModelPackageGroup)))
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 ->
Int -> Text -> CreateModelPackageGroupResponse
CreateModelPackageGroupResponse'
(Int -> Text -> CreateModelPackageGroupResponse)
-> Either String Int
-> Either String (Text -> CreateModelPackageGroupResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (Text -> CreateModelPackageGroupResponse)
-> Either String Text
-> Either String CreateModelPackageGroupResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ModelPackageGroupArn")
)
instance Prelude.Hashable CreateModelPackageGroup
instance Prelude.NFData CreateModelPackageGroup
instance Core.ToHeaders CreateModelPackageGroup where
toHeaders :: CreateModelPackageGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateModelPackageGroup -> 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.CreateModelPackageGroup" ::
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 CreateModelPackageGroup where
toJSON :: CreateModelPackageGroup -> Value
toJSON CreateModelPackageGroup' {Maybe [Tag]
Maybe Text
Text
modelPackageGroupName :: Text
tags :: Maybe [Tag]
modelPackageGroupDescription :: Maybe Text
$sel:modelPackageGroupName:CreateModelPackageGroup' :: CreateModelPackageGroup -> Text
$sel:tags:CreateModelPackageGroup' :: CreateModelPackageGroup -> Maybe [Tag]
$sel:modelPackageGroupDescription:CreateModelPackageGroup' :: CreateModelPackageGroup -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ModelPackageGroupDescription" 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
modelPackageGroupDescription,
(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
"ModelPackageGroupName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
modelPackageGroupName
)
]
)
instance Core.ToPath CreateModelPackageGroup where
toPath :: CreateModelPackageGroup -> ByteString
toPath = ByteString -> CreateModelPackageGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateModelPackageGroup where
toQuery :: CreateModelPackageGroup -> QueryString
toQuery = QueryString -> CreateModelPackageGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateModelPackageGroupResponse = CreateModelPackageGroupResponse'
{
CreateModelPackageGroupResponse -> Int
httpStatus :: Prelude.Int,
CreateModelPackageGroupResponse -> Text
modelPackageGroupArn :: Prelude.Text
}
deriving (CreateModelPackageGroupResponse
-> CreateModelPackageGroupResponse -> Bool
(CreateModelPackageGroupResponse
-> CreateModelPackageGroupResponse -> Bool)
-> (CreateModelPackageGroupResponse
-> CreateModelPackageGroupResponse -> Bool)
-> Eq CreateModelPackageGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateModelPackageGroupResponse
-> CreateModelPackageGroupResponse -> Bool
$c/= :: CreateModelPackageGroupResponse
-> CreateModelPackageGroupResponse -> Bool
== :: CreateModelPackageGroupResponse
-> CreateModelPackageGroupResponse -> Bool
$c== :: CreateModelPackageGroupResponse
-> CreateModelPackageGroupResponse -> Bool
Prelude.Eq, ReadPrec [CreateModelPackageGroupResponse]
ReadPrec CreateModelPackageGroupResponse
Int -> ReadS CreateModelPackageGroupResponse
ReadS [CreateModelPackageGroupResponse]
(Int -> ReadS CreateModelPackageGroupResponse)
-> ReadS [CreateModelPackageGroupResponse]
-> ReadPrec CreateModelPackageGroupResponse
-> ReadPrec [CreateModelPackageGroupResponse]
-> Read CreateModelPackageGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateModelPackageGroupResponse]
$creadListPrec :: ReadPrec [CreateModelPackageGroupResponse]
readPrec :: ReadPrec CreateModelPackageGroupResponse
$creadPrec :: ReadPrec CreateModelPackageGroupResponse
readList :: ReadS [CreateModelPackageGroupResponse]
$creadList :: ReadS [CreateModelPackageGroupResponse]
readsPrec :: Int -> ReadS CreateModelPackageGroupResponse
$creadsPrec :: Int -> ReadS CreateModelPackageGroupResponse
Prelude.Read, Int -> CreateModelPackageGroupResponse -> ShowS
[CreateModelPackageGroupResponse] -> ShowS
CreateModelPackageGroupResponse -> String
(Int -> CreateModelPackageGroupResponse -> ShowS)
-> (CreateModelPackageGroupResponse -> String)
-> ([CreateModelPackageGroupResponse] -> ShowS)
-> Show CreateModelPackageGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateModelPackageGroupResponse] -> ShowS
$cshowList :: [CreateModelPackageGroupResponse] -> ShowS
show :: CreateModelPackageGroupResponse -> String
$cshow :: CreateModelPackageGroupResponse -> String
showsPrec :: Int -> CreateModelPackageGroupResponse -> ShowS
$cshowsPrec :: Int -> CreateModelPackageGroupResponse -> ShowS
Prelude.Show, (forall x.
CreateModelPackageGroupResponse
-> Rep CreateModelPackageGroupResponse x)
-> (forall x.
Rep CreateModelPackageGroupResponse x
-> CreateModelPackageGroupResponse)
-> Generic CreateModelPackageGroupResponse
forall x.
Rep CreateModelPackageGroupResponse x
-> CreateModelPackageGroupResponse
forall x.
CreateModelPackageGroupResponse
-> Rep CreateModelPackageGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateModelPackageGroupResponse x
-> CreateModelPackageGroupResponse
$cfrom :: forall x.
CreateModelPackageGroupResponse
-> Rep CreateModelPackageGroupResponse x
Prelude.Generic)
newCreateModelPackageGroupResponse ::
Prelude.Int ->
Prelude.Text ->
CreateModelPackageGroupResponse
newCreateModelPackageGroupResponse :: Int -> Text -> CreateModelPackageGroupResponse
newCreateModelPackageGroupResponse
Int
pHttpStatus_
Text
pModelPackageGroupArn_ =
CreateModelPackageGroupResponse' :: Int -> Text -> CreateModelPackageGroupResponse
CreateModelPackageGroupResponse'
{ $sel:httpStatus:CreateModelPackageGroupResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:modelPackageGroupArn:CreateModelPackageGroupResponse' :: Text
modelPackageGroupArn =
Text
pModelPackageGroupArn_
}
createModelPackageGroupResponse_httpStatus :: Lens.Lens' CreateModelPackageGroupResponse Prelude.Int
createModelPackageGroupResponse_httpStatus :: (Int -> f Int)
-> CreateModelPackageGroupResponse
-> f CreateModelPackageGroupResponse
createModelPackageGroupResponse_httpStatus = (CreateModelPackageGroupResponse -> Int)
-> (CreateModelPackageGroupResponse
-> Int -> CreateModelPackageGroupResponse)
-> Lens
CreateModelPackageGroupResponse
CreateModelPackageGroupResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModelPackageGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateModelPackageGroupResponse' :: CreateModelPackageGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateModelPackageGroupResponse
s@CreateModelPackageGroupResponse' {} Int
a -> CreateModelPackageGroupResponse
s {$sel:httpStatus:CreateModelPackageGroupResponse' :: Int
httpStatus = Int
a} :: CreateModelPackageGroupResponse)
createModelPackageGroupResponse_modelPackageGroupArn :: Lens.Lens' CreateModelPackageGroupResponse Prelude.Text
createModelPackageGroupResponse_modelPackageGroupArn :: (Text -> f Text)
-> CreateModelPackageGroupResponse
-> f CreateModelPackageGroupResponse
createModelPackageGroupResponse_modelPackageGroupArn = (CreateModelPackageGroupResponse -> Text)
-> (CreateModelPackageGroupResponse
-> Text -> CreateModelPackageGroupResponse)
-> Lens
CreateModelPackageGroupResponse
CreateModelPackageGroupResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateModelPackageGroupResponse' {Text
modelPackageGroupArn :: Text
$sel:modelPackageGroupArn:CreateModelPackageGroupResponse' :: CreateModelPackageGroupResponse -> Text
modelPackageGroupArn} -> Text
modelPackageGroupArn) (\s :: CreateModelPackageGroupResponse
s@CreateModelPackageGroupResponse' {} Text
a -> CreateModelPackageGroupResponse
s {$sel:modelPackageGroupArn:CreateModelPackageGroupResponse' :: Text
modelPackageGroupArn = Text
a} :: CreateModelPackageGroupResponse)
instance
Prelude.NFData
CreateModelPackageGroupResponse