{-# 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.EC2.Types.RemovePrefixListEntry
-- 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.EC2.Types.RemovePrefixListEntry where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | An entry for a prefix list.
--
-- /See:/ 'newRemovePrefixListEntry' smart constructor.
data RemovePrefixListEntry = RemovePrefixListEntry'
  { -- | The CIDR block.
    RemovePrefixListEntry -> Text
cidr :: Prelude.Text
  }
  deriving (RemovePrefixListEntry -> RemovePrefixListEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemovePrefixListEntry -> RemovePrefixListEntry -> Bool
$c/= :: RemovePrefixListEntry -> RemovePrefixListEntry -> Bool
== :: RemovePrefixListEntry -> RemovePrefixListEntry -> Bool
$c== :: RemovePrefixListEntry -> RemovePrefixListEntry -> Bool
Prelude.Eq, ReadPrec [RemovePrefixListEntry]
ReadPrec RemovePrefixListEntry
Int -> ReadS RemovePrefixListEntry
ReadS [RemovePrefixListEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemovePrefixListEntry]
$creadListPrec :: ReadPrec [RemovePrefixListEntry]
readPrec :: ReadPrec RemovePrefixListEntry
$creadPrec :: ReadPrec RemovePrefixListEntry
readList :: ReadS [RemovePrefixListEntry]
$creadList :: ReadS [RemovePrefixListEntry]
readsPrec :: Int -> ReadS RemovePrefixListEntry
$creadsPrec :: Int -> ReadS RemovePrefixListEntry
Prelude.Read, Int -> RemovePrefixListEntry -> ShowS
[RemovePrefixListEntry] -> ShowS
RemovePrefixListEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemovePrefixListEntry] -> ShowS
$cshowList :: [RemovePrefixListEntry] -> ShowS
show :: RemovePrefixListEntry -> String
$cshow :: RemovePrefixListEntry -> String
showsPrec :: Int -> RemovePrefixListEntry -> ShowS
$cshowsPrec :: Int -> RemovePrefixListEntry -> ShowS
Prelude.Show, forall x. Rep RemovePrefixListEntry x -> RemovePrefixListEntry
forall x. RemovePrefixListEntry -> Rep RemovePrefixListEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RemovePrefixListEntry x -> RemovePrefixListEntry
$cfrom :: forall x. RemovePrefixListEntry -> Rep RemovePrefixListEntry x
Prelude.Generic)

-- |
-- Create a value of 'RemovePrefixListEntry' 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:
--
-- 'cidr', 'removePrefixListEntry_cidr' - The CIDR block.
newRemovePrefixListEntry ::
  -- | 'cidr'
  Prelude.Text ->
  RemovePrefixListEntry
newRemovePrefixListEntry :: Text -> RemovePrefixListEntry
newRemovePrefixListEntry Text
pCidr_ =
  RemovePrefixListEntry' {$sel:cidr:RemovePrefixListEntry' :: Text
cidr = Text
pCidr_}

-- | The CIDR block.
removePrefixListEntry_cidr :: Lens.Lens' RemovePrefixListEntry Prelude.Text
removePrefixListEntry_cidr :: Lens' RemovePrefixListEntry Text
removePrefixListEntry_cidr = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemovePrefixListEntry' {Text
cidr :: Text
$sel:cidr:RemovePrefixListEntry' :: RemovePrefixListEntry -> Text
cidr} -> Text
cidr) (\s :: RemovePrefixListEntry
s@RemovePrefixListEntry' {} Text
a -> RemovePrefixListEntry
s {$sel:cidr:RemovePrefixListEntry' :: Text
cidr = Text
a} :: RemovePrefixListEntry)

instance Prelude.Hashable RemovePrefixListEntry where
  hashWithSalt :: Int -> RemovePrefixListEntry -> Int
hashWithSalt Int
_salt RemovePrefixListEntry' {Text
cidr :: Text
$sel:cidr:RemovePrefixListEntry' :: RemovePrefixListEntry -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
cidr

instance Prelude.NFData RemovePrefixListEntry where
  rnf :: RemovePrefixListEntry -> ()
rnf RemovePrefixListEntry' {Text
cidr :: Text
$sel:cidr:RemovePrefixListEntry' :: RemovePrefixListEntry -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
cidr

instance Data.ToQuery RemovePrefixListEntry where
  toQuery :: RemovePrefixListEntry -> QueryString
toQuery RemovePrefixListEntry' {Text
cidr :: Text
$sel:cidr:RemovePrefixListEntry' :: RemovePrefixListEntry -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Cidr" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
cidr]