bloomy 0.10.0 → 0.11.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 +4 -4
- data/CONTRIBUTING.md +7 -4
- data/lib/bloomy/client.rb +10 -8
- data/lib/bloomy/operations/goals.rb +140 -123
- data/lib/bloomy/operations/headlines.rb +122 -104
- data/lib/bloomy/operations/issues.rb +83 -99
- data/lib/bloomy/operations/meetings.rb +156 -154
- data/lib/bloomy/operations/scorecard.rb +91 -93
- data/lib/bloomy/operations/todos.rb +123 -128
- data/lib/bloomy/operations/users.rb +100 -85
- data/lib/bloomy/types/items.rb +119 -0
- data/lib/bloomy/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54194503af40ece6bf43213c629ef356ace57155c5a2e8a482b0fe6aee05db3d
|
4
|
+
data.tar.gz: 331f8e7ee2c8b8a81430e8189637516f0de6749ebe015c4088bb5891722b645b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6edf8e382af72ec5ad3fe708958437c9e5af9cf84029453002c42a0237bcc327f544642e748da56d0d5fffd50c96722807fd7db6a11393754c8a1bae0986cc44
|
7
|
+
data.tar.gz: c2e67dfc490dc5cedf8f3994989ff57c30f0e60161d7a6673e40678b24e091277a4a58d8cedd93f702dfe1e7123031b4d55473a33d7706debeb46e66657034c8
|
data/CONTRIBUTING.md
CHANGED
@@ -16,6 +16,9 @@ If you want to contribute to the project, please follow these steps:
|
|
16
16
|
|
17
17
|
### Development Setup
|
18
18
|
|
19
|
+
> [!IMPORTANT]
|
20
|
+
> Make sure you have a Bloom Growth account and that you're using a user that won't disrupt the experience of other users. The tests will create and delete meetings, so make sure you're not using a user that has important meetings scheduled.
|
21
|
+
|
19
22
|
1. Fork and clone the repository:
|
20
23
|
|
21
24
|
```sh
|
@@ -28,7 +31,7 @@ git clone https://github.com/your-username/bloomy.git
|
|
28
31
|
bundle install
|
29
32
|
```
|
30
33
|
|
31
|
-
3. Set up pre-commit hooks:
|
34
|
+
3. Set up [pre-commit](https://pre-commit.com) hooks:
|
32
35
|
|
33
36
|
```sh
|
34
37
|
pre-commit install
|
@@ -41,10 +44,10 @@ export USERNAME=your_username
|
|
41
44
|
export PASSWORD=your_password
|
42
45
|
```
|
43
46
|
|
44
|
-
5. Run the tests:
|
47
|
+
5. Run the tests to make sure everything is green:
|
45
48
|
|
46
49
|
```sh
|
47
|
-
bundle exec rspec
|
50
|
+
bundle exec rspec --fail-fast
|
48
51
|
```
|
49
52
|
|
50
53
|
### Making Changes
|
@@ -63,7 +66,7 @@ As for coding style guidelines make sure you:
|
|
63
66
|
2. Make sure your PR passes the CI checks.
|
64
67
|
3. Make sure your PR has a clear title and description.
|
65
68
|
4. Update the version according to [Semantic Versioning](https://semver.org/).
|
66
|
-
5.
|
69
|
+
5. Use [Conventional Commits](https://www.conventionalcommits.org/) for your commit messages.
|
67
70
|
|
68
71
|
Make sure to follow these guidelines to ensure your PR is accepted and merged quickly. Rinse and repeat! 🚀
|
69
72
|
|
data/lib/bloomy/client.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "faraday"
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
|
5
|
+
require "bloomy/types/items"
|
6
|
+
require "bloomy/operations/users"
|
7
|
+
require "bloomy/operations/todos"
|
8
|
+
require "bloomy/operations/goals"
|
9
|
+
require "bloomy/operations/meetings"
|
10
|
+
require "bloomy/operations/scorecard"
|
11
|
+
require "bloomy/operations/issues"
|
12
|
+
require "bloomy/operations/headlines"
|
13
|
+
require "bloomy/utils/plugin_loader"
|
12
14
|
|
13
15
|
module Bloomy
|
14
16
|
# The Client class is the main entry point for interacting with the Bloomy API.
|
@@ -2,141 +2,158 @@
|
|
2
2
|
|
3
3
|
require "bloomy/utils/get_user_id"
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
# @param conn [Object] the connection object to interact with the API
|
11
|
-
def initialize(conn)
|
12
|
-
@conn = conn
|
13
|
-
end
|
5
|
+
module Bloomy
|
6
|
+
# Class to handle all the operations related to goals (also known as "rocks")
|
7
|
+
# @note This class is already initialized via the client and usable as `client.goal.method`
|
8
|
+
class Goal
|
9
|
+
include Bloomy::Utilities::UserIdUtility
|
14
10
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
# @example
|
21
|
-
# client.goal.list
|
22
|
-
# #=> [{ id: 1, title: "Complete project", created_at: "2024-06-10", ... }, ...]
|
23
|
-
def list(user_id = self.user_id, archived: false)
|
24
|
-
active_goals = @conn.get("rocks/user/#{user_id}?include_origin=true").body.map do |goal|
|
25
|
-
{
|
26
|
-
id: goal["Id"],
|
27
|
-
title: goal["Name"],
|
28
|
-
created_at: goal["CreateTime"],
|
29
|
-
due_date: goal["DueDate"],
|
30
|
-
status: goal["Complete"] ? "Completed" : "Incomplete",
|
31
|
-
meeting_id: goal["Origins"].empty? ? nil : goal["Origins"][0]["Id"],
|
32
|
-
meeting_title: goal["Origins"].empty? ? nil : goal["Origins"][0]["Name"]
|
33
|
-
}
|
11
|
+
# Initializes a new Goal instance
|
12
|
+
#
|
13
|
+
# @param conn [Object] the connection object to interact with the API
|
14
|
+
def initialize(conn)
|
15
|
+
@conn = conn
|
34
16
|
end
|
35
17
|
|
36
|
-
|
37
|
-
|
18
|
+
# Lists all goals for a specific user
|
19
|
+
#
|
20
|
+
# @param user_id [Integer] the ID of the user (default is the initialized user ID)
|
21
|
+
# @param archived [Boolean] whether to include archived goals (default: false)
|
22
|
+
# @return [Array<GoalItem>, Hash] Returns either:
|
23
|
+
# - An array of GoalItem objects if archived is false
|
24
|
+
# - A hash with :active and :archived arrays of GoalItem objects if archived is true
|
25
|
+
# @example List active goals
|
26
|
+
# client.goal.list
|
27
|
+
# #=> [#<GoalItem id: 1, title: "Complete project", ...>]
|
28
|
+
#
|
29
|
+
# @example List both active and archived goals
|
30
|
+
# client.goal.list(archived: true)
|
31
|
+
# #=> {
|
32
|
+
# active: [#<GoalItem id: 1, ...>],
|
33
|
+
# archived: [#<GoalItem id: 2, ...>]
|
34
|
+
# }
|
35
|
+
def list(user_id = self.user_id, archived: false)
|
36
|
+
active_goals = @conn.get("rocks/user/#{user_id}?include_origin=true").body.map do |goal|
|
37
|
+
Types::GoalItem.new(
|
38
|
+
id: goal["Id"],
|
39
|
+
user_id: goal["Owner"]["Id"],
|
40
|
+
user_name: goal["Owner"]["Name"],
|
41
|
+
title: goal["Name"],
|
42
|
+
created_at: goal["CreateTime"],
|
43
|
+
due_date: goal["DueDate"],
|
44
|
+
status: goal["Complete"] ? "Completed" : "Incomplete",
|
45
|
+
meeting_id: goal["Origins"].empty? ? nil : goal["Origins"][0]["Id"],
|
46
|
+
meeting_title: goal["Origins"].empty? ? nil : goal["Origins"][0]["Name"]
|
47
|
+
)
|
48
|
+
end
|
38
49
|
|
39
|
-
|
40
|
-
|
41
|
-
# @param title [String] the title of the new goal
|
42
|
-
# @param meeting_id [Integer] the ID of the meeting associated with the goal
|
43
|
-
# @param user_id [Integer] the ID of the user responsible for the goal (default: initialized user ID)
|
44
|
-
# @return [Hash] a hash containing the new goal's details
|
45
|
-
# @example
|
46
|
-
# client.goal.create(title: "New Goal", meeting_id: 1)
|
47
|
-
# #=> { goal_id: 1, title: "New Goal", meeting_id: 1, ... }
|
48
|
-
def create(title:, meeting_id:, user_id: self.user_id)
|
49
|
-
payload = {title: title, accountableUserId: user_id}.to_json
|
50
|
-
response = @conn.post("L10/#{meeting_id}/rocks", payload).body
|
51
|
-
{
|
52
|
-
goal_id: response["Id"],
|
53
|
-
title: title,
|
54
|
-
meeting_id: meeting_id,
|
55
|
-
meeting_title: response["Origins"][0]["Name"],
|
56
|
-
user_id: user_id,
|
57
|
-
user_name: response["Owner"]["Name"],
|
58
|
-
created_at: response["CreateTime"]
|
59
|
-
}
|
60
|
-
end
|
50
|
+
archived ? {active: active_goals, archived: get_archived_goals(user_id)} : active_goals
|
51
|
+
end
|
61
52
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
53
|
+
# Creates a new goal
|
54
|
+
#
|
55
|
+
# @param title [String] the title of the new goal
|
56
|
+
# @param meeting_id [Integer] the ID of the meeting associated with the goal
|
57
|
+
# @param user_id [Integer] the ID of the user responsible for the goal (default: initialized user ID)
|
58
|
+
# @return [GoalItem] the newly created goal
|
59
|
+
# @example
|
60
|
+
# client.goal.create(title: "New Goal", meeting_id: 1)
|
61
|
+
# #=> { goal_id: 1, title: "New Goal", meeting_id: 1, ... }
|
62
|
+
def create(title:, meeting_id:, user_id: self.user_id)
|
63
|
+
payload = {title: title, accountableUserId: user_id}.to_json
|
64
|
+
response = @conn.post("L10/#{meeting_id}/rocks", payload).body
|
65
|
+
|
66
|
+
Types::GoalItem.new(
|
67
|
+
id: response["Id"],
|
68
|
+
user_id: user_id,
|
69
|
+
user_name: response["Owner"]["Name"],
|
70
|
+
title: title,
|
71
|
+
meeting_id: meeting_id,
|
72
|
+
meeting_title: response["Origins"][0]["Name"],
|
73
|
+
status: {complete: 2, on: 1, off: 0}.key(response["Completion"]).to_s,
|
74
|
+
created_at: response["CreateTime"]
|
75
|
+
)
|
76
|
+
end
|
73
77
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
78
|
+
# Deletes a goal
|
79
|
+
#
|
80
|
+
# @param goal_id [Integer] the ID of the goal to delete
|
81
|
+
# @return [Hash] a hash containing the status of the delete operation
|
82
|
+
# @example
|
83
|
+
# client.goal.delete(1)
|
84
|
+
# #=> { status: 200 }
|
85
|
+
def delete(goal_id)
|
86
|
+
response = @conn.delete("rocks/#{goal_id}")
|
87
|
+
response.success?
|
88
|
+
end
|
89
|
+
|
90
|
+
# Updates a goal
|
91
|
+
#
|
92
|
+
# @param goal_id [Integer] the ID of the goal to update
|
93
|
+
# @param title [String] the new title of the goal
|
94
|
+
# @param accountable_user [Integer] the ID of the user responsible for the goal (default: initialized user ID)
|
95
|
+
# @param status [String, nil] the status value ('on', 'off', or 'complete')
|
96
|
+
# @return [Boolean] true if the update was successful
|
97
|
+
# @raise [ArgumentError] if an invalid status value is provided
|
98
|
+
# @example
|
99
|
+
# client.goal.update(goal_id: 1, title: "Updated Goal", status: 'on')
|
100
|
+
# #=> true
|
101
|
+
def update(goal_id:, title: nil, accountable_user: user_id, status: nil)
|
102
|
+
if status
|
103
|
+
valid_status = {on: "OnTrack", off: "AtRisk", complete: "Complete"}
|
104
|
+
status_key = status.downcase.to_sym
|
105
|
+
unless valid_status.key?(status_key)
|
106
|
+
raise ArgumentError, "Invalid status value. Must be 'on', 'off', or 'complete'."
|
107
|
+
end
|
108
|
+
status = valid_status[status_key]
|
91
109
|
end
|
92
|
-
|
110
|
+
payload = {title: title, accountableUserId: accountable_user, completion: status}.to_json
|
111
|
+
response = @conn.put("rocks/#{goal_id}", payload)
|
112
|
+
response.success?
|
93
113
|
end
|
94
|
-
payload = {title: title, accountableUserId: accountable_user, completion: status}.to_json
|
95
|
-
response = @conn.put("rocks/#{goal_id}", payload)
|
96
|
-
response.success?
|
97
|
-
end
|
98
114
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
115
|
+
# Archives a rock with the specified goal ID.
|
116
|
+
#
|
117
|
+
# @param goal_id [Integer] The ID of the goal/rock to archive
|
118
|
+
# @return [Boolean] Returns true if the archival was successful, false otherwise
|
119
|
+
# @example
|
120
|
+
# goals.archive(123) #=> true
|
121
|
+
def archive(goal_id)
|
122
|
+
response = @conn.put("rocks/#{goal_id}/archive")
|
123
|
+
response.success?
|
124
|
+
end
|
109
125
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
126
|
+
# Restores a previously archived goal identified by the provided goal ID.
|
127
|
+
#
|
128
|
+
# @param [String, Integer] goal_id The unique identifier of the goal to restore
|
129
|
+
# @return [Boolean] true if the restore operation was successful, false otherwise
|
130
|
+
# @example Restoring a goal
|
131
|
+
# goals.restore("123") #=> true
|
132
|
+
def restore(goal_id)
|
133
|
+
response = @conn.put("rocks/#{goal_id}/restore")
|
134
|
+
response.success?
|
135
|
+
end
|
120
136
|
|
121
|
-
|
137
|
+
private
|
122
138
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
139
|
+
# Retrieves all archived goals for a specific user (private method)
|
140
|
+
#
|
141
|
+
# @param user_id [Integer] the ID of the user (default is the initialized user ID)
|
142
|
+
# @return [Array<GoalItem>] an array of GoalItem objects containing archived goal details
|
143
|
+
# @example
|
144
|
+
# goal.send(:get_archived_goals)
|
145
|
+
# #=> [{ id: 1, title: "Archived Goal", created_at: "2024-06-10", ... }, ...]
|
146
|
+
def get_archived_goals(user_id = self.user_id)
|
147
|
+
response = @conn.get("archivedrocks/user/#{user_id}").body
|
148
|
+
response.map do |goal|
|
149
|
+
Types::GoalItem.new(
|
150
|
+
id: goal["Id"],
|
151
|
+
title: goal["Name"],
|
152
|
+
created_at: goal["CreateTime"],
|
153
|
+
due_date: goal["DueDate"],
|
154
|
+
status: goal["Complete"] ? "Complete" : "Incomplete"
|
155
|
+
)
|
156
|
+
end
|
140
157
|
end
|
141
158
|
end
|
142
159
|
end
|
@@ -2,120 +2,138 @@
|
|
2
2
|
|
3
3
|
require "bloomy/utils/get_user_id"
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
module Bloomy
|
6
|
+
class Headline
|
7
|
+
include Bloomy::Utilities::UserIdUtility
|
8
|
+
# Initializes a new headline instance
|
9
|
+
#
|
10
|
+
# @param conn [Object] the connection object to interact with the API
|
11
|
+
def initialize(conn)
|
12
|
+
@conn = conn
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
15
|
+
# Creates a new headline
|
16
|
+
#
|
17
|
+
# @param meeting_id [Integer] the ID of the meeting
|
18
|
+
# @param title [String] the title of the headline
|
19
|
+
# @param owner_id [Integer] the ID of the headline owner
|
20
|
+
# @param notes [String] additional notes for the headline
|
21
|
+
# @return [HeadlineItem] containing id, title, owner_details, and notes_url
|
22
|
+
def create(meeting_id:, title:, owner_id: user_id, notes: nil)
|
23
|
+
response = @conn.post("/api/v1/L10/#{meeting_id}/headlines",
|
24
|
+
{title: title, ownerId: owner_id, notes: notes}.to_json)
|
25
|
+
raise "Failed to create headline" unless response.status == 200
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
Types::HeadlineItem.new(
|
28
|
+
id: response.body["Id"],
|
29
|
+
title: response.body["Name"],
|
30
|
+
owner_details: Types::UserItem.new(id: response.body["OwnerId"]),
|
31
|
+
notes_url: response.body["DetailsUrl"]
|
32
|
+
)
|
33
|
+
end
|
33
34
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
35
|
+
# Updates a headline
|
36
|
+
#
|
37
|
+
# @param headline_id [Integer] the ID of the headline to update
|
38
|
+
# @param title [String] the new title of the headline
|
39
|
+
# @return [Boolean] true if update was successful
|
40
|
+
def update(headline_id:, title:)
|
41
|
+
response = @conn.put("/api/v1/headline/#{headline_id}", {title: title}.to_json)
|
42
|
+
raise "Failed to update headline" unless response.status == 200
|
43
|
+
true
|
44
|
+
end
|
44
45
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
# Get headline details
|
47
|
+
#
|
48
|
+
# @param headline_id [Integer] the ID of the headline
|
49
|
+
# @return [HeadlineItem] containing id, title, notes_url, meeting_details,
|
50
|
+
# owner_details, archived, created_at, and closed_at
|
51
|
+
def details(headline_id)
|
52
|
+
response = @conn.get("/api/v1/headline/#{headline_id}?Include_Origin=true")
|
53
|
+
raise "Failed to get headline details" unless response.status == 200
|
52
54
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
55
|
+
Types::HeadlineItem.new(
|
56
|
+
id: response.body["Id"],
|
57
|
+
title: response.body["Name"],
|
58
|
+
notes_url: response.body["DetailsUrl"],
|
59
|
+
meeting_details: Types::MeetingItem.new(
|
60
|
+
id: response.body["OriginId"],
|
61
|
+
title: response.body["Origin"]
|
62
|
+
),
|
63
|
+
owner_details: Types::UserItem.new(
|
64
|
+
id: response.body["Owner"]["Id"],
|
65
|
+
name: response.body["Owner"]["Name"]
|
66
|
+
),
|
67
|
+
archived: response.body["Archived"],
|
68
|
+
created_at: response.body["CreateTime"],
|
69
|
+
closed_at: response.body["CloseTime"]
|
70
|
+
)
|
71
|
+
end
|
70
72
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
73
|
+
# Get headlines for a user or a meeting.
|
74
|
+
#
|
75
|
+
# @param user_id [Integer, nil] the ID of the user (defaults to initialized user_id)
|
76
|
+
# @param meeting_id [Integer, nil] the ID of the meeting
|
77
|
+
# @raise [ArgumentError] if both `user_id` and `meeting_id` are provided
|
78
|
+
# @return [Array<HeadlineItem>] a list of headlines containing:
|
79
|
+
# - id
|
80
|
+
# - title
|
81
|
+
# - meeting_details
|
82
|
+
# - owner_details
|
83
|
+
# - archived
|
84
|
+
# - created_at
|
85
|
+
# - closed_at
|
86
|
+
# @example
|
87
|
+
# client.headline.list
|
88
|
+
# #=> [
|
89
|
+
# #<HeadlineItem
|
90
|
+
# id: 1,
|
91
|
+
# title: "Headline Title",
|
92
|
+
# meeting_details: #<MeetingItem id: 1, title: "Team Meeting">,
|
93
|
+
# owner_details: #<UserItem id: 1, name: "John Doe">,
|
94
|
+
# archived: false,
|
95
|
+
# created_at: "2023-01-01",
|
96
|
+
# closed_at: nil
|
97
|
+
# >
|
98
|
+
# ]
|
99
|
+
def list(user_id: nil, meeting_id: nil)
|
100
|
+
raise ArgumentError, "Please provide either `user_id` or `meeting_id`, not both." if user_id && meeting_id
|
83
101
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
102
|
+
if meeting_id
|
103
|
+
response = @conn.get("/api/v1/l10/#{meeting_id}/headlines")
|
104
|
+
else
|
105
|
+
user_id ||= self.user_id
|
106
|
+
response = @conn.get("/api/v1/headline/users/#{user_id}")
|
107
|
+
end
|
90
108
|
|
91
|
-
|
109
|
+
raise "Failed to list headlines" unless response.success?
|
92
110
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
111
|
+
response.body.map do |headline|
|
112
|
+
Types::HeadlineItem.new(
|
113
|
+
id: headline["Id"],
|
114
|
+
title: headline["Name"],
|
115
|
+
meeting_details: Types::MeetingItem.new(
|
116
|
+
id: headline["OriginId"],
|
117
|
+
title: headline["Origin"]
|
118
|
+
),
|
119
|
+
owner_details: Types::UserItem.new(
|
120
|
+
id: headline["Owner"]["Id"],
|
121
|
+
name: headline["Owner"]["Name"]
|
122
|
+
),
|
123
|
+
archived: headline["Archived"],
|
124
|
+
created_at: headline["CreateTime"],
|
125
|
+
closed_at: headline["CloseTime"]
|
126
|
+
)
|
127
|
+
end
|
109
128
|
end
|
110
|
-
end
|
111
129
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
130
|
+
# Deletes a headline
|
131
|
+
#
|
132
|
+
# @param headline_id [Integer] the ID of the headline to delete
|
133
|
+
# @return [Boolean] true if the deletion was successful
|
134
|
+
def delete(headline_id)
|
135
|
+
response = @conn.delete("/api/v1/headline/#{headline_id}")
|
136
|
+
response.success?
|
137
|
+
end
|
120
138
|
end
|
121
139
|
end
|