{-# 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.CreateMonitoringSchedule
(
CreateMonitoringSchedule (..),
newCreateMonitoringSchedule,
createMonitoringSchedule_tags,
createMonitoringSchedule_monitoringScheduleName,
createMonitoringSchedule_monitoringScheduleConfig,
CreateMonitoringScheduleResponse (..),
newCreateMonitoringScheduleResponse,
createMonitoringScheduleResponse_httpStatus,
createMonitoringScheduleResponse_monitoringScheduleArn,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types
data CreateMonitoringSchedule = CreateMonitoringSchedule'
{
CreateMonitoringSchedule -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateMonitoringSchedule -> Text
monitoringScheduleName :: Prelude.Text,
CreateMonitoringSchedule -> MonitoringScheduleConfig
monitoringScheduleConfig :: MonitoringScheduleConfig
}
deriving (CreateMonitoringSchedule -> CreateMonitoringSchedule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMonitoringSchedule -> CreateMonitoringSchedule -> Bool
$c/= :: CreateMonitoringSchedule -> CreateMonitoringSchedule -> Bool
== :: CreateMonitoringSchedule -> CreateMonitoringSchedule -> Bool
$c== :: CreateMonitoringSchedule -> CreateMonitoringSchedule -> Bool
Prelude.Eq, ReadPrec [CreateMonitoringSchedule]
ReadPrec CreateMonitoringSchedule
Int -> ReadS CreateMonitoringSchedule
ReadS [CreateMonitoringSchedule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMonitoringSchedule]
$creadListPrec :: ReadPrec [CreateMonitoringSchedule]
readPrec :: ReadPrec CreateMonitoringSchedule
$creadPrec :: ReadPrec CreateMonitoringSchedule
readList :: ReadS [CreateMonitoringSchedule]
$creadList :: ReadS [CreateMonitoringSchedule]
readsPrec :: Int -> ReadS CreateMonitoringSchedule
$creadsPrec :: Int -> ReadS CreateMonitoringSchedule
Prelude.Read, Int -> CreateMonitoringSchedule -> ShowS
[CreateMonitoringSchedule] -> ShowS
CreateMonitoringSchedule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMonitoringSchedule] -> ShowS
$cshowList :: [CreateMonitoringSchedule] -> ShowS
show :: CreateMonitoringSchedule -> String
$cshow :: CreateMonitoringSchedule -> String
showsPrec :: Int -> CreateMonitoringSchedule -> ShowS
$cshowsPrec :: Int -> CreateMonitoringSchedule -> ShowS
Prelude.Show, forall x.
Rep CreateMonitoringSchedule x -> CreateMonitoringSchedule
forall x.
CreateMonitoringSchedule -> Rep CreateMonitoringSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateMonitoringSchedule x -> CreateMonitoringSchedule
$cfrom :: forall x.
CreateMonitoringSchedule -> Rep CreateMonitoringSchedule x
Prelude.Generic)
newCreateMonitoringSchedule ::
Prelude.Text ->
MonitoringScheduleConfig ->
CreateMonitoringSchedule
newCreateMonitoringSchedule :: Text -> MonitoringScheduleConfig -> CreateMonitoringSchedule
newCreateMonitoringSchedule
Text
pMonitoringScheduleName_
MonitoringScheduleConfig
pMonitoringScheduleConfig_ =
CreateMonitoringSchedule'
{ $sel:tags:CreateMonitoringSchedule' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:monitoringScheduleName:CreateMonitoringSchedule' :: Text
monitoringScheduleName = Text
pMonitoringScheduleName_,
$sel:monitoringScheduleConfig:CreateMonitoringSchedule' :: MonitoringScheduleConfig
monitoringScheduleConfig =
MonitoringScheduleConfig
pMonitoringScheduleConfig_
}
createMonitoringSchedule_tags :: Lens.Lens' CreateMonitoringSchedule (Prelude.Maybe [Tag])
createMonitoringSchedule_tags :: Lens' CreateMonitoringSchedule (Maybe [Tag])
createMonitoringSchedule_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMonitoringSchedule' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateMonitoringSchedule' :: CreateMonitoringSchedule -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateMonitoringSchedule
s@CreateMonitoringSchedule' {} Maybe [Tag]
a -> CreateMonitoringSchedule
s {$sel:tags:CreateMonitoringSchedule' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateMonitoringSchedule) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createMonitoringSchedule_monitoringScheduleName :: Lens.Lens' CreateMonitoringSchedule Prelude.Text
createMonitoringSchedule_monitoringScheduleName :: Lens' CreateMonitoringSchedule Text
createMonitoringSchedule_monitoringScheduleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMonitoringSchedule' {Text
monitoringScheduleName :: Text
$sel:monitoringScheduleName:CreateMonitoringSchedule' :: CreateMonitoringSchedule -> Text
monitoringScheduleName} -> Text
monitoringScheduleName) (\s :: CreateMonitoringSchedule
s@CreateMonitoringSchedule' {} Text
a -> CreateMonitoringSchedule
s {$sel:monitoringScheduleName:CreateMonitoringSchedule' :: Text
monitoringScheduleName = Text
a} :: CreateMonitoringSchedule)
createMonitoringSchedule_monitoringScheduleConfig :: Lens.Lens' CreateMonitoringSchedule MonitoringScheduleConfig
createMonitoringSchedule_monitoringScheduleConfig :: Lens' CreateMonitoringSchedule MonitoringScheduleConfig
createMonitoringSchedule_monitoringScheduleConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMonitoringSchedule' {MonitoringScheduleConfig
monitoringScheduleConfig :: MonitoringScheduleConfig
$sel:monitoringScheduleConfig:CreateMonitoringSchedule' :: CreateMonitoringSchedule -> MonitoringScheduleConfig
monitoringScheduleConfig} -> MonitoringScheduleConfig
monitoringScheduleConfig) (\s :: CreateMonitoringSchedule
s@CreateMonitoringSchedule' {} MonitoringScheduleConfig
a -> CreateMonitoringSchedule
s {$sel:monitoringScheduleConfig:CreateMonitoringSchedule' :: MonitoringScheduleConfig
monitoringScheduleConfig = MonitoringScheduleConfig
a} :: CreateMonitoringSchedule)
instance Core.AWSRequest CreateMonitoringSchedule where
type
AWSResponse CreateMonitoringSchedule =
CreateMonitoringScheduleResponse
request :: (Service -> Service)
-> CreateMonitoringSchedule -> Request CreateMonitoringSchedule
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateMonitoringSchedule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateMonitoringSchedule)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> Text -> CreateMonitoringScheduleResponse
CreateMonitoringScheduleResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"MonitoringScheduleArn")
)
instance Prelude.Hashable CreateMonitoringSchedule where
hashWithSalt :: Int -> CreateMonitoringSchedule -> Int
hashWithSalt Int
_salt CreateMonitoringSchedule' {Maybe [Tag]
Text
MonitoringScheduleConfig
monitoringScheduleConfig :: MonitoringScheduleConfig
monitoringScheduleName :: Text
tags :: Maybe [Tag]
$sel:monitoringScheduleConfig:CreateMonitoringSchedule' :: CreateMonitoringSchedule -> MonitoringScheduleConfig
$sel:monitoringScheduleName:CreateMonitoringSchedule' :: CreateMonitoringSchedule -> Text
$sel:tags:CreateMonitoringSchedule' :: CreateMonitoringSchedule -> Maybe [Tag]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
monitoringScheduleName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MonitoringScheduleConfig
monitoringScheduleConfig
instance Prelude.NFData CreateMonitoringSchedule where
rnf :: CreateMonitoringSchedule -> ()
rnf CreateMonitoringSchedule' {Maybe [Tag]
Text
MonitoringScheduleConfig
monitoringScheduleConfig :: MonitoringScheduleConfig
monitoringScheduleName :: Text
tags :: Maybe [Tag]
$sel:monitoringScheduleConfig:CreateMonitoringSchedule' :: CreateMonitoringSchedule -> MonitoringScheduleConfig
$sel:monitoringScheduleName:CreateMonitoringSchedule' :: CreateMonitoringSchedule -> Text
$sel:tags:CreateMonitoringSchedule' :: CreateMonitoringSchedule -> Maybe [Tag]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
monitoringScheduleName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MonitoringScheduleConfig
monitoringScheduleConfig
instance Data.ToHeaders CreateMonitoringSchedule where
toHeaders :: CreateMonitoringSchedule -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"SageMaker.CreateMonitoringSchedule" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateMonitoringSchedule where
toJSON :: CreateMonitoringSchedule -> Value
toJSON CreateMonitoringSchedule' {Maybe [Tag]
Text
MonitoringScheduleConfig
monitoringScheduleConfig :: MonitoringScheduleConfig
monitoringScheduleName :: Text
tags :: Maybe [Tag]
$sel:monitoringScheduleConfig:CreateMonitoringSchedule' :: CreateMonitoringSchedule -> MonitoringScheduleConfig
$sel:monitoringScheduleName:CreateMonitoringSchedule' :: CreateMonitoringSchedule -> Text
$sel:tags:CreateMonitoringSchedule' :: CreateMonitoringSchedule -> Maybe [Tag]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
forall a. a -> Maybe a
Prelude.Just
( Key
"MonitoringScheduleName"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
monitoringScheduleName
),
forall a. a -> Maybe a
Prelude.Just
( Key
"MonitoringScheduleConfig"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= MonitoringScheduleConfig
monitoringScheduleConfig
)
]
)
instance Data.ToPath CreateMonitoringSchedule where
toPath :: CreateMonitoringSchedule -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateMonitoringSchedule where
toQuery :: CreateMonitoringSchedule -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateMonitoringScheduleResponse = CreateMonitoringScheduleResponse'
{
CreateMonitoringScheduleResponse -> Int
httpStatus :: Prelude.Int,
CreateMonitoringScheduleResponse -> Text
monitoringScheduleArn :: Prelude.Text
}
deriving (CreateMonitoringScheduleResponse
-> CreateMonitoringScheduleResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMonitoringScheduleResponse
-> CreateMonitoringScheduleResponse -> Bool
$c/= :: CreateMonitoringScheduleResponse
-> CreateMonitoringScheduleResponse -> Bool
== :: CreateMonitoringScheduleResponse
-> CreateMonitoringScheduleResponse -> Bool
$c== :: CreateMonitoringScheduleResponse
-> CreateMonitoringScheduleResponse -> Bool
Prelude.Eq, ReadPrec [CreateMonitoringScheduleResponse]
ReadPrec CreateMonitoringScheduleResponse
Int -> ReadS CreateMonitoringScheduleResponse
ReadS [CreateMonitoringScheduleResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateMonitoringScheduleResponse]
$creadListPrec :: ReadPrec [CreateMonitoringScheduleResponse]
readPrec :: ReadPrec CreateMonitoringScheduleResponse
$creadPrec :: ReadPrec CreateMonitoringScheduleResponse
readList :: ReadS [CreateMonitoringScheduleResponse]
$creadList :: ReadS [CreateMonitoringScheduleResponse]
readsPrec :: Int -> ReadS CreateMonitoringScheduleResponse
$creadsPrec :: Int -> ReadS CreateMonitoringScheduleResponse
Prelude.Read, Int -> CreateMonitoringScheduleResponse -> ShowS
[CreateMonitoringScheduleResponse] -> ShowS
CreateMonitoringScheduleResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMonitoringScheduleResponse] -> ShowS
$cshowList :: [CreateMonitoringScheduleResponse] -> ShowS
show :: CreateMonitoringScheduleResponse -> String
$cshow :: CreateMonitoringScheduleResponse -> String
showsPrec :: Int -> CreateMonitoringScheduleResponse -> ShowS
$cshowsPrec :: Int -> CreateMonitoringScheduleResponse -> ShowS
Prelude.Show, forall x.
Rep CreateMonitoringScheduleResponse x
-> CreateMonitoringScheduleResponse
forall x.
CreateMonitoringScheduleResponse
-> Rep CreateMonitoringScheduleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateMonitoringScheduleResponse x
-> CreateMonitoringScheduleResponse
$cfrom :: forall x.
CreateMonitoringScheduleResponse
-> Rep CreateMonitoringScheduleResponse x
Prelude.Generic)
newCreateMonitoringScheduleResponse ::
Prelude.Int ->
Prelude.Text ->
CreateMonitoringScheduleResponse
newCreateMonitoringScheduleResponse :: Int -> Text -> CreateMonitoringScheduleResponse
newCreateMonitoringScheduleResponse
Int
pHttpStatus_
Text
pMonitoringScheduleArn_ =
CreateMonitoringScheduleResponse'
{ $sel:httpStatus:CreateMonitoringScheduleResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:monitoringScheduleArn:CreateMonitoringScheduleResponse' :: Text
monitoringScheduleArn =
Text
pMonitoringScheduleArn_
}
createMonitoringScheduleResponse_httpStatus :: Lens.Lens' CreateMonitoringScheduleResponse Prelude.Int
createMonitoringScheduleResponse_httpStatus :: Lens' CreateMonitoringScheduleResponse Int
createMonitoringScheduleResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMonitoringScheduleResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateMonitoringScheduleResponse' :: CreateMonitoringScheduleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateMonitoringScheduleResponse
s@CreateMonitoringScheduleResponse' {} Int
a -> CreateMonitoringScheduleResponse
s {$sel:httpStatus:CreateMonitoringScheduleResponse' :: Int
httpStatus = Int
a} :: CreateMonitoringScheduleResponse)
createMonitoringScheduleResponse_monitoringScheduleArn :: Lens.Lens' CreateMonitoringScheduleResponse Prelude.Text
createMonitoringScheduleResponse_monitoringScheduleArn :: Lens' CreateMonitoringScheduleResponse Text
createMonitoringScheduleResponse_monitoringScheduleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMonitoringScheduleResponse' {Text
monitoringScheduleArn :: Text
$sel:monitoringScheduleArn:CreateMonitoringScheduleResponse' :: CreateMonitoringScheduleResponse -> Text
monitoringScheduleArn} -> Text
monitoringScheduleArn) (\s :: CreateMonitoringScheduleResponse
s@CreateMonitoringScheduleResponse' {} Text
a -> CreateMonitoringScheduleResponse
s {$sel:monitoringScheduleArn:CreateMonitoringScheduleResponse' :: Text
monitoringScheduleArn = Text
a} :: CreateMonitoringScheduleResponse)
instance
Prelude.NFData
CreateMonitoringScheduleResponse
where
rnf :: CreateMonitoringScheduleResponse -> ()
rnf CreateMonitoringScheduleResponse' {Int
Text
monitoringScheduleArn :: Text
httpStatus :: Int
$sel:monitoringScheduleArn:CreateMonitoringScheduleResponse' :: CreateMonitoringScheduleResponse -> Text
$sel:httpStatus:CreateMonitoringScheduleResponse' :: CreateMonitoringScheduleResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
monitoringScheduleArn