{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Rekognition.GetContentModeration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets the inappropriate, unwanted, or offensive content analysis results
-- for a Amazon Rekognition Video analysis started by
-- StartContentModeration. For a list of moderation labels in Amazon
-- Rekognition, see
-- <https://docs.aws.amazon.com/rekognition/latest/dg/moderation.html#moderation-api Using the image and video moderation APIs>.
--
-- Amazon Rekognition Video inappropriate or offensive content detection in
-- a stored video is an asynchronous operation. You start analysis by
-- calling StartContentModeration which returns a job identifier (@JobId@).
-- When analysis finishes, Amazon Rekognition Video publishes a completion
-- status to the Amazon Simple Notification Service topic registered in the
-- initial call to @StartContentModeration@. To get the results of the
-- content analysis, first check that the status value published to the
-- Amazon SNS topic is @SUCCEEDED@. If so, call @GetContentModeration@ and
-- pass the job identifier (@JobId@) from the initial call to
-- @StartContentModeration@.
--
-- For more information, see Working with Stored Videos in the Amazon
-- Rekognition Devlopers Guide.
--
-- @GetContentModeration@ returns detected inappropriate, unwanted, or
-- offensive content moderation labels, and the time they are detected, in
-- an array, @ModerationLabels@, of ContentModerationDetection objects.
--
-- By default, the moderated labels are returned sorted by time, in
-- milliseconds from the start of the video. You can also sort them by
-- moderated label by specifying @NAME@ for the @SortBy@ input parameter.
--
-- Since video analysis can return a large number of results, use the
-- @MaxResults@ parameter to limit the number of labels returned in a
-- single call to @GetContentModeration@. If there are more results than
-- specified in @MaxResults@, the value of @NextToken@ in the operation
-- response contains a pagination token for getting the next set of
-- results. To get the next page of results, call @GetContentModeration@
-- and populate the @NextToken@ request parameter with the value of
-- @NextToken@ returned from the previous call to @GetContentModeration@.
--
-- For more information, see moderating content in the Amazon Rekognition
-- Developer Guide.
module Amazonka.Rekognition.GetContentModeration
  ( -- * Creating a Request
    GetContentModeration (..),
    newGetContentModeration,

    -- * Request Lenses
    getContentModeration_maxResults,
    getContentModeration_nextToken,
    getContentModeration_sortBy,
    getContentModeration_jobId,

    -- * Destructuring the Response
    GetContentModerationResponse (..),
    newGetContentModerationResponse,

    -- * Response Lenses
    getContentModerationResponse_jobStatus,
    getContentModerationResponse_moderationLabels,
    getContentModerationResponse_moderationModelVersion,
    getContentModerationResponse_nextToken,
    getContentModerationResponse_statusMessage,
    getContentModerationResponse_videoMetadata,
    getContentModerationResponse_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

-- | /See:/ 'newGetContentModeration' smart constructor.
data GetContentModeration = GetContentModeration'
  { -- | Maximum number of results to return per paginated call. The largest
    -- value you can specify is 1000. If you specify a value greater than 1000,
    -- a maximum of 1000 results is returned. The default value is 1000.
    GetContentModeration -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the previous response was incomplete (because there is more data to
    -- retrieve), Amazon Rekognition returns a pagination token in the
    -- response. You can use this pagination token to retrieve the next set of
    -- content moderation labels.
    GetContentModeration -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Sort to use for elements in the @ModerationLabelDetections@ array. Use
    -- @TIMESTAMP@ to sort array elements by the time labels are detected. Use
    -- @NAME@ to alphabetically group elements for a label together. Within
    -- each label group, the array element are sorted by detection confidence.
    -- The default sort is by @TIMESTAMP@.
    GetContentModeration -> Maybe ContentModerationSortBy
sortBy :: Prelude.Maybe ContentModerationSortBy,
    -- | The identifier for the inappropriate, unwanted, or offensive content
    -- moderation job. Use @JobId@ to identify the job in a subsequent call to
    -- @GetContentModeration@.
    GetContentModeration -> Text
jobId :: Prelude.Text
  }
  deriving (GetContentModeration -> GetContentModeration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContentModeration -> GetContentModeration -> Bool
$c/= :: GetContentModeration -> GetContentModeration -> Bool
== :: GetContentModeration -> GetContentModeration -> Bool
$c== :: GetContentModeration -> GetContentModeration -> Bool
Prelude.Eq, ReadPrec [GetContentModeration]
ReadPrec GetContentModeration
Int -> ReadS GetContentModeration
ReadS [GetContentModeration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContentModeration]
$creadListPrec :: ReadPrec [GetContentModeration]
readPrec :: ReadPrec GetContentModeration
$creadPrec :: ReadPrec GetContentModeration
readList :: ReadS [GetContentModeration]
$creadList :: ReadS [GetContentModeration]
readsPrec :: Int -> ReadS GetContentModeration
$creadsPrec :: Int -> ReadS GetContentModeration
Prelude.Read, Int -> GetContentModeration -> ShowS
[GetContentModeration] -> ShowS
GetContentModeration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContentModeration] -> ShowS
$cshowList :: [GetContentModeration] -> ShowS
show :: GetContentModeration -> String
$cshow :: GetContentModeration -> String
showsPrec :: Int -> GetContentModeration -> ShowS
$cshowsPrec :: Int -> GetContentModeration -> ShowS
Prelude.Show, forall x. Rep GetContentModeration x -> GetContentModeration
forall x. GetContentModeration -> Rep GetContentModeration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetContentModeration x -> GetContentModeration
$cfrom :: forall x. GetContentModeration -> Rep GetContentModeration x
Prelude.Generic)

-- |
-- Create a value of 'GetContentModeration' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'maxResults', 'getContentModeration_maxResults' - Maximum number of results to return per paginated call. The largest
-- value you can specify is 1000. If you specify a value greater than 1000,
-- a maximum of 1000 results is returned. The default value is 1000.
--
-- 'nextToken', 'getContentModeration_nextToken' - If the previous response was incomplete (because there is more data to
-- retrieve), Amazon Rekognition returns a pagination token in the
-- response. You can use this pagination token to retrieve the next set of
-- content moderation labels.
--
-- 'sortBy', 'getContentModeration_sortBy' - Sort to use for elements in the @ModerationLabelDetections@ array. Use
-- @TIMESTAMP@ to sort array elements by the time labels are detected. Use
-- @NAME@ to alphabetically group elements for a label together. Within
-- each label group, the array element are sorted by detection confidence.
-- The default sort is by @TIMESTAMP@.
--
-- 'jobId', 'getContentModeration_jobId' - The identifier for the inappropriate, unwanted, or offensive content
-- moderation job. Use @JobId@ to identify the job in a subsequent call to
-- @GetContentModeration@.
newGetContentModeration ::
  -- | 'jobId'
  Prelude.Text ->
  GetContentModeration
newGetContentModeration :: Text -> GetContentModeration
newGetContentModeration Text
pJobId_ =
  GetContentModeration'
    { $sel:maxResults:GetContentModeration' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetContentModeration' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:GetContentModeration' :: Maybe ContentModerationSortBy
sortBy = forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:GetContentModeration' :: Text
jobId = Text
pJobId_
    }

-- | Maximum number of results to return per paginated call. The largest
-- value you can specify is 1000. If you specify a value greater than 1000,
-- a maximum of 1000 results is returned. The default value is 1000.
getContentModeration_maxResults :: Lens.Lens' GetContentModeration (Prelude.Maybe Prelude.Natural)
getContentModeration_maxResults :: Lens' GetContentModeration (Maybe Natural)
getContentModeration_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContentModeration' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetContentModeration' :: GetContentModeration -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetContentModeration
s@GetContentModeration' {} Maybe Natural
a -> GetContentModeration
s {$sel:maxResults:GetContentModeration' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetContentModeration)

-- | If the previous response was incomplete (because there is more data to
-- retrieve), Amazon Rekognition returns a pagination token in the
-- response. You can use this pagination token to retrieve the next set of
-- content moderation labels.
getContentModeration_nextToken :: Lens.Lens' GetContentModeration (Prelude.Maybe Prelude.Text)
getContentModeration_nextToken :: Lens' GetContentModeration (Maybe Text)
getContentModeration_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContentModeration' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetContentModeration' :: GetContentModeration -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetContentModeration
s@GetContentModeration' {} Maybe Text
a -> GetContentModeration
s {$sel:nextToken:GetContentModeration' :: Maybe Text
nextToken = Maybe Text
a} :: GetContentModeration)

-- | Sort to use for elements in the @ModerationLabelDetections@ array. Use
-- @TIMESTAMP@ to sort array elements by the time labels are detected. Use
-- @NAME@ to alphabetically group elements for a label together. Within
-- each label group, the array element are sorted by detection confidence.
-- The default sort is by @TIMESTAMP@.
getContentModeration_sortBy :: Lens.Lens' GetContentModeration (Prelude.Maybe ContentModerationSortBy)
getContentModeration_sortBy :: Lens' GetContentModeration (Maybe ContentModerationSortBy)
getContentModeration_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContentModeration' {Maybe ContentModerationSortBy
sortBy :: Maybe ContentModerationSortBy
$sel:sortBy:GetContentModeration' :: GetContentModeration -> Maybe ContentModerationSortBy
sortBy} -> Maybe ContentModerationSortBy
sortBy) (\s :: GetContentModeration
s@GetContentModeration' {} Maybe ContentModerationSortBy
a -> GetContentModeration
s {$sel:sortBy:GetContentModeration' :: Maybe ContentModerationSortBy
sortBy = Maybe ContentModerationSortBy
a} :: GetContentModeration)

-- | The identifier for the inappropriate, unwanted, or offensive content
-- moderation job. Use @JobId@ to identify the job in a subsequent call to
-- @GetContentModeration@.
getContentModeration_jobId :: Lens.Lens' GetContentModeration Prelude.Text
getContentModeration_jobId :: Lens' GetContentModeration Text
getContentModeration_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContentModeration' {Text
jobId :: Text
$sel:jobId:GetContentModeration' :: GetContentModeration -> Text
jobId} -> Text
jobId) (\s :: GetContentModeration
s@GetContentModeration' {} Text
a -> GetContentModeration
s {$sel:jobId:GetContentModeration' :: Text
jobId = Text
a} :: GetContentModeration)

instance Core.AWSRequest GetContentModeration where
  type
    AWSResponse GetContentModeration =
      GetContentModerationResponse
  request :: (Service -> Service)
-> GetContentModeration -> Request GetContentModeration
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 GetContentModeration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetContentModeration)))
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 VideoJobStatus
-> Maybe [ContentModerationDetection]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VideoMetadata
-> Int
-> GetContentModerationResponse
GetContentModerationResponse'
            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
"JobStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ModerationLabels"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ModerationModelVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"StatusMessage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"VideoMetadata")
            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 GetContentModeration where
  hashWithSalt :: Int -> GetContentModeration -> Int
hashWithSalt Int
_salt GetContentModeration' {Maybe Natural
Maybe Text
Maybe ContentModerationSortBy
Text
jobId :: Text
sortBy :: Maybe ContentModerationSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:GetContentModeration' :: GetContentModeration -> Text
$sel:sortBy:GetContentModeration' :: GetContentModeration -> Maybe ContentModerationSortBy
$sel:nextToken:GetContentModeration' :: GetContentModeration -> Maybe Text
$sel:maxResults:GetContentModeration' :: GetContentModeration -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContentModerationSortBy
sortBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId

instance Prelude.NFData GetContentModeration where
  rnf :: GetContentModeration -> ()
rnf GetContentModeration' {Maybe Natural
Maybe Text
Maybe ContentModerationSortBy
Text
jobId :: Text
sortBy :: Maybe ContentModerationSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:GetContentModeration' :: GetContentModeration -> Text
$sel:sortBy:GetContentModeration' :: GetContentModeration -> Maybe ContentModerationSortBy
$sel:nextToken:GetContentModeration' :: GetContentModeration -> Maybe Text
$sel:maxResults:GetContentModeration' :: GetContentModeration -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContentModerationSortBy
sortBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobId

instance Data.ToHeaders GetContentModeration where
  toHeaders :: GetContentModeration -> 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.GetContentModeration" ::
                          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 GetContentModeration where
  toJSON :: GetContentModeration -> Value
toJSON GetContentModeration' {Maybe Natural
Maybe Text
Maybe ContentModerationSortBy
Text
jobId :: Text
sortBy :: Maybe ContentModerationSortBy
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:GetContentModeration' :: GetContentModeration -> Text
$sel:sortBy:GetContentModeration' :: GetContentModeration -> Maybe ContentModerationSortBy
$sel:nextToken:GetContentModeration' :: GetContentModeration -> Maybe Text
$sel:maxResults:GetContentModeration' :: GetContentModeration -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxResults" 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 Natural
maxResults,
            (Key
"NextToken" 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
nextToken,
            (Key
"SortBy" 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 ContentModerationSortBy
sortBy,
            forall a. a -> Maybe a
Prelude.Just (Key
"JobId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobId)
          ]
      )

instance Data.ToPath GetContentModeration where
  toPath :: GetContentModeration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery GetContentModeration where
  toQuery :: GetContentModeration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetContentModerationResponse' smart constructor.
data GetContentModerationResponse = GetContentModerationResponse'
  { -- | The current status of the content moderation analysis job.
    GetContentModerationResponse -> Maybe VideoJobStatus
jobStatus :: Prelude.Maybe VideoJobStatus,
    -- | The detected inappropriate, unwanted, or offensive content moderation
    -- labels and the time(s) they were detected.
    GetContentModerationResponse -> Maybe [ContentModerationDetection]
moderationLabels :: Prelude.Maybe [ContentModerationDetection],
    -- | Version number of the moderation detection model that was used to detect
    -- inappropriate, unwanted, or offensive content.
    GetContentModerationResponse -> Maybe Text
moderationModelVersion :: Prelude.Maybe Prelude.Text,
    -- | If the response is truncated, Amazon Rekognition Video returns this
    -- token that you can use in the subsequent request to retrieve the next
    -- set of content moderation labels.
    GetContentModerationResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | If the job fails, @StatusMessage@ provides a descriptive error message.
    GetContentModerationResponse -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | Information about a video that Amazon Rekognition analyzed.
    -- @Videometadata@ is returned in every page of paginated responses from
    -- @GetContentModeration@.
    GetContentModerationResponse -> Maybe VideoMetadata
videoMetadata :: Prelude.Maybe VideoMetadata,
    -- | The response's http status code.
    GetContentModerationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetContentModerationResponse
-> GetContentModerationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContentModerationResponse
-> GetContentModerationResponse -> Bool
$c/= :: GetContentModerationResponse
-> GetContentModerationResponse -> Bool
== :: GetContentModerationResponse
-> GetContentModerationResponse -> Bool
$c== :: GetContentModerationResponse
-> GetContentModerationResponse -> Bool
Prelude.Eq, ReadPrec [GetContentModerationResponse]
ReadPrec GetContentModerationResponse
Int -> ReadS GetContentModerationResponse
ReadS [GetContentModerationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContentModerationResponse]
$creadListPrec :: ReadPrec [GetContentModerationResponse]
readPrec :: ReadPrec GetContentModerationResponse
$creadPrec :: ReadPrec GetContentModerationResponse
readList :: ReadS [GetContentModerationResponse]
$creadList :: ReadS [GetContentModerationResponse]
readsPrec :: Int -> ReadS GetContentModerationResponse
$creadsPrec :: Int -> ReadS GetContentModerationResponse
Prelude.Read, Int -> GetContentModerationResponse -> ShowS
[GetContentModerationResponse] -> ShowS
GetContentModerationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContentModerationResponse] -> ShowS
$cshowList :: [GetContentModerationResponse] -> ShowS
show :: GetContentModerationResponse -> String
$cshow :: GetContentModerationResponse -> String
showsPrec :: Int -> GetContentModerationResponse -> ShowS
$cshowsPrec :: Int -> GetContentModerationResponse -> ShowS
Prelude.Show, forall x.
Rep GetContentModerationResponse x -> GetContentModerationResponse
forall x.
GetContentModerationResponse -> Rep GetContentModerationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetContentModerationResponse x -> GetContentModerationResponse
$cfrom :: forall x.
GetContentModerationResponse -> Rep GetContentModerationResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetContentModerationResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'jobStatus', 'getContentModerationResponse_jobStatus' - The current status of the content moderation analysis job.
--
-- 'moderationLabels', 'getContentModerationResponse_moderationLabels' - The detected inappropriate, unwanted, or offensive content moderation
-- labels and the time(s) they were detected.
--
-- 'moderationModelVersion', 'getContentModerationResponse_moderationModelVersion' - Version number of the moderation detection model that was used to detect
-- inappropriate, unwanted, or offensive content.
--
-- 'nextToken', 'getContentModerationResponse_nextToken' - If the response is truncated, Amazon Rekognition Video returns this
-- token that you can use in the subsequent request to retrieve the next
-- set of content moderation labels.
--
-- 'statusMessage', 'getContentModerationResponse_statusMessage' - If the job fails, @StatusMessage@ provides a descriptive error message.
--
-- 'videoMetadata', 'getContentModerationResponse_videoMetadata' - Information about a video that Amazon Rekognition analyzed.
-- @Videometadata@ is returned in every page of paginated responses from
-- @GetContentModeration@.
--
-- 'httpStatus', 'getContentModerationResponse_httpStatus' - The response's http status code.
newGetContentModerationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetContentModerationResponse
newGetContentModerationResponse :: Int -> GetContentModerationResponse
newGetContentModerationResponse Int
pHttpStatus_ =
  GetContentModerationResponse'
    { $sel:jobStatus:GetContentModerationResponse' :: Maybe VideoJobStatus
jobStatus =
        forall a. Maybe a
Prelude.Nothing,
      $sel:moderationLabels:GetContentModerationResponse' :: Maybe [ContentModerationDetection]
moderationLabels = forall a. Maybe a
Prelude.Nothing,
      $sel:moderationModelVersion:GetContentModerationResponse' :: Maybe Text
moderationModelVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetContentModerationResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:GetContentModerationResponse' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:videoMetadata:GetContentModerationResponse' :: Maybe VideoMetadata
videoMetadata = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetContentModerationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current status of the content moderation analysis job.
getContentModerationResponse_jobStatus :: Lens.Lens' GetContentModerationResponse (Prelude.Maybe VideoJobStatus)
getContentModerationResponse_jobStatus :: Lens' GetContentModerationResponse (Maybe VideoJobStatus)
getContentModerationResponse_jobStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContentModerationResponse' {Maybe VideoJobStatus
jobStatus :: Maybe VideoJobStatus
$sel:jobStatus:GetContentModerationResponse' :: GetContentModerationResponse -> Maybe VideoJobStatus
jobStatus} -> Maybe VideoJobStatus
jobStatus) (\s :: GetContentModerationResponse
s@GetContentModerationResponse' {} Maybe VideoJobStatus
a -> GetContentModerationResponse
s {$sel:jobStatus:GetContentModerationResponse' :: Maybe VideoJobStatus
jobStatus = Maybe VideoJobStatus
a} :: GetContentModerationResponse)

-- | The detected inappropriate, unwanted, or offensive content moderation
-- labels and the time(s) they were detected.
getContentModerationResponse_moderationLabels :: Lens.Lens' GetContentModerationResponse (Prelude.Maybe [ContentModerationDetection])
getContentModerationResponse_moderationLabels :: Lens'
  GetContentModerationResponse (Maybe [ContentModerationDetection])
getContentModerationResponse_moderationLabels = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContentModerationResponse' {Maybe [ContentModerationDetection]
moderationLabels :: Maybe [ContentModerationDetection]
$sel:moderationLabels:GetContentModerationResponse' :: GetContentModerationResponse -> Maybe [ContentModerationDetection]
moderationLabels} -> Maybe [ContentModerationDetection]
moderationLabels) (\s :: GetContentModerationResponse
s@GetContentModerationResponse' {} Maybe [ContentModerationDetection]
a -> GetContentModerationResponse
s {$sel:moderationLabels:GetContentModerationResponse' :: Maybe [ContentModerationDetection]
moderationLabels = Maybe [ContentModerationDetection]
a} :: GetContentModerationResponse) 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

-- | Version number of the moderation detection model that was used to detect
-- inappropriate, unwanted, or offensive content.
getContentModerationResponse_moderationModelVersion :: Lens.Lens' GetContentModerationResponse (Prelude.Maybe Prelude.Text)
getContentModerationResponse_moderationModelVersion :: Lens' GetContentModerationResponse (Maybe Text)
getContentModerationResponse_moderationModelVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContentModerationResponse' {Maybe Text
moderationModelVersion :: Maybe Text
$sel:moderationModelVersion:GetContentModerationResponse' :: GetContentModerationResponse -> Maybe Text
moderationModelVersion} -> Maybe Text
moderationModelVersion) (\s :: GetContentModerationResponse
s@GetContentModerationResponse' {} Maybe Text
a -> GetContentModerationResponse
s {$sel:moderationModelVersion:GetContentModerationResponse' :: Maybe Text
moderationModelVersion = Maybe Text
a} :: GetContentModerationResponse)

-- | If the response is truncated, Amazon Rekognition Video returns this
-- token that you can use in the subsequent request to retrieve the next
-- set of content moderation labels.
getContentModerationResponse_nextToken :: Lens.Lens' GetContentModerationResponse (Prelude.Maybe Prelude.Text)
getContentModerationResponse_nextToken :: Lens' GetContentModerationResponse (Maybe Text)
getContentModerationResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContentModerationResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetContentModerationResponse' :: GetContentModerationResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetContentModerationResponse
s@GetContentModerationResponse' {} Maybe Text
a -> GetContentModerationResponse
s {$sel:nextToken:GetContentModerationResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetContentModerationResponse)

-- | If the job fails, @StatusMessage@ provides a descriptive error message.
getContentModerationResponse_statusMessage :: Lens.Lens' GetContentModerationResponse (Prelude.Maybe Prelude.Text)
getContentModerationResponse_statusMessage :: Lens' GetContentModerationResponse (Maybe Text)
getContentModerationResponse_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContentModerationResponse' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:GetContentModerationResponse' :: GetContentModerationResponse -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: GetContentModerationResponse
s@GetContentModerationResponse' {} Maybe Text
a -> GetContentModerationResponse
s {$sel:statusMessage:GetContentModerationResponse' :: Maybe Text
statusMessage = Maybe Text
a} :: GetContentModerationResponse)

-- | Information about a video that Amazon Rekognition analyzed.
-- @Videometadata@ is returned in every page of paginated responses from
-- @GetContentModeration@.
getContentModerationResponse_videoMetadata :: Lens.Lens' GetContentModerationResponse (Prelude.Maybe VideoMetadata)
getContentModerationResponse_videoMetadata :: Lens' GetContentModerationResponse (Maybe VideoMetadata)
getContentModerationResponse_videoMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContentModerationResponse' {Maybe VideoMetadata
videoMetadata :: Maybe VideoMetadata
$sel:videoMetadata:GetContentModerationResponse' :: GetContentModerationResponse -> Maybe VideoMetadata
videoMetadata} -> Maybe VideoMetadata
videoMetadata) (\s :: GetContentModerationResponse
s@GetContentModerationResponse' {} Maybe VideoMetadata
a -> GetContentModerationResponse
s {$sel:videoMetadata:GetContentModerationResponse' :: Maybe VideoMetadata
videoMetadata = Maybe VideoMetadata
a} :: GetContentModerationResponse)

-- | The response's http status code.
getContentModerationResponse_httpStatus :: Lens.Lens' GetContentModerationResponse Prelude.Int
getContentModerationResponse_httpStatus :: Lens' GetContentModerationResponse Int
getContentModerationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContentModerationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetContentModerationResponse' :: GetContentModerationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetContentModerationResponse
s@GetContentModerationResponse' {} Int
a -> GetContentModerationResponse
s {$sel:httpStatus:GetContentModerationResponse' :: Int
httpStatus = Int
a} :: GetContentModerationResponse)

instance Prelude.NFData GetContentModerationResponse where
  rnf :: GetContentModerationResponse -> ()
rnf GetContentModerationResponse' {Int
Maybe [ContentModerationDetection]
Maybe Text
Maybe VideoJobStatus
Maybe VideoMetadata
httpStatus :: Int
videoMetadata :: Maybe VideoMetadata
statusMessage :: Maybe Text
nextToken :: Maybe Text
moderationModelVersion :: Maybe Text
moderationLabels :: Maybe [ContentModerationDetection]
jobStatus :: Maybe VideoJobStatus
$sel:httpStatus:GetContentModerationResponse' :: GetContentModerationResponse -> Int
$sel:videoMetadata:GetContentModerationResponse' :: GetContentModerationResponse -> Maybe VideoMetadata
$sel:statusMessage:GetContentModerationResponse' :: GetContentModerationResponse -> Maybe Text
$sel:nextToken:GetContentModerationResponse' :: GetContentModerationResponse -> Maybe Text
$sel:moderationModelVersion:GetContentModerationResponse' :: GetContentModerationResponse -> Maybe Text
$sel:moderationLabels:GetContentModerationResponse' :: GetContentModerationResponse -> Maybe [ContentModerationDetection]
$sel:jobStatus:GetContentModerationResponse' :: GetContentModerationResponse -> Maybe VideoJobStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe VideoJobStatus
jobStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ContentModerationDetection]
moderationLabels
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
moderationModelVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VideoMetadata
videoMetadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus