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.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +143 -8
  5. data/lib/google/shopping/merchant/accounts/v1beta/accessright_pb.rb +44 -0
  6. data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/client.rb +452 -0
  7. data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/credentials.rb +49 -0
  8. data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/paths.rb +49 -0
  9. data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest/client.rb +419 -0
  10. data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest/service_stub.rb +130 -0
  11. data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest.rb +54 -0
  12. data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service.rb +57 -0
  13. data/lib/google/shopping/merchant/accounts/v1beta/account_tax_pb.rb +57 -0
  14. data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/client.rb +633 -0
  15. data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/credentials.rb +49 -0
  16. data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/paths.rb +66 -0
  17. data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest/client.rb +586 -0
  18. data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest/service_stub.rb +249 -0
  19. data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest.rb +58 -0
  20. data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service.rb +61 -0
  21. data/lib/google/shopping/merchant/accounts/v1beta/account_tax_services_pb.rb +58 -0
  22. data/lib/google/shopping/merchant/accounts/v1beta/accountissue_pb.rb +57 -0
  23. data/lib/google/shopping/merchant/accounts/v1beta/accountissue_services_pb.rb +47 -0
  24. data/lib/google/shopping/merchant/accounts/v1beta/accounts_pb.rb +67 -0
  25. data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/client.rb +942 -0
  26. data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/credentials.rb +49 -0
  27. data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/paths.rb +80 -0
  28. data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/client.rb +890 -0
  29. data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/service_stub.rb +423 -0
  30. data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest.rb +54 -0
  31. data/lib/google/shopping/merchant/accounts/v1beta/accounts_service.rb +57 -0
  32. data/lib/google/shopping/merchant/accounts/v1beta/accounts_services_pb.rb +71 -0
  33. data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/client.rb +525 -0
  34. data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/credentials.rb +49 -0
  35. data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/paths.rb +49 -0
  36. data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest/client.rb +485 -0
  37. data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest/service_stub.rb +190 -0
  38. data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest.rb +55 -0
  39. data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service.rb +58 -0
  40. data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/client.rb +524 -0
  41. data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/credentials.rb +49 -0
  42. data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/paths.rb +49 -0
  43. data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest/client.rb +484 -0
  44. data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest/service_stub.rb +190 -0
  45. data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest.rb +54 -0
  46. data/lib/google/shopping/merchant/accounts/v1beta/business_info_service.rb +57 -0
  47. data/lib/google/shopping/merchant/accounts/v1beta/businessidentity_pb.rb +56 -0
  48. data/lib/google/shopping/merchant/accounts/v1beta/businessidentity_services_pb.rb +51 -0
  49. data/lib/google/shopping/merchant/accounts/v1beta/businessinfo_pb.rb +60 -0
  50. data/lib/google/shopping/merchant/accounts/v1beta/businessinfo_services_pb.rb +50 -0
  51. data/lib/google/shopping/merchant/accounts/v1beta/customerservice_pb.rb +48 -0
  52. data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/client.rb +539 -0
  53. data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/credentials.rb +49 -0
  54. data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/paths.rb +52 -0
  55. data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest/client.rb +499 -0
  56. data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest/service_stub.rb +190 -0
  57. data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest.rb +57 -0
  58. data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service.rb +60 -0
  59. data/lib/google/shopping/merchant/accounts/v1beta/emailpreferences_pb.rb +54 -0
  60. data/lib/google/shopping/merchant/accounts/v1beta/emailpreferences_services_pb.rb +65 -0
  61. data/lib/google/shopping/merchant/accounts/v1beta/homepage_pb.rb +55 -0
  62. data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/client.rb +724 -0
  63. data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/credentials.rb +49 -0
  64. data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/paths.rb +49 -0
  65. data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest/client.rb +670 -0
  66. data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest/service_stub.rb +310 -0
  67. data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest.rb +54 -0
  68. data/lib/google/shopping/merchant/accounts/v1beta/homepage_service.rb +57 -0
  69. data/lib/google/shopping/merchant/accounts/v1beta/homepage_services_pb.rb +66 -0
  70. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_pb.rb +61 -0
  71. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/client.rb +551 -0
  72. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/credentials.rb +49 -0
  73. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/paths.rb +66 -0
  74. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/client.rb +511 -0
  75. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/service_stub.rb +189 -0
  76. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest.rb +58 -0
  77. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service.rb +61 -0
  78. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_services_pb.rb +53 -0
  79. data/lib/google/shopping/merchant/accounts/v1beta/phoneverificationstate_pb.rb +44 -0
  80. data/lib/google/shopping/merchant/accounts/v1beta/programs_pb.rb +56 -0
  81. data/lib/google/shopping/merchant/accounts/v1beta/programs_service/client.rb +734 -0
  82. data/lib/google/shopping/merchant/accounts/v1beta/programs_service/credentials.rb +49 -0
  83. data/lib/google/shopping/merchant/accounts/v1beta/programs_service/paths.rb +66 -0
  84. data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest/client.rb +680 -0
  85. data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest/service_stub.rb +309 -0
  86. data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest.rb +64 -0
  87. data/lib/google/shopping/merchant/accounts/v1beta/programs_service.rb +67 -0
  88. data/lib/google/shopping/merchant/accounts/v1beta/programs_services_pb.rb +65 -0
  89. data/lib/google/shopping/merchant/accounts/v1beta/regions_pb.rb +63 -0
  90. data/lib/google/shopping/merchant/accounts/v1beta/regions_service/client.rb +835 -0
  91. data/lib/google/shopping/merchant/accounts/v1beta/regions_service/credentials.rb +49 -0
  92. data/lib/google/shopping/merchant/accounts/v1beta/regions_service/paths.rb +66 -0
  93. data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest/client.rb +774 -0
  94. data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest/service_stub.rb +368 -0
  95. data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest.rb +58 -0
  96. data/lib/google/shopping/merchant/accounts/v1beta/regions_service.rb +61 -0
  97. data/lib/google/shopping/merchant/accounts/v1beta/regions_services_pb.rb +62 -0
  98. data/lib/google/shopping/merchant/accounts/v1beta/rest.rb +52 -0
  99. data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/client.rb +526 -0
  100. data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/credentials.rb +49 -0
  101. data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/paths.rb +49 -0
  102. data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/client.rb +486 -0
  103. data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/service_stub.rb +190 -0
  104. data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest.rb +55 -0
  105. data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service.rb +58 -0
  106. data/lib/google/shopping/merchant/accounts/v1beta/shippingsettings_pb.rb +83 -0
  107. data/lib/google/shopping/merchant/accounts/v1beta/shippingsettings_services_pb.rb +51 -0
  108. data/lib/google/shopping/merchant/accounts/v1beta/tax_rule_pb.rb +49 -0
  109. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/client.rb +522 -0
  110. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/credentials.rb +49 -0
  111. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/paths.rb +66 -0
  112. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest/client.rb +482 -0
  113. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest/service_stub.rb +189 -0
  114. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest.rb +54 -0
  115. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service.rb +57 -0
  116. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/client.rb +623 -0
  117. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/credentials.rb +49 -0
  118. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/paths.rb +63 -0
  119. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest/client.rb +584 -0
  120. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest/service_stub.rb +246 -0
  121. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest.rb +54 -0
  122. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service.rb +57 -0
  123. data/lib/google/shopping/merchant/accounts/v1beta/termsofservice_pb.rb +54 -0
  124. data/lib/google/shopping/merchant/accounts/v1beta/termsofservice_services_pb.rb +52 -0
  125. data/lib/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate_pb.rb +56 -0
  126. data/lib/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate_services_pb.rb +49 -0
  127. data/lib/google/shopping/merchant/accounts/v1beta/termsofservicekind_pb.rb +44 -0
  128. data/lib/google/shopping/merchant/accounts/v1beta/user_pb.rb +60 -0
  129. data/lib/google/shopping/merchant/accounts/v1beta/user_service/client.rb +838 -0
  130. data/lib/google/shopping/merchant/accounts/v1beta/user_service/credentials.rb +49 -0
  131. data/lib/google/shopping/merchant/accounts/v1beta/user_service/paths.rb +66 -0
  132. data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest/client.rb +777 -0
  133. data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest/service_stub.rb +368 -0
  134. data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest.rb +54 -0
  135. data/lib/google/shopping/merchant/accounts/v1beta/user_service.rb +57 -0
  136. data/lib/google/shopping/merchant/accounts/v1beta/user_services_pb.rb +58 -0
  137. data/lib/google/shopping/merchant/accounts/v1beta/version.rb +7 -2
  138. data/lib/google/shopping/merchant/accounts/v1beta.rb +60 -0
  139. data/lib/google-shopping-merchant-accounts-v1beta.rb +21 -0
  140. data/proto_docs/README.md +4 -0
  141. data/proto_docs/google/api/client.rb +420 -0
  142. data/proto_docs/google/api/field_behavior.rb +85 -0
  143. data/proto_docs/google/api/launch_stage.rb +71 -0
  144. data/proto_docs/google/api/resource.rb +227 -0
  145. data/proto_docs/google/protobuf/duration.rb +98 -0
  146. data/proto_docs/google/protobuf/empty.rb +34 -0
  147. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  148. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  149. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  150. data/proto_docs/google/shopping/merchant/accounts/v1beta/accessright.rb +43 -0
  151. data/proto_docs/google/shopping/merchant/accounts/v1beta/account_tax.rb +101 -0
  152. data/proto_docs/google/shopping/merchant/accounts/v1beta/accountissue.rb +142 -0
  153. data/proto_docs/google/shopping/merchant/accounts/v1beta/accounts.rb +219 -0
  154. data/proto_docs/google/shopping/merchant/accounts/v1beta/businessidentity.rb +129 -0
  155. data/proto_docs/google/shopping/merchant/accounts/v1beta/businessinfo.rb +72 -0
  156. data/proto_docs/google/shopping/merchant/accounts/v1beta/customerservice.rb +43 -0
  157. data/proto_docs/google/shopping/merchant/accounts/v1beta/emailpreferences.rb +82 -0
  158. data/proto_docs/google/shopping/merchant/accounts/v1beta/homepage.rb +87 -0
  159. data/proto_docs/google/shopping/merchant/accounts/v1beta/online_return_policy.rb +238 -0
  160. data/proto_docs/google/shopping/merchant/accounts/v1beta/phoneverificationstate.rb +40 -0
  161. data/proto_docs/google/shopping/merchant/accounts/v1beta/programs.rb +160 -0
  162. data/proto_docs/google/shopping/merchant/accounts/v1beta/regions.rb +195 -0
  163. data/proto_docs/google/shopping/merchant/accounts/v1beta/shippingsettings.rb +743 -0
  164. data/proto_docs/google/shopping/merchant/accounts/v1beta/tax_rule.rb +88 -0
  165. data/proto_docs/google/shopping/merchant/accounts/v1beta/termsofservice.rb +99 -0
  166. data/proto_docs/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.rb +132 -0
  167. data/proto_docs/google/shopping/merchant/accounts/v1beta/termsofservicekind.rb +37 -0
  168. data/proto_docs/google/shopping/merchant/accounts/v1beta/user.rb +156 -0
  169. data/proto_docs/google/shopping/type/types.rb +210 -0
  170. data/proto_docs/google/type/date.rb +53 -0
  171. data/proto_docs/google/type/datetime.rb +99 -0
  172. data/proto_docs/google/type/interval.rb +45 -0
  173. data/proto_docs/google/type/phone_number.rb +112 -0
  174. data/proto_docs/google/type/postal_address.rb +135 -0
  175. metadata +234 -10
@@ -0,0 +1,942 @@
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/accounts_pb"
21
+
22
+ module Google
23
+ module Shopping
24
+ module Merchant
25
+ module Accounts
26
+ module V1beta
27
+ module AccountsService
28
+ ##
29
+ # Client for the AccountsService service.
30
+ #
31
+ # Service to support Accounts API.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :accounts_service_stub
44
+
45
+ ##
46
+ # Configure the AccountsService Client class.
47
+ #
48
+ # See {::Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all AccountsService clients
54
+ # ::Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Shopping", "Merchant", "Accounts", "V1beta"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.timeout = 60.0
75
+ default_config.retry_policy = {
76
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config
80
+ end
81
+ yield @configure if block_given?
82
+ @configure
83
+ end
84
+
85
+ ##
86
+ # Configure the AccountsService Client instance.
87
+ #
88
+ # The configuration is set to the derived mode, meaning that values can be changed,
89
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
90
+ # should be made on {Client.configure}.
91
+ #
92
+ # See {::Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client::Configuration}
93
+ # for a description of the configuration fields.
94
+ #
95
+ # @yield [config] Configure the Client client.
96
+ # @yieldparam config [Client::Configuration]
97
+ #
98
+ # @return [Client::Configuration]
99
+ #
100
+ def configure
101
+ yield @config if block_given?
102
+ @config
103
+ end
104
+
105
+ ##
106
+ # The effective universe domain
107
+ #
108
+ # @return [String]
109
+ #
110
+ def universe_domain
111
+ @accounts_service_stub.universe_domain
112
+ end
113
+
114
+ ##
115
+ # Create a new AccountsService client object.
116
+ #
117
+ # @example
118
+ #
119
+ # # Create a client using the default configuration
120
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client.new do |config|
124
+ # config.timeout = 10.0
125
+ # end
126
+ #
127
+ # @yield [config] Configure the AccountsService client.
128
+ # @yieldparam config [Client::Configuration]
129
+ #
130
+ def initialize
131
+ # These require statements are intentionally placed here to initialize
132
+ # the gRPC module only when it's required.
133
+ # See https://github.com/googleapis/toolkit/issues/446
134
+ require "gapic/grpc"
135
+ require "google/shopping/merchant/accounts/v1beta/accounts_services_pb"
136
+
137
+ # Create the configuration object
138
+ @config = Configuration.new Client.configure
139
+
140
+ # Yield the configuration if needed
141
+ yield @config if block_given?
142
+
143
+ # Create credentials
144
+ credentials = @config.credentials
145
+ # Use self-signed JWT if the endpoint is unchanged from default,
146
+ # but only if the default endpoint does not have a region prefix.
147
+ enable_self_signed_jwt = @config.endpoint.nil? ||
148
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
+ !@config.endpoint.split(".").first.include?("-"))
150
+ credentials ||= Credentials.default scope: @config.scope,
151
+ enable_self_signed_jwt: enable_self_signed_jwt
152
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
153
+ credentials = Credentials.new credentials, scope: @config.scope
154
+ end
155
+ @quota_project_id = @config.quota_project
156
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
+
158
+ @accounts_service_stub = ::Gapic::ServiceStub.new(
159
+ ::Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Stub,
160
+ credentials: credentials,
161
+ endpoint: @config.endpoint,
162
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
163
+ universe_domain: @config.universe_domain,
164
+ channel_args: @config.channel_args,
165
+ interceptors: @config.interceptors,
166
+ channel_pool_config: @config.channel_pool
167
+ )
168
+ end
169
+
170
+ # Service calls
171
+
172
+ ##
173
+ # Retrieves an account from your Merchant Center account.
174
+ # After inserting, updating, or deleting an account, it may take several
175
+ # minutes before changes take effect.
176
+ #
177
+ # @overload get_account(request, options = nil)
178
+ # Pass arguments to `get_account` via a request object, either of type
179
+ # {::Google::Shopping::Merchant::Accounts::V1beta::GetAccountRequest} or an equivalent Hash.
180
+ #
181
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::GetAccountRequest, ::Hash]
182
+ # A request object representing the call parameters. Required. To specify no
183
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
184
+ # @param options [::Gapic::CallOptions, ::Hash]
185
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
186
+ #
187
+ # @overload get_account(name: nil)
188
+ # Pass arguments to `get_account` via keyword arguments. Note that at
189
+ # least one keyword argument is required. To specify no parameters, or to keep all
190
+ # the default parameter values, pass an empty Hash as a request object (see above).
191
+ #
192
+ # @param name [::String]
193
+ # Required. The name of the account to retrieve.
194
+ # Format: `accounts/{account}`
195
+ #
196
+ # @yield [response, operation] Access the result along with the RPC operation
197
+ # @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::Account]
198
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
199
+ #
200
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::Account]
201
+ #
202
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
203
+ #
204
+ # @example Basic example
205
+ # require "google/shopping/merchant/accounts/v1beta"
206
+ #
207
+ # # Create a client object. The client can be reused for multiple calls.
208
+ # client = Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client.new
209
+ #
210
+ # # Create a request. To set request fields, pass in keyword arguments.
211
+ # request = Google::Shopping::Merchant::Accounts::V1beta::GetAccountRequest.new
212
+ #
213
+ # # Call the get_account method.
214
+ # result = client.get_account request
215
+ #
216
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::Account.
217
+ # p result
218
+ #
219
+ def get_account request, options = nil
220
+ raise ::ArgumentError, "request must be provided" if request.nil?
221
+
222
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::GetAccountRequest
223
+
224
+ # Converts hash and nil to an options object
225
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
226
+
227
+ # Customize the options with defaults
228
+ metadata = @config.rpcs.get_account.metadata.to_h
229
+
230
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
231
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
232
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
233
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
234
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
235
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
236
+
237
+ header_params = {}
238
+ if request.name
239
+ header_params["name"] = request.name
240
+ end
241
+
242
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
243
+ metadata[:"x-goog-request-params"] ||= request_params_header
244
+
245
+ options.apply_defaults timeout: @config.rpcs.get_account.timeout,
246
+ metadata: metadata,
247
+ retry_policy: @config.rpcs.get_account.retry_policy
248
+
249
+ options.apply_defaults timeout: @config.timeout,
250
+ metadata: @config.metadata,
251
+ retry_policy: @config.retry_policy
252
+
253
+ @accounts_service_stub.call_rpc :get_account, request, options: options do |response, operation|
254
+ yield response, operation if block_given?
255
+ return response
256
+ end
257
+ rescue ::GRPC::BadStatus => e
258
+ raise ::Google::Cloud::Error.from_error(e)
259
+ end
260
+
261
+ ##
262
+ # Creates a standalone Merchant Center account with additional configuration.
263
+ # Adds the user that makes the request as an admin for the new account.
264
+ #
265
+ # @overload create_and_configure_account(request, options = nil)
266
+ # Pass arguments to `create_and_configure_account` via a request object, either of type
267
+ # {::Google::Shopping::Merchant::Accounts::V1beta::CreateAndConfigureAccountRequest} or an equivalent Hash.
268
+ #
269
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::CreateAndConfigureAccountRequest, ::Hash]
270
+ # A request object representing the call parameters. Required. To specify no
271
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
272
+ # @param options [::Gapic::CallOptions, ::Hash]
273
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
274
+ #
275
+ # @overload create_and_configure_account(account: nil, users: nil, accept_terms_of_service: nil, service: nil)
276
+ # Pass arguments to `create_and_configure_account` via keyword arguments. Note that at
277
+ # least one keyword argument is required. To specify no parameters, or to keep all
278
+ # the default parameter values, pass an empty Hash as a request object (see above).
279
+ #
280
+ # @param account [::Google::Shopping::Merchant::Accounts::V1beta::Account, ::Hash]
281
+ # Required. The account to be created.
282
+ # @param users [::Array<::Google::Shopping::Merchant::Accounts::V1beta::CreateUserRequest, ::Hash>]
283
+ # Optional. Users to be added to the account.
284
+ # @param accept_terms_of_service [::Google::Shopping::Merchant::Accounts::V1beta::CreateAndConfigureAccountRequest::AcceptTermsOfService, ::Hash]
285
+ # Optional. The Terms of Service (ToS) to be accepted immediately upon
286
+ # account creation.
287
+ # @param service [::Array<::Google::Shopping::Merchant::Accounts::V1beta::CreateAndConfigureAccountRequest::AddAccountService, ::Hash>]
288
+ # Optional. If specified, an account service between the account to be
289
+ # created and the provider account is initialized as part of the
290
+ # creation.
291
+ #
292
+ # @yield [response, operation] Access the result along with the RPC operation
293
+ # @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::Account]
294
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
295
+ #
296
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::Account]
297
+ #
298
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
299
+ #
300
+ # @example Basic example
301
+ # require "google/shopping/merchant/accounts/v1beta"
302
+ #
303
+ # # Create a client object. The client can be reused for multiple calls.
304
+ # client = Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client.new
305
+ #
306
+ # # Create a request. To set request fields, pass in keyword arguments.
307
+ # request = Google::Shopping::Merchant::Accounts::V1beta::CreateAndConfigureAccountRequest.new
308
+ #
309
+ # # Call the create_and_configure_account method.
310
+ # result = client.create_and_configure_account request
311
+ #
312
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::Account.
313
+ # p result
314
+ #
315
+ def create_and_configure_account request, options = nil
316
+ raise ::ArgumentError, "request must be provided" if request.nil?
317
+
318
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::CreateAndConfigureAccountRequest
319
+
320
+ # Converts hash and nil to an options object
321
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
322
+
323
+ # Customize the options with defaults
324
+ metadata = @config.rpcs.create_and_configure_account.metadata.to_h
325
+
326
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
327
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
328
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
329
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
330
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
331
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
332
+
333
+ options.apply_defaults timeout: @config.rpcs.create_and_configure_account.timeout,
334
+ metadata: metadata,
335
+ retry_policy: @config.rpcs.create_and_configure_account.retry_policy
336
+
337
+ options.apply_defaults timeout: @config.timeout,
338
+ metadata: @config.metadata,
339
+ retry_policy: @config.retry_policy
340
+
341
+ @accounts_service_stub.call_rpc :create_and_configure_account, request, options: options do |response, operation|
342
+ yield response, operation if block_given?
343
+ return response
344
+ end
345
+ rescue ::GRPC::BadStatus => e
346
+ raise ::Google::Cloud::Error.from_error(e)
347
+ end
348
+
349
+ ##
350
+ # Deletes the specified account regardless of its type: standalone, MCA or
351
+ # sub-account. Deleting an MCA leads to the deletion of all of its
352
+ # sub-accounts. Executing this method requires admin access.
353
+ #
354
+ # @overload delete_account(request, options = nil)
355
+ # Pass arguments to `delete_account` via a request object, either of type
356
+ # {::Google::Shopping::Merchant::Accounts::V1beta::DeleteAccountRequest} or an equivalent Hash.
357
+ #
358
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::DeleteAccountRequest, ::Hash]
359
+ # A request object representing the call parameters. Required. To specify no
360
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
361
+ # @param options [::Gapic::CallOptions, ::Hash]
362
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
363
+ #
364
+ # @overload delete_account(name: nil)
365
+ # Pass arguments to `delete_account` via keyword arguments. Note that at
366
+ # least one keyword argument is required. To specify no parameters, or to keep all
367
+ # the default parameter values, pass an empty Hash as a request object (see above).
368
+ #
369
+ # @param name [::String]
370
+ # Required. The name of the account to delete.
371
+ # Format: `accounts/{account}`
372
+ #
373
+ # @yield [response, operation] Access the result along with the RPC operation
374
+ # @yieldparam response [::Google::Protobuf::Empty]
375
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
376
+ #
377
+ # @return [::Google::Protobuf::Empty]
378
+ #
379
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
380
+ #
381
+ # @example Basic example
382
+ # require "google/shopping/merchant/accounts/v1beta"
383
+ #
384
+ # # Create a client object. The client can be reused for multiple calls.
385
+ # client = Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client.new
386
+ #
387
+ # # Create a request. To set request fields, pass in keyword arguments.
388
+ # request = Google::Shopping::Merchant::Accounts::V1beta::DeleteAccountRequest.new
389
+ #
390
+ # # Call the delete_account method.
391
+ # result = client.delete_account request
392
+ #
393
+ # # The returned object is of type Google::Protobuf::Empty.
394
+ # p result
395
+ #
396
+ def delete_account request, options = nil
397
+ raise ::ArgumentError, "request must be provided" if request.nil?
398
+
399
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::DeleteAccountRequest
400
+
401
+ # Converts hash and nil to an options object
402
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
403
+
404
+ # Customize the options with defaults
405
+ metadata = @config.rpcs.delete_account.metadata.to_h
406
+
407
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
408
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
409
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
410
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
411
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
412
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
413
+
414
+ header_params = {}
415
+ if request.name
416
+ header_params["name"] = request.name
417
+ end
418
+
419
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
420
+ metadata[:"x-goog-request-params"] ||= request_params_header
421
+
422
+ options.apply_defaults timeout: @config.rpcs.delete_account.timeout,
423
+ metadata: metadata,
424
+ retry_policy: @config.rpcs.delete_account.retry_policy
425
+
426
+ options.apply_defaults timeout: @config.timeout,
427
+ metadata: @config.metadata,
428
+ retry_policy: @config.retry_policy
429
+
430
+ @accounts_service_stub.call_rpc :delete_account, request, options: options do |response, operation|
431
+ yield response, operation if block_given?
432
+ return response
433
+ end
434
+ rescue ::GRPC::BadStatus => e
435
+ raise ::Google::Cloud::Error.from_error(e)
436
+ end
437
+
438
+ ##
439
+ # Updates an account regardless of its type: standalone, MCA or sub-account.
440
+ # Executing this method requires admin access.
441
+ #
442
+ # @overload update_account(request, options = nil)
443
+ # Pass arguments to `update_account` via a request object, either of type
444
+ # {::Google::Shopping::Merchant::Accounts::V1beta::UpdateAccountRequest} or an equivalent Hash.
445
+ #
446
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::UpdateAccountRequest, ::Hash]
447
+ # A request object representing the call parameters. Required. To specify no
448
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
449
+ # @param options [::Gapic::CallOptions, ::Hash]
450
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
451
+ #
452
+ # @overload update_account(account: nil, update_mask: nil)
453
+ # Pass arguments to `update_account` via keyword arguments. Note that at
454
+ # least one keyword argument is required. To specify no parameters, or to keep all
455
+ # the default parameter values, pass an empty Hash as a request object (see above).
456
+ #
457
+ # @param account [::Google::Shopping::Merchant::Accounts::V1beta::Account, ::Hash]
458
+ # Required. The new version of the account.
459
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
460
+ # Required. List of fields being updated.
461
+ #
462
+ # @yield [response, operation] Access the result along with the RPC operation
463
+ # @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::Account]
464
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
465
+ #
466
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::Account]
467
+ #
468
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
469
+ #
470
+ # @example Basic example
471
+ # require "google/shopping/merchant/accounts/v1beta"
472
+ #
473
+ # # Create a client object. The client can be reused for multiple calls.
474
+ # client = Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client.new
475
+ #
476
+ # # Create a request. To set request fields, pass in keyword arguments.
477
+ # request = Google::Shopping::Merchant::Accounts::V1beta::UpdateAccountRequest.new
478
+ #
479
+ # # Call the update_account method.
480
+ # result = client.update_account request
481
+ #
482
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::Account.
483
+ # p result
484
+ #
485
+ def update_account request, options = nil
486
+ raise ::ArgumentError, "request must be provided" if request.nil?
487
+
488
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::UpdateAccountRequest
489
+
490
+ # Converts hash and nil to an options object
491
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
492
+
493
+ # Customize the options with defaults
494
+ metadata = @config.rpcs.update_account.metadata.to_h
495
+
496
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
497
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
498
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
499
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
500
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
501
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
502
+
503
+ header_params = {}
504
+ if request.account&.name
505
+ header_params["account.name"] = request.account.name
506
+ end
507
+
508
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
509
+ metadata[:"x-goog-request-params"] ||= request_params_header
510
+
511
+ options.apply_defaults timeout: @config.rpcs.update_account.timeout,
512
+ metadata: metadata,
513
+ retry_policy: @config.rpcs.update_account.retry_policy
514
+
515
+ options.apply_defaults timeout: @config.timeout,
516
+ metadata: @config.metadata,
517
+ retry_policy: @config.retry_policy
518
+
519
+ @accounts_service_stub.call_rpc :update_account, request, options: options do |response, operation|
520
+ yield response, operation if block_given?
521
+ return response
522
+ end
523
+ rescue ::GRPC::BadStatus => e
524
+ raise ::Google::Cloud::Error.from_error(e)
525
+ end
526
+
527
+ ##
528
+ # Lists accounts accessible to the calling user and matching the
529
+ # constraints of the request such as page size or filters.
530
+ # This is not just listing the sub-accounts of an MCA, but all accounts the
531
+ # calling user has access to including other MCAs, linked accounts,
532
+ # standalone accounts and so on.
533
+ #
534
+ # @overload list_accounts(request, options = nil)
535
+ # Pass arguments to `list_accounts` via a request object, either of type
536
+ # {::Google::Shopping::Merchant::Accounts::V1beta::ListAccountsRequest} or an equivalent Hash.
537
+ #
538
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::ListAccountsRequest, ::Hash]
539
+ # A request object representing the call parameters. Required. To specify no
540
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
541
+ # @param options [::Gapic::CallOptions, ::Hash]
542
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
543
+ #
544
+ # @overload list_accounts(page_size: nil, page_token: nil, filter: nil)
545
+ # Pass arguments to `list_accounts` via keyword arguments. Note that at
546
+ # least one keyword argument is required. To specify no parameters, or to keep all
547
+ # the default parameter values, pass an empty Hash as a request object (see above).
548
+ #
549
+ # @param page_size [::Integer]
550
+ # Optional. The maximum number of accounts to return. The service may return
551
+ # fewer than this value. If unspecified, at most 250 accounts are returned.
552
+ # The maximum value is 500; values above 500 are coerced to 500.
553
+ # @param page_token [::String]
554
+ # Optional. A page token, received from a previous `ListAccounts` call.
555
+ # Provide this to retrieve the subsequent page.
556
+ #
557
+ # When paginating, all other parameters provided to `ListAccounts` must match
558
+ # the call that provided the page token.
559
+ # @param filter [::String]
560
+ # Optional. Returns only accounts that match the
561
+ # [filter](/merchant/api/guides/accounts/filter).
562
+ # For more details, see the
563
+ # [filter syntax reference](/merchant/api/guides/accounts/filter-syntax).
564
+ #
565
+ # @yield [response, operation] Access the result along with the RPC operation
566
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::Account>]
567
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
568
+ #
569
+ # @return [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::Account>]
570
+ #
571
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
572
+ #
573
+ # @example Basic example
574
+ # require "google/shopping/merchant/accounts/v1beta"
575
+ #
576
+ # # Create a client object. The client can be reused for multiple calls.
577
+ # client = Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client.new
578
+ #
579
+ # # Create a request. To set request fields, pass in keyword arguments.
580
+ # request = Google::Shopping::Merchant::Accounts::V1beta::ListAccountsRequest.new
581
+ #
582
+ # # Call the list_accounts method.
583
+ # result = client.list_accounts request
584
+ #
585
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
586
+ # # over elements, and API calls will be issued to fetch pages as needed.
587
+ # result.each do |item|
588
+ # # Each element is of type ::Google::Shopping::Merchant::Accounts::V1beta::Account.
589
+ # p item
590
+ # end
591
+ #
592
+ def list_accounts request, options = nil
593
+ raise ::ArgumentError, "request must be provided" if request.nil?
594
+
595
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::ListAccountsRequest
596
+
597
+ # Converts hash and nil to an options object
598
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
599
+
600
+ # Customize the options with defaults
601
+ metadata = @config.rpcs.list_accounts.metadata.to_h
602
+
603
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
604
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
605
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
606
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
607
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
608
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
609
+
610
+ options.apply_defaults timeout: @config.rpcs.list_accounts.timeout,
611
+ metadata: metadata,
612
+ retry_policy: @config.rpcs.list_accounts.retry_policy
613
+
614
+ options.apply_defaults timeout: @config.timeout,
615
+ metadata: @config.metadata,
616
+ retry_policy: @config.retry_policy
617
+
618
+ @accounts_service_stub.call_rpc :list_accounts, request, options: options do |response, operation|
619
+ response = ::Gapic::PagedEnumerable.new @accounts_service_stub, :list_accounts, request, response, operation, options
620
+ yield response, operation if block_given?
621
+ return response
622
+ end
623
+ rescue ::GRPC::BadStatus => e
624
+ raise ::Google::Cloud::Error.from_error(e)
625
+ end
626
+
627
+ ##
628
+ # List all sub-accounts for a given multi client account. This is a
629
+ # convenience wrapper for the more powerful `ListAccounts` method. This
630
+ # method will produce the same results as calling `ListsAccounts` with the
631
+ # following filter:
632
+ # `relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))`
633
+ #
634
+ # @overload list_sub_accounts(request, options = nil)
635
+ # Pass arguments to `list_sub_accounts` via a request object, either of type
636
+ # {::Google::Shopping::Merchant::Accounts::V1beta::ListSubAccountsRequest} or an equivalent Hash.
637
+ #
638
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::ListSubAccountsRequest, ::Hash]
639
+ # A request object representing the call parameters. Required. To specify no
640
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
641
+ # @param options [::Gapic::CallOptions, ::Hash]
642
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
643
+ #
644
+ # @overload list_sub_accounts(provider: nil, page_size: nil, page_token: nil)
645
+ # Pass arguments to `list_sub_accounts` via keyword arguments. Note that at
646
+ # least one keyword argument is required. To specify no parameters, or to keep all
647
+ # the default parameter values, pass an empty Hash as a request object (see above).
648
+ #
649
+ # @param provider [::String]
650
+ # Required. The parent account.
651
+ # Format: `accounts/{account}`
652
+ # @param page_size [::Integer]
653
+ # Optional. The maximum number of accounts to return. The service may return
654
+ # fewer than this value. If unspecified, at most 250 accounts are returned.
655
+ # The maximum value is 500; values above 500 are coerced to 500.
656
+ # @param page_token [::String]
657
+ # Optional. A page token, received from a previous `ListAccounts` call.
658
+ # Provide this to retrieve the subsequent page.
659
+ #
660
+ # When paginating, all other parameters provided to `ListAccounts` must match
661
+ # the call that provided the page token.
662
+ #
663
+ # @yield [response, operation] Access the result along with the RPC operation
664
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::Account>]
665
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
666
+ #
667
+ # @return [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::Account>]
668
+ #
669
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
670
+ #
671
+ # @example Basic example
672
+ # require "google/shopping/merchant/accounts/v1beta"
673
+ #
674
+ # # Create a client object. The client can be reused for multiple calls.
675
+ # client = Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client.new
676
+ #
677
+ # # Create a request. To set request fields, pass in keyword arguments.
678
+ # request = Google::Shopping::Merchant::Accounts::V1beta::ListSubAccountsRequest.new
679
+ #
680
+ # # Call the list_sub_accounts method.
681
+ # result = client.list_sub_accounts request
682
+ #
683
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
684
+ # # over elements, and API calls will be issued to fetch pages as needed.
685
+ # result.each do |item|
686
+ # # Each element is of type ::Google::Shopping::Merchant::Accounts::V1beta::Account.
687
+ # p item
688
+ # end
689
+ #
690
+ def list_sub_accounts request, options = nil
691
+ raise ::ArgumentError, "request must be provided" if request.nil?
692
+
693
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::ListSubAccountsRequest
694
+
695
+ # Converts hash and nil to an options object
696
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
697
+
698
+ # Customize the options with defaults
699
+ metadata = @config.rpcs.list_sub_accounts.metadata.to_h
700
+
701
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
702
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
703
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
704
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
705
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
706
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
707
+
708
+ header_params = {}
709
+ if request.provider
710
+ header_params["provider"] = request.provider
711
+ end
712
+
713
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
714
+ metadata[:"x-goog-request-params"] ||= request_params_header
715
+
716
+ options.apply_defaults timeout: @config.rpcs.list_sub_accounts.timeout,
717
+ metadata: metadata,
718
+ retry_policy: @config.rpcs.list_sub_accounts.retry_policy
719
+
720
+ options.apply_defaults timeout: @config.timeout,
721
+ metadata: @config.metadata,
722
+ retry_policy: @config.retry_policy
723
+
724
+ @accounts_service_stub.call_rpc :list_sub_accounts, request, options: options do |response, operation|
725
+ response = ::Gapic::PagedEnumerable.new @accounts_service_stub, :list_sub_accounts, request, response, operation, options
726
+ yield response, operation if block_given?
727
+ return response
728
+ end
729
+ rescue ::GRPC::BadStatus => e
730
+ raise ::Google::Cloud::Error.from_error(e)
731
+ end
732
+
733
+ ##
734
+ # Configuration class for the AccountsService API.
735
+ #
736
+ # This class represents the configuration for AccountsService,
737
+ # providing control over timeouts, retry behavior, logging, transport
738
+ # parameters, and other low-level controls. Certain parameters can also be
739
+ # applied individually to specific RPCs. See
740
+ # {::Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client::Configuration::Rpcs}
741
+ # for a list of RPCs that can be configured independently.
742
+ #
743
+ # Configuration can be applied globally to all clients, or to a single client
744
+ # on construction.
745
+ #
746
+ # @example
747
+ #
748
+ # # Modify the global config, setting the timeout for
749
+ # # get_account to 20 seconds,
750
+ # # and all remaining timeouts to 10 seconds.
751
+ # ::Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client.configure do |config|
752
+ # config.timeout = 10.0
753
+ # config.rpcs.get_account.timeout = 20.0
754
+ # end
755
+ #
756
+ # # Apply the above configuration only to a new client.
757
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::AccountsService::Client.new do |config|
758
+ # config.timeout = 10.0
759
+ # config.rpcs.get_account.timeout = 20.0
760
+ # end
761
+ #
762
+ # @!attribute [rw] endpoint
763
+ # A custom service endpoint, as a hostname or hostname:port. The default is
764
+ # nil, indicating to use the default endpoint in the current universe domain.
765
+ # @return [::String,nil]
766
+ # @!attribute [rw] credentials
767
+ # Credentials to send with calls. You may provide any of the following types:
768
+ # * (`String`) The path to a service account key file in JSON format
769
+ # * (`Hash`) A service account key as a Hash
770
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
771
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
772
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
773
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
774
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
775
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
776
+ # * (`nil`) indicating no credentials
777
+ # @return [::Object]
778
+ # @!attribute [rw] scope
779
+ # The OAuth scopes
780
+ # @return [::Array<::String>]
781
+ # @!attribute [rw] lib_name
782
+ # The library name as recorded in instrumentation and logging
783
+ # @return [::String]
784
+ # @!attribute [rw] lib_version
785
+ # The library version as recorded in instrumentation and logging
786
+ # @return [::String]
787
+ # @!attribute [rw] channel_args
788
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
789
+ # `GRPC::Core::Channel` object is provided as the credential.
790
+ # @return [::Hash]
791
+ # @!attribute [rw] interceptors
792
+ # An array of interceptors that are run before calls are executed.
793
+ # @return [::Array<::GRPC::ClientInterceptor>]
794
+ # @!attribute [rw] timeout
795
+ # The call timeout in seconds.
796
+ # @return [::Numeric]
797
+ # @!attribute [rw] metadata
798
+ # Additional gRPC headers to be sent with the call.
799
+ # @return [::Hash{::Symbol=>::String}]
800
+ # @!attribute [rw] retry_policy
801
+ # The retry policy. The value is a hash with the following keys:
802
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
803
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
804
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
805
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
806
+ # trigger a retry.
807
+ # @return [::Hash]
808
+ # @!attribute [rw] quota_project
809
+ # A separate project against which to charge quota.
810
+ # @return [::String]
811
+ # @!attribute [rw] universe_domain
812
+ # The universe domain within which to make requests. This determines the
813
+ # default endpoint URL. The default value of nil uses the environment
814
+ # universe (usually the default "googleapis.com" universe).
815
+ # @return [::String,nil]
816
+ #
817
+ class Configuration
818
+ extend ::Gapic::Config
819
+
820
+ # @private
821
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
822
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
823
+
824
+ config_attr :endpoint, nil, ::String, nil
825
+ config_attr :credentials, nil do |value|
826
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
827
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
828
+ allowed.any? { |klass| klass === value }
829
+ end
830
+ config_attr :scope, nil, ::String, ::Array, nil
831
+ config_attr :lib_name, nil, ::String, nil
832
+ config_attr :lib_version, nil, ::String, nil
833
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
834
+ config_attr :interceptors, nil, ::Array, nil
835
+ config_attr :timeout, nil, ::Numeric, nil
836
+ config_attr :metadata, nil, ::Hash, nil
837
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
838
+ config_attr :quota_project, nil, ::String, nil
839
+ config_attr :universe_domain, nil, ::String, nil
840
+
841
+ # @private
842
+ def initialize parent_config = nil
843
+ @parent_config = parent_config unless parent_config.nil?
844
+
845
+ yield self if block_given?
846
+ end
847
+
848
+ ##
849
+ # Configurations for individual RPCs
850
+ # @return [Rpcs]
851
+ #
852
+ def rpcs
853
+ @rpcs ||= begin
854
+ parent_rpcs = nil
855
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
856
+ Rpcs.new parent_rpcs
857
+ end
858
+ end
859
+
860
+ ##
861
+ # Configuration for the channel pool
862
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
863
+ #
864
+ def channel_pool
865
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
866
+ end
867
+
868
+ ##
869
+ # Configuration RPC class for the AccountsService API.
870
+ #
871
+ # Includes fields providing the configuration for each RPC in this service.
872
+ # Each configuration object is of type `Gapic::Config::Method` and includes
873
+ # the following configuration fields:
874
+ #
875
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
876
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
877
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
878
+ # include the following keys:
879
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
880
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
881
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
882
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
883
+ # trigger a retry.
884
+ #
885
+ class Rpcs
886
+ ##
887
+ # RPC-specific configuration for `get_account`
888
+ # @return [::Gapic::Config::Method]
889
+ #
890
+ attr_reader :get_account
891
+ ##
892
+ # RPC-specific configuration for `create_and_configure_account`
893
+ # @return [::Gapic::Config::Method]
894
+ #
895
+ attr_reader :create_and_configure_account
896
+ ##
897
+ # RPC-specific configuration for `delete_account`
898
+ # @return [::Gapic::Config::Method]
899
+ #
900
+ attr_reader :delete_account
901
+ ##
902
+ # RPC-specific configuration for `update_account`
903
+ # @return [::Gapic::Config::Method]
904
+ #
905
+ attr_reader :update_account
906
+ ##
907
+ # RPC-specific configuration for `list_accounts`
908
+ # @return [::Gapic::Config::Method]
909
+ #
910
+ attr_reader :list_accounts
911
+ ##
912
+ # RPC-specific configuration for `list_sub_accounts`
913
+ # @return [::Gapic::Config::Method]
914
+ #
915
+ attr_reader :list_sub_accounts
916
+
917
+ # @private
918
+ def initialize parent_rpcs = nil
919
+ get_account_config = parent_rpcs.get_account if parent_rpcs.respond_to? :get_account
920
+ @get_account = ::Gapic::Config::Method.new get_account_config
921
+ create_and_configure_account_config = parent_rpcs.create_and_configure_account if parent_rpcs.respond_to? :create_and_configure_account
922
+ @create_and_configure_account = ::Gapic::Config::Method.new create_and_configure_account_config
923
+ delete_account_config = parent_rpcs.delete_account if parent_rpcs.respond_to? :delete_account
924
+ @delete_account = ::Gapic::Config::Method.new delete_account_config
925
+ update_account_config = parent_rpcs.update_account if parent_rpcs.respond_to? :update_account
926
+ @update_account = ::Gapic::Config::Method.new update_account_config
927
+ list_accounts_config = parent_rpcs.list_accounts if parent_rpcs.respond_to? :list_accounts
928
+ @list_accounts = ::Gapic::Config::Method.new list_accounts_config
929
+ list_sub_accounts_config = parent_rpcs.list_sub_accounts if parent_rpcs.respond_to? :list_sub_accounts
930
+ @list_sub_accounts = ::Gapic::Config::Method.new list_sub_accounts_config
931
+
932
+ yield self if block_given?
933
+ end
934
+ end
935
+ end
936
+ end
937
+ end
938
+ end
939
+ end
940
+ end
941
+ end
942
+ end