{-# 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.Chime.UpdateAppInstanceUser
(
UpdateAppInstanceUser (..),
newUpdateAppInstanceUser,
updateAppInstanceUser_metadata,
updateAppInstanceUser_appInstanceUserArn,
updateAppInstanceUser_name,
UpdateAppInstanceUserResponse (..),
newUpdateAppInstanceUserResponse,
updateAppInstanceUserResponse_appInstanceUserArn,
updateAppInstanceUserResponse_httpStatus,
)
where
import Amazonka.Chime.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateAppInstanceUser = UpdateAppInstanceUser'
{
UpdateAppInstanceUser -> Maybe (Sensitive Text)
metadata :: Prelude.Maybe (Data.Sensitive Prelude.Text),
UpdateAppInstanceUser -> Text
appInstanceUserArn :: Prelude.Text,
UpdateAppInstanceUser -> Sensitive Text
name :: Data.Sensitive Prelude.Text
}
deriving (UpdateAppInstanceUser -> UpdateAppInstanceUser -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAppInstanceUser -> UpdateAppInstanceUser -> Bool
$c/= :: UpdateAppInstanceUser -> UpdateAppInstanceUser -> Bool
== :: UpdateAppInstanceUser -> UpdateAppInstanceUser -> Bool
$c== :: UpdateAppInstanceUser -> UpdateAppInstanceUser -> Bool
Prelude.Eq, Int -> UpdateAppInstanceUser -> ShowS
[UpdateAppInstanceUser] -> ShowS
UpdateAppInstanceUser -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAppInstanceUser] -> ShowS
$cshowList :: [UpdateAppInstanceUser] -> ShowS
show :: UpdateAppInstanceUser -> String
$cshow :: UpdateAppInstanceUser -> String
showsPrec :: Int -> UpdateAppInstanceUser -> ShowS
$cshowsPrec :: Int -> UpdateAppInstanceUser -> ShowS
Prelude.Show, forall x. Rep UpdateAppInstanceUser x -> UpdateAppInstanceUser
forall x. UpdateAppInstanceUser -> Rep UpdateAppInstanceUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAppInstanceUser x -> UpdateAppInstanceUser
$cfrom :: forall x. UpdateAppInstanceUser -> Rep UpdateAppInstanceUser x
Prelude.Generic)
newUpdateAppInstanceUser ::
Prelude.Text ->
Prelude.Text ->
UpdateAppInstanceUser
newUpdateAppInstanceUser :: Text -> Text -> UpdateAppInstanceUser
newUpdateAppInstanceUser Text
pAppInstanceUserArn_ Text
pName_ =
UpdateAppInstanceUser'
{ $sel:metadata:UpdateAppInstanceUser' :: Maybe (Sensitive Text)
metadata = forall a. Maybe a
Prelude.Nothing,
$sel:appInstanceUserArn:UpdateAppInstanceUser' :: Text
appInstanceUserArn = Text
pAppInstanceUserArn_,
$sel:name:UpdateAppInstanceUser' :: Sensitive Text
name = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pName_
}
updateAppInstanceUser_metadata :: Lens.Lens' UpdateAppInstanceUser (Prelude.Maybe Prelude.Text)
updateAppInstanceUser_metadata :: Lens' UpdateAppInstanceUser (Maybe Text)
updateAppInstanceUser_metadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppInstanceUser' {Maybe (Sensitive Text)
metadata :: Maybe (Sensitive Text)
$sel:metadata:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Maybe (Sensitive Text)
metadata} -> Maybe (Sensitive Text)
metadata) (\s :: UpdateAppInstanceUser
s@UpdateAppInstanceUser' {} Maybe (Sensitive Text)
a -> UpdateAppInstanceUser
s {$sel:metadata:UpdateAppInstanceUser' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
a} :: UpdateAppInstanceUser) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive
updateAppInstanceUser_appInstanceUserArn :: Lens.Lens' UpdateAppInstanceUser Prelude.Text
updateAppInstanceUser_appInstanceUserArn :: Lens' UpdateAppInstanceUser Text
updateAppInstanceUser_appInstanceUserArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppInstanceUser' {Text
appInstanceUserArn :: Text
$sel:appInstanceUserArn:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Text
appInstanceUserArn} -> Text
appInstanceUserArn) (\s :: UpdateAppInstanceUser
s@UpdateAppInstanceUser' {} Text
a -> UpdateAppInstanceUser
s {$sel:appInstanceUserArn:UpdateAppInstanceUser' :: Text
appInstanceUserArn = Text
a} :: UpdateAppInstanceUser)
updateAppInstanceUser_name :: Lens.Lens' UpdateAppInstanceUser Prelude.Text
updateAppInstanceUser_name :: Lens' UpdateAppInstanceUser Text
updateAppInstanceUser_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppInstanceUser' {Sensitive Text
name :: Sensitive Text
$sel:name:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Sensitive Text
name} -> Sensitive Text
name) (\s :: UpdateAppInstanceUser
s@UpdateAppInstanceUser' {} Sensitive Text
a -> UpdateAppInstanceUser
s {$sel:name:UpdateAppInstanceUser' :: Sensitive Text
name = Sensitive Text
a} :: UpdateAppInstanceUser) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Core.AWSRequest UpdateAppInstanceUser where
type
AWSResponse UpdateAppInstanceUser =
UpdateAppInstanceUserResponse
request :: (Service -> Service)
-> UpdateAppInstanceUser -> Request UpdateAppInstanceUser
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateAppInstanceUser
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateAppInstanceUser)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> UpdateAppInstanceUserResponse
UpdateAppInstanceUserResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"AppInstanceUserArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateAppInstanceUser where
hashWithSalt :: Int -> UpdateAppInstanceUser -> Int
hashWithSalt Int
_salt UpdateAppInstanceUser' {Maybe (Sensitive Text)
Text
Sensitive Text
name :: Sensitive Text
appInstanceUserArn :: Text
metadata :: Maybe (Sensitive Text)
$sel:name:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Sensitive Text
$sel:appInstanceUserArn:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Text
$sel:metadata:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
metadata
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appInstanceUserArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
name
instance Prelude.NFData UpdateAppInstanceUser where
rnf :: UpdateAppInstanceUser -> ()
rnf UpdateAppInstanceUser' {Maybe (Sensitive Text)
Text
Sensitive Text
name :: Sensitive Text
appInstanceUserArn :: Text
metadata :: Maybe (Sensitive Text)
$sel:name:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Sensitive Text
$sel:appInstanceUserArn:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Text
$sel:metadata:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
metadata
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
appInstanceUserArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
name
instance Data.ToHeaders UpdateAppInstanceUser where
toHeaders :: UpdateAppInstanceUser -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON UpdateAppInstanceUser where
toJSON :: UpdateAppInstanceUser -> Value
toJSON UpdateAppInstanceUser' {Maybe (Sensitive Text)
Text
Sensitive Text
name :: Sensitive Text
appInstanceUserArn :: Text
metadata :: Maybe (Sensitive Text)
$sel:name:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Sensitive Text
$sel:appInstanceUserArn:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Text
$sel:metadata:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Metadata" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
metadata,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
name)
]
)
instance Data.ToPath UpdateAppInstanceUser where
toPath :: UpdateAppInstanceUser -> ByteString
toPath UpdateAppInstanceUser' {Maybe (Sensitive Text)
Text
Sensitive Text
name :: Sensitive Text
appInstanceUserArn :: Text
metadata :: Maybe (Sensitive Text)
$sel:name:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Sensitive Text
$sel:appInstanceUserArn:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Text
$sel:metadata:UpdateAppInstanceUser' :: UpdateAppInstanceUser -> Maybe (Sensitive Text)
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/app-instance-users/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
appInstanceUserArn
]
instance Data.ToQuery UpdateAppInstanceUser where
toQuery :: UpdateAppInstanceUser -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateAppInstanceUserResponse = UpdateAppInstanceUserResponse'
{
UpdateAppInstanceUserResponse -> Maybe Text
appInstanceUserArn :: Prelude.Maybe Prelude.Text,
UpdateAppInstanceUserResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateAppInstanceUserResponse
-> UpdateAppInstanceUserResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAppInstanceUserResponse
-> UpdateAppInstanceUserResponse -> Bool
$c/= :: UpdateAppInstanceUserResponse
-> UpdateAppInstanceUserResponse -> Bool
== :: UpdateAppInstanceUserResponse
-> UpdateAppInstanceUserResponse -> Bool
$c== :: UpdateAppInstanceUserResponse
-> UpdateAppInstanceUserResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAppInstanceUserResponse]
ReadPrec UpdateAppInstanceUserResponse
Int -> ReadS UpdateAppInstanceUserResponse
ReadS [UpdateAppInstanceUserResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAppInstanceUserResponse]
$creadListPrec :: ReadPrec [UpdateAppInstanceUserResponse]
readPrec :: ReadPrec UpdateAppInstanceUserResponse
$creadPrec :: ReadPrec UpdateAppInstanceUserResponse
readList :: ReadS [UpdateAppInstanceUserResponse]
$creadList :: ReadS [UpdateAppInstanceUserResponse]
readsPrec :: Int -> ReadS UpdateAppInstanceUserResponse
$creadsPrec :: Int -> ReadS UpdateAppInstanceUserResponse
Prelude.Read, Int -> UpdateAppInstanceUserResponse -> ShowS
[UpdateAppInstanceUserResponse] -> ShowS
UpdateAppInstanceUserResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAppInstanceUserResponse] -> ShowS
$cshowList :: [UpdateAppInstanceUserResponse] -> ShowS
show :: UpdateAppInstanceUserResponse -> String
$cshow :: UpdateAppInstanceUserResponse -> String
showsPrec :: Int -> UpdateAppInstanceUserResponse -> ShowS
$cshowsPrec :: Int -> UpdateAppInstanceUserResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateAppInstanceUserResponse x
-> UpdateAppInstanceUserResponse
forall x.
UpdateAppInstanceUserResponse
-> Rep UpdateAppInstanceUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAppInstanceUserResponse x
-> UpdateAppInstanceUserResponse
$cfrom :: forall x.
UpdateAppInstanceUserResponse
-> Rep UpdateAppInstanceUserResponse x
Prelude.Generic)
newUpdateAppInstanceUserResponse ::
Prelude.Int ->
UpdateAppInstanceUserResponse
newUpdateAppInstanceUserResponse :: Int -> UpdateAppInstanceUserResponse
newUpdateAppInstanceUserResponse Int
pHttpStatus_ =
UpdateAppInstanceUserResponse'
{ $sel:appInstanceUserArn:UpdateAppInstanceUserResponse' :: Maybe Text
appInstanceUserArn =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateAppInstanceUserResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateAppInstanceUserResponse_appInstanceUserArn :: Lens.Lens' UpdateAppInstanceUserResponse (Prelude.Maybe Prelude.Text)
updateAppInstanceUserResponse_appInstanceUserArn :: Lens' UpdateAppInstanceUserResponse (Maybe Text)
updateAppInstanceUserResponse_appInstanceUserArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppInstanceUserResponse' {Maybe Text
appInstanceUserArn :: Maybe Text
$sel:appInstanceUserArn:UpdateAppInstanceUserResponse' :: UpdateAppInstanceUserResponse -> Maybe Text
appInstanceUserArn} -> Maybe Text
appInstanceUserArn) (\s :: UpdateAppInstanceUserResponse
s@UpdateAppInstanceUserResponse' {} Maybe Text
a -> UpdateAppInstanceUserResponse
s {$sel:appInstanceUserArn:UpdateAppInstanceUserResponse' :: Maybe Text
appInstanceUserArn = Maybe Text
a} :: UpdateAppInstanceUserResponse)
updateAppInstanceUserResponse_httpStatus :: Lens.Lens' UpdateAppInstanceUserResponse Prelude.Int
updateAppInstanceUserResponse_httpStatus :: Lens' UpdateAppInstanceUserResponse Int
updateAppInstanceUserResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppInstanceUserResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAppInstanceUserResponse' :: UpdateAppInstanceUserResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateAppInstanceUserResponse
s@UpdateAppInstanceUserResponse' {} Int
a -> UpdateAppInstanceUserResponse
s {$sel:httpStatus:UpdateAppInstanceUserResponse' :: Int
httpStatus = Int
a} :: UpdateAppInstanceUserResponse)
instance Prelude.NFData UpdateAppInstanceUserResponse where
rnf :: UpdateAppInstanceUserResponse -> ()
rnf UpdateAppInstanceUserResponse' {Int
Maybe Text
httpStatus :: Int
appInstanceUserArn :: Maybe Text
$sel:httpStatus:UpdateAppInstanceUserResponse' :: UpdateAppInstanceUserResponse -> Int
$sel:appInstanceUserArn:UpdateAppInstanceUserResponse' :: UpdateAppInstanceUserResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
appInstanceUserArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus