sygna-bridge-ivms-util 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +110 -0
  4. data/Rakefile +10 -0
  5. data/docs/Address.md +47 -0
  6. data/docs/AddressTypeCode.md +16 -0
  7. data/docs/Beneficiary.md +19 -0
  8. data/docs/BeneficiaryVasp.md +17 -0
  9. data/docs/DateAndPlaceOfBirth.md +19 -0
  10. data/docs/DefaultApi.md +49 -0
  11. data/docs/IdentityPayload.md +27 -0
  12. data/docs/IntermediaryVasp.md +19 -0
  13. data/docs/LegalPerson.md +25 -0
  14. data/docs/LegalPersonName.md +21 -0
  15. data/docs/LegalPersonNameId.md +19 -0
  16. data/docs/LegalPersonNameTypeCode.md +16 -0
  17. data/docs/LocalLegalPersonNameId.md +19 -0
  18. data/docs/LocalNaturalPersonNameId.md +21 -0
  19. data/docs/NationalIdentification.md +23 -0
  20. data/docs/NationalIdentifierTypeCode.md +16 -0
  21. data/docs/NaturalPerson.md +27 -0
  22. data/docs/NaturalPersonName.md +21 -0
  23. data/docs/NaturalPersonNameId.md +21 -0
  24. data/docs/NaturalPersonNameTypeCode.md +16 -0
  25. data/docs/OriginatingVasp.md +17 -0
  26. data/docs/Originator.md +19 -0
  27. data/docs/PayloadMetadata.md +17 -0
  28. data/docs/Person.md +19 -0
  29. data/docs/TransliterationMethodCode.md +16 -0
  30. data/git_push.sh +58 -0
  31. data/lib/sygna-bridge-ivms-util.rb +64 -0
  32. data/lib/sygna-bridge-ivms-util/api/default_api.rb +74 -0
  33. data/lib/sygna-bridge-ivms-util/api_client.rb +387 -0
  34. data/lib/sygna-bridge-ivms-util/api_error.rb +57 -0
  35. data/lib/sygna-bridge-ivms-util/configuration.rb +241 -0
  36. data/lib/sygna-bridge-ivms-util/models/address.rb +377 -0
  37. data/lib/sygna-bridge-ivms-util/models/address_type_code.rb +37 -0
  38. data/lib/sygna-bridge-ivms-util/models/beneficiary.rb +219 -0
  39. data/lib/sygna-bridge-ivms-util/models/beneficiary_vasp.rb +206 -0
  40. data/lib/sygna-bridge-ivms-util/models/date_and_place_of_birth.rb +215 -0
  41. data/lib/sygna-bridge-ivms-util/models/identity_payload.rb +253 -0
  42. data/lib/sygna-bridge-ivms-util/models/intermediary_vasp.rb +239 -0
  43. data/lib/sygna-bridge-ivms-util/models/legal_person.rb +244 -0
  44. data/lib/sygna-bridge-ivms-util/models/legal_person_name.rb +230 -0
  45. data/lib/sygna-bridge-ivms-util/models/legal_person_name_id.rb +249 -0
  46. data/lib/sygna-bridge-ivms-util/models/legal_person_name_type_code.rb +37 -0
  47. data/lib/sygna-bridge-ivms-util/models/local_legal_person_name_id.rb +249 -0
  48. data/lib/sygna-bridge-ivms-util/models/local_natural_person_name_id.rb +258 -0
  49. data/lib/sygna-bridge-ivms-util/models/national_identification.rb +267 -0
  50. data/lib/sygna-bridge-ivms-util/models/national_identifier_type_code.rb +44 -0
  51. data/lib/sygna-bridge-ivms-util/models/natural_person.rb +253 -0
  52. data/lib/sygna-bridge-ivms-util/models/natural_person_name.rb +230 -0
  53. data/lib/sygna-bridge-ivms-util/models/natural_person_name_id.rb +258 -0
  54. data/lib/sygna-bridge-ivms-util/models/natural_person_name_type_code.rb +39 -0
  55. data/lib/sygna-bridge-ivms-util/models/originating_vasp.rb +206 -0
  56. data/lib/sygna-bridge-ivms-util/models/originator.rb +219 -0
  57. data/lib/sygna-bridge-ivms-util/models/payload_metadata.rb +230 -0
  58. data/lib/sygna-bridge-ivms-util/models/person.rb +215 -0
  59. data/lib/sygna-bridge-ivms-util/models/transliteration_method_code.rb +47 -0
  60. data/lib/sygna-bridge-ivms-util/version.rb +15 -0
  61. data/spec/api/default_api_spec.rb +44 -0
  62. data/spec/api_client_spec.rb +226 -0
  63. data/spec/configuration_spec.rb +42 -0
  64. data/spec/models/address_spec.rb +135 -0
  65. data/spec/models/address_type_code_spec.rb +35 -0
  66. data/spec/models/beneficiary_spec.rb +47 -0
  67. data/spec/models/beneficiary_vasp_spec.rb +41 -0
  68. data/spec/models/date_and_place_of_birth_spec.rb +47 -0
  69. data/spec/models/identity_payload_spec.rb +71 -0
  70. data/spec/models/intermediary_vasp_spec.rb +47 -0
  71. data/spec/models/legal_person_name_id_spec.rb +51 -0
  72. data/spec/models/legal_person_name_spec.rb +53 -0
  73. data/spec/models/legal_person_name_type_code_spec.rb +35 -0
  74. data/spec/models/legal_person_spec.rb +65 -0
  75. data/spec/models/local_legal_person_name_id_spec.rb +51 -0
  76. data/spec/models/local_natural_person_name_id_spec.rb +57 -0
  77. data/spec/models/national_identification_spec.rb +63 -0
  78. data/spec/models/national_identifier_type_code_spec.rb +35 -0
  79. data/spec/models/natural_person_name_id_spec.rb +57 -0
  80. data/spec/models/natural_person_name_spec.rb +53 -0
  81. data/spec/models/natural_person_name_type_code_spec.rb +35 -0
  82. data/spec/models/natural_person_spec.rb +71 -0
  83. data/spec/models/originating_vasp_spec.rb +41 -0
  84. data/spec/models/originator_spec.rb +47 -0
  85. data/spec/models/payload_metadata_spec.rb +45 -0
  86. data/spec/models/person_spec.rb +47 -0
  87. data/spec/models/transliteration_method_code_spec.rb +35 -0
  88. data/spec/spec_helper.rb +111 -0
  89. data/sygna-bridge-ivms-util.gemspec +39 -0
  90. metadata +219 -0
@@ -0,0 +1,206 @@
1
+ =begin
2
+ #Bridge
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SygnaBridgeIvmsUtil
16
+ class BeneficiaryVasp
17
+ attr_accessor :beneficiary_vasp
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'beneficiary_vasp' => :'beneficiary_vasp'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.openapi_types
28
+ {
29
+ :'beneficiary_vasp' => :'Person'
30
+ }
31
+ end
32
+
33
+ # List of attributes with nullable: true
34
+ def self.openapi_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ if (!attributes.is_a?(Hash))
43
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SygnaBridgeIvmsUtil::BeneficiaryVasp` initialize method"
44
+ end
45
+
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SygnaBridgeIvmsUtil::BeneficiaryVasp`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ end
51
+ h[k.to_sym] = v
52
+ }
53
+
54
+ if attributes.key?(:'beneficiary_vasp')
55
+ self.beneficiary_vasp = attributes[:'beneficiary_vasp']
56
+ end
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ invalid_properties
64
+ end
65
+
66
+ # Check to see if the all the properties in the model are valid
67
+ # @return true if the model is valid
68
+ def valid?
69
+ true
70
+ end
71
+
72
+ # Checks equality by comparing each attribute.
73
+ # @param [Object] Object to be compared
74
+ def ==(o)
75
+ return true if self.equal?(o)
76
+ self.class == o.class &&
77
+ beneficiary_vasp == o.beneficiary_vasp
78
+ end
79
+
80
+ # @see the `==` method
81
+ # @param [Object] Object to be compared
82
+ def eql?(o)
83
+ self == o
84
+ end
85
+
86
+ # Calculates hash code according to all attributes.
87
+ # @return [Integer] Hash code
88
+ def hash
89
+ [beneficiary_vasp].hash
90
+ end
91
+
92
+ # Builds the object from hash
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ # @return [Object] Returns the model itself
95
+ def self.build_from_hash(attributes)
96
+ new.build_from_hash(attributes)
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def build_from_hash(attributes)
103
+ return nil unless attributes.is_a?(Hash)
104
+ self.class.openapi_types.each_pair do |key, type|
105
+ if type =~ /\AArray<(.*)>/i
106
+ # check to ensure the input is an array given that the attribute
107
+ # is documented as an array but the input is not
108
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
109
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
110
+ end
111
+ elsif !attributes[self.class.attribute_map[key]].nil?
112
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
113
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
114
+ end
115
+
116
+ self
117
+ end
118
+
119
+ # Deserializes the data based on type
120
+ # @param string type Data type
121
+ # @param string value Value to be deserialized
122
+ # @return [Object] Deserialized data
123
+ def _deserialize(type, value)
124
+ case type.to_sym
125
+ when :DateTime
126
+ DateTime.parse(value)
127
+ when :Date
128
+ Date.parse(value)
129
+ when :String
130
+ value.to_s
131
+ when :Integer
132
+ value.to_i
133
+ when :Float
134
+ value.to_f
135
+ when :Boolean
136
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
+ true
138
+ else
139
+ false
140
+ end
141
+ when :Object
142
+ # generic object (usually a Hash), return directly
143
+ value
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ SygnaBridgeIvmsUtil.const_get(type).build_from_hash(value)
157
+ end
158
+ end
159
+
160
+ # Returns the string representation of the object
161
+ # @return [String] String presentation of the object
162
+ def to_s
163
+ to_hash.to_s
164
+ end
165
+
166
+ # to_body is an alias to to_hash (backward compatibility)
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_body
169
+ to_hash
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ # Outputs non-array value in the form of hash
189
+ # For object, use to_hash. Otherwise, just return the value
190
+ # @param [Object] value Any valid value
191
+ # @return [Hash] Returns the value in the form of hash
192
+ def _to_hash(value)
193
+ if value.is_a?(Array)
194
+ value.compact.map { |v| _to_hash(v) }
195
+ elsif value.is_a?(Hash)
196
+ {}.tap do |hash|
197
+ value.each { |k, v| hash[k] = _to_hash(v) }
198
+ end
199
+ elsif value.respond_to? :to_hash
200
+ value.to_hash
201
+ else
202
+ value
203
+ end
204
+ end
205
+ end
206
+ end
@@ -0,0 +1,215 @@
1
+ =begin
2
+ #Bridge
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SygnaBridgeIvmsUtil
16
+ class DateAndPlaceOfBirth
17
+ attr_accessor :date_of_birth
18
+
19
+ attr_accessor :place_of_birth
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'date_of_birth' => :'date_of_birth',
25
+ :'place_of_birth' => :'place_of_birth'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'date_of_birth' => :'String',
33
+ :'place_of_birth' => :'String'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SygnaBridgeIvmsUtil::DateAndPlaceOfBirth` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SygnaBridgeIvmsUtil::DateAndPlaceOfBirth`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'date_of_birth')
59
+ self.date_of_birth = attributes[:'date_of_birth']
60
+ end
61
+
62
+ if attributes.key?(:'place_of_birth')
63
+ self.place_of_birth = attributes[:'place_of_birth']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ date_of_birth == o.date_of_birth &&
86
+ place_of_birth == o.place_of_birth
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [date_of_birth, place_of_birth].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :DateTime
135
+ DateTime.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ SygnaBridgeIvmsUtil.const_get(type).build_from_hash(value)
166
+ end
167
+ end
168
+
169
+ # Returns the string representation of the object
170
+ # @return [String] String presentation of the object
171
+ def to_s
172
+ to_hash.to_s
173
+ end
174
+
175
+ # to_body is an alias to to_hash (backward compatibility)
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_body
178
+ to_hash
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+ end
215
+ end
@@ -0,0 +1,253 @@
1
+ =begin
2
+ #Bridge
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SygnaBridgeIvmsUtil
16
+ class IdentityPayload
17
+ attr_accessor :originator
18
+
19
+ attr_accessor :beneficiary
20
+
21
+ attr_accessor :originating_vasp
22
+
23
+ attr_accessor :beneficiary_vasp
24
+
25
+ attr_accessor :transfer_path
26
+
27
+ attr_accessor :payload_metadata
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'originator' => :'originator',
33
+ :'beneficiary' => :'beneficiary',
34
+ :'originating_vasp' => :'originating_vasp',
35
+ :'beneficiary_vasp' => :'beneficiary_vasp',
36
+ :'transfer_path' => :'transfer_path',
37
+ :'payload_metadata' => :'payload_metadata'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'originator' => :'Originator',
45
+ :'beneficiary' => :'Beneficiary',
46
+ :'originating_vasp' => :'OriginatingVasp',
47
+ :'beneficiary_vasp' => :'BeneficiaryVasp',
48
+ :'transfer_path' => :'Array<IntermediaryVasp>',
49
+ :'payload_metadata' => :'PayloadMetadata'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SygnaBridgeIvmsUtil::IdentityPayload` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SygnaBridgeIvmsUtil::IdentityPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'originator')
75
+ self.originator = attributes[:'originator']
76
+ end
77
+
78
+ if attributes.key?(:'beneficiary')
79
+ self.beneficiary = attributes[:'beneficiary']
80
+ end
81
+
82
+ if attributes.key?(:'originating_vasp')
83
+ self.originating_vasp = attributes[:'originating_vasp']
84
+ end
85
+
86
+ if attributes.key?(:'beneficiary_vasp')
87
+ self.beneficiary_vasp = attributes[:'beneficiary_vasp']
88
+ end
89
+
90
+ if attributes.key?(:'transfer_path')
91
+ if (value = attributes[:'transfer_path']).is_a?(Array)
92
+ self.transfer_path = value
93
+ end
94
+ end
95
+
96
+ if attributes.key?(:'payload_metadata')
97
+ self.payload_metadata = attributes[:'payload_metadata']
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ invalid_properties = Array.new
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ originator == o.originator &&
120
+ beneficiary == o.beneficiary &&
121
+ originating_vasp == o.originating_vasp &&
122
+ beneficiary_vasp == o.beneficiary_vasp &&
123
+ transfer_path == o.transfer_path &&
124
+ payload_metadata == o.payload_metadata
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [originator, beneficiary, originating_vasp, beneficiary_vasp, transfer_path, payload_metadata].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ new.build_from_hash(attributes)
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.openapi_types.each_pair do |key, type|
152
+ if type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
156
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
157
+ end
158
+ elsif !attributes[self.class.attribute_map[key]].nil?
159
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
160
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
161
+ end
162
+
163
+ self
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def _deserialize(type, value)
171
+ case type.to_sym
172
+ when :DateTime
173
+ DateTime.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :Boolean
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ SygnaBridgeIvmsUtil.const_get(type).build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+ end
253
+ end