{-# 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.AgentStatus
-- 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.AgentStatus where

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

-- | Contains information about an agent status.
--
-- /See:/ 'newAgentStatus' smart constructor.
data AgentStatus = AgentStatus'
  { -- | The display order of the agent status.
    AgentStatus -> Maybe Natural
displayOrder :: Prelude.Maybe Prelude.Natural,
    -- | The state of the agent status.
    AgentStatus -> Maybe AgentStatusState
state :: Prelude.Maybe AgentStatusState,
    -- | The name of the agent status.
    AgentStatus -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the agent status.
    AgentStatus -> Maybe Text
agentStatusId :: Prelude.Maybe Prelude.Text,
    -- | The type of agent status.
    AgentStatus -> Maybe AgentStatusType
type' :: Prelude.Maybe AgentStatusType,
    -- | The Amazon Resource Name (ARN) of the agent status.
    AgentStatus -> Maybe Text
agentStatusARN :: Prelude.Maybe Prelude.Text,
    -- | The description of the agent status.
    AgentStatus -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | One or more tags.
    AgentStatus -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (AgentStatus -> AgentStatus -> Bool
(AgentStatus -> AgentStatus -> Bool)
-> (AgentStatus -> AgentStatus -> Bool) -> Eq AgentStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AgentStatus -> AgentStatus -> Bool
$c/= :: AgentStatus -> AgentStatus -> Bool
== :: AgentStatus -> AgentStatus -> Bool
$c== :: AgentStatus -> AgentStatus -> Bool
Prelude.Eq, ReadPrec [AgentStatus]
ReadPrec AgentStatus
Int -> ReadS AgentStatus
ReadS [AgentStatus]
(Int -> ReadS AgentStatus)
-> ReadS [AgentStatus]
-> ReadPrec AgentStatus
-> ReadPrec [AgentStatus]
-> Read AgentStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AgentStatus]
$creadListPrec :: ReadPrec [AgentStatus]
readPrec :: ReadPrec AgentStatus
$creadPrec :: ReadPrec AgentStatus
readList :: ReadS [AgentStatus]
$creadList :: ReadS [AgentStatus]
readsPrec :: Int -> ReadS AgentStatus
$creadsPrec :: Int -> ReadS AgentStatus
Prelude.Read, Int -> AgentStatus -> ShowS
[AgentStatus] -> ShowS
AgentStatus -> String
(Int -> AgentStatus -> ShowS)
-> (AgentStatus -> String)
-> ([AgentStatus] -> ShowS)
-> Show AgentStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AgentStatus] -> ShowS
$cshowList :: [AgentStatus] -> ShowS
show :: AgentStatus -> String
$cshow :: AgentStatus -> String
showsPrec :: Int -> AgentStatus -> ShowS
$cshowsPrec :: Int -> AgentStatus -> ShowS
Prelude.Show, (forall x. AgentStatus -> Rep AgentStatus x)
-> (forall x. Rep AgentStatus x -> AgentStatus)
-> Generic AgentStatus
forall x. Rep AgentStatus x -> AgentStatus
forall x. AgentStatus -> Rep AgentStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AgentStatus x -> AgentStatus
$cfrom :: forall x. AgentStatus -> Rep AgentStatus x
Prelude.Generic)

-- |
-- Create a value of 'AgentStatus' 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:
--
-- 'displayOrder', 'agentStatus_displayOrder' - The display order of the agent status.
--
-- 'state', 'agentStatus_state' - The state of the agent status.
--
-- 'name', 'agentStatus_name' - The name of the agent status.
--
-- 'agentStatusId', 'agentStatus_agentStatusId' - The identifier of the agent status.
--
-- 'type'', 'agentStatus_type' - The type of agent status.
--
-- 'agentStatusARN', 'agentStatus_agentStatusARN' - The Amazon Resource Name (ARN) of the agent status.
--
-- 'description', 'agentStatus_description' - The description of the agent status.
--
-- 'tags', 'agentStatus_tags' - One or more tags.
newAgentStatus ::
  AgentStatus
newAgentStatus :: AgentStatus
newAgentStatus =
  AgentStatus' :: Maybe Natural
-> Maybe AgentStatusState
-> Maybe Text
-> Maybe Text
-> Maybe AgentStatusType
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> AgentStatus
AgentStatus'
    { $sel:displayOrder:AgentStatus' :: Maybe Natural
displayOrder = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:state:AgentStatus' :: Maybe AgentStatusState
state = Maybe AgentStatusState
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AgentStatus' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:agentStatusId:AgentStatus' :: Maybe Text
agentStatusId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':AgentStatus' :: Maybe AgentStatusType
type' = Maybe AgentStatusType
forall a. Maybe a
Prelude.Nothing,
      $sel:agentStatusARN:AgentStatus' :: Maybe Text
agentStatusARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:AgentStatus' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:AgentStatus' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The display order of the agent status.
agentStatus_displayOrder :: Lens.Lens' AgentStatus (Prelude.Maybe Prelude.Natural)
agentStatus_displayOrder :: (Maybe Natural -> f (Maybe Natural))
-> AgentStatus -> f AgentStatus
agentStatus_displayOrder = (AgentStatus -> Maybe Natural)
-> (AgentStatus -> Maybe Natural -> AgentStatus)
-> Lens AgentStatus AgentStatus (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentStatus' {Maybe Natural
displayOrder :: Maybe Natural
$sel:displayOrder:AgentStatus' :: AgentStatus -> Maybe Natural
displayOrder} -> Maybe Natural
displayOrder) (\s :: AgentStatus
s@AgentStatus' {} Maybe Natural
a -> AgentStatus
s {$sel:displayOrder:AgentStatus' :: Maybe Natural
displayOrder = Maybe Natural
a} :: AgentStatus)

-- | The state of the agent status.
agentStatus_state :: Lens.Lens' AgentStatus (Prelude.Maybe AgentStatusState)
agentStatus_state :: (Maybe AgentStatusState -> f (Maybe AgentStatusState))
-> AgentStatus -> f AgentStatus
agentStatus_state = (AgentStatus -> Maybe AgentStatusState)
-> (AgentStatus -> Maybe AgentStatusState -> AgentStatus)
-> Lens
     AgentStatus
     AgentStatus
     (Maybe AgentStatusState)
     (Maybe AgentStatusState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentStatus' {Maybe AgentStatusState
state :: Maybe AgentStatusState
$sel:state:AgentStatus' :: AgentStatus -> Maybe AgentStatusState
state} -> Maybe AgentStatusState
state) (\s :: AgentStatus
s@AgentStatus' {} Maybe AgentStatusState
a -> AgentStatus
s {$sel:state:AgentStatus' :: Maybe AgentStatusState
state = Maybe AgentStatusState
a} :: AgentStatus)

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

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

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

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

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

-- | One or more tags.
agentStatus_tags :: Lens.Lens' AgentStatus (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
agentStatus_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AgentStatus -> f AgentStatus
agentStatus_tags = (AgentStatus -> Maybe (HashMap Text Text))
-> (AgentStatus -> Maybe (HashMap Text Text) -> AgentStatus)
-> Lens
     AgentStatus
     AgentStatus
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentStatus' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:AgentStatus' :: AgentStatus -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: AgentStatus
s@AgentStatus' {} Maybe (HashMap Text Text)
a -> AgentStatus
s {$sel:tags:AgentStatus' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: AgentStatus) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> AgentStatus -> f AgentStatus)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AgentStatus
-> f AgentStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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 AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON AgentStatus where
  parseJSON :: Value -> Parser AgentStatus
parseJSON =
    String
-> (Object -> Parser AgentStatus) -> Value -> Parser AgentStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AgentStatus"
      ( \Object
x ->
          Maybe Natural
-> Maybe AgentStatusState
-> Maybe Text
-> Maybe Text
-> Maybe AgentStatusType
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> AgentStatus
AgentStatus'
            (Maybe Natural
 -> Maybe AgentStatusState
 -> Maybe Text
 -> Maybe Text
 -> Maybe AgentStatusType
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> AgentStatus)
-> Parser (Maybe Natural)
-> Parser
     (Maybe AgentStatusState
      -> Maybe Text
      -> Maybe Text
      -> Maybe AgentStatusType
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> AgentStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DisplayOrder")
            Parser
  (Maybe AgentStatusState
   -> Maybe Text
   -> Maybe Text
   -> Maybe AgentStatusType
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> AgentStatus)
-> Parser (Maybe AgentStatusState)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AgentStatusType
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> AgentStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AgentStatusState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe AgentStatusType
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> AgentStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AgentStatusType
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> AgentStatus)
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
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> AgentStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe AgentStatusType
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> AgentStatus)
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
"AgentStatusId")
            Parser
  (Maybe AgentStatusType
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> AgentStatus)
-> Parser (Maybe AgentStatusType)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe (HashMap Text Text) -> AgentStatus)
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")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe (HashMap Text Text) -> AgentStatus)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe (HashMap Text Text) -> AgentStatus)
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
"AgentStatusARN")
            Parser (Maybe Text -> Maybe (HashMap Text Text) -> AgentStatus)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> AgentStatus)
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
"Description")
            Parser (Maybe (HashMap Text Text) -> AgentStatus)
-> Parser (Maybe (HashMap Text Text)) -> Parser AgentStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable AgentStatus

instance Prelude.NFData AgentStatus