{-# 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.EC2ReplaceRouteTableAssociationAction
-- 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.EC2ReplaceRouteTableAssociationAction 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 ReplaceRouteTableAssociation action in Amazon EC2.
--
-- /See:/ 'newEC2ReplaceRouteTableAssociationAction' smart constructor.
data EC2ReplaceRouteTableAssociationAction = EC2ReplaceRouteTableAssociationAction'
  { -- | A description of the ReplaceRouteTableAssociation action in Amazon EC2.
    EC2ReplaceRouteTableAssociationAction -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Information about the association ID.
    EC2ReplaceRouteTableAssociationAction -> ActionTarget
associationId :: ActionTarget,
    -- | Information about the ID of the new route table to associate with the
    -- subnet.
    EC2ReplaceRouteTableAssociationAction -> ActionTarget
routeTableId :: ActionTarget
  }
  deriving (EC2ReplaceRouteTableAssociationAction
-> EC2ReplaceRouteTableAssociationAction -> Bool
(EC2ReplaceRouteTableAssociationAction
 -> EC2ReplaceRouteTableAssociationAction -> Bool)
-> (EC2ReplaceRouteTableAssociationAction
    -> EC2ReplaceRouteTableAssociationAction -> Bool)
-> Eq EC2ReplaceRouteTableAssociationAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EC2ReplaceRouteTableAssociationAction
-> EC2ReplaceRouteTableAssociationAction -> Bool
$c/= :: EC2ReplaceRouteTableAssociationAction
-> EC2ReplaceRouteTableAssociationAction -> Bool
== :: EC2ReplaceRouteTableAssociationAction
-> EC2ReplaceRouteTableAssociationAction -> Bool
$c== :: EC2ReplaceRouteTableAssociationAction
-> EC2ReplaceRouteTableAssociationAction -> Bool
Prelude.Eq, ReadPrec [EC2ReplaceRouteTableAssociationAction]
ReadPrec EC2ReplaceRouteTableAssociationAction
Int -> ReadS EC2ReplaceRouteTableAssociationAction
ReadS [EC2ReplaceRouteTableAssociationAction]
(Int -> ReadS EC2ReplaceRouteTableAssociationAction)
-> ReadS [EC2ReplaceRouteTableAssociationAction]
-> ReadPrec EC2ReplaceRouteTableAssociationAction
-> ReadPrec [EC2ReplaceRouteTableAssociationAction]
-> Read EC2ReplaceRouteTableAssociationAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EC2ReplaceRouteTableAssociationAction]
$creadListPrec :: ReadPrec [EC2ReplaceRouteTableAssociationAction]
readPrec :: ReadPrec EC2ReplaceRouteTableAssociationAction
$creadPrec :: ReadPrec EC2ReplaceRouteTableAssociationAction
readList :: ReadS [EC2ReplaceRouteTableAssociationAction]
$creadList :: ReadS [EC2ReplaceRouteTableAssociationAction]
readsPrec :: Int -> ReadS EC2ReplaceRouteTableAssociationAction
$creadsPrec :: Int -> ReadS EC2ReplaceRouteTableAssociationAction
Prelude.Read, Int -> EC2ReplaceRouteTableAssociationAction -> ShowS
[EC2ReplaceRouteTableAssociationAction] -> ShowS
EC2ReplaceRouteTableAssociationAction -> String
(Int -> EC2ReplaceRouteTableAssociationAction -> ShowS)
-> (EC2ReplaceRouteTableAssociationAction -> String)
-> ([EC2ReplaceRouteTableAssociationAction] -> ShowS)
-> Show EC2ReplaceRouteTableAssociationAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EC2ReplaceRouteTableAssociationAction] -> ShowS
$cshowList :: [EC2ReplaceRouteTableAssociationAction] -> ShowS
show :: EC2ReplaceRouteTableAssociationAction -> String
$cshow :: EC2ReplaceRouteTableAssociationAction -> String
showsPrec :: Int -> EC2ReplaceRouteTableAssociationAction -> ShowS
$cshowsPrec :: Int -> EC2ReplaceRouteTableAssociationAction -> ShowS
Prelude.Show, (forall x.
 EC2ReplaceRouteTableAssociationAction
 -> Rep EC2ReplaceRouteTableAssociationAction x)
-> (forall x.
    Rep EC2ReplaceRouteTableAssociationAction x
    -> EC2ReplaceRouteTableAssociationAction)
-> Generic EC2ReplaceRouteTableAssociationAction
forall x.
Rep EC2ReplaceRouteTableAssociationAction x
-> EC2ReplaceRouteTableAssociationAction
forall x.
EC2ReplaceRouteTableAssociationAction
-> Rep EC2ReplaceRouteTableAssociationAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EC2ReplaceRouteTableAssociationAction x
-> EC2ReplaceRouteTableAssociationAction
$cfrom :: forall x.
EC2ReplaceRouteTableAssociationAction
-> Rep EC2ReplaceRouteTableAssociationAction x
Prelude.Generic)

-- |
-- Create a value of 'EC2ReplaceRouteTableAssociationAction' 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', 'eC2ReplaceRouteTableAssociationAction_description' - A description of the ReplaceRouteTableAssociation action in Amazon EC2.
--
-- 'associationId', 'eC2ReplaceRouteTableAssociationAction_associationId' - Information about the association ID.
--
-- 'routeTableId', 'eC2ReplaceRouteTableAssociationAction_routeTableId' - Information about the ID of the new route table to associate with the
-- subnet.
newEC2ReplaceRouteTableAssociationAction ::
  -- | 'associationId'
  ActionTarget ->
  -- | 'routeTableId'
  ActionTarget ->
  EC2ReplaceRouteTableAssociationAction
newEC2ReplaceRouteTableAssociationAction :: ActionTarget
-> ActionTarget -> EC2ReplaceRouteTableAssociationAction
newEC2ReplaceRouteTableAssociationAction
  ActionTarget
pAssociationId_
  ActionTarget
pRouteTableId_ =
    EC2ReplaceRouteTableAssociationAction' :: Maybe Text
-> ActionTarget
-> ActionTarget
-> EC2ReplaceRouteTableAssociationAction
EC2ReplaceRouteTableAssociationAction'
      { $sel:description:EC2ReplaceRouteTableAssociationAction' :: Maybe Text
description =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:associationId:EC2ReplaceRouteTableAssociationAction' :: ActionTarget
associationId = ActionTarget
pAssociationId_,
        $sel:routeTableId:EC2ReplaceRouteTableAssociationAction' :: ActionTarget
routeTableId = ActionTarget
pRouteTableId_
      }

-- | A description of the ReplaceRouteTableAssociation action in Amazon EC2.
eC2ReplaceRouteTableAssociationAction_description :: Lens.Lens' EC2ReplaceRouteTableAssociationAction (Prelude.Maybe Prelude.Text)
eC2ReplaceRouteTableAssociationAction_description :: (Maybe Text -> f (Maybe Text))
-> EC2ReplaceRouteTableAssociationAction
-> f EC2ReplaceRouteTableAssociationAction
eC2ReplaceRouteTableAssociationAction_description = (EC2ReplaceRouteTableAssociationAction -> Maybe Text)
-> (EC2ReplaceRouteTableAssociationAction
    -> Maybe Text -> EC2ReplaceRouteTableAssociationAction)
-> Lens
     EC2ReplaceRouteTableAssociationAction
     EC2ReplaceRouteTableAssociationAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2ReplaceRouteTableAssociationAction' {Maybe Text
description :: Maybe Text
$sel:description:EC2ReplaceRouteTableAssociationAction' :: EC2ReplaceRouteTableAssociationAction -> Maybe Text
description} -> Maybe Text
description) (\s :: EC2ReplaceRouteTableAssociationAction
s@EC2ReplaceRouteTableAssociationAction' {} Maybe Text
a -> EC2ReplaceRouteTableAssociationAction
s {$sel:description:EC2ReplaceRouteTableAssociationAction' :: Maybe Text
description = Maybe Text
a} :: EC2ReplaceRouteTableAssociationAction)

-- | Information about the association ID.
eC2ReplaceRouteTableAssociationAction_associationId :: Lens.Lens' EC2ReplaceRouteTableAssociationAction ActionTarget
eC2ReplaceRouteTableAssociationAction_associationId :: (ActionTarget -> f ActionTarget)
-> EC2ReplaceRouteTableAssociationAction
-> f EC2ReplaceRouteTableAssociationAction
eC2ReplaceRouteTableAssociationAction_associationId = (EC2ReplaceRouteTableAssociationAction -> ActionTarget)
-> (EC2ReplaceRouteTableAssociationAction
    -> ActionTarget -> EC2ReplaceRouteTableAssociationAction)
-> Lens
     EC2ReplaceRouteTableAssociationAction
     EC2ReplaceRouteTableAssociationAction
     ActionTarget
     ActionTarget
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2ReplaceRouteTableAssociationAction' {ActionTarget
associationId :: ActionTarget
$sel:associationId:EC2ReplaceRouteTableAssociationAction' :: EC2ReplaceRouteTableAssociationAction -> ActionTarget
associationId} -> ActionTarget
associationId) (\s :: EC2ReplaceRouteTableAssociationAction
s@EC2ReplaceRouteTableAssociationAction' {} ActionTarget
a -> EC2ReplaceRouteTableAssociationAction
s {$sel:associationId:EC2ReplaceRouteTableAssociationAction' :: ActionTarget
associationId = ActionTarget
a} :: EC2ReplaceRouteTableAssociationAction)

-- | Information about the ID of the new route table to associate with the
-- subnet.
eC2ReplaceRouteTableAssociationAction_routeTableId :: Lens.Lens' EC2ReplaceRouteTableAssociationAction ActionTarget
eC2ReplaceRouteTableAssociationAction_routeTableId :: (ActionTarget -> f ActionTarget)
-> EC2ReplaceRouteTableAssociationAction
-> f EC2ReplaceRouteTableAssociationAction
eC2ReplaceRouteTableAssociationAction_routeTableId = (EC2ReplaceRouteTableAssociationAction -> ActionTarget)
-> (EC2ReplaceRouteTableAssociationAction
    -> ActionTarget -> EC2ReplaceRouteTableAssociationAction)
-> Lens
     EC2ReplaceRouteTableAssociationAction
     EC2ReplaceRouteTableAssociationAction
     ActionTarget
     ActionTarget
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2ReplaceRouteTableAssociationAction' {ActionTarget
routeTableId :: ActionTarget
$sel:routeTableId:EC2ReplaceRouteTableAssociationAction' :: EC2ReplaceRouteTableAssociationAction -> ActionTarget
routeTableId} -> ActionTarget
routeTableId) (\s :: EC2ReplaceRouteTableAssociationAction
s@EC2ReplaceRouteTableAssociationAction' {} ActionTarget
a -> EC2ReplaceRouteTableAssociationAction
s {$sel:routeTableId:EC2ReplaceRouteTableAssociationAction' :: ActionTarget
routeTableId = ActionTarget
a} :: EC2ReplaceRouteTableAssociationAction)

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

instance
  Prelude.NFData
    EC2ReplaceRouteTableAssociationAction