{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Route53.ListTrafficPolicies
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets information about the latest version for every traffic policy that
-- is associated with the current Amazon Web Services account. Policies are
-- listed in the order that they were created in.
--
-- For information about how of deleting a traffic policy affects the
-- response from @ListTrafficPolicies@, see
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteTrafficPolicy.html DeleteTrafficPolicy>.
module Amazonka.Route53.ListTrafficPolicies
  ( -- * Creating a Request
    ListTrafficPolicies (..),
    newListTrafficPolicies,

    -- * Request Lenses
    listTrafficPolicies_trafficPolicyIdMarker,
    listTrafficPolicies_maxItems,

    -- * Destructuring the Response
    ListTrafficPoliciesResponse (..),
    newListTrafficPoliciesResponse,

    -- * Response Lenses
    listTrafficPoliciesResponse_httpStatus,
    listTrafficPoliciesResponse_trafficPolicySummaries,
    listTrafficPoliciesResponse_isTruncated,
    listTrafficPoliciesResponse_trafficPolicyIdMarker,
    listTrafficPoliciesResponse_maxItems,
  )
where

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
import Amazonka.Route53.Types

-- | A complex type that contains the information about the request to list
-- the traffic policies that are associated with the current Amazon Web
-- Services account.
--
-- /See:/ 'newListTrafficPolicies' smart constructor.
data ListTrafficPolicies = ListTrafficPolicies'
  { -- | (Conditional) For your first request to @ListTrafficPolicies@, don\'t
    -- include the @TrafficPolicyIdMarker@ parameter.
    --
    -- If you have more traffic policies than the value of @MaxItems@,
    -- @ListTrafficPolicies@ returns only the first @MaxItems@ traffic
    -- policies. To get the next group of policies, submit another request to
    -- @ListTrafficPolicies@. For the value of @TrafficPolicyIdMarker@, specify
    -- the value of @TrafficPolicyIdMarker@ that was returned in the previous
    -- response.
    ListTrafficPolicies -> Maybe Text
trafficPolicyIdMarker :: Prelude.Maybe Prelude.Text,
    -- | (Optional) The maximum number of traffic policies that you want Amazon
    -- Route 53 to return in response to this request. If you have more than
    -- @MaxItems@ traffic policies, the value of @IsTruncated@ in the response
    -- is @true@, and the value of @TrafficPolicyIdMarker@ is the ID of the
    -- first traffic policy that Route 53 will return if you submit another
    -- request.
    ListTrafficPolicies -> Maybe Text
maxItems :: Prelude.Maybe Prelude.Text
  }
  deriving (ListTrafficPolicies -> ListTrafficPolicies -> Bool
(ListTrafficPolicies -> ListTrafficPolicies -> Bool)
-> (ListTrafficPolicies -> ListTrafficPolicies -> Bool)
-> Eq ListTrafficPolicies
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]
(Int -> ReadS ListTrafficPolicies)
-> ReadS [ListTrafficPolicies]
-> ReadPrec ListTrafficPolicies
-> ReadPrec [ListTrafficPolicies]
-> Read 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
(Int -> ListTrafficPolicies -> ShowS)
-> (ListTrafficPolicies -> String)
-> ([ListTrafficPolicies] -> ShowS)
-> Show ListTrafficPolicies
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. ListTrafficPolicies -> Rep ListTrafficPolicies x)
-> (forall x. Rep ListTrafficPolicies x -> ListTrafficPolicies)
-> Generic ListTrafficPolicies
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)

-- |
-- Create a value of 'ListTrafficPolicies' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'trafficPolicyIdMarker', 'listTrafficPolicies_trafficPolicyIdMarker' - (Conditional) For your first request to @ListTrafficPolicies@, don\'t
-- include the @TrafficPolicyIdMarker@ parameter.
--
-- If you have more traffic policies than the value of @MaxItems@,
-- @ListTrafficPolicies@ returns only the first @MaxItems@ traffic
-- policies. To get the next group of policies, submit another request to
-- @ListTrafficPolicies@. For the value of @TrafficPolicyIdMarker@, specify
-- the value of @TrafficPolicyIdMarker@ that was returned in the previous
-- response.
--
-- 'maxItems', 'listTrafficPolicies_maxItems' - (Optional) The maximum number of traffic policies that you want Amazon
-- Route 53 to return in response to this request. If you have more than
-- @MaxItems@ traffic policies, the value of @IsTruncated@ in the response
-- is @true@, and the value of @TrafficPolicyIdMarker@ is the ID of the
-- first traffic policy that Route 53 will return if you submit another
-- request.
newListTrafficPolicies ::
  ListTrafficPolicies
newListTrafficPolicies :: ListTrafficPolicies
newListTrafficPolicies =
  ListTrafficPolicies' :: Maybe Text -> Maybe Text -> ListTrafficPolicies
ListTrafficPolicies'
    { $sel:trafficPolicyIdMarker:ListTrafficPolicies' :: Maybe Text
trafficPolicyIdMarker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListTrafficPolicies' :: Maybe Text
maxItems = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | (Conditional) For your first request to @ListTrafficPolicies@, don\'t
-- include the @TrafficPolicyIdMarker@ parameter.
--
-- If you have more traffic policies than the value of @MaxItems@,
-- @ListTrafficPolicies@ returns only the first @MaxItems@ traffic
-- policies. To get the next group of policies, submit another request to
-- @ListTrafficPolicies@. For the value of @TrafficPolicyIdMarker@, specify
-- the value of @TrafficPolicyIdMarker@ that was returned in the previous
-- response.
listTrafficPolicies_trafficPolicyIdMarker :: Lens.Lens' ListTrafficPolicies (Prelude.Maybe Prelude.Text)
listTrafficPolicies_trafficPolicyIdMarker :: (Maybe Text -> f (Maybe Text))
-> ListTrafficPolicies -> f ListTrafficPolicies
listTrafficPolicies_trafficPolicyIdMarker = (ListTrafficPolicies -> Maybe Text)
-> (ListTrafficPolicies -> Maybe Text -> ListTrafficPolicies)
-> Lens
     ListTrafficPolicies ListTrafficPolicies (Maybe Text) (Maybe Text)
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)

-- | (Optional) The maximum number of traffic policies that you want Amazon
-- Route 53 to return in response to this request. If you have more than
-- @MaxItems@ traffic policies, the value of @IsTruncated@ in the response
-- is @true@, and the value of @TrafficPolicyIdMarker@ is the ID of the
-- first traffic policy that Route 53 will return if you submit another
-- request.
listTrafficPolicies_maxItems :: Lens.Lens' ListTrafficPolicies (Prelude.Maybe Prelude.Text)
listTrafficPolicies_maxItems :: (Maybe Text -> f (Maybe Text))
-> ListTrafficPolicies -> f ListTrafficPolicies
listTrafficPolicies_maxItems = (ListTrafficPolicies -> Maybe Text)
-> (ListTrafficPolicies -> Maybe Text -> ListTrafficPolicies)
-> Lens
     ListTrafficPolicies ListTrafficPolicies (Maybe Text) (Maybe Text)
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)

instance Core.AWSRequest ListTrafficPolicies where
  type
    AWSResponse ListTrafficPolicies =
      ListTrafficPoliciesResponse
  request :: ListTrafficPolicies -> Request ListTrafficPolicies
request = Service -> ListTrafficPolicies -> Request ListTrafficPolicies
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListTrafficPolicies
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListTrafficPolicies)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse ListTrafficPolicies))
-> Logger
-> Service
-> Proxy ListTrafficPolicies
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListTrafficPolicies)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> 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'
            (Int
 -> [TrafficPolicySummary]
 -> Bool
 -> Text
 -> Text
 -> ListTrafficPoliciesResponse)
-> Either String Int
-> Either
     String
     ([TrafficPolicySummary]
      -> Bool -> Text -> Text -> ListTrafficPoliciesResponse)
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
  ([TrafficPolicySummary]
   -> Bool -> Text -> Text -> ListTrafficPoliciesResponse)
-> Either String [TrafficPolicySummary]
-> Either
     String (Bool -> Text -> Text -> ListTrafficPoliciesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TrafficPolicySummaries"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String [TrafficPolicySummary])
-> Either String [TrafficPolicySummary]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [TrafficPolicySummary]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"TrafficPolicySummary"
                        )
            Either String (Bool -> Text -> Text -> ListTrafficPoliciesResponse)
-> Either String Bool
-> Either String (Text -> Text -> ListTrafficPoliciesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Bool
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"IsTruncated")
            Either String (Text -> Text -> ListTrafficPoliciesResponse)
-> Either String Text
-> Either String (Text -> ListTrafficPoliciesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"TrafficPolicyIdMarker")
            Either String (Text -> ListTrafficPoliciesResponse)
-> Either String Text -> Either String ListTrafficPoliciesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"MaxItems")
      )

instance Prelude.Hashable ListTrafficPolicies

instance Prelude.NFData ListTrafficPolicies

instance Core.ToHeaders ListTrafficPolicies where
  toHeaders :: ListTrafficPolicies -> ResponseHeaders
toHeaders = ResponseHeaders -> ListTrafficPolicies -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath ListTrafficPolicies where
  toPath :: ListTrafficPolicies -> ByteString
toPath = ByteString -> ListTrafficPolicies -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2013-04-01/trafficpolicies"

instance Core.ToQuery ListTrafficPolicies where
  toQuery :: ListTrafficPolicies -> QueryString
toQuery ListTrafficPolicies' {Maybe Text
maxItems :: Maybe Text
trafficPolicyIdMarker :: Maybe Text
$sel:maxItems:ListTrafficPolicies' :: ListTrafficPolicies -> Maybe Text
$sel:trafficPolicyIdMarker:ListTrafficPolicies' :: ListTrafficPolicies -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"trafficpolicyid" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
trafficPolicyIdMarker,
        ByteString
"maxitems" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxItems
      ]

-- | A complex type that contains the response information for the request.
--
-- /See:/ 'newListTrafficPoliciesResponse' smart constructor.
data ListTrafficPoliciesResponse = ListTrafficPoliciesResponse'
  { -- | The response's http status code.
    ListTrafficPoliciesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list that contains one @TrafficPolicySummary@ element for each traffic
    -- policy that was created by the current Amazon Web Services account.
    ListTrafficPoliciesResponse -> [TrafficPolicySummary]
trafficPolicySummaries :: [TrafficPolicySummary],
    -- | A flag that indicates whether there are more traffic policies to be
    -- listed. If the response was truncated, you can get the next group of
    -- traffic policies by submitting another @ListTrafficPolicies@ request and
    -- specifying the value of @TrafficPolicyIdMarker@ in the
    -- @TrafficPolicyIdMarker@ request parameter.
    ListTrafficPoliciesResponse -> Bool
isTruncated :: Prelude.Bool,
    -- | If the value of @IsTruncated@ is @true@, @TrafficPolicyIdMarker@ is the
    -- ID of the first traffic policy in the next group of @MaxItems@ traffic
    -- policies.
    ListTrafficPoliciesResponse -> Text
trafficPolicyIdMarker :: Prelude.Text,
    -- | The value that you specified for the @MaxItems@ parameter in the
    -- @ListTrafficPolicies@ request that produced the current response.
    ListTrafficPoliciesResponse -> Text
maxItems :: Prelude.Text
  }
  deriving (ListTrafficPoliciesResponse -> ListTrafficPoliciesResponse -> Bool
(ListTrafficPoliciesResponse
 -> ListTrafficPoliciesResponse -> Bool)
-> (ListTrafficPoliciesResponse
    -> ListTrafficPoliciesResponse -> Bool)
-> Eq ListTrafficPoliciesResponse
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]
(Int -> ReadS ListTrafficPoliciesResponse)
-> ReadS [ListTrafficPoliciesResponse]
-> ReadPrec ListTrafficPoliciesResponse
-> ReadPrec [ListTrafficPoliciesResponse]
-> Read 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
(Int -> ListTrafficPoliciesResponse -> ShowS)
-> (ListTrafficPoliciesResponse -> String)
-> ([ListTrafficPoliciesResponse] -> ShowS)
-> Show ListTrafficPoliciesResponse
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.
 ListTrafficPoliciesResponse -> Rep ListTrafficPoliciesResponse x)
-> (forall x.
    Rep ListTrafficPoliciesResponse x -> ListTrafficPoliciesResponse)
-> Generic ListTrafficPoliciesResponse
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)

-- |
-- Create a value of 'ListTrafficPoliciesResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'listTrafficPoliciesResponse_httpStatus' - The response's http status code.
--
-- 'trafficPolicySummaries', 'listTrafficPoliciesResponse_trafficPolicySummaries' - A list that contains one @TrafficPolicySummary@ element for each traffic
-- policy that was created by the current Amazon Web Services account.
--
-- 'isTruncated', 'listTrafficPoliciesResponse_isTruncated' - A flag that indicates whether there are more traffic policies to be
-- listed. If the response was truncated, you can get the next group of
-- traffic policies by submitting another @ListTrafficPolicies@ request and
-- specifying the value of @TrafficPolicyIdMarker@ in the
-- @TrafficPolicyIdMarker@ request parameter.
--
-- 'trafficPolicyIdMarker', 'listTrafficPoliciesResponse_trafficPolicyIdMarker' - If the value of @IsTruncated@ is @true@, @TrafficPolicyIdMarker@ is the
-- ID of the first traffic policy in the next group of @MaxItems@ traffic
-- policies.
--
-- 'maxItems', 'listTrafficPoliciesResponse_maxItems' - The value that you specified for the @MaxItems@ parameter in the
-- @ListTrafficPolicies@ request that produced the current response.
newListTrafficPoliciesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'isTruncated'
  Prelude.Bool ->
  -- | 'trafficPolicyIdMarker'
  Prelude.Text ->
  -- | 'maxItems'
  Prelude.Text ->
  ListTrafficPoliciesResponse
newListTrafficPoliciesResponse :: Int -> Bool -> Text -> Text -> ListTrafficPoliciesResponse
newListTrafficPoliciesResponse
  Int
pHttpStatus_
  Bool
pIsTruncated_
  Text
pTrafficPolicyIdMarker_
  Text
pMaxItems_ =
    ListTrafficPoliciesResponse' :: Int
-> [TrafficPolicySummary]
-> Bool
-> Text
-> Text
-> ListTrafficPoliciesResponse
ListTrafficPoliciesResponse'
      { $sel:httpStatus:ListTrafficPoliciesResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:trafficPolicySummaries:ListTrafficPoliciesResponse' :: [TrafficPolicySummary]
trafficPolicySummaries = [TrafficPolicySummary]
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_
      }

-- | The response's http status code.
listTrafficPoliciesResponse_httpStatus :: Lens.Lens' ListTrafficPoliciesResponse Prelude.Int
listTrafficPoliciesResponse_httpStatus :: (Int -> f Int)
-> ListTrafficPoliciesResponse -> f ListTrafficPoliciesResponse
listTrafficPoliciesResponse_httpStatus = (ListTrafficPoliciesResponse -> Int)
-> (ListTrafficPoliciesResponse
    -> Int -> ListTrafficPoliciesResponse)
-> Lens
     ListTrafficPoliciesResponse ListTrafficPoliciesResponse Int Int
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)

-- | A list that contains one @TrafficPolicySummary@ element for each traffic
-- policy that was created by the current Amazon Web Services account.
listTrafficPoliciesResponse_trafficPolicySummaries :: Lens.Lens' ListTrafficPoliciesResponse [TrafficPolicySummary]
listTrafficPoliciesResponse_trafficPolicySummaries :: ([TrafficPolicySummary] -> f [TrafficPolicySummary])
-> ListTrafficPoliciesResponse -> f ListTrafficPoliciesResponse
listTrafficPoliciesResponse_trafficPolicySummaries = (ListTrafficPoliciesResponse -> [TrafficPolicySummary])
-> (ListTrafficPoliciesResponse
    -> [TrafficPolicySummary] -> ListTrafficPoliciesResponse)
-> Lens
     ListTrafficPoliciesResponse
     ListTrafficPoliciesResponse
     [TrafficPolicySummary]
     [TrafficPolicySummary]
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) (([TrafficPolicySummary] -> f [TrafficPolicySummary])
 -> ListTrafficPoliciesResponse -> f ListTrafficPoliciesResponse)
-> (([TrafficPolicySummary] -> f [TrafficPolicySummary])
    -> [TrafficPolicySummary] -> f [TrafficPolicySummary])
-> ([TrafficPolicySummary] -> f [TrafficPolicySummary])
-> ListTrafficPoliciesResponse
-> f ListTrafficPoliciesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TrafficPolicySummary] -> f [TrafficPolicySummary])
-> [TrafficPolicySummary] -> f [TrafficPolicySummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A flag that indicates whether there are more traffic policies to be
-- listed. If the response was truncated, you can get the next group of
-- traffic policies by submitting another @ListTrafficPolicies@ request and
-- specifying the value of @TrafficPolicyIdMarker@ in the
-- @TrafficPolicyIdMarker@ request parameter.
listTrafficPoliciesResponse_isTruncated :: Lens.Lens' ListTrafficPoliciesResponse Prelude.Bool
listTrafficPoliciesResponse_isTruncated :: (Bool -> f Bool)
-> ListTrafficPoliciesResponse -> f ListTrafficPoliciesResponse
listTrafficPoliciesResponse_isTruncated = (ListTrafficPoliciesResponse -> Bool)
-> (ListTrafficPoliciesResponse
    -> Bool -> ListTrafficPoliciesResponse)
-> Lens
     ListTrafficPoliciesResponse ListTrafficPoliciesResponse Bool Bool
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)

-- | If the value of @IsTruncated@ is @true@, @TrafficPolicyIdMarker@ is the
-- ID of the first traffic policy in the next group of @MaxItems@ traffic
-- policies.
listTrafficPoliciesResponse_trafficPolicyIdMarker :: Lens.Lens' ListTrafficPoliciesResponse Prelude.Text
listTrafficPoliciesResponse_trafficPolicyIdMarker :: (Text -> f Text)
-> ListTrafficPoliciesResponse -> f ListTrafficPoliciesResponse
listTrafficPoliciesResponse_trafficPolicyIdMarker = (ListTrafficPoliciesResponse -> Text)
-> (ListTrafficPoliciesResponse
    -> Text -> ListTrafficPoliciesResponse)
-> Lens
     ListTrafficPoliciesResponse ListTrafficPoliciesResponse Text Text
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)

-- | The value that you specified for the @MaxItems@ parameter in the
-- @ListTrafficPolicies@ request that produced the current response.
listTrafficPoliciesResponse_maxItems :: Lens.Lens' ListTrafficPoliciesResponse Prelude.Text
listTrafficPoliciesResponse_maxItems :: (Text -> f Text)
-> ListTrafficPoliciesResponse -> f ListTrafficPoliciesResponse
listTrafficPoliciesResponse_maxItems = (ListTrafficPoliciesResponse -> Text)
-> (ListTrafficPoliciesResponse
    -> Text -> ListTrafficPoliciesResponse)
-> Lens
     ListTrafficPoliciesResponse ListTrafficPoliciesResponse Text Text
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