Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions google-ads-data_manager-v1/.owlbot-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"lib/google/ads/data_manager/v1/user_list_service/rest/client.rb",
"lib/google/ads/data_manager/v1/user_list_service/rest/service_stub.rb",
"lib/google/ads/data_manager/v1/version.rb",
"lib/google/ads/datamanager/v1/ad_event_pb.rb",
"lib/google/ads/datamanager/v1/age_range_pb.rb",
"lib/google/ads/datamanager/v1/audience_pb.rb",
"lib/google/ads/datamanager/v1/cart_data_pb.rb",
Expand Down Expand Up @@ -96,7 +97,9 @@
"lib/google/ads/datamanager/v1/user_list_service_pb.rb",
"lib/google/ads/datamanager/v1/user_list_service_services_pb.rb",
"lib/google/ads/datamanager/v1/user_properties_pb.rb",
"lib/google/ads/datamanager/v1/viewability_info_pb.rb",
"proto_docs/README.md",
"proto_docs/google/ads/datamanager/v1/ad_event.rb",
"proto_docs/google/ads/datamanager/v1/age_range.rb",
"proto_docs/google/ads/datamanager/v1/audience.rb",
"proto_docs/google/ads/datamanager/v1/cart_data.rb",
Expand Down Expand Up @@ -130,6 +133,7 @@
"proto_docs/google/ads/datamanager/v1/user_list_license_status.rb",
"proto_docs/google/ads/datamanager/v1/user_list_service.rb",
"proto_docs/google/ads/datamanager/v1/user_properties.rb",
"proto_docs/google/ads/datamanager/v1/viewability_info.rb",
"proto_docs/google/api/client.rb",
"proto_docs/google/api/field_behavior.rb",
"proto_docs/google/api/field_info.rb",
Expand All @@ -140,6 +144,7 @@
"proto_docs/google/protobuf/field_mask.rb",
"proto_docs/google/protobuf/timestamp.rb",
"snippets/Gemfile",
"snippets/ingestion_service/ingest_ad_events.rb",
"snippets/ingestion_service/ingest_audience_members.rb",
"snippets/ingestion_service/ingest_events.rb",
"snippets/ingestion_service/remove_audience_members.rb",
Expand Down
5 changes: 5 additions & 0 deletions google-ads-data_manager-v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"ingest_events"
]
},
"IngestAdEvents": {
"methods": [
"ingest_ad_events"
]
},
"RetrieveRequestStatus": {
"methods": [
"retrieve_request_status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,92 @@ def ingest_events request, options = nil
raise ::Google::Cloud::Error.from_error(e)
end

##
# Uploads a list of
# {::Google::Ads::DataManager::V1::AdEvent AdEvent} resources to Google
# Analytics.
#
# This feature is only available to accounts on an allowlist.
#
# @overload ingest_ad_events(request, options = nil)
# Pass arguments to `ingest_ad_events` via a request object, either of type
# {::Google::Ads::DataManager::V1::IngestAdEventsRequest} or an equivalent Hash.
#
# @param request [::Google::Ads::DataManager::V1::IngestAdEventsRequest, ::Hash]
# A request object representing the call parameters. Required. To specify no
# parameters, or to keep all the default parameter values, pass an empty Hash.
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
#
# @overload ingest_ad_events(ad_events: nil, encryption_info: nil, validate_only: nil)
# Pass arguments to `ingest_ad_events` via keyword arguments. Note that at
# least one keyword argument is required. To specify no parameters, or to keep all
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param ad_events [::Array<::Google::Ads::DataManager::V1::AdEvent, ::Hash>]
# Required. Required (at least 1). A list of ad events.
# @param encryption_info [::Google::Ads::DataManager::V1::EncryptionInfo, ::Hash]
# Optional. Information about encryption keys which are used to encrypt the
# data.
# @param validate_only [::Boolean]
# Optional. If true, the request is validated, but not executed.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Ads::DataManager::V1::IngestAdEventsResponse]
# @yieldparam operation [::GRPC::ActiveCall::Operation]
#
# @return [::Google::Ads::DataManager::V1::IngestAdEventsResponse]
#
# @raise [::Google::Cloud::Error] if the RPC is aborted.
#
# @example Basic example
# require "google/ads/data_manager/v1"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Ads::DataManager::V1::IngestionService::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Ads::DataManager::V1::IngestAdEventsRequest.new
#
# # Call the ingest_ad_events method.
# result = client.ingest_ad_events request
#
# # The returned object is of type Google::Ads::DataManager::V1::IngestAdEventsResponse.
# p result
#
def ingest_ad_events request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::DataManager::V1::IngestAdEventsRequest

# Converts hash and nil to an options object
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

# Customize the options with defaults
metadata = @config.rpcs.ingest_ad_events.metadata.to_h

# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Ads::DataManager::V1::VERSION
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

options.apply_defaults timeout: @config.rpcs.ingest_ad_events.timeout,
metadata: metadata,
retry_policy: @config.rpcs.ingest_ad_events.retry_policy

options.apply_defaults timeout: @config.timeout,
metadata: @config.metadata,
retry_policy: @config.retry_policy

@ingestion_service_stub.call_rpc :ingest_ad_events, request, options: options do |response, operation|
yield response, operation if block_given?
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end

##
# Gets the status of a request given request id.
#
Expand Down Expand Up @@ -761,6 +847,11 @@ class Rpcs
#
attr_reader :ingest_events
##
# RPC-specific configuration for `ingest_ad_events`
# @return [::Gapic::Config::Method]
#
attr_reader :ingest_ad_events
##
# RPC-specific configuration for `retrieve_request_status`
# @return [::Gapic::Config::Method]
#
Expand All @@ -774,6 +865,8 @@ def initialize parent_rpcs = nil
@remove_audience_members = ::Gapic::Config::Method.new remove_audience_members_config
ingest_events_config = parent_rpcs.ingest_events if parent_rpcs.respond_to? :ingest_events
@ingest_events = ::Gapic::Config::Method.new ingest_events_config
ingest_ad_events_config = parent_rpcs.ingest_ad_events if parent_rpcs.respond_to? :ingest_ad_events
@ingest_ad_events = ::Gapic::Config::Method.new ingest_ad_events_config
retrieve_request_status_config = parent_rpcs.retrieve_request_status if parent_rpcs.respond_to? :retrieve_request_status
@retrieve_request_status = ::Gapic::Config::Method.new retrieve_request_status_config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,93 @@ def ingest_events request, options = nil
raise ::Google::Cloud::Error.from_error(e)
end

##
# Uploads a list of
# {::Google::Ads::DataManager::V1::AdEvent AdEvent} resources to Google
# Analytics.
#
# This feature is only available to accounts on an allowlist.
#
# @overload ingest_ad_events(request, options = nil)
# Pass arguments to `ingest_ad_events` via a request object, either of type
# {::Google::Ads::DataManager::V1::IngestAdEventsRequest} or an equivalent Hash.
#
# @param request [::Google::Ads::DataManager::V1::IngestAdEventsRequest, ::Hash]
# A request object representing the call parameters. Required. To specify no
# parameters, or to keep all the default parameter values, pass an empty Hash.
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
#
# @overload ingest_ad_events(ad_events: nil, encryption_info: nil, validate_only: nil)
# Pass arguments to `ingest_ad_events` via keyword arguments. Note that at
# least one keyword argument is required. To specify no parameters, or to keep all
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param ad_events [::Array<::Google::Ads::DataManager::V1::AdEvent, ::Hash>]
# Required. Required (at least 1). A list of ad events.
# @param encryption_info [::Google::Ads::DataManager::V1::EncryptionInfo, ::Hash]
# Optional. Information about encryption keys which are used to encrypt the
# data.
# @param validate_only [::Boolean]
# Optional. If true, the request is validated, but not executed.
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Google::Ads::DataManager::V1::IngestAdEventsResponse]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Google::Ads::DataManager::V1::IngestAdEventsResponse]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/ads/data_manager/v1"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Ads::DataManager::V1::IngestionService::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Ads::DataManager::V1::IngestAdEventsRequest.new
#
# # Call the ingest_ad_events method.
# result = client.ingest_ad_events request
#
# # The returned object is of type Google::Ads::DataManager::V1::IngestAdEventsResponse.
# p result
#
def ingest_ad_events request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::DataManager::V1::IngestAdEventsRequest

# Converts hash and nil to an options object
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

# Customize the options with defaults
call_metadata = @config.rpcs.ingest_ad_events.metadata.to_h

# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Ads::DataManager::V1::VERSION,
transports_version_send: [:rest]

call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

options.apply_defaults timeout: @config.rpcs.ingest_ad_events.timeout,
metadata: call_metadata,
retry_policy: @config.rpcs.ingest_ad_events.retry_policy

options.apply_defaults timeout: @config.timeout,
metadata: @config.metadata,
retry_policy: @config.retry_policy

@ingestion_service_stub.ingest_ad_events request, options do |result, operation|
yield result, operation if block_given?
end
rescue ::Gapic::Rest::Error => e
raise ::Google::Cloud::Error.from_error(e)
end

##
# Gets the status of a request given request id.
#
Expand Down Expand Up @@ -721,6 +808,11 @@ class Rpcs
#
attr_reader :ingest_events
##
# RPC-specific configuration for `ingest_ad_events`
# @return [::Gapic::Config::Method]
#
attr_reader :ingest_ad_events
##
# RPC-specific configuration for `retrieve_request_status`
# @return [::Gapic::Config::Method]
#
Expand All @@ -734,6 +826,8 @@ def initialize parent_rpcs = nil
@remove_audience_members = ::Gapic::Config::Method.new remove_audience_members_config
ingest_events_config = parent_rpcs.ingest_events if parent_rpcs.respond_to? :ingest_events
@ingest_events = ::Gapic::Config::Method.new ingest_events_config
ingest_ad_events_config = parent_rpcs.ingest_ad_events if parent_rpcs.respond_to? :ingest_ad_events
@ingest_ad_events = ::Gapic::Config::Method.new ingest_ad_events_config
retrieve_request_status_config = parent_rpcs.retrieve_request_status if parent_rpcs.respond_to? :retrieve_request_status
@retrieve_request_status = ::Gapic::Config::Method.new retrieve_request_status_config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,46 @@ def ingest_events request_pb, options = nil
end
end

##
# Baseline implementation for the ingest_ad_events REST call
#
# @param request_pb [::Google::Ads::DataManager::V1::IngestAdEventsRequest]
# A request object representing the call parameters. Required.
# @param options [::Gapic::CallOptions]
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
#
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Google::Ads::DataManager::V1::IngestAdEventsResponse]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Google::Ads::DataManager::V1::IngestAdEventsResponse]
# A result object deserialized from the server's reply
def ingest_ad_events request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?

verb, uri, query_string_params, body = ServiceStub.transcode_ingest_ad_events_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end

response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
method_name: "ingest_ad_events",
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Ads::DataManager::V1::IngestAdEventsResponse.decode_json response.body, ignore_unknown_fields: true
catch :response do
yield result, operation if block_given?
result
end
end

##
# Baseline implementation for the retrieve_request_status REST call
#
Expand Down Expand Up @@ -293,6 +333,26 @@ def self.transcode_ingest_events_request request_pb
transcoder.transcode request_pb
end

##
# @private
#
# GRPC transcoding helper method for the ingest_ad_events REST call
#
# @param request_pb [::Google::Ads::DataManager::V1::IngestAdEventsRequest]
# A request object representing the call parameters. Required.
# @return [Array(String, [String, nil], Hash{String => String})]
# Uri, Body, Query string parameters
def self.transcode_ingest_ad_events_request request_pb
transcoder = Gapic::Rest::GrpcTranscoder.new
.with_bindings(
uri_method: :post,
uri_template: "/v1/adEvents:ingest",
body: "*",
matches: []
)
transcoder.transcode request_pb
end

##
# @private
#
Expand Down
Loading
Loading