{-# 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.Route53Resolver.Types.ResolverEndpoint
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53Resolver.Types.ResolverEndpoint where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53Resolver.Types.ResolverEndpointDirection
import Amazonka.Route53Resolver.Types.ResolverEndpointStatus

-- | In the response to a
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_CreateResolverEndpoint.html CreateResolverEndpoint>,
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_DeleteResolverEndpoint.html DeleteResolverEndpoint>,
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_GetResolverEndpoint.html GetResolverEndpoint>,
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_ListResolverEndpoints.html ListResolverEndpoints>,
-- or
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_UpdateResolverEndpoint.html UpdateResolverEndpoint>
-- request, a complex type that contains settings for an existing inbound
-- or outbound Resolver endpoint.
--
-- /See:/ 'newResolverEndpoint' smart constructor.
data ResolverEndpoint = ResolverEndpoint'
  { -- | The date and time that the endpoint was created, in Unix time format and
    -- Coordinated Universal Time (UTC).
    ResolverEndpoint -> Maybe Text
creationTime :: Prelude.Maybe Prelude.Text,
    -- | A code that specifies the current status of the Resolver endpoint. Valid
    -- values include the following:
    --
    -- -   @CREATING@: Resolver is creating and configuring one or more Amazon
    --     VPC network interfaces for this endpoint.
    --
    -- -   @OPERATIONAL@: The Amazon VPC network interfaces for this endpoint
    --     are correctly configured and able to pass inbound or outbound DNS
    --     queries between your network and Resolver.
    --
    -- -   @UPDATING@: Resolver is associating or disassociating one or more
    --     network interfaces with this endpoint.
    --
    -- -   @AUTO_RECOVERING@: Resolver is trying to recover one or more of the
    --     network interfaces that are associated with this endpoint. During
    --     the recovery process, the endpoint functions with limited capacity
    --     because of the limit on the number of DNS queries per IP address
    --     (per network interface). For the current limit, see
    --     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-entities-resolver Limits on Route 53 Resolver>.
    --
    -- -   @ACTION_NEEDED@: This endpoint is unhealthy, and Resolver can\'t
    --     automatically recover it. To resolve the problem, we recommend that
    --     you check each IP address that you associated with the endpoint. For
    --     each IP address that isn\'t available, add another IP address and
    --     then delete the IP address that isn\'t available. (An endpoint must
    --     always include at least two IP addresses.) A status of
    --     @ACTION_NEEDED@ can have a variety of causes. Here are two common
    --     causes:
    --
    --     -   One or more of the network interfaces that are associated with
    --         the endpoint were deleted using Amazon VPC.
    --
    --     -   The network interface couldn\'t be created for some reason
    --         that\'s outside the control of Resolver.
    --
    -- -   @DELETING@: Resolver is deleting this endpoint and the associated
    --     network interfaces.
    ResolverEndpoint -> Maybe ResolverEndpointStatus
status :: Prelude.Maybe ResolverEndpointStatus,
    -- | The ID of one or more security groups that control access to this VPC.
    -- The security group must include one or more inbound rules (for inbound
    -- endpoints) or outbound rules (for outbound endpoints). Inbound and
    -- outbound rules must allow TCP and UDP access. For inbound access, open
    -- port 53. For outbound access, open the port that you\'re using for DNS
    -- queries on your network.
    ResolverEndpoint -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | Indicates whether the Resolver endpoint allows inbound or outbound DNS
    -- queries:
    --
    -- -   @INBOUND@: allows DNS queries to your VPC from your network
    --
    -- -   @OUTBOUND@: allows DNS queries from your VPC to your network
    ResolverEndpoint -> Maybe ResolverEndpointDirection
direction :: Prelude.Maybe ResolverEndpointDirection,
    -- | The ARN (Amazon Resource Name) for the Resolver endpoint.
    ResolverEndpoint -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | A unique string that identifies the request that created the Resolver
    -- endpoint. The @CreatorRequestId@ allows failed requests to be retried
    -- without the risk of running the operation twice.
    ResolverEndpoint -> Maybe Text
creatorRequestId :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the endpoint was last modified, in Unix time
    -- format and Coordinated Universal Time (UTC).
    ResolverEndpoint -> Maybe Text
modificationTime :: Prelude.Maybe Prelude.Text,
    -- | The number of IP addresses that the Resolver endpoint can use for DNS
    -- queries.
    ResolverEndpoint -> Maybe Int
ipAddressCount :: Prelude.Maybe Prelude.Int,
    -- | A detailed description of the status of the Resolver endpoint.
    ResolverEndpoint -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | The name that you assigned to the Resolver endpoint when you submitted a
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_CreateResolverEndpoint.html CreateResolverEndpoint>
    -- request.
    ResolverEndpoint -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Resolver endpoint.
    ResolverEndpoint -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The ID of the VPC that you want to create the Resolver endpoint in.
    ResolverEndpoint -> Maybe Text
hostVPCId :: Prelude.Maybe Prelude.Text
  }
  deriving (ResolverEndpoint -> ResolverEndpoint -> Bool
(ResolverEndpoint -> ResolverEndpoint -> Bool)
-> (ResolverEndpoint -> ResolverEndpoint -> Bool)
-> Eq ResolverEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResolverEndpoint -> ResolverEndpoint -> Bool
$c/= :: ResolverEndpoint -> ResolverEndpoint -> Bool
== :: ResolverEndpoint -> ResolverEndpoint -> Bool
$c== :: ResolverEndpoint -> ResolverEndpoint -> Bool
Prelude.Eq, ReadPrec [ResolverEndpoint]
ReadPrec ResolverEndpoint
Int -> ReadS ResolverEndpoint
ReadS [ResolverEndpoint]
(Int -> ReadS ResolverEndpoint)
-> ReadS [ResolverEndpoint]
-> ReadPrec ResolverEndpoint
-> ReadPrec [ResolverEndpoint]
-> Read ResolverEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResolverEndpoint]
$creadListPrec :: ReadPrec [ResolverEndpoint]
readPrec :: ReadPrec ResolverEndpoint
$creadPrec :: ReadPrec ResolverEndpoint
readList :: ReadS [ResolverEndpoint]
$creadList :: ReadS [ResolverEndpoint]
readsPrec :: Int -> ReadS ResolverEndpoint
$creadsPrec :: Int -> ReadS ResolverEndpoint
Prelude.Read, Int -> ResolverEndpoint -> ShowS
[ResolverEndpoint] -> ShowS
ResolverEndpoint -> String
(Int -> ResolverEndpoint -> ShowS)
-> (ResolverEndpoint -> String)
-> ([ResolverEndpoint] -> ShowS)
-> Show ResolverEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResolverEndpoint] -> ShowS
$cshowList :: [ResolverEndpoint] -> ShowS
show :: ResolverEndpoint -> String
$cshow :: ResolverEndpoint -> String
showsPrec :: Int -> ResolverEndpoint -> ShowS
$cshowsPrec :: Int -> ResolverEndpoint -> ShowS
Prelude.Show, (forall x. ResolverEndpoint -> Rep ResolverEndpoint x)
-> (forall x. Rep ResolverEndpoint x -> ResolverEndpoint)
-> Generic ResolverEndpoint
forall x. Rep ResolverEndpoint x -> ResolverEndpoint
forall x. ResolverEndpoint -> Rep ResolverEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResolverEndpoint x -> ResolverEndpoint
$cfrom :: forall x. ResolverEndpoint -> Rep ResolverEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'ResolverEndpoint' 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:
--
-- 'creationTime', 'resolverEndpoint_creationTime' - The date and time that the endpoint was created, in Unix time format and
-- Coordinated Universal Time (UTC).
--
-- 'status', 'resolverEndpoint_status' - A code that specifies the current status of the Resolver endpoint. Valid
-- values include the following:
--
-- -   @CREATING@: Resolver is creating and configuring one or more Amazon
--     VPC network interfaces for this endpoint.
--
-- -   @OPERATIONAL@: The Amazon VPC network interfaces for this endpoint
--     are correctly configured and able to pass inbound or outbound DNS
--     queries between your network and Resolver.
--
-- -   @UPDATING@: Resolver is associating or disassociating one or more
--     network interfaces with this endpoint.
--
-- -   @AUTO_RECOVERING@: Resolver is trying to recover one or more of the
--     network interfaces that are associated with this endpoint. During
--     the recovery process, the endpoint functions with limited capacity
--     because of the limit on the number of DNS queries per IP address
--     (per network interface). For the current limit, see
--     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-entities-resolver Limits on Route 53 Resolver>.
--
-- -   @ACTION_NEEDED@: This endpoint is unhealthy, and Resolver can\'t
--     automatically recover it. To resolve the problem, we recommend that
--     you check each IP address that you associated with the endpoint. For
--     each IP address that isn\'t available, add another IP address and
--     then delete the IP address that isn\'t available. (An endpoint must
--     always include at least two IP addresses.) A status of
--     @ACTION_NEEDED@ can have a variety of causes. Here are two common
--     causes:
--
--     -   One or more of the network interfaces that are associated with
--         the endpoint were deleted using Amazon VPC.
--
--     -   The network interface couldn\'t be created for some reason
--         that\'s outside the control of Resolver.
--
-- -   @DELETING@: Resolver is deleting this endpoint and the associated
--     network interfaces.
--
-- 'securityGroupIds', 'resolverEndpoint_securityGroupIds' - The ID of one or more security groups that control access to this VPC.
-- The security group must include one or more inbound rules (for inbound
-- endpoints) or outbound rules (for outbound endpoints). Inbound and
-- outbound rules must allow TCP and UDP access. For inbound access, open
-- port 53. For outbound access, open the port that you\'re using for DNS
-- queries on your network.
--
-- 'direction', 'resolverEndpoint_direction' - Indicates whether the Resolver endpoint allows inbound or outbound DNS
-- queries:
--
-- -   @INBOUND@: allows DNS queries to your VPC from your network
--
-- -   @OUTBOUND@: allows DNS queries from your VPC to your network
--
-- 'arn', 'resolverEndpoint_arn' - The ARN (Amazon Resource Name) for the Resolver endpoint.
--
-- 'creatorRequestId', 'resolverEndpoint_creatorRequestId' - A unique string that identifies the request that created the Resolver
-- endpoint. The @CreatorRequestId@ allows failed requests to be retried
-- without the risk of running the operation twice.
--
-- 'modificationTime', 'resolverEndpoint_modificationTime' - The date and time that the endpoint was last modified, in Unix time
-- format and Coordinated Universal Time (UTC).
--
-- 'ipAddressCount', 'resolverEndpoint_ipAddressCount' - The number of IP addresses that the Resolver endpoint can use for DNS
-- queries.
--
-- 'statusMessage', 'resolverEndpoint_statusMessage' - A detailed description of the status of the Resolver endpoint.
--
-- 'name', 'resolverEndpoint_name' - The name that you assigned to the Resolver endpoint when you submitted a
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_CreateResolverEndpoint.html CreateResolverEndpoint>
-- request.
--
-- 'id', 'resolverEndpoint_id' - The ID of the Resolver endpoint.
--
-- 'hostVPCId', 'resolverEndpoint_hostVPCId' - The ID of the VPC that you want to create the Resolver endpoint in.
newResolverEndpoint ::
  ResolverEndpoint
newResolverEndpoint :: ResolverEndpoint
newResolverEndpoint =
  ResolverEndpoint' :: Maybe Text
-> Maybe ResolverEndpointStatus
-> Maybe [Text]
-> Maybe ResolverEndpointDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ResolverEndpoint
ResolverEndpoint'
    { $sel:creationTime:ResolverEndpoint' :: Maybe Text
creationTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ResolverEndpoint' :: Maybe ResolverEndpointStatus
status = Maybe ResolverEndpointStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroupIds:ResolverEndpoint' :: Maybe [Text]
securityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:direction:ResolverEndpoint' :: Maybe ResolverEndpointDirection
direction = Maybe ResolverEndpointDirection
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ResolverEndpoint' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creatorRequestId:ResolverEndpoint' :: Maybe Text
creatorRequestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:modificationTime:ResolverEndpoint' :: Maybe Text
modificationTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddressCount:ResolverEndpoint' :: Maybe Int
ipAddressCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:ResolverEndpoint' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ResolverEndpoint' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ResolverEndpoint' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hostVPCId:ResolverEndpoint' :: Maybe Text
hostVPCId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time that the endpoint was created, in Unix time format and
-- Coordinated Universal Time (UTC).
resolverEndpoint_creationTime :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_creationTime :: (Maybe Text -> f (Maybe Text))
-> ResolverEndpoint -> f ResolverEndpoint
resolverEndpoint_creationTime = (ResolverEndpoint -> Maybe Text)
-> (ResolverEndpoint -> Maybe Text -> ResolverEndpoint)
-> Lens ResolverEndpoint ResolverEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
creationTime :: Maybe Text
$sel:creationTime:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
creationTime} -> Maybe Text
creationTime) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:creationTime:ResolverEndpoint' :: Maybe Text
creationTime = Maybe Text
a} :: ResolverEndpoint)

-- | A code that specifies the current status of the Resolver endpoint. Valid
-- values include the following:
--
-- -   @CREATING@: Resolver is creating and configuring one or more Amazon
--     VPC network interfaces for this endpoint.
--
-- -   @OPERATIONAL@: The Amazon VPC network interfaces for this endpoint
--     are correctly configured and able to pass inbound or outbound DNS
--     queries between your network and Resolver.
--
-- -   @UPDATING@: Resolver is associating or disassociating one or more
--     network interfaces with this endpoint.
--
-- -   @AUTO_RECOVERING@: Resolver is trying to recover one or more of the
--     network interfaces that are associated with this endpoint. During
--     the recovery process, the endpoint functions with limited capacity
--     because of the limit on the number of DNS queries per IP address
--     (per network interface). For the current limit, see
--     <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-entities-resolver Limits on Route 53 Resolver>.
--
-- -   @ACTION_NEEDED@: This endpoint is unhealthy, and Resolver can\'t
--     automatically recover it. To resolve the problem, we recommend that
--     you check each IP address that you associated with the endpoint. For
--     each IP address that isn\'t available, add another IP address and
--     then delete the IP address that isn\'t available. (An endpoint must
--     always include at least two IP addresses.) A status of
--     @ACTION_NEEDED@ can have a variety of causes. Here are two common
--     causes:
--
--     -   One or more of the network interfaces that are associated with
--         the endpoint were deleted using Amazon VPC.
--
--     -   The network interface couldn\'t be created for some reason
--         that\'s outside the control of Resolver.
--
-- -   @DELETING@: Resolver is deleting this endpoint and the associated
--     network interfaces.
resolverEndpoint_status :: Lens.Lens' ResolverEndpoint (Prelude.Maybe ResolverEndpointStatus)
resolverEndpoint_status :: (Maybe ResolverEndpointStatus -> f (Maybe ResolverEndpointStatus))
-> ResolverEndpoint -> f ResolverEndpoint
resolverEndpoint_status = (ResolverEndpoint -> Maybe ResolverEndpointStatus)
-> (ResolverEndpoint
    -> Maybe ResolverEndpointStatus -> ResolverEndpoint)
-> Lens
     ResolverEndpoint
     ResolverEndpoint
     (Maybe ResolverEndpointStatus)
     (Maybe ResolverEndpointStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe ResolverEndpointStatus
status :: Maybe ResolverEndpointStatus
$sel:status:ResolverEndpoint' :: ResolverEndpoint -> Maybe ResolverEndpointStatus
status} -> Maybe ResolverEndpointStatus
status) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe ResolverEndpointStatus
a -> ResolverEndpoint
s {$sel:status:ResolverEndpoint' :: Maybe ResolverEndpointStatus
status = Maybe ResolverEndpointStatus
a} :: ResolverEndpoint)

-- | The ID of one or more security groups that control access to this VPC.
-- The security group must include one or more inbound rules (for inbound
-- endpoints) or outbound rules (for outbound endpoints). Inbound and
-- outbound rules must allow TCP and UDP access. For inbound access, open
-- port 53. For outbound access, open the port that you\'re using for DNS
-- queries on your network.
resolverEndpoint_securityGroupIds :: Lens.Lens' ResolverEndpoint (Prelude.Maybe [Prelude.Text])
resolverEndpoint_securityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> ResolverEndpoint -> f ResolverEndpoint
resolverEndpoint_securityGroupIds = (ResolverEndpoint -> Maybe [Text])
-> (ResolverEndpoint -> Maybe [Text] -> ResolverEndpoint)
-> Lens
     ResolverEndpoint ResolverEndpoint (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:ResolverEndpoint' :: ResolverEndpoint -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe [Text]
a -> ResolverEndpoint
s {$sel:securityGroupIds:ResolverEndpoint' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: ResolverEndpoint) ((Maybe [Text] -> f (Maybe [Text]))
 -> ResolverEndpoint -> f ResolverEndpoint)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ResolverEndpoint
-> f ResolverEndpoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates whether the Resolver endpoint allows inbound or outbound DNS
-- queries:
--
-- -   @INBOUND@: allows DNS queries to your VPC from your network
--
-- -   @OUTBOUND@: allows DNS queries from your VPC to your network
resolverEndpoint_direction :: Lens.Lens' ResolverEndpoint (Prelude.Maybe ResolverEndpointDirection)
resolverEndpoint_direction :: (Maybe ResolverEndpointDirection
 -> f (Maybe ResolverEndpointDirection))
-> ResolverEndpoint -> f ResolverEndpoint
resolverEndpoint_direction = (ResolverEndpoint -> Maybe ResolverEndpointDirection)
-> (ResolverEndpoint
    -> Maybe ResolverEndpointDirection -> ResolverEndpoint)
-> Lens
     ResolverEndpoint
     ResolverEndpoint
     (Maybe ResolverEndpointDirection)
     (Maybe ResolverEndpointDirection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe ResolverEndpointDirection
direction :: Maybe ResolverEndpointDirection
$sel:direction:ResolverEndpoint' :: ResolverEndpoint -> Maybe ResolverEndpointDirection
direction} -> Maybe ResolverEndpointDirection
direction) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe ResolverEndpointDirection
a -> ResolverEndpoint
s {$sel:direction:ResolverEndpoint' :: Maybe ResolverEndpointDirection
direction = Maybe ResolverEndpointDirection
a} :: ResolverEndpoint)

-- | The ARN (Amazon Resource Name) for the Resolver endpoint.
resolverEndpoint_arn :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_arn :: (Maybe Text -> f (Maybe Text))
-> ResolverEndpoint -> f ResolverEndpoint
resolverEndpoint_arn = (ResolverEndpoint -> Maybe Text)
-> (ResolverEndpoint -> Maybe Text -> ResolverEndpoint)
-> Lens ResolverEndpoint ResolverEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
arn :: Maybe Text
$sel:arn:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:arn:ResolverEndpoint' :: Maybe Text
arn = Maybe Text
a} :: ResolverEndpoint)

-- | A unique string that identifies the request that created the Resolver
-- endpoint. The @CreatorRequestId@ allows failed requests to be retried
-- without the risk of running the operation twice.
resolverEndpoint_creatorRequestId :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_creatorRequestId :: (Maybe Text -> f (Maybe Text))
-> ResolverEndpoint -> f ResolverEndpoint
resolverEndpoint_creatorRequestId = (ResolverEndpoint -> Maybe Text)
-> (ResolverEndpoint -> Maybe Text -> ResolverEndpoint)
-> Lens ResolverEndpoint ResolverEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
creatorRequestId :: Maybe Text
$sel:creatorRequestId:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
creatorRequestId} -> Maybe Text
creatorRequestId) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:creatorRequestId:ResolverEndpoint' :: Maybe Text
creatorRequestId = Maybe Text
a} :: ResolverEndpoint)

-- | The date and time that the endpoint was last modified, in Unix time
-- format and Coordinated Universal Time (UTC).
resolverEndpoint_modificationTime :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_modificationTime :: (Maybe Text -> f (Maybe Text))
-> ResolverEndpoint -> f ResolverEndpoint
resolverEndpoint_modificationTime = (ResolverEndpoint -> Maybe Text)
-> (ResolverEndpoint -> Maybe Text -> ResolverEndpoint)
-> Lens ResolverEndpoint ResolverEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
modificationTime :: Maybe Text
$sel:modificationTime:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
modificationTime} -> Maybe Text
modificationTime) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:modificationTime:ResolverEndpoint' :: Maybe Text
modificationTime = Maybe Text
a} :: ResolverEndpoint)

-- | The number of IP addresses that the Resolver endpoint can use for DNS
-- queries.
resolverEndpoint_ipAddressCount :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Int)
resolverEndpoint_ipAddressCount :: (Maybe Int -> f (Maybe Int))
-> ResolverEndpoint -> f ResolverEndpoint
resolverEndpoint_ipAddressCount = (ResolverEndpoint -> Maybe Int)
-> (ResolverEndpoint -> Maybe Int -> ResolverEndpoint)
-> Lens ResolverEndpoint ResolverEndpoint (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Int
ipAddressCount :: Maybe Int
$sel:ipAddressCount:ResolverEndpoint' :: ResolverEndpoint -> Maybe Int
ipAddressCount} -> Maybe Int
ipAddressCount) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Int
a -> ResolverEndpoint
s {$sel:ipAddressCount:ResolverEndpoint' :: Maybe Int
ipAddressCount = Maybe Int
a} :: ResolverEndpoint)

-- | A detailed description of the status of the Resolver endpoint.
resolverEndpoint_statusMessage :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_statusMessage :: (Maybe Text -> f (Maybe Text))
-> ResolverEndpoint -> f ResolverEndpoint
resolverEndpoint_statusMessage = (ResolverEndpoint -> Maybe Text)
-> (ResolverEndpoint -> Maybe Text -> ResolverEndpoint)
-> Lens ResolverEndpoint ResolverEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:statusMessage:ResolverEndpoint' :: Maybe Text
statusMessage = Maybe Text
a} :: ResolverEndpoint)

-- | The name that you assigned to the Resolver endpoint when you submitted a
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_CreateResolverEndpoint.html CreateResolverEndpoint>
-- request.
resolverEndpoint_name :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_name :: (Maybe Text -> f (Maybe Text))
-> ResolverEndpoint -> f ResolverEndpoint
resolverEndpoint_name = (ResolverEndpoint -> Maybe Text)
-> (ResolverEndpoint -> Maybe Text -> ResolverEndpoint)
-> Lens ResolverEndpoint ResolverEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
name :: Maybe Text
$sel:name:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
name} -> Maybe Text
name) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:name:ResolverEndpoint' :: Maybe Text
name = Maybe Text
a} :: ResolverEndpoint)

-- | The ID of the Resolver endpoint.
resolverEndpoint_id :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_id :: (Maybe Text -> f (Maybe Text))
-> ResolverEndpoint -> f ResolverEndpoint
resolverEndpoint_id = (ResolverEndpoint -> Maybe Text)
-> (ResolverEndpoint -> Maybe Text -> ResolverEndpoint)
-> Lens ResolverEndpoint ResolverEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
id :: Maybe Text
$sel:id:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
id} -> Maybe Text
id) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:id:ResolverEndpoint' :: Maybe Text
id = Maybe Text
a} :: ResolverEndpoint)

-- | The ID of the VPC that you want to create the Resolver endpoint in.
resolverEndpoint_hostVPCId :: Lens.Lens' ResolverEndpoint (Prelude.Maybe Prelude.Text)
resolverEndpoint_hostVPCId :: (Maybe Text -> f (Maybe Text))
-> ResolverEndpoint -> f ResolverEndpoint
resolverEndpoint_hostVPCId = (ResolverEndpoint -> Maybe Text)
-> (ResolverEndpoint -> Maybe Text -> ResolverEndpoint)
-> Lens ResolverEndpoint ResolverEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverEndpoint' {Maybe Text
hostVPCId :: Maybe Text
$sel:hostVPCId:ResolverEndpoint' :: ResolverEndpoint -> Maybe Text
hostVPCId} -> Maybe Text
hostVPCId) (\s :: ResolverEndpoint
s@ResolverEndpoint' {} Maybe Text
a -> ResolverEndpoint
s {$sel:hostVPCId:ResolverEndpoint' :: Maybe Text
hostVPCId = Maybe Text
a} :: ResolverEndpoint)

instance Core.FromJSON ResolverEndpoint where
  parseJSON :: Value -> Parser ResolverEndpoint
parseJSON =
    String
-> (Object -> Parser ResolverEndpoint)
-> Value
-> Parser ResolverEndpoint
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResolverEndpoint"
      ( \Object
x ->
          Maybe Text
-> Maybe ResolverEndpointStatus
-> Maybe [Text]
-> Maybe ResolverEndpointDirection
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ResolverEndpoint
ResolverEndpoint'
            (Maybe Text
 -> Maybe ResolverEndpointStatus
 -> Maybe [Text]
 -> Maybe ResolverEndpointDirection
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> ResolverEndpoint)
-> Parser (Maybe Text)
-> Parser
     (Maybe ResolverEndpointStatus
      -> Maybe [Text]
      -> Maybe ResolverEndpointDirection
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverEndpoint)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTime")
            Parser
  (Maybe ResolverEndpointStatus
   -> Maybe [Text]
   -> Maybe ResolverEndpointDirection
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverEndpoint)
-> Parser (Maybe ResolverEndpointStatus)
-> Parser
     (Maybe [Text]
      -> Maybe ResolverEndpointDirection
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResolverEndpointStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe [Text]
   -> Maybe ResolverEndpointDirection
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverEndpoint)
-> Parser (Maybe [Text])
-> Parser
     (Maybe ResolverEndpointDirection
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SecurityGroupIds"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe ResolverEndpointDirection
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverEndpoint)
-> Parser (Maybe ResolverEndpointDirection)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResolverEndpointDirection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Direction")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverEndpoint)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverEndpoint)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatorRequestId")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverEndpoint)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ModificationTime")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverEndpoint)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> ResolverEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IpAddressCount")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> ResolverEndpoint)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> ResolverEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatusMessage")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> ResolverEndpoint)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ResolverEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser (Maybe Text -> Maybe Text -> ResolverEndpoint)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ResolverEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
            Parser (Maybe Text -> ResolverEndpoint)
-> Parser (Maybe Text) -> Parser ResolverEndpoint
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HostVPCId")
      )

instance Prelude.Hashable ResolverEndpoint

instance Prelude.NFData ResolverEndpoint