Skip to content
Merged
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
360 changes: 360 additions & 0 deletions google-ads-data_manager/lib/google/ads/data_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,366 @@ def self.ingestion_service_available? version: :v1, transport: :grpc
rescue ::LoadError
false
end

##
# Create a new client object for MarketingDataInsightsService.
#
# By default, this returns an instance of
# [Google::Ads::DataManager::V1::MarketingDataInsightsService::Client](https://rubydoc.info/gems/google-ads-data_manager-v1/Google/Ads/DataManager/V1/MarketingDataInsightsService/Client)
# for a gRPC client for version V1 of the API.
# However, you can specify a different API version by passing it in the
# `version` parameter. If the MarketingDataInsightsService service is
# supported by that API version, and the corresponding gem is available, the
# appropriate versioned client will be returned.
# You can also specify a different transport by passing `:rest` or `:grpc` in
# the `transport` parameter.
#
# Raises an exception if the currently installed versioned client gem for the
# given API version does not support the given transport of the MarketingDataInsightsService service.
# You can determine whether the method will succeed by calling
# {Google::Ads::DataManager.marketing_data_insights_service_available?}.
#
# ## About MarketingDataInsightsService
#
# Service to return insights on marketing data.
#
# This feature is only available to data partners.
#
# @param version [::String, ::Symbol] The API version to connect to. Optional.
# Defaults to `:v1`.
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
# @return [::Object] A client object for the specified version.
#
def self.marketing_data_insights_service version: :v1, transport: :grpc, &block
require "google/ads/data_manager/#{version.to_s.downcase}"

package_name = Google::Ads::DataManager
.constants
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
.first
service_module = Google::Ads::DataManager.const_get(package_name).const_get(:MarketingDataInsightsService)
service_module = service_module.const_get(:Rest) if transport == :rest
service_module.const_get(:Client).new(&block)
end

##
# Determines whether the MarketingDataInsightsService service is supported by the current client.
# If true, you can retrieve a client object by calling {Google::Ads::DataManager.marketing_data_insights_service}.
# If false, that method will raise an exception. This could happen if the given
# API version does not exist or does not support the MarketingDataInsightsService service,
# or if the versioned client gem needs an update to support the MarketingDataInsightsService service.
#
# @param version [::String, ::Symbol] The API version to connect to. Optional.
# Defaults to `:v1`.
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
# @return [boolean] Whether the service is available.
#
def self.marketing_data_insights_service_available? version: :v1, transport: :grpc
require "google/ads/data_manager/#{version.to_s.downcase}"
package_name = Google::Ads::DataManager
.constants
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
.first
return false unless package_name
service_module = Google::Ads::DataManager.const_get package_name
return false unless service_module.const_defined? :MarketingDataInsightsService
service_module = service_module.const_get :MarketingDataInsightsService
if transport == :rest
return false unless service_module.const_defined? :Rest
service_module = service_module.const_get :Rest
end
service_module.const_defined? :Client
rescue ::LoadError
false
end

##
# Create a new client object for PartnerLinkService.
#
# By default, this returns an instance of
# [Google::Ads::DataManager::V1::PartnerLinkService::Client](https://rubydoc.info/gems/google-ads-data_manager-v1/Google/Ads/DataManager/V1/PartnerLinkService/Client)
# for a gRPC client for version V1 of the API.
# However, you can specify a different API version by passing it in the
# `version` parameter. If the PartnerLinkService service is
# supported by that API version, and the corresponding gem is available, the
# appropriate versioned client will be returned.
# You can also specify a different transport by passing `:rest` or `:grpc` in
# the `transport` parameter.
#
# Raises an exception if the currently installed versioned client gem for the
# given API version does not support the given transport of the PartnerLinkService service.
# You can determine whether the method will succeed by calling
# {Google::Ads::DataManager.partner_link_service_available?}.
#
# ## About PartnerLinkService
#
# Service for managing partner links.
#
# @param version [::String, ::Symbol] The API version to connect to. Optional.
# Defaults to `:v1`.
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
# @return [::Object] A client object for the specified version.
#
def self.partner_link_service version: :v1, transport: :grpc, &block
require "google/ads/data_manager/#{version.to_s.downcase}"

package_name = Google::Ads::DataManager
.constants
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
.first
service_module = Google::Ads::DataManager.const_get(package_name).const_get(:PartnerLinkService)
service_module = service_module.const_get(:Rest) if transport == :rest
service_module.const_get(:Client).new(&block)
end

##
# Determines whether the PartnerLinkService service is supported by the current client.
# If true, you can retrieve a client object by calling {Google::Ads::DataManager.partner_link_service}.
# If false, that method will raise an exception. This could happen if the given
# API version does not exist or does not support the PartnerLinkService service,
# or if the versioned client gem needs an update to support the PartnerLinkService service.
#
# @param version [::String, ::Symbol] The API version to connect to. Optional.
# Defaults to `:v1`.
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
# @return [boolean] Whether the service is available.
#
def self.partner_link_service_available? version: :v1, transport: :grpc
require "google/ads/data_manager/#{version.to_s.downcase}"
package_name = Google::Ads::DataManager
.constants
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
.first
return false unless package_name
service_module = Google::Ads::DataManager.const_get package_name
return false unless service_module.const_defined? :PartnerLinkService
service_module = service_module.const_get :PartnerLinkService
if transport == :rest
return false unless service_module.const_defined? :Rest
service_module = service_module.const_get :Rest
end
service_module.const_defined? :Client
rescue ::LoadError
false
end

##
# Create a new client object for UserListDirectLicenseService.
#
# By default, this returns an instance of
# [Google::Ads::DataManager::V1::UserListDirectLicenseService::Client](https://rubydoc.info/gems/google-ads-data_manager-v1/Google/Ads/DataManager/V1/UserListDirectLicenseService/Client)
# for a gRPC client for version V1 of the API.
# However, you can specify a different API version by passing it in the
# `version` parameter. If the UserListDirectLicenseService service is
# supported by that API version, and the corresponding gem is available, the
# appropriate versioned client will be returned.
# You can also specify a different transport by passing `:rest` or `:grpc` in
# the `transport` parameter.
#
# Raises an exception if the currently installed versioned client gem for the
# given API version does not support the given transport of the UserListDirectLicenseService service.
# You can determine whether the method will succeed by calling
# {Google::Ads::DataManager.user_list_direct_license_service_available?}.
#
# ## About UserListDirectLicenseService
#
# Service for managing user list direct licenses. Delete is not a supported
# operation for UserListDirectLicenses. Callers should update the
# license status to DISABLED to instead to deactivate a license.
#
# This feature is only available to data partners.
#
# @param version [::String, ::Symbol] The API version to connect to. Optional.
# Defaults to `:v1`.
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
# @return [::Object] A client object for the specified version.
#
def self.user_list_direct_license_service version: :v1, transport: :grpc, &block
require "google/ads/data_manager/#{version.to_s.downcase}"

package_name = Google::Ads::DataManager
.constants
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
.first
service_module = Google::Ads::DataManager.const_get(package_name).const_get(:UserListDirectLicenseService)
service_module = service_module.const_get(:Rest) if transport == :rest
service_module.const_get(:Client).new(&block)
end

##
# Determines whether the UserListDirectLicenseService service is supported by the current client.
# If true, you can retrieve a client object by calling {Google::Ads::DataManager.user_list_direct_license_service}.
# If false, that method will raise an exception. This could happen if the given
# API version does not exist or does not support the UserListDirectLicenseService service,
# or if the versioned client gem needs an update to support the UserListDirectLicenseService service.
#
# @param version [::String, ::Symbol] The API version to connect to. Optional.
# Defaults to `:v1`.
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
# @return [boolean] Whether the service is available.
#
def self.user_list_direct_license_service_available? version: :v1, transport: :grpc
require "google/ads/data_manager/#{version.to_s.downcase}"
package_name = Google::Ads::DataManager
.constants
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
.first
return false unless package_name
service_module = Google::Ads::DataManager.const_get package_name
return false unless service_module.const_defined? :UserListDirectLicenseService
service_module = service_module.const_get :UserListDirectLicenseService
if transport == :rest
return false unless service_module.const_defined? :Rest
service_module = service_module.const_get :Rest
end
service_module.const_defined? :Client
rescue ::LoadError
false
end

##
# Create a new client object for UserListGlobalLicenseService.
#
# By default, this returns an instance of
# [Google::Ads::DataManager::V1::UserListGlobalLicenseService::Client](https://rubydoc.info/gems/google-ads-data_manager-v1/Google/Ads/DataManager/V1/UserListGlobalLicenseService/Client)
# for a gRPC client for version V1 of the API.
# However, you can specify a different API version by passing it in the
# `version` parameter. If the UserListGlobalLicenseService service is
# supported by that API version, and the corresponding gem is available, the
# appropriate versioned client will be returned.
# You can also specify a different transport by passing `:rest` or `:grpc` in
# the `transport` parameter.
#
# Raises an exception if the currently installed versioned client gem for the
# given API version does not support the given transport of the UserListGlobalLicenseService service.
# You can determine whether the method will succeed by calling
# {Google::Ads::DataManager.user_list_global_license_service_available?}.
#
# ## About UserListGlobalLicenseService
#
# Service for managing user list global licenses. Delete is not a supported
# operation for UserListGlobalLicenses. Callers should update the
# license status to DISABLED to instead to deactivate a license.
#
# This feature is only available to data partners.
#
# @param version [::String, ::Symbol] The API version to connect to. Optional.
# Defaults to `:v1`.
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
# @return [::Object] A client object for the specified version.
#
def self.user_list_global_license_service version: :v1, transport: :grpc, &block
require "google/ads/data_manager/#{version.to_s.downcase}"

package_name = Google::Ads::DataManager
.constants
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
.first
service_module = Google::Ads::DataManager.const_get(package_name).const_get(:UserListGlobalLicenseService)
service_module = service_module.const_get(:Rest) if transport == :rest
service_module.const_get(:Client).new(&block)
end

##
# Determines whether the UserListGlobalLicenseService service is supported by the current client.
# If true, you can retrieve a client object by calling {Google::Ads::DataManager.user_list_global_license_service}.
# If false, that method will raise an exception. This could happen if the given
# API version does not exist or does not support the UserListGlobalLicenseService service,
# or if the versioned client gem needs an update to support the UserListGlobalLicenseService service.
#
# @param version [::String, ::Symbol] The API version to connect to. Optional.
# Defaults to `:v1`.
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
# @return [boolean] Whether the service is available.
#
def self.user_list_global_license_service_available? version: :v1, transport: :grpc
require "google/ads/data_manager/#{version.to_s.downcase}"
package_name = Google::Ads::DataManager
.constants
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
.first
return false unless package_name
service_module = Google::Ads::DataManager.const_get package_name
return false unless service_module.const_defined? :UserListGlobalLicenseService
service_module = service_module.const_get :UserListGlobalLicenseService
if transport == :rest
return false unless service_module.const_defined? :Rest
service_module = service_module.const_get :Rest
end
service_module.const_defined? :Client
rescue ::LoadError
false
end

##
# Create a new client object for UserListService.
#
# By default, this returns an instance of
# [Google::Ads::DataManager::V1::UserListService::Client](https://rubydoc.info/gems/google-ads-data_manager-v1/Google/Ads/DataManager/V1/UserListService/Client)
# for a gRPC client for version V1 of the API.
# However, you can specify a different API version by passing it in the
# `version` parameter. If the UserListService service is
# supported by that API version, and the corresponding gem is available, the
# appropriate versioned client will be returned.
# You can also specify a different transport by passing `:rest` or `:grpc` in
# the `transport` parameter.
#
# Raises an exception if the currently installed versioned client gem for the
# given API version does not support the given transport of the UserListService service.
# You can determine whether the method will succeed by calling
# {Google::Ads::DataManager.user_list_service_available?}.
#
# ## About UserListService
#
# Service for managing UserList resources.
#
# @param version [::String, ::Symbol] The API version to connect to. Optional.
# Defaults to `:v1`.
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
# @return [::Object] A client object for the specified version.
#
def self.user_list_service version: :v1, transport: :grpc, &block
require "google/ads/data_manager/#{version.to_s.downcase}"

package_name = Google::Ads::DataManager
.constants
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
.first
service_module = Google::Ads::DataManager.const_get(package_name).const_get(:UserListService)
service_module = service_module.const_get(:Rest) if transport == :rest
service_module.const_get(:Client).new(&block)
end

##
# Determines whether the UserListService service is supported by the current client.
# If true, you can retrieve a client object by calling {Google::Ads::DataManager.user_list_service}.
# If false, that method will raise an exception. This could happen if the given
# API version does not exist or does not support the UserListService service,
# or if the versioned client gem needs an update to support the UserListService service.
#
# @param version [::String, ::Symbol] The API version to connect to. Optional.
# Defaults to `:v1`.
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
# @return [boolean] Whether the service is available.
#
def self.user_list_service_available? version: :v1, transport: :grpc
require "google/ads/data_manager/#{version.to_s.downcase}"
package_name = Google::Ads::DataManager
.constants
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
.first
return false unless package_name
service_module = Google::Ads::DataManager.const_get package_name
return false unless service_module.const_defined? :UserListService
service_module = service_module.const_get :UserListService
if transport == :rest
return false unless service_module.const_defined? :Rest
service_module = service_module.const_get :Rest
end
service_module.const_defined? :Client
rescue ::LoadError
false
end
end
end
end
Expand Down
Loading
Loading