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