{-# 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.GlobalAccelerator.DenyCustomRoutingTraffic
-- 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)
--
-- Specify the Amazon EC2 instance (destination) IP addresses and ports for
-- a VPC subnet endpoint that cannot receive traffic for a custom routing
-- accelerator. You can deny traffic to all destinations in the VPC
-- endpoint, or deny traffic to a specified list of destination IP
-- addresses and ports. Note that you cannot specify IP addresses or ports
-- outside of the range that you configured for the endpoint group.
--
-- After you make changes, you can verify that the updates are complete by
-- checking the status of your accelerator: the status changes from
-- IN_PROGRESS to DEPLOYED.
module Amazonka.GlobalAccelerator.DenyCustomRoutingTraffic
  ( -- * Creating a Request
    DenyCustomRoutingTraffic (..),
    newDenyCustomRoutingTraffic,

    -- * Request Lenses
    denyCustomRoutingTraffic_destinationAddresses,
    denyCustomRoutingTraffic_destinationPorts,
    denyCustomRoutingTraffic_denyAllTrafficToEndpoint,
    denyCustomRoutingTraffic_endpointGroupArn,
    denyCustomRoutingTraffic_endpointId,

    -- * Destructuring the Response
    DenyCustomRoutingTrafficResponse (..),
    newDenyCustomRoutingTrafficResponse,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GlobalAccelerator.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDenyCustomRoutingTraffic' smart constructor.
data DenyCustomRoutingTraffic = DenyCustomRoutingTraffic'
  { -- | A list of specific Amazon EC2 instance IP addresses (destination
    -- addresses) in a subnet that you want to prevent from receiving traffic.
    -- The IP addresses must be a subset of the IP addresses allowed for the
    -- VPC subnet associated with the endpoint group.
    DenyCustomRoutingTraffic -> Maybe [Text]
destinationAddresses :: Prelude.Maybe [Prelude.Text],
    -- | A list of specific Amazon EC2 instance ports (destination ports) in a
    -- subnet endpoint that you want to prevent from receiving traffic.
    DenyCustomRoutingTraffic -> Maybe [Natural]
destinationPorts :: Prelude.Maybe [Prelude.Natural],
    -- | Indicates whether all destination IP addresses and ports for a specified
    -- VPC subnet endpoint /cannot/ receive traffic from a custom routing
    -- accelerator. The value is TRUE or FALSE.
    --
    -- When set to TRUE, /no/ destinations in the custom routing VPC subnet can
    -- receive traffic. Note that you cannot specify destination IP addresses
    -- and ports when the value is set to TRUE.
    --
    -- When set to FALSE (or not specified), you /must/ specify a list of
    -- destination IP addresses that cannot receive traffic. A list of ports is
    -- optional. If you don\'t specify a list of ports, the ports that can
    -- accept traffic is the same as the ports configured for the endpoint
    -- group.
    --
    -- The default value is FALSE.
    DenyCustomRoutingTraffic -> Maybe Bool
denyAllTrafficToEndpoint :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Name (ARN) of the endpoint group.
    DenyCustomRoutingTraffic -> Text
endpointGroupArn :: Prelude.Text,
    -- | An ID for the endpoint. For custom routing accelerators, this is the
    -- virtual private cloud (VPC) subnet ID.
    DenyCustomRoutingTraffic -> Text
endpointId :: Prelude.Text
  }
  deriving (DenyCustomRoutingTraffic -> DenyCustomRoutingTraffic -> Bool
(DenyCustomRoutingTraffic -> DenyCustomRoutingTraffic -> Bool)
-> (DenyCustomRoutingTraffic -> DenyCustomRoutingTraffic -> Bool)
-> Eq DenyCustomRoutingTraffic
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DenyCustomRoutingTraffic -> DenyCustomRoutingTraffic -> Bool
$c/= :: DenyCustomRoutingTraffic -> DenyCustomRoutingTraffic -> Bool
== :: DenyCustomRoutingTraffic -> DenyCustomRoutingTraffic -> Bool
$c== :: DenyCustomRoutingTraffic -> DenyCustomRoutingTraffic -> Bool
Prelude.Eq, ReadPrec [DenyCustomRoutingTraffic]
ReadPrec DenyCustomRoutingTraffic
Int -> ReadS DenyCustomRoutingTraffic
ReadS [DenyCustomRoutingTraffic]
(Int -> ReadS DenyCustomRoutingTraffic)
-> ReadS [DenyCustomRoutingTraffic]
-> ReadPrec DenyCustomRoutingTraffic
-> ReadPrec [DenyCustomRoutingTraffic]
-> Read DenyCustomRoutingTraffic
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DenyCustomRoutingTraffic]
$creadListPrec :: ReadPrec [DenyCustomRoutingTraffic]
readPrec :: ReadPrec DenyCustomRoutingTraffic
$creadPrec :: ReadPrec DenyCustomRoutingTraffic
readList :: ReadS [DenyCustomRoutingTraffic]
$creadList :: ReadS [DenyCustomRoutingTraffic]
readsPrec :: Int -> ReadS DenyCustomRoutingTraffic
$creadsPrec :: Int -> ReadS DenyCustomRoutingTraffic
Prelude.Read, Int -> DenyCustomRoutingTraffic -> ShowS
[DenyCustomRoutingTraffic] -> ShowS
DenyCustomRoutingTraffic -> String
(Int -> DenyCustomRoutingTraffic -> ShowS)
-> (DenyCustomRoutingTraffic -> String)
-> ([DenyCustomRoutingTraffic] -> ShowS)
-> Show DenyCustomRoutingTraffic
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DenyCustomRoutingTraffic] -> ShowS
$cshowList :: [DenyCustomRoutingTraffic] -> ShowS
show :: DenyCustomRoutingTraffic -> String
$cshow :: DenyCustomRoutingTraffic -> String
showsPrec :: Int -> DenyCustomRoutingTraffic -> ShowS
$cshowsPrec :: Int -> DenyCustomRoutingTraffic -> ShowS
Prelude.Show, (forall x.
 DenyCustomRoutingTraffic -> Rep DenyCustomRoutingTraffic x)
-> (forall x.
    Rep DenyCustomRoutingTraffic x -> DenyCustomRoutingTraffic)
-> Generic DenyCustomRoutingTraffic
forall x.
Rep DenyCustomRoutingTraffic x -> DenyCustomRoutingTraffic
forall x.
DenyCustomRoutingTraffic -> Rep DenyCustomRoutingTraffic x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DenyCustomRoutingTraffic x -> DenyCustomRoutingTraffic
$cfrom :: forall x.
DenyCustomRoutingTraffic -> Rep DenyCustomRoutingTraffic x
Prelude.Generic)

-- |
-- Create a value of 'DenyCustomRoutingTraffic' 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:
--
-- 'destinationAddresses', 'denyCustomRoutingTraffic_destinationAddresses' - A list of specific Amazon EC2 instance IP addresses (destination
-- addresses) in a subnet that you want to prevent from receiving traffic.
-- The IP addresses must be a subset of the IP addresses allowed for the
-- VPC subnet associated with the endpoint group.
--
-- 'destinationPorts', 'denyCustomRoutingTraffic_destinationPorts' - A list of specific Amazon EC2 instance ports (destination ports) in a
-- subnet endpoint that you want to prevent from receiving traffic.
--
-- 'denyAllTrafficToEndpoint', 'denyCustomRoutingTraffic_denyAllTrafficToEndpoint' - Indicates whether all destination IP addresses and ports for a specified
-- VPC subnet endpoint /cannot/ receive traffic from a custom routing
-- accelerator. The value is TRUE or FALSE.
--
-- When set to TRUE, /no/ destinations in the custom routing VPC subnet can
-- receive traffic. Note that you cannot specify destination IP addresses
-- and ports when the value is set to TRUE.
--
-- When set to FALSE (or not specified), you /must/ specify a list of
-- destination IP addresses that cannot receive traffic. A list of ports is
-- optional. If you don\'t specify a list of ports, the ports that can
-- accept traffic is the same as the ports configured for the endpoint
-- group.
--
-- The default value is FALSE.
--
-- 'endpointGroupArn', 'denyCustomRoutingTraffic_endpointGroupArn' - The Amazon Resource Name (ARN) of the endpoint group.
--
-- 'endpointId', 'denyCustomRoutingTraffic_endpointId' - An ID for the endpoint. For custom routing accelerators, this is the
-- virtual private cloud (VPC) subnet ID.
newDenyCustomRoutingTraffic ::
  -- | 'endpointGroupArn'
  Prelude.Text ->
  -- | 'endpointId'
  Prelude.Text ->
  DenyCustomRoutingTraffic
newDenyCustomRoutingTraffic :: Text -> Text -> DenyCustomRoutingTraffic
newDenyCustomRoutingTraffic
  Text
pEndpointGroupArn_
  Text
pEndpointId_ =
    DenyCustomRoutingTraffic' :: Maybe [Text]
-> Maybe [Natural]
-> Maybe Bool
-> Text
-> Text
-> DenyCustomRoutingTraffic
DenyCustomRoutingTraffic'
      { $sel:destinationAddresses:DenyCustomRoutingTraffic' :: Maybe [Text]
destinationAddresses =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:destinationPorts:DenyCustomRoutingTraffic' :: Maybe [Natural]
destinationPorts = Maybe [Natural]
forall a. Maybe a
Prelude.Nothing,
        $sel:denyAllTrafficToEndpoint:DenyCustomRoutingTraffic' :: Maybe Bool
denyAllTrafficToEndpoint = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:endpointGroupArn:DenyCustomRoutingTraffic' :: Text
endpointGroupArn = Text
pEndpointGroupArn_,
        $sel:endpointId:DenyCustomRoutingTraffic' :: Text
endpointId = Text
pEndpointId_
      }

-- | A list of specific Amazon EC2 instance IP addresses (destination
-- addresses) in a subnet that you want to prevent from receiving traffic.
-- The IP addresses must be a subset of the IP addresses allowed for the
-- VPC subnet associated with the endpoint group.
denyCustomRoutingTraffic_destinationAddresses :: Lens.Lens' DenyCustomRoutingTraffic (Prelude.Maybe [Prelude.Text])
denyCustomRoutingTraffic_destinationAddresses :: (Maybe [Text] -> f (Maybe [Text]))
-> DenyCustomRoutingTraffic -> f DenyCustomRoutingTraffic
denyCustomRoutingTraffic_destinationAddresses = (DenyCustomRoutingTraffic -> Maybe [Text])
-> (DenyCustomRoutingTraffic
    -> Maybe [Text] -> DenyCustomRoutingTraffic)
-> Lens
     DenyCustomRoutingTraffic
     DenyCustomRoutingTraffic
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DenyCustomRoutingTraffic' {Maybe [Text]
destinationAddresses :: Maybe [Text]
$sel:destinationAddresses:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe [Text]
destinationAddresses} -> Maybe [Text]
destinationAddresses) (\s :: DenyCustomRoutingTraffic
s@DenyCustomRoutingTraffic' {} Maybe [Text]
a -> DenyCustomRoutingTraffic
s {$sel:destinationAddresses:DenyCustomRoutingTraffic' :: Maybe [Text]
destinationAddresses = Maybe [Text]
a} :: DenyCustomRoutingTraffic) ((Maybe [Text] -> f (Maybe [Text]))
 -> DenyCustomRoutingTraffic -> f DenyCustomRoutingTraffic)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DenyCustomRoutingTraffic
-> f DenyCustomRoutingTraffic
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 specific Amazon EC2 instance ports (destination ports) in a
-- subnet endpoint that you want to prevent from receiving traffic.
denyCustomRoutingTraffic_destinationPorts :: Lens.Lens' DenyCustomRoutingTraffic (Prelude.Maybe [Prelude.Natural])
denyCustomRoutingTraffic_destinationPorts :: (Maybe [Natural] -> f (Maybe [Natural]))
-> DenyCustomRoutingTraffic -> f DenyCustomRoutingTraffic
denyCustomRoutingTraffic_destinationPorts = (DenyCustomRoutingTraffic -> Maybe [Natural])
-> (DenyCustomRoutingTraffic
    -> Maybe [Natural] -> DenyCustomRoutingTraffic)
-> Lens
     DenyCustomRoutingTraffic
     DenyCustomRoutingTraffic
     (Maybe [Natural])
     (Maybe [Natural])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DenyCustomRoutingTraffic' {Maybe [Natural]
destinationPorts :: Maybe [Natural]
$sel:destinationPorts:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe [Natural]
destinationPorts} -> Maybe [Natural]
destinationPorts) (\s :: DenyCustomRoutingTraffic
s@DenyCustomRoutingTraffic' {} Maybe [Natural]
a -> DenyCustomRoutingTraffic
s {$sel:destinationPorts:DenyCustomRoutingTraffic' :: Maybe [Natural]
destinationPorts = Maybe [Natural]
a} :: DenyCustomRoutingTraffic) ((Maybe [Natural] -> f (Maybe [Natural]))
 -> DenyCustomRoutingTraffic -> f DenyCustomRoutingTraffic)
-> ((Maybe [Natural] -> f (Maybe [Natural]))
    -> Maybe [Natural] -> f (Maybe [Natural]))
-> (Maybe [Natural] -> f (Maybe [Natural]))
-> DenyCustomRoutingTraffic
-> f DenyCustomRoutingTraffic
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Natural] [Natural] [Natural] [Natural]
-> Iso
     (Maybe [Natural])
     (Maybe [Natural])
     (Maybe [Natural])
     (Maybe [Natural])
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 [Natural] [Natural] [Natural] [Natural]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates whether all destination IP addresses and ports for a specified
-- VPC subnet endpoint /cannot/ receive traffic from a custom routing
-- accelerator. The value is TRUE or FALSE.
--
-- When set to TRUE, /no/ destinations in the custom routing VPC subnet can
-- receive traffic. Note that you cannot specify destination IP addresses
-- and ports when the value is set to TRUE.
--
-- When set to FALSE (or not specified), you /must/ specify a list of
-- destination IP addresses that cannot receive traffic. A list of ports is
-- optional. If you don\'t specify a list of ports, the ports that can
-- accept traffic is the same as the ports configured for the endpoint
-- group.
--
-- The default value is FALSE.
denyCustomRoutingTraffic_denyAllTrafficToEndpoint :: Lens.Lens' DenyCustomRoutingTraffic (Prelude.Maybe Prelude.Bool)
denyCustomRoutingTraffic_denyAllTrafficToEndpoint :: (Maybe Bool -> f (Maybe Bool))
-> DenyCustomRoutingTraffic -> f DenyCustomRoutingTraffic
denyCustomRoutingTraffic_denyAllTrafficToEndpoint = (DenyCustomRoutingTraffic -> Maybe Bool)
-> (DenyCustomRoutingTraffic
    -> Maybe Bool -> DenyCustomRoutingTraffic)
-> Lens
     DenyCustomRoutingTraffic
     DenyCustomRoutingTraffic
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DenyCustomRoutingTraffic' {Maybe Bool
denyAllTrafficToEndpoint :: Maybe Bool
$sel:denyAllTrafficToEndpoint:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe Bool
denyAllTrafficToEndpoint} -> Maybe Bool
denyAllTrafficToEndpoint) (\s :: DenyCustomRoutingTraffic
s@DenyCustomRoutingTraffic' {} Maybe Bool
a -> DenyCustomRoutingTraffic
s {$sel:denyAllTrafficToEndpoint:DenyCustomRoutingTraffic' :: Maybe Bool
denyAllTrafficToEndpoint = Maybe Bool
a} :: DenyCustomRoutingTraffic)

-- | The Amazon Resource Name (ARN) of the endpoint group.
denyCustomRoutingTraffic_endpointGroupArn :: Lens.Lens' DenyCustomRoutingTraffic Prelude.Text
denyCustomRoutingTraffic_endpointGroupArn :: (Text -> f Text)
-> DenyCustomRoutingTraffic -> f DenyCustomRoutingTraffic
denyCustomRoutingTraffic_endpointGroupArn = (DenyCustomRoutingTraffic -> Text)
-> (DenyCustomRoutingTraffic -> Text -> DenyCustomRoutingTraffic)
-> Lens DenyCustomRoutingTraffic DenyCustomRoutingTraffic Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DenyCustomRoutingTraffic' {Text
endpointGroupArn :: Text
$sel:endpointGroupArn:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Text
endpointGroupArn} -> Text
endpointGroupArn) (\s :: DenyCustomRoutingTraffic
s@DenyCustomRoutingTraffic' {} Text
a -> DenyCustomRoutingTraffic
s {$sel:endpointGroupArn:DenyCustomRoutingTraffic' :: Text
endpointGroupArn = Text
a} :: DenyCustomRoutingTraffic)

-- | An ID for the endpoint. For custom routing accelerators, this is the
-- virtual private cloud (VPC) subnet ID.
denyCustomRoutingTraffic_endpointId :: Lens.Lens' DenyCustomRoutingTraffic Prelude.Text
denyCustomRoutingTraffic_endpointId :: (Text -> f Text)
-> DenyCustomRoutingTraffic -> f DenyCustomRoutingTraffic
denyCustomRoutingTraffic_endpointId = (DenyCustomRoutingTraffic -> Text)
-> (DenyCustomRoutingTraffic -> Text -> DenyCustomRoutingTraffic)
-> Lens DenyCustomRoutingTraffic DenyCustomRoutingTraffic Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DenyCustomRoutingTraffic' {Text
endpointId :: Text
$sel:endpointId:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Text
endpointId} -> Text
endpointId) (\s :: DenyCustomRoutingTraffic
s@DenyCustomRoutingTraffic' {} Text
a -> DenyCustomRoutingTraffic
s {$sel:endpointId:DenyCustomRoutingTraffic' :: Text
endpointId = Text
a} :: DenyCustomRoutingTraffic)

instance Core.AWSRequest DenyCustomRoutingTraffic where
  type
    AWSResponse DenyCustomRoutingTraffic =
      DenyCustomRoutingTrafficResponse
  request :: DenyCustomRoutingTraffic -> Request DenyCustomRoutingTraffic
request = Service
-> DenyCustomRoutingTraffic -> Request DenyCustomRoutingTraffic
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DenyCustomRoutingTraffic
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DenyCustomRoutingTraffic)))
response =
    AWSResponse DenyCustomRoutingTraffic
-> Logger
-> Service
-> Proxy DenyCustomRoutingTraffic
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DenyCustomRoutingTraffic)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DenyCustomRoutingTraffic
DenyCustomRoutingTrafficResponse
DenyCustomRoutingTrafficResponse'

instance Prelude.Hashable DenyCustomRoutingTraffic

instance Prelude.NFData DenyCustomRoutingTraffic

instance Core.ToHeaders DenyCustomRoutingTraffic where
  toHeaders :: DenyCustomRoutingTraffic -> [Header]
toHeaders =
    [Header] -> DenyCustomRoutingTraffic -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"GlobalAccelerator_V20180706.DenyCustomRoutingTraffic" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DenyCustomRoutingTraffic where
  toJSON :: DenyCustomRoutingTraffic -> Value
toJSON DenyCustomRoutingTraffic' {Maybe Bool
Maybe [Natural]
Maybe [Text]
Text
endpointId :: Text
endpointGroupArn :: Text
denyAllTrafficToEndpoint :: Maybe Bool
destinationPorts :: Maybe [Natural]
destinationAddresses :: Maybe [Text]
$sel:endpointId:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Text
$sel:endpointGroupArn:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Text
$sel:denyAllTrafficToEndpoint:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe Bool
$sel:destinationPorts:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe [Natural]
$sel:destinationAddresses:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DestinationAddresses" 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]
destinationAddresses,
            (Text
"DestinationPorts" Text -> [Natural] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Natural] -> Pair) -> Maybe [Natural] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Natural]
destinationPorts,
            (Text
"DenyAllTrafficToEndpoint" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
denyAllTrafficToEndpoint,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"EndpointGroupArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
endpointGroupArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EndpointId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
endpointId)
          ]
      )

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

instance Core.ToQuery DenyCustomRoutingTraffic where
  toQuery :: DenyCustomRoutingTraffic -> QueryString
toQuery = QueryString -> DenyCustomRoutingTraffic -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDenyCustomRoutingTrafficResponse' smart constructor.
data DenyCustomRoutingTrafficResponse = DenyCustomRoutingTrafficResponse'
  {
  }
  deriving (DenyCustomRoutingTrafficResponse
-> DenyCustomRoutingTrafficResponse -> Bool
(DenyCustomRoutingTrafficResponse
 -> DenyCustomRoutingTrafficResponse -> Bool)
-> (DenyCustomRoutingTrafficResponse
    -> DenyCustomRoutingTrafficResponse -> Bool)
-> Eq DenyCustomRoutingTrafficResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DenyCustomRoutingTrafficResponse
-> DenyCustomRoutingTrafficResponse -> Bool
$c/= :: DenyCustomRoutingTrafficResponse
-> DenyCustomRoutingTrafficResponse -> Bool
== :: DenyCustomRoutingTrafficResponse
-> DenyCustomRoutingTrafficResponse -> Bool
$c== :: DenyCustomRoutingTrafficResponse
-> DenyCustomRoutingTrafficResponse -> Bool
Prelude.Eq, ReadPrec [DenyCustomRoutingTrafficResponse]
ReadPrec DenyCustomRoutingTrafficResponse
Int -> ReadS DenyCustomRoutingTrafficResponse
ReadS [DenyCustomRoutingTrafficResponse]
(Int -> ReadS DenyCustomRoutingTrafficResponse)
-> ReadS [DenyCustomRoutingTrafficResponse]
-> ReadPrec DenyCustomRoutingTrafficResponse
-> ReadPrec [DenyCustomRoutingTrafficResponse]
-> Read DenyCustomRoutingTrafficResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DenyCustomRoutingTrafficResponse]
$creadListPrec :: ReadPrec [DenyCustomRoutingTrafficResponse]
readPrec :: ReadPrec DenyCustomRoutingTrafficResponse
$creadPrec :: ReadPrec DenyCustomRoutingTrafficResponse
readList :: ReadS [DenyCustomRoutingTrafficResponse]
$creadList :: ReadS [DenyCustomRoutingTrafficResponse]
readsPrec :: Int -> ReadS DenyCustomRoutingTrafficResponse
$creadsPrec :: Int -> ReadS DenyCustomRoutingTrafficResponse
Prelude.Read, Int -> DenyCustomRoutingTrafficResponse -> ShowS
[DenyCustomRoutingTrafficResponse] -> ShowS
DenyCustomRoutingTrafficResponse -> String
(Int -> DenyCustomRoutingTrafficResponse -> ShowS)
-> (DenyCustomRoutingTrafficResponse -> String)
-> ([DenyCustomRoutingTrafficResponse] -> ShowS)
-> Show DenyCustomRoutingTrafficResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DenyCustomRoutingTrafficResponse] -> ShowS
$cshowList :: [DenyCustomRoutingTrafficResponse] -> ShowS
show :: DenyCustomRoutingTrafficResponse -> String
$cshow :: DenyCustomRoutingTrafficResponse -> String
showsPrec :: Int -> DenyCustomRoutingTrafficResponse -> ShowS
$cshowsPrec :: Int -> DenyCustomRoutingTrafficResponse -> ShowS
Prelude.Show, (forall x.
 DenyCustomRoutingTrafficResponse
 -> Rep DenyCustomRoutingTrafficResponse x)
-> (forall x.
    Rep DenyCustomRoutingTrafficResponse x
    -> DenyCustomRoutingTrafficResponse)
-> Generic DenyCustomRoutingTrafficResponse
forall x.
Rep DenyCustomRoutingTrafficResponse x
-> DenyCustomRoutingTrafficResponse
forall x.
DenyCustomRoutingTrafficResponse
-> Rep DenyCustomRoutingTrafficResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DenyCustomRoutingTrafficResponse x
-> DenyCustomRoutingTrafficResponse
$cfrom :: forall x.
DenyCustomRoutingTrafficResponse
-> Rep DenyCustomRoutingTrafficResponse x
Prelude.Generic)

-- |
-- Create a value of 'DenyCustomRoutingTrafficResponse' 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.
newDenyCustomRoutingTrafficResponse ::
  DenyCustomRoutingTrafficResponse
newDenyCustomRoutingTrafficResponse :: DenyCustomRoutingTrafficResponse
newDenyCustomRoutingTrafficResponse =
  DenyCustomRoutingTrafficResponse
DenyCustomRoutingTrafficResponse'

instance
  Prelude.NFData
    DenyCustomRoutingTrafficResponse