google-ads-ad_manager 0.a → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3b444f3c52144f931a55dc1361079071aaf90a28598d32eb6f6ee9c4904a33b
4
- data.tar.gz: fe22247a9403988a0fc2e3a8ead8d0c0bf6f738066b290b23eb1bfb69045064e
3
+ metadata.gz: b0b1dccce45b39200e41411acce1a5fb57b58bf90b089ac05924463613406c97
4
+ data.tar.gz: 5eca0fbf13372c4d14cdb324c095268c1458590fe0ffa1e9f21d08a947827ede
5
5
  SHA512:
6
- metadata.gz: 2367fc2658061645983af0dee35493d0cea26ba3be900cafcf5e31bc1eff80d3c944cf834b20b1b19e3b887cb2156ab372be6df8ad879c7122c990dd1f0bd66f
7
- data.tar.gz: bc702572ba869add275aa7e978fe4a50e2c431a3cf46e254e3af56c9409be91b701ac7d96cadd5e52fbc2c3cacae194712fb0b3aa5df66de7730fb666a9594ce
6
+ metadata.gz: ac03663aceb55e2006fc8abd6747d8f8459d88fe139c95a12007ad3f2818af8c361e923e8cce9c57a7cc90efb98af2cd818eec8d6854be6c2abd6a32d5a773d2
7
+ data.tar.gz: 97b49a7fda20babe05534257911c76d5fe145b42d69c648861816a738974bb9e6f2eebb7b51ddf9c50d1ffaa849b3cac38f20e237280a27b206f1cac9a585ed3
data/.yardopts ADDED
@@ -0,0 +1,11 @@
1
+ --no-private
2
+ --title="Google Ad Manager API"
3
+ --exclude _pb\.rb$
4
+ --markup markdown
5
+ --markup-provider redcarpet
6
+
7
+ ./lib/**/*.rb
8
+ -
9
+ README.md
10
+ AUTHENTICATION.md
11
+ LICENSE.md
data/AUTHENTICATION.md ADDED
@@ -0,0 +1,122 @@
1
+ # Authentication
2
+
3
+ The recommended way to authenticate to the google-ads-ad_manager library is to use
4
+ [Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials).
5
+ To review all of your authentication options, see [Credentials lookup](#credential-lookup).
6
+
7
+ ## Quickstart
8
+
9
+ The following example shows how to set up authentication for a local development
10
+ environment with your user credentials.
11
+
12
+ **NOTE:** This method is _not_ recommended for running in production. User credentials
13
+ should be used only during development.
14
+
15
+ 1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk).
16
+ 2. Set up a local ADC file with your user credentials:
17
+
18
+ ```sh
19
+ gcloud auth application-default login
20
+ ```
21
+
22
+ 3. Write code as if already authenticated.
23
+
24
+ For more information about setting up authentication for a local development environment, see
25
+ [Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev).
26
+
27
+ ## Credential Lookup
28
+
29
+ The google-ads-ad_manager library provides several mechanisms to configure your system.
30
+ Generally, using Application Default Credentials to facilitate automatic
31
+ credentials discovery is the easist method. But if you need to explicitly specify
32
+ credentials, there are several methods available to you.
33
+
34
+ Credentials are accepted in the following ways, in the following order or precedence:
35
+
36
+ 1. Credentials specified in method arguments
37
+ 2. Credentials specified in configuration
38
+ 3. Credentials pointed to or included in environment variables
39
+ 4. Credentials found in local ADC file
40
+ 5. Credentials returned by the metadata server for the attached service account (GCP)
41
+
42
+ ### Configuration
43
+
44
+ You can configure a path to a JSON credentials file, either for an individual client object or
45
+ globally, for all client objects. The JSON file can contain credentials created for
46
+ [workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
47
+ [workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
48
+ [service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
49
+
50
+ Note: Service account keys are a security risk if not managed correctly. You should
51
+ [choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
52
+ whenever possible.
53
+
54
+ To configure a credentials file for an individual client initialization:
55
+
56
+ ```ruby
57
+ require "google/ads/ad_manager"
58
+
59
+ client = Google::Ads::AdManager.ad_unit_service do |config|
60
+ config.credentials = "path/to/credentialfile.json"
61
+ end
62
+ ```
63
+
64
+ To configure a credentials file globally for all clients:
65
+
66
+ ```ruby
67
+ require "google/ads/ad_manager"
68
+
69
+ Google::Ads::AdManager.configure do |config|
70
+ config.credentials = "path/to/credentialfile.json"
71
+ end
72
+
73
+ client = Google::Ads::AdManager.ad_unit_service
74
+ ```
75
+
76
+ ### Environment Variables
77
+
78
+ You can also use an environment variable to provide a JSON credentials file.
79
+ The environment variable can contain a path to the credentials file or, for
80
+ environments such as Docker containers where writing files is not encouraged,
81
+ you can include the credentials file itself.
82
+
83
+ The JSON file can contain credentials created for
84
+ [workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
85
+ [workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
86
+ [service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
87
+
88
+ Note: Service account keys are a security risk if not managed correctly. You should
89
+ [choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
90
+ whenever possible.
91
+
92
+ The environment variables that google-ads-ad_manager
93
+ checks for credentials are:
94
+
95
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
96
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
97
+
98
+ ```ruby
99
+ require "google/ads/ad_manager"
100
+
101
+ ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
102
+
103
+ client = Google::Ads::AdManager.ad_unit_service
104
+ ```
105
+
106
+ ### Local ADC file
107
+
108
+ You can set up a local ADC file with your user credentials for authentication during
109
+ development. If credentials are not provided in code or in environment variables,
110
+ then the local ADC credentials are discovered.
111
+
112
+ Follow the steps in [Quickstart](#quickstart) to set up a local ADC file.
113
+
114
+ ### Google Cloud Platform environments
115
+
116
+ When running on Google Cloud Platform (GCP), including Google Compute Engine
117
+ (GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
118
+ Functions (GCF) and Cloud Run, credentials are retrieved from the attached
119
+ service account automatically. Code should be written as if already authenticated.
120
+
121
+ For more information, see
122
+ [Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa).
data/README.md CHANGED
@@ -1,8 +1,134 @@
1
- # Placeholder for Ruby gem google-ads-ad_manager
2
-
3
- This is a placeholder for the future Google-authored gem google-ads-ad_manager.
4
- This placeholder is being released on 2024-10-23 in order to reserve the name.
5
- The final gem should be available shortly after that date. If it has not been
6
- released in a timely manner, or if this placeholder interferes with your work,
7
- you can contact the Google Ruby team by opening an issue in the GitHub
8
- repository https://github.com/googleapis/google-cloud-ruby.
1
+ # Ruby Client for the Google Ad Manager API
2
+
3
+ Manage your Ad Manager inventory, run reports and more.
4
+
5
+ The Ad Manager API enables an app to integrate with Google Ad Manager. You can read Ad Manager data and run reports using the API.
6
+
7
+ Actual client classes for the various versions of this API are defined in
8
+ _versioned_ client gems, with names of the form `google-ads-ad_manager-v*`.
9
+ The gem `google-ads-ad_manager` is the main client library that brings the
10
+ verisoned gems in as dependencies, and provides high-level methods for
11
+ constructing clients. More information on versioned clients can be found below
12
+ in the section titled *Which client should I use?*.
13
+
14
+ View the [Client Library Documentation](https://rubydoc.info/gems/google-ads-ad_manager)
15
+ for this library, google-ads-ad_manager, to see the convenience methods for
16
+ constructing client objects. Reference documentation for the client objects
17
+ themselves can be found in the client library documentation for the versioned
18
+ client gems:
19
+ [google-ads-ad_manager-v1](https://rubydoc.info/gems/google-ads-ad_manager-v1).
20
+
21
+ See also the [Product Documentation](https://developers.google.com/ad-manager/api/beta)
22
+ for more usage information.
23
+
24
+ ## Quick Start
25
+
26
+ ```
27
+ $ gem install google-ads-ad_manager
28
+ ```
29
+
30
+ In order to use this library, you first need to go through the following steps:
31
+
32
+ 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
33
+ 1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
34
+ 1. [Enable the API.](https://console.cloud.google.com/apis/library/admanager.googleapis.com)
35
+ 1. {file:AUTHENTICATION.md Set up authentication.}
36
+
37
+ ## Debug Logging
38
+
39
+ This library comes with opt-in Debug Logging that can help you troubleshoot
40
+ your application's integration with the API. When logging is activated, key
41
+ events such as requests and responses, along with data payloads and metadata
42
+ such as headers and client configuration, are logged to the standard error
43
+ stream.
44
+
45
+ **WARNING:** Client Library Debug Logging includes your data payloads in
46
+ plaintext, which could include sensitive data such as PII for yourself or your
47
+ customers, private keys, or other security data that could be compromising if
48
+ leaked. Always practice good data hygiene with your application logs, and follow
49
+ the principle of least access. Google also recommends that Client Library Debug
50
+ Logging be enabled only temporarily during active debugging, and not used
51
+ permanently in production.
52
+
53
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
54
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
55
+ list of client library gem names. This will select the default logging behavior,
56
+ which writes logs to the standard error stream. On a local workstation, this may
57
+ result in logs appearing on the console. When running on a Google Cloud hosting
58
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
59
+ results in logs appearing alongside your application logs in the
60
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
61
+
62
+ Debug logging also requires that the versioned clients for this service be
63
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
64
+ working, try updating the versioned clients in your bundle or installed gems:
65
+ [google-ads-ad_manager-v1](https://rubydoc.info/gems/google-ads-ad_manager-v1).
66
+
67
+ ## Supported Ruby Versions
68
+
69
+ This library is supported on Ruby 3.0+.
70
+
71
+ Google provides official support for Ruby versions that are actively supported
72
+ by Ruby Core—that is, Ruby versions that are either in normal maintenance or
73
+ in security maintenance, and not end of life. Older versions of Ruby _may_
74
+ still work, but are unsupported and not recommended. See
75
+ https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
76
+ support schedule.
77
+
78
+ ## Which client should I use?
79
+
80
+ Most modern Ruby client libraries for Google APIs come in two flavors: the main
81
+ client library with a name such as `google-ads-ad_manager`,
82
+ and lower-level _versioned_ client libraries with names such as
83
+ `google-ads-ad_manager-v1`.
84
+ _In most cases, you should install the main client._
85
+
86
+ ### What's the difference between the main client and a versioned client?
87
+
88
+ A _versioned client_ provides a basic set of data types and client classes for
89
+ a _single version_ of a specific service. (That is, for a service with multiple
90
+ versions, there might be a separate versioned client for each service version.)
91
+ Most versioned clients are written and maintained by a code generator.
92
+
93
+ The _main client_ is designed to provide you with the _recommended_ client
94
+ interfaces for the service. There will be only one main client for any given
95
+ service, even a service with multiple versions. The main client includes
96
+ factory methods for constructing the client objects we recommend for most
97
+ users. In some cases, those will be classes provided by an underlying versioned
98
+ client; in other cases, they will be handwritten higher-level client objects
99
+ with additional capabilities, convenience methods, or best practices built in.
100
+ Generally, the main client will default to a recommended service version,
101
+ although in some cases you can override this if you need to talk to a specific
102
+ service version.
103
+
104
+ ### Why would I want to use the main client?
105
+
106
+ We recommend that most users install the main client gem for a service. You can
107
+ identify this gem as the one _without_ a version in its name, e.g.
108
+ `google-ads-ad_manager`.
109
+ The main client is recommended because it will embody the best practices for
110
+ accessing the service, and may also provide more convenient interfaces or
111
+ tighter integration into frameworks and third-party libraries. In addition, the
112
+ documentation and samples published by Google will generally demonstrate use of
113
+ the main client.
114
+
115
+ ### Why would I want to use a versioned client?
116
+
117
+ You can use a versioned client if you are content with a possibly lower-level
118
+ class interface, you explicitly want to avoid features provided by the main
119
+ client, or you want to access a specific service version not be covered by the
120
+ main client. You can identify versioned client gems because the service version
121
+ is part of the name, e.g. `google-ads-ad_manager-v1`.
122
+
123
+ ### What about the google-apis-<name> clients?
124
+
125
+ Client library gems with names that begin with `google-apis-` are based on an
126
+ older code generation technology. They talk to a REST/JSON backend (whereas
127
+ most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may
128
+ not offer the same performance, features, and ease of use provided by more
129
+ modern clients.
130
+
131
+ The `google-apis-` clients have wide coverage across Google services, so you
132
+ might need to use one if there is no modern client available for the service.
133
+ However, if a modern client is available, we generally recommend it over the
134
+ older `google-apis-` clients.
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright 2024 Google LLC
2
4
  #
3
5
  # Licensed under the Apache License, Version 2.0 (the "License");
4
6
  # you may not use this file except in compliance with the License.
5
7
  # You may obtain a copy of the License at
6
8
  #
7
- # http://www.apache.org/licenses/LICENSE-2.0
9
+ # https://www.apache.org/licenses/LICENSE-2.0
8
10
  #
9
11
  # Unless required by applicable law or agreed to in writing, software
10
12
  # distributed under the License is distributed on an "AS IS" BASIS,
@@ -12,10 +14,13 @@
12
14
  # See the License for the specific language governing permissions and
13
15
  # limitations under the License.
14
16
 
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
15
20
  module Google
16
21
  module Ads
17
22
  module AdManager
18
- VERSION = "0.a"
23
+ VERSION = "0.2.0"
19
24
  end
20
25
  end
21
26
  end
@@ -0,0 +1,853 @@
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 this file early so that the version constant gets defined before
20
+ # requiring "google/cloud". This is because google-cloud-core will load the
21
+ # entrypoint (gem name) file, which in turn re-requires this file (hence
22
+ # causing a require cycle) unless the version constant is already defined.
23
+ require "google/ads/ad_manager/version"
24
+
25
+ require "googleauth"
26
+
27
+ module Google
28
+ module Ads
29
+ module AdManager
30
+ ##
31
+ # Create a new client object for AdUnitService.
32
+ #
33
+ # By default, this returns an instance of
34
+ # [Google::Ads::AdManager::V1::AdUnitService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/AdUnitService/Rest/Client)
35
+ # for a REST client for version V1 of the API.
36
+ # However, you can specify a different API version by passing it in the
37
+ # `version` parameter. If the AdUnitService service is
38
+ # supported by that API version, and the corresponding gem is available, the
39
+ # appropriate versioned client will be returned.
40
+ #
41
+ # Raises an exception if the currently installed versioned client gem for the
42
+ # given API version does not support the AdUnitService service.
43
+ # You can determine whether the method will succeed by calling
44
+ # {Google::Ads::AdManager.ad_unit_service_available?}.
45
+ #
46
+ # ## About AdUnitService
47
+ #
48
+ # Provides methods for handling AdUnit objects.
49
+ #
50
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
51
+ # Defaults to `:v1`.
52
+ # @return [::Object] A client object for the specified version.
53
+ #
54
+ def self.ad_unit_service version: :v1, &block
55
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
56
+
57
+ package_name = Google::Ads::AdManager
58
+ .constants
59
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
60
+ .first
61
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:AdUnitService)
62
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
63
+ end
64
+
65
+ ##
66
+ # Determines whether the AdUnitService service is supported by the current client.
67
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.ad_unit_service}.
68
+ # If false, that method will raise an exception. This could happen if the given
69
+ # API version does not exist or does not support the AdUnitService service,
70
+ # or if the versioned client gem needs an update to support the AdUnitService service.
71
+ #
72
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
73
+ # Defaults to `:v1`.
74
+ # @return [boolean] Whether the service is available.
75
+ #
76
+ def self.ad_unit_service_available? version: :v1
77
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
78
+ package_name = Google::Ads::AdManager
79
+ .constants
80
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
81
+ .first
82
+ return false unless package_name
83
+ service_module = Google::Ads::AdManager.const_get package_name
84
+ return false unless service_module.const_defined? :AdUnitService
85
+ service_module = service_module.const_get :AdUnitService
86
+ return false unless service_module.const_defined? :Rest
87
+ service_module = service_module.const_get :Rest
88
+ service_module.const_defined? :Client
89
+ rescue ::LoadError
90
+ false
91
+ end
92
+
93
+ ##
94
+ # Create a new client object for CompanyService.
95
+ #
96
+ # By default, this returns an instance of
97
+ # [Google::Ads::AdManager::V1::CompanyService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/CompanyService/Rest/Client)
98
+ # for a REST client for version V1 of the API.
99
+ # However, you can specify a different API version by passing it in the
100
+ # `version` parameter. If the CompanyService service is
101
+ # supported by that API version, and the corresponding gem is available, the
102
+ # appropriate versioned client will be returned.
103
+ #
104
+ # Raises an exception if the currently installed versioned client gem for the
105
+ # given API version does not support the CompanyService service.
106
+ # You can determine whether the method will succeed by calling
107
+ # {Google::Ads::AdManager.company_service_available?}.
108
+ #
109
+ # ## About CompanyService
110
+ #
111
+ # Provides methods for handling `Company` objects.
112
+ #
113
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
114
+ # Defaults to `:v1`.
115
+ # @return [::Object] A client object for the specified version.
116
+ #
117
+ def self.company_service version: :v1, &block
118
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
119
+
120
+ package_name = Google::Ads::AdManager
121
+ .constants
122
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
123
+ .first
124
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:CompanyService)
125
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
126
+ end
127
+
128
+ ##
129
+ # Determines whether the CompanyService service is supported by the current client.
130
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.company_service}.
131
+ # If false, that method will raise an exception. This could happen if the given
132
+ # API version does not exist or does not support the CompanyService service,
133
+ # or if the versioned client gem needs an update to support the CompanyService service.
134
+ #
135
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
136
+ # Defaults to `:v1`.
137
+ # @return [boolean] Whether the service is available.
138
+ #
139
+ def self.company_service_available? version: :v1
140
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
141
+ package_name = Google::Ads::AdManager
142
+ .constants
143
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
144
+ .first
145
+ return false unless package_name
146
+ service_module = Google::Ads::AdManager.const_get package_name
147
+ return false unless service_module.const_defined? :CompanyService
148
+ service_module = service_module.const_get :CompanyService
149
+ return false unless service_module.const_defined? :Rest
150
+ service_module = service_module.const_get :Rest
151
+ service_module.const_defined? :Client
152
+ rescue ::LoadError
153
+ false
154
+ end
155
+
156
+ ##
157
+ # Create a new client object for CustomFieldService.
158
+ #
159
+ # By default, this returns an instance of
160
+ # [Google::Ads::AdManager::V1::CustomFieldService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/CustomFieldService/Rest/Client)
161
+ # for a REST client for version V1 of the API.
162
+ # However, you can specify a different API version by passing it in the
163
+ # `version` parameter. If the CustomFieldService service is
164
+ # supported by that API version, and the corresponding gem is available, the
165
+ # appropriate versioned client will be returned.
166
+ #
167
+ # Raises an exception if the currently installed versioned client gem for the
168
+ # given API version does not support the CustomFieldService service.
169
+ # You can determine whether the method will succeed by calling
170
+ # {Google::Ads::AdManager.custom_field_service_available?}.
171
+ #
172
+ # ## About CustomFieldService
173
+ #
174
+ # Provides methods for handling `CustomField` objects.
175
+ #
176
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
177
+ # Defaults to `:v1`.
178
+ # @return [::Object] A client object for the specified version.
179
+ #
180
+ def self.custom_field_service version: :v1, &block
181
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
182
+
183
+ package_name = Google::Ads::AdManager
184
+ .constants
185
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
186
+ .first
187
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:CustomFieldService)
188
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
189
+ end
190
+
191
+ ##
192
+ # Determines whether the CustomFieldService service is supported by the current client.
193
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.custom_field_service}.
194
+ # If false, that method will raise an exception. This could happen if the given
195
+ # API version does not exist or does not support the CustomFieldService service,
196
+ # or if the versioned client gem needs an update to support the CustomFieldService service.
197
+ #
198
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
199
+ # Defaults to `:v1`.
200
+ # @return [boolean] Whether the service is available.
201
+ #
202
+ def self.custom_field_service_available? version: :v1
203
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
204
+ package_name = Google::Ads::AdManager
205
+ .constants
206
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
207
+ .first
208
+ return false unless package_name
209
+ service_module = Google::Ads::AdManager.const_get package_name
210
+ return false unless service_module.const_defined? :CustomFieldService
211
+ service_module = service_module.const_get :CustomFieldService
212
+ return false unless service_module.const_defined? :Rest
213
+ service_module = service_module.const_get :Rest
214
+ service_module.const_defined? :Client
215
+ rescue ::LoadError
216
+ false
217
+ end
218
+
219
+ ##
220
+ # Create a new client object for CustomTargetingKeyService.
221
+ #
222
+ # By default, this returns an instance of
223
+ # [Google::Ads::AdManager::V1::CustomTargetingKeyService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/CustomTargetingKeyService/Rest/Client)
224
+ # for a REST client for version V1 of the API.
225
+ # However, you can specify a different API version by passing it in the
226
+ # `version` parameter. If the CustomTargetingKeyService service is
227
+ # supported by that API version, and the corresponding gem is available, the
228
+ # appropriate versioned client will be returned.
229
+ #
230
+ # Raises an exception if the currently installed versioned client gem for the
231
+ # given API version does not support the CustomTargetingKeyService service.
232
+ # You can determine whether the method will succeed by calling
233
+ # {Google::Ads::AdManager.custom_targeting_key_service_available?}.
234
+ #
235
+ # ## About CustomTargetingKeyService
236
+ #
237
+ # Provides methods for handling `CustomTargetingKey` objects.
238
+ #
239
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
240
+ # Defaults to `:v1`.
241
+ # @return [::Object] A client object for the specified version.
242
+ #
243
+ def self.custom_targeting_key_service version: :v1, &block
244
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
245
+
246
+ package_name = Google::Ads::AdManager
247
+ .constants
248
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
249
+ .first
250
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:CustomTargetingKeyService)
251
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
252
+ end
253
+
254
+ ##
255
+ # Determines whether the CustomTargetingKeyService service is supported by the current client.
256
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.custom_targeting_key_service}.
257
+ # If false, that method will raise an exception. This could happen if the given
258
+ # API version does not exist or does not support the CustomTargetingKeyService service,
259
+ # or if the versioned client gem needs an update to support the CustomTargetingKeyService service.
260
+ #
261
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
262
+ # Defaults to `:v1`.
263
+ # @return [boolean] Whether the service is available.
264
+ #
265
+ def self.custom_targeting_key_service_available? version: :v1
266
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
267
+ package_name = Google::Ads::AdManager
268
+ .constants
269
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
270
+ .first
271
+ return false unless package_name
272
+ service_module = Google::Ads::AdManager.const_get package_name
273
+ return false unless service_module.const_defined? :CustomTargetingKeyService
274
+ service_module = service_module.const_get :CustomTargetingKeyService
275
+ return false unless service_module.const_defined? :Rest
276
+ service_module = service_module.const_get :Rest
277
+ service_module.const_defined? :Client
278
+ rescue ::LoadError
279
+ false
280
+ end
281
+
282
+ ##
283
+ # Create a new client object for CustomTargetingValueService.
284
+ #
285
+ # By default, this returns an instance of
286
+ # [Google::Ads::AdManager::V1::CustomTargetingValueService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/CustomTargetingValueService/Rest/Client)
287
+ # for a REST client for version V1 of the API.
288
+ # However, you can specify a different API version by passing it in the
289
+ # `version` parameter. If the CustomTargetingValueService service is
290
+ # supported by that API version, and the corresponding gem is available, the
291
+ # appropriate versioned client will be returned.
292
+ #
293
+ # Raises an exception if the currently installed versioned client gem for the
294
+ # given API version does not support the CustomTargetingValueService service.
295
+ # You can determine whether the method will succeed by calling
296
+ # {Google::Ads::AdManager.custom_targeting_value_service_available?}.
297
+ #
298
+ # ## About CustomTargetingValueService
299
+ #
300
+ # Provides methods for handling `CustomTargetingValue` objects.
301
+ #
302
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
303
+ # Defaults to `:v1`.
304
+ # @return [::Object] A client object for the specified version.
305
+ #
306
+ def self.custom_targeting_value_service version: :v1, &block
307
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
308
+
309
+ package_name = Google::Ads::AdManager
310
+ .constants
311
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
312
+ .first
313
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:CustomTargetingValueService)
314
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
315
+ end
316
+
317
+ ##
318
+ # Determines whether the CustomTargetingValueService service is supported by the current client.
319
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.custom_targeting_value_service}.
320
+ # If false, that method will raise an exception. This could happen if the given
321
+ # API version does not exist or does not support the CustomTargetingValueService service,
322
+ # or if the versioned client gem needs an update to support the CustomTargetingValueService service.
323
+ #
324
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
325
+ # Defaults to `:v1`.
326
+ # @return [boolean] Whether the service is available.
327
+ #
328
+ def self.custom_targeting_value_service_available? version: :v1
329
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
330
+ package_name = Google::Ads::AdManager
331
+ .constants
332
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
333
+ .first
334
+ return false unless package_name
335
+ service_module = Google::Ads::AdManager.const_get package_name
336
+ return false unless service_module.const_defined? :CustomTargetingValueService
337
+ service_module = service_module.const_get :CustomTargetingValueService
338
+ return false unless service_module.const_defined? :Rest
339
+ service_module = service_module.const_get :Rest
340
+ service_module.const_defined? :Client
341
+ rescue ::LoadError
342
+ false
343
+ end
344
+
345
+ ##
346
+ # Create a new client object for EntitySignalsMappingService.
347
+ #
348
+ # By default, this returns an instance of
349
+ # [Google::Ads::AdManager::V1::EntitySignalsMappingService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/EntitySignalsMappingService/Rest/Client)
350
+ # for a REST client for version V1 of the API.
351
+ # However, you can specify a different API version by passing it in the
352
+ # `version` parameter. If the EntitySignalsMappingService service is
353
+ # supported by that API version, and the corresponding gem is available, the
354
+ # appropriate versioned client will be returned.
355
+ #
356
+ # Raises an exception if the currently installed versioned client gem for the
357
+ # given API version does not support the EntitySignalsMappingService service.
358
+ # You can determine whether the method will succeed by calling
359
+ # {Google::Ads::AdManager.entity_signals_mapping_service_available?}.
360
+ #
361
+ # ## About EntitySignalsMappingService
362
+ #
363
+ # Provides methods for handling `EntitySignalsMapping` objects.
364
+ #
365
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
366
+ # Defaults to `:v1`.
367
+ # @return [::Object] A client object for the specified version.
368
+ #
369
+ def self.entity_signals_mapping_service version: :v1, &block
370
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
371
+
372
+ package_name = Google::Ads::AdManager
373
+ .constants
374
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
375
+ .first
376
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:EntitySignalsMappingService)
377
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
378
+ end
379
+
380
+ ##
381
+ # Determines whether the EntitySignalsMappingService service is supported by the current client.
382
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.entity_signals_mapping_service}.
383
+ # If false, that method will raise an exception. This could happen if the given
384
+ # API version does not exist or does not support the EntitySignalsMappingService service,
385
+ # or if the versioned client gem needs an update to support the EntitySignalsMappingService service.
386
+ #
387
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
388
+ # Defaults to `:v1`.
389
+ # @return [boolean] Whether the service is available.
390
+ #
391
+ def self.entity_signals_mapping_service_available? version: :v1
392
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
393
+ package_name = Google::Ads::AdManager
394
+ .constants
395
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
396
+ .first
397
+ return false unless package_name
398
+ service_module = Google::Ads::AdManager.const_get package_name
399
+ return false unless service_module.const_defined? :EntitySignalsMappingService
400
+ service_module = service_module.const_get :EntitySignalsMappingService
401
+ return false unless service_module.const_defined? :Rest
402
+ service_module = service_module.const_get :Rest
403
+ service_module.const_defined? :Client
404
+ rescue ::LoadError
405
+ false
406
+ end
407
+
408
+ ##
409
+ # Create a new client object for NetworkService.
410
+ #
411
+ # By default, this returns an instance of
412
+ # [Google::Ads::AdManager::V1::NetworkService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/NetworkService/Rest/Client)
413
+ # for a REST client for version V1 of the API.
414
+ # However, you can specify a different API version by passing it in the
415
+ # `version` parameter. If the NetworkService service is
416
+ # supported by that API version, and the corresponding gem is available, the
417
+ # appropriate versioned client will be returned.
418
+ #
419
+ # Raises an exception if the currently installed versioned client gem for the
420
+ # given API version does not support the NetworkService service.
421
+ # You can determine whether the method will succeed by calling
422
+ # {Google::Ads::AdManager.network_service_available?}.
423
+ #
424
+ # ## About NetworkService
425
+ #
426
+ # Provides methods for handling Network objects.
427
+ #
428
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
429
+ # Defaults to `:v1`.
430
+ # @return [::Object] A client object for the specified version.
431
+ #
432
+ def self.network_service version: :v1, &block
433
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
434
+
435
+ package_name = Google::Ads::AdManager
436
+ .constants
437
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
438
+ .first
439
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:NetworkService)
440
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
441
+ end
442
+
443
+ ##
444
+ # Determines whether the NetworkService service is supported by the current client.
445
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.network_service}.
446
+ # If false, that method will raise an exception. This could happen if the given
447
+ # API version does not exist or does not support the NetworkService service,
448
+ # or if the versioned client gem needs an update to support the NetworkService service.
449
+ #
450
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
451
+ # Defaults to `:v1`.
452
+ # @return [boolean] Whether the service is available.
453
+ #
454
+ def self.network_service_available? version: :v1
455
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
456
+ package_name = Google::Ads::AdManager
457
+ .constants
458
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
459
+ .first
460
+ return false unless package_name
461
+ service_module = Google::Ads::AdManager.const_get package_name
462
+ return false unless service_module.const_defined? :NetworkService
463
+ service_module = service_module.const_get :NetworkService
464
+ return false unless service_module.const_defined? :Rest
465
+ service_module = service_module.const_get :Rest
466
+ service_module.const_defined? :Client
467
+ rescue ::LoadError
468
+ false
469
+ end
470
+
471
+ ##
472
+ # Create a new client object for OrderService.
473
+ #
474
+ # By default, this returns an instance of
475
+ # [Google::Ads::AdManager::V1::OrderService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/OrderService/Rest/Client)
476
+ # for a REST client for version V1 of the API.
477
+ # However, you can specify a different API version by passing it in the
478
+ # `version` parameter. If the OrderService service is
479
+ # supported by that API version, and the corresponding gem is available, the
480
+ # appropriate versioned client will be returned.
481
+ #
482
+ # Raises an exception if the currently installed versioned client gem for the
483
+ # given API version does not support the OrderService service.
484
+ # You can determine whether the method will succeed by calling
485
+ # {Google::Ads::AdManager.order_service_available?}.
486
+ #
487
+ # ## About OrderService
488
+ #
489
+ # Provides methods for handling `Order` objects.
490
+ #
491
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
492
+ # Defaults to `:v1`.
493
+ # @return [::Object] A client object for the specified version.
494
+ #
495
+ def self.order_service version: :v1, &block
496
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
497
+
498
+ package_name = Google::Ads::AdManager
499
+ .constants
500
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
501
+ .first
502
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:OrderService)
503
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
504
+ end
505
+
506
+ ##
507
+ # Determines whether the OrderService service is supported by the current client.
508
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.order_service}.
509
+ # If false, that method will raise an exception. This could happen if the given
510
+ # API version does not exist or does not support the OrderService service,
511
+ # or if the versioned client gem needs an update to support the OrderService service.
512
+ #
513
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
514
+ # Defaults to `:v1`.
515
+ # @return [boolean] Whether the service is available.
516
+ #
517
+ def self.order_service_available? version: :v1
518
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
519
+ package_name = Google::Ads::AdManager
520
+ .constants
521
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
522
+ .first
523
+ return false unless package_name
524
+ service_module = Google::Ads::AdManager.const_get package_name
525
+ return false unless service_module.const_defined? :OrderService
526
+ service_module = service_module.const_get :OrderService
527
+ return false unless service_module.const_defined? :Rest
528
+ service_module = service_module.const_get :Rest
529
+ service_module.const_defined? :Client
530
+ rescue ::LoadError
531
+ false
532
+ end
533
+
534
+ ##
535
+ # Create a new client object for PlacementService.
536
+ #
537
+ # By default, this returns an instance of
538
+ # [Google::Ads::AdManager::V1::PlacementService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/PlacementService/Rest/Client)
539
+ # for a REST client for version V1 of the API.
540
+ # However, you can specify a different API version by passing it in the
541
+ # `version` parameter. If the PlacementService service is
542
+ # supported by that API version, and the corresponding gem is available, the
543
+ # appropriate versioned client will be returned.
544
+ #
545
+ # Raises an exception if the currently installed versioned client gem for the
546
+ # given API version does not support the PlacementService service.
547
+ # You can determine whether the method will succeed by calling
548
+ # {Google::Ads::AdManager.placement_service_available?}.
549
+ #
550
+ # ## About PlacementService
551
+ #
552
+ # Provides methods for handling `Placement` objects.
553
+ #
554
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
555
+ # Defaults to `:v1`.
556
+ # @return [::Object] A client object for the specified version.
557
+ #
558
+ def self.placement_service version: :v1, &block
559
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
560
+
561
+ package_name = Google::Ads::AdManager
562
+ .constants
563
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
564
+ .first
565
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:PlacementService)
566
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
567
+ end
568
+
569
+ ##
570
+ # Determines whether the PlacementService service is supported by the current client.
571
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.placement_service}.
572
+ # If false, that method will raise an exception. This could happen if the given
573
+ # API version does not exist or does not support the PlacementService service,
574
+ # or if the versioned client gem needs an update to support the PlacementService service.
575
+ #
576
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
577
+ # Defaults to `:v1`.
578
+ # @return [boolean] Whether the service is available.
579
+ #
580
+ def self.placement_service_available? version: :v1
581
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
582
+ package_name = Google::Ads::AdManager
583
+ .constants
584
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
585
+ .first
586
+ return false unless package_name
587
+ service_module = Google::Ads::AdManager.const_get package_name
588
+ return false unless service_module.const_defined? :PlacementService
589
+ service_module = service_module.const_get :PlacementService
590
+ return false unless service_module.const_defined? :Rest
591
+ service_module = service_module.const_get :Rest
592
+ service_module.const_defined? :Client
593
+ rescue ::LoadError
594
+ false
595
+ end
596
+
597
+ ##
598
+ # Create a new client object for ReportService.
599
+ #
600
+ # By default, this returns an instance of
601
+ # [Google::Ads::AdManager::V1::ReportService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/ReportService/Rest/Client)
602
+ # for a REST client for version V1 of the API.
603
+ # However, you can specify a different API version by passing it in the
604
+ # `version` parameter. If the ReportService service is
605
+ # supported by that API version, and the corresponding gem is available, the
606
+ # appropriate versioned client will be returned.
607
+ #
608
+ # Raises an exception if the currently installed versioned client gem for the
609
+ # given API version does not support the ReportService service.
610
+ # You can determine whether the method will succeed by calling
611
+ # {Google::Ads::AdManager.report_service_available?}.
612
+ #
613
+ # ## About ReportService
614
+ #
615
+ # Provides methods for interacting with reports.
616
+ #
617
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
618
+ # Defaults to `:v1`.
619
+ # @return [::Object] A client object for the specified version.
620
+ #
621
+ def self.report_service version: :v1, &block
622
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
623
+
624
+ package_name = Google::Ads::AdManager
625
+ .constants
626
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
627
+ .first
628
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:ReportService)
629
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
630
+ end
631
+
632
+ ##
633
+ # Determines whether the ReportService service is supported by the current client.
634
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.report_service}.
635
+ # If false, that method will raise an exception. This could happen if the given
636
+ # API version does not exist or does not support the ReportService service,
637
+ # or if the versioned client gem needs an update to support the ReportService service.
638
+ #
639
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
640
+ # Defaults to `:v1`.
641
+ # @return [boolean] Whether the service is available.
642
+ #
643
+ def self.report_service_available? version: :v1
644
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
645
+ package_name = Google::Ads::AdManager
646
+ .constants
647
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
648
+ .first
649
+ return false unless package_name
650
+ service_module = Google::Ads::AdManager.const_get package_name
651
+ return false unless service_module.const_defined? :ReportService
652
+ service_module = service_module.const_get :ReportService
653
+ return false unless service_module.const_defined? :Rest
654
+ service_module = service_module.const_get :Rest
655
+ service_module.const_defined? :Client
656
+ rescue ::LoadError
657
+ false
658
+ end
659
+
660
+ ##
661
+ # Create a new client object for RoleService.
662
+ #
663
+ # By default, this returns an instance of
664
+ # [Google::Ads::AdManager::V1::RoleService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/RoleService/Rest/Client)
665
+ # for a REST client for version V1 of the API.
666
+ # However, you can specify a different API version by passing it in the
667
+ # `version` parameter. If the RoleService service is
668
+ # supported by that API version, and the corresponding gem is available, the
669
+ # appropriate versioned client will be returned.
670
+ #
671
+ # Raises an exception if the currently installed versioned client gem for the
672
+ # given API version does not support the RoleService service.
673
+ # You can determine whether the method will succeed by calling
674
+ # {Google::Ads::AdManager.role_service_available?}.
675
+ #
676
+ # ## About RoleService
677
+ #
678
+ # Provides methods for handling `Role` objects.
679
+ #
680
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
681
+ # Defaults to `:v1`.
682
+ # @return [::Object] A client object for the specified version.
683
+ #
684
+ def self.role_service version: :v1, &block
685
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
686
+
687
+ package_name = Google::Ads::AdManager
688
+ .constants
689
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
690
+ .first
691
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:RoleService)
692
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
693
+ end
694
+
695
+ ##
696
+ # Determines whether the RoleService service is supported by the current client.
697
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.role_service}.
698
+ # If false, that method will raise an exception. This could happen if the given
699
+ # API version does not exist or does not support the RoleService service,
700
+ # or if the versioned client gem needs an update to support the RoleService service.
701
+ #
702
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
703
+ # Defaults to `:v1`.
704
+ # @return [boolean] Whether the service is available.
705
+ #
706
+ def self.role_service_available? version: :v1
707
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
708
+ package_name = Google::Ads::AdManager
709
+ .constants
710
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
711
+ .first
712
+ return false unless package_name
713
+ service_module = Google::Ads::AdManager.const_get package_name
714
+ return false unless service_module.const_defined? :RoleService
715
+ service_module = service_module.const_get :RoleService
716
+ return false unless service_module.const_defined? :Rest
717
+ service_module = service_module.const_get :Rest
718
+ service_module.const_defined? :Client
719
+ rescue ::LoadError
720
+ false
721
+ end
722
+
723
+ ##
724
+ # Create a new client object for TaxonomyCategoryService.
725
+ #
726
+ # By default, this returns an instance of
727
+ # [Google::Ads::AdManager::V1::TaxonomyCategoryService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/TaxonomyCategoryService/Rest/Client)
728
+ # for a REST client for version V1 of the API.
729
+ # However, you can specify a different API version by passing it in the
730
+ # `version` parameter. If the TaxonomyCategoryService service is
731
+ # supported by that API version, and the corresponding gem is available, the
732
+ # appropriate versioned client will be returned.
733
+ #
734
+ # Raises an exception if the currently installed versioned client gem for the
735
+ # given API version does not support the TaxonomyCategoryService service.
736
+ # You can determine whether the method will succeed by calling
737
+ # {Google::Ads::AdManager.taxonomy_category_service_available?}.
738
+ #
739
+ # ## About TaxonomyCategoryService
740
+ #
741
+ # Provides methods for handling `TaxonomyCategory` objects.
742
+ #
743
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
744
+ # Defaults to `:v1`.
745
+ # @return [::Object] A client object for the specified version.
746
+ #
747
+ def self.taxonomy_category_service version: :v1, &block
748
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
749
+
750
+ package_name = Google::Ads::AdManager
751
+ .constants
752
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
753
+ .first
754
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:TaxonomyCategoryService)
755
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
756
+ end
757
+
758
+ ##
759
+ # Determines whether the TaxonomyCategoryService service is supported by the current client.
760
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.taxonomy_category_service}.
761
+ # If false, that method will raise an exception. This could happen if the given
762
+ # API version does not exist or does not support the TaxonomyCategoryService service,
763
+ # or if the versioned client gem needs an update to support the TaxonomyCategoryService service.
764
+ #
765
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
766
+ # Defaults to `:v1`.
767
+ # @return [boolean] Whether the service is available.
768
+ #
769
+ def self.taxonomy_category_service_available? version: :v1
770
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
771
+ package_name = Google::Ads::AdManager
772
+ .constants
773
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
774
+ .first
775
+ return false unless package_name
776
+ service_module = Google::Ads::AdManager.const_get package_name
777
+ return false unless service_module.const_defined? :TaxonomyCategoryService
778
+ service_module = service_module.const_get :TaxonomyCategoryService
779
+ return false unless service_module.const_defined? :Rest
780
+ service_module = service_module.const_get :Rest
781
+ service_module.const_defined? :Client
782
+ rescue ::LoadError
783
+ false
784
+ end
785
+
786
+ ##
787
+ # Create a new client object for UserService.
788
+ #
789
+ # By default, this returns an instance of
790
+ # [Google::Ads::AdManager::V1::UserService::Rest::Client](https://rubydoc.info/gems/google-ads-ad_manager-v1/Google/Ads/AdManager/V1/UserService/Rest/Client)
791
+ # for a REST client for version V1 of the API.
792
+ # However, you can specify a different API version by passing it in the
793
+ # `version` parameter. If the UserService service is
794
+ # supported by that API version, and the corresponding gem is available, the
795
+ # appropriate versioned client will be returned.
796
+ #
797
+ # Raises an exception if the currently installed versioned client gem for the
798
+ # given API version does not support the UserService service.
799
+ # You can determine whether the method will succeed by calling
800
+ # {Google::Ads::AdManager.user_service_available?}.
801
+ #
802
+ # ## About UserService
803
+ #
804
+ # Provides methods for handling User objects.
805
+ #
806
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
807
+ # Defaults to `:v1`.
808
+ # @return [::Object] A client object for the specified version.
809
+ #
810
+ def self.user_service version: :v1, &block
811
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
812
+
813
+ package_name = Google::Ads::AdManager
814
+ .constants
815
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
816
+ .first
817
+ service_module = Google::Ads::AdManager.const_get(package_name).const_get(:UserService)
818
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
819
+ end
820
+
821
+ ##
822
+ # Determines whether the UserService service is supported by the current client.
823
+ # If true, you can retrieve a client object by calling {Google::Ads::AdManager.user_service}.
824
+ # If false, that method will raise an exception. This could happen if the given
825
+ # API version does not exist or does not support the UserService service,
826
+ # or if the versioned client gem needs an update to support the UserService service.
827
+ #
828
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
829
+ # Defaults to `:v1`.
830
+ # @return [boolean] Whether the service is available.
831
+ #
832
+ def self.user_service_available? version: :v1
833
+ require "google/ads/ad_manager/#{version.to_s.downcase}"
834
+ package_name = Google::Ads::AdManager
835
+ .constants
836
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
837
+ .first
838
+ return false unless package_name
839
+ service_module = Google::Ads::AdManager.const_get package_name
840
+ return false unless service_module.const_defined? :UserService
841
+ service_module = service_module.const_get :UserService
842
+ return false unless service_module.const_defined? :Rest
843
+ service_module = service_module.const_get :Rest
844
+ service_module.const_defined? :Client
845
+ rescue ::LoadError
846
+ false
847
+ end
848
+ end
849
+ end
850
+ end
851
+
852
+ helper_path = ::File.join __dir__, "ad_manager", "helpers.rb"
853
+ require "google/ads/ad_manager/helpers" if ::File.file? helper_path
@@ -0,0 +1,19 @@
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/ads/ad_manager" unless defined? Google::Ads::AdManager::VERSION
metadata CHANGED
@@ -1,33 +1,66 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-ads-ad_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.a
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-10-23 00:00:00.000000000 Z
12
- dependencies: []
13
- description: Placeholder for the future Google-authored gem google-ads-ad_manager.
14
- This placeholder is being released on 2024-10-23 in order to reserve the name. The
15
- final gem should be available shortly after that date. If it has not been released
16
- in a timely manner, or if this placeholder interferes with your work, you can contact
17
- the Google Ruby team by opening an issue in the GitHub repository https://github.com/googleapis/google-cloud-ruby.
10
+ date: 2025-01-29 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: google-ads-ad_manager-v1
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0.0'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 2.a
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '0.0'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: 2.a
32
+ - !ruby/object:Gem::Dependency
33
+ name: google-cloud-core
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - "~>"
37
+ - !ruby/object:Gem::Version
38
+ version: '1.6'
39
+ type: :runtime
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - "~>"
44
+ - !ruby/object:Gem::Version
45
+ version: '1.6'
46
+ description: The Ad Manager API enables an app to integrate with Google Ad Manager.
47
+ You can read Ad Manager data and run reports using the API.
18
48
  email: googleapis-packages@google.com
19
49
  executables: []
20
50
  extensions: []
21
51
  extra_rdoc_files: []
22
52
  files:
53
+ - ".yardopts"
54
+ - AUTHENTICATION.md
23
55
  - LICENSE.md
24
56
  - README.md
57
+ - lib/google-ads-ad_manager.rb
58
+ - lib/google/ads/ad_manager.rb
25
59
  - lib/google/ads/ad_manager/version.rb
26
60
  homepage: https://github.com/googleapis/google-cloud-ruby
27
61
  licenses:
28
62
  - Apache-2.0
29
63
  metadata: {}
30
- post_install_message:
31
64
  rdoc_options: []
32
65
  require_paths:
33
66
  - lib
@@ -42,8 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
42
75
  - !ruby/object:Gem::Version
43
76
  version: '0'
44
77
  requirements: []
45
- rubygems_version: 3.5.21
46
- signing_key:
78
+ rubygems_version: 3.6.2
47
79
  specification_version: 4
48
- summary: Placeholder for the future Google-authored gem google-ads-ad_manager
80
+ summary: Manage your Ad Manager inventory, run reports and more.
49
81
  test_files: []