{-# 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 #-}
module Amazonka.LicenseManager.CheckoutLicense
(
CheckoutLicense (..),
newCheckoutLicense,
checkoutLicense_nodeId,
checkoutLicense_beneficiary,
checkoutLicense_productSKU,
checkoutLicense_checkoutType,
checkoutLicense_keyFingerprint,
checkoutLicense_entitlements,
checkoutLicense_clientToken,
CheckoutLicenseResponse (..),
newCheckoutLicenseResponse,
checkoutLicenseResponse_entitlementsAllowed,
checkoutLicenseResponse_checkoutType,
checkoutLicenseResponse_expiration,
checkoutLicenseResponse_signedToken,
checkoutLicenseResponse_licenseConsumptionToken,
checkoutLicenseResponse_nodeId,
checkoutLicenseResponse_issuedAt,
checkoutLicenseResponse_licenseArn,
checkoutLicenseResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LicenseManager.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CheckoutLicense = CheckoutLicense'
{
CheckoutLicense -> Maybe Text
nodeId :: Prelude.Maybe Prelude.Text,
CheckoutLicense -> Maybe Text
beneficiary :: Prelude.Maybe Prelude.Text,
CheckoutLicense -> Text
productSKU :: Prelude.Text,
CheckoutLicense -> CheckoutType
checkoutType :: CheckoutType,
CheckoutLicense -> Text
keyFingerprint :: Prelude.Text,
CheckoutLicense -> [EntitlementData]
entitlements :: [EntitlementData],
CheckoutLicense -> Text
clientToken :: Prelude.Text
}
deriving (CheckoutLicense -> CheckoutLicense -> Bool
(CheckoutLicense -> CheckoutLicense -> Bool)
-> (CheckoutLicense -> CheckoutLicense -> Bool)
-> Eq CheckoutLicense
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CheckoutLicense -> CheckoutLicense -> Bool
$c/= :: CheckoutLicense -> CheckoutLicense -> Bool
== :: CheckoutLicense -> CheckoutLicense -> Bool
$c== :: CheckoutLicense -> CheckoutLicense -> Bool
Prelude.Eq, ReadPrec [CheckoutLicense]
ReadPrec CheckoutLicense
Int -> ReadS CheckoutLicense
ReadS [CheckoutLicense]
(Int -> ReadS CheckoutLicense)
-> ReadS [CheckoutLicense]
-> ReadPrec CheckoutLicense
-> ReadPrec [CheckoutLicense]
-> Read CheckoutLicense
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CheckoutLicense]
$creadListPrec :: ReadPrec [CheckoutLicense]
readPrec :: ReadPrec CheckoutLicense
$creadPrec :: ReadPrec CheckoutLicense
readList :: ReadS [CheckoutLicense]
$creadList :: ReadS [CheckoutLicense]
readsPrec :: Int -> ReadS CheckoutLicense
$creadsPrec :: Int -> ReadS CheckoutLicense
Prelude.Read, Int -> CheckoutLicense -> ShowS
[CheckoutLicense] -> ShowS
CheckoutLicense -> String
(Int -> CheckoutLicense -> ShowS)
-> (CheckoutLicense -> String)
-> ([CheckoutLicense] -> ShowS)
-> Show CheckoutLicense
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CheckoutLicense] -> ShowS
$cshowList :: [CheckoutLicense] -> ShowS
show :: CheckoutLicense -> String
$cshow :: CheckoutLicense -> String
showsPrec :: Int -> CheckoutLicense -> ShowS
$cshowsPrec :: Int -> CheckoutLicense -> ShowS
Prelude.Show, (forall x. CheckoutLicense -> Rep CheckoutLicense x)
-> (forall x. Rep CheckoutLicense x -> CheckoutLicense)
-> Generic CheckoutLicense
forall x. Rep CheckoutLicense x -> CheckoutLicense
forall x. CheckoutLicense -> Rep CheckoutLicense x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CheckoutLicense x -> CheckoutLicense
$cfrom :: forall x. CheckoutLicense -> Rep CheckoutLicense x
Prelude.Generic)
newCheckoutLicense ::
Prelude.Text ->
CheckoutType ->
Prelude.Text ->
Prelude.Text ->
CheckoutLicense
newCheckoutLicense :: Text -> CheckoutType -> Text -> Text -> CheckoutLicense
newCheckoutLicense
Text
pProductSKU_
CheckoutType
pCheckoutType_
Text
pKeyFingerprint_
Text
pClientToken_ =
CheckoutLicense' :: Maybe Text
-> Maybe Text
-> Text
-> CheckoutType
-> Text
-> [EntitlementData]
-> Text
-> CheckoutLicense
CheckoutLicense'
{ $sel:nodeId:CheckoutLicense' :: Maybe Text
nodeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:beneficiary:CheckoutLicense' :: Maybe Text
beneficiary = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:productSKU:CheckoutLicense' :: Text
productSKU = Text
pProductSKU_,
$sel:checkoutType:CheckoutLicense' :: CheckoutType
checkoutType = CheckoutType
pCheckoutType_,
$sel:keyFingerprint:CheckoutLicense' :: Text
keyFingerprint = Text
pKeyFingerprint_,
$sel:entitlements:CheckoutLicense' :: [EntitlementData]
entitlements = [EntitlementData]
forall a. Monoid a => a
Prelude.mempty,
$sel:clientToken:CheckoutLicense' :: Text
clientToken = Text
pClientToken_
}
checkoutLicense_nodeId :: Lens.Lens' CheckoutLicense (Prelude.Maybe Prelude.Text)
checkoutLicense_nodeId :: (Maybe Text -> f (Maybe Text))
-> CheckoutLicense -> f CheckoutLicense
checkoutLicense_nodeId = (CheckoutLicense -> Maybe Text)
-> (CheckoutLicense -> Maybe Text -> CheckoutLicense)
-> Lens CheckoutLicense CheckoutLicense (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicense' {Maybe Text
nodeId :: Maybe Text
$sel:nodeId:CheckoutLicense' :: CheckoutLicense -> Maybe Text
nodeId} -> Maybe Text
nodeId) (\s :: CheckoutLicense
s@CheckoutLicense' {} Maybe Text
a -> CheckoutLicense
s {$sel:nodeId:CheckoutLicense' :: Maybe Text
nodeId = Maybe Text
a} :: CheckoutLicense)
checkoutLicense_beneficiary :: Lens.Lens' CheckoutLicense (Prelude.Maybe Prelude.Text)
checkoutLicense_beneficiary :: (Maybe Text -> f (Maybe Text))
-> CheckoutLicense -> f CheckoutLicense
checkoutLicense_beneficiary = (CheckoutLicense -> Maybe Text)
-> (CheckoutLicense -> Maybe Text -> CheckoutLicense)
-> Lens CheckoutLicense CheckoutLicense (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicense' {Maybe Text
beneficiary :: Maybe Text
$sel:beneficiary:CheckoutLicense' :: CheckoutLicense -> Maybe Text
beneficiary} -> Maybe Text
beneficiary) (\s :: CheckoutLicense
s@CheckoutLicense' {} Maybe Text
a -> CheckoutLicense
s {$sel:beneficiary:CheckoutLicense' :: Maybe Text
beneficiary = Maybe Text
a} :: CheckoutLicense)
checkoutLicense_productSKU :: Lens.Lens' CheckoutLicense Prelude.Text
checkoutLicense_productSKU :: (Text -> f Text) -> CheckoutLicense -> f CheckoutLicense
checkoutLicense_productSKU = (CheckoutLicense -> Text)
-> (CheckoutLicense -> Text -> CheckoutLicense)
-> Lens CheckoutLicense CheckoutLicense Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicense' {Text
productSKU :: Text
$sel:productSKU:CheckoutLicense' :: CheckoutLicense -> Text
productSKU} -> Text
productSKU) (\s :: CheckoutLicense
s@CheckoutLicense' {} Text
a -> CheckoutLicense
s {$sel:productSKU:CheckoutLicense' :: Text
productSKU = Text
a} :: CheckoutLicense)
checkoutLicense_checkoutType :: Lens.Lens' CheckoutLicense CheckoutType
checkoutLicense_checkoutType :: (CheckoutType -> f CheckoutType)
-> CheckoutLicense -> f CheckoutLicense
checkoutLicense_checkoutType = (CheckoutLicense -> CheckoutType)
-> (CheckoutLicense -> CheckoutType -> CheckoutLicense)
-> Lens CheckoutLicense CheckoutLicense CheckoutType CheckoutType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicense' {CheckoutType
checkoutType :: CheckoutType
$sel:checkoutType:CheckoutLicense' :: CheckoutLicense -> CheckoutType
checkoutType} -> CheckoutType
checkoutType) (\s :: CheckoutLicense
s@CheckoutLicense' {} CheckoutType
a -> CheckoutLicense
s {$sel:checkoutType:CheckoutLicense' :: CheckoutType
checkoutType = CheckoutType
a} :: CheckoutLicense)
checkoutLicense_keyFingerprint :: Lens.Lens' CheckoutLicense Prelude.Text
checkoutLicense_keyFingerprint :: (Text -> f Text) -> CheckoutLicense -> f CheckoutLicense
checkoutLicense_keyFingerprint = (CheckoutLicense -> Text)
-> (CheckoutLicense -> Text -> CheckoutLicense)
-> Lens CheckoutLicense CheckoutLicense Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicense' {Text
keyFingerprint :: Text
$sel:keyFingerprint:CheckoutLicense' :: CheckoutLicense -> Text
keyFingerprint} -> Text
keyFingerprint) (\s :: CheckoutLicense
s@CheckoutLicense' {} Text
a -> CheckoutLicense
s {$sel:keyFingerprint:CheckoutLicense' :: Text
keyFingerprint = Text
a} :: CheckoutLicense)
checkoutLicense_entitlements :: Lens.Lens' CheckoutLicense [EntitlementData]
checkoutLicense_entitlements :: ([EntitlementData] -> f [EntitlementData])
-> CheckoutLicense -> f CheckoutLicense
checkoutLicense_entitlements = (CheckoutLicense -> [EntitlementData])
-> (CheckoutLicense -> [EntitlementData] -> CheckoutLicense)
-> Lens
CheckoutLicense CheckoutLicense [EntitlementData] [EntitlementData]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicense' {[EntitlementData]
entitlements :: [EntitlementData]
$sel:entitlements:CheckoutLicense' :: CheckoutLicense -> [EntitlementData]
entitlements} -> [EntitlementData]
entitlements) (\s :: CheckoutLicense
s@CheckoutLicense' {} [EntitlementData]
a -> CheckoutLicense
s {$sel:entitlements:CheckoutLicense' :: [EntitlementData]
entitlements = [EntitlementData]
a} :: CheckoutLicense) (([EntitlementData] -> f [EntitlementData])
-> CheckoutLicense -> f CheckoutLicense)
-> (([EntitlementData] -> f [EntitlementData])
-> [EntitlementData] -> f [EntitlementData])
-> ([EntitlementData] -> f [EntitlementData])
-> CheckoutLicense
-> f CheckoutLicense
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([EntitlementData] -> f [EntitlementData])
-> [EntitlementData] -> f [EntitlementData]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
checkoutLicense_clientToken :: Lens.Lens' CheckoutLicense Prelude.Text
checkoutLicense_clientToken :: (Text -> f Text) -> CheckoutLicense -> f CheckoutLicense
checkoutLicense_clientToken = (CheckoutLicense -> Text)
-> (CheckoutLicense -> Text -> CheckoutLicense)
-> Lens CheckoutLicense CheckoutLicense Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicense' {Text
clientToken :: Text
$sel:clientToken:CheckoutLicense' :: CheckoutLicense -> Text
clientToken} -> Text
clientToken) (\s :: CheckoutLicense
s@CheckoutLicense' {} Text
a -> CheckoutLicense
s {$sel:clientToken:CheckoutLicense' :: Text
clientToken = Text
a} :: CheckoutLicense)
instance Core.AWSRequest CheckoutLicense where
type
AWSResponse CheckoutLicense =
CheckoutLicenseResponse
request :: CheckoutLicense -> Request CheckoutLicense
request = Service -> CheckoutLicense -> Request CheckoutLicense
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CheckoutLicense
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CheckoutLicense)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CheckoutLicense))
-> Logger
-> Service
-> Proxy CheckoutLicense
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CheckoutLicense)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [EntitlementData]
-> Maybe CheckoutType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutLicenseResponse
CheckoutLicenseResponse'
(Maybe [EntitlementData]
-> Maybe CheckoutType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutLicenseResponse)
-> Either String (Maybe [EntitlementData])
-> Either
String
(Maybe CheckoutType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutLicenseResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [EntitlementData]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EntitlementsAllowed"
Either String (Maybe (Maybe [EntitlementData]))
-> Maybe [EntitlementData]
-> Either String (Maybe [EntitlementData])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [EntitlementData]
forall a. Monoid a => a
Prelude.mempty
)
Either
String
(Maybe CheckoutType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutLicenseResponse)
-> Either String (Maybe CheckoutType)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutLicenseResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe CheckoutType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CheckoutType")
Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutLicenseResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutLicenseResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Expiration")
Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutLicenseResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutLicenseResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SignedToken")
Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutLicenseResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CheckoutLicenseResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LicenseConsumptionToken")
Either
String
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CheckoutLicenseResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Int -> CheckoutLicenseResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NodeId")
Either
String (Maybe Text -> Maybe Text -> Int -> CheckoutLicenseResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CheckoutLicenseResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"IssuedAt")
Either String (Maybe Text -> Int -> CheckoutLicenseResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CheckoutLicenseResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LicenseArn")
Either String (Int -> CheckoutLicenseResponse)
-> Either String Int -> Either String CheckoutLicenseResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CheckoutLicense
instance Prelude.NFData CheckoutLicense
instance Core.ToHeaders CheckoutLicense where
toHeaders :: CheckoutLicense -> ResponseHeaders
toHeaders =
ResponseHeaders -> CheckoutLicense -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSLicenseManager.CheckoutLicense" ::
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 CheckoutLicense where
toJSON :: CheckoutLicense -> Value
toJSON CheckoutLicense' {[EntitlementData]
Maybe Text
Text
CheckoutType
clientToken :: Text
entitlements :: [EntitlementData]
keyFingerprint :: Text
checkoutType :: CheckoutType
productSKU :: Text
beneficiary :: Maybe Text
nodeId :: Maybe Text
$sel:clientToken:CheckoutLicense' :: CheckoutLicense -> Text
$sel:entitlements:CheckoutLicense' :: CheckoutLicense -> [EntitlementData]
$sel:keyFingerprint:CheckoutLicense' :: CheckoutLicense -> Text
$sel:checkoutType:CheckoutLicense' :: CheckoutLicense -> CheckoutType
$sel:productSKU:CheckoutLicense' :: CheckoutLicense -> Text
$sel:beneficiary:CheckoutLicense' :: CheckoutLicense -> Maybe Text
$sel:nodeId:CheckoutLicense' :: CheckoutLicense -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NodeId" 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
nodeId,
(Text
"Beneficiary" 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
beneficiary,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ProductSKU" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
productSKU),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"CheckoutType" Text -> CheckoutType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CheckoutType
checkoutType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"KeyFingerprint" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
keyFingerprint),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Entitlements" Text -> [EntitlementData] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [EntitlementData]
entitlements),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
]
)
instance Core.ToPath CheckoutLicense where
toPath :: CheckoutLicense -> ByteString
toPath = ByteString -> CheckoutLicense -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CheckoutLicense where
toQuery :: CheckoutLicense -> QueryString
toQuery = QueryString -> CheckoutLicense -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CheckoutLicenseResponse = CheckoutLicenseResponse'
{
CheckoutLicenseResponse -> Maybe [EntitlementData]
entitlementsAllowed :: Prelude.Maybe [EntitlementData],
CheckoutLicenseResponse -> Maybe CheckoutType
checkoutType :: Prelude.Maybe CheckoutType,
CheckoutLicenseResponse -> Maybe Text
expiration :: Prelude.Maybe Prelude.Text,
CheckoutLicenseResponse -> Maybe Text
signedToken :: Prelude.Maybe Prelude.Text,
CheckoutLicenseResponse -> Maybe Text
licenseConsumptionToken :: Prelude.Maybe Prelude.Text,
CheckoutLicenseResponse -> Maybe Text
nodeId :: Prelude.Maybe Prelude.Text,
CheckoutLicenseResponse -> Maybe Text
issuedAt :: Prelude.Maybe Prelude.Text,
CheckoutLicenseResponse -> Maybe Text
licenseArn :: Prelude.Maybe Prelude.Text,
CheckoutLicenseResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CheckoutLicenseResponse -> CheckoutLicenseResponse -> Bool
(CheckoutLicenseResponse -> CheckoutLicenseResponse -> Bool)
-> (CheckoutLicenseResponse -> CheckoutLicenseResponse -> Bool)
-> Eq CheckoutLicenseResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CheckoutLicenseResponse -> CheckoutLicenseResponse -> Bool
$c/= :: CheckoutLicenseResponse -> CheckoutLicenseResponse -> Bool
== :: CheckoutLicenseResponse -> CheckoutLicenseResponse -> Bool
$c== :: CheckoutLicenseResponse -> CheckoutLicenseResponse -> Bool
Prelude.Eq, ReadPrec [CheckoutLicenseResponse]
ReadPrec CheckoutLicenseResponse
Int -> ReadS CheckoutLicenseResponse
ReadS [CheckoutLicenseResponse]
(Int -> ReadS CheckoutLicenseResponse)
-> ReadS [CheckoutLicenseResponse]
-> ReadPrec CheckoutLicenseResponse
-> ReadPrec [CheckoutLicenseResponse]
-> Read CheckoutLicenseResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CheckoutLicenseResponse]
$creadListPrec :: ReadPrec [CheckoutLicenseResponse]
readPrec :: ReadPrec CheckoutLicenseResponse
$creadPrec :: ReadPrec CheckoutLicenseResponse
readList :: ReadS [CheckoutLicenseResponse]
$creadList :: ReadS [CheckoutLicenseResponse]
readsPrec :: Int -> ReadS CheckoutLicenseResponse
$creadsPrec :: Int -> ReadS CheckoutLicenseResponse
Prelude.Read, Int -> CheckoutLicenseResponse -> ShowS
[CheckoutLicenseResponse] -> ShowS
CheckoutLicenseResponse -> String
(Int -> CheckoutLicenseResponse -> ShowS)
-> (CheckoutLicenseResponse -> String)
-> ([CheckoutLicenseResponse] -> ShowS)
-> Show CheckoutLicenseResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CheckoutLicenseResponse] -> ShowS
$cshowList :: [CheckoutLicenseResponse] -> ShowS
show :: CheckoutLicenseResponse -> String
$cshow :: CheckoutLicenseResponse -> String
showsPrec :: Int -> CheckoutLicenseResponse -> ShowS
$cshowsPrec :: Int -> CheckoutLicenseResponse -> ShowS
Prelude.Show, (forall x.
CheckoutLicenseResponse -> Rep CheckoutLicenseResponse x)
-> (forall x.
Rep CheckoutLicenseResponse x -> CheckoutLicenseResponse)
-> Generic CheckoutLicenseResponse
forall x. Rep CheckoutLicenseResponse x -> CheckoutLicenseResponse
forall x. CheckoutLicenseResponse -> Rep CheckoutLicenseResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CheckoutLicenseResponse x -> CheckoutLicenseResponse
$cfrom :: forall x. CheckoutLicenseResponse -> Rep CheckoutLicenseResponse x
Prelude.Generic)
newCheckoutLicenseResponse ::
Prelude.Int ->
CheckoutLicenseResponse
newCheckoutLicenseResponse :: Int -> CheckoutLicenseResponse
newCheckoutLicenseResponse Int
pHttpStatus_ =
CheckoutLicenseResponse' :: Maybe [EntitlementData]
-> Maybe CheckoutType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutLicenseResponse
CheckoutLicenseResponse'
{ $sel:entitlementsAllowed:CheckoutLicenseResponse' :: Maybe [EntitlementData]
entitlementsAllowed =
Maybe [EntitlementData]
forall a. Maybe a
Prelude.Nothing,
$sel:checkoutType:CheckoutLicenseResponse' :: Maybe CheckoutType
checkoutType = Maybe CheckoutType
forall a. Maybe a
Prelude.Nothing,
$sel:expiration:CheckoutLicenseResponse' :: Maybe Text
expiration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:signedToken:CheckoutLicenseResponse' :: Maybe Text
signedToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:licenseConsumptionToken:CheckoutLicenseResponse' :: Maybe Text
licenseConsumptionToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nodeId:CheckoutLicenseResponse' :: Maybe Text
nodeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:issuedAt:CheckoutLicenseResponse' :: Maybe Text
issuedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:licenseArn:CheckoutLicenseResponse' :: Maybe Text
licenseArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CheckoutLicenseResponse' :: Int
httpStatus = Int
pHttpStatus_
}
checkoutLicenseResponse_entitlementsAllowed :: Lens.Lens' CheckoutLicenseResponse (Prelude.Maybe [EntitlementData])
checkoutLicenseResponse_entitlementsAllowed :: (Maybe [EntitlementData] -> f (Maybe [EntitlementData]))
-> CheckoutLicenseResponse -> f CheckoutLicenseResponse
checkoutLicenseResponse_entitlementsAllowed = (CheckoutLicenseResponse -> Maybe [EntitlementData])
-> (CheckoutLicenseResponse
-> Maybe [EntitlementData] -> CheckoutLicenseResponse)
-> Lens
CheckoutLicenseResponse
CheckoutLicenseResponse
(Maybe [EntitlementData])
(Maybe [EntitlementData])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicenseResponse' {Maybe [EntitlementData]
entitlementsAllowed :: Maybe [EntitlementData]
$sel:entitlementsAllowed:CheckoutLicenseResponse' :: CheckoutLicenseResponse -> Maybe [EntitlementData]
entitlementsAllowed} -> Maybe [EntitlementData]
entitlementsAllowed) (\s :: CheckoutLicenseResponse
s@CheckoutLicenseResponse' {} Maybe [EntitlementData]
a -> CheckoutLicenseResponse
s {$sel:entitlementsAllowed:CheckoutLicenseResponse' :: Maybe [EntitlementData]
entitlementsAllowed = Maybe [EntitlementData]
a} :: CheckoutLicenseResponse) ((Maybe [EntitlementData] -> f (Maybe [EntitlementData]))
-> CheckoutLicenseResponse -> f CheckoutLicenseResponse)
-> ((Maybe [EntitlementData] -> f (Maybe [EntitlementData]))
-> Maybe [EntitlementData] -> f (Maybe [EntitlementData]))
-> (Maybe [EntitlementData] -> f (Maybe [EntitlementData]))
-> CheckoutLicenseResponse
-> f CheckoutLicenseResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[EntitlementData]
[EntitlementData]
[EntitlementData]
[EntitlementData]
-> Iso
(Maybe [EntitlementData])
(Maybe [EntitlementData])
(Maybe [EntitlementData])
(Maybe [EntitlementData])
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
[EntitlementData]
[EntitlementData]
[EntitlementData]
[EntitlementData]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
checkoutLicenseResponse_checkoutType :: Lens.Lens' CheckoutLicenseResponse (Prelude.Maybe CheckoutType)
checkoutLicenseResponse_checkoutType :: (Maybe CheckoutType -> f (Maybe CheckoutType))
-> CheckoutLicenseResponse -> f CheckoutLicenseResponse
checkoutLicenseResponse_checkoutType = (CheckoutLicenseResponse -> Maybe CheckoutType)
-> (CheckoutLicenseResponse
-> Maybe CheckoutType -> CheckoutLicenseResponse)
-> Lens
CheckoutLicenseResponse
CheckoutLicenseResponse
(Maybe CheckoutType)
(Maybe CheckoutType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicenseResponse' {Maybe CheckoutType
checkoutType :: Maybe CheckoutType
$sel:checkoutType:CheckoutLicenseResponse' :: CheckoutLicenseResponse -> Maybe CheckoutType
checkoutType} -> Maybe CheckoutType
checkoutType) (\s :: CheckoutLicenseResponse
s@CheckoutLicenseResponse' {} Maybe CheckoutType
a -> CheckoutLicenseResponse
s {$sel:checkoutType:CheckoutLicenseResponse' :: Maybe CheckoutType
checkoutType = Maybe CheckoutType
a} :: CheckoutLicenseResponse)
checkoutLicenseResponse_expiration :: Lens.Lens' CheckoutLicenseResponse (Prelude.Maybe Prelude.Text)
checkoutLicenseResponse_expiration :: (Maybe Text -> f (Maybe Text))
-> CheckoutLicenseResponse -> f CheckoutLicenseResponse
checkoutLicenseResponse_expiration = (CheckoutLicenseResponse -> Maybe Text)
-> (CheckoutLicenseResponse
-> Maybe Text -> CheckoutLicenseResponse)
-> Lens
CheckoutLicenseResponse
CheckoutLicenseResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicenseResponse' {Maybe Text
expiration :: Maybe Text
$sel:expiration:CheckoutLicenseResponse' :: CheckoutLicenseResponse -> Maybe Text
expiration} -> Maybe Text
expiration) (\s :: CheckoutLicenseResponse
s@CheckoutLicenseResponse' {} Maybe Text
a -> CheckoutLicenseResponse
s {$sel:expiration:CheckoutLicenseResponse' :: Maybe Text
expiration = Maybe Text
a} :: CheckoutLicenseResponse)
checkoutLicenseResponse_signedToken :: Lens.Lens' CheckoutLicenseResponse (Prelude.Maybe Prelude.Text)
checkoutLicenseResponse_signedToken :: (Maybe Text -> f (Maybe Text))
-> CheckoutLicenseResponse -> f CheckoutLicenseResponse
checkoutLicenseResponse_signedToken = (CheckoutLicenseResponse -> Maybe Text)
-> (CheckoutLicenseResponse
-> Maybe Text -> CheckoutLicenseResponse)
-> Lens
CheckoutLicenseResponse
CheckoutLicenseResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicenseResponse' {Maybe Text
signedToken :: Maybe Text
$sel:signedToken:CheckoutLicenseResponse' :: CheckoutLicenseResponse -> Maybe Text
signedToken} -> Maybe Text
signedToken) (\s :: CheckoutLicenseResponse
s@CheckoutLicenseResponse' {} Maybe Text
a -> CheckoutLicenseResponse
s {$sel:signedToken:CheckoutLicenseResponse' :: Maybe Text
signedToken = Maybe Text
a} :: CheckoutLicenseResponse)
checkoutLicenseResponse_licenseConsumptionToken :: Lens.Lens' CheckoutLicenseResponse (Prelude.Maybe Prelude.Text)
checkoutLicenseResponse_licenseConsumptionToken :: (Maybe Text -> f (Maybe Text))
-> CheckoutLicenseResponse -> f CheckoutLicenseResponse
checkoutLicenseResponse_licenseConsumptionToken = (CheckoutLicenseResponse -> Maybe Text)
-> (CheckoutLicenseResponse
-> Maybe Text -> CheckoutLicenseResponse)
-> Lens
CheckoutLicenseResponse
CheckoutLicenseResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicenseResponse' {Maybe Text
licenseConsumptionToken :: Maybe Text
$sel:licenseConsumptionToken:CheckoutLicenseResponse' :: CheckoutLicenseResponse -> Maybe Text
licenseConsumptionToken} -> Maybe Text
licenseConsumptionToken) (\s :: CheckoutLicenseResponse
s@CheckoutLicenseResponse' {} Maybe Text
a -> CheckoutLicenseResponse
s {$sel:licenseConsumptionToken:CheckoutLicenseResponse' :: Maybe Text
licenseConsumptionToken = Maybe Text
a} :: CheckoutLicenseResponse)
checkoutLicenseResponse_nodeId :: Lens.Lens' CheckoutLicenseResponse (Prelude.Maybe Prelude.Text)
checkoutLicenseResponse_nodeId :: (Maybe Text -> f (Maybe Text))
-> CheckoutLicenseResponse -> f CheckoutLicenseResponse
checkoutLicenseResponse_nodeId = (CheckoutLicenseResponse -> Maybe Text)
-> (CheckoutLicenseResponse
-> Maybe Text -> CheckoutLicenseResponse)
-> Lens
CheckoutLicenseResponse
CheckoutLicenseResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicenseResponse' {Maybe Text
nodeId :: Maybe Text
$sel:nodeId:CheckoutLicenseResponse' :: CheckoutLicenseResponse -> Maybe Text
nodeId} -> Maybe Text
nodeId) (\s :: CheckoutLicenseResponse
s@CheckoutLicenseResponse' {} Maybe Text
a -> CheckoutLicenseResponse
s {$sel:nodeId:CheckoutLicenseResponse' :: Maybe Text
nodeId = Maybe Text
a} :: CheckoutLicenseResponse)
checkoutLicenseResponse_issuedAt :: Lens.Lens' CheckoutLicenseResponse (Prelude.Maybe Prelude.Text)
checkoutLicenseResponse_issuedAt :: (Maybe Text -> f (Maybe Text))
-> CheckoutLicenseResponse -> f CheckoutLicenseResponse
checkoutLicenseResponse_issuedAt = (CheckoutLicenseResponse -> Maybe Text)
-> (CheckoutLicenseResponse
-> Maybe Text -> CheckoutLicenseResponse)
-> Lens
CheckoutLicenseResponse
CheckoutLicenseResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicenseResponse' {Maybe Text
issuedAt :: Maybe Text
$sel:issuedAt:CheckoutLicenseResponse' :: CheckoutLicenseResponse -> Maybe Text
issuedAt} -> Maybe Text
issuedAt) (\s :: CheckoutLicenseResponse
s@CheckoutLicenseResponse' {} Maybe Text
a -> CheckoutLicenseResponse
s {$sel:issuedAt:CheckoutLicenseResponse' :: Maybe Text
issuedAt = Maybe Text
a} :: CheckoutLicenseResponse)
checkoutLicenseResponse_licenseArn :: Lens.Lens' CheckoutLicenseResponse (Prelude.Maybe Prelude.Text)
checkoutLicenseResponse_licenseArn :: (Maybe Text -> f (Maybe Text))
-> CheckoutLicenseResponse -> f CheckoutLicenseResponse
checkoutLicenseResponse_licenseArn = (CheckoutLicenseResponse -> Maybe Text)
-> (CheckoutLicenseResponse
-> Maybe Text -> CheckoutLicenseResponse)
-> Lens
CheckoutLicenseResponse
CheckoutLicenseResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicenseResponse' {Maybe Text
licenseArn :: Maybe Text
$sel:licenseArn:CheckoutLicenseResponse' :: CheckoutLicenseResponse -> Maybe Text
licenseArn} -> Maybe Text
licenseArn) (\s :: CheckoutLicenseResponse
s@CheckoutLicenseResponse' {} Maybe Text
a -> CheckoutLicenseResponse
s {$sel:licenseArn:CheckoutLicenseResponse' :: Maybe Text
licenseArn = Maybe Text
a} :: CheckoutLicenseResponse)
checkoutLicenseResponse_httpStatus :: Lens.Lens' CheckoutLicenseResponse Prelude.Int
checkoutLicenseResponse_httpStatus :: (Int -> f Int)
-> CheckoutLicenseResponse -> f CheckoutLicenseResponse
checkoutLicenseResponse_httpStatus = (CheckoutLicenseResponse -> Int)
-> (CheckoutLicenseResponse -> Int -> CheckoutLicenseResponse)
-> Lens CheckoutLicenseResponse CheckoutLicenseResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutLicenseResponse' {Int
httpStatus :: Int
$sel:httpStatus:CheckoutLicenseResponse' :: CheckoutLicenseResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CheckoutLicenseResponse
s@CheckoutLicenseResponse' {} Int
a -> CheckoutLicenseResponse
s {$sel:httpStatus:CheckoutLicenseResponse' :: Int
httpStatus = Int
a} :: CheckoutLicenseResponse)
instance Prelude.NFData CheckoutLicenseResponse