{-# 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.CreateUser
-- 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)
--
-- Creates a user and associates them with an existing file transfer
-- protocol-enabled server. You can only create and associate users with
-- servers that have the @IdentityProviderType@ set to @SERVICE_MANAGED@.
-- Using parameters for @CreateUser@, you can specify the user name, set
-- the home directory, store the user\'s public key, and assign the user\'s
-- Amazon Web Services Identity and Access Management (IAM) role. You can
-- also optionally add a session policy, and assign metadata with tags that
-- can be used to group and search for users.
module Amazonka.Transfer.CreateUser
  ( -- * Creating a Request
    CreateUser (..),
    newCreateUser,

    -- * Request Lenses
    createUser_homeDirectoryType,
    createUser_sshPublicKeyBody,
    createUser_posixProfile,
    createUser_homeDirectoryMappings,
    createUser_policy,
    createUser_homeDirectory,
    createUser_tags,
    createUser_role,
    createUser_serverId,
    createUser_userName,

    -- * Destructuring the Response
    CreateUserResponse (..),
    newCreateUserResponse,

    -- * Response Lenses
    createUserResponse_httpStatus,
    createUserResponse_serverId,
    createUserResponse_userName,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transfer.Types

-- | /See:/ 'newCreateUser' smart constructor.
data CreateUser = CreateUser'
  { -- | 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.
    CreateUser -> Maybe HomeDirectoryType
homeDirectoryType :: Prelude.Maybe HomeDirectoryType,
    -- | The public portion of the Secure Shell (SSH) key used to authenticate
    -- the user to the server.
    CreateUser -> Maybe Text
sshPublicKeyBody :: 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 EFS file systems. The POSIX
    -- permissions that are set on files and directories in Amazon EFS
    -- determine the level of access your users get when transferring files
    -- into and out of your Amazon EFS file systems.
    CreateUser -> 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/.
    --
    -- 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 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.
    --
    -- The following is an @Entry@ and @Target@ pair example for @chroot@.
    --
    -- @[ { \"Entry:\": \"\/\", \"Target\": \"\/bucket_name\/home\/mydirectory\" } ]@
    --
    -- If the target of a logical directory entry does not exist in Amazon S3
    -- or EFS, the entry is ignored. As a workaround, you can use the Amazon S3
    -- API or EFS API to create 0 byte objects as place holders for your
    -- directory. If using the CLI, use the @s3api@ or @efsapi@ call instead of
    -- @s3@ or @efs@ so you can use the put-object operation. For example, you
    -- use the following:
    -- @aws s3api put-object --bucket bucketname --key path\/to\/folder\/@.
    -- Make sure that the end of the key name ends in a @\/@ for it to be
    -- considered a folder.
    CreateUser -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings :: Prelude.Maybe (Prelude.NonEmpty HomeDirectoryMapEntry),
    -- | 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}@.
    --
    -- This only applies when the domain of @ServerId@ is S3. EFS does not use
    -- session policies.
    --
    -- For session policies, Amazon Web Services 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 Services Security Token Service API Reference/.
    CreateUser -> 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@.
    CreateUser -> Maybe Text
homeDirectory :: Prelude.Maybe Prelude.Text,
    -- | Key-value pairs that can be used to group and search for users. Tags are
    -- metadata attached to users for any purpose.
    CreateUser -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | 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.
    CreateUser -> Text
role' :: Prelude.Text,
    -- | A system-assigned unique identifier for a server instance. This is the
    -- specific server that you added your user to.
    CreateUser -> Text
serverId :: Prelude.Text,
    -- | A unique string that identifies a user and is associated with a
    -- @ServerId@. This user name must be a minimum of 3 and a maximum of 100
    -- characters long. The following are valid characters: a-z, A-Z, 0-9,
    -- underscore \'_\', hyphen \'-\', period \'.\', and at sign \'\@\'. The
    -- user name can\'t start with a hyphen, period, or at sign.
    CreateUser -> Text
userName :: Prelude.Text
  }
  deriving (CreateUser -> CreateUser -> Bool
(CreateUser -> CreateUser -> Bool)
-> (CreateUser -> CreateUser -> Bool) -> Eq CreateUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUser -> CreateUser -> Bool
$c/= :: CreateUser -> CreateUser -> Bool
== :: CreateUser -> CreateUser -> Bool
$c== :: CreateUser -> CreateUser -> Bool
Prelude.Eq, ReadPrec [CreateUser]
ReadPrec CreateUser
Int -> ReadS CreateUser
ReadS [CreateUser]
(Int -> ReadS CreateUser)
-> ReadS [CreateUser]
-> ReadPrec CreateUser
-> ReadPrec [CreateUser]
-> Read CreateUser
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateUser]
$creadListPrec :: ReadPrec [CreateUser]
readPrec :: ReadPrec CreateUser
$creadPrec :: ReadPrec CreateUser
readList :: ReadS [CreateUser]
$creadList :: ReadS [CreateUser]
readsPrec :: Int -> ReadS CreateUser
$creadsPrec :: Int -> ReadS CreateUser
Prelude.Read, Int -> CreateUser -> ShowS
[CreateUser] -> ShowS
CreateUser -> String
(Int -> CreateUser -> ShowS)
-> (CreateUser -> String)
-> ([CreateUser] -> ShowS)
-> Show CreateUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUser] -> ShowS
$cshowList :: [CreateUser] -> ShowS
show :: CreateUser -> String
$cshow :: CreateUser -> String
showsPrec :: Int -> CreateUser -> ShowS
$cshowsPrec :: Int -> CreateUser -> ShowS
Prelude.Show, (forall x. CreateUser -> Rep CreateUser x)
-> (forall x. Rep CreateUser x -> CreateUser) -> Generic CreateUser
forall x. Rep CreateUser x -> CreateUser
forall x. CreateUser -> Rep CreateUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateUser x -> CreateUser
$cfrom :: forall x. CreateUser -> Rep CreateUser x
Prelude.Generic)

-- |
-- Create a value of 'CreateUser' 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', 'createUser_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.
--
-- 'sshPublicKeyBody', 'createUser_sshPublicKeyBody' - The public portion of the Secure Shell (SSH) key used to authenticate
-- the user to the server.
--
-- 'posixProfile', 'createUser_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 EFS file systems. The POSIX
-- permissions that are set on files and directories in Amazon EFS
-- determine the level of access your users get when transferring files
-- into and out of your Amazon EFS file systems.
--
-- 'homeDirectoryMappings', 'createUser_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/.
--
-- 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 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.
--
-- The following is an @Entry@ and @Target@ pair example for @chroot@.
--
-- @[ { \"Entry:\": \"\/\", \"Target\": \"\/bucket_name\/home\/mydirectory\" } ]@
--
-- If the target of a logical directory entry does not exist in Amazon S3
-- or EFS, the entry is ignored. As a workaround, you can use the Amazon S3
-- API or EFS API to create 0 byte objects as place holders for your
-- directory. If using the CLI, use the @s3api@ or @efsapi@ call instead of
-- @s3@ or @efs@ so you can use the put-object operation. For example, you
-- use the following:
-- @aws s3api put-object --bucket bucketname --key path\/to\/folder\/@.
-- Make sure that the end of the key name ends in a @\/@ for it to be
-- considered a folder.
--
-- 'policy', 'createUser_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}@.
--
-- This only applies when the domain of @ServerId@ is S3. EFS does not use
-- session policies.
--
-- For session policies, Amazon Web Services 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 Services Security Token Service API Reference/.
--
-- 'homeDirectory', 'createUser_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', 'createUser_tags' - Key-value pairs that can be used to group and search for users. Tags are
-- metadata attached to users for any purpose.
--
-- 'role'', 'createUser_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.
--
-- 'serverId', 'createUser_serverId' - A system-assigned unique identifier for a server instance. This is the
-- specific server that you added your user to.
--
-- 'userName', 'createUser_userName' - A unique string that identifies a user and is associated with a
-- @ServerId@. This user name must be a minimum of 3 and a maximum of 100
-- characters long. The following are valid characters: a-z, A-Z, 0-9,
-- underscore \'_\', hyphen \'-\', period \'.\', and at sign \'\@\'. The
-- user name can\'t start with a hyphen, period, or at sign.
newCreateUser ::
  -- | 'role''
  Prelude.Text ->
  -- | 'serverId'
  Prelude.Text ->
  -- | 'userName'
  Prelude.Text ->
  CreateUser
newCreateUser :: Text -> Text -> Text -> CreateUser
newCreateUser Text
pRole_ Text
pServerId_ Text
pUserName_ =
  CreateUser' :: Maybe HomeDirectoryType
-> Maybe Text
-> Maybe PosixProfile
-> Maybe (NonEmpty HomeDirectoryMapEntry)
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> Text
-> Text
-> CreateUser
CreateUser'
    { $sel:homeDirectoryType:CreateUser' :: Maybe HomeDirectoryType
homeDirectoryType = Maybe HomeDirectoryType
forall a. Maybe a
Prelude.Nothing,
      $sel:sshPublicKeyBody:CreateUser' :: Maybe Text
sshPublicKeyBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:posixProfile:CreateUser' :: Maybe PosixProfile
posixProfile = Maybe PosixProfile
forall a. Maybe a
Prelude.Nothing,
      $sel:homeDirectoryMappings:CreateUser' :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings = Maybe (NonEmpty HomeDirectoryMapEntry)
forall a. Maybe a
Prelude.Nothing,
      $sel:policy:CreateUser' :: Maybe Text
policy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:homeDirectory:CreateUser' :: Maybe Text
homeDirectory = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateUser' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
      $sel:role':CreateUser' :: Text
role' = Text
pRole_,
      $sel:serverId:CreateUser' :: Text
serverId = Text
pServerId_,
      $sel:userName:CreateUser' :: Text
userName = Text
pUserName_
    }

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

-- | The public portion of the Secure Shell (SSH) key used to authenticate
-- the user to the server.
createUser_sshPublicKeyBody :: Lens.Lens' CreateUser (Prelude.Maybe Prelude.Text)
createUser_sshPublicKeyBody :: (Maybe Text -> f (Maybe Text)) -> CreateUser -> f CreateUser
createUser_sshPublicKeyBody = (CreateUser -> Maybe Text)
-> (CreateUser -> Maybe Text -> CreateUser)
-> Lens CreateUser CreateUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe Text
sshPublicKeyBody :: Maybe Text
$sel:sshPublicKeyBody:CreateUser' :: CreateUser -> Maybe Text
sshPublicKeyBody} -> Maybe Text
sshPublicKeyBody) (\s :: CreateUser
s@CreateUser' {} Maybe Text
a -> CreateUser
s {$sel:sshPublicKeyBody:CreateUser' :: Maybe Text
sshPublicKeyBody = Maybe Text
a} :: CreateUser)

-- | 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 EFS file systems. The POSIX
-- permissions that are set on files and directories in Amazon EFS
-- determine the level of access your users get when transferring files
-- into and out of your Amazon EFS file systems.
createUser_posixProfile :: Lens.Lens' CreateUser (Prelude.Maybe PosixProfile)
createUser_posixProfile :: (Maybe PosixProfile -> f (Maybe PosixProfile))
-> CreateUser -> f CreateUser
createUser_posixProfile = (CreateUser -> Maybe PosixProfile)
-> (CreateUser -> Maybe PosixProfile -> CreateUser)
-> Lens
     CreateUser CreateUser (Maybe PosixProfile) (Maybe PosixProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe PosixProfile
posixProfile :: Maybe PosixProfile
$sel:posixProfile:CreateUser' :: CreateUser -> Maybe PosixProfile
posixProfile} -> Maybe PosixProfile
posixProfile) (\s :: CreateUser
s@CreateUser' {} Maybe PosixProfile
a -> CreateUser
s {$sel:posixProfile:CreateUser' :: Maybe PosixProfile
posixProfile = Maybe PosixProfile
a} :: CreateUser)

-- | 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/.
--
-- 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 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.
--
-- The following is an @Entry@ and @Target@ pair example for @chroot@.
--
-- @[ { \"Entry:\": \"\/\", \"Target\": \"\/bucket_name\/home\/mydirectory\" } ]@
--
-- If the target of a logical directory entry does not exist in Amazon S3
-- or EFS, the entry is ignored. As a workaround, you can use the Amazon S3
-- API or EFS API to create 0 byte objects as place holders for your
-- directory. If using the CLI, use the @s3api@ or @efsapi@ call instead of
-- @s3@ or @efs@ so you can use the put-object operation. For example, you
-- use the following:
-- @aws s3api put-object --bucket bucketname --key path\/to\/folder\/@.
-- Make sure that the end of the key name ends in a @\/@ for it to be
-- considered a folder.
createUser_homeDirectoryMappings :: Lens.Lens' CreateUser (Prelude.Maybe (Prelude.NonEmpty HomeDirectoryMapEntry))
createUser_homeDirectoryMappings :: (Maybe (NonEmpty HomeDirectoryMapEntry)
 -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> CreateUser -> f CreateUser
createUser_homeDirectoryMappings = (CreateUser -> Maybe (NonEmpty HomeDirectoryMapEntry))
-> (CreateUser
    -> Maybe (NonEmpty HomeDirectoryMapEntry) -> CreateUser)
-> Lens
     CreateUser
     CreateUser
     (Maybe (NonEmpty HomeDirectoryMapEntry))
     (Maybe (NonEmpty HomeDirectoryMapEntry))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings :: Maybe (NonEmpty HomeDirectoryMapEntry)
$sel:homeDirectoryMappings:CreateUser' :: CreateUser -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings} -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings) (\s :: CreateUser
s@CreateUser' {} Maybe (NonEmpty HomeDirectoryMapEntry)
a -> CreateUser
s {$sel:homeDirectoryMappings:CreateUser' :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings = Maybe (NonEmpty HomeDirectoryMapEntry)
a} :: CreateUser) ((Maybe (NonEmpty HomeDirectoryMapEntry)
  -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
 -> CreateUser -> f CreateUser)
-> ((Maybe (NonEmpty HomeDirectoryMapEntry)
     -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
    -> Maybe (NonEmpty HomeDirectoryMapEntry)
    -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> (Maybe (NonEmpty HomeDirectoryMapEntry)
    -> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> CreateUser
-> f CreateUser
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

-- | 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}@.
--
-- This only applies when the domain of @ServerId@ is S3. EFS does not use
-- session policies.
--
-- For session policies, Amazon Web Services 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 Services Security Token Service API Reference/.
createUser_policy :: Lens.Lens' CreateUser (Prelude.Maybe Prelude.Text)
createUser_policy :: (Maybe Text -> f (Maybe Text)) -> CreateUser -> f CreateUser
createUser_policy = (CreateUser -> Maybe Text)
-> (CreateUser -> Maybe Text -> CreateUser)
-> Lens CreateUser CreateUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe Text
policy :: Maybe Text
$sel:policy:CreateUser' :: CreateUser -> Maybe Text
policy} -> Maybe Text
policy) (\s :: CreateUser
s@CreateUser' {} Maybe Text
a -> CreateUser
s {$sel:policy:CreateUser' :: Maybe Text
policy = Maybe Text
a} :: CreateUser)

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

-- | Key-value pairs that can be used to group and search for users. Tags are
-- metadata attached to users for any purpose.
createUser_tags :: Lens.Lens' CreateUser (Prelude.Maybe (Prelude.NonEmpty Tag))
createUser_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateUser -> f CreateUser
createUser_tags = (CreateUser -> Maybe (NonEmpty Tag))
-> (CreateUser -> Maybe (NonEmpty Tag) -> CreateUser)
-> Lens
     CreateUser CreateUser (Maybe (NonEmpty Tag)) (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateUser' :: CreateUser -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateUser
s@CreateUser' {} Maybe (NonEmpty Tag)
a -> CreateUser
s {$sel:tags:CreateUser' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateUser) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateUser -> f CreateUser)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateUser
-> f CreateUser
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 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.
createUser_role :: Lens.Lens' CreateUser Prelude.Text
createUser_role :: (Text -> f Text) -> CreateUser -> f CreateUser
createUser_role = (CreateUser -> Text)
-> (CreateUser -> Text -> CreateUser)
-> Lens CreateUser CreateUser Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Text
role' :: Text
$sel:role':CreateUser' :: CreateUser -> Text
role'} -> Text
role') (\s :: CreateUser
s@CreateUser' {} Text
a -> CreateUser
s {$sel:role':CreateUser' :: Text
role' = Text
a} :: CreateUser)

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

-- | A unique string that identifies a user and is associated with a
-- @ServerId@. This user name must be a minimum of 3 and a maximum of 100
-- characters long. The following are valid characters: a-z, A-Z, 0-9,
-- underscore \'_\', hyphen \'-\', period \'.\', and at sign \'\@\'. The
-- user name can\'t start with a hyphen, period, or at sign.
createUser_userName :: Lens.Lens' CreateUser Prelude.Text
createUser_userName :: (Text -> f Text) -> CreateUser -> f CreateUser
createUser_userName = (CreateUser -> Text)
-> (CreateUser -> Text -> CreateUser)
-> Lens CreateUser CreateUser Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Text
userName :: Text
$sel:userName:CreateUser' :: CreateUser -> Text
userName} -> Text
userName) (\s :: CreateUser
s@CreateUser' {} Text
a -> CreateUser
s {$sel:userName:CreateUser' :: Text
userName = Text
a} :: CreateUser)

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

instance Prelude.Hashable CreateUser

instance Prelude.NFData CreateUser

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

instance Core.ToJSON CreateUser where
  toJSON :: CreateUser -> Value
toJSON CreateUser' {Maybe (NonEmpty HomeDirectoryMapEntry)
Maybe (NonEmpty Tag)
Maybe Text
Maybe HomeDirectoryType
Maybe PosixProfile
Text
userName :: Text
serverId :: Text
role' :: Text
tags :: Maybe (NonEmpty Tag)
homeDirectory :: Maybe Text
policy :: Maybe Text
homeDirectoryMappings :: Maybe (NonEmpty HomeDirectoryMapEntry)
posixProfile :: Maybe PosixProfile
sshPublicKeyBody :: Maybe Text
homeDirectoryType :: Maybe HomeDirectoryType
$sel:userName:CreateUser' :: CreateUser -> Text
$sel:serverId:CreateUser' :: CreateUser -> Text
$sel:role':CreateUser' :: CreateUser -> Text
$sel:tags:CreateUser' :: CreateUser -> Maybe (NonEmpty Tag)
$sel:homeDirectory:CreateUser' :: CreateUser -> Maybe Text
$sel:policy:CreateUser' :: CreateUser -> Maybe Text
$sel:homeDirectoryMappings:CreateUser' :: CreateUser -> Maybe (NonEmpty HomeDirectoryMapEntry)
$sel:posixProfile:CreateUser' :: CreateUser -> Maybe PosixProfile
$sel:sshPublicKeyBody:CreateUser' :: CreateUser -> Maybe Text
$sel:homeDirectoryType:CreateUser' :: CreateUser -> Maybe HomeDirectoryType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"HomeDirectoryType" Text -> HomeDirectoryType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HomeDirectoryType -> Pair)
-> Maybe HomeDirectoryType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HomeDirectoryType
homeDirectoryType,
            (Text
"SshPublicKeyBody" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sshPublicKeyBody,
            (Text
"PosixProfile" Text -> PosixProfile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PosixProfile -> Pair) -> Maybe PosixProfile -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PosixProfile
posixProfile,
            (Text
"HomeDirectoryMappings" Text -> NonEmpty HomeDirectoryMapEntry -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty HomeDirectoryMapEntry -> Pair)
-> Maybe (NonEmpty HomeDirectoryMapEntry) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings,
            (Text
"Policy" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
policy,
            (Text
"HomeDirectory" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
homeDirectory,
            (Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Role" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
role'),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServerId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serverId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userName)
          ]
      )

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

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

-- | /See:/ 'newCreateUserResponse' smart constructor.
data CreateUserResponse = CreateUserResponse'
  { -- | The response's http status code.
    CreateUserResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ID of the server that the user is attached to.
    CreateUserResponse -> Text
serverId :: Prelude.Text,
    -- | A unique string that identifies a user account associated with a server.
    CreateUserResponse -> Text
userName :: Prelude.Text
  }
  deriving (CreateUserResponse -> CreateUserResponse -> Bool
(CreateUserResponse -> CreateUserResponse -> Bool)
-> (CreateUserResponse -> CreateUserResponse -> Bool)
-> Eq CreateUserResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUserResponse -> CreateUserResponse -> Bool
$c/= :: CreateUserResponse -> CreateUserResponse -> Bool
== :: CreateUserResponse -> CreateUserResponse -> Bool
$c== :: CreateUserResponse -> CreateUserResponse -> Bool
Prelude.Eq, ReadPrec [CreateUserResponse]
ReadPrec CreateUserResponse
Int -> ReadS CreateUserResponse
ReadS [CreateUserResponse]
(Int -> ReadS CreateUserResponse)
-> ReadS [CreateUserResponse]
-> ReadPrec CreateUserResponse
-> ReadPrec [CreateUserResponse]
-> Read CreateUserResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateUserResponse]
$creadListPrec :: ReadPrec [CreateUserResponse]
readPrec :: ReadPrec CreateUserResponse
$creadPrec :: ReadPrec CreateUserResponse
readList :: ReadS [CreateUserResponse]
$creadList :: ReadS [CreateUserResponse]
readsPrec :: Int -> ReadS CreateUserResponse
$creadsPrec :: Int -> ReadS CreateUserResponse
Prelude.Read, Int -> CreateUserResponse -> ShowS
[CreateUserResponse] -> ShowS
CreateUserResponse -> String
(Int -> CreateUserResponse -> ShowS)
-> (CreateUserResponse -> String)
-> ([CreateUserResponse] -> ShowS)
-> Show CreateUserResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUserResponse] -> ShowS
$cshowList :: [CreateUserResponse] -> ShowS
show :: CreateUserResponse -> String
$cshow :: CreateUserResponse -> String
showsPrec :: Int -> CreateUserResponse -> ShowS
$cshowsPrec :: Int -> CreateUserResponse -> ShowS
Prelude.Show, (forall x. CreateUserResponse -> Rep CreateUserResponse x)
-> (forall x. Rep CreateUserResponse x -> CreateUserResponse)
-> Generic CreateUserResponse
forall x. Rep CreateUserResponse x -> CreateUserResponse
forall x. CreateUserResponse -> Rep CreateUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateUserResponse x -> CreateUserResponse
$cfrom :: forall x. CreateUserResponse -> Rep CreateUserResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateUserResponse' 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', 'createUserResponse_httpStatus' - The response's http status code.
--
-- 'serverId', 'createUserResponse_serverId' - The ID of the server that the user is attached to.
--
-- 'userName', 'createUserResponse_userName' - A unique string that identifies a user account associated with a server.
newCreateUserResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'serverId'
  Prelude.Text ->
  -- | 'userName'
  Prelude.Text ->
  CreateUserResponse
newCreateUserResponse :: Int -> Text -> Text -> CreateUserResponse
newCreateUserResponse
  Int
pHttpStatus_
  Text
pServerId_
  Text
pUserName_ =
    CreateUserResponse' :: Int -> Text -> Text -> CreateUserResponse
CreateUserResponse'
      { $sel:httpStatus:CreateUserResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:serverId:CreateUserResponse' :: Text
serverId = Text
pServerId_,
        $sel:userName:CreateUserResponse' :: Text
userName = Text
pUserName_
      }

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

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

-- | A unique string that identifies a user account associated with a server.
createUserResponse_userName :: Lens.Lens' CreateUserResponse Prelude.Text
createUserResponse_userName :: (Text -> f Text) -> CreateUserResponse -> f CreateUserResponse
createUserResponse_userName = (CreateUserResponse -> Text)
-> (CreateUserResponse -> Text -> CreateUserResponse)
-> Lens CreateUserResponse CreateUserResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserResponse' {Text
userName :: Text
$sel:userName:CreateUserResponse' :: CreateUserResponse -> Text
userName} -> Text
userName) (\s :: CreateUserResponse
s@CreateUserResponse' {} Text
a -> CreateUserResponse
s {$sel:userName:CreateUserResponse' :: Text
userName = Text
a} :: CreateUserResponse)

instance Prelude.NFData CreateUserResponse