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

-- | 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
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]
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
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. 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'
    { $sel:description:EC2CopyRouteTableAction' :: Maybe Text
description =
        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 :: Lens' EC2CopyRouteTableAction (Maybe Text)
eC2CopyRouteTableAction_description = 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 :: Lens' EC2CopyRouteTableAction ActionTarget
eC2CopyRouteTableAction_vpcId = 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 :: Lens' EC2CopyRouteTableAction ActionTarget
eC2CopyRouteTableAction_routeTableId = 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 Data.FromJSON EC2CopyRouteTableAction where
  parseJSON :: Value -> Parser EC2CopyRouteTableAction
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EC2CopyRouteTableAction"
      ( \Object
x ->
          Maybe Text
-> ActionTarget -> ActionTarget -> EC2CopyRouteTableAction
EC2CopyRouteTableAction'
            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 a
Data..: Key
"VpcId")
            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 EC2CopyRouteTableAction where
  hashWithSalt :: Int -> EC2CopyRouteTableAction -> Int
hashWithSalt Int
_salt EC2CopyRouteTableAction' {Maybe Text
ActionTarget
routeTableId :: ActionTarget
vpcId :: ActionTarget
description :: Maybe Text
$sel:routeTableId:EC2CopyRouteTableAction' :: EC2CopyRouteTableAction -> ActionTarget
$sel:vpcId:EC2CopyRouteTableAction' :: EC2CopyRouteTableAction -> ActionTarget
$sel:description:EC2CopyRouteTableAction' :: EC2CopyRouteTableAction -> 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` ActionTarget
vpcId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ActionTarget
routeTableId

instance Prelude.NFData EC2CopyRouteTableAction where
  rnf :: EC2CopyRouteTableAction -> ()
rnf EC2CopyRouteTableAction' {Maybe Text
ActionTarget
routeTableId :: ActionTarget
vpcId :: ActionTarget
description :: Maybe Text
$sel:routeTableId:EC2CopyRouteTableAction' :: EC2CopyRouteTableAction -> ActionTarget
$sel:vpcId:EC2CopyRouteTableAction' :: EC2CopyRouteTableAction -> ActionTarget
$sel:description:EC2CopyRouteTableAction' :: EC2CopyRouteTableAction -> 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 ActionTarget
vpcId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ActionTarget
routeTableId