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

import Amazonka.Chime.Types.AlexaForBusinessMetadata
import Amazonka.Chime.Types.InviteStatus
import Amazonka.Chime.Types.License
import Amazonka.Chime.Types.RegistrationStatus
import Amazonka.Chime.Types.UserType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The user on the Amazon Chime account.
--
-- /See:/ 'newUser' smart constructor.
data User = User'
  { -- | The user invite status.
    User -> Maybe InviteStatus
userInvitationStatus :: Prelude.Maybe InviteStatus,
    -- | The user\'s personal meeting PIN.
    User -> Maybe Text
personalPIN :: Prelude.Maybe Prelude.Text,
    -- | The primary phone number associated with the user.
    User -> Maybe (Sensitive Text)
primaryProvisionedNumber :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The license type for the user.
    User -> Maybe License
licenseType :: Prelude.Maybe License,
    -- | Date and time when the user is registered, in ISO 8601 format.
    User -> Maybe POSIX
registeredOn :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Chime account ID.
    User -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | The user registration status.
    User -> Maybe RegistrationStatus
userRegistrationStatus :: Prelude.Maybe RegistrationStatus,
    -- | Date and time when the user is invited to the Amazon Chime account, in
    -- ISO 8601 format.
    User -> Maybe POSIX
invitedOn :: Prelude.Maybe Core.POSIX,
    -- | The display name of the user.
    User -> Maybe (Sensitive Text)
displayName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The primary email address of the user.
    User -> Maybe (Sensitive Text)
primaryEmail :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The user type.
    User -> Maybe UserType
userType :: Prelude.Maybe UserType,
    -- | The Alexa for Business metadata.
    User -> Maybe AlexaForBusinessMetadata
alexaForBusinessMetadata :: Prelude.Maybe AlexaForBusinessMetadata,
    -- | The user ID.
    User -> Text
userId :: 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, 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:
--
-- 'userInvitationStatus', 'user_userInvitationStatus' - The user invite status.
--
-- 'personalPIN', 'user_personalPIN' - The user\'s personal meeting PIN.
--
-- 'primaryProvisionedNumber', 'user_primaryProvisionedNumber' - The primary phone number associated with the user.
--
-- 'licenseType', 'user_licenseType' - The license type for the user.
--
-- 'registeredOn', 'user_registeredOn' - Date and time when the user is registered, in ISO 8601 format.
--
-- 'accountId', 'user_accountId' - The Amazon Chime account ID.
--
-- 'userRegistrationStatus', 'user_userRegistrationStatus' - The user registration status.
--
-- 'invitedOn', 'user_invitedOn' - Date and time when the user is invited to the Amazon Chime account, in
-- ISO 8601 format.
--
-- 'displayName', 'user_displayName' - The display name of the user.
--
-- 'primaryEmail', 'user_primaryEmail' - The primary email address of the user.
--
-- 'userType', 'user_userType' - The user type.
--
-- 'alexaForBusinessMetadata', 'user_alexaForBusinessMetadata' - The Alexa for Business metadata.
--
-- 'userId', 'user_userId' - The user ID.
newUser ::
  -- | 'userId'
  Prelude.Text ->
  User
newUser :: Text -> User
newUser Text
pUserId_ =
  User' :: Maybe InviteStatus
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe License
-> Maybe POSIX
-> Maybe Text
-> Maybe RegistrationStatus
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe UserType
-> Maybe AlexaForBusinessMetadata
-> Text
-> User
User'
    { $sel:userInvitationStatus:User' :: Maybe InviteStatus
userInvitationStatus = Maybe InviteStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:personalPIN:User' :: Maybe Text
personalPIN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:primaryProvisionedNumber:User' :: Maybe (Sensitive Text)
primaryProvisionedNumber = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:licenseType:User' :: Maybe License
licenseType = Maybe License
forall a. Maybe a
Prelude.Nothing,
      $sel:registeredOn:User' :: Maybe POSIX
registeredOn = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:User' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userRegistrationStatus:User' :: Maybe RegistrationStatus
userRegistrationStatus = Maybe RegistrationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:invitedOn:User' :: Maybe POSIX
invitedOn = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:User' :: Maybe (Sensitive Text)
displayName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:primaryEmail:User' :: Maybe (Sensitive Text)
primaryEmail = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:userType:User' :: Maybe UserType
userType = Maybe UserType
forall a. Maybe a
Prelude.Nothing,
      $sel:alexaForBusinessMetadata:User' :: Maybe AlexaForBusinessMetadata
alexaForBusinessMetadata = Maybe AlexaForBusinessMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:userId:User' :: Text
userId = Text
pUserId_
    }

-- | The user invite status.
user_userInvitationStatus :: Lens.Lens' User (Prelude.Maybe InviteStatus)
user_userInvitationStatus :: (Maybe InviteStatus -> f (Maybe InviteStatus)) -> User -> f User
user_userInvitationStatus = (User -> Maybe InviteStatus)
-> (User -> Maybe InviteStatus -> User)
-> Lens User User (Maybe InviteStatus) (Maybe InviteStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe InviteStatus
userInvitationStatus :: Maybe InviteStatus
$sel:userInvitationStatus:User' :: User -> Maybe InviteStatus
userInvitationStatus} -> Maybe InviteStatus
userInvitationStatus) (\s :: User
s@User' {} Maybe InviteStatus
a -> User
s {$sel:userInvitationStatus:User' :: Maybe InviteStatus
userInvitationStatus = Maybe InviteStatus
a} :: User)

-- | The user\'s personal meeting PIN.
user_personalPIN :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_personalPIN :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_personalPIN = (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
personalPIN :: Maybe Text
$sel:personalPIN:User' :: User -> Maybe Text
personalPIN} -> Maybe Text
personalPIN) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:personalPIN:User' :: Maybe Text
personalPIN = Maybe Text
a} :: User)

-- | The primary phone number associated with the user.
user_primaryProvisionedNumber :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_primaryProvisionedNumber :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_primaryProvisionedNumber = (User -> Maybe (Sensitive Text))
-> (User -> Maybe (Sensitive Text) -> User)
-> Lens User User (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe (Sensitive Text)
primaryProvisionedNumber :: Maybe (Sensitive Text)
$sel:primaryProvisionedNumber:User' :: User -> Maybe (Sensitive Text)
primaryProvisionedNumber} -> Maybe (Sensitive Text)
primaryProvisionedNumber) (\s :: User
s@User' {} Maybe (Sensitive Text)
a -> User
s {$sel:primaryProvisionedNumber:User' :: Maybe (Sensitive Text)
primaryProvisionedNumber = Maybe (Sensitive Text)
a} :: User) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> User -> f User)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> User
-> f User
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

-- | The license type for the user.
user_licenseType :: Lens.Lens' User (Prelude.Maybe License)
user_licenseType :: (Maybe License -> f (Maybe License)) -> User -> f User
user_licenseType = (User -> Maybe License)
-> (User -> Maybe License -> User)
-> Lens User User (Maybe License) (Maybe License)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe License
licenseType :: Maybe License
$sel:licenseType:User' :: User -> Maybe License
licenseType} -> Maybe License
licenseType) (\s :: User
s@User' {} Maybe License
a -> User
s {$sel:licenseType:User' :: Maybe License
licenseType = Maybe License
a} :: User)

-- | Date and time when the user is registered, in ISO 8601 format.
user_registeredOn :: Lens.Lens' User (Prelude.Maybe Prelude.UTCTime)
user_registeredOn :: (Maybe UTCTime -> f (Maybe UTCTime)) -> User -> f User
user_registeredOn = (User -> Maybe POSIX)
-> (User -> Maybe POSIX -> User)
-> Lens User User (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe POSIX
registeredOn :: Maybe POSIX
$sel:registeredOn:User' :: User -> Maybe POSIX
registeredOn} -> Maybe POSIX
registeredOn) (\s :: User
s@User' {} Maybe POSIX
a -> User
s {$sel:registeredOn:User' :: Maybe POSIX
registeredOn = Maybe POSIX
a} :: User) ((Maybe POSIX -> f (Maybe POSIX)) -> User -> f User)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> User
-> f User
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

-- | The Amazon Chime account ID.
user_accountId :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_accountId :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_accountId = (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
accountId :: Maybe Text
$sel:accountId:User' :: User -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:accountId:User' :: Maybe Text
accountId = Maybe Text
a} :: User)

-- | The user registration status.
user_userRegistrationStatus :: Lens.Lens' User (Prelude.Maybe RegistrationStatus)
user_userRegistrationStatus :: (Maybe RegistrationStatus -> f (Maybe RegistrationStatus))
-> User -> f User
user_userRegistrationStatus = (User -> Maybe RegistrationStatus)
-> (User -> Maybe RegistrationStatus -> User)
-> Lens
     User User (Maybe RegistrationStatus) (Maybe RegistrationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe RegistrationStatus
userRegistrationStatus :: Maybe RegistrationStatus
$sel:userRegistrationStatus:User' :: User -> Maybe RegistrationStatus
userRegistrationStatus} -> Maybe RegistrationStatus
userRegistrationStatus) (\s :: User
s@User' {} Maybe RegistrationStatus
a -> User
s {$sel:userRegistrationStatus:User' :: Maybe RegistrationStatus
userRegistrationStatus = Maybe RegistrationStatus
a} :: User)

-- | Date and time when the user is invited to the Amazon Chime account, in
-- ISO 8601 format.
user_invitedOn :: Lens.Lens' User (Prelude.Maybe Prelude.UTCTime)
user_invitedOn :: (Maybe UTCTime -> f (Maybe UTCTime)) -> User -> f User
user_invitedOn = (User -> Maybe POSIX)
-> (User -> Maybe POSIX -> User)
-> Lens User User (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe POSIX
invitedOn :: Maybe POSIX
$sel:invitedOn:User' :: User -> Maybe POSIX
invitedOn} -> Maybe POSIX
invitedOn) (\s :: User
s@User' {} Maybe POSIX
a -> User
s {$sel:invitedOn:User' :: Maybe POSIX
invitedOn = Maybe POSIX
a} :: User) ((Maybe POSIX -> f (Maybe POSIX)) -> User -> f User)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> User
-> f User
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

-- | The display name of the user.
user_displayName :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_displayName :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_displayName = (User -> Maybe (Sensitive Text))
-> (User -> Maybe (Sensitive Text) -> User)
-> Lens User User (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe (Sensitive Text)
displayName :: Maybe (Sensitive Text)
$sel:displayName:User' :: User -> Maybe (Sensitive Text)
displayName} -> Maybe (Sensitive Text)
displayName) (\s :: User
s@User' {} Maybe (Sensitive Text)
a -> User
s {$sel:displayName:User' :: Maybe (Sensitive Text)
displayName = Maybe (Sensitive Text)
a} :: User) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> User -> f User)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> User
-> f User
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

-- | The primary email address of the user.
user_primaryEmail :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_primaryEmail :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_primaryEmail = (User -> Maybe (Sensitive Text))
-> (User -> Maybe (Sensitive Text) -> User)
-> Lens User User (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe (Sensitive Text)
primaryEmail :: Maybe (Sensitive Text)
$sel:primaryEmail:User' :: User -> Maybe (Sensitive Text)
primaryEmail} -> Maybe (Sensitive Text)
primaryEmail) (\s :: User
s@User' {} Maybe (Sensitive Text)
a -> User
s {$sel:primaryEmail:User' :: Maybe (Sensitive Text)
primaryEmail = Maybe (Sensitive Text)
a} :: User) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> User -> f User)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> User
-> f User
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

-- | The user type.
user_userType :: Lens.Lens' User (Prelude.Maybe UserType)
user_userType :: (Maybe UserType -> f (Maybe UserType)) -> User -> f User
user_userType = (User -> Maybe UserType)
-> (User -> Maybe UserType -> User)
-> Lens User User (Maybe UserType) (Maybe UserType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe UserType
userType :: Maybe UserType
$sel:userType:User' :: User -> Maybe UserType
userType} -> Maybe UserType
userType) (\s :: User
s@User' {} Maybe UserType
a -> User
s {$sel:userType:User' :: Maybe UserType
userType = Maybe UserType
a} :: User)

-- | The Alexa for Business metadata.
user_alexaForBusinessMetadata :: Lens.Lens' User (Prelude.Maybe AlexaForBusinessMetadata)
user_alexaForBusinessMetadata :: (Maybe AlexaForBusinessMetadata
 -> f (Maybe AlexaForBusinessMetadata))
-> User -> f User
user_alexaForBusinessMetadata = (User -> Maybe AlexaForBusinessMetadata)
-> (User -> Maybe AlexaForBusinessMetadata -> User)
-> Lens
     User
     User
     (Maybe AlexaForBusinessMetadata)
     (Maybe AlexaForBusinessMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe AlexaForBusinessMetadata
alexaForBusinessMetadata :: Maybe AlexaForBusinessMetadata
$sel:alexaForBusinessMetadata:User' :: User -> Maybe AlexaForBusinessMetadata
alexaForBusinessMetadata} -> Maybe AlexaForBusinessMetadata
alexaForBusinessMetadata) (\s :: User
s@User' {} Maybe AlexaForBusinessMetadata
a -> User
s {$sel:alexaForBusinessMetadata:User' :: Maybe AlexaForBusinessMetadata
alexaForBusinessMetadata = Maybe AlexaForBusinessMetadata
a} :: User)

-- | The user ID.
user_userId :: Lens.Lens' User Prelude.Text
user_userId :: (Text -> f Text) -> User -> f User
user_userId = (User -> Text)
-> (User -> Text -> User) -> Lens User User Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Text
userId :: Text
$sel:userId:User' :: User -> Text
userId} -> Text
userId) (\s :: User
s@User' {} Text
a -> User
s {$sel:userId:User' :: Text
userId = Text
a} :: User)

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 InviteStatus
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe License
-> Maybe POSIX
-> Maybe Text
-> Maybe RegistrationStatus
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe UserType
-> Maybe AlexaForBusinessMetadata
-> Text
-> User
User'
            (Maybe InviteStatus
 -> Maybe Text
 -> Maybe (Sensitive Text)
 -> Maybe License
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe RegistrationStatus
 -> Maybe POSIX
 -> Maybe (Sensitive Text)
 -> Maybe (Sensitive Text)
 -> Maybe UserType
 -> Maybe AlexaForBusinessMetadata
 -> Text
 -> User)
-> Parser (Maybe InviteStatus)
-> Parser
     (Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe License
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe RegistrationStatus
      -> Maybe POSIX
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe UserType
      -> Maybe AlexaForBusinessMetadata
      -> Text
      -> User)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InviteStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserInvitationStatus")
            Parser
  (Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe License
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe RegistrationStatus
   -> Maybe POSIX
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe UserType
   -> Maybe AlexaForBusinessMetadata
   -> Text
   -> User)
-> Parser (Maybe Text)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe License
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe RegistrationStatus
      -> Maybe POSIX
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe UserType
      -> Maybe AlexaForBusinessMetadata
      -> 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
"PersonalPIN")
            Parser
  (Maybe (Sensitive Text)
   -> Maybe License
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe RegistrationStatus
   -> Maybe POSIX
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe UserType
   -> Maybe AlexaForBusinessMetadata
   -> Text
   -> User)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe License
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe RegistrationStatus
      -> Maybe POSIX
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe UserType
      -> Maybe AlexaForBusinessMetadata
      -> Text
      -> User)
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
"PrimaryProvisionedNumber")
            Parser
  (Maybe License
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe RegistrationStatus
   -> Maybe POSIX
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe UserType
   -> Maybe AlexaForBusinessMetadata
   -> Text
   -> User)
-> Parser (Maybe License)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe RegistrationStatus
      -> Maybe POSIX
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe UserType
      -> Maybe AlexaForBusinessMetadata
      -> Text
      -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe License)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LicenseType")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe RegistrationStatus
   -> Maybe POSIX
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe UserType
   -> Maybe AlexaForBusinessMetadata
   -> Text
   -> User)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe RegistrationStatus
      -> Maybe POSIX
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe UserType
      -> Maybe AlexaForBusinessMetadata
      -> Text
      -> User)
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
"RegisteredOn")
            Parser
  (Maybe Text
   -> Maybe RegistrationStatus
   -> Maybe POSIX
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe UserType
   -> Maybe AlexaForBusinessMetadata
   -> Text
   -> User)
-> Parser (Maybe Text)
-> Parser
     (Maybe RegistrationStatus
      -> Maybe POSIX
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe UserType
      -> Maybe AlexaForBusinessMetadata
      -> 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
"AccountId")
            Parser
  (Maybe RegistrationStatus
   -> Maybe POSIX
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe UserType
   -> Maybe AlexaForBusinessMetadata
   -> Text
   -> User)
-> Parser (Maybe RegistrationStatus)
-> Parser
     (Maybe POSIX
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe UserType
      -> Maybe AlexaForBusinessMetadata
      -> Text
      -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RegistrationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserRegistrationStatus")
            Parser
  (Maybe POSIX
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe UserType
   -> Maybe AlexaForBusinessMetadata
   -> Text
   -> User)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe UserType
      -> Maybe AlexaForBusinessMetadata
      -> Text
      -> User)
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
"InvitedOn")
            Parser
  (Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe UserType
   -> Maybe AlexaForBusinessMetadata
   -> Text
   -> User)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe UserType
      -> Maybe AlexaForBusinessMetadata
      -> Text
      -> User)
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
"DisplayName")
            Parser
  (Maybe (Sensitive Text)
   -> Maybe UserType
   -> Maybe AlexaForBusinessMetadata
   -> Text
   -> User)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe UserType -> Maybe AlexaForBusinessMetadata -> Text -> User)
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
"PrimaryEmail")
            Parser
  (Maybe UserType -> Maybe AlexaForBusinessMetadata -> Text -> User)
-> Parser (Maybe UserType)
-> Parser (Maybe AlexaForBusinessMetadata -> Text -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UserType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserType")
            Parser (Maybe AlexaForBusinessMetadata -> Text -> User)
-> Parser (Maybe AlexaForBusinessMetadata) -> Parser (Text -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AlexaForBusinessMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AlexaForBusinessMetadata")
            Parser (Text -> User) -> Parser Text -> Parser User
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"UserId")
      )

instance Prelude.Hashable User

instance Prelude.NFData User