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

import Amazonka.Connect.Types.UserIdentityInfo
import Amazonka.Connect.Types.UserPhoneConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about a user account for a Amazon Connect instance.
--
-- /See:/ 'newUser' smart constructor.
data User = User'
  { -- | The identifier of the routing profile for the user.
    User -> Maybe Text
routingProfileId :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the user account in the directory used for identity
    -- management.
    User -> Maybe Text
directoryUserId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the user account.
    User -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Information about the user identity.
    User -> Maybe UserIdentityInfo
identityInfo :: Prelude.Maybe UserIdentityInfo,
    -- | The identifiers of the security profiles for the user.
    User -> Maybe (NonEmpty Text)
securityProfileIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The user name assigned to the user account.
    User -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the user account.
    User -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the hierarchy group for the user.
    User -> Maybe Text
hierarchyGroupId :: Prelude.Maybe Prelude.Text,
    -- | Information about the phone configuration for the user.
    User -> Maybe UserPhoneConfig
phoneConfig :: Prelude.Maybe UserPhoneConfig,
    -- | The tags.
    User -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (User -> User -> Bool
(User -> User -> Bool) -> (User -> User -> Bool) -> Eq User
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: User -> User -> Bool
$c/= :: User -> User -> Bool
== :: User -> User -> Bool
$c== :: User -> User -> Bool
Prelude.Eq, ReadPrec [User]
ReadPrec User
Int -> ReadS User
ReadS [User]
(Int -> ReadS User)
-> ReadS [User] -> ReadPrec User -> ReadPrec [User] -> Read User
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [User]
$creadListPrec :: ReadPrec [User]
readPrec :: ReadPrec User
$creadPrec :: ReadPrec User
readList :: ReadS [User]
$creadList :: ReadS [User]
readsPrec :: Int -> ReadS User
$creadsPrec :: Int -> ReadS User
Prelude.Read, Int -> User -> ShowS
[User] -> ShowS
User -> String
(Int -> User -> ShowS)
-> (User -> String) -> ([User] -> ShowS) -> Show User
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [User] -> ShowS
$cshowList :: [User] -> ShowS
show :: User -> String
$cshow :: User -> String
showsPrec :: Int -> User -> ShowS
$cshowsPrec :: Int -> User -> ShowS
Prelude.Show, (forall x. User -> Rep User x)
-> (forall x. Rep User x -> User) -> Generic User
forall x. Rep User x -> User
forall x. User -> Rep User x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep User x -> User
$cfrom :: forall x. User -> Rep User x
Prelude.Generic)

-- |
-- Create a value of 'User' 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:
--
-- 'routingProfileId', 'user_routingProfileId' - The identifier of the routing profile for the user.
--
-- 'directoryUserId', 'user_directoryUserId' - The identifier of the user account in the directory used for identity
-- management.
--
-- 'arn', 'user_arn' - The Amazon Resource Name (ARN) of the user account.
--
-- 'identityInfo', 'user_identityInfo' - Information about the user identity.
--
-- 'securityProfileIds', 'user_securityProfileIds' - The identifiers of the security profiles for the user.
--
-- 'username', 'user_username' - The user name assigned to the user account.
--
-- 'id', 'user_id' - The identifier of the user account.
--
-- 'hierarchyGroupId', 'user_hierarchyGroupId' - The identifier of the hierarchy group for the user.
--
-- 'phoneConfig', 'user_phoneConfig' - Information about the phone configuration for the user.
--
-- 'tags', 'user_tags' - The tags.
newUser ::
  User
newUser :: User
newUser =
  User' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe UserIdentityInfo
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe UserPhoneConfig
-> Maybe (HashMap Text Text)
-> User
User'
    { $sel:routingProfileId:User' :: Maybe Text
routingProfileId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:directoryUserId:User' :: Maybe Text
directoryUserId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:User' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:identityInfo:User' :: Maybe UserIdentityInfo
identityInfo = Maybe UserIdentityInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:securityProfileIds:User' :: Maybe (NonEmpty Text)
securityProfileIds = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:username:User' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:User' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hierarchyGroupId:User' :: Maybe Text
hierarchyGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:phoneConfig:User' :: Maybe UserPhoneConfig
phoneConfig = Maybe UserPhoneConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:User' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the routing profile for the user.
user_routingProfileId :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_routingProfileId :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_routingProfileId = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
routingProfileId :: Maybe Text
$sel:routingProfileId:User' :: User -> Maybe Text
routingProfileId} -> Maybe Text
routingProfileId) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:routingProfileId:User' :: Maybe Text
routingProfileId = Maybe Text
a} :: User)

-- | The identifier of the user account in the directory used for identity
-- management.
user_directoryUserId :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_directoryUserId :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_directoryUserId = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
directoryUserId :: Maybe Text
$sel:directoryUserId:User' :: User -> Maybe Text
directoryUserId} -> Maybe Text
directoryUserId) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:directoryUserId:User' :: Maybe Text
directoryUserId = Maybe Text
a} :: User)

-- | The Amazon Resource Name (ARN) of the user account.
user_arn :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_arn :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_arn = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
arn :: Maybe Text
$sel:arn:User' :: User -> Maybe Text
arn} -> Maybe Text
arn) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:arn:User' :: Maybe Text
arn = Maybe Text
a} :: User)

-- | Information about the user identity.
user_identityInfo :: Lens.Lens' User (Prelude.Maybe UserIdentityInfo)
user_identityInfo :: (Maybe UserIdentityInfo -> f (Maybe UserIdentityInfo))
-> User -> f User
user_identityInfo = (User -> Maybe UserIdentityInfo)
-> (User -> Maybe UserIdentityInfo -> User)
-> Lens User User (Maybe UserIdentityInfo) (Maybe UserIdentityInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe UserIdentityInfo
identityInfo :: Maybe UserIdentityInfo
$sel:identityInfo:User' :: User -> Maybe UserIdentityInfo
identityInfo} -> Maybe UserIdentityInfo
identityInfo) (\s :: User
s@User' {} Maybe UserIdentityInfo
a -> User
s {$sel:identityInfo:User' :: Maybe UserIdentityInfo
identityInfo = Maybe UserIdentityInfo
a} :: User)

-- | The identifiers of the security profiles for the user.
user_securityProfileIds :: Lens.Lens' User (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
user_securityProfileIds :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> User -> f User
user_securityProfileIds = (User -> Maybe (NonEmpty Text))
-> (User -> Maybe (NonEmpty Text) -> User)
-> Lens User User (Maybe (NonEmpty Text)) (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe (NonEmpty Text)
securityProfileIds :: Maybe (NonEmpty Text)
$sel:securityProfileIds:User' :: User -> Maybe (NonEmpty Text)
securityProfileIds} -> Maybe (NonEmpty Text)
securityProfileIds) (\s :: User
s@User' {} Maybe (NonEmpty Text)
a -> User
s {$sel:securityProfileIds:User' :: Maybe (NonEmpty Text)
securityProfileIds = Maybe (NonEmpty Text)
a} :: User) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> User -> f User)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> User
-> f User
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The user name assigned to the user account.
user_username :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_username :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_username = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
username :: Maybe Text
$sel:username:User' :: User -> Maybe Text
username} -> Maybe Text
username) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:username:User' :: Maybe Text
username = Maybe Text
a} :: User)

-- | The identifier of the user account.
user_id :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_id :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_id = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
id :: Maybe Text
$sel:id:User' :: User -> Maybe Text
id} -> Maybe Text
id) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:id:User' :: Maybe Text
id = Maybe Text
a} :: User)

-- | The identifier of the hierarchy group for the user.
user_hierarchyGroupId :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_hierarchyGroupId :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_hierarchyGroupId = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
hierarchyGroupId :: Maybe Text
$sel:hierarchyGroupId:User' :: User -> Maybe Text
hierarchyGroupId} -> Maybe Text
hierarchyGroupId) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:hierarchyGroupId:User' :: Maybe Text
hierarchyGroupId = Maybe Text
a} :: User)

-- | Information about the phone configuration for the user.
user_phoneConfig :: Lens.Lens' User (Prelude.Maybe UserPhoneConfig)
user_phoneConfig :: (Maybe UserPhoneConfig -> f (Maybe UserPhoneConfig))
-> User -> f User
user_phoneConfig = (User -> Maybe UserPhoneConfig)
-> (User -> Maybe UserPhoneConfig -> User)
-> Lens User User (Maybe UserPhoneConfig) (Maybe UserPhoneConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe UserPhoneConfig
phoneConfig :: Maybe UserPhoneConfig
$sel:phoneConfig:User' :: User -> Maybe UserPhoneConfig
phoneConfig} -> Maybe UserPhoneConfig
phoneConfig) (\s :: User
s@User' {} Maybe UserPhoneConfig
a -> User
s {$sel:phoneConfig:User' :: Maybe UserPhoneConfig
phoneConfig = Maybe UserPhoneConfig
a} :: User)

-- | The tags.
user_tags :: Lens.Lens' User (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
user_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> User -> f User
user_tags = (User -> Maybe (HashMap Text Text))
-> (User -> Maybe (HashMap Text Text) -> User)
-> Lens
     User User (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 (\User' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:User' :: User -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: User
s@User' {} Maybe (HashMap Text Text)
a -> User
s {$sel:tags:User' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: User) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> User -> f User)
-> ((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)))
-> User
-> f User
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 User where
  parseJSON :: Value -> Parser User
parseJSON =
    String -> (Object -> Parser User) -> Value -> Parser User
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"User"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe UserIdentityInfo
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe UserPhoneConfig
-> Maybe (HashMap Text Text)
-> User
User'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe UserIdentityInfo
 -> Maybe (NonEmpty Text)
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe UserPhoneConfig
 -> Maybe (HashMap Text Text)
 -> User)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe UserIdentityInfo
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe UserPhoneConfig
      -> Maybe (HashMap Text Text)
      -> User)
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
"RoutingProfileId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe UserIdentityInfo
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe UserPhoneConfig
   -> Maybe (HashMap Text Text)
   -> User)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe UserIdentityInfo
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe UserPhoneConfig
      -> Maybe (HashMap Text Text)
      -> User)
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
"DirectoryUserId")
            Parser
  (Maybe Text
   -> Maybe UserIdentityInfo
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe UserPhoneConfig
   -> Maybe (HashMap Text Text)
   -> User)
-> Parser (Maybe Text)
-> Parser
     (Maybe UserIdentityInfo
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe UserPhoneConfig
      -> Maybe (HashMap Text Text)
      -> User)
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
"Arn")
            Parser
  (Maybe UserIdentityInfo
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe UserPhoneConfig
   -> Maybe (HashMap Text Text)
   -> User)
-> Parser (Maybe UserIdentityInfo)
-> Parser
     (Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe UserPhoneConfig
      -> Maybe (HashMap Text Text)
      -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UserIdentityInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IdentityInfo")
            Parser
  (Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe UserPhoneConfig
   -> Maybe (HashMap Text Text)
   -> User)
-> Parser (Maybe (NonEmpty Text))
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe UserPhoneConfig
      -> Maybe (HashMap Text Text)
      -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SecurityProfileIds")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe UserPhoneConfig
   -> Maybe (HashMap Text Text)
   -> User)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe UserPhoneConfig
      -> Maybe (HashMap Text Text)
      -> User)
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
"Username")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe UserPhoneConfig
   -> Maybe (HashMap Text Text)
   -> User)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe UserPhoneConfig -> Maybe (HashMap Text Text) -> User)
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 Text
   -> Maybe UserPhoneConfig -> Maybe (HashMap Text Text) -> User)
-> Parser (Maybe Text)
-> Parser
     (Maybe UserPhoneConfig -> Maybe (HashMap Text Text) -> User)
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
"HierarchyGroupId")
            Parser (Maybe UserPhoneConfig -> Maybe (HashMap Text Text) -> User)
-> Parser (Maybe UserPhoneConfig)
-> Parser (Maybe (HashMap Text Text) -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UserPhoneConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PhoneConfig")
            Parser (Maybe (HashMap Text Text) -> User)
-> Parser (Maybe (HashMap Text Text)) -> Parser User
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 User

instance Prelude.NFData User