4me-sdk 1.1.3 → 1.1.4

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
  SHA1:
3
- metadata.gz: 1b97eb59b35a6a8b7551637c38240a5bf2c76b8e
4
- data.tar.gz: 625d0ffaf906d4ebcab85012bc4a7627ed17b6c3
3
+ metadata.gz: 864b07c2b953a22cde7b603d2ca40e0c922af5ab
4
+ data.tar.gz: 191f083e0183d044f77c9872a3b28f6e3541bf24
5
5
  SHA512:
6
- metadata.gz: 6803ef3bebc9ca50c967a0e975f5062ed233b8f435dc32e985e33b5b7099c24b7d06895304fb5103b5831a2f55d37c523bf2e39f766410de69f1d3e6bb8d95be
7
- data.tar.gz: 2933d2f59bde6498efadeb177988eea3c99e6a7ec35fe59db175f7c11731064dd7ce0d3aafd982cdf05e8b66afac54c986cd476e821746bbec632dc96a555cf1
6
+ metadata.gz: 161e613f6c9e5af777051f09aad8c83cd4ade36395550e0c4da63c8d7ee4a399f161aadbd0c3ee965db44864c2faa3ed4f336017b98e85b9196c6a0ee8844d13
7
+ data.tar.gz: 348aa6bb7536b81c6cf0642e0b7376c3aea935d88dc6743af82cdf563b023d92f82773f72ef500c44458a448eb96b0027bce74d9e4b79f7f9c2901f3483bb013
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- 4me-sdk (1.1.2)
5
- activesupport
6
- gem_config
7
- mime-types
4
+ 4me-sdk (1.1.4)
5
+ activesupport (>= 4.2)
6
+ gem_config (>= 0.3)
7
+ mime-types (>= 3.0)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
@@ -32,19 +32,19 @@ GEM
32
32
  minitest (5.11.3)
33
33
  public_suffix (3.0.3)
34
34
  rake (12.3.1)
35
- rspec (3.3.0)
36
- rspec-core (~> 3.3.0)
37
- rspec-expectations (~> 3.3.0)
38
- rspec-mocks (~> 3.3.0)
39
- rspec-core (3.3.2)
40
- rspec-support (~> 3.3.0)
41
- rspec-expectations (3.3.1)
35
+ rspec (3.8.0)
36
+ rspec-core (~> 3.8.0)
37
+ rspec-expectations (~> 3.8.0)
38
+ rspec-mocks (~> 3.8.0)
39
+ rspec-core (3.8.0)
40
+ rspec-support (~> 3.8.0)
41
+ rspec-expectations (3.8.2)
42
42
  diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.3.0)
44
- rspec-mocks (3.3.2)
43
+ rspec-support (~> 3.8.0)
44
+ rspec-mocks (3.8.0)
45
45
  diff-lcs (>= 1.2.0, < 2.0)
46
- rspec-support (~> 3.3.0)
47
- rspec-support (3.3.0)
46
+ rspec-support (~> 3.8.0)
47
+ rspec-support (3.8.0)
48
48
  safe_yaml (1.0.4)
49
49
  simplecov (0.16.1)
50
50
  docile (~> 1.1)
@@ -71,4 +71,4 @@ DEPENDENCIES
71
71
  webmock (~> 2)
72
72
 
73
73
  BUNDLED WITH
74
- 1.16.1
74
+ 1.16.2
data/README.md CHANGED
@@ -309,6 +309,14 @@ By default all actions on the 4me SDK Client will block until the 4me API is acc
309
309
  By setting the _block_at_rate_limit_ to `true` in the [configuration](#configuration) all actions will also block in case the [rate limit](http://developer.4me.com/v1/#rate-limiting) is reached. The action is retried every 5 minutes until the [rate limit](http://developer.4me.com/v1/#rate-limiting) is lifted again, which might take up to 1 hour.
310
310
 
311
311
 
312
+ ### Translations
313
+
314
+ When exporting translations, the _locale_ parameter is required:
315
+
316
+ ```
317
+ response = Itrp::Client.new.export('translations', nil, false, 'nl')
318
+ ```
319
+
312
320
  ### Exception handling
313
321
 
314
322
  The standard methods `get`, `post`, `put` and `delete` will always return a Response with an [error message](http://developer.4me.com/v1/#http-status-codes) in case something went wrong.
@@ -151,10 +151,12 @@ module Sdk4me
151
151
  # @param types: The types to export, e.g. person, organization, people_contact_details
152
152
  # @param from: Retrieve all files since a given data and time
153
153
  # @param block_until_completed: Set to true to monitor the export progress
154
+ # @param locale: Required for translations export
154
155
  # @raise Sdk4me::Exception in case the export progress could not be monitored
155
- def export(types, from = nil, block_until_completed = false)
156
+ def export(types, from = nil, block_until_completed = false, locale = nil)
156
157
  data = {type: [types].flatten.join(',')}
157
158
  data[:from] = from unless from.blank?
159
+ data[:locale] = locale unless locale.blank?
158
160
  response = post('/export', data)
159
161
  if response.valid?
160
162
  if response.raw.code.to_s == '204'
@@ -1,5 +1,5 @@
1
1
  module Sdk4me
2
2
  class Client
3
- VERSION = '1.1.3'
3
+ VERSION = '1.1.4'
4
4
  end
5
5
  end
@@ -402,6 +402,14 @@ describe Sdk4me::Client do
402
402
  expect(response[:token]).to eq('68ef5ef0f64c0')
403
403
  end
404
404
 
405
+ it 'should export with locale' do
406
+ stub_request(:post, 'https://api.4me.com/v1/export').with(basic_auth: ['secret', 'x']).with(body: {type: 'translations', locale: 'nl'}).to_return(body: {token: '68ef5ef0f64c0'}.to_json)
407
+ expect_log("Export for 'translations' successfully queued with token '68ef5ef0f64c0'.")
408
+
409
+ response = @client.export('translations', nil, nil, 'nl')
410
+ expect(response[:token]).to eq('68ef5ef0f64c0')
411
+ end
412
+
405
413
  it 'should wait for the export to complete' do
406
414
  stub_request(:post, 'https://api.4me.com/v1/export').with(basic_auth: ['secret', 'x']).with(body: {type: 'people'}).to_return(body: {token: '68ef5ef0f64c0'}.to_json)
407
415
  progress_stub = stub_request(:get, 'https://api.4me.com/v1/export/68ef5ef0f64c0').with(basic_auth: ['secret', 'x'])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: 4me-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - 4me
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-09 00:00:00.000000000 Z
11
+ date: 2018-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_config