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

import Amazonka.Connect.Types.AgentStatusState
import Amazonka.Connect.Types.AgentStatusType
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

-- | Contains information about an agent status.
--
-- /See:/ 'newAgentStatus' smart constructor.
data AgentStatus = AgentStatus'
  { -- | The Amazon Resource Name (ARN) of the agent status.
    AgentStatus -> Maybe Text
agentStatusARN :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the agent status.
    AgentStatus -> Maybe Text
agentStatusId :: Prelude.Maybe Prelude.Text,
    -- | The description of the agent status.
    AgentStatus -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The display order of the agent status.
    AgentStatus -> Maybe Natural
displayOrder :: Prelude.Maybe Prelude.Natural,
    -- | The name of the agent status.
    AgentStatus -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The state of the agent status.
    AgentStatus -> Maybe AgentStatusState
state :: Prelude.Maybe AgentStatusState,
    -- | The tags used to organize, track, or control access for this resource.
    -- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
    AgentStatus -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The type of agent status.
    AgentStatus -> Maybe AgentStatusType
type' :: Prelude.Maybe AgentStatusType
  }
  deriving (AgentStatus -> AgentStatus -> Bool
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]
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
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. 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:
--
-- 'agentStatusARN', 'agentStatus_agentStatusARN' - The Amazon Resource Name (ARN) of the agent status.
--
-- 'agentStatusId', 'agentStatus_agentStatusId' - The identifier of the agent status.
--
-- 'description', 'agentStatus_description' - The description of the agent status.
--
-- 'displayOrder', 'agentStatus_displayOrder' - The display order of the agent status.
--
-- 'name', 'agentStatus_name' - The name of the agent status.
--
-- 'state', 'agentStatus_state' - The state of the agent status.
--
-- 'tags', 'agentStatus_tags' - The tags used to organize, track, or control access for this resource.
-- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
--
-- 'type'', 'agentStatus_type' - The type of agent status.
newAgentStatus ::
  AgentStatus
newAgentStatus :: AgentStatus
newAgentStatus =
  AgentStatus'
    { $sel:agentStatusARN:AgentStatus' :: Maybe Text
agentStatusARN = forall a. Maybe a
Prelude.Nothing,
      $sel:agentStatusId:AgentStatus' :: Maybe Text
agentStatusId = forall a. Maybe a
Prelude.Nothing,
      $sel:description:AgentStatus' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:displayOrder:AgentStatus' :: Maybe Natural
displayOrder = forall a. Maybe a
Prelude.Nothing,
      $sel:name:AgentStatus' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:state:AgentStatus' :: Maybe AgentStatusState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:AgentStatus' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:type':AgentStatus' :: Maybe AgentStatusType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the agent status.
agentStatus_agentStatusARN :: Lens.Lens' AgentStatus (Prelude.Maybe Prelude.Text)
agentStatus_agentStatusARN :: Lens' AgentStatus (Maybe Text)
agentStatus_agentStatusARN = 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 identifier of the agent status.
agentStatus_agentStatusId :: Lens.Lens' AgentStatus (Prelude.Maybe Prelude.Text)
agentStatus_agentStatusId :: Lens' AgentStatus (Maybe Text)
agentStatus_agentStatusId = 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 description of the agent status.
agentStatus_description :: Lens.Lens' AgentStatus (Prelude.Maybe Prelude.Text)
agentStatus_description :: Lens' AgentStatus (Maybe Text)
agentStatus_description = 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)

-- | The display order of the agent status.
agentStatus_displayOrder :: Lens.Lens' AgentStatus (Prelude.Maybe Prelude.Natural)
agentStatus_displayOrder :: Lens' AgentStatus (Maybe Natural)
agentStatus_displayOrder = 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 name of the agent status.
agentStatus_name :: Lens.Lens' AgentStatus (Prelude.Maybe Prelude.Text)
agentStatus_name :: Lens' AgentStatus (Maybe Text)
agentStatus_name = 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 state of the agent status.
agentStatus_state :: Lens.Lens' AgentStatus (Prelude.Maybe AgentStatusState)
agentStatus_state :: Lens' AgentStatus (Maybe AgentStatusState)
agentStatus_state = 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 tags used to organize, track, or control access for this resource.
-- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
agentStatus_tags :: Lens.Lens' AgentStatus (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
agentStatus_tags :: Lens' AgentStatus (Maybe (HashMap Text Text))
agentStatus_tags = 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) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of agent status.
agentStatus_type :: Lens.Lens' AgentStatus (Prelude.Maybe AgentStatusType)
agentStatus_type :: Lens' AgentStatus (Maybe AgentStatusType)
agentStatus_type = 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)

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

instance Prelude.Hashable AgentStatus where
  hashWithSalt :: Int -> AgentStatus -> Int
hashWithSalt Int
_salt AgentStatus' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe AgentStatusState
Maybe AgentStatusType
type' :: Maybe AgentStatusType
tags :: Maybe (HashMap Text Text)
state :: Maybe AgentStatusState
name :: Maybe Text
displayOrder :: Maybe Natural
description :: Maybe Text
agentStatusId :: Maybe Text
agentStatusARN :: Maybe Text
$sel:type':AgentStatus' :: AgentStatus -> Maybe AgentStatusType
$sel:tags:AgentStatus' :: AgentStatus -> Maybe (HashMap Text Text)
$sel:state:AgentStatus' :: AgentStatus -> Maybe AgentStatusState
$sel:name:AgentStatus' :: AgentStatus -> Maybe Text
$sel:displayOrder:AgentStatus' :: AgentStatus -> Maybe Natural
$sel:description:AgentStatus' :: AgentStatus -> Maybe Text
$sel:agentStatusId:AgentStatus' :: AgentStatus -> Maybe Text
$sel:agentStatusARN:AgentStatus' :: AgentStatus -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
agentStatusARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
agentStatusId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
displayOrder
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AgentStatusState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AgentStatusType
type'

instance Prelude.NFData AgentStatus where
  rnf :: AgentStatus -> ()
rnf AgentStatus' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe AgentStatusState
Maybe AgentStatusType
type' :: Maybe AgentStatusType
tags :: Maybe (HashMap Text Text)
state :: Maybe AgentStatusState
name :: Maybe Text
displayOrder :: Maybe Natural
description :: Maybe Text
agentStatusId :: Maybe Text
agentStatusARN :: Maybe Text
$sel:type':AgentStatus' :: AgentStatus -> Maybe AgentStatusType
$sel:tags:AgentStatus' :: AgentStatus -> Maybe (HashMap Text Text)
$sel:state:AgentStatus' :: AgentStatus -> Maybe AgentStatusState
$sel:name:AgentStatus' :: AgentStatus -> Maybe Text
$sel:displayOrder:AgentStatus' :: AgentStatus -> Maybe Natural
$sel:description:AgentStatus' :: AgentStatus -> Maybe Text
$sel:agentStatusId:AgentStatus' :: AgentStatus -> Maybe Text
$sel:agentStatusARN:AgentStatus' :: AgentStatus -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
agentStatusARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
agentStatusId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
displayOrder
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AgentStatusState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AgentStatusType
type'