{-# 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.DescribeBudgetAction
(
DescribeBudgetAction (..),
newDescribeBudgetAction,
describeBudgetAction_accountId,
describeBudgetAction_budgetName,
describeBudgetAction_actionId,
DescribeBudgetActionResponse (..),
newDescribeBudgetActionResponse,
describeBudgetActionResponse_httpStatus,
describeBudgetActionResponse_accountId,
describeBudgetActionResponse_budgetName,
describeBudgetActionResponse_action,
)
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 DescribeBudgetAction = DescribeBudgetAction'
{ DescribeBudgetAction -> Text
accountId :: Prelude.Text,
DescribeBudgetAction -> Text
budgetName :: Prelude.Text,
DescribeBudgetAction -> Text
actionId :: Prelude.Text
}
deriving (DescribeBudgetAction -> DescribeBudgetAction -> Bool
(DescribeBudgetAction -> DescribeBudgetAction -> Bool)
-> (DescribeBudgetAction -> DescribeBudgetAction -> Bool)
-> Eq DescribeBudgetAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeBudgetAction -> DescribeBudgetAction -> Bool
$c/= :: DescribeBudgetAction -> DescribeBudgetAction -> Bool
== :: DescribeBudgetAction -> DescribeBudgetAction -> Bool
$c== :: DescribeBudgetAction -> DescribeBudgetAction -> Bool
Prelude.Eq, ReadPrec [DescribeBudgetAction]
ReadPrec DescribeBudgetAction
Int -> ReadS DescribeBudgetAction
ReadS [DescribeBudgetAction]
(Int -> ReadS DescribeBudgetAction)
-> ReadS [DescribeBudgetAction]
-> ReadPrec DescribeBudgetAction
-> ReadPrec [DescribeBudgetAction]
-> Read DescribeBudgetAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeBudgetAction]
$creadListPrec :: ReadPrec [DescribeBudgetAction]
readPrec :: ReadPrec DescribeBudgetAction
$creadPrec :: ReadPrec DescribeBudgetAction
readList :: ReadS [DescribeBudgetAction]
$creadList :: ReadS [DescribeBudgetAction]
readsPrec :: Int -> ReadS DescribeBudgetAction
$creadsPrec :: Int -> ReadS DescribeBudgetAction
Prelude.Read, Int -> DescribeBudgetAction -> ShowS
[DescribeBudgetAction] -> ShowS
DescribeBudgetAction -> String
(Int -> DescribeBudgetAction -> ShowS)
-> (DescribeBudgetAction -> String)
-> ([DescribeBudgetAction] -> ShowS)
-> Show DescribeBudgetAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeBudgetAction] -> ShowS
$cshowList :: [DescribeBudgetAction] -> ShowS
show :: DescribeBudgetAction -> String
$cshow :: DescribeBudgetAction -> String
showsPrec :: Int -> DescribeBudgetAction -> ShowS
$cshowsPrec :: Int -> DescribeBudgetAction -> ShowS
Prelude.Show, (forall x. DescribeBudgetAction -> Rep DescribeBudgetAction x)
-> (forall x. Rep DescribeBudgetAction x -> DescribeBudgetAction)
-> Generic DescribeBudgetAction
forall x. Rep DescribeBudgetAction x -> DescribeBudgetAction
forall x. DescribeBudgetAction -> Rep DescribeBudgetAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeBudgetAction x -> DescribeBudgetAction
$cfrom :: forall x. DescribeBudgetAction -> Rep DescribeBudgetAction x
Prelude.Generic)
newDescribeBudgetAction ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DescribeBudgetAction
newDescribeBudgetAction :: Text -> Text -> Text -> DescribeBudgetAction
newDescribeBudgetAction
Text
pAccountId_
Text
pBudgetName_
Text
pActionId_ =
DescribeBudgetAction' :: Text -> Text -> Text -> DescribeBudgetAction
DescribeBudgetAction'
{ $sel:accountId:DescribeBudgetAction' :: Text
accountId = Text
pAccountId_,
$sel:budgetName:DescribeBudgetAction' :: Text
budgetName = Text
pBudgetName_,
$sel:actionId:DescribeBudgetAction' :: Text
actionId = Text
pActionId_
}
describeBudgetAction_accountId :: Lens.Lens' DescribeBudgetAction Prelude.Text
describeBudgetAction_accountId :: (Text -> f Text) -> DescribeBudgetAction -> f DescribeBudgetAction
describeBudgetAction_accountId = (DescribeBudgetAction -> Text)
-> (DescribeBudgetAction -> Text -> DescribeBudgetAction)
-> Lens DescribeBudgetAction DescribeBudgetAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetAction' {Text
accountId :: Text
$sel:accountId:DescribeBudgetAction' :: DescribeBudgetAction -> Text
accountId} -> Text
accountId) (\s :: DescribeBudgetAction
s@DescribeBudgetAction' {} Text
a -> DescribeBudgetAction
s {$sel:accountId:DescribeBudgetAction' :: Text
accountId = Text
a} :: DescribeBudgetAction)
describeBudgetAction_budgetName :: Lens.Lens' DescribeBudgetAction Prelude.Text
describeBudgetAction_budgetName :: (Text -> f Text) -> DescribeBudgetAction -> f DescribeBudgetAction
describeBudgetAction_budgetName = (DescribeBudgetAction -> Text)
-> (DescribeBudgetAction -> Text -> DescribeBudgetAction)
-> Lens DescribeBudgetAction DescribeBudgetAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetAction' {Text
budgetName :: Text
$sel:budgetName:DescribeBudgetAction' :: DescribeBudgetAction -> Text
budgetName} -> Text
budgetName) (\s :: DescribeBudgetAction
s@DescribeBudgetAction' {} Text
a -> DescribeBudgetAction
s {$sel:budgetName:DescribeBudgetAction' :: Text
budgetName = Text
a} :: DescribeBudgetAction)
describeBudgetAction_actionId :: Lens.Lens' DescribeBudgetAction Prelude.Text
describeBudgetAction_actionId :: (Text -> f Text) -> DescribeBudgetAction -> f DescribeBudgetAction
describeBudgetAction_actionId = (DescribeBudgetAction -> Text)
-> (DescribeBudgetAction -> Text -> DescribeBudgetAction)
-> Lens DescribeBudgetAction DescribeBudgetAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetAction' {Text
actionId :: Text
$sel:actionId:DescribeBudgetAction' :: DescribeBudgetAction -> Text
actionId} -> Text
actionId) (\s :: DescribeBudgetAction
s@DescribeBudgetAction' {} Text
a -> DescribeBudgetAction
s {$sel:actionId:DescribeBudgetAction' :: Text
actionId = Text
a} :: DescribeBudgetAction)
instance Core.AWSRequest DescribeBudgetAction where
type
AWSResponse DescribeBudgetAction =
DescribeBudgetActionResponse
request :: DescribeBudgetAction -> Request DescribeBudgetAction
request = Service -> DescribeBudgetAction -> Request DescribeBudgetAction
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeBudgetAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeBudgetAction)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeBudgetAction))
-> Logger
-> Service
-> Proxy DescribeBudgetAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeBudgetAction)))
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 -> DescribeBudgetActionResponse
DescribeBudgetActionResponse'
(Int -> Text -> Text -> Action -> DescribeBudgetActionResponse)
-> Either String Int
-> Either
String (Text -> Text -> Action -> DescribeBudgetActionResponse)
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 -> DescribeBudgetActionResponse)
-> Either String Text
-> Either String (Text -> Action -> DescribeBudgetActionResponse)
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 -> DescribeBudgetActionResponse)
-> Either String Text
-> Either String (Action -> DescribeBudgetActionResponse)
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 -> DescribeBudgetActionResponse)
-> Either String Action
-> Either String DescribeBudgetActionResponse
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
"Action")
)
instance Prelude.Hashable DescribeBudgetAction
instance Prelude.NFData DescribeBudgetAction
instance Core.ToHeaders DescribeBudgetAction where
toHeaders :: DescribeBudgetAction -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeBudgetAction -> 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.DescribeBudgetAction" ::
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 DescribeBudgetAction where
toJSON :: DescribeBudgetAction -> Value
toJSON DescribeBudgetAction' {Text
actionId :: Text
budgetName :: Text
accountId :: Text
$sel:actionId:DescribeBudgetAction' :: DescribeBudgetAction -> Text
$sel:budgetName:DescribeBudgetAction' :: DescribeBudgetAction -> Text
$sel:accountId:DescribeBudgetAction' :: DescribeBudgetAction -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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 DescribeBudgetAction where
toPath :: DescribeBudgetAction -> ByteString
toPath = ByteString -> DescribeBudgetAction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeBudgetAction where
toQuery :: DescribeBudgetAction -> QueryString
toQuery = QueryString -> DescribeBudgetAction -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeBudgetActionResponse = DescribeBudgetActionResponse'
{
DescribeBudgetActionResponse -> Int
httpStatus :: Prelude.Int,
DescribeBudgetActionResponse -> Text
accountId :: Prelude.Text,
DescribeBudgetActionResponse -> Text
budgetName :: Prelude.Text,
DescribeBudgetActionResponse -> Action
action :: Action
}
deriving (DescribeBudgetActionResponse
-> DescribeBudgetActionResponse -> Bool
(DescribeBudgetActionResponse
-> DescribeBudgetActionResponse -> Bool)
-> (DescribeBudgetActionResponse
-> DescribeBudgetActionResponse -> Bool)
-> Eq DescribeBudgetActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeBudgetActionResponse
-> DescribeBudgetActionResponse -> Bool
$c/= :: DescribeBudgetActionResponse
-> DescribeBudgetActionResponse -> Bool
== :: DescribeBudgetActionResponse
-> DescribeBudgetActionResponse -> Bool
$c== :: DescribeBudgetActionResponse
-> DescribeBudgetActionResponse -> Bool
Prelude.Eq, Int -> DescribeBudgetActionResponse -> ShowS
[DescribeBudgetActionResponse] -> ShowS
DescribeBudgetActionResponse -> String
(Int -> DescribeBudgetActionResponse -> ShowS)
-> (DescribeBudgetActionResponse -> String)
-> ([DescribeBudgetActionResponse] -> ShowS)
-> Show DescribeBudgetActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeBudgetActionResponse] -> ShowS
$cshowList :: [DescribeBudgetActionResponse] -> ShowS
show :: DescribeBudgetActionResponse -> String
$cshow :: DescribeBudgetActionResponse -> String
showsPrec :: Int -> DescribeBudgetActionResponse -> ShowS
$cshowsPrec :: Int -> DescribeBudgetActionResponse -> ShowS
Prelude.Show, (forall x.
DescribeBudgetActionResponse -> Rep DescribeBudgetActionResponse x)
-> (forall x.
Rep DescribeBudgetActionResponse x -> DescribeBudgetActionResponse)
-> Generic DescribeBudgetActionResponse
forall x.
Rep DescribeBudgetActionResponse x -> DescribeBudgetActionResponse
forall x.
DescribeBudgetActionResponse -> Rep DescribeBudgetActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeBudgetActionResponse x -> DescribeBudgetActionResponse
$cfrom :: forall x.
DescribeBudgetActionResponse -> Rep DescribeBudgetActionResponse x
Prelude.Generic)
newDescribeBudgetActionResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
Action ->
DescribeBudgetActionResponse
newDescribeBudgetActionResponse :: Int -> Text -> Text -> Action -> DescribeBudgetActionResponse
newDescribeBudgetActionResponse
Int
pHttpStatus_
Text
pAccountId_
Text
pBudgetName_
Action
pAction_ =
DescribeBudgetActionResponse' :: Int -> Text -> Text -> Action -> DescribeBudgetActionResponse
DescribeBudgetActionResponse'
{ $sel:httpStatus:DescribeBudgetActionResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:accountId:DescribeBudgetActionResponse' :: Text
accountId = Text
pAccountId_,
$sel:budgetName:DescribeBudgetActionResponse' :: Text
budgetName = Text
pBudgetName_,
$sel:action:DescribeBudgetActionResponse' :: Action
action = Action
pAction_
}
describeBudgetActionResponse_httpStatus :: Lens.Lens' DescribeBudgetActionResponse Prelude.Int
describeBudgetActionResponse_httpStatus :: (Int -> f Int)
-> DescribeBudgetActionResponse -> f DescribeBudgetActionResponse
describeBudgetActionResponse_httpStatus = (DescribeBudgetActionResponse -> Int)
-> (DescribeBudgetActionResponse
-> Int -> DescribeBudgetActionResponse)
-> Lens
DescribeBudgetActionResponse DescribeBudgetActionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetActionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeBudgetActionResponse' :: DescribeBudgetActionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeBudgetActionResponse
s@DescribeBudgetActionResponse' {} Int
a -> DescribeBudgetActionResponse
s {$sel:httpStatus:DescribeBudgetActionResponse' :: Int
httpStatus = Int
a} :: DescribeBudgetActionResponse)
describeBudgetActionResponse_accountId :: Lens.Lens' DescribeBudgetActionResponse Prelude.Text
describeBudgetActionResponse_accountId :: (Text -> f Text)
-> DescribeBudgetActionResponse -> f DescribeBudgetActionResponse
describeBudgetActionResponse_accountId = (DescribeBudgetActionResponse -> Text)
-> (DescribeBudgetActionResponse
-> Text -> DescribeBudgetActionResponse)
-> Lens
DescribeBudgetActionResponse DescribeBudgetActionResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetActionResponse' {Text
accountId :: Text
$sel:accountId:DescribeBudgetActionResponse' :: DescribeBudgetActionResponse -> Text
accountId} -> Text
accountId) (\s :: DescribeBudgetActionResponse
s@DescribeBudgetActionResponse' {} Text
a -> DescribeBudgetActionResponse
s {$sel:accountId:DescribeBudgetActionResponse' :: Text
accountId = Text
a} :: DescribeBudgetActionResponse)
describeBudgetActionResponse_budgetName :: Lens.Lens' DescribeBudgetActionResponse Prelude.Text
describeBudgetActionResponse_budgetName :: (Text -> f Text)
-> DescribeBudgetActionResponse -> f DescribeBudgetActionResponse
describeBudgetActionResponse_budgetName = (DescribeBudgetActionResponse -> Text)
-> (DescribeBudgetActionResponse
-> Text -> DescribeBudgetActionResponse)
-> Lens
DescribeBudgetActionResponse DescribeBudgetActionResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetActionResponse' {Text
budgetName :: Text
$sel:budgetName:DescribeBudgetActionResponse' :: DescribeBudgetActionResponse -> Text
budgetName} -> Text
budgetName) (\s :: DescribeBudgetActionResponse
s@DescribeBudgetActionResponse' {} Text
a -> DescribeBudgetActionResponse
s {$sel:budgetName:DescribeBudgetActionResponse' :: Text
budgetName = Text
a} :: DescribeBudgetActionResponse)
describeBudgetActionResponse_action :: Lens.Lens' DescribeBudgetActionResponse Action
describeBudgetActionResponse_action :: (Action -> f Action)
-> DescribeBudgetActionResponse -> f DescribeBudgetActionResponse
describeBudgetActionResponse_action = (DescribeBudgetActionResponse -> Action)
-> (DescribeBudgetActionResponse
-> Action -> DescribeBudgetActionResponse)
-> Lens
DescribeBudgetActionResponse
DescribeBudgetActionResponse
Action
Action
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetActionResponse' {Action
action :: Action
$sel:action:DescribeBudgetActionResponse' :: DescribeBudgetActionResponse -> Action
action} -> Action
action) (\s :: DescribeBudgetActionResponse
s@DescribeBudgetActionResponse' {} Action
a -> DescribeBudgetActionResponse
s {$sel:action:DescribeBudgetActionResponse' :: Action
action = Action
a} :: DescribeBudgetActionResponse)
instance Prelude.NFData DescribeBudgetActionResponse