restforce-db 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rubocop/custom/method_documentation.rb +65 -0
  4. data/.rubocop.yml +39 -0
  5. data/.travis.yml +3 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +68 -0
  9. data/Rakefile +13 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +7 -0
  12. data/lib/generators/restforce_generator.rb +19 -0
  13. data/lib/generators/templates/config.yml +8 -0
  14. data/lib/generators/templates/script +6 -0
  15. data/lib/restforce/db/command.rb +98 -0
  16. data/lib/restforce/db/configuration.rb +50 -0
  17. data/lib/restforce/db/instances/active_record.rb +48 -0
  18. data/lib/restforce/db/instances/base.rb +66 -0
  19. data/lib/restforce/db/instances/salesforce.rb +46 -0
  20. data/lib/restforce/db/mapping.rb +106 -0
  21. data/lib/restforce/db/model.rb +50 -0
  22. data/lib/restforce/db/record_type.rb +77 -0
  23. data/lib/restforce/db/record_types/active_record.rb +80 -0
  24. data/lib/restforce/db/record_types/base.rb +44 -0
  25. data/lib/restforce/db/record_types/salesforce.rb +94 -0
  26. data/lib/restforce/db/synchronizer.rb +57 -0
  27. data/lib/restforce/db/version.rb +10 -0
  28. data/lib/restforce/db/worker.rb +156 -0
  29. data/lib/restforce/db.rb +77 -0
  30. data/lib/restforce/extensions.rb +19 -0
  31. data/restforce-db.gemspec +41 -0
  32. data/test/cassettes/Restforce_DB/accessing_Salesforce/uses_the_configured_credentials.yml +43 -0
  33. data/test/cassettes/Restforce_DB_Instances_Salesforce/_copy_/updates_the_record_with_the_attributes_from_the_copied_object.yml +193 -0
  34. data/test/cassettes/Restforce_DB_Instances_Salesforce/_update_/updates_the_local_record_with_the_passed_attributes.yml +193 -0
  35. data/test/cassettes/Restforce_DB_Instances_Salesforce/_update_/updates_the_record_in_Salesforce_with_the_passed_attributes.yml +232 -0
  36. data/test/cassettes/Restforce_DB_RecordTypes_Salesforce/_create_/creates_a_record_in_Salesforce_from_the_passed_database_record_s_attributes.yml +158 -0
  37. data/test/cassettes/Restforce_DB_RecordTypes_Salesforce/_create_/updates_the_database_record_with_the_Salesforce_record_s_ID.yml +158 -0
  38. data/test/cassettes/Restforce_DB_RecordTypes_Salesforce/_find/finds_existing_records_in_Salesforce.yml +157 -0
  39. data/test/cassettes/Restforce_DB_RecordTypes_Salesforce/_find/returns_nil_when_no_matching_record_exists.yml +81 -0
  40. data/test/cassettes/Restforce_DB_Synchronizer/_run/given_a_Salesforce_record_with_an_existing_record_in_the_database/updates_the_database_record.yml +158 -0
  41. data/test/cassettes/Restforce_DB_Synchronizer/_run/given_an_existing_Salesforce_record/populates_the_database_with_the_new_record.yml +158 -0
  42. data/test/cassettes/Restforce_DB_Synchronizer/_run/given_an_existing_database_record/populates_Salesforce_with_the_new_record.yml +235 -0
  43. data/test/lib/restforce/db/configuration_test.rb +38 -0
  44. data/test/lib/restforce/db/instances/active_record_test.rb +39 -0
  45. data/test/lib/restforce/db/instances/salesforce_test.rb +51 -0
  46. data/test/lib/restforce/db/mapping_test.rb +70 -0
  47. data/test/lib/restforce/db/model_test.rb +48 -0
  48. data/test/lib/restforce/db/record_type_test.rb +26 -0
  49. data/test/lib/restforce/db/record_types/active_record_test.rb +85 -0
  50. data/test/lib/restforce/db/record_types/salesforce_test.rb +46 -0
  51. data/test/lib/restforce/db/synchronizer_test.rb +84 -0
  52. data/test/lib/restforce/db_test.rb +24 -0
  53. data/test/support/active_record.rb +20 -0
  54. data/test/support/database_cleaner.rb +3 -0
  55. data/test/support/salesforce.rb +48 -0
  56. data/test/support/vcr.rb +23 -0
  57. data/test/test_helper.rb +25 -0
  58. metadata +287 -0
@@ -0,0 +1,77 @@
1
+ require "time"
2
+ require "restforce"
3
+
4
+ require "restforce/extensions"
5
+
6
+ require "restforce/db/version"
7
+ require "restforce/db/configuration"
8
+
9
+ require "restforce/db/instances/base"
10
+ require "restforce/db/instances/active_record"
11
+ require "restforce/db/instances/salesforce"
12
+
13
+ require "restforce/db/record_types/base"
14
+ require "restforce/db/record_types/active_record"
15
+ require "restforce/db/record_types/salesforce"
16
+
17
+ require "restforce/db/mapping"
18
+ require "restforce/db/model"
19
+ require "restforce/db/synchronizer"
20
+ require "restforce/db/record_type"
21
+ require "restforce/db/worker"
22
+
23
+ module Restforce
24
+
25
+ # Restforce::DB exposes basic Restforce client configuration methods for use
26
+ # by the other classes in this library.
27
+ module DB
28
+
29
+ class << self
30
+
31
+ attr_writer :configuration
32
+
33
+ end
34
+
35
+ # Public: Get the current configuration for Restforce::DB.
36
+ #
37
+ # Returns a Restforce::DB::Configuration instance.
38
+ def self.configuration
39
+ @configuration ||= Configuration.new
40
+ end
41
+
42
+ # Public: Get a Restforce client based on the currently configured settings.
43
+ #
44
+ # Returns a Restforce::Data::Client instance.
45
+ def self.client
46
+ @client ||= Restforce.new(
47
+ username: configuration.username,
48
+ password: configuration.password,
49
+ security_token: configuration.security_token,
50
+ client_id: configuration.client_id,
51
+ client_secret: configuration.client_secret,
52
+ host: configuration.host,
53
+ )
54
+ end
55
+
56
+ # Public: Configure Restforce::DB by assigning values to the current
57
+ # configuration.
58
+ #
59
+ # Yields the current configuration.
60
+ # Returns the current configuration.
61
+ def self.configure
62
+ yield(configuration)
63
+ configuration
64
+ end
65
+
66
+ # Public: Eliminate all customizations to the current Restforce::DB
67
+ # configuration and client.
68
+ #
69
+ # Returns nothing.
70
+ def self.reset
71
+ @configuration = nil
72
+ @client = nil
73
+ end
74
+
75
+ end
76
+
77
+ end
@@ -0,0 +1,19 @@
1
+ module Restforce
2
+
3
+ # :nodoc:
4
+ class SObject
5
+
6
+ # Public: Update the Salesforce record with the passed attributes.
7
+ #
8
+ # attributes - A Hash of attributes to assign to the record.
9
+ #
10
+ # Raises on update error.
11
+ def update!(attributes)
12
+ ensure_id
13
+ @client.update!(sobject_type, attributes.merge("Id" => self.Id))
14
+ merge!(attributes)
15
+ end
16
+
17
+ end
18
+
19
+ end
@@ -0,0 +1,41 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "restforce/db/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "restforce-db"
8
+ spec.version = Restforce::DB::VERSION
9
+ spec.authors = ["Andrew Horner"]
10
+ spec.email = ["andrew@tablexi.com"]
11
+
12
+ spec.summary = "Bind your database to Salesforce data"
13
+ spec.description = "
14
+ This gem provides two-way bindings between Salesforce records and records
15
+ in an ActiveRecord-compatible database. It leans on the Restforce library
16
+ for Salesforce API interactions, and provides a self-daemonizing binary
17
+ which keeps records in sync by way of a tight polling loop."
18
+
19
+ spec.homepage = "https://www.github.com/tablexi/restforce-db"
20
+ spec.license = "MIT"
21
+
22
+ spec.files = `git ls-files`.split($RS)
23
+ spec.bindir = "exe"
24
+ spec.executables = spec.files.grep(/^exe\//) { |f| File.basename(f) }
25
+ spec.require_paths = ["lib"]
26
+
27
+ spec.add_dependency "activerecord"
28
+ spec.add_dependency "daemons"
29
+ spec.add_dependency "restforce"
30
+
31
+ spec.add_development_dependency "bundler", "~> 1.8"
32
+ spec.add_development_dependency "database_cleaner"
33
+ spec.add_development_dependency "minitest"
34
+ spec.add_development_dependency "minitest-bang"
35
+ spec.add_development_dependency "minitest-spec-expect"
36
+ spec.add_development_dependency "minitest-vcr"
37
+ spec.add_development_dependency "rake", "~> 10.0"
38
+ spec.add_development_dependency "rubocop"
39
+ spec.add_development_dependency "sqlite3"
40
+ spec.add_development_dependency "webmock"
41
+ end
@@ -0,0 +1,43 @@
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
+ - Tue, 17 Mar 2015 18:29:58 GMT
25
+ Set-Cookie:
26
+ - BrowserId=KvCaIxn-RmelQDRcZJJmcw;Path=/;Domain=.salesforce.com;Expires=Sat,
27
+ 16-May-2015 18: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":"1426616998243","token_type":"Bearer","instance_url":"https://<host>","signature":"UW5T01ssq1ZZjJa4k86jnWTT+XYv7lNzCLudxzKJ2BQ=","access_token":"00D1a000000H3O9!AQ4AQBFd3oqpDO.7.Xcxso.goiRaetayUacefPmDpnmt8PamElbwequE5PNhXF16HhJY.W21KtDWD8mnv5vFKKt9refJWu.h"}'
41
+ http_version:
42
+ recorded_at: Tue, 17 Mar 2015 18:29:58 GMT
43
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,193 @@
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
+ - Wed, 18 Mar 2015 20:34:33 GMT
25
+ Set-Cookie:
26
+ - BrowserId=ElUZRQLkSy6kt2YDAVSFKA;Path=/;Domain=.salesforce.com;Expires=Sun,
27
+ 17-May-2015 20:34:33 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":"1426710873724","token_type":"Bearer","instance_url":"https://<host>","signature":"robX3TYpeZYExmADA4WBjnOtA+qelwKg7GGVQDufmXs=","access_token":"00D1a000000H3O9!AQ4AQBPYB1dtKrLqKFY0OHPXkpY2WSuWV3emXMOLv6.4pyhpMQ0liAbd0z2To0vRk4VoArPod87jkJCAza2a_.92y4ZpZ_4m"}'
41
+ http_version:
42
+ recorded_at: Wed, 18 Mar 2015 20:34:32 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!AQ4AQBPYB1dtKrLqKFY0OHPXkpY2WSuWV3emXMOLv6.4pyhpMQ0liAbd0z2To0vRk4VoArPod87jkJCAza2a_.92y4ZpZ_4m
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
+ - Wed, 18 Mar 2015 20:34:33 GMT
67
+ Set-Cookie:
68
+ - BrowserId=JIawnNr3TwSQYvLRC3Zy_g;Path=/;Domain=.salesforce.com;Expires=Sun,
69
+ 17-May-2015 20:34:33 GMT
70
+ Expires:
71
+ - Thu, 01 Jan 1970 00:00:00 GMT
72
+ Sforce-Limit-Info:
73
+ - api-usage=26/15000
74
+ Location:
75
+ - "/services/data/v26.0/sobjects/CustomObject__c/a001a000001E5iDAAS"
76
+ Content-Type:
77
+ - application/json;charset=UTF-8
78
+ Transfer-Encoding:
79
+ - chunked
80
+ body:
81
+ encoding: ASCII-8BIT
82
+ string: '{"id":"a001a000001E5iDAAS","success":true,"errors":[]}'
83
+ http_version:
84
+ recorded_at: Wed, 18 Mar 2015 20:34:33 GMT
85
+ - request:
86
+ method: get
87
+ uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Example_Field__c%20from%20CustomObject__c%20where%20Id%20=%20%27a001a000001E5iDAAS%27
88
+ body:
89
+ encoding: US-ASCII
90
+ string: ''
91
+ headers:
92
+ User-Agent:
93
+ - Faraday v0.9.1
94
+ Authorization:
95
+ - OAuth 00D1a000000H3O9!AQ4AQBPYB1dtKrLqKFY0OHPXkpY2WSuWV3emXMOLv6.4pyhpMQ0liAbd0z2To0vRk4VoArPod87jkJCAza2a_.92y4ZpZ_4m
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
+ - Wed, 18 Mar 2015 20:34:34 GMT
107
+ Set-Cookie:
108
+ - BrowserId=ZQuS91hNQvG7-aeioBAM0Q;Path=/;Domain=.salesforce.com;Expires=Sun,
109
+ 17-May-2015 20:34:34 GMT
110
+ Expires:
111
+ - Thu, 01 Jan 1970 00:00:00 GMT
112
+ Sforce-Limit-Info:
113
+ - api-usage=26/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/a001a000001E5iDAAS"},"Id":"a001a000001E5iDAAS","SystemModstamp":"2015-03-18T20:34:33.000+0000","Example_Field__c":null}]}'
121
+ http_version:
122
+ recorded_at: Wed, 18 Mar 2015 20:34:33 GMT
123
+ - request:
124
+ method: patch
125
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001E5iDAAS
126
+ body:
127
+ encoding: UTF-8
128
+ string: '{"Example_Field__c":"Copied text"}'
129
+ headers:
130
+ User-Agent:
131
+ - Faraday v0.9.1
132
+ Content-Type:
133
+ - application/json
134
+ Authorization:
135
+ - OAuth 00D1a000000H3O9!AQ4AQBPYB1dtKrLqKFY0OHPXkpY2WSuWV3emXMOLv6.4pyhpMQ0liAbd0z2To0vRk4VoArPod87jkJCAza2a_.92y4ZpZ_4m
136
+ Accept-Encoding:
137
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
138
+ Accept:
139
+ - "*/*"
140
+ response:
141
+ status:
142
+ code: 204
143
+ message: No Content
144
+ headers:
145
+ Date:
146
+ - Wed, 18 Mar 2015 20:34:34 GMT
147
+ Set-Cookie:
148
+ - BrowserId=Mcsl3yAuTt-WCg7Trps_xA;Path=/;Domain=.salesforce.com;Expires=Sun,
149
+ 17-May-2015 20:34:34 GMT
150
+ Expires:
151
+ - Thu, 01 Jan 1970 00:00:00 GMT
152
+ Sforce-Limit-Info:
153
+ - api-usage=27/15000
154
+ body:
155
+ encoding: UTF-8
156
+ string: ''
157
+ http_version:
158
+ recorded_at: Wed, 18 Mar 2015 20:34:33 GMT
159
+ - request:
160
+ method: delete
161
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001E5iDAAS
162
+ body:
163
+ encoding: US-ASCII
164
+ string: ''
165
+ headers:
166
+ User-Agent:
167
+ - Faraday v0.9.1
168
+ Authorization:
169
+ - OAuth 00D1a000000H3O9!AQ4AQBPYB1dtKrLqKFY0OHPXkpY2WSuWV3emXMOLv6.4pyhpMQ0liAbd0z2To0vRk4VoArPod87jkJCAza2a_.92y4ZpZ_4m
170
+ Accept-Encoding:
171
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
172
+ Accept:
173
+ - "*/*"
174
+ response:
175
+ status:
176
+ code: 204
177
+ message: No Content
178
+ headers:
179
+ Date:
180
+ - Wed, 18 Mar 2015 20:34:34 GMT
181
+ Set-Cookie:
182
+ - BrowserId=5R5Mi6kWS-mlesKpWMefDg;Path=/;Domain=.salesforce.com;Expires=Sun,
183
+ 17-May-2015 20:34:34 GMT
184
+ Expires:
185
+ - Thu, 01 Jan 1970 00:00:00 GMT
186
+ Sforce-Limit-Info:
187
+ - api-usage=26/15000
188
+ body:
189
+ encoding: UTF-8
190
+ string: ''
191
+ http_version:
192
+ recorded_at: Wed, 18 Mar 2015 20:34:33 GMT
193
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,193 @@
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
+ - Wed, 18 Mar 2015 20:28:24 GMT
25
+ Set-Cookie:
26
+ - BrowserId=mx38MLIPRSCaFqs-2qbrvw;Path=/;Domain=.salesforce.com;Expires=Sun,
27
+ 17-May-2015 20:28:24 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":"1426710504686","token_type":"Bearer","instance_url":"https://<host>","signature":"l8NUmtIwGCV90XfQi2H8DEGmHpKTNknDLvedcottr0E=","access_token":"00D1a000000H3O9!AQ4AQBPYB1dtKrLqKFY0OHPXkpY2WSuWV3emXMOLv6.4pyhpMQ0liAbd0z2To0vRk4VoArPod87jkJCAza2a_.92y4ZpZ_4m"}'
41
+ http_version:
42
+ recorded_at: Wed, 18 Mar 2015 20:28:23 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!AQ4AQBPYB1dtKrLqKFY0OHPXkpY2WSuWV3emXMOLv6.4pyhpMQ0liAbd0z2To0vRk4VoArPod87jkJCAza2a_.92y4ZpZ_4m
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
+ - Wed, 18 Mar 2015 20:28:24 GMT
67
+ Set-Cookie:
68
+ - BrowserId=fRXtlzl9QcacxtklNtvLoA;Path=/;Domain=.salesforce.com;Expires=Sun,
69
+ 17-May-2015 20:28:24 GMT
70
+ Expires:
71
+ - Thu, 01 Jan 1970 00:00:00 GMT
72
+ Sforce-Limit-Info:
73
+ - api-usage=5/15000
74
+ Location:
75
+ - "/services/data/v26.0/sobjects/CustomObject__c/a001a000001E5hoAAC"
76
+ Content-Type:
77
+ - application/json;charset=UTF-8
78
+ Transfer-Encoding:
79
+ - chunked
80
+ body:
81
+ encoding: ASCII-8BIT
82
+ string: '{"id":"a001a000001E5hoAAC","success":true,"errors":[]}'
83
+ http_version:
84
+ recorded_at: Wed, 18 Mar 2015 20:28:24 GMT
85
+ - request:
86
+ method: get
87
+ uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Example_Field__c%20from%20CustomObject__c%20where%20Id%20=%20%27a001a000001E5hoAAC%27
88
+ body:
89
+ encoding: US-ASCII
90
+ string: ''
91
+ headers:
92
+ User-Agent:
93
+ - Faraday v0.9.1
94
+ Authorization:
95
+ - OAuth 00D1a000000H3O9!AQ4AQBPYB1dtKrLqKFY0OHPXkpY2WSuWV3emXMOLv6.4pyhpMQ0liAbd0z2To0vRk4VoArPod87jkJCAza2a_.92y4ZpZ_4m
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
+ - Wed, 18 Mar 2015 20:28:25 GMT
107
+ Set-Cookie:
108
+ - BrowserId=dXS8uTmeRmu3wHnIoRL0Hg;Path=/;Domain=.salesforce.com;Expires=Sun,
109
+ 17-May-2015 20:28:25 GMT
110
+ Expires:
111
+ - Thu, 01 Jan 1970 00:00:00 GMT
112
+ Sforce-Limit-Info:
113
+ - api-usage=5/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/a001a000001E5hoAAC"},"Id":"a001a000001E5hoAAC","SystemModstamp":"2015-03-18T20:28:24.000+0000","Example_Field__c":null}]}'
121
+ http_version:
122
+ recorded_at: Wed, 18 Mar 2015 20:28:24 GMT
123
+ - request:
124
+ method: patch
125
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001E5hoAAC
126
+ body:
127
+ encoding: UTF-8
128
+ string: '{"Example_Field__c":"Some new text"}'
129
+ headers:
130
+ User-Agent:
131
+ - Faraday v0.9.1
132
+ Content-Type:
133
+ - application/json
134
+ Authorization:
135
+ - OAuth 00D1a000000H3O9!AQ4AQBPYB1dtKrLqKFY0OHPXkpY2WSuWV3emXMOLv6.4pyhpMQ0liAbd0z2To0vRk4VoArPod87jkJCAza2a_.92y4ZpZ_4m
136
+ Accept-Encoding:
137
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
138
+ Accept:
139
+ - "*/*"
140
+ response:
141
+ status:
142
+ code: 204
143
+ message: No Content
144
+ headers:
145
+ Date:
146
+ - Wed, 18 Mar 2015 20:28:25 GMT
147
+ Set-Cookie:
148
+ - BrowserId=b1i3OOQBT52XairbLpLPiA;Path=/;Domain=.salesforce.com;Expires=Sun,
149
+ 17-May-2015 20:28:25 GMT
150
+ Expires:
151
+ - Thu, 01 Jan 1970 00:00:00 GMT
152
+ Sforce-Limit-Info:
153
+ - api-usage=5/15000
154
+ body:
155
+ encoding: UTF-8
156
+ string: ''
157
+ http_version:
158
+ recorded_at: Wed, 18 Mar 2015 20:28:24 GMT
159
+ - request:
160
+ method: delete
161
+ uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001E5hoAAC
162
+ body:
163
+ encoding: US-ASCII
164
+ string: ''
165
+ headers:
166
+ User-Agent:
167
+ - Faraday v0.9.1
168
+ Authorization:
169
+ - OAuth 00D1a000000H3O9!AQ4AQBPYB1dtKrLqKFY0OHPXkpY2WSuWV3emXMOLv6.4pyhpMQ0liAbd0z2To0vRk4VoArPod87jkJCAza2a_.92y4ZpZ_4m
170
+ Accept-Encoding:
171
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
172
+ Accept:
173
+ - "*/*"
174
+ response:
175
+ status:
176
+ code: 204
177
+ message: No Content
178
+ headers:
179
+ Date:
180
+ - Wed, 18 Mar 2015 20:28:25 GMT
181
+ Set-Cookie:
182
+ - BrowserId=hIn49Vb3RECzS5EyNAAQMw;Path=/;Domain=.salesforce.com;Expires=Sun,
183
+ 17-May-2015 20:28:25 GMT
184
+ Expires:
185
+ - Thu, 01 Jan 1970 00:00:00 GMT
186
+ Sforce-Limit-Info:
187
+ - api-usage=5/15000
188
+ body:
189
+ encoding: UTF-8
190
+ string: ''
191
+ http_version:
192
+ recorded_at: Wed, 18 Mar 2015 20:28:25 GMT
193
+ recorded_with: VCR 2.9.3