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,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-beta
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SygnaBridgeIvmsUtil
16
+ class PayloadMetadata
17
+ attr_accessor :transliteration_method
18
+
19
+ class EnumAttributeValidator
20
+ attr_reader :datatype
21
+ attr_reader :allowable_values
22
+
23
+ def initialize(datatype, allowable_values)
24
+ @allowable_values = allowable_values.map do |value|
25
+ case datatype.to_s
26
+ when /Integer/i
27
+ value.to_i
28
+ when /Float/i
29
+ value.to_f
30
+ else
31
+ value
32
+ end
33
+ end
34
+ end
35
+
36
+ def valid?(value)
37
+ !value || allowable_values.include?(value)
38
+ end
39
+ end
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'transliteration_method' => :'transliteration_method'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'transliteration_method' => :'Array<String>'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SygnaBridgeIvmsUtil::PayloadMetadata` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SygnaBridgeIvmsUtil::PayloadMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'transliteration_method')
77
+ if (value = attributes[:'transliteration_method']).is_a?(Array)
78
+ self.transliteration_method = value
79
+ end
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ transliteration_method == o.transliteration_method
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
+ [transliteration_method].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,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-beta
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SygnaBridgeIvmsUtil
16
+ class Person
17
+ attr_accessor :natural_person
18
+
19
+ attr_accessor :legal_person
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'natural_person' => :'natural_person',
25
+ :'legal_person' => :'legal_person'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'natural_person' => :'NaturalPerson',
33
+ :'legal_person' => :'LegalPerson'
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::Person` 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::Person`. 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?(:'natural_person')
59
+ self.natural_person = attributes[:'natural_person']
60
+ end
61
+
62
+ if attributes.key?(:'legal_person')
63
+ self.legal_person = attributes[:'legal_person']
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
+ natural_person == o.natural_person &&
86
+ legal_person == o.legal_person
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
+ [natural_person, legal_person].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,47 @@
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 TransliterationMethodCode
17
+ ARAB = "ARAB".freeze
18
+ ARAN = "ARAN".freeze
19
+ ARMN = "ARMN".freeze
20
+ CYRL = "CYRL".freeze
21
+ DEVA = "DEVA".freeze
22
+ GEOR = "GEOR".freeze
23
+ GREK = "GREK".freeze
24
+ HANI = "HANI".freeze
25
+ HEBR = "HEBR".freeze
26
+ KANA = "KANA".freeze
27
+ KORE = "KORE".freeze
28
+ THAI = "THAI".freeze
29
+ OTHR = "OTHR".freeze
30
+
31
+ # Builds the enum from string
32
+ # @param [String] The enum value in the form of the string
33
+ # @return [String] The enum value
34
+ def self.build_from_hash(value)
35
+ new.build_from_hash(value)
36
+ end
37
+
38
+ # Builds the enum from string
39
+ # @param [String] The enum value in the form of the string
40
+ # @return [String] The enum value
41
+ def build_from_hash(value)
42
+ constantValues = TransliterationMethodCode.constants.select { |c| TransliterationMethodCode::const_get(c) == value }
43
+ raise "Invalid ENUM value #{value} for class #TransliterationMethodCode" if constantValues.empty?
44
+ value
45
+ end
46
+ end
47
+ end