{-# 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.DetectModerationLabels
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Detects unsafe content in a specified JPEG or PNG format image. Use
-- @DetectModerationLabels@ to moderate images depending on your
-- requirements. For example, you might want to filter images that contain
-- nudity, but not images containing suggestive content.
--
-- To filter images, use the labels returned by @DetectModerationLabels@ to
-- determine which types of content are appropriate.
--
-- For information about moderation labels, see Detecting Unsafe Content in
-- the Amazon Rekognition Developer Guide.
--
-- You pass the input image either as base64-encoded image bytes or as a
-- reference to an image in an Amazon S3 bucket. If you use the AWS CLI to
-- call Amazon Rekognition operations, passing image bytes is not
-- supported. The image must be either a PNG or JPEG formatted file.
module Amazonka.Rekognition.DetectModerationLabels
  ( -- * Creating a Request
    DetectModerationLabels (..),
    newDetectModerationLabels,

    -- * Request Lenses
    detectModerationLabels_humanLoopConfig,
    detectModerationLabels_minConfidence,
    detectModerationLabels_image,

    -- * Destructuring the Response
    DetectModerationLabelsResponse (..),
    newDetectModerationLabelsResponse,

    -- * Response Lenses
    detectModerationLabelsResponse_humanLoopActivationOutput,
    detectModerationLabelsResponse_moderationModelVersion,
    detectModerationLabelsResponse_moderationLabels,
    detectModerationLabelsResponse_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

-- | /See:/ 'newDetectModerationLabels' smart constructor.
data DetectModerationLabels = DetectModerationLabels'
  { -- | Sets up the configuration for human evaluation, including the
    -- FlowDefinition the image will be sent to.
    DetectModerationLabels -> Maybe HumanLoopConfig
humanLoopConfig :: Prelude.Maybe HumanLoopConfig,
    -- | Specifies the minimum confidence level for the labels to return. Amazon
    -- Rekognition doesn\'t return any labels with a confidence level lower
    -- than this specified value.
    --
    -- If you don\'t specify @MinConfidence@, the operation returns labels with
    -- confidence values greater than or equal to 50 percent.
    DetectModerationLabels -> Maybe Double
minConfidence :: Prelude.Maybe Prelude.Double,
    -- | The input image as base64-encoded bytes or an S3 object. If you use the
    -- AWS CLI to call Amazon Rekognition operations, passing base64-encoded
    -- image bytes is not supported.
    --
    -- If you are using an AWS SDK to call Amazon Rekognition, you might not
    -- need to base64-encode image bytes passed using the @Bytes@ field. For
    -- more information, see Images in the Amazon Rekognition developer guide.
    DetectModerationLabels -> Image
image :: Image
  }
  deriving (DetectModerationLabels -> DetectModerationLabels -> Bool
(DetectModerationLabels -> DetectModerationLabels -> Bool)
-> (DetectModerationLabels -> DetectModerationLabels -> Bool)
-> Eq DetectModerationLabels
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectModerationLabels -> DetectModerationLabels -> Bool
$c/= :: DetectModerationLabels -> DetectModerationLabels -> Bool
== :: DetectModerationLabels -> DetectModerationLabels -> Bool
$c== :: DetectModerationLabels -> DetectModerationLabels -> Bool
Prelude.Eq, ReadPrec [DetectModerationLabels]
ReadPrec DetectModerationLabels
Int -> ReadS DetectModerationLabels
ReadS [DetectModerationLabels]
(Int -> ReadS DetectModerationLabels)
-> ReadS [DetectModerationLabels]
-> ReadPrec DetectModerationLabels
-> ReadPrec [DetectModerationLabels]
-> Read DetectModerationLabels
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectModerationLabels]
$creadListPrec :: ReadPrec [DetectModerationLabels]
readPrec :: ReadPrec DetectModerationLabels
$creadPrec :: ReadPrec DetectModerationLabels
readList :: ReadS [DetectModerationLabels]
$creadList :: ReadS [DetectModerationLabels]
readsPrec :: Int -> ReadS DetectModerationLabels
$creadsPrec :: Int -> ReadS DetectModerationLabels
Prelude.Read, Int -> DetectModerationLabels -> ShowS
[DetectModerationLabels] -> ShowS
DetectModerationLabels -> String
(Int -> DetectModerationLabels -> ShowS)
-> (DetectModerationLabels -> String)
-> ([DetectModerationLabels] -> ShowS)
-> Show DetectModerationLabels
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectModerationLabels] -> ShowS
$cshowList :: [DetectModerationLabels] -> ShowS
show :: DetectModerationLabels -> String
$cshow :: DetectModerationLabels -> String
showsPrec :: Int -> DetectModerationLabels -> ShowS
$cshowsPrec :: Int -> DetectModerationLabels -> ShowS
Prelude.Show, (forall x. DetectModerationLabels -> Rep DetectModerationLabels x)
-> (forall x.
    Rep DetectModerationLabels x -> DetectModerationLabels)
-> Generic DetectModerationLabels
forall x. Rep DetectModerationLabels x -> DetectModerationLabels
forall x. DetectModerationLabels -> Rep DetectModerationLabels x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetectModerationLabels x -> DetectModerationLabels
$cfrom :: forall x. DetectModerationLabels -> Rep DetectModerationLabels x
Prelude.Generic)

-- |
-- Create a value of 'DetectModerationLabels' 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:
--
-- 'humanLoopConfig', 'detectModerationLabels_humanLoopConfig' - Sets up the configuration for human evaluation, including the
-- FlowDefinition the image will be sent to.
--
-- 'minConfidence', 'detectModerationLabels_minConfidence' - Specifies the minimum confidence level for the labels to return. Amazon
-- Rekognition doesn\'t return any labels with a confidence level lower
-- than this specified value.
--
-- If you don\'t specify @MinConfidence@, the operation returns labels with
-- confidence values greater than or equal to 50 percent.
--
-- 'image', 'detectModerationLabels_image' - The input image as base64-encoded bytes or an S3 object. If you use the
-- AWS CLI to call Amazon Rekognition operations, passing base64-encoded
-- image bytes is not supported.
--
-- If you are using an AWS SDK to call Amazon Rekognition, you might not
-- need to base64-encode image bytes passed using the @Bytes@ field. For
-- more information, see Images in the Amazon Rekognition developer guide.
newDetectModerationLabels ::
  -- | 'image'
  Image ->
  DetectModerationLabels
newDetectModerationLabels :: Image -> DetectModerationLabels
newDetectModerationLabels Image
pImage_ =
  DetectModerationLabels' :: Maybe HumanLoopConfig
-> Maybe Double -> Image -> DetectModerationLabels
DetectModerationLabels'
    { $sel:humanLoopConfig:DetectModerationLabels' :: Maybe HumanLoopConfig
humanLoopConfig =
        Maybe HumanLoopConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:minConfidence:DetectModerationLabels' :: Maybe Double
minConfidence = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:image:DetectModerationLabels' :: Image
image = Image
pImage_
    }

-- | Sets up the configuration for human evaluation, including the
-- FlowDefinition the image will be sent to.
detectModerationLabels_humanLoopConfig :: Lens.Lens' DetectModerationLabels (Prelude.Maybe HumanLoopConfig)
detectModerationLabels_humanLoopConfig :: (Maybe HumanLoopConfig -> f (Maybe HumanLoopConfig))
-> DetectModerationLabels -> f DetectModerationLabels
detectModerationLabels_humanLoopConfig = (DetectModerationLabels -> Maybe HumanLoopConfig)
-> (DetectModerationLabels
    -> Maybe HumanLoopConfig -> DetectModerationLabels)
-> Lens
     DetectModerationLabels
     DetectModerationLabels
     (Maybe HumanLoopConfig)
     (Maybe HumanLoopConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectModerationLabels' {Maybe HumanLoopConfig
humanLoopConfig :: Maybe HumanLoopConfig
$sel:humanLoopConfig:DetectModerationLabels' :: DetectModerationLabels -> Maybe HumanLoopConfig
humanLoopConfig} -> Maybe HumanLoopConfig
humanLoopConfig) (\s :: DetectModerationLabels
s@DetectModerationLabels' {} Maybe HumanLoopConfig
a -> DetectModerationLabels
s {$sel:humanLoopConfig:DetectModerationLabels' :: Maybe HumanLoopConfig
humanLoopConfig = Maybe HumanLoopConfig
a} :: DetectModerationLabels)

-- | Specifies the minimum confidence level for the labels to return. Amazon
-- Rekognition doesn\'t return any labels with a confidence level lower
-- than this specified value.
--
-- If you don\'t specify @MinConfidence@, the operation returns labels with
-- confidence values greater than or equal to 50 percent.
detectModerationLabels_minConfidence :: Lens.Lens' DetectModerationLabels (Prelude.Maybe Prelude.Double)
detectModerationLabels_minConfidence :: (Maybe Double -> f (Maybe Double))
-> DetectModerationLabels -> f DetectModerationLabels
detectModerationLabels_minConfidence = (DetectModerationLabels -> Maybe Double)
-> (DetectModerationLabels
    -> Maybe Double -> DetectModerationLabels)
-> Lens
     DetectModerationLabels
     DetectModerationLabels
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectModerationLabels' {Maybe Double
minConfidence :: Maybe Double
$sel:minConfidence:DetectModerationLabels' :: DetectModerationLabels -> Maybe Double
minConfidence} -> Maybe Double
minConfidence) (\s :: DetectModerationLabels
s@DetectModerationLabels' {} Maybe Double
a -> DetectModerationLabels
s {$sel:minConfidence:DetectModerationLabels' :: Maybe Double
minConfidence = Maybe Double
a} :: DetectModerationLabels)

-- | The input image as base64-encoded bytes or an S3 object. If you use the
-- AWS CLI to call Amazon Rekognition operations, passing base64-encoded
-- image bytes is not supported.
--
-- If you are using an AWS SDK to call Amazon Rekognition, you might not
-- need to base64-encode image bytes passed using the @Bytes@ field. For
-- more information, see Images in the Amazon Rekognition developer guide.
detectModerationLabels_image :: Lens.Lens' DetectModerationLabels Image
detectModerationLabels_image :: (Image -> f Image)
-> DetectModerationLabels -> f DetectModerationLabels
detectModerationLabels_image = (DetectModerationLabels -> Image)
-> (DetectModerationLabels -> Image -> DetectModerationLabels)
-> Lens DetectModerationLabels DetectModerationLabels Image Image
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectModerationLabels' {Image
image :: Image
$sel:image:DetectModerationLabels' :: DetectModerationLabels -> Image
image} -> Image
image) (\s :: DetectModerationLabels
s@DetectModerationLabels' {} Image
a -> DetectModerationLabels
s {$sel:image:DetectModerationLabels' :: Image
image = Image
a} :: DetectModerationLabels)

instance Core.AWSRequest DetectModerationLabels where
  type
    AWSResponse DetectModerationLabels =
      DetectModerationLabelsResponse
  request :: DetectModerationLabels -> Request DetectModerationLabels
request = Service -> DetectModerationLabels -> Request DetectModerationLabels
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DetectModerationLabels
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DetectModerationLabels)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DetectModerationLabels))
-> Logger
-> Service
-> Proxy DetectModerationLabels
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DetectModerationLabels)))
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 HumanLoopActivationOutput
-> Maybe Text
-> Maybe [ModerationLabel]
-> Int
-> DetectModerationLabelsResponse
DetectModerationLabelsResponse'
            (Maybe HumanLoopActivationOutput
 -> Maybe Text
 -> Maybe [ModerationLabel]
 -> Int
 -> DetectModerationLabelsResponse)
-> Either String (Maybe HumanLoopActivationOutput)
-> Either
     String
     (Maybe Text
      -> Maybe [ModerationLabel]
      -> Int
      -> DetectModerationLabelsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe HumanLoopActivationOutput)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HumanLoopActivationOutput")
            Either
  String
  (Maybe Text
   -> Maybe [ModerationLabel]
   -> Int
   -> DetectModerationLabelsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ModerationLabel] -> Int -> DetectModerationLabelsResponse)
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
"ModerationModelVersion")
            Either
  String
  (Maybe [ModerationLabel] -> Int -> DetectModerationLabelsResponse)
-> Either String (Maybe [ModerationLabel])
-> Either String (Int -> DetectModerationLabelsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ModerationLabel]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ModerationLabels"
                            Either String (Maybe (Maybe [ModerationLabel]))
-> Maybe [ModerationLabel]
-> Either String (Maybe [ModerationLabel])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ModerationLabel]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> DetectModerationLabelsResponse)
-> Either String Int
-> Either String DetectModerationLabelsResponse
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 DetectModerationLabels

instance Prelude.NFData DetectModerationLabels

instance Core.ToHeaders DetectModerationLabels where
  toHeaders :: DetectModerationLabels -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DetectModerationLabels -> 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.DetectModerationLabels" ::
                          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 DetectModerationLabels where
  toJSON :: DetectModerationLabels -> Value
toJSON DetectModerationLabels' {Maybe Double
Maybe HumanLoopConfig
Image
image :: Image
minConfidence :: Maybe Double
humanLoopConfig :: Maybe HumanLoopConfig
$sel:image:DetectModerationLabels' :: DetectModerationLabels -> Image
$sel:minConfidence:DetectModerationLabels' :: DetectModerationLabels -> Maybe Double
$sel:humanLoopConfig:DetectModerationLabels' :: DetectModerationLabels -> Maybe HumanLoopConfig
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"HumanLoopConfig" Text -> HumanLoopConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HumanLoopConfig -> Pair) -> Maybe HumanLoopConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HumanLoopConfig
humanLoopConfig,
            (Text
"MinConfidence" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
minConfidence,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Image" Text -> Image -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Image
image)
          ]
      )

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

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

-- | /See:/ 'newDetectModerationLabelsResponse' smart constructor.
data DetectModerationLabelsResponse = DetectModerationLabelsResponse'
  { -- | Shows the results of the human in the loop evaluation.
    DetectModerationLabelsResponse -> Maybe HumanLoopActivationOutput
humanLoopActivationOutput :: Prelude.Maybe HumanLoopActivationOutput,
    -- | Version number of the moderation detection model that was used to detect
    -- unsafe content.
    DetectModerationLabelsResponse -> Maybe Text
moderationModelVersion :: Prelude.Maybe Prelude.Text,
    -- | Array of detected Moderation labels and the time, in milliseconds from
    -- the start of the video, they were detected.
    DetectModerationLabelsResponse -> Maybe [ModerationLabel]
moderationLabels :: Prelude.Maybe [ModerationLabel],
    -- | The response's http status code.
    DetectModerationLabelsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DetectModerationLabelsResponse
-> DetectModerationLabelsResponse -> Bool
(DetectModerationLabelsResponse
 -> DetectModerationLabelsResponse -> Bool)
-> (DetectModerationLabelsResponse
    -> DetectModerationLabelsResponse -> Bool)
-> Eq DetectModerationLabelsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectModerationLabelsResponse
-> DetectModerationLabelsResponse -> Bool
$c/= :: DetectModerationLabelsResponse
-> DetectModerationLabelsResponse -> Bool
== :: DetectModerationLabelsResponse
-> DetectModerationLabelsResponse -> Bool
$c== :: DetectModerationLabelsResponse
-> DetectModerationLabelsResponse -> Bool
Prelude.Eq, ReadPrec [DetectModerationLabelsResponse]
ReadPrec DetectModerationLabelsResponse
Int -> ReadS DetectModerationLabelsResponse
ReadS [DetectModerationLabelsResponse]
(Int -> ReadS DetectModerationLabelsResponse)
-> ReadS [DetectModerationLabelsResponse]
-> ReadPrec DetectModerationLabelsResponse
-> ReadPrec [DetectModerationLabelsResponse]
-> Read DetectModerationLabelsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectModerationLabelsResponse]
$creadListPrec :: ReadPrec [DetectModerationLabelsResponse]
readPrec :: ReadPrec DetectModerationLabelsResponse
$creadPrec :: ReadPrec DetectModerationLabelsResponse
readList :: ReadS [DetectModerationLabelsResponse]
$creadList :: ReadS [DetectModerationLabelsResponse]
readsPrec :: Int -> ReadS DetectModerationLabelsResponse
$creadsPrec :: Int -> ReadS DetectModerationLabelsResponse
Prelude.Read, Int -> DetectModerationLabelsResponse -> ShowS
[DetectModerationLabelsResponse] -> ShowS
DetectModerationLabelsResponse -> String
(Int -> DetectModerationLabelsResponse -> ShowS)
-> (DetectModerationLabelsResponse -> String)
-> ([DetectModerationLabelsResponse] -> ShowS)
-> Show DetectModerationLabelsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectModerationLabelsResponse] -> ShowS
$cshowList :: [DetectModerationLabelsResponse] -> ShowS
show :: DetectModerationLabelsResponse -> String
$cshow :: DetectModerationLabelsResponse -> String
showsPrec :: Int -> DetectModerationLabelsResponse -> ShowS
$cshowsPrec :: Int -> DetectModerationLabelsResponse -> ShowS
Prelude.Show, (forall x.
 DetectModerationLabelsResponse
 -> Rep DetectModerationLabelsResponse x)
-> (forall x.
    Rep DetectModerationLabelsResponse x
    -> DetectModerationLabelsResponse)
-> Generic DetectModerationLabelsResponse
forall x.
Rep DetectModerationLabelsResponse x
-> DetectModerationLabelsResponse
forall x.
DetectModerationLabelsResponse
-> Rep DetectModerationLabelsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetectModerationLabelsResponse x
-> DetectModerationLabelsResponse
$cfrom :: forall x.
DetectModerationLabelsResponse
-> Rep DetectModerationLabelsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DetectModerationLabelsResponse' 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:
--
-- 'humanLoopActivationOutput', 'detectModerationLabelsResponse_humanLoopActivationOutput' - Shows the results of the human in the loop evaluation.
--
-- 'moderationModelVersion', 'detectModerationLabelsResponse_moderationModelVersion' - Version number of the moderation detection model that was used to detect
-- unsafe content.
--
-- 'moderationLabels', 'detectModerationLabelsResponse_moderationLabels' - Array of detected Moderation labels and the time, in milliseconds from
-- the start of the video, they were detected.
--
-- 'httpStatus', 'detectModerationLabelsResponse_httpStatus' - The response's http status code.
newDetectModerationLabelsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DetectModerationLabelsResponse
newDetectModerationLabelsResponse :: Int -> DetectModerationLabelsResponse
newDetectModerationLabelsResponse Int
pHttpStatus_ =
  DetectModerationLabelsResponse' :: Maybe HumanLoopActivationOutput
-> Maybe Text
-> Maybe [ModerationLabel]
-> Int
-> DetectModerationLabelsResponse
DetectModerationLabelsResponse'
    { $sel:humanLoopActivationOutput:DetectModerationLabelsResponse' :: Maybe HumanLoopActivationOutput
humanLoopActivationOutput =
        Maybe HumanLoopActivationOutput
forall a. Maybe a
Prelude.Nothing,
      $sel:moderationModelVersion:DetectModerationLabelsResponse' :: Maybe Text
moderationModelVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:moderationLabels:DetectModerationLabelsResponse' :: Maybe [ModerationLabel]
moderationLabels = Maybe [ModerationLabel]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DetectModerationLabelsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Shows the results of the human in the loop evaluation.
detectModerationLabelsResponse_humanLoopActivationOutput :: Lens.Lens' DetectModerationLabelsResponse (Prelude.Maybe HumanLoopActivationOutput)
detectModerationLabelsResponse_humanLoopActivationOutput :: (Maybe HumanLoopActivationOutput
 -> f (Maybe HumanLoopActivationOutput))
-> DetectModerationLabelsResponse
-> f DetectModerationLabelsResponse
detectModerationLabelsResponse_humanLoopActivationOutput = (DetectModerationLabelsResponse -> Maybe HumanLoopActivationOutput)
-> (DetectModerationLabelsResponse
    -> Maybe HumanLoopActivationOutput
    -> DetectModerationLabelsResponse)
-> Lens
     DetectModerationLabelsResponse
     DetectModerationLabelsResponse
     (Maybe HumanLoopActivationOutput)
     (Maybe HumanLoopActivationOutput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectModerationLabelsResponse' {Maybe HumanLoopActivationOutput
humanLoopActivationOutput :: Maybe HumanLoopActivationOutput
$sel:humanLoopActivationOutput:DetectModerationLabelsResponse' :: DetectModerationLabelsResponse -> Maybe HumanLoopActivationOutput
humanLoopActivationOutput} -> Maybe HumanLoopActivationOutput
humanLoopActivationOutput) (\s :: DetectModerationLabelsResponse
s@DetectModerationLabelsResponse' {} Maybe HumanLoopActivationOutput
a -> DetectModerationLabelsResponse
s {$sel:humanLoopActivationOutput:DetectModerationLabelsResponse' :: Maybe HumanLoopActivationOutput
humanLoopActivationOutput = Maybe HumanLoopActivationOutput
a} :: DetectModerationLabelsResponse)

-- | Version number of the moderation detection model that was used to detect
-- unsafe content.
detectModerationLabelsResponse_moderationModelVersion :: Lens.Lens' DetectModerationLabelsResponse (Prelude.Maybe Prelude.Text)
detectModerationLabelsResponse_moderationModelVersion :: (Maybe Text -> f (Maybe Text))
-> DetectModerationLabelsResponse
-> f DetectModerationLabelsResponse
detectModerationLabelsResponse_moderationModelVersion = (DetectModerationLabelsResponse -> Maybe Text)
-> (DetectModerationLabelsResponse
    -> Maybe Text -> DetectModerationLabelsResponse)
-> Lens
     DetectModerationLabelsResponse
     DetectModerationLabelsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectModerationLabelsResponse' {Maybe Text
moderationModelVersion :: Maybe Text
$sel:moderationModelVersion:DetectModerationLabelsResponse' :: DetectModerationLabelsResponse -> Maybe Text
moderationModelVersion} -> Maybe Text
moderationModelVersion) (\s :: DetectModerationLabelsResponse
s@DetectModerationLabelsResponse' {} Maybe Text
a -> DetectModerationLabelsResponse
s {$sel:moderationModelVersion:DetectModerationLabelsResponse' :: Maybe Text
moderationModelVersion = Maybe Text
a} :: DetectModerationLabelsResponse)

-- | Array of detected Moderation labels and the time, in milliseconds from
-- the start of the video, they were detected.
detectModerationLabelsResponse_moderationLabels :: Lens.Lens' DetectModerationLabelsResponse (Prelude.Maybe [ModerationLabel])
detectModerationLabelsResponse_moderationLabels :: (Maybe [ModerationLabel] -> f (Maybe [ModerationLabel]))
-> DetectModerationLabelsResponse
-> f DetectModerationLabelsResponse
detectModerationLabelsResponse_moderationLabels = (DetectModerationLabelsResponse -> Maybe [ModerationLabel])
-> (DetectModerationLabelsResponse
    -> Maybe [ModerationLabel] -> DetectModerationLabelsResponse)
-> Lens
     DetectModerationLabelsResponse
     DetectModerationLabelsResponse
     (Maybe [ModerationLabel])
     (Maybe [ModerationLabel])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectModerationLabelsResponse' {Maybe [ModerationLabel]
moderationLabels :: Maybe [ModerationLabel]
$sel:moderationLabels:DetectModerationLabelsResponse' :: DetectModerationLabelsResponse -> Maybe [ModerationLabel]
moderationLabels} -> Maybe [ModerationLabel]
moderationLabels) (\s :: DetectModerationLabelsResponse
s@DetectModerationLabelsResponse' {} Maybe [ModerationLabel]
a -> DetectModerationLabelsResponse
s {$sel:moderationLabels:DetectModerationLabelsResponse' :: Maybe [ModerationLabel]
moderationLabels = Maybe [ModerationLabel]
a} :: DetectModerationLabelsResponse) ((Maybe [ModerationLabel] -> f (Maybe [ModerationLabel]))
 -> DetectModerationLabelsResponse
 -> f DetectModerationLabelsResponse)
-> ((Maybe [ModerationLabel] -> f (Maybe [ModerationLabel]))
    -> Maybe [ModerationLabel] -> f (Maybe [ModerationLabel]))
-> (Maybe [ModerationLabel] -> f (Maybe [ModerationLabel]))
-> DetectModerationLabelsResponse
-> f DetectModerationLabelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ModerationLabel]
  [ModerationLabel]
  [ModerationLabel]
  [ModerationLabel]
-> Iso
     (Maybe [ModerationLabel])
     (Maybe [ModerationLabel])
     (Maybe [ModerationLabel])
     (Maybe [ModerationLabel])
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
  [ModerationLabel]
  [ModerationLabel]
  [ModerationLabel]
  [ModerationLabel]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DetectModerationLabelsResponse