{-# 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.Connect.Types.AgentStatusReference
-- 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.Connect.Types.AgentStatusReference 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

-- | Information about the agent\'s status.
--
-- /See:/ 'newAgentStatusReference' smart constructor.
data AgentStatusReference = AgentStatusReference'
  { -- | The Amazon Resource Name (ARN) of the agent\'s status.
    AgentStatusReference -> Maybe Text
statusArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the agent status.
    AgentStatusReference -> Maybe Text
statusName :: Prelude.Maybe Prelude.Text,
    -- | The start timestamp of the agent\'s status.
    AgentStatusReference -> Maybe POSIX
statusStartTimestamp :: Prelude.Maybe Data.POSIX
  }
  deriving (AgentStatusReference -> AgentStatusReference -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AgentStatusReference -> AgentStatusReference -> Bool
$c/= :: AgentStatusReference -> AgentStatusReference -> Bool
== :: AgentStatusReference -> AgentStatusReference -> Bool
$c== :: AgentStatusReference -> AgentStatusReference -> Bool
Prelude.Eq, ReadPrec [AgentStatusReference]
ReadPrec AgentStatusReference
Int -> ReadS AgentStatusReference
ReadS [AgentStatusReference]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AgentStatusReference]
$creadListPrec :: ReadPrec [AgentStatusReference]
readPrec :: ReadPrec AgentStatusReference
$creadPrec :: ReadPrec AgentStatusReference
readList :: ReadS [AgentStatusReference]
$creadList :: ReadS [AgentStatusReference]
readsPrec :: Int -> ReadS AgentStatusReference
$creadsPrec :: Int -> ReadS AgentStatusReference
Prelude.Read, Int -> AgentStatusReference -> ShowS
[AgentStatusReference] -> ShowS
AgentStatusReference -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AgentStatusReference] -> ShowS
$cshowList :: [AgentStatusReference] -> ShowS
show :: AgentStatusReference -> String
$cshow :: AgentStatusReference -> String
showsPrec :: Int -> AgentStatusReference -> ShowS
$cshowsPrec :: Int -> AgentStatusReference -> ShowS
Prelude.Show, forall x. Rep AgentStatusReference x -> AgentStatusReference
forall x. AgentStatusReference -> Rep AgentStatusReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AgentStatusReference x -> AgentStatusReference
$cfrom :: forall x. AgentStatusReference -> Rep AgentStatusReference x
Prelude.Generic)

-- |
-- Create a value of 'AgentStatusReference' 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:
--
-- 'statusArn', 'agentStatusReference_statusArn' - The Amazon Resource Name (ARN) of the agent\'s status.
--
-- 'statusName', 'agentStatusReference_statusName' - The name of the agent status.
--
-- 'statusStartTimestamp', 'agentStatusReference_statusStartTimestamp' - The start timestamp of the agent\'s status.
newAgentStatusReference ::
  AgentStatusReference
newAgentStatusReference :: AgentStatusReference
newAgentStatusReference =
  AgentStatusReference'
    { $sel:statusArn:AgentStatusReference' :: Maybe Text
statusArn = forall a. Maybe a
Prelude.Nothing,
      $sel:statusName:AgentStatusReference' :: Maybe Text
statusName = forall a. Maybe a
Prelude.Nothing,
      $sel:statusStartTimestamp:AgentStatusReference' :: Maybe POSIX
statusStartTimestamp = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the agent\'s status.
agentStatusReference_statusArn :: Lens.Lens' AgentStatusReference (Prelude.Maybe Prelude.Text)
agentStatusReference_statusArn :: Lens' AgentStatusReference (Maybe Text)
agentStatusReference_statusArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentStatusReference' {Maybe Text
statusArn :: Maybe Text
$sel:statusArn:AgentStatusReference' :: AgentStatusReference -> Maybe Text
statusArn} -> Maybe Text
statusArn) (\s :: AgentStatusReference
s@AgentStatusReference' {} Maybe Text
a -> AgentStatusReference
s {$sel:statusArn:AgentStatusReference' :: Maybe Text
statusArn = Maybe Text
a} :: AgentStatusReference)

-- | The name of the agent status.
agentStatusReference_statusName :: Lens.Lens' AgentStatusReference (Prelude.Maybe Prelude.Text)
agentStatusReference_statusName :: Lens' AgentStatusReference (Maybe Text)
agentStatusReference_statusName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentStatusReference' {Maybe Text
statusName :: Maybe Text
$sel:statusName:AgentStatusReference' :: AgentStatusReference -> Maybe Text
statusName} -> Maybe Text
statusName) (\s :: AgentStatusReference
s@AgentStatusReference' {} Maybe Text
a -> AgentStatusReference
s {$sel:statusName:AgentStatusReference' :: Maybe Text
statusName = Maybe Text
a} :: AgentStatusReference)

-- | The start timestamp of the agent\'s status.
agentStatusReference_statusStartTimestamp :: Lens.Lens' AgentStatusReference (Prelude.Maybe Prelude.UTCTime)
agentStatusReference_statusStartTimestamp :: Lens' AgentStatusReference (Maybe UTCTime)
agentStatusReference_statusStartTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentStatusReference' {Maybe POSIX
statusStartTimestamp :: Maybe POSIX
$sel:statusStartTimestamp:AgentStatusReference' :: AgentStatusReference -> Maybe POSIX
statusStartTimestamp} -> Maybe POSIX
statusStartTimestamp) (\s :: AgentStatusReference
s@AgentStatusReference' {} Maybe POSIX
a -> AgentStatusReference
s {$sel:statusStartTimestamp:AgentStatusReference' :: Maybe POSIX
statusStartTimestamp = Maybe POSIX
a} :: AgentStatusReference) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON AgentStatusReference where
  parseJSON :: Value -> Parser AgentStatusReference
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AgentStatusReference"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe POSIX -> AgentStatusReference
AgentStatusReference'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StatusArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StatusName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StatusStartTimestamp")
      )

instance Prelude.Hashable AgentStatusReference where
  hashWithSalt :: Int -> AgentStatusReference -> Int
hashWithSalt Int
_salt AgentStatusReference' {Maybe Text
Maybe POSIX
statusStartTimestamp :: Maybe POSIX
statusName :: Maybe Text
statusArn :: Maybe Text
$sel:statusStartTimestamp:AgentStatusReference' :: AgentStatusReference -> Maybe POSIX
$sel:statusName:AgentStatusReference' :: AgentStatusReference -> Maybe Text
$sel:statusArn:AgentStatusReference' :: AgentStatusReference -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
statusStartTimestamp

instance Prelude.NFData AgentStatusReference where
  rnf :: AgentStatusReference -> ()
rnf AgentStatusReference' {Maybe Text
Maybe POSIX
statusStartTimestamp :: Maybe POSIX
statusName :: Maybe Text
statusArn :: Maybe Text
$sel:statusStartTimestamp:AgentStatusReference' :: AgentStatusReference -> Maybe POSIX
$sel:statusName:AgentStatusReference' :: AgentStatusReference -> Maybe Text
$sel:statusArn:AgentStatusReference' :: AgentStatusReference -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
statusStartTimestamp