my_john_deere_api 2.3.4 → 2.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +50 -1
- data/lib/my_john_deere_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d94f50a7c306efa861fb855b0c8a90d1b070c8ad230e05fc0ba298118b5d91c4
|
4
|
+
data.tar.gz: f105e3d4c42cc755db700ce5ceeaecd2a9edf2292b8ddb4ff4e559913a68fd89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d35cdcecd45fef14e1e78f454846a115c29b2c8e20543407540ca5ebd44f82e76a796e01b14fe4c02b70a725b9fad726d97d06f938dd6f00da5dcd5a779d5fe3
|
7
|
+
data.tar.gz: 8b33a28e57f5e0d08bc71d975be12e7c0fc71fa596a1cceb4b2fe611c31d3a1422ac2d2b7e314a6f6bc692ef5c2a268dbb8c00158daa9eff37893cc4e24233a0
|
data/README.md
CHANGED
@@ -24,6 +24,7 @@ without having to code your own oAuth process, API requests, and pagination.
|
|
24
24
|
* [Organizations](#organizations)
|
25
25
|
* [Assets](#assets)
|
26
26
|
* [Asset Locations](#asset-locations)
|
27
|
+
* [Fields](#fields)
|
27
28
|
* [Direct API Requests](#direct-api-requests)
|
28
29
|
* [GET](#get)
|
29
30
|
* [POST](#post)
|
@@ -346,7 +347,7 @@ organization.links
|
|
346
347
|
# => {
|
347
348
|
# 'self' => 'https://sandboxapi.deere.com/platform/organizations/1234',
|
348
349
|
# 'machines' => 'https://sandboxapi.deere.com/platform/organizations/1234/machines',
|
349
|
-
# 'wdtCapableMachines' => '
|
350
|
+
# 'wdtCapableMachines' => 'https://sandboxapi.deere.com/platform/organizations/1234/machines?capability=wdt'
|
350
351
|
# }
|
351
352
|
|
352
353
|
organization.assets
|
@@ -558,6 +559,54 @@ Note that locations are called "Asset Locations" in John Deere, but we call the
|
|
558
559
|
`asset.locations`, for brevity.
|
559
560
|
|
560
561
|
|
562
|
+
### [Fields](https://developer.deere.com/#!documentation&doc=myjohndeere%2FfieldsADS.htm)
|
563
|
+
|
564
|
+
Handles an organization's fields. Field collections support the following methods:
|
565
|
+
|
566
|
+
* all
|
567
|
+
* count
|
568
|
+
* first
|
569
|
+
* find(field\_id)
|
570
|
+
|
571
|
+
An individual field supports the following methods and associations:
|
572
|
+
|
573
|
+
* id
|
574
|
+
* name
|
575
|
+
* archived?
|
576
|
+
* links
|
577
|
+
* flags (collection of this field's flags)
|
578
|
+
|
579
|
+
The `count` method only requires loading the first page of results, so it's a relatively cheap call. On the other hand,
|
580
|
+
`all` forces the entire collection to be loaded from John Deere's API, so use with caution. Fields can be
|
581
|
+
created via the API, but there is no `create` method on this collection yet.
|
582
|
+
|
583
|
+
```ruby
|
584
|
+
organization.fields
|
585
|
+
# => collection of fields under this organization
|
586
|
+
|
587
|
+
organization.fields.count
|
588
|
+
# => 15
|
589
|
+
|
590
|
+
organization.fields.first
|
591
|
+
# => an individual field object
|
592
|
+
|
593
|
+
field = organization.fields.find(1234)
|
594
|
+
# => an individual field object, fetched by ID
|
595
|
+
|
596
|
+
field.name
|
597
|
+
# => 'Smith Field'
|
598
|
+
|
599
|
+
field.archived?
|
600
|
+
# => false
|
601
|
+
|
602
|
+
field.links
|
603
|
+
# => a hash of API urls related to this asset
|
604
|
+
|
605
|
+
field.flags
|
606
|
+
# => collection of flags belonging to this field
|
607
|
+
```
|
608
|
+
|
609
|
+
|
561
610
|
## Direct API Requests
|
562
611
|
|
563
612
|
While the goal of the client is to eliminate the need to make/interpret calls to the John Deere API, it's important
|
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: 2.3.
|
4
|
+
version: 2.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaime Bellmyer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-02-
|
12
|
+
date: 2020-02-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: vcr
|