@google-ads/admanager 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/LICENSE +202 -0
  3. package/README.md +236 -0
  4. package/build/protos/google/ads/admanager/v1/ad_unit_enums.proto +81 -0
  5. package/build/protos/google/ads/admanager/v1/ad_unit_messages.proto +230 -0
  6. package/build/protos/google/ads/admanager/v1/ad_unit_service.proto +195 -0
  7. package/build/protos/google/ads/admanager/v1/admanager_error.proto +52 -0
  8. package/build/protos/google/ads/admanager/v1/applied_label.proto +41 -0
  9. package/build/protos/google/ads/admanager/v1/company_credit_status_enum.proto +97 -0
  10. package/build/protos/google/ads/admanager/v1/company_messages.proto +122 -0
  11. package/build/protos/google/ads/admanager/v1/company_service.proto +126 -0
  12. package/build/protos/google/ads/admanager/v1/company_type_enum.proto +51 -0
  13. package/build/protos/google/ads/admanager/v1/contact_messages.proto +49 -0
  14. package/build/protos/google/ads/admanager/v1/custom_field_enums.proto +110 -0
  15. package/build/protos/google/ads/admanager/v1/custom_field_messages.proto +87 -0
  16. package/build/protos/google/ads/admanager/v1/custom_field_service.proto +127 -0
  17. package/build/protos/google/ads/admanager/v1/custom_field_value.proto +62 -0
  18. package/build/protos/google/ads/admanager/v1/custom_targeting_key_enums.proto +76 -0
  19. package/build/protos/google/ads/admanager/v1/custom_targeting_key_messages.proto +69 -0
  20. package/build/protos/google/ads/admanager/v1/custom_targeting_key_service.proto +129 -0
  21. package/build/protos/google/ads/admanager/v1/custom_targeting_value_enums.proto +90 -0
  22. package/build/protos/google/ads/admanager/v1/custom_targeting_value_messages.proto +66 -0
  23. package/build/protos/google/ads/admanager/v1/custom_targeting_value_service.proto +132 -0
  24. package/build/protos/google/ads/admanager/v1/entity_signals_mapping_messages.proto +64 -0
  25. package/build/protos/google/ads/admanager/v1/entity_signals_mapping_service.proto +252 -0
  26. package/build/protos/google/ads/admanager/v1/environment_type_enum.proto +41 -0
  27. package/build/protos/google/ads/admanager/v1/frequency_cap.proto +39 -0
  28. package/build/protos/google/ads/admanager/v1/label_messages.proto +42 -0
  29. package/build/protos/google/ads/admanager/v1/network_messages.proto +79 -0
  30. package/build/protos/google/ads/admanager/v1/network_service.proto +72 -0
  31. package/build/protos/google/ads/admanager/v1/order_enums.proto +59 -0
  32. package/build/protos/google/ads/admanager/v1/order_messages.proto +209 -0
  33. package/build/protos/google/ads/admanager/v1/order_service.proto +129 -0
  34. package/build/protos/google/ads/admanager/v1/placement_enums.proto +44 -0
  35. package/build/protos/google/ads/admanager/v1/placement_messages.proto +77 -0
  36. package/build/protos/google/ads/admanager/v1/placement_service.proto +126 -0
  37. package/build/protos/google/ads/admanager/v1/report_service.proto +3526 -0
  38. package/build/protos/google/ads/admanager/v1/role_enums.proto +41 -0
  39. package/build/protos/google/ads/admanager/v1/role_messages.proto +59 -0
  40. package/build/protos/google/ads/admanager/v1/role_service.proto +122 -0
  41. package/build/protos/google/ads/admanager/v1/size.proto +47 -0
  42. package/build/protos/google/ads/admanager/v1/size_type_enum.proto +62 -0
  43. package/build/protos/google/ads/admanager/v1/taxonomy_category_messages.proto +70 -0
  44. package/build/protos/google/ads/admanager/v1/taxonomy_category_service.proto +128 -0
  45. package/build/protos/google/ads/admanager/v1/taxonomy_type_enum.proto +51 -0
  46. package/build/protos/google/ads/admanager/v1/team_messages.proto +46 -0
  47. package/build/protos/google/ads/admanager/v1/time_unit_enum.proto +59 -0
  48. package/build/protos/google/ads/admanager/v1/user_messages.proto +78 -0
  49. package/build/protos/google/ads/admanager/v1/user_service.proto +57 -0
  50. package/build/protos/protos.d.ts +23491 -0
  51. package/build/protos/protos.js +69798 -0
  52. package/build/protos/protos.json +7273 -0
  53. package/build/src/index.d.ts +47 -0
  54. package/build/src/index.js +67 -0
  55. package/build/src/index.js.map +1 -0
  56. package/build/src/v1/ad_unit_service_client.d.ts +794 -0
  57. package/build/src/v1/ad_unit_service_client.js +1136 -0
  58. package/build/src/v1/ad_unit_service_client.js.map +1 -0
  59. package/build/src/v1/ad_unit_service_client_config.json +38 -0
  60. package/build/src/v1/company_service_client.d.ts +663 -0
  61. package/build/src/v1/company_service_client.js +999 -0
  62. package/build/src/v1/company_service_client.js.map +1 -0
  63. package/build/src/v1/company_service_client_config.json +34 -0
  64. package/build/src/v1/custom_field_service_client.d.ts +663 -0
  65. package/build/src/v1/custom_field_service_client.js +1002 -0
  66. package/build/src/v1/custom_field_service_client.js.map +1 -0
  67. package/build/src/v1/custom_field_service_client_config.json +34 -0
  68. package/build/src/v1/custom_targeting_key_service_client.d.ts +664 -0
  69. package/build/src/v1/custom_targeting_key_service_client.js +1004 -0
  70. package/build/src/v1/custom_targeting_key_service_client.js.map +1 -0
  71. package/build/src/v1/custom_targeting_key_service_client_config.json +34 -0
  72. package/build/src/v1/custom_targeting_value_service_client.d.ts +673 -0
  73. package/build/src/v1/custom_targeting_value_service_client.js +1010 -0
  74. package/build/src/v1/custom_targeting_value_service_client.js.map +1 -0
  75. package/build/src/v1/custom_targeting_value_service_client_config.json +34 -0
  76. package/build/src/v1/entity_signals_mapping_service_client.d.ts +782 -0
  77. package/build/src/v1/entity_signals_mapping_service_client.js +1096 -0
  78. package/build/src/v1/entity_signals_mapping_service_client.js.map +1 -0
  79. package/build/src/v1/entity_signals_mapping_service_client_config.json +50 -0
  80. package/build/src/v1/index.d.ts +13 -0
  81. package/build/src/v1/index.js +47 -0
  82. package/build/src/v1/index.js.map +1 -0
  83. package/build/src/v1/network_service_client.d.ts +552 -0
  84. package/build/src/v1/network_service_client.js +877 -0
  85. package/build/src/v1/network_service_client.js.map +1 -0
  86. package/build/src/v1/network_service_client_config.json +34 -0
  87. package/build/src/v1/order_service_client.d.ts +668 -0
  88. package/build/src/v1/order_service_client.js +999 -0
  89. package/build/src/v1/order_service_client.js.map +1 -0
  90. package/build/src/v1/order_service_client_config.json +48 -0
  91. package/build/src/v1/placement_service_client.d.ts +663 -0
  92. package/build/src/v1/placement_service_client.js +999 -0
  93. package/build/src/v1/placement_service_client.js.map +1 -0
  94. package/build/src/v1/placement_service_client_config.json +34 -0
  95. package/build/src/v1/report_service_client.d.ts +975 -0
  96. package/build/src/v1/report_service_client.js +1352 -0
  97. package/build/src/v1/report_service_client.js.map +1 -0
  98. package/build/src/v1/report_service_client_config.json +50 -0
  99. package/build/src/v1/role_service_client.d.ts +660 -0
  100. package/build/src/v1/role_service_client.js +997 -0
  101. package/build/src/v1/role_service_client.js.map +1 -0
  102. package/build/src/v1/role_service_client_config.json +34 -0
  103. package/build/src/v1/taxonomy_category_service_client.d.ts +663 -0
  104. package/build/src/v1/taxonomy_category_service_client.js +1003 -0
  105. package/build/src/v1/taxonomy_category_service_client.js.map +1 -0
  106. package/build/src/v1/taxonomy_category_service_client_config.json +34 -0
  107. package/build/src/v1/user_service_client.d.ts +534 -0
  108. package/build/src/v1/user_service_client.js +861 -0
  109. package/build/src/v1/user_service_client.js.map +1 -0
  110. package/build/src/v1/user_service_client_config.json +30 -0
  111. package/package.json +70 -0
@@ -0,0 +1,1136 @@
1
+ "use strict";
2
+ // Copyright 2024 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // https://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+ // ** This file is automatically generated by gapic-generator-typescript. **
17
+ // ** https://github.com/googleapis/gapic-generator-typescript **
18
+ // ** All changes to this file may be overwritten. **
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.AdUnitServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1/ad_unit_service_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./ad_unit_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Provides methods for handling AdUnit objects.
31
+ * @class
32
+ * @memberof v1
33
+ */
34
+ class AdUnitServiceClient {
35
+ /**
36
+ * Construct an instance of AdUnitServiceClient.
37
+ *
38
+ * @param {object} [options] - The configuration object.
39
+ * The options accepted by the constructor are described in detail
40
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
41
+ * The common options are:
42
+ * @param {object} [options.credentials] - Credentials object.
43
+ * @param {string} [options.credentials.client_email]
44
+ * @param {string} [options.credentials.private_key]
45
+ * @param {string} [options.email] - Account email address. Required when
46
+ * using a .pem or .p12 keyFilename.
47
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
48
+ * .p12 key downloaded from the Google Developers Console. If you provide
49
+ * a path to a JSON file, the projectId option below is not necessary.
50
+ * NOTE: .pem and .p12 require you to specify options.email as well.
51
+ * @param {number} [options.port] - The port on which to connect to
52
+ * the remote host.
53
+ * @param {string} [options.projectId] - The project ID from the Google
54
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
55
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
56
+ * app is running in an environment which supports
57
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
58
+ * your project ID will be detected automatically.
59
+ * @param {string} [options.apiEndpoint] - The domain name of the
60
+ * API remote host.
61
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
62
+ * Follows the structure of {@link gapicConfig}.
63
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
64
+ * For more information, please check the
65
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
66
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
67
+ * need to avoid loading the default gRPC version and want to use the fallback
68
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
69
+ * ```
70
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
71
+ * const client = new AdUnitServiceClient({fallback: true}, gax);
72
+ * ```
73
+ */
74
+ constructor(opts, gaxInstance) {
75
+ var _a, _b, _c, _d, _e, _f;
76
+ this._terminated = false;
77
+ this.descriptors = {
78
+ page: {},
79
+ stream: {},
80
+ longrunning: {},
81
+ batching: {},
82
+ };
83
+ // Ensure that options include all the required fields.
84
+ const staticMembers = this.constructor;
85
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
86
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
87
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
88
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
89
+ }
90
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
91
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
92
+ : undefined;
93
+ this._universeDomain =
94
+ (_c = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
95
+ this._servicePath = 'admanager.' + this._universeDomain;
96
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
97
+ this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
98
+ const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
99
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
100
+ // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute).
101
+ if (!opts) {
102
+ opts = { fallback: true };
103
+ }
104
+ else {
105
+ opts.fallback = (_e = opts.fallback) !== null && _e !== void 0 ? _e : true;
106
+ }
107
+ const fallback = (_f = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _f !== void 0 ? _f : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
108
+ opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
109
+ // Request numeric enum values if REST transport is used.
110
+ opts.numericEnums = true;
111
+ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
112
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
113
+ opts['scopes'] = staticMembers.scopes;
114
+ }
115
+ // Load google-gax module synchronously if needed
116
+ if (!gaxInstance) {
117
+ gaxInstance = require('google-gax');
118
+ }
119
+ // Choose either gRPC or proto-over-HTTP implementation of google-gax.
120
+ this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
121
+ // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
122
+ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
123
+ // Save options to use in initialize() method.
124
+ this._opts = opts;
125
+ // Save the auth object to the client, for use by other methods.
126
+ this.auth = this._gaxGrpc.auth;
127
+ // Set useJWTAccessWithScope on the auth object.
128
+ this.auth.useJWTAccessWithScope = true;
129
+ // Set defaultServicePath on the auth object.
130
+ this.auth.defaultServicePath = this._servicePath;
131
+ // Set the default scopes in auth client if needed.
132
+ if (servicePath === this._servicePath) {
133
+ this.auth.defaultScopes = staticMembers.scopes;
134
+ }
135
+ // Determine the client header string.
136
+ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
137
+ if (typeof process === 'object' && 'versions' in process) {
138
+ clientHeader.push(`gl-node/${process.versions.node}`);
139
+ }
140
+ else {
141
+ clientHeader.push(`gl-web/${this._gaxModule.version}`);
142
+ }
143
+ if (!opts.fallback) {
144
+ clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
145
+ }
146
+ else {
147
+ clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
148
+ }
149
+ if (opts.libName && opts.libVersion) {
150
+ clientHeader.push(`${opts.libName}/${opts.libVersion}`);
151
+ }
152
+ // Load the applicable protos.
153
+ this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
154
+ // This API contains "path templates"; forward-slash-separated
155
+ // identifiers to uniquely identify resources within the API.
156
+ // Create useful helper objects for these.
157
+ this.pathTemplates = {
158
+ adUnitPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/adUnits/{ad_unit}'),
159
+ companyPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/companies/{company}'),
160
+ contactPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/contacts/{contact}'),
161
+ customFieldPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/customFields/{custom_field}'),
162
+ customTargetingKeyPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/customTargetingKeys/{custom_targeting_key}'),
163
+ customTargetingValuePathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/customTargetingKeys/{custom_targeting_key}/customTargetingValues/{custom_targeting_value}'),
164
+ entitySignalsMappingPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/entitySignalsMappings/{entity_signals_mapping}'),
165
+ labelPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/labels/{label}'),
166
+ networkPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}'),
167
+ orderPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/orders/{order}'),
168
+ placementPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/placements/{placement}'),
169
+ reportPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/reports/{report}'),
170
+ rolePathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/roles/{role}'),
171
+ taxonomyCategoryPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/taxonomyCategories/{taxonomy_category}'),
172
+ teamPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/teams/{team}'),
173
+ userPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/users/{user}'),
174
+ };
175
+ // Some of the methods on this service return "paged" results,
176
+ // (e.g. 50 results at a time, with tokens to get subsequent
177
+ // pages). Denote the keys used for pagination and results.
178
+ this.descriptors.page = {
179
+ listAdUnits: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'adUnits'),
180
+ listAdUnitSizes: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'adUnitSizes'),
181
+ };
182
+ // Put together the default options sent with requests.
183
+ this._defaults = this._gaxGrpc.constructSettings('google.ads.admanager.v1.AdUnitService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
184
+ // Set up a dictionary of "inner API calls"; the core implementation
185
+ // of calling the API is handled in `google-gax`, with this code
186
+ // merely providing the destination and request information.
187
+ this.innerApiCalls = {};
188
+ // Add a warn function to the client constructor so it can be easily tested.
189
+ this.warn = this._gaxModule.warn;
190
+ }
191
+ /**
192
+ * Initialize the client.
193
+ * Performs asynchronous operations (such as authentication) and prepares the client.
194
+ * This function will be called automatically when any class method is called for the
195
+ * first time, but if you need to initialize it before calling an actual method,
196
+ * feel free to call initialize() directly.
197
+ *
198
+ * You can await on this method if you want to make sure the client is initialized.
199
+ *
200
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
201
+ */
202
+ initialize() {
203
+ // If the client stub promise is already initialized, return immediately.
204
+ if (this.adUnitServiceStub) {
205
+ return this.adUnitServiceStub;
206
+ }
207
+ // Put together the "service stub" for
208
+ // google.ads.admanager.v1.AdUnitService.
209
+ this.adUnitServiceStub = this._gaxGrpc.createStub(this._opts.fallback
210
+ ? this._protos.lookupService('google.ads.admanager.v1.AdUnitService')
211
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
212
+ this._protos.google.ads.admanager.v1.AdUnitService, this._opts, this._providedCustomServicePath);
213
+ // Iterate over each of the methods that the service provides
214
+ // and create an API call method for each.
215
+ const adUnitServiceStubMethods = [
216
+ 'getAdUnit',
217
+ 'listAdUnits',
218
+ 'listAdUnitSizes',
219
+ ];
220
+ for (const methodName of adUnitServiceStubMethods) {
221
+ const callPromise = this.adUnitServiceStub.then(stub => (...args) => {
222
+ if (this._terminated) {
223
+ return Promise.reject('The client has already been closed.');
224
+ }
225
+ const func = stub[methodName];
226
+ return func.apply(stub, args);
227
+ }, (err) => () => {
228
+ throw err;
229
+ });
230
+ const descriptor = this.descriptors.page[methodName] || undefined;
231
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
232
+ this.innerApiCalls[methodName] = apiCall;
233
+ }
234
+ return this.adUnitServiceStub;
235
+ }
236
+ /**
237
+ * The DNS address for this API service.
238
+ * @deprecated Use the apiEndpoint method of the client instance.
239
+ * @returns {string} The DNS address for this service.
240
+ */
241
+ static get servicePath() {
242
+ if (typeof process === 'object' &&
243
+ typeof process.emitWarning === 'function') {
244
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
245
+ }
246
+ return 'admanager.googleapis.com';
247
+ }
248
+ /**
249
+ * The DNS address for this API service - same as servicePath.
250
+ * @deprecated Use the apiEndpoint method of the client instance.
251
+ * @returns {string} The DNS address for this service.
252
+ */
253
+ static get apiEndpoint() {
254
+ if (typeof process === 'object' &&
255
+ typeof process.emitWarning === 'function') {
256
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
257
+ }
258
+ return 'admanager.googleapis.com';
259
+ }
260
+ /**
261
+ * The DNS address for this API service.
262
+ * @returns {string} The DNS address for this service.
263
+ */
264
+ get apiEndpoint() {
265
+ return this._servicePath;
266
+ }
267
+ get universeDomain() {
268
+ return this._universeDomain;
269
+ }
270
+ /**
271
+ * The port for this API service.
272
+ * @returns {number} The default port for this service.
273
+ */
274
+ static get port() {
275
+ return 443;
276
+ }
277
+ /**
278
+ * The scopes needed to make gRPC calls for every method defined
279
+ * in this service.
280
+ * @returns {string[]} List of default scopes.
281
+ */
282
+ static get scopes() {
283
+ return [];
284
+ }
285
+ /**
286
+ * Return the project ID used by this class.
287
+ * @returns {Promise} A promise that resolves to string containing the project ID.
288
+ */
289
+ getProjectId(callback) {
290
+ if (callback) {
291
+ this.auth.getProjectId(callback);
292
+ return;
293
+ }
294
+ return this.auth.getProjectId();
295
+ }
296
+ getAdUnit(request, optionsOrCallback, callback) {
297
+ var _a;
298
+ request = request || {};
299
+ let options;
300
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
301
+ callback = optionsOrCallback;
302
+ options = {};
303
+ }
304
+ else {
305
+ options = optionsOrCallback;
306
+ }
307
+ options = options || {};
308
+ options.otherArgs = options.otherArgs || {};
309
+ options.otherArgs.headers = options.otherArgs.headers || {};
310
+ options.otherArgs.headers['x-goog-request-params'] =
311
+ this._gaxModule.routingHeader.fromParams({
312
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
313
+ });
314
+ this.initialize();
315
+ return this.innerApiCalls.getAdUnit(request, options, callback);
316
+ }
317
+ listAdUnits(request, optionsOrCallback, callback) {
318
+ var _a;
319
+ request = request || {};
320
+ let options;
321
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
322
+ callback = optionsOrCallback;
323
+ options = {};
324
+ }
325
+ else {
326
+ options = optionsOrCallback;
327
+ }
328
+ options = options || {};
329
+ options.otherArgs = options.otherArgs || {};
330
+ options.otherArgs.headers = options.otherArgs.headers || {};
331
+ options.otherArgs.headers['x-goog-request-params'] =
332
+ this._gaxModule.routingHeader.fromParams({
333
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
334
+ });
335
+ this.initialize();
336
+ return this.innerApiCalls.listAdUnits(request, options, callback);
337
+ }
338
+ /**
339
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
340
+ * @param {Object} request
341
+ * The request object that will be sent.
342
+ * @param {string} request.parent
343
+ * Required. The parent, which owns this collection of AdUnits.
344
+ * Format: `networks/{network_code}`
345
+ * @param {number} [request.pageSize]
346
+ * Optional. The maximum number of AdUnits to return. The service may return
347
+ * fewer than this value. If unspecified, at most 50 ad units will be
348
+ * returned. The maximum value is 1000; values above 1000 will be coerced to
349
+ * 1000.
350
+ * @param {string} [request.pageToken]
351
+ * Optional. A page token, received from a previous `ListAdUnits` call.
352
+ * Provide this to retrieve the subsequent page.
353
+ *
354
+ * When paginating, all other parameters provided to `ListAdUnits` must match
355
+ * the call that provided the page token.
356
+ * @param {string} [request.filter]
357
+ * Optional. Expression to filter the response.
358
+ * See syntax details at
359
+ * https://developers.google.com/ad-manager/api/beta/filters
360
+ * @param {string} [request.orderBy]
361
+ * Optional. Expression to specify sorting order.
362
+ * See syntax details at
363
+ * https://developers.google.com/ad-manager/api/beta/filters#order
364
+ * @param {number} [request.skip]
365
+ * Optional. Number of individual resources to skip while paginating.
366
+ * @param {object} [options]
367
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
368
+ * @returns {Stream}
369
+ * An object stream which emits an object representing {@link protos.google.ads.admanager.v1.AdUnit|AdUnit} on 'data' event.
370
+ * The client library will perform auto-pagination by default: it will call the API as many
371
+ * times as needed. Note that it can affect your quota.
372
+ * We recommend using `listAdUnitsAsync()`
373
+ * method described below for async iteration which you can stop as needed.
374
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
375
+ * for more details and examples.
376
+ */
377
+ listAdUnitsStream(request, options) {
378
+ var _a;
379
+ request = request || {};
380
+ options = options || {};
381
+ options.otherArgs = options.otherArgs || {};
382
+ options.otherArgs.headers = options.otherArgs.headers || {};
383
+ options.otherArgs.headers['x-goog-request-params'] =
384
+ this._gaxModule.routingHeader.fromParams({
385
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
386
+ });
387
+ const defaultCallSettings = this._defaults['listAdUnits'];
388
+ const callSettings = defaultCallSettings.merge(options);
389
+ this.initialize();
390
+ return this.descriptors.page.listAdUnits.createStream(this.innerApiCalls.listAdUnits, request, callSettings);
391
+ }
392
+ /**
393
+ * Equivalent to `listAdUnits`, but returns an iterable object.
394
+ *
395
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
396
+ * @param {Object} request
397
+ * The request object that will be sent.
398
+ * @param {string} request.parent
399
+ * Required. The parent, which owns this collection of AdUnits.
400
+ * Format: `networks/{network_code}`
401
+ * @param {number} [request.pageSize]
402
+ * Optional. The maximum number of AdUnits to return. The service may return
403
+ * fewer than this value. If unspecified, at most 50 ad units will be
404
+ * returned. The maximum value is 1000; values above 1000 will be coerced to
405
+ * 1000.
406
+ * @param {string} [request.pageToken]
407
+ * Optional. A page token, received from a previous `ListAdUnits` call.
408
+ * Provide this to retrieve the subsequent page.
409
+ *
410
+ * When paginating, all other parameters provided to `ListAdUnits` must match
411
+ * the call that provided the page token.
412
+ * @param {string} [request.filter]
413
+ * Optional. Expression to filter the response.
414
+ * See syntax details at
415
+ * https://developers.google.com/ad-manager/api/beta/filters
416
+ * @param {string} [request.orderBy]
417
+ * Optional. Expression to specify sorting order.
418
+ * See syntax details at
419
+ * https://developers.google.com/ad-manager/api/beta/filters#order
420
+ * @param {number} [request.skip]
421
+ * Optional. Number of individual resources to skip while paginating.
422
+ * @param {object} [options]
423
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
424
+ * @returns {Object}
425
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
426
+ * When you iterate the returned iterable, each element will be an object representing
427
+ * {@link protos.google.ads.admanager.v1.AdUnit|AdUnit}. The API will be called under the hood as needed, once per the page,
428
+ * so you can stop the iteration when you don't need more results.
429
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
430
+ * for more details and examples.
431
+ * @example <caption>include:samples/generated/v1/ad_unit_service.list_ad_units.js</caption>
432
+ * region_tag:admanager_v1_generated_AdUnitService_ListAdUnits_async
433
+ */
434
+ listAdUnitsAsync(request, options) {
435
+ var _a;
436
+ request = request || {};
437
+ options = options || {};
438
+ options.otherArgs = options.otherArgs || {};
439
+ options.otherArgs.headers = options.otherArgs.headers || {};
440
+ options.otherArgs.headers['x-goog-request-params'] =
441
+ this._gaxModule.routingHeader.fromParams({
442
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
443
+ });
444
+ const defaultCallSettings = this._defaults['listAdUnits'];
445
+ const callSettings = defaultCallSettings.merge(options);
446
+ this.initialize();
447
+ return this.descriptors.page.listAdUnits.asyncIterate(this.innerApiCalls['listAdUnits'], request, callSettings);
448
+ }
449
+ listAdUnitSizes(request, optionsOrCallback, callback) {
450
+ var _a;
451
+ request = request || {};
452
+ let options;
453
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
454
+ callback = optionsOrCallback;
455
+ options = {};
456
+ }
457
+ else {
458
+ options = optionsOrCallback;
459
+ }
460
+ options = options || {};
461
+ options.otherArgs = options.otherArgs || {};
462
+ options.otherArgs.headers = options.otherArgs.headers || {};
463
+ options.otherArgs.headers['x-goog-request-params'] =
464
+ this._gaxModule.routingHeader.fromParams({
465
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
466
+ });
467
+ this.initialize();
468
+ return this.innerApiCalls.listAdUnitSizes(request, options, callback);
469
+ }
470
+ /**
471
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
472
+ * @param {Object} request
473
+ * The request object that will be sent.
474
+ * @param {string} request.parent
475
+ * Required. The parent, which owns this collection of AdUnitSizes.
476
+ * Format: `networks/{network_code}`
477
+ * @param {number} [request.pageSize]
478
+ * Optional. The maximum number of AdUnitSizes to return. The service may
479
+ * return fewer than this value. If unspecified, at most 50 ad unit sizes will
480
+ * be returned. The maximum value is 1000; values above 1000 will be coerced
481
+ * to 1000.
482
+ * @param {string} [request.pageToken]
483
+ * Optional. A page token, received from a previous `ListAdUnitSizes` call.
484
+ * Provide this to retrieve the subsequent page.
485
+ *
486
+ * When paginating, all other parameters provided to `ListAdUnitSizes` must
487
+ * match the call that provided the page token.
488
+ * @param {string} [request.filter]
489
+ * Optional. Expression to filter the response.
490
+ * See syntax details at
491
+ * https://developers.google.com/ad-manager/api/beta/filters
492
+ * @param {string} [request.orderBy]
493
+ * Optional. Expression to specify sorting order.
494
+ * See syntax details at
495
+ * https://developers.google.com/ad-manager/api/beta/filters#order
496
+ * @param {number} [request.skip]
497
+ * Optional. Number of individual resources to skip while paginating.
498
+ * @param {object} [options]
499
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
500
+ * @returns {Stream}
501
+ * An object stream which emits an object representing {@link protos.google.ads.admanager.v1.AdUnitSize|AdUnitSize} on 'data' event.
502
+ * The client library will perform auto-pagination by default: it will call the API as many
503
+ * times as needed. Note that it can affect your quota.
504
+ * We recommend using `listAdUnitSizesAsync()`
505
+ * method described below for async iteration which you can stop as needed.
506
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
507
+ * for more details and examples.
508
+ */
509
+ listAdUnitSizesStream(request, options) {
510
+ var _a;
511
+ request = request || {};
512
+ options = options || {};
513
+ options.otherArgs = options.otherArgs || {};
514
+ options.otherArgs.headers = options.otherArgs.headers || {};
515
+ options.otherArgs.headers['x-goog-request-params'] =
516
+ this._gaxModule.routingHeader.fromParams({
517
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
518
+ });
519
+ const defaultCallSettings = this._defaults['listAdUnitSizes'];
520
+ const callSettings = defaultCallSettings.merge(options);
521
+ this.initialize();
522
+ return this.descriptors.page.listAdUnitSizes.createStream(this.innerApiCalls.listAdUnitSizes, request, callSettings);
523
+ }
524
+ /**
525
+ * Equivalent to `listAdUnitSizes`, but returns an iterable object.
526
+ *
527
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
528
+ * @param {Object} request
529
+ * The request object that will be sent.
530
+ * @param {string} request.parent
531
+ * Required. The parent, which owns this collection of AdUnitSizes.
532
+ * Format: `networks/{network_code}`
533
+ * @param {number} [request.pageSize]
534
+ * Optional. The maximum number of AdUnitSizes to return. The service may
535
+ * return fewer than this value. If unspecified, at most 50 ad unit sizes will
536
+ * be returned. The maximum value is 1000; values above 1000 will be coerced
537
+ * to 1000.
538
+ * @param {string} [request.pageToken]
539
+ * Optional. A page token, received from a previous `ListAdUnitSizes` call.
540
+ * Provide this to retrieve the subsequent page.
541
+ *
542
+ * When paginating, all other parameters provided to `ListAdUnitSizes` must
543
+ * match the call that provided the page token.
544
+ * @param {string} [request.filter]
545
+ * Optional. Expression to filter the response.
546
+ * See syntax details at
547
+ * https://developers.google.com/ad-manager/api/beta/filters
548
+ * @param {string} [request.orderBy]
549
+ * Optional. Expression to specify sorting order.
550
+ * See syntax details at
551
+ * https://developers.google.com/ad-manager/api/beta/filters#order
552
+ * @param {number} [request.skip]
553
+ * Optional. Number of individual resources to skip while paginating.
554
+ * @param {object} [options]
555
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
556
+ * @returns {Object}
557
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
558
+ * When you iterate the returned iterable, each element will be an object representing
559
+ * {@link protos.google.ads.admanager.v1.AdUnitSize|AdUnitSize}. The API will be called under the hood as needed, once per the page,
560
+ * so you can stop the iteration when you don't need more results.
561
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
562
+ * for more details and examples.
563
+ * @example <caption>include:samples/generated/v1/ad_unit_service.list_ad_unit_sizes.js</caption>
564
+ * region_tag:admanager_v1_generated_AdUnitService_ListAdUnitSizes_async
565
+ */
566
+ listAdUnitSizesAsync(request, options) {
567
+ var _a;
568
+ request = request || {};
569
+ options = options || {};
570
+ options.otherArgs = options.otherArgs || {};
571
+ options.otherArgs.headers = options.otherArgs.headers || {};
572
+ options.otherArgs.headers['x-goog-request-params'] =
573
+ this._gaxModule.routingHeader.fromParams({
574
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
575
+ });
576
+ const defaultCallSettings = this._defaults['listAdUnitSizes'];
577
+ const callSettings = defaultCallSettings.merge(options);
578
+ this.initialize();
579
+ return this.descriptors.page.listAdUnitSizes.asyncIterate(this.innerApiCalls['listAdUnitSizes'], request, callSettings);
580
+ }
581
+ // --------------------
582
+ // -- Path templates --
583
+ // --------------------
584
+ /**
585
+ * Return a fully-qualified adUnit resource name string.
586
+ *
587
+ * @param {string} network_code
588
+ * @param {string} ad_unit
589
+ * @returns {string} Resource name string.
590
+ */
591
+ adUnitPath(networkCode, adUnit) {
592
+ return this.pathTemplates.adUnitPathTemplate.render({
593
+ network_code: networkCode,
594
+ ad_unit: adUnit,
595
+ });
596
+ }
597
+ /**
598
+ * Parse the network_code from AdUnit resource.
599
+ *
600
+ * @param {string} adUnitName
601
+ * A fully-qualified path representing AdUnit resource.
602
+ * @returns {string} A string representing the network_code.
603
+ */
604
+ matchNetworkCodeFromAdUnitName(adUnitName) {
605
+ return this.pathTemplates.adUnitPathTemplate.match(adUnitName).network_code;
606
+ }
607
+ /**
608
+ * Parse the ad_unit from AdUnit resource.
609
+ *
610
+ * @param {string} adUnitName
611
+ * A fully-qualified path representing AdUnit resource.
612
+ * @returns {string} A string representing the ad_unit.
613
+ */
614
+ matchAdUnitFromAdUnitName(adUnitName) {
615
+ return this.pathTemplates.adUnitPathTemplate.match(adUnitName).ad_unit;
616
+ }
617
+ /**
618
+ * Return a fully-qualified company resource name string.
619
+ *
620
+ * @param {string} network_code
621
+ * @param {string} company
622
+ * @returns {string} Resource name string.
623
+ */
624
+ companyPath(networkCode, company) {
625
+ return this.pathTemplates.companyPathTemplate.render({
626
+ network_code: networkCode,
627
+ company: company,
628
+ });
629
+ }
630
+ /**
631
+ * Parse the network_code from Company resource.
632
+ *
633
+ * @param {string} companyName
634
+ * A fully-qualified path representing Company resource.
635
+ * @returns {string} A string representing the network_code.
636
+ */
637
+ matchNetworkCodeFromCompanyName(companyName) {
638
+ return this.pathTemplates.companyPathTemplate.match(companyName)
639
+ .network_code;
640
+ }
641
+ /**
642
+ * Parse the company from Company resource.
643
+ *
644
+ * @param {string} companyName
645
+ * A fully-qualified path representing Company resource.
646
+ * @returns {string} A string representing the company.
647
+ */
648
+ matchCompanyFromCompanyName(companyName) {
649
+ return this.pathTemplates.companyPathTemplate.match(companyName).company;
650
+ }
651
+ /**
652
+ * Return a fully-qualified contact resource name string.
653
+ *
654
+ * @param {string} network_code
655
+ * @param {string} contact
656
+ * @returns {string} Resource name string.
657
+ */
658
+ contactPath(networkCode, contact) {
659
+ return this.pathTemplates.contactPathTemplate.render({
660
+ network_code: networkCode,
661
+ contact: contact,
662
+ });
663
+ }
664
+ /**
665
+ * Parse the network_code from Contact resource.
666
+ *
667
+ * @param {string} contactName
668
+ * A fully-qualified path representing Contact resource.
669
+ * @returns {string} A string representing the network_code.
670
+ */
671
+ matchNetworkCodeFromContactName(contactName) {
672
+ return this.pathTemplates.contactPathTemplate.match(contactName)
673
+ .network_code;
674
+ }
675
+ /**
676
+ * Parse the contact from Contact resource.
677
+ *
678
+ * @param {string} contactName
679
+ * A fully-qualified path representing Contact resource.
680
+ * @returns {string} A string representing the contact.
681
+ */
682
+ matchContactFromContactName(contactName) {
683
+ return this.pathTemplates.contactPathTemplate.match(contactName).contact;
684
+ }
685
+ /**
686
+ * Return a fully-qualified customField resource name string.
687
+ *
688
+ * @param {string} network_code
689
+ * @param {string} custom_field
690
+ * @returns {string} Resource name string.
691
+ */
692
+ customFieldPath(networkCode, customField) {
693
+ return this.pathTemplates.customFieldPathTemplate.render({
694
+ network_code: networkCode,
695
+ custom_field: customField,
696
+ });
697
+ }
698
+ /**
699
+ * Parse the network_code from CustomField resource.
700
+ *
701
+ * @param {string} customFieldName
702
+ * A fully-qualified path representing CustomField resource.
703
+ * @returns {string} A string representing the network_code.
704
+ */
705
+ matchNetworkCodeFromCustomFieldName(customFieldName) {
706
+ return this.pathTemplates.customFieldPathTemplate.match(customFieldName)
707
+ .network_code;
708
+ }
709
+ /**
710
+ * Parse the custom_field from CustomField resource.
711
+ *
712
+ * @param {string} customFieldName
713
+ * A fully-qualified path representing CustomField resource.
714
+ * @returns {string} A string representing the custom_field.
715
+ */
716
+ matchCustomFieldFromCustomFieldName(customFieldName) {
717
+ return this.pathTemplates.customFieldPathTemplate.match(customFieldName)
718
+ .custom_field;
719
+ }
720
+ /**
721
+ * Return a fully-qualified customTargetingKey resource name string.
722
+ *
723
+ * @param {string} network_code
724
+ * @param {string} custom_targeting_key
725
+ * @returns {string} Resource name string.
726
+ */
727
+ customTargetingKeyPath(networkCode, customTargetingKey) {
728
+ return this.pathTemplates.customTargetingKeyPathTemplate.render({
729
+ network_code: networkCode,
730
+ custom_targeting_key: customTargetingKey,
731
+ });
732
+ }
733
+ /**
734
+ * Parse the network_code from CustomTargetingKey resource.
735
+ *
736
+ * @param {string} customTargetingKeyName
737
+ * A fully-qualified path representing CustomTargetingKey resource.
738
+ * @returns {string} A string representing the network_code.
739
+ */
740
+ matchNetworkCodeFromCustomTargetingKeyName(customTargetingKeyName) {
741
+ return this.pathTemplates.customTargetingKeyPathTemplate.match(customTargetingKeyName).network_code;
742
+ }
743
+ /**
744
+ * Parse the custom_targeting_key from CustomTargetingKey resource.
745
+ *
746
+ * @param {string} customTargetingKeyName
747
+ * A fully-qualified path representing CustomTargetingKey resource.
748
+ * @returns {string} A string representing the custom_targeting_key.
749
+ */
750
+ matchCustomTargetingKeyFromCustomTargetingKeyName(customTargetingKeyName) {
751
+ return this.pathTemplates.customTargetingKeyPathTemplate.match(customTargetingKeyName).custom_targeting_key;
752
+ }
753
+ /**
754
+ * Return a fully-qualified customTargetingValue resource name string.
755
+ *
756
+ * @param {string} network_code
757
+ * @param {string} custom_targeting_key
758
+ * @param {string} custom_targeting_value
759
+ * @returns {string} Resource name string.
760
+ */
761
+ customTargetingValuePath(networkCode, customTargetingKey, customTargetingValue) {
762
+ return this.pathTemplates.customTargetingValuePathTemplate.render({
763
+ network_code: networkCode,
764
+ custom_targeting_key: customTargetingKey,
765
+ custom_targeting_value: customTargetingValue,
766
+ });
767
+ }
768
+ /**
769
+ * Parse the network_code from CustomTargetingValue resource.
770
+ *
771
+ * @param {string} customTargetingValueName
772
+ * A fully-qualified path representing CustomTargetingValue resource.
773
+ * @returns {string} A string representing the network_code.
774
+ */
775
+ matchNetworkCodeFromCustomTargetingValueName(customTargetingValueName) {
776
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).network_code;
777
+ }
778
+ /**
779
+ * Parse the custom_targeting_key from CustomTargetingValue resource.
780
+ *
781
+ * @param {string} customTargetingValueName
782
+ * A fully-qualified path representing CustomTargetingValue resource.
783
+ * @returns {string} A string representing the custom_targeting_key.
784
+ */
785
+ matchCustomTargetingKeyFromCustomTargetingValueName(customTargetingValueName) {
786
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).custom_targeting_key;
787
+ }
788
+ /**
789
+ * Parse the custom_targeting_value from CustomTargetingValue resource.
790
+ *
791
+ * @param {string} customTargetingValueName
792
+ * A fully-qualified path representing CustomTargetingValue resource.
793
+ * @returns {string} A string representing the custom_targeting_value.
794
+ */
795
+ matchCustomTargetingValueFromCustomTargetingValueName(customTargetingValueName) {
796
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).custom_targeting_value;
797
+ }
798
+ /**
799
+ * Return a fully-qualified entitySignalsMapping resource name string.
800
+ *
801
+ * @param {string} network_code
802
+ * @param {string} entity_signals_mapping
803
+ * @returns {string} Resource name string.
804
+ */
805
+ entitySignalsMappingPath(networkCode, entitySignalsMapping) {
806
+ return this.pathTemplates.entitySignalsMappingPathTemplate.render({
807
+ network_code: networkCode,
808
+ entity_signals_mapping: entitySignalsMapping,
809
+ });
810
+ }
811
+ /**
812
+ * Parse the network_code from EntitySignalsMapping resource.
813
+ *
814
+ * @param {string} entitySignalsMappingName
815
+ * A fully-qualified path representing EntitySignalsMapping resource.
816
+ * @returns {string} A string representing the network_code.
817
+ */
818
+ matchNetworkCodeFromEntitySignalsMappingName(entitySignalsMappingName) {
819
+ return this.pathTemplates.entitySignalsMappingPathTemplate.match(entitySignalsMappingName).network_code;
820
+ }
821
+ /**
822
+ * Parse the entity_signals_mapping from EntitySignalsMapping resource.
823
+ *
824
+ * @param {string} entitySignalsMappingName
825
+ * A fully-qualified path representing EntitySignalsMapping resource.
826
+ * @returns {string} A string representing the entity_signals_mapping.
827
+ */
828
+ matchEntitySignalsMappingFromEntitySignalsMappingName(entitySignalsMappingName) {
829
+ return this.pathTemplates.entitySignalsMappingPathTemplate.match(entitySignalsMappingName).entity_signals_mapping;
830
+ }
831
+ /**
832
+ * Return a fully-qualified label resource name string.
833
+ *
834
+ * @param {string} network_code
835
+ * @param {string} label
836
+ * @returns {string} Resource name string.
837
+ */
838
+ labelPath(networkCode, label) {
839
+ return this.pathTemplates.labelPathTemplate.render({
840
+ network_code: networkCode,
841
+ label: label,
842
+ });
843
+ }
844
+ /**
845
+ * Parse the network_code from Label resource.
846
+ *
847
+ * @param {string} labelName
848
+ * A fully-qualified path representing Label resource.
849
+ * @returns {string} A string representing the network_code.
850
+ */
851
+ matchNetworkCodeFromLabelName(labelName) {
852
+ return this.pathTemplates.labelPathTemplate.match(labelName).network_code;
853
+ }
854
+ /**
855
+ * Parse the label from Label resource.
856
+ *
857
+ * @param {string} labelName
858
+ * A fully-qualified path representing Label resource.
859
+ * @returns {string} A string representing the label.
860
+ */
861
+ matchLabelFromLabelName(labelName) {
862
+ return this.pathTemplates.labelPathTemplate.match(labelName).label;
863
+ }
864
+ /**
865
+ * Return a fully-qualified network resource name string.
866
+ *
867
+ * @param {string} network_code
868
+ * @returns {string} Resource name string.
869
+ */
870
+ networkPath(networkCode) {
871
+ return this.pathTemplates.networkPathTemplate.render({
872
+ network_code: networkCode,
873
+ });
874
+ }
875
+ /**
876
+ * Parse the network_code from Network resource.
877
+ *
878
+ * @param {string} networkName
879
+ * A fully-qualified path representing Network resource.
880
+ * @returns {string} A string representing the network_code.
881
+ */
882
+ matchNetworkCodeFromNetworkName(networkName) {
883
+ return this.pathTemplates.networkPathTemplate.match(networkName)
884
+ .network_code;
885
+ }
886
+ /**
887
+ * Return a fully-qualified order resource name string.
888
+ *
889
+ * @param {string} network_code
890
+ * @param {string} order
891
+ * @returns {string} Resource name string.
892
+ */
893
+ orderPath(networkCode, order) {
894
+ return this.pathTemplates.orderPathTemplate.render({
895
+ network_code: networkCode,
896
+ order: order,
897
+ });
898
+ }
899
+ /**
900
+ * Parse the network_code from Order resource.
901
+ *
902
+ * @param {string} orderName
903
+ * A fully-qualified path representing Order resource.
904
+ * @returns {string} A string representing the network_code.
905
+ */
906
+ matchNetworkCodeFromOrderName(orderName) {
907
+ return this.pathTemplates.orderPathTemplate.match(orderName).network_code;
908
+ }
909
+ /**
910
+ * Parse the order from Order resource.
911
+ *
912
+ * @param {string} orderName
913
+ * A fully-qualified path representing Order resource.
914
+ * @returns {string} A string representing the order.
915
+ */
916
+ matchOrderFromOrderName(orderName) {
917
+ return this.pathTemplates.orderPathTemplate.match(orderName).order;
918
+ }
919
+ /**
920
+ * Return a fully-qualified placement resource name string.
921
+ *
922
+ * @param {string} network_code
923
+ * @param {string} placement
924
+ * @returns {string} Resource name string.
925
+ */
926
+ placementPath(networkCode, placement) {
927
+ return this.pathTemplates.placementPathTemplate.render({
928
+ network_code: networkCode,
929
+ placement: placement,
930
+ });
931
+ }
932
+ /**
933
+ * Parse the network_code from Placement resource.
934
+ *
935
+ * @param {string} placementName
936
+ * A fully-qualified path representing Placement resource.
937
+ * @returns {string} A string representing the network_code.
938
+ */
939
+ matchNetworkCodeFromPlacementName(placementName) {
940
+ return this.pathTemplates.placementPathTemplate.match(placementName)
941
+ .network_code;
942
+ }
943
+ /**
944
+ * Parse the placement from Placement resource.
945
+ *
946
+ * @param {string} placementName
947
+ * A fully-qualified path representing Placement resource.
948
+ * @returns {string} A string representing the placement.
949
+ */
950
+ matchPlacementFromPlacementName(placementName) {
951
+ return this.pathTemplates.placementPathTemplate.match(placementName)
952
+ .placement;
953
+ }
954
+ /**
955
+ * Return a fully-qualified report resource name string.
956
+ *
957
+ * @param {string} network_code
958
+ * @param {string} report
959
+ * @returns {string} Resource name string.
960
+ */
961
+ reportPath(networkCode, report) {
962
+ return this.pathTemplates.reportPathTemplate.render({
963
+ network_code: networkCode,
964
+ report: report,
965
+ });
966
+ }
967
+ /**
968
+ * Parse the network_code from Report resource.
969
+ *
970
+ * @param {string} reportName
971
+ * A fully-qualified path representing Report resource.
972
+ * @returns {string} A string representing the network_code.
973
+ */
974
+ matchNetworkCodeFromReportName(reportName) {
975
+ return this.pathTemplates.reportPathTemplate.match(reportName).network_code;
976
+ }
977
+ /**
978
+ * Parse the report from Report resource.
979
+ *
980
+ * @param {string} reportName
981
+ * A fully-qualified path representing Report resource.
982
+ * @returns {string} A string representing the report.
983
+ */
984
+ matchReportFromReportName(reportName) {
985
+ return this.pathTemplates.reportPathTemplate.match(reportName).report;
986
+ }
987
+ /**
988
+ * Return a fully-qualified role resource name string.
989
+ *
990
+ * @param {string} network_code
991
+ * @param {string} role
992
+ * @returns {string} Resource name string.
993
+ */
994
+ rolePath(networkCode, role) {
995
+ return this.pathTemplates.rolePathTemplate.render({
996
+ network_code: networkCode,
997
+ role: role,
998
+ });
999
+ }
1000
+ /**
1001
+ * Parse the network_code from Role resource.
1002
+ *
1003
+ * @param {string} roleName
1004
+ * A fully-qualified path representing Role resource.
1005
+ * @returns {string} A string representing the network_code.
1006
+ */
1007
+ matchNetworkCodeFromRoleName(roleName) {
1008
+ return this.pathTemplates.rolePathTemplate.match(roleName).network_code;
1009
+ }
1010
+ /**
1011
+ * Parse the role from Role resource.
1012
+ *
1013
+ * @param {string} roleName
1014
+ * A fully-qualified path representing Role resource.
1015
+ * @returns {string} A string representing the role.
1016
+ */
1017
+ matchRoleFromRoleName(roleName) {
1018
+ return this.pathTemplates.rolePathTemplate.match(roleName).role;
1019
+ }
1020
+ /**
1021
+ * Return a fully-qualified taxonomyCategory resource name string.
1022
+ *
1023
+ * @param {string} network_code
1024
+ * @param {string} taxonomy_category
1025
+ * @returns {string} Resource name string.
1026
+ */
1027
+ taxonomyCategoryPath(networkCode, taxonomyCategory) {
1028
+ return this.pathTemplates.taxonomyCategoryPathTemplate.render({
1029
+ network_code: networkCode,
1030
+ taxonomy_category: taxonomyCategory,
1031
+ });
1032
+ }
1033
+ /**
1034
+ * Parse the network_code from TaxonomyCategory resource.
1035
+ *
1036
+ * @param {string} taxonomyCategoryName
1037
+ * A fully-qualified path representing TaxonomyCategory resource.
1038
+ * @returns {string} A string representing the network_code.
1039
+ */
1040
+ matchNetworkCodeFromTaxonomyCategoryName(taxonomyCategoryName) {
1041
+ return this.pathTemplates.taxonomyCategoryPathTemplate.match(taxonomyCategoryName).network_code;
1042
+ }
1043
+ /**
1044
+ * Parse the taxonomy_category from TaxonomyCategory resource.
1045
+ *
1046
+ * @param {string} taxonomyCategoryName
1047
+ * A fully-qualified path representing TaxonomyCategory resource.
1048
+ * @returns {string} A string representing the taxonomy_category.
1049
+ */
1050
+ matchTaxonomyCategoryFromTaxonomyCategoryName(taxonomyCategoryName) {
1051
+ return this.pathTemplates.taxonomyCategoryPathTemplate.match(taxonomyCategoryName).taxonomy_category;
1052
+ }
1053
+ /**
1054
+ * Return a fully-qualified team resource name string.
1055
+ *
1056
+ * @param {string} network_code
1057
+ * @param {string} team
1058
+ * @returns {string} Resource name string.
1059
+ */
1060
+ teamPath(networkCode, team) {
1061
+ return this.pathTemplates.teamPathTemplate.render({
1062
+ network_code: networkCode,
1063
+ team: team,
1064
+ });
1065
+ }
1066
+ /**
1067
+ * Parse the network_code from Team resource.
1068
+ *
1069
+ * @param {string} teamName
1070
+ * A fully-qualified path representing Team resource.
1071
+ * @returns {string} A string representing the network_code.
1072
+ */
1073
+ matchNetworkCodeFromTeamName(teamName) {
1074
+ return this.pathTemplates.teamPathTemplate.match(teamName).network_code;
1075
+ }
1076
+ /**
1077
+ * Parse the team from Team resource.
1078
+ *
1079
+ * @param {string} teamName
1080
+ * A fully-qualified path representing Team resource.
1081
+ * @returns {string} A string representing the team.
1082
+ */
1083
+ matchTeamFromTeamName(teamName) {
1084
+ return this.pathTemplates.teamPathTemplate.match(teamName).team;
1085
+ }
1086
+ /**
1087
+ * Return a fully-qualified user resource name string.
1088
+ *
1089
+ * @param {string} network_code
1090
+ * @param {string} user
1091
+ * @returns {string} Resource name string.
1092
+ */
1093
+ userPath(networkCode, user) {
1094
+ return this.pathTemplates.userPathTemplate.render({
1095
+ network_code: networkCode,
1096
+ user: user,
1097
+ });
1098
+ }
1099
+ /**
1100
+ * Parse the network_code from User resource.
1101
+ *
1102
+ * @param {string} userName
1103
+ * A fully-qualified path representing User resource.
1104
+ * @returns {string} A string representing the network_code.
1105
+ */
1106
+ matchNetworkCodeFromUserName(userName) {
1107
+ return this.pathTemplates.userPathTemplate.match(userName).network_code;
1108
+ }
1109
+ /**
1110
+ * Parse the user from User resource.
1111
+ *
1112
+ * @param {string} userName
1113
+ * A fully-qualified path representing User resource.
1114
+ * @returns {string} A string representing the user.
1115
+ */
1116
+ matchUserFromUserName(userName) {
1117
+ return this.pathTemplates.userPathTemplate.match(userName).user;
1118
+ }
1119
+ /**
1120
+ * Terminate the gRPC channel and close the client.
1121
+ *
1122
+ * The client will no longer be usable and all future behavior is undefined.
1123
+ * @returns {Promise} A promise that resolves when the client is closed.
1124
+ */
1125
+ close() {
1126
+ if (this.adUnitServiceStub && !this._terminated) {
1127
+ return this.adUnitServiceStub.then(stub => {
1128
+ this._terminated = true;
1129
+ stub.close();
1130
+ });
1131
+ }
1132
+ return Promise.resolve();
1133
+ }
1134
+ }
1135
+ exports.AdUnitServiceClient = AdUnitServiceClient;
1136
+ //# sourceMappingURL=ad_unit_service_client.js.map