Class: Stigg::Models::V1::PlanCreateParams::DefaultTrialConfig

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/stigg/models/v1/plan_create_params.rb

Defined Under Namespace

Modules: TrialEndBehavior, Units Classes: Budget

Instance Attribute Summary collapse

Class Method 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(has_soft_limit:, limit:) ⇒ Object

Budget configuration for the trial

Parameters:

  • has_soft_limit (Boolean)

    Whether the budget limit is a soft limit (allows overage) or hard limit

  • limit (Float)

    The budget limit amount



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/stigg/models/v1/plan_create_params.rb', line 100

class DefaultTrialConfig < Stigg::Internal::Type::BaseModel
  # @!attribute duration
  #   The duration of the trial in the specified units
  #
  #   @return [Float]
  required :duration, Float

  # @!attribute units
  #   The time unit for the trial duration (DAY or MONTH)
  #
  #   @return [Symbol, Stigg::Models::V1::PlanCreateParams::DefaultTrialConfig::Units]
  required :units, enum: -> { Stigg::V1::PlanCreateParams::DefaultTrialConfig::Units }

  # @!attribute budget
  #   Budget configuration for the trial
  #
  #   @return [Stigg::Models::V1::PlanCreateParams::DefaultTrialConfig::Budget, nil]
  optional :budget, -> { Stigg::V1::PlanCreateParams::DefaultTrialConfig::Budget }, nil?: true

  # @!attribute trial_end_behavior
  #   Behavior when the trial ends (CONVERT_TO_PAID or CANCEL_SUBSCRIPTION)
  #
  #   @return [Symbol, Stigg::Models::V1::PlanCreateParams::DefaultTrialConfig::TrialEndBehavior, nil]
  optional :trial_end_behavior,
           enum: -> { Stigg::V1::PlanCreateParams::DefaultTrialConfig::TrialEndBehavior },
           api_name: :trialEndBehavior,
           nil?: true

  # @!method initialize(duration:, units:, budget: nil, trial_end_behavior: nil)
  #   Default trial configuration for the plan
  #
  #   @param duration [Float] The duration of the trial in the specified units
  #
  #   @param units [Symbol, Stigg::Models::V1::PlanCreateParams::DefaultTrialConfig::Units] The time unit for the trial duration (DAY or MONTH)
  #
  #   @param budget [Stigg::Models::V1::PlanCreateParams::DefaultTrialConfig::Budget, nil] Budget configuration for the trial
  #
  #   @param trial_end_behavior [Symbol, Stigg::Models::V1::PlanCreateParams::DefaultTrialConfig::TrialEndBehavior, nil] Behavior when the trial ends (CONVERT_TO_PAID or CANCEL_SUBSCRIPTION)

  # The time unit for the trial duration (DAY or MONTH)
  #
  # @see Stigg::Models::V1::PlanCreateParams::DefaultTrialConfig#units
  module Units
    extend Stigg::Internal::Type::Enum

    DAY = :DAY
    MONTH = :MONTH

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # @see Stigg::Models::V1::PlanCreateParams::DefaultTrialConfig#budget
  class Budget < Stigg::Internal::Type::BaseModel
    # @!attribute has_soft_limit
    #   Whether the budget limit is a soft limit (allows overage) or hard limit
    #
    #   @return [Boolean]
    required :has_soft_limit, Stigg::Internal::Type::Boolean, api_name: :hasSoftLimit

    # @!attribute limit
    #   The budget limit amount
    #
    #   @return [Float]
    required :limit, Float

    # @!method initialize(has_soft_limit:, limit:)
    #   Budget configuration for the trial
    #
    #   @param has_soft_limit [Boolean] Whether the budget limit is a soft limit (allows overage) or hard limit
    #
    #   @param limit [Float] The budget limit amount
  end

  # Behavior when the trial ends (CONVERT_TO_PAID or CANCEL_SUBSCRIPTION)
  #
  # @see Stigg::Models::V1::PlanCreateParams::DefaultTrialConfig#trial_end_behavior
  module TrialEndBehavior
    extend Stigg::Internal::Type::Enum

    CONVERT_TO_PAID = :CONVERT_TO_PAID
    CANCEL_SUBSCRIPTION = :CANCEL_SUBSCRIPTION

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#budgetStigg::Models::V1::PlanCreateParams::DefaultTrialConfig::Budget?

Budget configuration for the trial



117
# File 'lib/stigg/models/v1/plan_create_params.rb', line 117

optional :budget, -> { Stigg::V1::PlanCreateParams::DefaultTrialConfig::Budget }, nil?: true

#durationFloat

The duration of the trial in the specified units

Returns:

  • (Float)


105
# File 'lib/stigg/models/v1/plan_create_params.rb', line 105

required :duration, Float

#trial_end_behaviorSymbol, ...

Behavior when the trial ends (CONVERT_TO_PAID or CANCEL_SUBSCRIPTION)



123
124
125
126
# File 'lib/stigg/models/v1/plan_create_params.rb', line 123

optional :trial_end_behavior,
enum: -> { Stigg::V1::PlanCreateParams::DefaultTrialConfig::TrialEndBehavior },
api_name: :trialEndBehavior,
nil?: true

#unitsSymbol, Stigg::Models::V1::PlanCreateParams::DefaultTrialConfig::Units

The time unit for the trial duration (DAY or MONTH)



111
# File 'lib/stigg/models/v1/plan_create_params.rb', line 111

required :units, enum: -> { Stigg::V1::PlanCreateParams::DefaultTrialConfig::Units }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/stigg/models/v1/plan_create_params.rb', line 148