google-shopping-merchant-accounts-v1beta 0.a → 0.1.0

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