todoist-ruby 0.1.3 → 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 +4 -4
- data/README.md +20 -27
- data/lib/todoist.rb +4 -1
- data/lib/todoist/client.rb +119 -0
- data/lib/todoist/config.rb +65 -0
- data/lib/todoist/misc/activity.rb +4 -4
- data/lib/todoist/misc/backups.rb +2 -2
- data/lib/todoist/misc/completed.rb +5 -5
- data/lib/todoist/misc/items.rb +3 -3
- data/lib/todoist/misc/projects.rb +4 -4
- data/lib/todoist/misc/query.rb +2 -2
- data/lib/todoist/misc/quick.rb +2 -2
- data/lib/todoist/misc/templates.rb +5 -5
- data/lib/todoist/misc/uploads.rb +5 -5
- data/lib/todoist/service.rb +10 -0
- data/lib/todoist/sync/filters.rb +6 -6
- data/lib/todoist/sync/items.rb +13 -13
- data/lib/todoist/sync/labels.rb +6 -6
- data/lib/todoist/sync/notes.rb +5 -5
- data/lib/todoist/sync/projects.rb +8 -8
- data/lib/todoist/sync/reminders.rb +6 -6
- data/lib/todoist/util/api_helper.rb +39 -26
- data/lib/todoist/util/network_helper.rb +54 -19
- data/lib/todoist/util/parse_helper.rb +5 -5
- data/lib/todoist/version.rb +1 -1
- data/todoist.gemspec +7 -7
- metadata +33 -33
- data/lib/todoist/misc/user.rb +0 -16
- data/lib/todoist/util/command_synchronizer.rb +0 -54
- data/lib/todoist/util/config.rb +0 -78
data/lib/todoist/misc/query.rb
CHANGED
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
module Todoist
|
7
7
|
module Misc
|
8
|
-
class Query
|
8
|
+
class Query < Todoist::Service
|
9
9
|
include Todoist::Util
|
10
10
|
|
11
11
|
# Given an array of queries, return multiple results with key being the
|
12
12
|
# query results. Query results have three key elements: query, type,
|
13
13
|
# and data. Data is where the items are stored.
|
14
14
|
def queries(queries)
|
15
|
-
result =
|
15
|
+
result = @client.api_helper.get_response(Config::TODOIST_QUERY_COMMAND,
|
16
16
|
queries: queries.to_json)
|
17
17
|
return ParseHelper.make_objects_as_hash(result, "query")
|
18
18
|
end
|
data/lib/todoist/misc/quick.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
module Todoist
|
2
2
|
module Misc
|
3
|
-
class Quick
|
3
|
+
class Quick < Todoist::Service
|
4
4
|
include Todoist::Util
|
5
5
|
|
6
6
|
# Implementation of the Quick Add Task available in the official
|
7
7
|
# clients.
|
8
8
|
def add_item(text)
|
9
|
-
result =
|
9
|
+
result = @client.api_helper.get_response(Config::TODOIST_QUICK_ADD_COMMAND, {text: text})
|
10
10
|
return ParseHelper.make_object(result)
|
11
11
|
end
|
12
12
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Todoist
|
2
2
|
module Misc
|
3
|
-
class Templates
|
3
|
+
class Templates < Todoist::Service
|
4
4
|
include Todoist::Util
|
5
5
|
|
6
6
|
# Given a project and a File object (Ruby) imports the content onto the
|
@@ -8,21 +8,21 @@ module Todoist
|
|
8
8
|
# suffix is CSV. Otherwise, the file will be parsed as one item per line
|
9
9
|
# and ignore the formatting altogether.
|
10
10
|
def import_into_project(project, file)
|
11
|
-
multipart_file =
|
11
|
+
multipart_file = @client.api_helper.multipart_file(file)
|
12
12
|
params = {project_id: project.id, file: multipart_file}
|
13
|
-
|
13
|
+
@client.api_helper.get_multipart_response(Config::TODOIST_TEMPLATES_IMPORT_INTO_PROJECT_COMMAND, params)
|
14
14
|
end
|
15
15
|
|
16
16
|
# Export the project as a CSV string
|
17
17
|
def export_as_file(project)
|
18
18
|
params = {project_id: project.id}
|
19
|
-
|
19
|
+
@client.api_helper.get_response(Config::TODOIST_TEMPLATES_EXPORT_AS_FILE_COMMAND, params)
|
20
20
|
end
|
21
21
|
|
22
22
|
# Export the project as a url that can be accessed over HTTP
|
23
23
|
def export_as_url(project)
|
24
24
|
params = {project_id: project.id}
|
25
|
-
|
25
|
+
@client.api_helper.get_response(Config::TODOIST_TEMPLATES_EXPORT_AS_URL_COMMAND, params)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/lib/todoist/misc/uploads.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module Todoist
|
2
2
|
module Misc
|
3
|
-
class Uploads
|
3
|
+
class Uploads < Todoist::Service
|
4
4
|
include Todoist::Util
|
5
5
|
|
6
6
|
# Uploads a file given a Ruby File.
|
7
7
|
def add(file)
|
8
|
-
multipart_file =
|
8
|
+
multipart_file = @client.api_helper.multipart_file(file)
|
9
9
|
params = {file_name: File.basename(file), file: multipart_file}
|
10
|
-
|
10
|
+
@client.api_helper.get_multipart_response(Config::TODOIST_UPLOADS_ADD_COMMAND, params)
|
11
11
|
end
|
12
12
|
|
13
13
|
# Get uploads up to limit. If last_id is entered, then the results list
|
@@ -15,13 +15,13 @@ module Todoist
|
|
15
15
|
def get(limit = 30, last_id = 0)
|
16
16
|
params = {limit: limit}
|
17
17
|
params["last_id"] = last_id if last_id
|
18
|
-
|
18
|
+
@client.api_helper.get_response(Config::TODOIST_UPLOADS_GET_COMMAND, params)
|
19
19
|
end
|
20
20
|
|
21
21
|
# Deletes an upload given a file URL.
|
22
22
|
def delete(file_url)
|
23
23
|
params = {file_url: file_url}
|
24
|
-
|
24
|
+
@client.api_helper.get_response(Config::TODOIST_UPLOADS_DELETE_COMMAND, params)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/lib/todoist/sync/filters.rb
CHANGED
@@ -2,30 +2,30 @@
|
|
2
2
|
|
3
3
|
module Todoist
|
4
4
|
module Sync
|
5
|
-
class Filters
|
5
|
+
class Filters < Todoist::Service
|
6
6
|
include Todoist::Util
|
7
7
|
|
8
8
|
# Return a Hash of filters where key is the id of a filter and value is a filter
|
9
9
|
def collection
|
10
|
-
return
|
10
|
+
return @client.api_helper.collection("filters")
|
11
11
|
end
|
12
12
|
|
13
13
|
# Add a filter with a given hash of attributes and returns the filter id.
|
14
14
|
# Please note that item_id is required as is a date as specific in the
|
15
15
|
# documentation. This method can be tricky to all.
|
16
16
|
def add(args)
|
17
|
-
return
|
17
|
+
return @client.api_helper.add(args, "filter_add")
|
18
18
|
end
|
19
19
|
|
20
20
|
# Update a filter given a hash of attributes
|
21
21
|
def update(args)
|
22
|
-
return
|
22
|
+
return @client.api_helper.command(args, "filter_update")
|
23
23
|
end
|
24
24
|
|
25
25
|
# Delete filter given an array of filters
|
26
26
|
def delete(filter)
|
27
27
|
args = {id: filter.id}
|
28
|
-
return
|
28
|
+
return @client.api_helper.command(args, "filter_delete")
|
29
29
|
end
|
30
30
|
|
31
31
|
# Update orders for an array of filters
|
@@ -35,7 +35,7 @@ module Todoist
|
|
35
35
|
args[filter.id] = filter.item_order
|
36
36
|
end
|
37
37
|
args = {id_order_mapping: args.to_json}
|
38
|
-
return
|
38
|
+
return @client.api_helper.command(args, "filter_update_orders")
|
39
39
|
end
|
40
40
|
|
41
41
|
|
data/lib/todoist/sync/items.rb
CHANGED
@@ -1,28 +1,28 @@
|
|
1
1
|
module Todoist
|
2
2
|
module Sync
|
3
|
-
class Items
|
3
|
+
class Items < Todoist::Service
|
4
4
|
include Todoist::Util
|
5
5
|
|
6
6
|
# Return a Hash of items where key is the id of a item and value is a item
|
7
7
|
def collection
|
8
|
-
return
|
8
|
+
return @client.api_helper.collection("items")
|
9
9
|
end
|
10
10
|
|
11
11
|
# Add a item with a given hash of attributes and returns the item id
|
12
12
|
def add(args)
|
13
|
-
return
|
13
|
+
return @client.api_helper.add(args, "item_add")
|
14
14
|
end
|
15
15
|
|
16
16
|
# Update item given a hash of attributes
|
17
17
|
def update(args)
|
18
|
-
return
|
18
|
+
return @client.api_helper.command(args, "item_update")
|
19
19
|
end
|
20
20
|
|
21
21
|
# Delete items given an array of items
|
22
22
|
def delete(items)
|
23
23
|
item_ids = items.collect { |item| item.id }
|
24
24
|
args = {ids: item_ids.to_json}
|
25
|
-
return
|
25
|
+
return @client.api_helper.command(args, "item_delete")
|
26
26
|
end
|
27
27
|
|
28
28
|
# Move an item from one project to another project given an item and a project.
|
@@ -31,7 +31,7 @@ module Todoist
|
|
31
31
|
def move(item, project)
|
32
32
|
project_items = {item.project_id => [item.id]}
|
33
33
|
args = {project_items: project_items, to_project: project.id}
|
34
|
-
return
|
34
|
+
return @client.api_helper.command(args, "item_move")
|
35
35
|
end
|
36
36
|
|
37
37
|
# Complete items and optionally move them to history given an array of items. When force_history = 1, items should be moved to history (where 1 is true and 0 is false, and the default is 1) This is useful when checking off sub items.
|
@@ -39,7 +39,7 @@ module Todoist
|
|
39
39
|
def complete(items, force_history=1)
|
40
40
|
item_ids = items.collect { |item| item.id }
|
41
41
|
args = {ids: item_ids.to_json, force_history: force_history}
|
42
|
-
return
|
42
|
+
return @client.api_helper.command(args, "item_complete")
|
43
43
|
end
|
44
44
|
|
45
45
|
# Uncomplete items and move them to the active projects given an array
|
@@ -48,7 +48,7 @@ module Todoist
|
|
48
48
|
def uncomplete(items)
|
49
49
|
item_ids = items.collect { |item| item.id }
|
50
50
|
args = {ids: item_ids.to_json}
|
51
|
-
return
|
51
|
+
return @client.api_helper.command(args, "item_uncomplete")
|
52
52
|
end
|
53
53
|
|
54
54
|
# Complete a recurring item given the id of the recurring item.
|
@@ -62,14 +62,14 @@ module Todoist
|
|
62
62
|
args = {id: item.id, is_forward: is_forward}
|
63
63
|
if new_date_utc
|
64
64
|
# Reformat DateTime to the following string: YYYY-MM-DDTHH:MM
|
65
|
-
args["new_date_utc"] = ParseHelper.
|
65
|
+
args["new_date_utc"] = ParseHelper.format_time(new_date_utc)
|
66
66
|
end
|
67
67
|
|
68
68
|
if date_string
|
69
69
|
args["date_string"] = date_string
|
70
70
|
end
|
71
71
|
|
72
|
-
return
|
72
|
+
return @client.api_helper.command(args, "item_update_date_complete")
|
73
73
|
end
|
74
74
|
|
75
75
|
# A simplified version of item_complete / item_update_date_complete.
|
@@ -78,7 +78,7 @@ module Todoist
|
|
78
78
|
|
79
79
|
def close(item)
|
80
80
|
args = {id: item.id}
|
81
|
-
return
|
81
|
+
return @client.api_helper.command(args, "item_close")
|
82
82
|
end
|
83
83
|
|
84
84
|
# Update the day orders of multiple items at once given an array of
|
@@ -89,7 +89,7 @@ module Todoist
|
|
89
89
|
ids_to_orders[item.id] = item.day_order
|
90
90
|
end
|
91
91
|
args = {ids_to_orders: ids_to_orders.to_json}
|
92
|
-
return
|
92
|
+
return @client.api_helper.command(args, "item_update_day_orders")
|
93
93
|
end
|
94
94
|
|
95
95
|
# Update orders and indents for an array of items
|
@@ -99,7 +99,7 @@ module Todoist
|
|
99
99
|
tuples[item.id] = [item.item_order, item.indent]
|
100
100
|
end
|
101
101
|
args = {ids_to_orders_indents: tuples.to_json}
|
102
|
-
return
|
102
|
+
return @client.api_helper.command(args, "item_update_orders_indents")
|
103
103
|
end
|
104
104
|
|
105
105
|
end
|
data/lib/todoist/sync/labels.rb
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
module Todoist
|
2
2
|
module Sync
|
3
|
-
class Labels
|
3
|
+
class Labels < Todoist::Service
|
4
4
|
include Todoist::Util
|
5
5
|
|
6
6
|
# Return a Hash of labels where key is the id of a label and value is a label
|
7
7
|
def collection
|
8
|
-
return
|
8
|
+
return @client.api_helper.collection("labels")
|
9
9
|
end
|
10
10
|
|
11
11
|
# Add a label with a given hash of attributes and returns the label id
|
12
12
|
def add(args)
|
13
|
-
return
|
13
|
+
return @client.api_helper.add(args, "label_add")
|
14
14
|
end
|
15
15
|
|
16
16
|
# Update label given a hash of attributes
|
17
17
|
def update(args)
|
18
|
-
return
|
18
|
+
return @client.api_helper.command(args, "label_update")
|
19
19
|
end
|
20
20
|
|
21
21
|
# Delete a label given a label
|
22
22
|
def delete(label)
|
23
23
|
args = {id: label.id}
|
24
|
-
return
|
24
|
+
return @client.api_helper.command(args, "label_delete")
|
25
25
|
end
|
26
26
|
|
27
27
|
# Update orders for an array of labels
|
@@ -31,7 +31,7 @@ module Todoist
|
|
31
31
|
args[label.id] = label.item_order
|
32
32
|
end
|
33
33
|
args = {id_order_mapping: args.to_json}
|
34
|
-
return
|
34
|
+
return @client.api_helper.command(args, "label_update_orders")
|
35
35
|
end
|
36
36
|
|
37
37
|
end
|
data/lib/todoist/sync/notes.rb
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
module Todoist
|
2
2
|
module Sync
|
3
|
-
class Notes
|
3
|
+
class Notes < Todoist::Service
|
4
4
|
include Todoist::Util
|
5
5
|
|
6
6
|
# Return a Hash of notes where key is the id of a note and value is a note
|
7
7
|
def collection
|
8
|
-
return
|
8
|
+
return @client.api_helper.collection("notes")
|
9
9
|
end
|
10
10
|
|
11
11
|
# Add a note with a given hash of attributes and returns the note id.
|
12
12
|
# Please note that item_id or project_id key is required. In addition,
|
13
13
|
# content is also a required key in the hash.
|
14
14
|
def add(args)
|
15
|
-
return
|
15
|
+
return @client.api_helper.add(args, "note_add")
|
16
16
|
end
|
17
17
|
|
18
18
|
# Update a note given a hash of attributes
|
19
19
|
def update(args)
|
20
|
-
return
|
20
|
+
return @client.api_helper.command(args, "note_update")
|
21
21
|
end
|
22
22
|
|
23
23
|
# Delete notes given an a note
|
24
24
|
def delete(note)
|
25
25
|
args = {id: note.id}
|
26
|
-
return
|
26
|
+
return @client.api_helper.command(args, "note_delete")
|
27
27
|
end
|
28
28
|
|
29
29
|
|
@@ -2,43 +2,43 @@ module Todoist
|
|
2
2
|
module Sync
|
3
3
|
|
4
4
|
|
5
|
-
class Projects
|
5
|
+
class Projects < Todoist::Service
|
6
6
|
include Todoist::Util
|
7
7
|
|
8
8
|
# Return a Hash of projects where key is the id of a project and value is a project
|
9
9
|
def collection
|
10
|
-
return
|
10
|
+
return @client.api_helper.collection("projects")
|
11
11
|
end
|
12
12
|
|
13
13
|
# Add a project with a given hash of attributes and returns the project id
|
14
14
|
def add(args)
|
15
|
-
return
|
15
|
+
return @client.api_helper.add(args, "project_add")
|
16
16
|
end
|
17
17
|
|
18
18
|
# Delete projects given an array of projects
|
19
19
|
def delete(projects)
|
20
20
|
project_ids = projects.collect { |project| project.id }
|
21
21
|
args = {ids: project_ids.to_json}
|
22
|
-
return
|
22
|
+
return @client.api_helper.command(args, "project_delete")
|
23
23
|
end
|
24
24
|
|
25
25
|
# Archive projects given an array of projects
|
26
26
|
def archive(projects)
|
27
27
|
project_ids = projects.collect { |project| project.id }
|
28
28
|
args = {ids: project_ids.to_json}
|
29
|
-
return
|
29
|
+
return @client.api_helper.command(args, "project_archive")
|
30
30
|
end
|
31
31
|
|
32
32
|
# Unarchive projects given an array of projects
|
33
33
|
def unarchive(projects)
|
34
34
|
project_ids = projects.collect { |project| project.id }
|
35
35
|
args = {ids: project_ids.to_json}
|
36
|
-
return
|
36
|
+
return @client.api_helper.command(args, "project_unarchive")
|
37
37
|
end
|
38
38
|
|
39
39
|
# Update project given a hash of attributes
|
40
40
|
def update(args)
|
41
|
-
return
|
41
|
+
return @client.api_helper.command(args, "project_update")
|
42
42
|
end
|
43
43
|
|
44
44
|
# Update orders and indents for an array of projects
|
@@ -48,7 +48,7 @@ module Todoist
|
|
48
48
|
tuples[project.id] = [project.item_order, project.indent]
|
49
49
|
end
|
50
50
|
args = {ids_to_orders_indents: tuples.to_json}
|
51
|
-
return
|
51
|
+
return @client.api_helper.command(args, "project_update_orders_indents")
|
52
52
|
end
|
53
53
|
|
54
54
|
end
|
@@ -1,35 +1,35 @@
|
|
1
1
|
module Todoist
|
2
2
|
module Sync
|
3
|
-
class Reminders
|
3
|
+
class Reminders < Todoist::Service
|
4
4
|
include Todoist::Util
|
5
5
|
|
6
6
|
# Return a Hash of reminders where key is the id of a reminder and value is a reminder
|
7
7
|
def collection
|
8
|
-
return
|
8
|
+
return @client.api_helper.collection("reminders")
|
9
9
|
end
|
10
10
|
|
11
11
|
# Add a reminder with a given hash of attributes and returns the reminder id.
|
12
12
|
# Please note that item_id is required as is a date as specific in the
|
13
13
|
# documentation. This method can be tricky to all.
|
14
14
|
def add(args)
|
15
|
-
return
|
15
|
+
return @client.api_helper.add(args, "reminder_add")
|
16
16
|
end
|
17
17
|
|
18
18
|
# Update a reminder given a hash of attributes
|
19
19
|
def update(args)
|
20
|
-
return
|
20
|
+
return @client.api_helper.command(args, "reminder_update")
|
21
21
|
end
|
22
22
|
|
23
23
|
# Delete reminder given an array of reminders
|
24
24
|
def delete(reminder)
|
25
25
|
args = {id: reminder.id}
|
26
|
-
return
|
26
|
+
return @client.api_helper.command(args, "reminder_delete")
|
27
27
|
end
|
28
28
|
|
29
29
|
# Clear locations which is used for location reminders
|
30
30
|
def clear_locations
|
31
31
|
args = {}
|
32
|
-
return
|
32
|
+
return @client.api_helper.command(args, "clear_locations")
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -1,10 +1,9 @@
|
|
1
1
|
require "net/http"
|
2
2
|
require "json"
|
3
|
-
require "todoist/
|
3
|
+
require "todoist/config"
|
4
4
|
require "todoist/util/network_helper"
|
5
5
|
require "todoist/util/parse_helper"
|
6
6
|
require "todoist/util/uuid"
|
7
|
-
require "todoist/util/command_synchronizer"
|
8
7
|
require "ostruct"
|
9
8
|
require 'concurrent'
|
10
9
|
|
@@ -15,18 +14,21 @@ module Todoist
|
|
15
14
|
module Util
|
16
15
|
|
17
16
|
class ApiHelper
|
18
|
-
|
19
|
-
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
@object_cache = {"projects" => Concurrent::Hash.new({}), "labels" => Concurrent::Hash.new({}),
|
20
20
|
"items" => Concurrent::Hash.new({}), "notes" => Concurrent::Hash.new({}),
|
21
21
|
"reminders" => Concurrent::Hash.new({}), "filters" => Concurrent::Hash.new({})
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
}
|
23
|
+
@sync_token_cache = Concurrent::Hash.new({"projects" => "*", "labels" => "*",
|
24
|
+
"items" => "*", "notes" => "*", "reminders" => "*", "filters" => "*"})
|
25
|
+
@network_helper = NetworkHelper.new(client)
|
26
|
+
end
|
27
|
+
|
28
|
+
def collection(type)
|
29
|
+
@network_helper.sync
|
28
30
|
|
29
|
-
response =
|
31
|
+
response = @network_helper.get_sync_response({sync_token: sync_token(type), resource_types: "[\"#{type}\"]"})
|
30
32
|
response[type].each do |object_data|
|
31
33
|
object = OpenStruct.new(object_data)
|
32
34
|
objects(type)[object.id] = object
|
@@ -35,23 +37,24 @@ module Todoist
|
|
35
37
|
return objects(type)
|
36
38
|
end
|
37
39
|
|
38
|
-
def
|
40
|
+
def exec(args, command, temporary_resource_id)
|
39
41
|
command_uuid = Uuid.command_uuid
|
40
42
|
commands = {type: command, temp_id: temporary_resource_id, uuid: command_uuid, args: args}
|
41
|
-
response =
|
43
|
+
response = @network_helper.get_sync_response({commands: "[#{commands.to_json}]"})
|
42
44
|
raise RuntimeError, "Response returned is not ok" unless response["sync_status"][command_uuid] == "ok"
|
43
45
|
return response
|
44
46
|
end
|
45
47
|
|
46
|
-
def
|
48
|
+
def command(args, command)
|
47
49
|
temporary_resource_id = Uuid.temporary_resource_id
|
48
50
|
command_uuid = Uuid.command_uuid
|
49
51
|
command = {type: command, temp_id: temporary_resource_id, uuid: command_uuid, args: args}
|
50
|
-
|
52
|
+
|
53
|
+
@network_helper.queue(command)
|
51
54
|
return true
|
52
55
|
end
|
53
56
|
|
54
|
-
def
|
57
|
+
def add(args, command)
|
55
58
|
temporary_resource_id = Uuid.temporary_resource_id
|
56
59
|
command_uuid = Uuid.command_uuid
|
57
60
|
command = {type: command, temp_id: temporary_resource_id, uuid: command_uuid, args: args}
|
@@ -60,28 +63,38 @@ module Todoist
|
|
60
63
|
object.id = temp_id_mappings[temporary_resource_id] if temp_id_mappings[temporary_resource_id]
|
61
64
|
end
|
62
65
|
|
63
|
-
|
66
|
+
@network_helper.queue(command, temp_id_callback)
|
64
67
|
return object
|
65
68
|
end
|
66
69
|
|
67
|
-
def
|
68
|
-
|
70
|
+
def get_response(command, params = {}, token = true)
|
71
|
+
@network_helper.get_response(command, params, token)
|
69
72
|
end
|
70
73
|
|
71
|
-
|
74
|
+
def get_multipart_response(command, params)
|
75
|
+
@network_helper.get_multipart_response(command, params)
|
76
|
+
end
|
72
77
|
|
78
|
+
def multipart_file(file)
|
79
|
+
@network_helper.multipart_file(file)
|
80
|
+
end
|
73
81
|
|
82
|
+
def sync
|
83
|
+
@network_helper.sync
|
84
|
+
end
|
85
|
+
|
86
|
+
protected
|
74
87
|
|
75
|
-
def
|
76
|
-
|
88
|
+
def objects(type)
|
89
|
+
@object_cache[type]
|
77
90
|
end
|
78
91
|
|
79
|
-
def
|
80
|
-
|
92
|
+
def sync_token(type)
|
93
|
+
@sync_token_cache[type]
|
81
94
|
end
|
82
95
|
|
83
|
-
def
|
84
|
-
|
96
|
+
def set_sync_token(type, value)
|
97
|
+
@sync_token_cache[type] = value
|
85
98
|
end
|
86
99
|
|
87
100
|
end
|