{-# 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.Route53RecoveryReadiness.ListCrossAccountAuthorizations
-- 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)
--
-- Returns a collection of cross account readiness authorizations.
--
-- This operation returns paginated results.
module Amazonka.Route53RecoveryReadiness.ListCrossAccountAuthorizations
  ( -- * Creating a Request
    ListCrossAccountAuthorizations (..),
    newListCrossAccountAuthorizations,

    -- * Request Lenses
    listCrossAccountAuthorizations_nextToken,
    listCrossAccountAuthorizations_maxResults,

    -- * Destructuring the Response
    ListCrossAccountAuthorizationsResponse (..),
    newListCrossAccountAuthorizationsResponse,

    -- * Response Lenses
    listCrossAccountAuthorizationsResponse_crossAccountAuthorizations,
    listCrossAccountAuthorizationsResponse_nextToken,
    listCrossAccountAuthorizationsResponse_httpStatus,
  )
where

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
import Amazonka.Route53RecoveryReadiness.Types

-- | /See:/ 'newListCrossAccountAuthorizations' smart constructor.
data ListCrossAccountAuthorizations = ListCrossAccountAuthorizations'
  { -- | A token used to resume pagination from the end of a previous request.
    ListCrossAccountAuthorizations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Upper bound on number of records to return.
    ListCrossAccountAuthorizations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListCrossAccountAuthorizations
-> ListCrossAccountAuthorizations -> Bool
(ListCrossAccountAuthorizations
 -> ListCrossAccountAuthorizations -> Bool)
-> (ListCrossAccountAuthorizations
    -> ListCrossAccountAuthorizations -> Bool)
-> Eq ListCrossAccountAuthorizations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCrossAccountAuthorizations
-> ListCrossAccountAuthorizations -> Bool
$c/= :: ListCrossAccountAuthorizations
-> ListCrossAccountAuthorizations -> Bool
== :: ListCrossAccountAuthorizations
-> ListCrossAccountAuthorizations -> Bool
$c== :: ListCrossAccountAuthorizations
-> ListCrossAccountAuthorizations -> Bool
Prelude.Eq, ReadPrec [ListCrossAccountAuthorizations]
ReadPrec ListCrossAccountAuthorizations
Int -> ReadS ListCrossAccountAuthorizations
ReadS [ListCrossAccountAuthorizations]
(Int -> ReadS ListCrossAccountAuthorizations)
-> ReadS [ListCrossAccountAuthorizations]
-> ReadPrec ListCrossAccountAuthorizations
-> ReadPrec [ListCrossAccountAuthorizations]
-> Read ListCrossAccountAuthorizations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCrossAccountAuthorizations]
$creadListPrec :: ReadPrec [ListCrossAccountAuthorizations]
readPrec :: ReadPrec ListCrossAccountAuthorizations
$creadPrec :: ReadPrec ListCrossAccountAuthorizations
readList :: ReadS [ListCrossAccountAuthorizations]
$creadList :: ReadS [ListCrossAccountAuthorizations]
readsPrec :: Int -> ReadS ListCrossAccountAuthorizations
$creadsPrec :: Int -> ReadS ListCrossAccountAuthorizations
Prelude.Read, Int -> ListCrossAccountAuthorizations -> ShowS
[ListCrossAccountAuthorizations] -> ShowS
ListCrossAccountAuthorizations -> String
(Int -> ListCrossAccountAuthorizations -> ShowS)
-> (ListCrossAccountAuthorizations -> String)
-> ([ListCrossAccountAuthorizations] -> ShowS)
-> Show ListCrossAccountAuthorizations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCrossAccountAuthorizations] -> ShowS
$cshowList :: [ListCrossAccountAuthorizations] -> ShowS
show :: ListCrossAccountAuthorizations -> String
$cshow :: ListCrossAccountAuthorizations -> String
showsPrec :: Int -> ListCrossAccountAuthorizations -> ShowS
$cshowsPrec :: Int -> ListCrossAccountAuthorizations -> ShowS
Prelude.Show, (forall x.
 ListCrossAccountAuthorizations
 -> Rep ListCrossAccountAuthorizations x)
-> (forall x.
    Rep ListCrossAccountAuthorizations x
    -> ListCrossAccountAuthorizations)
-> Generic ListCrossAccountAuthorizations
forall x.
Rep ListCrossAccountAuthorizations x
-> ListCrossAccountAuthorizations
forall x.
ListCrossAccountAuthorizations
-> Rep ListCrossAccountAuthorizations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCrossAccountAuthorizations x
-> ListCrossAccountAuthorizations
$cfrom :: forall x.
ListCrossAccountAuthorizations
-> Rep ListCrossAccountAuthorizations x
Prelude.Generic)

-- |
-- Create a value of 'ListCrossAccountAuthorizations' 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', 'listCrossAccountAuthorizations_nextToken' - A token used to resume pagination from the end of a previous request.
--
-- 'maxResults', 'listCrossAccountAuthorizations_maxResults' - Upper bound on number of records to return.
newListCrossAccountAuthorizations ::
  ListCrossAccountAuthorizations
newListCrossAccountAuthorizations :: ListCrossAccountAuthorizations
newListCrossAccountAuthorizations =
  ListCrossAccountAuthorizations' :: Maybe Text -> Maybe Natural -> ListCrossAccountAuthorizations
ListCrossAccountAuthorizations'
    { $sel:nextToken:ListCrossAccountAuthorizations' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListCrossAccountAuthorizations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A token used to resume pagination from the end of a previous request.
listCrossAccountAuthorizations_nextToken :: Lens.Lens' ListCrossAccountAuthorizations (Prelude.Maybe Prelude.Text)
listCrossAccountAuthorizations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListCrossAccountAuthorizations
-> f ListCrossAccountAuthorizations
listCrossAccountAuthorizations_nextToken = (ListCrossAccountAuthorizations -> Maybe Text)
-> (ListCrossAccountAuthorizations
    -> Maybe Text -> ListCrossAccountAuthorizations)
-> Lens
     ListCrossAccountAuthorizations
     ListCrossAccountAuthorizations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCrossAccountAuthorizations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCrossAccountAuthorizations' :: ListCrossAccountAuthorizations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCrossAccountAuthorizations
s@ListCrossAccountAuthorizations' {} Maybe Text
a -> ListCrossAccountAuthorizations
s {$sel:nextToken:ListCrossAccountAuthorizations' :: Maybe Text
nextToken = Maybe Text
a} :: ListCrossAccountAuthorizations)

-- | Upper bound on number of records to return.
listCrossAccountAuthorizations_maxResults :: Lens.Lens' ListCrossAccountAuthorizations (Prelude.Maybe Prelude.Natural)
listCrossAccountAuthorizations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListCrossAccountAuthorizations
-> f ListCrossAccountAuthorizations
listCrossAccountAuthorizations_maxResults = (ListCrossAccountAuthorizations -> Maybe Natural)
-> (ListCrossAccountAuthorizations
    -> Maybe Natural -> ListCrossAccountAuthorizations)
-> Lens
     ListCrossAccountAuthorizations
     ListCrossAccountAuthorizations
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCrossAccountAuthorizations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCrossAccountAuthorizations' :: ListCrossAccountAuthorizations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCrossAccountAuthorizations
s@ListCrossAccountAuthorizations' {} Maybe Natural
a -> ListCrossAccountAuthorizations
s {$sel:maxResults:ListCrossAccountAuthorizations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCrossAccountAuthorizations)

instance Core.AWSPager ListCrossAccountAuthorizations where
  page :: ListCrossAccountAuthorizations
-> AWSResponse ListCrossAccountAuthorizations
-> Maybe ListCrossAccountAuthorizations
page ListCrossAccountAuthorizations
rq AWSResponse ListCrossAccountAuthorizations
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCrossAccountAuthorizations
ListCrossAccountAuthorizationsResponse
rs
            ListCrossAccountAuthorizationsResponse
-> Getting (First Text) ListCrossAccountAuthorizationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCrossAccountAuthorizationsResponse
-> Const (First Text) ListCrossAccountAuthorizationsResponse
Lens' ListCrossAccountAuthorizationsResponse (Maybe Text)
listCrossAccountAuthorizationsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListCrossAccountAuthorizationsResponse
 -> Const (First Text) ListCrossAccountAuthorizationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCrossAccountAuthorizationsResponse 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 ListCrossAccountAuthorizations
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCrossAccountAuthorizations
ListCrossAccountAuthorizationsResponse
rs
            ListCrossAccountAuthorizationsResponse
-> Getting
     (First [Text]) ListCrossAccountAuthorizationsResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListCrossAccountAuthorizationsResponse
-> Const (First [Text]) ListCrossAccountAuthorizationsResponse
Lens' ListCrossAccountAuthorizationsResponse (Maybe [Text])
listCrossAccountAuthorizationsResponse_crossAccountAuthorizations
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListCrossAccountAuthorizationsResponse
 -> Const (First [Text]) ListCrossAccountAuthorizationsResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting
     (First [Text]) ListCrossAccountAuthorizationsResponse [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 ListCrossAccountAuthorizations
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListCrossAccountAuthorizations
-> Maybe ListCrossAccountAuthorizations
forall a. a -> Maybe a
Prelude.Just (ListCrossAccountAuthorizations
 -> Maybe ListCrossAccountAuthorizations)
-> ListCrossAccountAuthorizations
-> Maybe ListCrossAccountAuthorizations
forall a b. (a -> b) -> a -> b
Prelude.$
        ListCrossAccountAuthorizations
rq
          ListCrossAccountAuthorizations
-> (ListCrossAccountAuthorizations
    -> ListCrossAccountAuthorizations)
-> ListCrossAccountAuthorizations
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListCrossAccountAuthorizations
-> Identity ListCrossAccountAuthorizations
Lens
  ListCrossAccountAuthorizations
  ListCrossAccountAuthorizations
  (Maybe Text)
  (Maybe Text)
listCrossAccountAuthorizations_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListCrossAccountAuthorizations
 -> Identity ListCrossAccountAuthorizations)
-> Maybe Text
-> ListCrossAccountAuthorizations
-> ListCrossAccountAuthorizations
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCrossAccountAuthorizations
ListCrossAccountAuthorizationsResponse
rs
          ListCrossAccountAuthorizationsResponse
-> Getting (First Text) ListCrossAccountAuthorizationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCrossAccountAuthorizationsResponse
-> Const (First Text) ListCrossAccountAuthorizationsResponse
Lens' ListCrossAccountAuthorizationsResponse (Maybe Text)
listCrossAccountAuthorizationsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListCrossAccountAuthorizationsResponse
 -> Const (First Text) ListCrossAccountAuthorizationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCrossAccountAuthorizationsResponse 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
    ListCrossAccountAuthorizations
  where
  type
    AWSResponse ListCrossAccountAuthorizations =
      ListCrossAccountAuthorizationsResponse
  request :: ListCrossAccountAuthorizations
-> Request ListCrossAccountAuthorizations
request = Service
-> ListCrossAccountAuthorizations
-> Request ListCrossAccountAuthorizations
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListCrossAccountAuthorizations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListCrossAccountAuthorizations)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListCrossAccountAuthorizations))
-> Logger
-> Service
-> Proxy ListCrossAccountAuthorizations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListCrossAccountAuthorizations)))
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 Text -> Int -> ListCrossAccountAuthorizationsResponse
ListCrossAccountAuthorizationsResponse'
            (Maybe [Text]
 -> Maybe Text -> Int -> ListCrossAccountAuthorizationsResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text -> Int -> ListCrossAccountAuthorizationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"crossAccountAuthorizations"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text -> Int -> ListCrossAccountAuthorizationsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListCrossAccountAuthorizationsResponse)
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 -> ListCrossAccountAuthorizationsResponse)
-> Either String Int
-> Either String ListCrossAccountAuthorizationsResponse
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
    ListCrossAccountAuthorizations

instance
  Prelude.NFData
    ListCrossAccountAuthorizations

instance
  Core.ToHeaders
    ListCrossAccountAuthorizations
  where
  toHeaders :: ListCrossAccountAuthorizations -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ListCrossAccountAuthorizations -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListCrossAccountAuthorizations where
  toPath :: ListCrossAccountAuthorizations -> ByteString
toPath = ByteString -> ListCrossAccountAuthorizations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/crossaccountauthorizations"

instance Core.ToQuery ListCrossAccountAuthorizations where
  toQuery :: ListCrossAccountAuthorizations -> QueryString
toQuery ListCrossAccountAuthorizations' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListCrossAccountAuthorizations' :: ListCrossAccountAuthorizations -> Maybe Natural
$sel:nextToken:ListCrossAccountAuthorizations' :: ListCrossAccountAuthorizations -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListCrossAccountAuthorizationsResponse' smart constructor.
data ListCrossAccountAuthorizationsResponse = ListCrossAccountAuthorizationsResponse'
  { -- | A list of CrossAccountAuthorizations
    ListCrossAccountAuthorizationsResponse -> Maybe [Text]
crossAccountAuthorizations :: Prelude.Maybe [Prelude.Text],
    -- | A token that can be used to resume pagination from the end of the
    -- collection.
    ListCrossAccountAuthorizationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListCrossAccountAuthorizationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListCrossAccountAuthorizationsResponse
-> ListCrossAccountAuthorizationsResponse -> Bool
(ListCrossAccountAuthorizationsResponse
 -> ListCrossAccountAuthorizationsResponse -> Bool)
-> (ListCrossAccountAuthorizationsResponse
    -> ListCrossAccountAuthorizationsResponse -> Bool)
-> Eq ListCrossAccountAuthorizationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCrossAccountAuthorizationsResponse
-> ListCrossAccountAuthorizationsResponse -> Bool
$c/= :: ListCrossAccountAuthorizationsResponse
-> ListCrossAccountAuthorizationsResponse -> Bool
== :: ListCrossAccountAuthorizationsResponse
-> ListCrossAccountAuthorizationsResponse -> Bool
$c== :: ListCrossAccountAuthorizationsResponse
-> ListCrossAccountAuthorizationsResponse -> Bool
Prelude.Eq, ReadPrec [ListCrossAccountAuthorizationsResponse]
ReadPrec ListCrossAccountAuthorizationsResponse
Int -> ReadS ListCrossAccountAuthorizationsResponse
ReadS [ListCrossAccountAuthorizationsResponse]
(Int -> ReadS ListCrossAccountAuthorizationsResponse)
-> ReadS [ListCrossAccountAuthorizationsResponse]
-> ReadPrec ListCrossAccountAuthorizationsResponse
-> ReadPrec [ListCrossAccountAuthorizationsResponse]
-> Read ListCrossAccountAuthorizationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCrossAccountAuthorizationsResponse]
$creadListPrec :: ReadPrec [ListCrossAccountAuthorizationsResponse]
readPrec :: ReadPrec ListCrossAccountAuthorizationsResponse
$creadPrec :: ReadPrec ListCrossAccountAuthorizationsResponse
readList :: ReadS [ListCrossAccountAuthorizationsResponse]
$creadList :: ReadS [ListCrossAccountAuthorizationsResponse]
readsPrec :: Int -> ReadS ListCrossAccountAuthorizationsResponse
$creadsPrec :: Int -> ReadS ListCrossAccountAuthorizationsResponse
Prelude.Read, Int -> ListCrossAccountAuthorizationsResponse -> ShowS
[ListCrossAccountAuthorizationsResponse] -> ShowS
ListCrossAccountAuthorizationsResponse -> String
(Int -> ListCrossAccountAuthorizationsResponse -> ShowS)
-> (ListCrossAccountAuthorizationsResponse -> String)
-> ([ListCrossAccountAuthorizationsResponse] -> ShowS)
-> Show ListCrossAccountAuthorizationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCrossAccountAuthorizationsResponse] -> ShowS
$cshowList :: [ListCrossAccountAuthorizationsResponse] -> ShowS
show :: ListCrossAccountAuthorizationsResponse -> String
$cshow :: ListCrossAccountAuthorizationsResponse -> String
showsPrec :: Int -> ListCrossAccountAuthorizationsResponse -> ShowS
$cshowsPrec :: Int -> ListCrossAccountAuthorizationsResponse -> ShowS
Prelude.Show, (forall x.
 ListCrossAccountAuthorizationsResponse
 -> Rep ListCrossAccountAuthorizationsResponse x)
-> (forall x.
    Rep ListCrossAccountAuthorizationsResponse x
    -> ListCrossAccountAuthorizationsResponse)
-> Generic ListCrossAccountAuthorizationsResponse
forall x.
Rep ListCrossAccountAuthorizationsResponse x
-> ListCrossAccountAuthorizationsResponse
forall x.
ListCrossAccountAuthorizationsResponse
-> Rep ListCrossAccountAuthorizationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCrossAccountAuthorizationsResponse x
-> ListCrossAccountAuthorizationsResponse
$cfrom :: forall x.
ListCrossAccountAuthorizationsResponse
-> Rep ListCrossAccountAuthorizationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListCrossAccountAuthorizationsResponse' 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:
--
-- 'crossAccountAuthorizations', 'listCrossAccountAuthorizationsResponse_crossAccountAuthorizations' - A list of CrossAccountAuthorizations
--
-- 'nextToken', 'listCrossAccountAuthorizationsResponse_nextToken' - A token that can be used to resume pagination from the end of the
-- collection.
--
-- 'httpStatus', 'listCrossAccountAuthorizationsResponse_httpStatus' - The response's http status code.
newListCrossAccountAuthorizationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListCrossAccountAuthorizationsResponse
newListCrossAccountAuthorizationsResponse :: Int -> ListCrossAccountAuthorizationsResponse
newListCrossAccountAuthorizationsResponse
  Int
pHttpStatus_ =
    ListCrossAccountAuthorizationsResponse' :: Maybe [Text]
-> Maybe Text -> Int -> ListCrossAccountAuthorizationsResponse
ListCrossAccountAuthorizationsResponse'
      { $sel:crossAccountAuthorizations:ListCrossAccountAuthorizationsResponse' :: Maybe [Text]
crossAccountAuthorizations =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListCrossAccountAuthorizationsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListCrossAccountAuthorizationsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A list of CrossAccountAuthorizations
listCrossAccountAuthorizationsResponse_crossAccountAuthorizations :: Lens.Lens' ListCrossAccountAuthorizationsResponse (Prelude.Maybe [Prelude.Text])
listCrossAccountAuthorizationsResponse_crossAccountAuthorizations :: (Maybe [Text] -> f (Maybe [Text]))
-> ListCrossAccountAuthorizationsResponse
-> f ListCrossAccountAuthorizationsResponse
listCrossAccountAuthorizationsResponse_crossAccountAuthorizations = (ListCrossAccountAuthorizationsResponse -> Maybe [Text])
-> (ListCrossAccountAuthorizationsResponse
    -> Maybe [Text] -> ListCrossAccountAuthorizationsResponse)
-> Lens' ListCrossAccountAuthorizationsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCrossAccountAuthorizationsResponse' {Maybe [Text]
crossAccountAuthorizations :: Maybe [Text]
$sel:crossAccountAuthorizations:ListCrossAccountAuthorizationsResponse' :: ListCrossAccountAuthorizationsResponse -> Maybe [Text]
crossAccountAuthorizations} -> Maybe [Text]
crossAccountAuthorizations) (\s :: ListCrossAccountAuthorizationsResponse
s@ListCrossAccountAuthorizationsResponse' {} Maybe [Text]
a -> ListCrossAccountAuthorizationsResponse
s {$sel:crossAccountAuthorizations:ListCrossAccountAuthorizationsResponse' :: Maybe [Text]
crossAccountAuthorizations = Maybe [Text]
a} :: ListCrossAccountAuthorizationsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListCrossAccountAuthorizationsResponse
 -> f ListCrossAccountAuthorizationsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListCrossAccountAuthorizationsResponse
-> f ListCrossAccountAuthorizationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token that can be used to resume pagination from the end of the
-- collection.
listCrossAccountAuthorizationsResponse_nextToken :: Lens.Lens' ListCrossAccountAuthorizationsResponse (Prelude.Maybe Prelude.Text)
listCrossAccountAuthorizationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListCrossAccountAuthorizationsResponse
-> f ListCrossAccountAuthorizationsResponse
listCrossAccountAuthorizationsResponse_nextToken = (ListCrossAccountAuthorizationsResponse -> Maybe Text)
-> (ListCrossAccountAuthorizationsResponse
    -> Maybe Text -> ListCrossAccountAuthorizationsResponse)
-> Lens' ListCrossAccountAuthorizationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCrossAccountAuthorizationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCrossAccountAuthorizationsResponse' :: ListCrossAccountAuthorizationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCrossAccountAuthorizationsResponse
s@ListCrossAccountAuthorizationsResponse' {} Maybe Text
a -> ListCrossAccountAuthorizationsResponse
s {$sel:nextToken:ListCrossAccountAuthorizationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListCrossAccountAuthorizationsResponse)

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

instance
  Prelude.NFData
    ListCrossAccountAuthorizationsResponse