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

-- |
-- Create a value of 'EC2CreateRouteTableAction' 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', 'eC2CreateRouteTableAction_description' - A description of the CreateRouteTable action.
--
-- 'vpcId', 'eC2CreateRouteTableAction_vpcId' - Information about the ID of a VPC.
newEC2CreateRouteTableAction ::
  -- | 'vpcId'
  ActionTarget ->
  EC2CreateRouteTableAction
newEC2CreateRouteTableAction :: ActionTarget -> EC2CreateRouteTableAction
newEC2CreateRouteTableAction ActionTarget
pVpcId_ =
  EC2CreateRouteTableAction' :: Maybe Text -> ActionTarget -> EC2CreateRouteTableAction
EC2CreateRouteTableAction'
    { $sel:description:EC2CreateRouteTableAction' :: Maybe Text
description =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:EC2CreateRouteTableAction' :: ActionTarget
vpcId = ActionTarget
pVpcId_
    }

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

-- | Information about the ID of a VPC.
eC2CreateRouteTableAction_vpcId :: Lens.Lens' EC2CreateRouteTableAction ActionTarget
eC2CreateRouteTableAction_vpcId :: (ActionTarget -> f ActionTarget)
-> EC2CreateRouteTableAction -> f EC2CreateRouteTableAction
eC2CreateRouteTableAction_vpcId = (EC2CreateRouteTableAction -> ActionTarget)
-> (EC2CreateRouteTableAction
    -> ActionTarget -> EC2CreateRouteTableAction)
-> Lens
     EC2CreateRouteTableAction
     EC2CreateRouteTableAction
     ActionTarget
     ActionTarget
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EC2CreateRouteTableAction' {ActionTarget
vpcId :: ActionTarget
$sel:vpcId:EC2CreateRouteTableAction' :: EC2CreateRouteTableAction -> ActionTarget
vpcId} -> ActionTarget
vpcId) (\s :: EC2CreateRouteTableAction
s@EC2CreateRouteTableAction' {} ActionTarget
a -> EC2CreateRouteTableAction
s {$sel:vpcId:EC2CreateRouteTableAction' :: ActionTarget
vpcId = ActionTarget
a} :: EC2CreateRouteTableAction)

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

instance Prelude.Hashable EC2CreateRouteTableAction

instance Prelude.NFData EC2CreateRouteTableAction