@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,1004 @@
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.CustomTargetingKeyServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1/custom_targeting_key_service_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./custom_targeting_key_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Provides methods for handling `CustomTargetingKey` objects.
31
+ * @class
32
+ * @memberof v1
33
+ */
34
+ class CustomTargetingKeyServiceClient {
35
+ /**
36
+ * Construct an instance of CustomTargetingKeyServiceClient.
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 CustomTargetingKeyServiceClient({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
85
+ .constructor;
86
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
87
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
88
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
89
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
90
+ }
91
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
92
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
93
+ : undefined;
94
+ this._universeDomain =
95
+ (_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';
96
+ this._servicePath = 'admanager.' + this._universeDomain;
97
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
98
+ this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
99
+ const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
100
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
101
+ // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute).
102
+ if (!opts) {
103
+ opts = { fallback: true };
104
+ }
105
+ else {
106
+ opts.fallback = (_e = opts.fallback) !== null && _e !== void 0 ? _e : true;
107
+ }
108
+ 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');
109
+ opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
110
+ // Request numeric enum values if REST transport is used.
111
+ opts.numericEnums = true;
112
+ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
113
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
114
+ opts['scopes'] = staticMembers.scopes;
115
+ }
116
+ // Load google-gax module synchronously if needed
117
+ if (!gaxInstance) {
118
+ gaxInstance = require('google-gax');
119
+ }
120
+ // Choose either gRPC or proto-over-HTTP implementation of google-gax.
121
+ this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
122
+ // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
123
+ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
124
+ // Save options to use in initialize() method.
125
+ this._opts = opts;
126
+ // Save the auth object to the client, for use by other methods.
127
+ this.auth = this._gaxGrpc.auth;
128
+ // Set useJWTAccessWithScope on the auth object.
129
+ this.auth.useJWTAccessWithScope = true;
130
+ // Set defaultServicePath on the auth object.
131
+ this.auth.defaultServicePath = this._servicePath;
132
+ // Set the default scopes in auth client if needed.
133
+ if (servicePath === this._servicePath) {
134
+ this.auth.defaultScopes = staticMembers.scopes;
135
+ }
136
+ // Determine the client header string.
137
+ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
138
+ if (typeof process === 'object' && 'versions' in process) {
139
+ clientHeader.push(`gl-node/${process.versions.node}`);
140
+ }
141
+ else {
142
+ clientHeader.push(`gl-web/${this._gaxModule.version}`);
143
+ }
144
+ if (!opts.fallback) {
145
+ clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
146
+ }
147
+ else {
148
+ clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
149
+ }
150
+ if (opts.libName && opts.libVersion) {
151
+ clientHeader.push(`${opts.libName}/${opts.libVersion}`);
152
+ }
153
+ // Load the applicable protos.
154
+ this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
155
+ // This API contains "path templates"; forward-slash-separated
156
+ // identifiers to uniquely identify resources within the API.
157
+ // Create useful helper objects for these.
158
+ this.pathTemplates = {
159
+ adUnitPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/adUnits/{ad_unit}'),
160
+ companyPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/companies/{company}'),
161
+ contactPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/contacts/{contact}'),
162
+ customFieldPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/customFields/{custom_field}'),
163
+ customTargetingKeyPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/customTargetingKeys/{custom_targeting_key}'),
164
+ customTargetingValuePathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/customTargetingKeys/{custom_targeting_key}/customTargetingValues/{custom_targeting_value}'),
165
+ entitySignalsMappingPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/entitySignalsMappings/{entity_signals_mapping}'),
166
+ labelPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/labels/{label}'),
167
+ networkPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}'),
168
+ orderPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/orders/{order}'),
169
+ placementPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/placements/{placement}'),
170
+ reportPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/reports/{report}'),
171
+ rolePathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/roles/{role}'),
172
+ taxonomyCategoryPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/taxonomyCategories/{taxonomy_category}'),
173
+ teamPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/teams/{team}'),
174
+ userPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/users/{user}'),
175
+ };
176
+ // Some of the methods on this service return "paged" results,
177
+ // (e.g. 50 results at a time, with tokens to get subsequent
178
+ // pages). Denote the keys used for pagination and results.
179
+ this.descriptors.page = {
180
+ listCustomTargetingKeys: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customTargetingKeys'),
181
+ };
182
+ // Put together the default options sent with requests.
183
+ this._defaults = this._gaxGrpc.constructSettings('google.ads.admanager.v1.CustomTargetingKeyService', 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.customTargetingKeyServiceStub) {
205
+ return this.customTargetingKeyServiceStub;
206
+ }
207
+ // Put together the "service stub" for
208
+ // google.ads.admanager.v1.CustomTargetingKeyService.
209
+ this.customTargetingKeyServiceStub = this._gaxGrpc.createStub(this._opts.fallback
210
+ ? this._protos.lookupService('google.ads.admanager.v1.CustomTargetingKeyService')
211
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
212
+ this._protos.google.ads.admanager.v1
213
+ .CustomTargetingKeyService, this._opts, this._providedCustomServicePath);
214
+ // Iterate over each of the methods that the service provides
215
+ // and create an API call method for each.
216
+ const customTargetingKeyServiceStubMethods = [
217
+ 'getCustomTargetingKey',
218
+ 'listCustomTargetingKeys',
219
+ ];
220
+ for (const methodName of customTargetingKeyServiceStubMethods) {
221
+ const callPromise = this.customTargetingKeyServiceStub.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.customTargetingKeyServiceStub;
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
+ getCustomTargetingKey(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.getCustomTargetingKey(request, options, callback);
316
+ }
317
+ listCustomTargetingKeys(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.listCustomTargetingKeys(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 CustomTargetingKeys.
344
+ * Format: `networks/{network_code}`
345
+ * @param {number} [request.pageSize]
346
+ * Optional. The maximum number of `CustomTargetingKeys` to return. The
347
+ * service may return fewer than this value. If unspecified, at most 50
348
+ * `CustomTargetingKeys` will be returned. The maximum value is 1000; values
349
+ * above 1000 will be coerced to 1000.
350
+ * @param {string} [request.pageToken]
351
+ * Optional. A page token, received from a previous `ListCustomTargetingKeys`
352
+ * call. Provide this to retrieve the subsequent page.
353
+ *
354
+ * When paginating, all other parameters provided to `ListCustomTargetingKeys`
355
+ * must match 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.CustomTargetingKey|CustomTargetingKey} 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 `listCustomTargetingKeysAsync()`
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
+ listCustomTargetingKeysStream(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['listCustomTargetingKeys'];
388
+ const callSettings = defaultCallSettings.merge(options);
389
+ this.initialize();
390
+ return this.descriptors.page.listCustomTargetingKeys.createStream(this.innerApiCalls.listCustomTargetingKeys, request, callSettings);
391
+ }
392
+ /**
393
+ * Equivalent to `listCustomTargetingKeys`, 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 CustomTargetingKeys.
400
+ * Format: `networks/{network_code}`
401
+ * @param {number} [request.pageSize]
402
+ * Optional. The maximum number of `CustomTargetingKeys` to return. The
403
+ * service may return fewer than this value. If unspecified, at most 50
404
+ * `CustomTargetingKeys` will be returned. The maximum value is 1000; values
405
+ * above 1000 will be coerced to 1000.
406
+ * @param {string} [request.pageToken]
407
+ * Optional. A page token, received from a previous `ListCustomTargetingKeys`
408
+ * call. Provide this to retrieve the subsequent page.
409
+ *
410
+ * When paginating, all other parameters provided to `ListCustomTargetingKeys`
411
+ * must match 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.CustomTargetingKey|CustomTargetingKey}. 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/custom_targeting_key_service.list_custom_targeting_keys.js</caption>
432
+ * region_tag:admanager_v1_generated_CustomTargetingKeyService_ListCustomTargetingKeys_async
433
+ */
434
+ listCustomTargetingKeysAsync(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['listCustomTargetingKeys'];
445
+ const callSettings = defaultCallSettings.merge(options);
446
+ this.initialize();
447
+ return this.descriptors.page.listCustomTargetingKeys.asyncIterate(this.innerApiCalls['listCustomTargetingKeys'], request, callSettings);
448
+ }
449
+ // --------------------
450
+ // -- Path templates --
451
+ // --------------------
452
+ /**
453
+ * Return a fully-qualified adUnit resource name string.
454
+ *
455
+ * @param {string} network_code
456
+ * @param {string} ad_unit
457
+ * @returns {string} Resource name string.
458
+ */
459
+ adUnitPath(networkCode, adUnit) {
460
+ return this.pathTemplates.adUnitPathTemplate.render({
461
+ network_code: networkCode,
462
+ ad_unit: adUnit,
463
+ });
464
+ }
465
+ /**
466
+ * Parse the network_code from AdUnit resource.
467
+ *
468
+ * @param {string} adUnitName
469
+ * A fully-qualified path representing AdUnit resource.
470
+ * @returns {string} A string representing the network_code.
471
+ */
472
+ matchNetworkCodeFromAdUnitName(adUnitName) {
473
+ return this.pathTemplates.adUnitPathTemplate.match(adUnitName).network_code;
474
+ }
475
+ /**
476
+ * Parse the ad_unit from AdUnit resource.
477
+ *
478
+ * @param {string} adUnitName
479
+ * A fully-qualified path representing AdUnit resource.
480
+ * @returns {string} A string representing the ad_unit.
481
+ */
482
+ matchAdUnitFromAdUnitName(adUnitName) {
483
+ return this.pathTemplates.adUnitPathTemplate.match(adUnitName).ad_unit;
484
+ }
485
+ /**
486
+ * Return a fully-qualified company resource name string.
487
+ *
488
+ * @param {string} network_code
489
+ * @param {string} company
490
+ * @returns {string} Resource name string.
491
+ */
492
+ companyPath(networkCode, company) {
493
+ return this.pathTemplates.companyPathTemplate.render({
494
+ network_code: networkCode,
495
+ company: company,
496
+ });
497
+ }
498
+ /**
499
+ * Parse the network_code from Company resource.
500
+ *
501
+ * @param {string} companyName
502
+ * A fully-qualified path representing Company resource.
503
+ * @returns {string} A string representing the network_code.
504
+ */
505
+ matchNetworkCodeFromCompanyName(companyName) {
506
+ return this.pathTemplates.companyPathTemplate.match(companyName)
507
+ .network_code;
508
+ }
509
+ /**
510
+ * Parse the company from Company resource.
511
+ *
512
+ * @param {string} companyName
513
+ * A fully-qualified path representing Company resource.
514
+ * @returns {string} A string representing the company.
515
+ */
516
+ matchCompanyFromCompanyName(companyName) {
517
+ return this.pathTemplates.companyPathTemplate.match(companyName).company;
518
+ }
519
+ /**
520
+ * Return a fully-qualified contact resource name string.
521
+ *
522
+ * @param {string} network_code
523
+ * @param {string} contact
524
+ * @returns {string} Resource name string.
525
+ */
526
+ contactPath(networkCode, contact) {
527
+ return this.pathTemplates.contactPathTemplate.render({
528
+ network_code: networkCode,
529
+ contact: contact,
530
+ });
531
+ }
532
+ /**
533
+ * Parse the network_code from Contact resource.
534
+ *
535
+ * @param {string} contactName
536
+ * A fully-qualified path representing Contact resource.
537
+ * @returns {string} A string representing the network_code.
538
+ */
539
+ matchNetworkCodeFromContactName(contactName) {
540
+ return this.pathTemplates.contactPathTemplate.match(contactName)
541
+ .network_code;
542
+ }
543
+ /**
544
+ * Parse the contact from Contact resource.
545
+ *
546
+ * @param {string} contactName
547
+ * A fully-qualified path representing Contact resource.
548
+ * @returns {string} A string representing the contact.
549
+ */
550
+ matchContactFromContactName(contactName) {
551
+ return this.pathTemplates.contactPathTemplate.match(contactName).contact;
552
+ }
553
+ /**
554
+ * Return a fully-qualified customField resource name string.
555
+ *
556
+ * @param {string} network_code
557
+ * @param {string} custom_field
558
+ * @returns {string} Resource name string.
559
+ */
560
+ customFieldPath(networkCode, customField) {
561
+ return this.pathTemplates.customFieldPathTemplate.render({
562
+ network_code: networkCode,
563
+ custom_field: customField,
564
+ });
565
+ }
566
+ /**
567
+ * Parse the network_code from CustomField resource.
568
+ *
569
+ * @param {string} customFieldName
570
+ * A fully-qualified path representing CustomField resource.
571
+ * @returns {string} A string representing the network_code.
572
+ */
573
+ matchNetworkCodeFromCustomFieldName(customFieldName) {
574
+ return this.pathTemplates.customFieldPathTemplate.match(customFieldName)
575
+ .network_code;
576
+ }
577
+ /**
578
+ * Parse the custom_field from CustomField resource.
579
+ *
580
+ * @param {string} customFieldName
581
+ * A fully-qualified path representing CustomField resource.
582
+ * @returns {string} A string representing the custom_field.
583
+ */
584
+ matchCustomFieldFromCustomFieldName(customFieldName) {
585
+ return this.pathTemplates.customFieldPathTemplate.match(customFieldName)
586
+ .custom_field;
587
+ }
588
+ /**
589
+ * Return a fully-qualified customTargetingKey resource name string.
590
+ *
591
+ * @param {string} network_code
592
+ * @param {string} custom_targeting_key
593
+ * @returns {string} Resource name string.
594
+ */
595
+ customTargetingKeyPath(networkCode, customTargetingKey) {
596
+ return this.pathTemplates.customTargetingKeyPathTemplate.render({
597
+ network_code: networkCode,
598
+ custom_targeting_key: customTargetingKey,
599
+ });
600
+ }
601
+ /**
602
+ * Parse the network_code from CustomTargetingKey resource.
603
+ *
604
+ * @param {string} customTargetingKeyName
605
+ * A fully-qualified path representing CustomTargetingKey resource.
606
+ * @returns {string} A string representing the network_code.
607
+ */
608
+ matchNetworkCodeFromCustomTargetingKeyName(customTargetingKeyName) {
609
+ return this.pathTemplates.customTargetingKeyPathTemplate.match(customTargetingKeyName).network_code;
610
+ }
611
+ /**
612
+ * Parse the custom_targeting_key from CustomTargetingKey resource.
613
+ *
614
+ * @param {string} customTargetingKeyName
615
+ * A fully-qualified path representing CustomTargetingKey resource.
616
+ * @returns {string} A string representing the custom_targeting_key.
617
+ */
618
+ matchCustomTargetingKeyFromCustomTargetingKeyName(customTargetingKeyName) {
619
+ return this.pathTemplates.customTargetingKeyPathTemplate.match(customTargetingKeyName).custom_targeting_key;
620
+ }
621
+ /**
622
+ * Return a fully-qualified customTargetingValue resource name string.
623
+ *
624
+ * @param {string} network_code
625
+ * @param {string} custom_targeting_key
626
+ * @param {string} custom_targeting_value
627
+ * @returns {string} Resource name string.
628
+ */
629
+ customTargetingValuePath(networkCode, customTargetingKey, customTargetingValue) {
630
+ return this.pathTemplates.customTargetingValuePathTemplate.render({
631
+ network_code: networkCode,
632
+ custom_targeting_key: customTargetingKey,
633
+ custom_targeting_value: customTargetingValue,
634
+ });
635
+ }
636
+ /**
637
+ * Parse the network_code from CustomTargetingValue resource.
638
+ *
639
+ * @param {string} customTargetingValueName
640
+ * A fully-qualified path representing CustomTargetingValue resource.
641
+ * @returns {string} A string representing the network_code.
642
+ */
643
+ matchNetworkCodeFromCustomTargetingValueName(customTargetingValueName) {
644
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).network_code;
645
+ }
646
+ /**
647
+ * Parse the custom_targeting_key from CustomTargetingValue resource.
648
+ *
649
+ * @param {string} customTargetingValueName
650
+ * A fully-qualified path representing CustomTargetingValue resource.
651
+ * @returns {string} A string representing the custom_targeting_key.
652
+ */
653
+ matchCustomTargetingKeyFromCustomTargetingValueName(customTargetingValueName) {
654
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).custom_targeting_key;
655
+ }
656
+ /**
657
+ * Parse the custom_targeting_value from CustomTargetingValue resource.
658
+ *
659
+ * @param {string} customTargetingValueName
660
+ * A fully-qualified path representing CustomTargetingValue resource.
661
+ * @returns {string} A string representing the custom_targeting_value.
662
+ */
663
+ matchCustomTargetingValueFromCustomTargetingValueName(customTargetingValueName) {
664
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).custom_targeting_value;
665
+ }
666
+ /**
667
+ * Return a fully-qualified entitySignalsMapping resource name string.
668
+ *
669
+ * @param {string} network_code
670
+ * @param {string} entity_signals_mapping
671
+ * @returns {string} Resource name string.
672
+ */
673
+ entitySignalsMappingPath(networkCode, entitySignalsMapping) {
674
+ return this.pathTemplates.entitySignalsMappingPathTemplate.render({
675
+ network_code: networkCode,
676
+ entity_signals_mapping: entitySignalsMapping,
677
+ });
678
+ }
679
+ /**
680
+ * Parse the network_code from EntitySignalsMapping resource.
681
+ *
682
+ * @param {string} entitySignalsMappingName
683
+ * A fully-qualified path representing EntitySignalsMapping resource.
684
+ * @returns {string} A string representing the network_code.
685
+ */
686
+ matchNetworkCodeFromEntitySignalsMappingName(entitySignalsMappingName) {
687
+ return this.pathTemplates.entitySignalsMappingPathTemplate.match(entitySignalsMappingName).network_code;
688
+ }
689
+ /**
690
+ * Parse the entity_signals_mapping from EntitySignalsMapping resource.
691
+ *
692
+ * @param {string} entitySignalsMappingName
693
+ * A fully-qualified path representing EntitySignalsMapping resource.
694
+ * @returns {string} A string representing the entity_signals_mapping.
695
+ */
696
+ matchEntitySignalsMappingFromEntitySignalsMappingName(entitySignalsMappingName) {
697
+ return this.pathTemplates.entitySignalsMappingPathTemplate.match(entitySignalsMappingName).entity_signals_mapping;
698
+ }
699
+ /**
700
+ * Return a fully-qualified label resource name string.
701
+ *
702
+ * @param {string} network_code
703
+ * @param {string} label
704
+ * @returns {string} Resource name string.
705
+ */
706
+ labelPath(networkCode, label) {
707
+ return this.pathTemplates.labelPathTemplate.render({
708
+ network_code: networkCode,
709
+ label: label,
710
+ });
711
+ }
712
+ /**
713
+ * Parse the network_code from Label resource.
714
+ *
715
+ * @param {string} labelName
716
+ * A fully-qualified path representing Label resource.
717
+ * @returns {string} A string representing the network_code.
718
+ */
719
+ matchNetworkCodeFromLabelName(labelName) {
720
+ return this.pathTemplates.labelPathTemplate.match(labelName).network_code;
721
+ }
722
+ /**
723
+ * Parse the label from Label resource.
724
+ *
725
+ * @param {string} labelName
726
+ * A fully-qualified path representing Label resource.
727
+ * @returns {string} A string representing the label.
728
+ */
729
+ matchLabelFromLabelName(labelName) {
730
+ return this.pathTemplates.labelPathTemplate.match(labelName).label;
731
+ }
732
+ /**
733
+ * Return a fully-qualified network resource name string.
734
+ *
735
+ * @param {string} network_code
736
+ * @returns {string} Resource name string.
737
+ */
738
+ networkPath(networkCode) {
739
+ return this.pathTemplates.networkPathTemplate.render({
740
+ network_code: networkCode,
741
+ });
742
+ }
743
+ /**
744
+ * Parse the network_code from Network resource.
745
+ *
746
+ * @param {string} networkName
747
+ * A fully-qualified path representing Network resource.
748
+ * @returns {string} A string representing the network_code.
749
+ */
750
+ matchNetworkCodeFromNetworkName(networkName) {
751
+ return this.pathTemplates.networkPathTemplate.match(networkName)
752
+ .network_code;
753
+ }
754
+ /**
755
+ * Return a fully-qualified order resource name string.
756
+ *
757
+ * @param {string} network_code
758
+ * @param {string} order
759
+ * @returns {string} Resource name string.
760
+ */
761
+ orderPath(networkCode, order) {
762
+ return this.pathTemplates.orderPathTemplate.render({
763
+ network_code: networkCode,
764
+ order: order,
765
+ });
766
+ }
767
+ /**
768
+ * Parse the network_code from Order resource.
769
+ *
770
+ * @param {string} orderName
771
+ * A fully-qualified path representing Order resource.
772
+ * @returns {string} A string representing the network_code.
773
+ */
774
+ matchNetworkCodeFromOrderName(orderName) {
775
+ return this.pathTemplates.orderPathTemplate.match(orderName).network_code;
776
+ }
777
+ /**
778
+ * Parse the order from Order resource.
779
+ *
780
+ * @param {string} orderName
781
+ * A fully-qualified path representing Order resource.
782
+ * @returns {string} A string representing the order.
783
+ */
784
+ matchOrderFromOrderName(orderName) {
785
+ return this.pathTemplates.orderPathTemplate.match(orderName).order;
786
+ }
787
+ /**
788
+ * Return a fully-qualified placement resource name string.
789
+ *
790
+ * @param {string} network_code
791
+ * @param {string} placement
792
+ * @returns {string} Resource name string.
793
+ */
794
+ placementPath(networkCode, placement) {
795
+ return this.pathTemplates.placementPathTemplate.render({
796
+ network_code: networkCode,
797
+ placement: placement,
798
+ });
799
+ }
800
+ /**
801
+ * Parse the network_code from Placement resource.
802
+ *
803
+ * @param {string} placementName
804
+ * A fully-qualified path representing Placement resource.
805
+ * @returns {string} A string representing the network_code.
806
+ */
807
+ matchNetworkCodeFromPlacementName(placementName) {
808
+ return this.pathTemplates.placementPathTemplate.match(placementName)
809
+ .network_code;
810
+ }
811
+ /**
812
+ * Parse the placement from Placement resource.
813
+ *
814
+ * @param {string} placementName
815
+ * A fully-qualified path representing Placement resource.
816
+ * @returns {string} A string representing the placement.
817
+ */
818
+ matchPlacementFromPlacementName(placementName) {
819
+ return this.pathTemplates.placementPathTemplate.match(placementName)
820
+ .placement;
821
+ }
822
+ /**
823
+ * Return a fully-qualified report resource name string.
824
+ *
825
+ * @param {string} network_code
826
+ * @param {string} report
827
+ * @returns {string} Resource name string.
828
+ */
829
+ reportPath(networkCode, report) {
830
+ return this.pathTemplates.reportPathTemplate.render({
831
+ network_code: networkCode,
832
+ report: report,
833
+ });
834
+ }
835
+ /**
836
+ * Parse the network_code from Report resource.
837
+ *
838
+ * @param {string} reportName
839
+ * A fully-qualified path representing Report resource.
840
+ * @returns {string} A string representing the network_code.
841
+ */
842
+ matchNetworkCodeFromReportName(reportName) {
843
+ return this.pathTemplates.reportPathTemplate.match(reportName).network_code;
844
+ }
845
+ /**
846
+ * Parse the report from Report resource.
847
+ *
848
+ * @param {string} reportName
849
+ * A fully-qualified path representing Report resource.
850
+ * @returns {string} A string representing the report.
851
+ */
852
+ matchReportFromReportName(reportName) {
853
+ return this.pathTemplates.reportPathTemplate.match(reportName).report;
854
+ }
855
+ /**
856
+ * Return a fully-qualified role resource name string.
857
+ *
858
+ * @param {string} network_code
859
+ * @param {string} role
860
+ * @returns {string} Resource name string.
861
+ */
862
+ rolePath(networkCode, role) {
863
+ return this.pathTemplates.rolePathTemplate.render({
864
+ network_code: networkCode,
865
+ role: role,
866
+ });
867
+ }
868
+ /**
869
+ * Parse the network_code from Role resource.
870
+ *
871
+ * @param {string} roleName
872
+ * A fully-qualified path representing Role resource.
873
+ * @returns {string} A string representing the network_code.
874
+ */
875
+ matchNetworkCodeFromRoleName(roleName) {
876
+ return this.pathTemplates.rolePathTemplate.match(roleName).network_code;
877
+ }
878
+ /**
879
+ * Parse the role from Role resource.
880
+ *
881
+ * @param {string} roleName
882
+ * A fully-qualified path representing Role resource.
883
+ * @returns {string} A string representing the role.
884
+ */
885
+ matchRoleFromRoleName(roleName) {
886
+ return this.pathTemplates.rolePathTemplate.match(roleName).role;
887
+ }
888
+ /**
889
+ * Return a fully-qualified taxonomyCategory resource name string.
890
+ *
891
+ * @param {string} network_code
892
+ * @param {string} taxonomy_category
893
+ * @returns {string} Resource name string.
894
+ */
895
+ taxonomyCategoryPath(networkCode, taxonomyCategory) {
896
+ return this.pathTemplates.taxonomyCategoryPathTemplate.render({
897
+ network_code: networkCode,
898
+ taxonomy_category: taxonomyCategory,
899
+ });
900
+ }
901
+ /**
902
+ * Parse the network_code from TaxonomyCategory resource.
903
+ *
904
+ * @param {string} taxonomyCategoryName
905
+ * A fully-qualified path representing TaxonomyCategory resource.
906
+ * @returns {string} A string representing the network_code.
907
+ */
908
+ matchNetworkCodeFromTaxonomyCategoryName(taxonomyCategoryName) {
909
+ return this.pathTemplates.taxonomyCategoryPathTemplate.match(taxonomyCategoryName).network_code;
910
+ }
911
+ /**
912
+ * Parse the taxonomy_category from TaxonomyCategory resource.
913
+ *
914
+ * @param {string} taxonomyCategoryName
915
+ * A fully-qualified path representing TaxonomyCategory resource.
916
+ * @returns {string} A string representing the taxonomy_category.
917
+ */
918
+ matchTaxonomyCategoryFromTaxonomyCategoryName(taxonomyCategoryName) {
919
+ return this.pathTemplates.taxonomyCategoryPathTemplate.match(taxonomyCategoryName).taxonomy_category;
920
+ }
921
+ /**
922
+ * Return a fully-qualified team resource name string.
923
+ *
924
+ * @param {string} network_code
925
+ * @param {string} team
926
+ * @returns {string} Resource name string.
927
+ */
928
+ teamPath(networkCode, team) {
929
+ return this.pathTemplates.teamPathTemplate.render({
930
+ network_code: networkCode,
931
+ team: team,
932
+ });
933
+ }
934
+ /**
935
+ * Parse the network_code from Team resource.
936
+ *
937
+ * @param {string} teamName
938
+ * A fully-qualified path representing Team resource.
939
+ * @returns {string} A string representing the network_code.
940
+ */
941
+ matchNetworkCodeFromTeamName(teamName) {
942
+ return this.pathTemplates.teamPathTemplate.match(teamName).network_code;
943
+ }
944
+ /**
945
+ * Parse the team from Team resource.
946
+ *
947
+ * @param {string} teamName
948
+ * A fully-qualified path representing Team resource.
949
+ * @returns {string} A string representing the team.
950
+ */
951
+ matchTeamFromTeamName(teamName) {
952
+ return this.pathTemplates.teamPathTemplate.match(teamName).team;
953
+ }
954
+ /**
955
+ * Return a fully-qualified user resource name string.
956
+ *
957
+ * @param {string} network_code
958
+ * @param {string} user
959
+ * @returns {string} Resource name string.
960
+ */
961
+ userPath(networkCode, user) {
962
+ return this.pathTemplates.userPathTemplate.render({
963
+ network_code: networkCode,
964
+ user: user,
965
+ });
966
+ }
967
+ /**
968
+ * Parse the network_code from User resource.
969
+ *
970
+ * @param {string} userName
971
+ * A fully-qualified path representing User resource.
972
+ * @returns {string} A string representing the network_code.
973
+ */
974
+ matchNetworkCodeFromUserName(userName) {
975
+ return this.pathTemplates.userPathTemplate.match(userName).network_code;
976
+ }
977
+ /**
978
+ * Parse the user from User resource.
979
+ *
980
+ * @param {string} userName
981
+ * A fully-qualified path representing User resource.
982
+ * @returns {string} A string representing the user.
983
+ */
984
+ matchUserFromUserName(userName) {
985
+ return this.pathTemplates.userPathTemplate.match(userName).user;
986
+ }
987
+ /**
988
+ * Terminate the gRPC channel and close the client.
989
+ *
990
+ * The client will no longer be usable and all future behavior is undefined.
991
+ * @returns {Promise} A promise that resolves when the client is closed.
992
+ */
993
+ close() {
994
+ if (this.customTargetingKeyServiceStub && !this._terminated) {
995
+ return this.customTargetingKeyServiceStub.then(stub => {
996
+ this._terminated = true;
997
+ stub.close();
998
+ });
999
+ }
1000
+ return Promise.resolve();
1001
+ }
1002
+ }
1003
+ exports.CustomTargetingKeyServiceClient = CustomTargetingKeyServiceClient;
1004
+ //# sourceMappingURL=custom_targeting_key_service_client.js.map