{-# 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.LicenseManager.Types.GrantedLicense
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.LicenseManager.Types.GrantedLicense 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.ConsumptionConfiguration
import Amazonka.LicenseManager.Types.DatetimeRange
import Amazonka.LicenseManager.Types.Entitlement
import Amazonka.LicenseManager.Types.IssuerDetails
import Amazonka.LicenseManager.Types.LicenseStatus
import Amazonka.LicenseManager.Types.Metadata
import Amazonka.LicenseManager.Types.ReceivedMetadata
import qualified Amazonka.Prelude as Prelude

-- | Describes a license that is granted to a grantee.
--
-- /See:/ 'newGrantedLicense' smart constructor.
data GrantedLicense = GrantedLicense'
  { -- | Granted license beneficiary.
    GrantedLicense -> Maybe Text
beneficiary :: Prelude.Maybe Prelude.Text,
    -- | Configuration for consumption of the license.
    GrantedLicense -> Maybe ConsumptionConfiguration
consumptionConfiguration :: Prelude.Maybe ConsumptionConfiguration,
    -- | Creation time of the granted license.
    GrantedLicense -> Maybe Text
createTime :: Prelude.Maybe Prelude.Text,
    -- | License entitlements.
    GrantedLicense -> Maybe [Entitlement]
entitlements :: Prelude.Maybe [Entitlement],
    -- | Home Region of the granted license.
    GrantedLicense -> Maybe Text
homeRegion :: Prelude.Maybe Prelude.Text,
    -- | Granted license issuer.
    GrantedLicense -> Maybe IssuerDetails
issuer :: Prelude.Maybe IssuerDetails,
    -- | Amazon Resource Name (ARN) of the license.
    GrantedLicense -> Maybe Text
licenseArn :: Prelude.Maybe Prelude.Text,
    -- | Granted license metadata.
    GrantedLicense -> Maybe [Metadata]
licenseMetadata :: Prelude.Maybe [Metadata],
    -- | License name.
    GrantedLicense -> Maybe Text
licenseName :: Prelude.Maybe Prelude.Text,
    -- | Product name.
    GrantedLicense -> Maybe Text
productName :: Prelude.Maybe Prelude.Text,
    -- | Product SKU.
    GrantedLicense -> Maybe Text
productSKU :: Prelude.Maybe Prelude.Text,
    -- | Granted license received metadata.
    GrantedLicense -> Maybe ReceivedMetadata
receivedMetadata :: Prelude.Maybe ReceivedMetadata,
    -- | Granted license status.
    GrantedLicense -> Maybe LicenseStatus
status :: Prelude.Maybe LicenseStatus,
    -- | Date and time range during which the granted license is valid, in
    -- ISO8601-UTC format.
    GrantedLicense -> Maybe DatetimeRange
validity :: Prelude.Maybe DatetimeRange,
    -- | Version of the granted license.
    GrantedLicense -> Maybe Text
version :: Prelude.Maybe Prelude.Text
  }
  deriving (GrantedLicense -> GrantedLicense -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GrantedLicense -> GrantedLicense -> Bool
$c/= :: GrantedLicense -> GrantedLicense -> Bool
== :: GrantedLicense -> GrantedLicense -> Bool
$c== :: GrantedLicense -> GrantedLicense -> Bool
Prelude.Eq, ReadPrec [GrantedLicense]
ReadPrec GrantedLicense
Int -> ReadS GrantedLicense
ReadS [GrantedLicense]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GrantedLicense]
$creadListPrec :: ReadPrec [GrantedLicense]
readPrec :: ReadPrec GrantedLicense
$creadPrec :: ReadPrec GrantedLicense
readList :: ReadS [GrantedLicense]
$creadList :: ReadS [GrantedLicense]
readsPrec :: Int -> ReadS GrantedLicense
$creadsPrec :: Int -> ReadS GrantedLicense
Prelude.Read, Int -> GrantedLicense -> ShowS
[GrantedLicense] -> ShowS
GrantedLicense -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GrantedLicense] -> ShowS
$cshowList :: [GrantedLicense] -> ShowS
show :: GrantedLicense -> String
$cshow :: GrantedLicense -> String
showsPrec :: Int -> GrantedLicense -> ShowS
$cshowsPrec :: Int -> GrantedLicense -> ShowS
Prelude.Show, forall x. Rep GrantedLicense x -> GrantedLicense
forall x. GrantedLicense -> Rep GrantedLicense x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GrantedLicense x -> GrantedLicense
$cfrom :: forall x. GrantedLicense -> Rep GrantedLicense x
Prelude.Generic)

-- |
-- Create a value of 'GrantedLicense' 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:
--
-- 'beneficiary', 'grantedLicense_beneficiary' - Granted license beneficiary.
--
-- 'consumptionConfiguration', 'grantedLicense_consumptionConfiguration' - Configuration for consumption of the license.
--
-- 'createTime', 'grantedLicense_createTime' - Creation time of the granted license.
--
-- 'entitlements', 'grantedLicense_entitlements' - License entitlements.
--
-- 'homeRegion', 'grantedLicense_homeRegion' - Home Region of the granted license.
--
-- 'issuer', 'grantedLicense_issuer' - Granted license issuer.
--
-- 'licenseArn', 'grantedLicense_licenseArn' - Amazon Resource Name (ARN) of the license.
--
-- 'licenseMetadata', 'grantedLicense_licenseMetadata' - Granted license metadata.
--
-- 'licenseName', 'grantedLicense_licenseName' - License name.
--
-- 'productName', 'grantedLicense_productName' - Product name.
--
-- 'productSKU', 'grantedLicense_productSKU' - Product SKU.
--
-- 'receivedMetadata', 'grantedLicense_receivedMetadata' - Granted license received metadata.
--
-- 'status', 'grantedLicense_status' - Granted license status.
--
-- 'validity', 'grantedLicense_validity' - Date and time range during which the granted license is valid, in
-- ISO8601-UTC format.
--
-- 'version', 'grantedLicense_version' - Version of the granted license.
newGrantedLicense ::
  GrantedLicense
newGrantedLicense :: GrantedLicense
newGrantedLicense =
  GrantedLicense'
    { $sel:beneficiary:GrantedLicense' :: Maybe Text
beneficiary = forall a. Maybe a
Prelude.Nothing,
      $sel:consumptionConfiguration:GrantedLicense' :: Maybe ConsumptionConfiguration
consumptionConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:createTime:GrantedLicense' :: Maybe Text
createTime = forall a. Maybe a
Prelude.Nothing,
      $sel:entitlements:GrantedLicense' :: Maybe [Entitlement]
entitlements = forall a. Maybe a
Prelude.Nothing,
      $sel:homeRegion:GrantedLicense' :: Maybe Text
homeRegion = forall a. Maybe a
Prelude.Nothing,
      $sel:issuer:GrantedLicense' :: Maybe IssuerDetails
issuer = forall a. Maybe a
Prelude.Nothing,
      $sel:licenseArn:GrantedLicense' :: Maybe Text
licenseArn = forall a. Maybe a
Prelude.Nothing,
      $sel:licenseMetadata:GrantedLicense' :: Maybe [Metadata]
licenseMetadata = forall a. Maybe a
Prelude.Nothing,
      $sel:licenseName:GrantedLicense' :: Maybe Text
licenseName = forall a. Maybe a
Prelude.Nothing,
      $sel:productName:GrantedLicense' :: Maybe Text
productName = forall a. Maybe a
Prelude.Nothing,
      $sel:productSKU:GrantedLicense' :: Maybe Text
productSKU = forall a. Maybe a
Prelude.Nothing,
      $sel:receivedMetadata:GrantedLicense' :: Maybe ReceivedMetadata
receivedMetadata = forall a. Maybe a
Prelude.Nothing,
      $sel:status:GrantedLicense' :: Maybe LicenseStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:validity:GrantedLicense' :: Maybe DatetimeRange
validity = forall a. Maybe a
Prelude.Nothing,
      $sel:version:GrantedLicense' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing
    }

-- | Granted license beneficiary.
grantedLicense_beneficiary :: Lens.Lens' GrantedLicense (Prelude.Maybe Prelude.Text)
grantedLicense_beneficiary :: Lens' GrantedLicense (Maybe Text)
grantedLicense_beneficiary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe Text
beneficiary :: Maybe Text
$sel:beneficiary:GrantedLicense' :: GrantedLicense -> Maybe Text
beneficiary} -> Maybe Text
beneficiary) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe Text
a -> GrantedLicense
s {$sel:beneficiary:GrantedLicense' :: Maybe Text
beneficiary = Maybe Text
a} :: GrantedLicense)

-- | Configuration for consumption of the license.
grantedLicense_consumptionConfiguration :: Lens.Lens' GrantedLicense (Prelude.Maybe ConsumptionConfiguration)
grantedLicense_consumptionConfiguration :: Lens' GrantedLicense (Maybe ConsumptionConfiguration)
grantedLicense_consumptionConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe ConsumptionConfiguration
consumptionConfiguration :: Maybe ConsumptionConfiguration
$sel:consumptionConfiguration:GrantedLicense' :: GrantedLicense -> Maybe ConsumptionConfiguration
consumptionConfiguration} -> Maybe ConsumptionConfiguration
consumptionConfiguration) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe ConsumptionConfiguration
a -> GrantedLicense
s {$sel:consumptionConfiguration:GrantedLicense' :: Maybe ConsumptionConfiguration
consumptionConfiguration = Maybe ConsumptionConfiguration
a} :: GrantedLicense)

-- | Creation time of the granted license.
grantedLicense_createTime :: Lens.Lens' GrantedLicense (Prelude.Maybe Prelude.Text)
grantedLicense_createTime :: Lens' GrantedLicense (Maybe Text)
grantedLicense_createTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe Text
createTime :: Maybe Text
$sel:createTime:GrantedLicense' :: GrantedLicense -> Maybe Text
createTime} -> Maybe Text
createTime) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe Text
a -> GrantedLicense
s {$sel:createTime:GrantedLicense' :: Maybe Text
createTime = Maybe Text
a} :: GrantedLicense)

-- | License entitlements.
grantedLicense_entitlements :: Lens.Lens' GrantedLicense (Prelude.Maybe [Entitlement])
grantedLicense_entitlements :: Lens' GrantedLicense (Maybe [Entitlement])
grantedLicense_entitlements = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe [Entitlement]
entitlements :: Maybe [Entitlement]
$sel:entitlements:GrantedLicense' :: GrantedLicense -> Maybe [Entitlement]
entitlements} -> Maybe [Entitlement]
entitlements) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe [Entitlement]
a -> GrantedLicense
s {$sel:entitlements:GrantedLicense' :: Maybe [Entitlement]
entitlements = Maybe [Entitlement]
a} :: GrantedLicense) 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

-- | Home Region of the granted license.
grantedLicense_homeRegion :: Lens.Lens' GrantedLicense (Prelude.Maybe Prelude.Text)
grantedLicense_homeRegion :: Lens' GrantedLicense (Maybe Text)
grantedLicense_homeRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe Text
homeRegion :: Maybe Text
$sel:homeRegion:GrantedLicense' :: GrantedLicense -> Maybe Text
homeRegion} -> Maybe Text
homeRegion) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe Text
a -> GrantedLicense
s {$sel:homeRegion:GrantedLicense' :: Maybe Text
homeRegion = Maybe Text
a} :: GrantedLicense)

-- | Granted license issuer.
grantedLicense_issuer :: Lens.Lens' GrantedLicense (Prelude.Maybe IssuerDetails)
grantedLicense_issuer :: Lens' GrantedLicense (Maybe IssuerDetails)
grantedLicense_issuer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe IssuerDetails
issuer :: Maybe IssuerDetails
$sel:issuer:GrantedLicense' :: GrantedLicense -> Maybe IssuerDetails
issuer} -> Maybe IssuerDetails
issuer) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe IssuerDetails
a -> GrantedLicense
s {$sel:issuer:GrantedLicense' :: Maybe IssuerDetails
issuer = Maybe IssuerDetails
a} :: GrantedLicense)

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

-- | Granted license metadata.
grantedLicense_licenseMetadata :: Lens.Lens' GrantedLicense (Prelude.Maybe [Metadata])
grantedLicense_licenseMetadata :: Lens' GrantedLicense (Maybe [Metadata])
grantedLicense_licenseMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe [Metadata]
licenseMetadata :: Maybe [Metadata]
$sel:licenseMetadata:GrantedLicense' :: GrantedLicense -> Maybe [Metadata]
licenseMetadata} -> Maybe [Metadata]
licenseMetadata) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe [Metadata]
a -> GrantedLicense
s {$sel:licenseMetadata:GrantedLicense' :: Maybe [Metadata]
licenseMetadata = Maybe [Metadata]
a} :: GrantedLicense) 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

-- | License name.
grantedLicense_licenseName :: Lens.Lens' GrantedLicense (Prelude.Maybe Prelude.Text)
grantedLicense_licenseName :: Lens' GrantedLicense (Maybe Text)
grantedLicense_licenseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe Text
licenseName :: Maybe Text
$sel:licenseName:GrantedLicense' :: GrantedLicense -> Maybe Text
licenseName} -> Maybe Text
licenseName) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe Text
a -> GrantedLicense
s {$sel:licenseName:GrantedLicense' :: Maybe Text
licenseName = Maybe Text
a} :: GrantedLicense)

-- | Product name.
grantedLicense_productName :: Lens.Lens' GrantedLicense (Prelude.Maybe Prelude.Text)
grantedLicense_productName :: Lens' GrantedLicense (Maybe Text)
grantedLicense_productName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe Text
productName :: Maybe Text
$sel:productName:GrantedLicense' :: GrantedLicense -> Maybe Text
productName} -> Maybe Text
productName) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe Text
a -> GrantedLicense
s {$sel:productName:GrantedLicense' :: Maybe Text
productName = Maybe Text
a} :: GrantedLicense)

-- | Product SKU.
grantedLicense_productSKU :: Lens.Lens' GrantedLicense (Prelude.Maybe Prelude.Text)
grantedLicense_productSKU :: Lens' GrantedLicense (Maybe Text)
grantedLicense_productSKU = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe Text
productSKU :: Maybe Text
$sel:productSKU:GrantedLicense' :: GrantedLicense -> Maybe Text
productSKU} -> Maybe Text
productSKU) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe Text
a -> GrantedLicense
s {$sel:productSKU:GrantedLicense' :: Maybe Text
productSKU = Maybe Text
a} :: GrantedLicense)

-- | Granted license received metadata.
grantedLicense_receivedMetadata :: Lens.Lens' GrantedLicense (Prelude.Maybe ReceivedMetadata)
grantedLicense_receivedMetadata :: Lens' GrantedLicense (Maybe ReceivedMetadata)
grantedLicense_receivedMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe ReceivedMetadata
receivedMetadata :: Maybe ReceivedMetadata
$sel:receivedMetadata:GrantedLicense' :: GrantedLicense -> Maybe ReceivedMetadata
receivedMetadata} -> Maybe ReceivedMetadata
receivedMetadata) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe ReceivedMetadata
a -> GrantedLicense
s {$sel:receivedMetadata:GrantedLicense' :: Maybe ReceivedMetadata
receivedMetadata = Maybe ReceivedMetadata
a} :: GrantedLicense)

-- | Granted license status.
grantedLicense_status :: Lens.Lens' GrantedLicense (Prelude.Maybe LicenseStatus)
grantedLicense_status :: Lens' GrantedLicense (Maybe LicenseStatus)
grantedLicense_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe LicenseStatus
status :: Maybe LicenseStatus
$sel:status:GrantedLicense' :: GrantedLicense -> Maybe LicenseStatus
status} -> Maybe LicenseStatus
status) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe LicenseStatus
a -> GrantedLicense
s {$sel:status:GrantedLicense' :: Maybe LicenseStatus
status = Maybe LicenseStatus
a} :: GrantedLicense)

-- | Date and time range during which the granted license is valid, in
-- ISO8601-UTC format.
grantedLicense_validity :: Lens.Lens' GrantedLicense (Prelude.Maybe DatetimeRange)
grantedLicense_validity :: Lens' GrantedLicense (Maybe DatetimeRange)
grantedLicense_validity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe DatetimeRange
validity :: Maybe DatetimeRange
$sel:validity:GrantedLicense' :: GrantedLicense -> Maybe DatetimeRange
validity} -> Maybe DatetimeRange
validity) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe DatetimeRange
a -> GrantedLicense
s {$sel:validity:GrantedLicense' :: Maybe DatetimeRange
validity = Maybe DatetimeRange
a} :: GrantedLicense)

-- | Version of the granted license.
grantedLicense_version :: Lens.Lens' GrantedLicense (Prelude.Maybe Prelude.Text)
grantedLicense_version :: Lens' GrantedLicense (Maybe Text)
grantedLicense_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GrantedLicense' {Maybe Text
version :: Maybe Text
$sel:version:GrantedLicense' :: GrantedLicense -> Maybe Text
version} -> Maybe Text
version) (\s :: GrantedLicense
s@GrantedLicense' {} Maybe Text
a -> GrantedLicense
s {$sel:version:GrantedLicense' :: Maybe Text
version = Maybe Text
a} :: GrantedLicense)

instance Data.FromJSON GrantedLicense where
  parseJSON :: Value -> Parser GrantedLicense
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GrantedLicense"
      ( \Object
x ->
          Maybe Text
-> Maybe ConsumptionConfiguration
-> Maybe Text
-> Maybe [Entitlement]
-> Maybe Text
-> Maybe IssuerDetails
-> Maybe Text
-> Maybe [Metadata]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ReceivedMetadata
-> Maybe LicenseStatus
-> Maybe DatetimeRange
-> Maybe Text
-> GrantedLicense
GrantedLicense'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Beneficiary")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ConsumptionConfiguration")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreateTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Entitlements" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser (Maybe a)
Data..:? Key
"HomeRegion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Issuer")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LicenseArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LicenseMetadata"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser (Maybe a)
Data..:? Key
"LicenseName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ProductName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ProductSKU")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ReceivedMetadata")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Validity")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Version")
      )

instance Prelude.Hashable GrantedLicense where
  hashWithSalt :: Int -> GrantedLicense -> Int
hashWithSalt Int
_salt GrantedLicense' {Maybe [Entitlement]
Maybe [Metadata]
Maybe Text
Maybe DatetimeRange
Maybe IssuerDetails
Maybe LicenseStatus
Maybe ReceivedMetadata
Maybe ConsumptionConfiguration
version :: Maybe Text
validity :: Maybe DatetimeRange
status :: Maybe LicenseStatus
receivedMetadata :: Maybe ReceivedMetadata
productSKU :: Maybe Text
productName :: Maybe Text
licenseName :: Maybe Text
licenseMetadata :: Maybe [Metadata]
licenseArn :: Maybe Text
issuer :: Maybe IssuerDetails
homeRegion :: Maybe Text
entitlements :: Maybe [Entitlement]
createTime :: Maybe Text
consumptionConfiguration :: Maybe ConsumptionConfiguration
beneficiary :: Maybe Text
$sel:version:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:validity:GrantedLicense' :: GrantedLicense -> Maybe DatetimeRange
$sel:status:GrantedLicense' :: GrantedLicense -> Maybe LicenseStatus
$sel:receivedMetadata:GrantedLicense' :: GrantedLicense -> Maybe ReceivedMetadata
$sel:productSKU:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:productName:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:licenseName:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:licenseMetadata:GrantedLicense' :: GrantedLicense -> Maybe [Metadata]
$sel:licenseArn:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:issuer:GrantedLicense' :: GrantedLicense -> Maybe IssuerDetails
$sel:homeRegion:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:entitlements:GrantedLicense' :: GrantedLicense -> Maybe [Entitlement]
$sel:createTime:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:consumptionConfiguration:GrantedLicense' :: GrantedLicense -> Maybe ConsumptionConfiguration
$sel:beneficiary:GrantedLicense' :: GrantedLicense -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
beneficiary
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConsumptionConfiguration
consumptionConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
createTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Entitlement]
entitlements
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
homeRegion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IssuerDetails
issuer
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
licenseArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Metadata]
licenseMetadata
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
licenseName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
productName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
productSKU
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReceivedMetadata
receivedMetadata
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LicenseStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DatetimeRange
validity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version

instance Prelude.NFData GrantedLicense where
  rnf :: GrantedLicense -> ()
rnf GrantedLicense' {Maybe [Entitlement]
Maybe [Metadata]
Maybe Text
Maybe DatetimeRange
Maybe IssuerDetails
Maybe LicenseStatus
Maybe ReceivedMetadata
Maybe ConsumptionConfiguration
version :: Maybe Text
validity :: Maybe DatetimeRange
status :: Maybe LicenseStatus
receivedMetadata :: Maybe ReceivedMetadata
productSKU :: Maybe Text
productName :: Maybe Text
licenseName :: Maybe Text
licenseMetadata :: Maybe [Metadata]
licenseArn :: Maybe Text
issuer :: Maybe IssuerDetails
homeRegion :: Maybe Text
entitlements :: Maybe [Entitlement]
createTime :: Maybe Text
consumptionConfiguration :: Maybe ConsumptionConfiguration
beneficiary :: Maybe Text
$sel:version:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:validity:GrantedLicense' :: GrantedLicense -> Maybe DatetimeRange
$sel:status:GrantedLicense' :: GrantedLicense -> Maybe LicenseStatus
$sel:receivedMetadata:GrantedLicense' :: GrantedLicense -> Maybe ReceivedMetadata
$sel:productSKU:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:productName:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:licenseName:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:licenseMetadata:GrantedLicense' :: GrantedLicense -> Maybe [Metadata]
$sel:licenseArn:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:issuer:GrantedLicense' :: GrantedLicense -> Maybe IssuerDetails
$sel:homeRegion:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:entitlements:GrantedLicense' :: GrantedLicense -> Maybe [Entitlement]
$sel:createTime:GrantedLicense' :: GrantedLicense -> Maybe Text
$sel:consumptionConfiguration:GrantedLicense' :: GrantedLicense -> Maybe ConsumptionConfiguration
$sel:beneficiary:GrantedLicense' :: GrantedLicense -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
beneficiary
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConsumptionConfiguration
consumptionConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
createTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Entitlement]
entitlements
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
homeRegion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IssuerDetails
issuer
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
licenseArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Metadata]
licenseMetadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
licenseName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
productName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
productSKU
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReceivedMetadata
receivedMetadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LicenseStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DatetimeRange
validity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version