my_john_deere_api 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae757769e9c3ffe1d9609f7d59864fb139e20d399326903eb01dad46f3b7268f
4
- data.tar.gz: fe95f5060f2cc45706b2e4163825029f12fc27641f0219b6cfdbeb5c777be449
3
+ metadata.gz: c961dfeb403f8aa45346b79eb1144679d3110c05c4f0c338ed54d7e4a77bd2ba
4
+ data.tar.gz: adf929f8f8b16fd3f3ee67443bc0064cf9601fed75070856ed25b7b596d6db96
5
5
  SHA512:
6
- metadata.gz: b2582721a66be028a6dd556cbd15a67c07d52d33bd13851d24f994f548d863e1474c585a7d9b8b1d0aeb308662dfa069fcd75a501c1d555d6d2b294dc20d9447
7
- data.tar.gz: 7005b7c9e9a5125bad9afd5917fc9920f8f18ac7ad5549c595d2cc844172c238742ebbc1c5ccdbad603e16590e2081d12493284a5a18727ee57cb510decdcfba
6
+ metadata.gz: c17a8cc1db1990f52ce3c0eaa0ef8a2ea85f2dd779fa6a5c2508c813e73e050384a54c72206d4357eb32c947d7f57dca765748a0eaaa253696c67ec34ae701f8
7
+ data.tar.gz: 747b1d7d518a7deeccefb5d8f206ca1b2ab3f89bbe0dc40ae4105d5765bff3aa3f297b6835221a7e9a2b6ed624991fd954b9558cc5748a3a581e12aafbc29399
data/README.md CHANGED
@@ -104,11 +104,16 @@ with John Deere, not your user's. But most interactions will involve user data.
104
104
  )
105
105
 
106
106
 
107
- #### Arbitrary GET requests
107
+ ### Direct API Requests
108
108
 
109
109
  While the goal of the client is to eliminate the need to make/interpret calls to the John Deere API, it's important
110
110
  to be able to make calls that are not yet fully supported by the client. Or sometimes, you need to troubleshoot.
111
- You can pass any path to the get method, and receive the JSON-parsed response.
111
+
112
+
113
+ #### GET
114
+
115
+
116
+ DELETE requests require only a resource path.
112
117
 
113
118
  client.get('/organizations')
114
119
 
@@ -128,13 +133,12 @@ You can pass any path to the get method, and receive the JSON-parsed response.
128
133
  ]
129
134
  }
130
135
 
131
- This won't provide any client goodies like pagination, validation or weeding out the stuff you don't need (like the nifty client methods).
136
+ This won't provide any client goodies like pagination or validation.
132
137
 
133
138
 
134
- #### Arbitrary POST requests
139
+ #### POST
135
140
 
136
- You can also make arbitrary POST requests. This method takes a required resource path, and a hash for the request body that
137
- the client will convert to JSON.
141
+ POST requests require a resource path, and a hash for the request body. The client camelize the keys, and convert to JSON.
138
142
 
139
143
  client.post(
140
144
  '/organizations/123123/assets',
@@ -153,6 +157,41 @@ the client will convert to JSON.
153
157
  }
154
158
  )
155
159
 
156
- The response for most requests is just an HTTP status code, with no body. If a body is provided, it will be JSON-parsed and returned.
160
+ The response for most requests is just an HTTP status code, with no body. In this case, the entire Net::HTTP response is retruned.
161
+ If a body is provided, it will be JSON-parsed and returned instead of the full response.
162
+
163
+
164
+ #### PUT
165
+
166
+ PUT requests require a resource path, and a hash for the request body. The client camelize the keys, and convert to JSON.
167
+
168
+ client.put(
169
+ '/assets/123123',
170
+ {
171
+ "title"=>"i REALLY like turtles",
172
+ "assetCategory"=>"DEVICE",
173
+ "assetType"=>"SENSOR",
174
+ "assetSubType"=>"ENVIRONMENTAL",
175
+ "links"=>[
176
+ {
177
+ "@type"=>"Link",
178
+ "rel"=>"contributionDefinition",
179
+ "uri"=>"https://sandboxapi.deere.com/platform/contributionDefinitions/CONTRIBUTION_DEFINITION_ID"
180
+ }
181
+ ]
182
+ }
183
+ )
184
+
185
+ John Deere's standard response is a 204 HTTP status code, with the message "No Content". This method returns the full Net::HTTP response.
186
+
187
+
188
+ #### DELETE
189
+
190
+ DELETE requests require only a resource path.
191
+
192
+ client.delete('/assets/123123')
193
+
194
+ John Deere's standard response is a 204 HTTP status code, with the message "No Content". This method returns the full Net::HTTP response.
195
+
157
196
 
158
197
  More details coming soon.
@@ -1,6 +1,7 @@
1
1
  module MyJohnDeereApi
2
2
  class Client
3
3
  include Helpers::EnvironmentHelper
4
+ include Helpers::CaseConversion
4
5
 
5
6
  attr_reader :api_key, :api_secret, :access_token, :access_secret, :environment
6
7
 
@@ -45,14 +46,29 @@ module MyJohnDeereApi
45
46
  end
46
47
 
47
48
  ##
48
- # generic user-specific POST request method that returns JSON
49
+ # generic user-specific POST request method that returns JSON or response
49
50
 
50
51
  def post resource, body
51
52
  resource = resource.to_s
52
53
  resource = "/#{resource}" unless resource =~ /^\//
53
- response = accessor.post(resource, body.to_json, post_headers)
54
+ response = accessor.post(resource, camelize(body).to_json, post_headers)
54
55
 
55
- if response.body.size > 0
56
+ if response.body && response.body.size > 0
57
+ JSON.parse(response.body)
58
+ else
59
+ response
60
+ end
61
+ end
62
+
63
+ ##
64
+ # generic user-specific PUT request method that returns JSON or response
65
+
66
+ def put resource, body
67
+ resource = resource.to_s
68
+ resource = "/#{resource}" unless resource =~ /^\//
69
+ response = accessor.put(resource, camelize(body).to_json, post_headers)
70
+
71
+ if response.body && response.body.size > 0
56
72
  JSON.parse(response.body)
57
73
  else
58
74
  response
@@ -60,7 +76,7 @@ module MyJohnDeereApi
60
76
  end
61
77
 
62
78
  ##
63
- # generic user-specific DELETE request method
79
+ # generic user-specific DELETE request method that returns JSON or response
64
80
 
65
81
  def delete resource
66
82
  resource = resource.to_s
@@ -6,20 +6,32 @@ module MyJohnDeereApi::Helpers::CaseConversion
6
6
  ##
7
7
  # convert a text or camelcase string to underscore
8
8
 
9
- def underscore(string)
10
- string.gsub(/([a-z])([A-Z])/, '\1_\2').gsub(/\s+/, '_').gsub(/_+/, '_').downcase
9
+ def underscore(something)
10
+ something = something.to_s if something.is_a?(Symbol)
11
+
12
+ if something.is_a?(String)
13
+ something.gsub(/([a-z])([A-Z])/, '\1_\2').gsub(/\s+/, '_').gsub(/_+/, '_').downcase
14
+ elsif something.is_a?(Hash)
15
+ something.transform_keys{ |key| underscore(key) }
16
+ end
11
17
  end
12
18
 
13
19
  ##
14
20
  # convert text or underscored string to camelcase
15
21
 
16
- def camelize(string)
17
- list = string.strip.split(/[_\s]+/)
22
+ def camelize(something)
23
+ something = something.to_s if something.is_a?(Symbol)
24
+
25
+ if something.is_a?(String)
26
+ list = something.strip.split(/[_\s]+/)
18
27
 
19
- # preserve case of the first element
20
- new_list = [list.shift]
21
- new_list += list.map(&:capitalize)
28
+ # preserve case of the first element
29
+ new_list = [list.shift]
30
+ new_list += list.map(&:capitalize)
22
31
 
23
- new_list.join('')
32
+ new_list.join('')
33
+ elsif something.is_a?(Hash)
34
+ something.transform_keys{ |key| camelize(key) }
35
+ end
24
36
  end
25
37
  end
@@ -1,3 +1,3 @@
1
1
  module MyJohnDeereApi
2
- VERSION='0.14.0'
2
+ VERSION='0.15.0'
3
3
  end
@@ -1,6 +1,11 @@
1
1
  require 'support/helper'
2
2
 
3
3
  describe 'MyJohnDeereApi::Client' do
4
+ it 'includes the CaseConversion helper' do
5
+ client = JD::Client.new(api_key, api_secret)
6
+ assert_equal 'thisIsATest', client.send(:camelize, :this_is_a_test)
7
+ end
8
+
4
9
  describe '#initialize(api_key, api_secret)' do
5
10
  it 'sets the api key/secret' do
6
11
  client = JD::Client.new(api_key, api_secret)
@@ -60,9 +65,11 @@ describe 'MyJohnDeereApi::Client' do
60
65
  end
61
66
 
62
67
  describe '#post' do
68
+ let(:attributes) { CONFIG.asset_attributes }
69
+
63
70
  it 'returns the response as a Hash' do
64
71
  response = VCR.use_cassette('post_assets') do
65
- client.post("/organizations/#{organization_id}/assets", CONFIG.asset_attributes)
72
+ client.post("/organizations/#{organization_id}/assets", attributes)
66
73
  end
67
74
 
68
75
  assert_equal '201', response.code
@@ -72,7 +79,7 @@ describe 'MyJohnDeereApi::Client' do
72
79
 
73
80
  it 'prepends the leading slash if needed' do
74
81
  response = VCR.use_cassette('post_assets') do
75
- client.post("organizations/#{organization_id}/assets", CONFIG.asset_attributes)
82
+ client.post("organizations/#{organization_id}/assets", attributes)
76
83
  end
77
84
 
78
85
  assert_equal '201', response.code
@@ -81,6 +88,30 @@ describe 'MyJohnDeereApi::Client' do
81
88
  end
82
89
  end
83
90
 
91
+ describe '#put' do
92
+ let(:new_title) { 'i REALLY like turtles!' }
93
+
94
+ let(:attributes) do
95
+ CONFIG.asset_attributes.slice(
96
+ :asset_category, :asset_type, :asset_sub_type, :links
97
+ ).merge(title: new_title)
98
+ end
99
+
100
+ it 'sends the request' do
101
+ response = VCR.use_cassette('put_asset') { client.put("/assets/#{asset_id}", attributes) }
102
+
103
+ assert_equal '204', response.code
104
+ assert_equal 'No Content', response.message
105
+ end
106
+
107
+ it 'prepends the leading slash if needed' do
108
+ response = VCR.use_cassette('put_asset') { client.put("assets/#{asset_id}", attributes) }
109
+
110
+ assert_equal '204', response.code
111
+ assert_equal 'No Content', response.message
112
+ end
113
+ end
114
+
84
115
  describe '#delete' do
85
116
  it 'sends the request' do
86
117
  response = VCR.use_cassette('delete_asset') { client.delete("/assets/#{asset_id}") }
@@ -17,6 +17,23 @@ describe 'Helpers::CaseConversion' do
17
17
  assert_equal 'camel_case_example', string
18
18
  end
19
19
 
20
+ it 'converts from a symbol' do
21
+ string = object.send(:underscore, :camelCaseExample)
22
+ assert_equal 'camel_case_example', string
23
+ end
24
+
25
+ it 'converts the keys of a hash' do
26
+ hash = {
27
+ assetCategory: 'Asset Category',
28
+ assetType: 'Asset Type'
29
+ }
30
+
31
+ new_hash = object.send(:underscore, hash)
32
+
33
+ assert_equal new_hash['asset_category'], hash[:assetCategory]
34
+ assert_equal new_hash['asset_type'], hash[:assetType]
35
+ end
36
+
20
37
  it 'handles leading uppercase' do
21
38
  string = object.send(:underscore, 'CamelCaseExample')
22
39
  assert_equal 'camel_case_example', string
@@ -54,6 +71,23 @@ describe 'Helpers::CaseConversion' do
54
71
  assert_equal 'ThisIsATest', string
55
72
  end
56
73
 
74
+ it 'converts from a symbol' do
75
+ string = object.send(:camelize, :this_is_a_test)
76
+ assert_equal 'thisIsATest', string
77
+ end
78
+
79
+ it 'converts the keys of a hash' do
80
+ hash = {
81
+ asset_category: 'Asset Category',
82
+ asset_type: 'Asset Type'
83
+ }
84
+
85
+ new_hash = object.send(:camelize, hash)
86
+
87
+ assert_equal new_hash['assetCategory'], hash[:asset_category]
88
+ assert_equal new_hash['assetType'], hash[:asset_type]
89
+ end
90
+
57
91
  it 'is a private method' do
58
92
  exception = assert_raises(NoMethodError) { object.camelize('test') }
59
93
  assert_includes exception.message, 'private method'
@@ -23,15 +23,15 @@ http_interactions:
23
23
  message: OK
24
24
  headers:
25
25
  Date:
26
- - Fri, 07 Feb 2020 04:30:24 GMT
26
+ - Fri, 07 Feb 2020 16:22:27 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-45-137
30
+ - ip-10-214-44-185
31
31
  X-Frame-Options:
32
32
  - SAMEORIGIN
33
33
  X-Deere-Elapsed-Ms:
34
- - '8'
34
+ - '14'
35
35
  Cache-Control:
36
36
  - no-store
37
37
  Content-Language:
@@ -42,7 +42,7 @@ 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: Fri, 07 Feb 2020 04:30:25 GMT
45
+ recorded_at: Fri, 07 Feb 2020 16:22:27 GMT
46
46
  - request:
47
47
  method: delete
48
48
  uri: https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000
@@ -67,16 +67,16 @@ http_interactions:
67
67
  message: No Content
68
68
  headers:
69
69
  Date:
70
- - Fri, 07 Feb 2020 04:30:25 GMT
70
+ - Fri, 07 Feb 2020 16:22:27 GMT
71
71
  X-Deere-Handling-Server:
72
- - ip-10-214-44-185
72
+ - ip-10-214-44-252
73
73
  X-Frame-Options:
74
74
  - SAMEORIGIN
75
75
  X-Deere-Elapsed-Ms:
76
- - '60'
76
+ - '59'
77
77
  body:
78
78
  encoding: UTF-8
79
79
  string: ''
80
80
  http_version:
81
- recorded_at: Fri, 07 Feb 2020 04:30:25 GMT
81
+ recorded_at: Fri, 07 Feb 2020 16:22:28 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -23,7 +23,7 @@ http_interactions:
23
23
  message: OK
24
24
  headers:
25
25
  Date:
26
- - Fri, 07 Feb 2020 04:30:02 GMT
26
+ - Fri, 07 Feb 2020 16:22:24 GMT
27
27
  Content-Type:
28
28
  - application/vnd.deere.axiom.v3+json;charset=UTF-8
29
29
  X-Deere-Handling-Server:
@@ -31,7 +31,7 @@ http_interactions:
31
31
  X-Frame-Options:
32
32
  - SAMEORIGIN
33
33
  X-Deere-Elapsed-Ms:
34
- - '8'
34
+ - '19'
35
35
  Cache-Control:
36
36
  - no-store
37
37
  Content-Language:
@@ -42,7 +42,7 @@ 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: Fri, 07 Feb 2020 04:30:03 GMT
45
+ recorded_at: Fri, 07 Feb 2020 16:22:24 GMT
46
46
  - request:
47
47
  method: get
48
48
  uri: https://sandboxapi.deere.com/platform/organizations
@@ -67,15 +67,15 @@ http_interactions:
67
67
  message: OK
68
68
  headers:
69
69
  Date:
70
- - Fri, 07 Feb 2020 04:30:04 GMT
70
+ - Fri, 07 Feb 2020 16:22:25 GMT
71
71
  Content-Type:
72
72
  - application/vnd.deere.axiom.v3+json;charset=UTF-8
73
73
  X-Deere-Handling-Server:
74
- - ip-10-214-45-50
74
+ - ip-10-214-45-97
75
75
  X-Frame-Options:
76
76
  - SAMEORIGIN
77
77
  X-Deere-Elapsed-Ms:
78
- - '174'
78
+ - '151'
79
79
  Cache-Control:
80
80
  - no-store
81
81
  Content-Language:
@@ -96,7 +96,7 @@ http_interactions:
96
96
  Name","type":"customer","member":true,"id":"000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"machines","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines"},{"@type":"Link","rel":"wdtCapableMachines","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines?capability=wdt"},{"@type":"Link","rel":"files","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files"},{"@type":"Link","rel":"transferableFiles","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files?transferable=true"},{"@type":"Link","rel":"uploadFile","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files"},{"@type":"Link","rel":"sendFileToMachine","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fileTransfers"},{"@type":"Link","rel":"addMachine","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines"},{"@type":"Link","rel":"addField","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fields"},{"@type":"Link","rel":"assets","uri":"https://sandboxapi.deere.com/platform/organizations/000000/assets"},{"@type":"Link","rel":"fields","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fields"},{"@type":"Link","rel":"farms","uri":"https://sandboxapi.deere.com/platform/organizations/000000/farms"},{"@type":"Link","rel":"boundaries","uri":"https://sandboxapi.deere.com/platform/organizations/000000/boundaries"},{"@type":"Link","rel":"clients","uri":"https://sandboxapi.deere.com/platform/organizations/000000/clients"},{"@type":"Link","rel":"flags","uri":"https://sandboxapi.deere.com/platform/organizations/000000/flags"},{"@type":"Link","rel":"flagCategory","uri":"https://sandboxapi.deere.com/platform/organizations/000000/flagCategories"},{"@type":"Link","rel":"controllers","uri":"https://sandboxapi.deere.com/platform/organizations/000000/orgController"}]},{"@type":"Organization","name":"Organization
97
97
  Name","type":"customer","member":true,"id":"000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"machines","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines"},{"@type":"Link","rel":"wdtCapableMachines","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines?capability=wdt"},{"@type":"Link","rel":"files","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files"},{"@type":"Link","rel":"transferableFiles","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files?transferable=true"},{"@type":"Link","rel":"uploadFile","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files"},{"@type":"Link","rel":"sendFileToMachine","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fileTransfers"},{"@type":"Link","rel":"addMachine","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines"},{"@type":"Link","rel":"addField","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fields"},{"@type":"Link","rel":"assets","uri":"https://sandboxapi.deere.com/platform/organizations/000000/assets"},{"@type":"Link","rel":"fields","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fields"},{"@type":"Link","rel":"farms","uri":"https://sandboxapi.deere.com/platform/organizations/000000/farms"},{"@type":"Link","rel":"boundaries","uri":"https://sandboxapi.deere.com/platform/organizations/000000/boundaries"},{"@type":"Link","rel":"clients","uri":"https://sandboxapi.deere.com/platform/organizations/000000/clients"},{"@type":"Link","rel":"flags","uri":"https://sandboxapi.deere.com/platform/organizations/000000/flags"},{"@type":"Link","rel":"flagCategory","uri":"https://sandboxapi.deere.com/platform/organizations/000000/flagCategories"},{"@type":"Link","rel":"controllers","uri":"https://sandboxapi.deere.com/platform/organizations/000000/orgController"}]}]}'
98
98
  http_version:
99
- recorded_at: Fri, 07 Feb 2020 04:30:05 GMT
99
+ recorded_at: Fri, 07 Feb 2020 16:22:25 GMT
100
100
  - request:
101
101
  method: get
102
102
  uri: https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000
@@ -121,15 +121,15 @@ http_interactions:
121
121
  message: OK
122
122
  headers:
123
123
  Date:
124
- - Fri, 07 Feb 2020 04:30:05 GMT
124
+ - Fri, 07 Feb 2020 16:22:25 GMT
125
125
  Content-Type:
126
126
  - application/vnd.deere.axiom.v3+json;charset=UTF-8
127
127
  X-Deere-Handling-Server:
128
- - ip-10-214-44-185
128
+ - ip-10-214-45-143
129
129
  X-Frame-Options:
130
130
  - SAMEORIGIN
131
131
  X-Deere-Elapsed-Ms:
132
- - '25'
132
+ - '42'
133
133
  Cache-Control:
134
134
  - no-store
135
135
  Content-Language:
@@ -140,5 +140,5 @@ http_interactions:
140
140
  encoding: ASCII-8BIT
141
141
  string: '{"@type":"ContributedAsset","title":"Asset Title","assetCategory":"DEVICE","assetType":"SENSOR","assetSubType":"ENVIRONMENTAL","lastModifiedDate":"2020-02-06T22:30:14.000Z","id":"00000000-0000-0000-0000-000000000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"contributionDefinition","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"organization","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"locations","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations"},{"@type":"Link","rel":"lastKnownLocation","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations?lastKnown=true"}]}'
142
142
  http_version:
143
- recorded_at: Fri, 07 Feb 2020 04:30:06 GMT
143
+ recorded_at: Fri, 07 Feb 2020 16:22:26 GMT
144
144
  recorded_with: VCR 5.0.0
@@ -23,15 +23,15 @@ http_interactions:
23
23
  message: OK
24
24
  headers:
25
25
  Date:
26
- - Fri, 07 Feb 2020 04:29:56 GMT
26
+ - Fri, 07 Feb 2020 16:22:23 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-45-137
30
+ - ip-10-214-44-84
31
31
  X-Frame-Options:
32
32
  - SAMEORIGIN
33
33
  X-Deere-Elapsed-Ms:
34
- - '10'
34
+ - '17'
35
35
  Cache-Control:
36
36
  - no-store
37
37
  Content-Language:
@@ -42,7 +42,7 @@ 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: Fri, 07 Feb 2020 04:29:56 GMT
45
+ recorded_at: Fri, 07 Feb 2020 16:22:23 GMT
46
46
  - request:
47
47
  method: get
48
48
  uri: https://sandboxapi.deere.com/platform/organizations
@@ -67,7 +67,7 @@ http_interactions:
67
67
  message: OK
68
68
  headers:
69
69
  Date:
70
- - Fri, 07 Feb 2020 04:29:57 GMT
70
+ - Fri, 07 Feb 2020 16:22:23 GMT
71
71
  Content-Type:
72
72
  - application/vnd.deere.axiom.v3+json;charset=UTF-8
73
73
  X-Deere-Handling-Server:
@@ -75,7 +75,7 @@ http_interactions:
75
75
  X-Frame-Options:
76
76
  - SAMEORIGIN
77
77
  X-Deere-Elapsed-Ms:
78
- - '22'
78
+ - '141'
79
79
  Cache-Control:
80
80
  - no-store
81
81
  Content-Language:
@@ -96,7 +96,7 @@ http_interactions:
96
96
  Name","type":"customer","member":true,"id":"000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"machines","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines"},{"@type":"Link","rel":"wdtCapableMachines","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines?capability=wdt"},{"@type":"Link","rel":"files","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files"},{"@type":"Link","rel":"transferableFiles","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files?transferable=true"},{"@type":"Link","rel":"uploadFile","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files"},{"@type":"Link","rel":"sendFileToMachine","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fileTransfers"},{"@type":"Link","rel":"addMachine","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines"},{"@type":"Link","rel":"addField","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fields"},{"@type":"Link","rel":"assets","uri":"https://sandboxapi.deere.com/platform/organizations/000000/assets"},{"@type":"Link","rel":"fields","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fields"},{"@type":"Link","rel":"farms","uri":"https://sandboxapi.deere.com/platform/organizations/000000/farms"},{"@type":"Link","rel":"boundaries","uri":"https://sandboxapi.deere.com/platform/organizations/000000/boundaries"},{"@type":"Link","rel":"clients","uri":"https://sandboxapi.deere.com/platform/organizations/000000/clients"},{"@type":"Link","rel":"flags","uri":"https://sandboxapi.deere.com/platform/organizations/000000/flags"},{"@type":"Link","rel":"flagCategory","uri":"https://sandboxapi.deere.com/platform/organizations/000000/flagCategories"},{"@type":"Link","rel":"controllers","uri":"https://sandboxapi.deere.com/platform/organizations/000000/orgController"}]},{"@type":"Organization","name":"Organization
97
97
  Name","type":"customer","member":true,"id":"000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"machines","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines"},{"@type":"Link","rel":"wdtCapableMachines","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines?capability=wdt"},{"@type":"Link","rel":"files","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files"},{"@type":"Link","rel":"transferableFiles","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files?transferable=true"},{"@type":"Link","rel":"uploadFile","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files"},{"@type":"Link","rel":"sendFileToMachine","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fileTransfers"},{"@type":"Link","rel":"addMachine","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines"},{"@type":"Link","rel":"addField","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fields"},{"@type":"Link","rel":"assets","uri":"https://sandboxapi.deere.com/platform/organizations/000000/assets"},{"@type":"Link","rel":"fields","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fields"},{"@type":"Link","rel":"farms","uri":"https://sandboxapi.deere.com/platform/organizations/000000/farms"},{"@type":"Link","rel":"boundaries","uri":"https://sandboxapi.deere.com/platform/organizations/000000/boundaries"},{"@type":"Link","rel":"clients","uri":"https://sandboxapi.deere.com/platform/organizations/000000/clients"},{"@type":"Link","rel":"flags","uri":"https://sandboxapi.deere.com/platform/organizations/000000/flags"},{"@type":"Link","rel":"flagCategory","uri":"https://sandboxapi.deere.com/platform/organizations/000000/flagCategories"},{"@type":"Link","rel":"controllers","uri":"https://sandboxapi.deere.com/platform/organizations/000000/orgController"}]}]}'
98
98
  http_version:
99
- recorded_at: Fri, 07 Feb 2020 04:29:57 GMT
99
+ recorded_at: Fri, 07 Feb 2020 16:22:23 GMT
100
100
  - request:
101
101
  method: get
102
102
  uri: https://sandboxapi.deere.com/platform/organizations/000000/assets
@@ -121,15 +121,15 @@ http_interactions:
121
121
  message: OK
122
122
  headers:
123
123
  Date:
124
- - Fri, 07 Feb 2020 04:30:02 GMT
124
+ - Fri, 07 Feb 2020 16:22:24 GMT
125
125
  Content-Type:
126
126
  - application/vnd.deere.axiom.v3+json;charset=UTF-8
127
127
  X-Deere-Handling-Server:
128
- - ip-10-214-44-252
128
+ - ip-10-214-44-84
129
129
  X-Frame-Options:
130
130
  - SAMEORIGIN
131
131
  X-Deere-Elapsed-Ms:
132
- - '30'
132
+ - '36'
133
133
  Cache-Control:
134
134
  - no-store
135
135
  Content-Language:
@@ -138,11 +138,15 @@ http_interactions:
138
138
  - chunked
139
139
  body:
140
140
  encoding: ASCII-8BIT
141
- string: '{"links":[{"rel":"self","uri":"https://sandboxapi.deere.com/platform/organizations/000000/assets"}],"total":4,"values":[{"@type":"ContributedAsset","title":"Asset
141
+ string: '{"links":[{"rel":"self","uri":"https://sandboxapi.deere.com/platform/organizations/000000/assets"}],"total":8,"values":[{"@type":"ContributedAsset","title":"Asset
142
+ Title","assetCategory":"DEVICE","assetType":"SENSOR","assetSubType":"ENVIRONMENTAL","lastModifiedDate":"2020-02-06T22:30:14.000Z","id":"00000000-0000-0000-0000-000000000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"contributionDefinition","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"organization","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"locations","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations"},{"@type":"Link","rel":"lastKnownLocation","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations?lastKnown=true"}]},{"@type":"ContributedAsset","title":"Asset
143
+ Title","assetCategory":"DEVICE","assetType":"SENSOR","assetSubType":"ENVIRONMENTAL","lastModifiedDate":"2020-02-06T22:30:14.000Z","id":"00000000-0000-0000-0000-000000000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"contributionDefinition","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"organization","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"locations","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations"},{"@type":"Link","rel":"lastKnownLocation","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations?lastKnown=true"}]},{"@type":"ContributedAsset","title":"Asset
144
+ Title","assetCategory":"DEVICE","assetType":"SENSOR","assetSubType":"ENVIRONMENTAL","lastModifiedDate":"2020-02-06T22:30:14.000Z","id":"00000000-0000-0000-0000-000000000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"contributionDefinition","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"organization","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"locations","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations"},{"@type":"Link","rel":"lastKnownLocation","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations?lastKnown=true"}]},{"@type":"ContributedAsset","title":"Asset
145
+ Title","assetCategory":"DEVICE","assetType":"SENSOR","assetSubType":"ENVIRONMENTAL","lastModifiedDate":"2020-02-06T22:30:14.000Z","id":"00000000-0000-0000-0000-000000000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"contributionDefinition","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"organization","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"locations","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations"},{"@type":"Link","rel":"lastKnownLocation","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations?lastKnown=true"}]},{"@type":"ContributedAsset","title":"Asset
142
146
  Title","assetCategory":"DEVICE","assetType":"SENSOR","assetSubType":"ENVIRONMENTAL","lastModifiedDate":"2020-02-06T22:30:14.000Z","id":"00000000-0000-0000-0000-000000000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"contributionDefinition","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"organization","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"locations","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations"},{"@type":"Link","rel":"lastKnownLocation","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations?lastKnown=true"}]},{"@type":"ContributedAsset","title":"Asset
143
147
  Title","assetCategory":"DEVICE","assetType":"SENSOR","assetSubType":"ENVIRONMENTAL","lastModifiedDate":"2020-02-06T22:30:14.000Z","id":"00000000-0000-0000-0000-000000000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"contributionDefinition","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"organization","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"locations","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations"},{"@type":"Link","rel":"lastKnownLocation","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations?lastKnown=true"}]},{"@type":"ContributedAsset","title":"Asset
144
148
  Title","assetCategory":"DEVICE","assetType":"SENSOR","assetSubType":"ENVIRONMENTAL","lastModifiedDate":"2020-02-06T22:30:14.000Z","id":"00000000-0000-0000-0000-000000000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"contributionDefinition","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"organization","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"locations","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations"},{"@type":"Link","rel":"lastKnownLocation","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations?lastKnown=true"}]},{"@type":"ContributedAsset","title":"Asset
145
149
  Title","assetCategory":"DEVICE","assetType":"SENSOR","assetSubType":"ENVIRONMENTAL","lastModifiedDate":"2020-02-06T22:30:14.000Z","id":"00000000-0000-0000-0000-000000000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"contributionDefinition","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"organization","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"locations","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations"},{"@type":"Link","rel":"lastKnownLocation","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations?lastKnown=true"}]}]}'
146
150
  http_version:
147
- recorded_at: Fri, 07 Feb 2020 04:30:02 GMT
151
+ recorded_at: Fri, 07 Feb 2020 16:22:24 GMT
148
152
  recorded_with: VCR 5.0.0
@@ -23,15 +23,15 @@ http_interactions:
23
23
  message: OK
24
24
  headers:
25
25
  Date:
26
- - Fri, 07 Feb 2020 04:29:48 GMT
26
+ - Fri, 07 Feb 2020 16:22:20 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-45-143
30
+ - ip-10-214-45-137
31
31
  X-Frame-Options:
32
32
  - SAMEORIGIN
33
33
  X-Deere-Elapsed-Ms:
34
- - '8'
34
+ - '18'
35
35
  Cache-Control:
36
36
  - no-store
37
37
  Content-Language:
@@ -42,7 +42,7 @@ 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: Fri, 07 Feb 2020 04:29:48 GMT
45
+ recorded_at: Fri, 07 Feb 2020 16:22:20 GMT
46
46
  - request:
47
47
  method: get
48
48
  uri: https://sandboxapi.deere.com/platform/organizations
@@ -67,15 +67,15 @@ http_interactions:
67
67
  message: OK
68
68
  headers:
69
69
  Date:
70
- - Fri, 07 Feb 2020 04:29:49 GMT
70
+ - Fri, 07 Feb 2020 16:22:20 GMT
71
71
  Content-Type:
72
72
  - application/vnd.deere.axiom.v3+json;charset=UTF-8
73
73
  X-Deere-Handling-Server:
74
- - ip-10-214-44-185
74
+ - ip-10-214-45-139
75
75
  X-Frame-Options:
76
76
  - SAMEORIGIN
77
77
  X-Deere-Elapsed-Ms:
78
- - '21'
78
+ - '336'
79
79
  Cache-Control:
80
80
  - no-store
81
81
  Content-Language:
@@ -96,7 +96,7 @@ http_interactions:
96
96
  Name","type":"customer","member":true,"id":"000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"machines","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines"},{"@type":"Link","rel":"wdtCapableMachines","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines?capability=wdt"},{"@type":"Link","rel":"files","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files"},{"@type":"Link","rel":"transferableFiles","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files?transferable=true"},{"@type":"Link","rel":"uploadFile","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files"},{"@type":"Link","rel":"sendFileToMachine","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fileTransfers"},{"@type":"Link","rel":"addMachine","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines"},{"@type":"Link","rel":"addField","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fields"},{"@type":"Link","rel":"assets","uri":"https://sandboxapi.deere.com/platform/organizations/000000/assets"},{"@type":"Link","rel":"fields","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fields"},{"@type":"Link","rel":"farms","uri":"https://sandboxapi.deere.com/platform/organizations/000000/farms"},{"@type":"Link","rel":"boundaries","uri":"https://sandboxapi.deere.com/platform/organizations/000000/boundaries"},{"@type":"Link","rel":"clients","uri":"https://sandboxapi.deere.com/platform/organizations/000000/clients"},{"@type":"Link","rel":"flags","uri":"https://sandboxapi.deere.com/platform/organizations/000000/flags"},{"@type":"Link","rel":"flagCategory","uri":"https://sandboxapi.deere.com/platform/organizations/000000/flagCategories"},{"@type":"Link","rel":"controllers","uri":"https://sandboxapi.deere.com/platform/organizations/000000/orgController"}]},{"@type":"Organization","name":"Organization
97
97
  Name","type":"customer","member":true,"id":"000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"machines","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines"},{"@type":"Link","rel":"wdtCapableMachines","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines?capability=wdt"},{"@type":"Link","rel":"files","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files"},{"@type":"Link","rel":"transferableFiles","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files?transferable=true"},{"@type":"Link","rel":"uploadFile","uri":"https://sandboxapi.deere.com/platform/organizations/000000/files"},{"@type":"Link","rel":"sendFileToMachine","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fileTransfers"},{"@type":"Link","rel":"addMachine","uri":"https://sandboxapi.deere.com/platform/organizations/000000/machines"},{"@type":"Link","rel":"addField","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fields"},{"@type":"Link","rel":"assets","uri":"https://sandboxapi.deere.com/platform/organizations/000000/assets"},{"@type":"Link","rel":"fields","uri":"https://sandboxapi.deere.com/platform/organizations/000000/fields"},{"@type":"Link","rel":"farms","uri":"https://sandboxapi.deere.com/platform/organizations/000000/farms"},{"@type":"Link","rel":"boundaries","uri":"https://sandboxapi.deere.com/platform/organizations/000000/boundaries"},{"@type":"Link","rel":"clients","uri":"https://sandboxapi.deere.com/platform/organizations/000000/clients"},{"@type":"Link","rel":"flags","uri":"https://sandboxapi.deere.com/platform/organizations/000000/flags"},{"@type":"Link","rel":"flagCategory","uri":"https://sandboxapi.deere.com/platform/organizations/000000/flagCategories"},{"@type":"Link","rel":"controllers","uri":"https://sandboxapi.deere.com/platform/organizations/000000/orgController"}]}]}'
98
98
  http_version:
99
- recorded_at: Fri, 07 Feb 2020 04:29:50 GMT
99
+ recorded_at: Fri, 07 Feb 2020 16:22:21 GMT
100
100
  - request:
101
101
  method: post
102
102
  uri: https://sandboxapi.deere.com/platform/organizations/000000/assets
@@ -125,24 +125,24 @@ http_interactions:
125
125
  message: Created
126
126
  headers:
127
127
  Date:
128
- - Fri, 07 Feb 2020 04:29:52 GMT
128
+ - Fri, 07 Feb 2020 16:22:22 GMT
129
129
  Content-Type:
130
130
  - application/vnd.deere.axiom.v3+json
131
131
  X-Deere-Handling-Server:
132
- - ip-10-214-45-143
132
+ - ip-10-214-45-139
133
133
  X-Frame-Options:
134
134
  - SAMEORIGIN
135
135
  Location:
136
136
  - https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000
137
137
  X-Deere-Elapsed-Ms:
138
- - '58'
138
+ - '51'
139
139
  Transfer-Encoding:
140
140
  - chunked
141
141
  body:
142
142
  encoding: ASCII-8BIT
143
143
  string: ''
144
144
  http_version:
145
- recorded_at: Fri, 07 Feb 2020 04:29:53 GMT
145
+ recorded_at: Fri, 07 Feb 2020 16:22:22 GMT
146
146
  - request:
147
147
  method: get
148
148
  uri: https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000
@@ -169,11 +169,11 @@ http_interactions:
169
169
  message: OK
170
170
  headers:
171
171
  Date:
172
- - Fri, 07 Feb 2020 04:29:54 GMT
172
+ - Fri, 07 Feb 2020 16:22:22 GMT
173
173
  Content-Type:
174
174
  - application/vnd.deere.axiom.v3+json;charset=UTF-8
175
175
  X-Deere-Handling-Server:
176
- - ip-10-214-44-29
176
+ - ip-10-214-45-97
177
177
  X-Frame-Options:
178
178
  - SAMEORIGIN
179
179
  X-Deere-Elapsed-Ms:
@@ -188,5 +188,5 @@ http_interactions:
188
188
  encoding: ASCII-8BIT
189
189
  string: '{"@type":"ContributedAsset","title":"Asset Title","assetCategory":"DEVICE","assetType":"SENSOR","assetSubType":"ENVIRONMENTAL","lastModifiedDate":"2020-02-06T22:30:14.000Z","id":"00000000-0000-0000-0000-000000000000","links":[{"@type":"Link","rel":"self","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"contributionDefinition","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions/00000000-0000-0000-0000-000000000000"},{"@type":"Link","rel":"organization","uri":"https://sandboxapi.deere.com/platform/organizations/000000"},{"@type":"Link","rel":"locations","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations"},{"@type":"Link","rel":"lastKnownLocation","uri":"https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000/locations?lastKnown=true"}]}'
190
190
  http_version:
191
- recorded_at: Fri, 07 Feb 2020 04:29:55 GMT
191
+ recorded_at: Fri, 07 Feb 2020 16:22:22 GMT
192
192
  recorded_with: VCR 5.0.0
@@ -0,0 +1,87 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://sandboxapi.deere.com/platform/
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
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 16:22:26 GMT
27
+ Content-Type:
28
+ - application/vnd.deere.axiom.v3+json;charset=UTF-8
29
+ X-Deere-Handling-Server:
30
+ - ip-10-214-45-97
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 16:22:26 GMT
46
+ - request:
47
+ method: put
48
+ uri: https://sandboxapi.deere.com/platform/assets/00000000-0000-0000-0000-000000000000
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"assetCategory":"DEVICE","assetType":"SENSOR","assetSubType":"ENVIRONMENTAL","links":[{"@type":"Link","rel":"contributionDefinition","uri":"https://sandboxapi.deere.com/platform/contributionDefinitions/00000000-0000-0000-0000-000000000000"}],"title":"i
52
+ REALLY like turtles!"}'
53
+ headers:
54
+ Accept:
55
+ - application/vnd.deere.axiom.v3+json
56
+ Content-Type:
57
+ - application/vnd.deere.axiom.v3+json
58
+ Accept-Encoding:
59
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
60
+ User-Agent:
61
+ - OAuth gem v0.5.4
62
+ Content-Length:
63
+ - '276'
64
+ Authorization:
65
+ - OAuth oauth_body_hash="2cYRiTc%2BBr3sgGXkMJr4suLgHUc%3D", oauth_consumer_key="johndeere-0000000000000000000000000000000000000000",
66
+ oauth_nonce="000000000000000000000000000000000000000000", oauth_signature="0000000000000000000000000000",
67
+ oauth_signature_method="HMAC-SHA1", oauth_timestamp="1581028214", oauth_token="00000000-0000-0000-0000-000000000000",
68
+ oauth_version="1.0"
69
+ response:
70
+ status:
71
+ code: 204
72
+ message: No Content
73
+ headers:
74
+ Date:
75
+ - Fri, 07 Feb 2020 16:22:26 GMT
76
+ X-Deere-Handling-Server:
77
+ - ip-10-214-44-197
78
+ X-Frame-Options:
79
+ - SAMEORIGIN
80
+ X-Deere-Elapsed-Ms:
81
+ - '77'
82
+ body:
83
+ encoding: UTF-8
84
+ string: ''
85
+ http_version:
86
+ recorded_at: Fri, 07 Feb 2020 16:22:27 GMT
87
+ recorded_with: VCR 5.0.0
@@ -21,7 +21,7 @@ class VcrSetup
21
21
  :get_contribution_products, :get_contribution_product,
22
22
  :get_organizations, :get_organization,
23
23
  :get_fields, :get_field, :get_flags,
24
- :post_assets, :get_assets, :get_asset,
24
+ :post_assets, :get_assets, :get_asset, :put_asset,
25
25
  :post_asset_locations, :get_asset_locations,
26
26
  :delete_asset
27
27
  ]
@@ -238,6 +238,16 @@ class VcrSetup
238
238
  find_organization(ENV['ORGANIZATION_ID']).assets.find(@temporary_asset_id)
239
239
  end
240
240
 
241
+ def put_asset
242
+ attrs = asset_attributes.slice(
243
+ :asset_category, :asset_type, :asset_sub_type, :links
244
+ ).merge(
245
+ title: 'i REALLY like turtles!'
246
+ )
247
+
248
+ new_client.put("/assets/#{@temporary_asset_id}", attrs)
249
+ end
250
+
241
251
  def delete_asset
242
252
  new_client.delete("/assets/#{@temporary_asset_id}")
243
253
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_john_deere_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Bellmyer
@@ -201,6 +201,7 @@ files:
201
201
  - test/support/vcr/get_request_token.yml
202
202
  - test/support/vcr/post_asset_locations.yml
203
203
  - test/support/vcr/post_assets.yml
204
+ - test/support/vcr/put_asset.yml
204
205
  - test/support/vcr/url.yml
205
206
  - test/support/vcr/warning.txt
206
207
  - test/support/vcr_setup.rb