{-# 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.KMS.ListGrants
-- 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)
--
-- Gets a list of all grants for the specified KMS key.
--
-- You must specify the KMS key in all requests. You can filter the grant
-- list by grant ID or grantee principal.
--
-- For detailed information about grants, including grant terminology, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/grants.html Using grants>
-- in the //Key Management Service Developer Guide// . For examples of
-- working with grants in several programming languages, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html Programming grants>.
--
-- The @GranteePrincipal@ field in the @ListGrants@ response usually
-- contains the user or role designated as the grantee principal in the
-- grant. However, when the grantee principal in the grant is an Amazon Web
-- Services service, the @GranteePrincipal@ field contains the
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services service principal>,
-- which might represent several different grantee principals.
--
-- __Cross-account use__: Yes. To perform this operation on a KMS key in a
-- different Amazon Web Services account, specify the key ARN in the value
-- of the @KeyId@ parameter.
--
-- __Required permissions__:
-- <https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html kms:ListGrants>
-- (key policy)
--
-- __Related operations:__
--
-- -   CreateGrant
--
-- -   ListRetirableGrants
--
-- -   RetireGrant
--
-- -   RevokeGrant
--
-- This operation returns paginated results.
module Amazonka.KMS.ListGrants
  ( -- * Creating a Request
    ListGrants (..),
    newListGrants,

    -- * Request Lenses
    listGrants_grantId,
    listGrants_granteePrincipal,
    listGrants_marker,
    listGrants_limit,
    listGrants_keyId,

    -- * Destructuring the Response
    ListGrantsResponse (..),
    newListGrantsResponse,

    -- * Response Lenses
    listGrantsResponse_truncated,
    listGrantsResponse_grants,
    listGrantsResponse_nextMarker,
  )
where

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

-- | /See:/ 'newListGrants' smart constructor.
data ListGrants = ListGrants'
  { -- | Returns only the grant with the specified grant ID. The grant ID
    -- uniquely identifies the grant.
    ListGrants -> Maybe Text
grantId :: Prelude.Maybe Prelude.Text,
    -- | Returns only grants where the specified principal is the grantee
    -- principal for the grant.
    ListGrants -> Maybe Text
granteePrincipal :: Prelude.Maybe Prelude.Text,
    -- | Use this parameter in a subsequent request after you receive a response
    -- with truncated results. Set it to the value of @NextMarker@ from the
    -- truncated response you just received.
    ListGrants -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Use this parameter to specify the maximum number of items to return.
    -- When this value is present, KMS does not return more than the specified
    -- number of items, but it might return fewer.
    --
    -- This value is optional. If you include a value, it must be between 1 and
    -- 100, inclusive. If you do not include a value, it defaults to 50.
    ListGrants -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | Returns only grants for the specified KMS key. This parameter is
    -- required.
    --
    -- Specify the key ID or key ARN of the KMS key. To specify a KMS key in a
    -- different Amazon Web Services account, you must use the key ARN.
    --
    -- For example:
    --
    -- -   Key ID: @1234abcd-12ab-34cd-56ef-1234567890ab@
    --
    -- -   Key ARN:
    --     @arn:aws:kms:us-east-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@
    --
    -- To get the key ID and key ARN for a KMS key, use ListKeys or
    -- DescribeKey.
    ListGrants -> Text
keyId :: Prelude.Text
  }
  deriving (ListGrants -> ListGrants -> Bool
(ListGrants -> ListGrants -> Bool)
-> (ListGrants -> ListGrants -> Bool) -> Eq ListGrants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGrants -> ListGrants -> Bool
$c/= :: ListGrants -> ListGrants -> Bool
== :: ListGrants -> ListGrants -> Bool
$c== :: ListGrants -> ListGrants -> Bool
Prelude.Eq, ReadPrec [ListGrants]
ReadPrec ListGrants
Int -> ReadS ListGrants
ReadS [ListGrants]
(Int -> ReadS ListGrants)
-> ReadS [ListGrants]
-> ReadPrec ListGrants
-> ReadPrec [ListGrants]
-> Read ListGrants
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGrants]
$creadListPrec :: ReadPrec [ListGrants]
readPrec :: ReadPrec ListGrants
$creadPrec :: ReadPrec ListGrants
readList :: ReadS [ListGrants]
$creadList :: ReadS [ListGrants]
readsPrec :: Int -> ReadS ListGrants
$creadsPrec :: Int -> ReadS ListGrants
Prelude.Read, Int -> ListGrants -> ShowS
[ListGrants] -> ShowS
ListGrants -> String
(Int -> ListGrants -> ShowS)
-> (ListGrants -> String)
-> ([ListGrants] -> ShowS)
-> Show ListGrants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGrants] -> ShowS
$cshowList :: [ListGrants] -> ShowS
show :: ListGrants -> String
$cshow :: ListGrants -> String
showsPrec :: Int -> ListGrants -> ShowS
$cshowsPrec :: Int -> ListGrants -> ShowS
Prelude.Show, (forall x. ListGrants -> Rep ListGrants x)
-> (forall x. Rep ListGrants x -> ListGrants) -> Generic ListGrants
forall x. Rep ListGrants x -> ListGrants
forall x. ListGrants -> Rep ListGrants x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGrants x -> ListGrants
$cfrom :: forall x. ListGrants -> Rep ListGrants x
Prelude.Generic)

-- |
-- Create a value of 'ListGrants' 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:
--
-- 'grantId', 'listGrants_grantId' - Returns only the grant with the specified grant ID. The grant ID
-- uniquely identifies the grant.
--
-- 'granteePrincipal', 'listGrants_granteePrincipal' - Returns only grants where the specified principal is the grantee
-- principal for the grant.
--
-- 'marker', 'listGrants_marker' - Use this parameter in a subsequent request after you receive a response
-- with truncated results. Set it to the value of @NextMarker@ from the
-- truncated response you just received.
--
-- 'limit', 'listGrants_limit' - Use this parameter to specify the maximum number of items to return.
-- When this value is present, KMS does not return more than the specified
-- number of items, but it might return fewer.
--
-- This value is optional. If you include a value, it must be between 1 and
-- 100, inclusive. If you do not include a value, it defaults to 50.
--
-- 'keyId', 'listGrants_keyId' - Returns only grants for the specified KMS key. This parameter is
-- required.
--
-- Specify the key ID or key ARN of the KMS key. To specify a KMS key in a
-- different Amazon Web Services account, you must use the key ARN.
--
-- For example:
--
-- -   Key ID: @1234abcd-12ab-34cd-56ef-1234567890ab@
--
-- -   Key ARN:
--     @arn:aws:kms:us-east-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@
--
-- To get the key ID and key ARN for a KMS key, use ListKeys or
-- DescribeKey.
newListGrants ::
  -- | 'keyId'
  Prelude.Text ->
  ListGrants
newListGrants :: Text -> ListGrants
newListGrants Text
pKeyId_ =
  ListGrants' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Natural -> Text -> ListGrants
ListGrants'
    { $sel:grantId:ListGrants' :: Maybe Text
grantId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:granteePrincipal:ListGrants' :: Maybe Text
granteePrincipal = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListGrants' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListGrants' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:keyId:ListGrants' :: Text
keyId = Text
pKeyId_
    }

-- | Returns only the grant with the specified grant ID. The grant ID
-- uniquely identifies the grant.
listGrants_grantId :: Lens.Lens' ListGrants (Prelude.Maybe Prelude.Text)
listGrants_grantId :: (Maybe Text -> f (Maybe Text)) -> ListGrants -> f ListGrants
listGrants_grantId = (ListGrants -> Maybe Text)
-> (ListGrants -> Maybe Text -> ListGrants)
-> Lens ListGrants ListGrants (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGrants' {Maybe Text
grantId :: Maybe Text
$sel:grantId:ListGrants' :: ListGrants -> Maybe Text
grantId} -> Maybe Text
grantId) (\s :: ListGrants
s@ListGrants' {} Maybe Text
a -> ListGrants
s {$sel:grantId:ListGrants' :: Maybe Text
grantId = Maybe Text
a} :: ListGrants)

-- | Returns only grants where the specified principal is the grantee
-- principal for the grant.
listGrants_granteePrincipal :: Lens.Lens' ListGrants (Prelude.Maybe Prelude.Text)
listGrants_granteePrincipal :: (Maybe Text -> f (Maybe Text)) -> ListGrants -> f ListGrants
listGrants_granteePrincipal = (ListGrants -> Maybe Text)
-> (ListGrants -> Maybe Text -> ListGrants)
-> Lens ListGrants ListGrants (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGrants' {Maybe Text
granteePrincipal :: Maybe Text
$sel:granteePrincipal:ListGrants' :: ListGrants -> Maybe Text
granteePrincipal} -> Maybe Text
granteePrincipal) (\s :: ListGrants
s@ListGrants' {} Maybe Text
a -> ListGrants
s {$sel:granteePrincipal:ListGrants' :: Maybe Text
granteePrincipal = Maybe Text
a} :: ListGrants)

-- | Use this parameter in a subsequent request after you receive a response
-- with truncated results. Set it to the value of @NextMarker@ from the
-- truncated response you just received.
listGrants_marker :: Lens.Lens' ListGrants (Prelude.Maybe Prelude.Text)
listGrants_marker :: (Maybe Text -> f (Maybe Text)) -> ListGrants -> f ListGrants
listGrants_marker = (ListGrants -> Maybe Text)
-> (ListGrants -> Maybe Text -> ListGrants)
-> Lens ListGrants ListGrants (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGrants' {Maybe Text
marker :: Maybe Text
$sel:marker:ListGrants' :: ListGrants -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListGrants
s@ListGrants' {} Maybe Text
a -> ListGrants
s {$sel:marker:ListGrants' :: Maybe Text
marker = Maybe Text
a} :: ListGrants)

-- | Use this parameter to specify the maximum number of items to return.
-- When this value is present, KMS does not return more than the specified
-- number of items, but it might return fewer.
--
-- This value is optional. If you include a value, it must be between 1 and
-- 100, inclusive. If you do not include a value, it defaults to 50.
listGrants_limit :: Lens.Lens' ListGrants (Prelude.Maybe Prelude.Natural)
listGrants_limit :: (Maybe Natural -> f (Maybe Natural)) -> ListGrants -> f ListGrants
listGrants_limit = (ListGrants -> Maybe Natural)
-> (ListGrants -> Maybe Natural -> ListGrants)
-> Lens ListGrants ListGrants (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGrants' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListGrants' :: ListGrants -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListGrants
s@ListGrants' {} Maybe Natural
a -> ListGrants
s {$sel:limit:ListGrants' :: Maybe Natural
limit = Maybe Natural
a} :: ListGrants)

-- | Returns only grants for the specified KMS key. This parameter is
-- required.
--
-- Specify the key ID or key ARN of the KMS key. To specify a KMS key in a
-- different Amazon Web Services account, you must use the key ARN.
--
-- For example:
--
-- -   Key ID: @1234abcd-12ab-34cd-56ef-1234567890ab@
--
-- -   Key ARN:
--     @arn:aws:kms:us-east-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@
--
-- To get the key ID and key ARN for a KMS key, use ListKeys or
-- DescribeKey.
listGrants_keyId :: Lens.Lens' ListGrants Prelude.Text
listGrants_keyId :: (Text -> f Text) -> ListGrants -> f ListGrants
listGrants_keyId = (ListGrants -> Text)
-> (ListGrants -> Text -> ListGrants)
-> Lens ListGrants ListGrants Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGrants' {Text
keyId :: Text
$sel:keyId:ListGrants' :: ListGrants -> Text
keyId} -> Text
keyId) (\s :: ListGrants
s@ListGrants' {} Text
a -> ListGrants
s {$sel:keyId:ListGrants' :: Text
keyId = Text
a} :: ListGrants)

instance Core.AWSPager ListGrants where
  page :: ListGrants -> AWSResponse ListGrants -> Maybe ListGrants
page ListGrants
rq AWSResponse ListGrants
rs
    | Maybe Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListGrants
ListGrantsResponse
rs
            ListGrantsResponse
-> Getting (First Bool) ListGrantsResponse Bool -> Maybe Bool
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Bool -> Const (First Bool) (Maybe Bool))
-> ListGrantsResponse -> Const (First Bool) ListGrantsResponse
Lens' ListGrantsResponse (Maybe Bool)
listGrantsResponse_truncated ((Maybe Bool -> Const (First Bool) (Maybe Bool))
 -> ListGrantsResponse -> Const (First Bool) ListGrantsResponse)
-> ((Bool -> Const (First Bool) Bool)
    -> Maybe Bool -> Const (First Bool) (Maybe Bool))
-> Getting (First Bool) ListGrantsResponse Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Bool -> Const (First Bool) Bool)
-> Maybe Bool -> Const (First Bool) (Maybe Bool)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListGrants
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListGrants
ListGrantsResponse
rs
            ListGrantsResponse
-> Getting (First Text) ListGrantsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListGrantsResponse -> Const (First Text) ListGrantsResponse
Lens' ListGrantsResponse (Maybe Text)
listGrantsResponse_nextMarker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListGrantsResponse -> Const (First Text) ListGrantsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListGrantsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListGrants
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListGrants -> Maybe ListGrants
forall a. a -> Maybe a
Prelude.Just (ListGrants -> Maybe ListGrants) -> ListGrants -> Maybe ListGrants
forall a b. (a -> b) -> a -> b
Prelude.$
        ListGrants
rq
          ListGrants -> (ListGrants -> ListGrants) -> ListGrants
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListGrants -> Identity ListGrants
Lens ListGrants ListGrants (Maybe Text) (Maybe Text)
listGrants_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListGrants -> Identity ListGrants)
-> Maybe Text -> ListGrants -> ListGrants
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListGrants
ListGrantsResponse
rs
          ListGrantsResponse
-> Getting (First Text) ListGrantsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListGrantsResponse -> Const (First Text) ListGrantsResponse
Lens' ListGrantsResponse (Maybe Text)
listGrantsResponse_nextMarker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListGrantsResponse -> Const (First Text) ListGrantsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListGrantsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListGrants where
  type AWSResponse ListGrants = ListGrantsResponse
  request :: ListGrants -> Request ListGrants
request = Service -> ListGrants -> Request ListGrants
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListGrants
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListGrants)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListGrants))
-> Logger
-> Service
-> Proxy ListGrants
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListGrants)))
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 -> Object -> Either String ListGrantsResponse
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)

instance Prelude.Hashable ListGrants

instance Prelude.NFData ListGrants

instance Core.ToHeaders ListGrants where
  toHeaders :: ListGrants -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListGrants -> 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
"TrentService.ListGrants" :: 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 ListGrants where
  toJSON :: ListGrants -> Value
toJSON ListGrants' {Maybe Natural
Maybe Text
Text
keyId :: Text
limit :: Maybe Natural
marker :: Maybe Text
granteePrincipal :: Maybe Text
grantId :: Maybe Text
$sel:keyId:ListGrants' :: ListGrants -> Text
$sel:limit:ListGrants' :: ListGrants -> Maybe Natural
$sel:marker:ListGrants' :: ListGrants -> Maybe Text
$sel:granteePrincipal:ListGrants' :: ListGrants -> Maybe Text
$sel:grantId:ListGrants' :: ListGrants -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"GrantId" 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
grantId,
            (Text
"GranteePrincipal" 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
granteePrincipal,
            (Text
"Marker" 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
marker,
            (Text
"Limit" 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
limit,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"KeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
keyId)
          ]
      )

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

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