{-# 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.Budgets.DescribeSubscribersForNotification
(
DescribeSubscribersForNotification (..),
newDescribeSubscribersForNotification,
describeSubscribersForNotification_nextToken,
describeSubscribersForNotification_maxResults,
describeSubscribersForNotification_accountId,
describeSubscribersForNotification_budgetName,
describeSubscribersForNotification_notification,
DescribeSubscribersForNotificationResponse (..),
newDescribeSubscribersForNotificationResponse,
describeSubscribersForNotificationResponse_nextToken,
describeSubscribersForNotificationResponse_subscribers,
describeSubscribersForNotificationResponse_httpStatus,
)
where
import Amazonka.Budgets.Types
import qualified Amazonka.Core as Core
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 DescribeSubscribersForNotification = DescribeSubscribersForNotification'
{
DescribeSubscribersForNotification -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeSubscribersForNotification -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
DescribeSubscribersForNotification -> Text
accountId :: Prelude.Text,
DescribeSubscribersForNotification -> Text
budgetName :: Prelude.Text,
DescribeSubscribersForNotification -> Notification
notification :: Notification
}
deriving (DescribeSubscribersForNotification
-> DescribeSubscribersForNotification -> Bool
(DescribeSubscribersForNotification
-> DescribeSubscribersForNotification -> Bool)
-> (DescribeSubscribersForNotification
-> DescribeSubscribersForNotification -> Bool)
-> Eq DescribeSubscribersForNotification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSubscribersForNotification
-> DescribeSubscribersForNotification -> Bool
$c/= :: DescribeSubscribersForNotification
-> DescribeSubscribersForNotification -> Bool
== :: DescribeSubscribersForNotification
-> DescribeSubscribersForNotification -> Bool
$c== :: DescribeSubscribersForNotification
-> DescribeSubscribersForNotification -> Bool
Prelude.Eq, ReadPrec [DescribeSubscribersForNotification]
ReadPrec DescribeSubscribersForNotification
Int -> ReadS DescribeSubscribersForNotification
ReadS [DescribeSubscribersForNotification]
(Int -> ReadS DescribeSubscribersForNotification)
-> ReadS [DescribeSubscribersForNotification]
-> ReadPrec DescribeSubscribersForNotification
-> ReadPrec [DescribeSubscribersForNotification]
-> Read DescribeSubscribersForNotification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSubscribersForNotification]
$creadListPrec :: ReadPrec [DescribeSubscribersForNotification]
readPrec :: ReadPrec DescribeSubscribersForNotification
$creadPrec :: ReadPrec DescribeSubscribersForNotification
readList :: ReadS [DescribeSubscribersForNotification]
$creadList :: ReadS [DescribeSubscribersForNotification]
readsPrec :: Int -> ReadS DescribeSubscribersForNotification
$creadsPrec :: Int -> ReadS DescribeSubscribersForNotification
Prelude.Read, Int -> DescribeSubscribersForNotification -> ShowS
[DescribeSubscribersForNotification] -> ShowS
DescribeSubscribersForNotification -> String
(Int -> DescribeSubscribersForNotification -> ShowS)
-> (DescribeSubscribersForNotification -> String)
-> ([DescribeSubscribersForNotification] -> ShowS)
-> Show DescribeSubscribersForNotification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSubscribersForNotification] -> ShowS
$cshowList :: [DescribeSubscribersForNotification] -> ShowS
show :: DescribeSubscribersForNotification -> String
$cshow :: DescribeSubscribersForNotification -> String
showsPrec :: Int -> DescribeSubscribersForNotification -> ShowS
$cshowsPrec :: Int -> DescribeSubscribersForNotification -> ShowS
Prelude.Show, (forall x.
DescribeSubscribersForNotification
-> Rep DescribeSubscribersForNotification x)
-> (forall x.
Rep DescribeSubscribersForNotification x
-> DescribeSubscribersForNotification)
-> Generic DescribeSubscribersForNotification
forall x.
Rep DescribeSubscribersForNotification x
-> DescribeSubscribersForNotification
forall x.
DescribeSubscribersForNotification
-> Rep DescribeSubscribersForNotification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSubscribersForNotification x
-> DescribeSubscribersForNotification
$cfrom :: forall x.
DescribeSubscribersForNotification
-> Rep DescribeSubscribersForNotification x
Prelude.Generic)
newDescribeSubscribersForNotification ::
Prelude.Text ->
Prelude.Text ->
Notification ->
DescribeSubscribersForNotification
newDescribeSubscribersForNotification :: Text -> Text -> Notification -> DescribeSubscribersForNotification
newDescribeSubscribersForNotification
Text
pAccountId_
Text
pBudgetName_
Notification
pNotification_ =
DescribeSubscribersForNotification' :: Maybe Text
-> Maybe Natural
-> Text
-> Text
-> Notification
-> DescribeSubscribersForNotification
DescribeSubscribersForNotification'
{ $sel:nextToken:DescribeSubscribersForNotification' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:DescribeSubscribersForNotification' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:DescribeSubscribersForNotification' :: Text
accountId = Text
pAccountId_,
$sel:budgetName:DescribeSubscribersForNotification' :: Text
budgetName = Text
pBudgetName_,
$sel:notification:DescribeSubscribersForNotification' :: Notification
notification = Notification
pNotification_
}
describeSubscribersForNotification_nextToken :: Lens.Lens' DescribeSubscribersForNotification (Prelude.Maybe Prelude.Text)
describeSubscribersForNotification_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeSubscribersForNotification
-> f DescribeSubscribersForNotification
describeSubscribersForNotification_nextToken = (DescribeSubscribersForNotification -> Maybe Text)
-> (DescribeSubscribersForNotification
-> Maybe Text -> DescribeSubscribersForNotification)
-> Lens
DescribeSubscribersForNotification
DescribeSubscribersForNotification
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSubscribersForNotification' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeSubscribersForNotification' :: DescribeSubscribersForNotification -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeSubscribersForNotification
s@DescribeSubscribersForNotification' {} Maybe Text
a -> DescribeSubscribersForNotification
s {$sel:nextToken:DescribeSubscribersForNotification' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeSubscribersForNotification)
describeSubscribersForNotification_maxResults :: Lens.Lens' DescribeSubscribersForNotification (Prelude.Maybe Prelude.Natural)
describeSubscribersForNotification_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeSubscribersForNotification
-> f DescribeSubscribersForNotification
describeSubscribersForNotification_maxResults = (DescribeSubscribersForNotification -> Maybe Natural)
-> (DescribeSubscribersForNotification
-> Maybe Natural -> DescribeSubscribersForNotification)
-> Lens
DescribeSubscribersForNotification
DescribeSubscribersForNotification
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSubscribersForNotification' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeSubscribersForNotification' :: DescribeSubscribersForNotification -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeSubscribersForNotification
s@DescribeSubscribersForNotification' {} Maybe Natural
a -> DescribeSubscribersForNotification
s {$sel:maxResults:DescribeSubscribersForNotification' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeSubscribersForNotification)
describeSubscribersForNotification_accountId :: Lens.Lens' DescribeSubscribersForNotification Prelude.Text
describeSubscribersForNotification_accountId :: (Text -> f Text)
-> DescribeSubscribersForNotification
-> f DescribeSubscribersForNotification
describeSubscribersForNotification_accountId = (DescribeSubscribersForNotification -> Text)
-> (DescribeSubscribersForNotification
-> Text -> DescribeSubscribersForNotification)
-> Lens
DescribeSubscribersForNotification
DescribeSubscribersForNotification
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSubscribersForNotification' {Text
accountId :: Text
$sel:accountId:DescribeSubscribersForNotification' :: DescribeSubscribersForNotification -> Text
accountId} -> Text
accountId) (\s :: DescribeSubscribersForNotification
s@DescribeSubscribersForNotification' {} Text
a -> DescribeSubscribersForNotification
s {$sel:accountId:DescribeSubscribersForNotification' :: Text
accountId = Text
a} :: DescribeSubscribersForNotification)
describeSubscribersForNotification_budgetName :: Lens.Lens' DescribeSubscribersForNotification Prelude.Text
describeSubscribersForNotification_budgetName :: (Text -> f Text)
-> DescribeSubscribersForNotification
-> f DescribeSubscribersForNotification
describeSubscribersForNotification_budgetName = (DescribeSubscribersForNotification -> Text)
-> (DescribeSubscribersForNotification
-> Text -> DescribeSubscribersForNotification)
-> Lens
DescribeSubscribersForNotification
DescribeSubscribersForNotification
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSubscribersForNotification' {Text
budgetName :: Text
$sel:budgetName:DescribeSubscribersForNotification' :: DescribeSubscribersForNotification -> Text
budgetName} -> Text
budgetName) (\s :: DescribeSubscribersForNotification
s@DescribeSubscribersForNotification' {} Text
a -> DescribeSubscribersForNotification
s {$sel:budgetName:DescribeSubscribersForNotification' :: Text
budgetName = Text
a} :: DescribeSubscribersForNotification)
describeSubscribersForNotification_notification :: Lens.Lens' DescribeSubscribersForNotification Notification
describeSubscribersForNotification_notification :: (Notification -> f Notification)
-> DescribeSubscribersForNotification
-> f DescribeSubscribersForNotification
describeSubscribersForNotification_notification = (DescribeSubscribersForNotification -> Notification)
-> (DescribeSubscribersForNotification
-> Notification -> DescribeSubscribersForNotification)
-> Lens
DescribeSubscribersForNotification
DescribeSubscribersForNotification
Notification
Notification
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSubscribersForNotification' {Notification
notification :: Notification
$sel:notification:DescribeSubscribersForNotification' :: DescribeSubscribersForNotification -> Notification
notification} -> Notification
notification) (\s :: DescribeSubscribersForNotification
s@DescribeSubscribersForNotification' {} Notification
a -> DescribeSubscribersForNotification
s {$sel:notification:DescribeSubscribersForNotification' :: Notification
notification = Notification
a} :: DescribeSubscribersForNotification)
instance
Core.AWSPager
DescribeSubscribersForNotification
where
page :: DescribeSubscribersForNotification
-> AWSResponse DescribeSubscribersForNotification
-> Maybe DescribeSubscribersForNotification
page DescribeSubscribersForNotification
rq AWSResponse DescribeSubscribersForNotification
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeSubscribersForNotification
DescribeSubscribersForNotificationResponse
rs
DescribeSubscribersForNotificationResponse
-> Getting
(First Text) DescribeSubscribersForNotificationResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeSubscribersForNotificationResponse
-> Const (First Text) DescribeSubscribersForNotificationResponse
Lens' DescribeSubscribersForNotificationResponse (Maybe Text)
describeSubscribersForNotificationResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeSubscribersForNotificationResponse
-> Const (First Text) DescribeSubscribersForNotificationResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
(First Text) DescribeSubscribersForNotificationResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeSubscribersForNotification
forall a. Maybe a
Prelude.Nothing
| Maybe [Subscriber] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeSubscribersForNotification
DescribeSubscribersForNotificationResponse
rs
DescribeSubscribersForNotificationResponse
-> Getting
(First [Subscriber])
DescribeSubscribersForNotificationResponse
[Subscriber]
-> Maybe [Subscriber]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe (NonEmpty Subscriber)
-> Const (First [Subscriber]) (Maybe (NonEmpty Subscriber)))
-> DescribeSubscribersForNotificationResponse
-> Const
(First [Subscriber]) DescribeSubscribersForNotificationResponse
Lens'
DescribeSubscribersForNotificationResponse
(Maybe (NonEmpty Subscriber))
describeSubscribersForNotificationResponse_subscribers
((Maybe (NonEmpty Subscriber)
-> Const (First [Subscriber]) (Maybe (NonEmpty Subscriber)))
-> DescribeSubscribersForNotificationResponse
-> Const
(First [Subscriber]) DescribeSubscribersForNotificationResponse)
-> (([Subscriber] -> Const (First [Subscriber]) [Subscriber])
-> Maybe (NonEmpty Subscriber)
-> Const (First [Subscriber]) (Maybe (NonEmpty Subscriber)))
-> Getting
(First [Subscriber])
DescribeSubscribersForNotificationResponse
[Subscriber]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Subscriber
-> Const (First [Subscriber]) (NonEmpty Subscriber))
-> Maybe (NonEmpty Subscriber)
-> Const (First [Subscriber]) (Maybe (NonEmpty Subscriber))
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
((NonEmpty Subscriber
-> Const (First [Subscriber]) (NonEmpty Subscriber))
-> Maybe (NonEmpty Subscriber)
-> Const (First [Subscriber]) (Maybe (NonEmpty Subscriber)))
-> (([Subscriber] -> Const (First [Subscriber]) [Subscriber])
-> NonEmpty Subscriber
-> Const (First [Subscriber]) (NonEmpty Subscriber))
-> ([Subscriber] -> Const (First [Subscriber]) [Subscriber])
-> Maybe (NonEmpty Subscriber)
-> Const (First [Subscriber]) (Maybe (NonEmpty Subscriber))
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Subscriber -> [Subscriber])
-> ([Subscriber] -> Const (First [Subscriber]) [Subscriber])
-> NonEmpty Subscriber
-> Const (First [Subscriber]) (NonEmpty Subscriber)
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to NonEmpty Subscriber -> [Subscriber]
forall l. IsList l => l -> [Item l]
Prelude.toList
) =
Maybe DescribeSubscribersForNotification
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
DescribeSubscribersForNotification
-> Maybe DescribeSubscribersForNotification
forall a. a -> Maybe a
Prelude.Just (DescribeSubscribersForNotification
-> Maybe DescribeSubscribersForNotification)
-> DescribeSubscribersForNotification
-> Maybe DescribeSubscribersForNotification
forall a b. (a -> b) -> a -> b
Prelude.$
DescribeSubscribersForNotification
rq
DescribeSubscribersForNotification
-> (DescribeSubscribersForNotification
-> DescribeSubscribersForNotification)
-> DescribeSubscribersForNotification
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeSubscribersForNotification
-> Identity DescribeSubscribersForNotification
Lens
DescribeSubscribersForNotification
DescribeSubscribersForNotification
(Maybe Text)
(Maybe Text)
describeSubscribersForNotification_nextToken
((Maybe Text -> Identity (Maybe Text))
-> DescribeSubscribersForNotification
-> Identity DescribeSubscribersForNotification)
-> Maybe Text
-> DescribeSubscribersForNotification
-> DescribeSubscribersForNotification
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeSubscribersForNotification
DescribeSubscribersForNotificationResponse
rs
DescribeSubscribersForNotificationResponse
-> Getting
(First Text) DescribeSubscribersForNotificationResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeSubscribersForNotificationResponse
-> Const (First Text) DescribeSubscribersForNotificationResponse
Lens' DescribeSubscribersForNotificationResponse (Maybe Text)
describeSubscribersForNotificationResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeSubscribersForNotificationResponse
-> Const (First Text) DescribeSubscribersForNotificationResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
(First Text) DescribeSubscribersForNotificationResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance
Core.AWSRequest
DescribeSubscribersForNotification
where
type
AWSResponse DescribeSubscribersForNotification =
DescribeSubscribersForNotificationResponse
request :: DescribeSubscribersForNotification
-> Request DescribeSubscribersForNotification
request = Service
-> DescribeSubscribersForNotification
-> Request DescribeSubscribersForNotification
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeSubscribersForNotification
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeSubscribersForNotification)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeSubscribersForNotification))
-> Logger
-> Service
-> Proxy DescribeSubscribersForNotification
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeSubscribersForNotification)))
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 Text
-> Maybe (NonEmpty Subscriber)
-> Int
-> DescribeSubscribersForNotificationResponse
DescribeSubscribersForNotificationResponse'
(Maybe Text
-> Maybe (NonEmpty Subscriber)
-> Int
-> DescribeSubscribersForNotificationResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe (NonEmpty Subscriber)
-> Int -> DescribeSubscribersForNotificationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
Either
String
(Maybe (NonEmpty Subscriber)
-> Int -> DescribeSubscribersForNotificationResponse)
-> Either String (Maybe (NonEmpty Subscriber))
-> Either
String (Int -> DescribeSubscribersForNotificationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (NonEmpty Subscriber))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Subscribers")
Either String (Int -> DescribeSubscribersForNotificationResponse)
-> Either String Int
-> Either String DescribeSubscribersForNotificationResponse
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
DescribeSubscribersForNotification
instance
Prelude.NFData
DescribeSubscribersForNotification
instance
Core.ToHeaders
DescribeSubscribersForNotification
where
toHeaders :: DescribeSubscribersForNotification -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DescribeSubscribersForNotification -> 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
"AWSBudgetServiceGateway.DescribeSubscribersForNotification" ::
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
DescribeSubscribersForNotification
where
toJSON :: DescribeSubscribersForNotification -> Value
toJSON DescribeSubscribersForNotification' {Maybe Natural
Maybe Text
Text
Notification
notification :: Notification
budgetName :: Text
accountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:notification:DescribeSubscribersForNotification' :: DescribeSubscribersForNotification -> Notification
$sel:budgetName:DescribeSubscribersForNotification' :: DescribeSubscribersForNotification -> Text
$sel:accountId:DescribeSubscribersForNotification' :: DescribeSubscribersForNotification -> Text
$sel:maxResults:DescribeSubscribersForNotification' :: DescribeSubscribersForNotification -> Maybe Natural
$sel:nextToken:DescribeSubscribersForNotification' :: DescribeSubscribersForNotification -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NextToken" 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
nextToken,
(Text
"MaxResults" 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
maxResults,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
accountId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"BudgetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
budgetName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Notification" Text -> Notification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Notification
notification)
]
)
instance
Core.ToPath
DescribeSubscribersForNotification
where
toPath :: DescribeSubscribersForNotification -> ByteString
toPath = ByteString -> DescribeSubscribersForNotification -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
DescribeSubscribersForNotification
where
toQuery :: DescribeSubscribersForNotification -> QueryString
toQuery = QueryString -> DescribeSubscribersForNotification -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeSubscribersForNotificationResponse = DescribeSubscribersForNotificationResponse'
{
DescribeSubscribersForNotificationResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeSubscribersForNotificationResponse
-> Maybe (NonEmpty Subscriber)
subscribers :: Prelude.Maybe (Prelude.NonEmpty Subscriber),
DescribeSubscribersForNotificationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeSubscribersForNotificationResponse
-> DescribeSubscribersForNotificationResponse -> Bool
(DescribeSubscribersForNotificationResponse
-> DescribeSubscribersForNotificationResponse -> Bool)
-> (DescribeSubscribersForNotificationResponse
-> DescribeSubscribersForNotificationResponse -> Bool)
-> Eq DescribeSubscribersForNotificationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSubscribersForNotificationResponse
-> DescribeSubscribersForNotificationResponse -> Bool
$c/= :: DescribeSubscribersForNotificationResponse
-> DescribeSubscribersForNotificationResponse -> Bool
== :: DescribeSubscribersForNotificationResponse
-> DescribeSubscribersForNotificationResponse -> Bool
$c== :: DescribeSubscribersForNotificationResponse
-> DescribeSubscribersForNotificationResponse -> Bool
Prelude.Eq, Int -> DescribeSubscribersForNotificationResponse -> ShowS
[DescribeSubscribersForNotificationResponse] -> ShowS
DescribeSubscribersForNotificationResponse -> String
(Int -> DescribeSubscribersForNotificationResponse -> ShowS)
-> (DescribeSubscribersForNotificationResponse -> String)
-> ([DescribeSubscribersForNotificationResponse] -> ShowS)
-> Show DescribeSubscribersForNotificationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSubscribersForNotificationResponse] -> ShowS
$cshowList :: [DescribeSubscribersForNotificationResponse] -> ShowS
show :: DescribeSubscribersForNotificationResponse -> String
$cshow :: DescribeSubscribersForNotificationResponse -> String
showsPrec :: Int -> DescribeSubscribersForNotificationResponse -> ShowS
$cshowsPrec :: Int -> DescribeSubscribersForNotificationResponse -> ShowS
Prelude.Show, (forall x.
DescribeSubscribersForNotificationResponse
-> Rep DescribeSubscribersForNotificationResponse x)
-> (forall x.
Rep DescribeSubscribersForNotificationResponse x
-> DescribeSubscribersForNotificationResponse)
-> Generic DescribeSubscribersForNotificationResponse
forall x.
Rep DescribeSubscribersForNotificationResponse x
-> DescribeSubscribersForNotificationResponse
forall x.
DescribeSubscribersForNotificationResponse
-> Rep DescribeSubscribersForNotificationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSubscribersForNotificationResponse x
-> DescribeSubscribersForNotificationResponse
$cfrom :: forall x.
DescribeSubscribersForNotificationResponse
-> Rep DescribeSubscribersForNotificationResponse x
Prelude.Generic)
newDescribeSubscribersForNotificationResponse ::
Prelude.Int ->
DescribeSubscribersForNotificationResponse
newDescribeSubscribersForNotificationResponse :: Int -> DescribeSubscribersForNotificationResponse
newDescribeSubscribersForNotificationResponse
Int
pHttpStatus_ =
DescribeSubscribersForNotificationResponse' :: Maybe Text
-> Maybe (NonEmpty Subscriber)
-> Int
-> DescribeSubscribersForNotificationResponse
DescribeSubscribersForNotificationResponse'
{ $sel:nextToken:DescribeSubscribersForNotificationResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:subscribers:DescribeSubscribersForNotificationResponse' :: Maybe (NonEmpty Subscriber)
subscribers = Maybe (NonEmpty Subscriber)
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeSubscribersForNotificationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeSubscribersForNotificationResponse_nextToken :: Lens.Lens' DescribeSubscribersForNotificationResponse (Prelude.Maybe Prelude.Text)
describeSubscribersForNotificationResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeSubscribersForNotificationResponse
-> f DescribeSubscribersForNotificationResponse
describeSubscribersForNotificationResponse_nextToken = (DescribeSubscribersForNotificationResponse -> Maybe Text)
-> (DescribeSubscribersForNotificationResponse
-> Maybe Text -> DescribeSubscribersForNotificationResponse)
-> Lens' DescribeSubscribersForNotificationResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSubscribersForNotificationResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeSubscribersForNotificationResponse' :: DescribeSubscribersForNotificationResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeSubscribersForNotificationResponse
s@DescribeSubscribersForNotificationResponse' {} Maybe Text
a -> DescribeSubscribersForNotificationResponse
s {$sel:nextToken:DescribeSubscribersForNotificationResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeSubscribersForNotificationResponse)
describeSubscribersForNotificationResponse_subscribers :: Lens.Lens' DescribeSubscribersForNotificationResponse (Prelude.Maybe (Prelude.NonEmpty Subscriber))
describeSubscribersForNotificationResponse_subscribers :: (Maybe (NonEmpty Subscriber) -> f (Maybe (NonEmpty Subscriber)))
-> DescribeSubscribersForNotificationResponse
-> f DescribeSubscribersForNotificationResponse
describeSubscribersForNotificationResponse_subscribers = (DescribeSubscribersForNotificationResponse
-> Maybe (NonEmpty Subscriber))
-> (DescribeSubscribersForNotificationResponse
-> Maybe (NonEmpty Subscriber)
-> DescribeSubscribersForNotificationResponse)
-> Lens'
DescribeSubscribersForNotificationResponse
(Maybe (NonEmpty Subscriber))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSubscribersForNotificationResponse' {Maybe (NonEmpty Subscriber)
subscribers :: Maybe (NonEmpty Subscriber)
$sel:subscribers:DescribeSubscribersForNotificationResponse' :: DescribeSubscribersForNotificationResponse
-> Maybe (NonEmpty Subscriber)
subscribers} -> Maybe (NonEmpty Subscriber)
subscribers) (\s :: DescribeSubscribersForNotificationResponse
s@DescribeSubscribersForNotificationResponse' {} Maybe (NonEmpty Subscriber)
a -> DescribeSubscribersForNotificationResponse
s {$sel:subscribers:DescribeSubscribersForNotificationResponse' :: Maybe (NonEmpty Subscriber)
subscribers = Maybe (NonEmpty Subscriber)
a} :: DescribeSubscribersForNotificationResponse) ((Maybe (NonEmpty Subscriber) -> f (Maybe (NonEmpty Subscriber)))
-> DescribeSubscribersForNotificationResponse
-> f DescribeSubscribersForNotificationResponse)
-> ((Maybe (NonEmpty Subscriber)
-> f (Maybe (NonEmpty Subscriber)))
-> Maybe (NonEmpty Subscriber) -> f (Maybe (NonEmpty Subscriber)))
-> (Maybe (NonEmpty Subscriber) -> f (Maybe (NonEmpty Subscriber)))
-> DescribeSubscribersForNotificationResponse
-> f DescribeSubscribersForNotificationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Subscriber)
(NonEmpty Subscriber)
(NonEmpty Subscriber)
(NonEmpty Subscriber)
-> Iso
(Maybe (NonEmpty Subscriber))
(Maybe (NonEmpty Subscriber))
(Maybe (NonEmpty Subscriber))
(Maybe (NonEmpty Subscriber))
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
(NonEmpty Subscriber)
(NonEmpty Subscriber)
(NonEmpty Subscriber)
(NonEmpty Subscriber)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeSubscribersForNotificationResponse_httpStatus :: Lens.Lens' DescribeSubscribersForNotificationResponse Prelude.Int
describeSubscribersForNotificationResponse_httpStatus :: (Int -> f Int)
-> DescribeSubscribersForNotificationResponse
-> f DescribeSubscribersForNotificationResponse
describeSubscribersForNotificationResponse_httpStatus = (DescribeSubscribersForNotificationResponse -> Int)
-> (DescribeSubscribersForNotificationResponse
-> Int -> DescribeSubscribersForNotificationResponse)
-> Lens
DescribeSubscribersForNotificationResponse
DescribeSubscribersForNotificationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSubscribersForNotificationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeSubscribersForNotificationResponse' :: DescribeSubscribersForNotificationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeSubscribersForNotificationResponse
s@DescribeSubscribersForNotificationResponse' {} Int
a -> DescribeSubscribersForNotificationResponse
s {$sel:httpStatus:DescribeSubscribersForNotificationResponse' :: Int
httpStatus = Int
a} :: DescribeSubscribersForNotificationResponse)
instance
Prelude.NFData
DescribeSubscribersForNotificationResponse