{-# 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.Transfer.Types.DescribedUser
-- 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.Transfer.Types.DescribedUser where

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
import Amazonka.Transfer.Types.HomeDirectoryMapEntry
import Amazonka.Transfer.Types.HomeDirectoryType
import Amazonka.Transfer.Types.PosixProfile
import Amazonka.Transfer.Types.SshPublicKey
import Amazonka.Transfer.Types.Tag

-- | Describes the properties of a user that was specified.
--
-- /See:/ 'newDescribedUser' smart constructor.
data DescribedUser = DescribedUser'
  { -- | The landing directory (folder) for a user when they log in to the server
    -- using the client.
    --
    -- A @HomeDirectory@ example is @\/bucket_name\/home\/mydirectory@.
    DescribedUser -> Maybe Text
homeDirectory :: Prelude.Maybe Prelude.Text,
    -- | Logical directory mappings that specify what Amazon S3 or Amazon EFS
    -- paths and keys should be visible to your user and how you want to make
    -- them visible. You must specify the @Entry@ and @Target@ pair, where
    -- @Entry@ shows how the path is made visible and @Target@ is the actual
    -- Amazon S3 or Amazon EFS path. If you only specify a target, it is
    -- displayed as is. You also must ensure that your Identity and Access
    -- Management (IAM) role provides access to paths in @Target@. This value
    -- can be set only when @HomeDirectoryType@ is set to /LOGICAL/.
    --
    -- In most cases, you can use this value instead of the session policy to
    -- lock your user down to the designated home directory (\"@chroot@\"). To
    -- do this, you can set @Entry@ to \'\/\' and set @Target@ to the
    -- HomeDirectory parameter value.
    DescribedUser -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings :: Prelude.Maybe (Prelude.NonEmpty HomeDirectoryMapEntry),
    -- | The type of landing directory (folder) that you want your users\' home
    -- directory to be when they log in to the server. If you set it to @PATH@,
    -- the user will see the absolute Amazon S3 bucket or EFS paths as is in
    -- their file transfer protocol clients. If you set it @LOGICAL@, you need
    -- to provide mappings in the @HomeDirectoryMappings@ for how you want to
    -- make Amazon S3 or Amazon EFS paths visible to your users.
    DescribedUser -> Maybe HomeDirectoryType
homeDirectoryType :: Prelude.Maybe HomeDirectoryType,
    -- | A session policy for your user so that you can use the same Identity and
    -- Access Management (IAM) role across multiple users. This policy scopes
    -- down a user\'s access to portions of their Amazon S3 bucket. Variables
    -- that you can use inside this policy include @${Transfer:UserName}@,
    -- @${Transfer:HomeDirectory}@, and @${Transfer:HomeBucket}@.
    DescribedUser -> Maybe Text
policy :: Prelude.Maybe Prelude.Text,
    -- | Specifies the full POSIX identity, including user ID (@Uid@), group ID
    -- (@Gid@), and any secondary groups IDs (@SecondaryGids@), that controls
    -- your users\' access to your Amazon Elastic File System (Amazon EFS) file
    -- systems. The POSIX permissions that are set on files and directories in
    -- your file system determine the level of access your users get when
    -- transferring files into and out of your Amazon EFS file systems.
    DescribedUser -> Maybe PosixProfile
posixProfile :: Prelude.Maybe PosixProfile,
    -- | The Amazon Resource Name (ARN) of the Identity and Access Management
    -- (IAM) role that controls your users\' access to your Amazon S3 bucket or
    -- Amazon EFS file system. The policies attached to this role determine the
    -- level of access that you want to provide your users when transferring
    -- files into and out of your Amazon S3 bucket or Amazon EFS file system.
    -- The IAM role should also contain a trust relationship that allows the
    -- server to access your resources when servicing your users\' transfer
    -- requests.
    DescribedUser -> Maybe Text
role' :: Prelude.Maybe Prelude.Text,
    -- | Specifies the public key portion of the Secure Shell (SSH) keys stored
    -- for the described user.
    DescribedUser -> Maybe [SshPublicKey]
sshPublicKeys :: Prelude.Maybe [SshPublicKey],
    -- | Specifies the key-value pairs for the user requested. Tag can be used to
    -- search for and group users for a variety of purposes.
    DescribedUser -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | Specifies the name of the user that was requested to be described. User
    -- names are used for authentication purposes. This is the string that will
    -- be used by your user when they log in to your server.
    DescribedUser -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
    -- | Specifies the unique Amazon Resource Name (ARN) for the user that was
    -- requested to be described.
    DescribedUser -> Text
arn :: Prelude.Text
  }
  deriving (DescribedUser -> DescribedUser -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribedUser -> DescribedUser -> Bool
$c/= :: DescribedUser -> DescribedUser -> Bool
== :: DescribedUser -> DescribedUser -> Bool
$c== :: DescribedUser -> DescribedUser -> Bool
Prelude.Eq, ReadPrec [DescribedUser]
ReadPrec DescribedUser
Int -> ReadS DescribedUser
ReadS [DescribedUser]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribedUser]
$creadListPrec :: ReadPrec [DescribedUser]
readPrec :: ReadPrec DescribedUser
$creadPrec :: ReadPrec DescribedUser
readList :: ReadS [DescribedUser]
$creadList :: ReadS [DescribedUser]
readsPrec :: Int -> ReadS DescribedUser
$creadsPrec :: Int -> ReadS DescribedUser
Prelude.Read, Int -> DescribedUser -> ShowS
[DescribedUser] -> ShowS
DescribedUser -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribedUser] -> ShowS
$cshowList :: [DescribedUser] -> ShowS
show :: DescribedUser -> String
$cshow :: DescribedUser -> String
showsPrec :: Int -> DescribedUser -> ShowS
$cshowsPrec :: Int -> DescribedUser -> ShowS
Prelude.Show, forall x. Rep DescribedUser x -> DescribedUser
forall x. DescribedUser -> Rep DescribedUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribedUser x -> DescribedUser
$cfrom :: forall x. DescribedUser -> Rep DescribedUser x
Prelude.Generic)

-- |
-- Create a value of 'DescribedUser' 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:
--
-- 'homeDirectory', 'describedUser_homeDirectory' - The landing directory (folder) for a user when they log in to the server
-- using the client.
--
-- A @HomeDirectory@ example is @\/bucket_name\/home\/mydirectory@.
--
-- 'homeDirectoryMappings', 'describedUser_homeDirectoryMappings' - Logical directory mappings that specify what Amazon S3 or Amazon EFS
-- paths and keys should be visible to your user and how you want to make
-- them visible. You must specify the @Entry@ and @Target@ pair, where
-- @Entry@ shows how the path is made visible and @Target@ is the actual
-- Amazon S3 or Amazon EFS path. If you only specify a target, it is
-- displayed as is. You also must ensure that your Identity and Access
-- Management (IAM) role provides access to paths in @Target@. This value
-- can be set only when @HomeDirectoryType@ is set to /LOGICAL/.
--
-- In most cases, you can use this value instead of the session policy to
-- lock your user down to the designated home directory (\"@chroot@\"). To
-- do this, you can set @Entry@ to \'\/\' and set @Target@ to the
-- HomeDirectory parameter value.
--
-- 'homeDirectoryType', 'describedUser_homeDirectoryType' - The type of landing directory (folder) that you want your users\' home
-- directory to be when they log in to the server. If you set it to @PATH@,
-- the user will see the absolute Amazon S3 bucket or EFS paths as is in
-- their file transfer protocol clients. If you set it @LOGICAL@, you need
-- to provide mappings in the @HomeDirectoryMappings@ for how you want to
-- make Amazon S3 or Amazon EFS paths visible to your users.
--
-- 'policy', 'describedUser_policy' - A session policy for your user so that you can use the same Identity and
-- Access Management (IAM) role across multiple users. This policy scopes
-- down a user\'s access to portions of their Amazon S3 bucket. Variables
-- that you can use inside this policy include @${Transfer:UserName}@,
-- @${Transfer:HomeDirectory}@, and @${Transfer:HomeBucket}@.
--
-- 'posixProfile', 'describedUser_posixProfile' - Specifies the full POSIX identity, including user ID (@Uid@), group ID
-- (@Gid@), and any secondary groups IDs (@SecondaryGids@), that controls
-- your users\' access to your Amazon Elastic File System (Amazon EFS) file
-- systems. The POSIX permissions that are set on files and directories in
-- your file system determine the level of access your users get when
-- transferring files into and out of your Amazon EFS file systems.
--
-- 'role'', 'describedUser_role' - The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role that controls your users\' access to your Amazon S3 bucket or
-- Amazon EFS file system. The policies attached to this role determine the
-- level of access that you want to provide your users when transferring
-- files into and out of your Amazon S3 bucket or Amazon EFS file system.
-- The IAM role should also contain a trust relationship that allows the
-- server to access your resources when servicing your users\' transfer
-- requests.
--
-- 'sshPublicKeys', 'describedUser_sshPublicKeys' - Specifies the public key portion of the Secure Shell (SSH) keys stored
-- for the described user.
--
-- 'tags', 'describedUser_tags' - Specifies the key-value pairs for the user requested. Tag can be used to
-- search for and group users for a variety of purposes.
--
-- 'userName', 'describedUser_userName' - Specifies the name of the user that was requested to be described. User
-- names are used for authentication purposes. This is the string that will
-- be used by your user when they log in to your server.
--
-- 'arn', 'describedUser_arn' - Specifies the unique Amazon Resource Name (ARN) for the user that was
-- requested to be described.
newDescribedUser ::
  -- | 'arn'
  Prelude.Text ->
  DescribedUser
newDescribedUser :: Text -> DescribedUser
newDescribedUser Text
pArn_ =
  DescribedUser'
    { $sel:homeDirectory:DescribedUser' :: Maybe Text
homeDirectory = forall a. Maybe a
Prelude.Nothing,
      $sel:homeDirectoryMappings:DescribedUser' :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings = forall a. Maybe a
Prelude.Nothing,
      $sel:homeDirectoryType:DescribedUser' :: Maybe HomeDirectoryType
homeDirectoryType = forall a. Maybe a
Prelude.Nothing,
      $sel:policy:DescribedUser' :: Maybe Text
policy = forall a. Maybe a
Prelude.Nothing,
      $sel:posixProfile:DescribedUser' :: Maybe PosixProfile
posixProfile = forall a. Maybe a
Prelude.Nothing,
      $sel:role':DescribedUser' :: Maybe Text
role' = forall a. Maybe a
Prelude.Nothing,
      $sel:sshPublicKeys:DescribedUser' :: Maybe [SshPublicKey]
sshPublicKeys = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:DescribedUser' :: Maybe (NonEmpty Tag)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:userName:DescribedUser' :: Maybe Text
userName = forall a. Maybe a
Prelude.Nothing,
      $sel:arn:DescribedUser' :: Text
arn = Text
pArn_
    }

-- | The landing directory (folder) for a user when they log in to the server
-- using the client.
--
-- A @HomeDirectory@ example is @\/bucket_name\/home\/mydirectory@.
describedUser_homeDirectory :: Lens.Lens' DescribedUser (Prelude.Maybe Prelude.Text)
describedUser_homeDirectory :: Lens' DescribedUser (Maybe Text)
describedUser_homeDirectory = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedUser' {Maybe Text
homeDirectory :: Maybe Text
$sel:homeDirectory:DescribedUser' :: DescribedUser -> Maybe Text
homeDirectory} -> Maybe Text
homeDirectory) (\s :: DescribedUser
s@DescribedUser' {} Maybe Text
a -> DescribedUser
s {$sel:homeDirectory:DescribedUser' :: Maybe Text
homeDirectory = Maybe Text
a} :: DescribedUser)

-- | Logical directory mappings that specify what Amazon S3 or Amazon EFS
-- paths and keys should be visible to your user and how you want to make
-- them visible. You must specify the @Entry@ and @Target@ pair, where
-- @Entry@ shows how the path is made visible and @Target@ is the actual
-- Amazon S3 or Amazon EFS path. If you only specify a target, it is
-- displayed as is. You also must ensure that your Identity and Access
-- Management (IAM) role provides access to paths in @Target@. This value
-- can be set only when @HomeDirectoryType@ is set to /LOGICAL/.
--
-- In most cases, you can use this value instead of the session policy to
-- lock your user down to the designated home directory (\"@chroot@\"). To
-- do this, you can set @Entry@ to \'\/\' and set @Target@ to the
-- HomeDirectory parameter value.
describedUser_homeDirectoryMappings :: Lens.Lens' DescribedUser (Prelude.Maybe (Prelude.NonEmpty HomeDirectoryMapEntry))
describedUser_homeDirectoryMappings :: Lens' DescribedUser (Maybe (NonEmpty HomeDirectoryMapEntry))
describedUser_homeDirectoryMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedUser' {Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings :: Maybe (NonEmpty HomeDirectoryMapEntry)
$sel:homeDirectoryMappings:DescribedUser' :: DescribedUser -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings} -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings) (\s :: DescribedUser
s@DescribedUser' {} Maybe (NonEmpty HomeDirectoryMapEntry)
a -> DescribedUser
s {$sel:homeDirectoryMappings:DescribedUser' :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings = Maybe (NonEmpty HomeDirectoryMapEntry)
a} :: DescribedUser) 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 landing directory (folder) that you want your users\' home
-- directory to be when they log in to the server. If you set it to @PATH@,
-- the user will see the absolute Amazon S3 bucket or EFS paths as is in
-- their file transfer protocol clients. If you set it @LOGICAL@, you need
-- to provide mappings in the @HomeDirectoryMappings@ for how you want to
-- make Amazon S3 or Amazon EFS paths visible to your users.
describedUser_homeDirectoryType :: Lens.Lens' DescribedUser (Prelude.Maybe HomeDirectoryType)
describedUser_homeDirectoryType :: Lens' DescribedUser (Maybe HomeDirectoryType)
describedUser_homeDirectoryType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedUser' {Maybe HomeDirectoryType
homeDirectoryType :: Maybe HomeDirectoryType
$sel:homeDirectoryType:DescribedUser' :: DescribedUser -> Maybe HomeDirectoryType
homeDirectoryType} -> Maybe HomeDirectoryType
homeDirectoryType) (\s :: DescribedUser
s@DescribedUser' {} Maybe HomeDirectoryType
a -> DescribedUser
s {$sel:homeDirectoryType:DescribedUser' :: Maybe HomeDirectoryType
homeDirectoryType = Maybe HomeDirectoryType
a} :: DescribedUser)

-- | A session policy for your user so that you can use the same Identity and
-- Access Management (IAM) role across multiple users. This policy scopes
-- down a user\'s access to portions of their Amazon S3 bucket. Variables
-- that you can use inside this policy include @${Transfer:UserName}@,
-- @${Transfer:HomeDirectory}@, and @${Transfer:HomeBucket}@.
describedUser_policy :: Lens.Lens' DescribedUser (Prelude.Maybe Prelude.Text)
describedUser_policy :: Lens' DescribedUser (Maybe Text)
describedUser_policy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedUser' {Maybe Text
policy :: Maybe Text
$sel:policy:DescribedUser' :: DescribedUser -> Maybe Text
policy} -> Maybe Text
policy) (\s :: DescribedUser
s@DescribedUser' {} Maybe Text
a -> DescribedUser
s {$sel:policy:DescribedUser' :: Maybe Text
policy = Maybe Text
a} :: DescribedUser)

-- | Specifies the full POSIX identity, including user ID (@Uid@), group ID
-- (@Gid@), and any secondary groups IDs (@SecondaryGids@), that controls
-- your users\' access to your Amazon Elastic File System (Amazon EFS) file
-- systems. The POSIX permissions that are set on files and directories in
-- your file system determine the level of access your users get when
-- transferring files into and out of your Amazon EFS file systems.
describedUser_posixProfile :: Lens.Lens' DescribedUser (Prelude.Maybe PosixProfile)
describedUser_posixProfile :: Lens' DescribedUser (Maybe PosixProfile)
describedUser_posixProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedUser' {Maybe PosixProfile
posixProfile :: Maybe PosixProfile
$sel:posixProfile:DescribedUser' :: DescribedUser -> Maybe PosixProfile
posixProfile} -> Maybe PosixProfile
posixProfile) (\s :: DescribedUser
s@DescribedUser' {} Maybe PosixProfile
a -> DescribedUser
s {$sel:posixProfile:DescribedUser' :: Maybe PosixProfile
posixProfile = Maybe PosixProfile
a} :: DescribedUser)

-- | The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role that controls your users\' access to your Amazon S3 bucket or
-- Amazon EFS file system. The policies attached to this role determine the
-- level of access that you want to provide your users when transferring
-- files into and out of your Amazon S3 bucket or Amazon EFS file system.
-- The IAM role should also contain a trust relationship that allows the
-- server to access your resources when servicing your users\' transfer
-- requests.
describedUser_role :: Lens.Lens' DescribedUser (Prelude.Maybe Prelude.Text)
describedUser_role :: Lens' DescribedUser (Maybe Text)
describedUser_role = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedUser' {Maybe Text
role' :: Maybe Text
$sel:role':DescribedUser' :: DescribedUser -> Maybe Text
role'} -> Maybe Text
role') (\s :: DescribedUser
s@DescribedUser' {} Maybe Text
a -> DescribedUser
s {$sel:role':DescribedUser' :: Maybe Text
role' = Maybe Text
a} :: DescribedUser)

-- | Specifies the public key portion of the Secure Shell (SSH) keys stored
-- for the described user.
describedUser_sshPublicKeys :: Lens.Lens' DescribedUser (Prelude.Maybe [SshPublicKey])
describedUser_sshPublicKeys :: Lens' DescribedUser (Maybe [SshPublicKey])
describedUser_sshPublicKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedUser' {Maybe [SshPublicKey]
sshPublicKeys :: Maybe [SshPublicKey]
$sel:sshPublicKeys:DescribedUser' :: DescribedUser -> Maybe [SshPublicKey]
sshPublicKeys} -> Maybe [SshPublicKey]
sshPublicKeys) (\s :: DescribedUser
s@DescribedUser' {} Maybe [SshPublicKey]
a -> DescribedUser
s {$sel:sshPublicKeys:DescribedUser' :: Maybe [SshPublicKey]
sshPublicKeys = Maybe [SshPublicKey]
a} :: DescribedUser) 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

-- | Specifies the key-value pairs for the user requested. Tag can be used to
-- search for and group users for a variety of purposes.
describedUser_tags :: Lens.Lens' DescribedUser (Prelude.Maybe (Prelude.NonEmpty Tag))
describedUser_tags :: Lens' DescribedUser (Maybe (NonEmpty Tag))
describedUser_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedUser' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:DescribedUser' :: DescribedUser -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: DescribedUser
s@DescribedUser' {} Maybe (NonEmpty Tag)
a -> DescribedUser
s {$sel:tags:DescribedUser' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: DescribedUser) 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

-- | Specifies the name of the user that was requested to be described. User
-- names are used for authentication purposes. This is the string that will
-- be used by your user when they log in to your server.
describedUser_userName :: Lens.Lens' DescribedUser (Prelude.Maybe Prelude.Text)
describedUser_userName :: Lens' DescribedUser (Maybe Text)
describedUser_userName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedUser' {Maybe Text
userName :: Maybe Text
$sel:userName:DescribedUser' :: DescribedUser -> Maybe Text
userName} -> Maybe Text
userName) (\s :: DescribedUser
s@DescribedUser' {} Maybe Text
a -> DescribedUser
s {$sel:userName:DescribedUser' :: Maybe Text
userName = Maybe Text
a} :: DescribedUser)

-- | Specifies the unique Amazon Resource Name (ARN) for the user that was
-- requested to be described.
describedUser_arn :: Lens.Lens' DescribedUser Prelude.Text
describedUser_arn :: Lens' DescribedUser Text
describedUser_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedUser' {Text
arn :: Text
$sel:arn:DescribedUser' :: DescribedUser -> Text
arn} -> Text
arn) (\s :: DescribedUser
s@DescribedUser' {} Text
a -> DescribedUser
s {$sel:arn:DescribedUser' :: Text
arn = Text
a} :: DescribedUser)

instance Data.FromJSON DescribedUser where
  parseJSON :: Value -> Parser DescribedUser
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DescribedUser"
      ( \Object
x ->
          Maybe Text
-> Maybe (NonEmpty HomeDirectoryMapEntry)
-> Maybe HomeDirectoryType
-> Maybe Text
-> Maybe PosixProfile
-> Maybe Text
-> Maybe [SshPublicKey]
-> Maybe (NonEmpty Tag)
-> Maybe Text
-> Text
-> DescribedUser
DescribedUser'
            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
"HomeDirectory")
            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
"HomeDirectoryMappings")
            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
"HomeDirectoryType")
            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
"Policy")
            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
"PosixProfile")
            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
"Role")
            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
"SshPublicKeys" 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
"Tags")
            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
"UserName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Arn")
      )

instance Prelude.Hashable DescribedUser where
  hashWithSalt :: Int -> DescribedUser -> Int
hashWithSalt Int
_salt DescribedUser' {Maybe [SshPublicKey]
Maybe (NonEmpty HomeDirectoryMapEntry)
Maybe (NonEmpty Tag)
Maybe Text
Maybe HomeDirectoryType
Maybe PosixProfile
Text
arn :: Text
userName :: Maybe Text
tags :: Maybe (NonEmpty Tag)
sshPublicKeys :: Maybe [SshPublicKey]
role' :: Maybe Text
posixProfile :: Maybe PosixProfile
policy :: Maybe Text
homeDirectoryType :: Maybe HomeDirectoryType
homeDirectoryMappings :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectory :: Maybe Text
$sel:arn:DescribedUser' :: DescribedUser -> Text
$sel:userName:DescribedUser' :: DescribedUser -> Maybe Text
$sel:tags:DescribedUser' :: DescribedUser -> Maybe (NonEmpty Tag)
$sel:sshPublicKeys:DescribedUser' :: DescribedUser -> Maybe [SshPublicKey]
$sel:role':DescribedUser' :: DescribedUser -> Maybe Text
$sel:posixProfile:DescribedUser' :: DescribedUser -> Maybe PosixProfile
$sel:policy:DescribedUser' :: DescribedUser -> Maybe Text
$sel:homeDirectoryType:DescribedUser' :: DescribedUser -> Maybe HomeDirectoryType
$sel:homeDirectoryMappings:DescribedUser' :: DescribedUser -> Maybe (NonEmpty HomeDirectoryMapEntry)
$sel:homeDirectory:DescribedUser' :: DescribedUser -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
homeDirectory
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HomeDirectoryType
homeDirectoryType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PosixProfile
posixProfile
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
role'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SshPublicKey]
sshPublicKeys
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Tag)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn

instance Prelude.NFData DescribedUser where
  rnf :: DescribedUser -> ()
rnf DescribedUser' {Maybe [SshPublicKey]
Maybe (NonEmpty HomeDirectoryMapEntry)
Maybe (NonEmpty Tag)
Maybe Text
Maybe HomeDirectoryType
Maybe PosixProfile
Text
arn :: Text
userName :: Maybe Text
tags :: Maybe (NonEmpty Tag)
sshPublicKeys :: Maybe [SshPublicKey]
role' :: Maybe Text
posixProfile :: Maybe PosixProfile
policy :: Maybe Text
homeDirectoryType :: Maybe HomeDirectoryType
homeDirectoryMappings :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectory :: Maybe Text
$sel:arn:DescribedUser' :: DescribedUser -> Text
$sel:userName:DescribedUser' :: DescribedUser -> Maybe Text
$sel:tags:DescribedUser' :: DescribedUser -> Maybe (NonEmpty Tag)
$sel:sshPublicKeys:DescribedUser' :: DescribedUser -> Maybe [SshPublicKey]
$sel:role':DescribedUser' :: DescribedUser -> Maybe Text
$sel:posixProfile:DescribedUser' :: DescribedUser -> Maybe PosixProfile
$sel:policy:DescribedUser' :: DescribedUser -> Maybe Text
$sel:homeDirectoryType:DescribedUser' :: DescribedUser -> Maybe HomeDirectoryType
$sel:homeDirectoryMappings:DescribedUser' :: DescribedUser -> Maybe (NonEmpty HomeDirectoryMapEntry)
$sel:homeDirectory:DescribedUser' :: DescribedUser -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
homeDirectory
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HomeDirectoryType
homeDirectoryType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PosixProfile
posixProfile
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
role'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SshPublicKey]
sshPublicKeys
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn