{-# 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 #-}
module Amazonka.GlobalAccelerator.DenyCustomRoutingTraffic
(
DenyCustomRoutingTraffic (..),
newDenyCustomRoutingTraffic,
denyCustomRoutingTraffic_denyAllTrafficToEndpoint,
denyCustomRoutingTraffic_destinationAddresses,
denyCustomRoutingTraffic_destinationPorts,
denyCustomRoutingTraffic_endpointGroupArn,
denyCustomRoutingTraffic_endpointId,
DenyCustomRoutingTrafficResponse (..),
newDenyCustomRoutingTrafficResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GlobalAccelerator.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DenyCustomRoutingTraffic = DenyCustomRoutingTraffic'
{
DenyCustomRoutingTraffic -> Maybe Bool
denyAllTrafficToEndpoint :: Prelude.Maybe Prelude.Bool,
DenyCustomRoutingTraffic -> Maybe [Text]
destinationAddresses :: Prelude.Maybe [Prelude.Text],
DenyCustomRoutingTraffic -> Maybe [Natural]
destinationPorts :: Prelude.Maybe [Prelude.Natural],
DenyCustomRoutingTraffic -> Text
endpointGroupArn :: Prelude.Text,
DenyCustomRoutingTraffic -> Text
endpointId :: Prelude.Text
}
deriving (DenyCustomRoutingTraffic -> DenyCustomRoutingTraffic -> Bool
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]
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
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.
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)
newDenyCustomRoutingTraffic ::
Prelude.Text ->
Prelude.Text ->
DenyCustomRoutingTraffic
newDenyCustomRoutingTraffic :: Text -> Text -> DenyCustomRoutingTraffic
newDenyCustomRoutingTraffic
Text
pEndpointGroupArn_
Text
pEndpointId_ =
DenyCustomRoutingTraffic'
{ $sel:denyAllTrafficToEndpoint:DenyCustomRoutingTraffic' :: Maybe Bool
denyAllTrafficToEndpoint =
forall a. Maybe a
Prelude.Nothing,
$sel:destinationAddresses:DenyCustomRoutingTraffic' :: Maybe [Text]
destinationAddresses = forall a. Maybe a
Prelude.Nothing,
$sel:destinationPorts:DenyCustomRoutingTraffic' :: Maybe [Natural]
destinationPorts = forall a. Maybe a
Prelude.Nothing,
$sel:endpointGroupArn:DenyCustomRoutingTraffic' :: Text
endpointGroupArn = Text
pEndpointGroupArn_,
$sel:endpointId:DenyCustomRoutingTraffic' :: Text
endpointId = Text
pEndpointId_
}
denyCustomRoutingTraffic_denyAllTrafficToEndpoint :: Lens.Lens' DenyCustomRoutingTraffic (Prelude.Maybe Prelude.Bool)
denyCustomRoutingTraffic_denyAllTrafficToEndpoint :: Lens' DenyCustomRoutingTraffic (Maybe Bool)
denyCustomRoutingTraffic_denyAllTrafficToEndpoint = 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)
denyCustomRoutingTraffic_destinationAddresses :: Lens.Lens' DenyCustomRoutingTraffic (Prelude.Maybe [Prelude.Text])
denyCustomRoutingTraffic_destinationAddresses :: Lens' DenyCustomRoutingTraffic (Maybe [Text])
denyCustomRoutingTraffic_destinationAddresses = 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) 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
denyCustomRoutingTraffic_destinationPorts :: Lens.Lens' DenyCustomRoutingTraffic (Prelude.Maybe [Prelude.Natural])
denyCustomRoutingTraffic_destinationPorts :: Lens' DenyCustomRoutingTraffic (Maybe [Natural])
denyCustomRoutingTraffic_destinationPorts = 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) 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
denyCustomRoutingTraffic_endpointGroupArn :: Lens.Lens' DenyCustomRoutingTraffic Prelude.Text
denyCustomRoutingTraffic_endpointGroupArn :: Lens' DenyCustomRoutingTraffic Text
denyCustomRoutingTraffic_endpointGroupArn = 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)
denyCustomRoutingTraffic_endpointId :: Lens.Lens' DenyCustomRoutingTraffic Prelude.Text
denyCustomRoutingTraffic_endpointId :: Lens' DenyCustomRoutingTraffic Text
denyCustomRoutingTraffic_endpointId = 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 :: (Service -> Service)
-> DenyCustomRoutingTraffic -> Request DenyCustomRoutingTraffic
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DenyCustomRoutingTraffic
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DenyCustomRoutingTraffic)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
DenyCustomRoutingTrafficResponse
DenyCustomRoutingTrafficResponse'
instance Prelude.Hashable DenyCustomRoutingTraffic where
hashWithSalt :: Int -> DenyCustomRoutingTraffic -> Int
hashWithSalt Int
_salt DenyCustomRoutingTraffic' {Maybe Bool
Maybe [Natural]
Maybe [Text]
Text
endpointId :: Text
endpointGroupArn :: Text
destinationPorts :: Maybe [Natural]
destinationAddresses :: Maybe [Text]
denyAllTrafficToEndpoint :: Maybe Bool
$sel:endpointId:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Text
$sel:endpointGroupArn:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Text
$sel:destinationPorts:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe [Natural]
$sel:destinationAddresses:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe [Text]
$sel:denyAllTrafficToEndpoint:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
denyAllTrafficToEndpoint
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
destinationAddresses
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Natural]
destinationPorts
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
endpointGroupArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
endpointId
instance Prelude.NFData DenyCustomRoutingTraffic where
rnf :: DenyCustomRoutingTraffic -> ()
rnf DenyCustomRoutingTraffic' {Maybe Bool
Maybe [Natural]
Maybe [Text]
Text
endpointId :: Text
endpointGroupArn :: Text
destinationPorts :: Maybe [Natural]
destinationAddresses :: Maybe [Text]
denyAllTrafficToEndpoint :: Maybe Bool
$sel:endpointId:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Text
$sel:endpointGroupArn:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Text
$sel:destinationPorts:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe [Natural]
$sel:destinationAddresses:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe [Text]
$sel:denyAllTrafficToEndpoint:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
denyAllTrafficToEndpoint
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
destinationAddresses
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Natural]
destinationPorts
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
endpointGroupArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
endpointId
instance Data.ToHeaders DenyCustomRoutingTraffic where
toHeaders :: DenyCustomRoutingTraffic -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"GlobalAccelerator_V20180706.DenyCustomRoutingTraffic" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DenyCustomRoutingTraffic where
toJSON :: DenyCustomRoutingTraffic -> Value
toJSON DenyCustomRoutingTraffic' {Maybe Bool
Maybe [Natural]
Maybe [Text]
Text
endpointId :: Text
endpointGroupArn :: Text
destinationPorts :: Maybe [Natural]
destinationAddresses :: Maybe [Text]
denyAllTrafficToEndpoint :: Maybe Bool
$sel:endpointId:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Text
$sel:endpointGroupArn:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Text
$sel:destinationPorts:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe [Natural]
$sel:destinationAddresses:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe [Text]
$sel:denyAllTrafficToEndpoint:DenyCustomRoutingTraffic' :: DenyCustomRoutingTraffic -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DenyAllTrafficToEndpoint" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
denyAllTrafficToEndpoint,
(Key
"DestinationAddresses" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
destinationAddresses,
(Key
"DestinationPorts" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Natural]
destinationPorts,
forall a. a -> Maybe a
Prelude.Just
(Key
"EndpointGroupArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
endpointGroupArn),
forall a. a -> Maybe a
Prelude.Just (Key
"EndpointId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
endpointId)
]
)
instance Data.ToPath DenyCustomRoutingTraffic where
toPath :: DenyCustomRoutingTraffic -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DenyCustomRoutingTraffic where
toQuery :: DenyCustomRoutingTraffic -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DenyCustomRoutingTrafficResponse = DenyCustomRoutingTrafficResponse'
{
}
deriving (DenyCustomRoutingTrafficResponse
-> DenyCustomRoutingTrafficResponse -> Bool
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]
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
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.
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)
newDenyCustomRoutingTrafficResponse ::
DenyCustomRoutingTrafficResponse
newDenyCustomRoutingTrafficResponse :: DenyCustomRoutingTrafficResponse
newDenyCustomRoutingTrafficResponse =
DenyCustomRoutingTrafficResponse
DenyCustomRoutingTrafficResponse'
instance
Prelude.NFData
DenyCustomRoutingTrafficResponse
where
rnf :: DenyCustomRoutingTrafficResponse -> ()
rnf DenyCustomRoutingTrafficResponse
_ = ()