form_api 0.2.0 → 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.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/{.swagger-codegen-ignore → .openapi-generator-ignore} +3 -3
- data/.openapi-generator/VERSION +1 -0
- data/.rubocop.yml +154 -0
- data/Gemfile.lock +15 -16
- data/README.md +30 -28
- data/Rakefile +2 -0
- data/docs/{InlineResponse422.md → AuthenticationError.md} +3 -3
- data/docs/{InlineResponse401.md → AuthenticationSuccessResponse.md} +2 -2
- data/docs/CombinedSubmission.md +14 -0
- data/docs/CombinedSubmissionData.md +11 -0
- data/docs/CreateCombinedSubmissionResponse.md +10 -0
- data/docs/CreateSubmissionBatchResponse.md +12 -0
- data/docs/CreateSubmissionData.md +12 -0
- data/docs/CreateSubmissionDataBatchRequest.md +13 -0
- data/docs/CreateSubmissionResponse.md +10 -0
- data/docs/CreateSubmissionResponse1.md +10 -0
- data/docs/{InlineResponse200.md → Error.md} +3 -2
- data/docs/{InlineResponse400.md → InvalidRequest.md} +3 -3
- data/docs/PDFApi.md +148 -64
- data/docs/Submission.md +16 -0
- data/docs/SubmissionBatch.md +16 -0
- data/docs/SubmissionBatchData.md +11 -0
- data/docs/Template.md +21 -0
- data/form_api.gemspec +6 -11
- data/git_push.sh +3 -3
- data/lib/form_api.rb +22 -15
- data/lib/form_api/api/client.rb +91 -38
- data/lib/form_api/api/pdf_api.rb +222 -109
- data/lib/form_api/api_client.rb +13 -13
- data/lib/form_api/api_error.rb +3 -3
- data/lib/form_api/configuration.rb +26 -5
- data/lib/form_api/models/{inline_response_201_1.rb → authentication_error.rb} +25 -29
- data/lib/form_api/models/{inline_response_200.rb → authentication_success_response.rb} +15 -24
- data/lib/form_api/models/{inline_response_201_combined_submission.rb → combined_submission.rb} +42 -66
- data/lib/form_api/models/{create_combined_submission_body.rb → combined_submission_data.rb} +13 -18
- data/lib/form_api/models/{inline_response_201.rb → create_combined_submission_response.rb} +37 -35
- data/lib/form_api/models/create_submission_batch_response.rb +257 -0
- data/lib/form_api/models/{create_submission_batch_body.rb → create_submission_data.rb} +32 -19
- data/lib/form_api/models/{create_submission_body.rb → create_submission_data_batch_request.rb} +45 -18
- data/lib/form_api/models/create_submission_response.rb +237 -0
- data/lib/form_api/models/create_submission_response1.rb +237 -0
- data/lib/form_api/models/{inline_response_400.rb → error.rb} +17 -21
- data/lib/form_api/models/{inline_response_422.rb → invalid_request.rb} +17 -21
- data/lib/form_api/models/{templatestemplate_idsubmissionsbatch_submission.rb → submission.rb} +40 -26
- data/lib/form_api/models/submission_batch.rb +291 -0
- data/lib/form_api/models/{inline_response_401.rb → submission_batch_data.rb} +48 -24
- data/lib/form_api/models/{inline_response_200_1.rb → template.rb} +88 -152
- data/lib/form_api/version.rb +4 -4
- data/spec/api/client_spec.rb +197 -23
- data/spec/api/pdf_api_spec.rb +168 -63
- data/spec/api_client_spec.rb +37 -37
- data/spec/configuration_spec.rb +11 -11
- data/spec/models/authentication_error_spec.rb +51 -0
- data/spec/models/authentication_success_response_spec.rb +45 -0
- data/spec/models/combined_submission_data_spec.rb +59 -0
- data/spec/models/combined_submission_spec.rb +81 -0
- data/spec/models/create_combined_submission_response_spec.rb +57 -0
- data/spec/models/create_submission_batch_response_spec.rb +69 -0
- data/spec/models/create_submission_data_batch_request_spec.rb +71 -0
- data/spec/models/create_submission_data_spec.rb +65 -0
- data/spec/models/create_submission_response1_spec.rb +57 -0
- data/spec/models/create_submission_response_spec.rb +57 -0
- data/spec/models/error_spec.rb +51 -0
- data/spec/models/invalid_request_spec.rb +51 -0
- data/spec/models/submission_batch_data_spec.rb +59 -0
- data/spec/models/submission_batch_spec.rb +93 -0
- data/spec/models/submission_spec.rb +93 -0
- data/spec/models/template_spec.rb +123 -0
- data/spec/spec_helper.rb +3 -14
- metadata +70 -95
- data/.swagger-codegen/VERSION +0 -1
- data/docs/CreateCombinedSubmissionBody.md +0 -11
- data/docs/CreateSubmissionBatchBody.md +0 -10
- data/docs/CreateSubmissionBody.md +0 -10
- data/docs/InlineResponse2001.md +0 -21
- data/docs/InlineResponse201.md +0 -9
- data/docs/InlineResponse2011.md +0 -9
- data/docs/InlineResponse201CombinedSubmission.md +0 -14
- data/docs/TemplatestemplateIdsubmissionsbatchSubmission.md +0 -14
- data/spec/models/create_combined_submission_body_spec.rb +0 -60
- data/spec/models/create_submission_batch_body_spec.rb +0 -54
- data/spec/models/create_submission_body_spec.rb +0 -54
- data/spec/models/inline_response_200_1_spec.rb +0 -124
- data/spec/models/inline_response_200_spec.rb +0 -46
- data/spec/models/inline_response_201_1_spec.rb +0 -52
- data/spec/models/inline_response_201_combined_submission_spec.rb +0 -82
- data/spec/models/inline_response_201_spec.rb +0 -52
- data/spec/models/inline_response_400_spec.rb +0 -52
- data/spec/models/inline_response_401_spec.rb +0 -42
- data/spec/models/inline_response_422_spec.rb +0 -52
- data/spec/models/templatestemplate_idsubmissionsbatch_submission_spec.rb +0 -82
- data/spec/vcr_cassettes/FormAPI_Client/should_generate_a_PDF_and_wait_for_the_submission_to_be_processed.yml +0 -127
data/lib/form_api/models/{inline_response_201_combined_submission.rb → combined_submission.rb}
RENAMED
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#API V1
|
|
3
3
|
|
|
4
|
-
#No description provided (generated by
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
8
|
-
Generated by: https://
|
|
9
|
-
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 3.3.0-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
require 'date'
|
|
14
14
|
|
|
15
15
|
module FormAPI
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
attr_accessor :id
|
|
16
|
+
class CombinedSubmission
|
|
17
|
+
attr_accessor :metadata
|
|
19
18
|
|
|
20
19
|
attr_accessor :expired
|
|
21
20
|
|
|
22
21
|
attr_accessor :expires_at
|
|
23
22
|
|
|
24
|
-
attr_accessor :
|
|
25
|
-
|
|
26
|
-
attr_accessor :metadata
|
|
23
|
+
attr_accessor :download_url
|
|
27
24
|
|
|
28
25
|
attr_accessor :submission_ids
|
|
29
26
|
|
|
30
|
-
attr_accessor :
|
|
27
|
+
attr_accessor :id
|
|
28
|
+
|
|
29
|
+
attr_accessor :state
|
|
31
30
|
|
|
32
31
|
class EnumAttributeValidator
|
|
33
32
|
attr_reader :datatype
|
|
@@ -54,26 +53,26 @@ module FormAPI
|
|
|
54
53
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
54
|
def self.attribute_map
|
|
56
55
|
{
|
|
57
|
-
:'
|
|
56
|
+
:'metadata' => :'metadata',
|
|
58
57
|
:'expired' => :'expired',
|
|
59
58
|
:'expires_at' => :'expires_at',
|
|
60
|
-
:'
|
|
61
|
-
:'metadata' => :'metadata',
|
|
59
|
+
:'download_url' => :'download_url',
|
|
62
60
|
:'submission_ids' => :'submission_ids',
|
|
63
|
-
:'
|
|
61
|
+
:'id' => :'id',
|
|
62
|
+
:'state' => :'state'
|
|
64
63
|
}
|
|
65
64
|
end
|
|
66
65
|
|
|
67
66
|
# Attribute type mapping.
|
|
68
|
-
def self.
|
|
67
|
+
def self.openapi_types
|
|
69
68
|
{
|
|
70
|
-
:'
|
|
69
|
+
:'metadata' => :'Object',
|
|
71
70
|
:'expired' => :'BOOLEAN',
|
|
72
71
|
:'expires_at' => :'String',
|
|
73
|
-
:'
|
|
74
|
-
:'metadata' => :'Object',
|
|
72
|
+
:'download_url' => :'String',
|
|
75
73
|
:'submission_ids' => :'Array<String>',
|
|
76
|
-
:'
|
|
74
|
+
:'id' => :'String',
|
|
75
|
+
:'state' => :'String'
|
|
77
76
|
}
|
|
78
77
|
end
|
|
79
78
|
|
|
@@ -83,10 +82,10 @@ module FormAPI
|
|
|
83
82
|
return unless attributes.is_a?(Hash)
|
|
84
83
|
|
|
85
84
|
# convert string to symbol for hash key
|
|
86
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
87
86
|
|
|
88
|
-
if attributes.has_key?(:'
|
|
89
|
-
self.
|
|
87
|
+
if attributes.has_key?(:'metadata')
|
|
88
|
+
self.metadata = attributes[:'metadata']
|
|
90
89
|
end
|
|
91
90
|
|
|
92
91
|
if attributes.has_key?(:'expired')
|
|
@@ -97,12 +96,8 @@ module FormAPI
|
|
|
97
96
|
self.expires_at = attributes[:'expires_at']
|
|
98
97
|
end
|
|
99
98
|
|
|
100
|
-
if attributes.has_key?(:'
|
|
101
|
-
self.
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
if attributes.has_key?(:'metadata')
|
|
105
|
-
self.metadata = attributes[:'metadata']
|
|
99
|
+
if attributes.has_key?(:'download_url')
|
|
100
|
+
self.download_url = attributes[:'download_url']
|
|
106
101
|
end
|
|
107
102
|
|
|
108
103
|
if attributes.has_key?(:'submission_ids')
|
|
@@ -111,53 +106,36 @@ module FormAPI
|
|
|
111
106
|
end
|
|
112
107
|
end
|
|
113
108
|
|
|
114
|
-
if attributes.has_key?(:'
|
|
115
|
-
self.
|
|
109
|
+
if attributes.has_key?(:'id')
|
|
110
|
+
self.id = attributes[:'id']
|
|
116
111
|
end
|
|
117
112
|
|
|
113
|
+
if attributes.has_key?(:'state')
|
|
114
|
+
self.state = attributes[:'state']
|
|
115
|
+
end
|
|
118
116
|
end
|
|
119
117
|
|
|
120
118
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
121
|
-
# @return Array for valid
|
|
119
|
+
# @return Array for valid properties with the reasons
|
|
122
120
|
def list_invalid_properties
|
|
123
121
|
invalid_properties = Array.new
|
|
124
|
-
|
|
125
|
-
invalid_properties.push("invalid value for 'id', id cannot be nil.")
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
if @expired.nil?
|
|
129
|
-
invalid_properties.push("invalid value for 'expired', expired cannot be nil.")
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
if @state.nil?
|
|
133
|
-
invalid_properties.push("invalid value for 'state', state cannot be nil.")
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
if @submission_ids.nil?
|
|
137
|
-
invalid_properties.push("invalid value for 'submission_ids', submission_ids cannot be nil.")
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
return invalid_properties
|
|
122
|
+
invalid_properties
|
|
141
123
|
end
|
|
142
124
|
|
|
143
125
|
# Check to see if the all the properties in the model are valid
|
|
144
126
|
# @return true if the model is valid
|
|
145
127
|
def valid?
|
|
146
|
-
|
|
147
|
-
return false if @expired.nil?
|
|
148
|
-
return false if @state.nil?
|
|
149
|
-
state_validator = EnumAttributeValidator.new('String', ["pending", "processed", "error"])
|
|
128
|
+
state_validator = EnumAttributeValidator.new('String', ['pending', 'processed', 'error'])
|
|
150
129
|
return false unless state_validator.valid?(@state)
|
|
151
|
-
|
|
152
|
-
return true
|
|
130
|
+
true
|
|
153
131
|
end
|
|
154
132
|
|
|
155
133
|
# Custom attribute writer method checking allowed values (enum).
|
|
156
134
|
# @param [Object] state Object to be assigned
|
|
157
135
|
def state=(state)
|
|
158
|
-
validator = EnumAttributeValidator.new('String', [
|
|
136
|
+
validator = EnumAttributeValidator.new('String', ['pending', 'processed', 'error'])
|
|
159
137
|
unless validator.valid?(state)
|
|
160
|
-
fail ArgumentError,
|
|
138
|
+
fail ArgumentError, 'invalid value for "state", must be one of #{validator.allowable_values}.'
|
|
161
139
|
end
|
|
162
140
|
@state = state
|
|
163
141
|
end
|
|
@@ -167,13 +145,13 @@ module FormAPI
|
|
|
167
145
|
def ==(o)
|
|
168
146
|
return true if self.equal?(o)
|
|
169
147
|
self.class == o.class &&
|
|
170
|
-
|
|
148
|
+
metadata == o.metadata &&
|
|
171
149
|
expired == o.expired &&
|
|
172
150
|
expires_at == o.expires_at &&
|
|
173
|
-
|
|
174
|
-
metadata == o.metadata &&
|
|
151
|
+
download_url == o.download_url &&
|
|
175
152
|
submission_ids == o.submission_ids &&
|
|
176
|
-
|
|
153
|
+
id == o.id &&
|
|
154
|
+
state == o.state
|
|
177
155
|
end
|
|
178
156
|
|
|
179
157
|
# @see the `==` method
|
|
@@ -185,7 +163,7 @@ module FormAPI
|
|
|
185
163
|
# Calculates hash code according to all attributes.
|
|
186
164
|
# @return [Fixnum] Hash code
|
|
187
165
|
def hash
|
|
188
|
-
[
|
|
166
|
+
[metadata, expired, expires_at, download_url, submission_ids, id, state].hash
|
|
189
167
|
end
|
|
190
168
|
|
|
191
169
|
# Builds the object from hash
|
|
@@ -193,12 +171,12 @@ module FormAPI
|
|
|
193
171
|
# @return [Object] Returns the model itself
|
|
194
172
|
def build_from_hash(attributes)
|
|
195
173
|
return nil unless attributes.is_a?(Hash)
|
|
196
|
-
self.class.
|
|
174
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
197
175
|
if type =~ /\AArray<(.*)>/i
|
|
198
176
|
# check to ensure the input is an array given that the the attribute
|
|
199
177
|
# is documented as an array but the input is not
|
|
200
178
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
201
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
|
179
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
202
180
|
end
|
|
203
181
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
204
182
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
@@ -280,7 +258,7 @@ module FormAPI
|
|
|
280
258
|
# @return [Hash] Returns the value in the form of hash
|
|
281
259
|
def _to_hash(value)
|
|
282
260
|
if value.is_a?(Array)
|
|
283
|
-
value.compact.map{ |v| _to_hash(v) }
|
|
261
|
+
value.compact.map { |v| _to_hash(v) }
|
|
284
262
|
elsif value.is_a?(Hash)
|
|
285
263
|
{}.tap do |hash|
|
|
286
264
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
@@ -291,7 +269,5 @@ module FormAPI
|
|
|
291
269
|
value
|
|
292
270
|
end
|
|
293
271
|
end
|
|
294
|
-
|
|
295
272
|
end
|
|
296
|
-
|
|
297
273
|
end
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#API V1
|
|
3
3
|
|
|
4
|
-
#No description provided (generated by
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
8
|
-
Generated by: https://
|
|
9
|
-
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 3.3.0-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
require 'date'
|
|
14
14
|
|
|
15
15
|
module FormAPI
|
|
16
|
-
|
|
17
|
-
class CreateCombinedSubmissionBody
|
|
16
|
+
class CombinedSubmissionData
|
|
18
17
|
attr_accessor :test
|
|
19
18
|
|
|
20
19
|
attr_accessor :submission_ids
|
|
@@ -23,7 +22,6 @@ module FormAPI
|
|
|
23
22
|
|
|
24
23
|
attr_accessor :expires_in
|
|
25
24
|
|
|
26
|
-
|
|
27
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
26
|
def self.attribute_map
|
|
29
27
|
{
|
|
@@ -35,7 +33,7 @@ module FormAPI
|
|
|
35
33
|
end
|
|
36
34
|
|
|
37
35
|
# Attribute type mapping.
|
|
38
|
-
def self.
|
|
36
|
+
def self.openapi_types
|
|
39
37
|
{
|
|
40
38
|
:'test' => :'BOOLEAN',
|
|
41
39
|
:'submission_ids' => :'Array<String>',
|
|
@@ -50,7 +48,7 @@ module FormAPI
|
|
|
50
48
|
return unless attributes.is_a?(Hash)
|
|
51
49
|
|
|
52
50
|
# convert string to symbol for hash key
|
|
53
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
54
52
|
|
|
55
53
|
if attributes.has_key?(:'test')
|
|
56
54
|
self.test = attributes[:'test']
|
|
@@ -69,25 +67,24 @@ module FormAPI
|
|
|
69
67
|
if attributes.has_key?(:'expires_in')
|
|
70
68
|
self.expires_in = attributes[:'expires_in']
|
|
71
69
|
end
|
|
72
|
-
|
|
73
70
|
end
|
|
74
71
|
|
|
75
72
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
76
|
-
# @return Array for valid
|
|
73
|
+
# @return Array for valid properties with the reasons
|
|
77
74
|
def list_invalid_properties
|
|
78
75
|
invalid_properties = Array.new
|
|
79
76
|
if @submission_ids.nil?
|
|
80
|
-
invalid_properties.push(
|
|
77
|
+
invalid_properties.push('invalid value for "submission_ids", submission_ids cannot be nil.')
|
|
81
78
|
end
|
|
82
79
|
|
|
83
|
-
|
|
80
|
+
invalid_properties
|
|
84
81
|
end
|
|
85
82
|
|
|
86
83
|
# Check to see if the all the properties in the model are valid
|
|
87
84
|
# @return true if the model is valid
|
|
88
85
|
def valid?
|
|
89
86
|
return false if @submission_ids.nil?
|
|
90
|
-
|
|
87
|
+
true
|
|
91
88
|
end
|
|
92
89
|
|
|
93
90
|
# Checks equality by comparing each attribute.
|
|
@@ -118,12 +115,12 @@ module FormAPI
|
|
|
118
115
|
# @return [Object] Returns the model itself
|
|
119
116
|
def build_from_hash(attributes)
|
|
120
117
|
return nil unless attributes.is_a?(Hash)
|
|
121
|
-
self.class.
|
|
118
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
122
119
|
if type =~ /\AArray<(.*)>/i
|
|
123
120
|
# check to ensure the input is an array given that the the attribute
|
|
124
121
|
# is documented as an array but the input is not
|
|
125
122
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
126
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
|
123
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
127
124
|
end
|
|
128
125
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
129
126
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
@@ -205,7 +202,7 @@ module FormAPI
|
|
|
205
202
|
# @return [Hash] Returns the value in the form of hash
|
|
206
203
|
def _to_hash(value)
|
|
207
204
|
if value.is_a?(Array)
|
|
208
|
-
value.compact.map{ |v| _to_hash(v) }
|
|
205
|
+
value.compact.map { |v| _to_hash(v) }
|
|
209
206
|
elsif value.is_a?(Hash)
|
|
210
207
|
{}.tap do |hash|
|
|
211
208
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
@@ -216,7 +213,5 @@ module FormAPI
|
|
|
216
213
|
value
|
|
217
214
|
end
|
|
218
215
|
end
|
|
219
|
-
|
|
220
216
|
end
|
|
221
|
-
|
|
222
217
|
end
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#API V1
|
|
3
3
|
|
|
4
|
-
#No description provided (generated by
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
6
|
OpenAPI spec version: v1
|
|
7
7
|
|
|
8
|
-
Generated by: https://
|
|
9
|
-
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 3.3.0-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
require 'date'
|
|
14
14
|
|
|
15
15
|
module FormAPI
|
|
16
|
+
class CreateCombinedSubmissionResponse
|
|
17
|
+
attr_accessor :combined_submission
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
attr_accessor :status
|
|
19
|
+
attr_accessor :errors
|
|
19
20
|
|
|
20
|
-
attr_accessor :
|
|
21
|
+
attr_accessor :status
|
|
21
22
|
|
|
22
23
|
class EnumAttributeValidator
|
|
23
24
|
attr_reader :datatype
|
|
@@ -44,16 +45,18 @@ module FormAPI
|
|
|
44
45
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
45
46
|
def self.attribute_map
|
|
46
47
|
{
|
|
47
|
-
:'
|
|
48
|
-
:'
|
|
48
|
+
:'combined_submission' => :'combined_submission',
|
|
49
|
+
:'errors' => :'errors',
|
|
50
|
+
:'status' => :'status'
|
|
49
51
|
}
|
|
50
52
|
end
|
|
51
53
|
|
|
52
54
|
# Attribute type mapping.
|
|
53
|
-
def self.
|
|
55
|
+
def self.openapi_types
|
|
54
56
|
{
|
|
55
|
-
:'
|
|
56
|
-
:'
|
|
57
|
+
:'combined_submission' => :'CombinedSubmission',
|
|
58
|
+
:'errors' => :'Array<String>',
|
|
59
|
+
:'status' => :'String'
|
|
57
60
|
}
|
|
58
61
|
end
|
|
59
62
|
|
|
@@ -63,44 +66,44 @@ module FormAPI
|
|
|
63
66
|
return unless attributes.is_a?(Hash)
|
|
64
67
|
|
|
65
68
|
# convert string to symbol for hash key
|
|
66
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
67
|
-
|
|
68
|
-
if attributes.has_key?(:'status')
|
|
69
|
-
self.status = attributes[:'status']
|
|
70
|
-
end
|
|
69
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
71
70
|
|
|
72
71
|
if attributes.has_key?(:'combined_submission')
|
|
73
72
|
self.combined_submission = attributes[:'combined_submission']
|
|
74
73
|
end
|
|
75
74
|
|
|
75
|
+
if attributes.has_key?(:'errors')
|
|
76
|
+
if (value = attributes[:'errors']).is_a?(Array)
|
|
77
|
+
self.errors = value
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if attributes.has_key?(:'status')
|
|
82
|
+
self.status = attributes[:'status']
|
|
83
|
+
end
|
|
76
84
|
end
|
|
77
85
|
|
|
78
86
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
79
|
-
# @return Array for valid
|
|
87
|
+
# @return Array for valid properties with the reasons
|
|
80
88
|
def list_invalid_properties
|
|
81
89
|
invalid_properties = Array.new
|
|
82
|
-
|
|
83
|
-
invalid_properties.push("invalid value for 'status', status cannot be nil.")
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
return invalid_properties
|
|
90
|
+
invalid_properties
|
|
87
91
|
end
|
|
88
92
|
|
|
89
93
|
# Check to see if the all the properties in the model are valid
|
|
90
94
|
# @return true if the model is valid
|
|
91
95
|
def valid?
|
|
92
|
-
|
|
93
|
-
status_validator = EnumAttributeValidator.new('String', ["success", "error"])
|
|
96
|
+
status_validator = EnumAttributeValidator.new('String', ['success', 'error'])
|
|
94
97
|
return false unless status_validator.valid?(@status)
|
|
95
|
-
|
|
98
|
+
true
|
|
96
99
|
end
|
|
97
100
|
|
|
98
101
|
# Custom attribute writer method checking allowed values (enum).
|
|
99
102
|
# @param [Object] status Object to be assigned
|
|
100
103
|
def status=(status)
|
|
101
|
-
validator = EnumAttributeValidator.new('String', [
|
|
104
|
+
validator = EnumAttributeValidator.new('String', ['success', 'error'])
|
|
102
105
|
unless validator.valid?(status)
|
|
103
|
-
fail ArgumentError,
|
|
106
|
+
fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
|
|
104
107
|
end
|
|
105
108
|
@status = status
|
|
106
109
|
end
|
|
@@ -110,8 +113,9 @@ module FormAPI
|
|
|
110
113
|
def ==(o)
|
|
111
114
|
return true if self.equal?(o)
|
|
112
115
|
self.class == o.class &&
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
combined_submission == o.combined_submission &&
|
|
117
|
+
errors == o.errors &&
|
|
118
|
+
status == o.status
|
|
115
119
|
end
|
|
116
120
|
|
|
117
121
|
# @see the `==` method
|
|
@@ -123,7 +127,7 @@ module FormAPI
|
|
|
123
127
|
# Calculates hash code according to all attributes.
|
|
124
128
|
# @return [Fixnum] Hash code
|
|
125
129
|
def hash
|
|
126
|
-
[
|
|
130
|
+
[combined_submission, errors, status].hash
|
|
127
131
|
end
|
|
128
132
|
|
|
129
133
|
# Builds the object from hash
|
|
@@ -131,12 +135,12 @@ module FormAPI
|
|
|
131
135
|
# @return [Object] Returns the model itself
|
|
132
136
|
def build_from_hash(attributes)
|
|
133
137
|
return nil unless attributes.is_a?(Hash)
|
|
134
|
-
self.class.
|
|
138
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
135
139
|
if type =~ /\AArray<(.*)>/i
|
|
136
140
|
# check to ensure the input is an array given that the the attribute
|
|
137
141
|
# is documented as an array but the input is not
|
|
138
142
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
139
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
|
143
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
140
144
|
end
|
|
141
145
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
142
146
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
@@ -218,7 +222,7 @@ module FormAPI
|
|
|
218
222
|
# @return [Hash] Returns the value in the form of hash
|
|
219
223
|
def _to_hash(value)
|
|
220
224
|
if value.is_a?(Array)
|
|
221
|
-
value.compact.map{ |v| _to_hash(v) }
|
|
225
|
+
value.compact.map { |v| _to_hash(v) }
|
|
222
226
|
elsif value.is_a?(Hash)
|
|
223
227
|
{}.tap do |hash|
|
|
224
228
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
@@ -229,7 +233,5 @@ module FormAPI
|
|
|
229
233
|
value
|
|
230
234
|
end
|
|
231
235
|
end
|
|
232
|
-
|
|
233
236
|
end
|
|
234
|
-
|
|
235
237
|
end
|