{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.CloudFront.Types.ContinuousDeploymentPolicyList
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudFront.Types.ContinuousDeploymentPolicyList where

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

-- | Contains a list of continuous deployment policies.
--
-- /See:/ 'newContinuousDeploymentPolicyList' smart constructor.
data ContinuousDeploymentPolicyList = ContinuousDeploymentPolicyList'
  { -- | A list of continuous deployment policy items.
    ContinuousDeploymentPolicyList
-> Maybe [ContinuousDeploymentPolicySummary]
items :: Prelude.Maybe [ContinuousDeploymentPolicySummary],
    -- | Indicates the next page of continuous deployment policies. To get the
    -- next page of the list, use this value in the @Marker@ field of your
    -- request.
    ContinuousDeploymentPolicyList -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of continuous deployment policies that were specified
    -- in your request.
    ContinuousDeploymentPolicyList -> Int
maxItems :: Prelude.Int,
    -- | The total number of continuous deployment policies in your Amazon Web
    -- Services account, regardless of the @MaxItems@ value.
    ContinuousDeploymentPolicyList -> Int
quantity :: Prelude.Int
  }
  deriving (ContinuousDeploymentPolicyList
-> ContinuousDeploymentPolicyList -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContinuousDeploymentPolicyList
-> ContinuousDeploymentPolicyList -> Bool
$c/= :: ContinuousDeploymentPolicyList
-> ContinuousDeploymentPolicyList -> Bool
== :: ContinuousDeploymentPolicyList
-> ContinuousDeploymentPolicyList -> Bool
$c== :: ContinuousDeploymentPolicyList
-> ContinuousDeploymentPolicyList -> Bool
Prelude.Eq, ReadPrec [ContinuousDeploymentPolicyList]
ReadPrec ContinuousDeploymentPolicyList
Int -> ReadS ContinuousDeploymentPolicyList
ReadS [ContinuousDeploymentPolicyList]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContinuousDeploymentPolicyList]
$creadListPrec :: ReadPrec [ContinuousDeploymentPolicyList]
readPrec :: ReadPrec ContinuousDeploymentPolicyList
$creadPrec :: ReadPrec ContinuousDeploymentPolicyList
readList :: ReadS [ContinuousDeploymentPolicyList]
$creadList :: ReadS [ContinuousDeploymentPolicyList]
readsPrec :: Int -> ReadS ContinuousDeploymentPolicyList
$creadsPrec :: Int -> ReadS ContinuousDeploymentPolicyList
Prelude.Read, Int -> ContinuousDeploymentPolicyList -> ShowS
[ContinuousDeploymentPolicyList] -> ShowS
ContinuousDeploymentPolicyList -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContinuousDeploymentPolicyList] -> ShowS
$cshowList :: [ContinuousDeploymentPolicyList] -> ShowS
show :: ContinuousDeploymentPolicyList -> String
$cshow :: ContinuousDeploymentPolicyList -> String
showsPrec :: Int -> ContinuousDeploymentPolicyList -> ShowS
$cshowsPrec :: Int -> ContinuousDeploymentPolicyList -> ShowS
Prelude.Show, forall x.
Rep ContinuousDeploymentPolicyList x
-> ContinuousDeploymentPolicyList
forall x.
ContinuousDeploymentPolicyList
-> Rep ContinuousDeploymentPolicyList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ContinuousDeploymentPolicyList x
-> ContinuousDeploymentPolicyList
$cfrom :: forall x.
ContinuousDeploymentPolicyList
-> Rep ContinuousDeploymentPolicyList x
Prelude.Generic)

-- |
-- Create a value of 'ContinuousDeploymentPolicyList' 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:
--
-- 'items', 'continuousDeploymentPolicyList_items' - A list of continuous deployment policy items.
--
-- 'nextMarker', 'continuousDeploymentPolicyList_nextMarker' - Indicates the next page of continuous deployment policies. To get the
-- next page of the list, use this value in the @Marker@ field of your
-- request.
--
-- 'maxItems', 'continuousDeploymentPolicyList_maxItems' - The maximum number of continuous deployment policies that were specified
-- in your request.
--
-- 'quantity', 'continuousDeploymentPolicyList_quantity' - The total number of continuous deployment policies in your Amazon Web
-- Services account, regardless of the @MaxItems@ value.
newContinuousDeploymentPolicyList ::
  -- | 'maxItems'
  Prelude.Int ->
  -- | 'quantity'
  Prelude.Int ->
  ContinuousDeploymentPolicyList
newContinuousDeploymentPolicyList :: Int -> Int -> ContinuousDeploymentPolicyList
newContinuousDeploymentPolicyList
  Int
pMaxItems_
  Int
pQuantity_ =
    ContinuousDeploymentPolicyList'
      { $sel:items:ContinuousDeploymentPolicyList' :: Maybe [ContinuousDeploymentPolicySummary]
items =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextMarker:ContinuousDeploymentPolicyList' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
        $sel:maxItems:ContinuousDeploymentPolicyList' :: Int
maxItems = Int
pMaxItems_,
        $sel:quantity:ContinuousDeploymentPolicyList' :: Int
quantity = Int
pQuantity_
      }

-- | A list of continuous deployment policy items.
continuousDeploymentPolicyList_items :: Lens.Lens' ContinuousDeploymentPolicyList (Prelude.Maybe [ContinuousDeploymentPolicySummary])
continuousDeploymentPolicyList_items :: Lens'
  ContinuousDeploymentPolicyList
  (Maybe [ContinuousDeploymentPolicySummary])
continuousDeploymentPolicyList_items = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousDeploymentPolicyList' {Maybe [ContinuousDeploymentPolicySummary]
items :: Maybe [ContinuousDeploymentPolicySummary]
$sel:items:ContinuousDeploymentPolicyList' :: ContinuousDeploymentPolicyList
-> Maybe [ContinuousDeploymentPolicySummary]
items} -> Maybe [ContinuousDeploymentPolicySummary]
items) (\s :: ContinuousDeploymentPolicyList
s@ContinuousDeploymentPolicyList' {} Maybe [ContinuousDeploymentPolicySummary]
a -> ContinuousDeploymentPolicyList
s {$sel:items:ContinuousDeploymentPolicyList' :: Maybe [ContinuousDeploymentPolicySummary]
items = Maybe [ContinuousDeploymentPolicySummary]
a} :: ContinuousDeploymentPolicyList) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates the next page of continuous deployment policies. To get the
-- next page of the list, use this value in the @Marker@ field of your
-- request.
continuousDeploymentPolicyList_nextMarker :: Lens.Lens' ContinuousDeploymentPolicyList (Prelude.Maybe Prelude.Text)
continuousDeploymentPolicyList_nextMarker :: Lens' ContinuousDeploymentPolicyList (Maybe Text)
continuousDeploymentPolicyList_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousDeploymentPolicyList' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ContinuousDeploymentPolicyList' :: ContinuousDeploymentPolicyList -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ContinuousDeploymentPolicyList
s@ContinuousDeploymentPolicyList' {} Maybe Text
a -> ContinuousDeploymentPolicyList
s {$sel:nextMarker:ContinuousDeploymentPolicyList' :: Maybe Text
nextMarker = Maybe Text
a} :: ContinuousDeploymentPolicyList)

-- | The maximum number of continuous deployment policies that were specified
-- in your request.
continuousDeploymentPolicyList_maxItems :: Lens.Lens' ContinuousDeploymentPolicyList Prelude.Int
continuousDeploymentPolicyList_maxItems :: Lens' ContinuousDeploymentPolicyList Int
continuousDeploymentPolicyList_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousDeploymentPolicyList' {Int
maxItems :: Int
$sel:maxItems:ContinuousDeploymentPolicyList' :: ContinuousDeploymentPolicyList -> Int
maxItems} -> Int
maxItems) (\s :: ContinuousDeploymentPolicyList
s@ContinuousDeploymentPolicyList' {} Int
a -> ContinuousDeploymentPolicyList
s {$sel:maxItems:ContinuousDeploymentPolicyList' :: Int
maxItems = Int
a} :: ContinuousDeploymentPolicyList)

-- | The total number of continuous deployment policies in your Amazon Web
-- Services account, regardless of the @MaxItems@ value.
continuousDeploymentPolicyList_quantity :: Lens.Lens' ContinuousDeploymentPolicyList Prelude.Int
continuousDeploymentPolicyList_quantity :: Lens' ContinuousDeploymentPolicyList Int
continuousDeploymentPolicyList_quantity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousDeploymentPolicyList' {Int
quantity :: Int
$sel:quantity:ContinuousDeploymentPolicyList' :: ContinuousDeploymentPolicyList -> Int
quantity} -> Int
quantity) (\s :: ContinuousDeploymentPolicyList
s@ContinuousDeploymentPolicyList' {} Int
a -> ContinuousDeploymentPolicyList
s {$sel:quantity:ContinuousDeploymentPolicyList' :: Int
quantity = Int
a} :: ContinuousDeploymentPolicyList)

instance Data.FromXML ContinuousDeploymentPolicyList where
  parseXML :: [Node] -> Either String ContinuousDeploymentPolicyList
parseXML [Node]
x =
    Maybe [ContinuousDeploymentPolicySummary]
-> Maybe Text -> Int -> Int -> ContinuousDeploymentPolicyList
ContinuousDeploymentPolicyList'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Items"
                      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 (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
                        ( forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList
                            Text
"ContinuousDeploymentPolicySummary"
                        )
                  )
      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
"NextMarker")
      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")
      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
"Quantity")

instance
  Prelude.Hashable
    ContinuousDeploymentPolicyList
  where
  hashWithSalt :: Int -> ContinuousDeploymentPolicyList -> Int
hashWithSalt
    Int
_salt
    ContinuousDeploymentPolicyList' {Int
Maybe [ContinuousDeploymentPolicySummary]
Maybe Text
quantity :: Int
maxItems :: Int
nextMarker :: Maybe Text
items :: Maybe [ContinuousDeploymentPolicySummary]
$sel:quantity:ContinuousDeploymentPolicyList' :: ContinuousDeploymentPolicyList -> Int
$sel:maxItems:ContinuousDeploymentPolicyList' :: ContinuousDeploymentPolicyList -> Int
$sel:nextMarker:ContinuousDeploymentPolicyList' :: ContinuousDeploymentPolicyList -> Maybe Text
$sel:items:ContinuousDeploymentPolicyList' :: ContinuousDeploymentPolicyList
-> Maybe [ContinuousDeploymentPolicySummary]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ContinuousDeploymentPolicySummary]
items
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextMarker
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
maxItems
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
quantity

instance
  Prelude.NFData
    ContinuousDeploymentPolicyList
  where
  rnf :: ContinuousDeploymentPolicyList -> ()
rnf ContinuousDeploymentPolicyList' {Int
Maybe [ContinuousDeploymentPolicySummary]
Maybe Text
quantity :: Int
maxItems :: Int
nextMarker :: Maybe Text
items :: Maybe [ContinuousDeploymentPolicySummary]
$sel:quantity:ContinuousDeploymentPolicyList' :: ContinuousDeploymentPolicyList -> Int
$sel:maxItems:ContinuousDeploymentPolicyList' :: ContinuousDeploymentPolicyList -> Int
$sel:nextMarker:ContinuousDeploymentPolicyList' :: ContinuousDeploymentPolicyList -> Maybe Text
$sel:items:ContinuousDeploymentPolicyList' :: ContinuousDeploymentPolicyList
-> Maybe [ContinuousDeploymentPolicySummary]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ContinuousDeploymentPolicySummary]
items
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextMarker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
maxItems
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
quantity