base-api-io 1.5.0 → 1.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03115ed6815dd53c76ccfff2afa2bcce99b45af31b1f4828b5e9852eee241fff
4
- data.tar.gz: 86aafc849d1c51cb8bd316b8d2bcc8c33b8ede7f4a1566984bde0a92ce6c408f
3
+ metadata.gz: dc018be85c12f154324392a986ee8206538ad1dc525cb7baa09084d8b61f84cc
4
+ data.tar.gz: a09e6e7c4dd8a91890f3865143865312dacd6e5935c107a2c460a0178a427b07
5
5
  SHA512:
6
- metadata.gz: 4c93d0faa0134a7cdc46bab8c8b77a7ab839bced97d2ef0cd3d571d98c5a290770b351bebbf3e7f969463ce7744c50b83511c68da56ef473cc68f4e75fe2b68c
7
- data.tar.gz: 2cbf6000c0b364a0eecc5ed1c843eb3ad2743a103ae4d26dafe59ca1174868c8f32016a806698c5f3afc57228f2ddc9535c1601a5e99a9e14a70a812f440ae18
6
+ metadata.gz: 0ab9d381e5f385684d01df7809d14a7b08aa799a417c7a78873ea476a973a87a658b39766b79d784e4828c18ba69e5ac0bccf550f423763ff2a3c9a72da63fa3
7
+ data.tar.gz: db37ea3fb7d4f603bc61c073dd1f4a5fc1ed43bdaa4db340175825c8726389f990722ae1474900854db61b9047452e080d9317ff1894bebcba0f8a8f4d10d441
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- base-api-io (1.5.0)
4
+ base-api-io (1.6.0)
5
5
  faraday (~> 0.15.4)
6
6
  mimetype-fu (~> 0.1.2)
7
7
 
data/README.md CHANGED
@@ -279,6 +279,16 @@ submissions.metadata # The metadata object containing the total count
279
279
  submission =
280
280
  client.forms.get_submission('form_id', 'submission_id')
281
281
 
282
+ # Update a submission
283
+ submission =
284
+ client.forms.update_submission(
285
+ submission_id: 'submission_id',
286
+ id: 'form_id',
287
+ form: {
288
+ file: File.open('description.txt'),
289
+ key: 'value'
290
+ })
291
+
282
292
  # Delete a submission
283
293
  submission =
284
294
  client.forms.delete_submission('form_id', 'submission_id')
@@ -97,6 +97,31 @@ module Base
97
97
  end
98
98
  end
99
99
 
100
+ # Submits a new submission for the form with the given ID.
101
+ def update_submission(id:, submission_id:, form:)
102
+ request do
103
+ payload =
104
+ form.each_with_object({}) do |(key, value), memo|
105
+ memo[key] =
106
+ case value
107
+ when File, Tempfile
108
+ Faraday::UploadIO.new(
109
+ value.path,
110
+ File.mime_type?(value),
111
+ File.basename(value)
112
+ )
113
+ else
114
+ value
115
+ end
116
+ end
117
+
118
+ response =
119
+ connection.put("#{id}/submit/#{submission_id}", payload)
120
+
121
+ parse(response.body)
122
+ end
123
+ end
124
+
100
125
  # Deletes the submission with the given ID of the form with the given ID.
101
126
  def delete_submission(id, submission_id)
102
127
  request do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Base
4
- VERSION = '1.5.0'
4
+ VERSION = '1.6.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: base-api-io
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusztáv Szikszai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-02 00:00:00.000000000 Z
11
+ date: 2019-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday