{-# 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.ListReceivedGrantsForOrganization
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the grants received for all accounts in the organization.
module Amazonka.LicenseManager.ListReceivedGrantsForOrganization
  ( -- * Creating a Request
    ListReceivedGrantsForOrganization (..),
    newListReceivedGrantsForOrganization,

    -- * Request Lenses
    listReceivedGrantsForOrganization_filters,
    listReceivedGrantsForOrganization_maxResults,
    listReceivedGrantsForOrganization_nextToken,
    listReceivedGrantsForOrganization_licenseArn,

    -- * Destructuring the Response
    ListReceivedGrantsForOrganizationResponse (..),
    newListReceivedGrantsForOrganizationResponse,

    -- * Response Lenses
    listReceivedGrantsForOrganizationResponse_grants,
    listReceivedGrantsForOrganizationResponse_nextToken,
    listReceivedGrantsForOrganizationResponse_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

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

-- |
-- Create a value of 'ListReceivedGrantsForOrganization' 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', 'listReceivedGrantsForOrganization_filters' - Filters to scope the results. The following filters are supported:
--
-- -   @ParentArn@
--
-- -   @GranteePrincipalArn@
--
-- 'maxResults', 'listReceivedGrantsForOrganization_maxResults' - Maximum number of results to return in a single call.
--
-- 'nextToken', 'listReceivedGrantsForOrganization_nextToken' - Token for the next set of results.
--
-- 'licenseArn', 'listReceivedGrantsForOrganization_licenseArn' - The Amazon Resource Name (ARN) of the received license.
newListReceivedGrantsForOrganization ::
  -- | 'licenseArn'
  Prelude.Text ->
  ListReceivedGrantsForOrganization
newListReceivedGrantsForOrganization :: Text -> ListReceivedGrantsForOrganization
newListReceivedGrantsForOrganization Text
pLicenseArn_ =
  ListReceivedGrantsForOrganization'
    { $sel:filters:ListReceivedGrantsForOrganization' :: Maybe [Filter]
filters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListReceivedGrantsForOrganization' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListReceivedGrantsForOrganization' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:licenseArn:ListReceivedGrantsForOrganization' :: Text
licenseArn = Text
pLicenseArn_
    }

-- | Filters to scope the results. The following filters are supported:
--
-- -   @ParentArn@
--
-- -   @GranteePrincipalArn@
listReceivedGrantsForOrganization_filters :: Lens.Lens' ListReceivedGrantsForOrganization (Prelude.Maybe [Filter])
listReceivedGrantsForOrganization_filters :: Lens' ListReceivedGrantsForOrganization (Maybe [Filter])
listReceivedGrantsForOrganization_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReceivedGrantsForOrganization' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ListReceivedGrantsForOrganization
s@ListReceivedGrantsForOrganization' {} Maybe [Filter]
a -> ListReceivedGrantsForOrganization
s {$sel:filters:ListReceivedGrantsForOrganization' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ListReceivedGrantsForOrganization) 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

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

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

-- | The Amazon Resource Name (ARN) of the received license.
listReceivedGrantsForOrganization_licenseArn :: Lens.Lens' ListReceivedGrantsForOrganization Prelude.Text
listReceivedGrantsForOrganization_licenseArn :: Lens' ListReceivedGrantsForOrganization Text
listReceivedGrantsForOrganization_licenseArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReceivedGrantsForOrganization' {Text
licenseArn :: Text
$sel:licenseArn:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> Text
licenseArn} -> Text
licenseArn) (\s :: ListReceivedGrantsForOrganization
s@ListReceivedGrantsForOrganization' {} Text
a -> ListReceivedGrantsForOrganization
s {$sel:licenseArn:ListReceivedGrantsForOrganization' :: Text
licenseArn = Text
a} :: ListReceivedGrantsForOrganization)

instance
  Core.AWSRequest
    ListReceivedGrantsForOrganization
  where
  type
    AWSResponse ListReceivedGrantsForOrganization =
      ListReceivedGrantsForOrganizationResponse
  request :: (Service -> Service)
-> ListReceivedGrantsForOrganization
-> Request ListReceivedGrantsForOrganization
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 ListReceivedGrantsForOrganization
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListReceivedGrantsForOrganization)))
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 -> ListReceivedGrantsForOrganizationResponse
ListReceivedGrantsForOrganizationResponse'
            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
    ListReceivedGrantsForOrganization
  where
  hashWithSalt :: Int -> ListReceivedGrantsForOrganization -> Int
hashWithSalt
    Int
_salt
    ListReceivedGrantsForOrganization' {Maybe Natural
Maybe [Filter]
Maybe Text
Text
licenseArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:licenseArn:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> Text
$sel:nextToken:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> Maybe Text
$sel:maxResults:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> Maybe Natural
$sel:filters:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> 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 Natural
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
licenseArn

instance
  Prelude.NFData
    ListReceivedGrantsForOrganization
  where
  rnf :: ListReceivedGrantsForOrganization -> ()
rnf ListReceivedGrantsForOrganization' {Maybe Natural
Maybe [Filter]
Maybe Text
Text
licenseArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:licenseArn:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> Text
$sel:nextToken:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> Maybe Text
$sel:maxResults:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> Maybe Natural
$sel:filters:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> 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 Natural
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 Text
licenseArn

instance
  Data.ToHeaders
    ListReceivedGrantsForOrganization
  where
  toHeaders :: ListReceivedGrantsForOrganization -> 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.ListReceivedGrantsForOrganization" ::
                          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
    ListReceivedGrantsForOrganization
  where
  toJSON :: ListReceivedGrantsForOrganization -> Value
toJSON ListReceivedGrantsForOrganization' {Maybe Natural
Maybe [Filter]
Maybe Text
Text
licenseArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:licenseArn:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> Text
$sel:nextToken:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> Maybe Text
$sel:maxResults:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> Maybe Natural
$sel:filters:ListReceivedGrantsForOrganization' :: ListReceivedGrantsForOrganization -> 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
"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,
            forall a. a -> Maybe a
Prelude.Just (Key
"LicenseArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
licenseArn)
          ]
      )

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

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

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

-- |
-- Create a value of 'ListReceivedGrantsForOrganizationResponse' 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', 'listReceivedGrantsForOrganizationResponse_grants' - Lists the grants the organization has received.
--
-- 'nextToken', 'listReceivedGrantsForOrganizationResponse_nextToken' - Token for the next set of results.
--
-- 'httpStatus', 'listReceivedGrantsForOrganizationResponse_httpStatus' - The response's http status code.
newListReceivedGrantsForOrganizationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListReceivedGrantsForOrganizationResponse
newListReceivedGrantsForOrganizationResponse :: Int -> ListReceivedGrantsForOrganizationResponse
newListReceivedGrantsForOrganizationResponse
  Int
pHttpStatus_ =
    ListReceivedGrantsForOrganizationResponse'
      { $sel:grants:ListReceivedGrantsForOrganizationResponse' :: Maybe [Grant]
grants =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListReceivedGrantsForOrganizationResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListReceivedGrantsForOrganizationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Lists the grants the organization has received.
listReceivedGrantsForOrganizationResponse_grants :: Lens.Lens' ListReceivedGrantsForOrganizationResponse (Prelude.Maybe [Grant])
listReceivedGrantsForOrganizationResponse_grants :: Lens' ListReceivedGrantsForOrganizationResponse (Maybe [Grant])
listReceivedGrantsForOrganizationResponse_grants = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReceivedGrantsForOrganizationResponse' {Maybe [Grant]
grants :: Maybe [Grant]
$sel:grants:ListReceivedGrantsForOrganizationResponse' :: ListReceivedGrantsForOrganizationResponse -> Maybe [Grant]
grants} -> Maybe [Grant]
grants) (\s :: ListReceivedGrantsForOrganizationResponse
s@ListReceivedGrantsForOrganizationResponse' {} Maybe [Grant]
a -> ListReceivedGrantsForOrganizationResponse
s {$sel:grants:ListReceivedGrantsForOrganizationResponse' :: Maybe [Grant]
grants = Maybe [Grant]
a} :: ListReceivedGrantsForOrganizationResponse) 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

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

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

instance
  Prelude.NFData
    ListReceivedGrantsForOrganizationResponse
  where
  rnf :: ListReceivedGrantsForOrganizationResponse -> ()
rnf ListReceivedGrantsForOrganizationResponse' {Int
Maybe [Grant]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
grants :: Maybe [Grant]
$sel:httpStatus:ListReceivedGrantsForOrganizationResponse' :: ListReceivedGrantsForOrganizationResponse -> Int
$sel:nextToken:ListReceivedGrantsForOrganizationResponse' :: ListReceivedGrantsForOrganizationResponse -> Maybe Text
$sel:grants:ListReceivedGrantsForOrganizationResponse' :: ListReceivedGrantsForOrganizationResponse -> 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