{-# 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 #-}
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
data AgentStatus = AgentStatus'
{
AgentStatus -> Maybe Natural
displayOrder :: Prelude.Maybe Prelude.Natural,
AgentStatus -> Maybe AgentStatusState
state :: Prelude.Maybe AgentStatusState,
AgentStatus -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
AgentStatus -> Maybe Text
agentStatusId :: Prelude.Maybe Prelude.Text,
AgentStatus -> Maybe AgentStatusType
type' :: Prelude.Maybe AgentStatusType,
AgentStatus -> Maybe Text
agentStatusARN :: Prelude.Maybe Prelude.Text,
AgentStatus -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
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)
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
}
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)
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)
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)
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)
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)
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)
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)
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