{-# 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.Route53.ListTrafficPolicies
(
ListTrafficPolicies (..),
newListTrafficPolicies,
listTrafficPolicies_maxItems,
listTrafficPolicies_trafficPolicyIdMarker,
ListTrafficPoliciesResponse (..),
newListTrafficPoliciesResponse,
listTrafficPoliciesResponse_httpStatus,
listTrafficPoliciesResponse_trafficPolicySummaries,
listTrafficPoliciesResponse_isTruncated,
listTrafficPoliciesResponse_trafficPolicyIdMarker,
listTrafficPoliciesResponse_maxItems,
)
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 qualified Amazonka.Response as Response
import Amazonka.Route53.Types
data ListTrafficPolicies = ListTrafficPolicies'
{
ListTrafficPolicies -> Maybe Text
maxItems :: Prelude.Maybe Prelude.Text,
ListTrafficPolicies -> Maybe Text
trafficPolicyIdMarker :: Prelude.Maybe Prelude.Text
}
deriving (ListTrafficPolicies -> ListTrafficPolicies -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTrafficPolicies -> ListTrafficPolicies -> Bool
$c/= :: ListTrafficPolicies -> ListTrafficPolicies -> Bool
== :: ListTrafficPolicies -> ListTrafficPolicies -> Bool
$c== :: ListTrafficPolicies -> ListTrafficPolicies -> Bool
Prelude.Eq, ReadPrec [ListTrafficPolicies]
ReadPrec ListTrafficPolicies
Int -> ReadS ListTrafficPolicies
ReadS [ListTrafficPolicies]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTrafficPolicies]
$creadListPrec :: ReadPrec [ListTrafficPolicies]
readPrec :: ReadPrec ListTrafficPolicies
$creadPrec :: ReadPrec ListTrafficPolicies
readList :: ReadS [ListTrafficPolicies]
$creadList :: ReadS [ListTrafficPolicies]
readsPrec :: Int -> ReadS ListTrafficPolicies
$creadsPrec :: Int -> ReadS ListTrafficPolicies
Prelude.Read, Int -> ListTrafficPolicies -> ShowS
[ListTrafficPolicies] -> ShowS
ListTrafficPolicies -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTrafficPolicies] -> ShowS
$cshowList :: [ListTrafficPolicies] -> ShowS
show :: ListTrafficPolicies -> String
$cshow :: ListTrafficPolicies -> String
showsPrec :: Int -> ListTrafficPolicies -> ShowS
$cshowsPrec :: Int -> ListTrafficPolicies -> ShowS
Prelude.Show, forall x. Rep ListTrafficPolicies x -> ListTrafficPolicies
forall x. ListTrafficPolicies -> Rep ListTrafficPolicies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTrafficPolicies x -> ListTrafficPolicies
$cfrom :: forall x. ListTrafficPolicies -> Rep ListTrafficPolicies x
Prelude.Generic)
newListTrafficPolicies ::
ListTrafficPolicies
newListTrafficPolicies :: ListTrafficPolicies
newListTrafficPolicies =
ListTrafficPolicies'
{ $sel:maxItems:ListTrafficPolicies' :: Maybe Text
maxItems = forall a. Maybe a
Prelude.Nothing,
$sel:trafficPolicyIdMarker:ListTrafficPolicies' :: Maybe Text
trafficPolicyIdMarker = forall a. Maybe a
Prelude.Nothing
}
listTrafficPolicies_maxItems :: Lens.Lens' ListTrafficPolicies (Prelude.Maybe Prelude.Text)
listTrafficPolicies_maxItems :: Lens' ListTrafficPolicies (Maybe Text)
listTrafficPolicies_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPolicies' {Maybe Text
maxItems :: Maybe Text
$sel:maxItems:ListTrafficPolicies' :: ListTrafficPolicies -> Maybe Text
maxItems} -> Maybe Text
maxItems) (\s :: ListTrafficPolicies
s@ListTrafficPolicies' {} Maybe Text
a -> ListTrafficPolicies
s {$sel:maxItems:ListTrafficPolicies' :: Maybe Text
maxItems = Maybe Text
a} :: ListTrafficPolicies)
listTrafficPolicies_trafficPolicyIdMarker :: Lens.Lens' ListTrafficPolicies (Prelude.Maybe Prelude.Text)
listTrafficPolicies_trafficPolicyIdMarker :: Lens' ListTrafficPolicies (Maybe Text)
listTrafficPolicies_trafficPolicyIdMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPolicies' {Maybe Text
trafficPolicyIdMarker :: Maybe Text
$sel:trafficPolicyIdMarker:ListTrafficPolicies' :: ListTrafficPolicies -> Maybe Text
trafficPolicyIdMarker} -> Maybe Text
trafficPolicyIdMarker) (\s :: ListTrafficPolicies
s@ListTrafficPolicies' {} Maybe Text
a -> ListTrafficPolicies
s {$sel:trafficPolicyIdMarker:ListTrafficPolicies' :: Maybe Text
trafficPolicyIdMarker = Maybe Text
a} :: ListTrafficPolicies)
instance Core.AWSRequest ListTrafficPolicies where
type
AWSResponse ListTrafficPolicies =
ListTrafficPoliciesResponse
request :: (Service -> Service)
-> ListTrafficPolicies -> Request ListTrafficPolicies
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListTrafficPolicies
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListTrafficPolicies)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Int
-> [TrafficPolicySummary]
-> Bool
-> Text
-> Text
-> ListTrafficPoliciesResponse
ListTrafficPoliciesResponse'
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.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"TrafficPolicySummaries"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"TrafficPolicySummary"
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"IsTruncated")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"TrafficPolicyIdMarker")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"MaxItems")
)
instance Prelude.Hashable ListTrafficPolicies where
hashWithSalt :: Int -> ListTrafficPolicies -> Int
hashWithSalt Int
_salt ListTrafficPolicies' {Maybe Text
trafficPolicyIdMarker :: Maybe Text
maxItems :: Maybe Text
$sel:trafficPolicyIdMarker:ListTrafficPolicies' :: ListTrafficPolicies -> Maybe Text
$sel:maxItems:ListTrafficPolicies' :: ListTrafficPolicies -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxItems
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
trafficPolicyIdMarker
instance Prelude.NFData ListTrafficPolicies where
rnf :: ListTrafficPolicies -> ()
rnf ListTrafficPolicies' {Maybe Text
trafficPolicyIdMarker :: Maybe Text
maxItems :: Maybe Text
$sel:trafficPolicyIdMarker:ListTrafficPolicies' :: ListTrafficPolicies -> Maybe Text
$sel:maxItems:ListTrafficPolicies' :: ListTrafficPolicies -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maxItems
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
trafficPolicyIdMarker
instance Data.ToHeaders ListTrafficPolicies where
toHeaders :: ListTrafficPolicies -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListTrafficPolicies where
toPath :: ListTrafficPolicies -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/2013-04-01/trafficpolicies"
instance Data.ToQuery ListTrafficPolicies where
toQuery :: ListTrafficPolicies -> QueryString
toQuery ListTrafficPolicies' {Maybe Text
trafficPolicyIdMarker :: Maybe Text
maxItems :: Maybe Text
$sel:trafficPolicyIdMarker:ListTrafficPolicies' :: ListTrafficPolicies -> Maybe Text
$sel:maxItems:ListTrafficPolicies' :: ListTrafficPolicies -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxitems" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
maxItems,
ByteString
"trafficpolicyid" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
trafficPolicyIdMarker
]
data ListTrafficPoliciesResponse = ListTrafficPoliciesResponse'
{
ListTrafficPoliciesResponse -> Int
httpStatus :: Prelude.Int,
ListTrafficPoliciesResponse -> [TrafficPolicySummary]
trafficPolicySummaries :: [TrafficPolicySummary],
ListTrafficPoliciesResponse -> Bool
isTruncated :: Prelude.Bool,
ListTrafficPoliciesResponse -> Text
trafficPolicyIdMarker :: Prelude.Text,
ListTrafficPoliciesResponse -> Text
maxItems :: Prelude.Text
}
deriving (ListTrafficPoliciesResponse -> ListTrafficPoliciesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTrafficPoliciesResponse -> ListTrafficPoliciesResponse -> Bool
$c/= :: ListTrafficPoliciesResponse -> ListTrafficPoliciesResponse -> Bool
== :: ListTrafficPoliciesResponse -> ListTrafficPoliciesResponse -> Bool
$c== :: ListTrafficPoliciesResponse -> ListTrafficPoliciesResponse -> Bool
Prelude.Eq, ReadPrec [ListTrafficPoliciesResponse]
ReadPrec ListTrafficPoliciesResponse
Int -> ReadS ListTrafficPoliciesResponse
ReadS [ListTrafficPoliciesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTrafficPoliciesResponse]
$creadListPrec :: ReadPrec [ListTrafficPoliciesResponse]
readPrec :: ReadPrec ListTrafficPoliciesResponse
$creadPrec :: ReadPrec ListTrafficPoliciesResponse
readList :: ReadS [ListTrafficPoliciesResponse]
$creadList :: ReadS [ListTrafficPoliciesResponse]
readsPrec :: Int -> ReadS ListTrafficPoliciesResponse
$creadsPrec :: Int -> ReadS ListTrafficPoliciesResponse
Prelude.Read, Int -> ListTrafficPoliciesResponse -> ShowS
[ListTrafficPoliciesResponse] -> ShowS
ListTrafficPoliciesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTrafficPoliciesResponse] -> ShowS
$cshowList :: [ListTrafficPoliciesResponse] -> ShowS
show :: ListTrafficPoliciesResponse -> String
$cshow :: ListTrafficPoliciesResponse -> String
showsPrec :: Int -> ListTrafficPoliciesResponse -> ShowS
$cshowsPrec :: Int -> ListTrafficPoliciesResponse -> ShowS
Prelude.Show, forall x.
Rep ListTrafficPoliciesResponse x -> ListTrafficPoliciesResponse
forall x.
ListTrafficPoliciesResponse -> Rep ListTrafficPoliciesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTrafficPoliciesResponse x -> ListTrafficPoliciesResponse
$cfrom :: forall x.
ListTrafficPoliciesResponse -> Rep ListTrafficPoliciesResponse x
Prelude.Generic)
newListTrafficPoliciesResponse ::
Prelude.Int ->
Prelude.Bool ->
Prelude.Text ->
Prelude.Text ->
ListTrafficPoliciesResponse
newListTrafficPoliciesResponse :: Int -> Bool -> Text -> Text -> ListTrafficPoliciesResponse
newListTrafficPoliciesResponse
Int
pHttpStatus_
Bool
pIsTruncated_
Text
pTrafficPolicyIdMarker_
Text
pMaxItems_ =
ListTrafficPoliciesResponse'
{ $sel:httpStatus:ListTrafficPoliciesResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:trafficPolicySummaries:ListTrafficPoliciesResponse' :: [TrafficPolicySummary]
trafficPolicySummaries = forall a. Monoid a => a
Prelude.mempty,
$sel:isTruncated:ListTrafficPoliciesResponse' :: Bool
isTruncated = Bool
pIsTruncated_,
$sel:trafficPolicyIdMarker:ListTrafficPoliciesResponse' :: Text
trafficPolicyIdMarker =
Text
pTrafficPolicyIdMarker_,
$sel:maxItems:ListTrafficPoliciesResponse' :: Text
maxItems = Text
pMaxItems_
}
listTrafficPoliciesResponse_httpStatus :: Lens.Lens' ListTrafficPoliciesResponse Prelude.Int
listTrafficPoliciesResponse_httpStatus :: Lens' ListTrafficPoliciesResponse Int
listTrafficPoliciesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPoliciesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTrafficPoliciesResponse' :: ListTrafficPoliciesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTrafficPoliciesResponse
s@ListTrafficPoliciesResponse' {} Int
a -> ListTrafficPoliciesResponse
s {$sel:httpStatus:ListTrafficPoliciesResponse' :: Int
httpStatus = Int
a} :: ListTrafficPoliciesResponse)
listTrafficPoliciesResponse_trafficPolicySummaries :: Lens.Lens' ListTrafficPoliciesResponse [TrafficPolicySummary]
listTrafficPoliciesResponse_trafficPolicySummaries :: Lens' ListTrafficPoliciesResponse [TrafficPolicySummary]
listTrafficPoliciesResponse_trafficPolicySummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPoliciesResponse' {[TrafficPolicySummary]
trafficPolicySummaries :: [TrafficPolicySummary]
$sel:trafficPolicySummaries:ListTrafficPoliciesResponse' :: ListTrafficPoliciesResponse -> [TrafficPolicySummary]
trafficPolicySummaries} -> [TrafficPolicySummary]
trafficPolicySummaries) (\s :: ListTrafficPoliciesResponse
s@ListTrafficPoliciesResponse' {} [TrafficPolicySummary]
a -> ListTrafficPoliciesResponse
s {$sel:trafficPolicySummaries:ListTrafficPoliciesResponse' :: [TrafficPolicySummary]
trafficPolicySummaries = [TrafficPolicySummary]
a} :: ListTrafficPoliciesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listTrafficPoliciesResponse_isTruncated :: Lens.Lens' ListTrafficPoliciesResponse Prelude.Bool
listTrafficPoliciesResponse_isTruncated :: Lens' ListTrafficPoliciesResponse Bool
listTrafficPoliciesResponse_isTruncated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPoliciesResponse' {Bool
isTruncated :: Bool
$sel:isTruncated:ListTrafficPoliciesResponse' :: ListTrafficPoliciesResponse -> Bool
isTruncated} -> Bool
isTruncated) (\s :: ListTrafficPoliciesResponse
s@ListTrafficPoliciesResponse' {} Bool
a -> ListTrafficPoliciesResponse
s {$sel:isTruncated:ListTrafficPoliciesResponse' :: Bool
isTruncated = Bool
a} :: ListTrafficPoliciesResponse)
listTrafficPoliciesResponse_trafficPolicyIdMarker :: Lens.Lens' ListTrafficPoliciesResponse Prelude.Text
listTrafficPoliciesResponse_trafficPolicyIdMarker :: Lens' ListTrafficPoliciesResponse Text
listTrafficPoliciesResponse_trafficPolicyIdMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPoliciesResponse' {Text
trafficPolicyIdMarker :: Text
$sel:trafficPolicyIdMarker:ListTrafficPoliciesResponse' :: ListTrafficPoliciesResponse -> Text
trafficPolicyIdMarker} -> Text
trafficPolicyIdMarker) (\s :: ListTrafficPoliciesResponse
s@ListTrafficPoliciesResponse' {} Text
a -> ListTrafficPoliciesResponse
s {$sel:trafficPolicyIdMarker:ListTrafficPoliciesResponse' :: Text
trafficPolicyIdMarker = Text
a} :: ListTrafficPoliciesResponse)
listTrafficPoliciesResponse_maxItems :: Lens.Lens' ListTrafficPoliciesResponse Prelude.Text
listTrafficPoliciesResponse_maxItems :: Lens' ListTrafficPoliciesResponse Text
listTrafficPoliciesResponse_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPoliciesResponse' {Text
maxItems :: Text
$sel:maxItems:ListTrafficPoliciesResponse' :: ListTrafficPoliciesResponse -> Text
maxItems} -> Text
maxItems) (\s :: ListTrafficPoliciesResponse
s@ListTrafficPoliciesResponse' {} Text
a -> ListTrafficPoliciesResponse
s {$sel:maxItems:ListTrafficPoliciesResponse' :: Text
maxItems = Text
a} :: ListTrafficPoliciesResponse)
instance Prelude.NFData ListTrafficPoliciesResponse where
rnf :: ListTrafficPoliciesResponse -> ()
rnf ListTrafficPoliciesResponse' {Bool
Int
[TrafficPolicySummary]
Text
maxItems :: Text
trafficPolicyIdMarker :: Text
isTruncated :: Bool
trafficPolicySummaries :: [TrafficPolicySummary]
httpStatus :: Int
$sel:maxItems:ListTrafficPoliciesResponse' :: ListTrafficPoliciesResponse -> Text
$sel:trafficPolicyIdMarker:ListTrafficPoliciesResponse' :: ListTrafficPoliciesResponse -> Text
$sel:isTruncated:ListTrafficPoliciesResponse' :: ListTrafficPoliciesResponse -> Bool
$sel:trafficPolicySummaries:ListTrafficPoliciesResponse' :: ListTrafficPoliciesResponse -> [TrafficPolicySummary]
$sel:httpStatus:ListTrafficPoliciesResponse' :: ListTrafficPoliciesResponse -> 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 [TrafficPolicySummary]
trafficPolicySummaries
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
isTruncated
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
trafficPolicyIdMarker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
maxItems