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,63 @@
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 TermsOfServiceService
26
+ # Path helper methods for the TermsOfServiceService 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 TermsOfService resource string.
44
+ #
45
+ # The resource will be in the following format:
46
+ #
47
+ # `termsOfService/{version}`
48
+ #
49
+ # @param version [String]
50
+ #
51
+ # @return [::String]
52
+ def terms_of_service_path version:
53
+ "termsOfService/#{version}"
54
+ end
55
+
56
+ extend self
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,584 @@
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/termsofservice_pb"
21
+ require "google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Shopping
25
+ module Merchant
26
+ module Accounts
27
+ module V1beta
28
+ module TermsOfServiceService
29
+ module Rest
30
+ ##
31
+ # REST client for the TermsOfServiceService service.
32
+ #
33
+ # Service to support `TermsOfService` 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 :terms_of_service_service_stub
46
+
47
+ ##
48
+ # Configure the TermsOfServiceService Client class.
49
+ #
50
+ # See {::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceService::Rest::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all TermsOfServiceService clients
56
+ # ::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceService::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 TermsOfServiceService 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::TermsOfServiceService::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
+ @terms_of_service_service_stub.universe_domain
114
+ end
115
+
116
+ ##
117
+ # Create a new TermsOfServiceService REST client object.
118
+ #
119
+ # @example
120
+ #
121
+ # # Create a client using the default configuration
122
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceService::Rest::Client.new
123
+ #
124
+ # # Create a client using a custom configuration
125
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceService::Rest::Client.new do |config|
126
+ # config.timeout = 10.0
127
+ # end
128
+ #
129
+ # @yield [config] Configure the TermsOfServiceService 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
+ @terms_of_service_service_stub = ::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceService::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 the `TermsOfService` associated with the provided version.
167
+ #
168
+ # @overload get_terms_of_service(request, options = nil)
169
+ # Pass arguments to `get_terms_of_service` via a request object, either of type
170
+ # {::Google::Shopping::Merchant::Accounts::V1beta::GetTermsOfServiceRequest} or an equivalent Hash.
171
+ #
172
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::GetTermsOfServiceRequest, ::Hash]
173
+ # A request object representing the call parameters. Required. To specify no
174
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
175
+ # @param options [::Gapic::CallOptions, ::Hash]
176
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
177
+ #
178
+ # @overload get_terms_of_service(name: nil)
179
+ # Pass arguments to `get_terms_of_service` via keyword arguments. Note that at
180
+ # least one keyword argument is required. To specify no parameters, or to keep all
181
+ # the default parameter values, pass an empty Hash as a request object (see above).
182
+ #
183
+ # @param name [::String]
184
+ # Required. The resource name of the terms of service version.
185
+ # Format: `termsOfService/{version}`
186
+ # @yield [result, operation] Access the result along with the TransportOperation object
187
+ # @yieldparam result [::Google::Shopping::Merchant::Accounts::V1beta::TermsOfService]
188
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
189
+ #
190
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::TermsOfService]
191
+ #
192
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
193
+ #
194
+ # @example Basic example
195
+ # require "google/shopping/merchant/accounts/v1beta"
196
+ #
197
+ # # Create a client object. The client can be reused for multiple calls.
198
+ # client = Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceService::Rest::Client.new
199
+ #
200
+ # # Create a request. To set request fields, pass in keyword arguments.
201
+ # request = Google::Shopping::Merchant::Accounts::V1beta::GetTermsOfServiceRequest.new
202
+ #
203
+ # # Call the get_terms_of_service method.
204
+ # result = client.get_terms_of_service request
205
+ #
206
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::TermsOfService.
207
+ # p result
208
+ #
209
+ def get_terms_of_service request, options = nil
210
+ raise ::ArgumentError, "request must be provided" if request.nil?
211
+
212
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::GetTermsOfServiceRequest
213
+
214
+ # Converts hash and nil to an options object
215
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
216
+
217
+ # Customize the options with defaults
218
+ call_metadata = @config.rpcs.get_terms_of_service.metadata.to_h
219
+
220
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
221
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
222
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
223
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION,
224
+ transports_version_send: [:rest]
225
+
226
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
227
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
228
+
229
+ options.apply_defaults timeout: @config.rpcs.get_terms_of_service.timeout,
230
+ metadata: call_metadata,
231
+ retry_policy: @config.rpcs.get_terms_of_service.retry_policy
232
+
233
+ options.apply_defaults timeout: @config.timeout,
234
+ metadata: @config.metadata,
235
+ retry_policy: @config.retry_policy
236
+
237
+ @terms_of_service_service_stub.get_terms_of_service request, options do |result, operation|
238
+ yield result, operation if block_given?
239
+ return result
240
+ end
241
+ rescue ::Gapic::Rest::Error => e
242
+ raise ::Google::Cloud::Error.from_error(e)
243
+ end
244
+
245
+ ##
246
+ # Retrieves the latest version of the `TermsOfService` for a given `kind` and
247
+ # `region_code`.
248
+ #
249
+ # @overload retrieve_latest_terms_of_service(request, options = nil)
250
+ # Pass arguments to `retrieve_latest_terms_of_service` via a request object, either of type
251
+ # {::Google::Shopping::Merchant::Accounts::V1beta::RetrieveLatestTermsOfServiceRequest} or an equivalent Hash.
252
+ #
253
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::RetrieveLatestTermsOfServiceRequest, ::Hash]
254
+ # A request object representing the call parameters. Required. To specify no
255
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
256
+ # @param options [::Gapic::CallOptions, ::Hash]
257
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
258
+ #
259
+ # @overload retrieve_latest_terms_of_service(region_code: nil, kind: nil)
260
+ # Pass arguments to `retrieve_latest_terms_of_service` via keyword arguments. Note that at
261
+ # least one keyword argument is required. To specify no parameters, or to keep all
262
+ # the default parameter values, pass an empty Hash as a request object (see above).
263
+ #
264
+ # @param region_code [::String]
265
+ # Region code as defined by [CLDR](https://cldr.unicode.org/). This is either
266
+ # a country when the ToS applies specifically to that country or 001 when it
267
+ # applies globally.
268
+ # @param kind [::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceKind]
269
+ # The Kind this terms of service version applies to.
270
+ # @yield [result, operation] Access the result along with the TransportOperation object
271
+ # @yieldparam result [::Google::Shopping::Merchant::Accounts::V1beta::TermsOfService]
272
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
273
+ #
274
+ # @return [::Google::Shopping::Merchant::Accounts::V1beta::TermsOfService]
275
+ #
276
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
277
+ #
278
+ # @example Basic example
279
+ # require "google/shopping/merchant/accounts/v1beta"
280
+ #
281
+ # # Create a client object. The client can be reused for multiple calls.
282
+ # client = Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceService::Rest::Client.new
283
+ #
284
+ # # Create a request. To set request fields, pass in keyword arguments.
285
+ # request = Google::Shopping::Merchant::Accounts::V1beta::RetrieveLatestTermsOfServiceRequest.new
286
+ #
287
+ # # Call the retrieve_latest_terms_of_service method.
288
+ # result = client.retrieve_latest_terms_of_service request
289
+ #
290
+ # # The returned object is of type Google::Shopping::Merchant::Accounts::V1beta::TermsOfService.
291
+ # p result
292
+ #
293
+ def retrieve_latest_terms_of_service request, options = nil
294
+ raise ::ArgumentError, "request must be provided" if request.nil?
295
+
296
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::RetrieveLatestTermsOfServiceRequest
297
+
298
+ # Converts hash and nil to an options object
299
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
300
+
301
+ # Customize the options with defaults
302
+ call_metadata = @config.rpcs.retrieve_latest_terms_of_service.metadata.to_h
303
+
304
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
305
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
306
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
307
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION,
308
+ transports_version_send: [:rest]
309
+
310
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
311
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
312
+
313
+ options.apply_defaults timeout: @config.rpcs.retrieve_latest_terms_of_service.timeout,
314
+ metadata: call_metadata,
315
+ retry_policy: @config.rpcs.retrieve_latest_terms_of_service.retry_policy
316
+
317
+ options.apply_defaults timeout: @config.timeout,
318
+ metadata: @config.metadata,
319
+ retry_policy: @config.retry_policy
320
+
321
+ @terms_of_service_service_stub.retrieve_latest_terms_of_service request, options do |result, operation|
322
+ yield result, operation if block_given?
323
+ return result
324
+ end
325
+ rescue ::Gapic::Rest::Error => e
326
+ raise ::Google::Cloud::Error.from_error(e)
327
+ end
328
+
329
+ ##
330
+ # Accepts a `TermsOfService`. Executing this method requires admin access.
331
+ #
332
+ # @overload accept_terms_of_service(request, options = nil)
333
+ # Pass arguments to `accept_terms_of_service` via a request object, either of type
334
+ # {::Google::Shopping::Merchant::Accounts::V1beta::AcceptTermsOfServiceRequest} or an equivalent Hash.
335
+ #
336
+ # @param request [::Google::Shopping::Merchant::Accounts::V1beta::AcceptTermsOfServiceRequest, ::Hash]
337
+ # A request object representing the call parameters. Required. To specify no
338
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
339
+ # @param options [::Gapic::CallOptions, ::Hash]
340
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
341
+ #
342
+ # @overload accept_terms_of_service(name: nil, account: nil, region_code: nil)
343
+ # Pass arguments to `accept_terms_of_service` via keyword arguments. Note that at
344
+ # least one keyword argument is required. To specify no parameters, or to keep all
345
+ # the default parameter values, pass an empty Hash as a request object (see above).
346
+ #
347
+ # @param name [::String]
348
+ # Required. The resource name of the terms of service version.
349
+ # Format: `termsOfService/{version}`
350
+ # @param account [::String]
351
+ # Required. The account for which to accept the ToS.
352
+ # @param region_code [::String]
353
+ # Required. Region code as defined by [CLDR](https://cldr.unicode.org/). This
354
+ # is either a country when the ToS applies specifically to that country or
355
+ # 001 when it applies globally.
356
+ # @yield [result, operation] Access the result along with the TransportOperation object
357
+ # @yieldparam result [::Google::Protobuf::Empty]
358
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
359
+ #
360
+ # @return [::Google::Protobuf::Empty]
361
+ #
362
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
363
+ #
364
+ # @example Basic example
365
+ # require "google/shopping/merchant/accounts/v1beta"
366
+ #
367
+ # # Create a client object. The client can be reused for multiple calls.
368
+ # client = Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceService::Rest::Client.new
369
+ #
370
+ # # Create a request. To set request fields, pass in keyword arguments.
371
+ # request = Google::Shopping::Merchant::Accounts::V1beta::AcceptTermsOfServiceRequest.new
372
+ #
373
+ # # Call the accept_terms_of_service method.
374
+ # result = client.accept_terms_of_service request
375
+ #
376
+ # # The returned object is of type Google::Protobuf::Empty.
377
+ # p result
378
+ #
379
+ def accept_terms_of_service request, options = nil
380
+ raise ::ArgumentError, "request must be provided" if request.nil?
381
+
382
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Shopping::Merchant::Accounts::V1beta::AcceptTermsOfServiceRequest
383
+
384
+ # Converts hash and nil to an options object
385
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
386
+
387
+ # Customize the options with defaults
388
+ call_metadata = @config.rpcs.accept_terms_of_service.metadata.to_h
389
+
390
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
391
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
392
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
393
+ gapic_version: ::Google::Shopping::Merchant::Accounts::V1beta::VERSION,
394
+ transports_version_send: [:rest]
395
+
396
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
397
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
398
+
399
+ options.apply_defaults timeout: @config.rpcs.accept_terms_of_service.timeout,
400
+ metadata: call_metadata,
401
+ retry_policy: @config.rpcs.accept_terms_of_service.retry_policy
402
+
403
+ options.apply_defaults timeout: @config.timeout,
404
+ metadata: @config.metadata,
405
+ retry_policy: @config.retry_policy
406
+
407
+ @terms_of_service_service_stub.accept_terms_of_service request, options do |result, operation|
408
+ yield result, operation if block_given?
409
+ return result
410
+ end
411
+ rescue ::Gapic::Rest::Error => e
412
+ raise ::Google::Cloud::Error.from_error(e)
413
+ end
414
+
415
+ ##
416
+ # Configuration class for the TermsOfServiceService REST API.
417
+ #
418
+ # This class represents the configuration for TermsOfServiceService REST,
419
+ # providing control over timeouts, retry behavior, logging, transport
420
+ # parameters, and other low-level controls. Certain parameters can also be
421
+ # applied individually to specific RPCs. See
422
+ # {::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceService::Rest::Client::Configuration::Rpcs}
423
+ # for a list of RPCs that can be configured independently.
424
+ #
425
+ # Configuration can be applied globally to all clients, or to a single client
426
+ # on construction.
427
+ #
428
+ # @example
429
+ #
430
+ # # Modify the global config, setting the timeout for
431
+ # # get_terms_of_service to 20 seconds,
432
+ # # and all remaining timeouts to 10 seconds.
433
+ # ::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceService::Rest::Client.configure do |config|
434
+ # config.timeout = 10.0
435
+ # config.rpcs.get_terms_of_service.timeout = 20.0
436
+ # end
437
+ #
438
+ # # Apply the above configuration only to a new client.
439
+ # client = ::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceService::Rest::Client.new do |config|
440
+ # config.timeout = 10.0
441
+ # config.rpcs.get_terms_of_service.timeout = 20.0
442
+ # end
443
+ #
444
+ # @!attribute [rw] endpoint
445
+ # A custom service endpoint, as a hostname or hostname:port. The default is
446
+ # nil, indicating to use the default endpoint in the current universe domain.
447
+ # @return [::String,nil]
448
+ # @!attribute [rw] credentials
449
+ # Credentials to send with calls. You may provide any of the following types:
450
+ # * (`String`) The path to a service account key file in JSON format
451
+ # * (`Hash`) A service account key as a Hash
452
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
453
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
454
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
455
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
456
+ # * (`nil`) indicating no credentials
457
+ # @return [::Object]
458
+ # @!attribute [rw] scope
459
+ # The OAuth scopes
460
+ # @return [::Array<::String>]
461
+ # @!attribute [rw] lib_name
462
+ # The library name as recorded in instrumentation and logging
463
+ # @return [::String]
464
+ # @!attribute [rw] lib_version
465
+ # The library version as recorded in instrumentation and logging
466
+ # @return [::String]
467
+ # @!attribute [rw] timeout
468
+ # The call timeout in seconds.
469
+ # @return [::Numeric]
470
+ # @!attribute [rw] metadata
471
+ # Additional headers to be sent with the call.
472
+ # @return [::Hash{::Symbol=>::String}]
473
+ # @!attribute [rw] retry_policy
474
+ # The retry policy. The value is a hash with the following keys:
475
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
476
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
477
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
478
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
479
+ # trigger a retry.
480
+ # @return [::Hash]
481
+ # @!attribute [rw] quota_project
482
+ # A separate project against which to charge quota.
483
+ # @return [::String]
484
+ # @!attribute [rw] universe_domain
485
+ # The universe domain within which to make requests. This determines the
486
+ # default endpoint URL. The default value of nil uses the environment
487
+ # universe (usually the default "googleapis.com" universe).
488
+ # @return [::String,nil]
489
+ #
490
+ class Configuration
491
+ extend ::Gapic::Config
492
+
493
+ # @private
494
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
495
+ DEFAULT_ENDPOINT = "merchantapi.googleapis.com"
496
+
497
+ config_attr :endpoint, nil, ::String, nil
498
+ config_attr :credentials, nil do |value|
499
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
500
+ allowed.any? { |klass| klass === value }
501
+ end
502
+ config_attr :scope, nil, ::String, ::Array, nil
503
+ config_attr :lib_name, nil, ::String, nil
504
+ config_attr :lib_version, nil, ::String, nil
505
+ config_attr :timeout, nil, ::Numeric, nil
506
+ config_attr :metadata, nil, ::Hash, nil
507
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
508
+ config_attr :quota_project, nil, ::String, nil
509
+ config_attr :universe_domain, nil, ::String, nil
510
+
511
+ # @private
512
+ def initialize parent_config = nil
513
+ @parent_config = parent_config unless parent_config.nil?
514
+
515
+ yield self if block_given?
516
+ end
517
+
518
+ ##
519
+ # Configurations for individual RPCs
520
+ # @return [Rpcs]
521
+ #
522
+ def rpcs
523
+ @rpcs ||= begin
524
+ parent_rpcs = nil
525
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
526
+ Rpcs.new parent_rpcs
527
+ end
528
+ end
529
+
530
+ ##
531
+ # Configuration RPC class for the TermsOfServiceService API.
532
+ #
533
+ # Includes fields providing the configuration for each RPC in this service.
534
+ # Each configuration object is of type `Gapic::Config::Method` and includes
535
+ # the following configuration fields:
536
+ #
537
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
538
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
539
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
540
+ # include the following keys:
541
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
542
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
543
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
544
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
545
+ # trigger a retry.
546
+ #
547
+ class Rpcs
548
+ ##
549
+ # RPC-specific configuration for `get_terms_of_service`
550
+ # @return [::Gapic::Config::Method]
551
+ #
552
+ attr_reader :get_terms_of_service
553
+ ##
554
+ # RPC-specific configuration for `retrieve_latest_terms_of_service`
555
+ # @return [::Gapic::Config::Method]
556
+ #
557
+ attr_reader :retrieve_latest_terms_of_service
558
+ ##
559
+ # RPC-specific configuration for `accept_terms_of_service`
560
+ # @return [::Gapic::Config::Method]
561
+ #
562
+ attr_reader :accept_terms_of_service
563
+
564
+ # @private
565
+ def initialize parent_rpcs = nil
566
+ get_terms_of_service_config = parent_rpcs.get_terms_of_service if parent_rpcs.respond_to? :get_terms_of_service
567
+ @get_terms_of_service = ::Gapic::Config::Method.new get_terms_of_service_config
568
+ retrieve_latest_terms_of_service_config = parent_rpcs.retrieve_latest_terms_of_service if parent_rpcs.respond_to? :retrieve_latest_terms_of_service
569
+ @retrieve_latest_terms_of_service = ::Gapic::Config::Method.new retrieve_latest_terms_of_service_config
570
+ accept_terms_of_service_config = parent_rpcs.accept_terms_of_service if parent_rpcs.respond_to? :accept_terms_of_service
571
+ @accept_terms_of_service = ::Gapic::Config::Method.new accept_terms_of_service_config
572
+
573
+ yield self if block_given?
574
+ end
575
+ end
576
+ end
577
+ end
578
+ end
579
+ end
580
+ end
581
+ end
582
+ end
583
+ end
584
+ end