{-# 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.Rekognition.StartContentModeration
(
StartContentModeration (..),
newStartContentModeration,
startContentModeration_jobTag,
startContentModeration_notificationChannel,
startContentModeration_clientRequestToken,
startContentModeration_minConfidence,
startContentModeration_video,
StartContentModerationResponse (..),
newStartContentModerationResponse,
startContentModerationResponse_jobId,
startContentModerationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StartContentModeration = StartContentModeration'
{
StartContentModeration -> Maybe Text
jobTag :: Prelude.Maybe Prelude.Text,
StartContentModeration -> Maybe NotificationChannel
notificationChannel :: Prelude.Maybe NotificationChannel,
StartContentModeration -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
StartContentModeration -> Maybe Double
minConfidence :: Prelude.Maybe Prelude.Double,
StartContentModeration -> Video
video :: Video
}
deriving (StartContentModeration -> StartContentModeration -> Bool
(StartContentModeration -> StartContentModeration -> Bool)
-> (StartContentModeration -> StartContentModeration -> Bool)
-> Eq StartContentModeration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartContentModeration -> StartContentModeration -> Bool
$c/= :: StartContentModeration -> StartContentModeration -> Bool
== :: StartContentModeration -> StartContentModeration -> Bool
$c== :: StartContentModeration -> StartContentModeration -> Bool
Prelude.Eq, ReadPrec [StartContentModeration]
ReadPrec StartContentModeration
Int -> ReadS StartContentModeration
ReadS [StartContentModeration]
(Int -> ReadS StartContentModeration)
-> ReadS [StartContentModeration]
-> ReadPrec StartContentModeration
-> ReadPrec [StartContentModeration]
-> Read StartContentModeration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartContentModeration]
$creadListPrec :: ReadPrec [StartContentModeration]
readPrec :: ReadPrec StartContentModeration
$creadPrec :: ReadPrec StartContentModeration
readList :: ReadS [StartContentModeration]
$creadList :: ReadS [StartContentModeration]
readsPrec :: Int -> ReadS StartContentModeration
$creadsPrec :: Int -> ReadS StartContentModeration
Prelude.Read, Int -> StartContentModeration -> ShowS
[StartContentModeration] -> ShowS
StartContentModeration -> String
(Int -> StartContentModeration -> ShowS)
-> (StartContentModeration -> String)
-> ([StartContentModeration] -> ShowS)
-> Show StartContentModeration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartContentModeration] -> ShowS
$cshowList :: [StartContentModeration] -> ShowS
show :: StartContentModeration -> String
$cshow :: StartContentModeration -> String
showsPrec :: Int -> StartContentModeration -> ShowS
$cshowsPrec :: Int -> StartContentModeration -> ShowS
Prelude.Show, (forall x. StartContentModeration -> Rep StartContentModeration x)
-> (forall x.
Rep StartContentModeration x -> StartContentModeration)
-> Generic StartContentModeration
forall x. Rep StartContentModeration x -> StartContentModeration
forall x. StartContentModeration -> Rep StartContentModeration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartContentModeration x -> StartContentModeration
$cfrom :: forall x. StartContentModeration -> Rep StartContentModeration x
Prelude.Generic)
newStartContentModeration ::
Video ->
StartContentModeration
newStartContentModeration :: Video -> StartContentModeration
newStartContentModeration Video
pVideo_ =
StartContentModeration' :: Maybe Text
-> Maybe NotificationChannel
-> Maybe Text
-> Maybe Double
-> Video
-> StartContentModeration
StartContentModeration'
{ $sel:jobTag:StartContentModeration' :: Maybe Text
jobTag = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:notificationChannel:StartContentModeration' :: Maybe NotificationChannel
notificationChannel = Maybe NotificationChannel
forall a. Maybe a
Prelude.Nothing,
$sel:clientRequestToken:StartContentModeration' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:minConfidence:StartContentModeration' :: Maybe Double
minConfidence = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:video:StartContentModeration' :: Video
video = Video
pVideo_
}
startContentModeration_jobTag :: Lens.Lens' StartContentModeration (Prelude.Maybe Prelude.Text)
startContentModeration_jobTag :: (Maybe Text -> f (Maybe Text))
-> StartContentModeration -> f StartContentModeration
startContentModeration_jobTag = (StartContentModeration -> Maybe Text)
-> (StartContentModeration -> Maybe Text -> StartContentModeration)
-> Lens
StartContentModeration
StartContentModeration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContentModeration' {Maybe Text
jobTag :: Maybe Text
$sel:jobTag:StartContentModeration' :: StartContentModeration -> Maybe Text
jobTag} -> Maybe Text
jobTag) (\s :: StartContentModeration
s@StartContentModeration' {} Maybe Text
a -> StartContentModeration
s {$sel:jobTag:StartContentModeration' :: Maybe Text
jobTag = Maybe Text
a} :: StartContentModeration)
startContentModeration_notificationChannel :: Lens.Lens' StartContentModeration (Prelude.Maybe NotificationChannel)
startContentModeration_notificationChannel :: (Maybe NotificationChannel -> f (Maybe NotificationChannel))
-> StartContentModeration -> f StartContentModeration
startContentModeration_notificationChannel = (StartContentModeration -> Maybe NotificationChannel)
-> (StartContentModeration
-> Maybe NotificationChannel -> StartContentModeration)
-> Lens
StartContentModeration
StartContentModeration
(Maybe NotificationChannel)
(Maybe NotificationChannel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContentModeration' {Maybe NotificationChannel
notificationChannel :: Maybe NotificationChannel
$sel:notificationChannel:StartContentModeration' :: StartContentModeration -> Maybe NotificationChannel
notificationChannel} -> Maybe NotificationChannel
notificationChannel) (\s :: StartContentModeration
s@StartContentModeration' {} Maybe NotificationChannel
a -> StartContentModeration
s {$sel:notificationChannel:StartContentModeration' :: Maybe NotificationChannel
notificationChannel = Maybe NotificationChannel
a} :: StartContentModeration)
startContentModeration_clientRequestToken :: Lens.Lens' StartContentModeration (Prelude.Maybe Prelude.Text)
startContentModeration_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> StartContentModeration -> f StartContentModeration
startContentModeration_clientRequestToken = (StartContentModeration -> Maybe Text)
-> (StartContentModeration -> Maybe Text -> StartContentModeration)
-> Lens
StartContentModeration
StartContentModeration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContentModeration' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:StartContentModeration' :: StartContentModeration -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: StartContentModeration
s@StartContentModeration' {} Maybe Text
a -> StartContentModeration
s {$sel:clientRequestToken:StartContentModeration' :: Maybe Text
clientRequestToken = Maybe Text
a} :: StartContentModeration)
startContentModeration_minConfidence :: Lens.Lens' StartContentModeration (Prelude.Maybe Prelude.Double)
startContentModeration_minConfidence :: (Maybe Double -> f (Maybe Double))
-> StartContentModeration -> f StartContentModeration
startContentModeration_minConfidence = (StartContentModeration -> Maybe Double)
-> (StartContentModeration
-> Maybe Double -> StartContentModeration)
-> Lens
StartContentModeration
StartContentModeration
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContentModeration' {Maybe Double
minConfidence :: Maybe Double
$sel:minConfidence:StartContentModeration' :: StartContentModeration -> Maybe Double
minConfidence} -> Maybe Double
minConfidence) (\s :: StartContentModeration
s@StartContentModeration' {} Maybe Double
a -> StartContentModeration
s {$sel:minConfidence:StartContentModeration' :: Maybe Double
minConfidence = Maybe Double
a} :: StartContentModeration)
startContentModeration_video :: Lens.Lens' StartContentModeration Video
startContentModeration_video :: (Video -> f Video)
-> StartContentModeration -> f StartContentModeration
startContentModeration_video = (StartContentModeration -> Video)
-> (StartContentModeration -> Video -> StartContentModeration)
-> Lens StartContentModeration StartContentModeration Video Video
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContentModeration' {Video
video :: Video
$sel:video:StartContentModeration' :: StartContentModeration -> Video
video} -> Video
video) (\s :: StartContentModeration
s@StartContentModeration' {} Video
a -> StartContentModeration
s {$sel:video:StartContentModeration' :: Video
video = Video
a} :: StartContentModeration)
instance Core.AWSRequest StartContentModeration where
type
AWSResponse StartContentModeration =
StartContentModerationResponse
request :: StartContentModeration -> Request StartContentModeration
request = Service -> StartContentModeration -> Request StartContentModeration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartContentModeration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartContentModeration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StartContentModeration))
-> Logger
-> Service
-> Proxy StartContentModeration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartContentModeration)))
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 -> StartContentModerationResponse
StartContentModerationResponse'
(Maybe Text -> Int -> StartContentModerationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartContentModerationResponse)
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
"JobId")
Either String (Int -> StartContentModerationResponse)
-> Either String Int
-> Either String StartContentModerationResponse
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 StartContentModeration
instance Prelude.NFData StartContentModeration
instance Core.ToHeaders StartContentModeration where
toHeaders :: StartContentModeration -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartContentModeration -> 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
"RekognitionService.StartContentModeration" ::
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 StartContentModeration where
toJSON :: StartContentModeration -> Value
toJSON StartContentModeration' {Maybe Double
Maybe Text
Maybe NotificationChannel
Video
video :: Video
minConfidence :: Maybe Double
clientRequestToken :: Maybe Text
notificationChannel :: Maybe NotificationChannel
jobTag :: Maybe Text
$sel:video:StartContentModeration' :: StartContentModeration -> Video
$sel:minConfidence:StartContentModeration' :: StartContentModeration -> Maybe Double
$sel:clientRequestToken:StartContentModeration' :: StartContentModeration -> Maybe Text
$sel:notificationChannel:StartContentModeration' :: StartContentModeration -> Maybe NotificationChannel
$sel:jobTag:StartContentModeration' :: StartContentModeration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"JobTag" 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
jobTag,
(Text
"NotificationChannel" Text -> NotificationChannel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NotificationChannel -> Pair)
-> Maybe NotificationChannel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotificationChannel
notificationChannel,
(Text
"ClientRequestToken" 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
clientRequestToken,
(Text
"MinConfidence" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
minConfidence,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Video" Text -> Video -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Video
video)
]
)
instance Core.ToPath StartContentModeration where
toPath :: StartContentModeration -> ByteString
toPath = ByteString -> StartContentModeration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartContentModeration where
toQuery :: StartContentModeration -> QueryString
toQuery = QueryString -> StartContentModeration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartContentModerationResponse = StartContentModerationResponse'
{
StartContentModerationResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
StartContentModerationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartContentModerationResponse
-> StartContentModerationResponse -> Bool
(StartContentModerationResponse
-> StartContentModerationResponse -> Bool)
-> (StartContentModerationResponse
-> StartContentModerationResponse -> Bool)
-> Eq StartContentModerationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartContentModerationResponse
-> StartContentModerationResponse -> Bool
$c/= :: StartContentModerationResponse
-> StartContentModerationResponse -> Bool
== :: StartContentModerationResponse
-> StartContentModerationResponse -> Bool
$c== :: StartContentModerationResponse
-> StartContentModerationResponse -> Bool
Prelude.Eq, ReadPrec [StartContentModerationResponse]
ReadPrec StartContentModerationResponse
Int -> ReadS StartContentModerationResponse
ReadS [StartContentModerationResponse]
(Int -> ReadS StartContentModerationResponse)
-> ReadS [StartContentModerationResponse]
-> ReadPrec StartContentModerationResponse
-> ReadPrec [StartContentModerationResponse]
-> Read StartContentModerationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartContentModerationResponse]
$creadListPrec :: ReadPrec [StartContentModerationResponse]
readPrec :: ReadPrec StartContentModerationResponse
$creadPrec :: ReadPrec StartContentModerationResponse
readList :: ReadS [StartContentModerationResponse]
$creadList :: ReadS [StartContentModerationResponse]
readsPrec :: Int -> ReadS StartContentModerationResponse
$creadsPrec :: Int -> ReadS StartContentModerationResponse
Prelude.Read, Int -> StartContentModerationResponse -> ShowS
[StartContentModerationResponse] -> ShowS
StartContentModerationResponse -> String
(Int -> StartContentModerationResponse -> ShowS)
-> (StartContentModerationResponse -> String)
-> ([StartContentModerationResponse] -> ShowS)
-> Show StartContentModerationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartContentModerationResponse] -> ShowS
$cshowList :: [StartContentModerationResponse] -> ShowS
show :: StartContentModerationResponse -> String
$cshow :: StartContentModerationResponse -> String
showsPrec :: Int -> StartContentModerationResponse -> ShowS
$cshowsPrec :: Int -> StartContentModerationResponse -> ShowS
Prelude.Show, (forall x.
StartContentModerationResponse
-> Rep StartContentModerationResponse x)
-> (forall x.
Rep StartContentModerationResponse x
-> StartContentModerationResponse)
-> Generic StartContentModerationResponse
forall x.
Rep StartContentModerationResponse x
-> StartContentModerationResponse
forall x.
StartContentModerationResponse
-> Rep StartContentModerationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartContentModerationResponse x
-> StartContentModerationResponse
$cfrom :: forall x.
StartContentModerationResponse
-> Rep StartContentModerationResponse x
Prelude.Generic)
newStartContentModerationResponse ::
Prelude.Int ->
StartContentModerationResponse
newStartContentModerationResponse :: Int -> StartContentModerationResponse
newStartContentModerationResponse Int
pHttpStatus_ =
StartContentModerationResponse' :: Maybe Text -> Int -> StartContentModerationResponse
StartContentModerationResponse'
{ $sel:jobId:StartContentModerationResponse' :: Maybe Text
jobId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartContentModerationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startContentModerationResponse_jobId :: Lens.Lens' StartContentModerationResponse (Prelude.Maybe Prelude.Text)
startContentModerationResponse_jobId :: (Maybe Text -> f (Maybe Text))
-> StartContentModerationResponse
-> f StartContentModerationResponse
startContentModerationResponse_jobId = (StartContentModerationResponse -> Maybe Text)
-> (StartContentModerationResponse
-> Maybe Text -> StartContentModerationResponse)
-> Lens
StartContentModerationResponse
StartContentModerationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContentModerationResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:StartContentModerationResponse' :: StartContentModerationResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: StartContentModerationResponse
s@StartContentModerationResponse' {} Maybe Text
a -> StartContentModerationResponse
s {$sel:jobId:StartContentModerationResponse' :: Maybe Text
jobId = Maybe Text
a} :: StartContentModerationResponse)
startContentModerationResponse_httpStatus :: Lens.Lens' StartContentModerationResponse Prelude.Int
startContentModerationResponse_httpStatus :: (Int -> f Int)
-> StartContentModerationResponse
-> f StartContentModerationResponse
startContentModerationResponse_httpStatus = (StartContentModerationResponse -> Int)
-> (StartContentModerationResponse
-> Int -> StartContentModerationResponse)
-> Lens
StartContentModerationResponse
StartContentModerationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContentModerationResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartContentModerationResponse' :: StartContentModerationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartContentModerationResponse
s@StartContentModerationResponse' {} Int
a -> StartContentModerationResponse
s {$sel:httpStatus:StartContentModerationResponse' :: Int
httpStatus = Int
a} :: StartContentModerationResponse)
instance
Prelude.NFData
StartContentModerationResponse