business_insight_api_client 0.2.0

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7a36aebe2079574cf93797fafe1f574030bae237
4
+ data.tar.gz: b4aef315a2dc3fec580eca5774e71a356f5bc485
5
+ SHA512:
6
+ metadata.gz: 54d0bcf354e9e9419eeb4b5c74b61d42a68b1cee49dfd80971267cbe15284bfd33ce8a3636d00836155d42decb52eaba73f6d07b8450b8610b7b43f37eff3ae2
7
+ data.tar.gz: d22ca8f0beaa98423a5bde2f0c093f3376dade5c30860cdccac514e922942f88b35af62c97a56c25cebc0c30e2ede96c352aac26f6ed955a7076936bc0d078b4
data/.gitignore ADDED
@@ -0,0 +1,27 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ .rvmrc
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
19
+ *.bundle
20
+ *.so
21
+ *.o
22
+ *.a
23
+ mkmf.log
24
+ .idea
25
+ .DS_Store
26
+ .inch
27
+
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in business_insight_api.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,9 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :rspec do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { 'spec' }
8
+ end
9
+
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Nedap N.V.
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # Business Insight API client gem
2
+
3
+ A gem to interact with the Business Insight API
4
+
5
+ ## Installation
6
+
7
+ The Business Insight API Gem is available as gem.
8
+
9
+ Add these lines to your application's Gemfile:
10
+
11
+ ```
12
+ gem 'business_insight_api_client', '~> 0.2'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ ```
18
+ $ bundle
19
+ ```
20
+
21
+ Or install it yourself as:
22
+
23
+ ```
24
+ $ gem install business_insight_api_client
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ ## Configuration
30
+ Configure the gem for staging or the live (production) api.
31
+
32
+ ### Staging
33
+
34
+ The staging server can be used for testing. To access the staging server you can use the following configuration.
35
+
36
+ ```ruby
37
+ BusinessInsightApiClient.configure do |conf|
38
+ conf.api_url = 'https://staging-api.nedap-bi.com'
39
+ conf.authorization_url = 'https://staging.nedap-bi.com'
40
+ conf.client_id = 'your_application_id'
41
+ conf.client_secret = 'your_application_secret'
42
+ end
43
+ ```
44
+
45
+ ### Production
46
+
47
+ ```ruby
48
+ BusinessInsightApiClient.configure do |conf|
49
+ conf.api_url = 'https://api.nedap-bi.com'
50
+ conf.authorization_url = 'https://nedap-bi.com'
51
+ conf.client_id = 'your_application_id'
52
+ conf.client_secret = 'your_application_secret'
53
+ end
54
+ ```
55
+
56
+ ## Requests
57
+
58
+ Once configured, requests can be made with [Client](#label-BusinessInsightApiClient%3A%3AClient). The [example](#label-Example) chapter contains examples of how a request should be made.
59
+
60
+ ## Example
61
+
62
+ This section contains an example getting data in ruby (without callbacks).
63
+
64
+ ### Ruby
65
+ This section contains an example to query the Business Insight API from ruby.
66
+ We assume you already have an application id and secret.
67
+
68
+ ```ruby
69
+ require 'business_insight_api_client'
70
+
71
+ BusinessInsightApiClient.configure do |conf|
72
+ conf.api_url = 'https://staging-api.nedap-bi.com'
73
+ conf.authorization_url = 'https://staging.nedap-bi.com'
74
+ conf.client_id = 'your_application_id'
75
+ conf.client_secret = 'your_application_secret'
76
+ end
77
+
78
+ client = BusinessInsightApiClient::Client.new
79
+ installation_tokens = client.get_access_tokens # queries the API for all access tokens granted to your application.
80
+ installation_tokens.each do |installation , access_token|
81
+ puts "The access token belonging to installation #{installation} is #{access_token.token}"
82
+ client.access_token= access_token # set the access token (installation) you would like to use to.
83
+
84
+ installation_request = client.installations # query what installation additional information.
85
+ puts "Installation id #{installation_request.installation.id} and serial number #{installation_request.installation.serial_number}"
86
+
87
+ animals_request = client.animals # query all animals belonging to the installation.
88
+
89
+ status_code = animals_request.status # => 200 , http code status
90
+ installation_animals = animals_request.animals # => Mash containing all animals of the installation.
91
+ installation_animals.each |animal|
92
+ puts animal.name # iterate all animals and print their name
93
+ end
94
+ end
95
+ ```
96
+
97
+ ## BusinessInsightApiClient::Client
98
+ This is the class that should be used to make authorized calls to the Business Insight API.
99
+ You can browse the classes for the operations that can be accessed.
100
+
101
+ - {BusinessInsightApiClient::Api::Applications}
102
+ - {BusinessInsightApiClient::Api::Installations}
103
+ - {BusinessInsightApiClient::Api::Animals}
104
+ - {BusinessInsightApiClient::Api::Calendar}
105
+ - {BusinessInsightApiClient::Api::Groups}
106
+
107
+ If you need to authorize with the Business Insight authorization server you can access the [Authorizations Helper](#label-BusinessInsightApiClient%3A%3AHelpers%3A%3AAuthorization) from the client.
108
+ {BusinessInsightApiClient::Helpers::Authorization}.
109
+
110
+ Documentation about the Client can be found at {BusinessInsightApiClient::Client}.
111
+
112
+ ## BusinessInsightApiClient::Helpers::Authorization
113
+ The authorizations helper contains methods to authorization with the authorization server.
114
+
115
+ Documentation about the Authorization helper can be found at {BusinessInsightApiClient::Helpers::Authorization}.
116
+
117
+ ## BusinessInsightApiClient::Errors
118
+
119
+ If a request can't be accepted the API throws errors.
120
+ Detailed documentation about the errors classes can be found at {BusinessInsightApiClient::Errors}.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ require 'rspec/core/rake_task'
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,35 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'business_insight_api_client/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'business_insight_api_client'
8
+ spec.description = 'Business Insight API client'
9
+ spec.version = BusinessInsightApiClient::VERSION
10
+ spec.authors = ['Nedap']
11
+ spec.email = ['development-lm@nedap.com']
12
+ spec.summary = %q{A gem to interact with the Business Insight Api.}
13
+ spec.homepage = 'https://developer.nedap-bi.com'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").grep(/^[^spec\/]/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.require_paths = ['lib']
19
+ spec.add_dependency 'multi_json','~> 1.10.1'
20
+ spec.add_dependency 'httpclient', '~> 2.4.0'
21
+ spec.add_dependency 'hashie', '~> 3.2.0'
22
+ spec.add_dependency 'oauth2', '~> 1.0.0'
23
+
24
+
25
+ spec.add_development_dependency 'bundler', '~> 1.6'
26
+ spec.add_development_dependency 'rake'
27
+ spec.add_development_dependency 'rspec', '~> 3.0.0'
28
+ spec.add_development_dependency 'guard', '~> 2.6.1'
29
+ spec.add_development_dependency 'guard-rspec', '~> 4.2.10'
30
+ spec.add_development_dependency 'webmock', '~> 1.18.0'
31
+ spec.add_development_dependency 'vcr', '~> 2.9.2'
32
+ spec.add_development_dependency 'yard', '~> 0.8.7.6'
33
+ spec.add_development_dependency 'inch','~> 0.5.7'
34
+ spec.add_development_dependency 'rspec-collection_matchers'
35
+ end
@@ -0,0 +1,55 @@
1
+ require 'business_insight_api_client/version'
2
+ require 'business_insight_api_client/helpers'
3
+ require 'business_insight_api_client/api'
4
+ require 'business_insight_api_client/client'
5
+ require 'business_insight_api_client/errors'
6
+ require 'business_insight_api_client/mash'
7
+ require 'oauth2'
8
+
9
+ # BusinessInsightApiClient configuration class
10
+ # This class allows to set a configuration uses in the whole application until reloaded.
11
+ module BusinessInsightApiClient
12
+
13
+ class << self
14
+
15
+ # @!attribute [rw] api_url
16
+ # @return [String] the api url, default: https://api.nedap-bi.com
17
+ attr_accessor :api_url
18
+
19
+ # @!attribute [rw] authorization_url
20
+ # @return [String] the authorization url of the api, default: https://nedap-bi.com
21
+ attr_accessor :authorization_url
22
+
23
+ # @!attribute [rw] default_content_type
24
+ # @return [String] the default content, default: application/json
25
+ attr_accessor :default_content_type
26
+
27
+ # @attribute [rw] client_id
28
+ # @return [String] [String] the client id uses in OAuth authorization
29
+ attr_accessor :client_id
30
+
31
+ # @attribute [rw] client_secret
32
+ # @return [String] the client secret uses in OAuth authorization
33
+ attr_accessor :client_secret
34
+
35
+ # Configures the business insight api for usage.
36
+ # This method expects an configuration block.
37
+ # @example
38
+ # BusinessInsightApiClient.configure do |conf|
39
+ # conf.client_id = 'someclientid'
40
+ # end
41
+ # @yield [configuration] the configuration class.
42
+ # @yieldparam api_url [String]
43
+ # @yieldparam authorization_url [String]
44
+ # @yieldparam default_content_type [String]
45
+ # @yieldparam client_id [String]
46
+ # @yieldparam client_secret [String]
47
+ # @return [Boolean, true]
48
+ def configure
49
+ yield self
50
+ true
51
+ end
52
+
53
+ end
54
+ end
55
+
@@ -0,0 +1,9 @@
1
+ module BusinessInsightApiClientClient
2
+ module Api
3
+ require 'business_insight_api_client/api/applications'
4
+ require 'business_insight_api_client/api/installations'
5
+ require 'business_insight_api_client/api/animals'
6
+ require 'business_insight_api_client/api/calendars'
7
+ require 'business_insight_api_client/api/groups'
8
+ end
9
+ end
@@ -0,0 +1,76 @@
1
+ module BusinessInsightApiClient
2
+ module Api
3
+
4
+ # Animal API based methods. This module contains methods to query the Animal API.
5
+ module Animals
6
+
7
+ # get: '/animals'
8
+ # @return [BusinessInsightApiClient::Mash] response mash.
9
+ # @see https://api.nedap-bi.com/api/docs/
10
+ def animals
11
+ ::BusinessInsightApiClient::Mash.from_json client.get('/animals')
12
+ end
13
+
14
+
15
+ # get: '/animals/:id'
16
+ # @param [Integer] animal_id animal id
17
+ # @return [BusinessInsightApiClient::Mash] response mash.
18
+ # @see https://api.nedap-bi.com/api/docs/
19
+ def animal(animal_id)
20
+ ::BusinessInsightApiClient::Mash.from_json client.get("/animals/#{animal_id}")
21
+ end
22
+
23
+ # get: '/animals/with_life_number/:life_number'
24
+ # @param [String] life_number animal life number
25
+ # @return [BusinessInsightApiClient::Mash] response mash.
26
+ # @see https://api.nedap-bi.com/api/docs/
27
+ def animal_with_life_number(life_number)
28
+ body = { life_number: life_number }
29
+ ::BusinessInsightApiClient::Mash.from_json client.get('/animals/with_life_number', body: body)
30
+ end
31
+
32
+ # get: '/animals/animal_with_responder/:responder'
33
+ # @param [String] responder animal responder
34
+ # @return [BusinessInsightApiClient::Mash] response mash.
35
+ # @see https://api.nedap-bi.com/api/docs/
36
+ def animal_with_responder(responder)
37
+ body = { responder: responder }
38
+ ::BusinessInsightApiClient::Mash.from_json client.get('/animals/with_responder', body: body)
39
+ end
40
+
41
+ # get: '/animals/with_number/:number'
42
+ # @param [Integer] number animal number
43
+ # @return [BusinessInsightApiClient::Mash] response mash.
44
+ # @see https://api.nedap-bi.com/api/docs/
45
+ def animal_with_number(number)
46
+ body = { number: number }
47
+ ::BusinessInsightApiClient::Mash.from_json client.get('/animals/with_number', body: body)
48
+ end
49
+
50
+ # post: '/animals/:animal'
51
+ # @param [Hash] animal animal to be created. See docs for parameters.
52
+ # @return [BusinessInsightApiClient::Mash] response mash.
53
+ # @see https://api.nedap-bi.com/api/docs/
54
+ def create_animal(animal={})
55
+ ::BusinessInsightApiClient::Mash.from_json client.post('/animals', animal.to_json)
56
+ end
57
+
58
+ # put: '/animals/:animal_id'
59
+ # @param [Integer] animal_id animal to be updated.
60
+ # @param [Hash] animal animal to be updated. See docs for parameters.
61
+ # @return [BusinessInsightApiClient::Mash] response mash.
62
+ # @see https://api.nedap-bi.com/api/docs/
63
+ def update_animal(animal_id,animal={})
64
+ ::BusinessInsightApiClient::Mash.from_json client.put("/animals/#{animal_id}", animal.to_json)
65
+ end
66
+
67
+ # delete: '/animals/:animal_id'
68
+ # @param [Integer] animal_id animal to be deleted.
69
+ # @return [BusinessInsightApiClient::Mash] response mash.
70
+ # @see https://api.nedap-bi.com/api/docs/
71
+ def delete_animal(animal_id)
72
+ ::BusinessInsightApiClient::Mash.from_json client.delete("/animals/#{animal_id}")
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,54 @@
1
+ module BusinessInsightApiClient
2
+ module Api
3
+
4
+ # Applications API based methods. This module contains methods to query the Applications API.
5
+ module Applications
6
+
7
+ # Retrieves an access token for a specific application.
8
+ #
9
+ # @example
10
+ # client = BusinessInsightApiClient::Client.new
11
+ # tokens = client.get_access_tokens(client.authorization.get_login_token)
12
+ # tokens.each do |installation_id, token|
13
+ # ......
14
+ # end
15
+ # @param client_credential_token [OAuth2::AccessToken] the client credential token as retrieved with a client credential request.
16
+ # @return [Hash{Integer => OAuth2::AccessToken}] all access tokens with the installation id as key and token as value.
17
+ # @see http://www.rubydoc.info/gems/oauth2/1.0.0/OAuth2/AccessToken OAuth2::AccessToken information
18
+ # @see BusinessInsightApiClient::Helpers::Authorization
19
+ # @see BusinessInsightApiClient::Client
20
+ def get_access_tokens(client_credential_token)
21
+ tokens = ::BusinessInsightApiClient::Mash.from_json client.get('/applications/access_tokens', header: client_credential_token.headers)
22
+ expired_time = Time.now
23
+ Hash[tokens.access_tokens.collect do |token|
24
+ [
25
+ token.resource_owner_id,
26
+ authorization.access_token_from_hash(
27
+ token: token.token,
28
+ expires_in: token.expires_in_seconds,
29
+ expires_at: Time.now.to_i + token.expires_in_seconds,
30
+ refresh_token: token.refresh_token
31
+ )
32
+ ]
33
+ end]
34
+
35
+ end
36
+
37
+ # Retrieves an access token belonging to the application for a specific installation.
38
+ #
39
+ # @example
40
+ # client = BusinessInsightApiClient::Client.new
41
+ # token = client.get_access_token(client.authorization.get_login_token, 20)
42
+ # @param client_credential_token [OAuth2::AccessToken] the client credential token as retrieves with a client credential request.
43
+ # @param installation_id [Integer] the installation to find.
44
+ # @return [OAuth2::AccessToken] the access token.
45
+ # @see http://www.rubydoc.info/gems/oauth2/1.0.0/OAuth2/AccessToken OAuth2::AccessToken information
46
+ # @see BusinessInsightApiClient::Helpers::Authorization
47
+ # @see BusinessInsightApiClient::Client
48
+ def get_access_token(client_credential_token, installation_id)
49
+ tokens = get_access_tokens(client_credential_token)
50
+ tokens[installation_id]
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,158 @@
1
+ module BusinessInsightApiClient
2
+ module Api
3
+
4
+ # Calendar API based methods. This module contains methods to query the Calendar API.
5
+ module Calendar
6
+
7
+ # get: '/calendar'
8
+ # @param [Integer] animal_id animal id
9
+ # @param [Integer] cycle_number (nil) cycle_number
10
+ # @param [String] type (nil) calendar type
11
+ # @see https://api.nedap-bi.com/api/docs/
12
+ def calendar_events(animal_id, cycle_number = nil, type = nil)
13
+ body = { animal_id: animal_id }
14
+ body[:cycle_number] = cycle_number if cycle_number
15
+ body[:type] = type if type
16
+ ::BusinessInsightApiClient::Mash.from_json client.get('/calendar', body: body)
17
+ end
18
+
19
+ # get: '/calendar/:id'
20
+ # @param [Integer] id calendar id
21
+ # @see https://api.nedap-bi.com/api/docs/
22
+ def calendar_event(id)
23
+ ::BusinessInsightApiClient::Mash.from_json client.get("/calendar/#{id}")
24
+ end
25
+
26
+ # get: '/calendar/current_cycle/'
27
+ # @param [Integer] animal_id animal id
28
+ # @param [String] type (nil) calendar type
29
+ # @see https://api.nedap-bi.com/api/docs/
30
+ def calendar_events_current_cycle(animal_id, type=nil)
31
+ body = { animal_id: animal_id }
32
+ body[:type] = type if type
33
+ ::BusinessInsightApiClient::Mash.from_json client.get('/calendar/current_cycle', body: body)
34
+ end
35
+
36
+ # get: '/calendar/by_cycle/'
37
+ # @param [Integer] animal_id animal id
38
+ # @see https://api.nedap-bi.com/api/docs/
39
+ def calendar_events_by_cycle(animal_id)
40
+ body = { animal_id: animal_id }
41
+ ::BusinessInsightApiClient::Mash.from_json client.get('/calendar/by_cycle', body: body)
42
+ end
43
+
44
+ # post: '/calendar/birth_event'
45
+ # @param [Hash] calendar_event calendar event to be created. See docs for parameters.
46
+ # @see https://api.nedap-bi.com/api/docs/
47
+ def create_birth_event(calendar_event = {})
48
+ ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/birth_event', calendar_event.to_json)
49
+ end
50
+
51
+ # put: '/calendar/birth_event/:calendar_event_id'
52
+ # @param [Integer] calendar_event_id calendar event to be updated.
53
+ # @param [Hash] calendar_event ({}) parameters to be updated. See docs for parameters.
54
+ # @see https://api.nedap-bi.com/api/docs/
55
+ def update_birth_event(calendar_event_id, calendar_event = {})
56
+ ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/birth_event/#{calendar_event_id}", calendar_event.to_json)
57
+ end
58
+
59
+ # post: '/calendar/calving_event'
60
+ # @param [Hash] calendar_event calendar event to be created. See docs for parameters.
61
+ # @see https://api.nedap-bi.com/api/docs/
62
+ def create_calving_event(calendar_event = {})
63
+ ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/calving_event', calendar_event.to_json)
64
+ end
65
+
66
+ # put: '/calendar/calving_event/:calendar_event_id'
67
+ # @param [Integer] calendar_event_id calendar event to be updated.
68
+ # @param [Hash] calendar_event ({}) parameters to be updated. See docs for parameters.
69
+ # @see https://api.nedap-bi.com/api/docs/
70
+ def update_calving_event(calendar_event_id, calendar_event = {})
71
+ ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/calving_event/#{calendar_event_id}", calendar_event.to_json)
72
+ end
73
+
74
+ # post: '/calendar/dryoff_event'
75
+ # @param [Hash] calendar_event calendar event to be created. See docs for parameters.
76
+ # @see https://api.nedap-bi.com/api/docs/
77
+ def create_dryoff_event(calendar_event = {})
78
+ ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/dryoff_event', calendar_event.to_json)
79
+ end
80
+
81
+ # put: '/calendar/dryoff_event/:calendar_event_id'
82
+ # @param [Integer] calendar_event_id calendar event to be updated.
83
+ # @param [Hash] calendar_event ({}) parameters to be updated. See docs for parameters.
84
+ # @see https://api.nedap-bi.com/api/docs/
85
+ def update_dryoff_event(calendar_event_id, calendar_event = {})
86
+ ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/dryoff_event/#{calendar_event_id}", calendar_event.to_json)
87
+ end
88
+
89
+ # post: '/calendar/heat_event'
90
+ # @param [Hash] calendar_event calendar event to be created. See docs for parameters.
91
+ # @see https://api.nedap-bi.com/api/docs/
92
+ def create_heat_event(calendar_event = {})
93
+ ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/heat_event', calendar_event.to_json)
94
+ end
95
+
96
+ # put: '/calendar/heat_event/:calendar_event_id'
97
+ # @param [Integer] calendar_event_id calendar event to be updated.
98
+ # @param [Hash] calendar_event ({}) parameters to be updated. See docs for parameters.
99
+ # @see https://api.nedap-bi.com/api/docs/
100
+ def update_heat_event(calendar_event_id, calendar_event = {})
101
+ ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/heat_event/#{calendar_event_id}", calendar_event.to_json)
102
+ end
103
+
104
+ # post: '/calendar/keep_open_event'
105
+ # @param [Hash] calendar_event calendar event to be created. See docs for parameters.
106
+ # @see https://api.nedap-bi.com/api/docs/
107
+ def create_keep_open_event(calendar_event = {})
108
+ ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/keep_open_event', calendar_event.to_json)
109
+ end
110
+
111
+ # put: '/calendar/keep_open_event/:calendar_event_id'
112
+ # @param [Integer] calendar_event_id calendar event to be updated.
113
+ # @param [Hash] calendar_event ({}) parameters to be updated. See docs for parameters.
114
+ # @see https://api.nedap-bi.com/api/docs/
115
+ def update_keep_open_event(calendar_event_id, calendar_event = {})
116
+ ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/keep_open_event/#{calendar_event_id}", calendar_event.to_json)
117
+ end
118
+
119
+ # post: '/calendar/insemination_event'
120
+ # @param [Hash] calendar_event calendar event to be created. See docs for parameters.
121
+ # @see https://api.nedap-bi.com/api/docs/
122
+ def create_insemination_event(calendar_event = {})
123
+ ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/insemination_event', calendar_event.to_json)
124
+ end
125
+
126
+ # put: '/calendar/insemination_event/:calendar_event_id'
127
+ # @param [Integer] calendar_event_id calendar event to be updated.
128
+ # @param [Hash] calendar_event ({}) parameters to be updated. See docs for parameters.
129
+ # @see https://api.nedap-bi.com/api/docs/
130
+ def update_insemination_event(calendar_event_id, calendar_event = {})
131
+ ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/insemination_event/#{calendar_event_id}", calendar_event.to_json)
132
+ end
133
+
134
+ # post: '/calendar/pregnancy_check_event'
135
+ # @param [Hash] calendar_event calendar event to be created. See docs for parameters.
136
+ # @see https://api.nedap-bi.com/api/docs/
137
+ def create_pregnancy_check_event(calendar_event = {})
138
+ ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/pregnancy_check_event', calendar_event.to_json)
139
+ end
140
+
141
+ # put: '/calendar/pregnancy_check_event/:calendar_event_id'
142
+ # @param [Integer] calendar_event_id calendar event to be updated.
143
+ # @param [Hash] calendar_event ({}) parameters to be updated. See docs for parameters.
144
+ # @see https://api.nedap-bi.com/api/docs/
145
+ def update_pregnancy_check_event(calendar_event_id, calendar_event = {})
146
+ ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/pregnancy_check_event/#{calendar_event_id}", calendar_event.to_json)
147
+ end
148
+
149
+ # delete: '/calendar/:calendar_event_id'
150
+ # @param [Integer] calendar_event_id calendar event to be deleted.
151
+ # @see https://api.nedap-bi.com/api/docs/
152
+ def delete_calendar_event(calendar_event_id)
153
+ ::BusinessInsightApiClient::Mash.from_json client.delete("/calendar/#{calendar_event_id}")
154
+ end
155
+
156
+ end
157
+ end
158
+ end
@@ -0,0 +1,35 @@
1
+ module BusinessInsightApiClient
2
+ module Api
3
+
4
+ # Groups API based methods. This module contains methods to query the Groups API.
5
+ module Groups
6
+
7
+ # get: '/groups'
8
+ # @see https://api.nedap-bi.com/api/docs/
9
+ def groups
10
+ ::BusinessInsightApiClient::Mash.from_json client.get('/groups')
11
+ end
12
+ # get: '/groups/:id'
13
+ # @param [Integer] id group id
14
+ # @see https://api.nedap-bi.com/api/docs/
15
+ def group(id)
16
+ ::BusinessInsightApiClient::Mash.from_json client.get("/groups/#{id}")
17
+ end
18
+
19
+ # post: '/groups'
20
+ # @param [Hash] group ({}) group to be created. See docs for parameters.
21
+ # @see https://api.nedap-bi.com/api/docs/
22
+ def create_group(group = {})
23
+ ::BusinessInsightApiClient::Mash.from_json client.post('/groups', group.to_json)
24
+ end
25
+
26
+ # put: '/groups/:group_id'
27
+ # @param [Integer] group_id group to be updated.
28
+ # @param [Hash] group ({}) parameters to be updated. See docs for parameters.
29
+ # @see https://api.nedap-bi.com/api/docs/
30
+ def update_group(group_id, group = {})
31
+ ::BusinessInsightApiClient::Mash.from_json client.put("/groups/#{group_id}", group.to_json)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,14 @@
1
+ module BusinessInsightApiClient
2
+ module Api
3
+
4
+ # Installations API based methods. This module contains methods to query the Installations API.
5
+ module Installations
6
+
7
+ # get: '/installations'
8
+ # @see https://api.nedap-bi.com/api/docs/
9
+ def installations
10
+ ::BusinessInsightApiClient::Mash.from_json client.get('/installations')
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,77 @@
1
+ module BusinessInsightApiClient
2
+
3
+ # The client that has to make requests to the Business Insight Api.
4
+ # This class includes all api endpoint methods.
5
+ # See section Instance Method Summary, for available methods.
6
+ #
7
+ # @example Call an API method
8
+ # client = BusinessInsightApiClient::Client.new
9
+ # access_token = client.authorization.access_token_from_hash(token: 'abc', refresh_token: 'efc', expires_in: 30020, expires_at: 23939192)
10
+ # client.access_token= access_token
11
+ # animals = client.animals
12
+ # @see Api::Applications Applications endpoint methods.
13
+ # @see Api::Animals Animals endpoint methods.
14
+ # @see Api::Calendar Calendar endpoint methods.
15
+ # @see Api::Groups Groups endpoint methods.
16
+ # @see Api::Installations Installations endpoint methods.
17
+ class Client
18
+
19
+
20
+ include Api::Applications
21
+ include Api::Installations
22
+ include Api::Animals
23
+ include Api::Calendar
24
+ include Api::Groups
25
+
26
+ # Lists all options that are set for the client.
27
+ attr_reader :options
28
+
29
+
30
+ # Initializes a new Client with options.
31
+ # If no options are given the default configuration options are used for the client, like configured in BusinessInsightApiClient.configure.
32
+ # @example
33
+ # BusinessInsightApiClient::Client.new api_url: 'some url', client_id: 'some id' , client_secret: 'some secret'
34
+ # @param [Hash] options the options to configure the client.
35
+ # @option options [String] :api_url (BusinessInsightApiClient.api_url) the api url.
36
+ # @option options [String] :authorization_url (BusinessInsightApiClient.authorization_url) the authorization url of the api.
37
+ # @option options [String] :content_type (BusinessInsightApiClient.default_content_type) the content type used for sending and requesting.
38
+ # @option options [String] :client_id (BusinessInsightApiClient.client_id) the client id uses in OAuth authorization.
39
+ # @option options [String] :client_secret (BusinessInsightApiClient.client_secret) the client secret uses in OAuth authorization.
40
+ def initialize(options = {})
41
+ @options = options
42
+ @options[:api_url] ||= BusinessInsightApiClient.api_url
43
+ @options[:authorization_url] ||= BusinessInsightApiClient.authorization_url
44
+ @options[:content_type] ||= BusinessInsightApiClient.default_content_type
45
+ @options[:client_id] ||= BusinessInsightApiClient.client_id
46
+ @options[:client_secret] ||= BusinessInsightApiClient.client_secret
47
+ end
48
+
49
+ # Creates new or returns an existing Authorization helper.
50
+ # The helper can be used to retrieve OAuth Tokens from the Authorization server.
51
+ # The helper passes default options as configured with the client.
52
+ #
53
+ # @return [BusinessInsightApiClient::Helpers::Authorization] authorization helper.
54
+ def authorization
55
+ @authorization ||= BusinessInsightApiClient::Helpers::Authorization.new(options)
56
+ end
57
+
58
+
59
+ # Sets the access token to make requests with to the protected endpoints.
60
+ # Make sure the access token is not expired, or has enough time to make requests.
61
+ # Otherwise refresh the token with {OAuth2::AccessToken#refresh!}
62
+ # @param [OAuth2::AccessToken] token sets a auth token to make requests with.
63
+ # @see http://www.rubydoc.info/gems/oauth2/1.0.0/OAuth2/AccessToken OAuth2::AccessToken information
64
+ # @see http://www.rubydoc.info/gems/oauth2/1.0.0/OAuth2/AccessToken#refresh%21-instance_method Refreshing an Access Token.
65
+ def access_token=(token)
66
+ # TODO: fail when not access token class.
67
+ authorization.current_token = token
68
+ end
69
+
70
+ private
71
+
72
+ def client
73
+ @client ||= BusinessInsightApiClient::Helpers::RESTClient.new(authorization, options)
74
+ end
75
+ end
76
+ end
77
+
@@ -0,0 +1,60 @@
1
+ module BusinessInsightApiClient
2
+
3
+ # This module contains all errors that can be thrown by making requests to the API.
4
+ # All errors inherit from {StandardError}.
5
+ #
6
+ # @see Errors::BusinessInsightApiRequestError
7
+ # @see Errors::BadRequestError
8
+ # @see Errors::UnauthorizedError
9
+ # @see Errors::ForbiddenError
10
+ # @see Errors::NotFoundError
11
+ # @see Errors::InternalError
12
+ # @see Errors::UnavailableError
13
+ # @see Errors::RequestTimedOutError
14
+ module Errors
15
+
16
+ # General error class for Request based errors.
17
+ class BusinessInsightApiRequestError < StandardError
18
+
19
+ # @return [String] the full error message as received from the server.
20
+ attr_reader :full_code
21
+
22
+ # @return [Integer] the status code as received from the server
23
+ attr_reader :status_code
24
+
25
+ def initialize(status_code, full_code)
26
+ @status_code = status_code
27
+ @full_code = full_code
28
+ end
29
+ end
30
+
31
+ # This error is thrown when a bad request is made.
32
+ # This is a 400 status error.
33
+ class BadRequestError < BusinessInsightApiRequestError; end
34
+
35
+ # This error is thrown when a unauthorized request was made by the client.
36
+ # This is mostly caused by a missing or expired token.
37
+ # This is a 401 status error.
38
+ class UnauthorizedError < BusinessInsightApiRequestError; end
39
+
40
+ # This error is thrown when a request is made with insufficient scopes.
41
+ # This is an 403 status error.
42
+ class ForbiddenError < BusinessInsightApiRequestError; end
43
+
44
+ # This error is thrown when the page to which the request was made was not found.
45
+ # This is a 404 status error.
46
+ class NotFoundError < BusinessInsightApiRequestError; end
47
+
48
+ # This error is thrown when the request was malformed and the server had trouble processing the request.
49
+ # Possible due internal server bugs.
50
+ # This is a 500 status error.
51
+ class InternalError < BusinessInsightApiRequestError; end
52
+
53
+ #501, 502, 503
54
+ class UnavailableError < BusinessInsightApiRequestError; end
55
+
56
+ # This error is thrown when the request made was timed out.
57
+ # This could be because the server is unavailable to request. Check your internet settings or try again later.
58
+ class RequestTimedOutError < StandardError; end
59
+ end
60
+ end
@@ -0,0 +1,6 @@
1
+ module BusinessInsightApiClient
2
+ module Helpers
3
+ require 'business_insight_api_client/helpers/authorization'
4
+ require 'business_insight_api_client/helpers/restclient'
5
+ end
6
+ end
@@ -0,0 +1,94 @@
1
+ module BusinessInsightApiClient
2
+ module Helpers
3
+ require 'uri'
4
+
5
+ # Authorization helper, used as helper to interact with the OAuth2 authorization server.
6
+ class Authorization
7
+
8
+ DEFAULT_OPTIONS = {
9
+ authorization_url: 'https://nedap-bi.com',
10
+ client_id: '',
11
+ client_secret: ''
12
+ }
13
+
14
+
15
+ # @return [OAuth2:AccessToken] the access token.
16
+ attr_accessor :current_token
17
+
18
+ # @return [URI] the uri of the authorization server
19
+ attr_reader :authorization_url
20
+
21
+ # @return [String] the client id
22
+ attr_reader :client_id
23
+
24
+ # @return [String] the client secret
25
+ attr_reader :client_secret
26
+
27
+ # Creates a new authorization helper
28
+ #
29
+ # @param [Hash] options the options to create the Authorization Helper with.
30
+ # @option options [String] :authorization_url ('https://nedap-bi.com') the authorization url.
31
+ # @option options [String] :client_id ('') the client id
32
+ # @option options [String] :client_secret ('') the client secret
33
+ # @raise [URI::InvalidURIError] when the authorization_url given can not be parsed into an uri.
34
+ def initialize(options = {})
35
+ @authorization_url = URI(options[:authorization_url] || DEFAULT_OPTIONS[:authorization_url])
36
+ @client_id = options[:client_id] || DEFAULT_OPTIONS[:client_id]
37
+ @client_secret = options[:client_secret] || DEFAULT_OPTIONS[:client_secret]
38
+ end
39
+
40
+ # @return [OAuth2::AccessToken] returns the client credential token for the application.
41
+ def client_credential_token
42
+ oauth_client.client_credentials.get_token
43
+ end
44
+
45
+
46
+ # @return [Hash] the headers hash (includes Authorization token) as formatted with the configuration
47
+ def current_token_headers
48
+ return {} if current_token.nil?
49
+ current_token.headers
50
+ end
51
+
52
+ # Creates an URL to the authorization endpoint of the provider.
53
+ # When the user authorizes he will direct the user agent that follows this link to the redirect_uri.
54
+ #
55
+ # @param [Hash] params additional query parameters for the URL.
56
+ # @option params [String] :redirect_uri the redirect uri to which the client has to be redirected to.
57
+ def auth_code_authorize_url(params = {})
58
+ oauth_client.auth_code.authorize_url(params)
59
+ end
60
+
61
+ # Retrieve an access token given the specified validation code.
62
+ # When the token is verified it will direct the user agent that follows this link to the redirect_uri.
63
+ #
64
+ # @param [String] access_grant The Authorization Code value (Access Grant)
65
+ # @param [Hash] params additional params
66
+ # @option params [String] :redirect_uri the redirect uri to which the client has to be redirected to.
67
+ # @param [Hash] options options
68
+ def auth_code_token_from_access_grant(access_grant, params={},options={})
69
+ oauth_client.auth_code.get_token(access_grant,params,options)
70
+ end
71
+
72
+
73
+ # Creates an AccessToken from hash
74
+ #
75
+ # @param [Hash] options the options to create the Access Token with
76
+ # @option options [String] :token token the Access Token value
77
+ # @option options [String] :refresh_token (nil) the refresh_token value
78
+ # @option options [FixNum, String] :expires_in (nil) the number of seconds in which the AccessToken will expire
79
+ # @option options [FixNum, String] :expires_at (nil) the epoch time in seconds in which AccessToken will expire
80
+ # @return [OAuth2::AccessToken] an access token that can be used for API requests.
81
+ # @see http://www.rubydoc.info/gems/oauth2/1.0.0/OAuth2/AccessToken OAuth2::AccessToken information
82
+ def access_token_from_hash(options = {})
83
+ OAuth2::AccessToken.new oauth_client, options.delete(:token), options
84
+ end
85
+
86
+ private
87
+
88
+ def oauth_client
89
+ # raise_errors: false, to suppress OAuth2::Errors and to allow custom error handling
90
+ @oauth_client ||= OAuth2::Client.new(@client_id, @client_secret, site: @authorization_url, raise_errors: false)
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,111 @@
1
+ module BusinessInsightApiClient
2
+ module Helpers
3
+ require 'httpclient'
4
+ require 'uri'
5
+
6
+
7
+ # RESTClient helper, used as helper to interact with the API endpoints.
8
+ class RESTClient
9
+
10
+ include HTTPClient::Util
11
+
12
+ DEFAULT_OPTIONS = {
13
+ api_url: 'https://api.nedap-bi.com',
14
+ default_content_type: 'application/json',
15
+ }
16
+
17
+ API_VERSION_PATH = '/v1'
18
+
19
+ attr_reader :authorization
20
+
21
+ # @return [URI] the uri of the api.
22
+ attr_reader :base_uri
23
+
24
+ # @return [String] the content type set
25
+ attr_reader :content_type
26
+
27
+ # Creates a new RESTClient helper
28
+ #
29
+ # @param [Authorization] auhtorization the authorization helper used to create requests.
30
+ # @param [Hash] options the options to create the RESTClient Helper with.
31
+ # @option options [String] :api_url ('https://api.nedap-bi.com') the api url.
32
+ # @option options [String] :content_type ('application/json') the content type of requests.
33
+ # @raise [URI::InvalidURIError] when the api_url given can not be parsed into an uri.
34
+ def initialize(authorization, options = {})
35
+ @authorization = authorization
36
+ @base_uri = URI(options[:api_url] || DEFAULT_OPTIONS[:api_url])
37
+ @content_type = options[:content_type] || DEFAULT_OPTIONS[:default_content_type]
38
+ end
39
+
40
+ def get(path, *args, &block)
41
+ build_path(path)
42
+ begin
43
+ arguments = argument_to_hash(args,:query, :body, :header, :follow_redirect) || {}
44
+ arguments[:header] = access_token_header.merge(arguments[:header] || {})
45
+ response = client.request(:get, @base_uri.to_s, arguments, &block)
46
+ rescue HTTPClient::TimeoutError
47
+ raise ::BusinessInsightApiClient::Errors::RequestTimedOutError
48
+ end
49
+ raise_errors(response)
50
+ response.body
51
+ end
52
+
53
+ def put(path, body = '')
54
+ build_path(path)
55
+ response = client.put(@base_uri.to_s, body: body, header: { 'Content-Type' => content_type, 'Accept' => content_type}.merge(access_token_header))
56
+ raise_errors(response)
57
+ response.body
58
+ end
59
+
60
+ def post(path, body = '')
61
+ build_path(path)
62
+ response = client.post(@base_uri.to_s, body: body, header: { 'Content-Type' => content_type, 'Accept' => content_type}.merge(access_token_header))
63
+ raise_errors(response)
64
+ response.body
65
+ end
66
+
67
+ def delete(path)
68
+ build_path(path)
69
+ response = client.delete(@base_uri.to_s, header: access_token_header)
70
+ raise_errors(response)
71
+ response.body
72
+ end
73
+
74
+ private
75
+
76
+ def access_token_header
77
+ authorization.current_token_headers
78
+ end
79
+
80
+ def build_path(path)
81
+ @base_uri.path = "#{API_VERSION_PATH}#{path}"
82
+ end
83
+
84
+ def client
85
+ @client ||= HTTPClient.new
86
+ end
87
+
88
+ def raise_errors(response)
89
+ case response.status
90
+ when 400
91
+ response_body = BusinessInsightApiClient::Mash.from_json(response.body)
92
+ raise ::BusinessInsightApiClient::Errors::BadRequestError.new(response.status, response_body), "(#{response.status}): #{[*response_body.messages].join(', ')}"
93
+ when 401
94
+ response_body = BusinessInsightApiClient::Mash.from_json(response.body)
95
+ raise ::BusinessInsightApiClient::Errors::UnauthorizedError.new(response.status,response_body),"(#{response.status}): #{[*response_body.messages].join(', ')}"
96
+ when 403
97
+ response_body = BusinessInsightApiClient::Mash.from_json(response.body)
98
+ raise ::BusinessInsightApiClient::Errors::ForbiddenError.new(response.status, response_body), "(#{response.status}): #{[*response_body.messages].join(', ')}"
99
+ when 404
100
+ response_body = BusinessInsightApiClient::Mash.from_json(response.body)
101
+ raise ::BusinessInsightApiClient::Errors::NotFoundError.new(response.status, response_body), "(#{response.status}): #{[*response_body.messages].join(', ')}"
102
+ when 500
103
+ raise ::BusinessInsightApiClient::Errors::InternalError.new(response.status, response.reason), "#{response.code} : #{response.reason}"
104
+ when 501..503
105
+ raise ::BusinessInsightApiClient::Errors::UnavailableError.new(response.status, response.reason),"#{response.code} : #{response.reason}"
106
+ end
107
+ end
108
+
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,11 @@
1
+ require 'hashie'
2
+ require 'multi_json'
3
+
4
+ module BusinessInsightApiClient
5
+ class Mash < ::Hashie::Mash
6
+ def self.from_json(json_string)
7
+ result_hash = ::MultiJson.decode(json_string)
8
+ new(result_hash)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module BusinessInsightApiClient
2
+ VERSION = '0.2.0'
3
+ end
metadata ADDED
@@ -0,0 +1,263 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: business_insight_api_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Nedap
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: multi_json
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 1.10.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.10.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: httpclient
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 2.4.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 2.4.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: hashie
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 3.2.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 3.2.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: oauth2
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.0.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '1.6'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '1.6'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: 3.0.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: 3.0.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: guard
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 2.6.1
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: 2.6.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: guard-rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ~>
130
+ - !ruby/object:Gem::Version
131
+ version: 4.2.10
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ~>
137
+ - !ruby/object:Gem::Version
138
+ version: 4.2.10
139
+ - !ruby/object:Gem::Dependency
140
+ name: webmock
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ~>
144
+ - !ruby/object:Gem::Version
145
+ version: 1.18.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ~>
151
+ - !ruby/object:Gem::Version
152
+ version: 1.18.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: vcr
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ~>
158
+ - !ruby/object:Gem::Version
159
+ version: 2.9.2
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ~>
165
+ - !ruby/object:Gem::Version
166
+ version: 2.9.2
167
+ - !ruby/object:Gem::Dependency
168
+ name: yard
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ~>
172
+ - !ruby/object:Gem::Version
173
+ version: 0.8.7.6
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ~>
179
+ - !ruby/object:Gem::Version
180
+ version: 0.8.7.6
181
+ - !ruby/object:Gem::Dependency
182
+ name: inch
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ~>
186
+ - !ruby/object:Gem::Version
187
+ version: 0.5.7
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ~>
193
+ - !ruby/object:Gem::Version
194
+ version: 0.5.7
195
+ - !ruby/object:Gem::Dependency
196
+ name: rspec-collection_matchers
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - '>='
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ description: Business Insight API client
210
+ email:
211
+ - development-lm@nedap.com
212
+ executables: []
213
+ extensions: []
214
+ extra_rdoc_files: []
215
+ files:
216
+ - .gitignore
217
+ - .rspec
218
+ - Gemfile
219
+ - Guardfile
220
+ - LICENSE.txt
221
+ - README.md
222
+ - Rakefile
223
+ - business_insight_api_client.gemspec
224
+ - lib/business_insight_api_client.rb
225
+ - lib/business_insight_api_client/api.rb
226
+ - lib/business_insight_api_client/api/animals.rb
227
+ - lib/business_insight_api_client/api/applications.rb
228
+ - lib/business_insight_api_client/api/calendars.rb
229
+ - lib/business_insight_api_client/api/groups.rb
230
+ - lib/business_insight_api_client/api/installations.rb
231
+ - lib/business_insight_api_client/client.rb
232
+ - lib/business_insight_api_client/errors.rb
233
+ - lib/business_insight_api_client/helpers.rb
234
+ - lib/business_insight_api_client/helpers/authorization.rb
235
+ - lib/business_insight_api_client/helpers/restclient.rb
236
+ - lib/business_insight_api_client/mash.rb
237
+ - lib/business_insight_api_client/version.rb
238
+ homepage: https://developer.nedap-bi.com
239
+ licenses:
240
+ - MIT
241
+ metadata: {}
242
+ post_install_message:
243
+ rdoc_options: []
244
+ require_paths:
245
+ - lib
246
+ required_ruby_version: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - '>='
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
251
+ required_rubygems_version: !ruby/object:Gem::Requirement
252
+ requirements:
253
+ - - '>='
254
+ - !ruby/object:Gem::Version
255
+ version: '0'
256
+ requirements: []
257
+ rubyforge_project:
258
+ rubygems_version: 2.2.2
259
+ signing_key:
260
+ specification_version: 4
261
+ summary: A gem to interact with the Business Insight Api.
262
+ test_files: []
263
+ has_rdoc: