{-# 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.CognitoSync.ListIdentityPoolUsage
(
ListIdentityPoolUsage (..),
newListIdentityPoolUsage,
listIdentityPoolUsage_maxResults,
listIdentityPoolUsage_nextToken,
ListIdentityPoolUsageResponse (..),
newListIdentityPoolUsageResponse,
listIdentityPoolUsageResponse_count,
listIdentityPoolUsageResponse_identityPoolUsages,
listIdentityPoolUsageResponse_maxResults,
listIdentityPoolUsageResponse_nextToken,
listIdentityPoolUsageResponse_httpStatus,
)
where
import Amazonka.CognitoSync.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 ListIdentityPoolUsage = ListIdentityPoolUsage'
{
ListIdentityPoolUsage -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
ListIdentityPoolUsage -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListIdentityPoolUsage -> ListIdentityPoolUsage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIdentityPoolUsage -> ListIdentityPoolUsage -> Bool
$c/= :: ListIdentityPoolUsage -> ListIdentityPoolUsage -> Bool
== :: ListIdentityPoolUsage -> ListIdentityPoolUsage -> Bool
$c== :: ListIdentityPoolUsage -> ListIdentityPoolUsage -> Bool
Prelude.Eq, ReadPrec [ListIdentityPoolUsage]
ReadPrec ListIdentityPoolUsage
Int -> ReadS ListIdentityPoolUsage
ReadS [ListIdentityPoolUsage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIdentityPoolUsage]
$creadListPrec :: ReadPrec [ListIdentityPoolUsage]
readPrec :: ReadPrec ListIdentityPoolUsage
$creadPrec :: ReadPrec ListIdentityPoolUsage
readList :: ReadS [ListIdentityPoolUsage]
$creadList :: ReadS [ListIdentityPoolUsage]
readsPrec :: Int -> ReadS ListIdentityPoolUsage
$creadsPrec :: Int -> ReadS ListIdentityPoolUsage
Prelude.Read, Int -> ListIdentityPoolUsage -> ShowS
[ListIdentityPoolUsage] -> ShowS
ListIdentityPoolUsage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIdentityPoolUsage] -> ShowS
$cshowList :: [ListIdentityPoolUsage] -> ShowS
show :: ListIdentityPoolUsage -> String
$cshow :: ListIdentityPoolUsage -> String
showsPrec :: Int -> ListIdentityPoolUsage -> ShowS
$cshowsPrec :: Int -> ListIdentityPoolUsage -> ShowS
Prelude.Show, forall x. Rep ListIdentityPoolUsage x -> ListIdentityPoolUsage
forall x. ListIdentityPoolUsage -> Rep ListIdentityPoolUsage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIdentityPoolUsage x -> ListIdentityPoolUsage
$cfrom :: forall x. ListIdentityPoolUsage -> Rep ListIdentityPoolUsage x
Prelude.Generic)
newListIdentityPoolUsage ::
ListIdentityPoolUsage
newListIdentityPoolUsage :: ListIdentityPoolUsage
newListIdentityPoolUsage =
ListIdentityPoolUsage'
{ $sel:maxResults:ListIdentityPoolUsage' :: Maybe Int
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListIdentityPoolUsage' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listIdentityPoolUsage_maxResults :: Lens.Lens' ListIdentityPoolUsage (Prelude.Maybe Prelude.Int)
listIdentityPoolUsage_maxResults :: Lens' ListIdentityPoolUsage (Maybe Int)
listIdentityPoolUsage_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityPoolUsage' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListIdentityPoolUsage' :: ListIdentityPoolUsage -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListIdentityPoolUsage
s@ListIdentityPoolUsage' {} Maybe Int
a -> ListIdentityPoolUsage
s {$sel:maxResults:ListIdentityPoolUsage' :: Maybe Int
maxResults = Maybe Int
a} :: ListIdentityPoolUsage)
listIdentityPoolUsage_nextToken :: Lens.Lens' ListIdentityPoolUsage (Prelude.Maybe Prelude.Text)
listIdentityPoolUsage_nextToken :: Lens' ListIdentityPoolUsage (Maybe Text)
listIdentityPoolUsage_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityPoolUsage' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIdentityPoolUsage' :: ListIdentityPoolUsage -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIdentityPoolUsage
s@ListIdentityPoolUsage' {} Maybe Text
a -> ListIdentityPoolUsage
s {$sel:nextToken:ListIdentityPoolUsage' :: Maybe Text
nextToken = Maybe Text
a} :: ListIdentityPoolUsage)
instance Core.AWSRequest ListIdentityPoolUsage where
type
AWSResponse ListIdentityPoolUsage =
ListIdentityPoolUsageResponse
request :: (Service -> Service)
-> ListIdentityPoolUsage -> Request ListIdentityPoolUsage
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 ListIdentityPoolUsage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListIdentityPoolUsage)))
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 Int
-> Maybe [IdentityPoolUsage]
-> Maybe Int
-> Maybe Text
-> Int
-> ListIdentityPoolUsageResponse
ListIdentityPoolUsageResponse'
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
"Count")
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
"IdentityPoolUsages"
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
"MaxResults")
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 ListIdentityPoolUsage where
hashWithSalt :: Int -> ListIdentityPoolUsage -> Int
hashWithSalt Int
_salt ListIdentityPoolUsage' {Maybe Int
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:nextToken:ListIdentityPoolUsage' :: ListIdentityPoolUsage -> Maybe Text
$sel:maxResults:ListIdentityPoolUsage' :: ListIdentityPoolUsage -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListIdentityPoolUsage where
rnf :: ListIdentityPoolUsage -> ()
rnf ListIdentityPoolUsage' {Maybe Int
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:nextToken:ListIdentityPoolUsage' :: ListIdentityPoolUsage -> Maybe Text
$sel:maxResults:ListIdentityPoolUsage' :: ListIdentityPoolUsage -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListIdentityPoolUsage where
toHeaders :: ListIdentityPoolUsage -> 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 ListIdentityPoolUsage where
toPath :: ListIdentityPoolUsage -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/identitypools"
instance Data.ToQuery ListIdentityPoolUsage where
toQuery :: ListIdentityPoolUsage -> QueryString
toQuery ListIdentityPoolUsage' {Maybe Int
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:nextToken:ListIdentityPoolUsage' :: ListIdentityPoolUsage -> Maybe Text
$sel:maxResults:ListIdentityPoolUsage' :: ListIdentityPoolUsage -> Maybe Int
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListIdentityPoolUsageResponse = ListIdentityPoolUsageResponse'
{
ListIdentityPoolUsageResponse -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
ListIdentityPoolUsageResponse -> Maybe [IdentityPoolUsage]
identityPoolUsages :: Prelude.Maybe [IdentityPoolUsage],
ListIdentityPoolUsageResponse -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
ListIdentityPoolUsageResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListIdentityPoolUsageResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListIdentityPoolUsageResponse
-> ListIdentityPoolUsageResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIdentityPoolUsageResponse
-> ListIdentityPoolUsageResponse -> Bool
$c/= :: ListIdentityPoolUsageResponse
-> ListIdentityPoolUsageResponse -> Bool
== :: ListIdentityPoolUsageResponse
-> ListIdentityPoolUsageResponse -> Bool
$c== :: ListIdentityPoolUsageResponse
-> ListIdentityPoolUsageResponse -> Bool
Prelude.Eq, ReadPrec [ListIdentityPoolUsageResponse]
ReadPrec ListIdentityPoolUsageResponse
Int -> ReadS ListIdentityPoolUsageResponse
ReadS [ListIdentityPoolUsageResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIdentityPoolUsageResponse]
$creadListPrec :: ReadPrec [ListIdentityPoolUsageResponse]
readPrec :: ReadPrec ListIdentityPoolUsageResponse
$creadPrec :: ReadPrec ListIdentityPoolUsageResponse
readList :: ReadS [ListIdentityPoolUsageResponse]
$creadList :: ReadS [ListIdentityPoolUsageResponse]
readsPrec :: Int -> ReadS ListIdentityPoolUsageResponse
$creadsPrec :: Int -> ReadS ListIdentityPoolUsageResponse
Prelude.Read, Int -> ListIdentityPoolUsageResponse -> ShowS
[ListIdentityPoolUsageResponse] -> ShowS
ListIdentityPoolUsageResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIdentityPoolUsageResponse] -> ShowS
$cshowList :: [ListIdentityPoolUsageResponse] -> ShowS
show :: ListIdentityPoolUsageResponse -> String
$cshow :: ListIdentityPoolUsageResponse -> String
showsPrec :: Int -> ListIdentityPoolUsageResponse -> ShowS
$cshowsPrec :: Int -> ListIdentityPoolUsageResponse -> ShowS
Prelude.Show, forall x.
Rep ListIdentityPoolUsageResponse x
-> ListIdentityPoolUsageResponse
forall x.
ListIdentityPoolUsageResponse
-> Rep ListIdentityPoolUsageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListIdentityPoolUsageResponse x
-> ListIdentityPoolUsageResponse
$cfrom :: forall x.
ListIdentityPoolUsageResponse
-> Rep ListIdentityPoolUsageResponse x
Prelude.Generic)
newListIdentityPoolUsageResponse ::
Prelude.Int ->
ListIdentityPoolUsageResponse
newListIdentityPoolUsageResponse :: Int -> ListIdentityPoolUsageResponse
newListIdentityPoolUsageResponse Int
pHttpStatus_ =
ListIdentityPoolUsageResponse'
{ $sel:count:ListIdentityPoolUsageResponse' :: Maybe Int
count =
forall a. Maybe a
Prelude.Nothing,
$sel:identityPoolUsages:ListIdentityPoolUsageResponse' :: Maybe [IdentityPoolUsage]
identityPoolUsages = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListIdentityPoolUsageResponse' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListIdentityPoolUsageResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListIdentityPoolUsageResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listIdentityPoolUsageResponse_count :: Lens.Lens' ListIdentityPoolUsageResponse (Prelude.Maybe Prelude.Int)
listIdentityPoolUsageResponse_count :: Lens' ListIdentityPoolUsageResponse (Maybe Int)
listIdentityPoolUsageResponse_count = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityPoolUsageResponse' {Maybe Int
count :: Maybe Int
$sel:count:ListIdentityPoolUsageResponse' :: ListIdentityPoolUsageResponse -> Maybe Int
count} -> Maybe Int
count) (\s :: ListIdentityPoolUsageResponse
s@ListIdentityPoolUsageResponse' {} Maybe Int
a -> ListIdentityPoolUsageResponse
s {$sel:count:ListIdentityPoolUsageResponse' :: Maybe Int
count = Maybe Int
a} :: ListIdentityPoolUsageResponse)
listIdentityPoolUsageResponse_identityPoolUsages :: Lens.Lens' ListIdentityPoolUsageResponse (Prelude.Maybe [IdentityPoolUsage])
listIdentityPoolUsageResponse_identityPoolUsages :: Lens' ListIdentityPoolUsageResponse (Maybe [IdentityPoolUsage])
listIdentityPoolUsageResponse_identityPoolUsages = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityPoolUsageResponse' {Maybe [IdentityPoolUsage]
identityPoolUsages :: Maybe [IdentityPoolUsage]
$sel:identityPoolUsages:ListIdentityPoolUsageResponse' :: ListIdentityPoolUsageResponse -> Maybe [IdentityPoolUsage]
identityPoolUsages} -> Maybe [IdentityPoolUsage]
identityPoolUsages) (\s :: ListIdentityPoolUsageResponse
s@ListIdentityPoolUsageResponse' {} Maybe [IdentityPoolUsage]
a -> ListIdentityPoolUsageResponse
s {$sel:identityPoolUsages:ListIdentityPoolUsageResponse' :: Maybe [IdentityPoolUsage]
identityPoolUsages = Maybe [IdentityPoolUsage]
a} :: ListIdentityPoolUsageResponse) 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
listIdentityPoolUsageResponse_maxResults :: Lens.Lens' ListIdentityPoolUsageResponse (Prelude.Maybe Prelude.Int)
listIdentityPoolUsageResponse_maxResults :: Lens' ListIdentityPoolUsageResponse (Maybe Int)
listIdentityPoolUsageResponse_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityPoolUsageResponse' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListIdentityPoolUsageResponse' :: ListIdentityPoolUsageResponse -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListIdentityPoolUsageResponse
s@ListIdentityPoolUsageResponse' {} Maybe Int
a -> ListIdentityPoolUsageResponse
s {$sel:maxResults:ListIdentityPoolUsageResponse' :: Maybe Int
maxResults = Maybe Int
a} :: ListIdentityPoolUsageResponse)
listIdentityPoolUsageResponse_nextToken :: Lens.Lens' ListIdentityPoolUsageResponse (Prelude.Maybe Prelude.Text)
listIdentityPoolUsageResponse_nextToken :: Lens' ListIdentityPoolUsageResponse (Maybe Text)
listIdentityPoolUsageResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityPoolUsageResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIdentityPoolUsageResponse' :: ListIdentityPoolUsageResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIdentityPoolUsageResponse
s@ListIdentityPoolUsageResponse' {} Maybe Text
a -> ListIdentityPoolUsageResponse
s {$sel:nextToken:ListIdentityPoolUsageResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListIdentityPoolUsageResponse)
listIdentityPoolUsageResponse_httpStatus :: Lens.Lens' ListIdentityPoolUsageResponse Prelude.Int
listIdentityPoolUsageResponse_httpStatus :: Lens' ListIdentityPoolUsageResponse Int
listIdentityPoolUsageResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityPoolUsageResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListIdentityPoolUsageResponse' :: ListIdentityPoolUsageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListIdentityPoolUsageResponse
s@ListIdentityPoolUsageResponse' {} Int
a -> ListIdentityPoolUsageResponse
s {$sel:httpStatus:ListIdentityPoolUsageResponse' :: Int
httpStatus = Int
a} :: ListIdentityPoolUsageResponse)
instance Prelude.NFData ListIdentityPoolUsageResponse where
rnf :: ListIdentityPoolUsageResponse -> ()
rnf ListIdentityPoolUsageResponse' {Int
Maybe Int
Maybe [IdentityPoolUsage]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
maxResults :: Maybe Int
identityPoolUsages :: Maybe [IdentityPoolUsage]
count :: Maybe Int
$sel:httpStatus:ListIdentityPoolUsageResponse' :: ListIdentityPoolUsageResponse -> Int
$sel:nextToken:ListIdentityPoolUsageResponse' :: ListIdentityPoolUsageResponse -> Maybe Text
$sel:maxResults:ListIdentityPoolUsageResponse' :: ListIdentityPoolUsageResponse -> Maybe Int
$sel:identityPoolUsages:ListIdentityPoolUsageResponse' :: ListIdentityPoolUsageResponse -> Maybe [IdentityPoolUsage]
$sel:count:ListIdentityPoolUsageResponse' :: ListIdentityPoolUsageResponse -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
count
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [IdentityPoolUsage]
identityPoolUsages
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
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