fix: temporarily disable Apigee V1 and resolve conflicts in Spanner V1.

This commit is contained in:
Daniel Azuma 2020-04-13 09:09:58 -07:00 committed by GitHub
parent 8e474f1d07
commit f2726f4627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

2
api_list_config.yaml Normal file
View File

@ -0,0 +1,2 @@
exclude:
- apigee.v1

View File

@ -965,6 +965,8 @@
"/sheets:v4/sheets.spreadsheets.sheets.copyTo": copy_spreadsheet
"/sheets:v4/sheets.spreadsheets.values.batchGet": batch_get_spreadsheet_values
"/sheets:v4/sheets.spreadsheets.values.get": get_spreadsheet_values
"/spanner:v1/spanner.projects.instances.backupOperations.list": list_project_instance_backupoperations
"/spanner:v1/spanner.projects.instances.databaseOperations.list": list_project_instance_databaseoperations
"/sqladmin:v1beta4/BackupRunsListResponse": list_backup_runs_response
"/sqladmin:v1beta4/DatabasesListResponse": list_databases_response
"/sqladmin:v1beta4/FlagsListResponse": list_flags_response

View File

@ -10,6 +10,7 @@ end
require 'open-uri'
require 'google/apis/discovery_v1'
require 'logger'
require 'psych'
module Google
class ApiGenerator < Thor
@ -77,8 +78,11 @@ module Google
def generate_from_discovery(preferred_only: false)
say 'Fetching API list'
apis = discovery.list_apis
exclude_apis = api_list_config["exclude"] || []
apis.items.each do |api|
if (preferred_only && !api.preferred?)
if exclude_apis.include? "#{api.name}.#{api.version}"
say "Ignoring excluded API #{api.name} #{api.version}"
elsif (preferred_only && !api.preferred?)
say sprintf('Ignoring disoverable API %s', api.id)
else
# The Discovery service may returned cached versions of a Discovery document that are
@ -109,6 +113,10 @@ module Google
@generator ||= Google::Apis::Generator.new(api_names: options[:names], api_names_out: options[:names_out])
end
def api_list_config
@api_list_config ||= Psych.load_file(__dir__ + "/../api_list_config.yaml")
end
def ensure_active_support
begin
require 'active_support/inflector'

View File

@ -76,7 +76,7 @@ module Google
def pick_name(alt_name)
preferred_name = @names[key]
if preferred_name && preferred_name == alt_name
logger.warn { sprintf("Unnecessary name override '%s': %s", key, alt_name) }
# logger.warn { sprintf("Unnecessary name override '%s': %s", key, alt_name) }
elsif preferred_name.nil?
preferred_name = @names[key] = alt_name
end