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,551 @@
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/online_return_policy_pb"
21
+
22
+ module Google
23
+ module Shopping
24
+ module Merchant
25
+ module Accounts
26
+ module V1beta
27
+ module OnlineReturnPolicyService
28
+ ##
29
+ # Client for the OnlineReturnPolicyService service.
30
+ #
31
+ # The service facilitates the management of a merchant's remorse return policy
32
+ # configuration, encompassing return policies for both ads and free listings
33
+ # ## programs. This API defines the following resource model:
34
+ #
35
+ # [OnlineReturnPolicy][google.shopping.merchant.accounts.v1.OnlineReturnPolicy]
36
+ #
37
+ class Client
38
+ # @private
39
+ API_VERSION = ""
40
+
41
+ # @private
42
+ DEFAULT_ENDPOINT_TEMPLATE = "merchantapi.$UNIVERSE_DOMAIN$"
43
+
44
+ include Paths
45
+
46
+ # @private
47
+ attr_reader :online_return_policy_service_stub
48
+
49
+ ##
50
+ # Configure the OnlineReturnPolicyService Client class.
51
+ #
52
+ # See {::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicyService::Client::Configuration}
53
+ # for a description of the configuration fields.
54
+ #
55
+ # @example
56
+ #
57
+ # # Modify the configuration for all OnlineReturnPolicyService clients
58
+ # ::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicyService::Client.configure do |config|
59
+ # config.timeout = 10.0
60
+ # end
61
+ #
62
+ # @yield [config] Configure the Client client.
63
+ # @yieldparam config [Client::Configuration]
64
+ #
65
+ # @return [Client::Configuration]
66
+ #
67
+ def self.configure
68
+ @configure ||= begin
69
+ namespace = ["Google", "Shopping", "Merchant", "Accounts", "V1beta"]
70
+ parent_config = while namespace.any?
71
+ parent_name = namespace.join "::"
72
+ parent_const = const_get parent_name
73
+ break parent_const.configure if parent_const.respond_to? :configure
74
+ namespace.pop
75
+ end
76
+ default_config = Client::Configuration.new parent_config
77
+
78
+ default_config.timeout = 60.0
79
+ default_config.retry_policy = {
80
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
81
+ }
82
+
83
+ default_config
84
+ end
85
+ yield @configure if block_given?
86
+ @configure
87
+ end
88
+
89
+ ##
90
+ # Configure the OnlineReturnPolicyService Client instance.
91
+ #
92
+ # The configuration is set to the derived mode, meaning that values can be changed,
93
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
94
+ # should be made on {Client.configure}.
95
+ #
96
+ # See {::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicyService::Client::Configuration}
97
+ # for a description of the configuration fields.
98
+ #
99
+ # @yield [config] Configure the Client client.
100
+ # @yieldparam config [Client::Configuration]
101
+ #
102
+ # @return [Client::Configuration]
103
+ #
104
+ def configure
105
+ yield @config if block_given?
106
+ @config
107
+ end
108
+
109
+ ##
110
+ # The effective universe domain
111
+ #
112
+ # @return [String]
113
+ #
114
+ def universe_domain
115
+ @online_return_policy_service_stub.universe_domain
116
+ end
117
+
118
+ ##
119
+ # Create a new OnlineReturnPolicyService client object.
120
+ #
121
+ # @example
122
+ #
123
+ # # Create a client using the default configuration
124
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicyService::Client.new
125
+ #
126
+ # # Create a client using a custom configuration
127
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicyService::Client.new do |config|
128
+ # config.timeout = 10.0
129
+ # end
130
+ #
131
+ # @yield [config] Configure the OnlineReturnPolicyService client.
132
+ # @yieldparam config [Client::Configuration]
133
+ #
134
+ def initialize
135
+ # These require statements are intentionally placed here to initialize
136
+ # the gRPC module only when it's required.
137
+ # See https://github.com/googleapis/toolkit/issues/446
138
+ require "gapic/grpc"
139
+ require "google/shopping/merchant/accounts/v1beta/online_return_policy_services_pb"
140
+
141
+ # Create the configuration object
142
+ @config = Configuration.new Client.configure
143
+
144
+ # Yield the configuration if needed
145
+ yield @config if block_given?
146
+
147
+ # Create credentials
148
+ credentials = @config.credentials
149
+ # Use self-signed JWT if the endpoint is unchanged from default,
150
+ # but only if the default endpoint does not have a region prefix.
151
+ enable_self_signed_jwt = @config.endpoint.nil? ||
152
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
153
+ !@config.endpoint.split(".").first.include?("-"))
154
+ credentials ||= Credentials.default scope: @config.scope,
155
+ enable_self_signed_jwt: enable_self_signed_jwt
156
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
157
+ credentials = Credentials.new credentials, scope: @config.scope
158
+ end
159
+ @quota_project_id = @config.quota_project
160
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
161
+
162
+ @online_return_policy_service_stub = ::Gapic::ServiceStub.new(
163
+ ::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicyService::Stub,
164
+ credentials: credentials,
165
+ endpoint: @config.endpoint,
166
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
167
+ universe_domain: @config.universe_domain,
168
+ channel_args: @config.channel_args,
169
+ interceptors: @config.interceptors,
170
+ channel_pool_config: @config.channel_pool
171
+ )
172
+ end
173
+
174
+ # Service calls
175
+
176
+ ##
177
+ # Gets an existing return policy.
178
+ #
179
+ # @overload get_online_return_policy(request, options = nil)
180
+ # Pass arguments to `get_online_return_policy` via a request object, either of type
181
+ # {::Google::Shopping::Merchant::Accounts::V1beta::GetOnlineReturnPolicyRequest} or an equivalent Hash.
182
+ #
183
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::GetOnlineReturnPolicyRequest, ::Hash]
184
+ # A request object representing the call parameters. Required. To specify no
185
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
186
+ # @param options [::Gapic::CallOptions, ::Hash]
187
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
188
+ #
189
+ # @overload get_online_return_policy(name: nil)
190
+ # Pass arguments to `get_online_return_policy` via keyword arguments. Note that at
191
+ # least one keyword argument is required. To specify no parameters, or to keep all
192
+ # the default parameter values, pass an empty Hash as a request object (see above).
193
+ #
194
+ # @param name [::String]
195
+ # Required. The name of the return policy to retrieve.
196
+ # Format: `accounts/{account}/onlineReturnPolicies/{return_policy}`
197
+ #
198
+ # @yield [response, operation] Access the result along with the RPC operation
199
+ # @yieldparam response [::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicy]
200
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
201
+ #
202
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicy]
203
+ #
204
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
205
+ #
206
+ # @example Basic example
207
+ # require "google/shopping/merchant/accounts/v1beta"
208
+ #
209
+ # # Create a client object. The client can be reused for multiple calls.
210
+ # client = Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicyService::Client.new
211
+ #
212
+ # # Create a request. To set request fields, pass in keyword arguments.
213
+ # request = Google::Shopping::Merchant::Accounts::V1beta::GetOnlineReturnPolicyRequest.new
214
+ #
215
+ # # Call the get_online_return_policy method.
216
+ # result = client.get_online_return_policy request
217
+ #
218
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicy.
219
+ # p result
220
+ #
221
+ def get_online_return_policy request, options = nil
222
+ raise ::ArgumentError, "request must be provided" if request.nil?
223
+
224
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::GetOnlineReturnPolicyRequest
225
+
226
+ # Converts hash and nil to an options object
227
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
228
+
229
+ # Customize the options with defaults
230
+ metadata = @config.rpcs.get_online_return_policy.metadata.to_h
231
+
232
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
233
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
234
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
235
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
236
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
237
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
238
+
239
+ header_params = {}
240
+ if request.name
241
+ header_params["name"] = request.name
242
+ end
243
+
244
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
245
+ metadata[:"x-goog-request-params"] ||= request_params_header
246
+
247
+ options.apply_defaults timeout: @config.rpcs.get_online_return_policy.timeout,
248
+ metadata: metadata,
249
+ retry_policy: @config.rpcs.get_online_return_policy.retry_policy
250
+
251
+ options.apply_defaults timeout: @config.timeout,
252
+ metadata: @config.metadata,
253
+ retry_policy: @config.retry_policy
254
+
255
+ @online_return_policy_service_stub.call_rpc :get_online_return_policy, request, options: options do |response, operation|
256
+ yield response, operation if block_given?
257
+ return response
258
+ end
259
+ rescue ::GRPC::BadStatus => e
260
+ raise ::Google::Cloud::Error.from_error(e)
261
+ end
262
+
263
+ ##
264
+ # Lists all existing return policies.
265
+ #
266
+ # @overload list_online_return_policies(request, options = nil)
267
+ # Pass arguments to `list_online_return_policies` via a request object, either of type
268
+ # {::Google::Shopping::Merchant::Accounts::V1beta::ListOnlineReturnPoliciesRequest} or an equivalent Hash.
269
+ #
270
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::ListOnlineReturnPoliciesRequest, ::Hash]
271
+ # A request object representing the call parameters. Required. To specify no
272
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
273
+ # @param options [::Gapic::CallOptions, ::Hash]
274
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
275
+ #
276
+ # @overload list_online_return_policies(parent: nil, page_size: nil, page_token: nil)
277
+ # Pass arguments to `list_online_return_policies` via keyword arguments. Note that at
278
+ # least one keyword argument is required. To specify no parameters, or to keep all
279
+ # the default parameter values, pass an empty Hash as a request object (see above).
280
+ #
281
+ # @param parent [::String]
282
+ # Required. The merchant account for which to list return policies.
283
+ # Format: `accounts/{account}`
284
+ # @param page_size [::Integer]
285
+ # Optional. The maximum number of `OnlineReturnPolicy` resources to return.
286
+ # The service returns fewer than this value if the number of return policies
287
+ # for the given merchant is less that than the `pageSize`. The default value
288
+ # is 10. The maximum value is 100; If a value higher than the maximum is
289
+ # specified, then the `pageSize` will default to the maximum
290
+ # @param page_token [::String]
291
+ # Optional. A page token, received from a previous `ListOnlineReturnPolicies`
292
+ # call. Provide the page token to retrieve the subsequent page.
293
+ #
294
+ # When paginating, all other parameters provided to
295
+ # `ListOnlineReturnPolicies` must match the call that provided the page
296
+ # token. The token returned as
297
+ # {::Google::Shopping::Merchant::Accounts::V1beta::ListOnlineReturnPoliciesResponse#next_page_token nextPageToken}
298
+ # in the response to the previous request.
299
+ #
300
+ # @yield [response, operation] Access the result along with the RPC operation
301
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicy>]
302
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
303
+ #
304
+ # @return [::Gapic::PagedEnumerable<::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicy>]
305
+ #
306
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
307
+ #
308
+ # @example Basic example
309
+ # require "google/shopping/merchant/accounts/v1beta"
310
+ #
311
+ # # Create a client object. The client can be reused for multiple calls.
312
+ # client = Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicyService::Client.new
313
+ #
314
+ # # Create a request. To set request fields, pass in keyword arguments.
315
+ # request = Google::Shopping::Merchant::Accounts::V1beta::ListOnlineReturnPoliciesRequest.new
316
+ #
317
+ # # Call the list_online_return_policies method.
318
+ # result = client.list_online_return_policies request
319
+ #
320
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
321
+ # # over elements, and API calls will be issued to fetch pages as needed.
322
+ # result.each do |item|
323
+ # # Each element is of type ::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicy.
324
+ # p item
325
+ # end
326
+ #
327
+ def list_online_return_policies request, options = nil
328
+ raise ::ArgumentError, "request must be provided" if request.nil?
329
+
330
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::ListOnlineReturnPoliciesRequest
331
+
332
+ # Converts hash and nil to an options object
333
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
334
+
335
+ # Customize the options with defaults
336
+ metadata = @config.rpcs.list_online_return_policies.metadata.to_h
337
+
338
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
339
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
340
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
341
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION
342
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
343
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
344
+
345
+ header_params = {}
346
+ if request.parent
347
+ header_params["parent"] = request.parent
348
+ end
349
+
350
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
351
+ metadata[:"x-goog-request-params"] ||= request_params_header
352
+
353
+ options.apply_defaults timeout: @config.rpcs.list_online_return_policies.timeout,
354
+ metadata: metadata,
355
+ retry_policy: @config.rpcs.list_online_return_policies.retry_policy
356
+
357
+ options.apply_defaults timeout: @config.timeout,
358
+ metadata: @config.metadata,
359
+ retry_policy: @config.retry_policy
360
+
361
+ @online_return_policy_service_stub.call_rpc :list_online_return_policies, request, options: options do |response, operation|
362
+ response = ::Gapic::PagedEnumerable.new @online_return_policy_service_stub, :list_online_return_policies, request, response, operation, options
363
+ yield response, operation if block_given?
364
+ return response
365
+ end
366
+ rescue ::GRPC::BadStatus => e
367
+ raise ::Google::Cloud::Error.from_error(e)
368
+ end
369
+
370
+ ##
371
+ # Configuration class for the OnlineReturnPolicyService API.
372
+ #
373
+ # This class represents the configuration for OnlineReturnPolicyService,
374
+ # providing control over timeouts, retry behavior, logging, transport
375
+ # parameters, and other low-level controls. Certain parameters can also be
376
+ # applied individually to specific RPCs. See
377
+ # {::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicyService::Client::Configuration::Rpcs}
378
+ # for a list of RPCs that can be configured independently.
379
+ #
380
+ # Configuration can be applied globally to all clients, or to a single client
381
+ # on construction.
382
+ #
383
+ # @example
384
+ #
385
+ # # Modify the global config, setting the timeout for
386
+ # # get_online_return_policy to 20 seconds,
387
+ # # and all remaining timeouts to 10 seconds.
388
+ # ::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicyService::Client.configure do |config|
389
+ # config.timeout = 10.0
390
+ # config.rpcs.get_online_return_policy.timeout = 20.0
391
+ # end
392
+ #
393
+ # # Apply the above configuration only to a new client.
394
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::OnlineReturnPolicyService::Client.new do |config|
395
+ # config.timeout = 10.0
396
+ # config.rpcs.get_online_return_policy.timeout = 20.0
397
+ # end
398
+ #
399
+ # @!attribute [rw] endpoint
400
+ # A custom service endpoint, as a hostname or hostname:port. The default is
401
+ # nil, indicating to use the default endpoint in the current universe domain.
402
+ # @return [::String,nil]
403
+ # @!attribute [rw] credentials
404
+ # Credentials to send with calls. You may provide any of the following types:
405
+ # * (`String`) The path to a service account key file in JSON format
406
+ # * (`Hash`) A service account key as a Hash
407
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
408
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
409
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
410
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
411
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
412
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
413
+ # * (`nil`) indicating no credentials
414
+ # @return [::Object]
415
+ # @!attribute [rw] scope
416
+ # The OAuth scopes
417
+ # @return [::Array<::String>]
418
+ # @!attribute [rw] lib_name
419
+ # The library name as recorded in instrumentation and logging
420
+ # @return [::String]
421
+ # @!attribute [rw] lib_version
422
+ # The library version as recorded in instrumentation and logging
423
+ # @return [::String]
424
+ # @!attribute [rw] channel_args
425
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
426
+ # `GRPC::Core::Channel` object is provided as the credential.
427
+ # @return [::Hash]
428
+ # @!attribute [rw] interceptors
429
+ # An array of interceptors that are run before calls are executed.
430
+ # @return [::Array<::GRPC::ClientInterceptor>]
431
+ # @!attribute [rw] timeout
432
+ # The call timeout in seconds.
433
+ # @return [::Numeric]
434
+ # @!attribute [rw] metadata
435
+ # Additional gRPC headers to be sent with the call.
436
+ # @return [::Hash{::Symbol=>::String}]
437
+ # @!attribute [rw] retry_policy
438
+ # The retry policy. The value is a hash with the following keys:
439
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
440
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
441
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
442
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
443
+ # trigger a retry.
444
+ # @return [::Hash]
445
+ # @!attribute [rw] quota_project
446
+ # A separate project against which to charge quota.
447
+ # @return [::String]
448
+ # @!attribute [rw] universe_domain
449
+ # The universe domain within which to make requests. This determines the
450
+ # default endpoint URL. The default value of nil uses the environment
451
+ # universe (usually the default "googleapis.com" universe).
452
+ # @return [::String,nil]
453
+ #
454
+ class Configuration
455
+ extend ::Gapic::Config
456
+
457
+ # @private
458
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
459
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
460
+
461
+ config_attr :endpoint, nil, ::String, nil
462
+ config_attr :credentials, nil do |value|
463
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
464
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
465
+ allowed.any? { |klass| klass === value }
466
+ end
467
+ config_attr :scope, nil, ::String, ::Array, nil
468
+ config_attr :lib_name, nil, ::String, nil
469
+ config_attr :lib_version, nil, ::String, nil
470
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
471
+ config_attr :interceptors, nil, ::Array, nil
472
+ config_attr :timeout, nil, ::Numeric, nil
473
+ config_attr :metadata, nil, ::Hash, nil
474
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
475
+ config_attr :quota_project, nil, ::String, nil
476
+ config_attr :universe_domain, nil, ::String, nil
477
+
478
+ # @private
479
+ def initialize parent_config = nil
480
+ @parent_config = parent_config unless parent_config.nil?
481
+
482
+ yield self if block_given?
483
+ end
484
+
485
+ ##
486
+ # Configurations for individual RPCs
487
+ # @return [Rpcs]
488
+ #
489
+ def rpcs
490
+ @rpcs ||= begin
491
+ parent_rpcs = nil
492
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
493
+ Rpcs.new parent_rpcs
494
+ end
495
+ end
496
+
497
+ ##
498
+ # Configuration for the channel pool
499
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
500
+ #
501
+ def channel_pool
502
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
503
+ end
504
+
505
+ ##
506
+ # Configuration RPC class for the OnlineReturnPolicyService API.
507
+ #
508
+ # Includes fields providing the configuration for each RPC in this service.
509
+ # Each configuration object is of type `Gapic::Config::Method` and includes
510
+ # the following configuration fields:
511
+ #
512
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
513
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
514
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
515
+ # include the following keys:
516
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
517
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
518
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
519
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
520
+ # trigger a retry.
521
+ #
522
+ class Rpcs
523
+ ##
524
+ # RPC-specific configuration for `get_online_return_policy`
525
+ # @return [::Gapic::Config::Method]
526
+ #
527
+ attr_reader :get_online_return_policy
528
+ ##
529
+ # RPC-specific configuration for `list_online_return_policies`
530
+ # @return [::Gapic::Config::Method]
531
+ #
532
+ attr_reader :list_online_return_policies
533
+
534
+ # @private
535
+ def initialize parent_rpcs = nil
536
+ get_online_return_policy_config = parent_rpcs.get_online_return_policy if parent_rpcs.respond_to? :get_online_return_policy
537
+ @get_online_return_policy = ::Gapic::Config::Method.new get_online_return_policy_config
538
+ list_online_return_policies_config = parent_rpcs.list_online_return_policies if parent_rpcs.respond_to? :list_online_return_policies
539
+ @list_online_return_policies = ::Gapic::Config::Method.new list_online_return_policies_config
540
+
541
+ yield self if block_given?
542
+ end
543
+ end
544
+ end
545
+ end
546
+ end
547
+ end
548
+ end
549
+ end
550
+ end
551
+ end
@@ -0,0 +1,49 @@
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 "googleauth"
20
+
21
+ module Google
22
+ module Shopping
23
+ module Merchant
24
+ module Accounts
25
+ module V1beta
26
+ module OnlineReturnPolicyService
27
+ # Credentials for the OnlineReturnPolicyService API.
28
+ class Credentials < ::Google::Auth::Credentials
29
+ self.scope = [
30
+ "https://www.googleapis.com/auth/content"
31
+ ]
32
+ self.env_vars = [
33
+ "GOOGLE_CLOUD_CREDENTIALS",
34
+ "GOOGLE_CLOUD_KEYFILE",
35
+ "GCLOUD_KEYFILE",
36
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
37
+ "GOOGLE_CLOUD_KEYFILE_JSON",
38
+ "GCLOUD_KEYFILE_JSON"
39
+ ]
40
+ self.paths = [
41
+ "~/.config/google_cloud/application_default_credentials.json"
42
+ ]
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,66 @@
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
+
20
+ module Google
21
+ module Shopping
22
+ module Merchant
23
+ module Accounts
24
+ module V1beta
25
+ module OnlineReturnPolicyService
26
+ # Path helper methods for the OnlineReturnPolicyService API.
27
+ module Paths
28
+ ##
29
+ # Create a fully-qualified Account resource string.
30
+ #
31
+ # The resource will be in the following format:
32
+ #
33
+ # `accounts/{account}`
34
+ #
35
+ # @param account [String]
36
+ #
37
+ # @return [::String]
38
+ def account_path account:
39
+ "accounts/#{account}"
40
+ end
41
+
42
+ ##
43
+ # Create a fully-qualified OnlineReturnPolicy resource string.
44
+ #
45
+ # The resource will be in the following format:
46
+ #
47
+ # `accounts/{account}/onlineReturnPolicies/{return_policy}`
48
+ #
49
+ # @param account [String]
50
+ # @param return_policy [String]
51
+ #
52
+ # @return [::String]
53
+ def online_return_policy_path account:, return_policy:
54
+ raise ::ArgumentError, "account cannot contain /" if account.to_s.include? "/"
55
+
56
+ "accounts/#{account}/onlineReturnPolicies/#{return_policy}"
57
+ end
58
+
59
+ extend self
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end