endoflife_date 0.10.0 → 1.0.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 +4 -4
- data/Gemfile.lock +21 -21
- data/README.md +13 -7
- data/docs/Cycle.md +8 -8
- data/docs/CycleCycle.md +15 -0
- data/docs/CycleDiscontinued.md +15 -0
- data/docs/CycleEol.md +15 -0
- data/docs/CycleLts.md +15 -0
- data/docs/CycleSupport.md +15 -0
- data/docs/DefaultApi.md +14 -14
- data/endoflife_date.gemspec +6 -5
- data/git_push.sh +1 -1
- data/lib/endoflife_date/api/default_api.rb +14 -14
- data/lib/endoflife_date/api_client.rb +24 -22
- data/lib/endoflife_date/api_error.rb +2 -2
- data/lib/endoflife_date/configuration.rb +5 -4
- data/lib/endoflife_date/models/cycle.rb +22 -89
- data/lib/endoflife_date/models/cycle_cycle.rb +105 -0
- data/lib/endoflife_date/models/cycle_discontinued.rb +105 -0
- data/lib/endoflife_date/models/cycle_eol.rb +105 -0
- data/lib/endoflife_date/models/cycle_lts.rb +105 -0
- data/lib/endoflife_date/models/cycle_support.rb +105 -0
- data/lib/endoflife_date/version.rb +3 -3
- data/lib/endoflife_date.rb +7 -2
- data/spec/api/default_api_spec.rb +4 -4
- data/spec/models/cycle_cycle_spec.rb +21 -0
- data/spec/models/cycle_discontinued_spec.rb +21 -0
- data/spec/models/cycle_eol_spec.rb +21 -0
- data/spec/models/cycle_lts_spec.rb +21 -0
- data/spec/models/cycle_spec.rb +5 -3
- data/spec/models/cycle_support_spec.rb +21 -0
- data/spec/spec_helper.rb +2 -2
- metadata +25 -9
- data/spec/api_client_spec.rb +0 -228
- data/spec/configuration_spec.rb +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dca524415467bcab4a0a685c0f564cd4877d7bec53f2a0a13d98d8fb61b0a36d
|
4
|
+
data.tar.gz: c48d4fa8a062309744a28cadbed57b8ad3dea0789c0d83c48a5445a4f3a5f706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 839ef655cf8e3832055493c42929d1b7bf7ede935a49ee0e3b786d5a4f1da2e5ea6d2bafdf39fab75d7acc779e8fea255e56ae89da0fbf54dd86aaa636c032cd
|
7
|
+
data.tar.gz: b51e83f2da7e9bf96020a796c0f00607c6e4bd3410cfa2ac987503c5289886b11e473da8872473cee4399b3d8825e1adf81f496b5c375bb12085053a8190558c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
endoflife_date (0.
|
4
|
+
endoflife_date (1.0.0)
|
5
5
|
typhoeus (~> 1.0, >= 1.0.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -10,14 +10,14 @@ GEM
|
|
10
10
|
ast (2.4.2)
|
11
11
|
byebug (11.1.3)
|
12
12
|
coderay (1.1.3)
|
13
|
-
diff-lcs (1.5.
|
13
|
+
diff-lcs (1.5.1)
|
14
14
|
ethon (0.16.0)
|
15
15
|
ffi (>= 1.15.0)
|
16
|
-
ffi (1.
|
16
|
+
ffi (1.16.3)
|
17
17
|
jaro_winkler (1.5.6)
|
18
18
|
method_source (1.0.0)
|
19
|
-
parallel (1.
|
20
|
-
parser (3.
|
19
|
+
parallel (1.24.0)
|
20
|
+
parser (3.3.0.5)
|
21
21
|
ast (~> 2.4.1)
|
22
22
|
racc
|
23
23
|
pry (0.14.2)
|
@@ -26,24 +26,24 @@ GEM
|
|
26
26
|
pry-byebug (3.10.1)
|
27
27
|
byebug (~> 11.0)
|
28
28
|
pry (>= 0.13, < 0.15)
|
29
|
-
psych (5.1.
|
29
|
+
psych (5.1.2)
|
30
30
|
stringio
|
31
|
-
racc (1.7.
|
31
|
+
racc (1.7.3)
|
32
32
|
rainbow (3.1.1)
|
33
33
|
rake (13.0.6)
|
34
|
-
rspec (3.
|
35
|
-
rspec-core (~> 3.
|
36
|
-
rspec-expectations (~> 3.
|
37
|
-
rspec-mocks (~> 3.
|
38
|
-
rspec-core (3.
|
39
|
-
rspec-support (~> 3.
|
40
|
-
rspec-expectations (3.
|
34
|
+
rspec (3.13.0)
|
35
|
+
rspec-core (~> 3.13.0)
|
36
|
+
rspec-expectations (~> 3.13.0)
|
37
|
+
rspec-mocks (~> 3.13.0)
|
38
|
+
rspec-core (3.13.0)
|
39
|
+
rspec-support (~> 3.13.0)
|
40
|
+
rspec-expectations (3.13.0)
|
41
41
|
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
-
rspec-support (~> 3.
|
43
|
-
rspec-mocks (3.
|
42
|
+
rspec-support (~> 3.13.0)
|
43
|
+
rspec-mocks (3.13.0)
|
44
44
|
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
-
rspec-support (~> 3.
|
46
|
-
rspec-support (3.
|
45
|
+
rspec-support (~> 3.13.0)
|
46
|
+
rspec-support (3.13.1)
|
47
47
|
rubocop (0.66.0)
|
48
48
|
jaro_winkler (~> 1.5.1)
|
49
49
|
parallel (~> 1.10)
|
@@ -53,8 +53,8 @@ GEM
|
|
53
53
|
ruby-progressbar (~> 1.7)
|
54
54
|
unicode-display_width (>= 1.4.0, < 1.6)
|
55
55
|
ruby-progressbar (1.13.0)
|
56
|
-
stringio (3.0
|
57
|
-
typhoeus (1.4.
|
56
|
+
stringio (3.1.0)
|
57
|
+
typhoeus (1.4.1)
|
58
58
|
ethon (>= 0.9.0)
|
59
59
|
unicode-display_width (1.5.0)
|
60
60
|
|
@@ -69,4 +69,4 @@ DEPENDENCIES
|
|
69
69
|
rubocop (~> 0.66.0)
|
70
70
|
|
71
71
|
BUNDLED WITH
|
72
|
-
2.4.
|
72
|
+
2.4.22
|
data/README.md
CHANGED
@@ -7,9 +7,10 @@ Documentation for the endoflife.date API. The API is currently in Alpha. Additio
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: 0.0.1
|
10
|
-
- Package version: 0.
|
10
|
+
- Package version: 1.0.0
|
11
|
+
- Generator version: 7.4.0
|
11
12
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
|
-
For more information, please visit [https://github.com/
|
13
|
+
For more information, please visit [https://github.com/oapicf/endoflife.date-api-clients](https://github.com/oapicf/endoflife.date-api-clients)
|
13
14
|
|
14
15
|
## Installation
|
15
16
|
|
@@ -24,22 +25,22 @@ gem build endoflife_date.gemspec
|
|
24
25
|
Then either install the gem locally:
|
25
26
|
|
26
27
|
```shell
|
27
|
-
gem install ./endoflife_date-0.
|
28
|
+
gem install ./endoflife_date-1.0.0.gem
|
28
29
|
```
|
29
30
|
|
30
|
-
(for development, run `gem install --dev ./endoflife_date-0.
|
31
|
+
(for development, run `gem install --dev ./endoflife_date-1.0.0.gem` to install the development dependencies)
|
31
32
|
|
32
33
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
33
34
|
|
34
35
|
Finally add this to the Gemfile:
|
35
36
|
|
36
|
-
gem 'endoflife_date', '~> 0.
|
37
|
+
gem 'endoflife_date', '~> 1.0.0'
|
37
38
|
|
38
39
|
### Install from Git
|
39
40
|
|
40
|
-
If the Ruby gem is hosted at a git repository: https://github.com/
|
41
|
+
If the Ruby gem is hosted at a git repository: https://github.com/oapicf/endoflife.date-api-clients, then add the following in the Gemfile:
|
41
42
|
|
42
|
-
gem 'endoflife_date', :git => 'https://github.com/
|
43
|
+
gem 'endoflife_date', :git => 'https://github.com/oapicf/endoflife.date-api-clients.git'
|
43
44
|
|
44
45
|
### Include the Ruby code directly
|
45
46
|
|
@@ -83,6 +84,11 @@ Class | Method | HTTP request | Description
|
|
83
84
|
## Documentation for Models
|
84
85
|
|
85
86
|
- [EndOfLifeDateApiClient::Cycle](docs/Cycle.md)
|
87
|
+
- [EndOfLifeDateApiClient::CycleCycle](docs/CycleCycle.md)
|
88
|
+
- [EndOfLifeDateApiClient::CycleDiscontinued](docs/CycleDiscontinued.md)
|
89
|
+
- [EndOfLifeDateApiClient::CycleEol](docs/CycleEol.md)
|
90
|
+
- [EndOfLifeDateApiClient::CycleLts](docs/CycleLts.md)
|
91
|
+
- [EndOfLifeDateApiClient::CycleSupport](docs/CycleSupport.md)
|
86
92
|
|
87
93
|
|
88
94
|
## Documentation for Authorization
|
data/docs/Cycle.md
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **cycle** | **
|
8
|
-
| **release_date** | **
|
9
|
-
| **eol** | **
|
10
|
-
| **latest** | **
|
11
|
-
| **link** | **
|
12
|
-
| **lts** | **
|
13
|
-
| **support** | **
|
14
|
-
| **discontinued** | **
|
7
|
+
| **cycle** | [**CycleCycle**](CycleCycle.md) | | [optional] |
|
8
|
+
| **release_date** | **Date** | Release Date for the first release in this cycle | [optional] |
|
9
|
+
| **eol** | [**CycleEol**](CycleEol.md) | | [optional] |
|
10
|
+
| **latest** | **String** | Latest release in this cycle | [optional] |
|
11
|
+
| **link** | **String** | Link to changelog for the latest release, if available | [optional] |
|
12
|
+
| **lts** | [**CycleLts**](CycleLts.md) | | [optional] |
|
13
|
+
| **support** | [**CycleSupport**](CycleSupport.md) | | [optional] |
|
14
|
+
| **discontinued** | [**CycleDiscontinued**](CycleDiscontinued.md) | | [optional] |
|
15
15
|
|
16
16
|
## Example
|
17
17
|
|
data/docs/CycleCycle.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# EndOfLifeDateApiClient::CycleCycle
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'endoflife_date'
|
12
|
+
|
13
|
+
instance = EndOfLifeDateApiClient::CycleCycle.new()
|
14
|
+
```
|
15
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# EndOfLifeDateApiClient::CycleDiscontinued
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'endoflife_date'
|
12
|
+
|
13
|
+
instance = EndOfLifeDateApiClient::CycleDiscontinued.new()
|
14
|
+
```
|
15
|
+
|
data/docs/CycleEol.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# EndOfLifeDateApiClient::CycleEol
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'endoflife_date'
|
12
|
+
|
13
|
+
instance = EndOfLifeDateApiClient::CycleEol.new()
|
14
|
+
```
|
15
|
+
|
data/docs/CycleLts.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# EndOfLifeDateApiClient::CycleLts
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'endoflife_date'
|
12
|
+
|
13
|
+
instance = EndOfLifeDateApiClient::CycleLts.new()
|
14
|
+
```
|
15
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# EndOfLifeDateApiClient::CycleSupport
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'endoflife_date'
|
12
|
+
|
13
|
+
instance = EndOfLifeDateApiClient::CycleSupport.new()
|
14
|
+
```
|
15
|
+
|
data/docs/DefaultApi.md
CHANGED
@@ -11,7 +11,7 @@ All URIs are relative to *https://endoflife.date*
|
|
11
11
|
|
12
12
|
## get_api_all_json
|
13
13
|
|
14
|
-
>
|
14
|
+
> Array<String> get_api_all_json
|
15
15
|
|
16
16
|
All Products
|
17
17
|
|
@@ -38,7 +38,7 @@ end
|
|
38
38
|
|
39
39
|
This returns an Array which contains the response data, status code and headers.
|
40
40
|
|
41
|
-
> <Array(
|
41
|
+
> <Array(Array<String>, Integer, Hash)> get_api_all_json_with_http_info
|
42
42
|
|
43
43
|
```ruby
|
44
44
|
begin
|
@@ -46,7 +46,7 @@ begin
|
|
46
46
|
data, status_code, headers = api_instance.get_api_all_json_with_http_info
|
47
47
|
p status_code # => 2xx
|
48
48
|
p headers # => { ... }
|
49
|
-
p data # =>
|
49
|
+
p data # => Array<String>
|
50
50
|
rescue EndOfLifeDateApiClient::ApiError => e
|
51
51
|
puts "Error when calling DefaultApi->get_api_all_json_with_http_info: #{e}"
|
52
52
|
end
|
@@ -58,7 +58,7 @@ This endpoint does not need any parameter.
|
|
58
58
|
|
59
59
|
### Return type
|
60
60
|
|
61
|
-
**
|
61
|
+
**Array<String>**
|
62
62
|
|
63
63
|
### Authorization
|
64
64
|
|
@@ -85,8 +85,8 @@ require 'time'
|
|
85
85
|
require 'endoflife_date'
|
86
86
|
|
87
87
|
api_instance = EndOfLifeDateApiClient::DefaultApi.new
|
88
|
-
product =
|
89
|
-
cycle =
|
88
|
+
product = 'product_example' # String | Product URL as per the canonical URL on the endofife.date website
|
89
|
+
cycle = 'cycle_example' # String | Release Cycle for which the details must be fetched
|
90
90
|
|
91
91
|
begin
|
92
92
|
# Single cycle details
|
@@ -119,8 +119,8 @@ end
|
|
119
119
|
|
120
120
|
| Name | Type | Description | Notes |
|
121
121
|
| ---- | ---- | ----------- | ----- |
|
122
|
-
| **product** |
|
123
|
-
| **cycle** |
|
122
|
+
| **product** | **String** | Product URL as per the canonical URL on the endofife.date website | |
|
123
|
+
| **cycle** | **String** | Release Cycle for which the details must be fetched | |
|
124
124
|
|
125
125
|
### Return type
|
126
126
|
|
@@ -138,7 +138,7 @@ No authorization required
|
|
138
138
|
|
139
139
|
## get_api_product_json
|
140
140
|
|
141
|
-
>
|
141
|
+
> <Array<Cycle>> get_api_product_json(product)
|
142
142
|
|
143
143
|
Get All Details
|
144
144
|
|
@@ -151,7 +151,7 @@ require 'time'
|
|
151
151
|
require 'endoflife_date'
|
152
152
|
|
153
153
|
api_instance = EndOfLifeDateApiClient::DefaultApi.new
|
154
|
-
product =
|
154
|
+
product = 'product_example' # String | Product URL as per the canonical URL on the endofife.date website
|
155
155
|
|
156
156
|
begin
|
157
157
|
# Get All Details
|
@@ -166,7 +166,7 @@ end
|
|
166
166
|
|
167
167
|
This returns an Array which contains the response data, status code and headers.
|
168
168
|
|
169
|
-
> <Array(
|
169
|
+
> <Array(<Array<Cycle>>, Integer, Hash)> get_api_product_json_with_http_info(product)
|
170
170
|
|
171
171
|
```ruby
|
172
172
|
begin
|
@@ -174,7 +174,7 @@ begin
|
|
174
174
|
data, status_code, headers = api_instance.get_api_product_json_with_http_info(product)
|
175
175
|
p status_code # => 2xx
|
176
176
|
p headers # => { ... }
|
177
|
-
p data # =>
|
177
|
+
p data # => <Array<Cycle>>
|
178
178
|
rescue EndOfLifeDateApiClient::ApiError => e
|
179
179
|
puts "Error when calling DefaultApi->get_api_product_json_with_http_info: #{e}"
|
180
180
|
end
|
@@ -184,11 +184,11 @@ end
|
|
184
184
|
|
185
185
|
| Name | Type | Description | Notes |
|
186
186
|
| ---- | ---- | ----------- | ----- |
|
187
|
-
| **product** |
|
187
|
+
| **product** | **String** | Product URL as per the canonical URL on the endofife.date website | |
|
188
188
|
|
189
189
|
### Return type
|
190
190
|
|
191
|
-
**
|
191
|
+
[**Array<Cycle>**](Cycle.md)
|
192
192
|
|
193
193
|
### Authorization
|
194
194
|
|
data/endoflife_date.gemspec
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
#Documentation for the endoflife.date API. The API is currently in Alpha. Additional information about the API can be found on the [endoflife.date wiki](https://github.com/endoflife-date/endoflife.date/wiki)
|
7
7
|
|
8
8
|
The version of the OpenAPI document: 0.0.1
|
9
|
-
Contact: blah@cliffano.com
|
9
|
+
Contact: blah+oapicf@cliffano.com
|
10
10
|
Generated by: https://openapi-generator.tech
|
11
|
-
|
11
|
+
Generator version: 7.4.0
|
12
12
|
|
13
13
|
=end
|
14
14
|
|
@@ -19,13 +19,14 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.name = "endoflife_date"
|
20
20
|
s.version = EndOfLifeDateApiClient::VERSION
|
21
21
|
s.platform = Gem::Platform::RUBY
|
22
|
-
s.authors = ["
|
23
|
-
s.email = ["blah@cliffano.com"]
|
24
|
-
s.homepage = "https://github.com/
|
22
|
+
s.authors = ["OpenAPI Clients Factory"]
|
23
|
+
s.email = ["blah+oapicf@cliffano.com"]
|
24
|
+
s.homepage = "https://github.com/oapicf/endoflife.date-api-clients"
|
25
25
|
s.summary = "endoflife.date Ruby Gem"
|
26
26
|
s.description = "Documentation for the endoflife.date API. The API is currently in Alpha. Additional information about the API can be found on the [endoflife.date wiki](https://github.com/endoflife-date/endoflife.date/wiki)"
|
27
27
|
s.license = "MIT"
|
28
28
|
s.required_ruby_version = ">= 2.0"
|
29
|
+
s.metadata = {}
|
29
30
|
|
30
31
|
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
31
32
|
|
data/git_push.sh
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
#Documentation for the endoflife.date API. The API is currently in Alpha. Additional information about the API can be found on the [endoflife.date wiki](https://github.com/endoflife-date/endoflife.date/wiki)
|
5
5
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
7
|
-
Contact: blah@cliffano.com
|
7
|
+
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -22,7 +22,7 @@ module EndOfLifeDateApiClient
|
|
22
22
|
# All Products
|
23
23
|
# Return a list of all products. Each of these can be used for the other API endpoints.
|
24
24
|
# @param [Hash] opts the optional parameters
|
25
|
-
# @return [
|
25
|
+
# @return [Array<String>]
|
26
26
|
def get_api_all_json(opts = {})
|
27
27
|
data, _status_code, _headers = get_api_all_json_with_http_info(opts)
|
28
28
|
data
|
@@ -31,7 +31,7 @@ module EndOfLifeDateApiClient
|
|
31
31
|
# All Products
|
32
32
|
# Return a list of all products. Each of these can be used for the other API endpoints.
|
33
33
|
# @param [Hash] opts the optional parameters
|
34
|
-
# @return [Array<(
|
34
|
+
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
35
35
|
def get_api_all_json_with_http_info(opts = {})
|
36
36
|
if @api_client.config.debugging
|
37
37
|
@api_client.config.logger.debug 'Calling API: DefaultApi.get_api_all_json ...'
|
@@ -54,7 +54,7 @@ module EndOfLifeDateApiClient
|
|
54
54
|
post_body = opts[:debug_body]
|
55
55
|
|
56
56
|
# return_type
|
57
|
-
return_type = opts[:debug_return_type] || '
|
57
|
+
return_type = opts[:debug_return_type] || 'Array<String>'
|
58
58
|
|
59
59
|
# auth_names
|
60
60
|
auth_names = opts[:debug_auth_names] || []
|
@@ -78,8 +78,8 @@ module EndOfLifeDateApiClient
|
|
78
78
|
|
79
79
|
# Single cycle details
|
80
80
|
# Gets details of a single cycle
|
81
|
-
# @param product [
|
82
|
-
# @param cycle [
|
81
|
+
# @param product [String] Product URL as per the canonical URL on the endofife.date website
|
82
|
+
# @param cycle [String] Release Cycle for which the details must be fetched
|
83
83
|
# @param [Hash] opts the optional parameters
|
84
84
|
# @return [Cycle]
|
85
85
|
def get_api_product_cycle_json(product, cycle, opts = {})
|
@@ -89,8 +89,8 @@ module EndOfLifeDateApiClient
|
|
89
89
|
|
90
90
|
# Single cycle details
|
91
91
|
# Gets details of a single cycle
|
92
|
-
# @param product [
|
93
|
-
# @param cycle [
|
92
|
+
# @param product [String] Product URL as per the canonical URL on the endofife.date website
|
93
|
+
# @param cycle [String] Release Cycle for which the details must be fetched
|
94
94
|
# @param [Hash] opts the optional parameters
|
95
95
|
# @return [Array<(Cycle, Integer, Hash)>] Cycle data, response status code and response headers
|
96
96
|
def get_api_product_cycle_json_with_http_info(product, cycle, opts = {})
|
@@ -147,9 +147,9 @@ module EndOfLifeDateApiClient
|
|
147
147
|
|
148
148
|
# Get All Details
|
149
149
|
# Get EoL dates of all cycles of a given product.
|
150
|
-
# @param product [
|
150
|
+
# @param product [String] Product URL as per the canonical URL on the endofife.date website
|
151
151
|
# @param [Hash] opts the optional parameters
|
152
|
-
# @return [
|
152
|
+
# @return [Array<Cycle>]
|
153
153
|
def get_api_product_json(product, opts = {})
|
154
154
|
data, _status_code, _headers = get_api_product_json_with_http_info(product, opts)
|
155
155
|
data
|
@@ -157,9 +157,9 @@ module EndOfLifeDateApiClient
|
|
157
157
|
|
158
158
|
# Get All Details
|
159
159
|
# Get EoL dates of all cycles of a given product.
|
160
|
-
# @param product [
|
160
|
+
# @param product [String] Product URL as per the canonical URL on the endofife.date website
|
161
161
|
# @param [Hash] opts the optional parameters
|
162
|
-
# @return [Array<(
|
162
|
+
# @return [Array<(Array<Cycle>, Integer, Hash)>] Array<Cycle> data, response status code and response headers
|
163
163
|
def get_api_product_json_with_http_info(product, opts = {})
|
164
164
|
if @api_client.config.debugging
|
165
165
|
@api_client.config.logger.debug 'Calling API: DefaultApi.get_api_product_json ...'
|
@@ -186,7 +186,7 @@ module EndOfLifeDateApiClient
|
|
186
186
|
post_body = opts[:debug_body]
|
187
187
|
|
188
188
|
# return_type
|
189
|
-
return_type = opts[:debug_return_type] || '
|
189
|
+
return_type = opts[:debug_return_type] || 'Array<Cycle>'
|
190
190
|
|
191
191
|
# auth_names
|
192
192
|
auth_names = opts[:debug_auth_names] || []
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#Documentation for the endoflife.date API. The API is currently in Alpha. Additional information about the API can be found on the [endoflife.date wiki](https://github.com/endoflife-date/endoflife.date/wiki)
|
5
5
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
7
|
-
Contact: blah@cliffano.com
|
7
|
+
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -17,6 +17,7 @@ require 'tempfile'
|
|
17
17
|
require 'time'
|
18
18
|
require 'typhoeus'
|
19
19
|
|
20
|
+
|
20
21
|
module EndOfLifeDateApiClient
|
21
22
|
class ApiClient
|
22
23
|
# The Configuration object holding settings to be used in the API client.
|
@@ -45,9 +46,10 @@ module EndOfLifeDateApiClient
|
|
45
46
|
# Call an API with given options.
|
46
47
|
#
|
47
48
|
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
48
|
-
# the data deserialized from response body (
|
49
|
+
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
|
49
50
|
def call_api(http_method, path, opts = {})
|
50
51
|
request = build_request(http_method, path, opts)
|
52
|
+
tempfile = download_file(request) if opts[:return_type] == 'File'
|
51
53
|
response = request.run
|
52
54
|
|
53
55
|
if @config.debugging
|
@@ -69,7 +71,9 @@ module EndOfLifeDateApiClient
|
|
69
71
|
end
|
70
72
|
end
|
71
73
|
|
72
|
-
if opts[:return_type]
|
74
|
+
if opts[:return_type] == 'File'
|
75
|
+
data = tempfile
|
76
|
+
elsif opts[:return_type]
|
73
77
|
data = deserialize(response, opts[:return_type])
|
74
78
|
else
|
75
79
|
data = nil
|
@@ -124,9 +128,7 @@ module EndOfLifeDateApiClient
|
|
124
128
|
end
|
125
129
|
end
|
126
130
|
|
127
|
-
|
128
|
-
download_file(request) if opts[:return_type] == 'File'
|
129
|
-
request
|
131
|
+
Typhoeus::Request.new(url, req_opts)
|
130
132
|
end
|
131
133
|
|
132
134
|
# Builds the HTTP request body
|
@@ -164,6 +166,8 @@ module EndOfLifeDateApiClient
|
|
164
166
|
# process can use.
|
165
167
|
#
|
166
168
|
# @see Configuration#temp_folder_path
|
169
|
+
#
|
170
|
+
# @return [Tempfile] the tempfile generated
|
167
171
|
def download_file(request)
|
168
172
|
tempfile = nil
|
169
173
|
encoding = nil
|
@@ -178,21 +182,24 @@ module EndOfLifeDateApiClient
|
|
178
182
|
prefix = prefix + '-' unless prefix.end_with?('-')
|
179
183
|
encoding = response.body.encoding
|
180
184
|
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
181
|
-
@tempfile = tempfile
|
182
185
|
end
|
183
186
|
request.on_body do |chunk|
|
184
187
|
chunk.force_encoding(encoding)
|
185
188
|
tempfile.write(chunk)
|
186
189
|
end
|
187
|
-
request
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
190
|
+
# run the request to ensure the tempfile is created successfully before returning it
|
191
|
+
request.run
|
192
|
+
if tempfile
|
193
|
+
tempfile.close
|
194
|
+
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
195
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
196
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
197
|
+
"explicitly with `tempfile.delete`"
|
198
|
+
else
|
199
|
+
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
|
195
200
|
end
|
201
|
+
|
202
|
+
tempfile
|
196
203
|
end
|
197
204
|
|
198
205
|
# Check if the given MIME is a JSON MIME.
|
@@ -213,15 +220,10 @@ module EndOfLifeDateApiClient
|
|
213
220
|
# @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
|
214
221
|
def deserialize(response, return_type)
|
215
222
|
body = response.body
|
216
|
-
|
217
|
-
# handle file downloading - return the File instance processed in request callbacks
|
218
|
-
# note that response body is empty when the file is written in chunks in request on_body callback
|
219
|
-
return @tempfile if return_type == 'File'
|
220
|
-
|
221
223
|
return nil if body.nil? || body.empty?
|
222
224
|
|
223
225
|
# return response body directly for String return type
|
224
|
-
return body if return_type == 'String'
|
226
|
+
return body.to_s if return_type == 'String'
|
225
227
|
|
226
228
|
# ensuring a default content type
|
227
229
|
content_type = response.headers['Content-Type'] || 'application/json'
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#Documentation for the endoflife.date API. The API is currently in Alpha. Additional information about the API can be found on the [endoflife.date wiki](https://github.com/endoflife-date/endoflife.date/wiki)
|
5
5
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
7
|
-
Contact: blah@cliffano.com
|
7
|
+
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -4,9 +4,9 @@
|
|
4
4
|
#Documentation for the endoflife.date API. The API is currently in Alpha. Additional information about the API can be found on the [endoflife.date wiki](https://github.com/endoflife-date/endoflife.date/wiki)
|
5
5
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
7
|
-
Contact: blah@cliffano.com
|
7
|
+
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.4.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -222,8 +222,8 @@ module EndOfLifeDateApiClient
|
|
222
222
|
|
223
223
|
# Gets access_token using access_token_getter or uses the static access_token
|
224
224
|
def access_token_with_refresh
|
225
|
-
|
226
|
-
|
225
|
+
return access_token if access_token_getter.nil?
|
226
|
+
access_token_getter.call
|
227
227
|
end
|
228
228
|
|
229
229
|
# Gets Basic Auth token string
|
@@ -286,5 +286,6 @@ module EndOfLifeDateApiClient
|
|
286
286
|
url
|
287
287
|
end
|
288
288
|
|
289
|
+
|
289
290
|
end
|
290
291
|
end
|