{-# 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.Budgets.UpdateBudgetAction
(
UpdateBudgetAction (..),
newUpdateBudgetAction,
updateBudgetAction_definition,
updateBudgetAction_executionRoleArn,
updateBudgetAction_actionThreshold,
updateBudgetAction_notificationType,
updateBudgetAction_approvalModel,
updateBudgetAction_subscribers,
updateBudgetAction_accountId,
updateBudgetAction_budgetName,
updateBudgetAction_actionId,
UpdateBudgetActionResponse (..),
newUpdateBudgetActionResponse,
updateBudgetActionResponse_httpStatus,
updateBudgetActionResponse_accountId,
updateBudgetActionResponse_budgetName,
updateBudgetActionResponse_oldAction,
updateBudgetActionResponse_newAction,
)
where
import Amazonka.Budgets.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 UpdateBudgetAction = UpdateBudgetAction'
{ UpdateBudgetAction -> Maybe Definition
definition :: Prelude.Maybe Definition,
UpdateBudgetAction -> Maybe Text
executionRoleArn :: Prelude.Maybe Prelude.Text,
UpdateBudgetAction -> Maybe ActionThreshold
actionThreshold :: Prelude.Maybe ActionThreshold,
UpdateBudgetAction -> Maybe NotificationType
notificationType :: Prelude.Maybe NotificationType,
UpdateBudgetAction -> Maybe ApprovalModel
approvalModel :: Prelude.Maybe ApprovalModel,
UpdateBudgetAction -> Maybe (NonEmpty Subscriber)
subscribers :: Prelude.Maybe (Prelude.NonEmpty Subscriber),
UpdateBudgetAction -> Text
accountId :: Prelude.Text,
UpdateBudgetAction -> Text
budgetName :: Prelude.Text,
UpdateBudgetAction -> Text
actionId :: Prelude.Text
}
deriving (UpdateBudgetAction -> UpdateBudgetAction -> Bool
(UpdateBudgetAction -> UpdateBudgetAction -> Bool)
-> (UpdateBudgetAction -> UpdateBudgetAction -> Bool)
-> Eq UpdateBudgetAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBudgetAction -> UpdateBudgetAction -> Bool
$c/= :: UpdateBudgetAction -> UpdateBudgetAction -> Bool
== :: UpdateBudgetAction -> UpdateBudgetAction -> Bool
$c== :: UpdateBudgetAction -> UpdateBudgetAction -> Bool
Prelude.Eq, Int -> UpdateBudgetAction -> ShowS
[UpdateBudgetAction] -> ShowS
UpdateBudgetAction -> String
(Int -> UpdateBudgetAction -> ShowS)
-> (UpdateBudgetAction -> String)
-> ([UpdateBudgetAction] -> ShowS)
-> Show UpdateBudgetAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBudgetAction] -> ShowS
$cshowList :: [UpdateBudgetAction] -> ShowS
show :: UpdateBudgetAction -> String
$cshow :: UpdateBudgetAction -> String
showsPrec :: Int -> UpdateBudgetAction -> ShowS
$cshowsPrec :: Int -> UpdateBudgetAction -> ShowS
Prelude.Show, (forall x. UpdateBudgetAction -> Rep UpdateBudgetAction x)
-> (forall x. Rep UpdateBudgetAction x -> UpdateBudgetAction)
-> Generic UpdateBudgetAction
forall x. Rep UpdateBudgetAction x -> UpdateBudgetAction
forall x. UpdateBudgetAction -> Rep UpdateBudgetAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateBudgetAction x -> UpdateBudgetAction
$cfrom :: forall x. UpdateBudgetAction -> Rep UpdateBudgetAction x
Prelude.Generic)
newUpdateBudgetAction ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
UpdateBudgetAction
newUpdateBudgetAction :: Text -> Text -> Text -> UpdateBudgetAction
newUpdateBudgetAction
Text
pAccountId_
Text
pBudgetName_
Text
pActionId_ =
UpdateBudgetAction' :: Maybe Definition
-> Maybe Text
-> Maybe ActionThreshold
-> Maybe NotificationType
-> Maybe ApprovalModel
-> Maybe (NonEmpty Subscriber)
-> Text
-> Text
-> Text
-> UpdateBudgetAction
UpdateBudgetAction'
{ $sel:definition:UpdateBudgetAction' :: Maybe Definition
definition = Maybe Definition
forall a. Maybe a
Prelude.Nothing,
$sel:executionRoleArn:UpdateBudgetAction' :: Maybe Text
executionRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:actionThreshold:UpdateBudgetAction' :: Maybe ActionThreshold
actionThreshold = Maybe ActionThreshold
forall a. Maybe a
Prelude.Nothing,
$sel:notificationType:UpdateBudgetAction' :: Maybe NotificationType
notificationType = Maybe NotificationType
forall a. Maybe a
Prelude.Nothing,
$sel:approvalModel:UpdateBudgetAction' :: Maybe ApprovalModel
approvalModel = Maybe ApprovalModel
forall a. Maybe a
Prelude.Nothing,
$sel:subscribers:UpdateBudgetAction' :: Maybe (NonEmpty Subscriber)
subscribers = Maybe (NonEmpty Subscriber)
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:UpdateBudgetAction' :: Text
accountId = Text
pAccountId_,
$sel:budgetName:UpdateBudgetAction' :: Text
budgetName = Text
pBudgetName_,
$sel:actionId:UpdateBudgetAction' :: Text
actionId = Text
pActionId_
}
updateBudgetAction_definition :: Lens.Lens' UpdateBudgetAction (Prelude.Maybe Definition)
updateBudgetAction_definition :: (Maybe Definition -> f (Maybe Definition))
-> UpdateBudgetAction -> f UpdateBudgetAction
updateBudgetAction_definition = (UpdateBudgetAction -> Maybe Definition)
-> (UpdateBudgetAction -> Maybe Definition -> UpdateBudgetAction)
-> Lens
UpdateBudgetAction
UpdateBudgetAction
(Maybe Definition)
(Maybe Definition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetAction' {Maybe Definition
definition :: Maybe Definition
$sel:definition:UpdateBudgetAction' :: UpdateBudgetAction -> Maybe Definition
definition} -> Maybe Definition
definition) (\s :: UpdateBudgetAction
s@UpdateBudgetAction' {} Maybe Definition
a -> UpdateBudgetAction
s {$sel:definition:UpdateBudgetAction' :: Maybe Definition
definition = Maybe Definition
a} :: UpdateBudgetAction)
updateBudgetAction_executionRoleArn :: Lens.Lens' UpdateBudgetAction (Prelude.Maybe Prelude.Text)
updateBudgetAction_executionRoleArn :: (Maybe Text -> f (Maybe Text))
-> UpdateBudgetAction -> f UpdateBudgetAction
updateBudgetAction_executionRoleArn = (UpdateBudgetAction -> Maybe Text)
-> (UpdateBudgetAction -> Maybe Text -> UpdateBudgetAction)
-> Lens
UpdateBudgetAction UpdateBudgetAction (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetAction' {Maybe Text
executionRoleArn :: Maybe Text
$sel:executionRoleArn:UpdateBudgetAction' :: UpdateBudgetAction -> Maybe Text
executionRoleArn} -> Maybe Text
executionRoleArn) (\s :: UpdateBudgetAction
s@UpdateBudgetAction' {} Maybe Text
a -> UpdateBudgetAction
s {$sel:executionRoleArn:UpdateBudgetAction' :: Maybe Text
executionRoleArn = Maybe Text
a} :: UpdateBudgetAction)
updateBudgetAction_actionThreshold :: Lens.Lens' UpdateBudgetAction (Prelude.Maybe ActionThreshold)
updateBudgetAction_actionThreshold :: (Maybe ActionThreshold -> f (Maybe ActionThreshold))
-> UpdateBudgetAction -> f UpdateBudgetAction
updateBudgetAction_actionThreshold = (UpdateBudgetAction -> Maybe ActionThreshold)
-> (UpdateBudgetAction
-> Maybe ActionThreshold -> UpdateBudgetAction)
-> Lens
UpdateBudgetAction
UpdateBudgetAction
(Maybe ActionThreshold)
(Maybe ActionThreshold)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetAction' {Maybe ActionThreshold
actionThreshold :: Maybe ActionThreshold
$sel:actionThreshold:UpdateBudgetAction' :: UpdateBudgetAction -> Maybe ActionThreshold
actionThreshold} -> Maybe ActionThreshold
actionThreshold) (\s :: UpdateBudgetAction
s@UpdateBudgetAction' {} Maybe ActionThreshold
a -> UpdateBudgetAction
s {$sel:actionThreshold:UpdateBudgetAction' :: Maybe ActionThreshold
actionThreshold = Maybe ActionThreshold
a} :: UpdateBudgetAction)
updateBudgetAction_notificationType :: Lens.Lens' UpdateBudgetAction (Prelude.Maybe NotificationType)
updateBudgetAction_notificationType :: (Maybe NotificationType -> f (Maybe NotificationType))
-> UpdateBudgetAction -> f UpdateBudgetAction
updateBudgetAction_notificationType = (UpdateBudgetAction -> Maybe NotificationType)
-> (UpdateBudgetAction
-> Maybe NotificationType -> UpdateBudgetAction)
-> Lens
UpdateBudgetAction
UpdateBudgetAction
(Maybe NotificationType)
(Maybe NotificationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetAction' {Maybe NotificationType
notificationType :: Maybe NotificationType
$sel:notificationType:UpdateBudgetAction' :: UpdateBudgetAction -> Maybe NotificationType
notificationType} -> Maybe NotificationType
notificationType) (\s :: UpdateBudgetAction
s@UpdateBudgetAction' {} Maybe NotificationType
a -> UpdateBudgetAction
s {$sel:notificationType:UpdateBudgetAction' :: Maybe NotificationType
notificationType = Maybe NotificationType
a} :: UpdateBudgetAction)
updateBudgetAction_approvalModel :: Lens.Lens' UpdateBudgetAction (Prelude.Maybe ApprovalModel)
updateBudgetAction_approvalModel :: (Maybe ApprovalModel -> f (Maybe ApprovalModel))
-> UpdateBudgetAction -> f UpdateBudgetAction
updateBudgetAction_approvalModel = (UpdateBudgetAction -> Maybe ApprovalModel)
-> (UpdateBudgetAction
-> Maybe ApprovalModel -> UpdateBudgetAction)
-> Lens
UpdateBudgetAction
UpdateBudgetAction
(Maybe ApprovalModel)
(Maybe ApprovalModel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetAction' {Maybe ApprovalModel
approvalModel :: Maybe ApprovalModel
$sel:approvalModel:UpdateBudgetAction' :: UpdateBudgetAction -> Maybe ApprovalModel
approvalModel} -> Maybe ApprovalModel
approvalModel) (\s :: UpdateBudgetAction
s@UpdateBudgetAction' {} Maybe ApprovalModel
a -> UpdateBudgetAction
s {$sel:approvalModel:UpdateBudgetAction' :: Maybe ApprovalModel
approvalModel = Maybe ApprovalModel
a} :: UpdateBudgetAction)
updateBudgetAction_subscribers :: Lens.Lens' UpdateBudgetAction (Prelude.Maybe (Prelude.NonEmpty Subscriber))
updateBudgetAction_subscribers :: (Maybe (NonEmpty Subscriber) -> f (Maybe (NonEmpty Subscriber)))
-> UpdateBudgetAction -> f UpdateBudgetAction
updateBudgetAction_subscribers = (UpdateBudgetAction -> Maybe (NonEmpty Subscriber))
-> (UpdateBudgetAction
-> Maybe (NonEmpty Subscriber) -> UpdateBudgetAction)
-> Lens
UpdateBudgetAction
UpdateBudgetAction
(Maybe (NonEmpty Subscriber))
(Maybe (NonEmpty Subscriber))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetAction' {Maybe (NonEmpty Subscriber)
subscribers :: Maybe (NonEmpty Subscriber)
$sel:subscribers:UpdateBudgetAction' :: UpdateBudgetAction -> Maybe (NonEmpty Subscriber)
subscribers} -> Maybe (NonEmpty Subscriber)
subscribers) (\s :: UpdateBudgetAction
s@UpdateBudgetAction' {} Maybe (NonEmpty Subscriber)
a -> UpdateBudgetAction
s {$sel:subscribers:UpdateBudgetAction' :: Maybe (NonEmpty Subscriber)
subscribers = Maybe (NonEmpty Subscriber)
a} :: UpdateBudgetAction) ((Maybe (NonEmpty Subscriber) -> f (Maybe (NonEmpty Subscriber)))
-> UpdateBudgetAction -> f UpdateBudgetAction)
-> ((Maybe (NonEmpty Subscriber)
-> f (Maybe (NonEmpty Subscriber)))
-> Maybe (NonEmpty Subscriber) -> f (Maybe (NonEmpty Subscriber)))
-> (Maybe (NonEmpty Subscriber) -> f (Maybe (NonEmpty Subscriber)))
-> UpdateBudgetAction
-> f UpdateBudgetAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Subscriber)
(NonEmpty Subscriber)
(NonEmpty Subscriber)
(NonEmpty Subscriber)
-> Iso
(Maybe (NonEmpty Subscriber))
(Maybe (NonEmpty Subscriber))
(Maybe (NonEmpty Subscriber))
(Maybe (NonEmpty Subscriber))
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
(NonEmpty Subscriber)
(NonEmpty Subscriber)
(NonEmpty Subscriber)
(NonEmpty Subscriber)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateBudgetAction_accountId :: Lens.Lens' UpdateBudgetAction Prelude.Text
updateBudgetAction_accountId :: (Text -> f Text) -> UpdateBudgetAction -> f UpdateBudgetAction
updateBudgetAction_accountId = (UpdateBudgetAction -> Text)
-> (UpdateBudgetAction -> Text -> UpdateBudgetAction)
-> Lens UpdateBudgetAction UpdateBudgetAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetAction' {Text
accountId :: Text
$sel:accountId:UpdateBudgetAction' :: UpdateBudgetAction -> Text
accountId} -> Text
accountId) (\s :: UpdateBudgetAction
s@UpdateBudgetAction' {} Text
a -> UpdateBudgetAction
s {$sel:accountId:UpdateBudgetAction' :: Text
accountId = Text
a} :: UpdateBudgetAction)
updateBudgetAction_budgetName :: Lens.Lens' UpdateBudgetAction Prelude.Text
updateBudgetAction_budgetName :: (Text -> f Text) -> UpdateBudgetAction -> f UpdateBudgetAction
updateBudgetAction_budgetName = (UpdateBudgetAction -> Text)
-> (UpdateBudgetAction -> Text -> UpdateBudgetAction)
-> Lens UpdateBudgetAction UpdateBudgetAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetAction' {Text
budgetName :: Text
$sel:budgetName:UpdateBudgetAction' :: UpdateBudgetAction -> Text
budgetName} -> Text
budgetName) (\s :: UpdateBudgetAction
s@UpdateBudgetAction' {} Text
a -> UpdateBudgetAction
s {$sel:budgetName:UpdateBudgetAction' :: Text
budgetName = Text
a} :: UpdateBudgetAction)
updateBudgetAction_actionId :: Lens.Lens' UpdateBudgetAction Prelude.Text
updateBudgetAction_actionId :: (Text -> f Text) -> UpdateBudgetAction -> f UpdateBudgetAction
updateBudgetAction_actionId = (UpdateBudgetAction -> Text)
-> (UpdateBudgetAction -> Text -> UpdateBudgetAction)
-> Lens UpdateBudgetAction UpdateBudgetAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetAction' {Text
actionId :: Text
$sel:actionId:UpdateBudgetAction' :: UpdateBudgetAction -> Text
actionId} -> Text
actionId) (\s :: UpdateBudgetAction
s@UpdateBudgetAction' {} Text
a -> UpdateBudgetAction
s {$sel:actionId:UpdateBudgetAction' :: Text
actionId = Text
a} :: UpdateBudgetAction)
instance Core.AWSRequest UpdateBudgetAction where
type
AWSResponse UpdateBudgetAction =
UpdateBudgetActionResponse
request :: UpdateBudgetAction -> Request UpdateBudgetAction
request = Service -> UpdateBudgetAction -> Request UpdateBudgetAction
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateBudgetAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateBudgetAction)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateBudgetAction))
-> Logger
-> Service
-> Proxy UpdateBudgetAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateBudgetAction)))
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 ->
Int
-> Text -> Text -> Action -> Action -> UpdateBudgetActionResponse
UpdateBudgetActionResponse'
(Int
-> Text -> Text -> Action -> Action -> UpdateBudgetActionResponse)
-> Either String Int
-> Either
String
(Text -> Text -> Action -> Action -> UpdateBudgetActionResponse)
forall (f :: * -> *) a b. Functor 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))
Either
String
(Text -> Text -> Action -> Action -> UpdateBudgetActionResponse)
-> Either String Text
-> Either
String (Text -> Action -> Action -> UpdateBudgetActionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"AccountId")
Either
String (Text -> Action -> Action -> UpdateBudgetActionResponse)
-> Either String Text
-> Either String (Action -> Action -> UpdateBudgetActionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"BudgetName")
Either String (Action -> Action -> UpdateBudgetActionResponse)
-> Either String Action
-> Either String (Action -> UpdateBudgetActionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Action
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"OldAction")
Either String (Action -> UpdateBudgetActionResponse)
-> Either String Action -> Either String UpdateBudgetActionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Action
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"NewAction")
)
instance Prelude.Hashable UpdateBudgetAction
instance Prelude.NFData UpdateBudgetAction
instance Core.ToHeaders UpdateBudgetAction where
toHeaders :: UpdateBudgetAction -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateBudgetAction -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSBudgetServiceGateway.UpdateBudgetAction" ::
Prelude.ByteString
),
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 UpdateBudgetAction where
toJSON :: UpdateBudgetAction -> Value
toJSON UpdateBudgetAction' {Maybe (NonEmpty Subscriber)
Maybe Text
Maybe ApprovalModel
Maybe NotificationType
Maybe Definition
Maybe ActionThreshold
Text
actionId :: Text
budgetName :: Text
accountId :: Text
subscribers :: Maybe (NonEmpty Subscriber)
approvalModel :: Maybe ApprovalModel
notificationType :: Maybe NotificationType
actionThreshold :: Maybe ActionThreshold
executionRoleArn :: Maybe Text
definition :: Maybe Definition
$sel:actionId:UpdateBudgetAction' :: UpdateBudgetAction -> Text
$sel:budgetName:UpdateBudgetAction' :: UpdateBudgetAction -> Text
$sel:accountId:UpdateBudgetAction' :: UpdateBudgetAction -> Text
$sel:subscribers:UpdateBudgetAction' :: UpdateBudgetAction -> Maybe (NonEmpty Subscriber)
$sel:approvalModel:UpdateBudgetAction' :: UpdateBudgetAction -> Maybe ApprovalModel
$sel:notificationType:UpdateBudgetAction' :: UpdateBudgetAction -> Maybe NotificationType
$sel:actionThreshold:UpdateBudgetAction' :: UpdateBudgetAction -> Maybe ActionThreshold
$sel:executionRoleArn:UpdateBudgetAction' :: UpdateBudgetAction -> Maybe Text
$sel:definition:UpdateBudgetAction' :: UpdateBudgetAction -> Maybe Definition
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Definition" Text -> Definition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Definition -> Pair) -> Maybe Definition -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Definition
definition,
(Text
"ExecutionRoleArn" 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
executionRoleArn,
(Text
"ActionThreshold" Text -> ActionThreshold -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ActionThreshold -> Pair) -> Maybe ActionThreshold -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ActionThreshold
actionThreshold,
(Text
"NotificationType" Text -> NotificationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NotificationType -> Pair) -> Maybe NotificationType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotificationType
notificationType,
(Text
"ApprovalModel" Text -> ApprovalModel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ApprovalModel -> Pair) -> Maybe ApprovalModel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ApprovalModel
approvalModel,
(Text
"Subscribers" Text -> NonEmpty Subscriber -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Subscriber -> Pair)
-> Maybe (NonEmpty Subscriber) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Subscriber)
subscribers,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
accountId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"BudgetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
budgetName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ActionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
actionId)
]
)
instance Core.ToPath UpdateBudgetAction where
toPath :: UpdateBudgetAction -> ByteString
toPath = ByteString -> UpdateBudgetAction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateBudgetAction where
toQuery :: UpdateBudgetAction -> QueryString
toQuery = QueryString -> UpdateBudgetAction -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateBudgetActionResponse = UpdateBudgetActionResponse'
{
UpdateBudgetActionResponse -> Int
httpStatus :: Prelude.Int,
UpdateBudgetActionResponse -> Text
accountId :: Prelude.Text,
UpdateBudgetActionResponse -> Text
budgetName :: Prelude.Text,
UpdateBudgetActionResponse -> Action
oldAction :: Action,
UpdateBudgetActionResponse -> Action
newAction' :: Action
}
deriving (UpdateBudgetActionResponse -> UpdateBudgetActionResponse -> Bool
(UpdateBudgetActionResponse -> UpdateBudgetActionResponse -> Bool)
-> (UpdateBudgetActionResponse
-> UpdateBudgetActionResponse -> Bool)
-> Eq UpdateBudgetActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBudgetActionResponse -> UpdateBudgetActionResponse -> Bool
$c/= :: UpdateBudgetActionResponse -> UpdateBudgetActionResponse -> Bool
== :: UpdateBudgetActionResponse -> UpdateBudgetActionResponse -> Bool
$c== :: UpdateBudgetActionResponse -> UpdateBudgetActionResponse -> Bool
Prelude.Eq, Int -> UpdateBudgetActionResponse -> ShowS
[UpdateBudgetActionResponse] -> ShowS
UpdateBudgetActionResponse -> String
(Int -> UpdateBudgetActionResponse -> ShowS)
-> (UpdateBudgetActionResponse -> String)
-> ([UpdateBudgetActionResponse] -> ShowS)
-> Show UpdateBudgetActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBudgetActionResponse] -> ShowS
$cshowList :: [UpdateBudgetActionResponse] -> ShowS
show :: UpdateBudgetActionResponse -> String
$cshow :: UpdateBudgetActionResponse -> String
showsPrec :: Int -> UpdateBudgetActionResponse -> ShowS
$cshowsPrec :: Int -> UpdateBudgetActionResponse -> ShowS
Prelude.Show, (forall x.
UpdateBudgetActionResponse -> Rep UpdateBudgetActionResponse x)
-> (forall x.
Rep UpdateBudgetActionResponse x -> UpdateBudgetActionResponse)
-> Generic UpdateBudgetActionResponse
forall x.
Rep UpdateBudgetActionResponse x -> UpdateBudgetActionResponse
forall x.
UpdateBudgetActionResponse -> Rep UpdateBudgetActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateBudgetActionResponse x -> UpdateBudgetActionResponse
$cfrom :: forall x.
UpdateBudgetActionResponse -> Rep UpdateBudgetActionResponse x
Prelude.Generic)
newUpdateBudgetActionResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
Action ->
Action ->
UpdateBudgetActionResponse
newUpdateBudgetActionResponse :: Int
-> Text -> Text -> Action -> Action -> UpdateBudgetActionResponse
newUpdateBudgetActionResponse
Int
pHttpStatus_
Text
pAccountId_
Text
pBudgetName_
Action
pOldAction_
Action
pNewAction_ =
UpdateBudgetActionResponse' :: Int
-> Text -> Text -> Action -> Action -> UpdateBudgetActionResponse
UpdateBudgetActionResponse'
{ $sel:httpStatus:UpdateBudgetActionResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:accountId:UpdateBudgetActionResponse' :: Text
accountId = Text
pAccountId_,
$sel:budgetName:UpdateBudgetActionResponse' :: Text
budgetName = Text
pBudgetName_,
$sel:oldAction:UpdateBudgetActionResponse' :: Action
oldAction = Action
pOldAction_,
$sel:newAction':UpdateBudgetActionResponse' :: Action
newAction' = Action
pNewAction_
}
updateBudgetActionResponse_httpStatus :: Lens.Lens' UpdateBudgetActionResponse Prelude.Int
updateBudgetActionResponse_httpStatus :: (Int -> f Int)
-> UpdateBudgetActionResponse -> f UpdateBudgetActionResponse
updateBudgetActionResponse_httpStatus = (UpdateBudgetActionResponse -> Int)
-> (UpdateBudgetActionResponse
-> Int -> UpdateBudgetActionResponse)
-> Lens
UpdateBudgetActionResponse UpdateBudgetActionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetActionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateBudgetActionResponse' :: UpdateBudgetActionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateBudgetActionResponse
s@UpdateBudgetActionResponse' {} Int
a -> UpdateBudgetActionResponse
s {$sel:httpStatus:UpdateBudgetActionResponse' :: Int
httpStatus = Int
a} :: UpdateBudgetActionResponse)
updateBudgetActionResponse_accountId :: Lens.Lens' UpdateBudgetActionResponse Prelude.Text
updateBudgetActionResponse_accountId :: (Text -> f Text)
-> UpdateBudgetActionResponse -> f UpdateBudgetActionResponse
updateBudgetActionResponse_accountId = (UpdateBudgetActionResponse -> Text)
-> (UpdateBudgetActionResponse
-> Text -> UpdateBudgetActionResponse)
-> Lens
UpdateBudgetActionResponse UpdateBudgetActionResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetActionResponse' {Text
accountId :: Text
$sel:accountId:UpdateBudgetActionResponse' :: UpdateBudgetActionResponse -> Text
accountId} -> Text
accountId) (\s :: UpdateBudgetActionResponse
s@UpdateBudgetActionResponse' {} Text
a -> UpdateBudgetActionResponse
s {$sel:accountId:UpdateBudgetActionResponse' :: Text
accountId = Text
a} :: UpdateBudgetActionResponse)
updateBudgetActionResponse_budgetName :: Lens.Lens' UpdateBudgetActionResponse Prelude.Text
updateBudgetActionResponse_budgetName :: (Text -> f Text)
-> UpdateBudgetActionResponse -> f UpdateBudgetActionResponse
updateBudgetActionResponse_budgetName = (UpdateBudgetActionResponse -> Text)
-> (UpdateBudgetActionResponse
-> Text -> UpdateBudgetActionResponse)
-> Lens
UpdateBudgetActionResponse UpdateBudgetActionResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetActionResponse' {Text
budgetName :: Text
$sel:budgetName:UpdateBudgetActionResponse' :: UpdateBudgetActionResponse -> Text
budgetName} -> Text
budgetName) (\s :: UpdateBudgetActionResponse
s@UpdateBudgetActionResponse' {} Text
a -> UpdateBudgetActionResponse
s {$sel:budgetName:UpdateBudgetActionResponse' :: Text
budgetName = Text
a} :: UpdateBudgetActionResponse)
updateBudgetActionResponse_oldAction :: Lens.Lens' UpdateBudgetActionResponse Action
updateBudgetActionResponse_oldAction :: (Action -> f Action)
-> UpdateBudgetActionResponse -> f UpdateBudgetActionResponse
updateBudgetActionResponse_oldAction = (UpdateBudgetActionResponse -> Action)
-> (UpdateBudgetActionResponse
-> Action -> UpdateBudgetActionResponse)
-> Lens
UpdateBudgetActionResponse UpdateBudgetActionResponse Action Action
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetActionResponse' {Action
oldAction :: Action
$sel:oldAction:UpdateBudgetActionResponse' :: UpdateBudgetActionResponse -> Action
oldAction} -> Action
oldAction) (\s :: UpdateBudgetActionResponse
s@UpdateBudgetActionResponse' {} Action
a -> UpdateBudgetActionResponse
s {$sel:oldAction:UpdateBudgetActionResponse' :: Action
oldAction = Action
a} :: UpdateBudgetActionResponse)
updateBudgetActionResponse_newAction :: Lens.Lens' UpdateBudgetActionResponse Action
updateBudgetActionResponse_newAction :: (Action -> f Action)
-> UpdateBudgetActionResponse -> f UpdateBudgetActionResponse
updateBudgetActionResponse_newAction = (UpdateBudgetActionResponse -> Action)
-> (UpdateBudgetActionResponse
-> Action -> UpdateBudgetActionResponse)
-> Lens
UpdateBudgetActionResponse UpdateBudgetActionResponse Action Action
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBudgetActionResponse' {Action
newAction' :: Action
$sel:newAction':UpdateBudgetActionResponse' :: UpdateBudgetActionResponse -> Action
newAction'} -> Action
newAction') (\s :: UpdateBudgetActionResponse
s@UpdateBudgetActionResponse' {} Action
a -> UpdateBudgetActionResponse
s {$sel:newAction':UpdateBudgetActionResponse' :: Action
newAction' = Action
a} :: UpdateBudgetActionResponse)
instance Prelude.NFData UpdateBudgetActionResponse