{-# 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.FMS.Types.EC2DeleteRouteAction
-- 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.FMS.Types.EC2DeleteRouteAction where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FMS.Types.ActionTarget
import qualified Amazonka.Prelude as Prelude

-- | Information about the DeleteRoute action in Amazon EC2.
--
-- /See:/ 'newEC2DeleteRouteAction' smart constructor.
data EC2DeleteRouteAction = EC2DeleteRouteAction'
  { -- | A description of the DeleteRoute action.
    EC2DeleteRouteAction -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Information about the IPv4 CIDR range for the route. The value you
    -- specify must match the CIDR for the route exactly.
    EC2DeleteRouteAction -> Maybe Text
destinationCidrBlock :: Prelude.Maybe Prelude.Text,
    -- | Information about the IPv6 CIDR range for the route. The value you
    -- specify must match the CIDR for the route exactly.
    EC2DeleteRouteAction -> Maybe Text
destinationIpv6CidrBlock :: Prelude.Maybe Prelude.Text,
    -- | Information about the ID of the prefix list for the route.
    EC2DeleteRouteAction -> Maybe Text
destinationPrefixListId :: Prelude.Maybe Prelude.Text,
    -- | Information about the ID of the route table.
    EC2DeleteRouteAction -> ActionTarget
routeTableId :: ActionTarget
  }
  deriving (EC2DeleteRouteAction -> EC2DeleteRouteAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EC2DeleteRouteAction -> EC2DeleteRouteAction -> Bool
$c/= :: EC2DeleteRouteAction -> EC2DeleteRouteAction -> Bool
== :: EC2DeleteRouteAction -> EC2DeleteRouteAction -> Bool
$c== :: EC2DeleteRouteAction -> EC2DeleteRouteAction -> Bool
Prelude.Eq, ReadPrec [EC2DeleteRouteAction]
ReadPrec EC2DeleteRouteAction
Int -> ReadS EC2DeleteRouteAction
ReadS [EC2DeleteRouteAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EC2DeleteRouteAction]
$creadListPrec :: ReadPrec [EC2DeleteRouteAction]
readPrec :: ReadPrec EC2DeleteRouteAction
$creadPrec :: ReadPrec EC2DeleteRouteAction
readList :: ReadS [EC2DeleteRouteAction]
$creadList :: ReadS [EC2DeleteRouteAction]
readsPrec :: Int -> ReadS EC2DeleteRouteAction
$creadsPrec :: Int -> ReadS EC2DeleteRouteAction
Prelude.Read, Int -> EC2DeleteRouteAction -> ShowS
[EC2DeleteRouteAction] -> ShowS
EC2DeleteRouteAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EC2DeleteRouteAction] -> ShowS
$cshowList :: [EC2DeleteRouteAction] -> ShowS
show :: EC2DeleteRouteAction -> String
$cshow :: EC2DeleteRouteAction -> String
showsPrec :: Int -> EC2DeleteRouteAction -> ShowS
$cshowsPrec :: Int -> EC2DeleteRouteAction -> ShowS
Prelude.Show, forall x. Rep EC2DeleteRouteAction x -> EC2DeleteRouteAction
forall x. EC2DeleteRouteAction -> Rep EC2DeleteRouteAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EC2DeleteRouteAction x -> EC2DeleteRouteAction
$cfrom :: forall x. EC2DeleteRouteAction -> Rep EC2DeleteRouteAction x
Prelude.Generic)

-- |
-- Create a value of 'EC2DeleteRouteAction' 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:
--
-- 'description', 'eC2DeleteRouteAction_description' - A description of the DeleteRoute action.
--
-- 'destinationCidrBlock', 'eC2DeleteRouteAction_destinationCidrBlock' - Information about the IPv4 CIDR range for the route. The value you
-- specify must match the CIDR for the route exactly.
--
-- 'destinationIpv6CidrBlock', 'eC2DeleteRouteAction_destinationIpv6CidrBlock' - Information about the IPv6 CIDR range for the route. The value you
-- specify must match the CIDR for the route exactly.
--
-- 'destinationPrefixListId', 'eC2DeleteRouteAction_destinationPrefixListId' - Information about the ID of the prefix list for the route.
--
-- 'routeTableId', 'eC2DeleteRouteAction_routeTableId' - Information about the ID of the route table.
newEC2DeleteRouteAction ::
  -- | 'routeTableId'
  ActionTarget ->
  EC2DeleteRouteAction
newEC2DeleteRouteAction :: ActionTarget -> EC2DeleteRouteAction
newEC2DeleteRouteAction ActionTarget
pRouteTableId_ =
  EC2DeleteRouteAction'
    { $sel:description:EC2DeleteRouteAction' :: Maybe Text
description =
        forall a. Maybe a
Prelude.Nothing,
      $sel:destinationCidrBlock:EC2DeleteRouteAction' :: Maybe Text
destinationCidrBlock = forall a. Maybe a
Prelude.Nothing,
      $sel:destinationIpv6CidrBlock:EC2DeleteRouteAction' :: Maybe Text
destinationIpv6CidrBlock = forall a. Maybe a
Prelude.Nothing,
      $sel:destinationPrefixListId:EC2DeleteRouteAction' :: Maybe Text
destinationPrefixListId = forall a. Maybe a
Prelude.Nothing,
      $sel:routeTableId:EC2DeleteRouteAction' :: ActionTarget
routeTableId = ActionTarget
pRouteTableId_
    }

-- | A description of the DeleteRoute action.
eC2DeleteRouteAction_description :: Lens.Lens' EC2DeleteRouteAction (Prelude.Maybe Prelude.Text)
eC2DeleteRouteAction_description :: Lens' EC2DeleteRouteAction (Maybe Text)
eC2DeleteRouteAction_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2DeleteRouteAction' {Maybe Text
description :: Maybe Text
$sel:description:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> Maybe Text
description} -> Maybe Text
description) (\s :: EC2DeleteRouteAction
s@EC2DeleteRouteAction' {} Maybe Text
a -> EC2DeleteRouteAction
s {$sel:description:EC2DeleteRouteAction' :: Maybe Text
description = Maybe Text
a} :: EC2DeleteRouteAction)

-- | Information about the IPv4 CIDR range for the route. The value you
-- specify must match the CIDR for the route exactly.
eC2DeleteRouteAction_destinationCidrBlock :: Lens.Lens' EC2DeleteRouteAction (Prelude.Maybe Prelude.Text)
eC2DeleteRouteAction_destinationCidrBlock :: Lens' EC2DeleteRouteAction (Maybe Text)
eC2DeleteRouteAction_destinationCidrBlock = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2DeleteRouteAction' {Maybe Text
destinationCidrBlock :: Maybe Text
$sel:destinationCidrBlock:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> Maybe Text
destinationCidrBlock} -> Maybe Text
destinationCidrBlock) (\s :: EC2DeleteRouteAction
s@EC2DeleteRouteAction' {} Maybe Text
a -> EC2DeleteRouteAction
s {$sel:destinationCidrBlock:EC2DeleteRouteAction' :: Maybe Text
destinationCidrBlock = Maybe Text
a} :: EC2DeleteRouteAction)

-- | Information about the IPv6 CIDR range for the route. The value you
-- specify must match the CIDR for the route exactly.
eC2DeleteRouteAction_destinationIpv6CidrBlock :: Lens.Lens' EC2DeleteRouteAction (Prelude.Maybe Prelude.Text)
eC2DeleteRouteAction_destinationIpv6CidrBlock :: Lens' EC2DeleteRouteAction (Maybe Text)
eC2DeleteRouteAction_destinationIpv6CidrBlock = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2DeleteRouteAction' {Maybe Text
destinationIpv6CidrBlock :: Maybe Text
$sel:destinationIpv6CidrBlock:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> Maybe Text
destinationIpv6CidrBlock} -> Maybe Text
destinationIpv6CidrBlock) (\s :: EC2DeleteRouteAction
s@EC2DeleteRouteAction' {} Maybe Text
a -> EC2DeleteRouteAction
s {$sel:destinationIpv6CidrBlock:EC2DeleteRouteAction' :: Maybe Text
destinationIpv6CidrBlock = Maybe Text
a} :: EC2DeleteRouteAction)

-- | Information about the ID of the prefix list for the route.
eC2DeleteRouteAction_destinationPrefixListId :: Lens.Lens' EC2DeleteRouteAction (Prelude.Maybe Prelude.Text)
eC2DeleteRouteAction_destinationPrefixListId :: Lens' EC2DeleteRouteAction (Maybe Text)
eC2DeleteRouteAction_destinationPrefixListId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2DeleteRouteAction' {Maybe Text
destinationPrefixListId :: Maybe Text
$sel:destinationPrefixListId:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> Maybe Text
destinationPrefixListId} -> Maybe Text
destinationPrefixListId) (\s :: EC2DeleteRouteAction
s@EC2DeleteRouteAction' {} Maybe Text
a -> EC2DeleteRouteAction
s {$sel:destinationPrefixListId:EC2DeleteRouteAction' :: Maybe Text
destinationPrefixListId = Maybe Text
a} :: EC2DeleteRouteAction)

-- | Information about the ID of the route table.
eC2DeleteRouteAction_routeTableId :: Lens.Lens' EC2DeleteRouteAction ActionTarget
eC2DeleteRouteAction_routeTableId :: Lens' EC2DeleteRouteAction ActionTarget
eC2DeleteRouteAction_routeTableId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2DeleteRouteAction' {ActionTarget
routeTableId :: ActionTarget
$sel:routeTableId:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> ActionTarget
routeTableId} -> ActionTarget
routeTableId) (\s :: EC2DeleteRouteAction
s@EC2DeleteRouteAction' {} ActionTarget
a -> EC2DeleteRouteAction
s {$sel:routeTableId:EC2DeleteRouteAction' :: ActionTarget
routeTableId = ActionTarget
a} :: EC2DeleteRouteAction)

instance Data.FromJSON EC2DeleteRouteAction where
  parseJSON :: Value -> Parser EC2DeleteRouteAction
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EC2DeleteRouteAction"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ActionTarget
-> EC2DeleteRouteAction
EC2DeleteRouteAction'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DestinationCidrBlock")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DestinationIpv6CidrBlock")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DestinationPrefixListId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RouteTableId")
      )

instance Prelude.Hashable EC2DeleteRouteAction where
  hashWithSalt :: Int -> EC2DeleteRouteAction -> Int
hashWithSalt Int
_salt EC2DeleteRouteAction' {Maybe Text
ActionTarget
routeTableId :: ActionTarget
destinationPrefixListId :: Maybe Text
destinationIpv6CidrBlock :: Maybe Text
destinationCidrBlock :: Maybe Text
description :: Maybe Text
$sel:routeTableId:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> ActionTarget
$sel:destinationPrefixListId:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> Maybe Text
$sel:destinationIpv6CidrBlock:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> Maybe Text
$sel:destinationCidrBlock:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> Maybe Text
$sel:description:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destinationCidrBlock
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destinationIpv6CidrBlock
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destinationPrefixListId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ActionTarget
routeTableId

instance Prelude.NFData EC2DeleteRouteAction where
  rnf :: EC2DeleteRouteAction -> ()
rnf EC2DeleteRouteAction' {Maybe Text
ActionTarget
routeTableId :: ActionTarget
destinationPrefixListId :: Maybe Text
destinationIpv6CidrBlock :: Maybe Text
destinationCidrBlock :: Maybe Text
description :: Maybe Text
$sel:routeTableId:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> ActionTarget
$sel:destinationPrefixListId:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> Maybe Text
$sel:destinationIpv6CidrBlock:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> Maybe Text
$sel:destinationCidrBlock:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> Maybe Text
$sel:description:EC2DeleteRouteAction' :: EC2DeleteRouteAction -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
destinationCidrBlock
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
destinationIpv6CidrBlock
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
destinationPrefixListId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ActionTarget
routeTableId