{-# 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.DescribedAccess
-- 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.DescribedAccess 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

-- | Describes the properties of the access that was specified.
--
-- /See:/ 'newDescribedAccess' smart constructor.
data DescribedAccess = DescribedAccess'
  { -- | 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.
    DescribedAccess -> Maybe HomeDirectoryType
homeDirectoryType :: Prelude.Maybe HomeDirectoryType,
    DescribedAccess -> 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 down the associated access to the designated home directory
    -- (\"@chroot@\"). To do this, you can set @Entry@ to \'\/\' and set
    -- @Target@ to the @HomeDirectory@ parameter value.
    DescribedAccess -> 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.
    DescribedAccess -> 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}@.
    DescribedAccess -> Maybe Text
policy :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier that is required to identify specific groups within
    -- your directory. The users of the group that you associate have access to
    -- your Amazon S3 or Amazon EFS resources over the enabled protocols using
    -- Amazon Web Services Transfer Family. If you know the group name, you can
    -- view the SID values by running the following command using Windows
    -- PowerShell.
    --
    -- @Get-ADGroup -Filter {samAccountName -like \"YourGroupName*\"} -Properties * | Select SamAccountName,ObjectSid@
    --
    -- In that command, replace /YourGroupName/ with the name of your Active
    -- Directory group.
    --
    -- The regex used to validate this parameter is a string of characters
    -- consisting of uppercase and lowercase alphanumeric characters with no
    -- spaces. You can also include underscores or any of the following
    -- characters: =,.\@:\/-
    DescribedAccess -> Maybe Text
externalId :: 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@.
    DescribedAccess -> Maybe Text
homeDirectory :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribedAccess -> DescribedAccess -> Bool
(DescribedAccess -> DescribedAccess -> Bool)
-> (DescribedAccess -> DescribedAccess -> Bool)
-> Eq DescribedAccess
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribedAccess -> DescribedAccess -> Bool
$c/= :: DescribedAccess -> DescribedAccess -> Bool
== :: DescribedAccess -> DescribedAccess -> Bool
$c== :: DescribedAccess -> DescribedAccess -> Bool
Prelude.Eq, ReadPrec [DescribedAccess]
ReadPrec DescribedAccess
Int -> ReadS DescribedAccess
ReadS [DescribedAccess]
(Int -> ReadS DescribedAccess)
-> ReadS [DescribedAccess]
-> ReadPrec DescribedAccess
-> ReadPrec [DescribedAccess]
-> Read DescribedAccess
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribedAccess]
$creadListPrec :: ReadPrec [DescribedAccess]
readPrec :: ReadPrec DescribedAccess
$creadPrec :: ReadPrec DescribedAccess
readList :: ReadS [DescribedAccess]
$creadList :: ReadS [DescribedAccess]
readsPrec :: Int -> ReadS DescribedAccess
$creadsPrec :: Int -> ReadS DescribedAccess
Prelude.Read, Int -> DescribedAccess -> ShowS
[DescribedAccess] -> ShowS
DescribedAccess -> String
(Int -> DescribedAccess -> ShowS)
-> (DescribedAccess -> String)
-> ([DescribedAccess] -> ShowS)
-> Show DescribedAccess
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribedAccess] -> ShowS
$cshowList :: [DescribedAccess] -> ShowS
show :: DescribedAccess -> String
$cshow :: DescribedAccess -> String
showsPrec :: Int -> DescribedAccess -> ShowS
$cshowsPrec :: Int -> DescribedAccess -> ShowS
Prelude.Show, (forall x. DescribedAccess -> Rep DescribedAccess x)
-> (forall x. Rep DescribedAccess x -> DescribedAccess)
-> Generic DescribedAccess
forall x. Rep DescribedAccess x -> DescribedAccess
forall x. DescribedAccess -> Rep DescribedAccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribedAccess x -> DescribedAccess
$cfrom :: forall x. DescribedAccess -> Rep DescribedAccess x
Prelude.Generic)

-- |
-- Create a value of 'DescribedAccess' 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:
--
-- 'homeDirectoryType', 'describedAccess_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.
--
-- 'posixProfile', 'describedAccess_posixProfile' - Undocumented member.
--
-- 'homeDirectoryMappings', 'describedAccess_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 down the associated access to the designated home directory
-- (\"@chroot@\"). To do this, you can set @Entry@ to \'\/\' and set
-- @Target@ to the @HomeDirectory@ parameter value.
--
-- 'role'', 'describedAccess_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', 'describedAccess_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}@.
--
-- 'externalId', 'describedAccess_externalId' - A unique identifier that is required to identify specific groups within
-- your directory. The users of the group that you associate have access to
-- your Amazon S3 or Amazon EFS resources over the enabled protocols using
-- Amazon Web Services Transfer Family. If you know the group name, you can
-- view the SID values by running the following command using Windows
-- PowerShell.
--
-- @Get-ADGroup -Filter {samAccountName -like \"YourGroupName*\"} -Properties * | Select SamAccountName,ObjectSid@
--
-- In that command, replace /YourGroupName/ with the name of your Active
-- Directory group.
--
-- The regex used to validate this parameter is a string of characters
-- consisting of uppercase and lowercase alphanumeric characters with no
-- spaces. You can also include underscores or any of the following
-- characters: =,.\@:\/-
--
-- 'homeDirectory', 'describedAccess_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@.
newDescribedAccess ::
  DescribedAccess
newDescribedAccess :: DescribedAccess
newDescribedAccess =
  DescribedAccess' :: Maybe HomeDirectoryType
-> Maybe PosixProfile
-> Maybe (NonEmpty HomeDirectoryMapEntry)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DescribedAccess
DescribedAccess'
    { $sel:homeDirectoryType:DescribedAccess' :: Maybe HomeDirectoryType
homeDirectoryType =
        Maybe HomeDirectoryType
forall a. Maybe a
Prelude.Nothing,
      $sel:posixProfile:DescribedAccess' :: Maybe PosixProfile
posixProfile = Maybe PosixProfile
forall a. Maybe a
Prelude.Nothing,
      $sel:homeDirectoryMappings:DescribedAccess' :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings = Maybe (NonEmpty HomeDirectoryMapEntry)
forall a. Maybe a
Prelude.Nothing,
      $sel:role':DescribedAccess' :: Maybe Text
role' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:policy:DescribedAccess' :: Maybe Text
policy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:externalId:DescribedAccess' :: Maybe Text
externalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:homeDirectory:DescribedAccess' :: Maybe Text
homeDirectory = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | 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.
describedAccess_homeDirectoryType :: Lens.Lens' DescribedAccess (Prelude.Maybe HomeDirectoryType)
describedAccess_homeDirectoryType :: (Maybe HomeDirectoryType -> f (Maybe HomeDirectoryType))
-> DescribedAccess -> f DescribedAccess
describedAccess_homeDirectoryType = (DescribedAccess -> Maybe HomeDirectoryType)
-> (DescribedAccess -> Maybe HomeDirectoryType -> DescribedAccess)
-> Lens
     DescribedAccess
     DescribedAccess
     (Maybe HomeDirectoryType)
     (Maybe HomeDirectoryType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedAccess' {Maybe HomeDirectoryType
homeDirectoryType :: Maybe HomeDirectoryType
$sel:homeDirectoryType:DescribedAccess' :: DescribedAccess -> Maybe HomeDirectoryType
homeDirectoryType} -> Maybe HomeDirectoryType
homeDirectoryType) (\s :: DescribedAccess
s@DescribedAccess' {} Maybe HomeDirectoryType
a -> DescribedAccess
s {$sel:homeDirectoryType:DescribedAccess' :: Maybe HomeDirectoryType
homeDirectoryType = Maybe HomeDirectoryType
a} :: DescribedAccess)

-- | Undocumented member.
describedAccess_posixProfile :: Lens.Lens' DescribedAccess (Prelude.Maybe PosixProfile)
describedAccess_posixProfile :: (Maybe PosixProfile -> f (Maybe PosixProfile))
-> DescribedAccess -> f DescribedAccess
describedAccess_posixProfile = (DescribedAccess -> Maybe PosixProfile)
-> (DescribedAccess -> Maybe PosixProfile -> DescribedAccess)
-> Lens
     DescribedAccess
     DescribedAccess
     (Maybe PosixProfile)
     (Maybe PosixProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedAccess' {Maybe PosixProfile
posixProfile :: Maybe PosixProfile
$sel:posixProfile:DescribedAccess' :: DescribedAccess -> Maybe PosixProfile
posixProfile} -> Maybe PosixProfile
posixProfile) (\s :: DescribedAccess
s@DescribedAccess' {} Maybe PosixProfile
a -> DescribedAccess
s {$sel:posixProfile:DescribedAccess' :: Maybe PosixProfile
posixProfile = Maybe PosixProfile
a} :: DescribedAccess)

-- | 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 down the associated access to the designated home directory
-- (\"@chroot@\"). To do this, you can set @Entry@ to \'\/\' and set
-- @Target@ to the @HomeDirectory@ parameter value.
describedAccess_homeDirectoryMappings :: Lens.Lens' DescribedAccess (Prelude.Maybe (Prelude.NonEmpty HomeDirectoryMapEntry))
describedAccess_homeDirectoryMappings :: (Maybe (NonEmpty HomeDirectoryMapEntry)
 -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> DescribedAccess -> f DescribedAccess
describedAccess_homeDirectoryMappings = (DescribedAccess -> Maybe (NonEmpty HomeDirectoryMapEntry))
-> (DescribedAccess
    -> Maybe (NonEmpty HomeDirectoryMapEntry) -> DescribedAccess)
-> Lens
     DescribedAccess
     DescribedAccess
     (Maybe (NonEmpty HomeDirectoryMapEntry))
     (Maybe (NonEmpty HomeDirectoryMapEntry))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedAccess' {Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings :: Maybe (NonEmpty HomeDirectoryMapEntry)
$sel:homeDirectoryMappings:DescribedAccess' :: DescribedAccess -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings} -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings) (\s :: DescribedAccess
s@DescribedAccess' {} Maybe (NonEmpty HomeDirectoryMapEntry)
a -> DescribedAccess
s {$sel:homeDirectoryMappings:DescribedAccess' :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings = Maybe (NonEmpty HomeDirectoryMapEntry)
a} :: DescribedAccess) ((Maybe (NonEmpty HomeDirectoryMapEntry)
  -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
 -> DescribedAccess -> f DescribedAccess)
-> ((Maybe (NonEmpty HomeDirectoryMapEntry)
     -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
    -> Maybe (NonEmpty HomeDirectoryMapEntry)
    -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> (Maybe (NonEmpty HomeDirectoryMapEntry)
    -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> DescribedAccess
-> f DescribedAccess
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.
describedAccess_role :: Lens.Lens' DescribedAccess (Prelude.Maybe Prelude.Text)
describedAccess_role :: (Maybe Text -> f (Maybe Text))
-> DescribedAccess -> f DescribedAccess
describedAccess_role = (DescribedAccess -> Maybe Text)
-> (DescribedAccess -> Maybe Text -> DescribedAccess)
-> Lens DescribedAccess DescribedAccess (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedAccess' {Maybe Text
role' :: Maybe Text
$sel:role':DescribedAccess' :: DescribedAccess -> Maybe Text
role'} -> Maybe Text
role') (\s :: DescribedAccess
s@DescribedAccess' {} Maybe Text
a -> DescribedAccess
s {$sel:role':DescribedAccess' :: Maybe Text
role' = Maybe Text
a} :: DescribedAccess)

-- | 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}@.
describedAccess_policy :: Lens.Lens' DescribedAccess (Prelude.Maybe Prelude.Text)
describedAccess_policy :: (Maybe Text -> f (Maybe Text))
-> DescribedAccess -> f DescribedAccess
describedAccess_policy = (DescribedAccess -> Maybe Text)
-> (DescribedAccess -> Maybe Text -> DescribedAccess)
-> Lens DescribedAccess DescribedAccess (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedAccess' {Maybe Text
policy :: Maybe Text
$sel:policy:DescribedAccess' :: DescribedAccess -> Maybe Text
policy} -> Maybe Text
policy) (\s :: DescribedAccess
s@DescribedAccess' {} Maybe Text
a -> DescribedAccess
s {$sel:policy:DescribedAccess' :: Maybe Text
policy = Maybe Text
a} :: DescribedAccess)

-- | A unique identifier that is required to identify specific groups within
-- your directory. The users of the group that you associate have access to
-- your Amazon S3 or Amazon EFS resources over the enabled protocols using
-- Amazon Web Services Transfer Family. If you know the group name, you can
-- view the SID values by running the following command using Windows
-- PowerShell.
--
-- @Get-ADGroup -Filter {samAccountName -like \"YourGroupName*\"} -Properties * | Select SamAccountName,ObjectSid@
--
-- In that command, replace /YourGroupName/ with the name of your Active
-- Directory group.
--
-- The regex used to validate this parameter is a string of characters
-- consisting of uppercase and lowercase alphanumeric characters with no
-- spaces. You can also include underscores or any of the following
-- characters: =,.\@:\/-
describedAccess_externalId :: Lens.Lens' DescribedAccess (Prelude.Maybe Prelude.Text)
describedAccess_externalId :: (Maybe Text -> f (Maybe Text))
-> DescribedAccess -> f DescribedAccess
describedAccess_externalId = (DescribedAccess -> Maybe Text)
-> (DescribedAccess -> Maybe Text -> DescribedAccess)
-> Lens DescribedAccess DescribedAccess (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedAccess' {Maybe Text
externalId :: Maybe Text
$sel:externalId:DescribedAccess' :: DescribedAccess -> Maybe Text
externalId} -> Maybe Text
externalId) (\s :: DescribedAccess
s@DescribedAccess' {} Maybe Text
a -> DescribedAccess
s {$sel:externalId:DescribedAccess' :: Maybe Text
externalId = Maybe Text
a} :: DescribedAccess)

-- | 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@.
describedAccess_homeDirectory :: Lens.Lens' DescribedAccess (Prelude.Maybe Prelude.Text)
describedAccess_homeDirectory :: (Maybe Text -> f (Maybe Text))
-> DescribedAccess -> f DescribedAccess
describedAccess_homeDirectory = (DescribedAccess -> Maybe Text)
-> (DescribedAccess -> Maybe Text -> DescribedAccess)
-> Lens DescribedAccess DescribedAccess (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribedAccess' {Maybe Text
homeDirectory :: Maybe Text
$sel:homeDirectory:DescribedAccess' :: DescribedAccess -> Maybe Text
homeDirectory} -> Maybe Text
homeDirectory) (\s :: DescribedAccess
s@DescribedAccess' {} Maybe Text
a -> DescribedAccess
s {$sel:homeDirectory:DescribedAccess' :: Maybe Text
homeDirectory = Maybe Text
a} :: DescribedAccess)

instance Core.FromJSON DescribedAccess where
  parseJSON :: Value -> Parser DescribedAccess
parseJSON =
    String
-> (Object -> Parser DescribedAccess)
-> Value
-> Parser DescribedAccess
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DescribedAccess"
      ( \Object
x ->
          Maybe HomeDirectoryType
-> Maybe PosixProfile
-> Maybe (NonEmpty HomeDirectoryMapEntry)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DescribedAccess
DescribedAccess'
            (Maybe HomeDirectoryType
 -> Maybe PosixProfile
 -> Maybe (NonEmpty HomeDirectoryMapEntry)
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> DescribedAccess)
-> Parser (Maybe HomeDirectoryType)
-> Parser
     (Maybe PosixProfile
      -> Maybe (NonEmpty HomeDirectoryMapEntry)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> DescribedAccess)
forall (f :: * -> *) a b. Functor 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 PosixProfile
   -> Maybe (NonEmpty HomeDirectoryMapEntry)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> DescribedAccess)
-> Parser (Maybe PosixProfile)
-> Parser
     (Maybe (NonEmpty HomeDirectoryMapEntry)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> DescribedAccess)
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 Text
   -> DescribedAccess)
-> Parser (Maybe (NonEmpty HomeDirectoryMapEntry))
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> DescribedAccess)
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 Text -> DescribedAccess)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> DescribedAccess)
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 Text -> DescribedAccess)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> DescribedAccess)
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 Text -> DescribedAccess)
-> Parser (Maybe Text) -> Parser (Maybe Text -> DescribedAccess)
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
"ExternalId")
            Parser (Maybe Text -> DescribedAccess)
-> Parser (Maybe Text) -> Parser DescribedAccess
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")
      )

instance Prelude.Hashable DescribedAccess

instance Prelude.NFData DescribedAccess