templatefox 1.0.0

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 (75) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +206 -0
  5. data/Rakefile +10 -0
  6. data/docs/AccountApi.md +152 -0
  7. data/docs/AccountInfoResponse.md +20 -0
  8. data/docs/CreatePdfRequest.md +32 -0
  9. data/docs/CreatePdfResponse.md +24 -0
  10. data/docs/ExportType.md +15 -0
  11. data/docs/HTTPValidationError.md +18 -0
  12. data/docs/IntegrationsApi.md +286 -0
  13. data/docs/LocationInner.md +15 -0
  14. data/docs/PDFApi.md +79 -0
  15. data/docs/S3ConfigRequest.md +26 -0
  16. data/docs/S3ConfigResponse.md +28 -0
  17. data/docs/S3SuccessResponse.md +18 -0
  18. data/docs/S3TestResponse.md +20 -0
  19. data/docs/TemplateField.md +26 -0
  20. data/docs/TemplateListItem.md +24 -0
  21. data/docs/TemplatesApi.md +148 -0
  22. data/docs/TemplatesListResponse.md +18 -0
  23. data/docs/Transaction.md +28 -0
  24. data/docs/TransactionsResponse.md +24 -0
  25. data/docs/ValidationError.md +22 -0
  26. data/git_push.sh +57 -0
  27. data/lib/templatefox/api/account_api.rb +154 -0
  28. data/lib/templatefox/api/integrations_api.rb +261 -0
  29. data/lib/templatefox/api/pdf_api.rb +90 -0
  30. data/lib/templatefox/api/templates_api.rb +142 -0
  31. data/lib/templatefox/api_client.rb +397 -0
  32. data/lib/templatefox/api_error.rb +58 -0
  33. data/lib/templatefox/api_model_base.rb +88 -0
  34. data/lib/templatefox/configuration.rb +308 -0
  35. data/lib/templatefox/models/account_info_response.rb +176 -0
  36. data/lib/templatefox/models/create_pdf_request.rb +414 -0
  37. data/lib/templatefox/models/create_pdf_response.rb +247 -0
  38. data/lib/templatefox/models/export_type.rb +40 -0
  39. data/lib/templatefox/models/http_validation_error.rb +149 -0
  40. data/lib/templatefox/models/location_inner.rb +103 -0
  41. data/lib/templatefox/models/s3_config_request.rb +372 -0
  42. data/lib/templatefox/models/s3_config_response.rb +301 -0
  43. data/lib/templatefox/models/s3_success_response.rb +166 -0
  44. data/lib/templatefox/models/s3_test_response.rb +193 -0
  45. data/lib/templatefox/models/template_field.rb +227 -0
  46. data/lib/templatefox/models/template_list_item.rb +247 -0
  47. data/lib/templatefox/models/templates_list_response.rb +167 -0
  48. data/lib/templatefox/models/transaction.rb +267 -0
  49. data/lib/templatefox/models/transactions_response.rb +248 -0
  50. data/lib/templatefox/models/validation_error.rb +218 -0
  51. data/lib/templatefox/version.rb +15 -0
  52. data/lib/templatefox.rb +60 -0
  53. data/spec/api/account_api_spec.rb +59 -0
  54. data/spec/api/integrations_api_spec.rb +80 -0
  55. data/spec/api/pdf_api_spec.rb +47 -0
  56. data/spec/api/templates_api_spec.rb +58 -0
  57. data/spec/models/account_info_response_spec.rb +42 -0
  58. data/spec/models/create_pdf_request_spec.rb +78 -0
  59. data/spec/models/create_pdf_response_spec.rb +54 -0
  60. data/spec/models/export_type_spec.rb +30 -0
  61. data/spec/models/http_validation_error_spec.rb +36 -0
  62. data/spec/models/location_inner_spec.rb +21 -0
  63. data/spec/models/s3_config_request_spec.rb +60 -0
  64. data/spec/models/s3_config_response_spec.rb +66 -0
  65. data/spec/models/s3_success_response_spec.rb +36 -0
  66. data/spec/models/s3_test_response_spec.rb +42 -0
  67. data/spec/models/template_field_spec.rb +60 -0
  68. data/spec/models/template_list_item_spec.rb +54 -0
  69. data/spec/models/templates_list_response_spec.rb +36 -0
  70. data/spec/models/transaction_spec.rb +66 -0
  71. data/spec/models/transactions_response_spec.rb +54 -0
  72. data/spec/models/validation_error_spec.rb +48 -0
  73. data/spec/spec_helper.rb +111 -0
  74. data/templatefox.gemspec +39 -0
  75. metadata +177 -0
@@ -0,0 +1,301 @@
1
+ =begin
2
+ #TemplateFox API
3
+
4
+ #Generate PDFs from HTML templates via API. Design once, generate thousands.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
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 TemplateFox
17
+ # Response for S3 configuration (with masked secret)
18
+ class S3ConfigResponse < ApiModelBase
19
+ # Whether S3 is configured
20
+ attr_accessor :configured
21
+
22
+ # S3-compatible endpoint URL
23
+ attr_accessor :endpoint_url
24
+
25
+ # Access key ID
26
+ attr_accessor :access_key_id
27
+
28
+ # Masked secret access key (shows first 4 and last 4 characters)
29
+ attr_accessor :secret_access_key_masked
30
+
31
+ # S3 bucket name
32
+ attr_accessor :bucket_name
33
+
34
+ # Default path prefix for uploads
35
+ attr_accessor :default_prefix
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'configured' => :'configured',
41
+ :'endpoint_url' => :'endpoint_url',
42
+ :'access_key_id' => :'access_key_id',
43
+ :'secret_access_key_masked' => :'secret_access_key_masked',
44
+ :'bucket_name' => :'bucket_name',
45
+ :'default_prefix' => :'default_prefix'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'configured' => :'Boolean',
63
+ :'endpoint_url' => :'String',
64
+ :'access_key_id' => :'String',
65
+ :'secret_access_key_masked' => :'String',
66
+ :'bucket_name' => :'String',
67
+ :'default_prefix' => :'String'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::S3ConfigResponse` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::S3ConfigResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'configured')
94
+ self.configured = attributes[:'configured']
95
+ else
96
+ self.configured = nil
97
+ end
98
+
99
+ if attributes.key?(:'endpoint_url')
100
+ self.endpoint_url = attributes[:'endpoint_url']
101
+ else
102
+ self.endpoint_url = nil
103
+ end
104
+
105
+ if attributes.key?(:'access_key_id')
106
+ self.access_key_id = attributes[:'access_key_id']
107
+ else
108
+ self.access_key_id = nil
109
+ end
110
+
111
+ if attributes.key?(:'secret_access_key_masked')
112
+ self.secret_access_key_masked = attributes[:'secret_access_key_masked']
113
+ else
114
+ self.secret_access_key_masked = nil
115
+ end
116
+
117
+ if attributes.key?(:'bucket_name')
118
+ self.bucket_name = attributes[:'bucket_name']
119
+ else
120
+ self.bucket_name = nil
121
+ end
122
+
123
+ if attributes.key?(:'default_prefix')
124
+ self.default_prefix = attributes[:'default_prefix']
125
+ else
126
+ self.default_prefix = nil
127
+ end
128
+ end
129
+
130
+ # Show invalid properties with the reasons. Usually used together with valid?
131
+ # @return Array for valid properties with the reasons
132
+ def list_invalid_properties
133
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
134
+ invalid_properties = Array.new
135
+ if @configured.nil?
136
+ invalid_properties.push('invalid value for "configured", configured cannot be nil.')
137
+ end
138
+
139
+ if @endpoint_url.nil?
140
+ invalid_properties.push('invalid value for "endpoint_url", endpoint_url cannot be nil.')
141
+ end
142
+
143
+ if @access_key_id.nil?
144
+ invalid_properties.push('invalid value for "access_key_id", access_key_id cannot be nil.')
145
+ end
146
+
147
+ if @secret_access_key_masked.nil?
148
+ invalid_properties.push('invalid value for "secret_access_key_masked", secret_access_key_masked cannot be nil.')
149
+ end
150
+
151
+ if @bucket_name.nil?
152
+ invalid_properties.push('invalid value for "bucket_name", bucket_name cannot be nil.')
153
+ end
154
+
155
+ if @default_prefix.nil?
156
+ invalid_properties.push('invalid value for "default_prefix", default_prefix cannot be nil.')
157
+ end
158
+
159
+ invalid_properties
160
+ end
161
+
162
+ # Check to see if the all the properties in the model are valid
163
+ # @return true if the model is valid
164
+ def valid?
165
+ warn '[DEPRECATED] the `valid?` method is obsolete'
166
+ return false if @configured.nil?
167
+ return false if @endpoint_url.nil?
168
+ return false if @access_key_id.nil?
169
+ return false if @secret_access_key_masked.nil?
170
+ return false if @bucket_name.nil?
171
+ return false if @default_prefix.nil?
172
+ true
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] configured Value to be assigned
177
+ def configured=(configured)
178
+ if configured.nil?
179
+ fail ArgumentError, 'configured cannot be nil'
180
+ end
181
+
182
+ @configured = configured
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] endpoint_url Value to be assigned
187
+ def endpoint_url=(endpoint_url)
188
+ if endpoint_url.nil?
189
+ fail ArgumentError, 'endpoint_url cannot be nil'
190
+ end
191
+
192
+ @endpoint_url = endpoint_url
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] access_key_id Value to be assigned
197
+ def access_key_id=(access_key_id)
198
+ if access_key_id.nil?
199
+ fail ArgumentError, 'access_key_id cannot be nil'
200
+ end
201
+
202
+ @access_key_id = access_key_id
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] secret_access_key_masked Value to be assigned
207
+ def secret_access_key_masked=(secret_access_key_masked)
208
+ if secret_access_key_masked.nil?
209
+ fail ArgumentError, 'secret_access_key_masked cannot be nil'
210
+ end
211
+
212
+ @secret_access_key_masked = secret_access_key_masked
213
+ end
214
+
215
+ # Custom attribute writer method with validation
216
+ # @param [Object] bucket_name Value to be assigned
217
+ def bucket_name=(bucket_name)
218
+ if bucket_name.nil?
219
+ fail ArgumentError, 'bucket_name cannot be nil'
220
+ end
221
+
222
+ @bucket_name = bucket_name
223
+ end
224
+
225
+ # Custom attribute writer method with validation
226
+ # @param [Object] default_prefix Value to be assigned
227
+ def default_prefix=(default_prefix)
228
+ if default_prefix.nil?
229
+ fail ArgumentError, 'default_prefix cannot be nil'
230
+ end
231
+
232
+ @default_prefix = default_prefix
233
+ end
234
+
235
+ # Checks equality by comparing each attribute.
236
+ # @param [Object] Object to be compared
237
+ def ==(o)
238
+ return true if self.equal?(o)
239
+ self.class == o.class &&
240
+ configured == o.configured &&
241
+ endpoint_url == o.endpoint_url &&
242
+ access_key_id == o.access_key_id &&
243
+ secret_access_key_masked == o.secret_access_key_masked &&
244
+ bucket_name == o.bucket_name &&
245
+ default_prefix == o.default_prefix
246
+ end
247
+
248
+ # @see the `==` method
249
+ # @param [Object] Object to be compared
250
+ def eql?(o)
251
+ self == o
252
+ end
253
+
254
+ # Calculates hash code according to all attributes.
255
+ # @return [Integer] Hash code
256
+ def hash
257
+ [configured, endpoint_url, access_key_id, secret_access_key_masked, bucket_name, default_prefix].hash
258
+ end
259
+
260
+ # Builds the object from hash
261
+ # @param [Hash] attributes Model attributes in the form of hash
262
+ # @return [Object] Returns the model itself
263
+ def self.build_from_hash(attributes)
264
+ return nil unless attributes.is_a?(Hash)
265
+ attributes = attributes.transform_keys(&:to_sym)
266
+ transformed_hash = {}
267
+ openapi_types.each_pair do |key, type|
268
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
269
+ transformed_hash["#{key}"] = nil
270
+ elsif type =~ /\AArray<(.*)>/i
271
+ # check to ensure the input is an array given that the attribute
272
+ # is documented as an array but the input is not
273
+ if attributes[attribute_map[key]].is_a?(Array)
274
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
275
+ end
276
+ elsif !attributes[attribute_map[key]].nil?
277
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
278
+ end
279
+ end
280
+ new(transformed_hash)
281
+ end
282
+
283
+ # Returns the object in the form of hash
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_hash
286
+ hash = {}
287
+ self.class.attribute_map.each_pair do |attr, param|
288
+ value = self.send(attr)
289
+ if value.nil?
290
+ is_nullable = self.class.openapi_nullable.include?(attr)
291
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
292
+ end
293
+
294
+ hash[param] = _to_hash(value)
295
+ end
296
+ hash
297
+ end
298
+
299
+ end
300
+
301
+ end
@@ -0,0 +1,166 @@
1
+ =begin
2
+ #TemplateFox API
3
+
4
+ #Generate PDFs from HTML templates via API. Design once, generate thousands.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
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 TemplateFox
17
+ # Generic success response for S3 operations
18
+ class S3SuccessResponse < ApiModelBase
19
+ # Whether the operation succeeded
20
+ attr_accessor :success
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'success' => :'success'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'success' => :'Boolean'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::S3SuccessResponse` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::S3SuccessResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'success')
69
+ self.success = attributes[:'success']
70
+ else
71
+ self.success = nil
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
+ invalid_properties = Array.new
80
+ if @success.nil?
81
+ invalid_properties.push('invalid value for "success", success cannot be nil.')
82
+ end
83
+
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ return false if @success.nil?
92
+ true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] success Value to be assigned
97
+ def success=(success)
98
+ if success.nil?
99
+ fail ArgumentError, 'success cannot be nil'
100
+ end
101
+
102
+ @success = success
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ success == o.success
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
+ [success].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
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Returns the object in the form of hash
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_hash
151
+ hash = {}
152
+ self.class.attribute_map.each_pair do |attr, param|
153
+ value = self.send(attr)
154
+ if value.nil?
155
+ is_nullable = self.class.openapi_nullable.include?(attr)
156
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
157
+ end
158
+
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ end
165
+
166
+ end
@@ -0,0 +1,193 @@
1
+ =begin
2
+ #TemplateFox API
3
+
4
+ #Generate PDFs from HTML templates via API. Design once, generate thousands.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
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 TemplateFox
17
+ # Response for S3 connection test
18
+ class S3TestResponse < ApiModelBase
19
+ # Whether the connection test succeeded
20
+ attr_accessor :success
21
+
22
+ # Test result message
23
+ attr_accessor :message
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'success' => :'success',
29
+ :'message' => :'message'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'success' => :'Boolean',
47
+ :'message' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::S3TestResponse` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::S3TestResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'success')
74
+ self.success = attributes[:'success']
75
+ else
76
+ self.success = nil
77
+ end
78
+
79
+ if attributes.key?(:'message')
80
+ self.message = attributes[:'message']
81
+ else
82
+ self.message = nil
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
+ invalid_properties = Array.new
91
+ if @success.nil?
92
+ invalid_properties.push('invalid value for "success", success cannot be nil.')
93
+ end
94
+
95
+ if @message.nil?
96
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ warn '[DEPRECATED] the `valid?` method is obsolete'
106
+ return false if @success.nil?
107
+ return false if @message.nil?
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param [Object] success Value to be assigned
113
+ def success=(success)
114
+ if success.nil?
115
+ fail ArgumentError, 'success cannot be nil'
116
+ end
117
+
118
+ @success = success
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] message Value to be assigned
123
+ def message=(message)
124
+ if message.nil?
125
+ fail ArgumentError, 'message cannot be nil'
126
+ end
127
+
128
+ @message = message
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ success == o.success &&
137
+ message == o.message
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Integer] Hash code
148
+ def hash
149
+ [success, message].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def self.build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ attributes = attributes.transform_keys(&:to_sym)
158
+ transformed_hash = {}
159
+ openapi_types.each_pair do |key, type|
160
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
161
+ transformed_hash["#{key}"] = nil
162
+ elsif type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[attribute_map[key]].is_a?(Array)
166
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
167
+ end
168
+ elsif !attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
170
+ end
171
+ end
172
+ new(transformed_hash)
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ if value.nil?
182
+ is_nullable = self.class.openapi_nullable.include?(attr)
183
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
184
+ end
185
+
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ end
192
+
193
+ end