{-# 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.Route53RecoveryReadiness.ListCrossAccountAuthorizations
(
ListCrossAccountAuthorizations (..),
newListCrossAccountAuthorizations,
listCrossAccountAuthorizations_maxResults,
listCrossAccountAuthorizations_nextToken,
ListCrossAccountAuthorizationsResponse (..),
newListCrossAccountAuthorizationsResponse,
listCrossAccountAuthorizationsResponse_crossAccountAuthorizations,
listCrossAccountAuthorizationsResponse_nextToken,
listCrossAccountAuthorizationsResponse_httpStatus,
)
where
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
import Amazonka.Route53RecoveryReadiness.Types
data ListCrossAccountAuthorizations = ListCrossAccountAuthorizations'
{
ListCrossAccountAuthorizations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListCrossAccountAuthorizations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListCrossAccountAuthorizations
-> ListCrossAccountAuthorizations -> Bool
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]
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
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.
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)
newListCrossAccountAuthorizations ::
ListCrossAccountAuthorizations
newListCrossAccountAuthorizations :: ListCrossAccountAuthorizations
newListCrossAccountAuthorizations =
ListCrossAccountAuthorizations'
{ $sel:maxResults:ListCrossAccountAuthorizations' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListCrossAccountAuthorizations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listCrossAccountAuthorizations_maxResults :: Lens.Lens' ListCrossAccountAuthorizations (Prelude.Maybe Prelude.Natural)
listCrossAccountAuthorizations_maxResults :: Lens' ListCrossAccountAuthorizations (Maybe Natural)
listCrossAccountAuthorizations_maxResults = 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)
listCrossAccountAuthorizations_nextToken :: Lens.Lens' ListCrossAccountAuthorizations (Prelude.Maybe Prelude.Text)
listCrossAccountAuthorizations_nextToken :: Lens' ListCrossAccountAuthorizations (Maybe Text)
listCrossAccountAuthorizations_nextToken = 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)
instance Core.AWSPager ListCrossAccountAuthorizations where
page :: ListCrossAccountAuthorizations
-> AWSResponse ListCrossAccountAuthorizations
-> Maybe ListCrossAccountAuthorizations
page ListCrossAccountAuthorizations
rq AWSResponse ListCrossAccountAuthorizations
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListCrossAccountAuthorizations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCrossAccountAuthorizationsResponse (Maybe Text)
listCrossAccountAuthorizationsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListCrossAccountAuthorizations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCrossAccountAuthorizationsResponse (Maybe [Text])
listCrossAccountAuthorizationsResponse_crossAccountAuthorizations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListCrossAccountAuthorizations
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListCrossAccountAuthorizations (Maybe Text)
listCrossAccountAuthorizations_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCrossAccountAuthorizations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCrossAccountAuthorizationsResponse (Maybe Text)
listCrossAccountAuthorizationsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance
Core.AWSRequest
ListCrossAccountAuthorizations
where
type
AWSResponse ListCrossAccountAuthorizations =
ListCrossAccountAuthorizationsResponse
request :: (Service -> Service)
-> ListCrossAccountAuthorizations
-> Request ListCrossAccountAuthorizations
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListCrossAccountAuthorizations
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse ListCrossAccountAuthorizations)))
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 Text -> Int -> ListCrossAccountAuthorizationsResponse
ListCrossAccountAuthorizationsResponse'
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
"crossAccountAuthorizations"
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.<*> (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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
ListCrossAccountAuthorizations
where
hashWithSalt :: Int -> ListCrossAccountAuthorizations -> Int
hashWithSalt
Int
_salt
ListCrossAccountAuthorizations' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListCrossAccountAuthorizations' :: ListCrossAccountAuthorizations -> Maybe Text
$sel:maxResults:ListCrossAccountAuthorizations' :: ListCrossAccountAuthorizations -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance
Prelude.NFData
ListCrossAccountAuthorizations
where
rnf :: ListCrossAccountAuthorizations -> ()
rnf ListCrossAccountAuthorizations' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListCrossAccountAuthorizations' :: ListCrossAccountAuthorizations -> Maybe Text
$sel:maxResults:ListCrossAccountAuthorizations' :: ListCrossAccountAuthorizations -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance
Data.ToHeaders
ListCrossAccountAuthorizations
where
toHeaders :: ListCrossAccountAuthorizations -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListCrossAccountAuthorizations where
toPath :: ListCrossAccountAuthorizations -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/crossaccountauthorizations"
instance Data.ToQuery ListCrossAccountAuthorizations where
toQuery :: ListCrossAccountAuthorizations -> QueryString
toQuery ListCrossAccountAuthorizations' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListCrossAccountAuthorizations' :: ListCrossAccountAuthorizations -> Maybe Text
$sel:maxResults:ListCrossAccountAuthorizations' :: ListCrossAccountAuthorizations -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListCrossAccountAuthorizationsResponse = ListCrossAccountAuthorizationsResponse'
{
ListCrossAccountAuthorizationsResponse -> Maybe [Text]
crossAccountAuthorizations :: Prelude.Maybe [Prelude.Text],
ListCrossAccountAuthorizationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListCrossAccountAuthorizationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListCrossAccountAuthorizationsResponse
-> ListCrossAccountAuthorizationsResponse -> Bool
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]
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
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.
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)
newListCrossAccountAuthorizationsResponse ::
Prelude.Int ->
ListCrossAccountAuthorizationsResponse
newListCrossAccountAuthorizationsResponse :: Int -> ListCrossAccountAuthorizationsResponse
newListCrossAccountAuthorizationsResponse
Int
pHttpStatus_ =
ListCrossAccountAuthorizationsResponse'
{ $sel:crossAccountAuthorizations:ListCrossAccountAuthorizationsResponse' :: Maybe [Text]
crossAccountAuthorizations =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListCrossAccountAuthorizationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListCrossAccountAuthorizationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listCrossAccountAuthorizationsResponse_crossAccountAuthorizations :: Lens.Lens' ListCrossAccountAuthorizationsResponse (Prelude.Maybe [Prelude.Text])
listCrossAccountAuthorizationsResponse_crossAccountAuthorizations :: Lens' ListCrossAccountAuthorizationsResponse (Maybe [Text])
listCrossAccountAuthorizationsResponse_crossAccountAuthorizations = 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) 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
listCrossAccountAuthorizationsResponse_nextToken :: Lens.Lens' ListCrossAccountAuthorizationsResponse (Prelude.Maybe Prelude.Text)
listCrossAccountAuthorizationsResponse_nextToken :: Lens' ListCrossAccountAuthorizationsResponse (Maybe Text)
listCrossAccountAuthorizationsResponse_nextToken = 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)
listCrossAccountAuthorizationsResponse_httpStatus :: Lens.Lens' ListCrossAccountAuthorizationsResponse Prelude.Int
listCrossAccountAuthorizationsResponse_httpStatus :: Lens' ListCrossAccountAuthorizationsResponse Int
listCrossAccountAuthorizationsResponse_httpStatus = 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
where
rnf :: ListCrossAccountAuthorizationsResponse -> ()
rnf ListCrossAccountAuthorizationsResponse' {Int
Maybe [Text]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
crossAccountAuthorizations :: Maybe [Text]
$sel:httpStatus:ListCrossAccountAuthorizationsResponse' :: ListCrossAccountAuthorizationsResponse -> Int
$sel:nextToken:ListCrossAccountAuthorizationsResponse' :: ListCrossAccountAuthorizationsResponse -> Maybe Text
$sel:crossAccountAuthorizations:ListCrossAccountAuthorizationsResponse' :: ListCrossAccountAuthorizationsResponse -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
crossAccountAuthorizations
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 Int
httpStatus