desk_api 0.6.0 → 0.6.1
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/LICENSE.txt +27 -0
- data/README.md +97 -61
- data/lib/desk.rb +29 -1
- data/lib/desk_api.rb +57 -5
- data/lib/desk_api/client.rb +104 -47
- data/lib/desk_api/configuration.rb +201 -108
- data/lib/desk_api/default.rb +109 -52
- data/lib/desk_api/error.rb +90 -40
- data/lib/desk_api/error/bad_gateway.rb +29 -1
- data/lib/desk_api/error/bad_request.rb +29 -1
- data/lib/desk_api/error/client_error.rb +31 -2
- data/lib/desk_api/error/configuration_error.rb +29 -1
- data/lib/desk_api/error/conflict.rb +29 -1
- data/lib/desk_api/error/follow_redirect_error.rb +42 -0
- data/lib/desk_api/error/forbidden.rb +29 -1
- data/lib/desk_api/error/gateway_timeout.rb +29 -1
- data/lib/desk_api/error/internal_server_error.rb +29 -1
- data/lib/desk_api/error/method_not_allowed.rb +29 -1
- data/lib/desk_api/error/not_acceptable.rb +29 -1
- data/lib/desk_api/error/not_found.rb +29 -1
- data/lib/desk_api/error/parser_error.rb +29 -1
- data/lib/desk_api/error/server_error.rb +29 -1
- data/lib/desk_api/error/service_unavailable.rb +29 -1
- data/lib/desk_api/error/too_many_requests.rb +29 -1
- data/lib/desk_api/error/unauthorized.rb +29 -1
- data/lib/desk_api/error/unprocessable_entity.rb +29 -1
- data/lib/desk_api/error/unsupported_media_type.rb +29 -1
- data/lib/desk_api/rate_limit.rb +63 -21
- data/lib/desk_api/request/encode_json.rb +49 -7
- data/lib/desk_api/request/oauth.rb +62 -14
- data/lib/desk_api/request/retry.rb +108 -34
- data/lib/desk_api/resource.rb +402 -192
- data/lib/desk_api/response/follow_redirects.rb +99 -0
- data/lib/desk_api/response/parse_dates.rb +63 -21
- data/lib/desk_api/response/parse_json.rb +47 -5
- data/lib/desk_api/response/raise_error.rb +51 -10
- data/lib/desk_api/version.rb +30 -2
- data/spec/cassettes/DeskApi_Resource/_update/can_handle_action_params.yml +110 -104
- data/spec/cassettes/DeskApi_Resource/_update/can_handle_links.yml +426 -0
- data/spec/desk_api/client_spec.rb +28 -0
- data/spec/desk_api/configuration_spec.rb +28 -0
- data/spec/desk_api/default_spec.rb +28 -0
- data/spec/desk_api/error_spec.rb +29 -1
- data/spec/desk_api/rate_limit_spec.rb +28 -0
- data/spec/desk_api/request/encode_json_spec.rb +28 -0
- data/spec/desk_api/request/oauth_spec.rb +28 -0
- data/spec/desk_api/request/retry_spec.rb +29 -1
- data/spec/desk_api/resource_spec.rb +49 -12
- data/spec/desk_api/response/follow_redirects_spec.rb +95 -0
- data/spec/desk_api/response/parse_dates_spec.rb +28 -0
- data/spec/desk_api/response/parse_json_spec.rb +56 -9
- data/spec/desk_api/response/raise_error_spec.rb +28 -0
- data/spec/desk_api_spec.rb +28 -0
- data/spec/spec_helper.rb +28 -0
- metadata +84 -24
- data/LICENSE +0 -7
@@ -0,0 +1,426 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://devel.desk.com/api/v2/cases/3186
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
User-Agent:
|
13
|
+
- desk.com Ruby Gem v0.6.0
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
accept-ranges:
|
22
|
+
- bytes
|
23
|
+
cache-control:
|
24
|
+
- must-revalidate, private, max-age=0
|
25
|
+
content-type:
|
26
|
+
- application/json; charset=utf-8
|
27
|
+
date:
|
28
|
+
- Wed, 09 Jul 2014 21:42:40 GMT
|
29
|
+
etag:
|
30
|
+
- '"3b403b9148d9f982752106c400dc9880"'
|
31
|
+
status:
|
32
|
+
- 200 OK
|
33
|
+
vary:
|
34
|
+
- X-AppVersion
|
35
|
+
x-appversion:
|
36
|
+
- '15.99'
|
37
|
+
x-frame-options:
|
38
|
+
- SAMEORIGIN
|
39
|
+
x-rate-limit-limit:
|
40
|
+
- '240'
|
41
|
+
x-rate-limit-remaining:
|
42
|
+
- '239'
|
43
|
+
x-rate-limit-reset:
|
44
|
+
- '20'
|
45
|
+
x-request-id:
|
46
|
+
- 97ba5b34ec90a4a7f51251f00f9aa41c
|
47
|
+
content-length:
|
48
|
+
- '2049'
|
49
|
+
connection:
|
50
|
+
- Close
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: '{"id":3186,"external_id":null,"blurb":"Soluta et odit nisi. Repellat
|
54
|
+
qui unde quo et. Quo laudantium ex dolor mollitia omnis molestias. Praesentium
|
55
|
+
quasi earum nulla.\n\nUt unde excepturi est. Recusandae qui labore id. Doloribus
|
56
|
+
et voluptatem qui. Asperiores ut sed totam eveniet voluptatem.","subject":"Quas
|
57
|
+
iste rerum eos et eius.","priority":10,"locked_until":null,"description":"Soluta
|
58
|
+
et odit nisi. Repellat qui unde quo et. Quo laudantium ex dolor mollitia omnis
|
59
|
+
molestias. Praesentium quasi earum nulla.\r\n\r\nUt unde excepturi est. Recusandae
|
60
|
+
qui labore id. Doloribus et voluptatem qui. Asperiores ut sed totam eveniet
|
61
|
+
voluptatem.\r\n\r","status":"open","type":"email","labels":[],"label_ids":[],"language":null,"active_at":"2014-07-09T21:42:15Z","changed_at":"2014-07-09T21:42:19Z","created_at":"2013-05-23T17:47:51Z","updated_at":"2014-07-09T21:42:21Z","received_at":"2013-08-02T21:38:12Z","first_opened_at":null,"opened_at":null,"first_resolved_at":null,"resolved_at":null,"custom_fields":{"my_new_custom_field":null,"my_new_number_field":null,"my_new_date_field":null,"my_new_boolean_field":null,"my_new_list_field":null,"follow_up":null,"dependent":null},"_links":{"self":{"href":"/api/v2/cases/3186","class":"case"},"message":{"href":"/api/v2/cases/3186/message","class":"email"},"customer":{"href":"/api/v2/customers/105408563","class":"customer"},"labels":{"href":"/api/v2/cases/3186/labels","class":"label"},"assigned_user":null,"assigned_group":{"href":"/api/v2/groups/171213","class":"group"},"locked_by":null,"history":{"href":"/api/v2/cases/3186/history","class":"history"},"case_links":{"href":"/api/v2/cases/3186/links","class":"case_link"},"macro_preview":{"href":"/api/v2/cases/3186/macros/preview","class":"macro_preview"},"replies":{"href":"/api/v2/cases/3186/replies","class":"reply","count":1},"draft":{"href":"/api/v2/cases/3186/replies/draft","class":"reply"},"notes":{"href":"/api/v2/cases/3186/notes","class":"note","count":1},"attachments":{"href":"/api/v2/cases/3186/attachments","class":"attachment","count":0}}}'
|
62
|
+
http_version:
|
63
|
+
recorded_at: Wed, 09 Jul 2014 21:42:40 GMT
|
64
|
+
- request:
|
65
|
+
method: patch
|
66
|
+
uri: https://devel.desk.com/api/v2/cases/3186
|
67
|
+
body:
|
68
|
+
encoding: UTF-8
|
69
|
+
string: '{"_links":{"assigned_user":{"href":"/api/v2/users/16096734","class":"user"}}}'
|
70
|
+
headers:
|
71
|
+
Accept:
|
72
|
+
- application/json
|
73
|
+
User-Agent:
|
74
|
+
- desk.com Ruby Gem v0.6.0
|
75
|
+
Content-Type:
|
76
|
+
- application/json
|
77
|
+
response:
|
78
|
+
status:
|
79
|
+
code: 200
|
80
|
+
message:
|
81
|
+
headers:
|
82
|
+
cache-control:
|
83
|
+
- max-age=0, private, must-revalidate
|
84
|
+
content-type:
|
85
|
+
- application/json; charset=utf-8
|
86
|
+
date:
|
87
|
+
- Wed, 09 Jul 2014 21:42:41 GMT
|
88
|
+
etag:
|
89
|
+
- '"a0f5c39eba014db9e75e4bd0f699eaeb"'
|
90
|
+
server:
|
91
|
+
- nginx
|
92
|
+
status:
|
93
|
+
- 200 OK
|
94
|
+
vary:
|
95
|
+
- X-AppVersion
|
96
|
+
x-appversion:
|
97
|
+
- '15.99'
|
98
|
+
x-frame-options:
|
99
|
+
- SAMEORIGIN
|
100
|
+
x-rack-cache:
|
101
|
+
- invalidate, pass
|
102
|
+
x-rate-limit-limit:
|
103
|
+
- '240'
|
104
|
+
x-rate-limit-remaining:
|
105
|
+
- '238'
|
106
|
+
x-rate-limit-reset:
|
107
|
+
- '19'
|
108
|
+
x-request-id:
|
109
|
+
- 94f6e1e4c8318ff14e7942b42e1d1b49
|
110
|
+
x-runtime:
|
111
|
+
- '0.233515'
|
112
|
+
x-ua-compatible:
|
113
|
+
- IE=Edge,chrome=1
|
114
|
+
transfer-encoding:
|
115
|
+
- chunked
|
116
|
+
connection:
|
117
|
+
- Close
|
118
|
+
body:
|
119
|
+
encoding: UTF-8
|
120
|
+
string: '{"id":3186,"external_id":null,"blurb":"Soluta et odit nisi. Repellat
|
121
|
+
qui unde quo et. Quo laudantium ex dolor mollitia omnis molestias. Praesentium
|
122
|
+
quasi earum nulla.\n\nUt unde excepturi est. Recusandae qui labore id. Doloribus
|
123
|
+
et voluptatem qui. Asperiores ut sed totam eveniet voluptatem.","subject":"Quas
|
124
|
+
iste rerum eos et eius.","priority":10,"locked_until":null,"description":"Soluta
|
125
|
+
et odit nisi. Repellat qui unde quo et. Quo laudantium ex dolor mollitia omnis
|
126
|
+
molestias. Praesentium quasi earum nulla.\r\n\r\nUt unde excepturi est. Recusandae
|
127
|
+
qui labore id. Doloribus et voluptatem qui. Asperiores ut sed totam eveniet
|
128
|
+
voluptatem.\r\n\r","status":"open","type":"email","labels":[],"label_ids":[],"language":null,"active_at":"2014-07-09T21:42:15Z","changed_at":"2014-07-09T21:42:41Z","created_at":"2013-05-23T17:47:51Z","updated_at":"2014-07-09T21:42:41Z","received_at":"2013-08-02T21:38:12Z","first_opened_at":null,"opened_at":null,"first_resolved_at":null,"resolved_at":null,"custom_fields":{"my_new_custom_field":null,"my_new_number_field":null,"my_new_date_field":null,"my_new_boolean_field":null,"my_new_list_field":null,"follow_up":null,"dependent":null},"_links":{"self":{"href":"/api/v2/cases/3186","class":"case"},"message":{"href":"/api/v2/cases/3186/message","class":"email"},"customer":{"href":"/api/v2/customers/105408563","class":"customer"},"labels":{"href":"/api/v2/cases/3186/labels","class":"label"},"assigned_user":{"href":"/api/v2/users/16096734","class":"user"},"assigned_group":{"href":"/api/v2/groups/171213","class":"group"},"locked_by":null,"history":{"href":"/api/v2/cases/3186/history","class":"history"},"case_links":{"href":"/api/v2/cases/3186/links","class":"case_link"},"macro_preview":{"href":"/api/v2/cases/3186/macros/preview","class":"macro_preview"},"replies":{"href":"/api/v2/cases/3186/replies","class":"reply","count":1},"draft":{"href":"/api/v2/cases/3186/replies/draft","class":"reply"},"notes":{"href":"/api/v2/cases/3186/notes","class":"note","count":1},"attachments":{"href":"/api/v2/cases/3186/attachments","class":"attachment","count":0}}}'
|
129
|
+
http_version:
|
130
|
+
recorded_at: Wed, 09 Jul 2014 21:42:41 GMT
|
131
|
+
- request:
|
132
|
+
method: get
|
133
|
+
uri: https://devel.desk.com/api/v2/users/16096734
|
134
|
+
body:
|
135
|
+
encoding: US-ASCII
|
136
|
+
string: ''
|
137
|
+
headers:
|
138
|
+
Accept:
|
139
|
+
- application/json
|
140
|
+
User-Agent:
|
141
|
+
- desk.com Ruby Gem v0.6.0
|
142
|
+
Content-Type:
|
143
|
+
- application/json
|
144
|
+
response:
|
145
|
+
status:
|
146
|
+
code: 200
|
147
|
+
message:
|
148
|
+
headers:
|
149
|
+
accept-ranges:
|
150
|
+
- bytes
|
151
|
+
cache-control:
|
152
|
+
- must-revalidate, private, max-age=0
|
153
|
+
content-type:
|
154
|
+
- application/json; charset=utf-8
|
155
|
+
date:
|
156
|
+
- Wed, 09 Jul 2014 21:42:41 GMT
|
157
|
+
etag:
|
158
|
+
- '"3c793d278a94ceebca11b4019e63f2c8"'
|
159
|
+
status:
|
160
|
+
- 200 OK
|
161
|
+
vary:
|
162
|
+
- X-AppVersion
|
163
|
+
x-appversion:
|
164
|
+
- '15.99'
|
165
|
+
x-frame-options:
|
166
|
+
- SAMEORIGIN
|
167
|
+
x-rate-limit-limit:
|
168
|
+
- '240'
|
169
|
+
x-rate-limit-remaining:
|
170
|
+
- '237'
|
171
|
+
x-rate-limit-reset:
|
172
|
+
- '19'
|
173
|
+
x-request-id:
|
174
|
+
- 21c95d1024d9662442c2f7f9d23e0c6d
|
175
|
+
content-length:
|
176
|
+
- '908'
|
177
|
+
connection:
|
178
|
+
- Close
|
179
|
+
body:
|
180
|
+
encoding: UTF-8
|
181
|
+
string: '{"id":16096734,"name":"Thomas Stachl","public_name":"Thomas Stachl","email":"tstachl@salesforce.com","level":"siteadmin_billing","avatar":"http://www.gravatar.com/avatar/9d1a9e1a385960d1ba80fb873128cf73?rating=PG&size=50&default=404","created_at":"2012-06-06T14:51:21Z","updated_at":"2014-07-09T21:25:45Z","current_login_at":"2014-07-09T16:25:20Z","last_login_at":"2014-06-20T20:35:58Z","_links":{"self":{"href":"/api/v2/users/16096734","class":"user"},"preferences":{"href":"/api/v2/users/16096734/preferences","class":"user_preference"},"searches":{"href":"/api/v2/users/16096734/searches","class":"search"},"groups":{"href":"/api/v2/users/16096734/groups","class":"group"},"macros":{"href":"/api/v2/users/16096734/macros","class":"macro"},"filters":{"href":"/api/v2/users/16096734/filters","class":"filter"},"integration_urls":{"href":"/api/v2/users/16096734/integration_urls","class":"integration_url"}}}'
|
182
|
+
http_version:
|
183
|
+
recorded_at: Wed, 09 Jul 2014 21:42:41 GMT
|
184
|
+
- request:
|
185
|
+
method: get
|
186
|
+
uri: https://devel.desk.com/api/v2/cases/3186
|
187
|
+
body:
|
188
|
+
encoding: US-ASCII
|
189
|
+
string: ''
|
190
|
+
headers:
|
191
|
+
Accept:
|
192
|
+
- application/json
|
193
|
+
User-Agent:
|
194
|
+
- desk.com Ruby Gem v0.6.0
|
195
|
+
Content-Type:
|
196
|
+
- application/json
|
197
|
+
response:
|
198
|
+
status:
|
199
|
+
code: 200
|
200
|
+
message:
|
201
|
+
headers:
|
202
|
+
accept-ranges:
|
203
|
+
- bytes
|
204
|
+
cache-control:
|
205
|
+
- must-revalidate, private, max-age=0
|
206
|
+
content-type:
|
207
|
+
- application/json; charset=utf-8
|
208
|
+
date:
|
209
|
+
- Wed, 09 Jul 2014 21:42:41 GMT
|
210
|
+
etag:
|
211
|
+
- '"a0f5c39eba014db9e75e4bd0f699eaeb"'
|
212
|
+
status:
|
213
|
+
- 200 OK
|
214
|
+
vary:
|
215
|
+
- X-AppVersion
|
216
|
+
x-appversion:
|
217
|
+
- '15.99'
|
218
|
+
x-frame-options:
|
219
|
+
- SAMEORIGIN
|
220
|
+
x-rate-limit-limit:
|
221
|
+
- '240'
|
222
|
+
x-rate-limit-remaining:
|
223
|
+
- '236'
|
224
|
+
x-rate-limit-reset:
|
225
|
+
- '19'
|
226
|
+
x-request-id:
|
227
|
+
- 3c9aeae6b1a9e80d80493f0c71a80022
|
228
|
+
content-length:
|
229
|
+
- '2093'
|
230
|
+
connection:
|
231
|
+
- Close
|
232
|
+
body:
|
233
|
+
encoding: UTF-8
|
234
|
+
string: '{"id":3186,"external_id":null,"blurb":"Soluta et odit nisi. Repellat
|
235
|
+
qui unde quo et. Quo laudantium ex dolor mollitia omnis molestias. Praesentium
|
236
|
+
quasi earum nulla.\n\nUt unde excepturi est. Recusandae qui labore id. Doloribus
|
237
|
+
et voluptatem qui. Asperiores ut sed totam eveniet voluptatem.","subject":"Quas
|
238
|
+
iste rerum eos et eius.","priority":10,"locked_until":null,"description":"Soluta
|
239
|
+
et odit nisi. Repellat qui unde quo et. Quo laudantium ex dolor mollitia omnis
|
240
|
+
molestias. Praesentium quasi earum nulla.\r\n\r\nUt unde excepturi est. Recusandae
|
241
|
+
qui labore id. Doloribus et voluptatem qui. Asperiores ut sed totam eveniet
|
242
|
+
voluptatem.\r\n\r","status":"open","type":"email","labels":[],"label_ids":[],"language":null,"active_at":"2014-07-09T21:42:15Z","changed_at":"2014-07-09T21:42:41Z","created_at":"2013-05-23T17:47:51Z","updated_at":"2014-07-09T21:42:41Z","received_at":"2013-08-02T21:38:12Z","first_opened_at":null,"opened_at":null,"first_resolved_at":null,"resolved_at":null,"custom_fields":{"my_new_custom_field":null,"my_new_number_field":null,"my_new_date_field":null,"my_new_boolean_field":null,"my_new_list_field":null,"follow_up":null,"dependent":null},"_links":{"self":{"href":"/api/v2/cases/3186","class":"case"},"message":{"href":"/api/v2/cases/3186/message","class":"email"},"customer":{"href":"/api/v2/customers/105408563","class":"customer"},"labels":{"href":"/api/v2/cases/3186/labels","class":"label"},"assigned_user":{"href":"/api/v2/users/16096734","class":"user"},"assigned_group":{"href":"/api/v2/groups/171213","class":"group"},"locked_by":null,"history":{"href":"/api/v2/cases/3186/history","class":"history"},"case_links":{"href":"/api/v2/cases/3186/links","class":"case_link"},"macro_preview":{"href":"/api/v2/cases/3186/macros/preview","class":"macro_preview"},"replies":{"href":"/api/v2/cases/3186/replies","class":"reply","count":1},"draft":{"href":"/api/v2/cases/3186/replies/draft","class":"reply"},"notes":{"href":"/api/v2/cases/3186/notes","class":"note","count":1},"attachments":{"href":"/api/v2/cases/3186/attachments","class":"attachment","count":0}}}'
|
243
|
+
http_version:
|
244
|
+
recorded_at: Wed, 09 Jul 2014 21:42:41 GMT
|
245
|
+
- request:
|
246
|
+
method: patch
|
247
|
+
uri: https://devel.desk.com/api/v2/cases/3186
|
248
|
+
body:
|
249
|
+
encoding: UTF-8
|
250
|
+
string: '{"_links":{"assigned_user":{"href":"/api/v2/users/21923785","class":"user"}}}'
|
251
|
+
headers:
|
252
|
+
Accept:
|
253
|
+
- application/json
|
254
|
+
User-Agent:
|
255
|
+
- desk.com Ruby Gem v0.6.0
|
256
|
+
Content-Type:
|
257
|
+
- application/json
|
258
|
+
response:
|
259
|
+
status:
|
260
|
+
code: 200
|
261
|
+
message:
|
262
|
+
headers:
|
263
|
+
cache-control:
|
264
|
+
- max-age=0, private, must-revalidate
|
265
|
+
content-type:
|
266
|
+
- application/json; charset=utf-8
|
267
|
+
date:
|
268
|
+
- Wed, 09 Jul 2014 21:42:42 GMT
|
269
|
+
etag:
|
270
|
+
- '"aa74aa9d7abb026437a4dd38aaa9ad50"'
|
271
|
+
server:
|
272
|
+
- nginx
|
273
|
+
status:
|
274
|
+
- 200 OK
|
275
|
+
vary:
|
276
|
+
- X-AppVersion
|
277
|
+
x-appversion:
|
278
|
+
- '15.99'
|
279
|
+
x-frame-options:
|
280
|
+
- SAMEORIGIN
|
281
|
+
x-rack-cache:
|
282
|
+
- invalidate, pass
|
283
|
+
x-rate-limit-limit:
|
284
|
+
- '240'
|
285
|
+
x-rate-limit-remaining:
|
286
|
+
- '235'
|
287
|
+
x-rate-limit-reset:
|
288
|
+
- '18'
|
289
|
+
x-request-id:
|
290
|
+
- 8878757a3f962977e47c8f83faef3ca9
|
291
|
+
x-runtime:
|
292
|
+
- '0.448406'
|
293
|
+
x-ua-compatible:
|
294
|
+
- IE=Edge,chrome=1
|
295
|
+
content-length:
|
296
|
+
- '2093'
|
297
|
+
connection:
|
298
|
+
- Close
|
299
|
+
body:
|
300
|
+
encoding: UTF-8
|
301
|
+
string: '{"id":3186,"external_id":null,"blurb":"Soluta et odit nisi. Repellat
|
302
|
+
qui unde quo et. Quo laudantium ex dolor mollitia omnis molestias. Praesentium
|
303
|
+
quasi earum nulla.\n\nUt unde excepturi est. Recusandae qui labore id. Doloribus
|
304
|
+
et voluptatem qui. Asperiores ut sed totam eveniet voluptatem.","subject":"Quas
|
305
|
+
iste rerum eos et eius.","priority":10,"locked_until":null,"description":"Soluta
|
306
|
+
et odit nisi. Repellat qui unde quo et. Quo laudantium ex dolor mollitia omnis
|
307
|
+
molestias. Praesentium quasi earum nulla.\r\n\r\nUt unde excepturi est. Recusandae
|
308
|
+
qui labore id. Doloribus et voluptatem qui. Asperiores ut sed totam eveniet
|
309
|
+
voluptatem.\r\n\r","status":"open","type":"email","labels":[],"label_ids":[],"language":null,"active_at":"2014-07-09T21:42:15Z","changed_at":"2014-07-09T21:42:41Z","created_at":"2013-05-23T17:47:51Z","updated_at":"2014-07-09T21:42:41Z","received_at":"2013-08-02T21:38:12Z","first_opened_at":null,"opened_at":null,"first_resolved_at":null,"resolved_at":null,"custom_fields":{"my_new_custom_field":null,"my_new_number_field":null,"my_new_date_field":null,"my_new_boolean_field":null,"my_new_list_field":null,"follow_up":null,"dependent":null},"_links":{"self":{"href":"/api/v2/cases/3186","class":"case"},"message":{"href":"/api/v2/cases/3186/message","class":"email"},"customer":{"href":"/api/v2/customers/105408563","class":"customer"},"labels":{"href":"/api/v2/cases/3186/labels","class":"label"},"assigned_user":{"href":"/api/v2/users/21923785","class":"user"},"assigned_group":{"href":"/api/v2/groups/171213","class":"group"},"locked_by":null,"history":{"href":"/api/v2/cases/3186/history","class":"history"},"case_links":{"href":"/api/v2/cases/3186/links","class":"case_link"},"macro_preview":{"href":"/api/v2/cases/3186/macros/preview","class":"macro_preview"},"replies":{"href":"/api/v2/cases/3186/replies","class":"reply","count":1},"draft":{"href":"/api/v2/cases/3186/replies/draft","class":"reply"},"notes":{"href":"/api/v2/cases/3186/notes","class":"note","count":1},"attachments":{"href":"/api/v2/cases/3186/attachments","class":"attachment","count":0}}}'
|
310
|
+
http_version:
|
311
|
+
recorded_at: Wed, 09 Jul 2014 21:42:42 GMT
|
312
|
+
- request:
|
313
|
+
method: get
|
314
|
+
uri: https://devel.desk.com/api/v2/users/21923785
|
315
|
+
body:
|
316
|
+
encoding: US-ASCII
|
317
|
+
string: ''
|
318
|
+
headers:
|
319
|
+
Accept:
|
320
|
+
- application/json
|
321
|
+
User-Agent:
|
322
|
+
- desk.com Ruby Gem v0.6.0
|
323
|
+
Content-Type:
|
324
|
+
- application/json
|
325
|
+
response:
|
326
|
+
status:
|
327
|
+
code: 200
|
328
|
+
message:
|
329
|
+
headers:
|
330
|
+
accept-ranges:
|
331
|
+
- bytes
|
332
|
+
cache-control:
|
333
|
+
- must-revalidate, private, max-age=0
|
334
|
+
content-type:
|
335
|
+
- application/json; charset=utf-8
|
336
|
+
date:
|
337
|
+
- Wed, 09 Jul 2014 21:42:42 GMT
|
338
|
+
etag:
|
339
|
+
- '"90fc836746ee0c985f06d62c0ae01f78"'
|
340
|
+
status:
|
341
|
+
- 200 OK
|
342
|
+
vary:
|
343
|
+
- X-AppVersion
|
344
|
+
x-appversion:
|
345
|
+
- '15.99'
|
346
|
+
x-frame-options:
|
347
|
+
- SAMEORIGIN
|
348
|
+
x-rate-limit-limit:
|
349
|
+
- '240'
|
350
|
+
x-rate-limit-remaining:
|
351
|
+
- '234'
|
352
|
+
x-rate-limit-reset:
|
353
|
+
- '18'
|
354
|
+
x-request-id:
|
355
|
+
- a4232b653de590ad220c0a9b96b3a8b2
|
356
|
+
content-length:
|
357
|
+
- '908'
|
358
|
+
connection:
|
359
|
+
- Close
|
360
|
+
body:
|
361
|
+
encoding: UTF-8
|
362
|
+
string: '{"id":21923785,"name":"Andrew Frauen","public_name":"Andrew Frauen","email":"afrauen@salesforce.com","level":"siteadmin_billing","avatar":"http://www.gravatar.com/avatar/f35ae85c094c4d8eb9f17f10f72ca752?rating=PG&size=50&default=404","created_at":"2014-04-11T20:17:16Z","updated_at":"2014-05-14T19:06:09Z","current_login_at":"2014-05-14T19:06:09Z","last_login_at":"2014-05-06T18:41:27Z","_links":{"self":{"href":"/api/v2/users/21923785","class":"user"},"preferences":{"href":"/api/v2/users/21923785/preferences","class":"user_preference"},"searches":{"href":"/api/v2/users/21923785/searches","class":"search"},"groups":{"href":"/api/v2/users/21923785/groups","class":"group"},"macros":{"href":"/api/v2/users/21923785/macros","class":"macro"},"filters":{"href":"/api/v2/users/21923785/filters","class":"filter"},"integration_urls":{"href":"/api/v2/users/21923785/integration_urls","class":"integration_url"}}}'
|
363
|
+
http_version:
|
364
|
+
recorded_at: Wed, 09 Jul 2014 21:42:42 GMT
|
365
|
+
- request:
|
366
|
+
method: get
|
367
|
+
uri: https://devel.desk.com/api/v2/cases/3186
|
368
|
+
body:
|
369
|
+
encoding: US-ASCII
|
370
|
+
string: ''
|
371
|
+
headers:
|
372
|
+
Accept:
|
373
|
+
- application/json
|
374
|
+
User-Agent:
|
375
|
+
- desk.com Ruby Gem v0.6.0
|
376
|
+
Content-Type:
|
377
|
+
- application/json
|
378
|
+
response:
|
379
|
+
status:
|
380
|
+
code: 200
|
381
|
+
message:
|
382
|
+
headers:
|
383
|
+
accept-ranges:
|
384
|
+
- bytes
|
385
|
+
cache-control:
|
386
|
+
- must-revalidate, private, max-age=0
|
387
|
+
content-type:
|
388
|
+
- application/json; charset=utf-8
|
389
|
+
date:
|
390
|
+
- Wed, 09 Jul 2014 21:42:42 GMT
|
391
|
+
etag:
|
392
|
+
- '"aa74aa9d7abb026437a4dd38aaa9ad50"'
|
393
|
+
status:
|
394
|
+
- 200 OK
|
395
|
+
vary:
|
396
|
+
- X-AppVersion
|
397
|
+
x-appversion:
|
398
|
+
- '15.99'
|
399
|
+
x-frame-options:
|
400
|
+
- SAMEORIGIN
|
401
|
+
x-rate-limit-limit:
|
402
|
+
- '240'
|
403
|
+
x-rate-limit-remaining:
|
404
|
+
- '233'
|
405
|
+
x-rate-limit-reset:
|
406
|
+
- '18'
|
407
|
+
x-request-id:
|
408
|
+
- 0d6464305bdc8b9398de2b8a9ecb8b9b
|
409
|
+
content-length:
|
410
|
+
- '2093'
|
411
|
+
connection:
|
412
|
+
- Close
|
413
|
+
body:
|
414
|
+
encoding: UTF-8
|
415
|
+
string: '{"id":3186,"external_id":null,"blurb":"Soluta et odit nisi. Repellat
|
416
|
+
qui unde quo et. Quo laudantium ex dolor mollitia omnis molestias. Praesentium
|
417
|
+
quasi earum nulla.\n\nUt unde excepturi est. Recusandae qui labore id. Doloribus
|
418
|
+
et voluptatem qui. Asperiores ut sed totam eveniet voluptatem.","subject":"Quas
|
419
|
+
iste rerum eos et eius.","priority":10,"locked_until":null,"description":"Soluta
|
420
|
+
et odit nisi. Repellat qui unde quo et. Quo laudantium ex dolor mollitia omnis
|
421
|
+
molestias. Praesentium quasi earum nulla.\r\n\r\nUt unde excepturi est. Recusandae
|
422
|
+
qui labore id. Doloribus et voluptatem qui. Asperiores ut sed totam eveniet
|
423
|
+
voluptatem.\r\n\r","status":"open","type":"email","labels":[],"label_ids":[],"language":null,"active_at":"2014-07-09T21:42:15Z","changed_at":"2014-07-09T21:42:41Z","created_at":"2013-05-23T17:47:51Z","updated_at":"2014-07-09T21:42:41Z","received_at":"2013-08-02T21:38:12Z","first_opened_at":null,"opened_at":null,"first_resolved_at":null,"resolved_at":null,"custom_fields":{"my_new_custom_field":null,"my_new_number_field":null,"my_new_date_field":null,"my_new_boolean_field":null,"my_new_list_field":null,"follow_up":null,"dependent":null},"_links":{"self":{"href":"/api/v2/cases/3186","class":"case"},"message":{"href":"/api/v2/cases/3186/message","class":"email"},"customer":{"href":"/api/v2/customers/105408563","class":"customer"},"labels":{"href":"/api/v2/cases/3186/labels","class":"label"},"assigned_user":{"href":"/api/v2/users/21923785","class":"user"},"assigned_group":{"href":"/api/v2/groups/171213","class":"group"},"locked_by":null,"history":{"href":"/api/v2/cases/3186/history","class":"history"},"case_links":{"href":"/api/v2/cases/3186/links","class":"case_link"},"macro_preview":{"href":"/api/v2/cases/3186/macros/preview","class":"macro_preview"},"replies":{"href":"/api/v2/cases/3186/replies","class":"reply","count":1},"draft":{"href":"/api/v2/cases/3186/replies/draft","class":"reply"},"notes":{"href":"/api/v2/cases/3186/notes","class":"note","count":1},"attachments":{"href":"/api/v2/cases/3186/attachments","class":"attachment","count":0}}}'
|
424
|
+
http_version:
|
425
|
+
recorded_at: Wed, 09 Jul 2014 21:42:42 GMT
|
426
|
+
recorded_with: VCR 2.9.2
|
@@ -1,3 +1,31 @@
|
|
1
|
+
# Copyright (c) 2013-2014, Salesforce.com, Inc.
|
2
|
+
# All rights reserved.
|
3
|
+
#
|
4
|
+
# Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
# are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
8
|
+
# list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# * Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
13
|
+
#
|
14
|
+
# * Neither the name of Salesforce.com nor the names of its contributors may be
|
15
|
+
# used to endorse or promote products derived from this software without
|
16
|
+
# specific prior written permission.
|
17
|
+
#
|
18
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
22
|
+
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
25
|
+
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
+
|
1
29
|
require 'spec_helper'
|
2
30
|
|
3
31
|
describe DeskApi::Client do
|