google-shopping-merchant-accounts-v1beta 0.a → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +143 -8
- data/lib/google/shopping/merchant/accounts/v1beta/accessright_pb.rb +44 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/client.rb +452 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/paths.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest/client.rb +419 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest/service_stub.rb +130 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_pb.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/client.rb +633 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest/client.rb +586 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest/service_stub.rb +249 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service.rb +61 -0
- data/lib/google/shopping/merchant/accounts/v1beta/account_tax_services_pb.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accountissue_pb.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accountissue_services_pb.rb +47 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_pb.rb +67 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/client.rb +942 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/paths.rb +80 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/client.rb +890 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/service_stub.rb +423 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/accounts_services_pb.rb +71 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/client.rb +525 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/paths.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest/client.rb +485 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest/service_stub.rb +190 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest.rb +55 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/client.rb +524 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/paths.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest/client.rb +484 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest/service_stub.rb +190 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/business_info_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/businessidentity_pb.rb +56 -0
- data/lib/google/shopping/merchant/accounts/v1beta/businessidentity_services_pb.rb +51 -0
- data/lib/google/shopping/merchant/accounts/v1beta/businessinfo_pb.rb +60 -0
- data/lib/google/shopping/merchant/accounts/v1beta/businessinfo_services_pb.rb +50 -0
- data/lib/google/shopping/merchant/accounts/v1beta/customerservice_pb.rb +48 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/client.rb +539 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/paths.rb +52 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest/client.rb +499 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest/service_stub.rb +190 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service.rb +60 -0
- data/lib/google/shopping/merchant/accounts/v1beta/emailpreferences_pb.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/emailpreferences_services_pb.rb +65 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_pb.rb +55 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/client.rb +724 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/paths.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest/client.rb +670 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest/service_stub.rb +310 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/homepage_services_pb.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_pb.rb +61 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/client.rb +551 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/client.rb +511 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/service_stub.rb +189 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service.rb +61 -0
- data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_services_pb.rb +53 -0
- data/lib/google/shopping/merchant/accounts/v1beta/phoneverificationstate_pb.rb +44 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_pb.rb +56 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/client.rb +734 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest/client.rb +680 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest/service_stub.rb +309 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest.rb +64 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_service.rb +67 -0
- data/lib/google/shopping/merchant/accounts/v1beta/programs_services_pb.rb +65 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_pb.rb +63 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/client.rb +835 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest/client.rb +774 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest/service_stub.rb +368 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_service.rb +61 -0
- data/lib/google/shopping/merchant/accounts/v1beta/regions_services_pb.rb +62 -0
- data/lib/google/shopping/merchant/accounts/v1beta/rest.rb +52 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/client.rb +526 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/paths.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/client.rb +486 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/service_stub.rb +190 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest.rb +55 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shippingsettings_pb.rb +83 -0
- data/lib/google/shopping/merchant/accounts/v1beta/shippingsettings_services_pb.rb +51 -0
- data/lib/google/shopping/merchant/accounts/v1beta/tax_rule_pb.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/client.rb +522 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest/client.rb +482 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest/service_stub.rb +189 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/client.rb +623 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/paths.rb +63 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest/client.rb +584 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest/service_stub.rb +246 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/termsofservice_pb.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/termsofservice_services_pb.rb +52 -0
- data/lib/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate_pb.rb +56 -0
- data/lib/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate_services_pb.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/termsofservicekind_pb.rb +44 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_pb.rb +60 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/client.rb +838 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/credentials.rb +49 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/paths.rb +66 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest/client.rb +777 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest/service_stub.rb +368 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest.rb +54 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_service.rb +57 -0
- data/lib/google/shopping/merchant/accounts/v1beta/user_services_pb.rb +58 -0
- data/lib/google/shopping/merchant/accounts/v1beta/version.rb +7 -2
- data/lib/google/shopping/merchant/accounts/v1beta.rb +60 -0
- data/lib/google-shopping-merchant-accounts-v1beta.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +420 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +227 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/accessright.rb +43 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/account_tax.rb +101 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/accountissue.rb +142 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/accounts.rb +219 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/businessidentity.rb +129 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/businessinfo.rb +72 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/customerservice.rb +43 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/emailpreferences.rb +82 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/homepage.rb +87 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/online_return_policy.rb +238 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/phoneverificationstate.rb +40 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/programs.rb +160 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/regions.rb +195 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/shippingsettings.rb +743 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/tax_rule.rb +88 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/termsofservice.rb +99 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.rb +132 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/termsofservicekind.rb +37 -0
- data/proto_docs/google/shopping/merchant/accounts/v1beta/user.rb +156 -0
- data/proto_docs/google/shopping/type/types.rb +210 -0
- data/proto_docs/google/type/date.rb +53 -0
- data/proto_docs/google/type/datetime.rb +99 -0
- data/proto_docs/google/type/interval.rb +45 -0
- data/proto_docs/google/type/phone_number.rb +112 -0
- data/proto_docs/google/type/postal_address.rb +135 -0
- metadata +234 -10
@@ -0,0 +1,734 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/shopping/merchant/accounts/v1beta/programs_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Shopping
|
24
|
+
module Merchant
|
25
|
+
module Accounts
|
26
|
+
module V1beta
|
27
|
+
module ProgramsService
|
28
|
+
##
|
29
|
+
# Client for the ProgramsService service.
|
30
|
+
#
|
31
|
+
# Service for program management.
|
32
|
+
#
|
33
|
+
# Programs provide a mechanism for adding functionality to merchant accounts. A
|
34
|
+
# typical example of this is the [Free product
|
35
|
+
# listings](https://support.google.com/merchants/topic/9240261?ref_topic=7257954,7259405,&sjid=796648681813264022-EU)
|
36
|
+
# program, which enables products from a merchant's store to be shown across
|
37
|
+
# Google for free.
|
38
|
+
#
|
39
|
+
# This service exposes methods to retrieve a merchant's
|
40
|
+
# participation in all available programs, in addition to methods for
|
41
|
+
# explicitly enabling or disabling participation in each program.
|
42
|
+
#
|
43
|
+
class Client
|
44
|
+
# @private
|
45
|
+
API_VERSION = ""
|
46
|
+
|
47
|
+
# @private
|
48
|
+
DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
|
49
|
+
|
50
|
+
include Paths
|
51
|
+
|
52
|
+
# @private
|
53
|
+
attr_reader :programs_service_stub
|
54
|
+
|
55
|
+
##
|
56
|
+
# Configure the ProgramsService Client class.
|
57
|
+
#
|
58
|
+
# See {::Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Client::Configuration}
|
59
|
+
# for a description of the configuration fields.
|
60
|
+
#
|
61
|
+
# @example
|
62
|
+
#
|
63
|
+
# # Modify the configuration for all ProgramsService clients
|
64
|
+
# ::Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Client.configure do |config|
|
65
|
+
# config.timeout = 10.0
|
66
|
+
# end
|
67
|
+
#
|
68
|
+
# @yield [config] Configure the Client client.
|
69
|
+
# @yieldparam config [Client::Configuration]
|
70
|
+
#
|
71
|
+
# @return [Client::Configuration]
|
72
|
+
#
|
73
|
+
def self.configure
|
74
|
+
@configure ||= begin
|
75
|
+
namespace = ["Google", "Shopping", "Merchant", "Accounts", "V1beta"]
|
76
|
+
parent_config = while namespace.any?
|
77
|
+
parent_name = namespace.join "::"
|
78
|
+
parent_const = const_get parent_name
|
79
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
80
|
+
namespace.pop
|
81
|
+
end
|
82
|
+
default_config = Client::Configuration.new parent_config
|
83
|
+
|
84
|
+
default_config
|
85
|
+
end
|
86
|
+
yield @configure if block_given?
|
87
|
+
@configure
|
88
|
+
end
|
89
|
+
|
90
|
+
##
|
91
|
+
# Configure the ProgramsService Client instance.
|
92
|
+
#
|
93
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
94
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
95
|
+
# should be made on {Client.configure}.
|
96
|
+
#
|
97
|
+
# See {::Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Client::Configuration}
|
98
|
+
# for a description of the configuration fields.
|
99
|
+
#
|
100
|
+
# @yield [config] Configure the Client client.
|
101
|
+
# @yieldparam config [Client::Configuration]
|
102
|
+
#
|
103
|
+
# @return [Client::Configuration]
|
104
|
+
#
|
105
|
+
def configure
|
106
|
+
yield @config if block_given?
|
107
|
+
@config
|
108
|
+
end
|
109
|
+
|
110
|
+
##
|
111
|
+
# The effective universe domain
|
112
|
+
#
|
113
|
+
# @return [String]
|
114
|
+
#
|
115
|
+
def universe_domain
|
116
|
+
@programs_service_stub.universe_domain
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# Create a new ProgramsService client object.
|
121
|
+
#
|
122
|
+
# @example
|
123
|
+
#
|
124
|
+
# # Create a client using the default configuration
|
125
|
+
# client = ::Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Client.new
|
126
|
+
#
|
127
|
+
# # Create a client using a custom configuration
|
128
|
+
# client = ::Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Client.new do |config|
|
129
|
+
# config.timeout = 10.0
|
130
|
+
# end
|
131
|
+
#
|
132
|
+
# @yield [config] Configure the ProgramsService client.
|
133
|
+
# @yieldparam config [Client::Configuration]
|
134
|
+
#
|
135
|
+
def initialize
|
136
|
+
# These require statements are intentionally placed here to initialize
|
137
|
+
# the gRPC module only when it's required.
|
138
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
139
|
+
require "gapic/grpc"
|
140
|
+
require "google/shopping/merchant/accounts/v1beta/programs_services_pb"
|
141
|
+
|
142
|
+
# Create the configuration object
|
143
|
+
@config = Configuration.new Client.configure
|
144
|
+
|
145
|
+
# Yield the configuration if needed
|
146
|
+
yield @config if block_given?
|
147
|
+
|
148
|
+
# Create credentials
|
149
|
+
credentials = @config.credentials
|
150
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
151
|
+
# but only if the default endpoint does not have a region prefix.
|
152
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
153
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
154
|
+
!@config.endpoint.split(".").first.include?("-"))
|
155
|
+
credentials ||= Credentials.default scope: @config.scope,
|
156
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
157
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
158
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
159
|
+
end
|
160
|
+
@quota_project_id = @config.quota_project
|
161
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
162
|
+
|
163
|
+
@programs_service_stub = ::Gapic::ServiceStub.new(
|
164
|
+
::Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Stub,
|
165
|
+
credentials: credentials,
|
166
|
+
endpoint: @config.endpoint,
|
167
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
168
|
+
universe_domain: @config.universe_domain,
|
169
|
+
channel_args: @config.channel_args,
|
170
|
+
interceptors: @config.interceptors,
|
171
|
+
channel_pool_config: @config.channel_pool
|
172
|
+
)
|
173
|
+
end
|
174
|
+
|
175
|
+
# Service calls
|
176
|
+
|
177
|
+
##
|
178
|
+
# Retrieves the specified program for the account.
|
179
|
+
#
|
180
|
+
# @overload get_program(request, options = nil)
|
181
|
+
# Pass arguments to `get_program` via a request object, either of type
|
182
|
+
# {::Google::Shopping::Merchant::Accounts::V1beta::GetProgramRequest} or an equivalent Hash.
|
183
|
+
#
|
184
|
+
# @param request [::Google::Shopping::Merchant::Accounts::V1beta::GetProgramRequest, ::Hash]
|
185
|
+
# A request object representing the call parameters. Required. To specify no
|
186
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
187
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
188
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
189
|
+
#
|
190
|
+
# @overload get_program(name: nil)
|
191
|
+
# Pass arguments to `get_program` via keyword arguments. Note that at
|
192
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
193
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
194
|
+
#
|
195
|
+
# @param name [::String]
|
196
|
+
# Required. The name of the program to retrieve.
|
197
|
+
# Format: `accounts/{account}/programs/{program}`
|
198
|
+
#
|
199
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
200
|
+
# @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::Program]
|
201
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
202
|
+
#
|
203
|
+
# @return [::Google::Shopping::Merchant::Accounts::V1beta::Program]
|
204
|
+
#
|
205
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
206
|
+
#
|
207
|
+
# @example Basic example
|
208
|
+
# require "google/shopping/merchant/accounts/v1beta"
|
209
|
+
#
|
210
|
+
# # Create a client object. The client can be reused for multiple calls.
|
211
|
+
# client = Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Client.new
|
212
|
+
#
|
213
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
214
|
+
# request = Google::Shopping::Merchant::Accounts::V1beta::GetProgramRequest.new
|
215
|
+
#
|
216
|
+
# # Call the get_program method.
|
217
|
+
# result = client.get_program request
|
218
|
+
#
|
219
|
+
# # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::Program.
|
220
|
+
# p result
|
221
|
+
#
|
222
|
+
def get_program request, options = nil
|
223
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
224
|
+
|
225
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::GetProgramRequest
|
226
|
+
|
227
|
+
# Converts hash and nil to an options object
|
228
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
229
|
+
|
230
|
+
# Customize the options with defaults
|
231
|
+
metadata = @config.rpcs.get_program.metadata.to_h
|
232
|
+
|
233
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
234
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
235
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
236
|
+
gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
|
237
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
238
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
239
|
+
|
240
|
+
header_params = {}
|
241
|
+
if request.name
|
242
|
+
header_params["name"] = request.name
|
243
|
+
end
|
244
|
+
|
245
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
246
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
247
|
+
|
248
|
+
options.apply_defaults timeout: @config.rpcs.get_program.timeout,
|
249
|
+
metadata: metadata,
|
250
|
+
retry_policy: @config.rpcs.get_program.retry_policy
|
251
|
+
|
252
|
+
options.apply_defaults timeout: @config.timeout,
|
253
|
+
metadata: @config.metadata,
|
254
|
+
retry_policy: @config.retry_policy
|
255
|
+
|
256
|
+
@programs_service_stub.call_rpc :get_program, request, options: options do |response, operation|
|
257
|
+
yield response, operation if block_given?
|
258
|
+
return response
|
259
|
+
end
|
260
|
+
rescue ::GRPC::BadStatus => e
|
261
|
+
raise ::Google::Cloud::Error.from_error(e)
|
262
|
+
end
|
263
|
+
|
264
|
+
##
|
265
|
+
# Retrieves all programs for the account.
|
266
|
+
#
|
267
|
+
# @overload list_programs(request, options = nil)
|
268
|
+
# Pass arguments to `list_programs` via a request object, either of type
|
269
|
+
# {::Google::Shopping::Merchant::Accounts::V1beta::ListProgramsRequest} or an equivalent Hash.
|
270
|
+
#
|
271
|
+
# @param request [::Google::Shopping::Merchant::Accounts::V1beta::ListProgramsRequest, ::Hash]
|
272
|
+
# A request object representing the call parameters. Required. To specify no
|
273
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
274
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
275
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
276
|
+
#
|
277
|
+
# @overload list_programs(parent: nil, page_size: nil, page_token: nil)
|
278
|
+
# Pass arguments to `list_programs` via keyword arguments. Note that at
|
279
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
280
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
281
|
+
#
|
282
|
+
# @param parent [::String]
|
283
|
+
# Required. The name of the account for which to retrieve all programs.
|
284
|
+
# Format: `accounts/{account}`
|
285
|
+
# @param page_size [::Integer]
|
286
|
+
# Optional. The maximum number of programs to return in a single response. If
|
287
|
+
# unspecified (or 0), a default size of 1000 is used. The maximum value is
|
288
|
+
# 1000; values above 1000 will be coerced to 1000.
|
289
|
+
# @param page_token [::String]
|
290
|
+
# Optional. A continuation token, received from a previous `ListPrograms`
|
291
|
+
# call. Provide this to retrieve the next page.
|
292
|
+
#
|
293
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
294
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::Program>]
|
295
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
296
|
+
#
|
297
|
+
# @return [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::Program>]
|
298
|
+
#
|
299
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
300
|
+
#
|
301
|
+
# @example Basic example
|
302
|
+
# require "google/shopping/merchant/accounts/v1beta"
|
303
|
+
#
|
304
|
+
# # Create a client object. The client can be reused for multiple calls.
|
305
|
+
# client = Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Client.new
|
306
|
+
#
|
307
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
308
|
+
# request = Google::Shopping::Merchant::Accounts::V1beta::ListProgramsRequest.new
|
309
|
+
#
|
310
|
+
# # Call the list_programs method.
|
311
|
+
# result = client.list_programs request
|
312
|
+
#
|
313
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
314
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
315
|
+
# result.each do |item|
|
316
|
+
# # Each element is of type ::Google::Shopping::Merchant::Accounts::V1beta::Program.
|
317
|
+
# p item
|
318
|
+
# end
|
319
|
+
#
|
320
|
+
def list_programs request, options = nil
|
321
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
322
|
+
|
323
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::ListProgramsRequest
|
324
|
+
|
325
|
+
# Converts hash and nil to an options object
|
326
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
327
|
+
|
328
|
+
# Customize the options with defaults
|
329
|
+
metadata = @config.rpcs.list_programs.metadata.to_h
|
330
|
+
|
331
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
332
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
333
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
334
|
+
gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
|
335
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
336
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
337
|
+
|
338
|
+
header_params = {}
|
339
|
+
if request.parent
|
340
|
+
header_params["parent"] = request.parent
|
341
|
+
end
|
342
|
+
|
343
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
344
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
345
|
+
|
346
|
+
options.apply_defaults timeout: @config.rpcs.list_programs.timeout,
|
347
|
+
metadata: metadata,
|
348
|
+
retry_policy: @config.rpcs.list_programs.retry_policy
|
349
|
+
|
350
|
+
options.apply_defaults timeout: @config.timeout,
|
351
|
+
metadata: @config.metadata,
|
352
|
+
retry_policy: @config.retry_policy
|
353
|
+
|
354
|
+
@programs_service_stub.call_rpc :list_programs, request, options: options do |response, operation|
|
355
|
+
response = ::Gapic::PagedEnumerable.new @programs_service_stub, :list_programs, request, response, operation, options
|
356
|
+
yield response, operation if block_given?
|
357
|
+
return response
|
358
|
+
end
|
359
|
+
rescue ::GRPC::BadStatus => e
|
360
|
+
raise ::Google::Cloud::Error.from_error(e)
|
361
|
+
end
|
362
|
+
|
363
|
+
##
|
364
|
+
# Enable participation in the specified program for the account. Executing
|
365
|
+
# this method requires admin access.
|
366
|
+
#
|
367
|
+
# @overload enable_program(request, options = nil)
|
368
|
+
# Pass arguments to `enable_program` via a request object, either of type
|
369
|
+
# {::Google::Shopping::Merchant::Accounts::V1beta::EnableProgramRequest} or an equivalent Hash.
|
370
|
+
#
|
371
|
+
# @param request [::Google::Shopping::Merchant::Accounts::V1beta::EnableProgramRequest, ::Hash]
|
372
|
+
# A request object representing the call parameters. Required. To specify no
|
373
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
374
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
375
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
376
|
+
#
|
377
|
+
# @overload enable_program(name: nil)
|
378
|
+
# Pass arguments to `enable_program` via keyword arguments. Note that at
|
379
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
380
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
381
|
+
#
|
382
|
+
# @param name [::String]
|
383
|
+
# Required. The name of the program for which to enable participation for the
|
384
|
+
# given account. Format: `accounts/{account}/programs/{program}`
|
385
|
+
#
|
386
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
387
|
+
# @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::Program]
|
388
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
389
|
+
#
|
390
|
+
# @return [::Google::Shopping::Merchant::Accounts::V1beta::Program]
|
391
|
+
#
|
392
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
393
|
+
#
|
394
|
+
# @example Basic example
|
395
|
+
# require "google/shopping/merchant/accounts/v1beta"
|
396
|
+
#
|
397
|
+
# # Create a client object. The client can be reused for multiple calls.
|
398
|
+
# client = Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Client.new
|
399
|
+
#
|
400
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
401
|
+
# request = Google::Shopping::Merchant::Accounts::V1beta::EnableProgramRequest.new
|
402
|
+
#
|
403
|
+
# # Call the enable_program method.
|
404
|
+
# result = client.enable_program request
|
405
|
+
#
|
406
|
+
# # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::Program.
|
407
|
+
# p result
|
408
|
+
#
|
409
|
+
def enable_program request, options = nil
|
410
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
411
|
+
|
412
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::EnableProgramRequest
|
413
|
+
|
414
|
+
# Converts hash and nil to an options object
|
415
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
416
|
+
|
417
|
+
# Customize the options with defaults
|
418
|
+
metadata = @config.rpcs.enable_program.metadata.to_h
|
419
|
+
|
420
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
421
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
422
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
423
|
+
gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
|
424
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
425
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
426
|
+
|
427
|
+
header_params = {}
|
428
|
+
if request.name
|
429
|
+
header_params["name"] = request.name
|
430
|
+
end
|
431
|
+
|
432
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
433
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
434
|
+
|
435
|
+
options.apply_defaults timeout: @config.rpcs.enable_program.timeout,
|
436
|
+
metadata: metadata,
|
437
|
+
retry_policy: @config.rpcs.enable_program.retry_policy
|
438
|
+
|
439
|
+
options.apply_defaults timeout: @config.timeout,
|
440
|
+
metadata: @config.metadata,
|
441
|
+
retry_policy: @config.retry_policy
|
442
|
+
|
443
|
+
@programs_service_stub.call_rpc :enable_program, request, options: options do |response, operation|
|
444
|
+
yield response, operation if block_given?
|
445
|
+
return response
|
446
|
+
end
|
447
|
+
rescue ::GRPC::BadStatus => e
|
448
|
+
raise ::Google::Cloud::Error.from_error(e)
|
449
|
+
end
|
450
|
+
|
451
|
+
##
|
452
|
+
# Disable participation in the specified program for the account. Executing
|
453
|
+
# this method requires admin access.
|
454
|
+
#
|
455
|
+
# @overload disable_program(request, options = nil)
|
456
|
+
# Pass arguments to `disable_program` via a request object, either of type
|
457
|
+
# {::Google::Shopping::Merchant::Accounts::V1beta::DisableProgramRequest} or an equivalent Hash.
|
458
|
+
#
|
459
|
+
# @param request [::Google::Shopping::Merchant::Accounts::V1beta::DisableProgramRequest, ::Hash]
|
460
|
+
# A request object representing the call parameters. Required. To specify no
|
461
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
462
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
463
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
464
|
+
#
|
465
|
+
# @overload disable_program(name: nil)
|
466
|
+
# Pass arguments to `disable_program` via keyword arguments. Note that at
|
467
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
468
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
469
|
+
#
|
470
|
+
# @param name [::String]
|
471
|
+
# Required. The name of the program for which to disable participation for
|
472
|
+
# the given account. Format: `accounts/{account}/programs/{program}`
|
473
|
+
#
|
474
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
475
|
+
# @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::Program]
|
476
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
477
|
+
#
|
478
|
+
# @return [::Google::Shopping::Merchant::Accounts::V1beta::Program]
|
479
|
+
#
|
480
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
481
|
+
#
|
482
|
+
# @example Basic example
|
483
|
+
# require "google/shopping/merchant/accounts/v1beta"
|
484
|
+
#
|
485
|
+
# # Create a client object. The client can be reused for multiple calls.
|
486
|
+
# client = Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Client.new
|
487
|
+
#
|
488
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
489
|
+
# request = Google::Shopping::Merchant::Accounts::V1beta::DisableProgramRequest.new
|
490
|
+
#
|
491
|
+
# # Call the disable_program method.
|
492
|
+
# result = client.disable_program request
|
493
|
+
#
|
494
|
+
# # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::Program.
|
495
|
+
# p result
|
496
|
+
#
|
497
|
+
def disable_program request, options = nil
|
498
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
499
|
+
|
500
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::DisableProgramRequest
|
501
|
+
|
502
|
+
# Converts hash and nil to an options object
|
503
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
504
|
+
|
505
|
+
# Customize the options with defaults
|
506
|
+
metadata = @config.rpcs.disable_program.metadata.to_h
|
507
|
+
|
508
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
509
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
510
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
511
|
+
gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
|
512
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
513
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
514
|
+
|
515
|
+
header_params = {}
|
516
|
+
if request.name
|
517
|
+
header_params["name"] = request.name
|
518
|
+
end
|
519
|
+
|
520
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
521
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
522
|
+
|
523
|
+
options.apply_defaults timeout: @config.rpcs.disable_program.timeout,
|
524
|
+
metadata: metadata,
|
525
|
+
retry_policy: @config.rpcs.disable_program.retry_policy
|
526
|
+
|
527
|
+
options.apply_defaults timeout: @config.timeout,
|
528
|
+
metadata: @config.metadata,
|
529
|
+
retry_policy: @config.retry_policy
|
530
|
+
|
531
|
+
@programs_service_stub.call_rpc :disable_program, request, options: options do |response, operation|
|
532
|
+
yield response, operation if block_given?
|
533
|
+
return response
|
534
|
+
end
|
535
|
+
rescue ::GRPC::BadStatus => e
|
536
|
+
raise ::Google::Cloud::Error.from_error(e)
|
537
|
+
end
|
538
|
+
|
539
|
+
##
|
540
|
+
# Configuration class for the ProgramsService API.
|
541
|
+
#
|
542
|
+
# This class represents the configuration for ProgramsService,
|
543
|
+
# providing control over timeouts, retry behavior, logging, transport
|
544
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
545
|
+
# applied individually to specific RPCs. See
|
546
|
+
# {::Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Client::Configuration::Rpcs}
|
547
|
+
# for a list of RPCs that can be configured independently.
|
548
|
+
#
|
549
|
+
# Configuration can be applied globally to all clients, or to a single client
|
550
|
+
# on construction.
|
551
|
+
#
|
552
|
+
# @example
|
553
|
+
#
|
554
|
+
# # Modify the global config, setting the timeout for
|
555
|
+
# # get_program to 20 seconds,
|
556
|
+
# # and all remaining timeouts to 10 seconds.
|
557
|
+
# ::Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Client.configure do |config|
|
558
|
+
# config.timeout = 10.0
|
559
|
+
# config.rpcs.get_program.timeout = 20.0
|
560
|
+
# end
|
561
|
+
#
|
562
|
+
# # Apply the above configuration only to a new client.
|
563
|
+
# client = ::Google::Shopping::Merchant::Accounts::V1beta::ProgramsService::Client.new do |config|
|
564
|
+
# config.timeout = 10.0
|
565
|
+
# config.rpcs.get_program.timeout = 20.0
|
566
|
+
# end
|
567
|
+
#
|
568
|
+
# @!attribute [rw] endpoint
|
569
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
570
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
571
|
+
# @return [::String,nil]
|
572
|
+
# @!attribute [rw] credentials
|
573
|
+
# Credentials to send with calls. You may provide any of the following types:
|
574
|
+
# * (`String`) The path to a service account key file in JSON format
|
575
|
+
# * (`Hash`) A service account key as a Hash
|
576
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
577
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
578
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
579
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
580
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
581
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
582
|
+
# * (`nil`) indicating no credentials
|
583
|
+
# @return [::Object]
|
584
|
+
# @!attribute [rw] scope
|
585
|
+
# The OAuth scopes
|
586
|
+
# @return [::Array<::String>]
|
587
|
+
# @!attribute [rw] lib_name
|
588
|
+
# The library name as recorded in instrumentation and logging
|
589
|
+
# @return [::String]
|
590
|
+
# @!attribute [rw] lib_version
|
591
|
+
# The library version as recorded in instrumentation and logging
|
592
|
+
# @return [::String]
|
593
|
+
# @!attribute [rw] channel_args
|
594
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
595
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
596
|
+
# @return [::Hash]
|
597
|
+
# @!attribute [rw] interceptors
|
598
|
+
# An array of interceptors that are run before calls are executed.
|
599
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
600
|
+
# @!attribute [rw] timeout
|
601
|
+
# The call timeout in seconds.
|
602
|
+
# @return [::Numeric]
|
603
|
+
# @!attribute [rw] metadata
|
604
|
+
# Additional gRPC headers to be sent with the call.
|
605
|
+
# @return [::Hash{::Symbol=>::String}]
|
606
|
+
# @!attribute [rw] retry_policy
|
607
|
+
# The retry policy. The value is a hash with the following keys:
|
608
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
609
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
610
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
611
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
612
|
+
# trigger a retry.
|
613
|
+
# @return [::Hash]
|
614
|
+
# @!attribute [rw] quota_project
|
615
|
+
# A separate project against which to charge quota.
|
616
|
+
# @return [::String]
|
617
|
+
# @!attribute [rw] universe_domain
|
618
|
+
# The universe domain within which to make requests. This determines the
|
619
|
+
# default endpoint URL. The default value of nil uses the environment
|
620
|
+
# universe (usually the default "googleapis.com" universe).
|
621
|
+
# @return [::String,nil]
|
622
|
+
#
|
623
|
+
class Configuration
|
624
|
+
extend ::Gapic::Config
|
625
|
+
|
626
|
+
# @private
|
627
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
628
|
+
DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
|
629
|
+
|
630
|
+
config_attr :endpoint, nil, ::String, nil
|
631
|
+
config_attr :credentials, nil do |value|
|
632
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
633
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
634
|
+
allowed.any? { |klass| klass === value }
|
635
|
+
end
|
636
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
637
|
+
config_attr :lib_name, nil, ::String, nil
|
638
|
+
config_attr :lib_version, nil, ::String, nil
|
639
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
640
|
+
config_attr :interceptors, nil, ::Array, nil
|
641
|
+
config_attr :timeout, nil, ::Numeric, nil
|
642
|
+
config_attr :metadata, nil, ::Hash, nil
|
643
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
644
|
+
config_attr :quota_project, nil, ::String, nil
|
645
|
+
config_attr :universe_domain, nil, ::String, nil
|
646
|
+
|
647
|
+
# @private
|
648
|
+
def initialize parent_config = nil
|
649
|
+
@parent_config = parent_config unless parent_config.nil?
|
650
|
+
|
651
|
+
yield self if block_given?
|
652
|
+
end
|
653
|
+
|
654
|
+
##
|
655
|
+
# Configurations for individual RPCs
|
656
|
+
# @return [Rpcs]
|
657
|
+
#
|
658
|
+
def rpcs
|
659
|
+
@rpcs ||= begin
|
660
|
+
parent_rpcs = nil
|
661
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
662
|
+
Rpcs.new parent_rpcs
|
663
|
+
end
|
664
|
+
end
|
665
|
+
|
666
|
+
##
|
667
|
+
# Configuration for the channel pool
|
668
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
669
|
+
#
|
670
|
+
def channel_pool
|
671
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
672
|
+
end
|
673
|
+
|
674
|
+
##
|
675
|
+
# Configuration RPC class for the ProgramsService API.
|
676
|
+
#
|
677
|
+
# Includes fields providing the configuration for each RPC in this service.
|
678
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
679
|
+
# the following configuration fields:
|
680
|
+
#
|
681
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
682
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
683
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
684
|
+
# include the following keys:
|
685
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
686
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
687
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
688
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
689
|
+
# trigger a retry.
|
690
|
+
#
|
691
|
+
class Rpcs
|
692
|
+
##
|
693
|
+
# RPC-specific configuration for `get_program`
|
694
|
+
# @return [::Gapic::Config::Method]
|
695
|
+
#
|
696
|
+
attr_reader :get_program
|
697
|
+
##
|
698
|
+
# RPC-specific configuration for `list_programs`
|
699
|
+
# @return [::Gapic::Config::Method]
|
700
|
+
#
|
701
|
+
attr_reader :list_programs
|
702
|
+
##
|
703
|
+
# RPC-specific configuration for `enable_program`
|
704
|
+
# @return [::Gapic::Config::Method]
|
705
|
+
#
|
706
|
+
attr_reader :enable_program
|
707
|
+
##
|
708
|
+
# RPC-specific configuration for `disable_program`
|
709
|
+
# @return [::Gapic::Config::Method]
|
710
|
+
#
|
711
|
+
attr_reader :disable_program
|
712
|
+
|
713
|
+
# @private
|
714
|
+
def initialize parent_rpcs = nil
|
715
|
+
get_program_config = parent_rpcs.get_program if parent_rpcs.respond_to? :get_program
|
716
|
+
@get_program = ::Gapic::Config::Method.new get_program_config
|
717
|
+
list_programs_config = parent_rpcs.list_programs if parent_rpcs.respond_to? :list_programs
|
718
|
+
@list_programs = ::Gapic::Config::Method.new list_programs_config
|
719
|
+
enable_program_config = parent_rpcs.enable_program if parent_rpcs.respond_to? :enable_program
|
720
|
+
@enable_program = ::Gapic::Config::Method.new enable_program_config
|
721
|
+
disable_program_config = parent_rpcs.disable_program if parent_rpcs.respond_to? :disable_program
|
722
|
+
@disable_program = ::Gapic::Config::Method.new disable_program_config
|
723
|
+
|
724
|
+
yield self if block_given?
|
725
|
+
end
|
726
|
+
end
|
727
|
+
end
|
728
|
+
end
|
729
|
+
end
|
730
|
+
end
|
731
|
+
end
|
732
|
+
end
|
733
|
+
end
|
734
|
+
end
|