{-# 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.CreateClientVpnRoute
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Adds a route to a network to a Client VPN endpoint. Each Client VPN
-- endpoint has a route table that describes the available destination
-- network routes. Each route in the route table specifies the path for
-- traffic to specific resources or networks.
module Amazonka.EC2.CreateClientVpnRoute
  ( -- * Creating a Request
    CreateClientVpnRoute (..),
    newCreateClientVpnRoute,

    -- * Request Lenses
    createClientVpnRoute_clientToken,
    createClientVpnRoute_description,
    createClientVpnRoute_dryRun,
    createClientVpnRoute_clientVpnEndpointId,
    createClientVpnRoute_destinationCidrBlock,
    createClientVpnRoute_targetVpcSubnetId,

    -- * Destructuring the Response
    CreateClientVpnRouteResponse (..),
    newCreateClientVpnRouteResponse,

    -- * Response Lenses
    createClientVpnRouteResponse_status,
    createClientVpnRouteResponse_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:/ 'newCreateClientVpnRoute' smart constructor.
data CreateClientVpnRoute = CreateClientVpnRoute'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html How to ensure idempotency>.
    CreateClientVpnRoute -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | A brief description of the route.
    CreateClientVpnRoute -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | 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@.
    CreateClientVpnRoute -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the Client VPN endpoint to which to add the route.
    CreateClientVpnRoute -> Text
clientVpnEndpointId :: Prelude.Text,
    -- | The IPv4 address range, in CIDR notation, of the route destination. For
    -- example:
    --
    -- -   To add a route for Internet access, enter @0.0.0.0\/0@
    --
    -- -   To add a route for a peered VPC, enter the peered VPC\'s IPv4 CIDR
    --     range
    --
    -- -   To add a route for an on-premises network, enter the Amazon Web
    --     Services Site-to-Site VPN connection\'s IPv4 CIDR range
    --
    -- -   To add a route for the local network, enter the client CIDR range
    CreateClientVpnRoute -> Text
destinationCidrBlock :: Prelude.Text,
    -- | The ID of the subnet through which you want to route traffic. The
    -- specified subnet must be an existing target network of the Client VPN
    -- endpoint.
    --
    -- Alternatively, if you\'re adding a route for the local network, specify
    -- @local@.
    CreateClientVpnRoute -> Text
targetVpcSubnetId :: Prelude.Text
  }
  deriving (CreateClientVpnRoute -> CreateClientVpnRoute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateClientVpnRoute -> CreateClientVpnRoute -> Bool
$c/= :: CreateClientVpnRoute -> CreateClientVpnRoute -> Bool
== :: CreateClientVpnRoute -> CreateClientVpnRoute -> Bool
$c== :: CreateClientVpnRoute -> CreateClientVpnRoute -> Bool
Prelude.Eq, ReadPrec [CreateClientVpnRoute]
ReadPrec CreateClientVpnRoute
Int -> ReadS CreateClientVpnRoute
ReadS [CreateClientVpnRoute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateClientVpnRoute]
$creadListPrec :: ReadPrec [CreateClientVpnRoute]
readPrec :: ReadPrec CreateClientVpnRoute
$creadPrec :: ReadPrec CreateClientVpnRoute
readList :: ReadS [CreateClientVpnRoute]
$creadList :: ReadS [CreateClientVpnRoute]
readsPrec :: Int -> ReadS CreateClientVpnRoute
$creadsPrec :: Int -> ReadS CreateClientVpnRoute
Prelude.Read, Int -> CreateClientVpnRoute -> ShowS
[CreateClientVpnRoute] -> ShowS
CreateClientVpnRoute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateClientVpnRoute] -> ShowS
$cshowList :: [CreateClientVpnRoute] -> ShowS
show :: CreateClientVpnRoute -> String
$cshow :: CreateClientVpnRoute -> String
showsPrec :: Int -> CreateClientVpnRoute -> ShowS
$cshowsPrec :: Int -> CreateClientVpnRoute -> ShowS
Prelude.Show, forall x. Rep CreateClientVpnRoute x -> CreateClientVpnRoute
forall x. CreateClientVpnRoute -> Rep CreateClientVpnRoute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateClientVpnRoute x -> CreateClientVpnRoute
$cfrom :: forall x. CreateClientVpnRoute -> Rep CreateClientVpnRoute x
Prelude.Generic)

-- |
-- Create a value of 'CreateClientVpnRoute' 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:
--
-- 'clientToken', 'createClientVpnRoute_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html How to ensure idempotency>.
--
-- 'description', 'createClientVpnRoute_description' - A brief description of the route.
--
-- 'dryRun', 'createClientVpnRoute_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@.
--
-- 'clientVpnEndpointId', 'createClientVpnRoute_clientVpnEndpointId' - The ID of the Client VPN endpoint to which to add the route.
--
-- 'destinationCidrBlock', 'createClientVpnRoute_destinationCidrBlock' - The IPv4 address range, in CIDR notation, of the route destination. For
-- example:
--
-- -   To add a route for Internet access, enter @0.0.0.0\/0@
--
-- -   To add a route for a peered VPC, enter the peered VPC\'s IPv4 CIDR
--     range
--
-- -   To add a route for an on-premises network, enter the Amazon Web
--     Services Site-to-Site VPN connection\'s IPv4 CIDR range
--
-- -   To add a route for the local network, enter the client CIDR range
--
-- 'targetVpcSubnetId', 'createClientVpnRoute_targetVpcSubnetId' - The ID of the subnet through which you want to route traffic. The
-- specified subnet must be an existing target network of the Client VPN
-- endpoint.
--
-- Alternatively, if you\'re adding a route for the local network, specify
-- @local@.
newCreateClientVpnRoute ::
  -- | 'clientVpnEndpointId'
  Prelude.Text ->
  -- | 'destinationCidrBlock'
  Prelude.Text ->
  -- | 'targetVpcSubnetId'
  Prelude.Text ->
  CreateClientVpnRoute
newCreateClientVpnRoute :: Text -> Text -> Text -> CreateClientVpnRoute
newCreateClientVpnRoute
  Text
pClientVpnEndpointId_
  Text
pDestinationCidrBlock_
  Text
pTargetVpcSubnetId_ =
    CreateClientVpnRoute'
      { $sel:clientToken:CreateClientVpnRoute' :: Maybe Text
clientToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateClientVpnRoute' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:dryRun:CreateClientVpnRoute' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
        $sel:clientVpnEndpointId:CreateClientVpnRoute' :: Text
clientVpnEndpointId = Text
pClientVpnEndpointId_,
        $sel:destinationCidrBlock:CreateClientVpnRoute' :: Text
destinationCidrBlock = Text
pDestinationCidrBlock_,
        $sel:targetVpcSubnetId:CreateClientVpnRoute' :: Text
targetVpcSubnetId = Text
pTargetVpcSubnetId_
      }

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html How to ensure idempotency>.
createClientVpnRoute_clientToken :: Lens.Lens' CreateClientVpnRoute (Prelude.Maybe Prelude.Text)
createClientVpnRoute_clientToken :: Lens' CreateClientVpnRoute (Maybe Text)
createClientVpnRoute_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClientVpnRoute' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateClientVpnRoute' :: CreateClientVpnRoute -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateClientVpnRoute
s@CreateClientVpnRoute' {} Maybe Text
a -> CreateClientVpnRoute
s {$sel:clientToken:CreateClientVpnRoute' :: Maybe Text
clientToken = Maybe Text
a} :: CreateClientVpnRoute)

-- | A brief description of the route.
createClientVpnRoute_description :: Lens.Lens' CreateClientVpnRoute (Prelude.Maybe Prelude.Text)
createClientVpnRoute_description :: Lens' CreateClientVpnRoute (Maybe Text)
createClientVpnRoute_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClientVpnRoute' {Maybe Text
description :: Maybe Text
$sel:description:CreateClientVpnRoute' :: CreateClientVpnRoute -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateClientVpnRoute
s@CreateClientVpnRoute' {} Maybe Text
a -> CreateClientVpnRoute
s {$sel:description:CreateClientVpnRoute' :: Maybe Text
description = Maybe Text
a} :: CreateClientVpnRoute)

-- | 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@.
createClientVpnRoute_dryRun :: Lens.Lens' CreateClientVpnRoute (Prelude.Maybe Prelude.Bool)
createClientVpnRoute_dryRun :: Lens' CreateClientVpnRoute (Maybe Bool)
createClientVpnRoute_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClientVpnRoute' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:CreateClientVpnRoute' :: CreateClientVpnRoute -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: CreateClientVpnRoute
s@CreateClientVpnRoute' {} Maybe Bool
a -> CreateClientVpnRoute
s {$sel:dryRun:CreateClientVpnRoute' :: Maybe Bool
dryRun = Maybe Bool
a} :: CreateClientVpnRoute)

-- | The ID of the Client VPN endpoint to which to add the route.
createClientVpnRoute_clientVpnEndpointId :: Lens.Lens' CreateClientVpnRoute Prelude.Text
createClientVpnRoute_clientVpnEndpointId :: Lens' CreateClientVpnRoute Text
createClientVpnRoute_clientVpnEndpointId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClientVpnRoute' {Text
clientVpnEndpointId :: Text
$sel:clientVpnEndpointId:CreateClientVpnRoute' :: CreateClientVpnRoute -> Text
clientVpnEndpointId} -> Text
clientVpnEndpointId) (\s :: CreateClientVpnRoute
s@CreateClientVpnRoute' {} Text
a -> CreateClientVpnRoute
s {$sel:clientVpnEndpointId:CreateClientVpnRoute' :: Text
clientVpnEndpointId = Text
a} :: CreateClientVpnRoute)

-- | The IPv4 address range, in CIDR notation, of the route destination. For
-- example:
--
-- -   To add a route for Internet access, enter @0.0.0.0\/0@
--
-- -   To add a route for a peered VPC, enter the peered VPC\'s IPv4 CIDR
--     range
--
-- -   To add a route for an on-premises network, enter the Amazon Web
--     Services Site-to-Site VPN connection\'s IPv4 CIDR range
--
-- -   To add a route for the local network, enter the client CIDR range
createClientVpnRoute_destinationCidrBlock :: Lens.Lens' CreateClientVpnRoute Prelude.Text
createClientVpnRoute_destinationCidrBlock :: Lens' CreateClientVpnRoute Text
createClientVpnRoute_destinationCidrBlock = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClientVpnRoute' {Text
destinationCidrBlock :: Text
$sel:destinationCidrBlock:CreateClientVpnRoute' :: CreateClientVpnRoute -> Text
destinationCidrBlock} -> Text
destinationCidrBlock) (\s :: CreateClientVpnRoute
s@CreateClientVpnRoute' {} Text
a -> CreateClientVpnRoute
s {$sel:destinationCidrBlock:CreateClientVpnRoute' :: Text
destinationCidrBlock = Text
a} :: CreateClientVpnRoute)

-- | The ID of the subnet through which you want to route traffic. The
-- specified subnet must be an existing target network of the Client VPN
-- endpoint.
--
-- Alternatively, if you\'re adding a route for the local network, specify
-- @local@.
createClientVpnRoute_targetVpcSubnetId :: Lens.Lens' CreateClientVpnRoute Prelude.Text
createClientVpnRoute_targetVpcSubnetId :: Lens' CreateClientVpnRoute Text
createClientVpnRoute_targetVpcSubnetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClientVpnRoute' {Text
targetVpcSubnetId :: Text
$sel:targetVpcSubnetId:CreateClientVpnRoute' :: CreateClientVpnRoute -> Text
targetVpcSubnetId} -> Text
targetVpcSubnetId) (\s :: CreateClientVpnRoute
s@CreateClientVpnRoute' {} Text
a -> CreateClientVpnRoute
s {$sel:targetVpcSubnetId:CreateClientVpnRoute' :: Text
targetVpcSubnetId = Text
a} :: CreateClientVpnRoute)

instance Core.AWSRequest CreateClientVpnRoute where
  type
    AWSResponse CreateClientVpnRoute =
      CreateClientVpnRouteResponse
  request :: (Service -> Service)
-> CreateClientVpnRoute -> Request CreateClientVpnRoute
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 CreateClientVpnRoute
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateClientVpnRoute)))
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 ClientVpnRouteStatus -> Int -> CreateClientVpnRouteResponse
CreateClientVpnRouteResponse'
            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
"status")
            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 CreateClientVpnRoute where
  hashWithSalt :: Int -> CreateClientVpnRoute -> Int
hashWithSalt Int
_salt CreateClientVpnRoute' {Maybe Bool
Maybe Text
Text
targetVpcSubnetId :: Text
destinationCidrBlock :: Text
clientVpnEndpointId :: Text
dryRun :: Maybe Bool
description :: Maybe Text
clientToken :: Maybe Text
$sel:targetVpcSubnetId:CreateClientVpnRoute' :: CreateClientVpnRoute -> Text
$sel:destinationCidrBlock:CreateClientVpnRoute' :: CreateClientVpnRoute -> Text
$sel:clientVpnEndpointId:CreateClientVpnRoute' :: CreateClientVpnRoute -> Text
$sel:dryRun:CreateClientVpnRoute' :: CreateClientVpnRoute -> Maybe Bool
$sel:description:CreateClientVpnRoute' :: CreateClientVpnRoute -> Maybe Text
$sel:clientToken:CreateClientVpnRoute' :: CreateClientVpnRoute -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientVpnEndpointId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
destinationCidrBlock
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
targetVpcSubnetId

instance Prelude.NFData CreateClientVpnRoute where
  rnf :: CreateClientVpnRoute -> ()
rnf CreateClientVpnRoute' {Maybe Bool
Maybe Text
Text
targetVpcSubnetId :: Text
destinationCidrBlock :: Text
clientVpnEndpointId :: Text
dryRun :: Maybe Bool
description :: Maybe Text
clientToken :: Maybe Text
$sel:targetVpcSubnetId:CreateClientVpnRoute' :: CreateClientVpnRoute -> Text
$sel:destinationCidrBlock:CreateClientVpnRoute' :: CreateClientVpnRoute -> Text
$sel:clientVpnEndpointId:CreateClientVpnRoute' :: CreateClientVpnRoute -> Text
$sel:dryRun:CreateClientVpnRoute' :: CreateClientVpnRoute -> Maybe Bool
$sel:description:CreateClientVpnRoute' :: CreateClientVpnRoute -> Maybe Text
$sel:clientToken:CreateClientVpnRoute' :: CreateClientVpnRoute -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientVpnEndpointId
      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
targetVpcSubnetId

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

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

instance Data.ToQuery CreateClientVpnRoute where
  toQuery :: CreateClientVpnRoute -> QueryString
toQuery CreateClientVpnRoute' {Maybe Bool
Maybe Text
Text
targetVpcSubnetId :: Text
destinationCidrBlock :: Text
clientVpnEndpointId :: Text
dryRun :: Maybe Bool
description :: Maybe Text
clientToken :: Maybe Text
$sel:targetVpcSubnetId:CreateClientVpnRoute' :: CreateClientVpnRoute -> Text
$sel:destinationCidrBlock:CreateClientVpnRoute' :: CreateClientVpnRoute -> Text
$sel:clientVpnEndpointId:CreateClientVpnRoute' :: CreateClientVpnRoute -> Text
$sel:dryRun:CreateClientVpnRoute' :: CreateClientVpnRoute -> Maybe Bool
$sel:description:CreateClientVpnRoute' :: CreateClientVpnRoute -> Maybe Text
$sel:clientToken:CreateClientVpnRoute' :: CreateClientVpnRoute -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateClientVpnRoute" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"ClientToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clientToken,
        ByteString
"Description" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
description,
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"ClientVpnEndpointId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
clientVpnEndpointId,
        ByteString
"DestinationCidrBlock" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
destinationCidrBlock,
        ByteString
"TargetVpcSubnetId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
targetVpcSubnetId
      ]

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

-- |
-- Create a value of 'CreateClientVpnRouteResponse' 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:
--
-- 'status', 'createClientVpnRouteResponse_status' - The current state of the route.
--
-- 'httpStatus', 'createClientVpnRouteResponse_httpStatus' - The response's http status code.
newCreateClientVpnRouteResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateClientVpnRouteResponse
newCreateClientVpnRouteResponse :: Int -> CreateClientVpnRouteResponse
newCreateClientVpnRouteResponse Int
pHttpStatus_ =
  CreateClientVpnRouteResponse'
    { $sel:status:CreateClientVpnRouteResponse' :: Maybe ClientVpnRouteStatus
status =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateClientVpnRouteResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current state of the route.
createClientVpnRouteResponse_status :: Lens.Lens' CreateClientVpnRouteResponse (Prelude.Maybe ClientVpnRouteStatus)
createClientVpnRouteResponse_status :: Lens' CreateClientVpnRouteResponse (Maybe ClientVpnRouteStatus)
createClientVpnRouteResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateClientVpnRouteResponse' {Maybe ClientVpnRouteStatus
status :: Maybe ClientVpnRouteStatus
$sel:status:CreateClientVpnRouteResponse' :: CreateClientVpnRouteResponse -> Maybe ClientVpnRouteStatus
status} -> Maybe ClientVpnRouteStatus
status) (\s :: CreateClientVpnRouteResponse
s@CreateClientVpnRouteResponse' {} Maybe ClientVpnRouteStatus
a -> CreateClientVpnRouteResponse
s {$sel:status:CreateClientVpnRouteResponse' :: Maybe ClientVpnRouteStatus
status = Maybe ClientVpnRouteStatus
a} :: CreateClientVpnRouteResponse)

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

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