Class: Orb::Models::CouponCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/orb/models/coupon_create_params.rb,
sig/orb/models/coupon_create_params.rbs

Overview

See Also:

  • Orb::Resources::Coupons#create

Defined Under Namespace

Modules: Discount

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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

#initializeObject



24
# File 'sig/orb/models/coupon_create_params.rbs', line 24

def initialize: (

Instance Attribute Details

#discountOrb::Models::CouponCreateParams::Discount::Percentage, Orb::Models::CouponCreateParams::Discount::Amount

Parameters:

  • value (Orb::Models::CouponCreateParams::discount)

Returns:



13
# File 'lib/orb/models/coupon_create_params.rb', line 13

required :discount, union: -> { Orb::CouponCreateParams::Discount }

#duration_in_monthsInteger?

This allows for a coupon's discount to apply for a limited time (determined in months); a null value here means "unlimited time".

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


26
# File 'lib/orb/models/coupon_create_params.rb', line 26

optional :duration_in_months, Integer, nil?: true

#max_redemptionsInteger?

The maximum number of redemptions allowed for this coupon before it is exhausted;null here means "unlimited".

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


33
# File 'lib/orb/models/coupon_create_params.rb', line 33

optional :max_redemptions, Integer, nil?: true

#redemption_codeString

This string can be used to redeem this coupon for a given subscription.

Parameters:

  • value (String)

Returns:

  • (String)


19
# File 'lib/orb/models/coupon_create_params.rb', line 19

required :redemption_code, String

Instance Method Details

#to_hash{

Returns:

  • ({)


32
# File 'sig/orb/models/coupon_create_params.rbs', line 32

def to_hash: -> {