Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Updated google-shopping-merchant-data_sources-v1beta dependency #27359

Merged
merged 4 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion google-shopping-merchant-data_sources/.repo-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"release_level": "preview",
"repo": "googleapis/google-cloud-ruby",
"requires_billing": true,
"ruby-cloud-description": "Programmatically manage your Merchant Center accounts.",
"ruby-cloud-description": "Merchant API consists of multiple Sub-APIs. Accounts Sub-API: Enables you to programmatically manage your accounts. Conversions Sub-API: Enables you to programmatically manage your conversion sources for a merchant account. Datasources Sub-API: Enables you to programmatically manage your datasources. Inventories Sub-API: This bundle enables you to programmatically manage your local and regional inventories. Local Feeds Partnerships Sub-API: This bundle enables LFP partners to submit local inventories for a merchant. Notifications Sub-API: This bundle enables you to programmatically manage your notification subscriptions. Products Sub-API: This bundle enables you to programmatically manage your products. Promotions Sub-API: This bundle enables you to programmatically manage your promotions for products. Quota Sub-API: This bundle enables you to list your quotas for all APIs you are using. Reports Sub-API: This bundle enables you to programmatically retrieve reports and insights about products, their performance and their competitive environment.",
"ruby-cloud-product-url": "https://developers.google.com/merchant/api",
"library_type": "GAPIC_MANUAL"
}
3 changes: 2 additions & 1 deletion google-shopping-merchant-data_sources/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Ruby Client for the Merchant API

Programmatically manage your Merchant Center accounts.
Programmatically manage your Merchant Center Accounts.

Merchant API consists of multiple Sub-APIs. Accounts Sub-API: Enables you to programmatically manage your accounts. Conversions Sub-API: Enables you to programmatically manage your conversion sources for a merchant account. Datasources Sub-API: Enables you to programmatically manage your datasources. Inventories Sub-API: This bundle enables you to programmatically manage your local and regional inventories. Local Feeds Partnerships Sub-API: This bundle enables LFP partners to submit local inventories for a merchant. Notifications Sub-API: This bundle enables you to programmatically manage your notification subscriptions. Products Sub-API: This bundle enables you to programmatically manage your products. Promotions Sub-API: This bundle enables you to programmatically manage your promotions for products. Quota Sub-API: This bundle enables you to list your quotas for all APIs you are using. Reports Sub-API: This bundle enables you to programmatically retrieve reports and insights about products, their performance and their competitive environment.

Actual client classes for the various versions of this API are defined in
_versioned_ client gems, with names of the form `google-shopping-merchant-data_sources-v*`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Gem::Specification.new do |gem|

gem.authors = ["Google LLC"]
gem.email = "googleapis-packages@google.com"
gem.description = "Programmatically manage your Merchant Center accounts."
gem.summary = "Programmatically manage your Merchant Center accounts."
gem.description = "Merchant API consists of multiple Sub-APIs. Accounts Sub-API: Enables you to programmatically manage your accounts. Conversions Sub-API: Enables you to programmatically manage your conversion sources for a merchant account. Datasources Sub-API: Enables you to programmatically manage your datasources. Inventories Sub-API: This bundle enables you to programmatically manage your local and regional inventories. Local Feeds Partnerships Sub-API: This bundle enables LFP partners to submit local inventories for a merchant. Notifications Sub-API: This bundle enables you to programmatically manage your notification subscriptions. Products Sub-API: This bundle enables you to programmatically manage your products. Promotions Sub-API: This bundle enables you to programmatically manage your promotions for products. Quota Sub-API: This bundle enables you to list your quotas for all APIs you are using. Reports Sub-API: This bundle enables you to programmatically retrieve reports and insights about products, their performance and their competitive environment."
gem.summary = "Programmatically manage your Merchant Center Accounts."
gem.homepage = "https://github.com/googleapis/google-cloud-ruby"
gem.license = "Apache-2.0"

Expand All @@ -23,5 +23,5 @@ Gem::Specification.new do |gem|
gem.required_ruby_version = ">= 2.7"

gem.add_dependency "google-cloud-core", "~> 1.6"
gem.add_dependency "google-shopping-merchant-data_sources-v1beta", ">= 0.0", "< 2.a"
gem.add_dependency "google-shopping-merchant-data_sources-v1beta", ">= 0.2", "< 2.a"
end
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,40 @@ def self.data_sources_service version: :v1beta, transport: :grpc, &block
service_module = service_module.const_get(:Rest) if transport == :rest
service_module.const_get(:Client).new(&block)
end

##
# Create a new client object for FileUploadsService.
#
# By default, this returns an instance of
# [Google::Shopping::Merchant::DataSources::V1beta::FileUploadsService::Client](https://rubydoc.info/gems/google-shopping-merchant-data_sources-v1beta/Google/Shopping/Merchant/DataSources/V1beta/FileUploadsService/Client)
# for a gRPC client for version V1beta of the API.
# However, you can specify a different API version by passing it in the
# `version` parameter. If the FileUploadsService service is
# supported by that API version, and the corresponding gem is available, the
# appropriate versioned client will be returned.
# You can also specify a different transport by passing `:rest` or `:grpc` in
# the `transport` parameter.
#
# ## About FileUploadsService
#
# Service to manage data source file uploads.
#
# @param version [::String, ::Symbol] The API version to connect to. Optional.
# Defaults to `:v1beta`.
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
# @return [::Object] A client object for the specified version.
#
def self.file_uploads_service version: :v1beta, transport: :grpc, &block
require "google/shopping/merchant/data_sources/#{version.to_s.downcase}"

package_name = Google::Shopping::Merchant::DataSources
.constants
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
.first
service_module = Google::Shopping::Merchant::DataSources.const_get(package_name).const_get(:FileUploadsService)
service_module = service_module.const_get(:Rest) if transport == :rest
service_module.const_get(:Client).new(&block)
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,23 @@ def test_data_sources_service_rest
assert_kind_of Google::Shopping::Merchant::DataSources::V1beta::DataSourcesService::Rest::Client, client
end
end

def test_file_uploads_service_grpc
Gapic::ServiceStub.stub :new, DummyStub.new do
grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
client = Google::Shopping::Merchant::DataSources.file_uploads_service transport: :grpc do |config|
config.credentials = grpc_channel
end
assert_kind_of Google::Shopping::Merchant::DataSources::V1beta::FileUploadsService::Client, client
end
end

def test_file_uploads_service_rest
Gapic::Rest::ClientStub.stub :new, DummyStub.new do
client = Google::Shopping::Merchant::DataSources.file_uploads_service transport: :rest do |config|
config.credentials = :dummy_credentials
end
assert_kind_of Google::Shopping::Merchant::DataSources::V1beta::FileUploadsService::Rest::Client, client
end
end
end