{-# 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.LicenseManager.ListDistributedGrants
-- 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)
--
-- Lists the grants distributed for the specified license.
module Amazonka.LicenseManager.ListDistributedGrants
  ( -- * Creating a Request
    ListDistributedGrants (..),
    newListDistributedGrants,

    -- * Request Lenses
    listDistributedGrants_filters,
    listDistributedGrants_nextToken,
    listDistributedGrants_grantArns,
    listDistributedGrants_maxResults,

    -- * Destructuring the Response
    ListDistributedGrantsResponse (..),
    newListDistributedGrantsResponse,

    -- * Response Lenses
    listDistributedGrantsResponse_grants,
    listDistributedGrantsResponse_nextToken,
    listDistributedGrantsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LicenseManager.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListDistributedGrants' smart constructor.
data ListDistributedGrants = ListDistributedGrants'
  { -- | Filters to scope the results. The following filters are supported:
    --
    -- -   @LicenseArn@
    --
    -- -   @GrantStatus@
    --
    -- -   @GranteePrincipalARN@
    --
    -- -   @ProductSKU@
    --
    -- -   @LicenseIssuerName@
    ListDistributedGrants -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | Token for the next set of results.
    ListDistributedGrants -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Amazon Resource Names (ARNs) of the grants.
    ListDistributedGrants -> Maybe [Text]
grantArns :: Prelude.Maybe [Prelude.Text],
    -- | Maximum number of results to return in a single call.
    ListDistributedGrants -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListDistributedGrants -> ListDistributedGrants -> Bool
(ListDistributedGrants -> ListDistributedGrants -> Bool)
-> (ListDistributedGrants -> ListDistributedGrants -> Bool)
-> Eq ListDistributedGrants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDistributedGrants -> ListDistributedGrants -> Bool
$c/= :: ListDistributedGrants -> ListDistributedGrants -> Bool
== :: ListDistributedGrants -> ListDistributedGrants -> Bool
$c== :: ListDistributedGrants -> ListDistributedGrants -> Bool
Prelude.Eq, ReadPrec [ListDistributedGrants]
ReadPrec ListDistributedGrants
Int -> ReadS ListDistributedGrants
ReadS [ListDistributedGrants]
(Int -> ReadS ListDistributedGrants)
-> ReadS [ListDistributedGrants]
-> ReadPrec ListDistributedGrants
-> ReadPrec [ListDistributedGrants]
-> Read ListDistributedGrants
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDistributedGrants]
$creadListPrec :: ReadPrec [ListDistributedGrants]
readPrec :: ReadPrec ListDistributedGrants
$creadPrec :: ReadPrec ListDistributedGrants
readList :: ReadS [ListDistributedGrants]
$creadList :: ReadS [ListDistributedGrants]
readsPrec :: Int -> ReadS ListDistributedGrants
$creadsPrec :: Int -> ReadS ListDistributedGrants
Prelude.Read, Int -> ListDistributedGrants -> ShowS
[ListDistributedGrants] -> ShowS
ListDistributedGrants -> String
(Int -> ListDistributedGrants -> ShowS)
-> (ListDistributedGrants -> String)
-> ([ListDistributedGrants] -> ShowS)
-> Show ListDistributedGrants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDistributedGrants] -> ShowS
$cshowList :: [ListDistributedGrants] -> ShowS
show :: ListDistributedGrants -> String
$cshow :: ListDistributedGrants -> String
showsPrec :: Int -> ListDistributedGrants -> ShowS
$cshowsPrec :: Int -> ListDistributedGrants -> ShowS
Prelude.Show, (forall x. ListDistributedGrants -> Rep ListDistributedGrants x)
-> (forall x. Rep ListDistributedGrants x -> ListDistributedGrants)
-> Generic ListDistributedGrants
forall x. Rep ListDistributedGrants x -> ListDistributedGrants
forall x. ListDistributedGrants -> Rep ListDistributedGrants x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDistributedGrants x -> ListDistributedGrants
$cfrom :: forall x. ListDistributedGrants -> Rep ListDistributedGrants x
Prelude.Generic)

-- |
-- Create a value of 'ListDistributedGrants' 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:
--
-- 'filters', 'listDistributedGrants_filters' - Filters to scope the results. The following filters are supported:
--
-- -   @LicenseArn@
--
-- -   @GrantStatus@
--
-- -   @GranteePrincipalARN@
--
-- -   @ProductSKU@
--
-- -   @LicenseIssuerName@
--
-- 'nextToken', 'listDistributedGrants_nextToken' - Token for the next set of results.
--
-- 'grantArns', 'listDistributedGrants_grantArns' - Amazon Resource Names (ARNs) of the grants.
--
-- 'maxResults', 'listDistributedGrants_maxResults' - Maximum number of results to return in a single call.
newListDistributedGrants ::
  ListDistributedGrants
newListDistributedGrants :: ListDistributedGrants
newListDistributedGrants =
  ListDistributedGrants' :: Maybe [Filter]
-> Maybe Text
-> Maybe [Text]
-> Maybe Natural
-> ListDistributedGrants
ListDistributedGrants'
    { $sel:filters:ListDistributedGrants' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDistributedGrants' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:grantArns:ListDistributedGrants' :: Maybe [Text]
grantArns = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDistributedGrants' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Filters to scope the results. The following filters are supported:
--
-- -   @LicenseArn@
--
-- -   @GrantStatus@
--
-- -   @GranteePrincipalARN@
--
-- -   @ProductSKU@
--
-- -   @LicenseIssuerName@
listDistributedGrants_filters :: Lens.Lens' ListDistributedGrants (Prelude.Maybe [Filter])
listDistributedGrants_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> ListDistributedGrants -> f ListDistributedGrants
listDistributedGrants_filters = (ListDistributedGrants -> Maybe [Filter])
-> (ListDistributedGrants
    -> Maybe [Filter] -> ListDistributedGrants)
-> Lens
     ListDistributedGrants
     ListDistributedGrants
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributedGrants' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ListDistributedGrants' :: ListDistributedGrants -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ListDistributedGrants
s@ListDistributedGrants' {} Maybe [Filter]
a -> ListDistributedGrants
s {$sel:filters:ListDistributedGrants' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ListDistributedGrants) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> ListDistributedGrants -> f ListDistributedGrants)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> ListDistributedGrants
-> f ListDistributedGrants
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Token for the next set of results.
listDistributedGrants_nextToken :: Lens.Lens' ListDistributedGrants (Prelude.Maybe Prelude.Text)
listDistributedGrants_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDistributedGrants -> f ListDistributedGrants
listDistributedGrants_nextToken = (ListDistributedGrants -> Maybe Text)
-> (ListDistributedGrants -> Maybe Text -> ListDistributedGrants)
-> Lens
     ListDistributedGrants
     ListDistributedGrants
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributedGrants' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDistributedGrants' :: ListDistributedGrants -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDistributedGrants
s@ListDistributedGrants' {} Maybe Text
a -> ListDistributedGrants
s {$sel:nextToken:ListDistributedGrants' :: Maybe Text
nextToken = Maybe Text
a} :: ListDistributedGrants)

-- | Amazon Resource Names (ARNs) of the grants.
listDistributedGrants_grantArns :: Lens.Lens' ListDistributedGrants (Prelude.Maybe [Prelude.Text])
listDistributedGrants_grantArns :: (Maybe [Text] -> f (Maybe [Text]))
-> ListDistributedGrants -> f ListDistributedGrants
listDistributedGrants_grantArns = (ListDistributedGrants -> Maybe [Text])
-> (ListDistributedGrants -> Maybe [Text] -> ListDistributedGrants)
-> Lens
     ListDistributedGrants
     ListDistributedGrants
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributedGrants' {Maybe [Text]
grantArns :: Maybe [Text]
$sel:grantArns:ListDistributedGrants' :: ListDistributedGrants -> Maybe [Text]
grantArns} -> Maybe [Text]
grantArns) (\s :: ListDistributedGrants
s@ListDistributedGrants' {} Maybe [Text]
a -> ListDistributedGrants
s {$sel:grantArns:ListDistributedGrants' :: Maybe [Text]
grantArns = Maybe [Text]
a} :: ListDistributedGrants) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListDistributedGrants -> f ListDistributedGrants)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListDistributedGrants
-> f ListDistributedGrants
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

-- | Maximum number of results to return in a single call.
listDistributedGrants_maxResults :: Lens.Lens' ListDistributedGrants (Prelude.Maybe Prelude.Natural)
listDistributedGrants_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDistributedGrants -> f ListDistributedGrants
listDistributedGrants_maxResults = (ListDistributedGrants -> Maybe Natural)
-> (ListDistributedGrants
    -> Maybe Natural -> ListDistributedGrants)
-> Lens
     ListDistributedGrants
     ListDistributedGrants
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributedGrants' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDistributedGrants' :: ListDistributedGrants -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDistributedGrants
s@ListDistributedGrants' {} Maybe Natural
a -> ListDistributedGrants
s {$sel:maxResults:ListDistributedGrants' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDistributedGrants)

instance Core.AWSRequest ListDistributedGrants where
  type
    AWSResponse ListDistributedGrants =
      ListDistributedGrantsResponse
  request :: ListDistributedGrants -> Request ListDistributedGrants
request = Service -> ListDistributedGrants -> Request ListDistributedGrants
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListDistributedGrants
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDistributedGrants)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListDistributedGrants))
-> Logger
-> Service
-> Proxy ListDistributedGrants
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDistributedGrants)))
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 [Grant] -> Maybe Text -> Int -> ListDistributedGrantsResponse
ListDistributedGrantsResponse'
            (Maybe [Grant]
 -> Maybe Text -> Int -> ListDistributedGrantsResponse)
-> Either String (Maybe [Grant])
-> Either
     String (Maybe Text -> Int -> ListDistributedGrantsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Grant]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Grants" Either String (Maybe (Maybe [Grant]))
-> Maybe [Grant] -> Either String (Maybe [Grant])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Grant]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListDistributedGrantsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListDistributedGrantsResponse)
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 -> ListDistributedGrantsResponse)
-> Either String Int -> Either String ListDistributedGrantsResponse
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 ListDistributedGrants

instance Prelude.NFData ListDistributedGrants

instance Core.ToHeaders ListDistributedGrants where
  toHeaders :: ListDistributedGrants -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDistributedGrants -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSLicenseManager.ListDistributedGrants" ::
                          Prelude.ByteString
                      ),
            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.ToJSON ListDistributedGrants where
  toJSON :: ListDistributedGrants -> Value
toJSON ListDistributedGrants' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
maxResults :: Maybe Natural
grantArns :: Maybe [Text]
nextToken :: Maybe Text
filters :: Maybe [Filter]
$sel:maxResults:ListDistributedGrants' :: ListDistributedGrants -> Maybe Natural
$sel:grantArns:ListDistributedGrants' :: ListDistributedGrants -> Maybe [Text]
$sel:nextToken:ListDistributedGrants' :: ListDistributedGrants -> Maybe Text
$sel:filters:ListDistributedGrants' :: ListDistributedGrants -> Maybe [Filter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Filters" Text -> [Filter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Filter] -> Pair) -> Maybe [Filter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"GrantArns" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
grantArns,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

instance Core.ToPath ListDistributedGrants where
  toPath :: ListDistributedGrants -> ByteString
toPath = ByteString -> ListDistributedGrants -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListDistributedGrants where
  toQuery :: ListDistributedGrants -> QueryString
toQuery = QueryString -> ListDistributedGrants -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListDistributedGrantsResponse' smart constructor.
data ListDistributedGrantsResponse = ListDistributedGrantsResponse'
  { -- | Distributed grant details.
    ListDistributedGrantsResponse -> Maybe [Grant]
grants :: Prelude.Maybe [Grant],
    -- | Token for the next set of results.
    ListDistributedGrantsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDistributedGrantsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDistributedGrantsResponse
-> ListDistributedGrantsResponse -> Bool
(ListDistributedGrantsResponse
 -> ListDistributedGrantsResponse -> Bool)
-> (ListDistributedGrantsResponse
    -> ListDistributedGrantsResponse -> Bool)
-> Eq ListDistributedGrantsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDistributedGrantsResponse
-> ListDistributedGrantsResponse -> Bool
$c/= :: ListDistributedGrantsResponse
-> ListDistributedGrantsResponse -> Bool
== :: ListDistributedGrantsResponse
-> ListDistributedGrantsResponse -> Bool
$c== :: ListDistributedGrantsResponse
-> ListDistributedGrantsResponse -> Bool
Prelude.Eq, ReadPrec [ListDistributedGrantsResponse]
ReadPrec ListDistributedGrantsResponse
Int -> ReadS ListDistributedGrantsResponse
ReadS [ListDistributedGrantsResponse]
(Int -> ReadS ListDistributedGrantsResponse)
-> ReadS [ListDistributedGrantsResponse]
-> ReadPrec ListDistributedGrantsResponse
-> ReadPrec [ListDistributedGrantsResponse]
-> Read ListDistributedGrantsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDistributedGrantsResponse]
$creadListPrec :: ReadPrec [ListDistributedGrantsResponse]
readPrec :: ReadPrec ListDistributedGrantsResponse
$creadPrec :: ReadPrec ListDistributedGrantsResponse
readList :: ReadS [ListDistributedGrantsResponse]
$creadList :: ReadS [ListDistributedGrantsResponse]
readsPrec :: Int -> ReadS ListDistributedGrantsResponse
$creadsPrec :: Int -> ReadS ListDistributedGrantsResponse
Prelude.Read, Int -> ListDistributedGrantsResponse -> ShowS
[ListDistributedGrantsResponse] -> ShowS
ListDistributedGrantsResponse -> String
(Int -> ListDistributedGrantsResponse -> ShowS)
-> (ListDistributedGrantsResponse -> String)
-> ([ListDistributedGrantsResponse] -> ShowS)
-> Show ListDistributedGrantsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDistributedGrantsResponse] -> ShowS
$cshowList :: [ListDistributedGrantsResponse] -> ShowS
show :: ListDistributedGrantsResponse -> String
$cshow :: ListDistributedGrantsResponse -> String
showsPrec :: Int -> ListDistributedGrantsResponse -> ShowS
$cshowsPrec :: Int -> ListDistributedGrantsResponse -> ShowS
Prelude.Show, (forall x.
 ListDistributedGrantsResponse
 -> Rep ListDistributedGrantsResponse x)
-> (forall x.
    Rep ListDistributedGrantsResponse x
    -> ListDistributedGrantsResponse)
-> Generic ListDistributedGrantsResponse
forall x.
Rep ListDistributedGrantsResponse x
-> ListDistributedGrantsResponse
forall x.
ListDistributedGrantsResponse
-> Rep ListDistributedGrantsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDistributedGrantsResponse x
-> ListDistributedGrantsResponse
$cfrom :: forall x.
ListDistributedGrantsResponse
-> Rep ListDistributedGrantsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDistributedGrantsResponse' 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:
--
-- 'grants', 'listDistributedGrantsResponse_grants' - Distributed grant details.
--
-- 'nextToken', 'listDistributedGrantsResponse_nextToken' - Token for the next set of results.
--
-- 'httpStatus', 'listDistributedGrantsResponse_httpStatus' - The response's http status code.
newListDistributedGrantsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDistributedGrantsResponse
newListDistributedGrantsResponse :: Int -> ListDistributedGrantsResponse
newListDistributedGrantsResponse Int
pHttpStatus_ =
  ListDistributedGrantsResponse' :: Maybe [Grant] -> Maybe Text -> Int -> ListDistributedGrantsResponse
ListDistributedGrantsResponse'
    { $sel:grants:ListDistributedGrantsResponse' :: Maybe [Grant]
grants =
        Maybe [Grant]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDistributedGrantsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDistributedGrantsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Distributed grant details.
listDistributedGrantsResponse_grants :: Lens.Lens' ListDistributedGrantsResponse (Prelude.Maybe [Grant])
listDistributedGrantsResponse_grants :: (Maybe [Grant] -> f (Maybe [Grant]))
-> ListDistributedGrantsResponse -> f ListDistributedGrantsResponse
listDistributedGrantsResponse_grants = (ListDistributedGrantsResponse -> Maybe [Grant])
-> (ListDistributedGrantsResponse
    -> Maybe [Grant] -> ListDistributedGrantsResponse)
-> Lens
     ListDistributedGrantsResponse
     ListDistributedGrantsResponse
     (Maybe [Grant])
     (Maybe [Grant])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributedGrantsResponse' {Maybe [Grant]
grants :: Maybe [Grant]
$sel:grants:ListDistributedGrantsResponse' :: ListDistributedGrantsResponse -> Maybe [Grant]
grants} -> Maybe [Grant]
grants) (\s :: ListDistributedGrantsResponse
s@ListDistributedGrantsResponse' {} Maybe [Grant]
a -> ListDistributedGrantsResponse
s {$sel:grants:ListDistributedGrantsResponse' :: Maybe [Grant]
grants = Maybe [Grant]
a} :: ListDistributedGrantsResponse) ((Maybe [Grant] -> f (Maybe [Grant]))
 -> ListDistributedGrantsResponse
 -> f ListDistributedGrantsResponse)
-> ((Maybe [Grant] -> f (Maybe [Grant]))
    -> Maybe [Grant] -> f (Maybe [Grant]))
-> (Maybe [Grant] -> f (Maybe [Grant]))
-> ListDistributedGrantsResponse
-> f ListDistributedGrantsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Grant] [Grant] [Grant] [Grant]
-> Iso
     (Maybe [Grant]) (Maybe [Grant]) (Maybe [Grant]) (Maybe [Grant])
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 [Grant] [Grant] [Grant] [Grant]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Token for the next set of results.
listDistributedGrantsResponse_nextToken :: Lens.Lens' ListDistributedGrantsResponse (Prelude.Maybe Prelude.Text)
listDistributedGrantsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDistributedGrantsResponse -> f ListDistributedGrantsResponse
listDistributedGrantsResponse_nextToken = (ListDistributedGrantsResponse -> Maybe Text)
-> (ListDistributedGrantsResponse
    -> Maybe Text -> ListDistributedGrantsResponse)
-> Lens
     ListDistributedGrantsResponse
     ListDistributedGrantsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributedGrantsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDistributedGrantsResponse' :: ListDistributedGrantsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDistributedGrantsResponse
s@ListDistributedGrantsResponse' {} Maybe Text
a -> ListDistributedGrantsResponse
s {$sel:nextToken:ListDistributedGrantsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDistributedGrantsResponse)

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

instance Prelude.NFData ListDistributedGrantsResponse