{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.DetectLabelsImagePropertiesSettings
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Rekognition.Types.DetectLabelsImagePropertiesSettings 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

-- | Settings for the IMAGE_PROPERTIES feature type.
--
-- /See:/ 'newDetectLabelsImagePropertiesSettings' smart constructor.
data DetectLabelsImagePropertiesSettings = DetectLabelsImagePropertiesSettings'
  { -- | The maximum number of dominant colors to return when detecting labels in
    -- an image. The default value is 10.
    DetectLabelsImagePropertiesSettings -> Maybe Natural
maxDominantColors :: Prelude.Maybe Prelude.Natural
  }
  deriving (DetectLabelsImagePropertiesSettings
-> DetectLabelsImagePropertiesSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetectLabelsImagePropertiesSettings
-> DetectLabelsImagePropertiesSettings -> Bool
$c/= :: DetectLabelsImagePropertiesSettings
-> DetectLabelsImagePropertiesSettings -> Bool
== :: DetectLabelsImagePropertiesSettings
-> DetectLabelsImagePropertiesSettings -> Bool
$c== :: DetectLabelsImagePropertiesSettings
-> DetectLabelsImagePropertiesSettings -> Bool
Prelude.Eq, ReadPrec [DetectLabelsImagePropertiesSettings]
ReadPrec DetectLabelsImagePropertiesSettings
Int -> ReadS DetectLabelsImagePropertiesSettings
ReadS [DetectLabelsImagePropertiesSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetectLabelsImagePropertiesSettings]
$creadListPrec :: ReadPrec [DetectLabelsImagePropertiesSettings]
readPrec :: ReadPrec DetectLabelsImagePropertiesSettings
$creadPrec :: ReadPrec DetectLabelsImagePropertiesSettings
readList :: ReadS [DetectLabelsImagePropertiesSettings]
$creadList :: ReadS [DetectLabelsImagePropertiesSettings]
readsPrec :: Int -> ReadS DetectLabelsImagePropertiesSettings
$creadsPrec :: Int -> ReadS DetectLabelsImagePropertiesSettings
Prelude.Read, Int -> DetectLabelsImagePropertiesSettings -> ShowS
[DetectLabelsImagePropertiesSettings] -> ShowS
DetectLabelsImagePropertiesSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetectLabelsImagePropertiesSettings] -> ShowS
$cshowList :: [DetectLabelsImagePropertiesSettings] -> ShowS
show :: DetectLabelsImagePropertiesSettings -> String
$cshow :: DetectLabelsImagePropertiesSettings -> String
showsPrec :: Int -> DetectLabelsImagePropertiesSettings -> ShowS
$cshowsPrec :: Int -> DetectLabelsImagePropertiesSettings -> ShowS
Prelude.Show, forall x.
Rep DetectLabelsImagePropertiesSettings x
-> DetectLabelsImagePropertiesSettings
forall x.
DetectLabelsImagePropertiesSettings
-> Rep DetectLabelsImagePropertiesSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetectLabelsImagePropertiesSettings x
-> DetectLabelsImagePropertiesSettings
$cfrom :: forall x.
DetectLabelsImagePropertiesSettings
-> Rep DetectLabelsImagePropertiesSettings x
Prelude.Generic)

-- |
-- Create a value of 'DetectLabelsImagePropertiesSettings' 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:
--
-- 'maxDominantColors', 'detectLabelsImagePropertiesSettings_maxDominantColors' - The maximum number of dominant colors to return when detecting labels in
-- an image. The default value is 10.
newDetectLabelsImagePropertiesSettings ::
  DetectLabelsImagePropertiesSettings
newDetectLabelsImagePropertiesSettings :: DetectLabelsImagePropertiesSettings
newDetectLabelsImagePropertiesSettings =
  DetectLabelsImagePropertiesSettings'
    { $sel:maxDominantColors:DetectLabelsImagePropertiesSettings' :: Maybe Natural
maxDominantColors =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The maximum number of dominant colors to return when detecting labels in
-- an image. The default value is 10.
detectLabelsImagePropertiesSettings_maxDominantColors :: Lens.Lens' DetectLabelsImagePropertiesSettings (Prelude.Maybe Prelude.Natural)
detectLabelsImagePropertiesSettings_maxDominantColors :: Lens' DetectLabelsImagePropertiesSettings (Maybe Natural)
detectLabelsImagePropertiesSettings_maxDominantColors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectLabelsImagePropertiesSettings' {Maybe Natural
maxDominantColors :: Maybe Natural
$sel:maxDominantColors:DetectLabelsImagePropertiesSettings' :: DetectLabelsImagePropertiesSettings -> Maybe Natural
maxDominantColors} -> Maybe Natural
maxDominantColors) (\s :: DetectLabelsImagePropertiesSettings
s@DetectLabelsImagePropertiesSettings' {} Maybe Natural
a -> DetectLabelsImagePropertiesSettings
s {$sel:maxDominantColors:DetectLabelsImagePropertiesSettings' :: Maybe Natural
maxDominantColors = Maybe Natural
a} :: DetectLabelsImagePropertiesSettings)

instance
  Prelude.Hashable
    DetectLabelsImagePropertiesSettings
  where
  hashWithSalt :: Int -> DetectLabelsImagePropertiesSettings -> Int
hashWithSalt
    Int
_salt
    DetectLabelsImagePropertiesSettings' {Maybe Natural
maxDominantColors :: Maybe Natural
$sel:maxDominantColors:DetectLabelsImagePropertiesSettings' :: DetectLabelsImagePropertiesSettings -> Maybe Natural
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxDominantColors

instance
  Prelude.NFData
    DetectLabelsImagePropertiesSettings
  where
  rnf :: DetectLabelsImagePropertiesSettings -> ()
rnf DetectLabelsImagePropertiesSettings' {Maybe Natural
maxDominantColors :: Maybe Natural
$sel:maxDominantColors:DetectLabelsImagePropertiesSettings' :: DetectLabelsImagePropertiesSettings -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxDominantColors

instance
  Data.ToJSON
    DetectLabelsImagePropertiesSettings
  where
  toJSON :: DetectLabelsImagePropertiesSettings -> Value
toJSON DetectLabelsImagePropertiesSettings' {Maybe Natural
maxDominantColors :: Maybe Natural
$sel:maxDominantColors:DetectLabelsImagePropertiesSettings' :: DetectLabelsImagePropertiesSettings -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxDominantColors" 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
maxDominantColors
          ]
      )