Class: PaysecureApiDocumentationLive::Mandate4

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paysecure_api_documentation_live/models/mandate4.rb

Overview

Mandate4 Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(status:, frequency:, rule:, value:, total_deducted_amount:, email:, customer_id:, mandate_id:, mandate_max_amount:, amount_variability:, start_date:, recurring_mandate_ids: SKIP, next_mandate_date: SKIP, session_id: SKIP, additional_properties: nil) ⇒ Mandate4

Returns a new instance of Mandate4.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 102

def initialize(status:, frequency:, rule:, value:, total_deducted_amount:,
               email:, customer_id:, mandate_id:, mandate_max_amount:,
               amount_variability:, start_date:,
               recurring_mandate_ids: SKIP, next_mandate_date: SKIP,
               session_id: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @status = status
  @frequency = frequency
  @rule = rule
  @value = value
  @total_deducted_amount = total_deducted_amount
  @recurring_mandate_ids = recurring_mandate_ids unless recurring_mandate_ids == SKIP
  @email = email
  @next_mandate_date = next_mandate_date unless next_mandate_date == SKIP
  @customer_id = customer_id
  @mandate_id = mandate_id
  @mandate_max_amount = mandate_max_amount
  @amount_variability = amount_variability
  @start_date = start_date
  @session_id = session_id unless session_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#amount_variabilityString

TODO: Write general description for this method

Returns:

  • (String)


58
59
60
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 58

def amount_variability
  @amount_variability
end

#customer_idString

TODO: Write general description for this method

Returns:

  • (String)


46
47
48
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 46

def customer_id
  @customer_id
end

#emailString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 38

def email
  @email
end

#frequencyString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 18

def frequency
  @frequency
end

#mandate_idString

TODO: Write general description for this method

Returns:

  • (String)


50
51
52
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 50

def mandate_id
  @mandate_id
end

#mandate_max_amountInteger

TODO: Write general description for this method

Returns:

  • (Integer)


54
55
56
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 54

def mandate_max_amount
  @mandate_max_amount
end

#next_mandate_dateInteger

TODO: Write general description for this method

Returns:

  • (Integer)


42
43
44
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 42

def next_mandate_date
  @next_mandate_date
end

#recurring_mandate_idsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


34
35
36
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 34

def recurring_mandate_ids
  @recurring_mandate_ids
end

#ruleString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 22

def rule
  @rule
end

#session_idString

TODO: Write general description for this method

Returns:

  • (String)


66
67
68
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 66

def session_id
  @session_id
end

#start_dateString

TODO: Write general description for this method

Returns:

  • (String)


62
63
64
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 62

def start_date
  @start_date
end

#statusString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 14

def status
  @status
end

#total_deducted_amountString

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 30

def total_deducted_amount
  @total_deducted_amount
end

#valueInteger

TODO: Write general description for this method

Returns:

  • (Integer)


26
27
28
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 26

def value
  @value
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 128

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  status = hash.key?('status') ? hash['status'] : nil
  frequency = hash.key?('frequency') ? hash['frequency'] : nil
  rule = hash.key?('rule') ? hash['rule'] : nil
  value = hash.key?('value') ? hash['value'] : nil
  total_deducted_amount =
    hash.key?('totalDeductedAmount') ? hash['totalDeductedAmount'] : nil
  email = hash.key?('email') ? hash['email'] : nil
  customer_id = hash.key?('customer_id') ? hash['customer_id'] : nil
  mandate_id = hash.key?('mandate_id') ? hash['mandate_id'] : nil
  mandate_max_amount =
    hash.key?('mandate_max_amount') ? hash['mandate_max_amount'] : nil
  amount_variability =
    hash.key?('amount_variability') ? hash['amount_variability'] : nil
  start_date = hash.key?('start_date') ? hash['start_date'] : nil
  recurring_mandate_ids =
    hash.key?('recurringMandateIds') ? hash['recurringMandateIds'] : SKIP
  next_mandate_date =
    hash.key?('nextMandateDate') ? hash['nextMandateDate'] : SKIP
  session_id = hash.key?('session_id') ? hash['session_id'] : 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.
  Mandate4.new(status: status,
               frequency: frequency,
               rule: rule,
               value: value,
               total_deducted_amount: total_deducted_amount,
               email: email,
               customer_id: customer_id,
               mandate_id: mandate_id,
               mandate_max_amount: mandate_max_amount,
               amount_variability: amount_variability,
               start_date: start_date,
               recurring_mandate_ids: recurring_mandate_ids,
               next_mandate_date: next_mandate_date,
               session_id: session_id,
               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 69

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['status'] = 'status'
  @_hash['frequency'] = 'frequency'
  @_hash['rule'] = 'rule'
  @_hash['value'] = 'value'
  @_hash['total_deducted_amount'] = 'totalDeductedAmount'
  @_hash['recurring_mandate_ids'] = 'recurringMandateIds'
  @_hash['email'] = 'email'
  @_hash['next_mandate_date'] = 'nextMandateDate'
  @_hash['customer_id'] = 'customer_id'
  @_hash['mandate_id'] = 'mandate_id'
  @_hash['mandate_max_amount'] = 'mandate_max_amount'
  @_hash['amount_variability'] = 'amount_variability'
  @_hash['start_date'] = 'start_date'
  @_hash['session_id'] = 'session_id'
  @_hash
end

.nullablesObject

An array for nullable fields



98
99
100
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 98

def self.nullables
  []
end

.optionalsObject

An array for optional fields



89
90
91
92
93
94
95
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 89

def self.optionals
  %w[
    recurring_mandate_ids
    next_mandate_date
    session_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



190
191
192
193
194
195
196
197
198
199
200
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 190

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status.inspect}, frequency: #{@frequency.inspect}, rule:"\
  " #{@rule.inspect}, value: #{@value.inspect}, total_deducted_amount:"\
  " #{@total_deducted_amount.inspect}, recurring_mandate_ids:"\
  " #{@recurring_mandate_ids.inspect}, email: #{@email.inspect}, next_mandate_date:"\
  " #{@next_mandate_date.inspect}, customer_id: #{@customer_id.inspect}, mandate_id:"\
  " #{@mandate_id.inspect}, mandate_max_amount: #{@mandate_max_amount.inspect},"\
  " amount_variability: #{@amount_variability.inspect}, start_date: #{@start_date.inspect},"\
  " session_id: #{@session_id.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



178
179
180
181
182
183
184
185
186
187
# File 'lib/paysecure_api_documentation_live/models/mandate4.rb', line 178

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status}, frequency: #{@frequency}, rule: #{@rule}, value:"\
  " #{@value}, total_deducted_amount: #{@total_deducted_amount}, recurring_mandate_ids:"\
  " #{@recurring_mandate_ids}, email: #{@email}, next_mandate_date: #{@next_mandate_date},"\
  " customer_id: #{@customer_id}, mandate_id: #{@mandate_id}, mandate_max_amount:"\
  " #{@mandate_max_amount}, amount_variability: #{@amount_variability}, start_date:"\
  " #{@start_date}, session_id: #{@session_id}, additional_properties:"\
  " #{@additional_properties}>"
end