{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.EC2.CreateLocalGatewayRoute
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a static route for the specified local gateway route table. You
-- must specify one of the following targets:
--
-- -   @LocalGatewayVirtualInterfaceGroupId@
--
-- -   @NetworkInterfaceId@
module Amazonka.EC2.CreateLocalGatewayRoute
  ( -- * Creating a Request
    CreateLocalGatewayRoute (..),
    newCreateLocalGatewayRoute,

    -- * Request Lenses
    createLocalGatewayRoute_dryRun,
    createLocalGatewayRoute_localGatewayVirtualInterfaceGroupId,
    createLocalGatewayRoute_networkInterfaceId,
    createLocalGatewayRoute_destinationCidrBlock,
    createLocalGatewayRoute_localGatewayRouteTableId,

    -- * Destructuring the Response
    CreateLocalGatewayRouteResponse (..),
    newCreateLocalGatewayRouteResponse,

    -- * Response Lenses
    createLocalGatewayRouteResponse_route,
    createLocalGatewayRouteResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateLocalGatewayRoute' smart constructor.
data CreateLocalGatewayRoute = CreateLocalGatewayRoute'
  { -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    CreateLocalGatewayRoute -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the virtual interface group.
    CreateLocalGatewayRoute -> Maybe Text
localGatewayVirtualInterfaceGroupId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the network interface.
    CreateLocalGatewayRoute -> Maybe Text
networkInterfaceId :: Prelude.Maybe Prelude.Text,
    -- | The CIDR range used for destination matches. Routing decisions are based
    -- on the most specific match.
    CreateLocalGatewayRoute -> Text
destinationCidrBlock :: Prelude.Text,
    -- | The ID of the local gateway route table.
    CreateLocalGatewayRoute -> Text
localGatewayRouteTableId :: Prelude.Text
  }
  deriving (CreateLocalGatewayRoute -> CreateLocalGatewayRoute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLocalGatewayRoute -> CreateLocalGatewayRoute -> Bool
$c/= :: CreateLocalGatewayRoute -> CreateLocalGatewayRoute -> Bool
== :: CreateLocalGatewayRoute -> CreateLocalGatewayRoute -> Bool
$c== :: CreateLocalGatewayRoute -> CreateLocalGatewayRoute -> Bool
Prelude.Eq, ReadPrec [CreateLocalGatewayRoute]
ReadPrec CreateLocalGatewayRoute
Int -> ReadS CreateLocalGatewayRoute
ReadS [CreateLocalGatewayRoute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLocalGatewayRoute]
$creadListPrec :: ReadPrec [CreateLocalGatewayRoute]
readPrec :: ReadPrec CreateLocalGatewayRoute
$creadPrec :: ReadPrec CreateLocalGatewayRoute
readList :: ReadS [CreateLocalGatewayRoute]
$creadList :: ReadS [CreateLocalGatewayRoute]
readsPrec :: Int -> ReadS CreateLocalGatewayRoute
$creadsPrec :: Int -> ReadS CreateLocalGatewayRoute
Prelude.Read, Int -> CreateLocalGatewayRoute -> ShowS
[CreateLocalGatewayRoute] -> ShowS
CreateLocalGatewayRoute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLocalGatewayRoute] -> ShowS
$cshowList :: [CreateLocalGatewayRoute] -> ShowS
show :: CreateLocalGatewayRoute -> String
$cshow :: CreateLocalGatewayRoute -> String
showsPrec :: Int -> CreateLocalGatewayRoute -> ShowS
$cshowsPrec :: Int -> CreateLocalGatewayRoute -> ShowS
Prelude.Show, forall x. Rep CreateLocalGatewayRoute x -> CreateLocalGatewayRoute
forall x. CreateLocalGatewayRoute -> Rep CreateLocalGatewayRoute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLocalGatewayRoute x -> CreateLocalGatewayRoute
$cfrom :: forall x. CreateLocalGatewayRoute -> Rep CreateLocalGatewayRoute x
Prelude.Generic)

-- |
-- Create a value of 'CreateLocalGatewayRoute' 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:
--
-- 'dryRun', 'createLocalGatewayRoute_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'localGatewayVirtualInterfaceGroupId', 'createLocalGatewayRoute_localGatewayVirtualInterfaceGroupId' - The ID of the virtual interface group.
--
-- 'networkInterfaceId', 'createLocalGatewayRoute_networkInterfaceId' - The ID of the network interface.
--
-- 'destinationCidrBlock', 'createLocalGatewayRoute_destinationCidrBlock' - The CIDR range used for destination matches. Routing decisions are based
-- on the most specific match.
--
-- 'localGatewayRouteTableId', 'createLocalGatewayRoute_localGatewayRouteTableId' - The ID of the local gateway route table.
newCreateLocalGatewayRoute ::
  -- | 'destinationCidrBlock'
  Prelude.Text ->
  -- | 'localGatewayRouteTableId'
  Prelude.Text ->
  CreateLocalGatewayRoute
newCreateLocalGatewayRoute :: Text -> Text -> CreateLocalGatewayRoute
newCreateLocalGatewayRoute
  Text
pDestinationCidrBlock_
  Text
pLocalGatewayRouteTableId_ =
    CreateLocalGatewayRoute'
      { $sel:dryRun:CreateLocalGatewayRoute' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
        $sel:localGatewayVirtualInterfaceGroupId:CreateLocalGatewayRoute' :: Maybe Text
localGatewayVirtualInterfaceGroupId =
          forall a. Maybe a
Prelude.Nothing,
        $sel:networkInterfaceId:CreateLocalGatewayRoute' :: Maybe Text
networkInterfaceId = forall a. Maybe a
Prelude.Nothing,
        $sel:destinationCidrBlock:CreateLocalGatewayRoute' :: Text
destinationCidrBlock = Text
pDestinationCidrBlock_,
        $sel:localGatewayRouteTableId:CreateLocalGatewayRoute' :: Text
localGatewayRouteTableId =
          Text
pLocalGatewayRouteTableId_
      }

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
createLocalGatewayRoute_dryRun :: Lens.Lens' CreateLocalGatewayRoute (Prelude.Maybe Prelude.Bool)
createLocalGatewayRoute_dryRun :: Lens' CreateLocalGatewayRoute (Maybe Bool)
createLocalGatewayRoute_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocalGatewayRoute' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: CreateLocalGatewayRoute
s@CreateLocalGatewayRoute' {} Maybe Bool
a -> CreateLocalGatewayRoute
s {$sel:dryRun:CreateLocalGatewayRoute' :: Maybe Bool
dryRun = Maybe Bool
a} :: CreateLocalGatewayRoute)

-- | The ID of the virtual interface group.
createLocalGatewayRoute_localGatewayVirtualInterfaceGroupId :: Lens.Lens' CreateLocalGatewayRoute (Prelude.Maybe Prelude.Text)
createLocalGatewayRoute_localGatewayVirtualInterfaceGroupId :: Lens' CreateLocalGatewayRoute (Maybe Text)
createLocalGatewayRoute_localGatewayVirtualInterfaceGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocalGatewayRoute' {Maybe Text
localGatewayVirtualInterfaceGroupId :: Maybe Text
$sel:localGatewayVirtualInterfaceGroupId:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Maybe Text
localGatewayVirtualInterfaceGroupId} -> Maybe Text
localGatewayVirtualInterfaceGroupId) (\s :: CreateLocalGatewayRoute
s@CreateLocalGatewayRoute' {} Maybe Text
a -> CreateLocalGatewayRoute
s {$sel:localGatewayVirtualInterfaceGroupId:CreateLocalGatewayRoute' :: Maybe Text
localGatewayVirtualInterfaceGroupId = Maybe Text
a} :: CreateLocalGatewayRoute)

-- | The ID of the network interface.
createLocalGatewayRoute_networkInterfaceId :: Lens.Lens' CreateLocalGatewayRoute (Prelude.Maybe Prelude.Text)
createLocalGatewayRoute_networkInterfaceId :: Lens' CreateLocalGatewayRoute (Maybe Text)
createLocalGatewayRoute_networkInterfaceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocalGatewayRoute' {Maybe Text
networkInterfaceId :: Maybe Text
$sel:networkInterfaceId:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Maybe Text
networkInterfaceId} -> Maybe Text
networkInterfaceId) (\s :: CreateLocalGatewayRoute
s@CreateLocalGatewayRoute' {} Maybe Text
a -> CreateLocalGatewayRoute
s {$sel:networkInterfaceId:CreateLocalGatewayRoute' :: Maybe Text
networkInterfaceId = Maybe Text
a} :: CreateLocalGatewayRoute)

-- | The CIDR range used for destination matches. Routing decisions are based
-- on the most specific match.
createLocalGatewayRoute_destinationCidrBlock :: Lens.Lens' CreateLocalGatewayRoute Prelude.Text
createLocalGatewayRoute_destinationCidrBlock :: Lens' CreateLocalGatewayRoute Text
createLocalGatewayRoute_destinationCidrBlock = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocalGatewayRoute' {Text
destinationCidrBlock :: Text
$sel:destinationCidrBlock:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Text
destinationCidrBlock} -> Text
destinationCidrBlock) (\s :: CreateLocalGatewayRoute
s@CreateLocalGatewayRoute' {} Text
a -> CreateLocalGatewayRoute
s {$sel:destinationCidrBlock:CreateLocalGatewayRoute' :: Text
destinationCidrBlock = Text
a} :: CreateLocalGatewayRoute)

-- | The ID of the local gateway route table.
createLocalGatewayRoute_localGatewayRouteTableId :: Lens.Lens' CreateLocalGatewayRoute Prelude.Text
createLocalGatewayRoute_localGatewayRouteTableId :: Lens' CreateLocalGatewayRoute Text
createLocalGatewayRoute_localGatewayRouteTableId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocalGatewayRoute' {Text
localGatewayRouteTableId :: Text
$sel:localGatewayRouteTableId:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Text
localGatewayRouteTableId} -> Text
localGatewayRouteTableId) (\s :: CreateLocalGatewayRoute
s@CreateLocalGatewayRoute' {} Text
a -> CreateLocalGatewayRoute
s {$sel:localGatewayRouteTableId:CreateLocalGatewayRoute' :: Text
localGatewayRouteTableId = Text
a} :: CreateLocalGatewayRoute)

instance Core.AWSRequest CreateLocalGatewayRoute where
  type
    AWSResponse CreateLocalGatewayRoute =
      CreateLocalGatewayRouteResponse
  request :: (Service -> Service)
-> CreateLocalGatewayRoute -> Request CreateLocalGatewayRoute
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateLocalGatewayRoute
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateLocalGatewayRoute)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe LocalGatewayRoute -> Int -> CreateLocalGatewayRouteResponse
CreateLocalGatewayRouteResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"route")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateLocalGatewayRoute where
  hashWithSalt :: Int -> CreateLocalGatewayRoute -> Int
hashWithSalt Int
_salt CreateLocalGatewayRoute' {Maybe Bool
Maybe Text
Text
localGatewayRouteTableId :: Text
destinationCidrBlock :: Text
networkInterfaceId :: Maybe Text
localGatewayVirtualInterfaceGroupId :: Maybe Text
dryRun :: Maybe Bool
$sel:localGatewayRouteTableId:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Text
$sel:destinationCidrBlock:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Text
$sel:networkInterfaceId:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Maybe Text
$sel:localGatewayVirtualInterfaceGroupId:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Maybe Text
$sel:dryRun:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
localGatewayVirtualInterfaceGroupId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
networkInterfaceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
destinationCidrBlock
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
localGatewayRouteTableId

instance Prelude.NFData CreateLocalGatewayRoute where
  rnf :: CreateLocalGatewayRoute -> ()
rnf CreateLocalGatewayRoute' {Maybe Bool
Maybe Text
Text
localGatewayRouteTableId :: Text
destinationCidrBlock :: Text
networkInterfaceId :: Maybe Text
localGatewayVirtualInterfaceGroupId :: Maybe Text
dryRun :: Maybe Bool
$sel:localGatewayRouteTableId:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Text
$sel:destinationCidrBlock:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Text
$sel:networkInterfaceId:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Maybe Text
$sel:localGatewayVirtualInterfaceGroupId:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Maybe Text
$sel:dryRun:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
localGatewayVirtualInterfaceGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
networkInterfaceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
destinationCidrBlock
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
localGatewayRouteTableId

instance Data.ToHeaders CreateLocalGatewayRoute where
  toHeaders :: CreateLocalGatewayRoute -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath CreateLocalGatewayRoute where
  toPath :: CreateLocalGatewayRoute -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery CreateLocalGatewayRoute where
  toQuery :: CreateLocalGatewayRoute -> QueryString
toQuery CreateLocalGatewayRoute' {Maybe Bool
Maybe Text
Text
localGatewayRouteTableId :: Text
destinationCidrBlock :: Text
networkInterfaceId :: Maybe Text
localGatewayVirtualInterfaceGroupId :: Maybe Text
dryRun :: Maybe Bool
$sel:localGatewayRouteTableId:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Text
$sel:destinationCidrBlock:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Text
$sel:networkInterfaceId:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Maybe Text
$sel:localGatewayVirtualInterfaceGroupId:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Maybe Text
$sel:dryRun:CreateLocalGatewayRoute' :: CreateLocalGatewayRoute -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateLocalGatewayRoute" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"LocalGatewayVirtualInterfaceGroupId"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
localGatewayVirtualInterfaceGroupId,
        ByteString
"NetworkInterfaceId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
networkInterfaceId,
        ByteString
"DestinationCidrBlock" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
destinationCidrBlock,
        ByteString
"LocalGatewayRouteTableId"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
localGatewayRouteTableId
      ]

-- | /See:/ 'newCreateLocalGatewayRouteResponse' smart constructor.
data CreateLocalGatewayRouteResponse = CreateLocalGatewayRouteResponse'
  { -- | Information about the route.
    CreateLocalGatewayRouteResponse -> Maybe LocalGatewayRoute
route :: Prelude.Maybe LocalGatewayRoute,
    -- | The response's http status code.
    CreateLocalGatewayRouteResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateLocalGatewayRouteResponse
-> CreateLocalGatewayRouteResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLocalGatewayRouteResponse
-> CreateLocalGatewayRouteResponse -> Bool
$c/= :: CreateLocalGatewayRouteResponse
-> CreateLocalGatewayRouteResponse -> Bool
== :: CreateLocalGatewayRouteResponse
-> CreateLocalGatewayRouteResponse -> Bool
$c== :: CreateLocalGatewayRouteResponse
-> CreateLocalGatewayRouteResponse -> Bool
Prelude.Eq, ReadPrec [CreateLocalGatewayRouteResponse]
ReadPrec CreateLocalGatewayRouteResponse
Int -> ReadS CreateLocalGatewayRouteResponse
ReadS [CreateLocalGatewayRouteResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLocalGatewayRouteResponse]
$creadListPrec :: ReadPrec [CreateLocalGatewayRouteResponse]
readPrec :: ReadPrec CreateLocalGatewayRouteResponse
$creadPrec :: ReadPrec CreateLocalGatewayRouteResponse
readList :: ReadS [CreateLocalGatewayRouteResponse]
$creadList :: ReadS [CreateLocalGatewayRouteResponse]
readsPrec :: Int -> ReadS CreateLocalGatewayRouteResponse
$creadsPrec :: Int -> ReadS CreateLocalGatewayRouteResponse
Prelude.Read, Int -> CreateLocalGatewayRouteResponse -> ShowS
[CreateLocalGatewayRouteResponse] -> ShowS
CreateLocalGatewayRouteResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLocalGatewayRouteResponse] -> ShowS
$cshowList :: [CreateLocalGatewayRouteResponse] -> ShowS
show :: CreateLocalGatewayRouteResponse -> String
$cshow :: CreateLocalGatewayRouteResponse -> String
showsPrec :: Int -> CreateLocalGatewayRouteResponse -> ShowS
$cshowsPrec :: Int -> CreateLocalGatewayRouteResponse -> ShowS
Prelude.Show, forall x.
Rep CreateLocalGatewayRouteResponse x
-> CreateLocalGatewayRouteResponse
forall x.
CreateLocalGatewayRouteResponse
-> Rep CreateLocalGatewayRouteResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLocalGatewayRouteResponse x
-> CreateLocalGatewayRouteResponse
$cfrom :: forall x.
CreateLocalGatewayRouteResponse
-> Rep CreateLocalGatewayRouteResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateLocalGatewayRouteResponse' 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:
--
-- 'route', 'createLocalGatewayRouteResponse_route' - Information about the route.
--
-- 'httpStatus', 'createLocalGatewayRouteResponse_httpStatus' - The response's http status code.
newCreateLocalGatewayRouteResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateLocalGatewayRouteResponse
newCreateLocalGatewayRouteResponse :: Int -> CreateLocalGatewayRouteResponse
newCreateLocalGatewayRouteResponse Int
pHttpStatus_ =
  CreateLocalGatewayRouteResponse'
    { $sel:route:CreateLocalGatewayRouteResponse' :: Maybe LocalGatewayRoute
route =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateLocalGatewayRouteResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the route.
createLocalGatewayRouteResponse_route :: Lens.Lens' CreateLocalGatewayRouteResponse (Prelude.Maybe LocalGatewayRoute)
createLocalGatewayRouteResponse_route :: Lens' CreateLocalGatewayRouteResponse (Maybe LocalGatewayRoute)
createLocalGatewayRouteResponse_route = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocalGatewayRouteResponse' {Maybe LocalGatewayRoute
route :: Maybe LocalGatewayRoute
$sel:route:CreateLocalGatewayRouteResponse' :: CreateLocalGatewayRouteResponse -> Maybe LocalGatewayRoute
route} -> Maybe LocalGatewayRoute
route) (\s :: CreateLocalGatewayRouteResponse
s@CreateLocalGatewayRouteResponse' {} Maybe LocalGatewayRoute
a -> CreateLocalGatewayRouteResponse
s {$sel:route:CreateLocalGatewayRouteResponse' :: Maybe LocalGatewayRoute
route = Maybe LocalGatewayRoute
a} :: CreateLocalGatewayRouteResponse)

-- | The response's http status code.
createLocalGatewayRouteResponse_httpStatus :: Lens.Lens' CreateLocalGatewayRouteResponse Prelude.Int
createLocalGatewayRouteResponse_httpStatus :: Lens' CreateLocalGatewayRouteResponse Int
createLocalGatewayRouteResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocalGatewayRouteResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateLocalGatewayRouteResponse' :: CreateLocalGatewayRouteResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateLocalGatewayRouteResponse
s@CreateLocalGatewayRouteResponse' {} Int
a -> CreateLocalGatewayRouteResponse
s {$sel:httpStatus:CreateLocalGatewayRouteResponse' :: Int
httpStatus = Int
a} :: CreateLocalGatewayRouteResponse)

instance
  Prelude.NFData
    CreateLocalGatewayRouteResponse
  where
  rnf :: CreateLocalGatewayRouteResponse -> ()
rnf CreateLocalGatewayRouteResponse' {Int
Maybe LocalGatewayRoute
httpStatus :: Int
route :: Maybe LocalGatewayRoute
$sel:httpStatus:CreateLocalGatewayRouteResponse' :: CreateLocalGatewayRouteResponse -> Int
$sel:route:CreateLocalGatewayRouteResponse' :: CreateLocalGatewayRouteResponse -> Maybe LocalGatewayRoute
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe LocalGatewayRoute
route
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus