google-ads-data_manager-v1 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/ads/data_manager/v1/marketing_data_insights_service/client.rb +494 -0
  3. data/lib/google/ads/data_manager/v1/marketing_data_insights_service/credentials.rb +47 -0
  4. data/lib/google/ads/data_manager/v1/marketing_data_insights_service/rest/client.rb +444 -0
  5. data/lib/google/ads/data_manager/v1/marketing_data_insights_service/rest/service_stub.rb +143 -0
  6. data/lib/google/ads/data_manager/v1/marketing_data_insights_service/rest.rb +53 -0
  7. data/lib/google/ads/data_manager/v1/marketing_data_insights_service.rb +56 -0
  8. data/lib/google/ads/data_manager/v1/partner_link_service/client.rb +739 -0
  9. data/lib/google/ads/data_manager/v1/partner_link_service/credentials.rb +47 -0
  10. data/lib/google/ads/data_manager/v1/partner_link_service/paths.rb +69 -0
  11. data/lib/google/ads/data_manager/v1/partner_link_service/rest/client.rb +675 -0
  12. data/lib/google/ads/data_manager/v1/partner_link_service/rest/service_stub.rb +265 -0
  13. data/lib/google/ads/data_manager/v1/partner_link_service/rest.rb +52 -0
  14. data/lib/google/ads/data_manager/v1/partner_link_service.rb +55 -0
  15. data/lib/google/ads/data_manager/v1/rest.rb +5 -0
  16. data/lib/google/ads/data_manager/v1/user_list_direct_license_service/client.rb +813 -0
  17. data/lib/google/ads/data_manager/v1/user_list_direct_license_service/credentials.rb +47 -0
  18. data/lib/google/ads/data_manager/v1/user_list_direct_license_service/paths.rb +69 -0
  19. data/lib/google/ads/data_manager/v1/user_list_direct_license_service/rest/client.rb +742 -0
  20. data/lib/google/ads/data_manager/v1/user_list_direct_license_service/rest/service_stub.rb +327 -0
  21. data/lib/google/ads/data_manager/v1/user_list_direct_license_service/rest.rb +56 -0
  22. data/lib/google/ads/data_manager/v1/user_list_direct_license_service.rb +59 -0
  23. data/lib/google/ads/data_manager/v1/user_list_global_license_service/client.rb +955 -0
  24. data/lib/google/ads/data_manager/v1/user_list_global_license_service/credentials.rb +47 -0
  25. data/lib/google/ads/data_manager/v1/user_list_global_license_service/paths.rb +69 -0
  26. data/lib/google/ads/data_manager/v1/user_list_global_license_service/rest/client.rb +877 -0
  27. data/lib/google/ads/data_manager/v1/user_list_global_license_service/rest/service_stub.rb +388 -0
  28. data/lib/google/ads/data_manager/v1/user_list_global_license_service/rest.rb +56 -0
  29. data/lib/google/ads/data_manager/v1/user_list_global_license_service.rb +59 -0
  30. data/lib/google/ads/data_manager/v1/user_list_service/client.rb +972 -0
  31. data/lib/google/ads/data_manager/v1/user_list_service/credentials.rb +47 -0
  32. data/lib/google/ads/data_manager/v1/user_list_service/paths.rb +69 -0
  33. data/lib/google/ads/data_manager/v1/user_list_service/rest/client.rb +894 -0
  34. data/lib/google/ads/data_manager/v1/user_list_service/rest/service_stub.rb +388 -0
  35. data/lib/google/ads/data_manager/v1/user_list_service/rest.rb +52 -0
  36. data/lib/google/ads/data_manager/v1/user_list_service.rb +55 -0
  37. data/lib/google/ads/data_manager/v1/version.rb +1 -1
  38. data/lib/google/ads/data_manager/v1.rb +5 -0
  39. data/lib/google/ads/datamanager/v1/age_range_pb.rb +21 -0
  40. data/lib/google/ads/datamanager/v1/audience_pb.rb +5 -26
  41. data/lib/google/ads/datamanager/v1/cart_data_pb.rb +3 -25
  42. data/lib/google/ads/datamanager/v1/consent_pb.rb +3 -24
  43. data/lib/google/ads/datamanager/v1/destination_pb.rb +4 -24
  44. data/lib/google/ads/datamanager/v1/device_info_pb.rb +3 -24
  45. data/lib/google/ads/datamanager/v1/encryption_info_pb.rb +3 -24
  46. data/lib/google/ads/datamanager/v1/error_pb.rb +3 -24
  47. data/lib/google/ads/datamanager/v1/event_pb.rb +3 -31
  48. data/lib/google/ads/datamanager/v1/experimental_field_pb.rb +3 -24
  49. data/lib/google/ads/datamanager/v1/gender_pb.rb +21 -0
  50. data/lib/google/ads/datamanager/v1/ingestion_service_pb.rb +3 -31
  51. data/lib/google/ads/datamanager/v1/insights_service_pb.rb +33 -0
  52. data/lib/google/ads/datamanager/v1/insights_service_services_pb.rb +62 -0
  53. data/lib/google/ads/datamanager/v1/item_parameter_pb.rb +3 -24
  54. data/lib/google/ads/datamanager/v1/match_rate_pb.rb +3 -24
  55. data/lib/google/ads/datamanager/v1/partner_link_service_pb.rb +32 -0
  56. data/lib/google/ads/datamanager/v1/partner_link_service_services_pb.rb +79 -0
  57. data/lib/google/ads/datamanager/v1/processing_errors_pb.rb +3 -24
  58. data/lib/google/ads/datamanager/v1/request_status_per_destination_pb.rb +7 -26
  59. data/lib/google/ads/datamanager/v1/terms_of_service_pb.rb +3 -24
  60. data/lib/google/ads/datamanager/v1/user_data_pb.rb +3 -24
  61. data/lib/google/ads/datamanager/v1/user_list_direct_license_pb.rb +28 -0
  62. data/lib/google/ads/datamanager/v1/user_list_direct_license_service_pb.rb +32 -0
  63. data/lib/google/ads/datamanager/v1/user_list_direct_license_service_services_pb.rb +63 -0
  64. data/lib/google/ads/datamanager/v1/user_list_global_license_pb.rb +30 -0
  65. data/lib/google/ads/datamanager/v1/user_list_global_license_service_pb.rb +34 -0
  66. data/lib/google/ads/datamanager/v1/user_list_global_license_service_services_pb.rb +67 -0
  67. data/lib/google/ads/datamanager/v1/user_list_global_license_type_pb.rb +21 -0
  68. data/lib/google/ads/datamanager/v1/user_list_license_client_account_type_pb.rb +21 -0
  69. data/lib/google/ads/datamanager/v1/user_list_license_metrics_pb.rb +23 -0
  70. data/lib/google/ads/datamanager/v1/user_list_license_pricing_pb.rb +26 -0
  71. data/lib/google/ads/datamanager/v1/user_list_license_status_pb.rb +21 -0
  72. data/lib/google/ads/datamanager/v1/user_list_pb.rb +43 -0
  73. data/lib/google/ads/datamanager/v1/user_list_service_pb.rb +34 -0
  74. data/lib/google/ads/datamanager/v1/user_list_service_services_pb.rb +118 -0
  75. data/lib/google/ads/datamanager/v1/user_properties_pb.rb +3 -24
  76. data/proto_docs/google/ads/datamanager/v1/age_range.rb +53 -0
  77. data/proto_docs/google/ads/datamanager/v1/audience.rb +42 -3
  78. data/proto_docs/google/ads/datamanager/v1/destination.rb +3 -0
  79. data/proto_docs/google/ads/datamanager/v1/encryption_info.rb +6 -3
  80. data/proto_docs/google/ads/datamanager/v1/error.rb +159 -1
  81. data/proto_docs/google/ads/datamanager/v1/gender.rb +41 -0
  82. data/proto_docs/google/ads/datamanager/v1/insights_service.rb +133 -0
  83. data/proto_docs/google/ads/datamanager/v1/partner_link_service.rb +141 -0
  84. data/proto_docs/google/ads/datamanager/v1/request_status_per_destination.rb +92 -6
  85. data/proto_docs/google/ads/datamanager/v1/user_list.rb +397 -0
  86. data/proto_docs/google/ads/datamanager/v1/user_list_direct_license.rb +75 -0
  87. data/proto_docs/google/ads/datamanager/v1/user_list_direct_license_service.rb +134 -0
  88. data/proto_docs/google/ads/datamanager/v1/user_list_global_license.rb +114 -0
  89. data/proto_docs/google/ads/datamanager/v1/user_list_global_license_service.rb +204 -0
  90. data/proto_docs/google/ads/datamanager/v1/user_list_global_license_type.rb +41 -0
  91. data/proto_docs/google/ads/datamanager/v1/user_list_license_client_account_type.rb +44 -0
  92. data/proto_docs/google/ads/datamanager/v1/user_list_license_metrics.rb +55 -0
  93. data/proto_docs/google/ads/datamanager/v1/user_list_license_pricing.rb +108 -0
  94. data/proto_docs/google/ads/datamanager/v1/user_list_license_status.rb +38 -0
  95. data/proto_docs/google/ads/datamanager/v1/user_list_service.rb +151 -0
  96. data/proto_docs/google/api/client.rb +149 -29
  97. data/proto_docs/google/protobuf/empty.rb +34 -0
  98. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  99. metadata +73 -2
@@ -0,0 +1,444 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/ads/datamanager/v1/insights_service_pb"
21
+ require "google/ads/data_manager/v1/marketing_data_insights_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Ads
25
+ module DataManager
26
+ module V1
27
+ module MarketingDataInsightsService
28
+ module Rest
29
+ ##
30
+ # REST client for the MarketingDataInsightsService service.
31
+ #
32
+ # Service to return insights on marketing data.
33
+ #
34
+ # This feature is only available to data partners.
35
+ #
36
+ class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
40
+ # @private
41
+ DEFAULT_ENDPOINT_TEMPLATE = "datamanager.$UNIVERSE_DOMAIN$"
42
+
43
+ # @private
44
+ attr_reader :marketing_data_insights_service_stub
45
+
46
+ ##
47
+ # Configure the MarketingDataInsightsService Client class.
48
+ #
49
+ # See {::Google::Ads::DataManager::V1::MarketingDataInsightsService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all MarketingDataInsightsService clients
55
+ # ::Google::Ads::DataManager::V1::MarketingDataInsightsService::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Ads", "DataManager", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the MarketingDataInsightsService Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Ads::DataManager::V1::MarketingDataInsightsService::Rest::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @marketing_data_insights_service_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new MarketingDataInsightsService REST client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Ads::DataManager::V1::MarketingDataInsightsService::Rest::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Ads::DataManager::V1::MarketingDataInsightsService::Rest::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the MarketingDataInsightsService client.
124
+ # @yieldparam config [Client::Configuration]
125
+ #
126
+ def initialize
127
+ # Create the configuration object
128
+ @config = Configuration.new Client.configure
129
+
130
+ # Yield the configuration if needed
131
+ yield @config if block_given?
132
+
133
+ # Create credentials
134
+ credentials = @config.credentials
135
+ # Use self-signed JWT if the endpoint is unchanged from default,
136
+ # but only if the default endpoint does not have a region prefix.
137
+ enable_self_signed_jwt = @config.endpoint.nil? ||
138
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
139
+ !@config.endpoint.split(".").first.include?("-"))
140
+ credentials ||= Credentials.default scope: @config.scope,
141
+ enable_self_signed_jwt: enable_self_signed_jwt
142
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
143
+ credentials = Credentials.new credentials, scope: @config.scope
144
+ end
145
+
146
+ @quota_project_id = @config.quota_project
147
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
148
+
149
+ @marketing_data_insights_service_stub = ::Google::Ads::DataManager::V1::MarketingDataInsightsService::Rest::ServiceStub.new(
150
+ endpoint: @config.endpoint,
151
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
152
+ universe_domain: @config.universe_domain,
153
+ credentials: credentials,
154
+ logger: @config.logger
155
+ )
156
+
157
+ @marketing_data_insights_service_stub.logger(stub: true)&.info do |entry|
158
+ entry.set_system_name
159
+ entry.set_service
160
+ entry.message = "Created client for #{entry.service}"
161
+ entry.set_credentials_fields credentials
162
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
163
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
164
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
165
+ end
166
+ end
167
+
168
+ ##
169
+ # The logger used for request/response debug logging.
170
+ #
171
+ # @return [Logger]
172
+ #
173
+ def logger
174
+ @marketing_data_insights_service_stub.logger
175
+ end
176
+
177
+ # Service calls
178
+
179
+ ##
180
+ # Retrieves marketing data insights for a given user list.
181
+ #
182
+ # This feature is only available to data partners.
183
+ #
184
+ # Authorization Headers:
185
+ #
186
+ # This method supports the following optional headers to define how the API
187
+ # authorizes access for the request:
188
+ #
189
+ # * `login-account`: (Optional) The resource name of the account where the
190
+ # Google Account of the credentials is a user. If not set, defaults to the
191
+ # account of the request. Format:
192
+ # `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
193
+ # * `linked-account`: (Optional) The resource name of the account with an
194
+ # established product link to the `login-account`. Format:
195
+ # `accountTypes/{linkedAccountType}/accounts/{linkedAccountId}`
196
+ #
197
+ # @overload retrieve_insights(request, options = nil)
198
+ # Pass arguments to `retrieve_insights` via a request object, either of type
199
+ # {::Google::Ads::DataManager::V1::RetrieveInsightsRequest} or an equivalent Hash.
200
+ #
201
+ # @param request [::Google::Ads::DataManager::V1::RetrieveInsightsRequest, ::Hash]
202
+ # A request object representing the call parameters. Required. To specify no
203
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
204
+ # @param options [::Gapic::CallOptions, ::Hash]
205
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
206
+ #
207
+ # @overload retrieve_insights(parent: nil, baseline: nil, user_list_id: nil)
208
+ # Pass arguments to `retrieve_insights` via keyword arguments. Note that at
209
+ # least one keyword argument is required. To specify no parameters, or to keep all
210
+ # the default parameter values, pass an empty Hash as a request object (see above).
211
+ #
212
+ # @param parent [::String]
213
+ # Required. The parent account that owns the user list.
214
+ # Format: `accountTypes/{account_type}/accounts/{account}`
215
+ # @param baseline [::Google::Ads::DataManager::V1::Baseline, ::Hash]
216
+ # Required. Baseline for the insights requested.
217
+ # @param user_list_id [::String]
218
+ # Required. The user list ID for which insights are requested.
219
+ # @yield [result, operation] Access the result along with the TransportOperation object
220
+ # @yieldparam result [::Google::Ads::DataManager::V1::RetrieveInsightsResponse]
221
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
222
+ #
223
+ # @return [::Google::Ads::DataManager::V1::RetrieveInsightsResponse]
224
+ #
225
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
226
+ #
227
+ # @example Basic example
228
+ # require "google/ads/data_manager/v1"
229
+ #
230
+ # # Create a client object. The client can be reused for multiple calls.
231
+ # client = Google::Ads::DataManager::V1::MarketingDataInsightsService::Rest::Client.new
232
+ #
233
+ # # Create a request. To set request fields, pass in keyword arguments.
234
+ # request = Google::Ads::DataManager::V1::RetrieveInsightsRequest.new
235
+ #
236
+ # # Call the retrieve_insights method.
237
+ # result = client.retrieve_insights request
238
+ #
239
+ # # The returned object is of type Google::Ads::DataManager::V1::RetrieveInsightsResponse.
240
+ # p result
241
+ #
242
+ def retrieve_insights request, options = nil
243
+ raise ::ArgumentError, "request must be provided" if request.nil?
244
+
245
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::DataManager::V1::RetrieveInsightsRequest
246
+
247
+ # Converts hash and nil to an options object
248
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
249
+
250
+ # Customize the options with defaults
251
+ call_metadata = @config.rpcs.retrieve_insights.metadata.to_h
252
+
253
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
254
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
255
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
256
+ gapic_version: ::Google::Ads::DataManager::V1::VERSION,
257
+ transports_version_send: [:rest]
258
+
259
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
260
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
261
+
262
+ options.apply_defaults timeout: @config.rpcs.retrieve_insights.timeout,
263
+ metadata: call_metadata,
264
+ retry_policy: @config.rpcs.retrieve_insights.retry_policy
265
+
266
+ options.apply_defaults timeout: @config.timeout,
267
+ metadata: @config.metadata,
268
+ retry_policy: @config.retry_policy
269
+
270
+ @marketing_data_insights_service_stub.retrieve_insights request, options do |result, operation|
271
+ yield result, operation if block_given?
272
+ end
273
+ rescue ::Gapic::Rest::Error => e
274
+ raise ::Google::Cloud::Error.from_error(e)
275
+ end
276
+
277
+ ##
278
+ # Configuration class for the MarketingDataInsightsService REST API.
279
+ #
280
+ # This class represents the configuration for MarketingDataInsightsService REST,
281
+ # providing control over timeouts, retry behavior, logging, transport
282
+ # parameters, and other low-level controls. Certain parameters can also be
283
+ # applied individually to specific RPCs. See
284
+ # {::Google::Ads::DataManager::V1::MarketingDataInsightsService::Rest::Client::Configuration::Rpcs}
285
+ # for a list of RPCs that can be configured independently.
286
+ #
287
+ # Configuration can be applied globally to all clients, or to a single client
288
+ # on construction.
289
+ #
290
+ # @example
291
+ #
292
+ # # Modify the global config, setting the timeout for
293
+ # # retrieve_insights to 20 seconds,
294
+ # # and all remaining timeouts to 10 seconds.
295
+ # ::Google::Ads::DataManager::V1::MarketingDataInsightsService::Rest::Client.configure do |config|
296
+ # config.timeout = 10.0
297
+ # config.rpcs.retrieve_insights.timeout = 20.0
298
+ # end
299
+ #
300
+ # # Apply the above configuration only to a new client.
301
+ # client = ::Google::Ads::DataManager::V1::MarketingDataInsightsService::Rest::Client.new do |config|
302
+ # config.timeout = 10.0
303
+ # config.rpcs.retrieve_insights.timeout = 20.0
304
+ # end
305
+ #
306
+ # @!attribute [rw] endpoint
307
+ # A custom service endpoint, as a hostname or hostname:port. The default is
308
+ # nil, indicating to use the default endpoint in the current universe domain.
309
+ # @return [::String,nil]
310
+ # @!attribute [rw] credentials
311
+ # Credentials to send with calls. You may provide any of the following types:
312
+ # * (`String`) The path to a service account key file in JSON format
313
+ # * (`Hash`) A service account key as a Hash
314
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
315
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
316
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
317
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
318
+ # * (`nil`) indicating no credentials
319
+ #
320
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
321
+ # external source for authentication to Google Cloud, you must validate it before
322
+ # providing it to a Google API client library. Providing an unvalidated credential
323
+ # configuration to Google APIs can compromise the security of your systems and data.
324
+ # For more information, refer to [Validate credential configurations from external
325
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
326
+ # @return [::Object]
327
+ # @!attribute [rw] scope
328
+ # The OAuth scopes
329
+ # @return [::Array<::String>]
330
+ # @!attribute [rw] lib_name
331
+ # The library name as recorded in instrumentation and logging
332
+ # @return [::String]
333
+ # @!attribute [rw] lib_version
334
+ # The library version as recorded in instrumentation and logging
335
+ # @return [::String]
336
+ # @!attribute [rw] timeout
337
+ # The call timeout in seconds.
338
+ # @return [::Numeric]
339
+ # @!attribute [rw] metadata
340
+ # Additional headers to be sent with the call.
341
+ # @return [::Hash{::Symbol=>::String}]
342
+ # @!attribute [rw] retry_policy
343
+ # The retry policy. The value is a hash with the following keys:
344
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
345
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
346
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
347
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
348
+ # trigger a retry.
349
+ # @return [::Hash]
350
+ # @!attribute [rw] quota_project
351
+ # A separate project against which to charge quota.
352
+ # @return [::String]
353
+ # @!attribute [rw] universe_domain
354
+ # The universe domain within which to make requests. This determines the
355
+ # default endpoint URL. The default value of nil uses the environment
356
+ # universe (usually the default "googleapis.com" universe).
357
+ # @return [::String,nil]
358
+ # @!attribute [rw] logger
359
+ # A custom logger to use for request/response debug logging, or the value
360
+ # `:default` (the default) to construct a default logger, or `nil` to
361
+ # explicitly disable logging.
362
+ # @return [::Logger,:default,nil]
363
+ #
364
+ class Configuration
365
+ extend ::Gapic::Config
366
+
367
+ # @private
368
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
369
+ DEFAULT_ENDPOINT = "datamanager.googleapis.com"
370
+
371
+ config_attr :endpoint, nil, ::String, nil
372
+ config_attr :credentials, nil do |value|
373
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
374
+ allowed.any? { |klass| klass === value }
375
+ end
376
+ config_attr :scope, nil, ::String, ::Array, nil
377
+ config_attr :lib_name, nil, ::String, nil
378
+ config_attr :lib_version, nil, ::String, nil
379
+ config_attr :timeout, nil, ::Numeric, nil
380
+ config_attr :metadata, nil, ::Hash, nil
381
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
382
+ config_attr :quota_project, nil, ::String, nil
383
+ config_attr :universe_domain, nil, ::String, nil
384
+ config_attr :logger, :default, ::Logger, nil, :default
385
+
386
+ # @private
387
+ def initialize parent_config = nil
388
+ @parent_config = parent_config unless parent_config.nil?
389
+
390
+ yield self if block_given?
391
+ end
392
+
393
+ ##
394
+ # Configurations for individual RPCs
395
+ # @return [Rpcs]
396
+ #
397
+ def rpcs
398
+ @rpcs ||= begin
399
+ parent_rpcs = nil
400
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
401
+ Rpcs.new parent_rpcs
402
+ end
403
+ end
404
+
405
+ ##
406
+ # Configuration RPC class for the MarketingDataInsightsService API.
407
+ #
408
+ # Includes fields providing the configuration for each RPC in this service.
409
+ # Each configuration object is of type `Gapic::Config::Method` and includes
410
+ # the following configuration fields:
411
+ #
412
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
413
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
414
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
415
+ # include the following keys:
416
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
417
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
418
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
419
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
420
+ # trigger a retry.
421
+ #
422
+ class Rpcs
423
+ ##
424
+ # RPC-specific configuration for `retrieve_insights`
425
+ # @return [::Gapic::Config::Method]
426
+ #
427
+ attr_reader :retrieve_insights
428
+
429
+ # @private
430
+ def initialize parent_rpcs = nil
431
+ retrieve_insights_config = parent_rpcs.retrieve_insights if parent_rpcs.respond_to? :retrieve_insights
432
+ @retrieve_insights = ::Gapic::Config::Method.new retrieve_insights_config
433
+
434
+ yield self if block_given?
435
+ end
436
+ end
437
+ end
438
+ end
439
+ end
440
+ end
441
+ end
442
+ end
443
+ end
444
+ end
@@ -0,0 +1,143 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/ads/datamanager/v1/insights_service_pb"
20
+
21
+ module Google
22
+ module Ads
23
+ module DataManager
24
+ module V1
25
+ module MarketingDataInsightsService
26
+ module Rest
27
+ ##
28
+ # REST service stub for the MarketingDataInsightsService service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
40
+ endpoint_template: endpoint_template,
41
+ universe_domain: universe_domain,
42
+ credentials: credentials,
43
+ numeric_enums: true,
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
47
+ end
48
+
49
+ ##
50
+ # The effective universe domain
51
+ #
52
+ # @return [String]
53
+ #
54
+ def universe_domain
55
+ @client_stub.universe_domain
56
+ end
57
+
58
+ ##
59
+ # The effective endpoint
60
+ #
61
+ # @return [String]
62
+ #
63
+ def endpoint
64
+ @client_stub.endpoint
65
+ end
66
+
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
76
+ ##
77
+ # Baseline implementation for the retrieve_insights REST call
78
+ #
79
+ # @param request_pb [::Google::Ads::DataManager::V1::RetrieveInsightsRequest]
80
+ # A request object representing the call parameters. Required.
81
+ # @param options [::Gapic::CallOptions]
82
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
83
+ #
84
+ # @yield [result, operation] Access the result along with the TransportOperation object
85
+ # @yieldparam result [::Google::Ads::DataManager::V1::RetrieveInsightsResponse]
86
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
87
+ #
88
+ # @return [::Google::Ads::DataManager::V1::RetrieveInsightsResponse]
89
+ # A result object deserialized from the server's reply
90
+ def retrieve_insights request_pb, options = nil
91
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
92
+
93
+ verb, uri, query_string_params, body = ServiceStub.transcode_retrieve_insights_request request_pb
94
+ query_string_params = if query_string_params.any?
95
+ query_string_params.to_h { |p| p.split "=", 2 }
96
+ else
97
+ {}
98
+ end
99
+
100
+ response = @client_stub.make_http_request(
101
+ verb,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "retrieve_insights",
106
+ options: options
107
+ )
108
+ operation = ::Gapic::Rest::TransportOperation.new response
109
+ result = ::Google::Ads::DataManager::V1::RetrieveInsightsResponse.decode_json response.body, ignore_unknown_fields: true
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
114
+ end
115
+
116
+ ##
117
+ # @private
118
+ #
119
+ # GRPC transcoding helper method for the retrieve_insights REST call
120
+ #
121
+ # @param request_pb [::Google::Ads::DataManager::V1::RetrieveInsightsRequest]
122
+ # A request object representing the call parameters. Required.
123
+ # @return [Array(String, [String, nil], Hash{String => String})]
124
+ # Uri, Body, Query string parameters
125
+ def self.transcode_retrieve_insights_request request_pb
126
+ transcoder = Gapic::Rest::GrpcTranscoder.new
127
+ .with_bindings(
128
+ uri_method: :post,
129
+ uri_template: "/v1/{parent}/insights:retrieve",
130
+ body: "*",
131
+ matches: [
132
+ ["parent", %r{^accountTypes/[^/]+/accounts/[^/]+/?$}, false]
133
+ ]
134
+ )
135
+ transcoder.transcode request_pb
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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 "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/ads/data_manager/v1/version"
24
+
25
+ require "google/ads/data_manager/v1/marketing_data_insights_service/credentials"
26
+ require "google/ads/data_manager/v1/marketing_data_insights_service/rest/client"
27
+
28
+ module Google
29
+ module Ads
30
+ module DataManager
31
+ module V1
32
+ ##
33
+ # Service to return insights on marketing data.
34
+ #
35
+ # This feature is only available to data partners.
36
+ #
37
+ # To load this service and instantiate a REST client:
38
+ #
39
+ # require "google/ads/data_manager/v1/marketing_data_insights_service/rest"
40
+ # client = ::Google::Ads::DataManager::V1::MarketingDataInsightsService::Rest::Client.new
41
+ #
42
+ module MarketingDataInsightsService
43
+ # Client for the REST transport
44
+ module Rest
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
53
+ require "google/ads/data_manager/v1/marketing_data_insights_service/rest/helpers" if ::File.file? helper_path