{-# 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 #-}
module Amazonka.Connect.CreateUser
(
CreateUser (..),
newCreateUser,
createUser_directoryUserId,
createUser_identityInfo,
createUser_password,
createUser_hierarchyGroupId,
createUser_tags,
createUser_username,
createUser_phoneConfig,
createUser_securityProfileIds,
createUser_routingProfileId,
createUser_instanceId,
CreateUserResponse (..),
newCreateUserResponse,
createUserResponse_userId,
createUserResponse_userArn,
createUserResponse_httpStatus,
)
where
import Amazonka.Connect.Types
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
data CreateUser = CreateUser'
{
CreateUser -> Maybe Text
directoryUserId :: Prelude.Maybe Prelude.Text,
CreateUser -> Maybe UserIdentityInfo
identityInfo :: Prelude.Maybe UserIdentityInfo,
CreateUser -> Maybe Text
password :: Prelude.Maybe Prelude.Text,
CreateUser -> Maybe Text
hierarchyGroupId :: Prelude.Maybe Prelude.Text,
CreateUser -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateUser -> Text
username :: Prelude.Text,
CreateUser -> UserPhoneConfig
phoneConfig :: UserPhoneConfig,
CreateUser -> NonEmpty Text
securityProfileIds :: Prelude.NonEmpty Prelude.Text,
CreateUser -> Text
routingProfileId :: Prelude.Text,
CreateUser -> Text
instanceId :: 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)
newCreateUser ::
Prelude.Text ->
UserPhoneConfig ->
Prelude.NonEmpty Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateUser
newCreateUser :: Text
-> UserPhoneConfig -> NonEmpty Text -> Text -> Text -> CreateUser
newCreateUser
Text
pUsername_
UserPhoneConfig
pPhoneConfig_
NonEmpty Text
pSecurityProfileIds_
Text
pRoutingProfileId_
Text
pInstanceId_ =
CreateUser' :: Maybe Text
-> Maybe UserIdentityInfo
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> UserPhoneConfig
-> NonEmpty Text
-> Text
-> Text
-> CreateUser
CreateUser'
{ $sel:directoryUserId:CreateUser' :: Maybe Text
directoryUserId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:identityInfo:CreateUser' :: Maybe UserIdentityInfo
identityInfo = Maybe UserIdentityInfo
forall a. Maybe a
Prelude.Nothing,
$sel:password:CreateUser' :: Maybe Text
password = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:hierarchyGroupId:CreateUser' :: Maybe Text
hierarchyGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateUser' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:username:CreateUser' :: Text
username = Text
pUsername_,
$sel:phoneConfig:CreateUser' :: UserPhoneConfig
phoneConfig = UserPhoneConfig
pPhoneConfig_,
$sel:securityProfileIds:CreateUser' :: NonEmpty Text
securityProfileIds =
Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pSecurityProfileIds_,
$sel:routingProfileId:CreateUser' :: Text
routingProfileId = Text
pRoutingProfileId_,
$sel:instanceId:CreateUser' :: Text
instanceId = Text
pInstanceId_
}
createUser_directoryUserId :: Lens.Lens' CreateUser (Prelude.Maybe Prelude.Text)
createUser_directoryUserId :: (Maybe Text -> f (Maybe Text)) -> CreateUser -> f CreateUser
createUser_directoryUserId = (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
directoryUserId :: Maybe Text
$sel:directoryUserId:CreateUser' :: CreateUser -> Maybe Text
directoryUserId} -> Maybe Text
directoryUserId) (\s :: CreateUser
s@CreateUser' {} Maybe Text
a -> CreateUser
s {$sel:directoryUserId:CreateUser' :: Maybe Text
directoryUserId = Maybe Text
a} :: CreateUser)
createUser_identityInfo :: Lens.Lens' CreateUser (Prelude.Maybe UserIdentityInfo)
createUser_identityInfo :: (Maybe UserIdentityInfo -> f (Maybe UserIdentityInfo))
-> CreateUser -> f CreateUser
createUser_identityInfo = (CreateUser -> Maybe UserIdentityInfo)
-> (CreateUser -> Maybe UserIdentityInfo -> CreateUser)
-> Lens
CreateUser
CreateUser
(Maybe UserIdentityInfo)
(Maybe UserIdentityInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe UserIdentityInfo
identityInfo :: Maybe UserIdentityInfo
$sel:identityInfo:CreateUser' :: CreateUser -> Maybe UserIdentityInfo
identityInfo} -> Maybe UserIdentityInfo
identityInfo) (\s :: CreateUser
s@CreateUser' {} Maybe UserIdentityInfo
a -> CreateUser
s {$sel:identityInfo:CreateUser' :: Maybe UserIdentityInfo
identityInfo = Maybe UserIdentityInfo
a} :: CreateUser)
createUser_password :: Lens.Lens' CreateUser (Prelude.Maybe Prelude.Text)
createUser_password :: (Maybe Text -> f (Maybe Text)) -> CreateUser -> f CreateUser
createUser_password = (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
password :: Maybe Text
$sel:password:CreateUser' :: CreateUser -> Maybe Text
password} -> Maybe Text
password) (\s :: CreateUser
s@CreateUser' {} Maybe Text
a -> CreateUser
s {$sel:password:CreateUser' :: Maybe Text
password = Maybe Text
a} :: CreateUser)
createUser_hierarchyGroupId :: Lens.Lens' CreateUser (Prelude.Maybe Prelude.Text)
createUser_hierarchyGroupId :: (Maybe Text -> f (Maybe Text)) -> CreateUser -> f CreateUser
createUser_hierarchyGroupId = (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
hierarchyGroupId :: Maybe Text
$sel:hierarchyGroupId:CreateUser' :: CreateUser -> Maybe Text
hierarchyGroupId} -> Maybe Text
hierarchyGroupId) (\s :: CreateUser
s@CreateUser' {} Maybe Text
a -> CreateUser
s {$sel:hierarchyGroupId:CreateUser' :: Maybe Text
hierarchyGroupId = Maybe Text
a} :: CreateUser)
createUser_tags :: Lens.Lens' CreateUser (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createUser_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateUser -> f CreateUser
createUser_tags = (CreateUser -> Maybe (HashMap Text Text))
-> (CreateUser -> Maybe (HashMap Text Text) -> CreateUser)
-> Lens
CreateUser
CreateUser
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateUser' :: CreateUser -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateUser
s@CreateUser' {} Maybe (HashMap Text Text)
a -> CreateUser
s {$sel:tags:CreateUser' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateUser) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateUser -> f CreateUser)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateUser
-> f CreateUser
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
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)
createUser_phoneConfig :: Lens.Lens' CreateUser UserPhoneConfig
createUser_phoneConfig :: (UserPhoneConfig -> f UserPhoneConfig)
-> CreateUser -> f CreateUser
createUser_phoneConfig = (CreateUser -> UserPhoneConfig)
-> (CreateUser -> UserPhoneConfig -> CreateUser)
-> Lens CreateUser CreateUser UserPhoneConfig UserPhoneConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {UserPhoneConfig
phoneConfig :: UserPhoneConfig
$sel:phoneConfig:CreateUser' :: CreateUser -> UserPhoneConfig
phoneConfig} -> UserPhoneConfig
phoneConfig) (\s :: CreateUser
s@CreateUser' {} UserPhoneConfig
a -> CreateUser
s {$sel:phoneConfig:CreateUser' :: UserPhoneConfig
phoneConfig = UserPhoneConfig
a} :: CreateUser)
createUser_securityProfileIds :: Lens.Lens' CreateUser (Prelude.NonEmpty Prelude.Text)
createUser_securityProfileIds :: (NonEmpty Text -> f (NonEmpty Text)) -> CreateUser -> f CreateUser
createUser_securityProfileIds = (CreateUser -> NonEmpty Text)
-> (CreateUser -> NonEmpty Text -> CreateUser)
-> Lens CreateUser CreateUser (NonEmpty Text) (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {NonEmpty Text
securityProfileIds :: NonEmpty Text
$sel:securityProfileIds:CreateUser' :: CreateUser -> NonEmpty Text
securityProfileIds} -> NonEmpty Text
securityProfileIds) (\s :: CreateUser
s@CreateUser' {} NonEmpty Text
a -> CreateUser
s {$sel:securityProfileIds:CreateUser' :: NonEmpty Text
securityProfileIds = NonEmpty Text
a} :: CreateUser) ((NonEmpty Text -> f (NonEmpty Text))
-> CreateUser -> f CreateUser)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> CreateUser
-> f CreateUser
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createUser_routingProfileId :: Lens.Lens' CreateUser Prelude.Text
createUser_routingProfileId :: (Text -> f Text) -> CreateUser -> f CreateUser
createUser_routingProfileId = (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
routingProfileId :: Text
$sel:routingProfileId:CreateUser' :: CreateUser -> Text
routingProfileId} -> Text
routingProfileId) (\s :: CreateUser
s@CreateUser' {} Text
a -> CreateUser
s {$sel:routingProfileId:CreateUser' :: Text
routingProfileId = Text
a} :: CreateUser)
createUser_instanceId :: Lens.Lens' CreateUser Prelude.Text
createUser_instanceId :: (Text -> f Text) -> CreateUser -> f CreateUser
createUser_instanceId = (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
instanceId :: Text
$sel:instanceId:CreateUser' :: CreateUser -> Text
instanceId} -> Text
instanceId) (\s :: CreateUser
s@CreateUser' {} Text
a -> CreateUser
s {$sel:instanceId:CreateUser' :: Text
instanceId = 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.putJSON 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 ->
Maybe Text -> Maybe Text -> Int -> CreateUserResponse
CreateUserResponse'
(Maybe Text -> Maybe Text -> Int -> CreateUserResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateUserResponse)
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
"UserId")
Either String (Maybe Text -> Int -> CreateUserResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateUserResponse)
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
"UserArn")
Either String (Int -> CreateUserResponse)
-> Either String Int -> Either String CreateUserResponse
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 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
"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 Text
Maybe (HashMap Text Text)
Maybe UserIdentityInfo
NonEmpty Text
Text
UserPhoneConfig
instanceId :: Text
routingProfileId :: Text
securityProfileIds :: NonEmpty Text
phoneConfig :: UserPhoneConfig
username :: Text
tags :: Maybe (HashMap Text Text)
hierarchyGroupId :: Maybe Text
password :: Maybe Text
identityInfo :: Maybe UserIdentityInfo
directoryUserId :: Maybe Text
$sel:instanceId:CreateUser' :: CreateUser -> Text
$sel:routingProfileId:CreateUser' :: CreateUser -> Text
$sel:securityProfileIds:CreateUser' :: CreateUser -> NonEmpty Text
$sel:phoneConfig:CreateUser' :: CreateUser -> UserPhoneConfig
$sel:username:CreateUser' :: CreateUser -> Text
$sel:tags:CreateUser' :: CreateUser -> Maybe (HashMap Text Text)
$sel:hierarchyGroupId:CreateUser' :: CreateUser -> Maybe Text
$sel:password:CreateUser' :: CreateUser -> Maybe Text
$sel:identityInfo:CreateUser' :: CreateUser -> Maybe UserIdentityInfo
$sel:directoryUserId:CreateUser' :: CreateUser -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DirectoryUserId" 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
directoryUserId,
(Text
"IdentityInfo" Text -> UserIdentityInfo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (UserIdentityInfo -> Pair) -> Maybe UserIdentityInfo -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UserIdentityInfo
identityInfo,
(Text
"Password" 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
password,
(Text
"HierarchyGroupId" 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
hierarchyGroupId,
(Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PhoneConfig" Text -> UserPhoneConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= UserPhoneConfig
phoneConfig),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SecurityProfileIds" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
securityProfileIds),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"RoutingProfileId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
routingProfileId)
]
)
instance Core.ToPath CreateUser where
toPath :: CreateUser -> ByteString
toPath CreateUser' {Maybe Text
Maybe (HashMap Text Text)
Maybe UserIdentityInfo
NonEmpty Text
Text
UserPhoneConfig
instanceId :: Text
routingProfileId :: Text
securityProfileIds :: NonEmpty Text
phoneConfig :: UserPhoneConfig
username :: Text
tags :: Maybe (HashMap Text Text)
hierarchyGroupId :: Maybe Text
password :: Maybe Text
identityInfo :: Maybe UserIdentityInfo
directoryUserId :: Maybe Text
$sel:instanceId:CreateUser' :: CreateUser -> Text
$sel:routingProfileId:CreateUser' :: CreateUser -> Text
$sel:securityProfileIds:CreateUser' :: CreateUser -> NonEmpty Text
$sel:phoneConfig:CreateUser' :: CreateUser -> UserPhoneConfig
$sel:username:CreateUser' :: CreateUser -> Text
$sel:tags:CreateUser' :: CreateUser -> Maybe (HashMap Text Text)
$sel:hierarchyGroupId:CreateUser' :: CreateUser -> Maybe Text
$sel:password:CreateUser' :: CreateUser -> Maybe Text
$sel:identityInfo:CreateUser' :: CreateUser -> Maybe UserIdentityInfo
$sel:directoryUserId:CreateUser' :: CreateUser -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/users/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId]
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
data CreateUserResponse = CreateUserResponse'
{
CreateUserResponse -> Maybe Text
userId :: Prelude.Maybe Prelude.Text,
CreateUserResponse -> Maybe Text
userArn :: Prelude.Maybe Prelude.Text,
CreateUserResponse -> Int
httpStatus :: Prelude.Int
}
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)
newCreateUserResponse ::
Prelude.Int ->
CreateUserResponse
newCreateUserResponse :: Int -> CreateUserResponse
newCreateUserResponse Int
pHttpStatus_ =
CreateUserResponse' :: Maybe Text -> Maybe Text -> Int -> CreateUserResponse
CreateUserResponse'
{ $sel:userId:CreateUserResponse' :: Maybe Text
userId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userArn:CreateUserResponse' :: Maybe Text
userArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateUserResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createUserResponse_userId :: Lens.Lens' CreateUserResponse (Prelude.Maybe Prelude.Text)
createUserResponse_userId :: (Maybe Text -> f (Maybe Text))
-> CreateUserResponse -> f CreateUserResponse
createUserResponse_userId = (CreateUserResponse -> Maybe Text)
-> (CreateUserResponse -> Maybe Text -> CreateUserResponse)
-> Lens
CreateUserResponse CreateUserResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserResponse' {Maybe Text
userId :: Maybe Text
$sel:userId:CreateUserResponse' :: CreateUserResponse -> Maybe Text
userId} -> Maybe Text
userId) (\s :: CreateUserResponse
s@CreateUserResponse' {} Maybe Text
a -> CreateUserResponse
s {$sel:userId:CreateUserResponse' :: Maybe Text
userId = Maybe Text
a} :: CreateUserResponse)
createUserResponse_userArn :: Lens.Lens' CreateUserResponse (Prelude.Maybe Prelude.Text)
createUserResponse_userArn :: (Maybe Text -> f (Maybe Text))
-> CreateUserResponse -> f CreateUserResponse
createUserResponse_userArn = (CreateUserResponse -> Maybe Text)
-> (CreateUserResponse -> Maybe Text -> CreateUserResponse)
-> Lens
CreateUserResponse CreateUserResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserResponse' {Maybe Text
userArn :: Maybe Text
$sel:userArn:CreateUserResponse' :: CreateUserResponse -> Maybe Text
userArn} -> Maybe Text
userArn) (\s :: CreateUserResponse
s@CreateUserResponse' {} Maybe Text
a -> CreateUserResponse
s {$sel:userArn:CreateUserResponse' :: Maybe Text
userArn = Maybe Text
a} :: CreateUserResponse)
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)
instance Prelude.NFData CreateUserResponse