{-# 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.CloudFormation.EstimateTemplateCost
(
EstimateTemplateCost (..),
newEstimateTemplateCost,
estimateTemplateCost_parameters,
estimateTemplateCost_templateBody,
estimateTemplateCost_templateURL,
EstimateTemplateCostResponse (..),
newEstimateTemplateCostResponse,
estimateTemplateCostResponse_url,
estimateTemplateCostResponse_httpStatus,
)
where
import Amazonka.CloudFormation.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 EstimateTemplateCost = EstimateTemplateCost'
{
EstimateTemplateCost -> Maybe [Parameter]
parameters :: Prelude.Maybe [Parameter],
EstimateTemplateCost -> Maybe Text
templateBody :: Prelude.Maybe Prelude.Text,
EstimateTemplateCost -> Maybe Text
templateURL :: Prelude.Maybe Prelude.Text
}
deriving (EstimateTemplateCost -> EstimateTemplateCost -> Bool
(EstimateTemplateCost -> EstimateTemplateCost -> Bool)
-> (EstimateTemplateCost -> EstimateTemplateCost -> Bool)
-> Eq EstimateTemplateCost
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EstimateTemplateCost -> EstimateTemplateCost -> Bool
$c/= :: EstimateTemplateCost -> EstimateTemplateCost -> Bool
== :: EstimateTemplateCost -> EstimateTemplateCost -> Bool
$c== :: EstimateTemplateCost -> EstimateTemplateCost -> Bool
Prelude.Eq, ReadPrec [EstimateTemplateCost]
ReadPrec EstimateTemplateCost
Int -> ReadS EstimateTemplateCost
ReadS [EstimateTemplateCost]
(Int -> ReadS EstimateTemplateCost)
-> ReadS [EstimateTemplateCost]
-> ReadPrec EstimateTemplateCost
-> ReadPrec [EstimateTemplateCost]
-> Read EstimateTemplateCost
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EstimateTemplateCost]
$creadListPrec :: ReadPrec [EstimateTemplateCost]
readPrec :: ReadPrec EstimateTemplateCost
$creadPrec :: ReadPrec EstimateTemplateCost
readList :: ReadS [EstimateTemplateCost]
$creadList :: ReadS [EstimateTemplateCost]
readsPrec :: Int -> ReadS EstimateTemplateCost
$creadsPrec :: Int -> ReadS EstimateTemplateCost
Prelude.Read, Int -> EstimateTemplateCost -> ShowS
[EstimateTemplateCost] -> ShowS
EstimateTemplateCost -> String
(Int -> EstimateTemplateCost -> ShowS)
-> (EstimateTemplateCost -> String)
-> ([EstimateTemplateCost] -> ShowS)
-> Show EstimateTemplateCost
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EstimateTemplateCost] -> ShowS
$cshowList :: [EstimateTemplateCost] -> ShowS
show :: EstimateTemplateCost -> String
$cshow :: EstimateTemplateCost -> String
showsPrec :: Int -> EstimateTemplateCost -> ShowS
$cshowsPrec :: Int -> EstimateTemplateCost -> ShowS
Prelude.Show, (forall x. EstimateTemplateCost -> Rep EstimateTemplateCost x)
-> (forall x. Rep EstimateTemplateCost x -> EstimateTemplateCost)
-> Generic EstimateTemplateCost
forall x. Rep EstimateTemplateCost x -> EstimateTemplateCost
forall x. EstimateTemplateCost -> Rep EstimateTemplateCost x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EstimateTemplateCost x -> EstimateTemplateCost
$cfrom :: forall x. EstimateTemplateCost -> Rep EstimateTemplateCost x
Prelude.Generic)
newEstimateTemplateCost ::
EstimateTemplateCost
newEstimateTemplateCost :: EstimateTemplateCost
newEstimateTemplateCost =
EstimateTemplateCost' :: Maybe [Parameter]
-> Maybe Text -> Maybe Text -> EstimateTemplateCost
EstimateTemplateCost'
{ $sel:parameters:EstimateTemplateCost' :: Maybe [Parameter]
parameters = Maybe [Parameter]
forall a. Maybe a
Prelude.Nothing,
$sel:templateBody:EstimateTemplateCost' :: Maybe Text
templateBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateURL:EstimateTemplateCost' :: Maybe Text
templateURL = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
estimateTemplateCost_parameters :: Lens.Lens' EstimateTemplateCost (Prelude.Maybe [Parameter])
estimateTemplateCost_parameters :: (Maybe [Parameter] -> f (Maybe [Parameter]))
-> EstimateTemplateCost -> f EstimateTemplateCost
estimateTemplateCost_parameters = (EstimateTemplateCost -> Maybe [Parameter])
-> (EstimateTemplateCost
-> Maybe [Parameter] -> EstimateTemplateCost)
-> Lens
EstimateTemplateCost
EstimateTemplateCost
(Maybe [Parameter])
(Maybe [Parameter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EstimateTemplateCost' {Maybe [Parameter]
parameters :: Maybe [Parameter]
$sel:parameters:EstimateTemplateCost' :: EstimateTemplateCost -> Maybe [Parameter]
parameters} -> Maybe [Parameter]
parameters) (\s :: EstimateTemplateCost
s@EstimateTemplateCost' {} Maybe [Parameter]
a -> EstimateTemplateCost
s {$sel:parameters:EstimateTemplateCost' :: Maybe [Parameter]
parameters = Maybe [Parameter]
a} :: EstimateTemplateCost) ((Maybe [Parameter] -> f (Maybe [Parameter]))
-> EstimateTemplateCost -> f EstimateTemplateCost)
-> ((Maybe [Parameter] -> f (Maybe [Parameter]))
-> Maybe [Parameter] -> f (Maybe [Parameter]))
-> (Maybe [Parameter] -> f (Maybe [Parameter]))
-> EstimateTemplateCost
-> f EstimateTemplateCost
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Parameter] [Parameter] [Parameter] [Parameter]
-> Iso
(Maybe [Parameter])
(Maybe [Parameter])
(Maybe [Parameter])
(Maybe [Parameter])
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 [Parameter] [Parameter] [Parameter] [Parameter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
estimateTemplateCost_templateBody :: Lens.Lens' EstimateTemplateCost (Prelude.Maybe Prelude.Text)
estimateTemplateCost_templateBody :: (Maybe Text -> f (Maybe Text))
-> EstimateTemplateCost -> f EstimateTemplateCost
estimateTemplateCost_templateBody = (EstimateTemplateCost -> Maybe Text)
-> (EstimateTemplateCost -> Maybe Text -> EstimateTemplateCost)
-> Lens
EstimateTemplateCost EstimateTemplateCost (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EstimateTemplateCost' {Maybe Text
templateBody :: Maybe Text
$sel:templateBody:EstimateTemplateCost' :: EstimateTemplateCost -> Maybe Text
templateBody} -> Maybe Text
templateBody) (\s :: EstimateTemplateCost
s@EstimateTemplateCost' {} Maybe Text
a -> EstimateTemplateCost
s {$sel:templateBody:EstimateTemplateCost' :: Maybe Text
templateBody = Maybe Text
a} :: EstimateTemplateCost)
estimateTemplateCost_templateURL :: Lens.Lens' EstimateTemplateCost (Prelude.Maybe Prelude.Text)
estimateTemplateCost_templateURL :: (Maybe Text -> f (Maybe Text))
-> EstimateTemplateCost -> f EstimateTemplateCost
estimateTemplateCost_templateURL = (EstimateTemplateCost -> Maybe Text)
-> (EstimateTemplateCost -> Maybe Text -> EstimateTemplateCost)
-> Lens
EstimateTemplateCost EstimateTemplateCost (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EstimateTemplateCost' {Maybe Text
templateURL :: Maybe Text
$sel:templateURL:EstimateTemplateCost' :: EstimateTemplateCost -> Maybe Text
templateURL} -> Maybe Text
templateURL) (\s :: EstimateTemplateCost
s@EstimateTemplateCost' {} Maybe Text
a -> EstimateTemplateCost
s {$sel:templateURL:EstimateTemplateCost' :: Maybe Text
templateURL = Maybe Text
a} :: EstimateTemplateCost)
instance Core.AWSRequest EstimateTemplateCost where
type
AWSResponse EstimateTemplateCost =
EstimateTemplateCostResponse
request :: EstimateTemplateCost -> Request EstimateTemplateCost
request = Service -> EstimateTemplateCost -> Request EstimateTemplateCost
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy EstimateTemplateCost
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EstimateTemplateCost)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse EstimateTemplateCost))
-> Logger
-> Service
-> Proxy EstimateTemplateCost
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EstimateTemplateCost)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"EstimateTemplateCostResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text -> Int -> EstimateTemplateCostResponse
EstimateTemplateCostResponse'
(Maybe Text -> Int -> EstimateTemplateCostResponse)
-> Either String (Maybe Text)
-> Either String (Int -> EstimateTemplateCostResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Url")
Either String (Int -> EstimateTemplateCostResponse)
-> Either String Int -> Either String EstimateTemplateCostResponse
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 EstimateTemplateCost
instance Prelude.NFData EstimateTemplateCost
instance Core.ToHeaders EstimateTemplateCost where
toHeaders :: EstimateTemplateCost -> ResponseHeaders
toHeaders = ResponseHeaders -> EstimateTemplateCost -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath EstimateTemplateCost where
toPath :: EstimateTemplateCost -> ByteString
toPath = ByteString -> EstimateTemplateCost -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery EstimateTemplateCost where
toQuery :: EstimateTemplateCost -> QueryString
toQuery EstimateTemplateCost' {Maybe [Parameter]
Maybe Text
templateURL :: Maybe Text
templateBody :: Maybe Text
parameters :: Maybe [Parameter]
$sel:templateURL:EstimateTemplateCost' :: EstimateTemplateCost -> Maybe Text
$sel:templateBody:EstimateTemplateCost' :: EstimateTemplateCost -> Maybe Text
$sel:parameters:EstimateTemplateCost' :: EstimateTemplateCost -> Maybe [Parameter]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"EstimateTemplateCost" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"Parameters"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Parameter] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Parameter] -> QueryString)
-> Maybe [Parameter] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Parameter]
parameters),
ByteString
"TemplateBody" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
templateBody,
ByteString
"TemplateURL" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
templateURL
]
data EstimateTemplateCostResponse = EstimateTemplateCostResponse'
{
EstimateTemplateCostResponse -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
EstimateTemplateCostResponse -> Int
httpStatus :: Prelude.Int
}
deriving (EstimateTemplateCostResponse
-> EstimateTemplateCostResponse -> Bool
(EstimateTemplateCostResponse
-> EstimateTemplateCostResponse -> Bool)
-> (EstimateTemplateCostResponse
-> EstimateTemplateCostResponse -> Bool)
-> Eq EstimateTemplateCostResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EstimateTemplateCostResponse
-> EstimateTemplateCostResponse -> Bool
$c/= :: EstimateTemplateCostResponse
-> EstimateTemplateCostResponse -> Bool
== :: EstimateTemplateCostResponse
-> EstimateTemplateCostResponse -> Bool
$c== :: EstimateTemplateCostResponse
-> EstimateTemplateCostResponse -> Bool
Prelude.Eq, ReadPrec [EstimateTemplateCostResponse]
ReadPrec EstimateTemplateCostResponse
Int -> ReadS EstimateTemplateCostResponse
ReadS [EstimateTemplateCostResponse]
(Int -> ReadS EstimateTemplateCostResponse)
-> ReadS [EstimateTemplateCostResponse]
-> ReadPrec EstimateTemplateCostResponse
-> ReadPrec [EstimateTemplateCostResponse]
-> Read EstimateTemplateCostResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EstimateTemplateCostResponse]
$creadListPrec :: ReadPrec [EstimateTemplateCostResponse]
readPrec :: ReadPrec EstimateTemplateCostResponse
$creadPrec :: ReadPrec EstimateTemplateCostResponse
readList :: ReadS [EstimateTemplateCostResponse]
$creadList :: ReadS [EstimateTemplateCostResponse]
readsPrec :: Int -> ReadS EstimateTemplateCostResponse
$creadsPrec :: Int -> ReadS EstimateTemplateCostResponse
Prelude.Read, Int -> EstimateTemplateCostResponse -> ShowS
[EstimateTemplateCostResponse] -> ShowS
EstimateTemplateCostResponse -> String
(Int -> EstimateTemplateCostResponse -> ShowS)
-> (EstimateTemplateCostResponse -> String)
-> ([EstimateTemplateCostResponse] -> ShowS)
-> Show EstimateTemplateCostResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EstimateTemplateCostResponse] -> ShowS
$cshowList :: [EstimateTemplateCostResponse] -> ShowS
show :: EstimateTemplateCostResponse -> String
$cshow :: EstimateTemplateCostResponse -> String
showsPrec :: Int -> EstimateTemplateCostResponse -> ShowS
$cshowsPrec :: Int -> EstimateTemplateCostResponse -> ShowS
Prelude.Show, (forall x.
EstimateTemplateCostResponse -> Rep EstimateTemplateCostResponse x)
-> (forall x.
Rep EstimateTemplateCostResponse x -> EstimateTemplateCostResponse)
-> Generic EstimateTemplateCostResponse
forall x.
Rep EstimateTemplateCostResponse x -> EstimateTemplateCostResponse
forall x.
EstimateTemplateCostResponse -> Rep EstimateTemplateCostResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EstimateTemplateCostResponse x -> EstimateTemplateCostResponse
$cfrom :: forall x.
EstimateTemplateCostResponse -> Rep EstimateTemplateCostResponse x
Prelude.Generic)
newEstimateTemplateCostResponse ::
Prelude.Int ->
EstimateTemplateCostResponse
newEstimateTemplateCostResponse :: Int -> EstimateTemplateCostResponse
newEstimateTemplateCostResponse Int
pHttpStatus_ =
EstimateTemplateCostResponse' :: Maybe Text -> Int -> EstimateTemplateCostResponse
EstimateTemplateCostResponse'
{ $sel:url:EstimateTemplateCostResponse' :: Maybe Text
url =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:EstimateTemplateCostResponse' :: Int
httpStatus = Int
pHttpStatus_
}
estimateTemplateCostResponse_url :: Lens.Lens' EstimateTemplateCostResponse (Prelude.Maybe Prelude.Text)
estimateTemplateCostResponse_url :: (Maybe Text -> f (Maybe Text))
-> EstimateTemplateCostResponse -> f EstimateTemplateCostResponse
estimateTemplateCostResponse_url = (EstimateTemplateCostResponse -> Maybe Text)
-> (EstimateTemplateCostResponse
-> Maybe Text -> EstimateTemplateCostResponse)
-> Lens
EstimateTemplateCostResponse
EstimateTemplateCostResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EstimateTemplateCostResponse' {Maybe Text
url :: Maybe Text
$sel:url:EstimateTemplateCostResponse' :: EstimateTemplateCostResponse -> Maybe Text
url} -> Maybe Text
url) (\s :: EstimateTemplateCostResponse
s@EstimateTemplateCostResponse' {} Maybe Text
a -> EstimateTemplateCostResponse
s {$sel:url:EstimateTemplateCostResponse' :: Maybe Text
url = Maybe Text
a} :: EstimateTemplateCostResponse)
estimateTemplateCostResponse_httpStatus :: Lens.Lens' EstimateTemplateCostResponse Prelude.Int
estimateTemplateCostResponse_httpStatus :: (Int -> f Int)
-> EstimateTemplateCostResponse -> f EstimateTemplateCostResponse
estimateTemplateCostResponse_httpStatus = (EstimateTemplateCostResponse -> Int)
-> (EstimateTemplateCostResponse
-> Int -> EstimateTemplateCostResponse)
-> Lens
EstimateTemplateCostResponse EstimateTemplateCostResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EstimateTemplateCostResponse' {Int
httpStatus :: Int
$sel:httpStatus:EstimateTemplateCostResponse' :: EstimateTemplateCostResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: EstimateTemplateCostResponse
s@EstimateTemplateCostResponse' {} Int
a -> EstimateTemplateCostResponse
s {$sel:httpStatus:EstimateTemplateCostResponse' :: Int
httpStatus = Int
a} :: EstimateTemplateCostResponse)
instance Prelude.NFData EstimateTemplateCostResponse