{-# 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.ResilienceHub.UpdateApp
(
UpdateApp (..),
newUpdateApp,
updateApp_assessmentSchedule,
updateApp_clearResiliencyPolicyArn,
updateApp_description,
updateApp_policyArn,
updateApp_appArn,
UpdateAppResponse (..),
newUpdateAppResponse,
updateAppResponse_httpStatus,
updateAppResponse_app,
)
where
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 Amazonka.ResilienceHub.Types
import qualified Amazonka.Response as Response
data UpdateApp = UpdateApp'
{
UpdateApp -> Maybe AppAssessmentScheduleType
assessmentSchedule :: Prelude.Maybe AppAssessmentScheduleType,
UpdateApp -> Maybe Bool
clearResiliencyPolicyArn :: Prelude.Maybe Prelude.Bool,
UpdateApp -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateApp -> Maybe Text
policyArn :: Prelude.Maybe Prelude.Text,
UpdateApp -> Text
appArn :: Prelude.Text
}
deriving (UpdateApp -> UpdateApp -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateApp -> UpdateApp -> Bool
$c/= :: UpdateApp -> UpdateApp -> Bool
== :: UpdateApp -> UpdateApp -> Bool
$c== :: UpdateApp -> UpdateApp -> Bool
Prelude.Eq, ReadPrec [UpdateApp]
ReadPrec UpdateApp
Int -> ReadS UpdateApp
ReadS [UpdateApp]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateApp]
$creadListPrec :: ReadPrec [UpdateApp]
readPrec :: ReadPrec UpdateApp
$creadPrec :: ReadPrec UpdateApp
readList :: ReadS [UpdateApp]
$creadList :: ReadS [UpdateApp]
readsPrec :: Int -> ReadS UpdateApp
$creadsPrec :: Int -> ReadS UpdateApp
Prelude.Read, Int -> UpdateApp -> ShowS
[UpdateApp] -> ShowS
UpdateApp -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateApp] -> ShowS
$cshowList :: [UpdateApp] -> ShowS
show :: UpdateApp -> String
$cshow :: UpdateApp -> String
showsPrec :: Int -> UpdateApp -> ShowS
$cshowsPrec :: Int -> UpdateApp -> ShowS
Prelude.Show, forall x. Rep UpdateApp x -> UpdateApp
forall x. UpdateApp -> Rep UpdateApp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateApp x -> UpdateApp
$cfrom :: forall x. UpdateApp -> Rep UpdateApp x
Prelude.Generic)
newUpdateApp ::
Prelude.Text ->
UpdateApp
newUpdateApp :: Text -> UpdateApp
newUpdateApp Text
pAppArn_ =
UpdateApp'
{ $sel:assessmentSchedule:UpdateApp' :: Maybe AppAssessmentScheduleType
assessmentSchedule = forall a. Maybe a
Prelude.Nothing,
$sel:clearResiliencyPolicyArn:UpdateApp' :: Maybe Bool
clearResiliencyPolicyArn = forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateApp' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:policyArn:UpdateApp' :: Maybe Text
policyArn = forall a. Maybe a
Prelude.Nothing,
$sel:appArn:UpdateApp' :: Text
appArn = Text
pAppArn_
}
updateApp_assessmentSchedule :: Lens.Lens' UpdateApp (Prelude.Maybe AppAssessmentScheduleType)
updateApp_assessmentSchedule :: Lens' UpdateApp (Maybe AppAssessmentScheduleType)
updateApp_assessmentSchedule = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe AppAssessmentScheduleType
assessmentSchedule :: Maybe AppAssessmentScheduleType
$sel:assessmentSchedule:UpdateApp' :: UpdateApp -> Maybe AppAssessmentScheduleType
assessmentSchedule} -> Maybe AppAssessmentScheduleType
assessmentSchedule) (\s :: UpdateApp
s@UpdateApp' {} Maybe AppAssessmentScheduleType
a -> UpdateApp
s {$sel:assessmentSchedule:UpdateApp' :: Maybe AppAssessmentScheduleType
assessmentSchedule = Maybe AppAssessmentScheduleType
a} :: UpdateApp)
updateApp_clearResiliencyPolicyArn :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Bool)
updateApp_clearResiliencyPolicyArn :: Lens' UpdateApp (Maybe Bool)
updateApp_clearResiliencyPolicyArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Bool
clearResiliencyPolicyArn :: Maybe Bool
$sel:clearResiliencyPolicyArn:UpdateApp' :: UpdateApp -> Maybe Bool
clearResiliencyPolicyArn} -> Maybe Bool
clearResiliencyPolicyArn) (\s :: UpdateApp
s@UpdateApp' {} Maybe Bool
a -> UpdateApp
s {$sel:clearResiliencyPolicyArn:UpdateApp' :: Maybe Bool
clearResiliencyPolicyArn = Maybe Bool
a} :: UpdateApp)
updateApp_description :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_description :: Lens' UpdateApp (Maybe Text)
updateApp_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Text
description :: Maybe Text
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateApp
s@UpdateApp' {} Maybe Text
a -> UpdateApp
s {$sel:description:UpdateApp' :: Maybe Text
description = Maybe Text
a} :: UpdateApp)
updateApp_policyArn :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_policyArn :: Lens' UpdateApp (Maybe Text)
updateApp_policyArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Text
policyArn :: Maybe Text
$sel:policyArn:UpdateApp' :: UpdateApp -> Maybe Text
policyArn} -> Maybe Text
policyArn) (\s :: UpdateApp
s@UpdateApp' {} Maybe Text
a -> UpdateApp
s {$sel:policyArn:UpdateApp' :: Maybe Text
policyArn = Maybe Text
a} :: UpdateApp)
updateApp_appArn :: Lens.Lens' UpdateApp Prelude.Text
updateApp_appArn :: Lens' UpdateApp Text
updateApp_appArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Text
appArn :: Text
$sel:appArn:UpdateApp' :: UpdateApp -> Text
appArn} -> Text
appArn) (\s :: UpdateApp
s@UpdateApp' {} Text
a -> UpdateApp
s {$sel:appArn:UpdateApp' :: Text
appArn = Text
a} :: UpdateApp)
instance Core.AWSRequest UpdateApp where
type AWSResponse UpdateApp = UpdateAppResponse
request :: (Service -> Service) -> UpdateApp -> Request UpdateApp
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateApp)))
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 ->
Int -> App -> UpdateAppResponse
UpdateAppResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"app")
)
instance Prelude.Hashable UpdateApp where
hashWithSalt :: Int -> UpdateApp -> Int
hashWithSalt Int
_salt UpdateApp' {Maybe Bool
Maybe Text
Maybe AppAssessmentScheduleType
Text
appArn :: Text
policyArn :: Maybe Text
description :: Maybe Text
clearResiliencyPolicyArn :: Maybe Bool
assessmentSchedule :: Maybe AppAssessmentScheduleType
$sel:appArn:UpdateApp' :: UpdateApp -> Text
$sel:policyArn:UpdateApp' :: UpdateApp -> Maybe Text
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
$sel:clearResiliencyPolicyArn:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:assessmentSchedule:UpdateApp' :: UpdateApp -> Maybe AppAssessmentScheduleType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AppAssessmentScheduleType
assessmentSchedule
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
clearResiliencyPolicyArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policyArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appArn
instance Prelude.NFData UpdateApp where
rnf :: UpdateApp -> ()
rnf UpdateApp' {Maybe Bool
Maybe Text
Maybe AppAssessmentScheduleType
Text
appArn :: Text
policyArn :: Maybe Text
description :: Maybe Text
clearResiliencyPolicyArn :: Maybe Bool
assessmentSchedule :: Maybe AppAssessmentScheduleType
$sel:appArn:UpdateApp' :: UpdateApp -> Text
$sel:policyArn:UpdateApp' :: UpdateApp -> Maybe Text
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
$sel:clearResiliencyPolicyArn:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:assessmentSchedule:UpdateApp' :: UpdateApp -> Maybe AppAssessmentScheduleType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AppAssessmentScheduleType
assessmentSchedule
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
clearResiliencyPolicyArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policyArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
appArn
instance Data.ToHeaders UpdateApp where
toHeaders :: UpdateApp -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdateApp where
toJSON :: UpdateApp -> Value
toJSON UpdateApp' {Maybe Bool
Maybe Text
Maybe AppAssessmentScheduleType
Text
appArn :: Text
policyArn :: Maybe Text
description :: Maybe Text
clearResiliencyPolicyArn :: Maybe Bool
assessmentSchedule :: Maybe AppAssessmentScheduleType
$sel:appArn:UpdateApp' :: UpdateApp -> Text
$sel:policyArn:UpdateApp' :: UpdateApp -> Maybe Text
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
$sel:clearResiliencyPolicyArn:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:assessmentSchedule:UpdateApp' :: UpdateApp -> Maybe AppAssessmentScheduleType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"assessmentSchedule" 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 AppAssessmentScheduleType
assessmentSchedule,
(Key
"clearResiliencyPolicyArn" 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 Bool
clearResiliencyPolicyArn,
(Key
"description" 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 Text
description,
(Key
"policyArn" 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 Text
policyArn,
forall a. a -> Maybe a
Prelude.Just (Key
"appArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
appArn)
]
)
instance Data.ToPath UpdateApp where
toPath :: UpdateApp -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/update-app"
instance Data.ToQuery UpdateApp where
toQuery :: UpdateApp -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateAppResponse = UpdateAppResponse'
{
UpdateAppResponse -> Int
httpStatus :: Prelude.Int,
UpdateAppResponse -> App
app :: App
}
deriving (UpdateAppResponse -> UpdateAppResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAppResponse -> UpdateAppResponse -> Bool
$c/= :: UpdateAppResponse -> UpdateAppResponse -> Bool
== :: UpdateAppResponse -> UpdateAppResponse -> Bool
$c== :: UpdateAppResponse -> UpdateAppResponse -> Bool
Prelude.Eq, Int -> UpdateAppResponse -> ShowS
[UpdateAppResponse] -> ShowS
UpdateAppResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAppResponse] -> ShowS
$cshowList :: [UpdateAppResponse] -> ShowS
show :: UpdateAppResponse -> String
$cshow :: UpdateAppResponse -> String
showsPrec :: Int -> UpdateAppResponse -> ShowS
$cshowsPrec :: Int -> UpdateAppResponse -> ShowS
Prelude.Show, forall x. Rep UpdateAppResponse x -> UpdateAppResponse
forall x. UpdateAppResponse -> Rep UpdateAppResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAppResponse x -> UpdateAppResponse
$cfrom :: forall x. UpdateAppResponse -> Rep UpdateAppResponse x
Prelude.Generic)
newUpdateAppResponse ::
Prelude.Int ->
App ->
UpdateAppResponse
newUpdateAppResponse :: Int -> App -> UpdateAppResponse
newUpdateAppResponse Int
pHttpStatus_ App
pApp_ =
UpdateAppResponse'
{ $sel:httpStatus:UpdateAppResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:app:UpdateAppResponse' :: App
app = App
pApp_
}
updateAppResponse_httpStatus :: Lens.Lens' UpdateAppResponse Prelude.Int
updateAppResponse_httpStatus :: Lens' UpdateAppResponse Int
updateAppResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAppResponse' :: UpdateAppResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateAppResponse
s@UpdateAppResponse' {} Int
a -> UpdateAppResponse
s {$sel:httpStatus:UpdateAppResponse' :: Int
httpStatus = Int
a} :: UpdateAppResponse)
updateAppResponse_app :: Lens.Lens' UpdateAppResponse App
updateAppResponse_app :: Lens' UpdateAppResponse App
updateAppResponse_app = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAppResponse' {App
app :: App
$sel:app:UpdateAppResponse' :: UpdateAppResponse -> App
app} -> App
app) (\s :: UpdateAppResponse
s@UpdateAppResponse' {} App
a -> UpdateAppResponse
s {$sel:app:UpdateAppResponse' :: App
app = App
a} :: UpdateAppResponse)
instance Prelude.NFData UpdateAppResponse where
rnf :: UpdateAppResponse -> ()
rnf UpdateAppResponse' {Int
App
app :: App
httpStatus :: Int
$sel:app:UpdateAppResponse' :: UpdateAppResponse -> App
$sel:httpStatus:UpdateAppResponse' :: UpdateAppResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf App
app