help_scout 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af9833c01bb362743f11ae7a37fded124b094a45
4
- data.tar.gz: b00861cc5a4e1cb8b849b8d747316a538184310e
3
+ metadata.gz: d4c87308b26d2c7bc0d303723c079f9e35f3c2ea
4
+ data.tar.gz: 7b8c1072749cf893cd1341784a93e61bcaf6ec2b
5
5
  SHA512:
6
- metadata.gz: 6622b14f0f9845f7d6370e6350e78063884a127c95dd91514fbc29b8401a0aee135a7ea828097bb89472d468ef45e81e37d1b4f6a650c55db64d7125d5145c6e
7
- data.tar.gz: 7c3d739ff7256c65de60f029097264b24d257b392b4f6810d79fc1a82a4b653174f8b314cb0148b3ab796327eeeb385a7646a8636674fb16f9f814aef843c89e
6
+ metadata.gz: '0947044ccd69d6848052cfccc595740d9593902f8b92762a1a94921622142325b094e2f22f1204a5c4a6375b13b9291750ccd810e247b04fb9fac34395c21a00'
7
+ data.tar.gz: eff3ffe4edb758ee29d00f92bf47c26069482b4abefd83e979998334497a5a0ff67c31a63519485fff5457dd662c101538b6b29706f6a4176e5c84ad60a3d0ec
@@ -128,7 +128,8 @@ class HelpScout
128
128
  #
129
129
  # More info: http://developer.helpscout.net/help-desk-api/conversations/create-thread/
130
130
  #
131
- # Returns true if created, false otherwise
131
+ # Returns true if created, false otherwise. When used with reload: true it
132
+ # will return the entire conversation
132
133
  def create_thread(conversation_id:, thread:, imported: nil, reload: nil)
133
134
  query = {}
134
135
  { reload: reload, imported: imported }.each do |key, value|
@@ -137,7 +138,35 @@ class HelpScout
137
138
 
138
139
  post("conversations/#{conversation_id}", body: thread, query: query)
139
140
 
140
- last_response.code == HTTP_CREATED
141
+ if reload
142
+ last_response.parsed_response
143
+ else
144
+ last_response.code == HTTP_CREATED
145
+ end
146
+ end
147
+
148
+ # Public: Updates conversation thread
149
+ #
150
+ # conversion_id - conversation id
151
+ # thread - thread content to be updated (only the body can be updated)
152
+ # reload - Set to true to get the entire conversation in the result
153
+ #
154
+ # More info: http://developer.helpscout.net/help-desk-api/conversations/update-thread/
155
+ #
156
+ # Returns true if updated, false otherwise. When used with reload: true it
157
+ # will return the entire conversation
158
+ def update_thread(conversation_id:, thread:, reload: nil)
159
+ query = {}
160
+ query[:reload] = reload if reload
161
+ body = { body: thread[:body] }
162
+
163
+ put("conversations/#{conversation_id}/threads/#{thread[:id]}", body: body, query: query)
164
+
165
+ if reload
166
+ last_response.parsed_response
167
+ else
168
+ last_response.code == HTTP_OK
169
+ end
141
170
  end
142
171
 
143
172
  # Public: Update Customer
@@ -1,3 +1,3 @@
1
1
  class HelpScout
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: help_scout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Paagman
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2017-09-07 00:00:00.000000000 Z
13
+ date: 2017-11-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 2.5.1
140
+ rubygems_version: 2.6.11
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: HelpScout is an API client for Help Scout