{-# 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.UpdateCustomRoutingListener
(
UpdateCustomRoutingListener (..),
newUpdateCustomRoutingListener,
updateCustomRoutingListener_listenerArn,
updateCustomRoutingListener_portRanges,
UpdateCustomRoutingListenerResponse (..),
newUpdateCustomRoutingListenerResponse,
updateCustomRoutingListenerResponse_listener,
updateCustomRoutingListenerResponse_httpStatus,
)
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
data UpdateCustomRoutingListener = UpdateCustomRoutingListener'
{
UpdateCustomRoutingListener -> Text
listenerArn :: Prelude.Text,
UpdateCustomRoutingListener -> NonEmpty PortRange
portRanges :: Prelude.NonEmpty PortRange
}
deriving (UpdateCustomRoutingListener -> UpdateCustomRoutingListener -> Bool
(UpdateCustomRoutingListener
-> UpdateCustomRoutingListener -> Bool)
-> (UpdateCustomRoutingListener
-> UpdateCustomRoutingListener -> Bool)
-> Eq UpdateCustomRoutingListener
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCustomRoutingListener -> UpdateCustomRoutingListener -> Bool
$c/= :: UpdateCustomRoutingListener -> UpdateCustomRoutingListener -> Bool
== :: UpdateCustomRoutingListener -> UpdateCustomRoutingListener -> Bool
$c== :: UpdateCustomRoutingListener -> UpdateCustomRoutingListener -> Bool
Prelude.Eq, ReadPrec [UpdateCustomRoutingListener]
ReadPrec UpdateCustomRoutingListener
Int -> ReadS UpdateCustomRoutingListener
ReadS [UpdateCustomRoutingListener]
(Int -> ReadS UpdateCustomRoutingListener)
-> ReadS [UpdateCustomRoutingListener]
-> ReadPrec UpdateCustomRoutingListener
-> ReadPrec [UpdateCustomRoutingListener]
-> Read UpdateCustomRoutingListener
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCustomRoutingListener]
$creadListPrec :: ReadPrec [UpdateCustomRoutingListener]
readPrec :: ReadPrec UpdateCustomRoutingListener
$creadPrec :: ReadPrec UpdateCustomRoutingListener
readList :: ReadS [UpdateCustomRoutingListener]
$creadList :: ReadS [UpdateCustomRoutingListener]
readsPrec :: Int -> ReadS UpdateCustomRoutingListener
$creadsPrec :: Int -> ReadS UpdateCustomRoutingListener
Prelude.Read, Int -> UpdateCustomRoutingListener -> ShowS
[UpdateCustomRoutingListener] -> ShowS
UpdateCustomRoutingListener -> String
(Int -> UpdateCustomRoutingListener -> ShowS)
-> (UpdateCustomRoutingListener -> String)
-> ([UpdateCustomRoutingListener] -> ShowS)
-> Show UpdateCustomRoutingListener
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCustomRoutingListener] -> ShowS
$cshowList :: [UpdateCustomRoutingListener] -> ShowS
show :: UpdateCustomRoutingListener -> String
$cshow :: UpdateCustomRoutingListener -> String
showsPrec :: Int -> UpdateCustomRoutingListener -> ShowS
$cshowsPrec :: Int -> UpdateCustomRoutingListener -> ShowS
Prelude.Show, (forall x.
UpdateCustomRoutingListener -> Rep UpdateCustomRoutingListener x)
-> (forall x.
Rep UpdateCustomRoutingListener x -> UpdateCustomRoutingListener)
-> Generic UpdateCustomRoutingListener
forall x.
Rep UpdateCustomRoutingListener x -> UpdateCustomRoutingListener
forall x.
UpdateCustomRoutingListener -> Rep UpdateCustomRoutingListener x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCustomRoutingListener x -> UpdateCustomRoutingListener
$cfrom :: forall x.
UpdateCustomRoutingListener -> Rep UpdateCustomRoutingListener x
Prelude.Generic)
newUpdateCustomRoutingListener ::
Prelude.Text ->
Prelude.NonEmpty PortRange ->
UpdateCustomRoutingListener
newUpdateCustomRoutingListener :: Text -> NonEmpty PortRange -> UpdateCustomRoutingListener
newUpdateCustomRoutingListener
Text
pListenerArn_
NonEmpty PortRange
pPortRanges_ =
UpdateCustomRoutingListener' :: Text -> NonEmpty PortRange -> UpdateCustomRoutingListener
UpdateCustomRoutingListener'
{ $sel:listenerArn:UpdateCustomRoutingListener' :: Text
listenerArn =
Text
pListenerArn_,
$sel:portRanges:UpdateCustomRoutingListener' :: NonEmpty PortRange
portRanges = Tagged (NonEmpty PortRange) (Identity (NonEmpty PortRange))
-> Tagged (NonEmpty PortRange) (Identity (NonEmpty PortRange))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty PortRange) (Identity (NonEmpty PortRange))
-> Tagged (NonEmpty PortRange) (Identity (NonEmpty PortRange)))
-> NonEmpty PortRange -> NonEmpty PortRange
forall t b. AReview t b -> b -> t
Lens.# NonEmpty PortRange
pPortRanges_
}
updateCustomRoutingListener_listenerArn :: Lens.Lens' UpdateCustomRoutingListener Prelude.Text
updateCustomRoutingListener_listenerArn :: (Text -> f Text)
-> UpdateCustomRoutingListener -> f UpdateCustomRoutingListener
updateCustomRoutingListener_listenerArn = (UpdateCustomRoutingListener -> Text)
-> (UpdateCustomRoutingListener
-> Text -> UpdateCustomRoutingListener)
-> Lens
UpdateCustomRoutingListener UpdateCustomRoutingListener Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomRoutingListener' {Text
listenerArn :: Text
$sel:listenerArn:UpdateCustomRoutingListener' :: UpdateCustomRoutingListener -> Text
listenerArn} -> Text
listenerArn) (\s :: UpdateCustomRoutingListener
s@UpdateCustomRoutingListener' {} Text
a -> UpdateCustomRoutingListener
s {$sel:listenerArn:UpdateCustomRoutingListener' :: Text
listenerArn = Text
a} :: UpdateCustomRoutingListener)
updateCustomRoutingListener_portRanges :: Lens.Lens' UpdateCustomRoutingListener (Prelude.NonEmpty PortRange)
updateCustomRoutingListener_portRanges :: (NonEmpty PortRange -> f (NonEmpty PortRange))
-> UpdateCustomRoutingListener -> f UpdateCustomRoutingListener
updateCustomRoutingListener_portRanges = (UpdateCustomRoutingListener -> NonEmpty PortRange)
-> (UpdateCustomRoutingListener
-> NonEmpty PortRange -> UpdateCustomRoutingListener)
-> Lens
UpdateCustomRoutingListener
UpdateCustomRoutingListener
(NonEmpty PortRange)
(NonEmpty PortRange)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomRoutingListener' {NonEmpty PortRange
portRanges :: NonEmpty PortRange
$sel:portRanges:UpdateCustomRoutingListener' :: UpdateCustomRoutingListener -> NonEmpty PortRange
portRanges} -> NonEmpty PortRange
portRanges) (\s :: UpdateCustomRoutingListener
s@UpdateCustomRoutingListener' {} NonEmpty PortRange
a -> UpdateCustomRoutingListener
s {$sel:portRanges:UpdateCustomRoutingListener' :: NonEmpty PortRange
portRanges = NonEmpty PortRange
a} :: UpdateCustomRoutingListener) ((NonEmpty PortRange -> f (NonEmpty PortRange))
-> UpdateCustomRoutingListener -> f UpdateCustomRoutingListener)
-> ((NonEmpty PortRange -> f (NonEmpty PortRange))
-> NonEmpty PortRange -> f (NonEmpty PortRange))
-> (NonEmpty PortRange -> f (NonEmpty PortRange))
-> UpdateCustomRoutingListener
-> f UpdateCustomRoutingListener
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty PortRange -> f (NonEmpty PortRange))
-> NonEmpty PortRange -> f (NonEmpty PortRange)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest UpdateCustomRoutingListener where
type
AWSResponse UpdateCustomRoutingListener =
UpdateCustomRoutingListenerResponse
request :: UpdateCustomRoutingListener -> Request UpdateCustomRoutingListener
request = Service
-> UpdateCustomRoutingListener
-> Request UpdateCustomRoutingListener
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateCustomRoutingListener
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateCustomRoutingListener)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateCustomRoutingListener))
-> Logger
-> Service
-> Proxy UpdateCustomRoutingListener
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateCustomRoutingListener)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe CustomRoutingListener
-> Int -> UpdateCustomRoutingListenerResponse
UpdateCustomRoutingListenerResponse'
(Maybe CustomRoutingListener
-> Int -> UpdateCustomRoutingListenerResponse)
-> Either String (Maybe CustomRoutingListener)
-> Either String (Int -> UpdateCustomRoutingListenerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe CustomRoutingListener)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Listener")
Either String (Int -> UpdateCustomRoutingListenerResponse)
-> Either String Int
-> Either String UpdateCustomRoutingListenerResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateCustomRoutingListener
instance Prelude.NFData UpdateCustomRoutingListener
instance Core.ToHeaders UpdateCustomRoutingListener where
toHeaders :: UpdateCustomRoutingListener -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateCustomRoutingListener -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"GlobalAccelerator_V20180706.UpdateCustomRoutingListener" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateCustomRoutingListener where
toJSON :: UpdateCustomRoutingListener -> Value
toJSON UpdateCustomRoutingListener' {NonEmpty PortRange
Text
portRanges :: NonEmpty PortRange
listenerArn :: Text
$sel:portRanges:UpdateCustomRoutingListener' :: UpdateCustomRoutingListener -> NonEmpty PortRange
$sel:listenerArn:UpdateCustomRoutingListener' :: UpdateCustomRoutingListener -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ListenerArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
listenerArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PortRanges" Text -> NonEmpty PortRange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty PortRange
portRanges)
]
)
instance Core.ToPath UpdateCustomRoutingListener where
toPath :: UpdateCustomRoutingListener -> ByteString
toPath = ByteString -> UpdateCustomRoutingListener -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateCustomRoutingListener where
toQuery :: UpdateCustomRoutingListener -> QueryString
toQuery = QueryString -> UpdateCustomRoutingListener -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateCustomRoutingListenerResponse = UpdateCustomRoutingListenerResponse'
{
UpdateCustomRoutingListenerResponse -> Maybe CustomRoutingListener
listener :: Prelude.Maybe CustomRoutingListener,
UpdateCustomRoutingListenerResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateCustomRoutingListenerResponse
-> UpdateCustomRoutingListenerResponse -> Bool
(UpdateCustomRoutingListenerResponse
-> UpdateCustomRoutingListenerResponse -> Bool)
-> (UpdateCustomRoutingListenerResponse
-> UpdateCustomRoutingListenerResponse -> Bool)
-> Eq UpdateCustomRoutingListenerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCustomRoutingListenerResponse
-> UpdateCustomRoutingListenerResponse -> Bool
$c/= :: UpdateCustomRoutingListenerResponse
-> UpdateCustomRoutingListenerResponse -> Bool
== :: UpdateCustomRoutingListenerResponse
-> UpdateCustomRoutingListenerResponse -> Bool
$c== :: UpdateCustomRoutingListenerResponse
-> UpdateCustomRoutingListenerResponse -> Bool
Prelude.Eq, ReadPrec [UpdateCustomRoutingListenerResponse]
ReadPrec UpdateCustomRoutingListenerResponse
Int -> ReadS UpdateCustomRoutingListenerResponse
ReadS [UpdateCustomRoutingListenerResponse]
(Int -> ReadS UpdateCustomRoutingListenerResponse)
-> ReadS [UpdateCustomRoutingListenerResponse]
-> ReadPrec UpdateCustomRoutingListenerResponse
-> ReadPrec [UpdateCustomRoutingListenerResponse]
-> Read UpdateCustomRoutingListenerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCustomRoutingListenerResponse]
$creadListPrec :: ReadPrec [UpdateCustomRoutingListenerResponse]
readPrec :: ReadPrec UpdateCustomRoutingListenerResponse
$creadPrec :: ReadPrec UpdateCustomRoutingListenerResponse
readList :: ReadS [UpdateCustomRoutingListenerResponse]
$creadList :: ReadS [UpdateCustomRoutingListenerResponse]
readsPrec :: Int -> ReadS UpdateCustomRoutingListenerResponse
$creadsPrec :: Int -> ReadS UpdateCustomRoutingListenerResponse
Prelude.Read, Int -> UpdateCustomRoutingListenerResponse -> ShowS
[UpdateCustomRoutingListenerResponse] -> ShowS
UpdateCustomRoutingListenerResponse -> String
(Int -> UpdateCustomRoutingListenerResponse -> ShowS)
-> (UpdateCustomRoutingListenerResponse -> String)
-> ([UpdateCustomRoutingListenerResponse] -> ShowS)
-> Show UpdateCustomRoutingListenerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCustomRoutingListenerResponse] -> ShowS
$cshowList :: [UpdateCustomRoutingListenerResponse] -> ShowS
show :: UpdateCustomRoutingListenerResponse -> String
$cshow :: UpdateCustomRoutingListenerResponse -> String
showsPrec :: Int -> UpdateCustomRoutingListenerResponse -> ShowS
$cshowsPrec :: Int -> UpdateCustomRoutingListenerResponse -> ShowS
Prelude.Show, (forall x.
UpdateCustomRoutingListenerResponse
-> Rep UpdateCustomRoutingListenerResponse x)
-> (forall x.
Rep UpdateCustomRoutingListenerResponse x
-> UpdateCustomRoutingListenerResponse)
-> Generic UpdateCustomRoutingListenerResponse
forall x.
Rep UpdateCustomRoutingListenerResponse x
-> UpdateCustomRoutingListenerResponse
forall x.
UpdateCustomRoutingListenerResponse
-> Rep UpdateCustomRoutingListenerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCustomRoutingListenerResponse x
-> UpdateCustomRoutingListenerResponse
$cfrom :: forall x.
UpdateCustomRoutingListenerResponse
-> Rep UpdateCustomRoutingListenerResponse x
Prelude.Generic)
newUpdateCustomRoutingListenerResponse ::
Prelude.Int ->
UpdateCustomRoutingListenerResponse
newUpdateCustomRoutingListenerResponse :: Int -> UpdateCustomRoutingListenerResponse
newUpdateCustomRoutingListenerResponse Int
pHttpStatus_ =
UpdateCustomRoutingListenerResponse' :: Maybe CustomRoutingListener
-> Int -> UpdateCustomRoutingListenerResponse
UpdateCustomRoutingListenerResponse'
{ $sel:listener:UpdateCustomRoutingListenerResponse' :: Maybe CustomRoutingListener
listener =
Maybe CustomRoutingListener
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateCustomRoutingListenerResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateCustomRoutingListenerResponse_listener :: Lens.Lens' UpdateCustomRoutingListenerResponse (Prelude.Maybe CustomRoutingListener)
updateCustomRoutingListenerResponse_listener :: (Maybe CustomRoutingListener -> f (Maybe CustomRoutingListener))
-> UpdateCustomRoutingListenerResponse
-> f UpdateCustomRoutingListenerResponse
updateCustomRoutingListenerResponse_listener = (UpdateCustomRoutingListenerResponse
-> Maybe CustomRoutingListener)
-> (UpdateCustomRoutingListenerResponse
-> Maybe CustomRoutingListener
-> UpdateCustomRoutingListenerResponse)
-> Lens
UpdateCustomRoutingListenerResponse
UpdateCustomRoutingListenerResponse
(Maybe CustomRoutingListener)
(Maybe CustomRoutingListener)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomRoutingListenerResponse' {Maybe CustomRoutingListener
listener :: Maybe CustomRoutingListener
$sel:listener:UpdateCustomRoutingListenerResponse' :: UpdateCustomRoutingListenerResponse -> Maybe CustomRoutingListener
listener} -> Maybe CustomRoutingListener
listener) (\s :: UpdateCustomRoutingListenerResponse
s@UpdateCustomRoutingListenerResponse' {} Maybe CustomRoutingListener
a -> UpdateCustomRoutingListenerResponse
s {$sel:listener:UpdateCustomRoutingListenerResponse' :: Maybe CustomRoutingListener
listener = Maybe CustomRoutingListener
a} :: UpdateCustomRoutingListenerResponse)
updateCustomRoutingListenerResponse_httpStatus :: Lens.Lens' UpdateCustomRoutingListenerResponse Prelude.Int
updateCustomRoutingListenerResponse_httpStatus :: (Int -> f Int)
-> UpdateCustomRoutingListenerResponse
-> f UpdateCustomRoutingListenerResponse
updateCustomRoutingListenerResponse_httpStatus = (UpdateCustomRoutingListenerResponse -> Int)
-> (UpdateCustomRoutingListenerResponse
-> Int -> UpdateCustomRoutingListenerResponse)
-> Lens
UpdateCustomRoutingListenerResponse
UpdateCustomRoutingListenerResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomRoutingListenerResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateCustomRoutingListenerResponse' :: UpdateCustomRoutingListenerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateCustomRoutingListenerResponse
s@UpdateCustomRoutingListenerResponse' {} Int
a -> UpdateCustomRoutingListenerResponse
s {$sel:httpStatus:UpdateCustomRoutingListenerResponse' :: Int
httpStatus = Int
a} :: UpdateCustomRoutingListenerResponse)
instance
Prelude.NFData
UpdateCustomRoutingListenerResponse