Class: FdxV660Api::RecurringPaymentDurationEntity2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FdxV660Api::RecurringPaymentDurationEntity2
- Defined in:
- lib/fdx_v660_api/models/recurring_payment_duration_entity2.rb
Overview
Defines how long the payment repeats for
Instance Attribute Summary collapse
-
#end_date ⇒ Date
Last date when a payment is to be sent.
-
#number_of_times ⇒ Float
Maximum number of times a payment is to be sent.
-
#type ⇒ RecurringPaymentDurationType2
Type of duration.
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.
Instance Method Summary collapse
-
#initialize(type:, number_of_times: SKIP, end_date: SKIP, additional_properties: nil) ⇒ RecurringPaymentDurationEntity2
constructor
A new instance of RecurringPaymentDurationEntity2.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the 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(type:, number_of_times: SKIP, end_date: SKIP, additional_properties: nil) ⇒ RecurringPaymentDurationEntity2
Returns a new instance of RecurringPaymentDurationEntity2.
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/fdx_v660_api/models/recurring_payment_duration_entity2.rb', line 47 def initialize(type:, number_of_times: SKIP, end_date: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @type = type @number_of_times = number_of_times unless number_of_times == SKIP @end_date = end_date unless end_date == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#end_date ⇒ Date
Last date when a payment is to be sent. Required if type is set to ENDDATE
23 24 25 |
# File 'lib/fdx_v660_api/models/recurring_payment_duration_entity2.rb', line 23 def end_date @end_date end |
#number_of_times ⇒ Float
Maximum number of times a payment is to be sent. Required if type is set to NUMBEROFTIMES
19 20 21 |
# File 'lib/fdx_v660_api/models/recurring_payment_duration_entity2.rb', line 19 def number_of_times @number_of_times end |
#type ⇒ RecurringPaymentDurationType2
Type of duration
14 15 16 |
# File 'lib/fdx_v660_api/models/recurring_payment_duration_entity2.rb', line 14 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/fdx_v660_api/models/recurring_payment_duration_entity2.rb', line 59 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. type = hash.key?('type') ? hash['type'] : nil number_of_times = hash.key?('numberOfTimes') ? hash['numberOfTimes'] : SKIP end_date = hash.key?('endDate') ? hash['endDate'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. RecurringPaymentDurationEntity2.new(type: type, number_of_times: number_of_times, end_date: end_date, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/fdx_v660_api/models/recurring_payment_duration_entity2.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['type'] = 'type' @_hash['number_of_times'] = 'numberOfTimes' @_hash['end_date'] = 'endDate' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 |
# File 'lib/fdx_v660_api/models/recurring_payment_duration_entity2.rb', line 43 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 40 |
# File 'lib/fdx_v660_api/models/recurring_payment_duration_entity2.rb', line 35 def self.optionals %w[ number_of_times end_date ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
90 91 92 93 94 |
# File 'lib/fdx_v660_api/models/recurring_payment_duration_entity2.rb', line 90 def inspect class_name = self.class.name.split('::').last "<#{class_name} type: #{@type.inspect}, number_of_times: #{@number_of_times.inspect},"\ " end_date: #{@end_date.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
83 84 85 86 87 |
# File 'lib/fdx_v660_api/models/recurring_payment_duration_entity2.rb', line 83 def to_s class_name = self.class.name.split('::').last "<#{class_name} type: #{@type}, number_of_times: #{@number_of_times}, end_date:"\ " #{@end_date}, additional_properties: #{@additional_properties}>" end |