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
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#API V1
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 3.3.0-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module FormAPI
|
|
16
|
+
class CreateSubmissionBatchResponse
|
|
17
|
+
attr_accessor :submission_batch
|
|
18
|
+
|
|
19
|
+
attr_accessor :submissions
|
|
20
|
+
|
|
21
|
+
attr_accessor :error
|
|
22
|
+
|
|
23
|
+
attr_accessor :errors
|
|
24
|
+
|
|
25
|
+
attr_accessor :status
|
|
26
|
+
|
|
27
|
+
class EnumAttributeValidator
|
|
28
|
+
attr_reader :datatype
|
|
29
|
+
attr_reader :allowable_values
|
|
30
|
+
|
|
31
|
+
def initialize(datatype, allowable_values)
|
|
32
|
+
@allowable_values = allowable_values.map do |value|
|
|
33
|
+
case datatype.to_s
|
|
34
|
+
when /Integer/i
|
|
35
|
+
value.to_i
|
|
36
|
+
when /Float/i
|
|
37
|
+
value.to_f
|
|
38
|
+
else
|
|
39
|
+
value
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def valid?(value)
|
|
45
|
+
!value || allowable_values.include?(value)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
50
|
+
def self.attribute_map
|
|
51
|
+
{
|
|
52
|
+
:'submission_batch' => :'submission_batch',
|
|
53
|
+
:'submissions' => :'submissions',
|
|
54
|
+
:'error' => :'error',
|
|
55
|
+
:'errors' => :'errors',
|
|
56
|
+
:'status' => :'status'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Attribute type mapping.
|
|
61
|
+
def self.openapi_types
|
|
62
|
+
{
|
|
63
|
+
:'submission_batch' => :'SubmissionBatch',
|
|
64
|
+
:'submissions' => :'Array<CreateSubmissionResponse1>',
|
|
65
|
+
:'error' => :'String',
|
|
66
|
+
:'errors' => :'Array<String>',
|
|
67
|
+
:'status' => :'String'
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Initializes the object
|
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
73
|
+
def initialize(attributes = {})
|
|
74
|
+
return unless attributes.is_a?(Hash)
|
|
75
|
+
|
|
76
|
+
# convert string to symbol for hash key
|
|
77
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
78
|
+
|
|
79
|
+
if attributes.has_key?(:'submission_batch')
|
|
80
|
+
self.submission_batch = attributes[:'submission_batch']
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if attributes.has_key?(:'submissions')
|
|
84
|
+
if (value = attributes[:'submissions']).is_a?(Array)
|
|
85
|
+
self.submissions = value
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.has_key?(:'error')
|
|
90
|
+
self.error = attributes[:'error']
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.has_key?(:'errors')
|
|
94
|
+
if (value = attributes[:'errors']).is_a?(Array)
|
|
95
|
+
self.errors = value
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.has_key?(:'status')
|
|
100
|
+
self.status = attributes[:'status']
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
105
|
+
# @return Array for valid properties with the reasons
|
|
106
|
+
def list_invalid_properties
|
|
107
|
+
invalid_properties = Array.new
|
|
108
|
+
invalid_properties
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Check to see if the all the properties in the model are valid
|
|
112
|
+
# @return true if the model is valid
|
|
113
|
+
def valid?
|
|
114
|
+
status_validator = EnumAttributeValidator.new('String', ['success', 'error'])
|
|
115
|
+
return false unless status_validator.valid?(@status)
|
|
116
|
+
true
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
120
|
+
# @param [Object] status Object to be assigned
|
|
121
|
+
def status=(status)
|
|
122
|
+
validator = EnumAttributeValidator.new('String', ['success', 'error'])
|
|
123
|
+
unless validator.valid?(status)
|
|
124
|
+
fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
|
|
125
|
+
end
|
|
126
|
+
@status = status
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Checks equality by comparing each attribute.
|
|
130
|
+
# @param [Object] Object to be compared
|
|
131
|
+
def ==(o)
|
|
132
|
+
return true if self.equal?(o)
|
|
133
|
+
self.class == o.class &&
|
|
134
|
+
submission_batch == o.submission_batch &&
|
|
135
|
+
submissions == o.submissions &&
|
|
136
|
+
error == o.error &&
|
|
137
|
+
errors == o.errors &&
|
|
138
|
+
status == o.status
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# @see the `==` method
|
|
142
|
+
# @param [Object] Object to be compared
|
|
143
|
+
def eql?(o)
|
|
144
|
+
self == o
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Calculates hash code according to all attributes.
|
|
148
|
+
# @return [Fixnum] Hash code
|
|
149
|
+
def hash
|
|
150
|
+
[submission_batch, submissions, error, errors, status].hash
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Builds the object from hash
|
|
154
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
155
|
+
# @return [Object] Returns the model itself
|
|
156
|
+
def build_from_hash(attributes)
|
|
157
|
+
return nil unless attributes.is_a?(Hash)
|
|
158
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
159
|
+
if type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
163
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
166
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
167
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
self
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Deserializes the data based on type
|
|
174
|
+
# @param string type Data type
|
|
175
|
+
# @param string value Value to be deserialized
|
|
176
|
+
# @return [Object] Deserialized data
|
|
177
|
+
def _deserialize(type, value)
|
|
178
|
+
case type.to_sym
|
|
179
|
+
when :DateTime
|
|
180
|
+
DateTime.parse(value)
|
|
181
|
+
when :Date
|
|
182
|
+
Date.parse(value)
|
|
183
|
+
when :String
|
|
184
|
+
value.to_s
|
|
185
|
+
when :Integer
|
|
186
|
+
value.to_i
|
|
187
|
+
when :Float
|
|
188
|
+
value.to_f
|
|
189
|
+
when :BOOLEAN
|
|
190
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
191
|
+
true
|
|
192
|
+
else
|
|
193
|
+
false
|
|
194
|
+
end
|
|
195
|
+
when :Object
|
|
196
|
+
# generic object (usually a Hash), return directly
|
|
197
|
+
value
|
|
198
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
199
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
200
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
201
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
202
|
+
k_type = Regexp.last_match[:k_type]
|
|
203
|
+
v_type = Regexp.last_match[:v_type]
|
|
204
|
+
{}.tap do |hash|
|
|
205
|
+
value.each do |k, v|
|
|
206
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
else # model
|
|
210
|
+
temp_model = FormAPI.const_get(type).new
|
|
211
|
+
temp_model.build_from_hash(value)
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Returns the string representation of the object
|
|
216
|
+
# @return [String] String presentation of the object
|
|
217
|
+
def to_s
|
|
218
|
+
to_hash.to_s
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
|
223
|
+
def to_body
|
|
224
|
+
to_hash
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Returns the object in the form of hash
|
|
228
|
+
# @return [Hash] Returns the object in the form of hash
|
|
229
|
+
def to_hash
|
|
230
|
+
hash = {}
|
|
231
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
232
|
+
value = self.send(attr)
|
|
233
|
+
next if value.nil?
|
|
234
|
+
hash[param] = _to_hash(value)
|
|
235
|
+
end
|
|
236
|
+
hash
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Outputs non-array value in the form of hash
|
|
240
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
241
|
+
# @param [Object] value Any valid value
|
|
242
|
+
# @return [Hash] Returns the value in the form of hash
|
|
243
|
+
def _to_hash(value)
|
|
244
|
+
if value.is_a?(Array)
|
|
245
|
+
value.compact.map { |v| _to_hash(v) }
|
|
246
|
+
elsif value.is_a?(Hash)
|
|
247
|
+
{}.tap do |hash|
|
|
248
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
249
|
+
end
|
|
250
|
+
elsif value.respond_to? :to_hash
|
|
251
|
+
value.to_hash
|
|
252
|
+
else
|
|
253
|
+
value
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
end
|
|
@@ -1,41 +1,47 @@
|
|
|
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 CreateSubmissionBatchBody
|
|
16
|
+
class CreateSubmissionData
|
|
18
17
|
attr_accessor :test
|
|
19
18
|
|
|
20
19
|
attr_accessor :data
|
|
21
20
|
|
|
22
|
-
attr_accessor :
|
|
21
|
+
attr_accessor :html
|
|
22
|
+
|
|
23
|
+
attr_accessor :css
|
|
23
24
|
|
|
25
|
+
attr_accessor :metadata
|
|
24
26
|
|
|
25
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
28
|
def self.attribute_map
|
|
27
29
|
{
|
|
28
30
|
:'test' => :'test',
|
|
29
31
|
:'data' => :'data',
|
|
32
|
+
:'html' => :'html',
|
|
33
|
+
:'css' => :'css',
|
|
30
34
|
:'metadata' => :'metadata'
|
|
31
35
|
}
|
|
32
36
|
end
|
|
33
37
|
|
|
34
38
|
# Attribute type mapping.
|
|
35
|
-
def self.
|
|
39
|
+
def self.openapi_types
|
|
36
40
|
{
|
|
37
41
|
:'test' => :'BOOLEAN',
|
|
38
42
|
:'data' => :'Object',
|
|
43
|
+
:'html' => :'String',
|
|
44
|
+
:'css' => :'String',
|
|
39
45
|
:'metadata' => :'Object'
|
|
40
46
|
}
|
|
41
47
|
end
|
|
@@ -46,7 +52,7 @@ module FormAPI
|
|
|
46
52
|
return unless attributes.is_a?(Hash)
|
|
47
53
|
|
|
48
54
|
# convert string to symbol for hash key
|
|
49
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
50
56
|
|
|
51
57
|
if attributes.has_key?(:'test')
|
|
52
58
|
self.test = attributes[:'test']
|
|
@@ -56,28 +62,35 @@ module FormAPI
|
|
|
56
62
|
self.data = attributes[:'data']
|
|
57
63
|
end
|
|
58
64
|
|
|
65
|
+
if attributes.has_key?(:'html')
|
|
66
|
+
self.html = attributes[:'html']
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
if attributes.has_key?(:'css')
|
|
70
|
+
self.css = attributes[:'css']
|
|
71
|
+
end
|
|
72
|
+
|
|
59
73
|
if attributes.has_key?(:'metadata')
|
|
60
74
|
self.metadata = attributes[:'metadata']
|
|
61
75
|
end
|
|
62
|
-
|
|
63
76
|
end
|
|
64
77
|
|
|
65
78
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
66
|
-
# @return Array for valid
|
|
79
|
+
# @return Array for valid properties with the reasons
|
|
67
80
|
def list_invalid_properties
|
|
68
81
|
invalid_properties = Array.new
|
|
69
82
|
if @data.nil?
|
|
70
|
-
invalid_properties.push(
|
|
83
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
71
84
|
end
|
|
72
85
|
|
|
73
|
-
|
|
86
|
+
invalid_properties
|
|
74
87
|
end
|
|
75
88
|
|
|
76
89
|
# Check to see if the all the properties in the model are valid
|
|
77
90
|
# @return true if the model is valid
|
|
78
91
|
def valid?
|
|
79
92
|
return false if @data.nil?
|
|
80
|
-
|
|
93
|
+
true
|
|
81
94
|
end
|
|
82
95
|
|
|
83
96
|
# Checks equality by comparing each attribute.
|
|
@@ -87,6 +100,8 @@ module FormAPI
|
|
|
87
100
|
self.class == o.class &&
|
|
88
101
|
test == o.test &&
|
|
89
102
|
data == o.data &&
|
|
103
|
+
html == o.html &&
|
|
104
|
+
css == o.css &&
|
|
90
105
|
metadata == o.metadata
|
|
91
106
|
end
|
|
92
107
|
|
|
@@ -99,7 +114,7 @@ module FormAPI
|
|
|
99
114
|
# Calculates hash code according to all attributes.
|
|
100
115
|
# @return [Fixnum] Hash code
|
|
101
116
|
def hash
|
|
102
|
-
[test, data, metadata].hash
|
|
117
|
+
[test, data, html, css, metadata].hash
|
|
103
118
|
end
|
|
104
119
|
|
|
105
120
|
# Builds the object from hash
|
|
@@ -107,12 +122,12 @@ module FormAPI
|
|
|
107
122
|
# @return [Object] Returns the model itself
|
|
108
123
|
def build_from_hash(attributes)
|
|
109
124
|
return nil unless attributes.is_a?(Hash)
|
|
110
|
-
self.class.
|
|
125
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
111
126
|
if type =~ /\AArray<(.*)>/i
|
|
112
127
|
# check to ensure the input is an array given that the the attribute
|
|
113
128
|
# is documented as an array but the input is not
|
|
114
129
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
115
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
|
130
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
116
131
|
end
|
|
117
132
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
118
133
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
@@ -194,7 +209,7 @@ module FormAPI
|
|
|
194
209
|
# @return [Hash] Returns the value in the form of hash
|
|
195
210
|
def _to_hash(value)
|
|
196
211
|
if value.is_a?(Array)
|
|
197
|
-
value.compact.map{ |v| _to_hash(v) }
|
|
212
|
+
value.compact.map { |v| _to_hash(v) }
|
|
198
213
|
elsif value.is_a?(Hash)
|
|
199
214
|
{}.tap do |hash|
|
|
200
215
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
@@ -205,7 +220,5 @@ module FormAPI
|
|
|
205
220
|
value
|
|
206
221
|
end
|
|
207
222
|
end
|
|
208
|
-
|
|
209
223
|
end
|
|
210
|
-
|
|
211
224
|
end
|
data/lib/form_api/models/{create_submission_body.rb → create_submission_data_batch_request.rb}
RENAMED
|
@@ -1,41 +1,51 @@
|
|
|
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 CreateSubmissionDataBatchRequest
|
|
17
|
+
attr_accessor :template_id
|
|
16
18
|
|
|
17
|
-
class CreateSubmissionBody
|
|
18
19
|
attr_accessor :test
|
|
19
20
|
|
|
20
21
|
attr_accessor :data
|
|
21
22
|
|
|
22
|
-
attr_accessor :
|
|
23
|
+
attr_accessor :html
|
|
24
|
+
|
|
25
|
+
attr_accessor :css
|
|
23
26
|
|
|
27
|
+
attr_accessor :metadata
|
|
24
28
|
|
|
25
29
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
30
|
def self.attribute_map
|
|
27
31
|
{
|
|
32
|
+
:'template_id' => :'template_id',
|
|
28
33
|
:'test' => :'test',
|
|
29
34
|
:'data' => :'data',
|
|
35
|
+
:'html' => :'html',
|
|
36
|
+
:'css' => :'css',
|
|
30
37
|
:'metadata' => :'metadata'
|
|
31
38
|
}
|
|
32
39
|
end
|
|
33
40
|
|
|
34
41
|
# Attribute type mapping.
|
|
35
|
-
def self.
|
|
42
|
+
def self.openapi_types
|
|
36
43
|
{
|
|
44
|
+
:'template_id' => :'String',
|
|
37
45
|
:'test' => :'BOOLEAN',
|
|
38
46
|
:'data' => :'Object',
|
|
47
|
+
:'html' => :'String',
|
|
48
|
+
:'css' => :'String',
|
|
39
49
|
:'metadata' => :'Object'
|
|
40
50
|
}
|
|
41
51
|
end
|
|
@@ -46,7 +56,11 @@ module FormAPI
|
|
|
46
56
|
return unless attributes.is_a?(Hash)
|
|
47
57
|
|
|
48
58
|
# convert string to symbol for hash key
|
|
49
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
60
|
+
|
|
61
|
+
if attributes.has_key?(:'template_id')
|
|
62
|
+
self.template_id = attributes[:'template_id']
|
|
63
|
+
end
|
|
50
64
|
|
|
51
65
|
if attributes.has_key?(:'test')
|
|
52
66
|
self.test = attributes[:'test']
|
|
@@ -56,28 +70,40 @@ module FormAPI
|
|
|
56
70
|
self.data = attributes[:'data']
|
|
57
71
|
end
|
|
58
72
|
|
|
73
|
+
if attributes.has_key?(:'html')
|
|
74
|
+
self.html = attributes[:'html']
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes.has_key?(:'css')
|
|
78
|
+
self.css = attributes[:'css']
|
|
79
|
+
end
|
|
80
|
+
|
|
59
81
|
if attributes.has_key?(:'metadata')
|
|
60
82
|
self.metadata = attributes[:'metadata']
|
|
61
83
|
end
|
|
62
|
-
|
|
63
84
|
end
|
|
64
85
|
|
|
65
86
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
66
|
-
# @return Array for valid
|
|
87
|
+
# @return Array for valid properties with the reasons
|
|
67
88
|
def list_invalid_properties
|
|
68
89
|
invalid_properties = Array.new
|
|
90
|
+
if @template_id.nil?
|
|
91
|
+
invalid_properties.push('invalid value for "template_id", template_id cannot be nil.')
|
|
92
|
+
end
|
|
93
|
+
|
|
69
94
|
if @data.nil?
|
|
70
|
-
invalid_properties.push(
|
|
95
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
71
96
|
end
|
|
72
97
|
|
|
73
|
-
|
|
98
|
+
invalid_properties
|
|
74
99
|
end
|
|
75
100
|
|
|
76
101
|
# Check to see if the all the properties in the model are valid
|
|
77
102
|
# @return true if the model is valid
|
|
78
103
|
def valid?
|
|
104
|
+
return false if @template_id.nil?
|
|
79
105
|
return false if @data.nil?
|
|
80
|
-
|
|
106
|
+
true
|
|
81
107
|
end
|
|
82
108
|
|
|
83
109
|
# Checks equality by comparing each attribute.
|
|
@@ -85,8 +111,11 @@ module FormAPI
|
|
|
85
111
|
def ==(o)
|
|
86
112
|
return true if self.equal?(o)
|
|
87
113
|
self.class == o.class &&
|
|
114
|
+
template_id == o.template_id &&
|
|
88
115
|
test == o.test &&
|
|
89
116
|
data == o.data &&
|
|
117
|
+
html == o.html &&
|
|
118
|
+
css == o.css &&
|
|
90
119
|
metadata == o.metadata
|
|
91
120
|
end
|
|
92
121
|
|
|
@@ -99,7 +128,7 @@ module FormAPI
|
|
|
99
128
|
# Calculates hash code according to all attributes.
|
|
100
129
|
# @return [Fixnum] Hash code
|
|
101
130
|
def hash
|
|
102
|
-
[test, data, metadata].hash
|
|
131
|
+
[template_id, test, data, html, css, metadata].hash
|
|
103
132
|
end
|
|
104
133
|
|
|
105
134
|
# Builds the object from hash
|
|
@@ -107,12 +136,12 @@ module FormAPI
|
|
|
107
136
|
# @return [Object] Returns the model itself
|
|
108
137
|
def build_from_hash(attributes)
|
|
109
138
|
return nil unless attributes.is_a?(Hash)
|
|
110
|
-
self.class.
|
|
139
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
111
140
|
if type =~ /\AArray<(.*)>/i
|
|
112
141
|
# check to ensure the input is an array given that the the attribute
|
|
113
142
|
# is documented as an array but the input is not
|
|
114
143
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
115
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
|
144
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
116
145
|
end
|
|
117
146
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
118
147
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
@@ -194,7 +223,7 @@ module FormAPI
|
|
|
194
223
|
# @return [Hash] Returns the value in the form of hash
|
|
195
224
|
def _to_hash(value)
|
|
196
225
|
if value.is_a?(Array)
|
|
197
|
-
value.compact.map{ |v| _to_hash(v) }
|
|
226
|
+
value.compact.map { |v| _to_hash(v) }
|
|
198
227
|
elsif value.is_a?(Hash)
|
|
199
228
|
{}.tap do |hash|
|
|
200
229
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
@@ -205,7 +234,5 @@ module FormAPI
|
|
|
205
234
|
value
|
|
206
235
|
end
|
|
207
236
|
end
|
|
208
|
-
|
|
209
237
|
end
|
|
210
|
-
|
|
211
238
|
end
|