{-# 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.Lens as Lens
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 (Core.Sensitive Prelude.Text),
UpdateAppInstanceUser -> Text
appInstanceUserArn :: Prelude.Text,
UpdateAppInstanceUser -> Sensitive Text
name :: Core.Sensitive Prelude.Text
}
deriving (UpdateAppInstanceUser -> UpdateAppInstanceUser -> Bool
(UpdateAppInstanceUser -> UpdateAppInstanceUser -> Bool)
-> (UpdateAppInstanceUser -> UpdateAppInstanceUser -> Bool)
-> Eq UpdateAppInstanceUser
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
(Int -> UpdateAppInstanceUser -> ShowS)
-> (UpdateAppInstanceUser -> String)
-> ([UpdateAppInstanceUser] -> ShowS)
-> Show UpdateAppInstanceUser
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. UpdateAppInstanceUser -> Rep UpdateAppInstanceUser x)
-> (forall x. Rep UpdateAppInstanceUser x -> UpdateAppInstanceUser)
-> Generic UpdateAppInstanceUser
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' :: Maybe (Sensitive Text)
-> Text -> Sensitive Text -> UpdateAppInstanceUser
UpdateAppInstanceUser'
{ $sel:metadata:UpdateAppInstanceUser' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:appInstanceUserArn:UpdateAppInstanceUser' :: Text
appInstanceUserArn = Text
pAppInstanceUserArn_,
$sel:name:UpdateAppInstanceUser' :: Sensitive Text
name = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pName_
}
updateAppInstanceUser_metadata :: Lens.Lens' UpdateAppInstanceUser (Prelude.Maybe Prelude.Text)
updateAppInstanceUser_metadata :: (Maybe Text -> f (Maybe Text))
-> UpdateAppInstanceUser -> f UpdateAppInstanceUser
updateAppInstanceUser_metadata = (UpdateAppInstanceUser -> Maybe (Sensitive Text))
-> (UpdateAppInstanceUser
-> Maybe (Sensitive Text) -> UpdateAppInstanceUser)
-> Lens
UpdateAppInstanceUser
UpdateAppInstanceUser
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
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) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> UpdateAppInstanceUser -> f UpdateAppInstanceUser)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateAppInstanceUser
-> f UpdateAppInstanceUser
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
updateAppInstanceUser_appInstanceUserArn :: Lens.Lens' UpdateAppInstanceUser Prelude.Text
updateAppInstanceUser_appInstanceUserArn :: (Text -> f Text)
-> UpdateAppInstanceUser -> f UpdateAppInstanceUser
updateAppInstanceUser_appInstanceUserArn = (UpdateAppInstanceUser -> Text)
-> (UpdateAppInstanceUser -> Text -> UpdateAppInstanceUser)
-> Lens UpdateAppInstanceUser UpdateAppInstanceUser Text Text
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 :: (Text -> f Text)
-> UpdateAppInstanceUser -> f UpdateAppInstanceUser
updateAppInstanceUser_name = (UpdateAppInstanceUser -> Sensitive Text)
-> (UpdateAppInstanceUser
-> Sensitive Text -> UpdateAppInstanceUser)
-> Lens
UpdateAppInstanceUser
UpdateAppInstanceUser
(Sensitive Text)
(Sensitive Text)
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) ((Sensitive Text -> f (Sensitive Text))
-> UpdateAppInstanceUser -> f UpdateAppInstanceUser)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> UpdateAppInstanceUser
-> f UpdateAppInstanceUser
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Core.AWSRequest UpdateAppInstanceUser where
type
AWSResponse UpdateAppInstanceUser =
UpdateAppInstanceUserResponse
request :: UpdateAppInstanceUser -> Request UpdateAppInstanceUser
request = Service -> UpdateAppInstanceUser -> Request UpdateAppInstanceUser
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateAppInstanceUser
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateAppInstanceUser)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateAppInstanceUser))
-> Logger
-> Service
-> Proxy UpdateAppInstanceUser
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateAppInstanceUser)))
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 -> Int -> UpdateAppInstanceUserResponse
UpdateAppInstanceUserResponse'
(Maybe Text -> Int -> UpdateAppInstanceUserResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateAppInstanceUserResponse)
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
"AppInstanceUserArn")
Either String (Int -> UpdateAppInstanceUserResponse)
-> Either String Int -> Either String UpdateAppInstanceUserResponse
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 UpdateAppInstanceUser
instance Prelude.NFData UpdateAppInstanceUser
instance Core.ToHeaders UpdateAppInstanceUser where
toHeaders :: UpdateAppInstanceUser -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateAppInstanceUser -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Metadata" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
metadata,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
name)
]
)
instance Core.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)
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/app-instance-users/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
appInstanceUserArn
]
instance Core.ToQuery UpdateAppInstanceUser where
toQuery :: UpdateAppInstanceUser -> QueryString
toQuery = QueryString -> UpdateAppInstanceUser -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(UpdateAppInstanceUserResponse
-> UpdateAppInstanceUserResponse -> Bool)
-> (UpdateAppInstanceUserResponse
-> UpdateAppInstanceUserResponse -> Bool)
-> Eq UpdateAppInstanceUserResponse
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]
(Int -> ReadS UpdateAppInstanceUserResponse)
-> ReadS [UpdateAppInstanceUserResponse]
-> ReadPrec UpdateAppInstanceUserResponse
-> ReadPrec [UpdateAppInstanceUserResponse]
-> Read 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
(Int -> UpdateAppInstanceUserResponse -> ShowS)
-> (UpdateAppInstanceUserResponse -> String)
-> ([UpdateAppInstanceUserResponse] -> ShowS)
-> Show UpdateAppInstanceUserResponse
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.
UpdateAppInstanceUserResponse
-> Rep UpdateAppInstanceUserResponse x)
-> (forall x.
Rep UpdateAppInstanceUserResponse x
-> UpdateAppInstanceUserResponse)
-> Generic UpdateAppInstanceUserResponse
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' :: Maybe Text -> Int -> UpdateAppInstanceUserResponse
UpdateAppInstanceUserResponse'
{ $sel:appInstanceUserArn:UpdateAppInstanceUserResponse' :: Maybe Text
appInstanceUserArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateAppInstanceUserResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateAppInstanceUserResponse_appInstanceUserArn :: Lens.Lens' UpdateAppInstanceUserResponse (Prelude.Maybe Prelude.Text)
updateAppInstanceUserResponse_appInstanceUserArn :: (Maybe Text -> f (Maybe Text))
-> UpdateAppInstanceUserResponse -> f UpdateAppInstanceUserResponse
updateAppInstanceUserResponse_appInstanceUserArn = (UpdateAppInstanceUserResponse -> Maybe Text)
-> (UpdateAppInstanceUserResponse
-> Maybe Text -> UpdateAppInstanceUserResponse)
-> Lens
UpdateAppInstanceUserResponse
UpdateAppInstanceUserResponse
(Maybe Text)
(Maybe Text)
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 :: (Int -> f Int)
-> UpdateAppInstanceUserResponse -> f UpdateAppInstanceUserResponse
updateAppInstanceUserResponse_httpStatus = (UpdateAppInstanceUserResponse -> Int)
-> (UpdateAppInstanceUserResponse
-> Int -> UpdateAppInstanceUserResponse)
-> Lens
UpdateAppInstanceUserResponse UpdateAppInstanceUserResponse Int Int
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