Class: ThePlaidApi::PaymentConsentValidDateTime
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::PaymentConsentValidDateTime
- Defined in:
- lib/the_plaid_api/models/payment_consent_valid_date_time.rb
Overview
Life span for the payment consent. After the ‘to` date the payment consent expires and can no longer be used for payment initiation.
Instance Attribute Summary collapse
-
#from ⇒ DateTime
The date and time from which the consent should be active, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format.
-
#to ⇒ DateTime
The date and time at which the consent expires, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format.
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(from: SKIP, to: SKIP, additional_properties: nil) ⇒ PaymentConsentValidDateTime
constructor
A new instance of PaymentConsentValidDateTime.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_from ⇒ Object
- #to_custom_to ⇒ Object
-
#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(from: SKIP, to: SKIP, additional_properties: nil) ⇒ PaymentConsentValidDateTime
Returns a new instance of PaymentConsentValidDateTime.
48 49 50 51 52 53 54 55 |
# File 'lib/the_plaid_api/models/payment_consent_valid_date_time.rb', line 48 def initialize(from: SKIP, to: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @from = from unless from == SKIP @to = to unless to == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#from ⇒ DateTime
The date and time from which the consent should be active, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format.
17 18 19 |
# File 'lib/the_plaid_api/models/payment_consent_valid_date_time.rb', line 17 def from @from end |
#to ⇒ DateTime
The date and time at which the consent expires, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format.
22 23 24 |
# File 'lib/the_plaid_api/models/payment_consent_valid_date_time.rb', line 22 def to @to end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/the_plaid_api/models/payment_consent_valid_date_time.rb', line 58 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. from = if hash.key?('from') (DateTimeHelper.from_rfc3339(hash['from']) if hash['from']) else SKIP end to = if hash.key?('to') (DateTimeHelper.from_rfc3339(hash['to']) if hash['to']) else SKIP end # 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. PaymentConsentValidDateTime.new(from: from, to: to, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 |
# File 'lib/the_plaid_api/models/payment_consent_valid_date_time.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['from'] = 'from' @_hash['to'] = 'to' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 44 45 46 |
# File 'lib/the_plaid_api/models/payment_consent_valid_date_time.rb', line 41 def self.nullables %w[ from to ] end |
.optionals ⇒ Object
An array for optional fields
33 34 35 36 37 38 |
# File 'lib/the_plaid_api/models/payment_consent_valid_date_time.rb', line 33 def self.optionals %w[ from to ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
102 103 104 105 106 |
# File 'lib/the_plaid_api/models/payment_consent_valid_date_time.rb', line 102 def inspect class_name = self.class.name.split('::').last "<#{class_name} from: #{@from.inspect}, to: #{@to.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_from ⇒ Object
86 87 88 |
# File 'lib/the_plaid_api/models/payment_consent_valid_date_time.rb', line 86 def to_custom_from DateTimeHelper.to_rfc3339(from) end |
#to_custom_to ⇒ Object
90 91 92 |
# File 'lib/the_plaid_api/models/payment_consent_valid_date_time.rb', line 90 def to_custom_to DateTimeHelper.to_rfc3339(to) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
95 96 97 98 99 |
# File 'lib/the_plaid_api/models/payment_consent_valid_date_time.rb', line 95 def to_s class_name = self.class.name.split('::').last "<#{class_name} from: #{@from}, to: #{@to}, additional_properties:"\ " #{@additional_properties}>" end |