late-sdk 0.0.531 → 0.0.533

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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -0
  3. data/docs/AdsApi.md +287 -0
  4. data/docs/CheckPhoneNumberPortability200ResponseResultsInner.md +5 -1
  5. data/docs/CreatePhoneNumberPortInRequest.md +4 -2
  6. data/docs/CreatePhoneNumberPortInRequestEndUser.md +8 -4
  7. data/docs/CreatePhoneNumberPortInRequestRequirementsInner.md +20 -0
  8. data/docs/CreateRfPrediction201Response.md +22 -0
  9. data/docs/CreateRfPredictionRequest.md +34 -0
  10. data/docs/CreateStandaloneAdRequest.md +4 -0
  11. data/docs/GetPhoneNumberPortInOrderRequirements200Response.md +20 -0
  12. data/docs/GetPhoneNumberPortInOrderRequirements200ResponseRequirementsInner.md +32 -0
  13. data/docs/GetPhoneNumberPortInRequirements200Response.md +24 -0
  14. data/docs/GetPhoneNumberPortInRequirements200ResponseFieldsInner.md +28 -0
  15. data/docs/PhoneNumbersApi.md +149 -5
  16. data/docs/ReserveRfPrediction201Response.md +20 -0
  17. data/docs/ReserveRfPredictionRequest.md +20 -0
  18. data/docs/RfPrediction.md +42 -0
  19. data/lib/zernio-sdk/api/ads_api.rb +294 -0
  20. data/lib/zernio-sdk/api/phone_numbers_api.rb +148 -10
  21. data/lib/zernio-sdk/models/check_phone_number_portability200_response_results_inner.rb +24 -2
  22. data/lib/zernio-sdk/models/create_phone_number_port_in_request.rb +36 -5
  23. data/lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb +65 -23
  24. data/lib/zernio-sdk/models/create_phone_number_port_in_request_requirements_inner.rb +201 -0
  25. data/lib/zernio-sdk/models/create_rf_prediction201_response.rb +165 -0
  26. data/lib/zernio-sdk/models/create_rf_prediction_request.rb +323 -0
  27. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +33 -1
  28. data/lib/zernio-sdk/models/get_phone_number_port_in_order_requirements200_response.rb +158 -0
  29. data/lib/zernio-sdk/models/get_phone_number_port_in_order_requirements200_response_requirements_inner.rb +247 -0
  30. data/lib/zernio-sdk/models/get_phone_number_port_in_requirements200_response.rb +177 -0
  31. data/lib/zernio-sdk/models/get_phone_number_port_in_requirements200_response_fields_inner.rb +231 -0
  32. data/lib/zernio-sdk/models/reserve_rf_prediction201_response.rb +156 -0
  33. data/lib/zernio-sdk/models/reserve_rf_prediction_request.rb +190 -0
  34. data/lib/zernio-sdk/models/rf_prediction.rb +273 -0
  35. data/lib/zernio-sdk/version.rb +1 -1
  36. data/lib/zernio-sdk.rb +10 -0
  37. data/openapi.yaml +283 -16
  38. data/spec/api/ads_api_spec.rb +52 -0
  39. data/spec/api/phone_numbers_api_spec.rb +28 -3
  40. data/spec/models/check_phone_number_portability200_response_results_inner_spec.rb +12 -0
  41. data/spec/models/create_phone_number_port_in_request_end_user_spec.rb +13 -1
  42. data/spec/models/create_phone_number_port_in_request_requirements_inner_spec.rb +42 -0
  43. data/spec/models/create_phone_number_port_in_request_spec.rb +6 -0
  44. data/spec/models/create_rf_prediction201_response_spec.rb +48 -0
  45. data/spec/models/create_rf_prediction_request_spec.rb +84 -0
  46. data/spec/models/create_standalone_ad_request_spec.rb +16 -0
  47. data/spec/models/get_phone_number_port_in_order_requirements200_response_requirements_inner_spec.rb +82 -0
  48. data/spec/models/get_phone_number_port_in_order_requirements200_response_spec.rb +42 -0
  49. data/spec/models/get_phone_number_port_in_requirements200_response_fields_inner_spec.rb +70 -0
  50. data/spec/models/get_phone_number_port_in_requirements200_response_spec.rb +54 -0
  51. data/spec/models/reserve_rf_prediction201_response_spec.rb +42 -0
  52. data/spec/models/reserve_rf_prediction_request_spec.rb +42 -0
  53. data/spec/models/rf_prediction_spec.rb +108 -0
  54. data/zernio-sdk-0.0.533.gem +0 -0
  55. metadata +42 -2
  56. data/zernio-sdk-0.0.531.gem +0 -0
@@ -0,0 +1,247 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class GetPhoneNumberPortInOrderRequirements200ResponseRequirementsInner < ApiModelBase
18
+ attr_accessor :requirement_id
19
+
20
+ attr_accessor :label
21
+
22
+ attr_accessor :kind
23
+
24
+ attr_accessor :description
25
+
26
+ attr_accessor :example
27
+
28
+ attr_accessor :acceptable_values
29
+
30
+ # requirement-info-pending | requirement-info-under-review | requirement-info-exception | approved
31
+ attr_accessor :status
32
+
33
+ attr_accessor :filled
34
+
35
+ class EnumAttributeValidator
36
+ attr_reader :datatype
37
+ attr_reader :allowable_values
38
+
39
+ def initialize(datatype, allowable_values)
40
+ @allowable_values = allowable_values.map do |value|
41
+ case datatype.to_s
42
+ when /Integer/i
43
+ value.to_i
44
+ when /Float/i
45
+ value.to_f
46
+ else
47
+ value
48
+ end
49
+ end
50
+ end
51
+
52
+ def valid?(value)
53
+ !value || allowable_values.include?(value)
54
+ end
55
+ end
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'requirement_id' => :'requirementId',
61
+ :'label' => :'label',
62
+ :'kind' => :'kind',
63
+ :'description' => :'description',
64
+ :'example' => :'example',
65
+ :'acceptable_values' => :'acceptableValues',
66
+ :'status' => :'status',
67
+ :'filled' => :'filled'
68
+ }
69
+ end
70
+
71
+ # Returns attribute mapping this model knows about
72
+ def self.acceptable_attribute_map
73
+ attribute_map
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ acceptable_attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'requirement_id' => :'String',
85
+ :'label' => :'String',
86
+ :'kind' => :'String',
87
+ :'description' => :'String',
88
+ :'example' => :'String',
89
+ :'acceptable_values' => :'Array<String>',
90
+ :'status' => :'String',
91
+ :'filled' => :'Boolean'
92
+ }
93
+ end
94
+
95
+ # List of attributes with nullable: true
96
+ def self.openapi_nullable
97
+ Set.new([
98
+ ])
99
+ end
100
+
101
+ # Initializes the object
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ def initialize(attributes = {})
104
+ if (!attributes.is_a?(Hash))
105
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetPhoneNumberPortInOrderRequirements200ResponseRequirementsInner` initialize method"
106
+ end
107
+
108
+ # check to see if the attribute exists and convert string to symbol for hash key
109
+ acceptable_attribute_map = self.class.acceptable_attribute_map
110
+ attributes = attributes.each_with_object({}) { |(k, v), h|
111
+ if (!acceptable_attribute_map.key?(k.to_sym))
112
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetPhoneNumberPortInOrderRequirements200ResponseRequirementsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
113
+ end
114
+ h[k.to_sym] = v
115
+ }
116
+
117
+ if attributes.key?(:'requirement_id')
118
+ self.requirement_id = attributes[:'requirement_id']
119
+ end
120
+
121
+ if attributes.key?(:'label')
122
+ self.label = attributes[:'label']
123
+ end
124
+
125
+ if attributes.key?(:'kind')
126
+ self.kind = attributes[:'kind']
127
+ end
128
+
129
+ if attributes.key?(:'description')
130
+ self.description = attributes[:'description']
131
+ end
132
+
133
+ if attributes.key?(:'example')
134
+ self.example = attributes[:'example']
135
+ end
136
+
137
+ if attributes.key?(:'acceptable_values')
138
+ if (value = attributes[:'acceptable_values']).is_a?(Array)
139
+ self.acceptable_values = value
140
+ end
141
+ end
142
+
143
+ if attributes.key?(:'status')
144
+ self.status = attributes[:'status']
145
+ end
146
+
147
+ if attributes.key?(:'filled')
148
+ self.filled = attributes[:'filled']
149
+ end
150
+ end
151
+
152
+ # Show invalid properties with the reasons. Usually used together with valid?
153
+ # @return Array for valid properties with the reasons
154
+ def list_invalid_properties
155
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
156
+ invalid_properties = Array.new
157
+ invalid_properties
158
+ end
159
+
160
+ # Check to see if the all the properties in the model are valid
161
+ # @return true if the model is valid
162
+ def valid?
163
+ warn '[DEPRECATED] the `valid?` method is obsolete'
164
+ kind_validator = EnumAttributeValidator.new('String', ["text", "date", "address", "file", "action"])
165
+ return false unless kind_validator.valid?(@kind)
166
+ true
167
+ end
168
+
169
+ # Custom attribute writer method checking allowed values (enum).
170
+ # @param [Object] kind Object to be assigned
171
+ def kind=(kind)
172
+ validator = EnumAttributeValidator.new('String', ["text", "date", "address", "file", "action"])
173
+ unless validator.valid?(kind)
174
+ fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}."
175
+ end
176
+ @kind = kind
177
+ end
178
+
179
+ # Checks equality by comparing each attribute.
180
+ # @param [Object] Object to be compared
181
+ def ==(o)
182
+ return true if self.equal?(o)
183
+ self.class == o.class &&
184
+ requirement_id == o.requirement_id &&
185
+ label == o.label &&
186
+ kind == o.kind &&
187
+ description == o.description &&
188
+ example == o.example &&
189
+ acceptable_values == o.acceptable_values &&
190
+ status == o.status &&
191
+ filled == o.filled
192
+ end
193
+
194
+ # @see the `==` method
195
+ # @param [Object] Object to be compared
196
+ def eql?(o)
197
+ self == o
198
+ end
199
+
200
+ # Calculates hash code according to all attributes.
201
+ # @return [Integer] Hash code
202
+ def hash
203
+ [requirement_id, label, kind, description, example, acceptable_values, status, filled].hash
204
+ end
205
+
206
+ # Builds the object from hash
207
+ # @param [Hash] attributes Model attributes in the form of hash
208
+ # @return [Object] Returns the model itself
209
+ def self.build_from_hash(attributes)
210
+ return nil unless attributes.is_a?(Hash)
211
+ attributes = attributes.transform_keys(&:to_sym)
212
+ transformed_hash = {}
213
+ openapi_types.each_pair do |key, type|
214
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
215
+ transformed_hash["#{key}"] = nil
216
+ elsif type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[attribute_map[key]].is_a?(Array)
220
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
221
+ end
222
+ elsif !attributes[attribute_map[key]].nil?
223
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
224
+ end
225
+ end
226
+ new(transformed_hash)
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = {}
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ end
246
+
247
+ end
@@ -0,0 +1,177 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class GetPhoneNumberPortInRequirements200Response < ApiModelBase
18
+ attr_accessor :country
19
+
20
+ attr_accessor :number_type
21
+
22
+ # false when the combination includes a step that can't be completed through the API (e.g. an in-person identity verification) — porting it needs support.
23
+ attr_accessor :supported
24
+
25
+ attr_accessor :fields
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'country' => :'country',
31
+ :'number_type' => :'numberType',
32
+ :'supported' => :'supported',
33
+ :'fields' => :'fields'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'country' => :'String',
51
+ :'number_type' => :'String',
52
+ :'supported' => :'Boolean',
53
+ :'fields' => :'Array<GetPhoneNumberPortInRequirements200ResponseFieldsInner>'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetPhoneNumberPortInRequirements200Response` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ acceptable_attribute_map = self.class.acceptable_attribute_map
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!acceptable_attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetPhoneNumberPortInRequirements200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'country')
80
+ self.country = attributes[:'country']
81
+ end
82
+
83
+ if attributes.key?(:'number_type')
84
+ self.number_type = attributes[:'number_type']
85
+ end
86
+
87
+ if attributes.key?(:'supported')
88
+ self.supported = attributes[:'supported']
89
+ end
90
+
91
+ if attributes.key?(:'fields')
92
+ if (value = attributes[:'fields']).is_a?(Array)
93
+ self.fields = value
94
+ end
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
102
+ invalid_properties = Array.new
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ warn '[DEPRECATED] the `valid?` method is obsolete'
110
+ true
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ country == o.country &&
119
+ number_type == o.number_type &&
120
+ supported == o.supported &&
121
+ fields == o.fields
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [country, number_type, supported, fields].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
+ end
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
+ end
155
+ end
156
+ new(transformed_hash)
157
+ end
158
+
159
+ # Returns the object in the form of hash
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_hash
162
+ hash = {}
163
+ self.class.attribute_map.each_pair do |attr, param|
164
+ value = self.send(attr)
165
+ if value.nil?
166
+ is_nullable = self.class.openapi_nullable.include?(attr)
167
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
168
+ end
169
+
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ end
176
+
177
+ end
@@ -0,0 +1,231 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class GetPhoneNumberPortInRequirements200ResponseFieldsInner < ApiModelBase
18
+ # Pass back as requirements[].requirementTypeId.
19
+ attr_accessor :requirement_id
20
+
21
+ attr_accessor :label
22
+
23
+ # text/date take a string value; file takes a documentId from the documents endpoint; address is satisfied automatically from the end-user service address.
24
+ attr_accessor :kind
25
+
26
+ attr_accessor :description
27
+
28
+ attr_accessor :example
29
+
30
+ # When present, the value must be one of these.
31
+ attr_accessor :acceptable_values
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'requirement_id' => :'requirementId',
59
+ :'label' => :'label',
60
+ :'kind' => :'kind',
61
+ :'description' => :'description',
62
+ :'example' => :'example',
63
+ :'acceptable_values' => :'acceptableValues'
64
+ }
65
+ end
66
+
67
+ # Returns attribute mapping this model knows about
68
+ def self.acceptable_attribute_map
69
+ attribute_map
70
+ end
71
+
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ acceptable_attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.openapi_types
79
+ {
80
+ :'requirement_id' => :'String',
81
+ :'label' => :'String',
82
+ :'kind' => :'String',
83
+ :'description' => :'String',
84
+ :'example' => :'String',
85
+ :'acceptable_values' => :'Array<String>'
86
+ }
87
+ end
88
+
89
+ # List of attributes with nullable: true
90
+ def self.openapi_nullable
91
+ Set.new([
92
+ ])
93
+ end
94
+
95
+ # Initializes the object
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ def initialize(attributes = {})
98
+ if (!attributes.is_a?(Hash))
99
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetPhoneNumberPortInRequirements200ResponseFieldsInner` initialize method"
100
+ end
101
+
102
+ # check to see if the attribute exists and convert string to symbol for hash key
103
+ acceptable_attribute_map = self.class.acceptable_attribute_map
104
+ attributes = attributes.each_with_object({}) { |(k, v), h|
105
+ if (!acceptable_attribute_map.key?(k.to_sym))
106
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetPhoneNumberPortInRequirements200ResponseFieldsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
107
+ end
108
+ h[k.to_sym] = v
109
+ }
110
+
111
+ if attributes.key?(:'requirement_id')
112
+ self.requirement_id = attributes[:'requirement_id']
113
+ end
114
+
115
+ if attributes.key?(:'label')
116
+ self.label = attributes[:'label']
117
+ end
118
+
119
+ if attributes.key?(:'kind')
120
+ self.kind = attributes[:'kind']
121
+ end
122
+
123
+ if attributes.key?(:'description')
124
+ self.description = attributes[:'description']
125
+ end
126
+
127
+ if attributes.key?(:'example')
128
+ self.example = attributes[:'example']
129
+ end
130
+
131
+ if attributes.key?(:'acceptable_values')
132
+ if (value = attributes[:'acceptable_values']).is_a?(Array)
133
+ self.acceptable_values = value
134
+ end
135
+ end
136
+ end
137
+
138
+ # Show invalid properties with the reasons. Usually used together with valid?
139
+ # @return Array for valid properties with the reasons
140
+ def list_invalid_properties
141
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
142
+ invalid_properties = Array.new
143
+ invalid_properties
144
+ end
145
+
146
+ # Check to see if the all the properties in the model are valid
147
+ # @return true if the model is valid
148
+ def valid?
149
+ warn '[DEPRECATED] the `valid?` method is obsolete'
150
+ kind_validator = EnumAttributeValidator.new('String', ["text", "date", "address", "file", "action"])
151
+ return false unless kind_validator.valid?(@kind)
152
+ true
153
+ end
154
+
155
+ # Custom attribute writer method checking allowed values (enum).
156
+ # @param [Object] kind Object to be assigned
157
+ def kind=(kind)
158
+ validator = EnumAttributeValidator.new('String', ["text", "date", "address", "file", "action"])
159
+ unless validator.valid?(kind)
160
+ fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}."
161
+ end
162
+ @kind = kind
163
+ end
164
+
165
+ # Checks equality by comparing each attribute.
166
+ # @param [Object] Object to be compared
167
+ def ==(o)
168
+ return true if self.equal?(o)
169
+ self.class == o.class &&
170
+ requirement_id == o.requirement_id &&
171
+ label == o.label &&
172
+ kind == o.kind &&
173
+ description == o.description &&
174
+ example == o.example &&
175
+ acceptable_values == o.acceptable_values
176
+ end
177
+
178
+ # @see the `==` method
179
+ # @param [Object] Object to be compared
180
+ def eql?(o)
181
+ self == o
182
+ end
183
+
184
+ # Calculates hash code according to all attributes.
185
+ # @return [Integer] Hash code
186
+ def hash
187
+ [requirement_id, label, kind, description, example, acceptable_values].hash
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def self.build_from_hash(attributes)
194
+ return nil unless attributes.is_a?(Hash)
195
+ attributes = attributes.transform_keys(&:to_sym)
196
+ transformed_hash = {}
197
+ openapi_types.each_pair do |key, type|
198
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = nil
200
+ elsif type =~ /\AArray<(.*)>/i
201
+ # check to ensure the input is an array given that the attribute
202
+ # is documented as an array but the input is not
203
+ if attributes[attribute_map[key]].is_a?(Array)
204
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
205
+ end
206
+ elsif !attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
208
+ end
209
+ end
210
+ new(transformed_hash)
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ end
230
+
231
+ end