google-apis-generator 0.13.1 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/google/apis/generator/annotator.rb +1 -1
- data/lib/google/apis/generator/patch.rb +35 -0
- data/lib/google/apis/generator/templates/_method.tmpl +3 -0
- data/lib/google/apis/generator/templates/gemspec.tmpl +2 -2
- data/lib/google/apis/generator/templates/overview.md.tmpl +2 -2
- data/lib/google/apis/generator/version.rb +1 -1
- data/lib/google/apis/generator.rb +1 -0
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7ae10ea9397b32a9f875aab52e76afb290e77cc6bdcf725b55bbbd37bc44cec
|
4
|
+
data.tar.gz: 50c0575fb6de5e2ac17a511cc909e991fc9458c8e933db890de9bb962ddf6b49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ca6cb0de63dc094bbc0ef94ba83eec49d5626fa44bc8bc73276489ab244db6a9fdd283ed8e35e147f2a3c5c6bb800a2aec0d47398178246ffb632d3258534bc
|
7
|
+
data.tar.gz: 488fd5355004ca8efe3690c92fc05df94a774563ebb8982c6b6e369dd78c85b8e86a933bc2f0295b155d4e31bebdf5c71758931514d4050caaff57e3e2151a82
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 0.15.0 (2024-05-13)
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* Introduce api_version to discovery clients ([#18969](https://github.com/googleapis/google-api-ruby-client/issues/18969))
|
8
|
+
* Update generated clients to depend on google-apis-core 0.15.0 ([#18985](https://github.com/googleapis/google-api-ruby-client/issues/18985))
|
9
|
+
|
10
|
+
### 0.14.0 (2024-02-23)
|
11
|
+
|
12
|
+
#### Features
|
13
|
+
|
14
|
+
* Update generated clients to require Ruby 2.7 or later ([#17898](https://github.com/googleapis/google-api-ruby-client/issues/17898))
|
15
|
+
|
3
16
|
### 0.13.1 (2024-01-22)
|
4
17
|
|
5
18
|
#### Bug Fixes
|
@@ -159,7 +159,7 @@ module Google
|
|
159
159
|
end
|
160
160
|
|
161
161
|
# Modifies an API description to support ruby code generation. Primarily does:
|
162
|
-
# - Ensure all names follow
|
162
|
+
# - Ensure all names follow appropriate ruby conventions
|
163
163
|
# - Maps types to ruby types, classes, and resolves $refs
|
164
164
|
# - Attempts to simplify names where possible to make APIs more sensible
|
165
165
|
class Annotator
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'google/apis/discovery_v1'
|
2
|
+
|
3
|
+
# Extend the DiscoveryV1 API classes with additional fields for code generation,
|
4
|
+
# supporting features which are not present in the schema itself.
|
5
|
+
unless Google::Apis::DiscoveryV1::RestMethod.method_defined? :api_version
|
6
|
+
module Google
|
7
|
+
module Apis
|
8
|
+
module DiscoveryV1
|
9
|
+
class RestMethod
|
10
|
+
# The `apiVersion` for this method, or empty if not present.
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :api_version
|
13
|
+
|
14
|
+
# @private
|
15
|
+
# The original DiscoveryV1::RestMethod `update!` method to be called
|
16
|
+
# after applying patches to this schema.
|
17
|
+
alias_method :update_discovery!, :update!
|
18
|
+
|
19
|
+
# Update properties of this object.
|
20
|
+
def update!(**args)
|
21
|
+
@api_version = args.key?(:api_version) ? args[:api_version] : ""
|
22
|
+
update_discovery!(**args)
|
23
|
+
end
|
24
|
+
|
25
|
+
# @private
|
26
|
+
class Representation
|
27
|
+
# @private
|
28
|
+
# The api_version based on the JSON key value.
|
29
|
+
property :api_version, as: 'apiVersion'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -102,6 +102,9 @@ def <%= api_method.generated_name %>(<% for param in api_method.required_paramet
|
|
102
102
|
<% end -%>
|
103
103
|
<% for param in api.parameters.values.reject {|p| p.name == 'key'} -%>
|
104
104
|
command.query['<%= param.name %>'] = <%= param.generated_name %> unless <%= param.generated_name %>.nil?
|
105
|
+
<% end -%>
|
106
|
+
<% unless api_method.api_version.empty? -%>
|
107
|
+
command.set_api_version_header "<%= api_method.api_version %>"
|
105
108
|
<% end -%>
|
106
109
|
execute_or_queue_command(command, &block)
|
107
110
|
end
|
@@ -28,6 +28,6 @@ Gem::Specification.new do |gem|
|
|
28
28
|
gem.files = Dir.glob("lib/**/*.rb") + Dir.glob("*.md") + [".yardopts"]
|
29
29
|
gem.require_paths = ["lib"]
|
30
30
|
|
31
|
-
gem.required_ruby_version = '>= 2.
|
32
|
-
gem.add_runtime_dependency "google-apis-core", ">= 0.
|
31
|
+
gem.required_ruby_version = '>= 2.7'
|
32
|
+
gem.add_runtime_dependency "google-apis-core", ">= 0.15.0", "< 2.a"
|
33
33
|
end
|
@@ -83,9 +83,9 @@ The [product documentation](<%= api.documentation_link %>) may provide guidance
|
|
83
83
|
|
84
84
|
## Supported Ruby versions
|
85
85
|
|
86
|
-
This library is supported on Ruby 2.
|
86
|
+
This library is supported on Ruby 2.7+.
|
87
87
|
|
88
|
-
Google provides official support for Ruby versions that are actively supported by Ruby Core -- that is, Ruby versions that are either in normal maintenance or in security maintenance, and not end of life.
|
88
|
+
Google provides official support for Ruby versions that are actively supported by Ruby Core -- that is, Ruby versions that are either in normal maintenance or in security maintenance, and not end of life. Older versions of Ruby _may_ still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby support schedule.
|
89
89
|
|
90
90
|
## License
|
91
91
|
|
@@ -18,6 +18,7 @@ require 'google/apis/generator/model'
|
|
18
18
|
require 'google/apis/generator/template'
|
19
19
|
require 'google/apis/generator/updater'
|
20
20
|
require 'google/apis/generator/version'
|
21
|
+
require 'google/apis/generator/patch'
|
21
22
|
require 'active_support'
|
22
23
|
require 'active_support/core_ext'
|
23
24
|
require 'active_support/inflector'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-apis-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.15.0
|
48
48
|
- - "<"
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: 2.a
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
requirements:
|
55
55
|
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: 0.
|
57
|
+
version: 0.15.0
|
58
58
|
- - "<"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: 2.a
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- lib/google/apis/generator/annotator.rb
|
109
109
|
- lib/google/apis/generator/helpers.rb
|
110
110
|
- lib/google/apis/generator/model.rb
|
111
|
+
- lib/google/apis/generator/patch.rb
|
111
112
|
- lib/google/apis/generator/template.rb
|
112
113
|
- lib/google/apis/generator/templates/_class.tmpl
|
113
114
|
- lib/google/apis/generator/templates/_method.tmpl
|
@@ -138,7 +139,7 @@ licenses:
|
|
138
139
|
metadata:
|
139
140
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
140
141
|
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-generator/CHANGELOG.md
|
141
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-generator/v0.
|
142
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-generator/v0.15.0
|
142
143
|
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-generator
|
143
144
|
post_install_message:
|
144
145
|
rdoc_options: []
|
@@ -148,14 +149,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
149
|
requirements:
|
149
150
|
- - ">="
|
150
151
|
- !ruby/object:Gem::Version
|
151
|
-
version: '2.
|
152
|
+
version: '2.7'
|
152
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
154
|
requirements:
|
154
155
|
- - ">="
|
155
156
|
- !ruby/object:Gem::Version
|
156
157
|
version: '0'
|
157
158
|
requirements: []
|
158
|
-
rubygems_version: 3.5.
|
159
|
+
rubygems_version: 3.5.6
|
159
160
|
signing_key:
|
160
161
|
specification_version: 4
|
161
162
|
summary: Code generator for legacy Google REST clients
|