{-# 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.Instance where
import Amazonka.Connect.Types.DirectoryType
import Amazonka.Connect.Types.InstanceStatus
import Amazonka.Connect.Types.InstanceStatusReason
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Instance = Instance'
{
Instance -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Instance -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
Instance -> Maybe Bool
outboundCallsEnabled :: Prelude.Maybe Prelude.Bool,
Instance -> Maybe Bool
inboundCallsEnabled :: Prelude.Maybe Prelude.Bool,
Instance -> Maybe (Sensitive Text)
instanceAlias :: Prelude.Maybe (Core.Sensitive Prelude.Text),
Instance -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Instance -> Maybe InstanceStatus
instanceStatus :: Prelude.Maybe InstanceStatus,
Instance -> Maybe DirectoryType
identityManagementType :: Prelude.Maybe DirectoryType,
Instance -> Maybe InstanceStatusReason
statusReason :: Prelude.Maybe InstanceStatusReason,
Instance -> Maybe Text
serviceRole :: Prelude.Maybe Prelude.Text
}
deriving (Instance -> Instance -> Bool
(Instance -> Instance -> Bool)
-> (Instance -> Instance -> Bool) -> Eq Instance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Instance -> Instance -> Bool
$c/= :: Instance -> Instance -> Bool
== :: Instance -> Instance -> Bool
$c== :: Instance -> Instance -> Bool
Prelude.Eq, Int -> Instance -> ShowS
[Instance] -> ShowS
Instance -> String
(Int -> Instance -> ShowS)
-> (Instance -> String) -> ([Instance] -> ShowS) -> Show Instance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Instance] -> ShowS
$cshowList :: [Instance] -> ShowS
show :: Instance -> String
$cshow :: Instance -> String
showsPrec :: Int -> Instance -> ShowS
$cshowsPrec :: Int -> Instance -> ShowS
Prelude.Show, (forall x. Instance -> Rep Instance x)
-> (forall x. Rep Instance x -> Instance) -> Generic Instance
forall x. Rep Instance x -> Instance
forall x. Instance -> Rep Instance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Instance x -> Instance
$cfrom :: forall x. Instance -> Rep Instance x
Prelude.Generic)
newInstance ::
Instance
newInstance :: Instance
newInstance =
Instance' :: Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance
Instance'
{ $sel:arn:Instance' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdTime:Instance' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:outboundCallsEnabled:Instance' :: Maybe Bool
outboundCallsEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:inboundCallsEnabled:Instance' :: Maybe Bool
inboundCallsEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:instanceAlias:Instance' :: Maybe (Sensitive Text)
instanceAlias = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:id:Instance' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceStatus:Instance' :: Maybe InstanceStatus
instanceStatus = Maybe InstanceStatus
forall a. Maybe a
Prelude.Nothing,
$sel:identityManagementType:Instance' :: Maybe DirectoryType
identityManagementType = Maybe DirectoryType
forall a. Maybe a
Prelude.Nothing,
$sel:statusReason:Instance' :: Maybe InstanceStatusReason
statusReason = Maybe InstanceStatusReason
forall a. Maybe a
Prelude.Nothing,
$sel:serviceRole:Instance' :: Maybe Text
serviceRole = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
instance_arn :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_arn :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_arn = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
arn :: Maybe Text
$sel:arn:Instance' :: Instance -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:arn:Instance' :: Maybe Text
arn = Maybe Text
a} :: Instance)
instance_createdTime :: Lens.Lens' Instance (Prelude.Maybe Prelude.UTCTime)
instance_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Instance -> f Instance
instance_createdTime = (Instance -> Maybe POSIX)
-> (Instance -> Maybe POSIX -> Instance)
-> Lens Instance Instance (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:Instance' :: Instance -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: Instance
s@Instance' {} Maybe POSIX
a -> Instance
s {$sel:createdTime:Instance' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: Instance) ((Maybe POSIX -> f (Maybe POSIX)) -> Instance -> f Instance)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Instance
-> f Instance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance_outboundCallsEnabled :: Lens.Lens' Instance (Prelude.Maybe Prelude.Bool)
instance_outboundCallsEnabled :: (Maybe Bool -> f (Maybe Bool)) -> Instance -> f Instance
instance_outboundCallsEnabled = (Instance -> Maybe Bool)
-> (Instance -> Maybe Bool -> Instance)
-> Lens Instance Instance (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Bool
outboundCallsEnabled :: Maybe Bool
$sel:outboundCallsEnabled:Instance' :: Instance -> Maybe Bool
outboundCallsEnabled} -> Maybe Bool
outboundCallsEnabled) (\s :: Instance
s@Instance' {} Maybe Bool
a -> Instance
s {$sel:outboundCallsEnabled:Instance' :: Maybe Bool
outboundCallsEnabled = Maybe Bool
a} :: Instance)
instance_inboundCallsEnabled :: Lens.Lens' Instance (Prelude.Maybe Prelude.Bool)
instance_inboundCallsEnabled :: (Maybe Bool -> f (Maybe Bool)) -> Instance -> f Instance
instance_inboundCallsEnabled = (Instance -> Maybe Bool)
-> (Instance -> Maybe Bool -> Instance)
-> Lens Instance Instance (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Bool
inboundCallsEnabled :: Maybe Bool
$sel:inboundCallsEnabled:Instance' :: Instance -> Maybe Bool
inboundCallsEnabled} -> Maybe Bool
inboundCallsEnabled) (\s :: Instance
s@Instance' {} Maybe Bool
a -> Instance
s {$sel:inboundCallsEnabled:Instance' :: Maybe Bool
inboundCallsEnabled = Maybe Bool
a} :: Instance)
instance_instanceAlias :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_instanceAlias :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_instanceAlias = (Instance -> Maybe (Sensitive Text))
-> (Instance -> Maybe (Sensitive Text) -> Instance)
-> Lens
Instance Instance (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe (Sensitive Text)
instanceAlias :: Maybe (Sensitive Text)
$sel:instanceAlias:Instance' :: Instance -> Maybe (Sensitive Text)
instanceAlias} -> Maybe (Sensitive Text)
instanceAlias) (\s :: Instance
s@Instance' {} Maybe (Sensitive Text)
a -> Instance
s {$sel:instanceAlias:Instance' :: Maybe (Sensitive Text)
instanceAlias = Maybe (Sensitive Text)
a} :: Instance) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Instance -> f Instance)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Instance
-> f Instance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance_id :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_id :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_id = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
id :: Maybe Text
$sel:id:Instance' :: Instance -> Maybe Text
id} -> Maybe Text
id) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:id:Instance' :: Maybe Text
id = Maybe Text
a} :: Instance)
instance_instanceStatus :: Lens.Lens' Instance (Prelude.Maybe InstanceStatus)
instance_instanceStatus :: (Maybe InstanceStatus -> f (Maybe InstanceStatus))
-> Instance -> f Instance
instance_instanceStatus = (Instance -> Maybe InstanceStatus)
-> (Instance -> Maybe InstanceStatus -> Instance)
-> Lens
Instance Instance (Maybe InstanceStatus) (Maybe InstanceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe InstanceStatus
instanceStatus :: Maybe InstanceStatus
$sel:instanceStatus:Instance' :: Instance -> Maybe InstanceStatus
instanceStatus} -> Maybe InstanceStatus
instanceStatus) (\s :: Instance
s@Instance' {} Maybe InstanceStatus
a -> Instance
s {$sel:instanceStatus:Instance' :: Maybe InstanceStatus
instanceStatus = Maybe InstanceStatus
a} :: Instance)
instance_identityManagementType :: Lens.Lens' Instance (Prelude.Maybe DirectoryType)
instance_identityManagementType :: (Maybe DirectoryType -> f (Maybe DirectoryType))
-> Instance -> f Instance
instance_identityManagementType = (Instance -> Maybe DirectoryType)
-> (Instance -> Maybe DirectoryType -> Instance)
-> Lens
Instance Instance (Maybe DirectoryType) (Maybe DirectoryType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe DirectoryType
identityManagementType :: Maybe DirectoryType
$sel:identityManagementType:Instance' :: Instance -> Maybe DirectoryType
identityManagementType} -> Maybe DirectoryType
identityManagementType) (\s :: Instance
s@Instance' {} Maybe DirectoryType
a -> Instance
s {$sel:identityManagementType:Instance' :: Maybe DirectoryType
identityManagementType = Maybe DirectoryType
a} :: Instance)
instance_statusReason :: Lens.Lens' Instance (Prelude.Maybe InstanceStatusReason)
instance_statusReason :: (Maybe InstanceStatusReason -> f (Maybe InstanceStatusReason))
-> Instance -> f Instance
instance_statusReason = (Instance -> Maybe InstanceStatusReason)
-> (Instance -> Maybe InstanceStatusReason -> Instance)
-> Lens
Instance
Instance
(Maybe InstanceStatusReason)
(Maybe InstanceStatusReason)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe InstanceStatusReason
statusReason :: Maybe InstanceStatusReason
$sel:statusReason:Instance' :: Instance -> Maybe InstanceStatusReason
statusReason} -> Maybe InstanceStatusReason
statusReason) (\s :: Instance
s@Instance' {} Maybe InstanceStatusReason
a -> Instance
s {$sel:statusReason:Instance' :: Maybe InstanceStatusReason
statusReason = Maybe InstanceStatusReason
a} :: Instance)
instance_serviceRole :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_serviceRole :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_serviceRole = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
serviceRole :: Maybe Text
$sel:serviceRole:Instance' :: Instance -> Maybe Text
serviceRole} -> Maybe Text
serviceRole) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:serviceRole:Instance' :: Maybe Text
serviceRole = Maybe Text
a} :: Instance)
instance Core.FromJSON Instance where
parseJSON :: Value -> Parser Instance
parseJSON =
String -> (Object -> Parser Instance) -> Value -> Parser Instance
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Instance"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance
Instance'
(Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Bool
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
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 POSIX
-> Maybe Bool
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Bool
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTime")
Parser
(Maybe Bool
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
-> Parser (Maybe Bool)
-> Parser
(Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OutboundCallsEnabled")
Parser
(Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
-> Parser (Maybe Bool)
-> Parser
(Maybe (Sensitive Text)
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InboundCallsEnabled")
Parser
(Maybe (Sensitive Text)
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceAlias")
Parser
(Maybe Text
-> Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
-> Parser (Maybe Text)
-> Parser
(Maybe InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
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 InstanceStatus
-> Maybe DirectoryType
-> Maybe InstanceStatusReason
-> Maybe Text
-> Instance)
-> Parser (Maybe InstanceStatus)
-> Parser
(Maybe DirectoryType
-> Maybe InstanceStatusReason -> Maybe Text -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InstanceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceStatus")
Parser
(Maybe DirectoryType
-> Maybe InstanceStatusReason -> Maybe Text -> Instance)
-> Parser (Maybe DirectoryType)
-> Parser (Maybe InstanceStatusReason -> Maybe Text -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DirectoryType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IdentityManagementType")
Parser (Maybe InstanceStatusReason -> Maybe Text -> Instance)
-> Parser (Maybe InstanceStatusReason)
-> Parser (Maybe Text -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InstanceStatusReason)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatusReason")
Parser (Maybe Text -> Instance)
-> Parser (Maybe Text) -> Parser Instance
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
"ServiceRole")
)
instance Prelude.Hashable Instance
instance Prelude.NFData Instance