primary_connect_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 +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +72 -0
- data/README.md +100 -0
- data/Rakefile +10 -0
- data/git_push.sh +58 -0
- data/lib/primary_connect_client/api/default_api.rb +390 -0
- data/lib/primary_connect_client/api_client.rb +390 -0
- data/lib/primary_connect_client/api_error.rb +57 -0
- data/lib/primary_connect_client/configuration.rb +293 -0
- data/lib/primary_connect_client/version.rb +5 -0
- data/lib/primary_connect_client.rb +38 -0
- data/primary_connect_client.gemspec +36 -0
- data/spec/api/default_api_spec.rb +112 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/protobuf/address_spec.rb +9 -0
- data/spec/spec_helper.rb +111 -0
- metadata +120 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 699042c06622cea329a378b739e35742f3eb92ef1b6ecb0920ba8506ce8e09da
|
4
|
+
data.tar.gz: 318f90b7aaef69fd641cd99a702185c60a437e441ac30e417524a2030ca08dbe
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 974d84bfcc90ec201a68c662c55979ab01b6122541da4c11b133999086d079da89622e8defa1d4fb0eee4d0424204f72e9f5fa871ca167b25cd7ceea947cff58
|
7
|
+
data.tar.gz: 5575f16d3ba53aeb091d59f2a4060b2447cd52031907f180f587f23e36f09fbb112aa2f3535d3f6aef2de5d1693e470101cc6c69044307a6c6adf5893f2b8aec
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
primary_connect_client (0.0.1)
|
5
|
+
primary_connect_proto (~> 0.0.8)
|
6
|
+
typhoeus (~> 1.0, >= 1.0.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ast (2.4.2)
|
12
|
+
byebug (11.1.3)
|
13
|
+
coderay (1.1.3)
|
14
|
+
diff-lcs (1.4.4)
|
15
|
+
ethon (0.15.0)
|
16
|
+
ffi (>= 1.15.0)
|
17
|
+
ffi (1.15.4)
|
18
|
+
google-protobuf (4.0.0.rc.1)
|
19
|
+
jaro_winkler (1.5.4)
|
20
|
+
method_source (1.0.0)
|
21
|
+
parallel (1.21.0)
|
22
|
+
parser (3.0.2.0)
|
23
|
+
ast (~> 2.4.1)
|
24
|
+
primary_connect_proto (0.0.8)
|
25
|
+
google-protobuf (= 4.0.0.rc1)
|
26
|
+
pry (0.13.1)
|
27
|
+
coderay (~> 1.1)
|
28
|
+
method_source (~> 1.0)
|
29
|
+
pry-byebug (3.9.0)
|
30
|
+
byebug (~> 11.0)
|
31
|
+
pry (~> 0.13.0)
|
32
|
+
psych (4.0.2)
|
33
|
+
rainbow (3.0.0)
|
34
|
+
rake (13.0.6)
|
35
|
+
rspec (3.10.0)
|
36
|
+
rspec-core (~> 3.10.0)
|
37
|
+
rspec-expectations (~> 3.10.0)
|
38
|
+
rspec-mocks (~> 3.10.0)
|
39
|
+
rspec-core (3.10.1)
|
40
|
+
rspec-support (~> 3.10.0)
|
41
|
+
rspec-expectations (3.10.1)
|
42
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
43
|
+
rspec-support (~> 3.10.0)
|
44
|
+
rspec-mocks (3.10.2)
|
45
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
+
rspec-support (~> 3.10.0)
|
47
|
+
rspec-support (3.10.3)
|
48
|
+
rubocop (0.66.0)
|
49
|
+
jaro_winkler (~> 1.5.1)
|
50
|
+
parallel (~> 1.10)
|
51
|
+
parser (>= 2.5, != 2.5.1.1)
|
52
|
+
psych (>= 3.1.0)
|
53
|
+
rainbow (>= 2.2.2, < 4.0)
|
54
|
+
ruby-progressbar (~> 1.7)
|
55
|
+
unicode-display_width (>= 1.4.0, < 1.6)
|
56
|
+
ruby-progressbar (1.11.0)
|
57
|
+
typhoeus (1.4.0)
|
58
|
+
ethon (>= 0.9.0)
|
59
|
+
unicode-display_width (1.5.0)
|
60
|
+
|
61
|
+
PLATFORMS
|
62
|
+
ruby
|
63
|
+
|
64
|
+
DEPENDENCIES
|
65
|
+
primary_connect_client!
|
66
|
+
pry-byebug
|
67
|
+
rake (~> 13.0.1)
|
68
|
+
rspec (~> 3.6, >= 3.6.0)
|
69
|
+
rubocop (~> 0.66.0)
|
70
|
+
|
71
|
+
BUNDLED WITH
|
72
|
+
2.2.32
|
data/README.md
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
# primary_connect_client
|
2
|
+
|
3
|
+
PrimaryConnectClient - the Ruby gem for the Primary Connect API V1
|
4
|
+
|
5
|
+
Client Library to interface with Primary Connect
|
6
|
+
|
7
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
|
+
|
9
|
+
- API version: v1
|
10
|
+
- Package version: 1.0.0
|
11
|
+
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
### Build a gem
|
16
|
+
|
17
|
+
To build the Ruby code into a gem:
|
18
|
+
|
19
|
+
```shell
|
20
|
+
gem build primary_connect_client.gemspec
|
21
|
+
```
|
22
|
+
|
23
|
+
Then either install the gem locally:
|
24
|
+
|
25
|
+
```shell
|
26
|
+
gem install ./primary_connect_client-1.0.0.gem
|
27
|
+
```
|
28
|
+
|
29
|
+
(for development, run `gem install --dev ./primary_connect_client-1.0.0.gem` to install the development dependencies)
|
30
|
+
|
31
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
32
|
+
|
33
|
+
Finally add this to the Gemfile:
|
34
|
+
|
35
|
+
gem 'primary_connect_client', '~> 1.0.0'
|
36
|
+
|
37
|
+
### Install from Git
|
38
|
+
|
39
|
+
If the Ruby gem is hosted at a git repository: https://github.com/PrimaryDotHealth/connect-ruby-client, then add the following in the Gemfile:
|
40
|
+
|
41
|
+
gem 'primary_connect_client', :git => 'https://github.com/PrimaryDotHealth/connect-ruby-client.git'
|
42
|
+
|
43
|
+
### Include the Ruby code directly
|
44
|
+
|
45
|
+
Include the Ruby code directly using `-I` as follows:
|
46
|
+
|
47
|
+
```shell
|
48
|
+
ruby -Ilib script.rb
|
49
|
+
```
|
50
|
+
|
51
|
+
## Getting Started
|
52
|
+
|
53
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
# Load the gem
|
57
|
+
require 'primary_connect_client'
|
58
|
+
|
59
|
+
# Setup authorization
|
60
|
+
PrimaryConnectClient.configure do |config|
|
61
|
+
# Configure Bearer authorization: bearer_auth
|
62
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
63
|
+
end
|
64
|
+
|
65
|
+
api_instance = PrimaryConnectClient::DefaultApi.new
|
66
|
+
opts = {
|
67
|
+
order: Primary::Connect::Order.new.to_json # Order |
|
68
|
+
}
|
69
|
+
|
70
|
+
begin
|
71
|
+
#create order
|
72
|
+
api_instance.create_order(opts)
|
73
|
+
rescue PrimaryConnectClient::ApiError => e
|
74
|
+
puts "Exception when calling DefaultApi->create_order: #{e}"
|
75
|
+
end
|
76
|
+
|
77
|
+
```
|
78
|
+
|
79
|
+
## Documentation for API Endpoints
|
80
|
+
|
81
|
+
All URIs are relative to *https://connect.primary.health*
|
82
|
+
|
83
|
+
| Class | Method | HTTP request | Description |
|
84
|
+
| ---------------------------------- | --------------------------------------------------- | ---------------------------------------------- | ------------ |
|
85
|
+
| _PrimaryConnectClient::DefaultApi_ | [**create_order**](docs/DefaultApi.md#create_order) | **POST** /api/v1/orders | create order |
|
86
|
+
| _PrimaryConnectClient::DefaultApi_ | [**get_order**](docs/DefaultApi.md#get_order) | **GET** /api/v1/orders/{id} | show order |
|
87
|
+
| _PrimaryConnectClient::DefaultApi_ | [**get_result**](docs/DefaultApi.md#get_result) | **GET** /api/v1/orders/{order_id}/results/{id} | show result |
|
88
|
+
| _PrimaryConnectClient::DefaultApi_ | [**list_events**](docs/DefaultApi.md#list_events) | **GET** /api/v1/events | list events |
|
89
|
+
| _PrimaryConnectClient::DefaultApi_ | [**list_orders**](docs/DefaultApi.md#list_orders) | **GET** /api/v1/orders | list orders |
|
90
|
+
| _PrimaryConnectClient::DefaultApi_ | [**list_results**](docs/DefaultApi.md#list_results) | **GET** /api/v1/orders/{order_id}/results | list results |
|
91
|
+
|
92
|
+
## Documentation for Models
|
93
|
+
|
94
|
+
**TODO**
|
95
|
+
|
96
|
+
## Documentation for Authorization
|
97
|
+
|
98
|
+
### bearer_auth
|
99
|
+
|
100
|
+
- **Type**: Bearer authentication
|
data/Rakefile
ADDED
data/git_push.sh
ADDED
@@ -0,0 +1,58 @@
|
|
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-pestore-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'
|
58
|
+
|
@@ -0,0 +1,390 @@
|
|
1
|
+
=begin
|
2
|
+
#Primary Connect API V1
|
3
|
+
|
4
|
+
#Client Library to interface with Primary Connect
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.3.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module PrimaryConnectClient
|
16
|
+
class DefaultApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# create order
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @option opts [Order] :order
|
25
|
+
# @return [Object]
|
26
|
+
def create_order(opts = {})
|
27
|
+
data, _status_code, _headers = create_order_with_http_info(opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# create order
|
32
|
+
# @param [Hash] opts the optional parameters
|
33
|
+
# @option opts [Order] :order
|
34
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
35
|
+
def create_order_with_http_info(opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.create_order ...'
|
38
|
+
end
|
39
|
+
# resource path
|
40
|
+
local_var_path = '/api/v1/orders'
|
41
|
+
|
42
|
+
# query parameters
|
43
|
+
query_params = opts[:query_params] || {}
|
44
|
+
|
45
|
+
# header parameters
|
46
|
+
header_params = opts[:header_params] || {}
|
47
|
+
# HTTP header 'Accept' (if needed)
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
49
|
+
# HTTP header 'Content-Type'
|
50
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
51
|
+
|
52
|
+
# form parameters
|
53
|
+
form_params = opts[:form_params] || {}
|
54
|
+
|
55
|
+
# http body (model)
|
56
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'order'])
|
57
|
+
|
58
|
+
# return_type
|
59
|
+
return_type = opts[:debug_return_type] || 'Object'
|
60
|
+
|
61
|
+
# auth_names
|
62
|
+
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
63
|
+
|
64
|
+
new_options = opts.merge(
|
65
|
+
:operation => :"DefaultApi.create_order",
|
66
|
+
:header_params => header_params,
|
67
|
+
:query_params => query_params,
|
68
|
+
:form_params => form_params,
|
69
|
+
:body => post_body,
|
70
|
+
:auth_names => auth_names,
|
71
|
+
:return_type => return_type
|
72
|
+
)
|
73
|
+
|
74
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
75
|
+
if @api_client.config.debugging
|
76
|
+
@api_client.config.logger.debug "API called: DefaultApi#create_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
77
|
+
end
|
78
|
+
return data, status_code, headers
|
79
|
+
end
|
80
|
+
|
81
|
+
# show order
|
82
|
+
# @param id [String] id
|
83
|
+
# @param [Hash] opts the optional parameters
|
84
|
+
# @return [Object]
|
85
|
+
def get_order(id, opts = {})
|
86
|
+
data, _status_code, _headers = get_order_with_http_info(id, opts)
|
87
|
+
data
|
88
|
+
end
|
89
|
+
|
90
|
+
# show order
|
91
|
+
# @param id [String] id
|
92
|
+
# @param [Hash] opts the optional parameters
|
93
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
94
|
+
def get_order_with_http_info(id, opts = {})
|
95
|
+
if @api_client.config.debugging
|
96
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.get_order ...'
|
97
|
+
end
|
98
|
+
# verify the required parameter 'id' is set
|
99
|
+
if @api_client.config.client_side_validation && id.nil?
|
100
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DefaultApi.get_order"
|
101
|
+
end
|
102
|
+
# resource path
|
103
|
+
local_var_path = '/api/v1/orders/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
104
|
+
|
105
|
+
# query parameters
|
106
|
+
query_params = opts[:query_params] || {}
|
107
|
+
|
108
|
+
# header parameters
|
109
|
+
header_params = opts[:header_params] || {}
|
110
|
+
# HTTP header 'Accept' (if needed)
|
111
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
112
|
+
|
113
|
+
# form parameters
|
114
|
+
form_params = opts[:form_params] || {}
|
115
|
+
|
116
|
+
# http body (model)
|
117
|
+
post_body = opts[:debug_body]
|
118
|
+
|
119
|
+
# return_type
|
120
|
+
return_type = opts[:debug_return_type] || 'Object'
|
121
|
+
|
122
|
+
# auth_names
|
123
|
+
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
124
|
+
|
125
|
+
new_options = opts.merge(
|
126
|
+
:operation => :"DefaultApi.get_order",
|
127
|
+
:header_params => header_params,
|
128
|
+
:query_params => query_params,
|
129
|
+
:form_params => form_params,
|
130
|
+
:body => post_body,
|
131
|
+
:auth_names => auth_names,
|
132
|
+
:return_type => return_type
|
133
|
+
)
|
134
|
+
|
135
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
136
|
+
if @api_client.config.debugging
|
137
|
+
@api_client.config.logger.debug "API called: DefaultApi#get_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
138
|
+
end
|
139
|
+
return data, status_code, headers
|
140
|
+
end
|
141
|
+
|
142
|
+
# show result
|
143
|
+
# @param order_id [String] Order id
|
144
|
+
# @param id [String] Result id
|
145
|
+
# @param [Hash] opts the optional parameters
|
146
|
+
# @return [nil]
|
147
|
+
def get_result(order_id, id, opts = {})
|
148
|
+
get_result_with_http_info(order_id, id, opts)
|
149
|
+
nil
|
150
|
+
end
|
151
|
+
|
152
|
+
# show result
|
153
|
+
# @param order_id [String] Order id
|
154
|
+
# @param id [String] Result id
|
155
|
+
# @param [Hash] opts the optional parameters
|
156
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
157
|
+
def get_result_with_http_info(order_id, id, opts = {})
|
158
|
+
if @api_client.config.debugging
|
159
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.get_result ...'
|
160
|
+
end
|
161
|
+
# verify the required parameter 'order_id' is set
|
162
|
+
if @api_client.config.client_side_validation && order_id.nil?
|
163
|
+
fail ArgumentError, "Missing the required parameter 'order_id' when calling DefaultApi.get_result"
|
164
|
+
end
|
165
|
+
# verify the required parameter 'id' is set
|
166
|
+
if @api_client.config.client_side_validation && id.nil?
|
167
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DefaultApi.get_result"
|
168
|
+
end
|
169
|
+
# resource path
|
170
|
+
local_var_path = '/api/v1/orders/{order_id}/results/{id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
171
|
+
|
172
|
+
# query parameters
|
173
|
+
query_params = opts[:query_params] || {}
|
174
|
+
|
175
|
+
# header parameters
|
176
|
+
header_params = opts[:header_params] || {}
|
177
|
+
|
178
|
+
# form parameters
|
179
|
+
form_params = opts[:form_params] || {}
|
180
|
+
|
181
|
+
# http body (model)
|
182
|
+
post_body = opts[:debug_body]
|
183
|
+
|
184
|
+
# return_type
|
185
|
+
return_type = opts[:debug_return_type]
|
186
|
+
|
187
|
+
# auth_names
|
188
|
+
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
189
|
+
|
190
|
+
new_options = opts.merge(
|
191
|
+
:operation => :"DefaultApi.get_result",
|
192
|
+
:header_params => header_params,
|
193
|
+
:query_params => query_params,
|
194
|
+
:form_params => form_params,
|
195
|
+
:body => post_body,
|
196
|
+
:auth_names => auth_names,
|
197
|
+
:return_type => return_type
|
198
|
+
)
|
199
|
+
|
200
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
201
|
+
if @api_client.config.debugging
|
202
|
+
@api_client.config.logger.debug "API called: DefaultApi#get_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
203
|
+
end
|
204
|
+
return data, status_code, headers
|
205
|
+
end
|
206
|
+
|
207
|
+
# list events
|
208
|
+
# @param [Hash] opts the optional parameters
|
209
|
+
# @option opts [String] :last_event_id Paginate events with event id
|
210
|
+
# @option opts [String] :event_types Filter event_types, comma delimited
|
211
|
+
# @return [Object]
|
212
|
+
def list_events(opts = {})
|
213
|
+
data, _status_code, _headers = list_events_with_http_info(opts)
|
214
|
+
data
|
215
|
+
end
|
216
|
+
|
217
|
+
# list events
|
218
|
+
# @param [Hash] opts the optional parameters
|
219
|
+
# @option opts [String] :last_event_id Paginate events with event id
|
220
|
+
# @option opts [String] :event_types Filter event_types, comma delimited
|
221
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
222
|
+
def list_events_with_http_info(opts = {})
|
223
|
+
if @api_client.config.debugging
|
224
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.list_events ...'
|
225
|
+
end
|
226
|
+
# resource path
|
227
|
+
local_var_path = '/api/v1/events'
|
228
|
+
|
229
|
+
# query parameters
|
230
|
+
query_params = opts[:query_params] || {}
|
231
|
+
query_params[:'last_event_id'] = opts[:'last_event_id'] if !opts[:'last_event_id'].nil?
|
232
|
+
query_params[:'event_types'] = opts[:'event_types'] if !opts[:'event_types'].nil?
|
233
|
+
|
234
|
+
# header parameters
|
235
|
+
header_params = opts[:header_params] || {}
|
236
|
+
# HTTP header 'Accept' (if needed)
|
237
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
238
|
+
|
239
|
+
# form parameters
|
240
|
+
form_params = opts[:form_params] || {}
|
241
|
+
|
242
|
+
# http body (model)
|
243
|
+
post_body = opts[:debug_body]
|
244
|
+
|
245
|
+
# return_type
|
246
|
+
return_type = opts[:debug_return_type] || 'Object'
|
247
|
+
|
248
|
+
# auth_names
|
249
|
+
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
250
|
+
|
251
|
+
new_options = opts.merge(
|
252
|
+
:operation => :"DefaultApi.list_events",
|
253
|
+
:header_params => header_params,
|
254
|
+
:query_params => query_params,
|
255
|
+
:form_params => form_params,
|
256
|
+
:body => post_body,
|
257
|
+
:auth_names => auth_names,
|
258
|
+
:return_type => return_type
|
259
|
+
)
|
260
|
+
|
261
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
262
|
+
if @api_client.config.debugging
|
263
|
+
@api_client.config.logger.debug "API called: DefaultApi#list_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
264
|
+
end
|
265
|
+
return data, status_code, headers
|
266
|
+
end
|
267
|
+
|
268
|
+
# list orders
|
269
|
+
# @param [Hash] opts the optional parameters
|
270
|
+
# @option opts [String] :last_order_id Paginate orders with order id
|
271
|
+
# @option opts [String] :state Filter orders by state, comma delimited
|
272
|
+
# @return [Object]
|
273
|
+
def list_orders(opts = {})
|
274
|
+
data, _status_code, _headers = list_orders_with_http_info(opts)
|
275
|
+
data
|
276
|
+
end
|
277
|
+
|
278
|
+
# list orders
|
279
|
+
# @param [Hash] opts the optional parameters
|
280
|
+
# @option opts [String] :last_order_id Paginate orders with order id
|
281
|
+
# @option opts [String] :state Filter orders by state, comma delimited
|
282
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
283
|
+
def list_orders_with_http_info(opts = {})
|
284
|
+
if @api_client.config.debugging
|
285
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.list_orders ...'
|
286
|
+
end
|
287
|
+
# resource path
|
288
|
+
local_var_path = '/api/v1/orders'
|
289
|
+
|
290
|
+
# query parameters
|
291
|
+
query_params = opts[:query_params] || {}
|
292
|
+
query_params[:'last_order_id'] = opts[:'last_order_id'] if !opts[:'last_order_id'].nil?
|
293
|
+
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
|
294
|
+
|
295
|
+
# header parameters
|
296
|
+
header_params = opts[:header_params] || {}
|
297
|
+
# HTTP header 'Accept' (if needed)
|
298
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
299
|
+
|
300
|
+
# form parameters
|
301
|
+
form_params = opts[:form_params] || {}
|
302
|
+
|
303
|
+
# http body (model)
|
304
|
+
post_body = opts[:debug_body]
|
305
|
+
|
306
|
+
# return_type
|
307
|
+
return_type = opts[:debug_return_type] || 'Object'
|
308
|
+
|
309
|
+
# auth_names
|
310
|
+
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
311
|
+
|
312
|
+
new_options = opts.merge(
|
313
|
+
:operation => :"DefaultApi.list_orders",
|
314
|
+
:header_params => header_params,
|
315
|
+
:query_params => query_params,
|
316
|
+
:form_params => form_params,
|
317
|
+
:body => post_body,
|
318
|
+
:auth_names => auth_names,
|
319
|
+
:return_type => return_type
|
320
|
+
)
|
321
|
+
|
322
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
323
|
+
if @api_client.config.debugging
|
324
|
+
@api_client.config.logger.debug "API called: DefaultApi#list_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
325
|
+
end
|
326
|
+
return data, status_code, headers
|
327
|
+
end
|
328
|
+
|
329
|
+
# list results
|
330
|
+
# @param order_id [String] Order id
|
331
|
+
# @param [Hash] opts the optional parameters
|
332
|
+
# @return [Object]
|
333
|
+
def list_results(order_id, opts = {})
|
334
|
+
data, _status_code, _headers = list_results_with_http_info(order_id, opts)
|
335
|
+
data
|
336
|
+
end
|
337
|
+
|
338
|
+
# list results
|
339
|
+
# @param order_id [String] Order id
|
340
|
+
# @param [Hash] opts the optional parameters
|
341
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
342
|
+
def list_results_with_http_info(order_id, opts = {})
|
343
|
+
if @api_client.config.debugging
|
344
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.list_results ...'
|
345
|
+
end
|
346
|
+
# verify the required parameter 'order_id' is set
|
347
|
+
if @api_client.config.client_side_validation && order_id.nil?
|
348
|
+
fail ArgumentError, "Missing the required parameter 'order_id' when calling DefaultApi.list_results"
|
349
|
+
end
|
350
|
+
# resource path
|
351
|
+
local_var_path = '/api/v1/orders/{order_id}/results'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))
|
352
|
+
|
353
|
+
# query parameters
|
354
|
+
query_params = opts[:query_params] || {}
|
355
|
+
|
356
|
+
# header parameters
|
357
|
+
header_params = opts[:header_params] || {}
|
358
|
+
# HTTP header 'Accept' (if needed)
|
359
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
360
|
+
|
361
|
+
# form parameters
|
362
|
+
form_params = opts[:form_params] || {}
|
363
|
+
|
364
|
+
# http body (model)
|
365
|
+
post_body = opts[:debug_body]
|
366
|
+
|
367
|
+
# return_type
|
368
|
+
return_type = opts[:debug_return_type] || 'Object'
|
369
|
+
|
370
|
+
# auth_names
|
371
|
+
auth_names = opts[:debug_auth_names] || ['bearer_auth']
|
372
|
+
|
373
|
+
new_options = opts.merge(
|
374
|
+
:operation => :"DefaultApi.list_results",
|
375
|
+
:header_params => header_params,
|
376
|
+
:query_params => query_params,
|
377
|
+
:form_params => form_params,
|
378
|
+
:body => post_body,
|
379
|
+
:auth_names => auth_names,
|
380
|
+
:return_type => return_type
|
381
|
+
)
|
382
|
+
|
383
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
384
|
+
if @api_client.config.debugging
|
385
|
+
@api_client.config.logger.debug "API called: DefaultApi#list_results\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
386
|
+
end
|
387
|
+
return data, status_code, headers
|
388
|
+
end
|
389
|
+
end
|
390
|
+
end
|