{-# 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.EC2CopyRouteTableAction
-- 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.EC2CopyRouteTableAction where

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

-- | An action that copies the EC2 route table for use in remediation.
--
-- /See:/ 'newEC2CopyRouteTableAction' smart constructor.
data EC2CopyRouteTableAction = EC2CopyRouteTableAction'
  { -- | A description of the copied EC2 route table that is associated with the
    -- remediation action.
    EC2CopyRouteTableAction -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The VPC ID of the copied EC2 route table that is associated with the
    -- remediation action.
    EC2CopyRouteTableAction -> ActionTarget
vpcId :: ActionTarget,
    -- | The ID of the copied EC2 route table that is associated with the
    -- remediation action.
    EC2CopyRouteTableAction -> ActionTarget
routeTableId :: ActionTarget
  }
  deriving (EC2CopyRouteTableAction -> EC2CopyRouteTableAction -> Bool
(EC2CopyRouteTableAction -> EC2CopyRouteTableAction -> Bool)
-> (EC2CopyRouteTableAction -> EC2CopyRouteTableAction -> Bool)
-> Eq EC2CopyRouteTableAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EC2CopyRouteTableAction -> EC2CopyRouteTableAction -> Bool
$c/= :: EC2CopyRouteTableAction -> EC2CopyRouteTableAction -> Bool
== :: EC2CopyRouteTableAction -> EC2CopyRouteTableAction -> Bool
$c== :: EC2CopyRouteTableAction -> EC2CopyRouteTableAction -> Bool
Prelude.Eq, ReadPrec [EC2CopyRouteTableAction]
ReadPrec EC2CopyRouteTableAction
Int -> ReadS EC2CopyRouteTableAction
ReadS [EC2CopyRouteTableAction]
(Int -> ReadS EC2CopyRouteTableAction)
-> ReadS [EC2CopyRouteTableAction]
-> ReadPrec EC2CopyRouteTableAction
-> ReadPrec [EC2CopyRouteTableAction]
-> Read EC2CopyRouteTableAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EC2CopyRouteTableAction]
$creadListPrec :: ReadPrec [EC2CopyRouteTableAction]
readPrec :: ReadPrec EC2CopyRouteTableAction
$creadPrec :: ReadPrec EC2CopyRouteTableAction
readList :: ReadS [EC2CopyRouteTableAction]
$creadList :: ReadS [EC2CopyRouteTableAction]
readsPrec :: Int -> ReadS EC2CopyRouteTableAction
$creadsPrec :: Int -> ReadS EC2CopyRouteTableAction
Prelude.Read, Int -> EC2CopyRouteTableAction -> ShowS
[EC2CopyRouteTableAction] -> ShowS
EC2CopyRouteTableAction -> String
(Int -> EC2CopyRouteTableAction -> ShowS)
-> (EC2CopyRouteTableAction -> String)
-> ([EC2CopyRouteTableAction] -> ShowS)
-> Show EC2CopyRouteTableAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EC2CopyRouteTableAction] -> ShowS
$cshowList :: [EC2CopyRouteTableAction] -> ShowS
show :: EC2CopyRouteTableAction -> String
$cshow :: EC2CopyRouteTableAction -> String
showsPrec :: Int -> EC2CopyRouteTableAction -> ShowS
$cshowsPrec :: Int -> EC2CopyRouteTableAction -> ShowS
Prelude.Show, (forall x.
 EC2CopyRouteTableAction -> Rep EC2CopyRouteTableAction x)
-> (forall x.
    Rep EC2CopyRouteTableAction x -> EC2CopyRouteTableAction)
-> Generic EC2CopyRouteTableAction
forall x. Rep EC2CopyRouteTableAction x -> EC2CopyRouteTableAction
forall x. EC2CopyRouteTableAction -> Rep EC2CopyRouteTableAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EC2CopyRouteTableAction x -> EC2CopyRouteTableAction
$cfrom :: forall x. EC2CopyRouteTableAction -> Rep EC2CopyRouteTableAction x
Prelude.Generic)

-- |
-- Create a value of 'EC2CopyRouteTableAction' 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', 'eC2CopyRouteTableAction_description' - A description of the copied EC2 route table that is associated with the
-- remediation action.
--
-- 'vpcId', 'eC2CopyRouteTableAction_vpcId' - The VPC ID of the copied EC2 route table that is associated with the
-- remediation action.
--
-- 'routeTableId', 'eC2CopyRouteTableAction_routeTableId' - The ID of the copied EC2 route table that is associated with the
-- remediation action.
newEC2CopyRouteTableAction ::
  -- | 'vpcId'
  ActionTarget ->
  -- | 'routeTableId'
  ActionTarget ->
  EC2CopyRouteTableAction
newEC2CopyRouteTableAction :: ActionTarget -> ActionTarget -> EC2CopyRouteTableAction
newEC2CopyRouteTableAction ActionTarget
pVpcId_ ActionTarget
pRouteTableId_ =
  EC2CopyRouteTableAction' :: Maybe Text
-> ActionTarget -> ActionTarget -> EC2CopyRouteTableAction
EC2CopyRouteTableAction'
    { $sel:description:EC2CopyRouteTableAction' :: Maybe Text
description =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:EC2CopyRouteTableAction' :: ActionTarget
vpcId = ActionTarget
pVpcId_,
      $sel:routeTableId:EC2CopyRouteTableAction' :: ActionTarget
routeTableId = ActionTarget
pRouteTableId_
    }

-- | A description of the copied EC2 route table that is associated with the
-- remediation action.
eC2CopyRouteTableAction_description :: Lens.Lens' EC2CopyRouteTableAction (Prelude.Maybe Prelude.Text)
eC2CopyRouteTableAction_description :: (Maybe Text -> f (Maybe Text))
-> EC2CopyRouteTableAction -> f EC2CopyRouteTableAction
eC2CopyRouteTableAction_description = (EC2CopyRouteTableAction -> Maybe Text)
-> (EC2CopyRouteTableAction
    -> Maybe Text -> EC2CopyRouteTableAction)
-> Lens
     EC2CopyRouteTableAction
     EC2CopyRouteTableAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2CopyRouteTableAction' {Maybe Text
description :: Maybe Text
$sel:description:EC2CopyRouteTableAction' :: EC2CopyRouteTableAction -> Maybe Text
description} -> Maybe Text
description) (\s :: EC2CopyRouteTableAction
s@EC2CopyRouteTableAction' {} Maybe Text
a -> EC2CopyRouteTableAction
s {$sel:description:EC2CopyRouteTableAction' :: Maybe Text
description = Maybe Text
a} :: EC2CopyRouteTableAction)

-- | The VPC ID of the copied EC2 route table that is associated with the
-- remediation action.
eC2CopyRouteTableAction_vpcId :: Lens.Lens' EC2CopyRouteTableAction ActionTarget
eC2CopyRouteTableAction_vpcId :: (ActionTarget -> f ActionTarget)
-> EC2CopyRouteTableAction -> f EC2CopyRouteTableAction
eC2CopyRouteTableAction_vpcId = (EC2CopyRouteTableAction -> ActionTarget)
-> (EC2CopyRouteTableAction
    -> ActionTarget -> EC2CopyRouteTableAction)
-> Lens
     EC2CopyRouteTableAction
     EC2CopyRouteTableAction
     ActionTarget
     ActionTarget
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2CopyRouteTableAction' {ActionTarget
vpcId :: ActionTarget
$sel:vpcId:EC2CopyRouteTableAction' :: EC2CopyRouteTableAction -> ActionTarget
vpcId} -> ActionTarget
vpcId) (\s :: EC2CopyRouteTableAction
s@EC2CopyRouteTableAction' {} ActionTarget
a -> EC2CopyRouteTableAction
s {$sel:vpcId:EC2CopyRouteTableAction' :: ActionTarget
vpcId = ActionTarget
a} :: EC2CopyRouteTableAction)

-- | The ID of the copied EC2 route table that is associated with the
-- remediation action.
eC2CopyRouteTableAction_routeTableId :: Lens.Lens' EC2CopyRouteTableAction ActionTarget
eC2CopyRouteTableAction_routeTableId :: (ActionTarget -> f ActionTarget)
-> EC2CopyRouteTableAction -> f EC2CopyRouteTableAction
eC2CopyRouteTableAction_routeTableId = (EC2CopyRouteTableAction -> ActionTarget)
-> (EC2CopyRouteTableAction
    -> ActionTarget -> EC2CopyRouteTableAction)
-> Lens
     EC2CopyRouteTableAction
     EC2CopyRouteTableAction
     ActionTarget
     ActionTarget
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2CopyRouteTableAction' {ActionTarget
routeTableId :: ActionTarget
$sel:routeTableId:EC2CopyRouteTableAction' :: EC2CopyRouteTableAction -> ActionTarget
routeTableId} -> ActionTarget
routeTableId) (\s :: EC2CopyRouteTableAction
s@EC2CopyRouteTableAction' {} ActionTarget
a -> EC2CopyRouteTableAction
s {$sel:routeTableId:EC2CopyRouteTableAction' :: ActionTarget
routeTableId = ActionTarget
a} :: EC2CopyRouteTableAction)

instance Core.FromJSON EC2CopyRouteTableAction where
  parseJSON :: Value -> Parser EC2CopyRouteTableAction
parseJSON =
    String
-> (Object -> Parser EC2CopyRouteTableAction)
-> Value
-> Parser EC2CopyRouteTableAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EC2CopyRouteTableAction"
      ( \Object
x ->
          Maybe Text
-> ActionTarget -> ActionTarget -> EC2CopyRouteTableAction
EC2CopyRouteTableAction'
            (Maybe Text
 -> ActionTarget -> ActionTarget -> EC2CopyRouteTableAction)
-> Parser (Maybe Text)
-> Parser (ActionTarget -> ActionTarget -> EC2CopyRouteTableAction)
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
"Description")
            Parser (ActionTarget -> ActionTarget -> EC2CopyRouteTableAction)
-> Parser ActionTarget
-> Parser (ActionTarget -> EC2CopyRouteTableAction)
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
"VpcId")
            Parser (ActionTarget -> EC2CopyRouteTableAction)
-> Parser ActionTarget -> Parser EC2CopyRouteTableAction
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 EC2CopyRouteTableAction

instance Prelude.NFData EC2CopyRouteTableAction