{-# 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.Transfer.Types.EndpointDetails
-- 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.Transfer.Types.EndpointDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The virtual private cloud (VPC) endpoint settings that are configured
-- for your file transfer protocol-enabled server. With a VPC endpoint, you
-- can restrict access to your server and resources only within your VPC.
-- To control incoming internet traffic, invoke the @UpdateServer@ API and
-- attach an Elastic IP address to your server\'s endpoint.
--
-- After May 19, 2021, you won\'t be able to create a server using
-- @EndpointType=VPC_ENDPOINT@ in your Amazon Web Servicesaccount if your
-- account hasn\'t already done so before May 19, 2021. If you have already
-- created servers with @EndpointType=VPC_ENDPOINT@ in your Amazon Web
-- Servicesaccount on or before May 19, 2021, you will not be affected.
-- After this date, use @EndpointType@=@VPC@.
--
-- For more information, see
-- https:\/\/docs.aws.amazon.com\/transfer\/latest\/userguide\/create-server-in-vpc.html#deprecate-vpc-endpoint.
--
-- /See:/ 'newEndpointDetails' smart constructor.
data EndpointDetails = EndpointDetails'
  { -- | A list of security groups IDs that are available to attach to your
    -- server\'s endpoint.
    --
    -- This property can only be set when @EndpointType@ is set to @VPC@.
    --
    -- You can edit the @SecurityGroupIds@ property in the
    -- <https://docs.aws.amazon.com/transfer/latest/userguide/API_UpdateServer.html UpdateServer>
    -- API only if you are changing the @EndpointType@ from @PUBLIC@ or
    -- @VPC_ENDPOINT@ to @VPC@. To change security groups associated with your
    -- server\'s VPC endpoint after creation, use the Amazon EC2
    -- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyVpcEndpoint.html ModifyVpcEndpoint>
    -- API.
    EndpointDetails -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | A list of subnet IDs that are required to host your server endpoint in
    -- your VPC.
    --
    -- This property can only be set when @EndpointType@ is set to @VPC@.
    EndpointDetails -> Maybe [Text]
subnetIds :: Prelude.Maybe [Prelude.Text],
    -- | The VPC ID of the VPC in which a server\'s endpoint will be hosted.
    --
    -- This property can only be set when @EndpointType@ is set to @VPC@.
    EndpointDetails -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | A list of address allocation IDs that are required to attach an Elastic
    -- IP address to your server\'s endpoint.
    --
    -- This property can only be set when @EndpointType@ is set to @VPC@ and it
    -- is only valid in the @UpdateServer@ API.
    EndpointDetails -> Maybe [Text]
addressAllocationIds :: Prelude.Maybe [Prelude.Text],
    -- | The ID of the VPC endpoint.
    --
    -- This property can only be set when @EndpointType@ is set to
    -- @VPC_ENDPOINT@.
    --
    -- For more information, see
    -- https:\/\/docs.aws.amazon.com\/transfer\/latest\/userguide\/create-server-in-vpc.html#deprecate-vpc-endpoint.
    EndpointDetails -> Maybe Text
vpcEndpointId :: Prelude.Maybe Prelude.Text
  }
  deriving (EndpointDetails -> EndpointDetails -> Bool
(EndpointDetails -> EndpointDetails -> Bool)
-> (EndpointDetails -> EndpointDetails -> Bool)
-> Eq EndpointDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointDetails -> EndpointDetails -> Bool
$c/= :: EndpointDetails -> EndpointDetails -> Bool
== :: EndpointDetails -> EndpointDetails -> Bool
$c== :: EndpointDetails -> EndpointDetails -> Bool
Prelude.Eq, ReadPrec [EndpointDetails]
ReadPrec EndpointDetails
Int -> ReadS EndpointDetails
ReadS [EndpointDetails]
(Int -> ReadS EndpointDetails)
-> ReadS [EndpointDetails]
-> ReadPrec EndpointDetails
-> ReadPrec [EndpointDetails]
-> Read EndpointDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointDetails]
$creadListPrec :: ReadPrec [EndpointDetails]
readPrec :: ReadPrec EndpointDetails
$creadPrec :: ReadPrec EndpointDetails
readList :: ReadS [EndpointDetails]
$creadList :: ReadS [EndpointDetails]
readsPrec :: Int -> ReadS EndpointDetails
$creadsPrec :: Int -> ReadS EndpointDetails
Prelude.Read, Int -> EndpointDetails -> ShowS
[EndpointDetails] -> ShowS
EndpointDetails -> String
(Int -> EndpointDetails -> ShowS)
-> (EndpointDetails -> String)
-> ([EndpointDetails] -> ShowS)
-> Show EndpointDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointDetails] -> ShowS
$cshowList :: [EndpointDetails] -> ShowS
show :: EndpointDetails -> String
$cshow :: EndpointDetails -> String
showsPrec :: Int -> EndpointDetails -> ShowS
$cshowsPrec :: Int -> EndpointDetails -> ShowS
Prelude.Show, (forall x. EndpointDetails -> Rep EndpointDetails x)
-> (forall x. Rep EndpointDetails x -> EndpointDetails)
-> Generic EndpointDetails
forall x. Rep EndpointDetails x -> EndpointDetails
forall x. EndpointDetails -> Rep EndpointDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointDetails x -> EndpointDetails
$cfrom :: forall x. EndpointDetails -> Rep EndpointDetails x
Prelude.Generic)

-- |
-- Create a value of 'EndpointDetails' 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:
--
-- 'securityGroupIds', 'endpointDetails_securityGroupIds' - A list of security groups IDs that are available to attach to your
-- server\'s endpoint.
--
-- This property can only be set when @EndpointType@ is set to @VPC@.
--
-- You can edit the @SecurityGroupIds@ property in the
-- <https://docs.aws.amazon.com/transfer/latest/userguide/API_UpdateServer.html UpdateServer>
-- API only if you are changing the @EndpointType@ from @PUBLIC@ or
-- @VPC_ENDPOINT@ to @VPC@. To change security groups associated with your
-- server\'s VPC endpoint after creation, use the Amazon EC2
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyVpcEndpoint.html ModifyVpcEndpoint>
-- API.
--
-- 'subnetIds', 'endpointDetails_subnetIds' - A list of subnet IDs that are required to host your server endpoint in
-- your VPC.
--
-- This property can only be set when @EndpointType@ is set to @VPC@.
--
-- 'vpcId', 'endpointDetails_vpcId' - The VPC ID of the VPC in which a server\'s endpoint will be hosted.
--
-- This property can only be set when @EndpointType@ is set to @VPC@.
--
-- 'addressAllocationIds', 'endpointDetails_addressAllocationIds' - A list of address allocation IDs that are required to attach an Elastic
-- IP address to your server\'s endpoint.
--
-- This property can only be set when @EndpointType@ is set to @VPC@ and it
-- is only valid in the @UpdateServer@ API.
--
-- 'vpcEndpointId', 'endpointDetails_vpcEndpointId' - The ID of the VPC endpoint.
--
-- This property can only be set when @EndpointType@ is set to
-- @VPC_ENDPOINT@.
--
-- For more information, see
-- https:\/\/docs.aws.amazon.com\/transfer\/latest\/userguide\/create-server-in-vpc.html#deprecate-vpc-endpoint.
newEndpointDetails ::
  EndpointDetails
newEndpointDetails :: EndpointDetails
newEndpointDetails =
  EndpointDetails' :: Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> EndpointDetails
EndpointDetails'
    { $sel:securityGroupIds:EndpointDetails' :: Maybe [Text]
securityGroupIds =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:subnetIds:EndpointDetails' :: Maybe [Text]
subnetIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:EndpointDetails' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:addressAllocationIds:EndpointDetails' :: Maybe [Text]
addressAllocationIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcEndpointId:EndpointDetails' :: Maybe Text
vpcEndpointId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of security groups IDs that are available to attach to your
-- server\'s endpoint.
--
-- This property can only be set when @EndpointType@ is set to @VPC@.
--
-- You can edit the @SecurityGroupIds@ property in the
-- <https://docs.aws.amazon.com/transfer/latest/userguide/API_UpdateServer.html UpdateServer>
-- API only if you are changing the @EndpointType@ from @PUBLIC@ or
-- @VPC_ENDPOINT@ to @VPC@. To change security groups associated with your
-- server\'s VPC endpoint after creation, use the Amazon EC2
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyVpcEndpoint.html ModifyVpcEndpoint>
-- API.
endpointDetails_securityGroupIds :: Lens.Lens' EndpointDetails (Prelude.Maybe [Prelude.Text])
endpointDetails_securityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails -> f EndpointDetails
endpointDetails_securityGroupIds = (EndpointDetails -> Maybe [Text])
-> (EndpointDetails -> Maybe [Text] -> EndpointDetails)
-> Lens
     EndpointDetails EndpointDetails (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDetails' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: EndpointDetails
s@EndpointDetails' {} Maybe [Text]
a -> EndpointDetails
s {$sel:securityGroupIds:EndpointDetails' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: EndpointDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> EndpointDetails -> f EndpointDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails
-> f EndpointDetails
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

-- | A list of subnet IDs that are required to host your server endpoint in
-- your VPC.
--
-- This property can only be set when @EndpointType@ is set to @VPC@.
endpointDetails_subnetIds :: Lens.Lens' EndpointDetails (Prelude.Maybe [Prelude.Text])
endpointDetails_subnetIds :: (Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails -> f EndpointDetails
endpointDetails_subnetIds = (EndpointDetails -> Maybe [Text])
-> (EndpointDetails -> Maybe [Text] -> EndpointDetails)
-> Lens
     EndpointDetails EndpointDetails (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDetails' {Maybe [Text]
subnetIds :: Maybe [Text]
$sel:subnetIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
subnetIds} -> Maybe [Text]
subnetIds) (\s :: EndpointDetails
s@EndpointDetails' {} Maybe [Text]
a -> EndpointDetails
s {$sel:subnetIds:EndpointDetails' :: Maybe [Text]
subnetIds = Maybe [Text]
a} :: EndpointDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> EndpointDetails -> f EndpointDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails
-> f EndpointDetails
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

-- | The VPC ID of the VPC in which a server\'s endpoint will be hosted.
--
-- This property can only be set when @EndpointType@ is set to @VPC@.
endpointDetails_vpcId :: Lens.Lens' EndpointDetails (Prelude.Maybe Prelude.Text)
endpointDetails_vpcId :: (Maybe Text -> f (Maybe Text))
-> EndpointDetails -> f EndpointDetails
endpointDetails_vpcId = (EndpointDetails -> Maybe Text)
-> (EndpointDetails -> Maybe Text -> EndpointDetails)
-> Lens EndpointDetails EndpointDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDetails' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:EndpointDetails' :: EndpointDetails -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: EndpointDetails
s@EndpointDetails' {} Maybe Text
a -> EndpointDetails
s {$sel:vpcId:EndpointDetails' :: Maybe Text
vpcId = Maybe Text
a} :: EndpointDetails)

-- | A list of address allocation IDs that are required to attach an Elastic
-- IP address to your server\'s endpoint.
--
-- This property can only be set when @EndpointType@ is set to @VPC@ and it
-- is only valid in the @UpdateServer@ API.
endpointDetails_addressAllocationIds :: Lens.Lens' EndpointDetails (Prelude.Maybe [Prelude.Text])
endpointDetails_addressAllocationIds :: (Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails -> f EndpointDetails
endpointDetails_addressAllocationIds = (EndpointDetails -> Maybe [Text])
-> (EndpointDetails -> Maybe [Text] -> EndpointDetails)
-> Lens
     EndpointDetails EndpointDetails (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDetails' {Maybe [Text]
addressAllocationIds :: Maybe [Text]
$sel:addressAllocationIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
addressAllocationIds} -> Maybe [Text]
addressAllocationIds) (\s :: EndpointDetails
s@EndpointDetails' {} Maybe [Text]
a -> EndpointDetails
s {$sel:addressAllocationIds:EndpointDetails' :: Maybe [Text]
addressAllocationIds = Maybe [Text]
a} :: EndpointDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> EndpointDetails -> f EndpointDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails
-> f EndpointDetails
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

-- | The ID of the VPC endpoint.
--
-- This property can only be set when @EndpointType@ is set to
-- @VPC_ENDPOINT@.
--
-- For more information, see
-- https:\/\/docs.aws.amazon.com\/transfer\/latest\/userguide\/create-server-in-vpc.html#deprecate-vpc-endpoint.
endpointDetails_vpcEndpointId :: Lens.Lens' EndpointDetails (Prelude.Maybe Prelude.Text)
endpointDetails_vpcEndpointId :: (Maybe Text -> f (Maybe Text))
-> EndpointDetails -> f EndpointDetails
endpointDetails_vpcEndpointId = (EndpointDetails -> Maybe Text)
-> (EndpointDetails -> Maybe Text -> EndpointDetails)
-> Lens EndpointDetails EndpointDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDetails' {Maybe Text
vpcEndpointId :: Maybe Text
$sel:vpcEndpointId:EndpointDetails' :: EndpointDetails -> Maybe Text
vpcEndpointId} -> Maybe Text
vpcEndpointId) (\s :: EndpointDetails
s@EndpointDetails' {} Maybe Text
a -> EndpointDetails
s {$sel:vpcEndpointId:EndpointDetails' :: Maybe Text
vpcEndpointId = Maybe Text
a} :: EndpointDetails)

instance Core.FromJSON EndpointDetails where
  parseJSON :: Value -> Parser EndpointDetails
parseJSON =
    String
-> (Object -> Parser EndpointDetails)
-> Value
-> Parser EndpointDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EndpointDetails"
      ( \Object
x ->
          Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> EndpointDetails
EndpointDetails'
            (Maybe [Text]
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> EndpointDetails)
-> Parser (Maybe [Text])
-> Parser
     (Maybe [Text]
      -> Maybe Text -> Maybe [Text] -> Maybe Text -> EndpointDetails)
forall (f :: * -> *) a b. Functor 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 [Text]
   -> Maybe Text -> Maybe [Text] -> Maybe Text -> EndpointDetails)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text -> Maybe [Text] -> Maybe Text -> EndpointDetails)
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
"SubnetIds" 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 Text -> Maybe [Text] -> Maybe Text -> EndpointDetails)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> Maybe Text -> EndpointDetails)
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
"VpcId")
            Parser (Maybe [Text] -> Maybe Text -> EndpointDetails)
-> Parser (Maybe [Text]) -> Parser (Maybe Text -> EndpointDetails)
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
"AddressAllocationIds"
                            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 Text -> EndpointDetails)
-> Parser (Maybe Text) -> Parser EndpointDetails
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
"VpcEndpointId")
      )

instance Prelude.Hashable EndpointDetails

instance Prelude.NFData EndpointDetails

instance Core.ToJSON EndpointDetails where
  toJSON :: EndpointDetails -> Value
toJSON EndpointDetails' {Maybe [Text]
Maybe Text
vpcEndpointId :: Maybe Text
addressAllocationIds :: Maybe [Text]
vpcId :: Maybe Text
subnetIds :: Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:vpcEndpointId:EndpointDetails' :: EndpointDetails -> Maybe Text
$sel:addressAllocationIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
$sel:vpcId:EndpointDetails' :: EndpointDetails -> Maybe Text
$sel:subnetIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
$sel:securityGroupIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SecurityGroupIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
securityGroupIds,
            (Text
"SubnetIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
subnetIds,
            (Text
"VpcId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vpcId,
            (Text
"AddressAllocationIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
addressAllocationIds,
            (Text
"VpcEndpointId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vpcEndpointId
          ]
      )