{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.LicenseManager.CheckoutBorrowLicense
-- 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)
--
-- Checks out the specified license for offline use.
module Amazonka.LicenseManager.CheckoutBorrowLicense
  ( -- * Creating a Request
    CheckoutBorrowLicense (..),
    newCheckoutBorrowLicense,

    -- * Request Lenses
    checkoutBorrowLicense_checkoutMetadata,
    checkoutBorrowLicense_nodeId,
    checkoutBorrowLicense_licenseArn,
    checkoutBorrowLicense_entitlements,
    checkoutBorrowLicense_digitalSignatureMethod,
    checkoutBorrowLicense_clientToken,

    -- * Destructuring the Response
    CheckoutBorrowLicenseResponse (..),
    newCheckoutBorrowLicenseResponse,

    -- * Response Lenses
    checkoutBorrowLicenseResponse_entitlementsAllowed,
    checkoutBorrowLicenseResponse_checkoutMetadata,
    checkoutBorrowLicenseResponse_expiration,
    checkoutBorrowLicenseResponse_signedToken,
    checkoutBorrowLicenseResponse_licenseConsumptionToken,
    checkoutBorrowLicenseResponse_nodeId,
    checkoutBorrowLicenseResponse_issuedAt,
    checkoutBorrowLicenseResponse_licenseArn,
    checkoutBorrowLicenseResponse_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

-- | /See:/ 'newCheckoutBorrowLicense' smart constructor.
data CheckoutBorrowLicense = CheckoutBorrowLicense'
  { -- | Information about constraints.
    CheckoutBorrowLicense -> Maybe [Metadata]
checkoutMetadata :: Prelude.Maybe [Metadata],
    -- | Node ID.
    CheckoutBorrowLicense -> Maybe Text
nodeId :: Prelude.Maybe Prelude.Text,
    -- | Amazon Resource Name (ARN) of the license. The license must use the
    -- borrow consumption configuration.
    CheckoutBorrowLicense -> Text
licenseArn :: Prelude.Text,
    -- | License entitlements. Partial checkouts are not supported.
    CheckoutBorrowLicense -> [EntitlementData]
entitlements :: [EntitlementData],
    -- | Digital signature method. The possible value is JSON Web Signature (JWS)
    -- algorithm PS384. For more information, see
    -- <https://tools.ietf.org/html/rfc7518#section-3.5 RFC 7518 Digital Signature with RSASSA-PSS>.
    CheckoutBorrowLicense -> DigitalSignatureMethod
digitalSignatureMethod :: DigitalSignatureMethod,
    -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CheckoutBorrowLicense -> Text
clientToken :: Prelude.Text
  }
  deriving (CheckoutBorrowLicense -> CheckoutBorrowLicense -> Bool
(CheckoutBorrowLicense -> CheckoutBorrowLicense -> Bool)
-> (CheckoutBorrowLicense -> CheckoutBorrowLicense -> Bool)
-> Eq CheckoutBorrowLicense
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CheckoutBorrowLicense -> CheckoutBorrowLicense -> Bool
$c/= :: CheckoutBorrowLicense -> CheckoutBorrowLicense -> Bool
== :: CheckoutBorrowLicense -> CheckoutBorrowLicense -> Bool
$c== :: CheckoutBorrowLicense -> CheckoutBorrowLicense -> Bool
Prelude.Eq, ReadPrec [CheckoutBorrowLicense]
ReadPrec CheckoutBorrowLicense
Int -> ReadS CheckoutBorrowLicense
ReadS [CheckoutBorrowLicense]
(Int -> ReadS CheckoutBorrowLicense)
-> ReadS [CheckoutBorrowLicense]
-> ReadPrec CheckoutBorrowLicense
-> ReadPrec [CheckoutBorrowLicense]
-> Read CheckoutBorrowLicense
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CheckoutBorrowLicense]
$creadListPrec :: ReadPrec [CheckoutBorrowLicense]
readPrec :: ReadPrec CheckoutBorrowLicense
$creadPrec :: ReadPrec CheckoutBorrowLicense
readList :: ReadS [CheckoutBorrowLicense]
$creadList :: ReadS [CheckoutBorrowLicense]
readsPrec :: Int -> ReadS CheckoutBorrowLicense
$creadsPrec :: Int -> ReadS CheckoutBorrowLicense
Prelude.Read, Int -> CheckoutBorrowLicense -> ShowS
[CheckoutBorrowLicense] -> ShowS
CheckoutBorrowLicense -> String
(Int -> CheckoutBorrowLicense -> ShowS)
-> (CheckoutBorrowLicense -> String)
-> ([CheckoutBorrowLicense] -> ShowS)
-> Show CheckoutBorrowLicense
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CheckoutBorrowLicense] -> ShowS
$cshowList :: [CheckoutBorrowLicense] -> ShowS
show :: CheckoutBorrowLicense -> String
$cshow :: CheckoutBorrowLicense -> String
showsPrec :: Int -> CheckoutBorrowLicense -> ShowS
$cshowsPrec :: Int -> CheckoutBorrowLicense -> ShowS
Prelude.Show, (forall x. CheckoutBorrowLicense -> Rep CheckoutBorrowLicense x)
-> (forall x. Rep CheckoutBorrowLicense x -> CheckoutBorrowLicense)
-> Generic CheckoutBorrowLicense
forall x. Rep CheckoutBorrowLicense x -> CheckoutBorrowLicense
forall x. CheckoutBorrowLicense -> Rep CheckoutBorrowLicense x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CheckoutBorrowLicense x -> CheckoutBorrowLicense
$cfrom :: forall x. CheckoutBorrowLicense -> Rep CheckoutBorrowLicense x
Prelude.Generic)

-- |
-- Create a value of 'CheckoutBorrowLicense' 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:
--
-- 'checkoutMetadata', 'checkoutBorrowLicense_checkoutMetadata' - Information about constraints.
--
-- 'nodeId', 'checkoutBorrowLicense_nodeId' - Node ID.
--
-- 'licenseArn', 'checkoutBorrowLicense_licenseArn' - Amazon Resource Name (ARN) of the license. The license must use the
-- borrow consumption configuration.
--
-- 'entitlements', 'checkoutBorrowLicense_entitlements' - License entitlements. Partial checkouts are not supported.
--
-- 'digitalSignatureMethod', 'checkoutBorrowLicense_digitalSignatureMethod' - Digital signature method. The possible value is JSON Web Signature (JWS)
-- algorithm PS384. For more information, see
-- <https://tools.ietf.org/html/rfc7518#section-3.5 RFC 7518 Digital Signature with RSASSA-PSS>.
--
-- 'clientToken', 'checkoutBorrowLicense_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
newCheckoutBorrowLicense ::
  -- | 'licenseArn'
  Prelude.Text ->
  -- | 'digitalSignatureMethod'
  DigitalSignatureMethod ->
  -- | 'clientToken'
  Prelude.Text ->
  CheckoutBorrowLicense
newCheckoutBorrowLicense :: Text -> DigitalSignatureMethod -> Text -> CheckoutBorrowLicense
newCheckoutBorrowLicense
  Text
pLicenseArn_
  DigitalSignatureMethod
pDigitalSignatureMethod_
  Text
pClientToken_ =
    CheckoutBorrowLicense' :: Maybe [Metadata]
-> Maybe Text
-> Text
-> [EntitlementData]
-> DigitalSignatureMethod
-> Text
-> CheckoutBorrowLicense
CheckoutBorrowLicense'
      { $sel:checkoutMetadata:CheckoutBorrowLicense' :: Maybe [Metadata]
checkoutMetadata =
          Maybe [Metadata]
forall a. Maybe a
Prelude.Nothing,
        $sel:nodeId:CheckoutBorrowLicense' :: Maybe Text
nodeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:licenseArn:CheckoutBorrowLicense' :: Text
licenseArn = Text
pLicenseArn_,
        $sel:entitlements:CheckoutBorrowLicense' :: [EntitlementData]
entitlements = [EntitlementData]
forall a. Monoid a => a
Prelude.mempty,
        $sel:digitalSignatureMethod:CheckoutBorrowLicense' :: DigitalSignatureMethod
digitalSignatureMethod = DigitalSignatureMethod
pDigitalSignatureMethod_,
        $sel:clientToken:CheckoutBorrowLicense' :: Text
clientToken = Text
pClientToken_
      }

-- | Information about constraints.
checkoutBorrowLicense_checkoutMetadata :: Lens.Lens' CheckoutBorrowLicense (Prelude.Maybe [Metadata])
checkoutBorrowLicense_checkoutMetadata :: (Maybe [Metadata] -> f (Maybe [Metadata]))
-> CheckoutBorrowLicense -> f CheckoutBorrowLicense
checkoutBorrowLicense_checkoutMetadata = (CheckoutBorrowLicense -> Maybe [Metadata])
-> (CheckoutBorrowLicense
    -> Maybe [Metadata] -> CheckoutBorrowLicense)
-> Lens
     CheckoutBorrowLicense
     CheckoutBorrowLicense
     (Maybe [Metadata])
     (Maybe [Metadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicense' {Maybe [Metadata]
checkoutMetadata :: Maybe [Metadata]
$sel:checkoutMetadata:CheckoutBorrowLicense' :: CheckoutBorrowLicense -> Maybe [Metadata]
checkoutMetadata} -> Maybe [Metadata]
checkoutMetadata) (\s :: CheckoutBorrowLicense
s@CheckoutBorrowLicense' {} Maybe [Metadata]
a -> CheckoutBorrowLicense
s {$sel:checkoutMetadata:CheckoutBorrowLicense' :: Maybe [Metadata]
checkoutMetadata = Maybe [Metadata]
a} :: CheckoutBorrowLicense) ((Maybe [Metadata] -> f (Maybe [Metadata]))
 -> CheckoutBorrowLicense -> f CheckoutBorrowLicense)
-> ((Maybe [Metadata] -> f (Maybe [Metadata]))
    -> Maybe [Metadata] -> f (Maybe [Metadata]))
-> (Maybe [Metadata] -> f (Maybe [Metadata]))
-> CheckoutBorrowLicense
-> f CheckoutBorrowLicense
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Metadata] [Metadata] [Metadata] [Metadata]
-> Iso
     (Maybe [Metadata])
     (Maybe [Metadata])
     (Maybe [Metadata])
     (Maybe [Metadata])
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 [Metadata] [Metadata] [Metadata] [Metadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Node ID.
checkoutBorrowLicense_nodeId :: Lens.Lens' CheckoutBorrowLicense (Prelude.Maybe Prelude.Text)
checkoutBorrowLicense_nodeId :: (Maybe Text -> f (Maybe Text))
-> CheckoutBorrowLicense -> f CheckoutBorrowLicense
checkoutBorrowLicense_nodeId = (CheckoutBorrowLicense -> Maybe Text)
-> (CheckoutBorrowLicense -> Maybe Text -> CheckoutBorrowLicense)
-> Lens
     CheckoutBorrowLicense
     CheckoutBorrowLicense
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicense' {Maybe Text
nodeId :: Maybe Text
$sel:nodeId:CheckoutBorrowLicense' :: CheckoutBorrowLicense -> Maybe Text
nodeId} -> Maybe Text
nodeId) (\s :: CheckoutBorrowLicense
s@CheckoutBorrowLicense' {} Maybe Text
a -> CheckoutBorrowLicense
s {$sel:nodeId:CheckoutBorrowLicense' :: Maybe Text
nodeId = Maybe Text
a} :: CheckoutBorrowLicense)

-- | Amazon Resource Name (ARN) of the license. The license must use the
-- borrow consumption configuration.
checkoutBorrowLicense_licenseArn :: Lens.Lens' CheckoutBorrowLicense Prelude.Text
checkoutBorrowLicense_licenseArn :: (Text -> f Text)
-> CheckoutBorrowLicense -> f CheckoutBorrowLicense
checkoutBorrowLicense_licenseArn = (CheckoutBorrowLicense -> Text)
-> (CheckoutBorrowLicense -> Text -> CheckoutBorrowLicense)
-> Lens CheckoutBorrowLicense CheckoutBorrowLicense Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicense' {Text
licenseArn :: Text
$sel:licenseArn:CheckoutBorrowLicense' :: CheckoutBorrowLicense -> Text
licenseArn} -> Text
licenseArn) (\s :: CheckoutBorrowLicense
s@CheckoutBorrowLicense' {} Text
a -> CheckoutBorrowLicense
s {$sel:licenseArn:CheckoutBorrowLicense' :: Text
licenseArn = Text
a} :: CheckoutBorrowLicense)

-- | License entitlements. Partial checkouts are not supported.
checkoutBorrowLicense_entitlements :: Lens.Lens' CheckoutBorrowLicense [EntitlementData]
checkoutBorrowLicense_entitlements :: ([EntitlementData] -> f [EntitlementData])
-> CheckoutBorrowLicense -> f CheckoutBorrowLicense
checkoutBorrowLicense_entitlements = (CheckoutBorrowLicense -> [EntitlementData])
-> (CheckoutBorrowLicense
    -> [EntitlementData] -> CheckoutBorrowLicense)
-> Lens
     CheckoutBorrowLicense
     CheckoutBorrowLicense
     [EntitlementData]
     [EntitlementData]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicense' {[EntitlementData]
entitlements :: [EntitlementData]
$sel:entitlements:CheckoutBorrowLicense' :: CheckoutBorrowLicense -> [EntitlementData]
entitlements} -> [EntitlementData]
entitlements) (\s :: CheckoutBorrowLicense
s@CheckoutBorrowLicense' {} [EntitlementData]
a -> CheckoutBorrowLicense
s {$sel:entitlements:CheckoutBorrowLicense' :: [EntitlementData]
entitlements = [EntitlementData]
a} :: CheckoutBorrowLicense) (([EntitlementData] -> f [EntitlementData])
 -> CheckoutBorrowLicense -> f CheckoutBorrowLicense)
-> (([EntitlementData] -> f [EntitlementData])
    -> [EntitlementData] -> f [EntitlementData])
-> ([EntitlementData] -> f [EntitlementData])
-> CheckoutBorrowLicense
-> f CheckoutBorrowLicense
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

-- | Digital signature method. The possible value is JSON Web Signature (JWS)
-- algorithm PS384. For more information, see
-- <https://tools.ietf.org/html/rfc7518#section-3.5 RFC 7518 Digital Signature with RSASSA-PSS>.
checkoutBorrowLicense_digitalSignatureMethod :: Lens.Lens' CheckoutBorrowLicense DigitalSignatureMethod
checkoutBorrowLicense_digitalSignatureMethod :: (DigitalSignatureMethod -> f DigitalSignatureMethod)
-> CheckoutBorrowLicense -> f CheckoutBorrowLicense
checkoutBorrowLicense_digitalSignatureMethod = (CheckoutBorrowLicense -> DigitalSignatureMethod)
-> (CheckoutBorrowLicense
    -> DigitalSignatureMethod -> CheckoutBorrowLicense)
-> Lens
     CheckoutBorrowLicense
     CheckoutBorrowLicense
     DigitalSignatureMethod
     DigitalSignatureMethod
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicense' {DigitalSignatureMethod
digitalSignatureMethod :: DigitalSignatureMethod
$sel:digitalSignatureMethod:CheckoutBorrowLicense' :: CheckoutBorrowLicense -> DigitalSignatureMethod
digitalSignatureMethod} -> DigitalSignatureMethod
digitalSignatureMethod) (\s :: CheckoutBorrowLicense
s@CheckoutBorrowLicense' {} DigitalSignatureMethod
a -> CheckoutBorrowLicense
s {$sel:digitalSignatureMethod:CheckoutBorrowLicense' :: DigitalSignatureMethod
digitalSignatureMethod = DigitalSignatureMethod
a} :: CheckoutBorrowLicense)

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
checkoutBorrowLicense_clientToken :: Lens.Lens' CheckoutBorrowLicense Prelude.Text
checkoutBorrowLicense_clientToken :: (Text -> f Text)
-> CheckoutBorrowLicense -> f CheckoutBorrowLicense
checkoutBorrowLicense_clientToken = (CheckoutBorrowLicense -> Text)
-> (CheckoutBorrowLicense -> Text -> CheckoutBorrowLicense)
-> Lens CheckoutBorrowLicense CheckoutBorrowLicense Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicense' {Text
clientToken :: Text
$sel:clientToken:CheckoutBorrowLicense' :: CheckoutBorrowLicense -> Text
clientToken} -> Text
clientToken) (\s :: CheckoutBorrowLicense
s@CheckoutBorrowLicense' {} Text
a -> CheckoutBorrowLicense
s {$sel:clientToken:CheckoutBorrowLicense' :: Text
clientToken = Text
a} :: CheckoutBorrowLicense)

instance Core.AWSRequest CheckoutBorrowLicense where
  type
    AWSResponse CheckoutBorrowLicense =
      CheckoutBorrowLicenseResponse
  request :: CheckoutBorrowLicense -> Request CheckoutBorrowLicense
request = Service -> CheckoutBorrowLicense -> Request CheckoutBorrowLicense
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CheckoutBorrowLicense
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CheckoutBorrowLicense)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CheckoutBorrowLicense))
-> Logger
-> Service
-> Proxy CheckoutBorrowLicense
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CheckoutBorrowLicense)))
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 [Metadata]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutBorrowLicenseResponse
CheckoutBorrowLicenseResponse'
            (Maybe [EntitlementData]
 -> Maybe [Metadata]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CheckoutBorrowLicenseResponse)
-> Either String (Maybe [EntitlementData])
-> Either
     String
     (Maybe [Metadata]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CheckoutBorrowLicenseResponse)
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 [Metadata]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CheckoutBorrowLicenseResponse)
-> Either String (Maybe [Metadata])
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CheckoutBorrowLicenseResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Metadata]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CheckoutMetadata"
                            Either String (Maybe (Maybe [Metadata]))
-> Maybe [Metadata] -> Either String (Maybe [Metadata])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Metadata]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CheckoutBorrowLicenseResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CheckoutBorrowLicenseResponse)
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
   -> CheckoutBorrowLicenseResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CheckoutBorrowLicenseResponse)
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
   -> CheckoutBorrowLicenseResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CheckoutBorrowLicenseResponse)
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
   -> CheckoutBorrowLicenseResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> CheckoutBorrowLicenseResponse)
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 -> CheckoutBorrowLicenseResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> CheckoutBorrowLicenseResponse)
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 -> CheckoutBorrowLicenseResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CheckoutBorrowLicenseResponse)
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 -> CheckoutBorrowLicenseResponse)
-> Either String Int -> Either String CheckoutBorrowLicenseResponse
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 CheckoutBorrowLicense

instance Prelude.NFData CheckoutBorrowLicense

instance Core.ToHeaders CheckoutBorrowLicense where
  toHeaders :: CheckoutBorrowLicense -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CheckoutBorrowLicense -> 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.CheckoutBorrowLicense" ::
                          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 CheckoutBorrowLicense where
  toJSON :: CheckoutBorrowLicense -> Value
toJSON CheckoutBorrowLicense' {[EntitlementData]
Maybe [Metadata]
Maybe Text
Text
DigitalSignatureMethod
clientToken :: Text
digitalSignatureMethod :: DigitalSignatureMethod
entitlements :: [EntitlementData]
licenseArn :: Text
nodeId :: Maybe Text
checkoutMetadata :: Maybe [Metadata]
$sel:clientToken:CheckoutBorrowLicense' :: CheckoutBorrowLicense -> Text
$sel:digitalSignatureMethod:CheckoutBorrowLicense' :: CheckoutBorrowLicense -> DigitalSignatureMethod
$sel:entitlements:CheckoutBorrowLicense' :: CheckoutBorrowLicense -> [EntitlementData]
$sel:licenseArn:CheckoutBorrowLicense' :: CheckoutBorrowLicense -> Text
$sel:nodeId:CheckoutBorrowLicense' :: CheckoutBorrowLicense -> Maybe Text
$sel:checkoutMetadata:CheckoutBorrowLicense' :: CheckoutBorrowLicense -> Maybe [Metadata]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CheckoutMetadata" Text -> [Metadata] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Metadata] -> Pair) -> Maybe [Metadata] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Metadata]
checkoutMetadata,
            (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LicenseArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
licenseArn),
            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
"DigitalSignatureMethod"
                  Text -> DigitalSignatureMethod -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DigitalSignatureMethod
digitalSignatureMethod
              ),
            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 CheckoutBorrowLicense where
  toPath :: CheckoutBorrowLicense -> ByteString
toPath = ByteString -> CheckoutBorrowLicense -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newCheckoutBorrowLicenseResponse' smart constructor.
data CheckoutBorrowLicenseResponse = CheckoutBorrowLicenseResponse'
  { -- | Allowed license entitlements.
    CheckoutBorrowLicenseResponse -> Maybe [EntitlementData]
entitlementsAllowed :: Prelude.Maybe [EntitlementData],
    -- | Information about constraints.
    CheckoutBorrowLicenseResponse -> Maybe [Metadata]
checkoutMetadata :: Prelude.Maybe [Metadata],
    -- | Date and time at which the license checkout expires.
    CheckoutBorrowLicenseResponse -> Maybe Text
expiration :: Prelude.Maybe Prelude.Text,
    -- | Signed token.
    CheckoutBorrowLicenseResponse -> Maybe Text
signedToken :: Prelude.Maybe Prelude.Text,
    -- | License consumption token.
    CheckoutBorrowLicenseResponse -> Maybe Text
licenseConsumptionToken :: Prelude.Maybe Prelude.Text,
    -- | Node ID.
    CheckoutBorrowLicenseResponse -> Maybe Text
nodeId :: Prelude.Maybe Prelude.Text,
    -- | Date and time at which the license checkout is issued.
    CheckoutBorrowLicenseResponse -> Maybe Text
issuedAt :: Prelude.Maybe Prelude.Text,
    -- | Amazon Resource Name (ARN) of the license.
    CheckoutBorrowLicenseResponse -> Maybe Text
licenseArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CheckoutBorrowLicenseResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CheckoutBorrowLicenseResponse
-> CheckoutBorrowLicenseResponse -> Bool
(CheckoutBorrowLicenseResponse
 -> CheckoutBorrowLicenseResponse -> Bool)
-> (CheckoutBorrowLicenseResponse
    -> CheckoutBorrowLicenseResponse -> Bool)
-> Eq CheckoutBorrowLicenseResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CheckoutBorrowLicenseResponse
-> CheckoutBorrowLicenseResponse -> Bool
$c/= :: CheckoutBorrowLicenseResponse
-> CheckoutBorrowLicenseResponse -> Bool
== :: CheckoutBorrowLicenseResponse
-> CheckoutBorrowLicenseResponse -> Bool
$c== :: CheckoutBorrowLicenseResponse
-> CheckoutBorrowLicenseResponse -> Bool
Prelude.Eq, ReadPrec [CheckoutBorrowLicenseResponse]
ReadPrec CheckoutBorrowLicenseResponse
Int -> ReadS CheckoutBorrowLicenseResponse
ReadS [CheckoutBorrowLicenseResponse]
(Int -> ReadS CheckoutBorrowLicenseResponse)
-> ReadS [CheckoutBorrowLicenseResponse]
-> ReadPrec CheckoutBorrowLicenseResponse
-> ReadPrec [CheckoutBorrowLicenseResponse]
-> Read CheckoutBorrowLicenseResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CheckoutBorrowLicenseResponse]
$creadListPrec :: ReadPrec [CheckoutBorrowLicenseResponse]
readPrec :: ReadPrec CheckoutBorrowLicenseResponse
$creadPrec :: ReadPrec CheckoutBorrowLicenseResponse
readList :: ReadS [CheckoutBorrowLicenseResponse]
$creadList :: ReadS [CheckoutBorrowLicenseResponse]
readsPrec :: Int -> ReadS CheckoutBorrowLicenseResponse
$creadsPrec :: Int -> ReadS CheckoutBorrowLicenseResponse
Prelude.Read, Int -> CheckoutBorrowLicenseResponse -> ShowS
[CheckoutBorrowLicenseResponse] -> ShowS
CheckoutBorrowLicenseResponse -> String
(Int -> CheckoutBorrowLicenseResponse -> ShowS)
-> (CheckoutBorrowLicenseResponse -> String)
-> ([CheckoutBorrowLicenseResponse] -> ShowS)
-> Show CheckoutBorrowLicenseResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CheckoutBorrowLicenseResponse] -> ShowS
$cshowList :: [CheckoutBorrowLicenseResponse] -> ShowS
show :: CheckoutBorrowLicenseResponse -> String
$cshow :: CheckoutBorrowLicenseResponse -> String
showsPrec :: Int -> CheckoutBorrowLicenseResponse -> ShowS
$cshowsPrec :: Int -> CheckoutBorrowLicenseResponse -> ShowS
Prelude.Show, (forall x.
 CheckoutBorrowLicenseResponse
 -> Rep CheckoutBorrowLicenseResponse x)
-> (forall x.
    Rep CheckoutBorrowLicenseResponse x
    -> CheckoutBorrowLicenseResponse)
-> Generic CheckoutBorrowLicenseResponse
forall x.
Rep CheckoutBorrowLicenseResponse x
-> CheckoutBorrowLicenseResponse
forall x.
CheckoutBorrowLicenseResponse
-> Rep CheckoutBorrowLicenseResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CheckoutBorrowLicenseResponse x
-> CheckoutBorrowLicenseResponse
$cfrom :: forall x.
CheckoutBorrowLicenseResponse
-> Rep CheckoutBorrowLicenseResponse x
Prelude.Generic)

-- |
-- Create a value of 'CheckoutBorrowLicenseResponse' 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:
--
-- 'entitlementsAllowed', 'checkoutBorrowLicenseResponse_entitlementsAllowed' - Allowed license entitlements.
--
-- 'checkoutMetadata', 'checkoutBorrowLicenseResponse_checkoutMetadata' - Information about constraints.
--
-- 'expiration', 'checkoutBorrowLicenseResponse_expiration' - Date and time at which the license checkout expires.
--
-- 'signedToken', 'checkoutBorrowLicenseResponse_signedToken' - Signed token.
--
-- 'licenseConsumptionToken', 'checkoutBorrowLicenseResponse_licenseConsumptionToken' - License consumption token.
--
-- 'nodeId', 'checkoutBorrowLicenseResponse_nodeId' - Node ID.
--
-- 'issuedAt', 'checkoutBorrowLicenseResponse_issuedAt' - Date and time at which the license checkout is issued.
--
-- 'licenseArn', 'checkoutBorrowLicenseResponse_licenseArn' - Amazon Resource Name (ARN) of the license.
--
-- 'httpStatus', 'checkoutBorrowLicenseResponse_httpStatus' - The response's http status code.
newCheckoutBorrowLicenseResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CheckoutBorrowLicenseResponse
newCheckoutBorrowLicenseResponse :: Int -> CheckoutBorrowLicenseResponse
newCheckoutBorrowLicenseResponse Int
pHttpStatus_ =
  CheckoutBorrowLicenseResponse' :: Maybe [EntitlementData]
-> Maybe [Metadata]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CheckoutBorrowLicenseResponse
CheckoutBorrowLicenseResponse'
    { $sel:entitlementsAllowed:CheckoutBorrowLicenseResponse' :: Maybe [EntitlementData]
entitlementsAllowed =
        Maybe [EntitlementData]
forall a. Maybe a
Prelude.Nothing,
      $sel:checkoutMetadata:CheckoutBorrowLicenseResponse' :: Maybe [Metadata]
checkoutMetadata = Maybe [Metadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:expiration:CheckoutBorrowLicenseResponse' :: Maybe Text
expiration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:signedToken:CheckoutBorrowLicenseResponse' :: Maybe Text
signedToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:licenseConsumptionToken:CheckoutBorrowLicenseResponse' :: Maybe Text
licenseConsumptionToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nodeId:CheckoutBorrowLicenseResponse' :: Maybe Text
nodeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:issuedAt:CheckoutBorrowLicenseResponse' :: Maybe Text
issuedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:licenseArn:CheckoutBorrowLicenseResponse' :: Maybe Text
licenseArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CheckoutBorrowLicenseResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Allowed license entitlements.
checkoutBorrowLicenseResponse_entitlementsAllowed :: Lens.Lens' CheckoutBorrowLicenseResponse (Prelude.Maybe [EntitlementData])
checkoutBorrowLicenseResponse_entitlementsAllowed :: (Maybe [EntitlementData] -> f (Maybe [EntitlementData]))
-> CheckoutBorrowLicenseResponse -> f CheckoutBorrowLicenseResponse
checkoutBorrowLicenseResponse_entitlementsAllowed = (CheckoutBorrowLicenseResponse -> Maybe [EntitlementData])
-> (CheckoutBorrowLicenseResponse
    -> Maybe [EntitlementData] -> CheckoutBorrowLicenseResponse)
-> Lens
     CheckoutBorrowLicenseResponse
     CheckoutBorrowLicenseResponse
     (Maybe [EntitlementData])
     (Maybe [EntitlementData])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicenseResponse' {Maybe [EntitlementData]
entitlementsAllowed :: Maybe [EntitlementData]
$sel:entitlementsAllowed:CheckoutBorrowLicenseResponse' :: CheckoutBorrowLicenseResponse -> Maybe [EntitlementData]
entitlementsAllowed} -> Maybe [EntitlementData]
entitlementsAllowed) (\s :: CheckoutBorrowLicenseResponse
s@CheckoutBorrowLicenseResponse' {} Maybe [EntitlementData]
a -> CheckoutBorrowLicenseResponse
s {$sel:entitlementsAllowed:CheckoutBorrowLicenseResponse' :: Maybe [EntitlementData]
entitlementsAllowed = Maybe [EntitlementData]
a} :: CheckoutBorrowLicenseResponse) ((Maybe [EntitlementData] -> f (Maybe [EntitlementData]))
 -> CheckoutBorrowLicenseResponse
 -> f CheckoutBorrowLicenseResponse)
-> ((Maybe [EntitlementData] -> f (Maybe [EntitlementData]))
    -> Maybe [EntitlementData] -> f (Maybe [EntitlementData]))
-> (Maybe [EntitlementData] -> f (Maybe [EntitlementData]))
-> CheckoutBorrowLicenseResponse
-> f CheckoutBorrowLicenseResponse
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

-- | Information about constraints.
checkoutBorrowLicenseResponse_checkoutMetadata :: Lens.Lens' CheckoutBorrowLicenseResponse (Prelude.Maybe [Metadata])
checkoutBorrowLicenseResponse_checkoutMetadata :: (Maybe [Metadata] -> f (Maybe [Metadata]))
-> CheckoutBorrowLicenseResponse -> f CheckoutBorrowLicenseResponse
checkoutBorrowLicenseResponse_checkoutMetadata = (CheckoutBorrowLicenseResponse -> Maybe [Metadata])
-> (CheckoutBorrowLicenseResponse
    -> Maybe [Metadata] -> CheckoutBorrowLicenseResponse)
-> Lens
     CheckoutBorrowLicenseResponse
     CheckoutBorrowLicenseResponse
     (Maybe [Metadata])
     (Maybe [Metadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicenseResponse' {Maybe [Metadata]
checkoutMetadata :: Maybe [Metadata]
$sel:checkoutMetadata:CheckoutBorrowLicenseResponse' :: CheckoutBorrowLicenseResponse -> Maybe [Metadata]
checkoutMetadata} -> Maybe [Metadata]
checkoutMetadata) (\s :: CheckoutBorrowLicenseResponse
s@CheckoutBorrowLicenseResponse' {} Maybe [Metadata]
a -> CheckoutBorrowLicenseResponse
s {$sel:checkoutMetadata:CheckoutBorrowLicenseResponse' :: Maybe [Metadata]
checkoutMetadata = Maybe [Metadata]
a} :: CheckoutBorrowLicenseResponse) ((Maybe [Metadata] -> f (Maybe [Metadata]))
 -> CheckoutBorrowLicenseResponse
 -> f CheckoutBorrowLicenseResponse)
-> ((Maybe [Metadata] -> f (Maybe [Metadata]))
    -> Maybe [Metadata] -> f (Maybe [Metadata]))
-> (Maybe [Metadata] -> f (Maybe [Metadata]))
-> CheckoutBorrowLicenseResponse
-> f CheckoutBorrowLicenseResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Metadata] [Metadata] [Metadata] [Metadata]
-> Iso
     (Maybe [Metadata])
     (Maybe [Metadata])
     (Maybe [Metadata])
     (Maybe [Metadata])
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 [Metadata] [Metadata] [Metadata] [Metadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Date and time at which the license checkout expires.
checkoutBorrowLicenseResponse_expiration :: Lens.Lens' CheckoutBorrowLicenseResponse (Prelude.Maybe Prelude.Text)
checkoutBorrowLicenseResponse_expiration :: (Maybe Text -> f (Maybe Text))
-> CheckoutBorrowLicenseResponse -> f CheckoutBorrowLicenseResponse
checkoutBorrowLicenseResponse_expiration = (CheckoutBorrowLicenseResponse -> Maybe Text)
-> (CheckoutBorrowLicenseResponse
    -> Maybe Text -> CheckoutBorrowLicenseResponse)
-> Lens
     CheckoutBorrowLicenseResponse
     CheckoutBorrowLicenseResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicenseResponse' {Maybe Text
expiration :: Maybe Text
$sel:expiration:CheckoutBorrowLicenseResponse' :: CheckoutBorrowLicenseResponse -> Maybe Text
expiration} -> Maybe Text
expiration) (\s :: CheckoutBorrowLicenseResponse
s@CheckoutBorrowLicenseResponse' {} Maybe Text
a -> CheckoutBorrowLicenseResponse
s {$sel:expiration:CheckoutBorrowLicenseResponse' :: Maybe Text
expiration = Maybe Text
a} :: CheckoutBorrowLicenseResponse)

-- | Signed token.
checkoutBorrowLicenseResponse_signedToken :: Lens.Lens' CheckoutBorrowLicenseResponse (Prelude.Maybe Prelude.Text)
checkoutBorrowLicenseResponse_signedToken :: (Maybe Text -> f (Maybe Text))
-> CheckoutBorrowLicenseResponse -> f CheckoutBorrowLicenseResponse
checkoutBorrowLicenseResponse_signedToken = (CheckoutBorrowLicenseResponse -> Maybe Text)
-> (CheckoutBorrowLicenseResponse
    -> Maybe Text -> CheckoutBorrowLicenseResponse)
-> Lens
     CheckoutBorrowLicenseResponse
     CheckoutBorrowLicenseResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicenseResponse' {Maybe Text
signedToken :: Maybe Text
$sel:signedToken:CheckoutBorrowLicenseResponse' :: CheckoutBorrowLicenseResponse -> Maybe Text
signedToken} -> Maybe Text
signedToken) (\s :: CheckoutBorrowLicenseResponse
s@CheckoutBorrowLicenseResponse' {} Maybe Text
a -> CheckoutBorrowLicenseResponse
s {$sel:signedToken:CheckoutBorrowLicenseResponse' :: Maybe Text
signedToken = Maybe Text
a} :: CheckoutBorrowLicenseResponse)

-- | License consumption token.
checkoutBorrowLicenseResponse_licenseConsumptionToken :: Lens.Lens' CheckoutBorrowLicenseResponse (Prelude.Maybe Prelude.Text)
checkoutBorrowLicenseResponse_licenseConsumptionToken :: (Maybe Text -> f (Maybe Text))
-> CheckoutBorrowLicenseResponse -> f CheckoutBorrowLicenseResponse
checkoutBorrowLicenseResponse_licenseConsumptionToken = (CheckoutBorrowLicenseResponse -> Maybe Text)
-> (CheckoutBorrowLicenseResponse
    -> Maybe Text -> CheckoutBorrowLicenseResponse)
-> Lens
     CheckoutBorrowLicenseResponse
     CheckoutBorrowLicenseResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicenseResponse' {Maybe Text
licenseConsumptionToken :: Maybe Text
$sel:licenseConsumptionToken:CheckoutBorrowLicenseResponse' :: CheckoutBorrowLicenseResponse -> Maybe Text
licenseConsumptionToken} -> Maybe Text
licenseConsumptionToken) (\s :: CheckoutBorrowLicenseResponse
s@CheckoutBorrowLicenseResponse' {} Maybe Text
a -> CheckoutBorrowLicenseResponse
s {$sel:licenseConsumptionToken:CheckoutBorrowLicenseResponse' :: Maybe Text
licenseConsumptionToken = Maybe Text
a} :: CheckoutBorrowLicenseResponse)

-- | Node ID.
checkoutBorrowLicenseResponse_nodeId :: Lens.Lens' CheckoutBorrowLicenseResponse (Prelude.Maybe Prelude.Text)
checkoutBorrowLicenseResponse_nodeId :: (Maybe Text -> f (Maybe Text))
-> CheckoutBorrowLicenseResponse -> f CheckoutBorrowLicenseResponse
checkoutBorrowLicenseResponse_nodeId = (CheckoutBorrowLicenseResponse -> Maybe Text)
-> (CheckoutBorrowLicenseResponse
    -> Maybe Text -> CheckoutBorrowLicenseResponse)
-> Lens
     CheckoutBorrowLicenseResponse
     CheckoutBorrowLicenseResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicenseResponse' {Maybe Text
nodeId :: Maybe Text
$sel:nodeId:CheckoutBorrowLicenseResponse' :: CheckoutBorrowLicenseResponse -> Maybe Text
nodeId} -> Maybe Text
nodeId) (\s :: CheckoutBorrowLicenseResponse
s@CheckoutBorrowLicenseResponse' {} Maybe Text
a -> CheckoutBorrowLicenseResponse
s {$sel:nodeId:CheckoutBorrowLicenseResponse' :: Maybe Text
nodeId = Maybe Text
a} :: CheckoutBorrowLicenseResponse)

-- | Date and time at which the license checkout is issued.
checkoutBorrowLicenseResponse_issuedAt :: Lens.Lens' CheckoutBorrowLicenseResponse (Prelude.Maybe Prelude.Text)
checkoutBorrowLicenseResponse_issuedAt :: (Maybe Text -> f (Maybe Text))
-> CheckoutBorrowLicenseResponse -> f CheckoutBorrowLicenseResponse
checkoutBorrowLicenseResponse_issuedAt = (CheckoutBorrowLicenseResponse -> Maybe Text)
-> (CheckoutBorrowLicenseResponse
    -> Maybe Text -> CheckoutBorrowLicenseResponse)
-> Lens
     CheckoutBorrowLicenseResponse
     CheckoutBorrowLicenseResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CheckoutBorrowLicenseResponse' {Maybe Text
issuedAt :: Maybe Text
$sel:issuedAt:CheckoutBorrowLicenseResponse' :: CheckoutBorrowLicenseResponse -> Maybe Text
issuedAt} -> Maybe Text
issuedAt) (\s :: CheckoutBorrowLicenseResponse
s@CheckoutBorrowLicenseResponse' {} Maybe Text
a -> CheckoutBorrowLicenseResponse
s {$sel:issuedAt:CheckoutBorrowLicenseResponse' :: Maybe Text
issuedAt = Maybe Text
a} :: CheckoutBorrowLicenseResponse)

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

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

instance Prelude.NFData CheckoutBorrowLicenseResponse