kloudless 0.2.0 → 0.2.1

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: 87e04e539ed7a1b806e462f1e156ad3fa60241d4
4
- data.tar.gz: 5d2b394818e6db3824ef1287b39bcad1284081ef
3
+ metadata.gz: 42bbe34d180e3416514fad0b2fefc28ffaa0804e
4
+ data.tar.gz: 6074095b58159c86c87f9fb749c0721815e6a581
5
5
  SHA512:
6
- metadata.gz: 66a884a58eb3ccb6722facf07cb3096b4379c02e857c79693193dc0faf5d80783aa7b950e545316bed6e80d317ce518e68988fb6e9cd016f7567a0a82b6903b8
7
- data.tar.gz: 3d42f44a173284b6204333bf1a47dc060d33c8b53d8da17aeb8a96fc5725e6a88bb30e79bf0ddf466ab0f143b079d13055d1fd51e9de6caa55283e9227b98151
6
+ metadata.gz: 51dec12e2e4a7b610b5678d7696a841d358a3661df8eaec4109c2a21da158c2bb91106491659db8718c5c30131ec8a8c0b35a39d50b873a0f08f0d14f726dee6
7
+ data.tar.gz: 1f0f9dea225f7e4ca64611f6bc63338af9fbcd69b89ee564df2d1025458b68fcbdddc6667dff2e135c392812431d71a6641c9e3de6e34fdfa583be6c1857f451
@@ -1,4 +1,6 @@
1
- # upcoming
1
+ # 0.2.1
2
+
3
+ - Convert ID endpoint for file/folders. Listed under files. @kuinak
2
4
 
3
5
  # 0.2.0
4
6
 
data/README.md CHANGED
@@ -23,8 +23,11 @@ official reference. You can obtain an API Key at the [Developer
23
23
  Portal](https://developers.kloudless.com/).
24
24
 
25
25
  ```ruby
26
- # Authentication
27
- Kloudless.authorize(api_key: "abc")
26
+ # Authentication using a Bearer Token obtained by authenticating a user.
27
+ Kloudless.authorize(token: "abc")
28
+
29
+ # Alternatively, use the line below for API Keys:
30
+ # Kloudless.authorize(api_key: "abc")
28
31
 
29
32
  accounts = Kloudless::Account.list
30
33
  account = accounts.first
@@ -59,5 +59,12 @@ module Kloudless
59
59
  path = "/accounts/#{account_ids.join(',')}/search"
60
60
  Kloudless::Collection.new(self, http.get(path, params: params))
61
61
  end
62
+
63
+ def self.convert_id(account_id:, raw_id:, type:, params: {}, **data)
64
+ path = "/accounts/#{account_id}/convert_id"
65
+ data[:raw_id] = raw_id
66
+ data[:type] = type
67
+ http.post(path, params: params, data: data)
68
+ end
62
69
  end
63
70
  end
@@ -1,3 +1,3 @@
1
1
  module Kloudless
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -76,4 +76,13 @@ class Kloudless::FileTest < Minitest::Test
76
76
  assert_kind_of Kloudless::File, files.first
77
77
  end
78
78
  end
79
+
80
+ def test_convert_id
81
+ response = {"id" => "foo"}
82
+ data = {raw_id: "bar", type: "file"}
83
+ Kloudless.http.expect(:post, returns: response, args:["/accounts/1/convert_id", params: {}, data: data ]) do
84
+ new_id_data = Kloudless::File.convert_id(account_id: 1, raw_id: data[:raw_id], type: data[:type])
85
+ assert_equal "foo", new_id_data["id"]
86
+ end
87
+ end
79
88
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kloudless
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerry Cheung
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-27 00:00:00.000000000 Z
11
+ date: 2016-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler