Skip to content

Commit

Permalink
feat(merchant-accounts): Support for AutofeedSettingsService (#27364)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] authored Oct 3, 2024
1 parent 2c3a1c1 commit fc5134a
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 5 deletions.
2 changes: 1 addition & 1 deletion google-shopping-merchant-accounts/.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-accounts/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-accounts-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-accounts-v1beta", ">= 0.0", "< 2.a"
gem.add_dependency "google-shopping-merchant-accounts-v1beta", ">= 0.2", "< 2.a"
end
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,41 @@ def self.accounts_service version: :v1beta, transport: :grpc, &block
service_module.const_get(:Client).new(&block)
end

##
# Create a new client object for AutofeedSettingsService.
#
# By default, this returns an instance of
# [Google::Shopping::Merchant::Accounts::V1beta::AutofeedSettingsService::Client](https://rubydoc.info/gems/google-shopping-merchant-accounts-v1beta/Google/Shopping/Merchant/Accounts/V1beta/AutofeedSettingsService/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 AutofeedSettingsService 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 AutofeedSettingsService
#
# Service to support
# [autofeed](https://support.google.com/merchants/answer/7538732) setting.
#
# @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.autofeed_settings_service version: :v1beta, transport: :grpc, &block
require "google/shopping/merchant/accounts/#{version.to_s.downcase}"

package_name = Google::Shopping::Merchant::Accounts
.constants
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
.first
service_module = Google::Shopping::Merchant::Accounts.const_get(package_name).const_get(:AutofeedSettingsService)
service_module = service_module.const_get(:Rest) if transport == :rest
service_module.const_get(:Client).new(&block)
end

##
# Create a new client object for BusinessIdentityService.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,25 @@ def test_accounts_service_rest
end
end

def test_autofeed_settings_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::Accounts.autofeed_settings_service transport: :grpc do |config|
config.credentials = grpc_channel
end
assert_kind_of Google::Shopping::Merchant::Accounts::V1beta::AutofeedSettingsService::Client, client
end
end

def test_autofeed_settings_service_rest
Gapic::Rest::ClientStub.stub :new, DummyStub.new do
client = Google::Shopping::Merchant::Accounts.autofeed_settings_service transport: :rest do |config|
config.credentials = :dummy_credentials
end
assert_kind_of Google::Shopping::Merchant::Accounts::V1beta::AutofeedSettingsService::Rest::Client, client
end
end

def test_business_identity_service_grpc
Gapic::ServiceStub.stub :new, DummyStub.new do
grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
Expand Down

0 comments on commit fc5134a

Please sign in to comment.