{-# 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.LicenseManager.ListReceivedGrants
(
ListReceivedGrants (..),
newListReceivedGrants,
listReceivedGrants_filters,
listReceivedGrants_grantArns,
listReceivedGrants_maxResults,
listReceivedGrants_nextToken,
ListReceivedGrantsResponse (..),
newListReceivedGrantsResponse,
listReceivedGrantsResponse_grants,
listReceivedGrantsResponse_nextToken,
listReceivedGrantsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LicenseManager.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListReceivedGrants = ListReceivedGrants'
{
ListReceivedGrants -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
ListReceivedGrants -> Maybe [Text]
grantArns :: Prelude.Maybe [Prelude.Text],
ListReceivedGrants -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListReceivedGrants -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListReceivedGrants -> ListReceivedGrants -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListReceivedGrants -> ListReceivedGrants -> Bool
$c/= :: ListReceivedGrants -> ListReceivedGrants -> Bool
== :: ListReceivedGrants -> ListReceivedGrants -> Bool
$c== :: ListReceivedGrants -> ListReceivedGrants -> Bool
Prelude.Eq, ReadPrec [ListReceivedGrants]
ReadPrec ListReceivedGrants
Int -> ReadS ListReceivedGrants
ReadS [ListReceivedGrants]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListReceivedGrants]
$creadListPrec :: ReadPrec [ListReceivedGrants]
readPrec :: ReadPrec ListReceivedGrants
$creadPrec :: ReadPrec ListReceivedGrants
readList :: ReadS [ListReceivedGrants]
$creadList :: ReadS [ListReceivedGrants]
readsPrec :: Int -> ReadS ListReceivedGrants
$creadsPrec :: Int -> ReadS ListReceivedGrants
Prelude.Read, Int -> ListReceivedGrants -> ShowS
[ListReceivedGrants] -> ShowS
ListReceivedGrants -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListReceivedGrants] -> ShowS
$cshowList :: [ListReceivedGrants] -> ShowS
show :: ListReceivedGrants -> String
$cshow :: ListReceivedGrants -> String
showsPrec :: Int -> ListReceivedGrants -> ShowS
$cshowsPrec :: Int -> ListReceivedGrants -> ShowS
Prelude.Show, forall x. Rep ListReceivedGrants x -> ListReceivedGrants
forall x. ListReceivedGrants -> Rep ListReceivedGrants x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListReceivedGrants x -> ListReceivedGrants
$cfrom :: forall x. ListReceivedGrants -> Rep ListReceivedGrants x
Prelude.Generic)
newListReceivedGrants ::
ListReceivedGrants
newListReceivedGrants :: ListReceivedGrants
newListReceivedGrants =
ListReceivedGrants'
{ $sel:filters:ListReceivedGrants' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
$sel:grantArns:ListReceivedGrants' :: Maybe [Text]
grantArns = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListReceivedGrants' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListReceivedGrants' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listReceivedGrants_filters :: Lens.Lens' ListReceivedGrants (Prelude.Maybe [Filter])
listReceivedGrants_filters :: Lens' ListReceivedGrants (Maybe [Filter])
listReceivedGrants_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReceivedGrants' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ListReceivedGrants' :: ListReceivedGrants -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ListReceivedGrants
s@ListReceivedGrants' {} Maybe [Filter]
a -> ListReceivedGrants
s {$sel:filters:ListReceivedGrants' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ListReceivedGrants) 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
listReceivedGrants_grantArns :: Lens.Lens' ListReceivedGrants (Prelude.Maybe [Prelude.Text])
listReceivedGrants_grantArns :: Lens' ListReceivedGrants (Maybe [Text])
listReceivedGrants_grantArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReceivedGrants' {Maybe [Text]
grantArns :: Maybe [Text]
$sel:grantArns:ListReceivedGrants' :: ListReceivedGrants -> Maybe [Text]
grantArns} -> Maybe [Text]
grantArns) (\s :: ListReceivedGrants
s@ListReceivedGrants' {} Maybe [Text]
a -> ListReceivedGrants
s {$sel:grantArns:ListReceivedGrants' :: Maybe [Text]
grantArns = Maybe [Text]
a} :: ListReceivedGrants) 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
listReceivedGrants_maxResults :: Lens.Lens' ListReceivedGrants (Prelude.Maybe Prelude.Natural)
listReceivedGrants_maxResults :: Lens' ListReceivedGrants (Maybe Natural)
listReceivedGrants_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReceivedGrants' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListReceivedGrants' :: ListReceivedGrants -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListReceivedGrants
s@ListReceivedGrants' {} Maybe Natural
a -> ListReceivedGrants
s {$sel:maxResults:ListReceivedGrants' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListReceivedGrants)
listReceivedGrants_nextToken :: Lens.Lens' ListReceivedGrants (Prelude.Maybe Prelude.Text)
listReceivedGrants_nextToken :: Lens' ListReceivedGrants (Maybe Text)
listReceivedGrants_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReceivedGrants' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListReceivedGrants' :: ListReceivedGrants -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListReceivedGrants
s@ListReceivedGrants' {} Maybe Text
a -> ListReceivedGrants
s {$sel:nextToken:ListReceivedGrants' :: Maybe Text
nextToken = Maybe Text
a} :: ListReceivedGrants)
instance Core.AWSRequest ListReceivedGrants where
type
AWSResponse ListReceivedGrants =
ListReceivedGrantsResponse
request :: (Service -> Service)
-> ListReceivedGrants -> Request ListReceivedGrants
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListReceivedGrants
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListReceivedGrants)))
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 [Grant] -> Maybe Text -> Int -> ListReceivedGrantsResponse
ListReceivedGrantsResponse'
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
"Grants" 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 ListReceivedGrants where
hashWithSalt :: Int -> ListReceivedGrants -> Int
hashWithSalt Int
_salt ListReceivedGrants' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
grantArns :: Maybe [Text]
filters :: Maybe [Filter]
$sel:nextToken:ListReceivedGrants' :: ListReceivedGrants -> Maybe Text
$sel:maxResults:ListReceivedGrants' :: ListReceivedGrants -> Maybe Natural
$sel:grantArns:ListReceivedGrants' :: ListReceivedGrants -> Maybe [Text]
$sel:filters:ListReceivedGrants' :: ListReceivedGrants -> Maybe [Filter]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
grantArns
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 ListReceivedGrants where
rnf :: ListReceivedGrants -> ()
rnf ListReceivedGrants' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
grantArns :: Maybe [Text]
filters :: Maybe [Filter]
$sel:nextToken:ListReceivedGrants' :: ListReceivedGrants -> Maybe Text
$sel:maxResults:ListReceivedGrants' :: ListReceivedGrants -> Maybe Natural
$sel:grantArns:ListReceivedGrants' :: ListReceivedGrants -> Maybe [Text]
$sel:filters:ListReceivedGrants' :: ListReceivedGrants -> Maybe [Filter]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
grantArns
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 ListReceivedGrants where
toHeaders :: ListReceivedGrants -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSLicenseManager.ListReceivedGrants" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListReceivedGrants where
toJSON :: ListReceivedGrants -> Value
toJSON ListReceivedGrants' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
grantArns :: Maybe [Text]
filters :: Maybe [Filter]
$sel:nextToken:ListReceivedGrants' :: ListReceivedGrants -> Maybe Text
$sel:maxResults:ListReceivedGrants' :: ListReceivedGrants -> Maybe Natural
$sel:grantArns:ListReceivedGrants' :: ListReceivedGrants -> Maybe [Text]
$sel:filters:ListReceivedGrants' :: ListReceivedGrants -> Maybe [Filter]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
(Key
"GrantArns" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
grantArns,
(Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
]
)
instance Data.ToPath ListReceivedGrants where
toPath :: ListReceivedGrants -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListReceivedGrants where
toQuery :: ListReceivedGrants -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListReceivedGrantsResponse = ListReceivedGrantsResponse'
{
ListReceivedGrantsResponse -> Maybe [Grant]
grants :: Prelude.Maybe [Grant],
ListReceivedGrantsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListReceivedGrantsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListReceivedGrantsResponse -> ListReceivedGrantsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListReceivedGrantsResponse -> ListReceivedGrantsResponse -> Bool
$c/= :: ListReceivedGrantsResponse -> ListReceivedGrantsResponse -> Bool
== :: ListReceivedGrantsResponse -> ListReceivedGrantsResponse -> Bool
$c== :: ListReceivedGrantsResponse -> ListReceivedGrantsResponse -> Bool
Prelude.Eq, ReadPrec [ListReceivedGrantsResponse]
ReadPrec ListReceivedGrantsResponse
Int -> ReadS ListReceivedGrantsResponse
ReadS [ListReceivedGrantsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListReceivedGrantsResponse]
$creadListPrec :: ReadPrec [ListReceivedGrantsResponse]
readPrec :: ReadPrec ListReceivedGrantsResponse
$creadPrec :: ReadPrec ListReceivedGrantsResponse
readList :: ReadS [ListReceivedGrantsResponse]
$creadList :: ReadS [ListReceivedGrantsResponse]
readsPrec :: Int -> ReadS ListReceivedGrantsResponse
$creadsPrec :: Int -> ReadS ListReceivedGrantsResponse
Prelude.Read, Int -> ListReceivedGrantsResponse -> ShowS
[ListReceivedGrantsResponse] -> ShowS
ListReceivedGrantsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListReceivedGrantsResponse] -> ShowS
$cshowList :: [ListReceivedGrantsResponse] -> ShowS
show :: ListReceivedGrantsResponse -> String
$cshow :: ListReceivedGrantsResponse -> String
showsPrec :: Int -> ListReceivedGrantsResponse -> ShowS
$cshowsPrec :: Int -> ListReceivedGrantsResponse -> ShowS
Prelude.Show, forall x.
Rep ListReceivedGrantsResponse x -> ListReceivedGrantsResponse
forall x.
ListReceivedGrantsResponse -> Rep ListReceivedGrantsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListReceivedGrantsResponse x -> ListReceivedGrantsResponse
$cfrom :: forall x.
ListReceivedGrantsResponse -> Rep ListReceivedGrantsResponse x
Prelude.Generic)
newListReceivedGrantsResponse ::
Prelude.Int ->
ListReceivedGrantsResponse
newListReceivedGrantsResponse :: Int -> ListReceivedGrantsResponse
newListReceivedGrantsResponse Int
pHttpStatus_ =
ListReceivedGrantsResponse'
{ $sel:grants:ListReceivedGrantsResponse' :: Maybe [Grant]
grants =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListReceivedGrantsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListReceivedGrantsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listReceivedGrantsResponse_grants :: Lens.Lens' ListReceivedGrantsResponse (Prelude.Maybe [Grant])
listReceivedGrantsResponse_grants :: Lens' ListReceivedGrantsResponse (Maybe [Grant])
listReceivedGrantsResponse_grants = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReceivedGrantsResponse' {Maybe [Grant]
grants :: Maybe [Grant]
$sel:grants:ListReceivedGrantsResponse' :: ListReceivedGrantsResponse -> Maybe [Grant]
grants} -> Maybe [Grant]
grants) (\s :: ListReceivedGrantsResponse
s@ListReceivedGrantsResponse' {} Maybe [Grant]
a -> ListReceivedGrantsResponse
s {$sel:grants:ListReceivedGrantsResponse' :: Maybe [Grant]
grants = Maybe [Grant]
a} :: ListReceivedGrantsResponse) 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
listReceivedGrantsResponse_nextToken :: Lens.Lens' ListReceivedGrantsResponse (Prelude.Maybe Prelude.Text)
listReceivedGrantsResponse_nextToken :: Lens' ListReceivedGrantsResponse (Maybe Text)
listReceivedGrantsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReceivedGrantsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListReceivedGrantsResponse' :: ListReceivedGrantsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListReceivedGrantsResponse
s@ListReceivedGrantsResponse' {} Maybe Text
a -> ListReceivedGrantsResponse
s {$sel:nextToken:ListReceivedGrantsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListReceivedGrantsResponse)
listReceivedGrantsResponse_httpStatus :: Lens.Lens' ListReceivedGrantsResponse Prelude.Int
listReceivedGrantsResponse_httpStatus :: Lens' ListReceivedGrantsResponse Int
listReceivedGrantsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReceivedGrantsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListReceivedGrantsResponse' :: ListReceivedGrantsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListReceivedGrantsResponse
s@ListReceivedGrantsResponse' {} Int
a -> ListReceivedGrantsResponse
s {$sel:httpStatus:ListReceivedGrantsResponse' :: Int
httpStatus = Int
a} :: ListReceivedGrantsResponse)
instance Prelude.NFData ListReceivedGrantsResponse where
rnf :: ListReceivedGrantsResponse -> ()
rnf ListReceivedGrantsResponse' {Int
Maybe [Grant]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
grants :: Maybe [Grant]
$sel:httpStatus:ListReceivedGrantsResponse' :: ListReceivedGrantsResponse -> Int
$sel:nextToken:ListReceivedGrantsResponse' :: ListReceivedGrantsResponse -> Maybe Text
$sel:grants:ListReceivedGrantsResponse' :: ListReceivedGrantsResponse -> Maybe [Grant]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Grant]
grants
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