sygna-bridge-ivms-util 0.0.5

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