{-# 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.UpdateAppInstance
(
UpdateAppInstance (..),
newUpdateAppInstance,
updateAppInstance_metadata,
updateAppInstance_appInstanceArn,
updateAppInstance_name,
UpdateAppInstanceResponse (..),
newUpdateAppInstanceResponse,
updateAppInstanceResponse_appInstanceArn,
updateAppInstanceResponse_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 UpdateAppInstance = UpdateAppInstance'
{
UpdateAppInstance -> Maybe (Sensitive Text)
metadata :: Prelude.Maybe (Data.Sensitive Prelude.Text),
UpdateAppInstance -> Text
appInstanceArn :: Prelude.Text,
UpdateAppInstance -> Sensitive Text
name :: Data.Sensitive Prelude.Text
}
deriving (UpdateAppInstance -> UpdateAppInstance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAppInstance -> UpdateAppInstance -> Bool
$c/= :: UpdateAppInstance -> UpdateAppInstance -> Bool
== :: UpdateAppInstance -> UpdateAppInstance -> Bool
$c== :: UpdateAppInstance -> UpdateAppInstance -> Bool
Prelude.Eq, Int -> UpdateAppInstance -> ShowS
[UpdateAppInstance] -> ShowS
UpdateAppInstance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAppInstance] -> ShowS
$cshowList :: [UpdateAppInstance] -> ShowS
show :: UpdateAppInstance -> String
$cshow :: UpdateAppInstance -> String
showsPrec :: Int -> UpdateAppInstance -> ShowS
$cshowsPrec :: Int -> UpdateAppInstance -> ShowS
Prelude.Show, forall x. Rep UpdateAppInstance x -> UpdateAppInstance
forall x. UpdateAppInstance -> Rep UpdateAppInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAppInstance x -> UpdateAppInstance
$cfrom :: forall x. UpdateAppInstance -> Rep UpdateAppInstance x
Prelude.Generic)
newUpdateAppInstance ::
Prelude.Text ->
Prelude.Text ->
UpdateAppInstance
newUpdateAppInstance :: Text -> Text -> UpdateAppInstance
newUpdateAppInstance Text
pAppInstanceArn_ Text
pName_ =
UpdateAppInstance'
{ $sel:metadata:UpdateAppInstance' :: Maybe (Sensitive Text)
metadata = forall a. Maybe a
Prelude.Nothing,
$sel:appInstanceArn:UpdateAppInstance' :: Text
appInstanceArn = Text
pAppInstanceArn_,
$sel:name:UpdateAppInstance' :: Sensitive Text
name = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pName_
}
updateAppInstance_metadata :: Lens.Lens' UpdateAppInstance (Prelude.Maybe Prelude.Text)
updateAppInstance_metadata :: Lens' UpdateAppInstance (Maybe Text)
updateAppInstance_metadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppInstance' {Maybe (Sensitive Text)
metadata :: Maybe (Sensitive Text)
$sel:metadata:UpdateAppInstance' :: UpdateAppInstance -> Maybe (Sensitive Text)
metadata} -> Maybe (Sensitive Text)
metadata) (\s :: UpdateAppInstance
s@UpdateAppInstance' {} Maybe (Sensitive Text)
a -> UpdateAppInstance
s {$sel:metadata:UpdateAppInstance' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
a} :: UpdateAppInstance) 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
updateAppInstance_appInstanceArn :: Lens.Lens' UpdateAppInstance Prelude.Text
updateAppInstance_appInstanceArn :: Lens' UpdateAppInstance Text
updateAppInstance_appInstanceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppInstance' {Text
appInstanceArn :: Text
$sel:appInstanceArn:UpdateAppInstance' :: UpdateAppInstance -> Text
appInstanceArn} -> Text
appInstanceArn) (\s :: UpdateAppInstance
s@UpdateAppInstance' {} Text
a -> UpdateAppInstance
s {$sel:appInstanceArn:UpdateAppInstance' :: Text
appInstanceArn = Text
a} :: UpdateAppInstance)
updateAppInstance_name :: Lens.Lens' UpdateAppInstance Prelude.Text
updateAppInstance_name :: Lens' UpdateAppInstance Text
updateAppInstance_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppInstance' {Sensitive Text
name :: Sensitive Text
$sel:name:UpdateAppInstance' :: UpdateAppInstance -> Sensitive Text
name} -> Sensitive Text
name) (\s :: UpdateAppInstance
s@UpdateAppInstance' {} Sensitive Text
a -> UpdateAppInstance
s {$sel:name:UpdateAppInstance' :: Sensitive Text
name = Sensitive Text
a} :: UpdateAppInstance) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Core.AWSRequest UpdateAppInstance where
type
AWSResponse UpdateAppInstance =
UpdateAppInstanceResponse
request :: (Service -> Service)
-> UpdateAppInstance -> Request UpdateAppInstance
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 UpdateAppInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateAppInstance)))
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 -> UpdateAppInstanceResponse
UpdateAppInstanceResponse'
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
"AppInstanceArn")
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 UpdateAppInstance where
hashWithSalt :: Int -> UpdateAppInstance -> Int
hashWithSalt Int
_salt UpdateAppInstance' {Maybe (Sensitive Text)
Text
Sensitive Text
name :: Sensitive Text
appInstanceArn :: Text
metadata :: Maybe (Sensitive Text)
$sel:name:UpdateAppInstance' :: UpdateAppInstance -> Sensitive Text
$sel:appInstanceArn:UpdateAppInstance' :: UpdateAppInstance -> Text
$sel:metadata:UpdateAppInstance' :: UpdateAppInstance -> 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
appInstanceArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
name
instance Prelude.NFData UpdateAppInstance where
rnf :: UpdateAppInstance -> ()
rnf UpdateAppInstance' {Maybe (Sensitive Text)
Text
Sensitive Text
name :: Sensitive Text
appInstanceArn :: Text
metadata :: Maybe (Sensitive Text)
$sel:name:UpdateAppInstance' :: UpdateAppInstance -> Sensitive Text
$sel:appInstanceArn:UpdateAppInstance' :: UpdateAppInstance -> Text
$sel:metadata:UpdateAppInstance' :: UpdateAppInstance -> 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
appInstanceArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
name
instance Data.ToHeaders UpdateAppInstance where
toHeaders :: UpdateAppInstance -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON UpdateAppInstance where
toJSON :: UpdateAppInstance -> Value
toJSON UpdateAppInstance' {Maybe (Sensitive Text)
Text
Sensitive Text
name :: Sensitive Text
appInstanceArn :: Text
metadata :: Maybe (Sensitive Text)
$sel:name:UpdateAppInstance' :: UpdateAppInstance -> Sensitive Text
$sel:appInstanceArn:UpdateAppInstance' :: UpdateAppInstance -> Text
$sel:metadata:UpdateAppInstance' :: UpdateAppInstance -> 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 UpdateAppInstance where
toPath :: UpdateAppInstance -> ByteString
toPath UpdateAppInstance' {Maybe (Sensitive Text)
Text
Sensitive Text
name :: Sensitive Text
appInstanceArn :: Text
metadata :: Maybe (Sensitive Text)
$sel:name:UpdateAppInstance' :: UpdateAppInstance -> Sensitive Text
$sel:appInstanceArn:UpdateAppInstance' :: UpdateAppInstance -> Text
$sel:metadata:UpdateAppInstance' :: UpdateAppInstance -> Maybe (Sensitive Text)
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/app-instances/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
appInstanceArn]
instance Data.ToQuery UpdateAppInstance where
toQuery :: UpdateAppInstance -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateAppInstanceResponse = UpdateAppInstanceResponse'
{
UpdateAppInstanceResponse -> Maybe Text
appInstanceArn :: Prelude.Maybe Prelude.Text,
UpdateAppInstanceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateAppInstanceResponse -> UpdateAppInstanceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAppInstanceResponse -> UpdateAppInstanceResponse -> Bool
$c/= :: UpdateAppInstanceResponse -> UpdateAppInstanceResponse -> Bool
== :: UpdateAppInstanceResponse -> UpdateAppInstanceResponse -> Bool
$c== :: UpdateAppInstanceResponse -> UpdateAppInstanceResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAppInstanceResponse]
ReadPrec UpdateAppInstanceResponse
Int -> ReadS UpdateAppInstanceResponse
ReadS [UpdateAppInstanceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAppInstanceResponse]
$creadListPrec :: ReadPrec [UpdateAppInstanceResponse]
readPrec :: ReadPrec UpdateAppInstanceResponse
$creadPrec :: ReadPrec UpdateAppInstanceResponse
readList :: ReadS [UpdateAppInstanceResponse]
$creadList :: ReadS [UpdateAppInstanceResponse]
readsPrec :: Int -> ReadS UpdateAppInstanceResponse
$creadsPrec :: Int -> ReadS UpdateAppInstanceResponse
Prelude.Read, Int -> UpdateAppInstanceResponse -> ShowS
[UpdateAppInstanceResponse] -> ShowS
UpdateAppInstanceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAppInstanceResponse] -> ShowS
$cshowList :: [UpdateAppInstanceResponse] -> ShowS
show :: UpdateAppInstanceResponse -> String
$cshow :: UpdateAppInstanceResponse -> String
showsPrec :: Int -> UpdateAppInstanceResponse -> ShowS
$cshowsPrec :: Int -> UpdateAppInstanceResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateAppInstanceResponse x -> UpdateAppInstanceResponse
forall x.
UpdateAppInstanceResponse -> Rep UpdateAppInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAppInstanceResponse x -> UpdateAppInstanceResponse
$cfrom :: forall x.
UpdateAppInstanceResponse -> Rep UpdateAppInstanceResponse x
Prelude.Generic)
newUpdateAppInstanceResponse ::
Prelude.Int ->
UpdateAppInstanceResponse
newUpdateAppInstanceResponse :: Int -> UpdateAppInstanceResponse
newUpdateAppInstanceResponse Int
pHttpStatus_ =
UpdateAppInstanceResponse'
{ $sel:appInstanceArn:UpdateAppInstanceResponse' :: Maybe Text
appInstanceArn =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateAppInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateAppInstanceResponse_appInstanceArn :: Lens.Lens' UpdateAppInstanceResponse (Prelude.Maybe Prelude.Text)
updateAppInstanceResponse_appInstanceArn :: Lens' UpdateAppInstanceResponse (Maybe Text)
updateAppInstanceResponse_appInstanceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppInstanceResponse' {Maybe Text
appInstanceArn :: Maybe Text
$sel:appInstanceArn:UpdateAppInstanceResponse' :: UpdateAppInstanceResponse -> Maybe Text
appInstanceArn} -> Maybe Text
appInstanceArn) (\s :: UpdateAppInstanceResponse
s@UpdateAppInstanceResponse' {} Maybe Text
a -> UpdateAppInstanceResponse
s {$sel:appInstanceArn:UpdateAppInstanceResponse' :: Maybe Text
appInstanceArn = Maybe Text
a} :: UpdateAppInstanceResponse)
updateAppInstanceResponse_httpStatus :: Lens.Lens' UpdateAppInstanceResponse Prelude.Int
updateAppInstanceResponse_httpStatus :: Lens' UpdateAppInstanceResponse Int
updateAppInstanceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppInstanceResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAppInstanceResponse' :: UpdateAppInstanceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateAppInstanceResponse
s@UpdateAppInstanceResponse' {} Int
a -> UpdateAppInstanceResponse
s {$sel:httpStatus:UpdateAppInstanceResponse' :: Int
httpStatus = Int
a} :: UpdateAppInstanceResponse)
instance Prelude.NFData UpdateAppInstanceResponse where
rnf :: UpdateAppInstanceResponse -> ()
rnf UpdateAppInstanceResponse' {Int
Maybe Text
httpStatus :: Int
appInstanceArn :: Maybe Text
$sel:httpStatus:UpdateAppInstanceResponse' :: UpdateAppInstanceResponse -> Int
$sel:appInstanceArn:UpdateAppInstanceResponse' :: UpdateAppInstanceResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
appInstanceArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus