{-# 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_clientRequestToken,
startCelebrityRecognition_jobTag,
startCelebrityRecognition_notificationChannel,
startCelebrityRecognition_video,
StartCelebrityRecognitionResponse (..),
newStartCelebrityRecognitionResponse,
startCelebrityRecognitionResponse_jobId,
startCelebrityRecognitionResponse_httpStatus,
)
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 Amazonka.Rekognition.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StartCelebrityRecognition = StartCelebrityRecognition'
{
StartCelebrityRecognition -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
StartCelebrityRecognition -> Maybe Text
jobTag :: Prelude.Maybe Prelude.Text,
StartCelebrityRecognition -> Maybe NotificationChannel
notificationChannel :: Prelude.Maybe NotificationChannel,
StartCelebrityRecognition -> Video
video :: Video
}
deriving (StartCelebrityRecognition -> StartCelebrityRecognition -> Bool
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]
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
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.
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'
{ $sel:clientRequestToken:StartCelebrityRecognition' :: Maybe Text
clientRequestToken =
forall a. Maybe a
Prelude.Nothing,
$sel:jobTag:StartCelebrityRecognition' :: Maybe Text
jobTag = forall a. Maybe a
Prelude.Nothing,
$sel:notificationChannel:StartCelebrityRecognition' :: Maybe NotificationChannel
notificationChannel = forall a. Maybe a
Prelude.Nothing,
$sel:video:StartCelebrityRecognition' :: Video
video = Video
pVideo_
}
startCelebrityRecognition_clientRequestToken :: Lens.Lens' StartCelebrityRecognition (Prelude.Maybe Prelude.Text)
startCelebrityRecognition_clientRequestToken :: Lens' StartCelebrityRecognition (Maybe Text)
startCelebrityRecognition_clientRequestToken = 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_jobTag :: Lens.Lens' StartCelebrityRecognition (Prelude.Maybe Prelude.Text)
startCelebrityRecognition_jobTag :: Lens' StartCelebrityRecognition (Maybe Text)
startCelebrityRecognition_jobTag = 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 :: Lens' StartCelebrityRecognition (Maybe NotificationChannel)
startCelebrityRecognition_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_video :: Lens.Lens' StartCelebrityRecognition Video
startCelebrityRecognition_video :: Lens' StartCelebrityRecognition Video
startCelebrityRecognition_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 :: (Service -> Service)
-> StartCelebrityRecognition -> Request StartCelebrityRecognition
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 StartCelebrityRecognition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartCelebrityRecognition)))
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 ->
Maybe Text -> Int -> StartCelebrityRecognitionResponse
StartCelebrityRecognitionResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"JobId")
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable StartCelebrityRecognition where
hashWithSalt :: Int -> StartCelebrityRecognition -> Int
hashWithSalt Int
_salt StartCelebrityRecognition' {Maybe Text
Maybe NotificationChannel
Video
video :: Video
notificationChannel :: Maybe NotificationChannel
jobTag :: Maybe Text
clientRequestToken :: Maybe Text
$sel:video:StartCelebrityRecognition' :: StartCelebrityRecognition -> Video
$sel:notificationChannel:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe NotificationChannel
$sel:jobTag:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe Text
$sel:clientRequestToken:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientRequestToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
jobTag
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NotificationChannel
notificationChannel
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Video
video
instance Prelude.NFData StartCelebrityRecognition where
rnf :: StartCelebrityRecognition -> ()
rnf StartCelebrityRecognition' {Maybe Text
Maybe NotificationChannel
Video
video :: Video
notificationChannel :: Maybe NotificationChannel
jobTag :: Maybe Text
clientRequestToken :: Maybe Text
$sel:video:StartCelebrityRecognition' :: StartCelebrityRecognition -> Video
$sel:notificationChannel:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe NotificationChannel
$sel:jobTag:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe Text
$sel:clientRequestToken:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientRequestToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobTag
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NotificationChannel
notificationChannel
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Video
video
instance Data.ToHeaders StartCelebrityRecognition where
toHeaders :: StartCelebrityRecognition -> 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
"RekognitionService.StartCelebrityRecognition" ::
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 StartCelebrityRecognition where
toJSON :: StartCelebrityRecognition -> Value
toJSON StartCelebrityRecognition' {Maybe Text
Maybe NotificationChannel
Video
video :: Video
notificationChannel :: Maybe NotificationChannel
jobTag :: Maybe Text
clientRequestToken :: Maybe Text
$sel:video:StartCelebrityRecognition' :: StartCelebrityRecognition -> Video
$sel:notificationChannel:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe NotificationChannel
$sel:jobTag:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe Text
$sel:clientRequestToken:StartCelebrityRecognition' :: StartCelebrityRecognition -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ClientRequestToken" 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 Text
clientRequestToken,
(Key
"JobTag" 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 Text
jobTag,
(Key
"NotificationChannel" 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 NotificationChannel
notificationChannel,
forall a. a -> Maybe a
Prelude.Just (Key
"Video" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Video
video)
]
)
instance Data.ToPath StartCelebrityRecognition where
toPath :: StartCelebrityRecognition -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StartCelebrityRecognition where
toQuery :: StartCelebrityRecognition -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:jobId:StartCelebrityRecognitionResponse' :: Maybe Text
jobId =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartCelebrityRecognitionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startCelebrityRecognitionResponse_jobId :: Lens.Lens' StartCelebrityRecognitionResponse (Prelude.Maybe Prelude.Text)
startCelebrityRecognitionResponse_jobId :: Lens' StartCelebrityRecognitionResponse (Maybe Text)
startCelebrityRecognitionResponse_jobId = 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 :: Lens' StartCelebrityRecognitionResponse Int
startCelebrityRecognitionResponse_httpStatus = 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
where
rnf :: StartCelebrityRecognitionResponse -> ()
rnf StartCelebrityRecognitionResponse' {Int
Maybe Text
httpStatus :: Int
jobId :: Maybe Text
$sel:httpStatus:StartCelebrityRecognitionResponse' :: StartCelebrityRecognitionResponse -> Int
$sel:jobId:StartCelebrityRecognitionResponse' :: StartCelebrityRecognitionResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus