{-# 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.ConnectedHomeSettingsForUpdate
-- 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.ConnectedHomeSettingsForUpdate 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

-- | The label detection settings you want to use in your stream processor.
-- This includes the labels you want the stream processor to detect and the
-- minimum confidence level allowed to label objects.
--
-- /See:/ 'newConnectedHomeSettingsForUpdate' smart constructor.
data ConnectedHomeSettingsForUpdate = ConnectedHomeSettingsForUpdate'
  { -- | Specifies what you want to detect in the video, such as people,
    -- packages, or pets. The current valid labels you can include in this list
    -- are: \"PERSON\", \"PET\", \"PACKAGE\", and \"ALL\".
    ConnectedHomeSettingsForUpdate -> Maybe (NonEmpty Text)
labels :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The minimum confidence required to label an object in the video.
    ConnectedHomeSettingsForUpdate -> Maybe Double
minConfidence :: Prelude.Maybe Prelude.Double
  }
  deriving (ConnectedHomeSettingsForUpdate
-> ConnectedHomeSettingsForUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectedHomeSettingsForUpdate
-> ConnectedHomeSettingsForUpdate -> Bool
$c/= :: ConnectedHomeSettingsForUpdate
-> ConnectedHomeSettingsForUpdate -> Bool
== :: ConnectedHomeSettingsForUpdate
-> ConnectedHomeSettingsForUpdate -> Bool
$c== :: ConnectedHomeSettingsForUpdate
-> ConnectedHomeSettingsForUpdate -> Bool
Prelude.Eq, ReadPrec [ConnectedHomeSettingsForUpdate]
ReadPrec ConnectedHomeSettingsForUpdate
Int -> ReadS ConnectedHomeSettingsForUpdate
ReadS [ConnectedHomeSettingsForUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConnectedHomeSettingsForUpdate]
$creadListPrec :: ReadPrec [ConnectedHomeSettingsForUpdate]
readPrec :: ReadPrec ConnectedHomeSettingsForUpdate
$creadPrec :: ReadPrec ConnectedHomeSettingsForUpdate
readList :: ReadS [ConnectedHomeSettingsForUpdate]
$creadList :: ReadS [ConnectedHomeSettingsForUpdate]
readsPrec :: Int -> ReadS ConnectedHomeSettingsForUpdate
$creadsPrec :: Int -> ReadS ConnectedHomeSettingsForUpdate
Prelude.Read, Int -> ConnectedHomeSettingsForUpdate -> ShowS
[ConnectedHomeSettingsForUpdate] -> ShowS
ConnectedHomeSettingsForUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectedHomeSettingsForUpdate] -> ShowS
$cshowList :: [ConnectedHomeSettingsForUpdate] -> ShowS
show :: ConnectedHomeSettingsForUpdate -> String
$cshow :: ConnectedHomeSettingsForUpdate -> String
showsPrec :: Int -> ConnectedHomeSettingsForUpdate -> ShowS
$cshowsPrec :: Int -> ConnectedHomeSettingsForUpdate -> ShowS
Prelude.Show, forall x.
Rep ConnectedHomeSettingsForUpdate x
-> ConnectedHomeSettingsForUpdate
forall x.
ConnectedHomeSettingsForUpdate
-> Rep ConnectedHomeSettingsForUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ConnectedHomeSettingsForUpdate x
-> ConnectedHomeSettingsForUpdate
$cfrom :: forall x.
ConnectedHomeSettingsForUpdate
-> Rep ConnectedHomeSettingsForUpdate x
Prelude.Generic)

-- |
-- Create a value of 'ConnectedHomeSettingsForUpdate' 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:
--
-- 'labels', 'connectedHomeSettingsForUpdate_labels' - Specifies what you want to detect in the video, such as people,
-- packages, or pets. The current valid labels you can include in this list
-- are: \"PERSON\", \"PET\", \"PACKAGE\", and \"ALL\".
--
-- 'minConfidence', 'connectedHomeSettingsForUpdate_minConfidence' - The minimum confidence required to label an object in the video.
newConnectedHomeSettingsForUpdate ::
  ConnectedHomeSettingsForUpdate
newConnectedHomeSettingsForUpdate :: ConnectedHomeSettingsForUpdate
newConnectedHomeSettingsForUpdate =
  ConnectedHomeSettingsForUpdate'
    { $sel:labels:ConnectedHomeSettingsForUpdate' :: Maybe (NonEmpty Text)
labels =
        forall a. Maybe a
Prelude.Nothing,
      $sel:minConfidence:ConnectedHomeSettingsForUpdate' :: Maybe Double
minConfidence = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies what you want to detect in the video, such as people,
-- packages, or pets. The current valid labels you can include in this list
-- are: \"PERSON\", \"PET\", \"PACKAGE\", and \"ALL\".
connectedHomeSettingsForUpdate_labels :: Lens.Lens' ConnectedHomeSettingsForUpdate (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
connectedHomeSettingsForUpdate_labels :: Lens' ConnectedHomeSettingsForUpdate (Maybe (NonEmpty Text))
connectedHomeSettingsForUpdate_labels = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectedHomeSettingsForUpdate' {Maybe (NonEmpty Text)
labels :: Maybe (NonEmpty Text)
$sel:labels:ConnectedHomeSettingsForUpdate' :: ConnectedHomeSettingsForUpdate -> Maybe (NonEmpty Text)
labels} -> Maybe (NonEmpty Text)
labels) (\s :: ConnectedHomeSettingsForUpdate
s@ConnectedHomeSettingsForUpdate' {} Maybe (NonEmpty Text)
a -> ConnectedHomeSettingsForUpdate
s {$sel:labels:ConnectedHomeSettingsForUpdate' :: Maybe (NonEmpty Text)
labels = Maybe (NonEmpty Text)
a} :: ConnectedHomeSettingsForUpdate) 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

-- | The minimum confidence required to label an object in the video.
connectedHomeSettingsForUpdate_minConfidence :: Lens.Lens' ConnectedHomeSettingsForUpdate (Prelude.Maybe Prelude.Double)
connectedHomeSettingsForUpdate_minConfidence :: Lens' ConnectedHomeSettingsForUpdate (Maybe Double)
connectedHomeSettingsForUpdate_minConfidence = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectedHomeSettingsForUpdate' {Maybe Double
minConfidence :: Maybe Double
$sel:minConfidence:ConnectedHomeSettingsForUpdate' :: ConnectedHomeSettingsForUpdate -> Maybe Double
minConfidence} -> Maybe Double
minConfidence) (\s :: ConnectedHomeSettingsForUpdate
s@ConnectedHomeSettingsForUpdate' {} Maybe Double
a -> ConnectedHomeSettingsForUpdate
s {$sel:minConfidence:ConnectedHomeSettingsForUpdate' :: Maybe Double
minConfidence = Maybe Double
a} :: ConnectedHomeSettingsForUpdate)

instance
  Prelude.Hashable
    ConnectedHomeSettingsForUpdate
  where
  hashWithSalt :: Int -> ConnectedHomeSettingsForUpdate -> Int
hashWithSalt
    Int
_salt
    ConnectedHomeSettingsForUpdate' {Maybe Double
Maybe (NonEmpty Text)
minConfidence :: Maybe Double
labels :: Maybe (NonEmpty Text)
$sel:minConfidence:ConnectedHomeSettingsForUpdate' :: ConnectedHomeSettingsForUpdate -> Maybe Double
$sel:labels:ConnectedHomeSettingsForUpdate' :: ConnectedHomeSettingsForUpdate -> Maybe (NonEmpty Text)
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
labels
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
minConfidence

instance
  Prelude.NFData
    ConnectedHomeSettingsForUpdate
  where
  rnf :: ConnectedHomeSettingsForUpdate -> ()
rnf ConnectedHomeSettingsForUpdate' {Maybe Double
Maybe (NonEmpty Text)
minConfidence :: Maybe Double
labels :: Maybe (NonEmpty Text)
$sel:minConfidence:ConnectedHomeSettingsForUpdate' :: ConnectedHomeSettingsForUpdate -> Maybe Double
$sel:labels:ConnectedHomeSettingsForUpdate' :: ConnectedHomeSettingsForUpdate -> Maybe (NonEmpty Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
labels
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
minConfidence

instance Data.ToJSON ConnectedHomeSettingsForUpdate where
  toJSON :: ConnectedHomeSettingsForUpdate -> Value
toJSON ConnectedHomeSettingsForUpdate' {Maybe Double
Maybe (NonEmpty Text)
minConfidence :: Maybe Double
labels :: Maybe (NonEmpty Text)
$sel:minConfidence:ConnectedHomeSettingsForUpdate' :: ConnectedHomeSettingsForUpdate -> Maybe Double
$sel:labels:ConnectedHomeSettingsForUpdate' :: ConnectedHomeSettingsForUpdate -> Maybe (NonEmpty Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Labels" 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 (NonEmpty Text)
labels,
            (Key
"MinConfidence" 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 Double
minConfidence
          ]
      )