{-# 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.ListTrafficPolicyVersions
-- 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 all of the versions for a specified traffic
-- policy.
--
-- Traffic policy versions are listed in numerical order by
-- @VersionNumber@.
module Amazonka.Route53.ListTrafficPolicyVersions
  ( -- * Creating a Request
    ListTrafficPolicyVersions (..),
    newListTrafficPolicyVersions,

    -- * Request Lenses
    listTrafficPolicyVersions_maxItems,
    listTrafficPolicyVersions_trafficPolicyVersionMarker,
    listTrafficPolicyVersions_id,

    -- * Destructuring the Response
    ListTrafficPolicyVersionsResponse (..),
    newListTrafficPolicyVersionsResponse,

    -- * Response Lenses
    listTrafficPolicyVersionsResponse_httpStatus,
    listTrafficPolicyVersionsResponse_trafficPolicies,
    listTrafficPolicyVersionsResponse_isTruncated,
    listTrafficPolicyVersionsResponse_trafficPolicyVersionMarker,
    listTrafficPolicyVersionsResponse_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
-- your traffic policies.
--
-- /See:/ 'newListTrafficPolicyVersions' smart constructor.
data ListTrafficPolicyVersions = ListTrafficPolicyVersions'
  { -- | The maximum number of traffic policy versions that you want Amazon Route
    -- 53 to include in the response body for this request. If the specified
    -- traffic policy has more than @MaxItems@ versions, the value of
    -- @IsTruncated@ in the response is @true@, and the value of the
    -- @TrafficPolicyVersionMarker@ element is the ID of the first version that
    -- Route 53 will return if you submit another request.
    ListTrafficPolicyVersions -> Maybe Text
maxItems :: Prelude.Maybe Prelude.Text,
    -- | For your first request to @ListTrafficPolicyVersions@, don\'t include
    -- the @TrafficPolicyVersionMarker@ parameter.
    --
    -- If you have more traffic policy versions than the value of @MaxItems@,
    -- @ListTrafficPolicyVersions@ returns only the first group of @MaxItems@
    -- versions. To get more traffic policy versions, submit another
    -- @ListTrafficPolicyVersions@ request. For the value of
    -- @TrafficPolicyVersionMarker@, specify the value of
    -- @TrafficPolicyVersionMarker@ in the previous response.
    ListTrafficPolicyVersions -> Maybe Text
trafficPolicyVersionMarker :: Prelude.Maybe Prelude.Text,
    -- | Specify the value of @Id@ of the traffic policy for which you want to
    -- list all versions.
    ListTrafficPolicyVersions -> Text
id :: Prelude.Text
  }
  deriving (ListTrafficPolicyVersions -> ListTrafficPolicyVersions -> Bool
(ListTrafficPolicyVersions -> ListTrafficPolicyVersions -> Bool)
-> (ListTrafficPolicyVersions -> ListTrafficPolicyVersions -> Bool)
-> Eq ListTrafficPolicyVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTrafficPolicyVersions -> ListTrafficPolicyVersions -> Bool
$c/= :: ListTrafficPolicyVersions -> ListTrafficPolicyVersions -> Bool
== :: ListTrafficPolicyVersions -> ListTrafficPolicyVersions -> Bool
$c== :: ListTrafficPolicyVersions -> ListTrafficPolicyVersions -> Bool
Prelude.Eq, ReadPrec [ListTrafficPolicyVersions]
ReadPrec ListTrafficPolicyVersions
Int -> ReadS ListTrafficPolicyVersions
ReadS [ListTrafficPolicyVersions]
(Int -> ReadS ListTrafficPolicyVersions)
-> ReadS [ListTrafficPolicyVersions]
-> ReadPrec ListTrafficPolicyVersions
-> ReadPrec [ListTrafficPolicyVersions]
-> Read ListTrafficPolicyVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTrafficPolicyVersions]
$creadListPrec :: ReadPrec [ListTrafficPolicyVersions]
readPrec :: ReadPrec ListTrafficPolicyVersions
$creadPrec :: ReadPrec ListTrafficPolicyVersions
readList :: ReadS [ListTrafficPolicyVersions]
$creadList :: ReadS [ListTrafficPolicyVersions]
readsPrec :: Int -> ReadS ListTrafficPolicyVersions
$creadsPrec :: Int -> ReadS ListTrafficPolicyVersions
Prelude.Read, Int -> ListTrafficPolicyVersions -> ShowS
[ListTrafficPolicyVersions] -> ShowS
ListTrafficPolicyVersions -> String
(Int -> ListTrafficPolicyVersions -> ShowS)
-> (ListTrafficPolicyVersions -> String)
-> ([ListTrafficPolicyVersions] -> ShowS)
-> Show ListTrafficPolicyVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTrafficPolicyVersions] -> ShowS
$cshowList :: [ListTrafficPolicyVersions] -> ShowS
show :: ListTrafficPolicyVersions -> String
$cshow :: ListTrafficPolicyVersions -> String
showsPrec :: Int -> ListTrafficPolicyVersions -> ShowS
$cshowsPrec :: Int -> ListTrafficPolicyVersions -> ShowS
Prelude.Show, (forall x.
 ListTrafficPolicyVersions -> Rep ListTrafficPolicyVersions x)
-> (forall x.
    Rep ListTrafficPolicyVersions x -> ListTrafficPolicyVersions)
-> Generic ListTrafficPolicyVersions
forall x.
Rep ListTrafficPolicyVersions x -> ListTrafficPolicyVersions
forall x.
ListTrafficPolicyVersions -> Rep ListTrafficPolicyVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTrafficPolicyVersions x -> ListTrafficPolicyVersions
$cfrom :: forall x.
ListTrafficPolicyVersions -> Rep ListTrafficPolicyVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListTrafficPolicyVersions' 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:
--
-- 'maxItems', 'listTrafficPolicyVersions_maxItems' - The maximum number of traffic policy versions that you want Amazon Route
-- 53 to include in the response body for this request. If the specified
-- traffic policy has more than @MaxItems@ versions, the value of
-- @IsTruncated@ in the response is @true@, and the value of the
-- @TrafficPolicyVersionMarker@ element is the ID of the first version that
-- Route 53 will return if you submit another request.
--
-- 'trafficPolicyVersionMarker', 'listTrafficPolicyVersions_trafficPolicyVersionMarker' - For your first request to @ListTrafficPolicyVersions@, don\'t include
-- the @TrafficPolicyVersionMarker@ parameter.
--
-- If you have more traffic policy versions than the value of @MaxItems@,
-- @ListTrafficPolicyVersions@ returns only the first group of @MaxItems@
-- versions. To get more traffic policy versions, submit another
-- @ListTrafficPolicyVersions@ request. For the value of
-- @TrafficPolicyVersionMarker@, specify the value of
-- @TrafficPolicyVersionMarker@ in the previous response.
--
-- 'id', 'listTrafficPolicyVersions_id' - Specify the value of @Id@ of the traffic policy for which you want to
-- list all versions.
newListTrafficPolicyVersions ::
  -- | 'id'
  Prelude.Text ->
  ListTrafficPolicyVersions
newListTrafficPolicyVersions :: Text -> ListTrafficPolicyVersions
newListTrafficPolicyVersions Text
pId_ =
  ListTrafficPolicyVersions' :: Maybe Text -> Maybe Text -> Text -> ListTrafficPolicyVersions
ListTrafficPolicyVersions'
    { $sel:maxItems:ListTrafficPolicyVersions' :: Maybe Text
maxItems =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:trafficPolicyVersionMarker:ListTrafficPolicyVersions' :: Maybe Text
trafficPolicyVersionMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ListTrafficPolicyVersions' :: Text
id = Text
pId_
    }

-- | The maximum number of traffic policy versions that you want Amazon Route
-- 53 to include in the response body for this request. If the specified
-- traffic policy has more than @MaxItems@ versions, the value of
-- @IsTruncated@ in the response is @true@, and the value of the
-- @TrafficPolicyVersionMarker@ element is the ID of the first version that
-- Route 53 will return if you submit another request.
listTrafficPolicyVersions_maxItems :: Lens.Lens' ListTrafficPolicyVersions (Prelude.Maybe Prelude.Text)
listTrafficPolicyVersions_maxItems :: (Maybe Text -> f (Maybe Text))
-> ListTrafficPolicyVersions -> f ListTrafficPolicyVersions
listTrafficPolicyVersions_maxItems = (ListTrafficPolicyVersions -> Maybe Text)
-> (ListTrafficPolicyVersions
    -> Maybe Text -> ListTrafficPolicyVersions)
-> Lens
     ListTrafficPolicyVersions
     ListTrafficPolicyVersions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPolicyVersions' {Maybe Text
maxItems :: Maybe Text
$sel:maxItems:ListTrafficPolicyVersions' :: ListTrafficPolicyVersions -> Maybe Text
maxItems} -> Maybe Text
maxItems) (\s :: ListTrafficPolicyVersions
s@ListTrafficPolicyVersions' {} Maybe Text
a -> ListTrafficPolicyVersions
s {$sel:maxItems:ListTrafficPolicyVersions' :: Maybe Text
maxItems = Maybe Text
a} :: ListTrafficPolicyVersions)

-- | For your first request to @ListTrafficPolicyVersions@, don\'t include
-- the @TrafficPolicyVersionMarker@ parameter.
--
-- If you have more traffic policy versions than the value of @MaxItems@,
-- @ListTrafficPolicyVersions@ returns only the first group of @MaxItems@
-- versions. To get more traffic policy versions, submit another
-- @ListTrafficPolicyVersions@ request. For the value of
-- @TrafficPolicyVersionMarker@, specify the value of
-- @TrafficPolicyVersionMarker@ in the previous response.
listTrafficPolicyVersions_trafficPolicyVersionMarker :: Lens.Lens' ListTrafficPolicyVersions (Prelude.Maybe Prelude.Text)
listTrafficPolicyVersions_trafficPolicyVersionMarker :: (Maybe Text -> f (Maybe Text))
-> ListTrafficPolicyVersions -> f ListTrafficPolicyVersions
listTrafficPolicyVersions_trafficPolicyVersionMarker = (ListTrafficPolicyVersions -> Maybe Text)
-> (ListTrafficPolicyVersions
    -> Maybe Text -> ListTrafficPolicyVersions)
-> Lens
     ListTrafficPolicyVersions
     ListTrafficPolicyVersions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPolicyVersions' {Maybe Text
trafficPolicyVersionMarker :: Maybe Text
$sel:trafficPolicyVersionMarker:ListTrafficPolicyVersions' :: ListTrafficPolicyVersions -> Maybe Text
trafficPolicyVersionMarker} -> Maybe Text
trafficPolicyVersionMarker) (\s :: ListTrafficPolicyVersions
s@ListTrafficPolicyVersions' {} Maybe Text
a -> ListTrafficPolicyVersions
s {$sel:trafficPolicyVersionMarker:ListTrafficPolicyVersions' :: Maybe Text
trafficPolicyVersionMarker = Maybe Text
a} :: ListTrafficPolicyVersions)

-- | Specify the value of @Id@ of the traffic policy for which you want to
-- list all versions.
listTrafficPolicyVersions_id :: Lens.Lens' ListTrafficPolicyVersions Prelude.Text
listTrafficPolicyVersions_id :: (Text -> f Text)
-> ListTrafficPolicyVersions -> f ListTrafficPolicyVersions
listTrafficPolicyVersions_id = (ListTrafficPolicyVersions -> Text)
-> (ListTrafficPolicyVersions -> Text -> ListTrafficPolicyVersions)
-> Lens
     ListTrafficPolicyVersions ListTrafficPolicyVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPolicyVersions' {Text
id :: Text
$sel:id:ListTrafficPolicyVersions' :: ListTrafficPolicyVersions -> Text
id} -> Text
id) (\s :: ListTrafficPolicyVersions
s@ListTrafficPolicyVersions' {} Text
a -> ListTrafficPolicyVersions
s {$sel:id:ListTrafficPolicyVersions' :: Text
id = Text
a} :: ListTrafficPolicyVersions)

instance Core.AWSRequest ListTrafficPolicyVersions where
  type
    AWSResponse ListTrafficPolicyVersions =
      ListTrafficPolicyVersionsResponse
  request :: ListTrafficPolicyVersions -> Request ListTrafficPolicyVersions
request = Service
-> ListTrafficPolicyVersions -> Request ListTrafficPolicyVersions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListTrafficPolicyVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListTrafficPolicyVersions)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse ListTrafficPolicyVersions))
-> Logger
-> Service
-> Proxy ListTrafficPolicyVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListTrafficPolicyVersions)))
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
-> [TrafficPolicy]
-> Bool
-> Text
-> Text
-> ListTrafficPolicyVersionsResponse
ListTrafficPolicyVersionsResponse'
            (Int
 -> [TrafficPolicy]
 -> Bool
 -> Text
 -> Text
 -> ListTrafficPolicyVersionsResponse)
-> Either String Int
-> Either
     String
     ([TrafficPolicy]
      -> Bool -> Text -> Text -> ListTrafficPolicyVersionsResponse)
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
  ([TrafficPolicy]
   -> Bool -> Text -> Text -> ListTrafficPolicyVersionsResponse)
-> Either String [TrafficPolicy]
-> Either
     String (Bool -> Text -> Text -> ListTrafficPolicyVersionsResponse)
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
"TrafficPolicies" 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 [TrafficPolicy])
-> Either String [TrafficPolicy]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [TrafficPolicy]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"TrafficPolicy"
                        )
            Either
  String (Bool -> Text -> Text -> ListTrafficPolicyVersionsResponse)
-> Either String Bool
-> Either
     String (Text -> Text -> ListTrafficPolicyVersionsResponse)
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 -> ListTrafficPolicyVersionsResponse)
-> Either String Text
-> Either String (Text -> ListTrafficPolicyVersionsResponse)
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
"TrafficPolicyVersionMarker")
            Either String (Text -> ListTrafficPolicyVersionsResponse)
-> Either String Text
-> Either String ListTrafficPolicyVersionsResponse
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 ListTrafficPolicyVersions

instance Prelude.NFData ListTrafficPolicyVersions

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

instance Core.ToPath ListTrafficPolicyVersions where
  toPath :: ListTrafficPolicyVersions -> ByteString
toPath ListTrafficPolicyVersions' {Maybe Text
Text
id :: Text
trafficPolicyVersionMarker :: Maybe Text
maxItems :: Maybe Text
$sel:id:ListTrafficPolicyVersions' :: ListTrafficPolicyVersions -> Text
$sel:trafficPolicyVersionMarker:ListTrafficPolicyVersions' :: ListTrafficPolicyVersions -> Maybe Text
$sel:maxItems:ListTrafficPolicyVersions' :: ListTrafficPolicyVersions -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2013-04-01/trafficpolicies/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id,
        ByteString
"/versions"
      ]

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

-- | A complex type that contains the response information for the request.
--
-- /See:/ 'newListTrafficPolicyVersionsResponse' smart constructor.
data ListTrafficPolicyVersionsResponse = ListTrafficPolicyVersionsResponse'
  { -- | The response's http status code.
    ListTrafficPolicyVersionsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list that contains one @TrafficPolicy@ element for each traffic policy
    -- version that is associated with the specified traffic policy.
    ListTrafficPolicyVersionsResponse -> [TrafficPolicy]
trafficPolicies :: [TrafficPolicy],
    -- | 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 @ListTrafficPolicyVersions@
    -- request and specifying the value of @NextMarker@ in the @marker@
    -- parameter.
    ListTrafficPolicyVersionsResponse -> Bool
isTruncated :: Prelude.Bool,
    -- | If @IsTruncated@ is @true@, the value of @TrafficPolicyVersionMarker@
    -- identifies the first traffic policy that Amazon Route 53 will return if
    -- you submit another request. Call @ListTrafficPolicyVersions@ again and
    -- specify the value of @TrafficPolicyVersionMarker@ in the
    -- @TrafficPolicyVersionMarker@ request parameter.
    --
    -- This element is present only if @IsTruncated@ is @true@.
    ListTrafficPolicyVersionsResponse -> Text
trafficPolicyVersionMarker :: Prelude.Text,
    -- | The value that you specified for the @maxitems@ parameter in the
    -- @ListTrafficPolicyVersions@ request that produced the current response.
    ListTrafficPolicyVersionsResponse -> Text
maxItems :: Prelude.Text
  }
  deriving (ListTrafficPolicyVersionsResponse
-> ListTrafficPolicyVersionsResponse -> Bool
(ListTrafficPolicyVersionsResponse
 -> ListTrafficPolicyVersionsResponse -> Bool)
-> (ListTrafficPolicyVersionsResponse
    -> ListTrafficPolicyVersionsResponse -> Bool)
-> Eq ListTrafficPolicyVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTrafficPolicyVersionsResponse
-> ListTrafficPolicyVersionsResponse -> Bool
$c/= :: ListTrafficPolicyVersionsResponse
-> ListTrafficPolicyVersionsResponse -> Bool
== :: ListTrafficPolicyVersionsResponse
-> ListTrafficPolicyVersionsResponse -> Bool
$c== :: ListTrafficPolicyVersionsResponse
-> ListTrafficPolicyVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListTrafficPolicyVersionsResponse]
ReadPrec ListTrafficPolicyVersionsResponse
Int -> ReadS ListTrafficPolicyVersionsResponse
ReadS [ListTrafficPolicyVersionsResponse]
(Int -> ReadS ListTrafficPolicyVersionsResponse)
-> ReadS [ListTrafficPolicyVersionsResponse]
-> ReadPrec ListTrafficPolicyVersionsResponse
-> ReadPrec [ListTrafficPolicyVersionsResponse]
-> Read ListTrafficPolicyVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTrafficPolicyVersionsResponse]
$creadListPrec :: ReadPrec [ListTrafficPolicyVersionsResponse]
readPrec :: ReadPrec ListTrafficPolicyVersionsResponse
$creadPrec :: ReadPrec ListTrafficPolicyVersionsResponse
readList :: ReadS [ListTrafficPolicyVersionsResponse]
$creadList :: ReadS [ListTrafficPolicyVersionsResponse]
readsPrec :: Int -> ReadS ListTrafficPolicyVersionsResponse
$creadsPrec :: Int -> ReadS ListTrafficPolicyVersionsResponse
Prelude.Read, Int -> ListTrafficPolicyVersionsResponse -> ShowS
[ListTrafficPolicyVersionsResponse] -> ShowS
ListTrafficPolicyVersionsResponse -> String
(Int -> ListTrafficPolicyVersionsResponse -> ShowS)
-> (ListTrafficPolicyVersionsResponse -> String)
-> ([ListTrafficPolicyVersionsResponse] -> ShowS)
-> Show ListTrafficPolicyVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTrafficPolicyVersionsResponse] -> ShowS
$cshowList :: [ListTrafficPolicyVersionsResponse] -> ShowS
show :: ListTrafficPolicyVersionsResponse -> String
$cshow :: ListTrafficPolicyVersionsResponse -> String
showsPrec :: Int -> ListTrafficPolicyVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListTrafficPolicyVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListTrafficPolicyVersionsResponse
 -> Rep ListTrafficPolicyVersionsResponse x)
-> (forall x.
    Rep ListTrafficPolicyVersionsResponse x
    -> ListTrafficPolicyVersionsResponse)
-> Generic ListTrafficPolicyVersionsResponse
forall x.
Rep ListTrafficPolicyVersionsResponse x
-> ListTrafficPolicyVersionsResponse
forall x.
ListTrafficPolicyVersionsResponse
-> Rep ListTrafficPolicyVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTrafficPolicyVersionsResponse x
-> ListTrafficPolicyVersionsResponse
$cfrom :: forall x.
ListTrafficPolicyVersionsResponse
-> Rep ListTrafficPolicyVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTrafficPolicyVersionsResponse' 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', 'listTrafficPolicyVersionsResponse_httpStatus' - The response's http status code.
--
-- 'trafficPolicies', 'listTrafficPolicyVersionsResponse_trafficPolicies' - A list that contains one @TrafficPolicy@ element for each traffic policy
-- version that is associated with the specified traffic policy.
--
-- 'isTruncated', 'listTrafficPolicyVersionsResponse_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 @ListTrafficPolicyVersions@
-- request and specifying the value of @NextMarker@ in the @marker@
-- parameter.
--
-- 'trafficPolicyVersionMarker', 'listTrafficPolicyVersionsResponse_trafficPolicyVersionMarker' - If @IsTruncated@ is @true@, the value of @TrafficPolicyVersionMarker@
-- identifies the first traffic policy that Amazon Route 53 will return if
-- you submit another request. Call @ListTrafficPolicyVersions@ again and
-- specify the value of @TrafficPolicyVersionMarker@ in the
-- @TrafficPolicyVersionMarker@ request parameter.
--
-- This element is present only if @IsTruncated@ is @true@.
--
-- 'maxItems', 'listTrafficPolicyVersionsResponse_maxItems' - The value that you specified for the @maxitems@ parameter in the
-- @ListTrafficPolicyVersions@ request that produced the current response.
newListTrafficPolicyVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'isTruncated'
  Prelude.Bool ->
  -- | 'trafficPolicyVersionMarker'
  Prelude.Text ->
  -- | 'maxItems'
  Prelude.Text ->
  ListTrafficPolicyVersionsResponse
newListTrafficPolicyVersionsResponse :: Int -> Bool -> Text -> Text -> ListTrafficPolicyVersionsResponse
newListTrafficPolicyVersionsResponse
  Int
pHttpStatus_
  Bool
pIsTruncated_
  Text
pTrafficPolicyVersionMarker_
  Text
pMaxItems_ =
    ListTrafficPolicyVersionsResponse' :: Int
-> [TrafficPolicy]
-> Bool
-> Text
-> Text
-> ListTrafficPolicyVersionsResponse
ListTrafficPolicyVersionsResponse'
      { $sel:httpStatus:ListTrafficPolicyVersionsResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:trafficPolicies:ListTrafficPolicyVersionsResponse' :: [TrafficPolicy]
trafficPolicies = [TrafficPolicy]
forall a. Monoid a => a
Prelude.mempty,
        $sel:isTruncated:ListTrafficPolicyVersionsResponse' :: Bool
isTruncated = Bool
pIsTruncated_,
        $sel:trafficPolicyVersionMarker:ListTrafficPolicyVersionsResponse' :: Text
trafficPolicyVersionMarker =
          Text
pTrafficPolicyVersionMarker_,
        $sel:maxItems:ListTrafficPolicyVersionsResponse' :: Text
maxItems = Text
pMaxItems_
      }

-- | The response's http status code.
listTrafficPolicyVersionsResponse_httpStatus :: Lens.Lens' ListTrafficPolicyVersionsResponse Prelude.Int
listTrafficPolicyVersionsResponse_httpStatus :: (Int -> f Int)
-> ListTrafficPolicyVersionsResponse
-> f ListTrafficPolicyVersionsResponse
listTrafficPolicyVersionsResponse_httpStatus = (ListTrafficPolicyVersionsResponse -> Int)
-> (ListTrafficPolicyVersionsResponse
    -> Int -> ListTrafficPolicyVersionsResponse)
-> Lens
     ListTrafficPolicyVersionsResponse
     ListTrafficPolicyVersionsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPolicyVersionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTrafficPolicyVersionsResponse' :: ListTrafficPolicyVersionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTrafficPolicyVersionsResponse
s@ListTrafficPolicyVersionsResponse' {} Int
a -> ListTrafficPolicyVersionsResponse
s {$sel:httpStatus:ListTrafficPolicyVersionsResponse' :: Int
httpStatus = Int
a} :: ListTrafficPolicyVersionsResponse)

-- | A list that contains one @TrafficPolicy@ element for each traffic policy
-- version that is associated with the specified traffic policy.
listTrafficPolicyVersionsResponse_trafficPolicies :: Lens.Lens' ListTrafficPolicyVersionsResponse [TrafficPolicy]
listTrafficPolicyVersionsResponse_trafficPolicies :: ([TrafficPolicy] -> f [TrafficPolicy])
-> ListTrafficPolicyVersionsResponse
-> f ListTrafficPolicyVersionsResponse
listTrafficPolicyVersionsResponse_trafficPolicies = (ListTrafficPolicyVersionsResponse -> [TrafficPolicy])
-> (ListTrafficPolicyVersionsResponse
    -> [TrafficPolicy] -> ListTrafficPolicyVersionsResponse)
-> Lens
     ListTrafficPolicyVersionsResponse
     ListTrafficPolicyVersionsResponse
     [TrafficPolicy]
     [TrafficPolicy]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPolicyVersionsResponse' {[TrafficPolicy]
trafficPolicies :: [TrafficPolicy]
$sel:trafficPolicies:ListTrafficPolicyVersionsResponse' :: ListTrafficPolicyVersionsResponse -> [TrafficPolicy]
trafficPolicies} -> [TrafficPolicy]
trafficPolicies) (\s :: ListTrafficPolicyVersionsResponse
s@ListTrafficPolicyVersionsResponse' {} [TrafficPolicy]
a -> ListTrafficPolicyVersionsResponse
s {$sel:trafficPolicies:ListTrafficPolicyVersionsResponse' :: [TrafficPolicy]
trafficPolicies = [TrafficPolicy]
a} :: ListTrafficPolicyVersionsResponse) (([TrafficPolicy] -> f [TrafficPolicy])
 -> ListTrafficPolicyVersionsResponse
 -> f ListTrafficPolicyVersionsResponse)
-> (([TrafficPolicy] -> f [TrafficPolicy])
    -> [TrafficPolicy] -> f [TrafficPolicy])
-> ([TrafficPolicy] -> f [TrafficPolicy])
-> ListTrafficPolicyVersionsResponse
-> f ListTrafficPolicyVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TrafficPolicy] -> f [TrafficPolicy])
-> [TrafficPolicy] -> f [TrafficPolicy]
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 @ListTrafficPolicyVersions@
-- request and specifying the value of @NextMarker@ in the @marker@
-- parameter.
listTrafficPolicyVersionsResponse_isTruncated :: Lens.Lens' ListTrafficPolicyVersionsResponse Prelude.Bool
listTrafficPolicyVersionsResponse_isTruncated :: (Bool -> f Bool)
-> ListTrafficPolicyVersionsResponse
-> f ListTrafficPolicyVersionsResponse
listTrafficPolicyVersionsResponse_isTruncated = (ListTrafficPolicyVersionsResponse -> Bool)
-> (ListTrafficPolicyVersionsResponse
    -> Bool -> ListTrafficPolicyVersionsResponse)
-> Lens
     ListTrafficPolicyVersionsResponse
     ListTrafficPolicyVersionsResponse
     Bool
     Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPolicyVersionsResponse' {Bool
isTruncated :: Bool
$sel:isTruncated:ListTrafficPolicyVersionsResponse' :: ListTrafficPolicyVersionsResponse -> Bool
isTruncated} -> Bool
isTruncated) (\s :: ListTrafficPolicyVersionsResponse
s@ListTrafficPolicyVersionsResponse' {} Bool
a -> ListTrafficPolicyVersionsResponse
s {$sel:isTruncated:ListTrafficPolicyVersionsResponse' :: Bool
isTruncated = Bool
a} :: ListTrafficPolicyVersionsResponse)

-- | If @IsTruncated@ is @true@, the value of @TrafficPolicyVersionMarker@
-- identifies the first traffic policy that Amazon Route 53 will return if
-- you submit another request. Call @ListTrafficPolicyVersions@ again and
-- specify the value of @TrafficPolicyVersionMarker@ in the
-- @TrafficPolicyVersionMarker@ request parameter.
--
-- This element is present only if @IsTruncated@ is @true@.
listTrafficPolicyVersionsResponse_trafficPolicyVersionMarker :: Lens.Lens' ListTrafficPolicyVersionsResponse Prelude.Text
listTrafficPolicyVersionsResponse_trafficPolicyVersionMarker :: (Text -> f Text)
-> ListTrafficPolicyVersionsResponse
-> f ListTrafficPolicyVersionsResponse
listTrafficPolicyVersionsResponse_trafficPolicyVersionMarker = (ListTrafficPolicyVersionsResponse -> Text)
-> (ListTrafficPolicyVersionsResponse
    -> Text -> ListTrafficPolicyVersionsResponse)
-> Lens
     ListTrafficPolicyVersionsResponse
     ListTrafficPolicyVersionsResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPolicyVersionsResponse' {Text
trafficPolicyVersionMarker :: Text
$sel:trafficPolicyVersionMarker:ListTrafficPolicyVersionsResponse' :: ListTrafficPolicyVersionsResponse -> Text
trafficPolicyVersionMarker} -> Text
trafficPolicyVersionMarker) (\s :: ListTrafficPolicyVersionsResponse
s@ListTrafficPolicyVersionsResponse' {} Text
a -> ListTrafficPolicyVersionsResponse
s {$sel:trafficPolicyVersionMarker:ListTrafficPolicyVersionsResponse' :: Text
trafficPolicyVersionMarker = Text
a} :: ListTrafficPolicyVersionsResponse)

-- | The value that you specified for the @maxitems@ parameter in the
-- @ListTrafficPolicyVersions@ request that produced the current response.
listTrafficPolicyVersionsResponse_maxItems :: Lens.Lens' ListTrafficPolicyVersionsResponse Prelude.Text
listTrafficPolicyVersionsResponse_maxItems :: (Text -> f Text)
-> ListTrafficPolicyVersionsResponse
-> f ListTrafficPolicyVersionsResponse
listTrafficPolicyVersionsResponse_maxItems = (ListTrafficPolicyVersionsResponse -> Text)
-> (ListTrafficPolicyVersionsResponse
    -> Text -> ListTrafficPolicyVersionsResponse)
-> Lens
     ListTrafficPolicyVersionsResponse
     ListTrafficPolicyVersionsResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrafficPolicyVersionsResponse' {Text
maxItems :: Text
$sel:maxItems:ListTrafficPolicyVersionsResponse' :: ListTrafficPolicyVersionsResponse -> Text
maxItems} -> Text
maxItems) (\s :: ListTrafficPolicyVersionsResponse
s@ListTrafficPolicyVersionsResponse' {} Text
a -> ListTrafficPolicyVersionsResponse
s {$sel:maxItems:ListTrafficPolicyVersionsResponse' :: Text
maxItems = Text
a} :: ListTrafficPolicyVersionsResponse)

instance
  Prelude.NFData
    ListTrafficPolicyVersionsResponse