my_john_deere_api 0.12.4 → 0.12.6

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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/lib/my_john_deere_api/client.rb +10 -3
  3. data/lib/my_john_deere_api/model/contribution_product.rb +24 -0
  4. data/lib/my_john_deere_api/model/field.rb +1 -1
  5. data/lib/my_john_deere_api/model/organization.rb +1 -1
  6. data/lib/my_john_deere_api/model.rb +1 -0
  7. data/lib/my_john_deere_api/request/collection/asset_locations.rb +2 -2
  8. data/lib/my_john_deere_api/request/collection/assets.rb +2 -2
  9. data/lib/my_john_deere_api/request/collection/contribution_products.rb +26 -0
  10. data/lib/my_john_deere_api/request/collection.rb +1 -0
  11. data/lib/my_john_deere_api/request/individual/contribution_product.rb +19 -0
  12. data/lib/my_john_deere_api/request/individual.rb +3 -2
  13. data/lib/my_john_deere_api/version.rb +1 -1
  14. data/test/lib/my_john_deere_api/authorize_test.rb +6 -6
  15. data/test/lib/my_john_deere_api/client_test.rb +31 -70
  16. data/test/lib/my_john_deere_api/consumer_test.rb +14 -14
  17. data/test/lib/my_john_deere_api/model/asset_location_test.rb +8 -23
  18. data/test/lib/my_john_deere_api/model/asset_test.rb +6 -9
  19. data/test/lib/my_john_deere_api/model/base_test.rb +3 -4
  20. data/test/lib/my_john_deere_api/model/contribution_product_test.rb +68 -0
  21. data/test/lib/my_john_deere_api/model/field_test.rb +8 -11
  22. data/test/lib/my_john_deere_api/model/flag_test.rb +1 -1
  23. data/test/lib/my_john_deere_api/model/organization_test.rb +19 -22
  24. data/test/lib/my_john_deere_api/model_test.rb +4 -0
  25. data/test/lib/my_john_deere_api/request/collection/asset_locations_test.rb +9 -48
  26. data/test/lib/my_john_deere_api/request/collection/assets_test.rb +9 -31
  27. data/test/lib/my_john_deere_api/request/collection/base_test.rb +2 -5
  28. data/test/lib/my_john_deere_api/request/collection/contribution_products_test.rb +88 -0
  29. data/test/lib/my_john_deere_api/request/collection/fields_test.rb +4 -12
  30. data/test/lib/my_john_deere_api/request/collection/flags_test.rb +5 -19
  31. data/test/lib/my_john_deere_api/request/collection/organizations_test.rb +2 -4
  32. data/test/lib/my_john_deere_api/request/collection_test.rb +4 -0
  33. data/test/lib/my_john_deere_api/request/create/asset_location_test.rb +20 -50
  34. data/test/lib/my_john_deere_api/request/create/asset_test.rb +10 -24
  35. data/test/lib/my_john_deere_api/request/create/base_test.rb +0 -2
  36. data/test/lib/my_john_deere_api/request/individual/asset_test.rb +0 -3
  37. data/test/lib/my_john_deere_api/request/individual/base_test.rb +0 -3
  38. data/test/lib/my_john_deere_api/request/individual/contribution_product_test.rb +32 -0
  39. data/test/lib/my_john_deere_api/request/individual_test.rb +4 -0
  40. data/test/support/helper.rb +56 -5
  41. data/test/support/vcr/catalog.yml +51 -7
  42. data/test/support/vcr/delete_asset.yml +51 -10
  43. data/test/support/vcr/get_access_token.yml +8 -8
  44. data/test/support/vcr/get_asset.yml +107 -10
  45. data/test/support/vcr/get_asset_locations.yml +154 -17
  46. data/test/support/vcr/get_assets.yml +110 -10
  47. data/test/support/vcr/get_contribution_product.yml +91 -0
  48. data/test/support/vcr/get_contribution_products.yml +91 -0
  49. data/test/support/vcr/get_fields.yml +108 -11
  50. data/test/support/vcr/get_flags.yml +11 -11
  51. data/test/support/vcr/get_organization.yml +90 -0
  52. data/test/support/vcr/get_organizations.yml +73 -30
  53. data/test/support/vcr/get_request_token.yml +14 -14
  54. data/test/support/vcr/post_asset_locations.yml +165 -20
  55. data/test/support/vcr/post_assets.yml +119 -22
  56. data/test/support/vcr/{app_consumer.yml → url.yml} +7 -7
  57. data/test/support/vcr/warning.txt +24 -0
  58. data/test/support/vcr_setup.rb +420 -0
  59. metadata +14 -4
  60. data/test/support/vcr/post_flag_categories.yml +0 -49
@@ -7,44 +7,10 @@ describe 'MyJohnDeereApi::Request::Create::AssetLocation' do
7
7
  attributes.reject{|k,v| keys.include?(k)}
8
8
  end
9
9
 
10
- let(:client) { JD::Client.new(API_KEY, API_SECRET, environment: :sandbox, access: [ACCESS_TOKEN, ACCESS_SECRET]) }
11
- let(:accessor) { VCR.use_cassette('catalog') { client.send(:accessor) } }
12
-
13
- let(:asset_id) { ENV['ASSET_ID'] }
14
- let(:timestamp) { DateTime.parse(timestamp_string) }
15
- let(:timestamp_string) { '2020-01-21T10:49:00Z' }
16
- let(:coordinates) { [-103.115633, 41.670166] }
17
-
18
- let(:geometry) do
19
- {
20
- type: 'Feature',
21
- geometry: {
22
- geometries: [
23
- coordinates: coordinates,
24
- type: 'Point'
25
- ],
26
- type: 'GeometryCollection'
27
- }
28
- }
29
- end
30
-
31
- let(:measurement_data) do
32
- [
33
- {
34
- name: 'Temperature',
35
- value: '68.0',
36
- unit: 'F'
37
- }
38
- ]
39
- end
40
-
41
10
  let(:valid_attributes) do
42
- {
43
- asset_id: asset_id,
44
- timestamp: timestamp,
45
- geometry: geometry,
46
- measurement_data: measurement_data
47
- }
11
+ CONFIG.asset_location_attributes.merge(
12
+ asset_id: asset_id
13
+ )
48
14
  end
49
15
 
50
16
  let(:attributes) { valid_attributes }
@@ -67,12 +33,13 @@ describe 'MyJohnDeereApi::Request::Create::AssetLocation' do
67
33
  it 'accepts simple coordinates and generates the geometry' do
68
34
  attributes = {
69
35
  asset_id: asset_id,
70
- timestamp: timestamp,
71
- coordinates: coordinates,
72
- measurement_data: measurement_data
36
+ timestamp: valid_attributes[:timestamp],
37
+ coordinates: CONFIG.coordinates,
38
+ measurement_data: valid_attributes[:measurement_data]
73
39
  }
74
40
 
75
- assert_equal geometry.to_json, object.attributes[:geometry]
41
+ object = JD::Request::Create::AssetLocation.new(accessor, attributes)
42
+ assert_equal valid_attributes[:geometry].to_json, object.attributes[:geometry]
76
43
  end
77
44
 
78
45
  it 'defaults timestamp to current time' do
@@ -122,7 +89,7 @@ describe 'MyJohnDeereApi::Request::Create::AssetLocation' do
122
89
  end
123
90
 
124
91
  it 'must include a name' do
125
- without_attr = [measurement_data.first.reject{|k,v| k == :name}]
92
+ without_attr = [attributes[:measurement_data].first.reject{|k,v| k == :name}]
126
93
  object = JD::Request::Create::AssetLocation.new(accessor, attributes.merge(measurement_data: without_attr))
127
94
 
128
95
  refute object.valid?
@@ -130,7 +97,7 @@ describe 'MyJohnDeereApi::Request::Create::AssetLocation' do
130
97
  end
131
98
 
132
99
  it 'must include a value' do
133
- without_attr = [measurement_data.first.reject{|k,v| k == :value}]
100
+ without_attr = [attributes[:measurement_data].first.reject{|k,v| k == :value}]
134
101
  object = JD::Request::Create::AssetLocation.new(accessor, attributes.merge(measurement_data: without_attr))
135
102
 
136
103
  refute object.valid?
@@ -138,7 +105,7 @@ describe 'MyJohnDeereApi::Request::Create::AssetLocation' do
138
105
  end
139
106
 
140
107
  it 'must include a unit' do
141
- without_attr = [measurement_data.first.reject{|k,v| k == :unit}]
108
+ without_attr = [attributes[:measurement_data].first.reject{|k,v| k == :unit}]
142
109
  object = JD::Request::Create::AssetLocation.new(accessor, attributes.merge(measurement_data: without_attr))
143
110
 
144
111
  refute object.valid?
@@ -161,10 +128,12 @@ describe 'MyJohnDeereApi::Request::Create::AssetLocation' do
161
128
  it 'properly forms the request body' do
162
129
  body = object.send(:request_body)
163
130
 
131
+ expected_stamp = DateTime.parse(attributes[:timestamp]).strftime('%Y-%m-%dT%H:%M:%S.000Z')
132
+
164
133
  assert_kind_of Array, body
165
- assert_equal timestamp_string, body.first[:timestamp]
166
- assert_equal geometry.to_json, body.first[:geometry]
167
- assert_equal measurement_data, body.first[:measurementData]
134
+ assert_equal expected_stamp, body.first[:timestamp]
135
+ assert_equal attributes[:geometry], body.first[:geometry]
136
+ assert_equal attributes[:measurement_data], body.first[:measurementData]
168
137
  end
169
138
  end
170
139
 
@@ -184,13 +153,14 @@ describe 'MyJohnDeereApi::Request::Create::AssetLocation' do
184
153
 
185
154
  # API returns seconds with decimals, even though they're always zero
186
155
  integer_stamp = DateTime.parse(result.timestamp).strftime('%Y-%m-%dT%H:%M:%SZ')
156
+ expected_stamp = DateTime.parse(attributes[:timestamp]).strftime('%Y-%m-%dT%H:%M:%SZ')
187
157
 
188
158
  # API returns string keys and an extra '@type' key
189
159
  result_measurement_data = result.measurement_data.first.transform_keys{|k| k.to_sym}.slice(:name, :value, :unit)
190
160
 
191
- assert_equal timestamp_string, integer_stamp
192
- assert_equal geometry.to_json, result.geometry.to_json
193
- assert_equal measurement_data.first, result_measurement_data
161
+ assert_equal expected_stamp, integer_stamp
162
+ assert_equal attributes[:geometry], result.geometry.to_json
163
+ assert_equal attributes[:measurement_data].first, result_measurement_data
194
164
  end
195
165
  end
196
166
  end
@@ -6,25 +6,11 @@ describe 'MyJohnDeereApi::Request::Create::Asset' do
6
6
  attributes.reject{|k,v| keys.include?(k)}
7
7
  end
8
8
 
9
- let(:client) { JD::Client.new(API_KEY, API_SECRET, environment: :sandbox, access: [ACCESS_TOKEN, ACCESS_SECRET]) }
10
- let(:accessor) { VCR.use_cassette('catalog') { client.send(:accessor) } }
11
-
12
- let(:organization_id) { ENV['ORGANIZATION_ID']}
13
- let(:contribution_definition_id) { ENV['CONTRIBUTION_DEFINITION_ID']}
14
- let(:title) { 'i like turtles' }
15
- let(:category) { 'DEVICE' }
16
- let(:type) { 'SENSOR' }
17
- let(:subtype) { 'ENVIRONMENTAL' }
18
-
19
9
  let(:valid_attributes) do
20
- {
10
+ CONFIG.asset_attributes.merge(
21
11
  organization_id: organization_id,
22
12
  contribution_definition_id: contribution_definition_id,
23
- title: title,
24
- asset_category: category,
25
- asset_type: type,
26
- asset_sub_type: subtype,
27
- }
13
+ )
28
14
  end
29
15
 
30
16
  let(:object) { JD::Request::Create::Asset.new(accessor, attributes) }
@@ -155,10 +141,10 @@ describe 'MyJohnDeereApi::Request::Create::Asset' do
155
141
  object = JD::Request::Create::Asset.new(accessor, attributes)
156
142
  body = object.send(:request_body)
157
143
 
158
- assert_equal title, body[:title]
159
- assert_equal category, body[:assetCategory]
160
- assert_equal type, body[:assetType]
161
- assert_equal subtype, body[:assetSubType]
144
+ assert_equal attributes[:title], body[:title]
145
+ assert_equal attributes[:asset_category], body[:assetCategory]
146
+ assert_equal attributes[:asset_type], body[:assetType]
147
+ assert_equal attributes[:asset_sub_type], body[:assetSubType]
162
148
 
163
149
  assert_kind_of Array, body[:links]
164
150
  assert_equal 1, body[:links].size
@@ -189,10 +175,10 @@ describe 'MyJohnDeereApi::Request::Create::Asset' do
189
175
  expected_id = object.response['location'].split('/').last
190
176
 
191
177
  assert_equal expected_id, result.id
192
- assert_equal title, result.title
193
- assert_equal category, result.asset_category
194
- assert_equal type, result.asset_type
195
- assert_equal subtype, result.asset_sub_type
178
+ assert_equal attributes[:title], result.title
179
+ assert_equal attributes[:asset_category], result.asset_category
180
+ assert_equal attributes[:asset_type], result.asset_type
181
+ assert_equal attributes[:asset_sub_type], result.asset_sub_type
196
182
  end
197
183
  end
198
184
  end
@@ -1,8 +1,6 @@
1
1
  require 'support/helper'
2
2
 
3
3
  describe 'MyJohnDeereApi::Request::Create::Base' do
4
- let(:client) { JD::Client.new(API_KEY, API_SECRET, environment: :sandbox, access: [ACCESS_TOKEN, ACCESS_SECRET]) }
5
- let(:accessor) { VCR.use_cassette('catalog') { client.send(:accessor) } }
6
4
  let(:attributes) { {} }
7
5
 
8
6
  describe '#initialize(access_token, attributes)' do
@@ -3,9 +3,6 @@ require 'yaml'
3
3
  require 'json'
4
4
 
5
5
  describe 'MyJohnDeereApi::Request::Individual::Asset' do
6
- let(:asset_id) { '123' }
7
- let(:client) { JD::Client.new(API_KEY, API_SECRET, environment: :sandbox, access: [ACCESS_TOKEN, ACCESS_SECRET]) }
8
- let(:accessor) { VCR.use_cassette('catalog') { client.send(:accessor) } }
9
6
  let(:object) { JD::Request::Individual::Asset.new(accessor, asset_id) }
10
7
 
11
8
  inherits_from JD::Request::Individual::Base
@@ -3,9 +3,6 @@ require 'yaml'
3
3
  require 'json'
4
4
 
5
5
  describe 'MyJohnDeereApi::Request::Individual::Base' do
6
- let(:asset_id) { '123' }
7
- let(:client) { JD::Client.new(API_KEY, API_SECRET, environment: :sandbox, access: [ACCESS_TOKEN, ACCESS_SECRET]) }
8
- let(:accessor) { VCR.use_cassette('catalog') { client.send(:accessor) } }
9
6
  let(:object) { JD::Request::Individual::Base.new(accessor, asset_id) }
10
7
 
11
8
  describe '#initialize(access_token, asset_id)' do
@@ -0,0 +1,32 @@
1
+ require 'support/helper'
2
+ require 'yaml'
3
+ require 'json'
4
+
5
+ describe 'MyJohnDeereApi::Request::Individual::ContributionProduct' do
6
+ let(:object) { JD::Request::Individual::ContributionProduct.new(accessor, contribution_product_id) }
7
+
8
+ inherits_from JD::Request::Individual::Base
9
+
10
+ describe '#initialize(access_token, asset_id)' do
11
+ it 'accepts an access token' do
12
+ assert_equal accessor, object.accessor
13
+ end
14
+
15
+ it 'accepts contribution_product_id as id' do
16
+ assert_equal contribution_product_id, object.id
17
+ end
18
+ end
19
+
20
+ describe '#resource' do
21
+ it 'returns /contributionProducts/<product_id>' do
22
+ assert_equal "/contributionProducts/#{contribution_product_id}", object.resource
23
+ end
24
+ end
25
+
26
+ describe '#object' do
27
+ it 'returns all records' do
28
+ product = VCR.use_cassette('get_contribution_product') { object.object }
29
+ assert_kind_of JD::Model::ContributionProduct, product
30
+ end
31
+ end
32
+ end
@@ -9,5 +9,9 @@ describe 'MyJohnDeereApi::Request::Individual' do
9
9
  it 'loads Request::Individual::Asset' do
10
10
  assert JD::Request::Individual::Asset
11
11
  end
12
+
13
+ it 'loads Request::Individual::ContributionProduct' do
14
+ assert JD::Request::Individual::ContributionProduct
15
+ end
12
16
  end
13
17
  end
@@ -1,10 +1,14 @@
1
1
  require 'rubygems'
2
- require 'vcr'
3
2
  require 'webmock'
4
3
  require 'dotenv/load'
5
4
  require 'minitest/autorun'
5
+ require 'minitest/reporters'
6
6
  require 'my_john_deere_api'
7
7
 
8
+ require 'support/vcr_setup'
9
+
10
+ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => true)]
11
+
8
12
  # shortcut for long module name
9
13
  JD = MyJohnDeereApi
10
14
 
@@ -17,10 +21,7 @@ ACCESS_SECRET = ENV['ACCESS_SECRET']
17
21
  TOKEN_PATTERN = /^[0-9a-z\-]+$/
18
22
  SECRET_PATTERN = /^[0-9A-Za-z\-+=\/]+$/
19
23
 
20
- VCR.configure do |config|
21
- config.cassette_library_dir = 'test/support/vcr'
22
- config.hook_into :webmock
23
- end
24
+ CONFIG = VcrSetup.new
24
25
 
25
26
  class Minitest::Spec
26
27
  class << self
@@ -39,4 +40,54 @@ class Minitest::Spec
39
40
  end
40
41
  end
41
42
  end
43
+
44
+ # Helpers from CONFIG
45
+
46
+ def client
47
+ @_client ||= CONFIG.client
48
+ end
49
+
50
+ def accessor
51
+ @_accessor ||= VCR.use_cassette('catalog') { client.send(:accessor) }
52
+ end
53
+
54
+ def api_key
55
+ CONFIG.api_key
56
+ end
57
+
58
+ def api_secret
59
+ CONFIG.api_secret
60
+ end
61
+
62
+ def access_token
63
+ CONFIG.access_token
64
+ end
65
+
66
+ def access_secret
67
+ CONFIG.access_secret
68
+ end
69
+
70
+ def contribution_product_id
71
+ CONFIG.contribution_product_id
72
+ end
73
+
74
+ def contribution_definition_id
75
+ CONFIG.contribution_definition_id
76
+ end
77
+
78
+ def organization_id
79
+ CONFIG.organization_id
80
+ end
81
+
82
+ def asset_id
83
+ CONFIG.asset_id
84
+ end
85
+
86
+ def field_id
87
+ CONFIG.field_id
88
+ end
89
+
90
+ def verify_code
91
+ CONFIG.verify_code
92
+ end
42
93
  end
@@ -14,24 +14,24 @@ http_interactions:
14
14
  User-Agent:
15
15
  - OAuth gem v0.5.4
16
16
  Authorization:
17
- - OAuth oauth_consumer_key="johndeere-wgmADngYCRmfpEbVgSyc709wnyRux5J7PAv8SE7B",
18
- oauth_nonce="3O7ELJDsWLUeJWwOv38z2KBoobVksbYRYDspg7fpMyc", oauth_signature="TL0zdGeZxLQ%2BYKgQDqnZQ%2BBZsJA%3D",
19
- oauth_signature_method="HMAC-SHA1", oauth_timestamp="1578166502", oauth_version="1.0"
17
+ - OAuth oauth_consumer_key="johndeere-0000000000000000000000000000000000000000",
18
+ oauth_nonce="000000000000000000000000000000000000000000", oauth_signature="0000000000000000000000000000",
19
+ oauth_signature_method="HMAC-SHA1", oauth_timestamp="1581028214", oauth_version="1.0"
20
20
  response:
21
21
  status:
22
22
  code: 200
23
23
  message: OK
24
24
  headers:
25
25
  Date:
26
- - Sat, 04 Jan 2020 19:35:04 GMT
26
+ - Fri, 07 Feb 2020 04:29:00 GMT
27
27
  Content-Type:
28
28
  - application/vnd.deere.axiom.v3+json;charset=UTF-8
29
29
  X-Deere-Handling-Server:
30
- - ip-10-214-44-145
30
+ - ip-10-214-45-50
31
31
  X-Frame-Options:
32
32
  - SAMEORIGIN
33
33
  X-Deere-Elapsed-Ms:
34
- - '11'
34
+ - '18'
35
35
  Cache-Control:
36
36
  - no-store
37
37
  Content-Language:
@@ -42,5 +42,49 @@ http_interactions:
42
42
  encoding: ASCII-8BIT
43
43
  string: '{"@type":"ApiCatalog","links":[{"@type":"Link","rel":"oauthRequestToken","uri":"https://sandboxapi.deere.com/platform/oauth/request_token"},{"@type":"Link","rel":"oauthAuthorizeRequestToken","uri":"https://my.deere.com/consentToUseOfData?oauth_token={token}"},{"@type":"Link","rel":"oauthAccessToken","uri":"https://sandboxapi.deere.com/platform/oauth/access_token"},{"@type":"Link","rel":"agencies","uri":"https://sandboxapi.deere.com/platform/agencies"}]}'
44
44
  http_version:
45
- recorded_at: Sat, 04 Jan 2020 19:35:04 GMT
45
+ recorded_at: Fri, 07 Feb 2020 04:29:00 GMT
46
+ - request:
47
+ method: get
48
+ uri: https://sandboxapi.deere.com/platform/
49
+ body:
50
+ encoding: US-ASCII
51
+ string: ''
52
+ headers:
53
+ Accept:
54
+ - application/vnd.deere.axiom.v3+json
55
+ Accept-Encoding:
56
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
57
+ User-Agent:
58
+ - OAuth gem v0.5.4
59
+ Authorization:
60
+ - OAuth oauth_consumer_key="johndeere-0000000000000000000000000000000000000000",
61
+ oauth_nonce="000000000000000000000000000000000000000000", oauth_signature="0000000000000000000000000000",
62
+ oauth_signature_method="HMAC-SHA1", oauth_timestamp="1581028214", oauth_token="00000000-0000-0000-0000-000000000000",
63
+ oauth_version="1.0"
64
+ response:
65
+ status:
66
+ code: 200
67
+ message: OK
68
+ headers:
69
+ Date:
70
+ - Fri, 07 Feb 2020 04:29:01 GMT
71
+ Content-Type:
72
+ - application/vnd.deere.axiom.v3+json;charset=UTF-8
73
+ X-Deere-Handling-Server:
74
+ - ip-10-214-45-50
75
+ X-Frame-Options:
76
+ - SAMEORIGIN
77
+ X-Deere-Elapsed-Ms:
78
+ - '17'
79
+ Cache-Control:
80
+ - no-store
81
+ Content-Language:
82
+ - en-US
83
+ Transfer-Encoding:
84
+ - chunked
85
+ body:
86
+ encoding: ASCII-8BIT
87
+ string: '{"@type":"ApiCatalog","links":[{"@type":"Link","rel":"oauthRequestToken","uri":"https://sandboxapi.deere.com/platform/oauth/request_token"},{"@type":"Link","rel":"oauthAuthorizeRequestToken","uri":"https://my.deere.com/consentToUseOfData?oauth_token={token}"},{"@type":"Link","rel":"oauthAccessToken","uri":"https://sandboxapi.deere.com/platform/oauth/access_token"},{"@type":"Link","rel":"files","uri":"https://sandboxapi.deere.com/platform/files"},{"@type":"Link","rel":"fileTransfers","uri":"https://sandboxapi.deere.com/platform/fileTransfers"},{"@type":"Link","rel":"currentUser","uri":"https://sandboxapi.deere.com/platform/users/@currentUser"},{"@type":"Link","rel":"organizations","uri":"https://sandboxapi.deere.com/platform/organizations"},{"@type":"Link","rel":"currentToken","uri":"https://sandboxapi.deere.com/platform/oauthTokens/@currentToken"},{"@type":"Link","rel":"contributionProducts","uri":"https://sandboxapi.deere.com/platform/contributionProducts"},{"@type":"Link","rel":"contributionDefinitions","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions"},{"@type":"Link","rel":"assetCatalog","uri":"https://sandboxapi.deere.com/platform/assetCatalog"},{"@type":"Link","rel":"agencies","uri":"https://sandboxapi.deere.com/platform/agencies"}]}'
88
+ http_version:
89
+ recorded_at: Fri, 07 Feb 2020 04:29:01 GMT
46
90
  recorded_with: VCR 5.0.0
@@ -1,24 +1,65 @@
1
1
  ---
2
2
  http_interactions:
3
3
  - request:
4
- method: delete
5
- uri: https://sandboxapi.deere.com/platform/assets/123
4
+ method: get
5
+ uri: https://sandboxapi.deere.com/platform/
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  Accept:
11
11
  - application/vnd.deere.axiom.v3+json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ User-Agent:
15
+ - OAuth gem v0.5.4
16
+ Authorization:
17
+ - OAuth oauth_consumer_key="johndeere-0000000000000000000000000000000000000000",
18
+ oauth_nonce="000000000000000000000000000000000000000000", oauth_signature="0000000000000000000000000000",
19
+ oauth_signature_method="HMAC-SHA1", oauth_timestamp="1581028214", oauth_version="1.0"
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Fri, 07 Feb 2020 04:30:24 GMT
12
27
  Content-Type:
28
+ - application/vnd.deere.axiom.v3+json;charset=UTF-8
29
+ X-Deere-Handling-Server:
30
+ - ip-10-214-45-137
31
+ X-Frame-Options:
32
+ - SAMEORIGIN
33
+ X-Deere-Elapsed-Ms:
34
+ - '8'
35
+ Cache-Control:
36
+ - no-store
37
+ Content-Language:
38
+ - en-US
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: ASCII-8BIT
43
+ string: '{"@type":"ApiCatalog","links":[{"@type":"Link","rel":"oauthRequestToken","uri":"https://sandboxapi.deere.com/platform/oauth/request_token"},{"@type":"Link","rel":"oauthAuthorizeRequestToken","uri":"https://my.deere.com/consentToUseOfData?oauth_token={token}"},{"@type":"Link","rel":"oauthAccessToken","uri":"https://sandboxapi.deere.com/platform/oauth/access_token"},{"@type":"Link","rel":"agencies","uri":"https://sandboxapi.deere.com/platform/agencies"}]}'
44
+ http_version:
45
+ recorded_at: Fri, 07 Feb 2020 04:30:25 GMT
46
+ - request:
47
+ method: delete
48
+ uri: https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000
49
+ body:
50
+ encoding: US-ASCII
51
+ string: ''
52
+ headers:
53
+ Accept:
13
54
  - application/vnd.deere.axiom.v3+json
14
55
  Accept-Encoding:
15
56
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
57
  User-Agent:
17
58
  - OAuth gem v0.5.4
18
59
  Authorization:
19
- - OAuth oauth_consumer_key="johndeere-wgmADngYCRmfpEbVgSyc709wnyRux5J7PAv8SE7B",
20
- oauth_nonce="AqcnS0Io0fZd7gvtQWVTN0iXcS3htLzQwz6eYcv4g", oauth_signature="wQO6f89KmUaWXpdqqokQ6K%2BsrNM%3D",
21
- oauth_signature_method="HMAC-SHA1", oauth_timestamp="1579742355", oauth_token="47bbb9c9-41a8-4bec-8127-e3c5760af2f6",
60
+ - OAuth oauth_consumer_key="johndeere-0000000000000000000000000000000000000000",
61
+ oauth_nonce="000000000000000000000000000000000000000000", oauth_signature="0000000000000000000000000000",
62
+ oauth_signature_method="HMAC-SHA1", oauth_timestamp="1581028214", oauth_token="00000000-0000-0000-0000-000000000000",
22
63
  oauth_version="1.0"
23
64
  response:
24
65
  status:
@@ -26,16 +67,16 @@ http_interactions:
26
67
  message: No Content
27
68
  headers:
28
69
  Date:
29
- - Thu, 23 Jan 2020 01:19:16 GMT
70
+ - Fri, 07 Feb 2020 04:30:25 GMT
30
71
  X-Deere-Handling-Server:
31
- - ip-10-214-45-242
72
+ - ip-10-214-44-185
32
73
  X-Frame-Options:
33
74
  - SAMEORIGIN
34
75
  X-Deere-Elapsed-Ms:
35
- - '81'
76
+ - '60'
36
77
  body:
37
78
  encoding: UTF-8
38
79
  string: ''
39
- http_version:
40
- recorded_at: Thu, 23 Jan 2020 01:19:16 GMT
80
+ http_version:
81
+ recorded_at: Fri, 07 Feb 2020 04:30:25 GMT
41
82
  recorded_with: VCR 5.0.0
@@ -14,9 +14,9 @@ http_interactions:
14
14
  User-Agent:
15
15
  - OAuth gem v0.5.4
16
16
  Authorization:
17
- - OAuth oauth_consumer_key="johndeere-wgmADngYCRmfpEbVgSyc709wnyRux5J7PAv8SE7B",
18
- oauth_nonce="MLB5WFGhx3XqZSEqSLLMqN0rmZzVrpIcJifmmkHY", oauth_signature="EQuzjWYlzL2BdLApWuDmSIGWsuU%3D",
19
- oauth_signature_method="HMAC-SHA1", oauth_timestamp="1578342382", oauth_token="e9d13b08-0c49-412c-8d65-b705b2a6172a",
17
+ - OAuth oauth_consumer_key="johndeere-0000000000000000000000000000000000000000",
18
+ oauth_nonce="000000000000000000000000000000000000000000", oauth_signature="0000000000000000000000000000",
19
+ oauth_signature_method="HMAC-SHA1", oauth_timestamp="1581028214", oauth_token="00000000-0000-0000-0000-000000000000",
20
20
  oauth_verifier="VERIFY", oauth_version="1.0"
21
21
  response:
22
22
  status:
@@ -24,18 +24,18 @@ http_interactions:
24
24
  message: OK
25
25
  headers:
26
26
  Date:
27
- - Mon, 06 Jan 2020 20:26:22 GMT
27
+ - Fri, 07 Feb 2020 04:29:27 GMT
28
28
  Content-Type:
29
29
  - text/plain;charset=UTF-8
30
30
  X-Deere-Handling-Server:
31
- - ip-10-214-44-17
31
+ - ip-10-214-45-137
32
32
  Vary:
33
33
  - Accept-Encoding
34
34
  Transfer-Encoding:
35
35
  - chunked
36
36
  body:
37
37
  encoding: ASCII-8BIT
38
- string: oauth_token=47bbb9c9-41a8-4bec-8127-e3c5760af2f6&oauth_token_secret=ih3PKeoCJFbAeHcEpxn6l8cTAaQJSVzzRtemOvekXLGOsQCLUOifPOyQqZSrcYpiBXI3eJ2r0JUaCv79vsxTe1ngvrllBPjveSLg4%2Bsajmk%3D
39
- http_version:
40
- recorded_at: Mon, 06 Jan 2020 20:26:22 GMT
38
+ string: oauth_token=00000000-0000-0000-0000-000000000000&oauth_token_secret=000000000000000000000000000000000000000000
39
+ http_version:
40
+ recorded_at: Fri, 07 Feb 2020 04:29:27 GMT
41
41
  recorded_with: VCR 5.0.0