{-# 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.EC2.Types.NatGateway
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.NatGateway where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.ConnectivityType
import Amazonka.EC2.Types.NatGatewayAddress
import Amazonka.EC2.Types.NatGatewayState
import Amazonka.EC2.Types.ProvisionedBandwidth
import Amazonka.EC2.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Describes a NAT gateway.
--
-- /See:/ 'newNatGateway' smart constructor.
data NatGateway = NatGateway'
  { -- | Indicates whether the NAT gateway supports public or private
    -- connectivity.
    NatGateway -> Maybe ConnectivityType
connectivityType :: Prelude.Maybe ConnectivityType,
    -- | The date and time the NAT gateway was created.
    NatGateway -> Maybe ISO8601
createTime :: Prelude.Maybe Data.ISO8601,
    -- | The date and time the NAT gateway was deleted, if applicable.
    NatGateway -> Maybe ISO8601
deleteTime :: Prelude.Maybe Data.ISO8601,
    -- | If the NAT gateway could not be created, specifies the error code for
    -- the failure. (@InsufficientFreeAddressesInSubnet@ |
    -- @Gateway.NotAttached@ | @InvalidAllocationID.NotFound@ |
    -- @Resource.AlreadyAssociated@ | @InternalError@ |
    -- @InvalidSubnetID.NotFound@)
    NatGateway -> Maybe Text
failureCode :: Prelude.Maybe Prelude.Text,
    -- | If the NAT gateway could not be created, specifies the error message for
    -- the failure, that corresponds to the error code.
    --
    -- -   For InsufficientFreeAddressesInSubnet: \"Subnet has insufficient
    --     free addresses to create this NAT gateway\"
    --
    -- -   For Gateway.NotAttached: \"Network vpc-xxxxxxxx has no Internet
    --     gateway attached\"
    --
    -- -   For InvalidAllocationID.NotFound: \"Elastic IP address
    --     eipalloc-xxxxxxxx could not be associated with this NAT gateway\"
    --
    -- -   For Resource.AlreadyAssociated: \"Elastic IP address
    --     eipalloc-xxxxxxxx is already associated\"
    --
    -- -   For InternalError: \"Network interface eni-xxxxxxxx, created and
    --     used internally by this NAT gateway is in an invalid state. Please
    --     try again.\"
    --
    -- -   For InvalidSubnetID.NotFound: \"The specified subnet subnet-xxxxxxxx
    --     does not exist or could not be found.\"
    NatGateway -> Maybe Text
failureMessage :: Prelude.Maybe Prelude.Text,
    -- | Information about the IP addresses and network interface associated with
    -- the NAT gateway.
    NatGateway -> Maybe [NatGatewayAddress]
natGatewayAddresses :: Prelude.Maybe [NatGatewayAddress],
    -- | The ID of the NAT gateway.
    NatGateway -> Maybe Text
natGatewayId :: Prelude.Maybe Prelude.Text,
    -- | Reserved. If you need to sustain traffic greater than the
    -- <https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html documented limits>,
    -- contact us through the
    -- <https://console.aws.amazon.com/support/home? Support Center>.
    NatGateway -> Maybe ProvisionedBandwidth
provisionedBandwidth :: Prelude.Maybe ProvisionedBandwidth,
    -- | The state of the NAT gateway.
    --
    -- -   @pending@: The NAT gateway is being created and is not ready to
    --     process traffic.
    --
    -- -   @failed@: The NAT gateway could not be created. Check the
    --     @failureCode@ and @failureMessage@ fields for the reason.
    --
    -- -   @available@: The NAT gateway is able to process traffic. This status
    --     remains until you delete the NAT gateway, and does not indicate the
    --     health of the NAT gateway.
    --
    -- -   @deleting@: The NAT gateway is in the process of being terminated
    --     and may still be processing traffic.
    --
    -- -   @deleted@: The NAT gateway has been terminated and is no longer
    --     processing traffic.
    NatGateway -> Maybe NatGatewayState
state :: Prelude.Maybe NatGatewayState,
    -- | The ID of the subnet in which the NAT gateway is located.
    NatGateway -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
    -- | The tags for the NAT gateway.
    NatGateway -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The ID of the VPC in which the NAT gateway is located.
    NatGateway -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text
  }
  deriving (NatGateway -> NatGateway -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NatGateway -> NatGateway -> Bool
$c/= :: NatGateway -> NatGateway -> Bool
== :: NatGateway -> NatGateway -> Bool
$c== :: NatGateway -> NatGateway -> Bool
Prelude.Eq, ReadPrec [NatGateway]
ReadPrec NatGateway
Int -> ReadS NatGateway
ReadS [NatGateway]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NatGateway]
$creadListPrec :: ReadPrec [NatGateway]
readPrec :: ReadPrec NatGateway
$creadPrec :: ReadPrec NatGateway
readList :: ReadS [NatGateway]
$creadList :: ReadS [NatGateway]
readsPrec :: Int -> ReadS NatGateway
$creadsPrec :: Int -> ReadS NatGateway
Prelude.Read, Int -> NatGateway -> ShowS
[NatGateway] -> ShowS
NatGateway -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NatGateway] -> ShowS
$cshowList :: [NatGateway] -> ShowS
show :: NatGateway -> String
$cshow :: NatGateway -> String
showsPrec :: Int -> NatGateway -> ShowS
$cshowsPrec :: Int -> NatGateway -> ShowS
Prelude.Show, forall x. Rep NatGateway x -> NatGateway
forall x. NatGateway -> Rep NatGateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NatGateway x -> NatGateway
$cfrom :: forall x. NatGateway -> Rep NatGateway x
Prelude.Generic)

-- |
-- Create a value of 'NatGateway' 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:
--
-- 'connectivityType', 'natGateway_connectivityType' - Indicates whether the NAT gateway supports public or private
-- connectivity.
--
-- 'createTime', 'natGateway_createTime' - The date and time the NAT gateway was created.
--
-- 'deleteTime', 'natGateway_deleteTime' - The date and time the NAT gateway was deleted, if applicable.
--
-- 'failureCode', 'natGateway_failureCode' - If the NAT gateway could not be created, specifies the error code for
-- the failure. (@InsufficientFreeAddressesInSubnet@ |
-- @Gateway.NotAttached@ | @InvalidAllocationID.NotFound@ |
-- @Resource.AlreadyAssociated@ | @InternalError@ |
-- @InvalidSubnetID.NotFound@)
--
-- 'failureMessage', 'natGateway_failureMessage' - If the NAT gateway could not be created, specifies the error message for
-- the failure, that corresponds to the error code.
--
-- -   For InsufficientFreeAddressesInSubnet: \"Subnet has insufficient
--     free addresses to create this NAT gateway\"
--
-- -   For Gateway.NotAttached: \"Network vpc-xxxxxxxx has no Internet
--     gateway attached\"
--
-- -   For InvalidAllocationID.NotFound: \"Elastic IP address
--     eipalloc-xxxxxxxx could not be associated with this NAT gateway\"
--
-- -   For Resource.AlreadyAssociated: \"Elastic IP address
--     eipalloc-xxxxxxxx is already associated\"
--
-- -   For InternalError: \"Network interface eni-xxxxxxxx, created and
--     used internally by this NAT gateway is in an invalid state. Please
--     try again.\"
--
-- -   For InvalidSubnetID.NotFound: \"The specified subnet subnet-xxxxxxxx
--     does not exist or could not be found.\"
--
-- 'natGatewayAddresses', 'natGateway_natGatewayAddresses' - Information about the IP addresses and network interface associated with
-- the NAT gateway.
--
-- 'natGatewayId', 'natGateway_natGatewayId' - The ID of the NAT gateway.
--
-- 'provisionedBandwidth', 'natGateway_provisionedBandwidth' - Reserved. If you need to sustain traffic greater than the
-- <https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html documented limits>,
-- contact us through the
-- <https://console.aws.amazon.com/support/home? Support Center>.
--
-- 'state', 'natGateway_state' - The state of the NAT gateway.
--
-- -   @pending@: The NAT gateway is being created and is not ready to
--     process traffic.
--
-- -   @failed@: The NAT gateway could not be created. Check the
--     @failureCode@ and @failureMessage@ fields for the reason.
--
-- -   @available@: The NAT gateway is able to process traffic. This status
--     remains until you delete the NAT gateway, and does not indicate the
--     health of the NAT gateway.
--
-- -   @deleting@: The NAT gateway is in the process of being terminated
--     and may still be processing traffic.
--
-- -   @deleted@: The NAT gateway has been terminated and is no longer
--     processing traffic.
--
-- 'subnetId', 'natGateway_subnetId' - The ID of the subnet in which the NAT gateway is located.
--
-- 'tags', 'natGateway_tags' - The tags for the NAT gateway.
--
-- 'vpcId', 'natGateway_vpcId' - The ID of the VPC in which the NAT gateway is located.
newNatGateway ::
  NatGateway
newNatGateway :: NatGateway
newNatGateway =
  NatGateway'
    { $sel:connectivityType:NatGateway' :: Maybe ConnectivityType
connectivityType = forall a. Maybe a
Prelude.Nothing,
      $sel:createTime:NatGateway' :: Maybe ISO8601
createTime = forall a. Maybe a
Prelude.Nothing,
      $sel:deleteTime:NatGateway' :: Maybe ISO8601
deleteTime = forall a. Maybe a
Prelude.Nothing,
      $sel:failureCode:NatGateway' :: Maybe Text
failureCode = forall a. Maybe a
Prelude.Nothing,
      $sel:failureMessage:NatGateway' :: Maybe Text
failureMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:natGatewayAddresses:NatGateway' :: Maybe [NatGatewayAddress]
natGatewayAddresses = forall a. Maybe a
Prelude.Nothing,
      $sel:natGatewayId:NatGateway' :: Maybe Text
natGatewayId = forall a. Maybe a
Prelude.Nothing,
      $sel:provisionedBandwidth:NatGateway' :: Maybe ProvisionedBandwidth
provisionedBandwidth = forall a. Maybe a
Prelude.Nothing,
      $sel:state:NatGateway' :: Maybe NatGatewayState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:subnetId:NatGateway' :: Maybe Text
subnetId = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:NatGateway' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:NatGateway' :: Maybe Text
vpcId = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether the NAT gateway supports public or private
-- connectivity.
natGateway_connectivityType :: Lens.Lens' NatGateway (Prelude.Maybe ConnectivityType)
natGateway_connectivityType :: Lens' NatGateway (Maybe ConnectivityType)
natGateway_connectivityType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NatGateway' {Maybe ConnectivityType
connectivityType :: Maybe ConnectivityType
$sel:connectivityType:NatGateway' :: NatGateway -> Maybe ConnectivityType
connectivityType} -> Maybe ConnectivityType
connectivityType) (\s :: NatGateway
s@NatGateway' {} Maybe ConnectivityType
a -> NatGateway
s {$sel:connectivityType:NatGateway' :: Maybe ConnectivityType
connectivityType = Maybe ConnectivityType
a} :: NatGateway)

-- | The date and time the NAT gateway was created.
natGateway_createTime :: Lens.Lens' NatGateway (Prelude.Maybe Prelude.UTCTime)
natGateway_createTime :: Lens' NatGateway (Maybe UTCTime)
natGateway_createTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NatGateway' {Maybe ISO8601
createTime :: Maybe ISO8601
$sel:createTime:NatGateway' :: NatGateway -> Maybe ISO8601
createTime} -> Maybe ISO8601
createTime) (\s :: NatGateway
s@NatGateway' {} Maybe ISO8601
a -> NatGateway
s {$sel:createTime:NatGateway' :: Maybe ISO8601
createTime = Maybe ISO8601
a} :: NatGateway) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The date and time the NAT gateway was deleted, if applicable.
natGateway_deleteTime :: Lens.Lens' NatGateway (Prelude.Maybe Prelude.UTCTime)
natGateway_deleteTime :: Lens' NatGateway (Maybe UTCTime)
natGateway_deleteTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NatGateway' {Maybe ISO8601
deleteTime :: Maybe ISO8601
$sel:deleteTime:NatGateway' :: NatGateway -> Maybe ISO8601
deleteTime} -> Maybe ISO8601
deleteTime) (\s :: NatGateway
s@NatGateway' {} Maybe ISO8601
a -> NatGateway
s {$sel:deleteTime:NatGateway' :: Maybe ISO8601
deleteTime = Maybe ISO8601
a} :: NatGateway) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | If the NAT gateway could not be created, specifies the error code for
-- the failure. (@InsufficientFreeAddressesInSubnet@ |
-- @Gateway.NotAttached@ | @InvalidAllocationID.NotFound@ |
-- @Resource.AlreadyAssociated@ | @InternalError@ |
-- @InvalidSubnetID.NotFound@)
natGateway_failureCode :: Lens.Lens' NatGateway (Prelude.Maybe Prelude.Text)
natGateway_failureCode :: Lens' NatGateway (Maybe Text)
natGateway_failureCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NatGateway' {Maybe Text
failureCode :: Maybe Text
$sel:failureCode:NatGateway' :: NatGateway -> Maybe Text
failureCode} -> Maybe Text
failureCode) (\s :: NatGateway
s@NatGateway' {} Maybe Text
a -> NatGateway
s {$sel:failureCode:NatGateway' :: Maybe Text
failureCode = Maybe Text
a} :: NatGateway)

-- | If the NAT gateway could not be created, specifies the error message for
-- the failure, that corresponds to the error code.
--
-- -   For InsufficientFreeAddressesInSubnet: \"Subnet has insufficient
--     free addresses to create this NAT gateway\"
--
-- -   For Gateway.NotAttached: \"Network vpc-xxxxxxxx has no Internet
--     gateway attached\"
--
-- -   For InvalidAllocationID.NotFound: \"Elastic IP address
--     eipalloc-xxxxxxxx could not be associated with this NAT gateway\"
--
-- -   For Resource.AlreadyAssociated: \"Elastic IP address
--     eipalloc-xxxxxxxx is already associated\"
--
-- -   For InternalError: \"Network interface eni-xxxxxxxx, created and
--     used internally by this NAT gateway is in an invalid state. Please
--     try again.\"
--
-- -   For InvalidSubnetID.NotFound: \"The specified subnet subnet-xxxxxxxx
--     does not exist or could not be found.\"
natGateway_failureMessage :: Lens.Lens' NatGateway (Prelude.Maybe Prelude.Text)
natGateway_failureMessage :: Lens' NatGateway (Maybe Text)
natGateway_failureMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NatGateway' {Maybe Text
failureMessage :: Maybe Text
$sel:failureMessage:NatGateway' :: NatGateway -> Maybe Text
failureMessage} -> Maybe Text
failureMessage) (\s :: NatGateway
s@NatGateway' {} Maybe Text
a -> NatGateway
s {$sel:failureMessage:NatGateway' :: Maybe Text
failureMessage = Maybe Text
a} :: NatGateway)

-- | Information about the IP addresses and network interface associated with
-- the NAT gateway.
natGateway_natGatewayAddresses :: Lens.Lens' NatGateway (Prelude.Maybe [NatGatewayAddress])
natGateway_natGatewayAddresses :: Lens' NatGateway (Maybe [NatGatewayAddress])
natGateway_natGatewayAddresses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NatGateway' {Maybe [NatGatewayAddress]
natGatewayAddresses :: Maybe [NatGatewayAddress]
$sel:natGatewayAddresses:NatGateway' :: NatGateway -> Maybe [NatGatewayAddress]
natGatewayAddresses} -> Maybe [NatGatewayAddress]
natGatewayAddresses) (\s :: NatGateway
s@NatGateway' {} Maybe [NatGatewayAddress]
a -> NatGateway
s {$sel:natGatewayAddresses:NatGateway' :: Maybe [NatGatewayAddress]
natGatewayAddresses = Maybe [NatGatewayAddress]
a} :: NatGateway) 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

-- | The ID of the NAT gateway.
natGateway_natGatewayId :: Lens.Lens' NatGateway (Prelude.Maybe Prelude.Text)
natGateway_natGatewayId :: Lens' NatGateway (Maybe Text)
natGateway_natGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NatGateway' {Maybe Text
natGatewayId :: Maybe Text
$sel:natGatewayId:NatGateway' :: NatGateway -> Maybe Text
natGatewayId} -> Maybe Text
natGatewayId) (\s :: NatGateway
s@NatGateway' {} Maybe Text
a -> NatGateway
s {$sel:natGatewayId:NatGateway' :: Maybe Text
natGatewayId = Maybe Text
a} :: NatGateway)

-- | Reserved. If you need to sustain traffic greater than the
-- <https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html documented limits>,
-- contact us through the
-- <https://console.aws.amazon.com/support/home? Support Center>.
natGateway_provisionedBandwidth :: Lens.Lens' NatGateway (Prelude.Maybe ProvisionedBandwidth)
natGateway_provisionedBandwidth :: Lens' NatGateway (Maybe ProvisionedBandwidth)
natGateway_provisionedBandwidth = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NatGateway' {Maybe ProvisionedBandwidth
provisionedBandwidth :: Maybe ProvisionedBandwidth
$sel:provisionedBandwidth:NatGateway' :: NatGateway -> Maybe ProvisionedBandwidth
provisionedBandwidth} -> Maybe ProvisionedBandwidth
provisionedBandwidth) (\s :: NatGateway
s@NatGateway' {} Maybe ProvisionedBandwidth
a -> NatGateway
s {$sel:provisionedBandwidth:NatGateway' :: Maybe ProvisionedBandwidth
provisionedBandwidth = Maybe ProvisionedBandwidth
a} :: NatGateway)

-- | The state of the NAT gateway.
--
-- -   @pending@: The NAT gateway is being created and is not ready to
--     process traffic.
--
-- -   @failed@: The NAT gateway could not be created. Check the
--     @failureCode@ and @failureMessage@ fields for the reason.
--
-- -   @available@: The NAT gateway is able to process traffic. This status
--     remains until you delete the NAT gateway, and does not indicate the
--     health of the NAT gateway.
--
-- -   @deleting@: The NAT gateway is in the process of being terminated
--     and may still be processing traffic.
--
-- -   @deleted@: The NAT gateway has been terminated and is no longer
--     processing traffic.
natGateway_state :: Lens.Lens' NatGateway (Prelude.Maybe NatGatewayState)
natGateway_state :: Lens' NatGateway (Maybe NatGatewayState)
natGateway_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NatGateway' {Maybe NatGatewayState
state :: Maybe NatGatewayState
$sel:state:NatGateway' :: NatGateway -> Maybe NatGatewayState
state} -> Maybe NatGatewayState
state) (\s :: NatGateway
s@NatGateway' {} Maybe NatGatewayState
a -> NatGateway
s {$sel:state:NatGateway' :: Maybe NatGatewayState
state = Maybe NatGatewayState
a} :: NatGateway)

-- | The ID of the subnet in which the NAT gateway is located.
natGateway_subnetId :: Lens.Lens' NatGateway (Prelude.Maybe Prelude.Text)
natGateway_subnetId :: Lens' NatGateway (Maybe Text)
natGateway_subnetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NatGateway' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:NatGateway' :: NatGateway -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: NatGateway
s@NatGateway' {} Maybe Text
a -> NatGateway
s {$sel:subnetId:NatGateway' :: Maybe Text
subnetId = Maybe Text
a} :: NatGateway)

-- | The tags for the NAT gateway.
natGateway_tags :: Lens.Lens' NatGateway (Prelude.Maybe [Tag])
natGateway_tags :: Lens' NatGateway (Maybe [Tag])
natGateway_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NatGateway' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:NatGateway' :: NatGateway -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: NatGateway
s@NatGateway' {} Maybe [Tag]
a -> NatGateway
s {$sel:tags:NatGateway' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: NatGateway) 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

-- | The ID of the VPC in which the NAT gateway is located.
natGateway_vpcId :: Lens.Lens' NatGateway (Prelude.Maybe Prelude.Text)
natGateway_vpcId :: Lens' NatGateway (Maybe Text)
natGateway_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NatGateway' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:NatGateway' :: NatGateway -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: NatGateway
s@NatGateway' {} Maybe Text
a -> NatGateway
s {$sel:vpcId:NatGateway' :: Maybe Text
vpcId = Maybe Text
a} :: NatGateway)

instance Data.FromXML NatGateway where
  parseXML :: [Node] -> Either String NatGateway
parseXML [Node]
x =
    Maybe ConnectivityType
-> Maybe ISO8601
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe [NatGatewayAddress]
-> Maybe Text
-> Maybe ProvisionedBandwidth
-> Maybe NatGatewayState
-> Maybe Text
-> Maybe [Tag]
-> Maybe Text
-> NatGateway
NatGateway'
      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
"connectivityType")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"createTime")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"deleteTime")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"failureCode")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"failureMessage")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"natGatewayAddressSet"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"natGatewayId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"provisionedBandwidth")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"state")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"subnetId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"tagSet"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"vpcId")

instance Prelude.Hashable NatGateway where
  hashWithSalt :: Int -> NatGateway -> Int
hashWithSalt Int
_salt NatGateway' {Maybe [NatGatewayAddress]
Maybe [Tag]
Maybe Text
Maybe ISO8601
Maybe ConnectivityType
Maybe NatGatewayState
Maybe ProvisionedBandwidth
vpcId :: Maybe Text
tags :: Maybe [Tag]
subnetId :: Maybe Text
state :: Maybe NatGatewayState
provisionedBandwidth :: Maybe ProvisionedBandwidth
natGatewayId :: Maybe Text
natGatewayAddresses :: Maybe [NatGatewayAddress]
failureMessage :: Maybe Text
failureCode :: Maybe Text
deleteTime :: Maybe ISO8601
createTime :: Maybe ISO8601
connectivityType :: Maybe ConnectivityType
$sel:vpcId:NatGateway' :: NatGateway -> Maybe Text
$sel:tags:NatGateway' :: NatGateway -> Maybe [Tag]
$sel:subnetId:NatGateway' :: NatGateway -> Maybe Text
$sel:state:NatGateway' :: NatGateway -> Maybe NatGatewayState
$sel:provisionedBandwidth:NatGateway' :: NatGateway -> Maybe ProvisionedBandwidth
$sel:natGatewayId:NatGateway' :: NatGateway -> Maybe Text
$sel:natGatewayAddresses:NatGateway' :: NatGateway -> Maybe [NatGatewayAddress]
$sel:failureMessage:NatGateway' :: NatGateway -> Maybe Text
$sel:failureCode:NatGateway' :: NatGateway -> Maybe Text
$sel:deleteTime:NatGateway' :: NatGateway -> Maybe ISO8601
$sel:createTime:NatGateway' :: NatGateway -> Maybe ISO8601
$sel:connectivityType:NatGateway' :: NatGateway -> Maybe ConnectivityType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConnectivityType
connectivityType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
deleteTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
failureCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
failureMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [NatGatewayAddress]
natGatewayAddresses
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
natGatewayId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProvisionedBandwidth
provisionedBandwidth
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NatGatewayState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subnetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcId

instance Prelude.NFData NatGateway where
  rnf :: NatGateway -> ()
rnf NatGateway' {Maybe [NatGatewayAddress]
Maybe [Tag]
Maybe Text
Maybe ISO8601
Maybe ConnectivityType
Maybe NatGatewayState
Maybe ProvisionedBandwidth
vpcId :: Maybe Text
tags :: Maybe [Tag]
subnetId :: Maybe Text
state :: Maybe NatGatewayState
provisionedBandwidth :: Maybe ProvisionedBandwidth
natGatewayId :: Maybe Text
natGatewayAddresses :: Maybe [NatGatewayAddress]
failureMessage :: Maybe Text
failureCode :: Maybe Text
deleteTime :: Maybe ISO8601
createTime :: Maybe ISO8601
connectivityType :: Maybe ConnectivityType
$sel:vpcId:NatGateway' :: NatGateway -> Maybe Text
$sel:tags:NatGateway' :: NatGateway -> Maybe [Tag]
$sel:subnetId:NatGateway' :: NatGateway -> Maybe Text
$sel:state:NatGateway' :: NatGateway -> Maybe NatGatewayState
$sel:provisionedBandwidth:NatGateway' :: NatGateway -> Maybe ProvisionedBandwidth
$sel:natGatewayId:NatGateway' :: NatGateway -> Maybe Text
$sel:natGatewayAddresses:NatGateway' :: NatGateway -> Maybe [NatGatewayAddress]
$sel:failureMessage:NatGateway' :: NatGateway -> Maybe Text
$sel:failureCode:NatGateway' :: NatGateway -> Maybe Text
$sel:deleteTime:NatGateway' :: NatGateway -> Maybe ISO8601
$sel:createTime:NatGateway' :: NatGateway -> Maybe ISO8601
$sel:connectivityType:NatGateway' :: NatGateway -> Maybe ConnectivityType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ConnectivityType
connectivityType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
createTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
deleteTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
failureCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
failureMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [NatGatewayAddress]
natGatewayAddresses
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
natGatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProvisionedBandwidth
provisionedBandwidth
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NatGatewayState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subnetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcId