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

import Amazonka.Connect.Types.AgentStatusType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Summary information for an agent status.
--
-- /See:/ 'newAgentStatusSummary' smart constructor.
data AgentStatusSummary = AgentStatusSummary'
  { -- | The Amazon Resource Name (ARN) for the agent status.
    AgentStatusSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the agent status.
    AgentStatusSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The identifier for an agent status.
    AgentStatusSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The type of the agent status.
    AgentStatusSummary -> Maybe AgentStatusType
type' :: Prelude.Maybe AgentStatusType
  }
  deriving (AgentStatusSummary -> AgentStatusSummary -> Bool
(AgentStatusSummary -> AgentStatusSummary -> Bool)
-> (AgentStatusSummary -> AgentStatusSummary -> Bool)
-> Eq AgentStatusSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AgentStatusSummary -> AgentStatusSummary -> Bool
$c/= :: AgentStatusSummary -> AgentStatusSummary -> Bool
== :: AgentStatusSummary -> AgentStatusSummary -> Bool
$c== :: AgentStatusSummary -> AgentStatusSummary -> Bool
Prelude.Eq, ReadPrec [AgentStatusSummary]
ReadPrec AgentStatusSummary
Int -> ReadS AgentStatusSummary
ReadS [AgentStatusSummary]
(Int -> ReadS AgentStatusSummary)
-> ReadS [AgentStatusSummary]
-> ReadPrec AgentStatusSummary
-> ReadPrec [AgentStatusSummary]
-> Read AgentStatusSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AgentStatusSummary]
$creadListPrec :: ReadPrec [AgentStatusSummary]
readPrec :: ReadPrec AgentStatusSummary
$creadPrec :: ReadPrec AgentStatusSummary
readList :: ReadS [AgentStatusSummary]
$creadList :: ReadS [AgentStatusSummary]
readsPrec :: Int -> ReadS AgentStatusSummary
$creadsPrec :: Int -> ReadS AgentStatusSummary
Prelude.Read, Int -> AgentStatusSummary -> ShowS
[AgentStatusSummary] -> ShowS
AgentStatusSummary -> String
(Int -> AgentStatusSummary -> ShowS)
-> (AgentStatusSummary -> String)
-> ([AgentStatusSummary] -> ShowS)
-> Show AgentStatusSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AgentStatusSummary] -> ShowS
$cshowList :: [AgentStatusSummary] -> ShowS
show :: AgentStatusSummary -> String
$cshow :: AgentStatusSummary -> String
showsPrec :: Int -> AgentStatusSummary -> ShowS
$cshowsPrec :: Int -> AgentStatusSummary -> ShowS
Prelude.Show, (forall x. AgentStatusSummary -> Rep AgentStatusSummary x)
-> (forall x. Rep AgentStatusSummary x -> AgentStatusSummary)
-> Generic AgentStatusSummary
forall x. Rep AgentStatusSummary x -> AgentStatusSummary
forall x. AgentStatusSummary -> Rep AgentStatusSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AgentStatusSummary x -> AgentStatusSummary
$cfrom :: forall x. AgentStatusSummary -> Rep AgentStatusSummary x
Prelude.Generic)

-- |
-- Create a value of 'AgentStatusSummary' 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:
--
-- 'arn', 'agentStatusSummary_arn' - The Amazon Resource Name (ARN) for the agent status.
--
-- 'name', 'agentStatusSummary_name' - The name of the agent status.
--
-- 'id', 'agentStatusSummary_id' - The identifier for an agent status.
--
-- 'type'', 'agentStatusSummary_type' - The type of the agent status.
newAgentStatusSummary ::
  AgentStatusSummary
newAgentStatusSummary :: AgentStatusSummary
newAgentStatusSummary =
  AgentStatusSummary' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AgentStatusType
-> AgentStatusSummary
AgentStatusSummary'
    { $sel:arn:AgentStatusSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AgentStatusSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:AgentStatusSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':AgentStatusSummary' :: Maybe AgentStatusType
type' = Maybe AgentStatusType
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) for the agent status.
agentStatusSummary_arn :: Lens.Lens' AgentStatusSummary (Prelude.Maybe Prelude.Text)
agentStatusSummary_arn :: (Maybe Text -> f (Maybe Text))
-> AgentStatusSummary -> f AgentStatusSummary
agentStatusSummary_arn = (AgentStatusSummary -> Maybe Text)
-> (AgentStatusSummary -> Maybe Text -> AgentStatusSummary)
-> Lens
     AgentStatusSummary AgentStatusSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentStatusSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:AgentStatusSummary' :: AgentStatusSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: AgentStatusSummary
s@AgentStatusSummary' {} Maybe Text
a -> AgentStatusSummary
s {$sel:arn:AgentStatusSummary' :: Maybe Text
arn = Maybe Text
a} :: AgentStatusSummary)

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

-- | The identifier for an agent status.
agentStatusSummary_id :: Lens.Lens' AgentStatusSummary (Prelude.Maybe Prelude.Text)
agentStatusSummary_id :: (Maybe Text -> f (Maybe Text))
-> AgentStatusSummary -> f AgentStatusSummary
agentStatusSummary_id = (AgentStatusSummary -> Maybe Text)
-> (AgentStatusSummary -> Maybe Text -> AgentStatusSummary)
-> Lens
     AgentStatusSummary AgentStatusSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentStatusSummary' {Maybe Text
id :: Maybe Text
$sel:id:AgentStatusSummary' :: AgentStatusSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: AgentStatusSummary
s@AgentStatusSummary' {} Maybe Text
a -> AgentStatusSummary
s {$sel:id:AgentStatusSummary' :: Maybe Text
id = Maybe Text
a} :: AgentStatusSummary)

-- | The type of the agent status.
agentStatusSummary_type :: Lens.Lens' AgentStatusSummary (Prelude.Maybe AgentStatusType)
agentStatusSummary_type :: (Maybe AgentStatusType -> f (Maybe AgentStatusType))
-> AgentStatusSummary -> f AgentStatusSummary
agentStatusSummary_type = (AgentStatusSummary -> Maybe AgentStatusType)
-> (AgentStatusSummary
    -> Maybe AgentStatusType -> AgentStatusSummary)
-> Lens
     AgentStatusSummary
     AgentStatusSummary
     (Maybe AgentStatusType)
     (Maybe AgentStatusType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentStatusSummary' {Maybe AgentStatusType
type' :: Maybe AgentStatusType
$sel:type':AgentStatusSummary' :: AgentStatusSummary -> Maybe AgentStatusType
type'} -> Maybe AgentStatusType
type') (\s :: AgentStatusSummary
s@AgentStatusSummary' {} Maybe AgentStatusType
a -> AgentStatusSummary
s {$sel:type':AgentStatusSummary' :: Maybe AgentStatusType
type' = Maybe AgentStatusType
a} :: AgentStatusSummary)

instance Core.FromJSON AgentStatusSummary where
  parseJSON :: Value -> Parser AgentStatusSummary
parseJSON =
    String
-> (Object -> Parser AgentStatusSummary)
-> Value
-> Parser AgentStatusSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AgentStatusSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AgentStatusType
-> AgentStatusSummary
AgentStatusSummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AgentStatusType
 -> AgentStatusSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe AgentStatusType -> AgentStatusSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe AgentStatusType -> AgentStatusSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe AgentStatusType -> AgentStatusSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser (Maybe Text -> Maybe AgentStatusType -> AgentStatusSummary)
-> Parser (Maybe Text)
-> Parser (Maybe AgentStatusType -> AgentStatusSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
            Parser (Maybe AgentStatusType -> AgentStatusSummary)
-> Parser (Maybe AgentStatusType) -> Parser AgentStatusSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AgentStatusType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
      )

instance Prelude.Hashable AgentStatusSummary

instance Prelude.NFData AgentStatusSummary