restforce-db 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -22
  3. data/lib/restforce/db/associations/base.rb +152 -0
  4. data/lib/restforce/db/associations/belongs_to.rb +70 -0
  5. data/lib/restforce/db/associations/foreign_key.rb +80 -0
  6. data/lib/restforce/db/associations/has_many.rb +37 -0
  7. data/lib/restforce/db/associations/has_one.rb +33 -0
  8. data/lib/restforce/db/dsl.rb +25 -13
  9. data/lib/restforce/db/mapping.rb +2 -3
  10. data/lib/restforce/db/record_types/active_record.rb +3 -8
  11. data/lib/restforce/db/record_types/salesforce.rb +23 -8
  12. data/lib/restforce/db/strategies/associated.rb +58 -0
  13. data/lib/restforce/db/version.rb +1 -1
  14. data/lib/restforce/db.rb +6 -1
  15. data/restforce-db.gemspec +0 -1
  16. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_build/returns_an_associated_record_populated_with_the_Salesforce_attributes.yml +271 -0
  17. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_synced_for_/when_a_matching_associated_record_has_been_synchronized/returns_true.yml +271 -0
  18. data/test/cassettes/Restforce_DB_Associations_BelongsTo/with_an_inverse_mapping/_synced_for_/when_no_matching_associated_record_has_been_synchronized/returns_false.yml +271 -0
  19. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_build/builds_a_number_of_associated_records_from_the_data_in_Salesforce.yml +439 -0
  20. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_synced_for_/when_a_matching_associated_record_has_been_synchronized/returns_true.yml +439 -0
  21. data/test/cassettes/Restforce_DB_Associations_HasMany/with_an_inverse_mapping/_synced_for_/when_no_matching_associated_record_has_been_synchronized/returns_false.yml +196 -0
  22. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_build/returns_an_associated_record_populated_with_the_Salesforce_attributes.yml +271 -0
  23. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_synced_for_/when_a_matching_associated_record_has_been_synchronized/returns_true.yml +271 -0
  24. data/test/cassettes/Restforce_DB_Associations_HasOne/with_an_inverse_mapping/_synced_for_/when_no_matching_associated_record_has_been_synchronized/returns_false.yml +271 -0
  25. data/test/cassettes/Restforce_DB_Strategies_Associated/_build_/given_an_inverse_mapping/with_a_synchronized_association_record/wants_to_build_a_new_record.yml +275 -0
  26. data/test/cassettes/Restforce_DB_Strategies_Associated/_build_/given_an_inverse_mapping/with_an_existing_database_record/does_not_want_to_build_a_new_record.yml +237 -0
  27. data/test/cassettes/Restforce_DB_Strategies_Associated/_build_/given_an_inverse_mapping/with_no_synchronized_association_record/does_not_want_to_build_a_new_record.yml +275 -0
  28. data/test/lib/restforce/db/associations/belongs_to_test.rb +82 -0
  29. data/test/lib/restforce/db/associations/has_many_test.rb +96 -0
  30. data/test/lib/restforce/db/associations/has_one_test.rb +80 -0
  31. data/test/lib/restforce/db/dsl_test.rb +22 -3
  32. data/test/lib/restforce/db/mapping_test.rb +10 -8
  33. data/test/lib/restforce/db/record_types/active_record_test.rb +12 -5
  34. data/test/lib/restforce/db/runner_test.rb +2 -3
  35. data/test/lib/restforce/db/strategies/always_test.rb +2 -2
  36. data/test/lib/restforce/db/strategies/associated_test.rb +78 -0
  37. data/test/lib/restforce/db/strategies/passive_test.rb +1 -1
  38. data/test/lib/restforce/db/tracker_test.rb +0 -2
  39. data/test/support/active_record.rb +25 -2
  40. data/test/support/salesforce.rb +1 -1
  41. data/test/support/utilities.rb +5 -7
  42. data/test/test_helper.rb +0 -1
  43. metadata +24 -18
  44. data/lib/restforce/db/associations/active_record.rb +0 -68
  45. data/test/lib/restforce/db/associations/active_record_test.rb +0 -43
@@ -0,0 +1,439 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<host>/services/oauth2/token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: grant_type=password&client_id=<client_id>&client_secret=<client_secret>&username=<username>&password=<password><security_token>
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Sat, 11 Apr 2015 01:29:45 GMT
25
+ Set-Cookie:
26
+ - BrowserId=VV_spkQdR8qubm0JpfTtbw;Path=/;Domain=.salesforce.com;Expires=Wed,
27
+ 10-Jun-2015 01:29:45 GMT
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Pragma:
31
+ - no-cache
32
+ Cache-Control:
33
+ - no-cache, no-store
34
+ Content-Type:
35
+ - application/json;charset=UTF-8
36
+ Transfer-Encoding:
37
+ - chunked
38
+ body:
39
+ encoding: ASCII-8BIT
40
+ string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"1428715785563","token_type":"Bearer","instance_url":"https://<host>","signature":"CP3JKuG7/SQHR4Dam1HfpVtvW2QDAn8O0aTFO+2REEg=","access_token":"00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj"}'
41
+ http_version:
42
+ recorded_at: Sat, 11 Apr 2015 01:29:46 GMT
43
+ - request:
44
+ method: post
45
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"Name":"Sample object"}'
49
+ headers:
50
+ User-Agent:
51
+ - Faraday v0.9.1
52
+ Content-Type:
53
+ - application/json
54
+ Authorization:
55
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
56
+ Accept-Encoding:
57
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
58
+ Accept:
59
+ - "*/*"
60
+ response:
61
+ status:
62
+ code: 201
63
+ message: Created
64
+ headers:
65
+ Date:
66
+ - Sat, 11 Apr 2015 01:29:46 GMT
67
+ Set-Cookie:
68
+ - BrowserId=aInJO_P6S9CgPQAJiPLQOg;Path=/;Domain=.salesforce.com;Expires=Wed,
69
+ 10-Jun-2015 01:29:46 GMT
70
+ Expires:
71
+ - Thu, 01 Jan 1970 00:00:00 GMT
72
+ Sforce-Limit-Info:
73
+ - api-usage=170/15000
74
+ Location:
75
+ - "/services/data/v26.0/sobjects/CustomObject__c/a001a000001LXgyAAG"
76
+ Content-Type:
77
+ - application/json;charset=UTF-8
78
+ Transfer-Encoding:
79
+ - chunked
80
+ body:
81
+ encoding: ASCII-8BIT
82
+ string: '{"id":"a001a000001LXgyAAG","success":true,"errors":[]}'
83
+ http_version:
84
+ recorded_at: Sat, 11 Apr 2015 01:29:47 GMT
85
+ - request:
86
+ method: post
87
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObjectDetail__c
88
+ body:
89
+ encoding: UTF-8
90
+ string: '{"Name":"First Detail","CustomObject__c":"a001a000001LXgyAAG"}'
91
+ headers:
92
+ User-Agent:
93
+ - Faraday v0.9.1
94
+ Content-Type:
95
+ - application/json
96
+ Authorization:
97
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
98
+ Accept-Encoding:
99
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
100
+ Accept:
101
+ - "*/*"
102
+ response:
103
+ status:
104
+ code: 201
105
+ message: Created
106
+ headers:
107
+ Date:
108
+ - Sat, 11 Apr 2015 01:29:47 GMT
109
+ Set-Cookie:
110
+ - BrowserId=8OuxrYcMSci9f5ucAA61Ow;Path=/;Domain=.salesforce.com;Expires=Wed,
111
+ 10-Jun-2015 01:29:47 GMT
112
+ Expires:
113
+ - Thu, 01 Jan 1970 00:00:00 GMT
114
+ Sforce-Limit-Info:
115
+ - api-usage=170/15000
116
+ Location:
117
+ - "/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gym7AAA"
118
+ Content-Type:
119
+ - application/json;charset=UTF-8
120
+ Transfer-Encoding:
121
+ - chunked
122
+ body:
123
+ encoding: ASCII-8BIT
124
+ string: '{"id":"a011a000000gym7AAA","success":true,"errors":[]}'
125
+ http_version:
126
+ recorded_at: Sat, 11 Apr 2015 01:29:48 GMT
127
+ - request:
128
+ method: post
129
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObjectDetail__c
130
+ body:
131
+ encoding: UTF-8
132
+ string: '{"Name":"Second Detail","CustomObject__c":"a001a000001LXgyAAG"}'
133
+ headers:
134
+ User-Agent:
135
+ - Faraday v0.9.1
136
+ Content-Type:
137
+ - application/json
138
+ Authorization:
139
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
140
+ Accept-Encoding:
141
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
142
+ Accept:
143
+ - "*/*"
144
+ response:
145
+ status:
146
+ code: 201
147
+ message: Created
148
+ headers:
149
+ Date:
150
+ - Sat, 11 Apr 2015 01:29:48 GMT
151
+ Set-Cookie:
152
+ - BrowserId=gqy-MunDTHSeKeiSBBS5Sg;Path=/;Domain=.salesforce.com;Expires=Wed,
153
+ 10-Jun-2015 01:29:48 GMT
154
+ Expires:
155
+ - Thu, 01 Jan 1970 00:00:00 GMT
156
+ Sforce-Limit-Info:
157
+ - api-usage=170/15000
158
+ Location:
159
+ - "/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gylUAAQ"
160
+ Content-Type:
161
+ - application/json;charset=UTF-8
162
+ Transfer-Encoding:
163
+ - chunked
164
+ body:
165
+ encoding: ASCII-8BIT
166
+ string: '{"id":"a011a000000gylUAAQ","success":true,"errors":[]}'
167
+ http_version:
168
+ recorded_at: Sat, 11 Apr 2015 01:29:49 GMT
169
+ - request:
170
+ method: post
171
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObjectDetail__c
172
+ body:
173
+ encoding: UTF-8
174
+ string: '{"Name":"Third Detail","CustomObject__c":"a001a000001LXgyAAG"}'
175
+ headers:
176
+ User-Agent:
177
+ - Faraday v0.9.1
178
+ Content-Type:
179
+ - application/json
180
+ Authorization:
181
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
182
+ Accept-Encoding:
183
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
184
+ Accept:
185
+ - "*/*"
186
+ response:
187
+ status:
188
+ code: 201
189
+ message: Created
190
+ headers:
191
+ Date:
192
+ - Sat, 11 Apr 2015 01:29:49 GMT
193
+ Set-Cookie:
194
+ - BrowserId=eVURrnNBQvqY48EHi_z8ZQ;Path=/;Domain=.salesforce.com;Expires=Wed,
195
+ 10-Jun-2015 01:29:49 GMT
196
+ Expires:
197
+ - Thu, 01 Jan 1970 00:00:00 GMT
198
+ Sforce-Limit-Info:
199
+ - api-usage=170/15000
200
+ Location:
201
+ - "/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gymCAAQ"
202
+ Content-Type:
203
+ - application/json;charset=UTF-8
204
+ Transfer-Encoding:
205
+ - chunked
206
+ body:
207
+ encoding: ASCII-8BIT
208
+ string: '{"id":"a011a000000gymCAAQ","success":true,"errors":[]}'
209
+ http_version:
210
+ recorded_at: Sat, 11 Apr 2015 01:29:50 GMT
211
+ - request:
212
+ method: get
213
+ uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20Example_Field__c%20from%20CustomObject__c%20where%20Id%20=%20%27a001a000001LXgyAAG%27
214
+ body:
215
+ encoding: US-ASCII
216
+ string: ''
217
+ headers:
218
+ User-Agent:
219
+ - Faraday v0.9.1
220
+ Authorization:
221
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
222
+ Accept-Encoding:
223
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
224
+ Accept:
225
+ - "*/*"
226
+ response:
227
+ status:
228
+ code: 200
229
+ message: OK
230
+ headers:
231
+ Date:
232
+ - Sat, 11 Apr 2015 01:29:50 GMT
233
+ Set-Cookie:
234
+ - BrowserId=ZhSDIpJlR1SlGlsJOOCO5w;Path=/;Domain=.salesforce.com;Expires=Wed,
235
+ 10-Jun-2015 01:29:50 GMT
236
+ Expires:
237
+ - Thu, 01 Jan 1970 00:00:00 GMT
238
+ Sforce-Limit-Info:
239
+ - api-usage=170/15000
240
+ Content-Type:
241
+ - application/json;charset=UTF-8
242
+ Transfer-Encoding:
243
+ - chunked
244
+ body:
245
+ encoding: ASCII-8BIT
246
+ string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/v26.0/sobjects/CustomObject__c/a001a000001LXgyAAG"},"Id":"a001a000001LXgyAAG","SystemModstamp":"2015-04-11T01:29:46.000+0000","Name":"Sample
247
+ object","Example_Field__c":null}]}'
248
+ http_version:
249
+ recorded_at: Sat, 11 Apr 2015 01:29:51 GMT
250
+ - request:
251
+ method: get
252
+ uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20CustomObject__c%20from%20CustomObjectDetail__c%20where%20CustomObject__c%20=%20%27a001a000001LXgyAAG%27
253
+ body:
254
+ encoding: US-ASCII
255
+ string: ''
256
+ headers:
257
+ User-Agent:
258
+ - Faraday v0.9.1
259
+ Authorization:
260
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
261
+ Accept-Encoding:
262
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
263
+ Accept:
264
+ - "*/*"
265
+ response:
266
+ status:
267
+ code: 200
268
+ message: OK
269
+ headers:
270
+ Date:
271
+ - Sat, 11 Apr 2015 01:29:51 GMT
272
+ Set-Cookie:
273
+ - BrowserId=TPsGnc-QRp6JWQdNY6H7nw;Path=/;Domain=.salesforce.com;Expires=Wed,
274
+ 10-Jun-2015 01:29:51 GMT
275
+ Expires:
276
+ - Thu, 01 Jan 1970 00:00:00 GMT
277
+ Sforce-Limit-Info:
278
+ - api-usage=170/15000
279
+ Content-Type:
280
+ - application/json;charset=UTF-8
281
+ Transfer-Encoding:
282
+ - chunked
283
+ body:
284
+ encoding: ASCII-8BIT
285
+ string: '{"totalSize":3,"done":true,"records":[{"attributes":{"type":"CustomObjectDetail__c","url":"/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gylUAAQ"},"Id":"a011a000000gylUAAQ","SystemModstamp":"2015-04-11T01:29:48.000+0000","Name":"Second
286
+ Detail","CustomObject__c":"a001a000001LXgyAAG"},{"attributes":{"type":"CustomObjectDetail__c","url":"/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gym7AAA"},"Id":"a011a000000gym7AAA","SystemModstamp":"2015-04-11T01:29:47.000+0000","Name":"First
287
+ Detail","CustomObject__c":"a001a000001LXgyAAG"},{"attributes":{"type":"CustomObjectDetail__c","url":"/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gymCAAQ"},"Id":"a011a000000gymCAAQ","SystemModstamp":"2015-04-11T01:29:49.000+0000","Name":"Third
288
+ Detail","CustomObject__c":"a001a000001LXgyAAG"}]}'
289
+ http_version:
290
+ recorded_at: Sat, 11 Apr 2015 01:29:52 GMT
291
+ - request:
292
+ method: delete
293
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001LXgyAAG
294
+ body:
295
+ encoding: US-ASCII
296
+ string: ''
297
+ headers:
298
+ User-Agent:
299
+ - Faraday v0.9.1
300
+ Authorization:
301
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
302
+ Accept-Encoding:
303
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
304
+ Accept:
305
+ - "*/*"
306
+ response:
307
+ status:
308
+ code: 204
309
+ message: No Content
310
+ headers:
311
+ Date:
312
+ - Sat, 11 Apr 2015 01:29:52 GMT
313
+ Set-Cookie:
314
+ - BrowserId=GPOLOtEhRjOj-ZQI9VhL_A;Path=/;Domain=.salesforce.com;Expires=Wed,
315
+ 10-Jun-2015 01:29:52 GMT
316
+ Expires:
317
+ - Thu, 01 Jan 1970 00:00:00 GMT
318
+ Sforce-Limit-Info:
319
+ - api-usage=170/15000
320
+ body:
321
+ encoding: UTF-8
322
+ string: ''
323
+ http_version:
324
+ recorded_at: Sat, 11 Apr 2015 01:29:53 GMT
325
+ - request:
326
+ method: delete
327
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gym7AAA
328
+ body:
329
+ encoding: US-ASCII
330
+ string: ''
331
+ headers:
332
+ User-Agent:
333
+ - Faraday v0.9.1
334
+ Authorization:
335
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
336
+ Accept-Encoding:
337
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
338
+ Accept:
339
+ - "*/*"
340
+ response:
341
+ status:
342
+ code: 404
343
+ message: Not Found
344
+ headers:
345
+ Date:
346
+ - Sat, 11 Apr 2015 01:29:53 GMT
347
+ Set-Cookie:
348
+ - BrowserId=X2FYj_rwQ46ZEYVmd34Ehg;Path=/;Domain=.salesforce.com;Expires=Wed,
349
+ 10-Jun-2015 01:29:53 GMT
350
+ Expires:
351
+ - Thu, 01 Jan 1970 00:00:00 GMT
352
+ Sforce-Limit-Info:
353
+ - api-usage=170/15000
354
+ Content-Type:
355
+ - application/json;charset=UTF-8
356
+ Transfer-Encoding:
357
+ - chunked
358
+ body:
359
+ encoding: UTF-8
360
+ string: '[{"message":"entity is deleted","errorCode":"ENTITY_IS_DELETED","fields":[]}]'
361
+ http_version:
362
+ recorded_at: Sat, 11 Apr 2015 01:29:54 GMT
363
+ - request:
364
+ method: delete
365
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gylUAAQ
366
+ body:
367
+ encoding: US-ASCII
368
+ string: ''
369
+ headers:
370
+ User-Agent:
371
+ - Faraday v0.9.1
372
+ Authorization:
373
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
374
+ Accept-Encoding:
375
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
376
+ Accept:
377
+ - "*/*"
378
+ response:
379
+ status:
380
+ code: 404
381
+ message: Not Found
382
+ headers:
383
+ Date:
384
+ - Sat, 11 Apr 2015 01:29:54 GMT
385
+ Set-Cookie:
386
+ - BrowserId=0F4dFZ8OT_i3EZx6ySX99w;Path=/;Domain=.salesforce.com;Expires=Wed,
387
+ 10-Jun-2015 01:29:54 GMT
388
+ Expires:
389
+ - Thu, 01 Jan 1970 00:00:00 GMT
390
+ Sforce-Limit-Info:
391
+ - api-usage=170/15000
392
+ Content-Type:
393
+ - application/json;charset=UTF-8
394
+ Transfer-Encoding:
395
+ - chunked
396
+ body:
397
+ encoding: UTF-8
398
+ string: '[{"message":"entity is deleted","errorCode":"ENTITY_IS_DELETED","fields":[]}]'
399
+ http_version:
400
+ recorded_at: Sat, 11 Apr 2015 01:29:55 GMT
401
+ - request:
402
+ method: delete
403
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObjectDetail__c/a011a000000gymCAAQ
404
+ body:
405
+ encoding: US-ASCII
406
+ string: ''
407
+ headers:
408
+ User-Agent:
409
+ - Faraday v0.9.1
410
+ Authorization:
411
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
412
+ Accept-Encoding:
413
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
414
+ Accept:
415
+ - "*/*"
416
+ response:
417
+ status:
418
+ code: 404
419
+ message: Not Found
420
+ headers:
421
+ Date:
422
+ - Sat, 11 Apr 2015 01:29:56 GMT
423
+ Set-Cookie:
424
+ - BrowserId=fa1WPMDhTqGrd6tI4KrzYQ;Path=/;Domain=.salesforce.com;Expires=Wed,
425
+ 10-Jun-2015 01:29:56 GMT
426
+ Expires:
427
+ - Thu, 01 Jan 1970 00:00:00 GMT
428
+ Sforce-Limit-Info:
429
+ - api-usage=170/15000
430
+ Content-Type:
431
+ - application/json;charset=UTF-8
432
+ Transfer-Encoding:
433
+ - chunked
434
+ body:
435
+ encoding: UTF-8
436
+ string: '[{"message":"entity is deleted","errorCode":"ENTITY_IS_DELETED","fields":[]}]'
437
+ http_version:
438
+ recorded_at: Sat, 11 Apr 2015 01:29:57 GMT
439
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,196 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://<host>/services/oauth2/token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: grant_type=password&client_id=<client_id>&client_secret=<client_secret>&username=<username>&password=<password><security_token>
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Sat, 11 Apr 2015 01:29:58 GMT
25
+ Set-Cookie:
26
+ - BrowserId=x8CKG8j8THSZV7DpEsVLIg;Path=/;Domain=.salesforce.com;Expires=Wed,
27
+ 10-Jun-2015 01:29:58 GMT
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Pragma:
31
+ - no-cache
32
+ Cache-Control:
33
+ - no-cache, no-store
34
+ Content-Type:
35
+ - application/json;charset=UTF-8
36
+ Transfer-Encoding:
37
+ - chunked
38
+ body:
39
+ encoding: ASCII-8BIT
40
+ string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"1428715798755","token_type":"Bearer","instance_url":"https://<host>","signature":"/GkLEgWKmoxA2MrX0e/J3mV+I37ybalQOsRqYmS4YNU=","access_token":"00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj"}'
41
+ http_version:
42
+ recorded_at: Sat, 11 Apr 2015 01:29:59 GMT
43
+ - request:
44
+ method: post
45
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"Name":"Sample object"}'
49
+ headers:
50
+ User-Agent:
51
+ - Faraday v0.9.1
52
+ Content-Type:
53
+ - application/json
54
+ Authorization:
55
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
56
+ Accept-Encoding:
57
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
58
+ Accept:
59
+ - "*/*"
60
+ response:
61
+ status:
62
+ code: 201
63
+ message: Created
64
+ headers:
65
+ Date:
66
+ - Sat, 11 Apr 2015 01:30:00 GMT
67
+ Set-Cookie:
68
+ - BrowserId=SIzfsqgLTa-jNKJO1wgXvg;Path=/;Domain=.salesforce.com;Expires=Wed,
69
+ 10-Jun-2015 01:30:00 GMT
70
+ Expires:
71
+ - Thu, 01 Jan 1970 00:00:00 GMT
72
+ Sforce-Limit-Info:
73
+ - api-usage=170/15000
74
+ Location:
75
+ - "/services/data/v26.0/sobjects/CustomObject__c/a001a000001LXh3AAG"
76
+ Content-Type:
77
+ - application/json;charset=UTF-8
78
+ Transfer-Encoding:
79
+ - chunked
80
+ body:
81
+ encoding: ASCII-8BIT
82
+ string: '{"id":"a001a000001LXh3AAG","success":true,"errors":[]}'
83
+ http_version:
84
+ recorded_at: Sat, 11 Apr 2015 01:30:00 GMT
85
+ - request:
86
+ method: get
87
+ uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20Example_Field__c%20from%20CustomObject__c%20where%20Id%20=%20%27a001a000001LXh3AAG%27
88
+ body:
89
+ encoding: US-ASCII
90
+ string: ''
91
+ headers:
92
+ User-Agent:
93
+ - Faraday v0.9.1
94
+ Authorization:
95
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
96
+ Accept-Encoding:
97
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
98
+ Accept:
99
+ - "*/*"
100
+ response:
101
+ status:
102
+ code: 200
103
+ message: OK
104
+ headers:
105
+ Date:
106
+ - Sat, 11 Apr 2015 01:30:01 GMT
107
+ Set-Cookie:
108
+ - BrowserId=CfhnKykHQ_edY1rlPQpe0Q;Path=/;Domain=.salesforce.com;Expires=Wed,
109
+ 10-Jun-2015 01:30:01 GMT
110
+ Expires:
111
+ - Thu, 01 Jan 1970 00:00:00 GMT
112
+ Sforce-Limit-Info:
113
+ - api-usage=171/15000
114
+ Content-Type:
115
+ - application/json;charset=UTF-8
116
+ Transfer-Encoding:
117
+ - chunked
118
+ body:
119
+ encoding: ASCII-8BIT
120
+ string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/v26.0/sobjects/CustomObject__c/a001a000001LXh3AAG"},"Id":"a001a000001LXh3AAG","SystemModstamp":"2015-04-11T01:30:00.000+0000","Name":"Sample
121
+ object","Example_Field__c":null}]}'
122
+ http_version:
123
+ recorded_at: Sat, 11 Apr 2015 01:30:01 GMT
124
+ - request:
125
+ method: get
126
+ uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20CustomObject__c%20from%20CustomObjectDetail__c%20where%20CustomObject__c%20=%20%27a001a000001LXh3AAG%27
127
+ body:
128
+ encoding: US-ASCII
129
+ string: ''
130
+ headers:
131
+ User-Agent:
132
+ - Faraday v0.9.1
133
+ Authorization:
134
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
135
+ Accept-Encoding:
136
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
137
+ Accept:
138
+ - "*/*"
139
+ response:
140
+ status:
141
+ code: 200
142
+ message: OK
143
+ headers:
144
+ Date:
145
+ - Sat, 11 Apr 2015 01:30:02 GMT
146
+ Set-Cookie:
147
+ - BrowserId=M9SJMGIaRbKLVv1KPQho5Q;Path=/;Domain=.salesforce.com;Expires=Wed,
148
+ 10-Jun-2015 01:30:02 GMT
149
+ Expires:
150
+ - Thu, 01 Jan 1970 00:00:00 GMT
151
+ Sforce-Limit-Info:
152
+ - api-usage=172/15000
153
+ Content-Type:
154
+ - application/json;charset=UTF-8
155
+ Transfer-Encoding:
156
+ - chunked
157
+ body:
158
+ encoding: ASCII-8BIT
159
+ string: '{"totalSize":0,"done":true,"records":[]}'
160
+ http_version:
161
+ recorded_at: Sat, 11 Apr 2015 01:30:02 GMT
162
+ - request:
163
+ method: delete
164
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001LXh3AAG
165
+ body:
166
+ encoding: US-ASCII
167
+ string: ''
168
+ headers:
169
+ User-Agent:
170
+ - Faraday v0.9.1
171
+ Authorization:
172
+ - OAuth 00D1a000000H3O9!AQ4AQKzh13pKuR2SlS.Cq04BnD.sliu.0jLuP2qUQvVfZBc5RaiRknImPjcZu5w_dvIzyN831OnqnR.o9XKdgX14n3l6dNnj
173
+ Accept-Encoding:
174
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
175
+ Accept:
176
+ - "*/*"
177
+ response:
178
+ status:
179
+ code: 204
180
+ message: No Content
181
+ headers:
182
+ Date:
183
+ - Sat, 11 Apr 2015 01:30:03 GMT
184
+ Set-Cookie:
185
+ - BrowserId=henkCHXOSQyr7R2BuqP8cQ;Path=/;Domain=.salesforce.com;Expires=Wed,
186
+ 10-Jun-2015 01:30:03 GMT
187
+ Expires:
188
+ - Thu, 01 Jan 1970 00:00:00 GMT
189
+ Sforce-Limit-Info:
190
+ - api-usage=171/15000
191
+ body:
192
+ encoding: UTF-8
193
+ string: ''
194
+ http_version:
195
+ recorded_at: Sat, 11 Apr 2015 01:30:03 GMT
196
+ recorded_with: VCR 2.9.3