Class: ApiReference::UpdateTrialRequestParams
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApiReference::UpdateTrialRequestParams
- Defined in:
- lib/api_reference/models/update_trial_request_params.rb
Overview
UpdateTrialRequestParams Model.
Instance Attribute Summary collapse
-
#shift ⇒ TrueClass | FalseClass
If true, shifts subsequent price and adjustment intervals (preserving their durations, but adjusting their absolute dates).
-
#trial_end_date ⇒ Object
The new date that the trial should end, or the literal string
immediateto end the trial immediately.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(trial_end_date:, shift: false) ⇒ UpdateTrialRequestParams
constructor
A new instance of UpdateTrialRequestParams.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_union_type_trial_end_date ⇒ Object
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(trial_end_date:, shift: false) ⇒ UpdateTrialRequestParams
Returns a new instance of UpdateTrialRequestParams.
42 43 44 45 |
# File 'lib/api_reference/models/update_trial_request_params.rb', line 42 def initialize(trial_end_date:, shift: false) @trial_end_date = trial_end_date @shift = shift unless shift == SKIP end |
Instance Attribute Details
#shift ⇒ TrueClass | FalseClass
If true, shifts subsequent price and adjustment intervals (preserving their durations, but adjusting their absolute dates).
20 21 22 |
# File 'lib/api_reference/models/update_trial_request_params.rb', line 20 def shift @shift end |
#trial_end_date ⇒ Object
The new date that the trial should end, or the literal string immediate
to end the trial immediately.
15 16 17 |
# File 'lib/api_reference/models/update_trial_request_params.rb', line 15 def trial_end_date @trial_end_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/api_reference/models/update_trial_request_params.rb', line 48 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. trial_end_date = hash.key?('trial_end_date') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:UpdateTrialRequestParamsTrialEndDate), hash['trial_end_date'] ) : nil shift = hash['shift'] ||= false # Create object from extracted values. UpdateTrialRequestParams.new(trial_end_date: trial_end_date, shift: shift) end |
.names ⇒ Object
A mapping from model property names to API property names.
23 24 25 26 27 28 |
# File 'lib/api_reference/models/update_trial_request_params.rb', line 23 def self.names @_hash = {} if @_hash.nil? @_hash['trial_end_date'] = 'trial_end_date' @_hash['shift'] = 'shift' @_hash end |
.nullables ⇒ Object
An array for nullable fields
38 39 40 |
# File 'lib/api_reference/models/update_trial_request_params.rb', line 38 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
31 32 33 34 35 |
# File 'lib/api_reference/models/update_trial_request_params.rb', line 31 def self.optionals %w[ shift ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/api_reference/models/update_trial_request_params.rb', line 70 def self.validate(value) if value.instance_of? self return UnionTypeLookUp.get(:UpdateTrialRequestParamsTrialEndDate) .validate(value.trial_end_date) end return false unless value.instance_of? Hash UnionTypeLookUp.get(:UpdateTrialRequestParamsTrialEndDate) .validate(value['trial_end_date']) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
89 90 91 92 |
# File 'lib/api_reference/models/update_trial_request_params.rb', line 89 def inspect class_name = self.class.name.split('::').last "<#{class_name} trial_end_date: #{@trial_end_date.inspect}, shift: #{@shift.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
83 84 85 86 |
# File 'lib/api_reference/models/update_trial_request_params.rb', line 83 def to_s class_name = self.class.name.split('::').last "<#{class_name} trial_end_date: #{@trial_end_date}, shift: #{@shift}>" end |
#to_union_type_trial_end_date ⇒ Object
62 63 64 65 66 |
# File 'lib/api_reference/models/update_trial_request_params.rb', line 62 def to_union_type_trial_end_date UnionTypeLookUp.get(:UpdateTrialRequestParamsTrialEndDate) .validate(trial_end_date) .serialize(trial_end_date) end |