restforce-db 0.5.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +77 -21
- data/lib/restforce/db.rb +6 -0
- data/lib/restforce/db/associations/active_record.rb +1 -1
- data/lib/restforce/db/attribute_map.rb +5 -1
- data/lib/restforce/db/dsl.rb +80 -0
- data/lib/restforce/db/initializer.rb +3 -2
- data/lib/restforce/db/mapping.rb +20 -77
- data/lib/restforce/db/model.rb +7 -4
- data/lib/restforce/db/registry.rb +62 -0
- data/lib/restforce/db/strategies/always.rb +38 -0
- data/lib/restforce/db/strategies/passive.rb +37 -0
- data/lib/restforce/db/strategy.rb +25 -0
- data/lib/restforce/db/version.rb +1 -1
- data/test/cassettes/Restforce_DB_Initializer/_run/given_an_existing_Salesforce_record/{for_a_non-root_mapping → for_a_Passive_strategy}/does_not_create_a_database_record.yml +20 -20
- data/test/cassettes/Restforce_DB_Initializer/_run/given_an_existing_Salesforce_record/for_an_Always_strategy/creates_a_matching_database_record.yml +159 -0
- data/test/cassettes/Restforce_DB_Initializer/_run/given_an_existing_database_record/{for_a_root_mapping → for_an_Always_strategy}/populates_Salesforce_with_the_new_record.yml +44 -43
- data/test/cassettes/{Restforce_DB_Initializer/_run/given_an_existing_Salesforce_record/for_a_root_mapping/creates_a_matching_database_record.yml → Restforce_DB_Strategies_Always/_build_/given_a_Salesforce_record/wants_to_build_a_new_matching_record.yml} +30 -30
- data/test/cassettes/Restforce_DB_Strategies_Always/_build_/given_a_Salesforce_record/with_a_corresponding_database_record/does_not_want_to_build_a_new_record.yml +158 -0
- data/test/lib/restforce/db/associations/active_record_test.rb +6 -6
- data/test/lib/restforce/db/attribute_map_test.rb +5 -1
- data/test/lib/restforce/db/dsl_test.rb +80 -0
- data/test/lib/restforce/db/initializer_test.rb +8 -8
- data/test/lib/restforce/db/mapping_test.rb +7 -17
- data/test/lib/restforce/db/model_test.rb +8 -9
- data/test/lib/restforce/db/record_types/active_record_test.rb +10 -6
- data/test/lib/restforce/db/registry_test.rb +43 -0
- data/test/lib/restforce/db/strategies/always_test.rb +38 -0
- data/test/lib/restforce/db/strategies/passive_test.rb +17 -0
- data/test/lib/restforce/db/strategy_test.rb +19 -0
- data/test/support/utilities.rb +7 -9
- metadata +17 -5
@@ -0,0 +1,62 @@
|
|
1
|
+
module Restforce
|
2
|
+
|
3
|
+
module DB
|
4
|
+
|
5
|
+
# Restforce::DB::Registry is responsible for keeping track of all mappings
|
6
|
+
# established in the system.
|
7
|
+
class Registry
|
8
|
+
|
9
|
+
extend Enumerable
|
10
|
+
|
11
|
+
# Public: Get the Restforce::DB::Mapping entry for the specified model.
|
12
|
+
#
|
13
|
+
# model - A String or Class.
|
14
|
+
#
|
15
|
+
# Returns a Restforce::DB::Mapping.
|
16
|
+
def self.[](model)
|
17
|
+
@collection[model]
|
18
|
+
end
|
19
|
+
|
20
|
+
# Public: Iterate through all registered Restforce::DB::Mappings.
|
21
|
+
#
|
22
|
+
# Yields one Mapping for each database-to-Salesforce mapping.
|
23
|
+
# Returns nothing.
|
24
|
+
def self.each
|
25
|
+
@collection.each do |model, mappings|
|
26
|
+
# Since each mapping is inserted twice, we ignore the half which
|
27
|
+
# were inserted via Salesforce model names.
|
28
|
+
next unless model.is_a?(Class)
|
29
|
+
|
30
|
+
mappings.each do |mapping|
|
31
|
+
yield mapping
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# Public: Add a mapping to the overarching Mapping collection. Appends
|
37
|
+
# the mapping to the collection for both its database and salesforce
|
38
|
+
# object types.
|
39
|
+
#
|
40
|
+
# mapping - A Restforce::DB::Mapping.
|
41
|
+
#
|
42
|
+
# Returns nothing.
|
43
|
+
def self.<<(mapping)
|
44
|
+
[mapping.database_model, mapping.salesforce_model].each do |model|
|
45
|
+
@collection[model] << mapping
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# Public: Clear out any existing registered mappings.
|
50
|
+
#
|
51
|
+
# Returns nothing.
|
52
|
+
def self.clean!
|
53
|
+
@collection = Hash.new { |h, k| h[k] = [] }
|
54
|
+
end
|
55
|
+
|
56
|
+
clean!
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Restforce
|
2
|
+
|
3
|
+
module DB
|
4
|
+
|
5
|
+
module Strategies
|
6
|
+
|
7
|
+
# Restforce::DB::Strategies::Always defines an initialization strategy for
|
8
|
+
# a mapping in which newly-discovered records should always be
|
9
|
+
# synchronized from Salesforce into the database, and vice-versa.
|
10
|
+
class Always
|
11
|
+
|
12
|
+
# Public: Initialize a Restforce::DB::Strategies::Always.
|
13
|
+
def initialize(**_)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Public: Should the passed record be constructed in the other system?
|
17
|
+
#
|
18
|
+
# record - A Restforce::DB::Instances::Base.
|
19
|
+
#
|
20
|
+
# Returns a Boolean.
|
21
|
+
def build?(record)
|
22
|
+
!record.synced?
|
23
|
+
end
|
24
|
+
|
25
|
+
# Public: Is this a passive sync strategy?
|
26
|
+
#
|
27
|
+
# Returns false.
|
28
|
+
def passive?
|
29
|
+
false
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Restforce
|
2
|
+
|
3
|
+
module DB
|
4
|
+
|
5
|
+
module Strategies
|
6
|
+
|
7
|
+
# Restforce::DB::Strategies::Passive defines an initialization strategy
|
8
|
+
# for a mapping in which newly-discovered records should never be
|
9
|
+
# synchronized into the other system. This strategy may be used to prevent
|
10
|
+
# multiple insertion points from existing for a single database record.
|
11
|
+
class Passive
|
12
|
+
|
13
|
+
# Public: Initialize a Restforce::DB::Strategies::Passive.
|
14
|
+
def initialize(**_)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Public: Should the passed record be constructed in the other system?
|
18
|
+
#
|
19
|
+
# Returns false.
|
20
|
+
def build?(_)
|
21
|
+
false
|
22
|
+
end
|
23
|
+
|
24
|
+
# Public: Is this a passive sync strategy?
|
25
|
+
#
|
26
|
+
# Returns true.
|
27
|
+
def passive?
|
28
|
+
true
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Restforce
|
2
|
+
|
3
|
+
module DB
|
4
|
+
|
5
|
+
# Restforce::DB::Strategy is an abstraction for the available
|
6
|
+
# synchronization strategies, and provides a factory method by which to
|
7
|
+
# obtain a strategy by name.
|
8
|
+
class Strategy
|
9
|
+
|
10
|
+
# Public: Get a Strategy by the requested name.
|
11
|
+
#
|
12
|
+
# name - The Symbol or String name of the desired strategy.
|
13
|
+
# options - A Hash of options to pass to the strategy's initializer.
|
14
|
+
#
|
15
|
+
# Returns a Restforce::DB::Strategies instance.
|
16
|
+
def self.for(name, options = {})
|
17
|
+
class_name = "Restforce::DB::Strategies::#{name.to_s.camelize}"
|
18
|
+
class_name.constantize.new(options)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
data/lib/restforce/db/version.rb
CHANGED
@@ -21,10 +21,10 @@ http_interactions:
|
|
21
21
|
message: OK
|
22
22
|
headers:
|
23
23
|
Date:
|
24
|
-
-
|
24
|
+
- Wed, 08 Apr 2015 20:53:27 GMT
|
25
25
|
Set-Cookie:
|
26
|
-
- BrowserId=
|
27
|
-
|
26
|
+
- BrowserId=JiecschETr-qIUUCvn1_3A;Path=/;Domain=.salesforce.com;Expires=Sun,
|
27
|
+
07-Jun-2015 20:53:27 GMT
|
28
28
|
Expires:
|
29
29
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
30
30
|
Pragma:
|
@@ -37,9 +37,9 @@ http_interactions:
|
|
37
37
|
- chunked
|
38
38
|
body:
|
39
39
|
encoding: ASCII-8BIT
|
40
|
-
string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"
|
40
|
+
string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"1428526407882","token_type":"Bearer","instance_url":"https://<host>","signature":"b8JiQgpUdbWK4ZF5QL688+niNH2pYF3BCX6iynboWVI=","access_token":"00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj"}'
|
41
41
|
http_version:
|
42
|
-
recorded_at:
|
42
|
+
recorded_at: Wed, 08 Apr 2015 20:53:26 GMT
|
43
43
|
- request:
|
44
44
|
method: post
|
45
45
|
uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c
|
@@ -52,7 +52,7 @@ http_interactions:
|
|
52
52
|
Content-Type:
|
53
53
|
- application/json
|
54
54
|
Authorization:
|
55
|
-
- OAuth 00D1a000000H3O9!
|
55
|
+
- OAuth 00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj
|
56
56
|
Accept-Encoding:
|
57
57
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
58
58
|
Accept:
|
@@ -63,28 +63,28 @@ http_interactions:
|
|
63
63
|
message: Created
|
64
64
|
headers:
|
65
65
|
Date:
|
66
|
-
-
|
66
|
+
- Wed, 08 Apr 2015 20:53:28 GMT
|
67
67
|
Set-Cookie:
|
68
|
-
- BrowserId=
|
69
|
-
|
68
|
+
- BrowserId=87n8PrMESjOEdEKnA7TnHQ;Path=/;Domain=.salesforce.com;Expires=Sun,
|
69
|
+
07-Jun-2015 20:53:28 GMT
|
70
70
|
Expires:
|
71
71
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
72
72
|
Sforce-Limit-Info:
|
73
|
-
- api-usage=
|
73
|
+
- api-usage=16/15000
|
74
74
|
Location:
|
75
|
-
- "/services/data/v26.0/sobjects/CustomObject__c/
|
75
|
+
- "/services/data/v26.0/sobjects/CustomObject__c/a001a000001LNKUAA4"
|
76
76
|
Content-Type:
|
77
77
|
- application/json;charset=UTF-8
|
78
78
|
Transfer-Encoding:
|
79
79
|
- chunked
|
80
80
|
body:
|
81
81
|
encoding: ASCII-8BIT
|
82
|
-
string: '{"id":"
|
82
|
+
string: '{"id":"a001a000001LNKUAA4","success":true,"errors":[]}'
|
83
83
|
http_version:
|
84
|
-
recorded_at:
|
84
|
+
recorded_at: Wed, 08 Apr 2015 20:53:27 GMT
|
85
85
|
- request:
|
86
86
|
method: delete
|
87
|
-
uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/
|
87
|
+
uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001LNKUAA4
|
88
88
|
body:
|
89
89
|
encoding: US-ASCII
|
90
90
|
string: ''
|
@@ -92,7 +92,7 @@ http_interactions:
|
|
92
92
|
User-Agent:
|
93
93
|
- Faraday v0.9.1
|
94
94
|
Authorization:
|
95
|
-
- OAuth 00D1a000000H3O9!
|
95
|
+
- OAuth 00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj
|
96
96
|
Accept-Encoding:
|
97
97
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
98
98
|
Accept:
|
@@ -103,17 +103,17 @@ http_interactions:
|
|
103
103
|
message: No Content
|
104
104
|
headers:
|
105
105
|
Date:
|
106
|
-
-
|
106
|
+
- Wed, 08 Apr 2015 20:53:28 GMT
|
107
107
|
Set-Cookie:
|
108
|
-
- BrowserId=
|
109
|
-
|
108
|
+
- BrowserId=fsY3im3GQPqY5-Qq43gYqQ;Path=/;Domain=.salesforce.com;Expires=Sun,
|
109
|
+
07-Jun-2015 20:53:28 GMT
|
110
110
|
Expires:
|
111
111
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
112
112
|
Sforce-Limit-Info:
|
113
|
-
- api-usage=
|
113
|
+
- api-usage=14/15000
|
114
114
|
body:
|
115
115
|
encoding: UTF-8
|
116
116
|
string: ''
|
117
117
|
http_version:
|
118
|
-
recorded_at:
|
118
|
+
recorded_at: Wed, 08 Apr 2015 20:53:27 GMT
|
119
119
|
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,159 @@
|
|
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, 08 Apr 2015 20:53:29 GMT
|
25
|
+
Set-Cookie:
|
26
|
+
- BrowserId=1Rba-SCDStqzgMA__QPBpw;Path=/;Domain=.salesforce.com;Expires=Sun,
|
27
|
+
07-Jun-2015 20:53:29 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":"1428526409339","token_type":"Bearer","instance_url":"https://<host>","signature":"EkDl2eLtEFsBSHRtR+7FoXVgwtAsCzKztj+g9CCKYM4=","access_token":"00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj"}'
|
41
|
+
http_version:
|
42
|
+
recorded_at: Wed, 08 Apr 2015 20:53:28 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":"Custom object","Example_Field__c":"Some sample text"}'
|
49
|
+
headers:
|
50
|
+
User-Agent:
|
51
|
+
- Faraday v0.9.1
|
52
|
+
Content-Type:
|
53
|
+
- application/json
|
54
|
+
Authorization:
|
55
|
+
- OAuth 00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj
|
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, 08 Apr 2015 20:53:29 GMT
|
67
|
+
Set-Cookie:
|
68
|
+
- BrowserId=VRciZJEzSX2oH05IN1gX4A;Path=/;Domain=.salesforce.com;Expires=Sun,
|
69
|
+
07-Jun-2015 20:53:29 GMT
|
70
|
+
Expires:
|
71
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
72
|
+
Sforce-Limit-Info:
|
73
|
+
- api-usage=16/15000
|
74
|
+
Location:
|
75
|
+
- "/services/data/v26.0/sobjects/CustomObject__c/a001a000001LNKZAA4"
|
76
|
+
Content-Type:
|
77
|
+
- application/json;charset=UTF-8
|
78
|
+
Transfer-Encoding:
|
79
|
+
- chunked
|
80
|
+
body:
|
81
|
+
encoding: ASCII-8BIT
|
82
|
+
string: '{"id":"a001a000001LNKZAA4","success":true,"errors":[]}'
|
83
|
+
http_version:
|
84
|
+
recorded_at: Wed, 08 Apr 2015 20:53:28 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
|
88
|
+
body:
|
89
|
+
encoding: US-ASCII
|
90
|
+
string: ''
|
91
|
+
headers:
|
92
|
+
User-Agent:
|
93
|
+
- Faraday v0.9.1
|
94
|
+
Authorization:
|
95
|
+
- OAuth 00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj
|
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, 08 Apr 2015 20:53:29 GMT
|
107
|
+
Set-Cookie:
|
108
|
+
- BrowserId=vu_OtnaVQ7eehu-NXmvR8g;Path=/;Domain=.salesforce.com;Expires=Sun,
|
109
|
+
07-Jun-2015 20:53:29 GMT
|
110
|
+
Expires:
|
111
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
112
|
+
Sforce-Limit-Info:
|
113
|
+
- api-usage=19/15000
|
114
|
+
Content-Type:
|
115
|
+
- application/json;charset=UTF-8
|
116
|
+
Transfer-Encoding:
|
117
|
+
- chunked
|
118
|
+
body:
|
119
|
+
encoding: ASCII-8BIT
|
120
|
+
string: '{"totalSize":2,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/v26.0/sobjects/CustomObject__c/a001a000001LNK5AAO"},"Id":"a001a000001LNK5AAO","SystemModstamp":"2015-04-08T20:49:02.000+0000","Name":"Custom
|
121
|
+
object","Example_Field__c":"Some sample text"},{"attributes":{"type":"CustomObject__c","url":"/services/data/v26.0/sobjects/CustomObject__c/a001a000001LNKZAA4"},"Id":"a001a000001LNKZAA4","SystemModstamp":"2015-04-08T20:53:29.000+0000","Name":"Custom
|
122
|
+
object","Example_Field__c":"Some sample text"}]}'
|
123
|
+
http_version:
|
124
|
+
recorded_at: Wed, 08 Apr 2015 20:53:28 GMT
|
125
|
+
- request:
|
126
|
+
method: delete
|
127
|
+
uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001LNKZAA4
|
128
|
+
body:
|
129
|
+
encoding: US-ASCII
|
130
|
+
string: ''
|
131
|
+
headers:
|
132
|
+
User-Agent:
|
133
|
+
- Faraday v0.9.1
|
134
|
+
Authorization:
|
135
|
+
- OAuth 00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj
|
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, 08 Apr 2015 20:53:29 GMT
|
147
|
+
Set-Cookie:
|
148
|
+
- BrowserId=uqjP8hajTyaFAZMDFHLcVw;Path=/;Domain=.salesforce.com;Expires=Sun,
|
149
|
+
07-Jun-2015 20:53:29 GMT
|
150
|
+
Expires:
|
151
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
152
|
+
Sforce-Limit-Info:
|
153
|
+
- api-usage=16/15000
|
154
|
+
body:
|
155
|
+
encoding: UTF-8
|
156
|
+
string: ''
|
157
|
+
http_version:
|
158
|
+
recorded_at: Wed, 08 Apr 2015 20:53:29 GMT
|
159
|
+
recorded_with: VCR 2.9.3
|
@@ -21,10 +21,10 @@ http_interactions:
|
|
21
21
|
message: OK
|
22
22
|
headers:
|
23
23
|
Date:
|
24
|
-
-
|
24
|
+
- Wed, 08 Apr 2015 20:53:25 GMT
|
25
25
|
Set-Cookie:
|
26
|
-
- BrowserId=
|
27
|
-
|
26
|
+
- BrowserId=MVrwgYrpSkyS5UR2AOGaqA;Path=/;Domain=.salesforce.com;Expires=Sun,
|
27
|
+
07-Jun-2015 20:53:25 GMT
|
28
28
|
Expires:
|
29
29
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
30
30
|
Pragma:
|
@@ -37,9 +37,9 @@ http_interactions:
|
|
37
37
|
- chunked
|
38
38
|
body:
|
39
39
|
encoding: ASCII-8BIT
|
40
|
-
string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"
|
40
|
+
string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"1428526405467","token_type":"Bearer","instance_url":"https://<host>","signature":"OEgzQsng5CO8Wa/V0dQOeL0zD2ham3GXI8NLXyS1IwU=","access_token":"00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj"}'
|
41
41
|
http_version:
|
42
|
-
recorded_at:
|
42
|
+
recorded_at: Wed, 08 Apr 2015 20:53:24 GMT
|
43
43
|
- request:
|
44
44
|
method: get
|
45
45
|
uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20Example_Field__c%20from%20CustomObject__c
|
@@ -50,7 +50,7 @@ http_interactions:
|
|
50
50
|
User-Agent:
|
51
51
|
- Faraday v0.9.1
|
52
52
|
Authorization:
|
53
|
-
- OAuth 00D1a000000H3O9!
|
53
|
+
- OAuth 00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj
|
54
54
|
Accept-Encoding:
|
55
55
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
56
56
|
Accept:
|
@@ -61,23 +61,24 @@ http_interactions:
|
|
61
61
|
message: OK
|
62
62
|
headers:
|
63
63
|
Date:
|
64
|
-
-
|
64
|
+
- Wed, 08 Apr 2015 20:53:25 GMT
|
65
65
|
Set-Cookie:
|
66
|
-
- BrowserId=
|
67
|
-
|
66
|
+
- BrowserId=LbRZpgmdSlKNUc7AOC_poQ;Path=/;Domain=.salesforce.com;Expires=Sun,
|
67
|
+
07-Jun-2015 20:53:25 GMT
|
68
68
|
Expires:
|
69
69
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
70
70
|
Sforce-Limit-Info:
|
71
|
-
- api-usage=
|
71
|
+
- api-usage=14/15000
|
72
72
|
Content-Type:
|
73
73
|
- application/json;charset=UTF-8
|
74
74
|
Transfer-Encoding:
|
75
75
|
- chunked
|
76
76
|
body:
|
77
77
|
encoding: ASCII-8BIT
|
78
|
-
string: '{"totalSize":
|
78
|
+
string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/v26.0/sobjects/CustomObject__c/a001a000001LNK5AAO"},"Id":"a001a000001LNK5AAO","SystemModstamp":"2015-04-08T20:49:02.000+0000","Name":"Custom
|
79
|
+
object","Example_Field__c":"Some sample text"}]}'
|
79
80
|
http_version:
|
80
|
-
recorded_at:
|
81
|
+
recorded_at: Wed, 08 Apr 2015 20:53:24 GMT
|
81
82
|
- request:
|
82
83
|
method: post
|
83
84
|
uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c
|
@@ -90,7 +91,7 @@ http_interactions:
|
|
90
91
|
Content-Type:
|
91
92
|
- application/json
|
92
93
|
Authorization:
|
93
|
-
- OAuth 00D1a000000H3O9!
|
94
|
+
- OAuth 00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj
|
94
95
|
Accept-Encoding:
|
95
96
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
96
97
|
Accept:
|
@@ -101,28 +102,28 @@ http_interactions:
|
|
101
102
|
message: Created
|
102
103
|
headers:
|
103
104
|
Date:
|
104
|
-
-
|
105
|
+
- Wed, 08 Apr 2015 20:53:25 GMT
|
105
106
|
Set-Cookie:
|
106
|
-
- BrowserId=
|
107
|
-
|
107
|
+
- BrowserId=Ic2SY4LjRu2X8ZR58FJqIQ;Path=/;Domain=.salesforce.com;Expires=Sun,
|
108
|
+
07-Jun-2015 20:53:25 GMT
|
108
109
|
Expires:
|
109
110
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
110
111
|
Sforce-Limit-Info:
|
111
|
-
- api-usage=
|
112
|
+
- api-usage=14/15000
|
112
113
|
Location:
|
113
|
-
- "/services/data/v26.0/sobjects/CustomObject__c/
|
114
|
+
- "/services/data/v26.0/sobjects/CustomObject__c/a001a000001LNKPAA4"
|
114
115
|
Content-Type:
|
115
116
|
- application/json;charset=UTF-8
|
116
117
|
Transfer-Encoding:
|
117
118
|
- chunked
|
118
119
|
body:
|
119
120
|
encoding: ASCII-8BIT
|
120
|
-
string: '{"id":"
|
121
|
+
string: '{"id":"a001a000001LNKPAA4","success":true,"errors":[]}'
|
121
122
|
http_version:
|
122
|
-
recorded_at:
|
123
|
+
recorded_at: Wed, 08 Apr 2015 20:53:24 GMT
|
123
124
|
- request:
|
124
125
|
method: get
|
125
|
-
uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20Example_Field__c%20from%20CustomObject__c%20where%20Id%20=%20%
|
126
|
+
uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20Example_Field__c%20from%20CustomObject__c%20where%20Id%20=%20%27a001a000001LNKPAA4%27
|
126
127
|
body:
|
127
128
|
encoding: US-ASCII
|
128
129
|
string: ''
|
@@ -130,7 +131,7 @@ http_interactions:
|
|
130
131
|
User-Agent:
|
131
132
|
- Faraday v0.9.1
|
132
133
|
Authorization:
|
133
|
-
- OAuth 00D1a000000H3O9!
|
134
|
+
- OAuth 00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj
|
134
135
|
Accept-Encoding:
|
135
136
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
136
137
|
Accept:
|
@@ -141,27 +142,27 @@ http_interactions:
|
|
141
142
|
message: OK
|
142
143
|
headers:
|
143
144
|
Date:
|
144
|
-
-
|
145
|
+
- Wed, 08 Apr 2015 20:53:26 GMT
|
145
146
|
Set-Cookie:
|
146
|
-
- BrowserId=
|
147
|
-
|
147
|
+
- BrowserId=Bkc435clQh29F-VlM4C4tw;Path=/;Domain=.salesforce.com;Expires=Sun,
|
148
|
+
07-Jun-2015 20:53:26 GMT
|
148
149
|
Expires:
|
149
150
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
150
151
|
Sforce-Limit-Info:
|
151
|
-
- api-usage=
|
152
|
+
- api-usage=14/15000
|
152
153
|
Content-Type:
|
153
154
|
- application/json;charset=UTF-8
|
154
155
|
Transfer-Encoding:
|
155
156
|
- chunked
|
156
157
|
body:
|
157
158
|
encoding: ASCII-8BIT
|
158
|
-
string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/v26.0/sobjects/CustomObject__c/
|
159
|
+
string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/v26.0/sobjects/CustomObject__c/a001a000001LNKPAA4"},"Id":"a001a000001LNKPAA4","SystemModstamp":"2015-04-08T20:53:25.000+0000","Name":"Custom
|
159
160
|
object","Example_Field__c":"Some sample text"}]}'
|
160
161
|
http_version:
|
161
|
-
recorded_at:
|
162
|
+
recorded_at: Wed, 08 Apr 2015 20:53:25 GMT
|
162
163
|
- request:
|
163
164
|
method: get
|
164
|
-
uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20Example_Field__c%20from%20CustomObject__c%20where%20Id%20=%20%
|
165
|
+
uri: https://<host>/services/data/v26.0/query?q=select%20Id,%20SystemModstamp,%20Name,%20Example_Field__c%20from%20CustomObject__c%20where%20Id%20=%20%27a001a000001LNKPAA4%27
|
165
166
|
body:
|
166
167
|
encoding: US-ASCII
|
167
168
|
string: ''
|
@@ -169,7 +170,7 @@ http_interactions:
|
|
169
170
|
User-Agent:
|
170
171
|
- Faraday v0.9.1
|
171
172
|
Authorization:
|
172
|
-
- OAuth 00D1a000000H3O9!
|
173
|
+
- OAuth 00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj
|
173
174
|
Accept-Encoding:
|
174
175
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
175
176
|
Accept:
|
@@ -180,27 +181,27 @@ http_interactions:
|
|
180
181
|
message: OK
|
181
182
|
headers:
|
182
183
|
Date:
|
183
|
-
-
|
184
|
+
- Wed, 08 Apr 2015 20:53:26 GMT
|
184
185
|
Set-Cookie:
|
185
|
-
- BrowserId=
|
186
|
-
|
186
|
+
- BrowserId=33Nt22geS02sk9_Vh5SZdA;Path=/;Domain=.salesforce.com;Expires=Sun,
|
187
|
+
07-Jun-2015 20:53:26 GMT
|
187
188
|
Expires:
|
188
189
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
189
190
|
Sforce-Limit-Info:
|
190
|
-
- api-usage=
|
191
|
+
- api-usage=14/15000
|
191
192
|
Content-Type:
|
192
193
|
- application/json;charset=UTF-8
|
193
194
|
Transfer-Encoding:
|
194
195
|
- chunked
|
195
196
|
body:
|
196
197
|
encoding: ASCII-8BIT
|
197
|
-
string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/v26.0/sobjects/CustomObject__c/
|
198
|
+
string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/v26.0/sobjects/CustomObject__c/a001a000001LNKPAA4"},"Id":"a001a000001LNKPAA4","SystemModstamp":"2015-04-08T20:53:25.000+0000","Name":"Custom
|
198
199
|
object","Example_Field__c":"Some sample text"}]}'
|
199
200
|
http_version:
|
200
|
-
recorded_at:
|
201
|
+
recorded_at: Wed, 08 Apr 2015 20:53:25 GMT
|
201
202
|
- request:
|
202
203
|
method: delete
|
203
|
-
uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/
|
204
|
+
uri: https://<host>/services/data/v26.0/sobjects/CustomObject__c/a001a000001LNKPAA4
|
204
205
|
body:
|
205
206
|
encoding: US-ASCII
|
206
207
|
string: ''
|
@@ -208,7 +209,7 @@ http_interactions:
|
|
208
209
|
User-Agent:
|
209
210
|
- Faraday v0.9.1
|
210
211
|
Authorization:
|
211
|
-
- OAuth 00D1a000000H3O9!
|
212
|
+
- OAuth 00D1a000000H3O9!AQ4AQNyTp4z9oP2.J3Cn7NYTEhEEQDKps55QWmUhH0v3eAk6P1DoAUmVHKUnCITNabWF1iOMeT46TMEQTZdyM7pnT5JNIYfj
|
212
213
|
Accept-Encoding:
|
213
214
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
214
215
|
Accept:
|
@@ -219,17 +220,17 @@ http_interactions:
|
|
219
220
|
message: No Content
|
220
221
|
headers:
|
221
222
|
Date:
|
222
|
-
-
|
223
|
+
- Wed, 08 Apr 2015 20:53:26 GMT
|
223
224
|
Set-Cookie:
|
224
|
-
- BrowserId=
|
225
|
-
|
225
|
+
- BrowserId=_9uvGvwdSwWIqZVgdLOdAw;Path=/;Domain=.salesforce.com;Expires=Sun,
|
226
|
+
07-Jun-2015 20:53:26 GMT
|
226
227
|
Expires:
|
227
228
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
228
229
|
Sforce-Limit-Info:
|
229
|
-
- api-usage=
|
230
|
+
- api-usage=15/15000
|
230
231
|
body:
|
231
232
|
encoding: UTF-8
|
232
233
|
string: ''
|
233
234
|
http_version:
|
234
|
-
recorded_at:
|
235
|
+
recorded_at: Wed, 08 Apr 2015 20:53:25 GMT
|
235
236
|
recorded_with: VCR 2.9.3
|