{-# 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.QuickSight.RegisterUser
-- 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 an Amazon QuickSight user, whose identity is associated with the
-- AWS Identity and Access Management (IAM) identity or role specified in
-- the request.
module Amazonka.QuickSight.RegisterUser
  ( -- * Creating a Request
    RegisterUser (..),
    newRegisterUser,

    -- * Request Lenses
    registerUser_userName,
    registerUser_customPermissionsName,
    registerUser_customFederationProviderUrl,
    registerUser_externalLoginFederationProviderType,
    registerUser_iamArn,
    registerUser_externalLoginId,
    registerUser_sessionName,
    registerUser_identityType,
    registerUser_email,
    registerUser_userRole,
    registerUser_awsAccountId,
    registerUser_namespace,

    -- * Destructuring the Response
    RegisterUserResponse (..),
    newRegisterUserResponse,

    -- * Response Lenses
    registerUserResponse_requestId,
    registerUserResponse_userInvitationUrl,
    registerUserResponse_user,
    registerUserResponse_status,
  )
where

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

-- | /See:/ 'newRegisterUser' smart constructor.
data RegisterUser = RegisterUser'
  { -- | The Amazon QuickSight user name that you want to create for the user you
    -- are registering.
    RegisterUser -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
    -- | (Enterprise edition only) The name of the custom permissions profile
    -- that you want to assign to this user. Customized permissions allows you
    -- to control a user\'s access by restricting access the following
    -- operations:
    --
    -- -   Create and update data sources
    --
    -- -   Create and update datasets
    --
    -- -   Create and update email reports
    --
    -- -   Subscribe to email reports
    --
    -- To add custom permissions to an existing user, use @ UpdateUser @
    -- instead.
    --
    -- A set of custom permissions includes any combination of these
    -- restrictions. Currently, you need to create the profile names for custom
    -- permission sets by using the Amazon QuickSight console. Then, you use
    -- the @RegisterUser@ API operation to assign the named set of permissions
    -- to a Amazon QuickSight user.
    --
    -- Amazon QuickSight custom permissions are applied through IAMpolicies.
    -- Therefore, they override the permissions typically granted by assigning
    -- Amazon QuickSight users to one of the default security cohorts in Amazon
    -- QuickSight (admin, author, reader).
    --
    -- This feature is available only to Amazon QuickSight Enterprise edition
    -- subscriptions.
    RegisterUser -> Maybe Text
customPermissionsName :: Prelude.Maybe Prelude.Text,
    -- | The URL of the custom OpenID Connect (OIDC) provider that provides
    -- identity to let a user federate into Amazon QuickSight with an
    -- associated Identity and Access Management(IAM) role. This parameter
    -- should only be used when @ExternalLoginFederationProviderType@ parameter
    -- is set to @CUSTOM_OIDC@.
    RegisterUser -> Maybe Text
customFederationProviderUrl :: Prelude.Maybe Prelude.Text,
    -- | The type of supported external login provider that provides identity to
    -- let a user federate into Amazon QuickSight with an associated Identity
    -- and Access Management(IAM) role. The type of supported external login
    -- provider can be one of the following.
    --
    -- -   @COGNITO@: Amazon Cognito. The provider URL is
    --     cognito-identity.amazonaws.com. When choosing the @COGNITO@ provider
    --     type, don’t use the \"CustomFederationProviderUrl\" parameter which
    --     is only needed when the external provider is custom.
    --
    -- -   @CUSTOM_OIDC@: Custom OpenID Connect (OIDC) provider. When choosing
    --     @CUSTOM_OIDC@ type, use the @CustomFederationProviderUrl@ parameter
    --     to provide the custom OIDC provider URL.
    RegisterUser -> Maybe Text
externalLoginFederationProviderType :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the IAMuser or role that you are registering with Amazon
    -- QuickSight.
    RegisterUser -> Maybe Text
iamArn :: Prelude.Maybe Prelude.Text,
    -- | The identity ID for a user in the external login provider.
    RegisterUser -> Maybe Text
externalLoginId :: Prelude.Maybe Prelude.Text,
    -- | You need to use this parameter only when you register one or more users
    -- using an assumed IAMrole. You don\'t need to provide the session name
    -- for other scenarios, for example when you are registering an IAMuser or
    -- an Amazon QuickSight user. You can register multiple users using the
    -- same IAMrole if each user has a different session name. For more
    -- information on assuming IAMroles, see
    -- <https://docs.aws.amazon.com/cli/latest/reference/sts/assume-role.html assume-role>
    -- in the /AWS CLI Reference./
    RegisterUser -> Maybe Text
sessionName :: Prelude.Maybe Prelude.Text,
    -- | Amazon QuickSight supports several ways of managing the identity of
    -- users. This parameter accepts two values:
    --
    -- -   @IAM@: A user whose identity maps to an existing IAMuser or role.
    --
    -- -   @QUICKSIGHT@: A user whose identity is owned and managed internally
    --     by Amazon QuickSight.
    RegisterUser -> IdentityType
identityType :: IdentityType,
    -- | The email address of the user that you want to register.
    RegisterUser -> Text
email :: Prelude.Text,
    -- | The Amazon QuickSight role for the user. The user role can be one of the
    -- following:
    --
    -- -   @READER@: A user who has read-only access to dashboards.
    --
    -- -   @AUTHOR@: A user who can create data sources, datasets, analyses,
    --     and dashboards.
    --
    -- -   @ADMIN@: A user who is an author, who can also manage Amazon
    --     QuickSight settings.
    --
    -- -   @RESTRICTED_READER@: This role isn\'t currently available for use.
    --
    -- -   @RESTRICTED_AUTHOR@: This role isn\'t currently available for use.
    RegisterUser -> UserRole
userRole :: UserRole,
    -- | The ID for the Amazon Web Services account that the user is in.
    -- Currently, you use the ID for the Amazon Web Services account that
    -- contains your Amazon QuickSight account.
    RegisterUser -> Text
awsAccountId :: Prelude.Text,
    -- | The namespace. Currently, you should set this to @default@.
    RegisterUser -> Text
namespace :: Prelude.Text
  }
  deriving (RegisterUser -> RegisterUser -> Bool
(RegisterUser -> RegisterUser -> Bool)
-> (RegisterUser -> RegisterUser -> Bool) -> Eq RegisterUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterUser -> RegisterUser -> Bool
$c/= :: RegisterUser -> RegisterUser -> Bool
== :: RegisterUser -> RegisterUser -> Bool
$c== :: RegisterUser -> RegisterUser -> Bool
Prelude.Eq, ReadPrec [RegisterUser]
ReadPrec RegisterUser
Int -> ReadS RegisterUser
ReadS [RegisterUser]
(Int -> ReadS RegisterUser)
-> ReadS [RegisterUser]
-> ReadPrec RegisterUser
-> ReadPrec [RegisterUser]
-> Read RegisterUser
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterUser]
$creadListPrec :: ReadPrec [RegisterUser]
readPrec :: ReadPrec RegisterUser
$creadPrec :: ReadPrec RegisterUser
readList :: ReadS [RegisterUser]
$creadList :: ReadS [RegisterUser]
readsPrec :: Int -> ReadS RegisterUser
$creadsPrec :: Int -> ReadS RegisterUser
Prelude.Read, Int -> RegisterUser -> ShowS
[RegisterUser] -> ShowS
RegisterUser -> String
(Int -> RegisterUser -> ShowS)
-> (RegisterUser -> String)
-> ([RegisterUser] -> ShowS)
-> Show RegisterUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterUser] -> ShowS
$cshowList :: [RegisterUser] -> ShowS
show :: RegisterUser -> String
$cshow :: RegisterUser -> String
showsPrec :: Int -> RegisterUser -> ShowS
$cshowsPrec :: Int -> RegisterUser -> ShowS
Prelude.Show, (forall x. RegisterUser -> Rep RegisterUser x)
-> (forall x. Rep RegisterUser x -> RegisterUser)
-> Generic RegisterUser
forall x. Rep RegisterUser x -> RegisterUser
forall x. RegisterUser -> Rep RegisterUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterUser x -> RegisterUser
$cfrom :: forall x. RegisterUser -> Rep RegisterUser x
Prelude.Generic)

-- |
-- Create a value of 'RegisterUser' 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:
--
-- 'userName', 'registerUser_userName' - The Amazon QuickSight user name that you want to create for the user you
-- are registering.
--
-- 'customPermissionsName', 'registerUser_customPermissionsName' - (Enterprise edition only) The name of the custom permissions profile
-- that you want to assign to this user. Customized permissions allows you
-- to control a user\'s access by restricting access the following
-- operations:
--
-- -   Create and update data sources
--
-- -   Create and update datasets
--
-- -   Create and update email reports
--
-- -   Subscribe to email reports
--
-- To add custom permissions to an existing user, use @ UpdateUser @
-- instead.
--
-- A set of custom permissions includes any combination of these
-- restrictions. Currently, you need to create the profile names for custom
-- permission sets by using the Amazon QuickSight console. Then, you use
-- the @RegisterUser@ API operation to assign the named set of permissions
-- to a Amazon QuickSight user.
--
-- Amazon QuickSight custom permissions are applied through IAMpolicies.
-- Therefore, they override the permissions typically granted by assigning
-- Amazon QuickSight users to one of the default security cohorts in Amazon
-- QuickSight (admin, author, reader).
--
-- This feature is available only to Amazon QuickSight Enterprise edition
-- subscriptions.
--
-- 'customFederationProviderUrl', 'registerUser_customFederationProviderUrl' - The URL of the custom OpenID Connect (OIDC) provider that provides
-- identity to let a user federate into Amazon QuickSight with an
-- associated Identity and Access Management(IAM) role. This parameter
-- should only be used when @ExternalLoginFederationProviderType@ parameter
-- is set to @CUSTOM_OIDC@.
--
-- 'externalLoginFederationProviderType', 'registerUser_externalLoginFederationProviderType' - The type of supported external login provider that provides identity to
-- let a user federate into Amazon QuickSight with an associated Identity
-- and Access Management(IAM) role. The type of supported external login
-- provider can be one of the following.
--
-- -   @COGNITO@: Amazon Cognito. The provider URL is
--     cognito-identity.amazonaws.com. When choosing the @COGNITO@ provider
--     type, don’t use the \"CustomFederationProviderUrl\" parameter which
--     is only needed when the external provider is custom.
--
-- -   @CUSTOM_OIDC@: Custom OpenID Connect (OIDC) provider. When choosing
--     @CUSTOM_OIDC@ type, use the @CustomFederationProviderUrl@ parameter
--     to provide the custom OIDC provider URL.
--
-- 'iamArn', 'registerUser_iamArn' - The ARN of the IAMuser or role that you are registering with Amazon
-- QuickSight.
--
-- 'externalLoginId', 'registerUser_externalLoginId' - The identity ID for a user in the external login provider.
--
-- 'sessionName', 'registerUser_sessionName' - You need to use this parameter only when you register one or more users
-- using an assumed IAMrole. You don\'t need to provide the session name
-- for other scenarios, for example when you are registering an IAMuser or
-- an Amazon QuickSight user. You can register multiple users using the
-- same IAMrole if each user has a different session name. For more
-- information on assuming IAMroles, see
-- <https://docs.aws.amazon.com/cli/latest/reference/sts/assume-role.html assume-role>
-- in the /AWS CLI Reference./
--
-- 'identityType', 'registerUser_identityType' - Amazon QuickSight supports several ways of managing the identity of
-- users. This parameter accepts two values:
--
-- -   @IAM@: A user whose identity maps to an existing IAMuser or role.
--
-- -   @QUICKSIGHT@: A user whose identity is owned and managed internally
--     by Amazon QuickSight.
--
-- 'email', 'registerUser_email' - The email address of the user that you want to register.
--
-- 'userRole', 'registerUser_userRole' - The Amazon QuickSight role for the user. The user role can be one of the
-- following:
--
-- -   @READER@: A user who has read-only access to dashboards.
--
-- -   @AUTHOR@: A user who can create data sources, datasets, analyses,
--     and dashboards.
--
-- -   @ADMIN@: A user who is an author, who can also manage Amazon
--     QuickSight settings.
--
-- -   @RESTRICTED_READER@: This role isn\'t currently available for use.
--
-- -   @RESTRICTED_AUTHOR@: This role isn\'t currently available for use.
--
-- 'awsAccountId', 'registerUser_awsAccountId' - The ID for the Amazon Web Services account that the user is in.
-- Currently, you use the ID for the Amazon Web Services account that
-- contains your Amazon QuickSight account.
--
-- 'namespace', 'registerUser_namespace' - The namespace. Currently, you should set this to @default@.
newRegisterUser ::
  -- | 'identityType'
  IdentityType ->
  -- | 'email'
  Prelude.Text ->
  -- | 'userRole'
  UserRole ->
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'namespace'
  Prelude.Text ->
  RegisterUser
newRegisterUser :: IdentityType -> Text -> UserRole -> Text -> Text -> RegisterUser
newRegisterUser
  IdentityType
pIdentityType_
  Text
pEmail_
  UserRole
pUserRole_
  Text
pAwsAccountId_
  Text
pNamespace_ =
    RegisterUser' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> IdentityType
-> Text
-> UserRole
-> Text
-> Text
-> RegisterUser
RegisterUser'
      { $sel:userName:RegisterUser' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:customPermissionsName:RegisterUser' :: Maybe Text
customPermissionsName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:customFederationProviderUrl:RegisterUser' :: Maybe Text
customFederationProviderUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:externalLoginFederationProviderType:RegisterUser' :: Maybe Text
externalLoginFederationProviderType =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:iamArn:RegisterUser' :: Maybe Text
iamArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:externalLoginId:RegisterUser' :: Maybe Text
externalLoginId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:sessionName:RegisterUser' :: Maybe Text
sessionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:identityType:RegisterUser' :: IdentityType
identityType = IdentityType
pIdentityType_,
        $sel:email:RegisterUser' :: Text
email = Text
pEmail_,
        $sel:userRole:RegisterUser' :: UserRole
userRole = UserRole
pUserRole_,
        $sel:awsAccountId:RegisterUser' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:namespace:RegisterUser' :: Text
namespace = Text
pNamespace_
      }

-- | The Amazon QuickSight user name that you want to create for the user you
-- are registering.
registerUser_userName :: Lens.Lens' RegisterUser (Prelude.Maybe Prelude.Text)
registerUser_userName :: (Maybe Text -> f (Maybe Text)) -> RegisterUser -> f RegisterUser
registerUser_userName = (RegisterUser -> Maybe Text)
-> (RegisterUser -> Maybe Text -> RegisterUser)
-> Lens RegisterUser RegisterUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUser' {Maybe Text
userName :: Maybe Text
$sel:userName:RegisterUser' :: RegisterUser -> Maybe Text
userName} -> Maybe Text
userName) (\s :: RegisterUser
s@RegisterUser' {} Maybe Text
a -> RegisterUser
s {$sel:userName:RegisterUser' :: Maybe Text
userName = Maybe Text
a} :: RegisterUser)

-- | (Enterprise edition only) The name of the custom permissions profile
-- that you want to assign to this user. Customized permissions allows you
-- to control a user\'s access by restricting access the following
-- operations:
--
-- -   Create and update data sources
--
-- -   Create and update datasets
--
-- -   Create and update email reports
--
-- -   Subscribe to email reports
--
-- To add custom permissions to an existing user, use @ UpdateUser @
-- instead.
--
-- A set of custom permissions includes any combination of these
-- restrictions. Currently, you need to create the profile names for custom
-- permission sets by using the Amazon QuickSight console. Then, you use
-- the @RegisterUser@ API operation to assign the named set of permissions
-- to a Amazon QuickSight user.
--
-- Amazon QuickSight custom permissions are applied through IAMpolicies.
-- Therefore, they override the permissions typically granted by assigning
-- Amazon QuickSight users to one of the default security cohorts in Amazon
-- QuickSight (admin, author, reader).
--
-- This feature is available only to Amazon QuickSight Enterprise edition
-- subscriptions.
registerUser_customPermissionsName :: Lens.Lens' RegisterUser (Prelude.Maybe Prelude.Text)
registerUser_customPermissionsName :: (Maybe Text -> f (Maybe Text)) -> RegisterUser -> f RegisterUser
registerUser_customPermissionsName = (RegisterUser -> Maybe Text)
-> (RegisterUser -> Maybe Text -> RegisterUser)
-> Lens RegisterUser RegisterUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUser' {Maybe Text
customPermissionsName :: Maybe Text
$sel:customPermissionsName:RegisterUser' :: RegisterUser -> Maybe Text
customPermissionsName} -> Maybe Text
customPermissionsName) (\s :: RegisterUser
s@RegisterUser' {} Maybe Text
a -> RegisterUser
s {$sel:customPermissionsName:RegisterUser' :: Maybe Text
customPermissionsName = Maybe Text
a} :: RegisterUser)

-- | The URL of the custom OpenID Connect (OIDC) provider that provides
-- identity to let a user federate into Amazon QuickSight with an
-- associated Identity and Access Management(IAM) role. This parameter
-- should only be used when @ExternalLoginFederationProviderType@ parameter
-- is set to @CUSTOM_OIDC@.
registerUser_customFederationProviderUrl :: Lens.Lens' RegisterUser (Prelude.Maybe Prelude.Text)
registerUser_customFederationProviderUrl :: (Maybe Text -> f (Maybe Text)) -> RegisterUser -> f RegisterUser
registerUser_customFederationProviderUrl = (RegisterUser -> Maybe Text)
-> (RegisterUser -> Maybe Text -> RegisterUser)
-> Lens RegisterUser RegisterUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUser' {Maybe Text
customFederationProviderUrl :: Maybe Text
$sel:customFederationProviderUrl:RegisterUser' :: RegisterUser -> Maybe Text
customFederationProviderUrl} -> Maybe Text
customFederationProviderUrl) (\s :: RegisterUser
s@RegisterUser' {} Maybe Text
a -> RegisterUser
s {$sel:customFederationProviderUrl:RegisterUser' :: Maybe Text
customFederationProviderUrl = Maybe Text
a} :: RegisterUser)

-- | The type of supported external login provider that provides identity to
-- let a user federate into Amazon QuickSight with an associated Identity
-- and Access Management(IAM) role. The type of supported external login
-- provider can be one of the following.
--
-- -   @COGNITO@: Amazon Cognito. The provider URL is
--     cognito-identity.amazonaws.com. When choosing the @COGNITO@ provider
--     type, don’t use the \"CustomFederationProviderUrl\" parameter which
--     is only needed when the external provider is custom.
--
-- -   @CUSTOM_OIDC@: Custom OpenID Connect (OIDC) provider. When choosing
--     @CUSTOM_OIDC@ type, use the @CustomFederationProviderUrl@ parameter
--     to provide the custom OIDC provider URL.
registerUser_externalLoginFederationProviderType :: Lens.Lens' RegisterUser (Prelude.Maybe Prelude.Text)
registerUser_externalLoginFederationProviderType :: (Maybe Text -> f (Maybe Text)) -> RegisterUser -> f RegisterUser
registerUser_externalLoginFederationProviderType = (RegisterUser -> Maybe Text)
-> (RegisterUser -> Maybe Text -> RegisterUser)
-> Lens RegisterUser RegisterUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUser' {Maybe Text
externalLoginFederationProviderType :: Maybe Text
$sel:externalLoginFederationProviderType:RegisterUser' :: RegisterUser -> Maybe Text
externalLoginFederationProviderType} -> Maybe Text
externalLoginFederationProviderType) (\s :: RegisterUser
s@RegisterUser' {} Maybe Text
a -> RegisterUser
s {$sel:externalLoginFederationProviderType:RegisterUser' :: Maybe Text
externalLoginFederationProviderType = Maybe Text
a} :: RegisterUser)

-- | The ARN of the IAMuser or role that you are registering with Amazon
-- QuickSight.
registerUser_iamArn :: Lens.Lens' RegisterUser (Prelude.Maybe Prelude.Text)
registerUser_iamArn :: (Maybe Text -> f (Maybe Text)) -> RegisterUser -> f RegisterUser
registerUser_iamArn = (RegisterUser -> Maybe Text)
-> (RegisterUser -> Maybe Text -> RegisterUser)
-> Lens RegisterUser RegisterUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUser' {Maybe Text
iamArn :: Maybe Text
$sel:iamArn:RegisterUser' :: RegisterUser -> Maybe Text
iamArn} -> Maybe Text
iamArn) (\s :: RegisterUser
s@RegisterUser' {} Maybe Text
a -> RegisterUser
s {$sel:iamArn:RegisterUser' :: Maybe Text
iamArn = Maybe Text
a} :: RegisterUser)

-- | The identity ID for a user in the external login provider.
registerUser_externalLoginId :: Lens.Lens' RegisterUser (Prelude.Maybe Prelude.Text)
registerUser_externalLoginId :: (Maybe Text -> f (Maybe Text)) -> RegisterUser -> f RegisterUser
registerUser_externalLoginId = (RegisterUser -> Maybe Text)
-> (RegisterUser -> Maybe Text -> RegisterUser)
-> Lens RegisterUser RegisterUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUser' {Maybe Text
externalLoginId :: Maybe Text
$sel:externalLoginId:RegisterUser' :: RegisterUser -> Maybe Text
externalLoginId} -> Maybe Text
externalLoginId) (\s :: RegisterUser
s@RegisterUser' {} Maybe Text
a -> RegisterUser
s {$sel:externalLoginId:RegisterUser' :: Maybe Text
externalLoginId = Maybe Text
a} :: RegisterUser)

-- | You need to use this parameter only when you register one or more users
-- using an assumed IAMrole. You don\'t need to provide the session name
-- for other scenarios, for example when you are registering an IAMuser or
-- an Amazon QuickSight user. You can register multiple users using the
-- same IAMrole if each user has a different session name. For more
-- information on assuming IAMroles, see
-- <https://docs.aws.amazon.com/cli/latest/reference/sts/assume-role.html assume-role>
-- in the /AWS CLI Reference./
registerUser_sessionName :: Lens.Lens' RegisterUser (Prelude.Maybe Prelude.Text)
registerUser_sessionName :: (Maybe Text -> f (Maybe Text)) -> RegisterUser -> f RegisterUser
registerUser_sessionName = (RegisterUser -> Maybe Text)
-> (RegisterUser -> Maybe Text -> RegisterUser)
-> Lens RegisterUser RegisterUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUser' {Maybe Text
sessionName :: Maybe Text
$sel:sessionName:RegisterUser' :: RegisterUser -> Maybe Text
sessionName} -> Maybe Text
sessionName) (\s :: RegisterUser
s@RegisterUser' {} Maybe Text
a -> RegisterUser
s {$sel:sessionName:RegisterUser' :: Maybe Text
sessionName = Maybe Text
a} :: RegisterUser)

-- | Amazon QuickSight supports several ways of managing the identity of
-- users. This parameter accepts two values:
--
-- -   @IAM@: A user whose identity maps to an existing IAMuser or role.
--
-- -   @QUICKSIGHT@: A user whose identity is owned and managed internally
--     by Amazon QuickSight.
registerUser_identityType :: Lens.Lens' RegisterUser IdentityType
registerUser_identityType :: (IdentityType -> f IdentityType) -> RegisterUser -> f RegisterUser
registerUser_identityType = (RegisterUser -> IdentityType)
-> (RegisterUser -> IdentityType -> RegisterUser)
-> Lens RegisterUser RegisterUser IdentityType IdentityType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUser' {IdentityType
identityType :: IdentityType
$sel:identityType:RegisterUser' :: RegisterUser -> IdentityType
identityType} -> IdentityType
identityType) (\s :: RegisterUser
s@RegisterUser' {} IdentityType
a -> RegisterUser
s {$sel:identityType:RegisterUser' :: IdentityType
identityType = IdentityType
a} :: RegisterUser)

-- | The email address of the user that you want to register.
registerUser_email :: Lens.Lens' RegisterUser Prelude.Text
registerUser_email :: (Text -> f Text) -> RegisterUser -> f RegisterUser
registerUser_email = (RegisterUser -> Text)
-> (RegisterUser -> Text -> RegisterUser)
-> Lens RegisterUser RegisterUser Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUser' {Text
email :: Text
$sel:email:RegisterUser' :: RegisterUser -> Text
email} -> Text
email) (\s :: RegisterUser
s@RegisterUser' {} Text
a -> RegisterUser
s {$sel:email:RegisterUser' :: Text
email = Text
a} :: RegisterUser)

-- | The Amazon QuickSight role for the user. The user role can be one of the
-- following:
--
-- -   @READER@: A user who has read-only access to dashboards.
--
-- -   @AUTHOR@: A user who can create data sources, datasets, analyses,
--     and dashboards.
--
-- -   @ADMIN@: A user who is an author, who can also manage Amazon
--     QuickSight settings.
--
-- -   @RESTRICTED_READER@: This role isn\'t currently available for use.
--
-- -   @RESTRICTED_AUTHOR@: This role isn\'t currently available for use.
registerUser_userRole :: Lens.Lens' RegisterUser UserRole
registerUser_userRole :: (UserRole -> f UserRole) -> RegisterUser -> f RegisterUser
registerUser_userRole = (RegisterUser -> UserRole)
-> (RegisterUser -> UserRole -> RegisterUser)
-> Lens RegisterUser RegisterUser UserRole UserRole
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUser' {UserRole
userRole :: UserRole
$sel:userRole:RegisterUser' :: RegisterUser -> UserRole
userRole} -> UserRole
userRole) (\s :: RegisterUser
s@RegisterUser' {} UserRole
a -> RegisterUser
s {$sel:userRole:RegisterUser' :: UserRole
userRole = UserRole
a} :: RegisterUser)

-- | The ID for the Amazon Web Services account that the user is in.
-- Currently, you use the ID for the Amazon Web Services account that
-- contains your Amazon QuickSight account.
registerUser_awsAccountId :: Lens.Lens' RegisterUser Prelude.Text
registerUser_awsAccountId :: (Text -> f Text) -> RegisterUser -> f RegisterUser
registerUser_awsAccountId = (RegisterUser -> Text)
-> (RegisterUser -> Text -> RegisterUser)
-> Lens RegisterUser RegisterUser Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUser' {Text
awsAccountId :: Text
$sel:awsAccountId:RegisterUser' :: RegisterUser -> Text
awsAccountId} -> Text
awsAccountId) (\s :: RegisterUser
s@RegisterUser' {} Text
a -> RegisterUser
s {$sel:awsAccountId:RegisterUser' :: Text
awsAccountId = Text
a} :: RegisterUser)

-- | The namespace. Currently, you should set this to @default@.
registerUser_namespace :: Lens.Lens' RegisterUser Prelude.Text
registerUser_namespace :: (Text -> f Text) -> RegisterUser -> f RegisterUser
registerUser_namespace = (RegisterUser -> Text)
-> (RegisterUser -> Text -> RegisterUser)
-> Lens RegisterUser RegisterUser Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUser' {Text
namespace :: Text
$sel:namespace:RegisterUser' :: RegisterUser -> Text
namespace} -> Text
namespace) (\s :: RegisterUser
s@RegisterUser' {} Text
a -> RegisterUser
s {$sel:namespace:RegisterUser' :: Text
namespace = Text
a} :: RegisterUser)

instance Core.AWSRequest RegisterUser where
  type AWSResponse RegisterUser = RegisterUserResponse
  request :: RegisterUser -> Request RegisterUser
request = Service -> RegisterUser -> Request RegisterUser
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy RegisterUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RegisterUser)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse RegisterUser))
-> Logger
-> Service
-> Proxy RegisterUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RegisterUser)))
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 ->
          Maybe Text
-> Maybe Text -> Maybe User -> Int -> RegisterUserResponse
RegisterUserResponse'
            (Maybe Text
 -> Maybe Text -> Maybe User -> Int -> RegisterUserResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe User -> Int -> RegisterUserResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RequestId")
            Either
  String (Maybe Text -> Maybe User -> Int -> RegisterUserResponse)
-> Either String (Maybe Text)
-> Either String (Maybe User -> Int -> RegisterUserResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UserInvitationUrl")
            Either String (Maybe User -> Int -> RegisterUserResponse)
-> Either String (Maybe User)
-> Either String (Int -> RegisterUserResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe User)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"User")
            Either String (Int -> RegisterUserResponse)
-> Either String Int -> Either String RegisterUserResponse
forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable RegisterUser

instance Prelude.NFData RegisterUser

instance Core.ToHeaders RegisterUser where
  toHeaders :: RegisterUser -> ResponseHeaders
toHeaders =
    ResponseHeaders -> RegisterUser -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON RegisterUser where
  toJSON :: RegisterUser -> Value
toJSON RegisterUser' {Maybe Text
Text
IdentityType
UserRole
namespace :: Text
awsAccountId :: Text
userRole :: UserRole
email :: Text
identityType :: IdentityType
sessionName :: Maybe Text
externalLoginId :: Maybe Text
iamArn :: Maybe Text
externalLoginFederationProviderType :: Maybe Text
customFederationProviderUrl :: Maybe Text
customPermissionsName :: Maybe Text
userName :: Maybe Text
$sel:namespace:RegisterUser' :: RegisterUser -> Text
$sel:awsAccountId:RegisterUser' :: RegisterUser -> Text
$sel:userRole:RegisterUser' :: RegisterUser -> UserRole
$sel:email:RegisterUser' :: RegisterUser -> Text
$sel:identityType:RegisterUser' :: RegisterUser -> IdentityType
$sel:sessionName:RegisterUser' :: RegisterUser -> Maybe Text
$sel:externalLoginId:RegisterUser' :: RegisterUser -> Maybe Text
$sel:iamArn:RegisterUser' :: RegisterUser -> Maybe Text
$sel:externalLoginFederationProviderType:RegisterUser' :: RegisterUser -> Maybe Text
$sel:customFederationProviderUrl:RegisterUser' :: RegisterUser -> Maybe Text
$sel:customPermissionsName:RegisterUser' :: RegisterUser -> Maybe Text
$sel:userName:RegisterUser' :: RegisterUser -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"UserName" 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
userName,
            (Text
"CustomPermissionsName" 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
customPermissionsName,
            (Text
"CustomFederationProviderUrl" 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
customFederationProviderUrl,
            (Text
"ExternalLoginFederationProviderType" 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
externalLoginFederationProviderType,
            (Text
"IamArn" 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
iamArn,
            (Text
"ExternalLoginId" 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
externalLoginId,
            (Text
"SessionName" 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
sessionName,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"IdentityType" Text -> IdentityType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= IdentityType
identityType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Email" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
email),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserRole" Text -> UserRole -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= UserRole
userRole)
          ]
      )

instance Core.ToPath RegisterUser where
  toPath :: RegisterUser -> ByteString
toPath RegisterUser' {Maybe Text
Text
IdentityType
UserRole
namespace :: Text
awsAccountId :: Text
userRole :: UserRole
email :: Text
identityType :: IdentityType
sessionName :: Maybe Text
externalLoginId :: Maybe Text
iamArn :: Maybe Text
externalLoginFederationProviderType :: Maybe Text
customFederationProviderUrl :: Maybe Text
customPermissionsName :: Maybe Text
userName :: Maybe Text
$sel:namespace:RegisterUser' :: RegisterUser -> Text
$sel:awsAccountId:RegisterUser' :: RegisterUser -> Text
$sel:userRole:RegisterUser' :: RegisterUser -> UserRole
$sel:email:RegisterUser' :: RegisterUser -> Text
$sel:identityType:RegisterUser' :: RegisterUser -> IdentityType
$sel:sessionName:RegisterUser' :: RegisterUser -> Maybe Text
$sel:externalLoginId:RegisterUser' :: RegisterUser -> Maybe Text
$sel:iamArn:RegisterUser' :: RegisterUser -> Maybe Text
$sel:externalLoginFederationProviderType:RegisterUser' :: RegisterUser -> Maybe Text
$sel:customFederationProviderUrl:RegisterUser' :: RegisterUser -> Maybe Text
$sel:customPermissionsName:RegisterUser' :: RegisterUser -> Maybe Text
$sel:userName:RegisterUser' :: RegisterUser -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
        ByteString
"/namespaces/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
namespace,
        ByteString
"/users"
      ]

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

-- | /See:/ 'newRegisterUserResponse' smart constructor.
data RegisterUserResponse = RegisterUserResponse'
  { -- | The Amazon Web Services request ID for this operation.
    RegisterUserResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The URL the user visits to complete registration and provide a password.
    -- This is returned only for users with an identity type of @QUICKSIGHT@.
    RegisterUserResponse -> Maybe Text
userInvitationUrl :: Prelude.Maybe Prelude.Text,
    -- | The user\'s user name.
    RegisterUserResponse -> Maybe User
user :: Prelude.Maybe User,
    -- | The HTTP status of the request.
    RegisterUserResponse -> Int
status :: Prelude.Int
  }
  deriving (RegisterUserResponse -> RegisterUserResponse -> Bool
(RegisterUserResponse -> RegisterUserResponse -> Bool)
-> (RegisterUserResponse -> RegisterUserResponse -> Bool)
-> Eq RegisterUserResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterUserResponse -> RegisterUserResponse -> Bool
$c/= :: RegisterUserResponse -> RegisterUserResponse -> Bool
== :: RegisterUserResponse -> RegisterUserResponse -> Bool
$c== :: RegisterUserResponse -> RegisterUserResponse -> Bool
Prelude.Eq, ReadPrec [RegisterUserResponse]
ReadPrec RegisterUserResponse
Int -> ReadS RegisterUserResponse
ReadS [RegisterUserResponse]
(Int -> ReadS RegisterUserResponse)
-> ReadS [RegisterUserResponse]
-> ReadPrec RegisterUserResponse
-> ReadPrec [RegisterUserResponse]
-> Read RegisterUserResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterUserResponse]
$creadListPrec :: ReadPrec [RegisterUserResponse]
readPrec :: ReadPrec RegisterUserResponse
$creadPrec :: ReadPrec RegisterUserResponse
readList :: ReadS [RegisterUserResponse]
$creadList :: ReadS [RegisterUserResponse]
readsPrec :: Int -> ReadS RegisterUserResponse
$creadsPrec :: Int -> ReadS RegisterUserResponse
Prelude.Read, Int -> RegisterUserResponse -> ShowS
[RegisterUserResponse] -> ShowS
RegisterUserResponse -> String
(Int -> RegisterUserResponse -> ShowS)
-> (RegisterUserResponse -> String)
-> ([RegisterUserResponse] -> ShowS)
-> Show RegisterUserResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterUserResponse] -> ShowS
$cshowList :: [RegisterUserResponse] -> ShowS
show :: RegisterUserResponse -> String
$cshow :: RegisterUserResponse -> String
showsPrec :: Int -> RegisterUserResponse -> ShowS
$cshowsPrec :: Int -> RegisterUserResponse -> ShowS
Prelude.Show, (forall x. RegisterUserResponse -> Rep RegisterUserResponse x)
-> (forall x. Rep RegisterUserResponse x -> RegisterUserResponse)
-> Generic RegisterUserResponse
forall x. Rep RegisterUserResponse x -> RegisterUserResponse
forall x. RegisterUserResponse -> Rep RegisterUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterUserResponse x -> RegisterUserResponse
$cfrom :: forall x. RegisterUserResponse -> Rep RegisterUserResponse x
Prelude.Generic)

-- |
-- Create a value of 'RegisterUserResponse' 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:
--
-- 'requestId', 'registerUserResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'userInvitationUrl', 'registerUserResponse_userInvitationUrl' - The URL the user visits to complete registration and provide a password.
-- This is returned only for users with an identity type of @QUICKSIGHT@.
--
-- 'user', 'registerUserResponse_user' - The user\'s user name.
--
-- 'status', 'registerUserResponse_status' - The HTTP status of the request.
newRegisterUserResponse ::
  -- | 'status'
  Prelude.Int ->
  RegisterUserResponse
newRegisterUserResponse :: Int -> RegisterUserResponse
newRegisterUserResponse Int
pStatus_ =
  RegisterUserResponse' :: Maybe Text
-> Maybe Text -> Maybe User -> Int -> RegisterUserResponse
RegisterUserResponse'
    { $sel:requestId:RegisterUserResponse' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userInvitationUrl:RegisterUserResponse' :: Maybe Text
userInvitationUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:user:RegisterUserResponse' :: Maybe User
user = Maybe User
forall a. Maybe a
Prelude.Nothing,
      $sel:status:RegisterUserResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
registerUserResponse_requestId :: Lens.Lens' RegisterUserResponse (Prelude.Maybe Prelude.Text)
registerUserResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> RegisterUserResponse -> f RegisterUserResponse
registerUserResponse_requestId = (RegisterUserResponse -> Maybe Text)
-> (RegisterUserResponse -> Maybe Text -> RegisterUserResponse)
-> Lens
     RegisterUserResponse RegisterUserResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUserResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:RegisterUserResponse' :: RegisterUserResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: RegisterUserResponse
s@RegisterUserResponse' {} Maybe Text
a -> RegisterUserResponse
s {$sel:requestId:RegisterUserResponse' :: Maybe Text
requestId = Maybe Text
a} :: RegisterUserResponse)

-- | The URL the user visits to complete registration and provide a password.
-- This is returned only for users with an identity type of @QUICKSIGHT@.
registerUserResponse_userInvitationUrl :: Lens.Lens' RegisterUserResponse (Prelude.Maybe Prelude.Text)
registerUserResponse_userInvitationUrl :: (Maybe Text -> f (Maybe Text))
-> RegisterUserResponse -> f RegisterUserResponse
registerUserResponse_userInvitationUrl = (RegisterUserResponse -> Maybe Text)
-> (RegisterUserResponse -> Maybe Text -> RegisterUserResponse)
-> Lens
     RegisterUserResponse RegisterUserResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUserResponse' {Maybe Text
userInvitationUrl :: Maybe Text
$sel:userInvitationUrl:RegisterUserResponse' :: RegisterUserResponse -> Maybe Text
userInvitationUrl} -> Maybe Text
userInvitationUrl) (\s :: RegisterUserResponse
s@RegisterUserResponse' {} Maybe Text
a -> RegisterUserResponse
s {$sel:userInvitationUrl:RegisterUserResponse' :: Maybe Text
userInvitationUrl = Maybe Text
a} :: RegisterUserResponse)

-- | The user\'s user name.
registerUserResponse_user :: Lens.Lens' RegisterUserResponse (Prelude.Maybe User)
registerUserResponse_user :: (Maybe User -> f (Maybe User))
-> RegisterUserResponse -> f RegisterUserResponse
registerUserResponse_user = (RegisterUserResponse -> Maybe User)
-> (RegisterUserResponse -> Maybe User -> RegisterUserResponse)
-> Lens
     RegisterUserResponse RegisterUserResponse (Maybe User) (Maybe User)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUserResponse' {Maybe User
user :: Maybe User
$sel:user:RegisterUserResponse' :: RegisterUserResponse -> Maybe User
user} -> Maybe User
user) (\s :: RegisterUserResponse
s@RegisterUserResponse' {} Maybe User
a -> RegisterUserResponse
s {$sel:user:RegisterUserResponse' :: Maybe User
user = Maybe User
a} :: RegisterUserResponse)

-- | The HTTP status of the request.
registerUserResponse_status :: Lens.Lens' RegisterUserResponse Prelude.Int
registerUserResponse_status :: (Int -> f Int) -> RegisterUserResponse -> f RegisterUserResponse
registerUserResponse_status = (RegisterUserResponse -> Int)
-> (RegisterUserResponse -> Int -> RegisterUserResponse)
-> Lens RegisterUserResponse RegisterUserResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterUserResponse' {Int
status :: Int
$sel:status:RegisterUserResponse' :: RegisterUserResponse -> Int
status} -> Int
status) (\s :: RegisterUserResponse
s@RegisterUserResponse' {} Int
a -> RegisterUserResponse
s {$sel:status:RegisterUserResponse' :: Int
status = Int
a} :: RegisterUserResponse)

instance Prelude.NFData RegisterUserResponse