{-# 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.ELBV2.SetRulePriorities
(
SetRulePriorities (..),
newSetRulePriorities,
setRulePriorities_rulePriorities,
SetRulePrioritiesResponse (..),
newSetRulePrioritiesResponse,
setRulePrioritiesResponse_rules,
setRulePrioritiesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ELBV2.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 SetRulePriorities = SetRulePriorities'
{
SetRulePriorities -> [RulePriorityPair]
rulePriorities :: [RulePriorityPair]
}
deriving (SetRulePriorities -> SetRulePriorities -> Bool
(SetRulePriorities -> SetRulePriorities -> Bool)
-> (SetRulePriorities -> SetRulePriorities -> Bool)
-> Eq SetRulePriorities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetRulePriorities -> SetRulePriorities -> Bool
$c/= :: SetRulePriorities -> SetRulePriorities -> Bool
== :: SetRulePriorities -> SetRulePriorities -> Bool
$c== :: SetRulePriorities -> SetRulePriorities -> Bool
Prelude.Eq, ReadPrec [SetRulePriorities]
ReadPrec SetRulePriorities
Int -> ReadS SetRulePriorities
ReadS [SetRulePriorities]
(Int -> ReadS SetRulePriorities)
-> ReadS [SetRulePriorities]
-> ReadPrec SetRulePriorities
-> ReadPrec [SetRulePriorities]
-> Read SetRulePriorities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetRulePriorities]
$creadListPrec :: ReadPrec [SetRulePriorities]
readPrec :: ReadPrec SetRulePriorities
$creadPrec :: ReadPrec SetRulePriorities
readList :: ReadS [SetRulePriorities]
$creadList :: ReadS [SetRulePriorities]
readsPrec :: Int -> ReadS SetRulePriorities
$creadsPrec :: Int -> ReadS SetRulePriorities
Prelude.Read, Int -> SetRulePriorities -> ShowS
[SetRulePriorities] -> ShowS
SetRulePriorities -> String
(Int -> SetRulePriorities -> ShowS)
-> (SetRulePriorities -> String)
-> ([SetRulePriorities] -> ShowS)
-> Show SetRulePriorities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetRulePriorities] -> ShowS
$cshowList :: [SetRulePriorities] -> ShowS
show :: SetRulePriorities -> String
$cshow :: SetRulePriorities -> String
showsPrec :: Int -> SetRulePriorities -> ShowS
$cshowsPrec :: Int -> SetRulePriorities -> ShowS
Prelude.Show, (forall x. SetRulePriorities -> Rep SetRulePriorities x)
-> (forall x. Rep SetRulePriorities x -> SetRulePriorities)
-> Generic SetRulePriorities
forall x. Rep SetRulePriorities x -> SetRulePriorities
forall x. SetRulePriorities -> Rep SetRulePriorities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetRulePriorities x -> SetRulePriorities
$cfrom :: forall x. SetRulePriorities -> Rep SetRulePriorities x
Prelude.Generic)
newSetRulePriorities ::
SetRulePriorities
newSetRulePriorities :: SetRulePriorities
newSetRulePriorities =
SetRulePriorities' :: [RulePriorityPair] -> SetRulePriorities
SetRulePriorities' {$sel:rulePriorities:SetRulePriorities' :: [RulePriorityPair]
rulePriorities = [RulePriorityPair]
forall a. Monoid a => a
Prelude.mempty}
setRulePriorities_rulePriorities :: Lens.Lens' SetRulePriorities [RulePriorityPair]
setRulePriorities_rulePriorities :: ([RulePriorityPair] -> f [RulePriorityPair])
-> SetRulePriorities -> f SetRulePriorities
setRulePriorities_rulePriorities = (SetRulePriorities -> [RulePriorityPair])
-> (SetRulePriorities -> [RulePriorityPair] -> SetRulePriorities)
-> Lens
SetRulePriorities
SetRulePriorities
[RulePriorityPair]
[RulePriorityPair]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetRulePriorities' {[RulePriorityPair]
rulePriorities :: [RulePriorityPair]
$sel:rulePriorities:SetRulePriorities' :: SetRulePriorities -> [RulePriorityPair]
rulePriorities} -> [RulePriorityPair]
rulePriorities) (\s :: SetRulePriorities
s@SetRulePriorities' {} [RulePriorityPair]
a -> SetRulePriorities
s {$sel:rulePriorities:SetRulePriorities' :: [RulePriorityPair]
rulePriorities = [RulePriorityPair]
a} :: SetRulePriorities) (([RulePriorityPair] -> f [RulePriorityPair])
-> SetRulePriorities -> f SetRulePriorities)
-> (([RulePriorityPair] -> f [RulePriorityPair])
-> [RulePriorityPair] -> f [RulePriorityPair])
-> ([RulePriorityPair] -> f [RulePriorityPair])
-> SetRulePriorities
-> f SetRulePriorities
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RulePriorityPair] -> f [RulePriorityPair])
-> [RulePriorityPair] -> f [RulePriorityPair]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest SetRulePriorities where
type
AWSResponse SetRulePriorities =
SetRulePrioritiesResponse
request :: SetRulePriorities -> Request SetRulePriorities
request = Service -> SetRulePriorities -> Request SetRulePriorities
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy SetRulePriorities
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetRulePriorities)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse SetRulePriorities))
-> Logger
-> Service
-> Proxy SetRulePriorities
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetRulePriorities)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"SetRulePrioritiesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [Rule] -> Int -> SetRulePrioritiesResponse
SetRulePrioritiesResponse'
(Maybe [Rule] -> Int -> SetRulePrioritiesResponse)
-> Either String (Maybe [Rule])
-> Either String (Int -> SetRulePrioritiesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Rules" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [Rule]))
-> Either String (Maybe [Rule])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Rule])
-> [Node] -> Either String (Maybe [Rule])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Rule]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either String (Int -> SetRulePrioritiesResponse)
-> Either String Int -> Either String SetRulePrioritiesResponse
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 SetRulePriorities
instance Prelude.NFData SetRulePriorities
instance Core.ToHeaders SetRulePriorities where
toHeaders :: SetRulePriorities -> ResponseHeaders
toHeaders = ResponseHeaders -> SetRulePriorities -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath SetRulePriorities where
toPath :: SetRulePriorities -> ByteString
toPath = ByteString -> SetRulePriorities -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SetRulePriorities where
toQuery :: SetRulePriorities -> QueryString
toQuery SetRulePriorities' {[RulePriorityPair]
rulePriorities :: [RulePriorityPair]
$sel:rulePriorities:SetRulePriorities' :: SetRulePriorities -> [RulePriorityPair]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"SetRulePriorities" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-12-01" :: Prelude.ByteString),
ByteString
"RulePriorities"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [RulePriorityPair] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [RulePriorityPair]
rulePriorities
]
data SetRulePrioritiesResponse = SetRulePrioritiesResponse'
{
SetRulePrioritiesResponse -> Maybe [Rule]
rules :: Prelude.Maybe [Rule],
SetRulePrioritiesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SetRulePrioritiesResponse -> SetRulePrioritiesResponse -> Bool
(SetRulePrioritiesResponse -> SetRulePrioritiesResponse -> Bool)
-> (SetRulePrioritiesResponse -> SetRulePrioritiesResponse -> Bool)
-> Eq SetRulePrioritiesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetRulePrioritiesResponse -> SetRulePrioritiesResponse -> Bool
$c/= :: SetRulePrioritiesResponse -> SetRulePrioritiesResponse -> Bool
== :: SetRulePrioritiesResponse -> SetRulePrioritiesResponse -> Bool
$c== :: SetRulePrioritiesResponse -> SetRulePrioritiesResponse -> Bool
Prelude.Eq, ReadPrec [SetRulePrioritiesResponse]
ReadPrec SetRulePrioritiesResponse
Int -> ReadS SetRulePrioritiesResponse
ReadS [SetRulePrioritiesResponse]
(Int -> ReadS SetRulePrioritiesResponse)
-> ReadS [SetRulePrioritiesResponse]
-> ReadPrec SetRulePrioritiesResponse
-> ReadPrec [SetRulePrioritiesResponse]
-> Read SetRulePrioritiesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetRulePrioritiesResponse]
$creadListPrec :: ReadPrec [SetRulePrioritiesResponse]
readPrec :: ReadPrec SetRulePrioritiesResponse
$creadPrec :: ReadPrec SetRulePrioritiesResponse
readList :: ReadS [SetRulePrioritiesResponse]
$creadList :: ReadS [SetRulePrioritiesResponse]
readsPrec :: Int -> ReadS SetRulePrioritiesResponse
$creadsPrec :: Int -> ReadS SetRulePrioritiesResponse
Prelude.Read, Int -> SetRulePrioritiesResponse -> ShowS
[SetRulePrioritiesResponse] -> ShowS
SetRulePrioritiesResponse -> String
(Int -> SetRulePrioritiesResponse -> ShowS)
-> (SetRulePrioritiesResponse -> String)
-> ([SetRulePrioritiesResponse] -> ShowS)
-> Show SetRulePrioritiesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetRulePrioritiesResponse] -> ShowS
$cshowList :: [SetRulePrioritiesResponse] -> ShowS
show :: SetRulePrioritiesResponse -> String
$cshow :: SetRulePrioritiesResponse -> String
showsPrec :: Int -> SetRulePrioritiesResponse -> ShowS
$cshowsPrec :: Int -> SetRulePrioritiesResponse -> ShowS
Prelude.Show, (forall x.
SetRulePrioritiesResponse -> Rep SetRulePrioritiesResponse x)
-> (forall x.
Rep SetRulePrioritiesResponse x -> SetRulePrioritiesResponse)
-> Generic SetRulePrioritiesResponse
forall x.
Rep SetRulePrioritiesResponse x -> SetRulePrioritiesResponse
forall x.
SetRulePrioritiesResponse -> Rep SetRulePrioritiesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetRulePrioritiesResponse x -> SetRulePrioritiesResponse
$cfrom :: forall x.
SetRulePrioritiesResponse -> Rep SetRulePrioritiesResponse x
Prelude.Generic)
newSetRulePrioritiesResponse ::
Prelude.Int ->
SetRulePrioritiesResponse
newSetRulePrioritiesResponse :: Int -> SetRulePrioritiesResponse
newSetRulePrioritiesResponse Int
pHttpStatus_ =
SetRulePrioritiesResponse' :: Maybe [Rule] -> Int -> SetRulePrioritiesResponse
SetRulePrioritiesResponse'
{ $sel:rules:SetRulePrioritiesResponse' :: Maybe [Rule]
rules = Maybe [Rule]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SetRulePrioritiesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
setRulePrioritiesResponse_rules :: Lens.Lens' SetRulePrioritiesResponse (Prelude.Maybe [Rule])
setRulePrioritiesResponse_rules :: (Maybe [Rule] -> f (Maybe [Rule]))
-> SetRulePrioritiesResponse -> f SetRulePrioritiesResponse
setRulePrioritiesResponse_rules = (SetRulePrioritiesResponse -> Maybe [Rule])
-> (SetRulePrioritiesResponse
-> Maybe [Rule] -> SetRulePrioritiesResponse)
-> Lens
SetRulePrioritiesResponse
SetRulePrioritiesResponse
(Maybe [Rule])
(Maybe [Rule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetRulePrioritiesResponse' {Maybe [Rule]
rules :: Maybe [Rule]
$sel:rules:SetRulePrioritiesResponse' :: SetRulePrioritiesResponse -> Maybe [Rule]
rules} -> Maybe [Rule]
rules) (\s :: SetRulePrioritiesResponse
s@SetRulePrioritiesResponse' {} Maybe [Rule]
a -> SetRulePrioritiesResponse
s {$sel:rules:SetRulePrioritiesResponse' :: Maybe [Rule]
rules = Maybe [Rule]
a} :: SetRulePrioritiesResponse) ((Maybe [Rule] -> f (Maybe [Rule]))
-> SetRulePrioritiesResponse -> f SetRulePrioritiesResponse)
-> ((Maybe [Rule] -> f (Maybe [Rule]))
-> Maybe [Rule] -> f (Maybe [Rule]))
-> (Maybe [Rule] -> f (Maybe [Rule]))
-> SetRulePrioritiesResponse
-> f SetRulePrioritiesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Rule] [Rule] [Rule] [Rule]
-> Iso (Maybe [Rule]) (Maybe [Rule]) (Maybe [Rule]) (Maybe [Rule])
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 [Rule] [Rule] [Rule] [Rule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
setRulePrioritiesResponse_httpStatus :: Lens.Lens' SetRulePrioritiesResponse Prelude.Int
setRulePrioritiesResponse_httpStatus :: (Int -> f Int)
-> SetRulePrioritiesResponse -> f SetRulePrioritiesResponse
setRulePrioritiesResponse_httpStatus = (SetRulePrioritiesResponse -> Int)
-> (SetRulePrioritiesResponse -> Int -> SetRulePrioritiesResponse)
-> Lens SetRulePrioritiesResponse SetRulePrioritiesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetRulePrioritiesResponse' {Int
httpStatus :: Int
$sel:httpStatus:SetRulePrioritiesResponse' :: SetRulePrioritiesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SetRulePrioritiesResponse
s@SetRulePrioritiesResponse' {} Int
a -> SetRulePrioritiesResponse
s {$sel:httpStatus:SetRulePrioritiesResponse' :: Int
httpStatus = Int
a} :: SetRulePrioritiesResponse)
instance Prelude.NFData SetRulePrioritiesResponse