Class: Dodopayments::Models::Entitlements::EntitlementGrant

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/dodopayments/models/entitlements/entitlement_grant.rb

Overview

Direct Known Subclasses

WebhookPayload::Data::EntitlementGrant

Defined Under Namespace

Modules: Status

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, business_id:, created_at:, customer_id:, entitlement_id:, metadata:, status:, updated_at:, delivered_at: nil, digital_product_delivery: nil, error_code: nil, error_message: nil, license_key: nil, oauth_expires_at: nil, oauth_url: nil, payment_id: nil, revocation_reason: nil, revoked_at: nil, subscription_id: nil) ⇒ Object

Some parameter documentations has been truncated, see Dodopayments::Models::Entitlements::EntitlementGrant for more details.

Detailed view of a single entitlement grant: who it’s for, its lifecycle state, and any integration-specific delivery payload.

Parameters:

  • id (String)

    Unique identifier of the grant.

  • business_id (String)

    Identifier of the business that owns the grant.

  • created_at (Time)

    Timestamp when the grant was created.

  • customer_id (String)

    Identifier of the customer the grant was issued to.

  • entitlement_id (String)

    Identifier of the entitlement this grant was issued from.

  • metadata (Hash{Symbol=>String})

    Arbitrary key-value metadata recorded on the grant.

  • status (Symbol, Dodopayments::Models::Entitlements::EntitlementGrant::Status)

    Lifecycle status of the grant.

  • updated_at (Time)

    Timestamp when the grant was last modified.

  • delivered_at (Time, nil) (defaults to: nil)

    Timestamp when the grant transitioned to ‘delivered`, when applicable.

  • digital_product_delivery (Dodopayments::Models::DigitalProductDelivery, nil) (defaults to: nil)

    Digital-product-delivery payload, present when the entitlement

  • error_code (String, nil) (defaults to: nil)

    Machine-readable code reported when delivery failed, when applicable.

  • error_message (String, nil) (defaults to: nil)

    Human-readable message reported when delivery failed, when applicable.

  • license_key (Dodopayments::Models::Entitlements::LicenseKeyGrant, nil) (defaults to: nil)

    License-key delivery payload, present when the entitlement integration

  • oauth_expires_at (Time, nil) (defaults to: nil)

    Timestamp when ‘oauth_url` stops being valid, when applicable.

  • oauth_url (String, nil) (defaults to: nil)

    Customer-facing OAuth URL for OAuth-style integrations. Populated

  • payment_id (String, nil) (defaults to: nil)

    Identifier of the payment that triggered this grant, when applicable.

  • revocation_reason (String, nil) (defaults to: nil)

    Reason recorded when the grant was revoked, when applicable.

  • revoked_at (Time, nil) (defaults to: nil)

    Timestamp when the grant transitioned to ‘revoked`, when applicable.

  • subscription_id (String, nil) (defaults to: nil)

    Identifier of the subscription that triggered this grant, when applicable.



# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 126

Instance Attribute Details

#business_idString

Identifier of the business that owns the grant.

Returns:

  • (String)


18
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 18

required :business_id, String

#created_atTime

Timestamp when the grant was created.

Returns:

  • (Time)


24
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 24

required :created_at, Time

#customer_idString

Identifier of the customer the grant was issued to.

Returns:

  • (String)


30
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 30

required :customer_id, String

#delivered_atTime?

Timestamp when the grant transitioned to ‘delivered`, when applicable.

Returns:

  • (Time, nil)


60
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 60

optional :delivered_at, Time, nil?: true

#digital_product_deliveryDodopayments::Models::DigitalProductDelivery?

Digital-product-delivery payload, present when the entitlement integration is ‘digital_files`.



67
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 67

optional :digital_product_delivery, -> { Dodopayments::DigitalProductDelivery }, nil?: true

#entitlement_idString

Identifier of the entitlement this grant was issued from.

Returns:

  • (String)


36
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 36

required :entitlement_id, String

#error_codeString?

Machine-readable code reported when delivery failed, when applicable.

Returns:

  • (String, nil)


73
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 73

optional :error_code, String, nil?: true

#error_messageString?

Human-readable message reported when delivery failed, when applicable.

Returns:

  • (String, nil)


79
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 79

optional :error_message, String, nil?: true

#idString

Unique identifier of the grant.

Returns:

  • (String)


12
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 12

required :id, String

#license_keyDodopayments::Models::Entitlements::LicenseKeyGrant?

License-key delivery payload, present when the entitlement integration is ‘license_key`.



86
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 86

optional :license_key, -> { Dodopayments::Entitlements::LicenseKeyGrant }, nil?: true

#metadataHash{Symbol=>String}

Arbitrary key-value metadata recorded on the grant.

Returns:

  • (Hash{Symbol=>String})


42
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 42

required :metadata, Dodopayments::Internal::Type::HashOf[String]

#oauth_expires_atTime?

Timestamp when ‘oauth_url` stops being valid, when applicable.

Returns:

  • (Time, nil)


92
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 92

optional :oauth_expires_at, Time, nil?: true

#oauth_urlString?

Customer-facing OAuth URL for OAuth-style integrations. Populated during the customer-portal accept flow; ‘null` until the customer completes that step, and on grants for non-OAuth integrations.

Returns:

  • (String, nil)


100
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 100

optional :oauth_url, String, nil?: true

#payment_idString?

Identifier of the payment that triggered this grant, when applicable.

Returns:

  • (String, nil)


106
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 106

optional :payment_id, String, nil?: true

#revocation_reasonString?

Reason recorded when the grant was revoked, when applicable.

Returns:

  • (String, nil)


112
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 112

optional :revocation_reason, String, nil?: true

#revoked_atTime?

Timestamp when the grant transitioned to ‘revoked`, when applicable.

Returns:

  • (Time, nil)


118
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 118

optional :revoked_at, Time, nil?: true

#statusSymbol, Dodopayments::Models::Entitlements::EntitlementGrant::Status

Lifecycle status of the grant.



48
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 48

required :status, enum: -> { Dodopayments::Entitlements::EntitlementGrant::Status }

#subscription_idString?

Identifier of the subscription that triggered this grant, when applicable.

Returns:

  • (String, nil)


124
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 124

optional :subscription_id, String, nil?: true

#updated_atTime

Timestamp when the grant was last modified.

Returns:

  • (Time)


54
# File 'lib/dodopayments/models/entitlements/entitlement_grant.rb', line 54

required :updated_at, Time