camper 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/Gemfile.lock +1 -1
- data/README.md +4 -3
- data/examples/recordings.rb +13 -0
- data/examples/todolists.rb +19 -1
- data/examples/todos.rb +13 -1
- data/lib/camper.rb +1 -0
- data/lib/camper/api/people.rb +3 -3
- data/lib/camper/api/projects.rb +2 -2
- data/lib/camper/api/recordings.rb +84 -0
- data/lib/camper/api/todolists.rb +27 -5
- data/lib/camper/api/todos.rb +67 -2
- data/lib/camper/client.rb +1 -0
- data/lib/camper/recording_types.rb +22 -0
- data/lib/camper/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dbee68b43218a497b29c8006b70cb344d0925c879f5220aef14228e12cd6dce
|
4
|
+
data.tar.gz: fc3f58b2d04d11912e6fd497c86eba3039dae579c645eb8a5a5493d9076283d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00fabce0dc901476883b26af2e71b8b68fab3859577172e3a4456d20b099ffed533961917388e3eba39fa334f8b9097b73804a15a97264bc9cc6ebd8911b26a1
|
7
|
+
data.tar.gz: b360150b837d8d0d89e794f7145c711a7ef86f88267d9b17d6829b1988ef425f8c82f53b4c0037f74c6a63f655689c93438da9c7f618e5c02c004bffbea27f16
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,26 @@
|
|
4
4
|
|
5
5
|
**Implemented enhancements:**
|
6
6
|
|
7
|
+
- Implement trash\_todo endpoint [\#58](https://github.com/renehernandez/camper/issues/58)
|
8
|
+
- Implement trash\_todolist endpoint [\#57](https://github.com/renehernandez/camper/issues/57)
|
9
|
+
- To-do API is missing update\_todo endpoint [\#49](https://github.com/renehernandez/camper/issues/49)
|
10
|
+
- update\_todolist endpoint now sends the current description if none is specified [\#62](https://github.com/renehernandez/camper/pull/62)
|
11
|
+
- Add trash\_todolist endpoint [\#61](https://github.com/renehernandez/camper/pull/61)
|
12
|
+
- Add trash\_todo endpoint implementation [\#60](https://github.com/renehernandez/camper/pull/60)
|
13
|
+
- Add recordings api [\#53](https://github.com/renehernandez/camper/pull/53)
|
14
|
+
- Add update\_todo implementation [\#52](https://github.com/renehernandez/camper/pull/52)
|
15
|
+
|
16
|
+
**Fixed bugs:**
|
17
|
+
|
18
|
+
- return tag should mention PaginatedResponse instead of Array [\#56](https://github.com/renehernandez/camper/issues/56)
|
19
|
+
- Get endpoints params need to be set under query field [\#54](https://github.com/renehernandez/camper/issues/54)
|
20
|
+
- Update endpoints documentation to use PaginatedResponse [\#59](https://github.com/renehernandez/camper/pull/59)
|
21
|
+
- Fix query string generation in get endpoints [\#55](https://github.com/renehernandez/camper/pull/55)
|
22
|
+
|
23
|
+
## [v0.0.10](https://github.com/renehernandez/camper/tree/v0.0.10) (2020-10-30)
|
24
|
+
|
25
|
+
**Implemented enhancements:**
|
26
|
+
|
7
27
|
- Complete projects api [\#51](https://github.com/renehernandez/camper/pull/51)
|
8
28
|
|
9
29
|
## [v0.0.9](https://github.com/renehernandez/camper/tree/v0.0.9) (2020-10-28)
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -33,9 +33,10 @@ Currently, Camper supports the following endpoints:
|
|
33
33
|
* [Comments](https://github.com/basecamp/bc3-api/blob/master/sections/comments.md): Implementation at [comments.rb](https://github.com/renehernandez/camper/blob/main/lib/camper/api/comments.rb) (Partial)
|
34
34
|
* [Messages](https://github.com/basecamp/bc3-api/blob/master/sections/messages.md): Implementation at [messages.rb](https://github.com/renehernandez/camper/blob/main/lib/camper/api/messages.rb) (Partial)
|
35
35
|
* [People](https://github.com/basecamp/bc3-api/blob/master/sections/people.md): Implementation at [people.rb](https://github.com/renehernandez/camper/blob/main/lib/camper/api/people.rb) (Complete)
|
36
|
-
* [Projects](https://github.com/basecamp/bc3-api/blob/master/sections/projects.md): Implementation at [projects.rb](https://github.com/renehernandez/camper/blob/main/lib/camper/api/projects.rb) (
|
37
|
-
* [
|
38
|
-
* [To-
|
36
|
+
* [Projects](https://github.com/basecamp/bc3-api/blob/master/sections/projects.md): Implementation at [projects.rb](https://github.com/renehernandez/camper/blob/main/lib/camper/api/projects.rb) (Complete)
|
37
|
+
* [Recordings](https://github.com/basecamp/bc3-api/blob/master/sections/recordings.md): Implementation at [recordings.rb](https://github.com/renehernandez/camper/blob/main/lib/camper/api/recordings.rb)
|
38
|
+
* [To-do list](https://github.com/basecamp/bc3-api/blob/master/sections/todolists.md): Implementation at [todolists.rb](https://github.com/renehernandez/camper/blob/main/lib/camper/api/todolists.rb) (Complete)
|
39
|
+
* [To-dos](https://github.com/basecamp/bc3-api/blob/master/sections/todos.md): Implementation at [todos.rb](https://github.com/renehernandez/camper/blob/main/lib/camper/api/todos.rb) (Complete)
|
39
40
|
|
40
41
|
## Usage
|
41
42
|
|
data/examples/todolists.rb
CHANGED
@@ -13,6 +13,7 @@ projects.auto_paginate do |p|
|
|
13
13
|
|
14
14
|
puts "Ratio of completed Todos in Todoset: #{todoset.completed_ratio}"
|
15
15
|
|
16
|
+
puts 'Listing active todolists'
|
16
17
|
client.todolists(todoset).auto_paginate(5) do |list|
|
17
18
|
puts "Todolist: #{list.title}"
|
18
19
|
|
@@ -26,7 +27,24 @@ projects.auto_paginate do |p|
|
|
26
27
|
|
27
28
|
begin
|
28
29
|
client.todolists(p)
|
29
|
-
rescue Camper::Error::InvalidParameter
|
30
|
+
rescue Camper::Error::InvalidParameter, NoMethodError
|
30
31
|
puts 'Cannot use a project p to get the todolists'
|
31
32
|
end
|
33
|
+
|
34
|
+
puts 'Listing archived todolists'
|
35
|
+
client.todolists(todoset, status: :archived).auto_paginate do |list|
|
36
|
+
client.todos(list).auto_paginate do |todo|
|
37
|
+
puts "Todo: #{todo.title}"
|
38
|
+
puts "Can be commented: #{todo.can_be_commented?}"
|
39
|
+
puts "It's completed: #{todo.completed}"
|
40
|
+
|
41
|
+
client.complete_todo(todo)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
puts 'Create a new todolist'
|
46
|
+
new_list = client.create_todolist(todoset, 'Temporary list')
|
47
|
+
puts "Todolist title: #{new_list.title}"
|
48
|
+
puts 'Trash list'
|
49
|
+
client.trash_todolist(new_list)
|
32
50
|
end
|
data/examples/todos.rb
CHANGED
@@ -10,6 +10,8 @@ end
|
|
10
10
|
|
11
11
|
projects = client.projects
|
12
12
|
|
13
|
+
selected_todo = nil
|
14
|
+
|
13
15
|
projects.auto_paginate do |p|
|
14
16
|
puts "Project: #{p.name}"
|
15
17
|
|
@@ -25,6 +27,16 @@ projects.auto_paginate do |p|
|
|
25
27
|
puts "Get Todo using project id: #{client.todo(p.id, todo.id).title}"
|
26
28
|
puts "Get Todo using project resource: #{client.todo(p, todo.id).title}"
|
27
29
|
puts "Get Todo using todolist resource: #{client.todo(list, todo.id).title}"
|
30
|
+
|
31
|
+
selected_todo = todo
|
28
32
|
end
|
33
|
+
|
34
|
+
puts 'Create new todo'
|
35
|
+
new_todo = client.create_todo(list, 'new todo')
|
36
|
+
puts "New Todo title: #{new_todo.title}"
|
37
|
+
puts 'Trash new todo'
|
38
|
+
client.trash_todo(new_todo)
|
29
39
|
end
|
30
|
-
end
|
40
|
+
end
|
41
|
+
|
42
|
+
client.update_todo(selected_todo, { description: 'New Description' })
|
data/lib/camper.rb
CHANGED
data/lib/camper/api/people.rb
CHANGED
@@ -9,7 +9,7 @@ class Camper::Client
|
|
9
9
|
# @example
|
10
10
|
# client.people
|
11
11
|
#
|
12
|
-
# @return [
|
12
|
+
# @return [PaginatedResponse<Resource>]
|
13
13
|
# @see https://github.com/basecamp/bc3-api/blob/master/sections/people.md#get-all-people
|
14
14
|
def people
|
15
15
|
get('/people')
|
@@ -25,7 +25,7 @@ class Camper::Client
|
|
25
25
|
# client.people_in_project(my_project)
|
26
26
|
#
|
27
27
|
# @param project [Resource|Integer|String] A project resource or a project id
|
28
|
-
# @return [
|
28
|
+
# @return [PaginatedResponse<Resource>]
|
29
29
|
# @see https://github.com/basecamp/bc3-api/blob/master/sections/people.md#get-people-on-a-project
|
30
30
|
def people_in_project(project)
|
31
31
|
id = project.respond_to?(:id) ? project.id : project
|
@@ -65,7 +65,7 @@ class Camper::Client
|
|
65
65
|
# @example
|
66
66
|
# client.pingable_people
|
67
67
|
#
|
68
|
-
# @return [
|
68
|
+
# @return [PaginatedResponse<Resource>]
|
69
69
|
# @see https://github.com/basecamp/bc3-api/blob/master/sections/people.md#get-pingable-people
|
70
70
|
def pingable_people
|
71
71
|
get('/circles/people')
|
data/lib/camper/api/projects.rb
CHANGED
@@ -12,10 +12,10 @@ class Camper::Client
|
|
12
12
|
# client.projects(status: 'trashed')
|
13
13
|
#
|
14
14
|
# @param options [Hash] extra options to filter the list of todolist
|
15
|
-
# @return [
|
15
|
+
# @return [PaginatedResponse<Project>]
|
16
16
|
# @see https://github.com/basecamp/bc3-api/blob/master/sections/projects.md#get-all-projects
|
17
17
|
def projects(options = {})
|
18
|
-
get('/projects', options)
|
18
|
+
get('/projects', query: options)
|
19
19
|
end
|
20
20
|
|
21
21
|
# Get a project with a given id, granted they have access to it
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Camper
|
4
|
+
class Client
|
5
|
+
# Defines methods related to recordings.
|
6
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/recordings.md
|
7
|
+
module RecordingsAPI
|
8
|
+
# Get a paginated response of recordings of a given type
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# client.recordings('Todo')
|
12
|
+
# @example
|
13
|
+
# client.recordings(
|
14
|
+
# 'Document',
|
15
|
+
# bucket: [1,2],
|
16
|
+
# status: 'archived',
|
17
|
+
# sort: 'updated_at',
|
18
|
+
# direction: 'asc'
|
19
|
+
# )
|
20
|
+
#
|
21
|
+
# @param type [String] type of the recording
|
22
|
+
# @param options [Hash] extra options to filter the recordings to be resulted
|
23
|
+
# @return [PaginatedResponse<Resource>]
|
24
|
+
# @raise [Error::InvalidParameter] if type is not one of the allowed types
|
25
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/recordings.md#get-recordings
|
26
|
+
def recordings(type, options = {})
|
27
|
+
raise Error::InvalidParameter, type unless RecordingTypes.all.include?(type)
|
28
|
+
|
29
|
+
get('/projects/recordings', query: options.merge(type: type))
|
30
|
+
end
|
31
|
+
|
32
|
+
# Trash a given recording
|
33
|
+
#
|
34
|
+
# @example
|
35
|
+
# client.trash_recording(my_todo)
|
36
|
+
# @example
|
37
|
+
# client.trash_recording(my_message)
|
38
|
+
#
|
39
|
+
# @param recording [Resource] a resource of a valid recording type
|
40
|
+
# @raise [Error::InvalidParameter] if type field in recording param
|
41
|
+
# is not one of the allowed types
|
42
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/recordings.md#trash-a-recording
|
43
|
+
def trash_recording(recording)
|
44
|
+
raise Error::InvalidParameter, recording unless RecordingTypes.all.include?(recording.type)
|
45
|
+
|
46
|
+
put("/buckets/#{recording.bucket.id}/recordings/#{recording.id}/status/trashed")
|
47
|
+
end
|
48
|
+
|
49
|
+
# Archive a given recording
|
50
|
+
#
|
51
|
+
# @example
|
52
|
+
# client.archive_recording(my_todo)
|
53
|
+
# @example
|
54
|
+
# client.archive_recording(my_message)
|
55
|
+
#
|
56
|
+
# @param recording [Resource] a resource of a valid recording type
|
57
|
+
# @raise [Error::InvalidParameter] if type field in recording param
|
58
|
+
# is not one of the allowed types
|
59
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/recordings.md#archive-a-recording
|
60
|
+
def archive_recording(recording)
|
61
|
+
raise Error::InvalidParameter, recording unless RecordingTypes.all.include?(recording.type)
|
62
|
+
|
63
|
+
put("/buckets/#{recording.bucket.id}/recordings/#{recording.id}/status/archived")
|
64
|
+
end
|
65
|
+
|
66
|
+
# Unarchive a given recording
|
67
|
+
#
|
68
|
+
# @example
|
69
|
+
# client.unarchive_recording(my_todo)
|
70
|
+
# @example
|
71
|
+
# client.unarchive_recording(my_message)
|
72
|
+
#
|
73
|
+
# @param recording [Resource] a resource of a valid recording type
|
74
|
+
# @raise [Error::InvalidParameter] if type field in recording param
|
75
|
+
# is not one of the allowed types
|
76
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/recordings.md#unarchive-a-recording
|
77
|
+
def unarchive_recording(recording)
|
78
|
+
raise Error::InvalidParameter, recording unless RecordingTypes.all.include?(recording.type)
|
79
|
+
|
80
|
+
put("/buckets/#{recording.bucket.id}/recordings/#{recording.id}/status/active")
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
data/lib/camper/api/todolists.rb
CHANGED
@@ -13,7 +13,7 @@ class Camper::Client
|
|
13
13
|
#
|
14
14
|
# @param todoset [Resource] the parent todoset resource
|
15
15
|
# @param options [Hash] extra options to filter the list of todolist
|
16
|
-
# @return [
|
16
|
+
# @return [PaginatedResponse<Resource>]
|
17
17
|
# @raise [Error::InvalidParameter] if todolists_url field in todoset param
|
18
18
|
# is not a valid basecamp url
|
19
19
|
# @see https://github.com/basecamp/bc3-api/blob/master/sections/todolists.md#get-to-do-lists
|
@@ -22,7 +22,7 @@ class Camper::Client
|
|
22
22
|
|
23
23
|
raise Camper::Error::InvalidParameter, todoset unless Camper::UrlUtils.basecamp_url?(url)
|
24
24
|
|
25
|
-
get(url, options
|
25
|
+
get(url, query: options, override_path: true)
|
26
26
|
end
|
27
27
|
|
28
28
|
# Get a todolist with a given id
|
@@ -61,21 +61,43 @@ class Camper::Client
|
|
61
61
|
# Update a todolist to change name and description
|
62
62
|
#
|
63
63
|
# @example
|
64
|
+
# client.update_todolist(todolist, 'Launch')
|
65
|
+
# @example
|
64
66
|
# client.update_todolist(todolist, 'Launch', "<div><em>Finish it!</em></div>")
|
67
|
+
# @example
|
68
|
+
# client.update_todolist(todolist, 'Launch', '')
|
65
69
|
#
|
66
70
|
# @param todolist [Resource] the todolist resource to update
|
67
71
|
# @param name [String] the new name of the todolist
|
68
|
-
# @param description [String] a new optional description for 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
|
69
74
|
# @return [Resource]
|
70
75
|
# @raise [Error::InvalidParameter] if url field in todolist param
|
71
76
|
# is not a valid basecamp url
|
72
77
|
# @see https://github.com/basecamp/bc3-api/blob/master/sections/todolists.md#update-a-to-do-list
|
73
|
-
def update_todolist(todolist, name, description =
|
78
|
+
def update_todolist(todolist, name, description = nil)
|
74
79
|
url = todolist.url
|
75
80
|
|
76
81
|
raise Camper::Error::InvalidParameter, todolist unless Camper::UrlUtils.basecamp_url?(url)
|
77
82
|
|
78
|
-
|
83
|
+
body = { name: name }
|
84
|
+
body[:description] = description.nil? ? todolist.description : description
|
85
|
+
|
86
|
+
put(url, body: body, override_path: true)
|
87
|
+
end
|
88
|
+
|
89
|
+
# Trash a todolist
|
90
|
+
# it calls the trash_recording endpoint under the hood
|
91
|
+
#
|
92
|
+
# @example
|
93
|
+
# client.trash_todolist(todolist)
|
94
|
+
#
|
95
|
+
# @param todolist [Resource] the todolist to be trashed
|
96
|
+
# @raise [Error::InvalidParameter] if the type field in todolist param
|
97
|
+
# is not an allowed type in the recording API
|
98
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/recordings.md#trash-a-recording
|
99
|
+
def trash_todolist(todolist)
|
100
|
+
trash_recording(todolist)
|
79
101
|
end
|
80
102
|
end
|
81
103
|
end
|
data/lib/camper/api/todos.rb
CHANGED
@@ -4,6 +4,16 @@ class Camper::Client
|
|
4
4
|
# Defines methods related to todos.
|
5
5
|
# @see https://github.com/basecamp/bc3-api/blob/master/sections/todos.md
|
6
6
|
module TodosAPI
|
7
|
+
PARAMETERS = %w[
|
8
|
+
content
|
9
|
+
description
|
10
|
+
assignee_ids
|
11
|
+
completion_subscriber_ids
|
12
|
+
notify
|
13
|
+
due_on
|
14
|
+
starts_on
|
15
|
+
].freeze
|
16
|
+
|
7
17
|
# Get the todos in a todolist
|
8
18
|
#
|
9
19
|
# @example
|
@@ -22,7 +32,7 @@ class Camper::Client
|
|
22
32
|
|
23
33
|
raise Camper::Error::InvalidParameter, todolist unless Camper::UrlUtils.basecamp_url?(url)
|
24
34
|
|
25
|
-
get(url, options
|
35
|
+
get(url, query: options, override_path: true)
|
26
36
|
end
|
27
37
|
|
28
38
|
# Get a todo with a given id using a particular parent resource.
|
@@ -63,19 +73,52 @@ class Camper::Client
|
|
63
73
|
#
|
64
74
|
# @param todolist [Resource] the todolist where the todo is going to be created
|
65
75
|
# @param content [String] what the to-do is for
|
66
|
-
# @param options [Hash] extra
|
76
|
+
# @param options [Hash] extra parameters for the todo such as due_date and description
|
67
77
|
# @return [Resource]
|
68
78
|
# @raise [Error::InvalidParameter] if todos_url field in todolist param
|
69
79
|
# is not a valid basecamp url
|
80
|
+
# @raise [Error::InvalidParameter] if content parameter is blank
|
70
81
|
# @see https://github.com/basecamp/bc3-api/blob/master/sections/todos.md#create-a-to-do
|
71
82
|
def create_todo(todolist, content, options = {})
|
72
83
|
url = todolist.todos_url
|
73
84
|
|
74
85
|
raise Camper::Error::InvalidParameter, todolist unless Camper::UrlUtils.basecamp_url?(url)
|
86
|
+
raise Camper::Error::InvalidParameter, content if content.blank?
|
75
87
|
|
76
88
|
post(url, body: { content: content, **options }, override_path: true)
|
77
89
|
end
|
78
90
|
|
91
|
+
# Update a todo.
|
92
|
+
#
|
93
|
+
# @example
|
94
|
+
# client.update_todo(todo, 'Todo')
|
95
|
+
# @example
|
96
|
+
# client.update_todo(
|
97
|
+
# todo,
|
98
|
+
# 'Program it',
|
99
|
+
# description: "<div><em>Try that new language!</em></div>,
|
100
|
+
# due_on: "2016-05-01",
|
101
|
+
# starts_on: "2016-04-30"
|
102
|
+
# )
|
103
|
+
#
|
104
|
+
# @param todo [Resource] the todo to be updated
|
105
|
+
# @param options [Hash] parameters to be changed. The ones that are not specified
|
106
|
+
# will be set to the current values of the todo object
|
107
|
+
# @return [Resource]
|
108
|
+
# @raise [Error::InvalidParameter] if url field in todo param
|
109
|
+
# is not a valid basecamp url
|
110
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/todos.md#update-a-to-do
|
111
|
+
def update_todo(todo, options)
|
112
|
+
url = todo.url
|
113
|
+
|
114
|
+
raise Camper::Error::InvalidParameter, url unless Camper::UrlUtils.basecamp_url?(url)
|
115
|
+
|
116
|
+
body = {}.merge(options)
|
117
|
+
PARAMETERS.each { |p| body[p.to_sym] = todo[p] unless key_is_present?(body, p) }
|
118
|
+
|
119
|
+
put(url, body: body, override_path: true)
|
120
|
+
end
|
121
|
+
|
79
122
|
# Complete a todo
|
80
123
|
#
|
81
124
|
# @example
|
@@ -129,5 +172,27 @@ class Camper::Client
|
|
129
172
|
|
130
173
|
put("#{url}/position", position: position, override_path: true)
|
131
174
|
end
|
175
|
+
|
176
|
+
# Trash a todo
|
177
|
+
# it calls the trash_recording endpoint under the hood
|
178
|
+
#
|
179
|
+
# @example
|
180
|
+
# client.trash_todo(todo)
|
181
|
+
#
|
182
|
+
# @param todo [Resource] the todo to be trashed
|
183
|
+
# @raise [Error::InvalidParameter] if url field in todo param
|
184
|
+
# is not a valid basecamp url
|
185
|
+
# @see https://github.com/basecamp/bc3-api/blob/master/sections/recordings.md#trash-a-recording
|
186
|
+
def trash_todo(todo)
|
187
|
+
raise Camper::Error::InvalidParameter, todo unless Camper::UrlUtils.basecamp_url?(todo.url)
|
188
|
+
|
189
|
+
trash_recording(todo)
|
190
|
+
end
|
191
|
+
|
192
|
+
private
|
193
|
+
|
194
|
+
def key_is_present?(hash, key)
|
195
|
+
hash.key?(key.to_sym) || hash.key?(key.to_s)
|
196
|
+
end
|
132
197
|
end
|
133
198
|
end
|
data/lib/camper/client.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Camper
|
4
|
+
class RecordingTypes
|
5
|
+
COMMENT = 'Comment'
|
6
|
+
DOCUMENT = 'Document'
|
7
|
+
MESSAGE = 'Message'
|
8
|
+
QUESTION_ANSWER = 'Question::Answer'
|
9
|
+
SCHEDULE_ENTRY = 'Schedule::Entry'
|
10
|
+
TODO = 'Todo'
|
11
|
+
TODOLIST = 'Todolist'
|
12
|
+
UPLOAD = 'Upload'
|
13
|
+
|
14
|
+
# rubocop:disable Style/ClassVars
|
15
|
+
def self.all
|
16
|
+
@@recordings ||= constants(false).map { |c| const_get(c) }.sort
|
17
|
+
|
18
|
+
@@recordings
|
19
|
+
end
|
20
|
+
# rubocop:enable Style/ClassVars
|
21
|
+
end
|
22
|
+
end
|
data/lib/camper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: camper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- renehernandez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- examples/obtain_acces_token.rb
|
129
129
|
- examples/people.rb
|
130
130
|
- examples/projects.rb
|
131
|
+
- examples/recordings.rb
|
131
132
|
- examples/todolists.rb
|
132
133
|
- examples/todos.rb
|
133
134
|
- lib/camper.rb
|
@@ -135,6 +136,7 @@ files:
|
|
135
136
|
- lib/camper/api/messages.rb
|
136
137
|
- lib/camper/api/people.rb
|
137
138
|
- lib/camper/api/projects.rb
|
139
|
+
- lib/camper/api/recordings.rb
|
138
140
|
- lib/camper/api/resource.rb
|
139
141
|
- lib/camper/api/todolists.rb
|
140
142
|
- lib/camper/api/todos.rb
|
@@ -146,6 +148,7 @@ files:
|
|
146
148
|
- lib/camper/logging.rb
|
147
149
|
- lib/camper/paginated_response.rb
|
148
150
|
- lib/camper/pagination_data.rb
|
151
|
+
- lib/camper/recording_types.rb
|
149
152
|
- lib/camper/request.rb
|
150
153
|
- lib/camper/resource.rb
|
151
154
|
- lib/camper/resources/project.rb
|