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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | Specifies the public key portion of the Secure Shell (SSH) keys stored
    -- for the described user.
    DescribedUser -> Maybe [SshPublicKey]
sshPublicKeys :: Prelude.Maybe [SshPublicKey],
    -- | The type of landing directory (folder) you want your users\' home
    -- directory to be when they log into 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 EFS paths visible to your users.
    DescribedUser -> Maybe HomeDirectoryType
homeDirectoryType :: Prelude.Maybe HomeDirectoryType,
    -- | 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 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,
    -- | 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 Amazon Web Services
    -- Identity and Access Management (IAM) role provides access to paths in
    -- @Target@. This value can only be set 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),
    -- | Specifies the Amazon Resource Name (ARN) of the IAM role that controls
    -- your users\' access to your Amazon S3 bucket or 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 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,
    -- | A session policy for your user so that you can use the same IAM role
    -- across multiple users. This policy scopes down user 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,
    -- | 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,
    -- | 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 unique Amazon Resource Name (ARN) for the user that was
    -- requested to be described.
    DescribedUser -> Text
arn :: Prelude.Text
  }
  deriving (DescribedUser -> DescribedUser -> Bool
(DescribedUser -> DescribedUser -> Bool)
-> (DescribedUser -> DescribedUser -> Bool) -> Eq DescribedUser
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]
(Int -> ReadS DescribedUser)
-> ReadS [DescribedUser]
-> ReadPrec DescribedUser
-> ReadPrec [DescribedUser]
-> Read 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
(Int -> DescribedUser -> ShowS)
-> (DescribedUser -> String)
-> ([DescribedUser] -> ShowS)
-> Show DescribedUser
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. DescribedUser -> Rep DescribedUser x)
-> (forall x. Rep DescribedUser x -> DescribedUser)
-> Generic DescribedUser
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:
--
-- 'sshPublicKeys', 'describedUser_sshPublicKeys' - Specifies the public key portion of the Secure Shell (SSH) keys stored
-- for the described user.
--
-- 'homeDirectoryType', 'describedUser_homeDirectoryType' - The type of landing directory (folder) you want your users\' home
-- directory to be when they log into 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 EFS paths visible to your users.
--
-- '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.
--
-- '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.
--
-- '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 Amazon Web Services
-- Identity and Access Management (IAM) role provides access to paths in
-- @Target@. This value can only be set 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.
--
-- 'role'', 'describedUser_role' - Specifies the Amazon Resource Name (ARN) of the IAM role that controls
-- your users\' access to your Amazon S3 bucket or 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 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.
--
-- 'policy', 'describedUser_policy' - A session policy for your user so that you can use the same IAM role
-- across multiple users. This policy scopes down user access to portions
-- of their Amazon S3 bucket. Variables that you can use inside this policy
-- include @${Transfer:UserName}@, @${Transfer:HomeDirectory}@, and
-- @${Transfer:HomeBucket}@.
--
-- '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@.
--
-- '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.
--
-- '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' :: Maybe [SshPublicKey]
-> Maybe HomeDirectoryType
-> Maybe Text
-> Maybe PosixProfile
-> Maybe (NonEmpty HomeDirectoryMapEntry)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> DescribedUser
DescribedUser'
    { $sel:sshPublicKeys:DescribedUser' :: Maybe [SshPublicKey]
sshPublicKeys = Maybe [SshPublicKey]
forall a. Maybe a
Prelude.Nothing,
      $sel:homeDirectoryType:DescribedUser' :: Maybe HomeDirectoryType
homeDirectoryType = Maybe HomeDirectoryType
forall a. Maybe a
Prelude.Nothing,
      $sel:userName:DescribedUser' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:posixProfile:DescribedUser' :: Maybe PosixProfile
posixProfile = Maybe PosixProfile
forall a. Maybe a
Prelude.Nothing,
      $sel:homeDirectoryMappings:DescribedUser' :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings = Maybe (NonEmpty HomeDirectoryMapEntry)
forall a. Maybe a
Prelude.Nothing,
      $sel:role':DescribedUser' :: Maybe Text
role' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:policy:DescribedUser' :: Maybe Text
policy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:homeDirectory:DescribedUser' :: Maybe Text
homeDirectory = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:DescribedUser' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:DescribedUser' :: Text
arn = Text
pArn_
    }

-- | 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 :: (Maybe [SshPublicKey] -> f (Maybe [SshPublicKey]))
-> DescribedUser -> f DescribedUser
describedUser_sshPublicKeys = (DescribedUser -> Maybe [SshPublicKey])
-> (DescribedUser -> Maybe [SshPublicKey] -> DescribedUser)
-> Lens
     DescribedUser
     DescribedUser
     (Maybe [SshPublicKey])
     (Maybe [SshPublicKey])
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) ((Maybe [SshPublicKey] -> f (Maybe [SshPublicKey]))
 -> DescribedUser -> f DescribedUser)
-> ((Maybe [SshPublicKey] -> f (Maybe [SshPublicKey]))
    -> Maybe [SshPublicKey] -> f (Maybe [SshPublicKey]))
-> (Maybe [SshPublicKey] -> f (Maybe [SshPublicKey]))
-> DescribedUser
-> f DescribedUser
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [SshPublicKey] [SshPublicKey] [SshPublicKey] [SshPublicKey]
-> Iso
     (Maybe [SshPublicKey])
     (Maybe [SshPublicKey])
     (Maybe [SshPublicKey])
     (Maybe [SshPublicKey])
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 [SshPublicKey] [SshPublicKey] [SshPublicKey] [SshPublicKey]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of landing directory (folder) you want your users\' home
-- directory to be when they log into 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 EFS paths visible to your users.
describedUser_homeDirectoryType :: Lens.Lens' DescribedUser (Prelude.Maybe HomeDirectoryType)
describedUser_homeDirectoryType :: (Maybe HomeDirectoryType -> f (Maybe HomeDirectoryType))
-> DescribedUser -> f DescribedUser
describedUser_homeDirectoryType = (DescribedUser -> Maybe HomeDirectoryType)
-> (DescribedUser -> Maybe HomeDirectoryType -> DescribedUser)
-> Lens
     DescribedUser
     DescribedUser
     (Maybe HomeDirectoryType)
     (Maybe 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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> DescribedUser -> f DescribedUser
describedUser_userName = (DescribedUser -> Maybe Text)
-> (DescribedUser -> Maybe Text -> DescribedUser)
-> Lens DescribedUser DescribedUser (Maybe Text) (Maybe Text)
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 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 :: (Maybe PosixProfile -> f (Maybe PosixProfile))
-> DescribedUser -> f DescribedUser
describedUser_posixProfile = (DescribedUser -> Maybe PosixProfile)
-> (DescribedUser -> Maybe PosixProfile -> DescribedUser)
-> Lens
     DescribedUser
     DescribedUser
     (Maybe PosixProfile)
     (Maybe 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)

-- | 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 Amazon Web Services
-- Identity and Access Management (IAM) role provides access to paths in
-- @Target@. This value can only be set 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 :: (Maybe (NonEmpty HomeDirectoryMapEntry)
 -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> DescribedUser -> f DescribedUser
describedUser_homeDirectoryMappings = (DescribedUser -> Maybe (NonEmpty HomeDirectoryMapEntry))
-> (DescribedUser
    -> Maybe (NonEmpty HomeDirectoryMapEntry) -> DescribedUser)
-> Lens
     DescribedUser
     DescribedUser
     (Maybe (NonEmpty HomeDirectoryMapEntry))
     (Maybe (NonEmpty HomeDirectoryMapEntry))
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) ((Maybe (NonEmpty HomeDirectoryMapEntry)
  -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
 -> DescribedUser -> f DescribedUser)
-> ((Maybe (NonEmpty HomeDirectoryMapEntry)
     -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
    -> Maybe (NonEmpty HomeDirectoryMapEntry)
    -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> (Maybe (NonEmpty HomeDirectoryMapEntry)
    -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> DescribedUser
-> f DescribedUser
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty HomeDirectoryMapEntry)
  (NonEmpty HomeDirectoryMapEntry)
  (NonEmpty HomeDirectoryMapEntry)
  (NonEmpty HomeDirectoryMapEntry)
-> Iso
     (Maybe (NonEmpty HomeDirectoryMapEntry))
     (Maybe (NonEmpty HomeDirectoryMapEntry))
     (Maybe (NonEmpty HomeDirectoryMapEntry))
     (Maybe (NonEmpty HomeDirectoryMapEntry))
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 HomeDirectoryMapEntry)
  (NonEmpty HomeDirectoryMapEntry)
  (NonEmpty HomeDirectoryMapEntry)
  (NonEmpty HomeDirectoryMapEntry)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies the Amazon Resource Name (ARN) of the IAM role that controls
-- your users\' access to your Amazon S3 bucket or 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 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 :: (Maybe Text -> f (Maybe Text)) -> DescribedUser -> f DescribedUser
describedUser_role = (DescribedUser -> Maybe Text)
-> (DescribedUser -> Maybe Text -> DescribedUser)
-> Lens DescribedUser DescribedUser (Maybe Text) (Maybe Text)
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)

-- | A session policy for your user so that you can use the same IAM role
-- across multiple users. This policy scopes down user 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 :: (Maybe Text -> f (Maybe Text)) -> DescribedUser -> f DescribedUser
describedUser_policy = (DescribedUser -> Maybe Text)
-> (DescribedUser -> Maybe Text -> DescribedUser)
-> Lens DescribedUser DescribedUser (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> DescribedUser -> f DescribedUser
describedUser_homeDirectory = (DescribedUser -> Maybe Text)
-> (DescribedUser -> Maybe Text -> DescribedUser)
-> Lens DescribedUser DescribedUser (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> DescribedUser -> f DescribedUser
describedUser_tags = (DescribedUser -> Maybe (NonEmpty Tag))
-> (DescribedUser -> Maybe (NonEmpty Tag) -> DescribedUser)
-> Lens
     DescribedUser
     DescribedUser
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> DescribedUser -> f DescribedUser)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> DescribedUser
-> f DescribedUser
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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 Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Text -> f Text) -> DescribedUser -> f DescribedUser
describedUser_arn = (DescribedUser -> Text)
-> (DescribedUser -> Text -> DescribedUser)
-> Lens DescribedUser DescribedUser Text Text
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 Core.FromJSON DescribedUser where
  parseJSON :: Value -> Parser DescribedUser
parseJSON =
    String
-> (Object -> Parser DescribedUser)
-> Value
-> Parser DescribedUser
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DescribedUser"
      ( \Object
x ->
          Maybe [SshPublicKey]
-> Maybe HomeDirectoryType
-> Maybe Text
-> Maybe PosixProfile
-> Maybe (NonEmpty HomeDirectoryMapEntry)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> DescribedUser
DescribedUser'
            (Maybe [SshPublicKey]
 -> Maybe HomeDirectoryType
 -> Maybe Text
 -> Maybe PosixProfile
 -> Maybe (NonEmpty HomeDirectoryMapEntry)
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (NonEmpty Tag)
 -> Text
 -> DescribedUser)
-> Parser (Maybe [SshPublicKey])
-> Parser
     (Maybe HomeDirectoryType
      -> Maybe Text
      -> Maybe PosixProfile
      -> Maybe (NonEmpty HomeDirectoryMapEntry)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Text
      -> DescribedUser)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [SshPublicKey]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SshPublicKeys" Parser (Maybe (Maybe [SshPublicKey]))
-> Maybe [SshPublicKey] -> Parser (Maybe [SshPublicKey])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SshPublicKey]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe HomeDirectoryType
   -> Maybe Text
   -> Maybe PosixProfile
   -> Maybe (NonEmpty HomeDirectoryMapEntry)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Text
   -> DescribedUser)
-> Parser (Maybe HomeDirectoryType)
-> Parser
     (Maybe Text
      -> Maybe PosixProfile
      -> Maybe (NonEmpty HomeDirectoryMapEntry)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Text
      -> DescribedUser)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HomeDirectoryType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HomeDirectoryType")
            Parser
  (Maybe Text
   -> Maybe PosixProfile
   -> Maybe (NonEmpty HomeDirectoryMapEntry)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Text
   -> DescribedUser)
-> Parser (Maybe Text)
-> Parser
     (Maybe PosixProfile
      -> Maybe (NonEmpty HomeDirectoryMapEntry)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Text
      -> DescribedUser)
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 PosixProfile
   -> Maybe (NonEmpty HomeDirectoryMapEntry)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Text
   -> DescribedUser)
-> Parser (Maybe PosixProfile)
-> Parser
     (Maybe (NonEmpty HomeDirectoryMapEntry)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Text
      -> DescribedUser)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PosixProfile)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PosixProfile")
            Parser
  (Maybe (NonEmpty HomeDirectoryMapEntry)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Text
   -> DescribedUser)
-> Parser (Maybe (NonEmpty HomeDirectoryMapEntry))
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Text
      -> DescribedUser)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty HomeDirectoryMapEntry))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HomeDirectoryMappings")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Text
   -> DescribedUser)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe (NonEmpty Tag) -> Text -> DescribedUser)
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
"Role")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe (NonEmpty Tag) -> Text -> DescribedUser)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe (NonEmpty Tag) -> Text -> DescribedUser)
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
"Policy")
            Parser
  (Maybe Text -> Maybe (NonEmpty Tag) -> Text -> DescribedUser)
-> Parser (Maybe Text)
-> Parser (Maybe (NonEmpty Tag) -> Text -> DescribedUser)
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
"HomeDirectory")
            Parser (Maybe (NonEmpty Tag) -> Text -> DescribedUser)
-> Parser (Maybe (NonEmpty Tag)) -> Parser (Text -> DescribedUser)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Tag))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags")
            Parser (Text -> DescribedUser)
-> Parser Text -> Parser DescribedUser
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
"Arn")
      )

instance Prelude.Hashable DescribedUser

instance Prelude.NFData DescribedUser