{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.GrantListEntry
-- 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)
module Amazonka.KMS.Types.GrantListEntry where

import qualified Amazonka.Core as Core
import Amazonka.KMS.Types.GrantConstraints
import Amazonka.KMS.Types.GrantOperation
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about a grant.
--
-- /See:/ 'newGrantListEntry' smart constructor.
data GrantListEntry = GrantListEntry'
  { -- | The unique identifier for the KMS key to which the grant applies.
    GrantListEntry -> Maybe Text
keyId :: Prelude.Maybe Prelude.Text,
    -- | The principal that can retire the grant.
    GrantListEntry -> Maybe Text
retiringPrincipal :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services account under which the grant was issued.
    GrantListEntry -> Maybe Text
issuingAccount :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the grant.
    GrantListEntry -> Maybe Text
grantId :: Prelude.Maybe Prelude.Text,
    -- | A list of key-value pairs that must be present in the encryption context
    -- of certain subsequent operations that the grant allows.
    GrantListEntry -> Maybe GrantConstraints
constraints :: Prelude.Maybe GrantConstraints,
    -- | The identity that gets the permissions in the grant.
    --
    -- 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.
    GrantListEntry -> Maybe Text
granteePrincipal :: Prelude.Maybe Prelude.Text,
    -- | The friendly name that identifies the grant. If a name was provided in
    -- the CreateGrant request, that name is returned. Otherwise this value is
    -- null.
    GrantListEntry -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the grant was created.
    GrantListEntry -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | The list of operations permitted by the grant.
    GrantListEntry -> Maybe [GrantOperation]
operations :: Prelude.Maybe [GrantOperation]
  }
  deriving (GrantListEntry -> GrantListEntry -> Bool
(GrantListEntry -> GrantListEntry -> Bool)
-> (GrantListEntry -> GrantListEntry -> Bool) -> Eq GrantListEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GrantListEntry -> GrantListEntry -> Bool
$c/= :: GrantListEntry -> GrantListEntry -> Bool
== :: GrantListEntry -> GrantListEntry -> Bool
$c== :: GrantListEntry -> GrantListEntry -> Bool
Prelude.Eq, ReadPrec [GrantListEntry]
ReadPrec GrantListEntry
Int -> ReadS GrantListEntry
ReadS [GrantListEntry]
(Int -> ReadS GrantListEntry)
-> ReadS [GrantListEntry]
-> ReadPrec GrantListEntry
-> ReadPrec [GrantListEntry]
-> Read GrantListEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GrantListEntry]
$creadListPrec :: ReadPrec [GrantListEntry]
readPrec :: ReadPrec GrantListEntry
$creadPrec :: ReadPrec GrantListEntry
readList :: ReadS [GrantListEntry]
$creadList :: ReadS [GrantListEntry]
readsPrec :: Int -> ReadS GrantListEntry
$creadsPrec :: Int -> ReadS GrantListEntry
Prelude.Read, Int -> GrantListEntry -> ShowS
[GrantListEntry] -> ShowS
GrantListEntry -> String
(Int -> GrantListEntry -> ShowS)
-> (GrantListEntry -> String)
-> ([GrantListEntry] -> ShowS)
-> Show GrantListEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GrantListEntry] -> ShowS
$cshowList :: [GrantListEntry] -> ShowS
show :: GrantListEntry -> String
$cshow :: GrantListEntry -> String
showsPrec :: Int -> GrantListEntry -> ShowS
$cshowsPrec :: Int -> GrantListEntry -> ShowS
Prelude.Show, (forall x. GrantListEntry -> Rep GrantListEntry x)
-> (forall x. Rep GrantListEntry x -> GrantListEntry)
-> Generic GrantListEntry
forall x. Rep GrantListEntry x -> GrantListEntry
forall x. GrantListEntry -> Rep GrantListEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GrantListEntry x -> GrantListEntry
$cfrom :: forall x. GrantListEntry -> Rep GrantListEntry x
Prelude.Generic)

-- |
-- Create a value of 'GrantListEntry' 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:
--
-- 'keyId', 'grantListEntry_keyId' - The unique identifier for the KMS key to which the grant applies.
--
-- 'retiringPrincipal', 'grantListEntry_retiringPrincipal' - The principal that can retire the grant.
--
-- 'issuingAccount', 'grantListEntry_issuingAccount' - The Amazon Web Services account under which the grant was issued.
--
-- 'grantId', 'grantListEntry_grantId' - The unique identifier for the grant.
--
-- 'constraints', 'grantListEntry_constraints' - A list of key-value pairs that must be present in the encryption context
-- of certain subsequent operations that the grant allows.
--
-- 'granteePrincipal', 'grantListEntry_granteePrincipal' - The identity that gets the permissions in the grant.
--
-- 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.
--
-- 'name', 'grantListEntry_name' - The friendly name that identifies the grant. If a name was provided in
-- the CreateGrant request, that name is returned. Otherwise this value is
-- null.
--
-- 'creationDate', 'grantListEntry_creationDate' - The date and time when the grant was created.
--
-- 'operations', 'grantListEntry_operations' - The list of operations permitted by the grant.
newGrantListEntry ::
  GrantListEntry
newGrantListEntry :: GrantListEntry
newGrantListEntry =
  GrantListEntry' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe GrantConstraints
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [GrantOperation]
-> GrantListEntry
GrantListEntry'
    { $sel:keyId:GrantListEntry' :: Maybe Text
keyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:retiringPrincipal:GrantListEntry' :: Maybe Text
retiringPrincipal = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:issuingAccount:GrantListEntry' :: Maybe Text
issuingAccount = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:grantId:GrantListEntry' :: Maybe Text
grantId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:constraints:GrantListEntry' :: Maybe GrantConstraints
constraints = Maybe GrantConstraints
forall a. Maybe a
Prelude.Nothing,
      $sel:granteePrincipal:GrantListEntry' :: Maybe Text
granteePrincipal = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GrantListEntry' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:GrantListEntry' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:operations:GrantListEntry' :: Maybe [GrantOperation]
operations = Maybe [GrantOperation]
forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier for the KMS key to which the grant applies.
grantListEntry_keyId :: Lens.Lens' GrantListEntry (Prelude.Maybe Prelude.Text)
grantListEntry_keyId :: (Maybe Text -> f (Maybe Text))
-> GrantListEntry -> f GrantListEntry
grantListEntry_keyId = (GrantListEntry -> Maybe Text)
-> (GrantListEntry -> Maybe Text -> GrantListEntry)
-> Lens GrantListEntry GrantListEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantListEntry' {Maybe Text
keyId :: Maybe Text
$sel:keyId:GrantListEntry' :: GrantListEntry -> Maybe Text
keyId} -> Maybe Text
keyId) (\s :: GrantListEntry
s@GrantListEntry' {} Maybe Text
a -> GrantListEntry
s {$sel:keyId:GrantListEntry' :: Maybe Text
keyId = Maybe Text
a} :: GrantListEntry)

-- | The principal that can retire the grant.
grantListEntry_retiringPrincipal :: Lens.Lens' GrantListEntry (Prelude.Maybe Prelude.Text)
grantListEntry_retiringPrincipal :: (Maybe Text -> f (Maybe Text))
-> GrantListEntry -> f GrantListEntry
grantListEntry_retiringPrincipal = (GrantListEntry -> Maybe Text)
-> (GrantListEntry -> Maybe Text -> GrantListEntry)
-> Lens GrantListEntry GrantListEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantListEntry' {Maybe Text
retiringPrincipal :: Maybe Text
$sel:retiringPrincipal:GrantListEntry' :: GrantListEntry -> Maybe Text
retiringPrincipal} -> Maybe Text
retiringPrincipal) (\s :: GrantListEntry
s@GrantListEntry' {} Maybe Text
a -> GrantListEntry
s {$sel:retiringPrincipal:GrantListEntry' :: Maybe Text
retiringPrincipal = Maybe Text
a} :: GrantListEntry)

-- | The Amazon Web Services account under which the grant was issued.
grantListEntry_issuingAccount :: Lens.Lens' GrantListEntry (Prelude.Maybe Prelude.Text)
grantListEntry_issuingAccount :: (Maybe Text -> f (Maybe Text))
-> GrantListEntry -> f GrantListEntry
grantListEntry_issuingAccount = (GrantListEntry -> Maybe Text)
-> (GrantListEntry -> Maybe Text -> GrantListEntry)
-> Lens GrantListEntry GrantListEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantListEntry' {Maybe Text
issuingAccount :: Maybe Text
$sel:issuingAccount:GrantListEntry' :: GrantListEntry -> Maybe Text
issuingAccount} -> Maybe Text
issuingAccount) (\s :: GrantListEntry
s@GrantListEntry' {} Maybe Text
a -> GrantListEntry
s {$sel:issuingAccount:GrantListEntry' :: Maybe Text
issuingAccount = Maybe Text
a} :: GrantListEntry)

-- | The unique identifier for the grant.
grantListEntry_grantId :: Lens.Lens' GrantListEntry (Prelude.Maybe Prelude.Text)
grantListEntry_grantId :: (Maybe Text -> f (Maybe Text))
-> GrantListEntry -> f GrantListEntry
grantListEntry_grantId = (GrantListEntry -> Maybe Text)
-> (GrantListEntry -> Maybe Text -> GrantListEntry)
-> Lens GrantListEntry GrantListEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantListEntry' {Maybe Text
grantId :: Maybe Text
$sel:grantId:GrantListEntry' :: GrantListEntry -> Maybe Text
grantId} -> Maybe Text
grantId) (\s :: GrantListEntry
s@GrantListEntry' {} Maybe Text
a -> GrantListEntry
s {$sel:grantId:GrantListEntry' :: Maybe Text
grantId = Maybe Text
a} :: GrantListEntry)

-- | A list of key-value pairs that must be present in the encryption context
-- of certain subsequent operations that the grant allows.
grantListEntry_constraints :: Lens.Lens' GrantListEntry (Prelude.Maybe GrantConstraints)
grantListEntry_constraints :: (Maybe GrantConstraints -> f (Maybe GrantConstraints))
-> GrantListEntry -> f GrantListEntry
grantListEntry_constraints = (GrantListEntry -> Maybe GrantConstraints)
-> (GrantListEntry -> Maybe GrantConstraints -> GrantListEntry)
-> Lens
     GrantListEntry
     GrantListEntry
     (Maybe GrantConstraints)
     (Maybe GrantConstraints)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantListEntry' {Maybe GrantConstraints
constraints :: Maybe GrantConstraints
$sel:constraints:GrantListEntry' :: GrantListEntry -> Maybe GrantConstraints
constraints} -> Maybe GrantConstraints
constraints) (\s :: GrantListEntry
s@GrantListEntry' {} Maybe GrantConstraints
a -> GrantListEntry
s {$sel:constraints:GrantListEntry' :: Maybe GrantConstraints
constraints = Maybe GrantConstraints
a} :: GrantListEntry)

-- | The identity that gets the permissions in the grant.
--
-- 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.
grantListEntry_granteePrincipal :: Lens.Lens' GrantListEntry (Prelude.Maybe Prelude.Text)
grantListEntry_granteePrincipal :: (Maybe Text -> f (Maybe Text))
-> GrantListEntry -> f GrantListEntry
grantListEntry_granteePrincipal = (GrantListEntry -> Maybe Text)
-> (GrantListEntry -> Maybe Text -> GrantListEntry)
-> Lens GrantListEntry GrantListEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantListEntry' {Maybe Text
granteePrincipal :: Maybe Text
$sel:granteePrincipal:GrantListEntry' :: GrantListEntry -> Maybe Text
granteePrincipal} -> Maybe Text
granteePrincipal) (\s :: GrantListEntry
s@GrantListEntry' {} Maybe Text
a -> GrantListEntry
s {$sel:granteePrincipal:GrantListEntry' :: Maybe Text
granteePrincipal = Maybe Text
a} :: GrantListEntry)

-- | The friendly name that identifies the grant. If a name was provided in
-- the CreateGrant request, that name is returned. Otherwise this value is
-- null.
grantListEntry_name :: Lens.Lens' GrantListEntry (Prelude.Maybe Prelude.Text)
grantListEntry_name :: (Maybe Text -> f (Maybe Text))
-> GrantListEntry -> f GrantListEntry
grantListEntry_name = (GrantListEntry -> Maybe Text)
-> (GrantListEntry -> Maybe Text -> GrantListEntry)
-> Lens GrantListEntry GrantListEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantListEntry' {Maybe Text
name :: Maybe Text
$sel:name:GrantListEntry' :: GrantListEntry -> Maybe Text
name} -> Maybe Text
name) (\s :: GrantListEntry
s@GrantListEntry' {} Maybe Text
a -> GrantListEntry
s {$sel:name:GrantListEntry' :: Maybe Text
name = Maybe Text
a} :: GrantListEntry)

-- | The date and time when the grant was created.
grantListEntry_creationDate :: Lens.Lens' GrantListEntry (Prelude.Maybe Prelude.UTCTime)
grantListEntry_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GrantListEntry -> f GrantListEntry
grantListEntry_creationDate = (GrantListEntry -> Maybe POSIX)
-> (GrantListEntry -> Maybe POSIX -> GrantListEntry)
-> Lens GrantListEntry GrantListEntry (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantListEntry' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:GrantListEntry' :: GrantListEntry -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: GrantListEntry
s@GrantListEntry' {} Maybe POSIX
a -> GrantListEntry
s {$sel:creationDate:GrantListEntry' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: GrantListEntry) ((Maybe POSIX -> f (Maybe POSIX))
 -> GrantListEntry -> f GrantListEntry)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GrantListEntry
-> f GrantListEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The list of operations permitted by the grant.
grantListEntry_operations :: Lens.Lens' GrantListEntry (Prelude.Maybe [GrantOperation])
grantListEntry_operations :: (Maybe [GrantOperation] -> f (Maybe [GrantOperation]))
-> GrantListEntry -> f GrantListEntry
grantListEntry_operations = (GrantListEntry -> Maybe [GrantOperation])
-> (GrantListEntry -> Maybe [GrantOperation] -> GrantListEntry)
-> Lens
     GrantListEntry
     GrantListEntry
     (Maybe [GrantOperation])
     (Maybe [GrantOperation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantListEntry' {Maybe [GrantOperation]
operations :: Maybe [GrantOperation]
$sel:operations:GrantListEntry' :: GrantListEntry -> Maybe [GrantOperation]
operations} -> Maybe [GrantOperation]
operations) (\s :: GrantListEntry
s@GrantListEntry' {} Maybe [GrantOperation]
a -> GrantListEntry
s {$sel:operations:GrantListEntry' :: Maybe [GrantOperation]
operations = Maybe [GrantOperation]
a} :: GrantListEntry) ((Maybe [GrantOperation] -> f (Maybe [GrantOperation]))
 -> GrantListEntry -> f GrantListEntry)
-> ((Maybe [GrantOperation] -> f (Maybe [GrantOperation]))
    -> Maybe [GrantOperation] -> f (Maybe [GrantOperation]))
-> (Maybe [GrantOperation] -> f (Maybe [GrantOperation]))
-> GrantListEntry
-> f GrantListEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [GrantOperation] [GrantOperation] [GrantOperation] [GrantOperation]
-> Iso
     (Maybe [GrantOperation])
     (Maybe [GrantOperation])
     (Maybe [GrantOperation])
     (Maybe [GrantOperation])
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
  [GrantOperation] [GrantOperation] [GrantOperation] [GrantOperation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON GrantListEntry where
  parseJSON :: Value -> Parser GrantListEntry
parseJSON =
    String
-> (Object -> Parser GrantListEntry)
-> Value
-> Parser GrantListEntry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"GrantListEntry"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe GrantConstraints
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [GrantOperation]
-> GrantListEntry
GrantListEntry'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe GrantConstraints
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe [GrantOperation]
 -> GrantListEntry)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe GrantConstraints
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe [GrantOperation]
      -> GrantListEntry)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KeyId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe GrantConstraints
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe [GrantOperation]
   -> GrantListEntry)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe GrantConstraints
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe [GrantOperation]
      -> GrantListEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RetiringPrincipal")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe GrantConstraints
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe [GrantOperation]
   -> GrantListEntry)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe GrantConstraints
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe [GrantOperation]
      -> GrantListEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IssuingAccount")
            Parser
  (Maybe Text
   -> Maybe GrantConstraints
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe [GrantOperation]
   -> GrantListEntry)
-> Parser (Maybe Text)
-> Parser
     (Maybe GrantConstraints
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe [GrantOperation]
      -> GrantListEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GrantId")
            Parser
  (Maybe GrantConstraints
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe [GrantOperation]
   -> GrantListEntry)
-> Parser (Maybe GrantConstraints)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe [GrantOperation]
      -> GrantListEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe GrantConstraints)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Constraints")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe [GrantOperation]
   -> GrantListEntry)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe [GrantOperation] -> GrantListEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GranteePrincipal")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe [GrantOperation] -> GrantListEntry)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe [GrantOperation] -> GrantListEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser (Maybe POSIX -> Maybe [GrantOperation] -> GrantListEntry)
-> Parser (Maybe POSIX)
-> Parser (Maybe [GrantOperation] -> GrantListEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationDate")
            Parser (Maybe [GrantOperation] -> GrantListEntry)
-> Parser (Maybe [GrantOperation]) -> Parser GrantListEntry
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [GrantOperation]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Operations" Parser (Maybe (Maybe [GrantOperation]))
-> Maybe [GrantOperation] -> Parser (Maybe [GrantOperation])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [GrantOperation]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable GrantListEntry

instance Prelude.NFData GrantListEntry