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

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

-- | Information about the DeleteRoute action in Amazon EC2.
--
-- /See:/ 'newEC2DeleteRouteAction' smart constructor.
data EC2DeleteRouteAction = EC2DeleteRouteAction'
  { -- | 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,
    -- | 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 ID of the route table.
    EC2DeleteRouteAction -> ActionTarget
routeTableId :: ActionTarget
  }
  deriving (EC2DeleteRouteAction -> EC2DeleteRouteAction -> Bool
(EC2DeleteRouteAction -> EC2DeleteRouteAction -> Bool)
-> (EC2DeleteRouteAction -> EC2DeleteRouteAction -> Bool)
-> Eq EC2DeleteRouteAction
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]
(Int -> ReadS EC2DeleteRouteAction)
-> ReadS [EC2DeleteRouteAction]
-> ReadPrec EC2DeleteRouteAction
-> ReadPrec [EC2DeleteRouteAction]
-> Read 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
(Int -> EC2DeleteRouteAction -> ShowS)
-> (EC2DeleteRouteAction -> String)
-> ([EC2DeleteRouteAction] -> ShowS)
-> Show EC2DeleteRouteAction
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. EC2DeleteRouteAction -> Rep EC2DeleteRouteAction x)
-> (forall x. Rep EC2DeleteRouteAction x -> EC2DeleteRouteAction)
-> Generic EC2DeleteRouteAction
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:
--
-- '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.
--
-- '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.
--
-- 'routeTableId', 'eC2DeleteRouteAction_routeTableId' - Information about the ID of the route table.
newEC2DeleteRouteAction ::
  -- | 'routeTableId'
  ActionTarget ->
  EC2DeleteRouteAction
newEC2DeleteRouteAction :: ActionTarget -> EC2DeleteRouteAction
newEC2DeleteRouteAction ActionTarget
pRouteTableId_ =
  EC2DeleteRouteAction' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ActionTarget
-> EC2DeleteRouteAction
EC2DeleteRouteAction'
    { $sel:destinationIpv6CidrBlock:EC2DeleteRouteAction' :: Maybe Text
destinationIpv6CidrBlock =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationPrefixListId:EC2DeleteRouteAction' :: Maybe Text
destinationPrefixListId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:EC2DeleteRouteAction' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationCidrBlock:EC2DeleteRouteAction' :: Maybe Text
destinationCidrBlock = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:routeTableId:EC2DeleteRouteAction' :: ActionTarget
routeTableId = ActionTarget
pRouteTableId_
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> EC2DeleteRouteAction -> f EC2DeleteRouteAction
eC2DeleteRouteAction_destinationIpv6CidrBlock = (EC2DeleteRouteAction -> Maybe Text)
-> (EC2DeleteRouteAction -> Maybe Text -> EC2DeleteRouteAction)
-> Lens
     EC2DeleteRouteAction EC2DeleteRouteAction (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> EC2DeleteRouteAction -> f EC2DeleteRouteAction
eC2DeleteRouteAction_destinationPrefixListId = (EC2DeleteRouteAction -> Maybe Text)
-> (EC2DeleteRouteAction -> Maybe Text -> EC2DeleteRouteAction)
-> Lens
     EC2DeleteRouteAction EC2DeleteRouteAction (Maybe Text) (Maybe Text)
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)

-- | A description of the DeleteRoute action.
eC2DeleteRouteAction_description :: Lens.Lens' EC2DeleteRouteAction (Prelude.Maybe Prelude.Text)
eC2DeleteRouteAction_description :: (Maybe Text -> f (Maybe Text))
-> EC2DeleteRouteAction -> f EC2DeleteRouteAction
eC2DeleteRouteAction_description = (EC2DeleteRouteAction -> Maybe Text)
-> (EC2DeleteRouteAction -> Maybe Text -> EC2DeleteRouteAction)
-> Lens
     EC2DeleteRouteAction EC2DeleteRouteAction (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> EC2DeleteRouteAction -> f EC2DeleteRouteAction
eC2DeleteRouteAction_destinationCidrBlock = (EC2DeleteRouteAction -> Maybe Text)
-> (EC2DeleteRouteAction -> Maybe Text -> EC2DeleteRouteAction)
-> Lens
     EC2DeleteRouteAction EC2DeleteRouteAction (Maybe Text) (Maybe Text)
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 ID of the route table.
eC2DeleteRouteAction_routeTableId :: Lens.Lens' EC2DeleteRouteAction ActionTarget
eC2DeleteRouteAction_routeTableId :: (ActionTarget -> f ActionTarget)
-> EC2DeleteRouteAction -> f EC2DeleteRouteAction
eC2DeleteRouteAction_routeTableId = (EC2DeleteRouteAction -> ActionTarget)
-> (EC2DeleteRouteAction -> ActionTarget -> EC2DeleteRouteAction)
-> Lens
     EC2DeleteRouteAction EC2DeleteRouteAction ActionTarget ActionTarget
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 Core.FromJSON EC2DeleteRouteAction where
  parseJSON :: Value -> Parser EC2DeleteRouteAction
parseJSON =
    String
-> (Object -> Parser EC2DeleteRouteAction)
-> Value
-> Parser EC2DeleteRouteAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EC2DeleteRouteAction"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ActionTarget
-> EC2DeleteRouteAction
EC2DeleteRouteAction'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> ActionTarget
 -> EC2DeleteRouteAction)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ActionTarget
      -> EC2DeleteRouteAction)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DestinationIpv6CidrBlock")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ActionTarget
   -> EC2DeleteRouteAction)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> ActionTarget -> EC2DeleteRouteAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DestinationPrefixListId")
            Parser
  (Maybe Text -> Maybe Text -> ActionTarget -> EC2DeleteRouteAction)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ActionTarget -> EC2DeleteRouteAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
            Parser (Maybe Text -> ActionTarget -> EC2DeleteRouteAction)
-> Parser (Maybe Text)
-> Parser (ActionTarget -> EC2DeleteRouteAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DestinationCidrBlock")
            Parser (ActionTarget -> EC2DeleteRouteAction)
-> Parser ActionTarget -> Parser EC2DeleteRouteAction
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ActionTarget
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RouteTableId")
      )

instance Prelude.Hashable EC2DeleteRouteAction

instance Prelude.NFData EC2DeleteRouteAction