finspot-sdk 0.0.2
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 +7 -0
- data/Gemfile +9 -0
- data/README.md +87 -0
- data/Rakefile +10 -0
- data/docs/DefaultApi.md +66 -0
- data/finspot-sdk.gemspec +39 -0
- data/git_push.sh +57 -0
- data/lib/finspot-sdk/api/default_api.rb +75 -0
- data/lib/finspot-sdk/api_client.rb +393 -0
- data/lib/finspot-sdk/api_error.rb +58 -0
- data/lib/finspot-sdk/configuration.rb +301 -0
- data/lib/finspot-sdk/version.rb +15 -0
- data/lib/finspot-sdk.rb +40 -0
- data/spec/api/default_api_spec.rb +45 -0
- data/spec/spec_helper.rb +111 -0
- metadata +99 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5dce4238f67bb43e10ec7bed9e1cdaa335448146ac497c5b4ddcd5a2bc0a6031
|
4
|
+
data.tar.gz: 837f7b035174674361637dc5b493de5022a7c9d8ee7dddcc286c938ce62287ad
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a76b61caaae04ca99ec942cb7357aa686262a3fdf22e934075d44f0079cbf11622f496ca67a4dd27fdc198d029fa21077143899c2c09dac06efe022ba889d31b
|
7
|
+
data.tar.gz: 988398328934a5416b3e8105f53ffcd52c346fee7375c4114592810eb9990db548c8f1b31d213ebdfc6b81eea8c51a58c4a13dc9ab380c2ba68f51406a4102cc
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
# finspot-sdk
|
2
|
+
|
3
|
+
FinspotSDK - the Ruby gem for the Finspot API
|
4
|
+
|
5
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
6
|
+
|
7
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
|
+
|
9
|
+
- API version: 1.0.0
|
10
|
+
- Package version: 0.0.2
|
11
|
+
- Generator version: 7.8.0-SNAPSHOT
|
12
|
+
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
### Build a gem
|
17
|
+
|
18
|
+
To build the Ruby code into a gem:
|
19
|
+
|
20
|
+
```shell
|
21
|
+
gem build finspot-sdk.gemspec
|
22
|
+
```
|
23
|
+
|
24
|
+
Then either install the gem locally:
|
25
|
+
|
26
|
+
```shell
|
27
|
+
gem install ./finspot-sdk-0.0.2.gem
|
28
|
+
```
|
29
|
+
|
30
|
+
(for development, run `gem install --dev ./finspot-sdk-0.0.2.gem` to install the development dependencies)
|
31
|
+
|
32
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
33
|
+
|
34
|
+
Finally add this to the Gemfile:
|
35
|
+
|
36
|
+
gem 'finspot-sdk', '~> 0.0.2'
|
37
|
+
|
38
|
+
### Install from Git
|
39
|
+
|
40
|
+
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:
|
41
|
+
|
42
|
+
gem 'finspot-sdk', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
43
|
+
|
44
|
+
### Include the Ruby code directly
|
45
|
+
|
46
|
+
Include the Ruby code directly using `-I` as follows:
|
47
|
+
|
48
|
+
```shell
|
49
|
+
ruby -Ilib script.rb
|
50
|
+
```
|
51
|
+
|
52
|
+
## Getting Started
|
53
|
+
|
54
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
# Load the gem
|
58
|
+
require 'finspot-sdk'
|
59
|
+
|
60
|
+
api_instance = FinspotSDK::DefaultApi.new
|
61
|
+
|
62
|
+
begin
|
63
|
+
#Enquire health
|
64
|
+
api_instance.up_get
|
65
|
+
rescue FinspotSDK::ApiError => e
|
66
|
+
puts "Exception when calling DefaultApi->up_get: #{e}"
|
67
|
+
end
|
68
|
+
|
69
|
+
```
|
70
|
+
|
71
|
+
## Documentation for API Endpoints
|
72
|
+
|
73
|
+
All URIs are relative to *http://localhost*
|
74
|
+
|
75
|
+
Class | Method | HTTP request | Description
|
76
|
+
------------ | ------------- | ------------- | -------------
|
77
|
+
*FinspotSDK::DefaultApi* | [**up_get**](docs/DefaultApi.md#up_get) | **GET** /up | Enquire health
|
78
|
+
|
79
|
+
|
80
|
+
## Documentation for Models
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
## Documentation for Authorization
|
85
|
+
|
86
|
+
Endpoints do not require authorization.
|
87
|
+
|
data/Rakefile
ADDED
data/docs/DefaultApi.md
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# FinspotSDK::DefaultApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://localhost*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**up_get**](DefaultApi.md#up_get) | **GET** /up | Enquire health |
|
8
|
+
|
9
|
+
|
10
|
+
## up_get
|
11
|
+
|
12
|
+
> up_get
|
13
|
+
|
14
|
+
Enquire health
|
15
|
+
|
16
|
+
### Examples
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
require 'time'
|
20
|
+
require 'finspot-sdk'
|
21
|
+
|
22
|
+
api_instance = FinspotSDK::DefaultApi.new
|
23
|
+
|
24
|
+
begin
|
25
|
+
# Enquire health
|
26
|
+
api_instance.up_get
|
27
|
+
rescue FinspotSDK::ApiError => e
|
28
|
+
puts "Error when calling DefaultApi->up_get: #{e}"
|
29
|
+
end
|
30
|
+
```
|
31
|
+
|
32
|
+
#### Using the up_get_with_http_info variant
|
33
|
+
|
34
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
35
|
+
|
36
|
+
> <Array(nil, Integer, Hash)> up_get_with_http_info
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
begin
|
40
|
+
# Enquire health
|
41
|
+
data, status_code, headers = api_instance.up_get_with_http_info
|
42
|
+
p status_code # => 2xx
|
43
|
+
p headers # => { ... }
|
44
|
+
p data # => nil
|
45
|
+
rescue FinspotSDK::ApiError => e
|
46
|
+
puts "Error when calling DefaultApi->up_get_with_http_info: #{e}"
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
50
|
+
### Parameters
|
51
|
+
|
52
|
+
This endpoint does not need any parameter.
|
53
|
+
|
54
|
+
### Return type
|
55
|
+
|
56
|
+
nil (empty response body)
|
57
|
+
|
58
|
+
### Authorization
|
59
|
+
|
60
|
+
No authorization required
|
61
|
+
|
62
|
+
### HTTP request headers
|
63
|
+
|
64
|
+
- **Content-Type**: Not defined
|
65
|
+
- **Accept**: Not defined
|
66
|
+
|
data/finspot-sdk.gemspec
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
=begin
|
4
|
+
#Finspot API
|
5
|
+
|
6
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
|
10
|
+
Generated by: https://openapi-generator.tech
|
11
|
+
Generator version: 7.8.0-SNAPSHOT
|
12
|
+
|
13
|
+
=end
|
14
|
+
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
16
|
+
require "finspot-sdk/version"
|
17
|
+
|
18
|
+
Gem::Specification.new do |s|
|
19
|
+
s.name = "finspot-sdk"
|
20
|
+
s.version = FinspotSDK::VERSION
|
21
|
+
s.platform = Gem::Platform::RUBY
|
22
|
+
s.authors = ["OpenAPI-Generator"]
|
23
|
+
s.email = [""]
|
24
|
+
s.homepage = "https://openapi-generator.tech"
|
25
|
+
s.summary = "Finspot API Ruby Gem"
|
26
|
+
s.description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)"
|
27
|
+
s.license = "Unlicense"
|
28
|
+
s.required_ruby_version = ">= 2.7"
|
29
|
+
s.metadata = {}
|
30
|
+
|
31
|
+
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
32
|
+
|
33
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
34
|
+
|
35
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
36
|
+
s.test_files = `find spec/*`.split("\n")
|
37
|
+
s.executables = []
|
38
|
+
s.require_paths = ["lib"]
|
39
|
+
end
|
data/git_push.sh
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="GIT_USER_ID"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=$(git remote)
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
@@ -0,0 +1,75 @@
|
|
1
|
+
=begin
|
2
|
+
#Finspot API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.8.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module FinspotSDK
|
16
|
+
class DefaultApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Enquire health
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [nil]
|
25
|
+
def up_get(opts = {})
|
26
|
+
up_get_with_http_info(opts)
|
27
|
+
nil
|
28
|
+
end
|
29
|
+
|
30
|
+
# Enquire health
|
31
|
+
# @param [Hash] opts the optional parameters
|
32
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
33
|
+
def up_get_with_http_info(opts = {})
|
34
|
+
if @api_client.config.debugging
|
35
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.up_get ...'
|
36
|
+
end
|
37
|
+
# resource path
|
38
|
+
local_var_path = '/up'
|
39
|
+
|
40
|
+
# query parameters
|
41
|
+
query_params = opts[:query_params] || {}
|
42
|
+
|
43
|
+
# header parameters
|
44
|
+
header_params = opts[:header_params] || {}
|
45
|
+
|
46
|
+
# form parameters
|
47
|
+
form_params = opts[:form_params] || {}
|
48
|
+
|
49
|
+
# http body (model)
|
50
|
+
post_body = opts[:debug_body]
|
51
|
+
|
52
|
+
# return_type
|
53
|
+
return_type = opts[:debug_return_type]
|
54
|
+
|
55
|
+
# auth_names
|
56
|
+
auth_names = opts[:debug_auth_names] || []
|
57
|
+
|
58
|
+
new_options = opts.merge(
|
59
|
+
:operation => :"DefaultApi.up_get",
|
60
|
+
:header_params => header_params,
|
61
|
+
:query_params => query_params,
|
62
|
+
:form_params => form_params,
|
63
|
+
:body => post_body,
|
64
|
+
:auth_names => auth_names,
|
65
|
+
:return_type => return_type
|
66
|
+
)
|
67
|
+
|
68
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
69
|
+
if @api_client.config.debugging
|
70
|
+
@api_client.config.logger.debug "API called: DefaultApi#up_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
71
|
+
end
|
72
|
+
return data, status_code, headers
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|