{-# 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.ConnectContactLens.Types.PointOfInterest
-- 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.ConnectContactLens.Types.PointOfInterest 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 section of the contact audio where that category rule was detected.
--
-- /See:/ 'newPointOfInterest' smart constructor.
data PointOfInterest = PointOfInterest'
  { -- | The beginning offset in milliseconds where the category rule was
    -- detected.
    PointOfInterest -> Natural
beginOffsetMillis :: Prelude.Natural,
    -- | The ending offset in milliseconds where the category rule was detected.
    PointOfInterest -> Natural
endOffsetMillis :: Prelude.Natural
  }
  deriving (PointOfInterest -> PointOfInterest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PointOfInterest -> PointOfInterest -> Bool
$c/= :: PointOfInterest -> PointOfInterest -> Bool
== :: PointOfInterest -> PointOfInterest -> Bool
$c== :: PointOfInterest -> PointOfInterest -> Bool
Prelude.Eq, ReadPrec [PointOfInterest]
ReadPrec PointOfInterest
Int -> ReadS PointOfInterest
ReadS [PointOfInterest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PointOfInterest]
$creadListPrec :: ReadPrec [PointOfInterest]
readPrec :: ReadPrec PointOfInterest
$creadPrec :: ReadPrec PointOfInterest
readList :: ReadS [PointOfInterest]
$creadList :: ReadS [PointOfInterest]
readsPrec :: Int -> ReadS PointOfInterest
$creadsPrec :: Int -> ReadS PointOfInterest
Prelude.Read, Int -> PointOfInterest -> ShowS
[PointOfInterest] -> ShowS
PointOfInterest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PointOfInterest] -> ShowS
$cshowList :: [PointOfInterest] -> ShowS
show :: PointOfInterest -> String
$cshow :: PointOfInterest -> String
showsPrec :: Int -> PointOfInterest -> ShowS
$cshowsPrec :: Int -> PointOfInterest -> ShowS
Prelude.Show, forall x. Rep PointOfInterest x -> PointOfInterest
forall x. PointOfInterest -> Rep PointOfInterest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PointOfInterest x -> PointOfInterest
$cfrom :: forall x. PointOfInterest -> Rep PointOfInterest x
Prelude.Generic)

-- |
-- Create a value of 'PointOfInterest' 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:
--
-- 'beginOffsetMillis', 'pointOfInterest_beginOffsetMillis' - The beginning offset in milliseconds where the category rule was
-- detected.
--
-- 'endOffsetMillis', 'pointOfInterest_endOffsetMillis' - The ending offset in milliseconds where the category rule was detected.
newPointOfInterest ::
  -- | 'beginOffsetMillis'
  Prelude.Natural ->
  -- | 'endOffsetMillis'
  Prelude.Natural ->
  PointOfInterest
newPointOfInterest :: Natural -> Natural -> PointOfInterest
newPointOfInterest
  Natural
pBeginOffsetMillis_
  Natural
pEndOffsetMillis_ =
    PointOfInterest'
      { $sel:beginOffsetMillis:PointOfInterest' :: Natural
beginOffsetMillis =
          Natural
pBeginOffsetMillis_,
        $sel:endOffsetMillis:PointOfInterest' :: Natural
endOffsetMillis = Natural
pEndOffsetMillis_
      }

-- | The beginning offset in milliseconds where the category rule was
-- detected.
pointOfInterest_beginOffsetMillis :: Lens.Lens' PointOfInterest Prelude.Natural
pointOfInterest_beginOffsetMillis :: Lens' PointOfInterest Natural
pointOfInterest_beginOffsetMillis = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PointOfInterest' {Natural
beginOffsetMillis :: Natural
$sel:beginOffsetMillis:PointOfInterest' :: PointOfInterest -> Natural
beginOffsetMillis} -> Natural
beginOffsetMillis) (\s :: PointOfInterest
s@PointOfInterest' {} Natural
a -> PointOfInterest
s {$sel:beginOffsetMillis:PointOfInterest' :: Natural
beginOffsetMillis = Natural
a} :: PointOfInterest)

-- | The ending offset in milliseconds where the category rule was detected.
pointOfInterest_endOffsetMillis :: Lens.Lens' PointOfInterest Prelude.Natural
pointOfInterest_endOffsetMillis :: Lens' PointOfInterest Natural
pointOfInterest_endOffsetMillis = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PointOfInterest' {Natural
endOffsetMillis :: Natural
$sel:endOffsetMillis:PointOfInterest' :: PointOfInterest -> Natural
endOffsetMillis} -> Natural
endOffsetMillis) (\s :: PointOfInterest
s@PointOfInterest' {} Natural
a -> PointOfInterest
s {$sel:endOffsetMillis:PointOfInterest' :: Natural
endOffsetMillis = Natural
a} :: PointOfInterest)

instance Data.FromJSON PointOfInterest where
  parseJSON :: Value -> Parser PointOfInterest
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PointOfInterest"
      ( \Object
x ->
          Natural -> Natural -> PointOfInterest
PointOfInterest'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"BeginOffsetMillis")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"EndOffsetMillis")
      )

instance Prelude.Hashable PointOfInterest where
  hashWithSalt :: Int -> PointOfInterest -> Int
hashWithSalt Int
_salt PointOfInterest' {Natural
endOffsetMillis :: Natural
beginOffsetMillis :: Natural
$sel:endOffsetMillis:PointOfInterest' :: PointOfInterest -> Natural
$sel:beginOffsetMillis:PointOfInterest' :: PointOfInterest -> Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
beginOffsetMillis
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
endOffsetMillis

instance Prelude.NFData PointOfInterest where
  rnf :: PointOfInterest -> ()
rnf PointOfInterest' {Natural
endOffsetMillis :: Natural
beginOffsetMillis :: Natural
$sel:endOffsetMillis:PointOfInterest' :: PointOfInterest -> Natural
$sel:beginOffsetMillis:PointOfInterest' :: PointOfInterest -> Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Natural
beginOffsetMillis
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
endOffsetMillis