{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudWatchEvents.ListPartnerEventSourceAccounts
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- An SaaS partner can use this operation to display the Amazon Web
-- Services account ID that a particular partner event source name is
-- associated with. This operation is not used by Amazon Web Services
-- customers.
module Amazonka.CloudWatchEvents.ListPartnerEventSourceAccounts
  ( -- * Creating a Request
    ListPartnerEventSourceAccounts (..),
    newListPartnerEventSourceAccounts,

    -- * Request Lenses
    listPartnerEventSourceAccounts_nextToken,
    listPartnerEventSourceAccounts_limit,
    listPartnerEventSourceAccounts_eventSourceName,

    -- * Destructuring the Response
    ListPartnerEventSourceAccountsResponse (..),
    newListPartnerEventSourceAccountsResponse,

    -- * Response Lenses
    listPartnerEventSourceAccountsResponse_partnerEventSourceAccounts,
    listPartnerEventSourceAccountsResponse_nextToken,
    listPartnerEventSourceAccountsResponse_httpStatus,
  )
where

import Amazonka.CloudWatchEvents.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

-- | /See:/ 'newListPartnerEventSourceAccounts' smart constructor.
data ListPartnerEventSourceAccounts = ListPartnerEventSourceAccounts'
  { -- | The token returned by a previous call to this operation. Specifying this
    -- retrieves the next set of results.
    ListPartnerEventSourceAccounts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specifying this limits the number of results returned by this operation.
    -- The operation also returns a NextToken which you can use in a subsequent
    -- operation to retrieve the next set of results.
    ListPartnerEventSourceAccounts -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The name of the partner event source to display account information
    -- about.
    ListPartnerEventSourceAccounts -> Text
eventSourceName :: Prelude.Text
  }
  deriving (ListPartnerEventSourceAccounts
-> ListPartnerEventSourceAccounts -> Bool
(ListPartnerEventSourceAccounts
 -> ListPartnerEventSourceAccounts -> Bool)
-> (ListPartnerEventSourceAccounts
    -> ListPartnerEventSourceAccounts -> Bool)
-> Eq ListPartnerEventSourceAccounts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPartnerEventSourceAccounts
-> ListPartnerEventSourceAccounts -> Bool
$c/= :: ListPartnerEventSourceAccounts
-> ListPartnerEventSourceAccounts -> Bool
== :: ListPartnerEventSourceAccounts
-> ListPartnerEventSourceAccounts -> Bool
$c== :: ListPartnerEventSourceAccounts
-> ListPartnerEventSourceAccounts -> Bool
Prelude.Eq, ReadPrec [ListPartnerEventSourceAccounts]
ReadPrec ListPartnerEventSourceAccounts
Int -> ReadS ListPartnerEventSourceAccounts
ReadS [ListPartnerEventSourceAccounts]
(Int -> ReadS ListPartnerEventSourceAccounts)
-> ReadS [ListPartnerEventSourceAccounts]
-> ReadPrec ListPartnerEventSourceAccounts
-> ReadPrec [ListPartnerEventSourceAccounts]
-> Read ListPartnerEventSourceAccounts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPartnerEventSourceAccounts]
$creadListPrec :: ReadPrec [ListPartnerEventSourceAccounts]
readPrec :: ReadPrec ListPartnerEventSourceAccounts
$creadPrec :: ReadPrec ListPartnerEventSourceAccounts
readList :: ReadS [ListPartnerEventSourceAccounts]
$creadList :: ReadS [ListPartnerEventSourceAccounts]
readsPrec :: Int -> ReadS ListPartnerEventSourceAccounts
$creadsPrec :: Int -> ReadS ListPartnerEventSourceAccounts
Prelude.Read, Int -> ListPartnerEventSourceAccounts -> ShowS
[ListPartnerEventSourceAccounts] -> ShowS
ListPartnerEventSourceAccounts -> String
(Int -> ListPartnerEventSourceAccounts -> ShowS)
-> (ListPartnerEventSourceAccounts -> String)
-> ([ListPartnerEventSourceAccounts] -> ShowS)
-> Show ListPartnerEventSourceAccounts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPartnerEventSourceAccounts] -> ShowS
$cshowList :: [ListPartnerEventSourceAccounts] -> ShowS
show :: ListPartnerEventSourceAccounts -> String
$cshow :: ListPartnerEventSourceAccounts -> String
showsPrec :: Int -> ListPartnerEventSourceAccounts -> ShowS
$cshowsPrec :: Int -> ListPartnerEventSourceAccounts -> ShowS
Prelude.Show, (forall x.
 ListPartnerEventSourceAccounts
 -> Rep ListPartnerEventSourceAccounts x)
-> (forall x.
    Rep ListPartnerEventSourceAccounts x
    -> ListPartnerEventSourceAccounts)
-> Generic ListPartnerEventSourceAccounts
forall x.
Rep ListPartnerEventSourceAccounts x
-> ListPartnerEventSourceAccounts
forall x.
ListPartnerEventSourceAccounts
-> Rep ListPartnerEventSourceAccounts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPartnerEventSourceAccounts x
-> ListPartnerEventSourceAccounts
$cfrom :: forall x.
ListPartnerEventSourceAccounts
-> Rep ListPartnerEventSourceAccounts x
Prelude.Generic)

-- |
-- Create a value of 'ListPartnerEventSourceAccounts' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listPartnerEventSourceAccounts_nextToken' - The token returned by a previous call to this operation. Specifying this
-- retrieves the next set of results.
--
-- 'limit', 'listPartnerEventSourceAccounts_limit' - Specifying this limits the number of results returned by this operation.
-- The operation also returns a NextToken which you can use in a subsequent
-- operation to retrieve the next set of results.
--
-- 'eventSourceName', 'listPartnerEventSourceAccounts_eventSourceName' - The name of the partner event source to display account information
-- about.
newListPartnerEventSourceAccounts ::
  -- | 'eventSourceName'
  Prelude.Text ->
  ListPartnerEventSourceAccounts
newListPartnerEventSourceAccounts :: Text -> ListPartnerEventSourceAccounts
newListPartnerEventSourceAccounts Text
pEventSourceName_ =
  ListPartnerEventSourceAccounts' :: Maybe Text
-> Maybe Natural -> Text -> ListPartnerEventSourceAccounts
ListPartnerEventSourceAccounts'
    { $sel:nextToken:ListPartnerEventSourceAccounts' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListPartnerEventSourceAccounts' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:eventSourceName:ListPartnerEventSourceAccounts' :: Text
eventSourceName = Text
pEventSourceName_
    }

-- | The token returned by a previous call to this operation. Specifying this
-- retrieves the next set of results.
listPartnerEventSourceAccounts_nextToken :: Lens.Lens' ListPartnerEventSourceAccounts (Prelude.Maybe Prelude.Text)
listPartnerEventSourceAccounts_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPartnerEventSourceAccounts
-> f ListPartnerEventSourceAccounts
listPartnerEventSourceAccounts_nextToken = (ListPartnerEventSourceAccounts -> Maybe Text)
-> (ListPartnerEventSourceAccounts
    -> Maybe Text -> ListPartnerEventSourceAccounts)
-> Lens
     ListPartnerEventSourceAccounts
     ListPartnerEventSourceAccounts
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartnerEventSourceAccounts' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPartnerEventSourceAccounts' :: ListPartnerEventSourceAccounts -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPartnerEventSourceAccounts
s@ListPartnerEventSourceAccounts' {} Maybe Text
a -> ListPartnerEventSourceAccounts
s {$sel:nextToken:ListPartnerEventSourceAccounts' :: Maybe Text
nextToken = Maybe Text
a} :: ListPartnerEventSourceAccounts)

-- | Specifying this limits the number of results returned by this operation.
-- The operation also returns a NextToken which you can use in a subsequent
-- operation to retrieve the next set of results.
listPartnerEventSourceAccounts_limit :: Lens.Lens' ListPartnerEventSourceAccounts (Prelude.Maybe Prelude.Natural)
listPartnerEventSourceAccounts_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListPartnerEventSourceAccounts
-> f ListPartnerEventSourceAccounts
listPartnerEventSourceAccounts_limit = (ListPartnerEventSourceAccounts -> Maybe Natural)
-> (ListPartnerEventSourceAccounts
    -> Maybe Natural -> ListPartnerEventSourceAccounts)
-> Lens
     ListPartnerEventSourceAccounts
     ListPartnerEventSourceAccounts
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartnerEventSourceAccounts' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListPartnerEventSourceAccounts' :: ListPartnerEventSourceAccounts -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListPartnerEventSourceAccounts
s@ListPartnerEventSourceAccounts' {} Maybe Natural
a -> ListPartnerEventSourceAccounts
s {$sel:limit:ListPartnerEventSourceAccounts' :: Maybe Natural
limit = Maybe Natural
a} :: ListPartnerEventSourceAccounts)

-- | The name of the partner event source to display account information
-- about.
listPartnerEventSourceAccounts_eventSourceName :: Lens.Lens' ListPartnerEventSourceAccounts Prelude.Text
listPartnerEventSourceAccounts_eventSourceName :: (Text -> f Text)
-> ListPartnerEventSourceAccounts
-> f ListPartnerEventSourceAccounts
listPartnerEventSourceAccounts_eventSourceName = (ListPartnerEventSourceAccounts -> Text)
-> (ListPartnerEventSourceAccounts
    -> Text -> ListPartnerEventSourceAccounts)
-> Lens
     ListPartnerEventSourceAccounts
     ListPartnerEventSourceAccounts
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartnerEventSourceAccounts' {Text
eventSourceName :: Text
$sel:eventSourceName:ListPartnerEventSourceAccounts' :: ListPartnerEventSourceAccounts -> Text
eventSourceName} -> Text
eventSourceName) (\s :: ListPartnerEventSourceAccounts
s@ListPartnerEventSourceAccounts' {} Text
a -> ListPartnerEventSourceAccounts
s {$sel:eventSourceName:ListPartnerEventSourceAccounts' :: Text
eventSourceName = Text
a} :: ListPartnerEventSourceAccounts)

instance
  Core.AWSRequest
    ListPartnerEventSourceAccounts
  where
  type
    AWSResponse ListPartnerEventSourceAccounts =
      ListPartnerEventSourceAccountsResponse
  request :: ListPartnerEventSourceAccounts
-> Request ListPartnerEventSourceAccounts
request = Service
-> ListPartnerEventSourceAccounts
-> Request ListPartnerEventSourceAccounts
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPartnerEventSourceAccounts
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListPartnerEventSourceAccounts)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListPartnerEventSourceAccounts))
-> Logger
-> Service
-> Proxy ListPartnerEventSourceAccounts
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListPartnerEventSourceAccounts)))
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 [PartnerEventSourceAccount]
-> Maybe Text -> Int -> ListPartnerEventSourceAccountsResponse
ListPartnerEventSourceAccountsResponse'
            (Maybe [PartnerEventSourceAccount]
 -> Maybe Text -> Int -> ListPartnerEventSourceAccountsResponse)
-> Either String (Maybe [PartnerEventSourceAccount])
-> Either
     String
     (Maybe Text -> Int -> ListPartnerEventSourceAccountsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [PartnerEventSourceAccount]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PartnerEventSourceAccounts"
                            Either String (Maybe (Maybe [PartnerEventSourceAccount]))
-> Maybe [PartnerEventSourceAccount]
-> Either String (Maybe [PartnerEventSourceAccount])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PartnerEventSourceAccount]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text -> Int -> ListPartnerEventSourceAccountsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListPartnerEventSourceAccountsResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> ListPartnerEventSourceAccountsResponse)
-> Either String Int
-> Either String ListPartnerEventSourceAccountsResponse
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
    ListPartnerEventSourceAccounts

instance
  Prelude.NFData
    ListPartnerEventSourceAccounts

instance
  Core.ToHeaders
    ListPartnerEventSourceAccounts
  where
  toHeaders :: ListPartnerEventSourceAccounts -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ListPartnerEventSourceAccounts -> 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
"AWSEvents.ListPartnerEventSourceAccounts" ::
                          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 ListPartnerEventSourceAccounts where
  toJSON :: ListPartnerEventSourceAccounts -> Value
toJSON ListPartnerEventSourceAccounts' {Maybe Natural
Maybe Text
Text
eventSourceName :: Text
limit :: Maybe Natural
nextToken :: Maybe Text
$sel:eventSourceName:ListPartnerEventSourceAccounts' :: ListPartnerEventSourceAccounts -> Text
$sel:limit:ListPartnerEventSourceAccounts' :: ListPartnerEventSourceAccounts -> Maybe Natural
$sel:nextToken:ListPartnerEventSourceAccounts' :: ListPartnerEventSourceAccounts -> 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
"Limit" 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
limit,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"EventSourceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventSourceName)
          ]
      )

instance Core.ToPath ListPartnerEventSourceAccounts where
  toPath :: ListPartnerEventSourceAccounts -> ByteString
toPath = ByteString -> ListPartnerEventSourceAccounts -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListPartnerEventSourceAccounts where
  toQuery :: ListPartnerEventSourceAccounts -> QueryString
toQuery = QueryString -> ListPartnerEventSourceAccounts -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListPartnerEventSourceAccountsResponse' smart constructor.
data ListPartnerEventSourceAccountsResponse = ListPartnerEventSourceAccountsResponse'
  { -- | The list of partner event sources returned by the operation.
    ListPartnerEventSourceAccountsResponse
-> Maybe [PartnerEventSourceAccount]
partnerEventSourceAccounts :: Prelude.Maybe [PartnerEventSourceAccount],
    -- | A token you can use in a subsequent operation to retrieve the next set
    -- of results.
    ListPartnerEventSourceAccountsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListPartnerEventSourceAccountsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPartnerEventSourceAccountsResponse
-> ListPartnerEventSourceAccountsResponse -> Bool
(ListPartnerEventSourceAccountsResponse
 -> ListPartnerEventSourceAccountsResponse -> Bool)
-> (ListPartnerEventSourceAccountsResponse
    -> ListPartnerEventSourceAccountsResponse -> Bool)
-> Eq ListPartnerEventSourceAccountsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPartnerEventSourceAccountsResponse
-> ListPartnerEventSourceAccountsResponse -> Bool
$c/= :: ListPartnerEventSourceAccountsResponse
-> ListPartnerEventSourceAccountsResponse -> Bool
== :: ListPartnerEventSourceAccountsResponse
-> ListPartnerEventSourceAccountsResponse -> Bool
$c== :: ListPartnerEventSourceAccountsResponse
-> ListPartnerEventSourceAccountsResponse -> Bool
Prelude.Eq, ReadPrec [ListPartnerEventSourceAccountsResponse]
ReadPrec ListPartnerEventSourceAccountsResponse
Int -> ReadS ListPartnerEventSourceAccountsResponse
ReadS [ListPartnerEventSourceAccountsResponse]
(Int -> ReadS ListPartnerEventSourceAccountsResponse)
-> ReadS [ListPartnerEventSourceAccountsResponse]
-> ReadPrec ListPartnerEventSourceAccountsResponse
-> ReadPrec [ListPartnerEventSourceAccountsResponse]
-> Read ListPartnerEventSourceAccountsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPartnerEventSourceAccountsResponse]
$creadListPrec :: ReadPrec [ListPartnerEventSourceAccountsResponse]
readPrec :: ReadPrec ListPartnerEventSourceAccountsResponse
$creadPrec :: ReadPrec ListPartnerEventSourceAccountsResponse
readList :: ReadS [ListPartnerEventSourceAccountsResponse]
$creadList :: ReadS [ListPartnerEventSourceAccountsResponse]
readsPrec :: Int -> ReadS ListPartnerEventSourceAccountsResponse
$creadsPrec :: Int -> ReadS ListPartnerEventSourceAccountsResponse
Prelude.Read, Int -> ListPartnerEventSourceAccountsResponse -> ShowS
[ListPartnerEventSourceAccountsResponse] -> ShowS
ListPartnerEventSourceAccountsResponse -> String
(Int -> ListPartnerEventSourceAccountsResponse -> ShowS)
-> (ListPartnerEventSourceAccountsResponse -> String)
-> ([ListPartnerEventSourceAccountsResponse] -> ShowS)
-> Show ListPartnerEventSourceAccountsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPartnerEventSourceAccountsResponse] -> ShowS
$cshowList :: [ListPartnerEventSourceAccountsResponse] -> ShowS
show :: ListPartnerEventSourceAccountsResponse -> String
$cshow :: ListPartnerEventSourceAccountsResponse -> String
showsPrec :: Int -> ListPartnerEventSourceAccountsResponse -> ShowS
$cshowsPrec :: Int -> ListPartnerEventSourceAccountsResponse -> ShowS
Prelude.Show, (forall x.
 ListPartnerEventSourceAccountsResponse
 -> Rep ListPartnerEventSourceAccountsResponse x)
-> (forall x.
    Rep ListPartnerEventSourceAccountsResponse x
    -> ListPartnerEventSourceAccountsResponse)
-> Generic ListPartnerEventSourceAccountsResponse
forall x.
Rep ListPartnerEventSourceAccountsResponse x
-> ListPartnerEventSourceAccountsResponse
forall x.
ListPartnerEventSourceAccountsResponse
-> Rep ListPartnerEventSourceAccountsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPartnerEventSourceAccountsResponse x
-> ListPartnerEventSourceAccountsResponse
$cfrom :: forall x.
ListPartnerEventSourceAccountsResponse
-> Rep ListPartnerEventSourceAccountsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPartnerEventSourceAccountsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'partnerEventSourceAccounts', 'listPartnerEventSourceAccountsResponse_partnerEventSourceAccounts' - The list of partner event sources returned by the operation.
--
-- 'nextToken', 'listPartnerEventSourceAccountsResponse_nextToken' - A token you can use in a subsequent operation to retrieve the next set
-- of results.
--
-- 'httpStatus', 'listPartnerEventSourceAccountsResponse_httpStatus' - The response's http status code.
newListPartnerEventSourceAccountsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPartnerEventSourceAccountsResponse
newListPartnerEventSourceAccountsResponse :: Int -> ListPartnerEventSourceAccountsResponse
newListPartnerEventSourceAccountsResponse
  Int
pHttpStatus_ =
    ListPartnerEventSourceAccountsResponse' :: Maybe [PartnerEventSourceAccount]
-> Maybe Text -> Int -> ListPartnerEventSourceAccountsResponse
ListPartnerEventSourceAccountsResponse'
      { $sel:partnerEventSourceAccounts:ListPartnerEventSourceAccountsResponse' :: Maybe [PartnerEventSourceAccount]
partnerEventSourceAccounts =
          Maybe [PartnerEventSourceAccount]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListPartnerEventSourceAccountsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListPartnerEventSourceAccountsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The list of partner event sources returned by the operation.
listPartnerEventSourceAccountsResponse_partnerEventSourceAccounts :: Lens.Lens' ListPartnerEventSourceAccountsResponse (Prelude.Maybe [PartnerEventSourceAccount])
listPartnerEventSourceAccountsResponse_partnerEventSourceAccounts :: (Maybe [PartnerEventSourceAccount]
 -> f (Maybe [PartnerEventSourceAccount]))
-> ListPartnerEventSourceAccountsResponse
-> f ListPartnerEventSourceAccountsResponse
listPartnerEventSourceAccountsResponse_partnerEventSourceAccounts = (ListPartnerEventSourceAccountsResponse
 -> Maybe [PartnerEventSourceAccount])
-> (ListPartnerEventSourceAccountsResponse
    -> Maybe [PartnerEventSourceAccount]
    -> ListPartnerEventSourceAccountsResponse)
-> Lens
     ListPartnerEventSourceAccountsResponse
     ListPartnerEventSourceAccountsResponse
     (Maybe [PartnerEventSourceAccount])
     (Maybe [PartnerEventSourceAccount])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartnerEventSourceAccountsResponse' {Maybe [PartnerEventSourceAccount]
partnerEventSourceAccounts :: Maybe [PartnerEventSourceAccount]
$sel:partnerEventSourceAccounts:ListPartnerEventSourceAccountsResponse' :: ListPartnerEventSourceAccountsResponse
-> Maybe [PartnerEventSourceAccount]
partnerEventSourceAccounts} -> Maybe [PartnerEventSourceAccount]
partnerEventSourceAccounts) (\s :: ListPartnerEventSourceAccountsResponse
s@ListPartnerEventSourceAccountsResponse' {} Maybe [PartnerEventSourceAccount]
a -> ListPartnerEventSourceAccountsResponse
s {$sel:partnerEventSourceAccounts:ListPartnerEventSourceAccountsResponse' :: Maybe [PartnerEventSourceAccount]
partnerEventSourceAccounts = Maybe [PartnerEventSourceAccount]
a} :: ListPartnerEventSourceAccountsResponse) ((Maybe [PartnerEventSourceAccount]
  -> f (Maybe [PartnerEventSourceAccount]))
 -> ListPartnerEventSourceAccountsResponse
 -> f ListPartnerEventSourceAccountsResponse)
-> ((Maybe [PartnerEventSourceAccount]
     -> f (Maybe [PartnerEventSourceAccount]))
    -> Maybe [PartnerEventSourceAccount]
    -> f (Maybe [PartnerEventSourceAccount]))
-> (Maybe [PartnerEventSourceAccount]
    -> f (Maybe [PartnerEventSourceAccount]))
-> ListPartnerEventSourceAccountsResponse
-> f ListPartnerEventSourceAccountsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PartnerEventSourceAccount]
  [PartnerEventSourceAccount]
  [PartnerEventSourceAccount]
  [PartnerEventSourceAccount]
-> Iso
     (Maybe [PartnerEventSourceAccount])
     (Maybe [PartnerEventSourceAccount])
     (Maybe [PartnerEventSourceAccount])
     (Maybe [PartnerEventSourceAccount])
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
  [PartnerEventSourceAccount]
  [PartnerEventSourceAccount]
  [PartnerEventSourceAccount]
  [PartnerEventSourceAccount]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token you can use in a subsequent operation to retrieve the next set
-- of results.
listPartnerEventSourceAccountsResponse_nextToken :: Lens.Lens' ListPartnerEventSourceAccountsResponse (Prelude.Maybe Prelude.Text)
listPartnerEventSourceAccountsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPartnerEventSourceAccountsResponse
-> f ListPartnerEventSourceAccountsResponse
listPartnerEventSourceAccountsResponse_nextToken = (ListPartnerEventSourceAccountsResponse -> Maybe Text)
-> (ListPartnerEventSourceAccountsResponse
    -> Maybe Text -> ListPartnerEventSourceAccountsResponse)
-> Lens
     ListPartnerEventSourceAccountsResponse
     ListPartnerEventSourceAccountsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartnerEventSourceAccountsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPartnerEventSourceAccountsResponse' :: ListPartnerEventSourceAccountsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPartnerEventSourceAccountsResponse
s@ListPartnerEventSourceAccountsResponse' {} Maybe Text
a -> ListPartnerEventSourceAccountsResponse
s {$sel:nextToken:ListPartnerEventSourceAccountsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPartnerEventSourceAccountsResponse)

-- | The response's http status code.
listPartnerEventSourceAccountsResponse_httpStatus :: Lens.Lens' ListPartnerEventSourceAccountsResponse Prelude.Int
listPartnerEventSourceAccountsResponse_httpStatus :: (Int -> f Int)
-> ListPartnerEventSourceAccountsResponse
-> f ListPartnerEventSourceAccountsResponse
listPartnerEventSourceAccountsResponse_httpStatus = (ListPartnerEventSourceAccountsResponse -> Int)
-> (ListPartnerEventSourceAccountsResponse
    -> Int -> ListPartnerEventSourceAccountsResponse)
-> Lens
     ListPartnerEventSourceAccountsResponse
     ListPartnerEventSourceAccountsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPartnerEventSourceAccountsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListPartnerEventSourceAccountsResponse' :: ListPartnerEventSourceAccountsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListPartnerEventSourceAccountsResponse
s@ListPartnerEventSourceAccountsResponse' {} Int
a -> ListPartnerEventSourceAccountsResponse
s {$sel:httpStatus:ListPartnerEventSourceAccountsResponse' :: Int
httpStatus = Int
a} :: ListPartnerEventSourceAccountsResponse)

instance
  Prelude.NFData
    ListPartnerEventSourceAccountsResponse