{-# 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.StartCelebrityRecognition
(
StartCelebrityRecognition (..),
newStartCelebrityRecognition,
startCelebrityRecognition_jobTag,
startCelebrityRecognition_notificationChannel,
startCelebrityRecognition_clientRequestToken,
startCelebrityRecognition_video,
StartCelebrityRecognitionResponse (..),
newStartCelebrityRecognitionResponse,
startCelebrityRecognitionResponse_jobId,
startCelebrityRecognitionResponse_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 StartCelebrityRecognition = StartCelebrityRecognition'
{
StartCelebrityRecognition -> Maybe Text
jobTag :: Prelude.Maybe Prelude.Text,
StartCelebrityRecognition -> Maybe NotificationChannel
notificationChannel :: Prelude.Maybe NotificationChannel,
StartCelebrityRecognition -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
StartCelebrityRecognition -> Video
video :: Video
}
deriving (StartCelebrityRecognition -> StartCelebrityRecognition -> Bool
(StartCelebrityRecognition -> StartCelebrityRecognition -> Bool)
-> (StartCelebrityRecognition -> StartCelebrityRecognition -> Bool)
-> Eq StartCelebrityRecognition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartCelebrityRecognition -> StartCelebrityRecognition -> Bool
$c/= :: StartCelebrityRecognition -> StartCelebrityRecognition -> Bool
== :: StartCelebrityRecognition -> StartCelebrityRecognition -> Bool
$c== :: StartCelebrityRecognition -> StartCelebrityRecognition -> Bool
Prelude.Eq, ReadPrec [StartCelebrityRecognition]
ReadPrec StartCelebrityRecognition
Int -> ReadS StartCelebrityRecognition
ReadS [StartCelebrityRecognition]
(Int -> ReadS StartCelebrityRecognition)
-> ReadS [StartCelebrityRecognition]
-> ReadPrec StartCelebrityRecognition
-> ReadPrec [StartCelebrityRecognition]
-> Read StartCelebrityRecognition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartCelebrityRecognition]
$creadListPrec :: ReadPrec [StartCelebrityRecognition]
readPrec :: ReadPrec StartCelebrityRecognition
$creadPrec :: ReadPrec StartCelebrityRecognition
readList :: ReadS [StartCelebrityRecognition]
$creadList :: ReadS [StartCelebrityRecognition]
readsPrec :: Int -> ReadS StartCelebrityRecognition
$creadsPrec :: Int -> ReadS StartCelebrityRecognition
Prelude.Read, Int -> StartCelebrityRecognition -> ShowS
[StartCelebrityRecognition] -> ShowS
StartCelebrityRecognition -> String
(Int -> StartCelebrityRecognition -> ShowS)
-> (StartCelebrityRecognition -> String)
-> ([StartCelebrityRecognition] -> ShowS)
-> Show StartCelebrityRecognition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartCelebrityRecognition] -> ShowS
$cshowList :: [StartCelebrityRecognition] -> ShowS
show :: StartCelebrityRecognition -> String
$cshow :: StartCelebrityRecognition -> String
showsPrec :: Int -> StartCelebrityRecognition -> ShowS
$cshowsPrec :: Int -> StartCelebrityRecognition -> ShowS
Prelude.Show, (forall x.
StartCelebrityRecognition -> Rep StartCelebrityRecognition x)
-> (forall x.
Rep StartCelebrityRecognition x -> StartCelebrityRecognition)
-> Generic StartCelebrityRecognition
forall x.
Rep StartCelebrityRecognition x -> StartCelebrityRecognition
forall x.
StartCelebrityRecognition -> Rep StartCelebrityRecognition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartCelebrityRecognition x -> StartCelebrityRecognition
$cfrom :: forall x.
StartCelebrityRecognition -> Rep StartCelebrityRecognition x
Prelude.Generic)
newStartCelebrityRecognition ::
Video ->
StartCelebrityRecognition
newStartCelebrityRecognition :: Video -> StartCelebrityRecognition
newStartCelebrityRecognition Video
pVideo_ =
StartCelebrityRecognition' :: Maybe Text
-> Maybe NotificationChannel
-> Maybe Text
-> Video
-> StartCelebrityRecognition
StartCelebrityRecognition'
{ $sel:jobTag:StartCelebrityRecognition' :: Maybe Text
jobTag =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:notificationChannel:StartCelebrityRecognition' :: Maybe NotificationChannel
notificationChannel = Maybe NotificationChannel
forall a. Maybe a
Prelude.Nothing,
$sel:clientRequestToken:StartCelebrityRecognition' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:video:StartCelebrityRecognition' :: Video
video = Video
pVideo_
}
startCelebrityRecognition_jobTag :: Lens.Lens' StartCelebrityRecognition (Prelude.Maybe Prelude.Text)
startCelebrityRecognition_jobTag :: (Maybe Text -> f (Maybe Text))
-> StartCelebrityRecognition -> f StartCelebrityRecognition
startCelebrityRecognition_jobTag = (StartCelebrityRecognition -> Maybe Text)
-> (StartCelebrityRecognition
-> Maybe Text -> StartCelebrityRecognition)
-> Lens
StartCelebrityRecognition
StartCelebrityRecognition
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartCelebrityRecognition' {Maybe Text
jobTag :: Maybe Text
$sel:jobTag:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe Text
jobTag} -> Maybe Text
jobTag) (\s :: StartCelebrityRecognition
s@StartCelebrityRecognition' {} Maybe Text
a -> StartCelebrityRecognition
s {$sel:jobTag:StartCelebrityRecognition' :: Maybe Text
jobTag = Maybe Text
a} :: StartCelebrityRecognition)
startCelebrityRecognition_notificationChannel :: Lens.Lens' StartCelebrityRecognition (Prelude.Maybe NotificationChannel)
startCelebrityRecognition_notificationChannel :: (Maybe NotificationChannel -> f (Maybe NotificationChannel))
-> StartCelebrityRecognition -> f StartCelebrityRecognition
startCelebrityRecognition_notificationChannel = (StartCelebrityRecognition -> Maybe NotificationChannel)
-> (StartCelebrityRecognition
-> Maybe NotificationChannel -> StartCelebrityRecognition)
-> Lens
StartCelebrityRecognition
StartCelebrityRecognition
(Maybe NotificationChannel)
(Maybe NotificationChannel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartCelebrityRecognition' {Maybe NotificationChannel
notificationChannel :: Maybe NotificationChannel
$sel:notificationChannel:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe NotificationChannel
notificationChannel} -> Maybe NotificationChannel
notificationChannel) (\s :: StartCelebrityRecognition
s@StartCelebrityRecognition' {} Maybe NotificationChannel
a -> StartCelebrityRecognition
s {$sel:notificationChannel:StartCelebrityRecognition' :: Maybe NotificationChannel
notificationChannel = Maybe NotificationChannel
a} :: StartCelebrityRecognition)
startCelebrityRecognition_clientRequestToken :: Lens.Lens' StartCelebrityRecognition (Prelude.Maybe Prelude.Text)
startCelebrityRecognition_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> StartCelebrityRecognition -> f StartCelebrityRecognition
startCelebrityRecognition_clientRequestToken = (StartCelebrityRecognition -> Maybe Text)
-> (StartCelebrityRecognition
-> Maybe Text -> StartCelebrityRecognition)
-> Lens
StartCelebrityRecognition
StartCelebrityRecognition
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartCelebrityRecognition' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: StartCelebrityRecognition
s@StartCelebrityRecognition' {} Maybe Text
a -> StartCelebrityRecognition
s {$sel:clientRequestToken:StartCelebrityRecognition' :: Maybe Text
clientRequestToken = Maybe Text
a} :: StartCelebrityRecognition)
startCelebrityRecognition_video :: Lens.Lens' StartCelebrityRecognition Video
startCelebrityRecognition_video :: (Video -> f Video)
-> StartCelebrityRecognition -> f StartCelebrityRecognition
startCelebrityRecognition_video = (StartCelebrityRecognition -> Video)
-> (StartCelebrityRecognition
-> Video -> StartCelebrityRecognition)
-> Lens
StartCelebrityRecognition StartCelebrityRecognition Video Video
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartCelebrityRecognition' {Video
video :: Video
$sel:video:StartCelebrityRecognition' :: StartCelebrityRecognition -> Video
video} -> Video
video) (\s :: StartCelebrityRecognition
s@StartCelebrityRecognition' {} Video
a -> StartCelebrityRecognition
s {$sel:video:StartCelebrityRecognition' :: Video
video = Video
a} :: StartCelebrityRecognition)
instance Core.AWSRequest StartCelebrityRecognition where
type
AWSResponse StartCelebrityRecognition =
StartCelebrityRecognitionResponse
request :: StartCelebrityRecognition -> Request StartCelebrityRecognition
request = Service
-> StartCelebrityRecognition -> Request StartCelebrityRecognition
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartCelebrityRecognition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartCelebrityRecognition)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StartCelebrityRecognition))
-> Logger
-> Service
-> Proxy StartCelebrityRecognition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartCelebrityRecognition)))
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 -> StartCelebrityRecognitionResponse
StartCelebrityRecognitionResponse'
(Maybe Text -> Int -> StartCelebrityRecognitionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartCelebrityRecognitionResponse)
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 -> StartCelebrityRecognitionResponse)
-> Either String Int
-> Either String StartCelebrityRecognitionResponse
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 StartCelebrityRecognition
instance Prelude.NFData StartCelebrityRecognition
instance Core.ToHeaders StartCelebrityRecognition where
toHeaders :: StartCelebrityRecognition -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartCelebrityRecognition -> 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.StartCelebrityRecognition" ::
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 StartCelebrityRecognition where
toJSON :: StartCelebrityRecognition -> Value
toJSON StartCelebrityRecognition' {Maybe Text
Maybe NotificationChannel
Video
video :: Video
clientRequestToken :: Maybe Text
notificationChannel :: Maybe NotificationChannel
jobTag :: Maybe Text
$sel:video:StartCelebrityRecognition' :: StartCelebrityRecognition -> Video
$sel:clientRequestToken:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe Text
$sel:notificationChannel:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe NotificationChannel
$sel:jobTag:StartCelebrityRecognition' :: StartCelebrityRecognition -> 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,
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 StartCelebrityRecognition where
toPath :: StartCelebrityRecognition -> ByteString
toPath = ByteString -> StartCelebrityRecognition -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartCelebrityRecognition where
toQuery :: StartCelebrityRecognition -> QueryString
toQuery = QueryString -> StartCelebrityRecognition -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartCelebrityRecognitionResponse = StartCelebrityRecognitionResponse'
{
StartCelebrityRecognitionResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
StartCelebrityRecognitionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartCelebrityRecognitionResponse
-> StartCelebrityRecognitionResponse -> Bool
(StartCelebrityRecognitionResponse
-> StartCelebrityRecognitionResponse -> Bool)
-> (StartCelebrityRecognitionResponse
-> StartCelebrityRecognitionResponse -> Bool)
-> Eq StartCelebrityRecognitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartCelebrityRecognitionResponse
-> StartCelebrityRecognitionResponse -> Bool
$c/= :: StartCelebrityRecognitionResponse
-> StartCelebrityRecognitionResponse -> Bool
== :: StartCelebrityRecognitionResponse
-> StartCelebrityRecognitionResponse -> Bool
$c== :: StartCelebrityRecognitionResponse
-> StartCelebrityRecognitionResponse -> Bool
Prelude.Eq, ReadPrec [StartCelebrityRecognitionResponse]
ReadPrec StartCelebrityRecognitionResponse
Int -> ReadS StartCelebrityRecognitionResponse
ReadS [StartCelebrityRecognitionResponse]
(Int -> ReadS StartCelebrityRecognitionResponse)
-> ReadS [StartCelebrityRecognitionResponse]
-> ReadPrec StartCelebrityRecognitionResponse
-> ReadPrec [StartCelebrityRecognitionResponse]
-> Read StartCelebrityRecognitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartCelebrityRecognitionResponse]
$creadListPrec :: ReadPrec [StartCelebrityRecognitionResponse]
readPrec :: ReadPrec StartCelebrityRecognitionResponse
$creadPrec :: ReadPrec StartCelebrityRecognitionResponse
readList :: ReadS [StartCelebrityRecognitionResponse]
$creadList :: ReadS [StartCelebrityRecognitionResponse]
readsPrec :: Int -> ReadS StartCelebrityRecognitionResponse
$creadsPrec :: Int -> ReadS StartCelebrityRecognitionResponse
Prelude.Read, Int -> StartCelebrityRecognitionResponse -> ShowS
[StartCelebrityRecognitionResponse] -> ShowS
StartCelebrityRecognitionResponse -> String
(Int -> StartCelebrityRecognitionResponse -> ShowS)
-> (StartCelebrityRecognitionResponse -> String)
-> ([StartCelebrityRecognitionResponse] -> ShowS)
-> Show StartCelebrityRecognitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartCelebrityRecognitionResponse] -> ShowS
$cshowList :: [StartCelebrityRecognitionResponse] -> ShowS
show :: StartCelebrityRecognitionResponse -> String
$cshow :: StartCelebrityRecognitionResponse -> String
showsPrec :: Int -> StartCelebrityRecognitionResponse -> ShowS
$cshowsPrec :: Int -> StartCelebrityRecognitionResponse -> ShowS
Prelude.Show, (forall x.
StartCelebrityRecognitionResponse
-> Rep StartCelebrityRecognitionResponse x)
-> (forall x.
Rep StartCelebrityRecognitionResponse x
-> StartCelebrityRecognitionResponse)
-> Generic StartCelebrityRecognitionResponse
forall x.
Rep StartCelebrityRecognitionResponse x
-> StartCelebrityRecognitionResponse
forall x.
StartCelebrityRecognitionResponse
-> Rep StartCelebrityRecognitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartCelebrityRecognitionResponse x
-> StartCelebrityRecognitionResponse
$cfrom :: forall x.
StartCelebrityRecognitionResponse
-> Rep StartCelebrityRecognitionResponse x
Prelude.Generic)
newStartCelebrityRecognitionResponse ::
Prelude.Int ->
StartCelebrityRecognitionResponse
newStartCelebrityRecognitionResponse :: Int -> StartCelebrityRecognitionResponse
newStartCelebrityRecognitionResponse Int
pHttpStatus_ =
StartCelebrityRecognitionResponse' :: Maybe Text -> Int -> StartCelebrityRecognitionResponse
StartCelebrityRecognitionResponse'
{ $sel:jobId:StartCelebrityRecognitionResponse' :: Maybe Text
jobId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartCelebrityRecognitionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startCelebrityRecognitionResponse_jobId :: Lens.Lens' StartCelebrityRecognitionResponse (Prelude.Maybe Prelude.Text)
startCelebrityRecognitionResponse_jobId :: (Maybe Text -> f (Maybe Text))
-> StartCelebrityRecognitionResponse
-> f StartCelebrityRecognitionResponse
startCelebrityRecognitionResponse_jobId = (StartCelebrityRecognitionResponse -> Maybe Text)
-> (StartCelebrityRecognitionResponse
-> Maybe Text -> StartCelebrityRecognitionResponse)
-> Lens
StartCelebrityRecognitionResponse
StartCelebrityRecognitionResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartCelebrityRecognitionResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:StartCelebrityRecognitionResponse' :: StartCelebrityRecognitionResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: StartCelebrityRecognitionResponse
s@StartCelebrityRecognitionResponse' {} Maybe Text
a -> StartCelebrityRecognitionResponse
s {$sel:jobId:StartCelebrityRecognitionResponse' :: Maybe Text
jobId = Maybe Text
a} :: StartCelebrityRecognitionResponse)
startCelebrityRecognitionResponse_httpStatus :: Lens.Lens' StartCelebrityRecognitionResponse Prelude.Int
startCelebrityRecognitionResponse_httpStatus :: (Int -> f Int)
-> StartCelebrityRecognitionResponse
-> f StartCelebrityRecognitionResponse
startCelebrityRecognitionResponse_httpStatus = (StartCelebrityRecognitionResponse -> Int)
-> (StartCelebrityRecognitionResponse
-> Int -> StartCelebrityRecognitionResponse)
-> Lens
StartCelebrityRecognitionResponse
StartCelebrityRecognitionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartCelebrityRecognitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartCelebrityRecognitionResponse' :: StartCelebrityRecognitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartCelebrityRecognitionResponse
s@StartCelebrityRecognitionResponse' {} Int
a -> StartCelebrityRecognitionResponse
s {$sel:httpStatus:StartCelebrityRecognitionResponse' :: Int
httpStatus = Int
a} :: StartCelebrityRecognitionResponse)
instance
Prelude.NFData
StartCelebrityRecognitionResponse