-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from databox/release/0.4.0/1720687697207
[SDK release] Generated SDK code based on data-link 0.4.0 API changes
- Loading branch information
Showing
35 changed files
with
3,376 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,106 @@ | ||
# Databox bindings for Ruby | ||
# databox | ||
|
||
[![Build Status][travis-badge]][travis] | ||
[![Gem Version](https://badge.fury.io/rb/databox.svg)](https://badge.fury.io/rb/databox) | ||
Databox - the Ruby gem for the Static OpenAPI document of Push API resource | ||
|
||
Ruby Gem for [Databox](http://databox.com/) - Mobile Executive Dashboard. | ||
Push API resources Open API documentation | ||
|
||
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: | ||
|
||
- API version: 0.4.0 | ||
- Package version: 2.1.1 | ||
- Generator version: 7.6.0 | ||
- Build package: org.openapitools.codegen.languages.RubyClientCodegen | ||
|
||
## Installation | ||
|
||
Add this line to your application's Gemfile: | ||
### Build a gem | ||
|
||
gem 'databox' | ||
To build the Ruby code into a gem: | ||
|
||
And then execute: | ||
```shell | ||
gem build databox.gemspec | ||
``` | ||
|
||
$ bundle | ||
Then either install the gem locally: | ||
|
||
Or install it yourself as: | ||
```shell | ||
gem install ./databox-2.1.1.gem | ||
``` | ||
|
||
$ gem install databox | ||
(for development, run `gem install --dev ./databox-2.1.1.gem` to install the development dependencies) | ||
|
||
## Initialisation | ||
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). | ||
|
||
Before pushing data to Databox you have to initialize it with token. | ||
Finally add this to the Gemfile: | ||
|
||
```ruby | ||
Databox.configure do |c| | ||
c.push_token = "YOUR_TOKEN" | ||
end | ||
``` | ||
gem 'databox', '~> 2.1.1' | ||
|
||
## Usage | ||
### Install from Git | ||
|
||
Pushing data directly to Databox with help of `push` method: | ||
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: | ||
|
||
```ruby | ||
client = Databox::Client.new | ||
gem 'databox', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' | ||
|
||
### Include the Ruby code directly | ||
|
||
client.push(key: 'sales.total', value: 3000) | ||
client.push(key: 'temp.boston', value: 52.0) | ||
client.push(key: 'temp.boston', value: 52.0, date: '2015-01-01 17:00:00') | ||
client.push(key: 'temp.boston', value: 52.0, attributes: { | ||
location: 'boston-south' | ||
}) | ||
Include the Ruby code directly using `-I` as follows: | ||
|
||
```shell | ||
ruby -Ilib script.rb | ||
``` | ||
|
||
Inserting multiple matrices with one `insert_all`: | ||
## Getting Started | ||
|
||
Please follow the [installation](#installation) procedure and then run the following code: | ||
|
||
```ruby | ||
client = Databox::Client.new | ||
# Load the gem | ||
require 'databox' | ||
|
||
# Setup authorization | ||
Databox.configure do |config| | ||
# Configure HTTP basic authorization: basicAuth | ||
config.username = 'YOUR_USERNAME' | ||
config.password = 'YOUR_PASSWORD' | ||
end | ||
|
||
client.insert_all [ | ||
{key: 'temp.boston', value: 52}, | ||
{key: 'temp.boston', value: 50, date: '2015-01-01 17:00:00'}, | ||
{key: 'temp.ny', value: 49} | ||
] | ||
``` | ||
api_instance = Databox::DefaultApi.new | ||
|
||
Retrieving information from last push with `last_push`: | ||
begin | ||
api_instance.data_delete | ||
rescue Databox::ApiError => e | ||
puts "Exception when calling DefaultApi->data_delete: #{e}" | ||
end | ||
|
||
```ruby | ||
client.last_push | ||
|
||
# => | ||
#[{ | ||
# "push"=>"{\"data\":[{\"$sales.total\":2000}]}", | ||
# "err"=>"[]", | ||
# "no_err"=>0, | ||
# "datetime"=>"2015-06-05T10:21:23.861Z", | ||
# "keys"=>"[\"132|sales.total\"]" | ||
#}] | ||
``` | ||
|
||
## Resources | ||
- [Databox Web App](https://app.databox.com/) | ||
- [Databox Developers Portal](https://developers.databox.com/) | ||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *https://push.databox.com* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*Databox::DefaultApi* | [**data_delete**](docs/DefaultApi.md#data_delete) | **DELETE** /data | | ||
*Databox::DefaultApi* | [**data_metric_key_delete**](docs/DefaultApi.md#data_metric_key_delete) | **DELETE** /data/{metricKey} | | ||
*Databox::DefaultApi* | [**data_post**](docs/DefaultApi.md#data_post) | **POST** /data | | ||
*Databox::DefaultApi* | [**metrickeys_get**](docs/DefaultApi.md#metrickeys_get) | **GET** /metrickeys | | ||
*Databox::DefaultApi* | [**metrickeys_post**](docs/DefaultApi.md#metrickeys_post) | **POST** /metrickeys | | ||
*Databox::DefaultApi* | [**ping_get**](docs/DefaultApi.md#ping_get) | **GET** /ping | | ||
|
||
|
||
## Documentation for Models | ||
|
||
- [Databox::ApiResponse](docs/ApiResponse.md) | ||
- [Databox::PushData](docs/PushData.md) | ||
- [Databox::PushDataAttribute](docs/PushDataAttribute.md) | ||
- [Databox::State](docs/State.md) | ||
|
||
|
||
## Documentation for Authorization | ||
|
||
|
||
## Author & License | ||
- [Oto Brglez](https://github.com/otobrglez) | ||
- [Vlada Petrović](https://github.com/VladaPetrovic) | ||
Authentication schemes defined for the API: | ||
### basicAuth | ||
|
||
## License | ||
- Comes with `MIT` license and terms. | ||
- **Type**: HTTP basic authentication | ||
|
||
[travis-badge]: https://secure.travis-ci.org/databox/databox-ruby.png?branch=v2 | ||
[travis]: http://travis-ci.org/databox/databox-ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Generated by: https://openapi-generator.tech | ||
# | ||
|
||
*.gem | ||
*.rbc | ||
/.config | ||
/coverage/ | ||
/InstalledFiles | ||
/pkg/ | ||
/spec/reports/ | ||
/spec/examples.txt | ||
/test/tmp/ | ||
/test/version_tmp/ | ||
/tmp/ | ||
|
||
## Specific to RubyMotion: | ||
.dat* | ||
.repl_history | ||
build/ | ||
|
||
## Documentation cache and generated files: | ||
/.yardoc/ | ||
/_yardoc/ | ||
/doc/ | ||
/rdoc/ | ||
|
||
## Environment normalization: | ||
/.bundle/ | ||
/vendor/bundle | ||
/lib/bundler/man/ | ||
|
||
# for a library or gem, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# Gemfile.lock | ||
# .ruby-version | ||
# .ruby-gemset | ||
|
||
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: | ||
.rvmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.ruby: &ruby | ||
variables: | ||
LANG: "C.UTF-8" | ||
before_script: | ||
- ruby -v | ||
- bundle config set --local deployment true | ||
- bundle install -j $(nproc) | ||
parallel: | ||
matrix: | ||
- RUBY_VERSION: ['2.7', '3.0', '3.1'] | ||
image: "ruby:$RUBY_VERSION" | ||
cache: | ||
paths: | ||
- vendor/ruby | ||
key: 'ruby-$RUBY_VERSION' | ||
|
||
gem: | ||
extends: .ruby | ||
script: | ||
- bundle exec rspec | ||
- bundle exec rake build | ||
- bundle exec rake install | ||
artifacts: | ||
paths: | ||
- pkg/*.gem | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.gitignore | ||
.gitlab-ci.yml | ||
.openapi-generator-ignore | ||
.rspec | ||
.rubocop.yml | ||
.travis.yml | ||
Gemfile | ||
README.md | ||
Rakefile | ||
databox.gemspec | ||
docs/ApiResponse.md | ||
docs/DefaultApi.md | ||
docs/PushData.md | ||
docs/PushDataAttribute.md | ||
docs/State.md | ||
git_push.sh | ||
lib/databox.rb | ||
lib/databox/api/default_api.rb | ||
lib/databox/api_client.rb | ||
lib/databox/api_error.rb | ||
lib/databox/configuration.rb | ||
lib/databox/models/api_response.rb | ||
lib/databox/models/push_data.rb | ||
lib/databox/models/push_data_attribute.rb | ||
lib/databox/models/state.rb | ||
lib/databox/version.rb | ||
spec/api/default_api_spec.rb | ||
spec/models/api_response_spec.rb | ||
spec/models/push_data_attribute_spec.rb | ||
spec/models/push_data_spec.rb | ||
spec/models/state_spec.rb | ||
spec/spec_helper.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--require spec_helper |
Oops, something went wrong.