{-# 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.CloudWatchEvents.ListPartnerEventSources
(
ListPartnerEventSources (..),
newListPartnerEventSources,
listPartnerEventSources_limit,
listPartnerEventSources_nextToken,
listPartnerEventSources_namePrefix,
ListPartnerEventSourcesResponse (..),
newListPartnerEventSourcesResponse,
listPartnerEventSourcesResponse_nextToken,
listPartnerEventSourcesResponse_partnerEventSources,
listPartnerEventSourcesResponse_httpStatus,
)
where
import Amazonka.CloudWatchEvents.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListPartnerEventSources = ListPartnerEventSources'
{
ListPartnerEventSources -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListPartnerEventSources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListPartnerEventSources -> Text
namePrefix :: Prelude.Text
}
deriving (ListPartnerEventSources -> ListPartnerEventSources -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPartnerEventSources -> ListPartnerEventSources -> Bool
$c/= :: ListPartnerEventSources -> ListPartnerEventSources -> Bool
== :: ListPartnerEventSources -> ListPartnerEventSources -> Bool
$c== :: ListPartnerEventSources -> ListPartnerEventSources -> Bool
Prelude.Eq, ReadPrec [ListPartnerEventSources]
ReadPrec ListPartnerEventSources
Int -> ReadS ListPartnerEventSources
ReadS [ListPartnerEventSources]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPartnerEventSources]
$creadListPrec :: ReadPrec [ListPartnerEventSources]
readPrec :: ReadPrec ListPartnerEventSources
$creadPrec :: ReadPrec ListPartnerEventSources
readList :: ReadS [ListPartnerEventSources]
$creadList :: ReadS [ListPartnerEventSources]
readsPrec :: Int -> ReadS ListPartnerEventSources
$creadsPrec :: Int -> ReadS ListPartnerEventSources
Prelude.Read, Int -> ListPartnerEventSources -> ShowS
[ListPartnerEventSources] -> ShowS
ListPartnerEventSources -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPartnerEventSources] -> ShowS
$cshowList :: [ListPartnerEventSources] -> ShowS
show :: ListPartnerEventSources -> String
$cshow :: ListPartnerEventSources -> String
showsPrec :: Int -> ListPartnerEventSources -> ShowS
$cshowsPrec :: Int -> ListPartnerEventSources -> ShowS
Prelude.Show, forall x. Rep ListPartnerEventSources x -> ListPartnerEventSources
forall x. ListPartnerEventSources -> Rep ListPartnerEventSources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPartnerEventSources x -> ListPartnerEventSources
$cfrom :: forall x. ListPartnerEventSources -> Rep ListPartnerEventSources x
Prelude.Generic)
newListPartnerEventSources ::
Prelude.Text ->
ListPartnerEventSources
newListPartnerEventSources :: Text -> ListPartnerEventSources
newListPartnerEventSources Text
pNamePrefix_ =
ListPartnerEventSources'
{ $sel:limit:ListPartnerEventSources' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListPartnerEventSources' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:namePrefix:ListPartnerEventSources' :: Text
namePrefix = Text
pNamePrefix_
}
listPartnerEventSources_limit :: Lens.Lens' ListPartnerEventSources (Prelude.Maybe Prelude.Natural)
listPartnerEventSources_limit :: Lens' ListPartnerEventSources (Maybe Natural)
listPartnerEventSources_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartnerEventSources' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListPartnerEventSources' :: ListPartnerEventSources -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListPartnerEventSources
s@ListPartnerEventSources' {} Maybe Natural
a -> ListPartnerEventSources
s {$sel:limit:ListPartnerEventSources' :: Maybe Natural
limit = Maybe Natural
a} :: ListPartnerEventSources)
listPartnerEventSources_nextToken :: Lens.Lens' ListPartnerEventSources (Prelude.Maybe Prelude.Text)
listPartnerEventSources_nextToken :: Lens' ListPartnerEventSources (Maybe Text)
listPartnerEventSources_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartnerEventSources' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPartnerEventSources' :: ListPartnerEventSources -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPartnerEventSources
s@ListPartnerEventSources' {} Maybe Text
a -> ListPartnerEventSources
s {$sel:nextToken:ListPartnerEventSources' :: Maybe Text
nextToken = Maybe Text
a} :: ListPartnerEventSources)
listPartnerEventSources_namePrefix :: Lens.Lens' ListPartnerEventSources Prelude.Text
listPartnerEventSources_namePrefix :: Lens' ListPartnerEventSources Text
listPartnerEventSources_namePrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartnerEventSources' {Text
namePrefix :: Text
$sel:namePrefix:ListPartnerEventSources' :: ListPartnerEventSources -> Text
namePrefix} -> Text
namePrefix) (\s :: ListPartnerEventSources
s@ListPartnerEventSources' {} Text
a -> ListPartnerEventSources
s {$sel:namePrefix:ListPartnerEventSources' :: Text
namePrefix = Text
a} :: ListPartnerEventSources)
instance Core.AWSRequest ListPartnerEventSources where
type
AWSResponse ListPartnerEventSources =
ListPartnerEventSourcesResponse
request :: (Service -> Service)
-> ListPartnerEventSources -> Request ListPartnerEventSources
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 ListPartnerEventSources
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListPartnerEventSources)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe [PartnerEventSource]
-> Int
-> ListPartnerEventSourcesResponse
ListPartnerEventSourcesResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"PartnerEventSources"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListPartnerEventSources where
hashWithSalt :: Int -> ListPartnerEventSources -> Int
hashWithSalt Int
_salt ListPartnerEventSources' {Maybe Natural
Maybe Text
Text
namePrefix :: Text
nextToken :: Maybe Text
limit :: Maybe Natural
$sel:namePrefix:ListPartnerEventSources' :: ListPartnerEventSources -> Text
$sel:nextToken:ListPartnerEventSources' :: ListPartnerEventSources -> Maybe Text
$sel:limit:ListPartnerEventSources' :: ListPartnerEventSources -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
namePrefix
instance Prelude.NFData ListPartnerEventSources where
rnf :: ListPartnerEventSources -> ()
rnf ListPartnerEventSources' {Maybe Natural
Maybe Text
Text
namePrefix :: Text
nextToken :: Maybe Text
limit :: Maybe Natural
$sel:namePrefix:ListPartnerEventSources' :: ListPartnerEventSources -> Text
$sel:nextToken:ListPartnerEventSources' :: ListPartnerEventSources -> Maybe Text
$sel:limit:ListPartnerEventSources' :: ListPartnerEventSources -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
namePrefix
instance Data.ToHeaders ListPartnerEventSources where
toHeaders :: ListPartnerEventSources -> ResponseHeaders
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 -> ResponseHeaders
Data.=# ( ByteString
"AWSEvents.ListPartnerEventSources" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListPartnerEventSources where
toJSON :: ListPartnerEventSources -> Value
toJSON ListPartnerEventSources' {Maybe Natural
Maybe Text
Text
namePrefix :: Text
nextToken :: Maybe Text
limit :: Maybe Natural
$sel:namePrefix:ListPartnerEventSources' :: ListPartnerEventSources -> Text
$sel:nextToken:ListPartnerEventSources' :: ListPartnerEventSources -> Maybe Text
$sel:limit:ListPartnerEventSources' :: ListPartnerEventSources -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Limit" 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
limit,
(Key
"NextToken" 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
nextToken,
forall a. a -> Maybe a
Prelude.Just (Key
"NamePrefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
namePrefix)
]
)
instance Data.ToPath ListPartnerEventSources where
toPath :: ListPartnerEventSources -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListPartnerEventSources where
toQuery :: ListPartnerEventSources -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListPartnerEventSourcesResponse = ListPartnerEventSourcesResponse'
{
ListPartnerEventSourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListPartnerEventSourcesResponse -> Maybe [PartnerEventSource]
partnerEventSources :: Prelude.Maybe [PartnerEventSource],
ListPartnerEventSourcesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListPartnerEventSourcesResponse
-> ListPartnerEventSourcesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPartnerEventSourcesResponse
-> ListPartnerEventSourcesResponse -> Bool
$c/= :: ListPartnerEventSourcesResponse
-> ListPartnerEventSourcesResponse -> Bool
== :: ListPartnerEventSourcesResponse
-> ListPartnerEventSourcesResponse -> Bool
$c== :: ListPartnerEventSourcesResponse
-> ListPartnerEventSourcesResponse -> Bool
Prelude.Eq, ReadPrec [ListPartnerEventSourcesResponse]
ReadPrec ListPartnerEventSourcesResponse
Int -> ReadS ListPartnerEventSourcesResponse
ReadS [ListPartnerEventSourcesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPartnerEventSourcesResponse]
$creadListPrec :: ReadPrec [ListPartnerEventSourcesResponse]
readPrec :: ReadPrec ListPartnerEventSourcesResponse
$creadPrec :: ReadPrec ListPartnerEventSourcesResponse
readList :: ReadS [ListPartnerEventSourcesResponse]
$creadList :: ReadS [ListPartnerEventSourcesResponse]
readsPrec :: Int -> ReadS ListPartnerEventSourcesResponse
$creadsPrec :: Int -> ReadS ListPartnerEventSourcesResponse
Prelude.Read, Int -> ListPartnerEventSourcesResponse -> ShowS
[ListPartnerEventSourcesResponse] -> ShowS
ListPartnerEventSourcesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPartnerEventSourcesResponse] -> ShowS
$cshowList :: [ListPartnerEventSourcesResponse] -> ShowS
show :: ListPartnerEventSourcesResponse -> String
$cshow :: ListPartnerEventSourcesResponse -> String
showsPrec :: Int -> ListPartnerEventSourcesResponse -> ShowS
$cshowsPrec :: Int -> ListPartnerEventSourcesResponse -> ShowS
Prelude.Show, forall x.
Rep ListPartnerEventSourcesResponse x
-> ListPartnerEventSourcesResponse
forall x.
ListPartnerEventSourcesResponse
-> Rep ListPartnerEventSourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPartnerEventSourcesResponse x
-> ListPartnerEventSourcesResponse
$cfrom :: forall x.
ListPartnerEventSourcesResponse
-> Rep ListPartnerEventSourcesResponse x
Prelude.Generic)
newListPartnerEventSourcesResponse ::
Prelude.Int ->
ListPartnerEventSourcesResponse
newListPartnerEventSourcesResponse :: Int -> ListPartnerEventSourcesResponse
newListPartnerEventSourcesResponse Int
pHttpStatus_ =
ListPartnerEventSourcesResponse'
{ $sel:nextToken:ListPartnerEventSourcesResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:partnerEventSources:ListPartnerEventSourcesResponse' :: Maybe [PartnerEventSource]
partnerEventSources = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListPartnerEventSourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listPartnerEventSourcesResponse_nextToken :: Lens.Lens' ListPartnerEventSourcesResponse (Prelude.Maybe Prelude.Text)
listPartnerEventSourcesResponse_nextToken :: Lens' ListPartnerEventSourcesResponse (Maybe Text)
listPartnerEventSourcesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartnerEventSourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPartnerEventSourcesResponse' :: ListPartnerEventSourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPartnerEventSourcesResponse
s@ListPartnerEventSourcesResponse' {} Maybe Text
a -> ListPartnerEventSourcesResponse
s {$sel:nextToken:ListPartnerEventSourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPartnerEventSourcesResponse)
listPartnerEventSourcesResponse_partnerEventSources :: Lens.Lens' ListPartnerEventSourcesResponse (Prelude.Maybe [PartnerEventSource])
listPartnerEventSourcesResponse_partnerEventSources :: Lens' ListPartnerEventSourcesResponse (Maybe [PartnerEventSource])
listPartnerEventSourcesResponse_partnerEventSources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartnerEventSourcesResponse' {Maybe [PartnerEventSource]
partnerEventSources :: Maybe [PartnerEventSource]
$sel:partnerEventSources:ListPartnerEventSourcesResponse' :: ListPartnerEventSourcesResponse -> Maybe [PartnerEventSource]
partnerEventSources} -> Maybe [PartnerEventSource]
partnerEventSources) (\s :: ListPartnerEventSourcesResponse
s@ListPartnerEventSourcesResponse' {} Maybe [PartnerEventSource]
a -> ListPartnerEventSourcesResponse
s {$sel:partnerEventSources:ListPartnerEventSourcesResponse' :: Maybe [PartnerEventSource]
partnerEventSources = Maybe [PartnerEventSource]
a} :: ListPartnerEventSourcesResponse) 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
listPartnerEventSourcesResponse_httpStatus :: Lens.Lens' ListPartnerEventSourcesResponse Prelude.Int
listPartnerEventSourcesResponse_httpStatus :: Lens' ListPartnerEventSourcesResponse Int
listPartnerEventSourcesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartnerEventSourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListPartnerEventSourcesResponse' :: ListPartnerEventSourcesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListPartnerEventSourcesResponse
s@ListPartnerEventSourcesResponse' {} Int
a -> ListPartnerEventSourcesResponse
s {$sel:httpStatus:ListPartnerEventSourcesResponse' :: Int
httpStatus = Int
a} :: ListPartnerEventSourcesResponse)
instance
Prelude.NFData
ListPartnerEventSourcesResponse
where
rnf :: ListPartnerEventSourcesResponse -> ()
rnf ListPartnerEventSourcesResponse' {Int
Maybe [PartnerEventSource]
Maybe Text
httpStatus :: Int
partnerEventSources :: Maybe [PartnerEventSource]
nextToken :: Maybe Text
$sel:httpStatus:ListPartnerEventSourcesResponse' :: ListPartnerEventSourcesResponse -> Int
$sel:partnerEventSources:ListPartnerEventSourcesResponse' :: ListPartnerEventSourcesResponse -> Maybe [PartnerEventSource]
$sel:nextToken:ListPartnerEventSourcesResponse' :: ListPartnerEventSourcesResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PartnerEventSource]
partnerEventSources
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus