{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.UpdateAccess
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Allows you to update parameters for the access specified in the
-- @ServerID@ and @ExternalID@ parameters.
module Amazonka.Transfer.UpdateAccess
  ( -- * Creating a Request
    UpdateAccess (..),
    newUpdateAccess,

    -- * Request Lenses
    updateAccess_homeDirectory,
    updateAccess_homeDirectoryMappings,
    updateAccess_homeDirectoryType,
    updateAccess_policy,
    updateAccess_posixProfile,
    updateAccess_role,
    updateAccess_serverId,
    updateAccess_externalId,

    -- * Destructuring the Response
    UpdateAccessResponse (..),
    newUpdateAccessResponse,

    -- * Response Lenses
    updateAccessResponse_httpStatus,
    updateAccessResponse_serverId,
    updateAccessResponse_externalId,
  )
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transfer.Types

-- | /See:/ 'newUpdateAccess' smart constructor.
data UpdateAccess = UpdateAccess'
  { -- | 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@.
    UpdateAccess -> 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/.
    --
    -- The following is an @Entry@ and @Target@ pair example.
    --
    -- @[ { \"Entry\": \"\/directory1\", \"Target\": \"\/bucket_name\/home\/mydirectory\" } ]@
    --
    -- In most cases, you can use this value instead of the session policy to
    -- lock down your user to the designated home directory (\"@chroot@\"). To
    -- do this, you can set @Entry@ to @\/@ and set @Target@ to the
    -- @HomeDirectory@ parameter value.
    --
    -- The following is an @Entry@ and @Target@ pair example for @chroot@.
    --
    -- @[ { \"Entry\": \"\/\", \"Target\": \"\/bucket_name\/home\/mydirectory\" } ]@
    UpdateAccess -> 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.
    UpdateAccess -> 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}@.
    --
    -- This policy applies only when the domain of @ServerId@ is Amazon S3.
    -- Amazon EFS does not use session policies.
    --
    -- For session policies, Transfer Family stores the policy as a JSON blob,
    -- instead of the Amazon Resource Name (ARN) of the policy. You save the
    -- policy as a JSON blob and pass it in the @Policy@ argument.
    --
    -- For an example of a session policy, see
    -- <https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html Example session policy>.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html AssumeRole>
    -- in the /Amazon Web ServicesSecurity Token Service API Reference/.
    UpdateAccess -> Maybe Text
policy :: Prelude.Maybe Prelude.Text,
    UpdateAccess -> 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.
    UpdateAccess -> Maybe Text
role' :: Prelude.Maybe Prelude.Text,
    -- | A system-assigned unique identifier for a server instance. This is the
    -- specific server that you added your user to.
    UpdateAccess -> Text
serverId :: 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
    -- 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 regular expression 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: =,.\@:\/-
    UpdateAccess -> Text
externalId :: Prelude.Text
  }
  deriving (UpdateAccess -> UpdateAccess -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAccess -> UpdateAccess -> Bool
$c/= :: UpdateAccess -> UpdateAccess -> Bool
== :: UpdateAccess -> UpdateAccess -> Bool
$c== :: UpdateAccess -> UpdateAccess -> Bool
Prelude.Eq, ReadPrec [UpdateAccess]
ReadPrec UpdateAccess
Int -> ReadS UpdateAccess
ReadS [UpdateAccess]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAccess]
$creadListPrec :: ReadPrec [UpdateAccess]
readPrec :: ReadPrec UpdateAccess
$creadPrec :: ReadPrec UpdateAccess
readList :: ReadS [UpdateAccess]
$creadList :: ReadS [UpdateAccess]
readsPrec :: Int -> ReadS UpdateAccess
$creadsPrec :: Int -> ReadS UpdateAccess
Prelude.Read, Int -> UpdateAccess -> ShowS
[UpdateAccess] -> ShowS
UpdateAccess -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAccess] -> ShowS
$cshowList :: [UpdateAccess] -> ShowS
show :: UpdateAccess -> String
$cshow :: UpdateAccess -> String
showsPrec :: Int -> UpdateAccess -> ShowS
$cshowsPrec :: Int -> UpdateAccess -> ShowS
Prelude.Show, forall x. Rep UpdateAccess x -> UpdateAccess
forall x. UpdateAccess -> Rep UpdateAccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAccess x -> UpdateAccess
$cfrom :: forall x. UpdateAccess -> Rep UpdateAccess x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAccess' 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', 'updateAccess_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', 'updateAccess_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/.
--
-- The following is an @Entry@ and @Target@ pair example.
--
-- @[ { \"Entry\": \"\/directory1\", \"Target\": \"\/bucket_name\/home\/mydirectory\" } ]@
--
-- In most cases, you can use this value instead of the session policy to
-- lock down your user to the designated home directory (\"@chroot@\"). To
-- do this, you can set @Entry@ to @\/@ and set @Target@ to the
-- @HomeDirectory@ parameter value.
--
-- The following is an @Entry@ and @Target@ pair example for @chroot@.
--
-- @[ { \"Entry\": \"\/\", \"Target\": \"\/bucket_name\/home\/mydirectory\" } ]@
--
-- 'homeDirectoryType', 'updateAccess_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', 'updateAccess_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}@.
--
-- This policy applies only when the domain of @ServerId@ is Amazon S3.
-- Amazon EFS does not use session policies.
--
-- For session policies, Transfer Family stores the policy as a JSON blob,
-- instead of the Amazon Resource Name (ARN) of the policy. You save the
-- policy as a JSON blob and pass it in the @Policy@ argument.
--
-- For an example of a session policy, see
-- <https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html Example session policy>.
--
-- For more information, see
-- <https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html AssumeRole>
-- in the /Amazon Web ServicesSecurity Token Service API Reference/.
--
-- 'posixProfile', 'updateAccess_posixProfile' - Undocumented member.
--
-- 'role'', 'updateAccess_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.
--
-- 'serverId', 'updateAccess_serverId' - A system-assigned unique identifier for a server instance. This is the
-- specific server that you added your user to.
--
-- 'externalId', 'updateAccess_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
-- 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 regular expression 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: =,.\@:\/-
newUpdateAccess ::
  -- | 'serverId'
  Prelude.Text ->
  -- | 'externalId'
  Prelude.Text ->
  UpdateAccess
newUpdateAccess :: Text -> Text -> UpdateAccess
newUpdateAccess Text
pServerId_ Text
pExternalId_ =
  UpdateAccess'
    { $sel:homeDirectory:UpdateAccess' :: Maybe Text
homeDirectory = forall a. Maybe a
Prelude.Nothing,
      $sel:homeDirectoryMappings:UpdateAccess' :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings = forall a. Maybe a
Prelude.Nothing,
      $sel:homeDirectoryType:UpdateAccess' :: Maybe HomeDirectoryType
homeDirectoryType = forall a. Maybe a
Prelude.Nothing,
      $sel:policy:UpdateAccess' :: Maybe Text
policy = forall a. Maybe a
Prelude.Nothing,
      $sel:posixProfile:UpdateAccess' :: Maybe PosixProfile
posixProfile = forall a. Maybe a
Prelude.Nothing,
      $sel:role':UpdateAccess' :: Maybe Text
role' = forall a. Maybe a
Prelude.Nothing,
      $sel:serverId:UpdateAccess' :: Text
serverId = Text
pServerId_,
      $sel:externalId:UpdateAccess' :: Text
externalId = Text
pExternalId_
    }

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

-- | 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/.
--
-- The following is an @Entry@ and @Target@ pair example.
--
-- @[ { \"Entry\": \"\/directory1\", \"Target\": \"\/bucket_name\/home\/mydirectory\" } ]@
--
-- In most cases, you can use this value instead of the session policy to
-- lock down your user to the designated home directory (\"@chroot@\"). To
-- do this, you can set @Entry@ to @\/@ and set @Target@ to the
-- @HomeDirectory@ parameter value.
--
-- The following is an @Entry@ and @Target@ pair example for @chroot@.
--
-- @[ { \"Entry\": \"\/\", \"Target\": \"\/bucket_name\/home\/mydirectory\" } ]@
updateAccess_homeDirectoryMappings :: Lens.Lens' UpdateAccess (Prelude.Maybe (Prelude.NonEmpty HomeDirectoryMapEntry))
updateAccess_homeDirectoryMappings :: Lens' UpdateAccess (Maybe (NonEmpty HomeDirectoryMapEntry))
updateAccess_homeDirectoryMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccess' {Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings :: Maybe (NonEmpty HomeDirectoryMapEntry)
$sel:homeDirectoryMappings:UpdateAccess' :: UpdateAccess -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings} -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings) (\s :: UpdateAccess
s@UpdateAccess' {} Maybe (NonEmpty HomeDirectoryMapEntry)
a -> UpdateAccess
s {$sel:homeDirectoryMappings:UpdateAccess' :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings = Maybe (NonEmpty HomeDirectoryMapEntry)
a} :: UpdateAccess) 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.
updateAccess_homeDirectoryType :: Lens.Lens' UpdateAccess (Prelude.Maybe HomeDirectoryType)
updateAccess_homeDirectoryType :: Lens' UpdateAccess (Maybe HomeDirectoryType)
updateAccess_homeDirectoryType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccess' {Maybe HomeDirectoryType
homeDirectoryType :: Maybe HomeDirectoryType
$sel:homeDirectoryType:UpdateAccess' :: UpdateAccess -> Maybe HomeDirectoryType
homeDirectoryType} -> Maybe HomeDirectoryType
homeDirectoryType) (\s :: UpdateAccess
s@UpdateAccess' {} Maybe HomeDirectoryType
a -> UpdateAccess
s {$sel:homeDirectoryType:UpdateAccess' :: Maybe HomeDirectoryType
homeDirectoryType = Maybe HomeDirectoryType
a} :: UpdateAccess)

-- | 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}@.
--
-- This policy applies only when the domain of @ServerId@ is Amazon S3.
-- Amazon EFS does not use session policies.
--
-- For session policies, Transfer Family stores the policy as a JSON blob,
-- instead of the Amazon Resource Name (ARN) of the policy. You save the
-- policy as a JSON blob and pass it in the @Policy@ argument.
--
-- For an example of a session policy, see
-- <https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html Example session policy>.
--
-- For more information, see
-- <https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html AssumeRole>
-- in the /Amazon Web ServicesSecurity Token Service API Reference/.
updateAccess_policy :: Lens.Lens' UpdateAccess (Prelude.Maybe Prelude.Text)
updateAccess_policy :: Lens' UpdateAccess (Maybe Text)
updateAccess_policy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccess' {Maybe Text
policy :: Maybe Text
$sel:policy:UpdateAccess' :: UpdateAccess -> Maybe Text
policy} -> Maybe Text
policy) (\s :: UpdateAccess
s@UpdateAccess' {} Maybe Text
a -> UpdateAccess
s {$sel:policy:UpdateAccess' :: Maybe Text
policy = Maybe Text
a} :: UpdateAccess)

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

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

-- | A system-assigned unique identifier for a server instance. This is the
-- specific server that you added your user to.
updateAccess_serverId :: Lens.Lens' UpdateAccess Prelude.Text
updateAccess_serverId :: Lens' UpdateAccess Text
updateAccess_serverId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccess' {Text
serverId :: Text
$sel:serverId:UpdateAccess' :: UpdateAccess -> Text
serverId} -> Text
serverId) (\s :: UpdateAccess
s@UpdateAccess' {} Text
a -> UpdateAccess
s {$sel:serverId:UpdateAccess' :: Text
serverId = Text
a} :: UpdateAccess)

-- | 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
-- 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 regular expression 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: =,.\@:\/-
updateAccess_externalId :: Lens.Lens' UpdateAccess Prelude.Text
updateAccess_externalId :: Lens' UpdateAccess Text
updateAccess_externalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccess' {Text
externalId :: Text
$sel:externalId:UpdateAccess' :: UpdateAccess -> Text
externalId} -> Text
externalId) (\s :: UpdateAccess
s@UpdateAccess' {} Text
a -> UpdateAccess
s {$sel:externalId:UpdateAccess' :: Text
externalId = Text
a} :: UpdateAccess)

instance Core.AWSRequest UpdateAccess where
  type AWSResponse UpdateAccess = UpdateAccessResponse
  request :: (Service -> Service) -> UpdateAccess -> Request UpdateAccess
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateAccess
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAccess)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> Text -> Text -> UpdateAccessResponse
UpdateAccessResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"ServerId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"ExternalId")
      )

instance Prelude.Hashable UpdateAccess where
  hashWithSalt :: Int -> UpdateAccess -> Int
hashWithSalt Int
_salt UpdateAccess' {Maybe (NonEmpty HomeDirectoryMapEntry)
Maybe Text
Maybe HomeDirectoryType
Maybe PosixProfile
Text
externalId :: Text
serverId :: Text
role' :: Maybe Text
posixProfile :: Maybe PosixProfile
policy :: Maybe Text
homeDirectoryType :: Maybe HomeDirectoryType
homeDirectoryMappings :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectory :: Maybe Text
$sel:externalId:UpdateAccess' :: UpdateAccess -> Text
$sel:serverId:UpdateAccess' :: UpdateAccess -> Text
$sel:role':UpdateAccess' :: UpdateAccess -> Maybe Text
$sel:posixProfile:UpdateAccess' :: UpdateAccess -> Maybe PosixProfile
$sel:policy:UpdateAccess' :: UpdateAccess -> Maybe Text
$sel:homeDirectoryType:UpdateAccess' :: UpdateAccess -> Maybe HomeDirectoryType
$sel:homeDirectoryMappings:UpdateAccess' :: UpdateAccess -> Maybe (NonEmpty HomeDirectoryMapEntry)
$sel:homeDirectory:UpdateAccess' :: UpdateAccess -> 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` Text
serverId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
externalId

instance Prelude.NFData UpdateAccess where
  rnf :: UpdateAccess -> ()
rnf UpdateAccess' {Maybe (NonEmpty HomeDirectoryMapEntry)
Maybe Text
Maybe HomeDirectoryType
Maybe PosixProfile
Text
externalId :: Text
serverId :: Text
role' :: Maybe Text
posixProfile :: Maybe PosixProfile
policy :: Maybe Text
homeDirectoryType :: Maybe HomeDirectoryType
homeDirectoryMappings :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectory :: Maybe Text
$sel:externalId:UpdateAccess' :: UpdateAccess -> Text
$sel:serverId:UpdateAccess' :: UpdateAccess -> Text
$sel:role':UpdateAccess' :: UpdateAccess -> Maybe Text
$sel:posixProfile:UpdateAccess' :: UpdateAccess -> Maybe PosixProfile
$sel:policy:UpdateAccess' :: UpdateAccess -> Maybe Text
$sel:homeDirectoryType:UpdateAccess' :: UpdateAccess -> Maybe HomeDirectoryType
$sel:homeDirectoryMappings:UpdateAccess' :: UpdateAccess -> Maybe (NonEmpty HomeDirectoryMapEntry)
$sel:homeDirectory:UpdateAccess' :: UpdateAccess -> 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 Text
serverId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
externalId

instance Data.ToHeaders UpdateAccess where
  toHeaders :: UpdateAccess -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"TransferService.UpdateAccess" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateAccess where
  toJSON :: UpdateAccess -> Value
toJSON UpdateAccess' {Maybe (NonEmpty HomeDirectoryMapEntry)
Maybe Text
Maybe HomeDirectoryType
Maybe PosixProfile
Text
externalId :: Text
serverId :: Text
role' :: Maybe Text
posixProfile :: Maybe PosixProfile
policy :: Maybe Text
homeDirectoryType :: Maybe HomeDirectoryType
homeDirectoryMappings :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectory :: Maybe Text
$sel:externalId:UpdateAccess' :: UpdateAccess -> Text
$sel:serverId:UpdateAccess' :: UpdateAccess -> Text
$sel:role':UpdateAccess' :: UpdateAccess -> Maybe Text
$sel:posixProfile:UpdateAccess' :: UpdateAccess -> Maybe PosixProfile
$sel:policy:UpdateAccess' :: UpdateAccess -> Maybe Text
$sel:homeDirectoryType:UpdateAccess' :: UpdateAccess -> Maybe HomeDirectoryType
$sel:homeDirectoryMappings:UpdateAccess' :: UpdateAccess -> Maybe (NonEmpty HomeDirectoryMapEntry)
$sel:homeDirectory:UpdateAccess' :: UpdateAccess -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"HomeDirectory" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
homeDirectory,
            (Key
"HomeDirectoryMappings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings,
            (Key
"HomeDirectoryType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HomeDirectoryType
homeDirectoryType,
            (Key
"Policy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
policy,
            (Key
"PosixProfile" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PosixProfile
posixProfile,
            (Key
"Role" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
role',
            forall a. a -> Maybe a
Prelude.Just (Key
"ServerId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serverId),
            forall a. a -> Maybe a
Prelude.Just (Key
"ExternalId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
externalId)
          ]
      )

instance Data.ToPath UpdateAccess where
  toPath :: UpdateAccess -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery UpdateAccess where
  toQuery :: UpdateAccess -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateAccessResponse' smart constructor.
data UpdateAccessResponse = UpdateAccessResponse'
  { -- | The response's http status code.
    UpdateAccessResponse -> Int
httpStatus :: Prelude.Int,
    -- | The identifier of the server that the user is attached to.
    UpdateAccessResponse -> Text
serverId :: Prelude.Text,
    -- | The external identifier of the group whose users have access to your
    -- Amazon S3 or Amazon EFS resources over the enabled protocols using
    -- Amazon Web ServicesTransfer Family.
    UpdateAccessResponse -> Text
externalId :: Prelude.Text
  }
  deriving (UpdateAccessResponse -> UpdateAccessResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAccessResponse -> UpdateAccessResponse -> Bool
$c/= :: UpdateAccessResponse -> UpdateAccessResponse -> Bool
== :: UpdateAccessResponse -> UpdateAccessResponse -> Bool
$c== :: UpdateAccessResponse -> UpdateAccessResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAccessResponse]
ReadPrec UpdateAccessResponse
Int -> ReadS UpdateAccessResponse
ReadS [UpdateAccessResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAccessResponse]
$creadListPrec :: ReadPrec [UpdateAccessResponse]
readPrec :: ReadPrec UpdateAccessResponse
$creadPrec :: ReadPrec UpdateAccessResponse
readList :: ReadS [UpdateAccessResponse]
$creadList :: ReadS [UpdateAccessResponse]
readsPrec :: Int -> ReadS UpdateAccessResponse
$creadsPrec :: Int -> ReadS UpdateAccessResponse
Prelude.Read, Int -> UpdateAccessResponse -> ShowS
[UpdateAccessResponse] -> ShowS
UpdateAccessResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAccessResponse] -> ShowS
$cshowList :: [UpdateAccessResponse] -> ShowS
show :: UpdateAccessResponse -> String
$cshow :: UpdateAccessResponse -> String
showsPrec :: Int -> UpdateAccessResponse -> ShowS
$cshowsPrec :: Int -> UpdateAccessResponse -> ShowS
Prelude.Show, forall x. Rep UpdateAccessResponse x -> UpdateAccessResponse
forall x. UpdateAccessResponse -> Rep UpdateAccessResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAccessResponse x -> UpdateAccessResponse
$cfrom :: forall x. UpdateAccessResponse -> Rep UpdateAccessResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAccessResponse' 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:
--
-- 'httpStatus', 'updateAccessResponse_httpStatus' - The response's http status code.
--
-- 'serverId', 'updateAccessResponse_serverId' - The identifier of the server that the user is attached to.
--
-- 'externalId', 'updateAccessResponse_externalId' - The external identifier of the group whose users have access to your
-- Amazon S3 or Amazon EFS resources over the enabled protocols using
-- Amazon Web ServicesTransfer Family.
newUpdateAccessResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'serverId'
  Prelude.Text ->
  -- | 'externalId'
  Prelude.Text ->
  UpdateAccessResponse
newUpdateAccessResponse :: Int -> Text -> Text -> UpdateAccessResponse
newUpdateAccessResponse
  Int
pHttpStatus_
  Text
pServerId_
  Text
pExternalId_ =
    UpdateAccessResponse'
      { $sel:httpStatus:UpdateAccessResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:serverId:UpdateAccessResponse' :: Text
serverId = Text
pServerId_,
        $sel:externalId:UpdateAccessResponse' :: Text
externalId = Text
pExternalId_
      }

-- | The response's http status code.
updateAccessResponse_httpStatus :: Lens.Lens' UpdateAccessResponse Prelude.Int
updateAccessResponse_httpStatus :: Lens' UpdateAccessResponse Int
updateAccessResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccessResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAccessResponse' :: UpdateAccessResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateAccessResponse
s@UpdateAccessResponse' {} Int
a -> UpdateAccessResponse
s {$sel:httpStatus:UpdateAccessResponse' :: Int
httpStatus = Int
a} :: UpdateAccessResponse)

-- | The identifier of the server that the user is attached to.
updateAccessResponse_serverId :: Lens.Lens' UpdateAccessResponse Prelude.Text
updateAccessResponse_serverId :: Lens' UpdateAccessResponse Text
updateAccessResponse_serverId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccessResponse' {Text
serverId :: Text
$sel:serverId:UpdateAccessResponse' :: UpdateAccessResponse -> Text
serverId} -> Text
serverId) (\s :: UpdateAccessResponse
s@UpdateAccessResponse' {} Text
a -> UpdateAccessResponse
s {$sel:serverId:UpdateAccessResponse' :: Text
serverId = Text
a} :: UpdateAccessResponse)

-- | The external identifier of the group whose users have access to your
-- Amazon S3 or Amazon EFS resources over the enabled protocols using
-- Amazon Web ServicesTransfer Family.
updateAccessResponse_externalId :: Lens.Lens' UpdateAccessResponse Prelude.Text
updateAccessResponse_externalId :: Lens' UpdateAccessResponse Text
updateAccessResponse_externalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccessResponse' {Text
externalId :: Text
$sel:externalId:UpdateAccessResponse' :: UpdateAccessResponse -> Text
externalId} -> Text
externalId) (\s :: UpdateAccessResponse
s@UpdateAccessResponse' {} Text
a -> UpdateAccessResponse
s {$sel:externalId:UpdateAccessResponse' :: Text
externalId = Text
a} :: UpdateAccessResponse)

instance Prelude.NFData UpdateAccessResponse where
  rnf :: UpdateAccessResponse -> ()
rnf UpdateAccessResponse' {Int
Text
externalId :: Text
serverId :: Text
httpStatus :: Int
$sel:externalId:UpdateAccessResponse' :: UpdateAccessResponse -> Text
$sel:serverId:UpdateAccessResponse' :: UpdateAccessResponse -> Text
$sel:httpStatus:UpdateAccessResponse' :: UpdateAccessResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serverId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
externalId