wixanswers 0.0.5 → 0.0.5.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
  SHA256:
3
- metadata.gz: 21d43335f8bcfa2fb50d395f15d2f91ebcc8dabd8232bd9c16e6aa6d1cd7d1b0
4
- data.tar.gz: f007d21c8e72e016b8ab1fe1d05a94b6ea0f3773eee0fd75f805f45b4538808e
3
+ metadata.gz: ea25787ae420dbb146807f786bd43b8c6a2df267bbe0f3e2dcf2b766b5e047dd
4
+ data.tar.gz: bc06dd6724bd06cd967df6289276f46ce1276d4ece00472fbe3734957b067a0f
5
5
  SHA512:
6
- metadata.gz: 79a990f97a8b3af128ac72a3d2fa372813a3eddeba6341857a6912134621877303939cd3159aac2419df1a49dcac5ec1f479e7f63621fd2aa39b95a5153aae5e
7
- data.tar.gz: 447cbf3731bd905b5132054f5632cf6f311c2c5ca7598ae21985d0e5931c8b5c55167a34b050ec0a2bcb8f7e9a47badfb547f88efe85bc43084ebf08ee3fa5f0
6
+ metadata.gz: 9cff4fa36c1c8e019ab6614aeb9cb09ea1750b3169889630502ed4a5e2563e1f05903ee16c226104ab799f834a2c0ed777cd210ddfa42e1496264dc1b73173f3
7
+ data.tar.gz: 6be85a9de452e315afe3d82ad81ca0ece1d5e5cf27e861f9420646ceb21d4630753dfdc5c6521ea9a51f4dcad75e578699364ceefb569cfb1db527f8cab68acb
@@ -5,7 +5,12 @@
5
5
  * added Client class
6
6
  * added support for ticket 'Add', 'Get'
7
7
 
8
- 0.0.5 (Stable)
8
+
9
+ 0.0.5.1 (Stable)
10
+ ----------------
11
+ * added support for `AGENT_REPLY_CREATED` Webhook events
12
+
13
+ 0.0.5
9
14
  ------
10
15
  * added all Enumeration objects
11
16
  * added Enumeration#title method
@@ -28,7 +28,8 @@ module WixAnswers
28
28
  end
29
29
 
30
30
  class WebhookType < Enumeration
31
- TICKET_CREATED ||= 2
31
+ TICKET_CREATED ||= 1
32
+ REPLY_CREATED ||= 2
32
33
  TICKET_STATUS_CHANGED ||= 8
33
34
  end
34
35
 
@@ -99,16 +99,11 @@ module WixAnswers
99
99
 
100
100
  case payload[:channel]
101
101
  when Enumerations::Channel::WEB
102
- Models::Ticket.new(payload)
102
+ payload[:type].nil? ? Models::Ticket.new(payload) : Models::Reply.new(payload)
103
103
  when Enumerations::Channel::BY_AGENT
104
104
  Models::ByAgent.new(payload)
105
105
  when Enumerations::Channel::EMAIL
106
- # support email-based tickets
107
- if payload[:type].nil?
108
- Models::Ticket.new(payload)
109
- else
110
- Models::Reply.new(payload)
111
- end
106
+ payload[:type].nil? ? Models::Ticket.new(payload) : Models::Reply.new(payload)
112
107
  when Enumerations::Channel::PHONE_CALLBACK
113
108
  Models::PhoneCallback.new(payload)
114
109
  when Enumerations::Channel::WIDGET
@@ -157,6 +157,185 @@ module WixAnswers
157
157
  def count(options = {})
158
158
  perform_request("/tickets/filtersCounts", :post, options)
159
159
  end
160
+
161
+ # Assign a ticket to an agent or an agent group.
162
+ #
163
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#assign-a-ticket
164
+ # @authorization Requires agent authorization token and permission BASIC_TICKET_ACTIONS
165
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
166
+ # @return <WixAnswers::Models::Ticket>
167
+ # @param ticket_id [String] Ticket GUID
168
+ def assign(ticket_id)
169
+ WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/assign", :post))
170
+ end
171
+
172
+ # Assign one or more tickets to an agent or an agent group.
173
+ #
174
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#assign-one-or-more-tickets
175
+ # @authorization Requires agent authorization token and permission BASIC_TICKET_ACTIONS
176
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
177
+ # @return <Array[WixAnswers::Models::Ticket]>
178
+ # @param options [Hash] A customizable set of options
179
+ # @option ids [String] List of tickets to assign.
180
+ # @option assignedGroupId [String] The agent group to which to assign the ticket.
181
+ # This parameter or assignedUserId is required (but not both.
182
+ # @option assignedUserId [String] The agent to whom to assign the ticket.
183
+ # This parameter or assignedGroupId is required (but not both).
184
+ def assign_many(options={})
185
+ perform_request("/tickets/assign", :post, options).map {|ticket| WixAnswers::Models::Ticket.new(ticket)}
186
+ end
187
+
188
+ # Remove the agent or group assignment from a ticket.
189
+ #
190
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#unassign-a-ticket
191
+ # @authorization Requires agent authorization token and permission BASIC_TICKET_ACTIONS
192
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
193
+ # @return <WixAnswers::Models::Ticket>
194
+ # @param ticket_id [String] Ticket GUID
195
+ def unassign(ticket_id)
196
+ WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/unassign", :post))
197
+ end
198
+
199
+ # Remove the agent or group assignment from one or more tickets.
200
+ #
201
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#unassign-one-or-more-tickets
202
+ # @authorization Requires agent authorization token and permission BASIC_TICKET_ACTIONS
203
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
204
+ # @return <Array[WixAnswers::Models::Ticket]>
205
+ # @param options [Hash] A customizable set of options
206
+ # @option ids [String] List of tickets to unassign.
207
+ # @option assignedGroupId [String] The agent group to which to unassign the ticket.
208
+ # This parameter or assignedUserId is required (but not both.
209
+ # @option assignedUserId [String] The agent to whom to unassign the ticket.
210
+ # This parameter or assignedGroupId is required (but not both).
211
+ def unassign_many(options={})
212
+ perform_request("/tickets/unassign", :post, options).map {|ticket| WixAnswers::Models::Ticket.new(ticket)}
213
+ end
214
+
215
+ # Mark a ticket as spam
216
+ #
217
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#mark-a-ticket-as-spam
218
+ # @authorization Requires agent authorization token and permission BASIC_TICKET_ACTIONS
219
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
220
+ # @return <WixAnswers::Models::Ticket>
221
+ # @param ticket_id [String] Ticket GUID
222
+ def mark_spam(ticket_id)
223
+ perform_request("/tickets/#{ticket_id}/markSpam", :post)
224
+ end
225
+
226
+ # Mark a ticket as not spam
227
+ #
228
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#mark-a-ticket-as-not-spam
229
+ # @authorization Requires agent authorization token and permission BASIC_TICKET_ACTIONS
230
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
231
+ # @return <WixAnswers::Models::Ticket>
232
+ # @param ticket_id [String] Ticket GUID
233
+ def mark_not_spam(ticket_id)
234
+ perform_request("/tickets/#{ticket_id}/markHam", :post)
235
+ end
236
+
237
+ # Mark one or more tickets as spam
238
+ #
239
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#mark-one-or-more-tickets-as-spam
240
+ # @authorization Requires agent authorization token and permission BASIC_TICKET_ACTIONS
241
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
242
+ # @return <Array[WixAnswers::Models::Ticket]>
243
+ # @param options [Hash] A customizable set of options
244
+ # @option ids [String] List of tickets to mark as spam.
245
+ def mark_spam_many(options={})
246
+ perform_request("/tickets/markSpam", :post, options)
247
+ end
248
+
249
+ # Mark one or more tickets as not spam
250
+ #
251
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#mark-one-or-more-tickets-as-not-spam
252
+ # @authorization Requires agent authorization token and permission BASIC_TICKET_ACTIONS
253
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
254
+ # @return <Array[WixAnswers::Models::Ticket]>
255
+ # @param options [Hash] A customizable set of options
256
+ # @option ids [String] List of tickets to mark as spam.
257
+ def mark_not_spam_many(options={})
258
+ perform_request("/tickets/markHam", :post, options)
259
+ end
260
+
261
+ # Authenticate a ticket.
262
+ #
263
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#authenticate-a-ticket
264
+ # @authorization Requires agent authorization token and permission MANAGE_TICKETS
265
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
266
+ # @return <WixAnswers::Models::Ticket>
267
+ # @param ticket_id [String] Ticket GUID
268
+ def authenticate(ticket_id)
269
+ WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/authenticate", :post))
270
+ end
271
+
272
+ # Transfer a ticket; this changes the user associated with a ticket. Use when an existing ticket
273
+ # is found to be relevant for the user, such as one opened initially for an unauthenticated user.
274
+ # For example, when a) an unauthenticated user is created from an email and then b) an agent moves
275
+ # the ticket to an existing authenticated user.
276
+ #
277
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#change-a-tickets-user-transfer-a-ticket
278
+ # @authorization Requires agent authorization token and permission MANAGE_TICKETS
279
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
280
+ # @return <WixAnswers::Models::Ticket>
281
+ # @param ticket_id [String] Ticket GUID
282
+ # @param options [Hash] A customizable set of options
283
+ # @option targetUserId [String] The new user
284
+ def transfer(ticket_id, options={})
285
+ WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/transfer", :post, options))
286
+ end
287
+
288
+ # Update a ticket's status
289
+ #
290
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#update-a-tickets-status
291
+ # @authorization Requires agent authorization token and permission BASIC_TICKET_ACTIONS
292
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
293
+ # @return <WixAnswers::Models::Ticket>
294
+ # @param ticket_id [String] Ticket GUID
295
+ # @param options [Hash] A customizable set of options
296
+ # @option status [Integer] The new Ticket Status
297
+ def update_status(ticket_id, options={})
298
+ WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/status", :put, options))
299
+ end
300
+
301
+ # Update one or more tickets' statuses
302
+ #
303
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#update-status-of-one-or-more-tickets
304
+ # @authorization Requires agent authorization token and permission BASIC_TICKET_ACTIONS
305
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
306
+ # @return <Array[WixAnswers::Models::Ticket]>
307
+ # @param options [Hash] A customizable set of options
308
+ # @option ids [Array<String>] List of tickets for which to change the status
309
+ # @option status [Integer] The new Ticket Status
310
+ def update_status_many(options={})
311
+ perform_request("/tickets/setStatus", :post, options).map {|ticket| WixAnswers::Models::Ticket.new(ticket)}
312
+ end
313
+
314
+ # Update a ticket's priority
315
+ #
316
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#update-a-tickets-priority
317
+ # @authorization Requires agent authorization token and permission BASIC_TICKET_ACTIONS
318
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
319
+ # @return <WixAnswers::Models::Ticket>
320
+ # @param ticket_id [String] Ticket GUID
321
+ # @param options [Hash] A customizable set of options
322
+ # @option priority [Integer] New Ticket Priority
323
+ def update_priority(ticket_id, options={})
324
+ WixAnswers::Models::Ticket.new(perform_request("/tickets/#{ticket_id}/priority", :put, options))
325
+ end
326
+
327
+ # Update one or more tickets' priorities
328
+ #
329
+ # @see https://help.wixanswers.com/kb/en/article/ticket-apis#update-priority-of-one-or-more-tickets
330
+ # @authorization Requires agent authorization token and permission BASIC_TICKET_ACTIONS
331
+ # @raise [WixAnswers::Exceptions::Unauthorized] Error raised when supplied agent credentials are not valid.
332
+ # @return <Array[WixAnswers::Models::Ticket]>
333
+ # @param options [Hash] A customizable set of options
334
+ # @option ids [Array<String>] List of tickets for which to change the status
335
+ # @option priority [Integer] New Ticket Priority
336
+ def update_priority_many(options={})
337
+ perform_request("/tickets/setPriority", :post, options).map {|ticket| WixAnswers::Models::Ticket.new(ticket)}
338
+ end
160
339
  end
161
340
  end
162
341
  end
@@ -15,7 +15,7 @@ module WixAnswers
15
15
  end
16
16
 
17
17
  def pre
18
- nil
18
+ 1
19
19
  end
20
20
 
21
21
  def to_h
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wixanswers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roee Sheelo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-22 00:00:00.000000000 Z
11
+ date: 2021-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler