camper 0.0.11 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -0
- data/CHANGELOG.md +18 -0
- data/Gemfile.lock +16 -16
- data/README.md +5 -3
- data/examples/comments.rb +12 -1
- data/examples/message_types.rb +29 -0
- data/examples/messages.rb +13 -2
- data/lib/camper/api/comments.rb +80 -8
- data/lib/camper/api/message_board.rb +23 -0
- data/lib/camper/api/message_types.rb +90 -0
- data/lib/camper/api/messages.rb +103 -4
- data/lib/camper/api/people.rb +86 -84
- data/lib/camper/api/projects.rb +101 -101
- data/lib/camper/api/resource.rb +6 -4
- data/lib/camper/api/todolists.rb +84 -92
- data/lib/camper/api/todos.rb +161 -183
- data/lib/camper/client.rb +3 -1
- data/lib/camper/error.rb +2 -0
- data/lib/camper/paginated_response.rb +2 -0
- data/lib/camper/request.rb +1 -0
- data/lib/camper/version.rb +1 -1
- metadata +5 -2
data/lib/camper/api/people.rb
CHANGED
@@ -1,97 +1,99 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
3
|
+
module Camper
|
4
|
+
class Client
|
5
|
+
# Defines methods related to people.
|
6
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/people.md
|
7
|
+
module PeopleAPI
|
8
|
+
# Get all people visible to the current user
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# client.people
|
12
|
+
#
|
13
|
+
# @return [PaginatedResponse<Resource>]
|
14
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/people.md#get-all-people
|
15
|
+
def people
|
16
|
+
get('/people')
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
19
|
+
# Get all active people on the project with the given ID
|
20
|
+
#
|
21
|
+
# @example
|
22
|
+
# client.people_in_project(10)
|
23
|
+
# @example
|
24
|
+
# client.people_in_project("20")
|
25
|
+
# @example
|
26
|
+
# client.people_in_project(my_project)
|
27
|
+
#
|
28
|
+
# @param project [Resource|Integer|String] A project resource or a project id
|
29
|
+
# @return [PaginatedResponse<Resource>]
|
30
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/people.md#get-people-on-a-project
|
31
|
+
def people_in_project(project)
|
32
|
+
id = project.respond_to?(:id) ? project.id : project
|
32
33
|
|
33
|
-
|
34
|
-
|
34
|
+
get("/projects/#{id}/people")
|
35
|
+
end
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
37
|
+
# Allows granting new and existing people access to a project, and revoking access from existing people.
|
38
|
+
#
|
39
|
+
# @example
|
40
|
+
# client.update_access_in_project(10, { grant: [102, 127] })
|
41
|
+
# @example
|
42
|
+
# client.update_access_in_project("8634", { revoke: [300, 12527] })
|
43
|
+
# @example
|
44
|
+
# client.update_access_in_project(my_project, {
|
45
|
+
# create: [{
|
46
|
+
# name: "Victor Copper",
|
47
|
+
# email_address: "victor@hanchodesign.com"
|
48
|
+
# }]
|
49
|
+
# })
|
50
|
+
#
|
51
|
+
# @param project [Resource|Integer|String] A project resource or a project id
|
52
|
+
# @param options [Hash] options to update access, either grant, revoke or create new people
|
53
|
+
# @return [Resource]
|
54
|
+
# @raise [Error::InvalidParameter] if no option is specified
|
55
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/people.md#update-who-can-access-a-project
|
56
|
+
def update_access_in_project(project, options = {})
|
57
|
+
raise Camper::Error::InvalidParameter, 'options cannot be empty' if options.empty?
|
57
58
|
|
58
|
-
|
59
|
+
id = project.respond_to?(:id) ? project.id : project
|
59
60
|
|
60
|
-
|
61
|
-
|
61
|
+
put("/projects/#{id}/people/users", body: { **options })
|
62
|
+
end
|
62
63
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
64
|
+
# Get all people on this Basecamp account who can be pinged
|
65
|
+
#
|
66
|
+
# @example
|
67
|
+
# client.pingable_people
|
68
|
+
#
|
69
|
+
# @return [PaginatedResponse<Resource>]
|
70
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/people.md#get-pingable-people
|
71
|
+
def pingable_people
|
72
|
+
get('/circles/people')
|
73
|
+
end
|
73
74
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
75
|
+
# Get the profile for the user with the given ID
|
76
|
+
#
|
77
|
+
# @example
|
78
|
+
# client.person(234790)
|
79
|
+
#
|
80
|
+
# @param id [Integer|String] A user id
|
81
|
+
# @return [Resource]
|
82
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/people.md#get-person
|
83
|
+
def person(id)
|
84
|
+
get("/people/#{id}")
|
85
|
+
end
|
85
86
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
87
|
+
# Get the current user's personal info.
|
88
|
+
#
|
89
|
+
# @example
|
90
|
+
# client.profile
|
91
|
+
#
|
92
|
+
# @return [Resource]
|
93
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/people.md#get-my-personal-info
|
94
|
+
def profile
|
95
|
+
get('/my/profile')
|
96
|
+
end
|
95
97
|
end
|
96
98
|
end
|
97
99
|
end
|
data/lib/camper/api/projects.rb
CHANGED
@@ -1,120 +1,120 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
# Get a project with a given id, granted they have access to it
|
22
|
-
#
|
23
|
-
# @example
|
24
|
-
# client.project(82564)
|
25
|
-
# @example
|
26
|
-
# client.project('7364183')
|
27
|
-
#
|
28
|
-
# @param id [Integet|String] id of the project to retrieve
|
29
|
-
# @return [Project]
|
30
|
-
# @raise [Error::InvalidParameter] if id is blank (nil or empty string)
|
31
|
-
# @see https://github.com/basecamp/bc3-api/blob/master/sections/projects.md#get-a-project
|
32
|
-
def project(id)
|
33
|
-
raise Camper::Error::InvalidParameter, id if id.blank?
|
3
|
+
module Camper
|
4
|
+
class Client
|
5
|
+
# Defines methods related to projects.
|
6
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/projects.md
|
7
|
+
module ProjectsAPI
|
8
|
+
# Get the projects visible to the current user
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# client.projects
|
12
|
+
# @example
|
13
|
+
# client.projects(status: 'trashed')
|
14
|
+
#
|
15
|
+
# @param options [Hash] extra options to filter the list of todolist
|
16
|
+
# @return [PaginatedResponse<Project>]
|
17
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/projects.md#get-all-projects
|
18
|
+
def projects(options = {})
|
19
|
+
get('/projects', query: options)
|
20
|
+
end
|
34
21
|
|
35
|
-
|
36
|
-
|
22
|
+
# Get a project with a given id, granted they have access to it
|
23
|
+
#
|
24
|
+
# @example
|
25
|
+
# client.project(82564)
|
26
|
+
# @example
|
27
|
+
# client.project('7364183')
|
28
|
+
#
|
29
|
+
# @param id [Integet|String] id of the project to retrieve
|
30
|
+
# @return [Project]
|
31
|
+
# @raise [Error::InvalidParameter] if id is blank (nil or empty string)
|
32
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/projects.md#get-a-project
|
33
|
+
def project(id)
|
34
|
+
raise Error::InvalidParameter, id if id.blank?
|
37
35
|
|
38
|
-
|
39
|
-
|
40
|
-
# @example
|
41
|
-
# client.create_project("Marketing Campaign")
|
42
|
-
# @example
|
43
|
-
# client.create_project('Better Marketing Campaign', "For Client: XYZ")
|
44
|
-
#
|
45
|
-
# @param name [String] name of the project to create
|
46
|
-
# @param description [String] description of the project
|
47
|
-
# @return [Project]
|
48
|
-
# @raise [Error::InvalidParameter] if name is blank (nil or empty string)
|
49
|
-
# @see https://github.com/basecamp/bc3-api/blob/master/sections/projects.md#create-a-project
|
50
|
-
def create_project(name, description = '')
|
51
|
-
raise Camper::Error::InvalidParameter, name if name.blank?
|
36
|
+
get("/projects/#{id}")
|
37
|
+
end
|
52
38
|
|
53
|
-
|
54
|
-
|
39
|
+
# Create a project
|
40
|
+
#
|
41
|
+
# @example
|
42
|
+
# client.create_project("Marketing Campaign")
|
43
|
+
# @example
|
44
|
+
# client.create_project('Better Marketing Campaign', "For Client: XYZ")
|
45
|
+
#
|
46
|
+
# @param name [String] name of the project to create
|
47
|
+
# @param description [String] description of the project
|
48
|
+
# @return [Project]
|
49
|
+
# @raise [Error::InvalidParameter] if name is blank (nil or empty string)
|
50
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/projects.md#create-a-project
|
51
|
+
def create_project(name, description = '')
|
52
|
+
raise Error::InvalidParameter, name if name.blank?
|
55
53
|
|
56
|
-
|
57
|
-
# description can be set to empty by passing an empty string
|
58
|
-
#
|
59
|
-
# @example
|
60
|
-
# client.update_project(12324, name: 'Retros')
|
61
|
-
# @example
|
62
|
-
# client.update_project('157432', description: 'A new description')
|
63
|
-
# @example
|
64
|
-
# client.update_project('157432', description: '')
|
65
|
-
# @example
|
66
|
-
# client.update_project(my_project, name: 'A new name', description: 'A new description')
|
67
|
-
#
|
68
|
-
# @param project [Integer|String|Project] either a project object or a project id
|
69
|
-
# @param name [String] optional new name of the project
|
70
|
-
# @param description [String] optinal new description of the project
|
71
|
-
# @return [Project]
|
72
|
-
# @raise [Error::InvalidParameter] if both name and description are blank (nil or empty strings)
|
73
|
-
# @see https://github.com/basecamp/bc3-api/blob/master/sections/projects.md#update-a-project
|
74
|
-
def update_project(project, name: '', description: nil)
|
75
|
-
if name.blank? && description.blank?
|
76
|
-
raise Camper::Error::InvalidParameter, 'name and description cannot both be blank'
|
54
|
+
post('/projects', body: { name: name, description: description })
|
77
55
|
end
|
78
56
|
|
79
|
-
|
57
|
+
# Update a project
|
58
|
+
# description can be set to empty by passing an empty string
|
59
|
+
#
|
60
|
+
# @example
|
61
|
+
# client.update_project(12324, name: 'Retros')
|
62
|
+
# @example
|
63
|
+
# client.update_project('157432', description: 'A new description')
|
64
|
+
# @example
|
65
|
+
# client.update_project('157432', description: '')
|
66
|
+
# @example
|
67
|
+
# client.update_project(my_project, name: 'A new name', description: 'A new description')
|
68
|
+
#
|
69
|
+
# @param project [Integer|String|Project] either a project object or a project id
|
70
|
+
# @param name [String] optional new name of the project
|
71
|
+
# @param description [String] optinal new description of the project
|
72
|
+
# @return [Project]
|
73
|
+
# @raise [Error::InvalidParameter] if both name and description are blank (nil or empty strings)
|
74
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/projects.md#update-a-project
|
75
|
+
def update_project(project, name: '', description: nil)
|
76
|
+
# rubocop:disable Style/IfUnlessModifier:
|
77
|
+
if name.blank? && description.blank?
|
78
|
+
raise Error::InvalidParameter, 'name and description cannot both be blank'
|
79
|
+
end
|
80
80
|
|
81
|
-
|
82
|
-
options[:name] = name unless name.blank?
|
83
|
-
options[:description] = description unless description.nil?
|
81
|
+
# rubocop:enable Style/IfUnlessModifier
|
84
82
|
|
85
|
-
|
86
|
-
end
|
83
|
+
id = project.respond_to?(:id) ? project.id : project
|
87
84
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
# client.delete_project(12324)
|
92
|
-
# @example
|
93
|
-
# client.delete_project('157432')
|
94
|
-
# @example
|
95
|
-
# client.delete_project(my_project)
|
96
|
-
#
|
97
|
-
# @param project [Integer|String|Project] either a project object or a project id
|
98
|
-
# @raise [Error::InvalidParameter] if project param is blank
|
99
|
-
# @see https://github.com/basecamp/bc3-api/blob/master/sections/projects.md#trash-a-project
|
100
|
-
def delete_project(project)
|
101
|
-
raise Camper::Error::InvalidParameter, 'project cannot be blank' if project.blank?
|
85
|
+
options = {}
|
86
|
+
options[:name] = name unless name.blank?
|
87
|
+
options[:description] = description unless description.nil?
|
102
88
|
|
103
|
-
|
89
|
+
put("/projects/#{id}", body: { **options })
|
90
|
+
end
|
104
91
|
|
105
|
-
|
106
|
-
|
92
|
+
# Delete a project
|
93
|
+
#
|
94
|
+
# @example
|
95
|
+
# client.delete_project(12324)
|
96
|
+
# @example
|
97
|
+
# client.delete_project('157432')
|
98
|
+
# @example
|
99
|
+
# client.delete_project(my_project)
|
100
|
+
#
|
101
|
+
# @param project [Integer|String|Project] either a project object or a project id
|
102
|
+
# @raise [Error::InvalidParameter] if project param is blank
|
103
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/projects.md#trash-a-project
|
104
|
+
def delete_project(project)
|
105
|
+
raise Error::InvalidParameter, 'project cannot be blank' if project.blank?
|
107
106
|
|
108
|
-
|
107
|
+
id = project.respond_to?(:id) ? project.id : project
|
109
108
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
109
|
+
delete("/projects/#{id}")
|
110
|
+
end
|
111
|
+
|
112
|
+
alias trash_project delete_project
|
114
113
|
|
115
|
-
|
116
|
-
|
117
|
-
|
114
|
+
def todoset(project)
|
115
|
+
todoset = project.todoset
|
116
|
+
get(todoset.url, override_path: true)
|
117
|
+
end
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
data/lib/camper/api/resource.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
module Camper
|
4
|
+
class Client
|
5
|
+
module ResourceAPI
|
6
|
+
def resource(url)
|
7
|
+
get(url, override_path: true)
|
8
|
+
end
|
7
9
|
end
|
8
10
|
end
|
9
11
|
end
|
data/lib/camper/api/todolists.rb
CHANGED
@@ -1,103 +1,95 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
3
|
+
module Camper
|
4
|
+
class Client
|
5
|
+
# Defines methods related to todolists.
|
6
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/todolists.md
|
7
|
+
module TodolistsAPI
|
8
|
+
# Get the todolists associated with the todoset
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# client.todolists(todoset)
|
12
|
+
# @example
|
13
|
+
# client.todolists(todoset, status: 'archived')
|
14
|
+
#
|
15
|
+
# @param todoset [Resource] the parent todoset resource
|
16
|
+
# @param options [Hash] extra options to filter the list of todolist
|
17
|
+
# @return [PaginatedResponse<Resource>]
|
18
|
+
# @raise [Error::InvalidParameter] if todolists_url field in todoset param
|
19
|
+
# is not a valid basecamp url
|
20
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/todolists.md#get-to-do-lists
|
21
|
+
def todolists(todoset, options = {})
|
22
|
+
get(todoset.todolists_url, query: options, override_path: true)
|
23
|
+
end
|
22
24
|
|
23
|
-
|
25
|
+
# Get a todolist with a given id
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# client.todolist(todoset, '2345')
|
29
|
+
#
|
30
|
+
# @param todoset [Resource] the parent todoset resource
|
31
|
+
# @param id [Integer, String] the id of the todolist to get
|
32
|
+
# @return [Resource]
|
33
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/todolists.md#get-a-to-do-list
|
34
|
+
def todolist(todoset, id)
|
35
|
+
get("/buckets/#{todoset.bucket.id}/todolists/#{id}")
|
36
|
+
end
|
24
37
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
end
|
38
|
+
# Create a todolist within the given todoset
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
# client.create_todolist(todoset, 'Launch', "<div><em>Finish it!</em></div>")
|
42
|
+
#
|
43
|
+
# @param todoset [Resource] the parent todoset resource
|
44
|
+
# @param name [String] the name of the new todolist
|
45
|
+
# @param description [String] an optional description for the todolist
|
46
|
+
# @return [Resource]
|
47
|
+
# @raise [Error::InvalidParameter] if todolists_url field in todoset param
|
48
|
+
# is not a valid basecamp url
|
49
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/todolists.md#create-a-to-do-list
|
50
|
+
def create_todolist(todoset, name, description = '')
|
51
|
+
body = { name: name, description: description }
|
40
52
|
|
41
|
-
|
42
|
-
|
43
|
-
# @example
|
44
|
-
# client.create_todolist(todoset, 'Launch', "<div><em>Finish it!</em></div>")
|
45
|
-
#
|
46
|
-
# @param todoset [Resource] the parent todoset resource
|
47
|
-
# @param name [String] the name of the new todolist
|
48
|
-
# @param description [String] an optional description for the todolist
|
49
|
-
# @return [Resource]
|
50
|
-
# @raise [Error::InvalidParameter] if todolists_url field in todoset param
|
51
|
-
# is not a valid basecamp url
|
52
|
-
# @see https://github.com/basecamp/bc3-api/blob/master/sections/todolists.md#create-a-to-do-list
|
53
|
-
def create_todolist(todoset, name, description = '')
|
54
|
-
url = todoset.todolists_url
|
53
|
+
post(todoset.todolists_url, body: body, override_path: true)
|
54
|
+
end
|
55
55
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
# Update a todolist to change name and description
|
57
|
+
#
|
58
|
+
# @example
|
59
|
+
# client.update_todolist(todolist, 'Launch')
|
60
|
+
# @example
|
61
|
+
# client.update_todolist(todolist, 'Launch', "<div><em>Finish it!</em></div>")
|
62
|
+
# @example
|
63
|
+
# client.update_todolist(todolist, 'Launch', '')
|
64
|
+
#
|
65
|
+
# @param todolist [Resource] the todolist resource to update
|
66
|
+
# @param name [String] the new name of the todolist
|
67
|
+
# @param description [String] a new optional description for the todolist. If not specified,
|
68
|
+
# it will be set to the current description value
|
69
|
+
# @return [Resource]
|
70
|
+
# @raise [Error::InvalidParameter] if url field in todolist param
|
71
|
+
# is not a valid basecamp url
|
72
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/todolists.md#update-a-to-do-list
|
73
|
+
def update_todolist(todolist, name, description = nil)
|
74
|
+
body = { name: name }
|
75
|
+
body[:description] = description.nil? ? todolist.description : description
|
60
76
|
|
61
|
-
|
62
|
-
|
63
|
-
# @example
|
64
|
-
# client.update_todolist(todolist, 'Launch')
|
65
|
-
# @example
|
66
|
-
# client.update_todolist(todolist, 'Launch', "<div><em>Finish it!</em></div>")
|
67
|
-
# @example
|
68
|
-
# client.update_todolist(todolist, 'Launch', '')
|
69
|
-
#
|
70
|
-
# @param todolist [Resource] the todolist resource to update
|
71
|
-
# @param name [String] the new name of the todolist
|
72
|
-
# @param description [String] a new optional description for the todolist. If not specified,
|
73
|
-
# it will be set to the current description value
|
74
|
-
# @return [Resource]
|
75
|
-
# @raise [Error::InvalidParameter] if url field in todolist param
|
76
|
-
# is not a valid basecamp url
|
77
|
-
# @see https://github.com/basecamp/bc3-api/blob/master/sections/todolists.md#update-a-to-do-list
|
78
|
-
def update_todolist(todolist, name, description = nil)
|
79
|
-
url = todolist.url
|
80
|
-
|
81
|
-
raise Camper::Error::InvalidParameter, todolist unless Camper::UrlUtils.basecamp_url?(url)
|
82
|
-
|
83
|
-
body = { name: name }
|
84
|
-
body[:description] = description.nil? ? todolist.description : description
|
85
|
-
|
86
|
-
put(url, body: body, override_path: true)
|
87
|
-
end
|
77
|
+
put(todolist.url, body: body, override_path: true)
|
78
|
+
end
|
88
79
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
80
|
+
# Trash a todolist
|
81
|
+
# it calls the trash_recording endpoint under the hood
|
82
|
+
#
|
83
|
+
# @example
|
84
|
+
# client.trash_todolist(todolist)
|
85
|
+
#
|
86
|
+
# @param todolist [Resource] the todolist to be trashed
|
87
|
+
# @raise [Error::InvalidParameter] if the type field in todolist param
|
88
|
+
# is not an allowed type in the recording API
|
89
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/recordings.md#trash-a-recording
|
90
|
+
def trash_todolist(todolist)
|
91
|
+
trash_recording(todolist)
|
92
|
+
end
|
101
93
|
end
|
102
94
|
end
|
103
95
|
end
|