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,230 @@
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 LegalPersonName
17
+ attr_accessor :name_identifiers
18
+
19
+ attr_accessor :local_name_identifiers
20
+
21
+ attr_accessor :phonetic_name_identifiers
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'name_identifiers' => :'name_identifiers',
27
+ :'local_name_identifiers' => :'local_name_identifiers',
28
+ :'phonetic_name_identifiers' => :'phonetic_name_identifiers'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'name_identifiers' => :'Array<LegalPersonNameId>',
36
+ :'local_name_identifiers' => :'Array<LocalLegalPersonNameId>',
37
+ :'phonetic_name_identifiers' => :'Array<LocalLegalPersonNameId>'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SygnaBridgeIvmsUtil::LegalPersonName` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SygnaBridgeIvmsUtil::LegalPersonName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'name_identifiers')
63
+ if (value = attributes[:'name_identifiers']).is_a?(Array)
64
+ self.name_identifiers = value
65
+ end
66
+ end
67
+
68
+ if attributes.key?(:'local_name_identifiers')
69
+ if (value = attributes[:'local_name_identifiers']).is_a?(Array)
70
+ self.local_name_identifiers = value
71
+ end
72
+ end
73
+
74
+ if attributes.key?(:'phonetic_name_identifiers')
75
+ if (value = attributes[:'phonetic_name_identifiers']).is_a?(Array)
76
+ self.phonetic_name_identifiers = value
77
+ end
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ name_identifiers == o.name_identifiers &&
100
+ local_name_identifiers == o.local_name_identifiers &&
101
+ phonetic_name_identifiers == o.phonetic_name_identifiers
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [name_identifiers, local_name_identifiers, phonetic_name_identifiers].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ new.build_from_hash(attributes)
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ self.class.openapi_types.each_pair do |key, type|
129
+ if type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
133
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
138
+ end
139
+
140
+ self
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def _deserialize(type, value)
148
+ case type.to_sym
149
+ when :DateTime
150
+ DateTime.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :Boolean
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ SygnaBridgeIvmsUtil.const_get(type).build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+ end
230
+ end
@@ -0,0 +1,249 @@
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 LegalPersonNameId
17
+ attr_accessor :legal_person_name
18
+
19
+ attr_accessor :legal_person_name_identifier_type
20
+
21
+ class EnumAttributeValidator
22
+ attr_reader :datatype
23
+ attr_reader :allowable_values
24
+
25
+ def initialize(datatype, allowable_values)
26
+ @allowable_values = allowable_values.map do |value|
27
+ case datatype.to_s
28
+ when /Integer/i
29
+ value.to_i
30
+ when /Float/i
31
+ value.to_f
32
+ else
33
+ value
34
+ end
35
+ end
36
+ end
37
+
38
+ def valid?(value)
39
+ !value || allowable_values.include?(value)
40
+ end
41
+ end
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'legal_person_name' => :'legal_person_name',
47
+ :'legal_person_name_identifier_type' => :'legal_person_name_identifier_type'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'legal_person_name' => :'String',
55
+ :'legal_person_name_identifier_type' => :'String'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SygnaBridgeIvmsUtil::LegalPersonNameId` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SygnaBridgeIvmsUtil::LegalPersonNameId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'legal_person_name')
81
+ self.legal_person_name = attributes[:'legal_person_name']
82
+ end
83
+
84
+ if attributes.key?(:'legal_person_name_identifier_type')
85
+ self.legal_person_name_identifier_type = attributes[:'legal_person_name_identifier_type']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ legal_person_name_identifier_type_validator = EnumAttributeValidator.new('String', ["LEGL", "SHRT", "TRAD"])
100
+ return false unless legal_person_name_identifier_type_validator.valid?(@legal_person_name_identifier_type)
101
+ true
102
+ end
103
+
104
+ # Custom attribute writer method checking allowed values (enum).
105
+ # @param [Object] legal_person_name_identifier_type Object to be assigned
106
+ def legal_person_name_identifier_type=(legal_person_name_identifier_type)
107
+ validator = EnumAttributeValidator.new('String', ["LEGL", "SHRT", "TRAD"])
108
+ unless validator.valid?(legal_person_name_identifier_type)
109
+ fail ArgumentError, "invalid value for \"legal_person_name_identifier_type\", must be one of #{validator.allowable_values}."
110
+ end
111
+ @legal_person_name_identifier_type = legal_person_name_identifier_type
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
+ legal_person_name == o.legal_person_name &&
120
+ legal_person_name_identifier_type == o.legal_person_name_identifier_type
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [legal_person_name, legal_person_name_identifier_type].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ new.build_from_hash(attributes)
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ self.class.openapi_types.each_pair do |key, type|
148
+ if type =~ /\AArray<(.*)>/i
149
+ # check to ensure the input is an array given that the attribute
150
+ # is documented as an array but the input is not
151
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
152
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
153
+ end
154
+ elsif !attributes[self.class.attribute_map[key]].nil?
155
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
156
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
157
+ end
158
+
159
+ self
160
+ end
161
+
162
+ # Deserializes the data based on type
163
+ # @param string type Data type
164
+ # @param string value Value to be deserialized
165
+ # @return [Object] Deserialized data
166
+ def _deserialize(type, value)
167
+ case type.to_sym
168
+ when :DateTime
169
+ DateTime.parse(value)
170
+ when :Date
171
+ Date.parse(value)
172
+ when :String
173
+ value.to_s
174
+ when :Integer
175
+ value.to_i
176
+ when :Float
177
+ value.to_f
178
+ when :Boolean
179
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
180
+ true
181
+ else
182
+ false
183
+ end
184
+ when :Object
185
+ # generic object (usually a Hash), return directly
186
+ value
187
+ when /\AArray<(?<inner_type>.+)>\z/
188
+ inner_type = Regexp.last_match[:inner_type]
189
+ value.map { |v| _deserialize(inner_type, v) }
190
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
191
+ k_type = Regexp.last_match[:k_type]
192
+ v_type = Regexp.last_match[:v_type]
193
+ {}.tap do |hash|
194
+ value.each do |k, v|
195
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
196
+ end
197
+ end
198
+ else # model
199
+ SygnaBridgeIvmsUtil.const_get(type).build_from_hash(value)
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ if value.nil?
222
+ is_nullable = self.class.openapi_nullable.include?(attr)
223
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
+ end
225
+
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ # Outputs non-array value in the form of hash
232
+ # For object, use to_hash. Otherwise, just return the value
233
+ # @param [Object] value Any valid value
234
+ # @return [Hash] Returns the value in the form of hash
235
+ def _to_hash(value)
236
+ if value.is_a?(Array)
237
+ value.compact.map { |v| _to_hash(v) }
238
+ elsif value.is_a?(Hash)
239
+ {}.tap do |hash|
240
+ value.each { |k, v| hash[k] = _to_hash(v) }
241
+ end
242
+ elsif value.respond_to? :to_hash
243
+ value.to_hash
244
+ else
245
+ value
246
+ end
247
+ end
248
+ end
249
+ end