{-# 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.DescribeCollection
(
DescribeCollection (..),
newDescribeCollection,
describeCollection_collectionId,
DescribeCollectionResponse (..),
newDescribeCollectionResponse,
describeCollectionResponse_faceModelVersion,
describeCollectionResponse_faceCount,
describeCollectionResponse_creationTimestamp,
describeCollectionResponse_collectionARN,
describeCollectionResponse_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 DescribeCollection = DescribeCollection'
{
DescribeCollection -> Text
collectionId :: Prelude.Text
}
deriving (DescribeCollection -> DescribeCollection -> Bool
(DescribeCollection -> DescribeCollection -> Bool)
-> (DescribeCollection -> DescribeCollection -> Bool)
-> Eq DescribeCollection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCollection -> DescribeCollection -> Bool
$c/= :: DescribeCollection -> DescribeCollection -> Bool
== :: DescribeCollection -> DescribeCollection -> Bool
$c== :: DescribeCollection -> DescribeCollection -> Bool
Prelude.Eq, ReadPrec [DescribeCollection]
ReadPrec DescribeCollection
Int -> ReadS DescribeCollection
ReadS [DescribeCollection]
(Int -> ReadS DescribeCollection)
-> ReadS [DescribeCollection]
-> ReadPrec DescribeCollection
-> ReadPrec [DescribeCollection]
-> Read DescribeCollection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCollection]
$creadListPrec :: ReadPrec [DescribeCollection]
readPrec :: ReadPrec DescribeCollection
$creadPrec :: ReadPrec DescribeCollection
readList :: ReadS [DescribeCollection]
$creadList :: ReadS [DescribeCollection]
readsPrec :: Int -> ReadS DescribeCollection
$creadsPrec :: Int -> ReadS DescribeCollection
Prelude.Read, Int -> DescribeCollection -> ShowS
[DescribeCollection] -> ShowS
DescribeCollection -> String
(Int -> DescribeCollection -> ShowS)
-> (DescribeCollection -> String)
-> ([DescribeCollection] -> ShowS)
-> Show DescribeCollection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCollection] -> ShowS
$cshowList :: [DescribeCollection] -> ShowS
show :: DescribeCollection -> String
$cshow :: DescribeCollection -> String
showsPrec :: Int -> DescribeCollection -> ShowS
$cshowsPrec :: Int -> DescribeCollection -> ShowS
Prelude.Show, (forall x. DescribeCollection -> Rep DescribeCollection x)
-> (forall x. Rep DescribeCollection x -> DescribeCollection)
-> Generic DescribeCollection
forall x. Rep DescribeCollection x -> DescribeCollection
forall x. DescribeCollection -> Rep DescribeCollection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeCollection x -> DescribeCollection
$cfrom :: forall x. DescribeCollection -> Rep DescribeCollection x
Prelude.Generic)
newDescribeCollection ::
Prelude.Text ->
DescribeCollection
newDescribeCollection :: Text -> DescribeCollection
newDescribeCollection Text
pCollectionId_ =
DescribeCollection' :: Text -> DescribeCollection
DescribeCollection' {$sel:collectionId:DescribeCollection' :: Text
collectionId = Text
pCollectionId_}
describeCollection_collectionId :: Lens.Lens' DescribeCollection Prelude.Text
describeCollection_collectionId :: (Text -> f Text) -> DescribeCollection -> f DescribeCollection
describeCollection_collectionId = (DescribeCollection -> Text)
-> (DescribeCollection -> Text -> DescribeCollection)
-> Lens DescribeCollection DescribeCollection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCollection' {Text
collectionId :: Text
$sel:collectionId:DescribeCollection' :: DescribeCollection -> Text
collectionId} -> Text
collectionId) (\s :: DescribeCollection
s@DescribeCollection' {} Text
a -> DescribeCollection
s {$sel:collectionId:DescribeCollection' :: Text
collectionId = Text
a} :: DescribeCollection)
instance Core.AWSRequest DescribeCollection where
type
AWSResponse DescribeCollection =
DescribeCollectionResponse
request :: DescribeCollection -> Request DescribeCollection
request = Service -> DescribeCollection -> Request DescribeCollection
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeCollection
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeCollection)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeCollection))
-> Logger
-> Service
-> Proxy DescribeCollection
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeCollection)))
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
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Int
-> DescribeCollectionResponse
DescribeCollectionResponse'
(Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Int
-> DescribeCollectionResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Natural
-> Maybe POSIX -> Maybe Text -> Int -> DescribeCollectionResponse)
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
"FaceModelVersion")
Either
String
(Maybe Natural
-> Maybe POSIX -> Maybe Text -> Int -> DescribeCollectionResponse)
-> Either String (Maybe Natural)
-> Either
String
(Maybe POSIX -> Maybe Text -> Int -> DescribeCollectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FaceCount")
Either
String
(Maybe POSIX -> Maybe Text -> Int -> DescribeCollectionResponse)
-> Either String (Maybe POSIX)
-> Either String (Maybe Text -> Int -> DescribeCollectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationTimestamp")
Either String (Maybe Text -> Int -> DescribeCollectionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeCollectionResponse)
forall (f :: * -> *) a b. Applicative f => 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
"CollectionARN")
Either String (Int -> DescribeCollectionResponse)
-> Either String Int -> Either String DescribeCollectionResponse
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 DescribeCollection
instance Prelude.NFData DescribeCollection
instance Core.ToHeaders DescribeCollection where
toHeaders :: DescribeCollection -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeCollection -> 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.DescribeCollection" ::
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 DescribeCollection where
toJSON :: DescribeCollection -> Value
toJSON DescribeCollection' {Text
collectionId :: Text
$sel:collectionId:DescribeCollection' :: DescribeCollection -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"CollectionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
collectionId)]
)
instance Core.ToPath DescribeCollection where
toPath :: DescribeCollection -> ByteString
toPath = ByteString -> DescribeCollection -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeCollection where
toQuery :: DescribeCollection -> QueryString
toQuery = QueryString -> DescribeCollection -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeCollectionResponse = DescribeCollectionResponse'
{
DescribeCollectionResponse -> Maybe Text
faceModelVersion :: Prelude.Maybe Prelude.Text,
DescribeCollectionResponse -> Maybe Natural
faceCount :: Prelude.Maybe Prelude.Natural,
DescribeCollectionResponse -> Maybe POSIX
creationTimestamp :: Prelude.Maybe Core.POSIX,
DescribeCollectionResponse -> Maybe Text
collectionARN :: Prelude.Maybe Prelude.Text,
DescribeCollectionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeCollectionResponse -> DescribeCollectionResponse -> Bool
(DescribeCollectionResponse -> DescribeCollectionResponse -> Bool)
-> (DescribeCollectionResponse
-> DescribeCollectionResponse -> Bool)
-> Eq DescribeCollectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCollectionResponse -> DescribeCollectionResponse -> Bool
$c/= :: DescribeCollectionResponse -> DescribeCollectionResponse -> Bool
== :: DescribeCollectionResponse -> DescribeCollectionResponse -> Bool
$c== :: DescribeCollectionResponse -> DescribeCollectionResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCollectionResponse]
ReadPrec DescribeCollectionResponse
Int -> ReadS DescribeCollectionResponse
ReadS [DescribeCollectionResponse]
(Int -> ReadS DescribeCollectionResponse)
-> ReadS [DescribeCollectionResponse]
-> ReadPrec DescribeCollectionResponse
-> ReadPrec [DescribeCollectionResponse]
-> Read DescribeCollectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCollectionResponse]
$creadListPrec :: ReadPrec [DescribeCollectionResponse]
readPrec :: ReadPrec DescribeCollectionResponse
$creadPrec :: ReadPrec DescribeCollectionResponse
readList :: ReadS [DescribeCollectionResponse]
$creadList :: ReadS [DescribeCollectionResponse]
readsPrec :: Int -> ReadS DescribeCollectionResponse
$creadsPrec :: Int -> ReadS DescribeCollectionResponse
Prelude.Read, Int -> DescribeCollectionResponse -> ShowS
[DescribeCollectionResponse] -> ShowS
DescribeCollectionResponse -> String
(Int -> DescribeCollectionResponse -> ShowS)
-> (DescribeCollectionResponse -> String)
-> ([DescribeCollectionResponse] -> ShowS)
-> Show DescribeCollectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCollectionResponse] -> ShowS
$cshowList :: [DescribeCollectionResponse] -> ShowS
show :: DescribeCollectionResponse -> String
$cshow :: DescribeCollectionResponse -> String
showsPrec :: Int -> DescribeCollectionResponse -> ShowS
$cshowsPrec :: Int -> DescribeCollectionResponse -> ShowS
Prelude.Show, (forall x.
DescribeCollectionResponse -> Rep DescribeCollectionResponse x)
-> (forall x.
Rep DescribeCollectionResponse x -> DescribeCollectionResponse)
-> Generic DescribeCollectionResponse
forall x.
Rep DescribeCollectionResponse x -> DescribeCollectionResponse
forall x.
DescribeCollectionResponse -> Rep DescribeCollectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCollectionResponse x -> DescribeCollectionResponse
$cfrom :: forall x.
DescribeCollectionResponse -> Rep DescribeCollectionResponse x
Prelude.Generic)
newDescribeCollectionResponse ::
Prelude.Int ->
DescribeCollectionResponse
newDescribeCollectionResponse :: Int -> DescribeCollectionResponse
newDescribeCollectionResponse Int
pHttpStatus_ =
DescribeCollectionResponse' :: Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Int
-> DescribeCollectionResponse
DescribeCollectionResponse'
{ $sel:faceModelVersion:DescribeCollectionResponse' :: Maybe Text
faceModelVersion =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:faceCount:DescribeCollectionResponse' :: Maybe Natural
faceCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:creationTimestamp:DescribeCollectionResponse' :: Maybe POSIX
creationTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:collectionARN:DescribeCollectionResponse' :: Maybe Text
collectionARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeCollectionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeCollectionResponse_faceModelVersion :: Lens.Lens' DescribeCollectionResponse (Prelude.Maybe Prelude.Text)
describeCollectionResponse_faceModelVersion :: (Maybe Text -> f (Maybe Text))
-> DescribeCollectionResponse -> f DescribeCollectionResponse
describeCollectionResponse_faceModelVersion = (DescribeCollectionResponse -> Maybe Text)
-> (DescribeCollectionResponse
-> Maybe Text -> DescribeCollectionResponse)
-> Lens
DescribeCollectionResponse
DescribeCollectionResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCollectionResponse' {Maybe Text
faceModelVersion :: Maybe Text
$sel:faceModelVersion:DescribeCollectionResponse' :: DescribeCollectionResponse -> Maybe Text
faceModelVersion} -> Maybe Text
faceModelVersion) (\s :: DescribeCollectionResponse
s@DescribeCollectionResponse' {} Maybe Text
a -> DescribeCollectionResponse
s {$sel:faceModelVersion:DescribeCollectionResponse' :: Maybe Text
faceModelVersion = Maybe Text
a} :: DescribeCollectionResponse)
describeCollectionResponse_faceCount :: Lens.Lens' DescribeCollectionResponse (Prelude.Maybe Prelude.Natural)
describeCollectionResponse_faceCount :: (Maybe Natural -> f (Maybe Natural))
-> DescribeCollectionResponse -> f DescribeCollectionResponse
describeCollectionResponse_faceCount = (DescribeCollectionResponse -> Maybe Natural)
-> (DescribeCollectionResponse
-> Maybe Natural -> DescribeCollectionResponse)
-> Lens
DescribeCollectionResponse
DescribeCollectionResponse
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCollectionResponse' {Maybe Natural
faceCount :: Maybe Natural
$sel:faceCount:DescribeCollectionResponse' :: DescribeCollectionResponse -> Maybe Natural
faceCount} -> Maybe Natural
faceCount) (\s :: DescribeCollectionResponse
s@DescribeCollectionResponse' {} Maybe Natural
a -> DescribeCollectionResponse
s {$sel:faceCount:DescribeCollectionResponse' :: Maybe Natural
faceCount = Maybe Natural
a} :: DescribeCollectionResponse)
describeCollectionResponse_creationTimestamp :: Lens.Lens' DescribeCollectionResponse (Prelude.Maybe Prelude.UTCTime)
describeCollectionResponse_creationTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeCollectionResponse -> f DescribeCollectionResponse
describeCollectionResponse_creationTimestamp = (DescribeCollectionResponse -> Maybe POSIX)
-> (DescribeCollectionResponse
-> Maybe POSIX -> DescribeCollectionResponse)
-> Lens
DescribeCollectionResponse
DescribeCollectionResponse
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCollectionResponse' {Maybe POSIX
creationTimestamp :: Maybe POSIX
$sel:creationTimestamp:DescribeCollectionResponse' :: DescribeCollectionResponse -> Maybe POSIX
creationTimestamp} -> Maybe POSIX
creationTimestamp) (\s :: DescribeCollectionResponse
s@DescribeCollectionResponse' {} Maybe POSIX
a -> DescribeCollectionResponse
s {$sel:creationTimestamp:DescribeCollectionResponse' :: Maybe POSIX
creationTimestamp = Maybe POSIX
a} :: DescribeCollectionResponse) ((Maybe POSIX -> f (Maybe POSIX))
-> DescribeCollectionResponse -> f DescribeCollectionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeCollectionResponse
-> f DescribeCollectionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
describeCollectionResponse_collectionARN :: Lens.Lens' DescribeCollectionResponse (Prelude.Maybe Prelude.Text)
describeCollectionResponse_collectionARN :: (Maybe Text -> f (Maybe Text))
-> DescribeCollectionResponse -> f DescribeCollectionResponse
describeCollectionResponse_collectionARN = (DescribeCollectionResponse -> Maybe Text)
-> (DescribeCollectionResponse
-> Maybe Text -> DescribeCollectionResponse)
-> Lens
DescribeCollectionResponse
DescribeCollectionResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCollectionResponse' {Maybe Text
collectionARN :: Maybe Text
$sel:collectionARN:DescribeCollectionResponse' :: DescribeCollectionResponse -> Maybe Text
collectionARN} -> Maybe Text
collectionARN) (\s :: DescribeCollectionResponse
s@DescribeCollectionResponse' {} Maybe Text
a -> DescribeCollectionResponse
s {$sel:collectionARN:DescribeCollectionResponse' :: Maybe Text
collectionARN = Maybe Text
a} :: DescribeCollectionResponse)
describeCollectionResponse_httpStatus :: Lens.Lens' DescribeCollectionResponse Prelude.Int
describeCollectionResponse_httpStatus :: (Int -> f Int)
-> DescribeCollectionResponse -> f DescribeCollectionResponse
describeCollectionResponse_httpStatus = (DescribeCollectionResponse -> Int)
-> (DescribeCollectionResponse
-> Int -> DescribeCollectionResponse)
-> Lens
DescribeCollectionResponse DescribeCollectionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCollectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeCollectionResponse' :: DescribeCollectionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeCollectionResponse
s@DescribeCollectionResponse' {} Int
a -> DescribeCollectionResponse
s {$sel:httpStatus:DescribeCollectionResponse' :: Int
httpStatus = Int
a} :: DescribeCollectionResponse)
instance Prelude.NFData DescribeCollectionResponse