{-# 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-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)
module Amazonka.ConnectContactLens.Types.PointOfInterest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(PointOfInterest -> PointOfInterest -> Bool)
-> (PointOfInterest -> PointOfInterest -> Bool)
-> Eq PointOfInterest
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]
(Int -> ReadS PointOfInterest)
-> ReadS [PointOfInterest]
-> ReadPrec PointOfInterest
-> ReadPrec [PointOfInterest]
-> Read 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
(Int -> PointOfInterest -> ShowS)
-> (PointOfInterest -> String)
-> ([PointOfInterest] -> ShowS)
-> Show PointOfInterest
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. PointOfInterest -> Rep PointOfInterest x)
-> (forall x. Rep PointOfInterest x -> PointOfInterest)
-> Generic PointOfInterest
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' :: Natural -> Natural -> PointOfInterest
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 :: (Natural -> f Natural) -> PointOfInterest -> f PointOfInterest
pointOfInterest_beginOffsetMillis = (PointOfInterest -> Natural)
-> (PointOfInterest -> Natural -> PointOfInterest)
-> Lens PointOfInterest PointOfInterest Natural Natural
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 :: (Natural -> f Natural) -> PointOfInterest -> f PointOfInterest
pointOfInterest_endOffsetMillis = (PointOfInterest -> Natural)
-> (PointOfInterest -> Natural -> PointOfInterest)
-> Lens PointOfInterest PointOfInterest Natural Natural
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 Core.FromJSON PointOfInterest where
  parseJSON :: Value -> Parser PointOfInterest
parseJSON =
    String
-> (Object -> Parser PointOfInterest)
-> Value
-> Parser PointOfInterest
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PointOfInterest"
      ( \Object
x ->
          Natural -> Natural -> PointOfInterest
PointOfInterest'
            (Natural -> Natural -> PointOfInterest)
-> Parser Natural -> Parser (Natural -> PointOfInterest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"BeginOffsetMillis")
            Parser (Natural -> PointOfInterest)
-> Parser Natural -> Parser PointOfInterest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"EndOffsetMillis")
      )

instance Prelude.Hashable PointOfInterest

instance Prelude.NFData PointOfInterest