{-# 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.CreateCustomerGateway
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Provides information to Amazon Web Services about your customer gateway
-- device. The customer gateway device is the appliance at your end of the
-- VPN connection. You must provide the IP address of the customer gateway
-- device’s external interface. The IP address must be static and can be
-- behind a device performing network address translation (NAT).
--
-- For devices that use Border Gateway Protocol (BGP), you can also provide
-- the device\'s BGP Autonomous System Number (ASN). You can use an
-- existing ASN assigned to your network. If you don\'t have an ASN
-- already, you can use a private ASN. For more information, see
-- <https://docs.aws.amazon.com/vpn/latest/s2svpn/cgw-options.html Customer gateway options for your Site-to-Site VPN connection>
-- in the /Amazon Web Services Site-to-Site VPN User Guide/.
--
-- To create more than one customer gateway with the same VPN type, IP
-- address, and BGP ASN, specify a unique device name for each customer
-- gateway. An identical request returns information about the existing
-- customer gateway; it doesn\'t create a new customer gateway.
module Amazonka.EC2.CreateCustomerGateway
  ( -- * Creating a Request
    CreateCustomerGateway (..),
    newCreateCustomerGateway,

    -- * Request Lenses
    createCustomerGateway_certificateArn,
    createCustomerGateway_deviceName,
    createCustomerGateway_dryRun,
    createCustomerGateway_ipAddress,
    createCustomerGateway_publicIp,
    createCustomerGateway_tagSpecifications,
    createCustomerGateway_bgpAsn,
    createCustomerGateway_type,

    -- * Destructuring the Response
    CreateCustomerGatewayResponse (..),
    newCreateCustomerGatewayResponse,

    -- * Response Lenses
    createCustomerGatewayResponse_customerGateway,
    createCustomerGatewayResponse_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

-- | Contains the parameters for CreateCustomerGateway.
--
-- /See:/ 'newCreateCustomerGateway' smart constructor.
data CreateCustomerGateway = CreateCustomerGateway'
  { -- | The Amazon Resource Name (ARN) for the customer gateway certificate.
    CreateCustomerGateway -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
    -- | A name for the customer gateway device.
    --
    -- Length Constraints: Up to 255 characters.
    CreateCustomerGateway -> Maybe Text
deviceName :: 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@.
    CreateCustomerGateway -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | IPv4 address for the customer gateway device\'s outside interface. The
    -- address must be static.
    CreateCustomerGateway -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
    -- | /This member has been deprecated./ The Internet-routable IP address for
    -- the customer gateway\'s outside interface. The address must be static.
    CreateCustomerGateway -> Maybe Text
publicIp :: Prelude.Maybe Prelude.Text,
    -- | The tags to apply to the customer gateway.
    CreateCustomerGateway -> Maybe [TagSpecification]
tagSpecifications :: Prelude.Maybe [TagSpecification],
    -- | For devices that support BGP, the customer gateway\'s BGP ASN.
    --
    -- Default: 65000
    CreateCustomerGateway -> Int
bgpAsn :: Prelude.Int,
    -- | The type of VPN connection that this customer gateway supports
    -- (@ipsec.1@).
    CreateCustomerGateway -> GatewayType
type' :: GatewayType
  }
  deriving (CreateCustomerGateway -> CreateCustomerGateway -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCustomerGateway -> CreateCustomerGateway -> Bool
$c/= :: CreateCustomerGateway -> CreateCustomerGateway -> Bool
== :: CreateCustomerGateway -> CreateCustomerGateway -> Bool
$c== :: CreateCustomerGateway -> CreateCustomerGateway -> Bool
Prelude.Eq, ReadPrec [CreateCustomerGateway]
ReadPrec CreateCustomerGateway
Int -> ReadS CreateCustomerGateway
ReadS [CreateCustomerGateway]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCustomerGateway]
$creadListPrec :: ReadPrec [CreateCustomerGateway]
readPrec :: ReadPrec CreateCustomerGateway
$creadPrec :: ReadPrec CreateCustomerGateway
readList :: ReadS [CreateCustomerGateway]
$creadList :: ReadS [CreateCustomerGateway]
readsPrec :: Int -> ReadS CreateCustomerGateway
$creadsPrec :: Int -> ReadS CreateCustomerGateway
Prelude.Read, Int -> CreateCustomerGateway -> ShowS
[CreateCustomerGateway] -> ShowS
CreateCustomerGateway -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCustomerGateway] -> ShowS
$cshowList :: [CreateCustomerGateway] -> ShowS
show :: CreateCustomerGateway -> String
$cshow :: CreateCustomerGateway -> String
showsPrec :: Int -> CreateCustomerGateway -> ShowS
$cshowsPrec :: Int -> CreateCustomerGateway -> ShowS
Prelude.Show, forall x. Rep CreateCustomerGateway x -> CreateCustomerGateway
forall x. CreateCustomerGateway -> Rep CreateCustomerGateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCustomerGateway x -> CreateCustomerGateway
$cfrom :: forall x. CreateCustomerGateway -> Rep CreateCustomerGateway x
Prelude.Generic)

-- |
-- Create a value of 'CreateCustomerGateway' 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:
--
-- 'certificateArn', 'createCustomerGateway_certificateArn' - The Amazon Resource Name (ARN) for the customer gateway certificate.
--
-- 'deviceName', 'createCustomerGateway_deviceName' - A name for the customer gateway device.
--
-- Length Constraints: Up to 255 characters.
--
-- 'dryRun', 'createCustomerGateway_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@.
--
-- 'ipAddress', 'createCustomerGateway_ipAddress' - IPv4 address for the customer gateway device\'s outside interface. The
-- address must be static.
--
-- 'publicIp', 'createCustomerGateway_publicIp' - /This member has been deprecated./ The Internet-routable IP address for
-- the customer gateway\'s outside interface. The address must be static.
--
-- 'tagSpecifications', 'createCustomerGateway_tagSpecifications' - The tags to apply to the customer gateway.
--
-- 'bgpAsn', 'createCustomerGateway_bgpAsn' - For devices that support BGP, the customer gateway\'s BGP ASN.
--
-- Default: 65000
--
-- 'type'', 'createCustomerGateway_type' - The type of VPN connection that this customer gateway supports
-- (@ipsec.1@).
newCreateCustomerGateway ::
  -- | 'bgpAsn'
  Prelude.Int ->
  -- | 'type''
  GatewayType ->
  CreateCustomerGateway
newCreateCustomerGateway :: Int -> GatewayType -> CreateCustomerGateway
newCreateCustomerGateway Int
pBgpAsn_ GatewayType
pType_ =
  CreateCustomerGateway'
    { $sel:certificateArn:CreateCustomerGateway' :: Maybe Text
certificateArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:deviceName:CreateCustomerGateway' :: Maybe Text
deviceName = forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:CreateCustomerGateway' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddress:CreateCustomerGateway' :: Maybe Text
ipAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:publicIp:CreateCustomerGateway' :: Maybe Text
publicIp = forall a. Maybe a
Prelude.Nothing,
      $sel:tagSpecifications:CreateCustomerGateway' :: Maybe [TagSpecification]
tagSpecifications = forall a. Maybe a
Prelude.Nothing,
      $sel:bgpAsn:CreateCustomerGateway' :: Int
bgpAsn = Int
pBgpAsn_,
      $sel:type':CreateCustomerGateway' :: GatewayType
type' = GatewayType
pType_
    }

-- | The Amazon Resource Name (ARN) for the customer gateway certificate.
createCustomerGateway_certificateArn :: Lens.Lens' CreateCustomerGateway (Prelude.Maybe Prelude.Text)
createCustomerGateway_certificateArn :: Lens' CreateCustomerGateway (Maybe Text)
createCustomerGateway_certificateArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomerGateway' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: CreateCustomerGateway
s@CreateCustomerGateway' {} Maybe Text
a -> CreateCustomerGateway
s {$sel:certificateArn:CreateCustomerGateway' :: Maybe Text
certificateArn = Maybe Text
a} :: CreateCustomerGateway)

-- | A name for the customer gateway device.
--
-- Length Constraints: Up to 255 characters.
createCustomerGateway_deviceName :: Lens.Lens' CreateCustomerGateway (Prelude.Maybe Prelude.Text)
createCustomerGateway_deviceName :: Lens' CreateCustomerGateway (Maybe Text)
createCustomerGateway_deviceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomerGateway' {Maybe Text
deviceName :: Maybe Text
$sel:deviceName:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
deviceName} -> Maybe Text
deviceName) (\s :: CreateCustomerGateway
s@CreateCustomerGateway' {} Maybe Text
a -> CreateCustomerGateway
s {$sel:deviceName:CreateCustomerGateway' :: Maybe Text
deviceName = Maybe Text
a} :: CreateCustomerGateway)

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

-- | IPv4 address for the customer gateway device\'s outside interface. The
-- address must be static.
createCustomerGateway_ipAddress :: Lens.Lens' CreateCustomerGateway (Prelude.Maybe Prelude.Text)
createCustomerGateway_ipAddress :: Lens' CreateCustomerGateway (Maybe Text)
createCustomerGateway_ipAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomerGateway' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: CreateCustomerGateway
s@CreateCustomerGateway' {} Maybe Text
a -> CreateCustomerGateway
s {$sel:ipAddress:CreateCustomerGateway' :: Maybe Text
ipAddress = Maybe Text
a} :: CreateCustomerGateway)

-- | /This member has been deprecated./ The Internet-routable IP address for
-- the customer gateway\'s outside interface. The address must be static.
createCustomerGateway_publicIp :: Lens.Lens' CreateCustomerGateway (Prelude.Maybe Prelude.Text)
createCustomerGateway_publicIp :: Lens' CreateCustomerGateway (Maybe Text)
createCustomerGateway_publicIp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomerGateway' {Maybe Text
publicIp :: Maybe Text
$sel:publicIp:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
publicIp} -> Maybe Text
publicIp) (\s :: CreateCustomerGateway
s@CreateCustomerGateway' {} Maybe Text
a -> CreateCustomerGateway
s {$sel:publicIp:CreateCustomerGateway' :: Maybe Text
publicIp = Maybe Text
a} :: CreateCustomerGateway)

-- | The tags to apply to the customer gateway.
createCustomerGateway_tagSpecifications :: Lens.Lens' CreateCustomerGateway (Prelude.Maybe [TagSpecification])
createCustomerGateway_tagSpecifications :: Lens' CreateCustomerGateway (Maybe [TagSpecification])
createCustomerGateway_tagSpecifications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomerGateway' {Maybe [TagSpecification]
tagSpecifications :: Maybe [TagSpecification]
$sel:tagSpecifications:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe [TagSpecification]
tagSpecifications} -> Maybe [TagSpecification]
tagSpecifications) (\s :: CreateCustomerGateway
s@CreateCustomerGateway' {} Maybe [TagSpecification]
a -> CreateCustomerGateway
s {$sel:tagSpecifications:CreateCustomerGateway' :: Maybe [TagSpecification]
tagSpecifications = Maybe [TagSpecification]
a} :: CreateCustomerGateway) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | For devices that support BGP, the customer gateway\'s BGP ASN.
--
-- Default: 65000
createCustomerGateway_bgpAsn :: Lens.Lens' CreateCustomerGateway Prelude.Int
createCustomerGateway_bgpAsn :: Lens' CreateCustomerGateway Int
createCustomerGateway_bgpAsn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomerGateway' {Int
bgpAsn :: Int
$sel:bgpAsn:CreateCustomerGateway' :: CreateCustomerGateway -> Int
bgpAsn} -> Int
bgpAsn) (\s :: CreateCustomerGateway
s@CreateCustomerGateway' {} Int
a -> CreateCustomerGateway
s {$sel:bgpAsn:CreateCustomerGateway' :: Int
bgpAsn = Int
a} :: CreateCustomerGateway)

-- | The type of VPN connection that this customer gateway supports
-- (@ipsec.1@).
createCustomerGateway_type :: Lens.Lens' CreateCustomerGateway GatewayType
createCustomerGateway_type :: Lens' CreateCustomerGateway GatewayType
createCustomerGateway_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomerGateway' {GatewayType
type' :: GatewayType
$sel:type':CreateCustomerGateway' :: CreateCustomerGateway -> GatewayType
type'} -> GatewayType
type') (\s :: CreateCustomerGateway
s@CreateCustomerGateway' {} GatewayType
a -> CreateCustomerGateway
s {$sel:type':CreateCustomerGateway' :: GatewayType
type' = GatewayType
a} :: CreateCustomerGateway)

instance Core.AWSRequest CreateCustomerGateway where
  type
    AWSResponse CreateCustomerGateway =
      CreateCustomerGatewayResponse
  request :: (Service -> Service)
-> CreateCustomerGateway -> Request CreateCustomerGateway
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 CreateCustomerGateway
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCustomerGateway)))
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 CustomerGateway -> Int -> CreateCustomerGatewayResponse
CreateCustomerGatewayResponse'
            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
"customerGateway")
            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 CreateCustomerGateway where
  hashWithSalt :: Int -> CreateCustomerGateway -> Int
hashWithSalt Int
_salt CreateCustomerGateway' {Int
Maybe Bool
Maybe [TagSpecification]
Maybe Text
GatewayType
type' :: GatewayType
bgpAsn :: Int
tagSpecifications :: Maybe [TagSpecification]
publicIp :: Maybe Text
ipAddress :: Maybe Text
dryRun :: Maybe Bool
deviceName :: Maybe Text
certificateArn :: Maybe Text
$sel:type':CreateCustomerGateway' :: CreateCustomerGateway -> GatewayType
$sel:bgpAsn:CreateCustomerGateway' :: CreateCustomerGateway -> Int
$sel:tagSpecifications:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe [TagSpecification]
$sel:publicIp:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
$sel:ipAddress:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
$sel:dryRun:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Bool
$sel:deviceName:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
$sel:certificateArn:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
certificateArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
publicIp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TagSpecification]
tagSpecifications
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
bgpAsn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` GatewayType
type'

instance Prelude.NFData CreateCustomerGateway where
  rnf :: CreateCustomerGateway -> ()
rnf CreateCustomerGateway' {Int
Maybe Bool
Maybe [TagSpecification]
Maybe Text
GatewayType
type' :: GatewayType
bgpAsn :: Int
tagSpecifications :: Maybe [TagSpecification]
publicIp :: Maybe Text
ipAddress :: Maybe Text
dryRun :: Maybe Bool
deviceName :: Maybe Text
certificateArn :: Maybe Text
$sel:type':CreateCustomerGateway' :: CreateCustomerGateway -> GatewayType
$sel:bgpAsn:CreateCustomerGateway' :: CreateCustomerGateway -> Int
$sel:tagSpecifications:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe [TagSpecification]
$sel:publicIp:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
$sel:ipAddress:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
$sel:dryRun:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Bool
$sel:deviceName:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
$sel:certificateArn:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificateArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceName
      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 Maybe Text
ipAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
publicIp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagSpecification]
tagSpecifications
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
bgpAsn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf GatewayType
type'

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

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

instance Data.ToQuery CreateCustomerGateway where
  toQuery :: CreateCustomerGateway -> QueryString
toQuery CreateCustomerGateway' {Int
Maybe Bool
Maybe [TagSpecification]
Maybe Text
GatewayType
type' :: GatewayType
bgpAsn :: Int
tagSpecifications :: Maybe [TagSpecification]
publicIp :: Maybe Text
ipAddress :: Maybe Text
dryRun :: Maybe Bool
deviceName :: Maybe Text
certificateArn :: Maybe Text
$sel:type':CreateCustomerGateway' :: CreateCustomerGateway -> GatewayType
$sel:bgpAsn:CreateCustomerGateway' :: CreateCustomerGateway -> Int
$sel:tagSpecifications:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe [TagSpecification]
$sel:publicIp:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
$sel:ipAddress:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
$sel:dryRun:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Bool
$sel:deviceName:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
$sel:certificateArn:CreateCustomerGateway' :: CreateCustomerGateway -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateCustomerGateway" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"CertificateArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
certificateArn,
        ByteString
"DeviceName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
deviceName,
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"IpAddress" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
ipAddress,
        ByteString
"PublicIp" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
publicIp,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagSpecification"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagSpecification]
tagSpecifications
          ),
        ByteString
"BgpAsn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Int
bgpAsn,
        ByteString
"Type" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: GatewayType
type'
      ]

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

-- |
-- Create a value of 'CreateCustomerGatewayResponse' 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:
--
-- 'customerGateway', 'createCustomerGatewayResponse_customerGateway' - Information about the customer gateway.
--
-- 'httpStatus', 'createCustomerGatewayResponse_httpStatus' - The response's http status code.
newCreateCustomerGatewayResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCustomerGatewayResponse
newCreateCustomerGatewayResponse :: Int -> CreateCustomerGatewayResponse
newCreateCustomerGatewayResponse Int
pHttpStatus_ =
  CreateCustomerGatewayResponse'
    { $sel:customerGateway:CreateCustomerGatewayResponse' :: Maybe CustomerGateway
customerGateway =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateCustomerGatewayResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the customer gateway.
createCustomerGatewayResponse_customerGateway :: Lens.Lens' CreateCustomerGatewayResponse (Prelude.Maybe CustomerGateway)
createCustomerGatewayResponse_customerGateway :: Lens' CreateCustomerGatewayResponse (Maybe CustomerGateway)
createCustomerGatewayResponse_customerGateway = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCustomerGatewayResponse' {Maybe CustomerGateway
customerGateway :: Maybe CustomerGateway
$sel:customerGateway:CreateCustomerGatewayResponse' :: CreateCustomerGatewayResponse -> Maybe CustomerGateway
customerGateway} -> Maybe CustomerGateway
customerGateway) (\s :: CreateCustomerGatewayResponse
s@CreateCustomerGatewayResponse' {} Maybe CustomerGateway
a -> CreateCustomerGatewayResponse
s {$sel:customerGateway:CreateCustomerGatewayResponse' :: Maybe CustomerGateway
customerGateway = Maybe CustomerGateway
a} :: CreateCustomerGatewayResponse)

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

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