{-# 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.ManagedBlockChain.ListAccessors
(
ListAccessors (..),
newListAccessors,
listAccessors_maxResults,
listAccessors_nextToken,
ListAccessorsResponse (..),
newListAccessorsResponse,
listAccessorsResponse_accessors,
listAccessorsResponse_nextToken,
listAccessorsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ManagedBlockChain.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListAccessors = ListAccessors'
{
ListAccessors -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListAccessors -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListAccessors -> ListAccessors -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAccessors -> ListAccessors -> Bool
$c/= :: ListAccessors -> ListAccessors -> Bool
== :: ListAccessors -> ListAccessors -> Bool
$c== :: ListAccessors -> ListAccessors -> Bool
Prelude.Eq, ReadPrec [ListAccessors]
ReadPrec ListAccessors
Int -> ReadS ListAccessors
ReadS [ListAccessors]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAccessors]
$creadListPrec :: ReadPrec [ListAccessors]
readPrec :: ReadPrec ListAccessors
$creadPrec :: ReadPrec ListAccessors
readList :: ReadS [ListAccessors]
$creadList :: ReadS [ListAccessors]
readsPrec :: Int -> ReadS ListAccessors
$creadsPrec :: Int -> ReadS ListAccessors
Prelude.Read, Int -> ListAccessors -> ShowS
[ListAccessors] -> ShowS
ListAccessors -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAccessors] -> ShowS
$cshowList :: [ListAccessors] -> ShowS
show :: ListAccessors -> String
$cshow :: ListAccessors -> String
showsPrec :: Int -> ListAccessors -> ShowS
$cshowsPrec :: Int -> ListAccessors -> ShowS
Prelude.Show, forall x. Rep ListAccessors x -> ListAccessors
forall x. ListAccessors -> Rep ListAccessors x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAccessors x -> ListAccessors
$cfrom :: forall x. ListAccessors -> Rep ListAccessors x
Prelude.Generic)
newListAccessors ::
ListAccessors
newListAccessors :: ListAccessors
newListAccessors =
ListAccessors'
{ $sel:maxResults:ListAccessors' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAccessors' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listAccessors_maxResults :: Lens.Lens' ListAccessors (Prelude.Maybe Prelude.Natural)
listAccessors_maxResults :: Lens' ListAccessors (Maybe Natural)
listAccessors_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccessors' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAccessors' :: ListAccessors -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAccessors
s@ListAccessors' {} Maybe Natural
a -> ListAccessors
s {$sel:maxResults:ListAccessors' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAccessors)
listAccessors_nextToken :: Lens.Lens' ListAccessors (Prelude.Maybe Prelude.Text)
listAccessors_nextToken :: Lens' ListAccessors (Maybe Text)
listAccessors_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccessors' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAccessors' :: ListAccessors -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAccessors
s@ListAccessors' {} Maybe Text
a -> ListAccessors
s {$sel:nextToken:ListAccessors' :: Maybe Text
nextToken = Maybe Text
a} :: ListAccessors)
instance Core.AWSPager ListAccessors where
page :: ListAccessors -> AWSResponse ListAccessors -> Maybe ListAccessors
page ListAccessors
rq AWSResponse ListAccessors
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAccessors
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAccessorsResponse (Maybe Text)
listAccessorsResponse_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 ListAccessors
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAccessorsResponse (Maybe [AccessorSummary])
listAccessorsResponse_accessors
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.$ ListAccessors
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAccessors (Maybe Text)
listAccessors_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAccessors
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAccessorsResponse (Maybe Text)
listAccessorsResponse_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 ListAccessors where
type
AWSResponse ListAccessors =
ListAccessorsResponse
request :: (Service -> Service) -> ListAccessors -> Request ListAccessors
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 ListAccessors
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAccessors)))
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 [AccessorSummary]
-> Maybe Text -> Int -> ListAccessorsResponse
ListAccessorsResponse'
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
"Accessors" 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 ListAccessors where
hashWithSalt :: Int -> ListAccessors -> Int
hashWithSalt Int
_salt ListAccessors' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListAccessors' :: ListAccessors -> Maybe Text
$sel:maxResults:ListAccessors' :: ListAccessors -> 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 ListAccessors where
rnf :: ListAccessors -> ()
rnf ListAccessors' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListAccessors' :: ListAccessors -> Maybe Text
$sel:maxResults:ListAccessors' :: ListAccessors -> 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 ListAccessors where
toHeaders :: ListAccessors -> 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 ListAccessors where
toPath :: ListAccessors -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/accessors"
instance Data.ToQuery ListAccessors where
toQuery :: ListAccessors -> QueryString
toQuery ListAccessors' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListAccessors' :: ListAccessors -> Maybe Text
$sel:maxResults:ListAccessors' :: ListAccessors -> 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 ListAccessorsResponse = ListAccessorsResponse'
{
ListAccessorsResponse -> Maybe [AccessorSummary]
accessors :: Prelude.Maybe [AccessorSummary],
ListAccessorsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAccessorsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListAccessorsResponse -> ListAccessorsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAccessorsResponse -> ListAccessorsResponse -> Bool
$c/= :: ListAccessorsResponse -> ListAccessorsResponse -> Bool
== :: ListAccessorsResponse -> ListAccessorsResponse -> Bool
$c== :: ListAccessorsResponse -> ListAccessorsResponse -> Bool
Prelude.Eq, ReadPrec [ListAccessorsResponse]
ReadPrec ListAccessorsResponse
Int -> ReadS ListAccessorsResponse
ReadS [ListAccessorsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAccessorsResponse]
$creadListPrec :: ReadPrec [ListAccessorsResponse]
readPrec :: ReadPrec ListAccessorsResponse
$creadPrec :: ReadPrec ListAccessorsResponse
readList :: ReadS [ListAccessorsResponse]
$creadList :: ReadS [ListAccessorsResponse]
readsPrec :: Int -> ReadS ListAccessorsResponse
$creadsPrec :: Int -> ReadS ListAccessorsResponse
Prelude.Read, Int -> ListAccessorsResponse -> ShowS
[ListAccessorsResponse] -> ShowS
ListAccessorsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAccessorsResponse] -> ShowS
$cshowList :: [ListAccessorsResponse] -> ShowS
show :: ListAccessorsResponse -> String
$cshow :: ListAccessorsResponse -> String
showsPrec :: Int -> ListAccessorsResponse -> ShowS
$cshowsPrec :: Int -> ListAccessorsResponse -> ShowS
Prelude.Show, forall x. Rep ListAccessorsResponse x -> ListAccessorsResponse
forall x. ListAccessorsResponse -> Rep ListAccessorsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAccessorsResponse x -> ListAccessorsResponse
$cfrom :: forall x. ListAccessorsResponse -> Rep ListAccessorsResponse x
Prelude.Generic)
newListAccessorsResponse ::
Prelude.Int ->
ListAccessorsResponse
newListAccessorsResponse :: Int -> ListAccessorsResponse
newListAccessorsResponse Int
pHttpStatus_ =
ListAccessorsResponse'
{ $sel:accessors:ListAccessorsResponse' :: Maybe [AccessorSummary]
accessors = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAccessorsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAccessorsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listAccessorsResponse_accessors :: Lens.Lens' ListAccessorsResponse (Prelude.Maybe [AccessorSummary])
listAccessorsResponse_accessors :: Lens' ListAccessorsResponse (Maybe [AccessorSummary])
listAccessorsResponse_accessors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccessorsResponse' {Maybe [AccessorSummary]
accessors :: Maybe [AccessorSummary]
$sel:accessors:ListAccessorsResponse' :: ListAccessorsResponse -> Maybe [AccessorSummary]
accessors} -> Maybe [AccessorSummary]
accessors) (\s :: ListAccessorsResponse
s@ListAccessorsResponse' {} Maybe [AccessorSummary]
a -> ListAccessorsResponse
s {$sel:accessors:ListAccessorsResponse' :: Maybe [AccessorSummary]
accessors = Maybe [AccessorSummary]
a} :: ListAccessorsResponse) 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
listAccessorsResponse_nextToken :: Lens.Lens' ListAccessorsResponse (Prelude.Maybe Prelude.Text)
listAccessorsResponse_nextToken :: Lens' ListAccessorsResponse (Maybe Text)
listAccessorsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccessorsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAccessorsResponse' :: ListAccessorsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAccessorsResponse
s@ListAccessorsResponse' {} Maybe Text
a -> ListAccessorsResponse
s {$sel:nextToken:ListAccessorsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAccessorsResponse)
listAccessorsResponse_httpStatus :: Lens.Lens' ListAccessorsResponse Prelude.Int
listAccessorsResponse_httpStatus :: Lens' ListAccessorsResponse Int
listAccessorsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAccessorsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAccessorsResponse' :: ListAccessorsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAccessorsResponse
s@ListAccessorsResponse' {} Int
a -> ListAccessorsResponse
s {$sel:httpStatus:ListAccessorsResponse' :: Int
httpStatus = Int
a} :: ListAccessorsResponse)
instance Prelude.NFData ListAccessorsResponse where
rnf :: ListAccessorsResponse -> ()
rnf ListAccessorsResponse' {Int
Maybe [AccessorSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
accessors :: Maybe [AccessorSummary]
$sel:httpStatus:ListAccessorsResponse' :: ListAccessorsResponse -> Int
$sel:nextToken:ListAccessorsResponse' :: ListAccessorsResponse -> Maybe Text
$sel:accessors:ListAccessorsResponse' :: ListAccessorsResponse -> Maybe [AccessorSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AccessorSummary]
accessors
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