Skip to content

Commit 871180e

Browse files
1 parent e1ab5ac commit 871180e

204 files changed

Lines changed: 536 additions & 27265 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎google-ads-data_manager-v1/.owlbot-manifest.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"lib/google/ads/data_manager/v1/user_list_service/rest/client.rb",
5858
"lib/google/ads/data_manager/v1/user_list_service/rest/service_stub.rb",
5959
"lib/google/ads/data_manager/v1/version.rb",
60+
"lib/google/ads/datamanager/v1/ad_event_pb.rb",
6061
"lib/google/ads/datamanager/v1/age_range_pb.rb",
6162
"lib/google/ads/datamanager/v1/audience_pb.rb",
6263
"lib/google/ads/datamanager/v1/cart_data_pb.rb",
@@ -96,7 +97,9 @@
9697
"lib/google/ads/datamanager/v1/user_list_service_pb.rb",
9798
"lib/google/ads/datamanager/v1/user_list_service_services_pb.rb",
9899
"lib/google/ads/datamanager/v1/user_properties_pb.rb",
100+
"lib/google/ads/datamanager/v1/viewability_info_pb.rb",
99101
"proto_docs/README.md",
102+
"proto_docs/google/ads/datamanager/v1/ad_event.rb",
100103
"proto_docs/google/ads/datamanager/v1/age_range.rb",
101104
"proto_docs/google/ads/datamanager/v1/audience.rb",
102105
"proto_docs/google/ads/datamanager/v1/cart_data.rb",
@@ -130,6 +133,7 @@
130133
"proto_docs/google/ads/datamanager/v1/user_list_license_status.rb",
131134
"proto_docs/google/ads/datamanager/v1/user_list_service.rb",
132135
"proto_docs/google/ads/datamanager/v1/user_properties.rb",
136+
"proto_docs/google/ads/datamanager/v1/viewability_info.rb",
133137
"proto_docs/google/api/client.rb",
134138
"proto_docs/google/api/field_behavior.rb",
135139
"proto_docs/google/api/field_info.rb",
@@ -140,6 +144,7 @@
140144
"proto_docs/google/protobuf/field_mask.rb",
141145
"proto_docs/google/protobuf/timestamp.rb",
142146
"snippets/Gemfile",
147+
"snippets/ingestion_service/ingest_ad_events.rb",
143148
"snippets/ingestion_service/ingest_audience_members.rb",
144149
"snippets/ingestion_service/ingest_events.rb",
145150
"snippets/ingestion_service/remove_audience_members.rb",

‎google-ads-data_manager-v1/gapic_metadata.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
"ingest_events"
2626
]
2727
},
28+
"IngestAdEvents": {
29+
"methods": [
30+
"ingest_ad_events"
31+
]
32+
},
2833
"RetrieveRequestStatus": {
2934
"methods": [
3035
"retrieve_request_status"

‎google-ads-data_manager-v1/lib/google/ads/data_manager/v1/ingestion_service/client.rb‎

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,92 @@ def ingest_events request, options = nil
483483
raise ::Google::Cloud::Error.from_error(e)
484484
end
485485

486+
##
487+
# Uploads a list of
488+
# {::Google::Ads::DataManager::V1::AdEvent AdEvent} resources to Google
489+
# Analytics.
490+
#
491+
# This feature is only available to accounts on an allowlist.
492+
#
493+
# @overload ingest_ad_events(request, options = nil)
494+
# Pass arguments to `ingest_ad_events` via a request object, either of type
495+
# {::Google::Ads::DataManager::V1::IngestAdEventsRequest} or an equivalent Hash.
496+
#
497+
# @param request [::Google::Ads::DataManager::V1::IngestAdEventsRequest, ::Hash]
498+
# A request object representing the call parameters. Required. To specify no
499+
# parameters, or to keep all the default parameter values, pass an empty Hash.
500+
# @param options [::Gapic::CallOptions, ::Hash]
501+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
502+
#
503+
# @overload ingest_ad_events(ad_events: nil, encryption_info: nil, validate_only: nil)
504+
# Pass arguments to `ingest_ad_events` via keyword arguments. Note that at
505+
# least one keyword argument is required. To specify no parameters, or to keep all
506+
# the default parameter values, pass an empty Hash as a request object (see above).
507+
#
508+
# @param ad_events [::Array<::Google::Ads::DataManager::V1::AdEvent, ::Hash>]
509+
# Required. Required (at least 1). A list of ad events.
510+
# @param encryption_info [::Google::Ads::DataManager::V1::EncryptionInfo, ::Hash]
511+
# Optional. Information about encryption keys which are used to encrypt the
512+
# data.
513+
# @param validate_only [::Boolean]
514+
# Optional. If true, the request is validated, but not executed.
515+
#
516+
# @yield [response, operation] Access the result along with the RPC operation
517+
# @yieldparam response [::Google::Ads::DataManager::V1::IngestAdEventsResponse]
518+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
519+
#
520+
# @return [::Google::Ads::DataManager::V1::IngestAdEventsResponse]
521+
#
522+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
523+
#
524+
# @example Basic example
525+
# require "google/ads/data_manager/v1"
526+
#
527+
# # Create a client object. The client can be reused for multiple calls.
528+
# client = Google::Ads::DataManager::V1::IngestionService::Client.new
529+
#
530+
# # Create a request. To set request fields, pass in keyword arguments.
531+
# request = Google::Ads::DataManager::V1::IngestAdEventsRequest.new
532+
#
533+
# # Call the ingest_ad_events method.
534+
# result = client.ingest_ad_events request
535+
#
536+
# # The returned object is of type Google::Ads::DataManager::V1::IngestAdEventsResponse.
537+
# p result
538+
#
539+
def ingest_ad_events request, options = nil
540+
raise ::ArgumentError, "request must be provided" if request.nil?
541+
542+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::DataManager::V1::IngestAdEventsRequest
543+
544+
# Converts hash and nil to an options object
545+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
546+
547+
# Customize the options with defaults
548+
metadata = @config.rpcs.ingest_ad_events.metadata.to_h
549+
550+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
551+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
552+
lib_name: @config.lib_name, lib_version: @config.lib_version,
553+
gapic_version: ::Google::Ads::DataManager::V1::VERSION
554+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
555+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
556+
557+
options.apply_defaults timeout: @config.rpcs.ingest_ad_events.timeout,
558+
metadata: metadata,
559+
retry_policy: @config.rpcs.ingest_ad_events.retry_policy
560+
561+
options.apply_defaults timeout: @config.timeout,
562+
metadata: @config.metadata,
563+
retry_policy: @config.retry_policy
564+
565+
@ingestion_service_stub.call_rpc :ingest_ad_events, request, options: options do |response, operation|
566+
yield response, operation if block_given?
567+
end
568+
rescue ::GRPC::BadStatus => e
569+
raise ::Google::Cloud::Error.from_error(e)
570+
end
571+
486572
##
487573
# Gets the status of a request given request id.
488574
#
@@ -761,6 +847,11 @@ class Rpcs
761847
#
762848
attr_reader :ingest_events
763849
##
850+
# RPC-specific configuration for `ingest_ad_events`
851+
# @return [::Gapic::Config::Method]
852+
#
853+
attr_reader :ingest_ad_events
854+
##
764855
# RPC-specific configuration for `retrieve_request_status`
765856
# @return [::Gapic::Config::Method]
766857
#
@@ -774,6 +865,8 @@ def initialize parent_rpcs = nil
774865
@remove_audience_members = ::Gapic::Config::Method.new remove_audience_members_config
775866
ingest_events_config = parent_rpcs.ingest_events if parent_rpcs.respond_to? :ingest_events
776867
@ingest_events = ::Gapic::Config::Method.new ingest_events_config
868+
ingest_ad_events_config = parent_rpcs.ingest_ad_events if parent_rpcs.respond_to? :ingest_ad_events
869+
@ingest_ad_events = ::Gapic::Config::Method.new ingest_ad_events_config
777870
retrieve_request_status_config = parent_rpcs.retrieve_request_status if parent_rpcs.respond_to? :retrieve_request_status
778871
@retrieve_request_status = ::Gapic::Config::Method.new retrieve_request_status_config
779872

‎google-ads-data_manager-v1/lib/google/ads/data_manager/v1/ingestion_service/rest/client.rb‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,93 @@ def ingest_events request, options = nil
479479
raise ::Google::Cloud::Error.from_error(e)
480480
end
481481

482+
##
483+
# Uploads a list of
484+
# {::Google::Ads::DataManager::V1::AdEvent AdEvent} resources to Google
485+
# Analytics.
486+
#
487+
# This feature is only available to accounts on an allowlist.
488+
#
489+
# @overload ingest_ad_events(request, options = nil)
490+
# Pass arguments to `ingest_ad_events` via a request object, either of type
491+
# {::Google::Ads::DataManager::V1::IngestAdEventsRequest} or an equivalent Hash.
492+
#
493+
# @param request [::Google::Ads::DataManager::V1::IngestAdEventsRequest, ::Hash]
494+
# A request object representing the call parameters. Required. To specify no
495+
# parameters, or to keep all the default parameter values, pass an empty Hash.
496+
# @param options [::Gapic::CallOptions, ::Hash]
497+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
498+
#
499+
# @overload ingest_ad_events(ad_events: nil, encryption_info: nil, validate_only: nil)
500+
# Pass arguments to `ingest_ad_events` via keyword arguments. Note that at
501+
# least one keyword argument is required. To specify no parameters, or to keep all
502+
# the default parameter values, pass an empty Hash as a request object (see above).
503+
#
504+
# @param ad_events [::Array<::Google::Ads::DataManager::V1::AdEvent, ::Hash>]
505+
# Required. Required (at least 1). A list of ad events.
506+
# @param encryption_info [::Google::Ads::DataManager::V1::EncryptionInfo, ::Hash]
507+
# Optional. Information about encryption keys which are used to encrypt the
508+
# data.
509+
# @param validate_only [::Boolean]
510+
# Optional. If true, the request is validated, but not executed.
511+
# @yield [result, operation] Access the result along with the TransportOperation object
512+
# @yieldparam result [::Google::Ads::DataManager::V1::IngestAdEventsResponse]
513+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
514+
#
515+
# @return [::Google::Ads::DataManager::V1::IngestAdEventsResponse]
516+
#
517+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
518+
#
519+
# @example Basic example
520+
# require "google/ads/data_manager/v1"
521+
#
522+
# # Create a client object. The client can be reused for multiple calls.
523+
# client = Google::Ads::DataManager::V1::IngestionService::Rest::Client.new
524+
#
525+
# # Create a request. To set request fields, pass in keyword arguments.
526+
# request = Google::Ads::DataManager::V1::IngestAdEventsRequest.new
527+
#
528+
# # Call the ingest_ad_events method.
529+
# result = client.ingest_ad_events request
530+
#
531+
# # The returned object is of type Google::Ads::DataManager::V1::IngestAdEventsResponse.
532+
# p result
533+
#
534+
def ingest_ad_events request, options = nil
535+
raise ::ArgumentError, "request must be provided" if request.nil?
536+
537+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::DataManager::V1::IngestAdEventsRequest
538+
539+
# Converts hash and nil to an options object
540+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
541+
542+
# Customize the options with defaults
543+
call_metadata = @config.rpcs.ingest_ad_events.metadata.to_h
544+
545+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
546+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
547+
lib_name: @config.lib_name, lib_version: @config.lib_version,
548+
gapic_version: ::Google::Ads::DataManager::V1::VERSION,
549+
transports_version_send: [:rest]
550+
551+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
552+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
553+
554+
options.apply_defaults timeout: @config.rpcs.ingest_ad_events.timeout,
555+
metadata: call_metadata,
556+
retry_policy: @config.rpcs.ingest_ad_events.retry_policy
557+
558+
options.apply_defaults timeout: @config.timeout,
559+
metadata: @config.metadata,
560+
retry_policy: @config.retry_policy
561+
562+
@ingestion_service_stub.ingest_ad_events request, options do |result, operation|
563+
yield result, operation if block_given?
564+
end
565+
rescue ::Gapic::Rest::Error => e
566+
raise ::Google::Cloud::Error.from_error(e)
567+
end
568+
482569
##
483570
# Gets the status of a request given request id.
484571
#
@@ -721,6 +808,11 @@ class Rpcs
721808
#
722809
attr_reader :ingest_events
723810
##
811+
# RPC-specific configuration for `ingest_ad_events`
812+
# @return [::Gapic::Config::Method]
813+
#
814+
attr_reader :ingest_ad_events
815+
##
724816
# RPC-specific configuration for `retrieve_request_status`
725817
# @return [::Gapic::Config::Method]
726818
#
@@ -734,6 +826,8 @@ def initialize parent_rpcs = nil
734826
@remove_audience_members = ::Gapic::Config::Method.new remove_audience_members_config
735827
ingest_events_config = parent_rpcs.ingest_events if parent_rpcs.respond_to? :ingest_events
736828
@ingest_events = ::Gapic::Config::Method.new ingest_events_config
829+
ingest_ad_events_config = parent_rpcs.ingest_ad_events if parent_rpcs.respond_to? :ingest_ad_events
830+
@ingest_ad_events = ::Gapic::Config::Method.new ingest_ad_events_config
737831
retrieve_request_status_config = parent_rpcs.retrieve_request_status if parent_rpcs.respond_to? :retrieve_request_status
738832
@retrieve_request_status = ::Gapic::Config::Method.new retrieve_request_status_config
739833

‎google-ads-data_manager-v1/lib/google/ads/data_manager/v1/ingestion_service/rest/service_stub.rb‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,46 @@ def ingest_events request_pb, options = nil
193193
end
194194
end
195195

196+
##
197+
# Baseline implementation for the ingest_ad_events REST call
198+
#
199+
# @param request_pb [::Google::Ads::DataManager::V1::IngestAdEventsRequest]
200+
# A request object representing the call parameters. Required.
201+
# @param options [::Gapic::CallOptions]
202+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
203+
#
204+
# @yield [result, operation] Access the result along with the TransportOperation object
205+
# @yieldparam result [::Google::Ads::DataManager::V1::IngestAdEventsResponse]
206+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
207+
#
208+
# @return [::Google::Ads::DataManager::V1::IngestAdEventsResponse]
209+
# A result object deserialized from the server's reply
210+
def ingest_ad_events request_pb, options = nil
211+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
212+
213+
verb, uri, query_string_params, body = ServiceStub.transcode_ingest_ad_events_request request_pb
214+
query_string_params = if query_string_params.any?
215+
query_string_params.to_h { |p| p.split "=", 2 }
216+
else
217+
{}
218+
end
219+
220+
response = @client_stub.make_http_request(
221+
verb,
222+
uri: uri,
223+
body: body || "",
224+
params: query_string_params,
225+
method_name: "ingest_ad_events",
226+
options: options
227+
)
228+
operation = ::Gapic::Rest::TransportOperation.new response
229+
result = ::Google::Ads::DataManager::V1::IngestAdEventsResponse.decode_json response.body, ignore_unknown_fields: true
230+
catch :response do
231+
yield result, operation if block_given?
232+
result
233+
end
234+
end
235+
196236
##
197237
# Baseline implementation for the retrieve_request_status REST call
198238
#
@@ -293,6 +333,26 @@ def self.transcode_ingest_events_request request_pb
293333
transcoder.transcode request_pb
294334
end
295335

336+
##
337+
# @private
338+
#
339+
# GRPC transcoding helper method for the ingest_ad_events REST call
340+
#
341+
# @param request_pb [::Google::Ads::DataManager::V1::IngestAdEventsRequest]
342+
# A request object representing the call parameters. Required.
343+
# @return [Array(String, [String, nil], Hash{String => String})]
344+
# Uri, Body, Query string parameters
345+
def self.transcode_ingest_ad_events_request request_pb
346+
transcoder = Gapic::Rest::GrpcTranscoder.new
347+
.with_bindings(
348+
uri_method: :post,
349+
uri_template: "/v1/adEvents:ingest",
350+
body: "*",
351+
matches: []
352+
)
353+
transcoder.transcode request_pb
354+
end
355+
296356
##
297357
# @private
298358
#

owl-bot-staging/google-ads-data_manager-v1/lib/google/ads/datamanager/v1/ad_event_pb.rb renamed to google-ads-data_manager-v1/lib/google/ads/datamanager/v1/ad_event_pb.rb

File renamed without changes.

0 commit comments

Comments
 (0)