{-# 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.EC2.ModifyManagedPrefixList
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies the specified managed prefix list.
--
-- Adding or removing entries in a prefix list creates a new version of the
-- prefix list. Changing the name of the prefix list does not affect the
-- version.
--
-- If you specify a current version number that does not match the true
-- current version number, the request fails.
module Amazonka.EC2.ModifyManagedPrefixList
  ( -- * Creating a Request
    ModifyManagedPrefixList (..),
    newModifyManagedPrefixList,

    -- * Request Lenses
    modifyManagedPrefixList_addEntries,
    modifyManagedPrefixList_currentVersion,
    modifyManagedPrefixList_dryRun,
    modifyManagedPrefixList_maxEntries,
    modifyManagedPrefixList_prefixListName,
    modifyManagedPrefixList_removeEntries,
    modifyManagedPrefixList_prefixListId,

    -- * Destructuring the Response
    ModifyManagedPrefixListResponse (..),
    newModifyManagedPrefixListResponse,

    -- * Response Lenses
    modifyManagedPrefixListResponse_prefixList,
    modifyManagedPrefixListResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newModifyManagedPrefixList' smart constructor.
data ModifyManagedPrefixList = ModifyManagedPrefixList'
  { -- | One or more entries to add to the prefix list.
    ModifyManagedPrefixList -> Maybe [AddPrefixListEntry]
addEntries :: Prelude.Maybe [AddPrefixListEntry],
    -- | The current version of the prefix list.
    ModifyManagedPrefixList -> Maybe Integer
currentVersion :: Prelude.Maybe Prelude.Integer,
    -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    ModifyManagedPrefixList -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The maximum number of entries for the prefix list. You cannot modify the
    -- entries of a prefix list and modify the size of a prefix list at the
    -- same time.
    --
    -- If any of the resources that reference the prefix list cannot support
    -- the new maximum size, the modify operation fails. Check the state
    -- message for the IDs of the first ten resources that do not support the
    -- new maximum size.
    ModifyManagedPrefixList -> Maybe Int
maxEntries :: Prelude.Maybe Prelude.Int,
    -- | A name for the prefix list.
    ModifyManagedPrefixList -> Maybe Text
prefixListName :: Prelude.Maybe Prelude.Text,
    -- | One or more entries to remove from the prefix list.
    ModifyManagedPrefixList -> Maybe [RemovePrefixListEntry]
removeEntries :: Prelude.Maybe [RemovePrefixListEntry],
    -- | The ID of the prefix list.
    ModifyManagedPrefixList -> Text
prefixListId :: Prelude.Text
  }
  deriving (ModifyManagedPrefixList -> ModifyManagedPrefixList -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyManagedPrefixList -> ModifyManagedPrefixList -> Bool
$c/= :: ModifyManagedPrefixList -> ModifyManagedPrefixList -> Bool
== :: ModifyManagedPrefixList -> ModifyManagedPrefixList -> Bool
$c== :: ModifyManagedPrefixList -> ModifyManagedPrefixList -> Bool
Prelude.Eq, ReadPrec [ModifyManagedPrefixList]
ReadPrec ModifyManagedPrefixList
Int -> ReadS ModifyManagedPrefixList
ReadS [ModifyManagedPrefixList]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyManagedPrefixList]
$creadListPrec :: ReadPrec [ModifyManagedPrefixList]
readPrec :: ReadPrec ModifyManagedPrefixList
$creadPrec :: ReadPrec ModifyManagedPrefixList
readList :: ReadS [ModifyManagedPrefixList]
$creadList :: ReadS [ModifyManagedPrefixList]
readsPrec :: Int -> ReadS ModifyManagedPrefixList
$creadsPrec :: Int -> ReadS ModifyManagedPrefixList
Prelude.Read, Int -> ModifyManagedPrefixList -> ShowS
[ModifyManagedPrefixList] -> ShowS
ModifyManagedPrefixList -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyManagedPrefixList] -> ShowS
$cshowList :: [ModifyManagedPrefixList] -> ShowS
show :: ModifyManagedPrefixList -> String
$cshow :: ModifyManagedPrefixList -> String
showsPrec :: Int -> ModifyManagedPrefixList -> ShowS
$cshowsPrec :: Int -> ModifyManagedPrefixList -> ShowS
Prelude.Show, forall x. Rep ModifyManagedPrefixList x -> ModifyManagedPrefixList
forall x. ModifyManagedPrefixList -> Rep ModifyManagedPrefixList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyManagedPrefixList x -> ModifyManagedPrefixList
$cfrom :: forall x. ModifyManagedPrefixList -> Rep ModifyManagedPrefixList x
Prelude.Generic)

-- |
-- Create a value of 'ModifyManagedPrefixList' 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:
--
-- 'addEntries', 'modifyManagedPrefixList_addEntries' - One or more entries to add to the prefix list.
--
-- 'currentVersion', 'modifyManagedPrefixList_currentVersion' - The current version of the prefix list.
--
-- 'dryRun', 'modifyManagedPrefixList_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'maxEntries', 'modifyManagedPrefixList_maxEntries' - The maximum number of entries for the prefix list. You cannot modify the
-- entries of a prefix list and modify the size of a prefix list at the
-- same time.
--
-- If any of the resources that reference the prefix list cannot support
-- the new maximum size, the modify operation fails. Check the state
-- message for the IDs of the first ten resources that do not support the
-- new maximum size.
--
-- 'prefixListName', 'modifyManagedPrefixList_prefixListName' - A name for the prefix list.
--
-- 'removeEntries', 'modifyManagedPrefixList_removeEntries' - One or more entries to remove from the prefix list.
--
-- 'prefixListId', 'modifyManagedPrefixList_prefixListId' - The ID of the prefix list.
newModifyManagedPrefixList ::
  -- | 'prefixListId'
  Prelude.Text ->
  ModifyManagedPrefixList
newModifyManagedPrefixList :: Text -> ModifyManagedPrefixList
newModifyManagedPrefixList Text
pPrefixListId_ =
  ModifyManagedPrefixList'
    { $sel:addEntries:ModifyManagedPrefixList' :: Maybe [AddPrefixListEntry]
addEntries =
        forall a. Maybe a
Prelude.Nothing,
      $sel:currentVersion:ModifyManagedPrefixList' :: Maybe Integer
currentVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:ModifyManagedPrefixList' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:maxEntries:ModifyManagedPrefixList' :: Maybe Int
maxEntries = forall a. Maybe a
Prelude.Nothing,
      $sel:prefixListName:ModifyManagedPrefixList' :: Maybe Text
prefixListName = forall a. Maybe a
Prelude.Nothing,
      $sel:removeEntries:ModifyManagedPrefixList' :: Maybe [RemovePrefixListEntry]
removeEntries = forall a. Maybe a
Prelude.Nothing,
      $sel:prefixListId:ModifyManagedPrefixList' :: Text
prefixListId = Text
pPrefixListId_
    }

-- | One or more entries to add to the prefix list.
modifyManagedPrefixList_addEntries :: Lens.Lens' ModifyManagedPrefixList (Prelude.Maybe [AddPrefixListEntry])
modifyManagedPrefixList_addEntries :: Lens' ModifyManagedPrefixList (Maybe [AddPrefixListEntry])
modifyManagedPrefixList_addEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyManagedPrefixList' {Maybe [AddPrefixListEntry]
addEntries :: Maybe [AddPrefixListEntry]
$sel:addEntries:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe [AddPrefixListEntry]
addEntries} -> Maybe [AddPrefixListEntry]
addEntries) (\s :: ModifyManagedPrefixList
s@ModifyManagedPrefixList' {} Maybe [AddPrefixListEntry]
a -> ModifyManagedPrefixList
s {$sel:addEntries:ModifyManagedPrefixList' :: Maybe [AddPrefixListEntry]
addEntries = Maybe [AddPrefixListEntry]
a} :: ModifyManagedPrefixList) 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

-- | The current version of the prefix list.
modifyManagedPrefixList_currentVersion :: Lens.Lens' ModifyManagedPrefixList (Prelude.Maybe Prelude.Integer)
modifyManagedPrefixList_currentVersion :: Lens' ModifyManagedPrefixList (Maybe Integer)
modifyManagedPrefixList_currentVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyManagedPrefixList' {Maybe Integer
currentVersion :: Maybe Integer
$sel:currentVersion:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Integer
currentVersion} -> Maybe Integer
currentVersion) (\s :: ModifyManagedPrefixList
s@ModifyManagedPrefixList' {} Maybe Integer
a -> ModifyManagedPrefixList
s {$sel:currentVersion:ModifyManagedPrefixList' :: Maybe Integer
currentVersion = Maybe Integer
a} :: ModifyManagedPrefixList)

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
modifyManagedPrefixList_dryRun :: Lens.Lens' ModifyManagedPrefixList (Prelude.Maybe Prelude.Bool)
modifyManagedPrefixList_dryRun :: Lens' ModifyManagedPrefixList (Maybe Bool)
modifyManagedPrefixList_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyManagedPrefixList' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: ModifyManagedPrefixList
s@ModifyManagedPrefixList' {} Maybe Bool
a -> ModifyManagedPrefixList
s {$sel:dryRun:ModifyManagedPrefixList' :: Maybe Bool
dryRun = Maybe Bool
a} :: ModifyManagedPrefixList)

-- | The maximum number of entries for the prefix list. You cannot modify the
-- entries of a prefix list and modify the size of a prefix list at the
-- same time.
--
-- If any of the resources that reference the prefix list cannot support
-- the new maximum size, the modify operation fails. Check the state
-- message for the IDs of the first ten resources that do not support the
-- new maximum size.
modifyManagedPrefixList_maxEntries :: Lens.Lens' ModifyManagedPrefixList (Prelude.Maybe Prelude.Int)
modifyManagedPrefixList_maxEntries :: Lens' ModifyManagedPrefixList (Maybe Int)
modifyManagedPrefixList_maxEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyManagedPrefixList' {Maybe Int
maxEntries :: Maybe Int
$sel:maxEntries:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Int
maxEntries} -> Maybe Int
maxEntries) (\s :: ModifyManagedPrefixList
s@ModifyManagedPrefixList' {} Maybe Int
a -> ModifyManagedPrefixList
s {$sel:maxEntries:ModifyManagedPrefixList' :: Maybe Int
maxEntries = Maybe Int
a} :: ModifyManagedPrefixList)

-- | A name for the prefix list.
modifyManagedPrefixList_prefixListName :: Lens.Lens' ModifyManagedPrefixList (Prelude.Maybe Prelude.Text)
modifyManagedPrefixList_prefixListName :: Lens' ModifyManagedPrefixList (Maybe Text)
modifyManagedPrefixList_prefixListName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyManagedPrefixList' {Maybe Text
prefixListName :: Maybe Text
$sel:prefixListName:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Text
prefixListName} -> Maybe Text
prefixListName) (\s :: ModifyManagedPrefixList
s@ModifyManagedPrefixList' {} Maybe Text
a -> ModifyManagedPrefixList
s {$sel:prefixListName:ModifyManagedPrefixList' :: Maybe Text
prefixListName = Maybe Text
a} :: ModifyManagedPrefixList)

-- | One or more entries to remove from the prefix list.
modifyManagedPrefixList_removeEntries :: Lens.Lens' ModifyManagedPrefixList (Prelude.Maybe [RemovePrefixListEntry])
modifyManagedPrefixList_removeEntries :: Lens' ModifyManagedPrefixList (Maybe [RemovePrefixListEntry])
modifyManagedPrefixList_removeEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyManagedPrefixList' {Maybe [RemovePrefixListEntry]
removeEntries :: Maybe [RemovePrefixListEntry]
$sel:removeEntries:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe [RemovePrefixListEntry]
removeEntries} -> Maybe [RemovePrefixListEntry]
removeEntries) (\s :: ModifyManagedPrefixList
s@ModifyManagedPrefixList' {} Maybe [RemovePrefixListEntry]
a -> ModifyManagedPrefixList
s {$sel:removeEntries:ModifyManagedPrefixList' :: Maybe [RemovePrefixListEntry]
removeEntries = Maybe [RemovePrefixListEntry]
a} :: ModifyManagedPrefixList) 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

-- | The ID of the prefix list.
modifyManagedPrefixList_prefixListId :: Lens.Lens' ModifyManagedPrefixList Prelude.Text
modifyManagedPrefixList_prefixListId :: Lens' ModifyManagedPrefixList Text
modifyManagedPrefixList_prefixListId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyManagedPrefixList' {Text
prefixListId :: Text
$sel:prefixListId:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Text
prefixListId} -> Text
prefixListId) (\s :: ModifyManagedPrefixList
s@ModifyManagedPrefixList' {} Text
a -> ModifyManagedPrefixList
s {$sel:prefixListId:ModifyManagedPrefixList' :: Text
prefixListId = Text
a} :: ModifyManagedPrefixList)

instance Core.AWSRequest ModifyManagedPrefixList where
  type
    AWSResponse ModifyManagedPrefixList =
      ModifyManagedPrefixListResponse
  request :: (Service -> Service)
-> ModifyManagedPrefixList -> Request ModifyManagedPrefixList
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ModifyManagedPrefixList
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyManagedPrefixList)))
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 ->
          Maybe ManagedPrefixList -> Int -> ModifyManagedPrefixListResponse
ModifyManagedPrefixListResponse'
            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
"prefixList")
            forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable ModifyManagedPrefixList where
  hashWithSalt :: Int -> ModifyManagedPrefixList -> Int
hashWithSalt Int
_salt ModifyManagedPrefixList' {Maybe Bool
Maybe Int
Maybe Integer
Maybe [AddPrefixListEntry]
Maybe [RemovePrefixListEntry]
Maybe Text
Text
prefixListId :: Text
removeEntries :: Maybe [RemovePrefixListEntry]
prefixListName :: Maybe Text
maxEntries :: Maybe Int
dryRun :: Maybe Bool
currentVersion :: Maybe Integer
addEntries :: Maybe [AddPrefixListEntry]
$sel:prefixListId:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Text
$sel:removeEntries:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe [RemovePrefixListEntry]
$sel:prefixListName:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Text
$sel:maxEntries:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Int
$sel:dryRun:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Bool
$sel:currentVersion:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Integer
$sel:addEntries:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe [AddPrefixListEntry]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AddPrefixListEntry]
addEntries
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
currentVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxEntries
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
prefixListName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RemovePrefixListEntry]
removeEntries
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
prefixListId

instance Prelude.NFData ModifyManagedPrefixList where
  rnf :: ModifyManagedPrefixList -> ()
rnf ModifyManagedPrefixList' {Maybe Bool
Maybe Int
Maybe Integer
Maybe [AddPrefixListEntry]
Maybe [RemovePrefixListEntry]
Maybe Text
Text
prefixListId :: Text
removeEntries :: Maybe [RemovePrefixListEntry]
prefixListName :: Maybe Text
maxEntries :: Maybe Int
dryRun :: Maybe Bool
currentVersion :: Maybe Integer
addEntries :: Maybe [AddPrefixListEntry]
$sel:prefixListId:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Text
$sel:removeEntries:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe [RemovePrefixListEntry]
$sel:prefixListName:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Text
$sel:maxEntries:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Int
$sel:dryRun:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Bool
$sel:currentVersion:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Integer
$sel:addEntries:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe [AddPrefixListEntry]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AddPrefixListEntry]
addEntries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
currentVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxEntries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
prefixListName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RemovePrefixListEntry]
removeEntries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
prefixListId

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

instance Data.ToPath ModifyManagedPrefixList where
  toPath :: ModifyManagedPrefixList -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery ModifyManagedPrefixList where
  toQuery :: ModifyManagedPrefixList -> QueryString
toQuery ModifyManagedPrefixList' {Maybe Bool
Maybe Int
Maybe Integer
Maybe [AddPrefixListEntry]
Maybe [RemovePrefixListEntry]
Maybe Text
Text
prefixListId :: Text
removeEntries :: Maybe [RemovePrefixListEntry]
prefixListName :: Maybe Text
maxEntries :: Maybe Int
dryRun :: Maybe Bool
currentVersion :: Maybe Integer
addEntries :: Maybe [AddPrefixListEntry]
$sel:prefixListId:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Text
$sel:removeEntries:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe [RemovePrefixListEntry]
$sel:prefixListName:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Text
$sel:maxEntries:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Int
$sel:dryRun:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Bool
$sel:currentVersion:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe Integer
$sel:addEntries:ModifyManagedPrefixList' :: ModifyManagedPrefixList -> Maybe [AddPrefixListEntry]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ModifyManagedPrefixList" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"AddEntry" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AddPrefixListEntry]
addEntries),
        ByteString
"CurrentVersion" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Integer
currentVersion,
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"MaxEntries" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxEntries,
        ByteString
"PrefixListName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
prefixListName,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"RemoveEntry"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RemovePrefixListEntry]
removeEntries
          ),
        ByteString
"PrefixListId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
prefixListId
      ]

-- | /See:/ 'newModifyManagedPrefixListResponse' smart constructor.
data ModifyManagedPrefixListResponse = ModifyManagedPrefixListResponse'
  { -- | Information about the prefix list.
    ModifyManagedPrefixListResponse -> Maybe ManagedPrefixList
prefixList :: Prelude.Maybe ManagedPrefixList,
    -- | The response's http status code.
    ModifyManagedPrefixListResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ModifyManagedPrefixListResponse
-> ModifyManagedPrefixListResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyManagedPrefixListResponse
-> ModifyManagedPrefixListResponse -> Bool
$c/= :: ModifyManagedPrefixListResponse
-> ModifyManagedPrefixListResponse -> Bool
== :: ModifyManagedPrefixListResponse
-> ModifyManagedPrefixListResponse -> Bool
$c== :: ModifyManagedPrefixListResponse
-> ModifyManagedPrefixListResponse -> Bool
Prelude.Eq, ReadPrec [ModifyManagedPrefixListResponse]
ReadPrec ModifyManagedPrefixListResponse
Int -> ReadS ModifyManagedPrefixListResponse
ReadS [ModifyManagedPrefixListResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyManagedPrefixListResponse]
$creadListPrec :: ReadPrec [ModifyManagedPrefixListResponse]
readPrec :: ReadPrec ModifyManagedPrefixListResponse
$creadPrec :: ReadPrec ModifyManagedPrefixListResponse
readList :: ReadS [ModifyManagedPrefixListResponse]
$creadList :: ReadS [ModifyManagedPrefixListResponse]
readsPrec :: Int -> ReadS ModifyManagedPrefixListResponse
$creadsPrec :: Int -> ReadS ModifyManagedPrefixListResponse
Prelude.Read, Int -> ModifyManagedPrefixListResponse -> ShowS
[ModifyManagedPrefixListResponse] -> ShowS
ModifyManagedPrefixListResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyManagedPrefixListResponse] -> ShowS
$cshowList :: [ModifyManagedPrefixListResponse] -> ShowS
show :: ModifyManagedPrefixListResponse -> String
$cshow :: ModifyManagedPrefixListResponse -> String
showsPrec :: Int -> ModifyManagedPrefixListResponse -> ShowS
$cshowsPrec :: Int -> ModifyManagedPrefixListResponse -> ShowS
Prelude.Show, forall x.
Rep ModifyManagedPrefixListResponse x
-> ModifyManagedPrefixListResponse
forall x.
ModifyManagedPrefixListResponse
-> Rep ModifyManagedPrefixListResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyManagedPrefixListResponse x
-> ModifyManagedPrefixListResponse
$cfrom :: forall x.
ModifyManagedPrefixListResponse
-> Rep ModifyManagedPrefixListResponse x
Prelude.Generic)

-- |
-- Create a value of 'ModifyManagedPrefixListResponse' 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:
--
-- 'prefixList', 'modifyManagedPrefixListResponse_prefixList' - Information about the prefix list.
--
-- 'httpStatus', 'modifyManagedPrefixListResponse_httpStatus' - The response's http status code.
newModifyManagedPrefixListResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyManagedPrefixListResponse
newModifyManagedPrefixListResponse :: Int -> ModifyManagedPrefixListResponse
newModifyManagedPrefixListResponse Int
pHttpStatus_ =
  ModifyManagedPrefixListResponse'
    { $sel:prefixList:ModifyManagedPrefixListResponse' :: Maybe ManagedPrefixList
prefixList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ModifyManagedPrefixListResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the prefix list.
modifyManagedPrefixListResponse_prefixList :: Lens.Lens' ModifyManagedPrefixListResponse (Prelude.Maybe ManagedPrefixList)
modifyManagedPrefixListResponse_prefixList :: Lens' ModifyManagedPrefixListResponse (Maybe ManagedPrefixList)
modifyManagedPrefixListResponse_prefixList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyManagedPrefixListResponse' {Maybe ManagedPrefixList
prefixList :: Maybe ManagedPrefixList
$sel:prefixList:ModifyManagedPrefixListResponse' :: ModifyManagedPrefixListResponse -> Maybe ManagedPrefixList
prefixList} -> Maybe ManagedPrefixList
prefixList) (\s :: ModifyManagedPrefixListResponse
s@ModifyManagedPrefixListResponse' {} Maybe ManagedPrefixList
a -> ModifyManagedPrefixListResponse
s {$sel:prefixList:ModifyManagedPrefixListResponse' :: Maybe ManagedPrefixList
prefixList = Maybe ManagedPrefixList
a} :: ModifyManagedPrefixListResponse)

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

instance
  Prelude.NFData
    ModifyManagedPrefixListResponse
  where
  rnf :: ModifyManagedPrefixListResponse -> ()
rnf ModifyManagedPrefixListResponse' {Int
Maybe ManagedPrefixList
httpStatus :: Int
prefixList :: Maybe ManagedPrefixList
$sel:httpStatus:ModifyManagedPrefixListResponse' :: ModifyManagedPrefixListResponse -> Int
$sel:prefixList:ModifyManagedPrefixListResponse' :: ModifyManagedPrefixListResponse -> Maybe ManagedPrefixList
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ManagedPrefixList
prefixList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus