@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,1010 @@
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.CustomTargetingValueServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1/custom_targeting_value_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_value_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Provides methods for handling `CustomTargetingValue` objects.
31
+ * @class
32
+ * @memberof v1
33
+ */
34
+ class CustomTargetingValueServiceClient {
35
+ /**
36
+ * Construct an instance of CustomTargetingValueServiceClient.
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 CustomTargetingValueServiceClient({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
+ listCustomTargetingValues: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'customTargetingValues'),
181
+ };
182
+ // Put together the default options sent with requests.
183
+ this._defaults = this._gaxGrpc.constructSettings('google.ads.admanager.v1.CustomTargetingValueService', 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.customTargetingValueServiceStub) {
205
+ return this.customTargetingValueServiceStub;
206
+ }
207
+ // Put together the "service stub" for
208
+ // google.ads.admanager.v1.CustomTargetingValueService.
209
+ this.customTargetingValueServiceStub = this._gaxGrpc.createStub(this._opts.fallback
210
+ ? this._protos.lookupService('google.ads.admanager.v1.CustomTargetingValueService')
211
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
212
+ this._protos.google.ads.admanager.v1
213
+ .CustomTargetingValueService, 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 customTargetingValueServiceStubMethods = [
217
+ 'getCustomTargetingValue',
218
+ 'listCustomTargetingValues',
219
+ ];
220
+ for (const methodName of customTargetingValueServiceStubMethods) {
221
+ const callPromise = this.customTargetingValueServiceStub.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.customTargetingValueServiceStub;
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
+ getCustomTargetingValue(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.getCustomTargetingValue(request, options, callback);
316
+ }
317
+ listCustomTargetingValues(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.listCustomTargetingValues(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 CustomTargetingValues.
344
+ * Format:
345
+ * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}`
346
+ * @param {number} [request.pageSize]
347
+ * Optional. The maximum number of `CustomTargetingValues` to return. The
348
+ * service may return fewer than this value. If unspecified, at most 50
349
+ * `CustomTargetingValues` will be returned. The maximum value is 1000; values
350
+ * above 1000 will be coerced to 1000.
351
+ * @param {string} [request.pageToken]
352
+ * Optional. A page token, received from a previous
353
+ * `ListCustomTargetingValues` call. Provide this to retrieve the subsequent
354
+ * page.
355
+ *
356
+ * When paginating, all other parameters provided to
357
+ * `ListCustomTargetingValues` must match the call that provided the page
358
+ * token.
359
+ * @param {string} [request.filter]
360
+ * Optional. Expression to filter the response.
361
+ * See syntax details at
362
+ * https://developers.google.com/ad-manager/api/beta/filters
363
+ * @param {string} [request.orderBy]
364
+ * Optional. Expression to specify sorting order.
365
+ * See syntax details at
366
+ * https://developers.google.com/ad-manager/api/beta/filters#order
367
+ * @param {number} [request.skip]
368
+ * Optional. Number of individual resources to skip while paginating.
369
+ * @param {object} [options]
370
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
371
+ * @returns {Stream}
372
+ * An object stream which emits an object representing {@link protos.google.ads.admanager.v1.CustomTargetingValue|CustomTargetingValue} on 'data' event.
373
+ * The client library will perform auto-pagination by default: it will call the API as many
374
+ * times as needed. Note that it can affect your quota.
375
+ * We recommend using `listCustomTargetingValuesAsync()`
376
+ * method described below for async iteration which you can stop as needed.
377
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
378
+ * for more details and examples.
379
+ */
380
+ listCustomTargetingValuesStream(request, options) {
381
+ var _a;
382
+ request = request || {};
383
+ options = options || {};
384
+ options.otherArgs = options.otherArgs || {};
385
+ options.otherArgs.headers = options.otherArgs.headers || {};
386
+ options.otherArgs.headers['x-goog-request-params'] =
387
+ this._gaxModule.routingHeader.fromParams({
388
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
389
+ });
390
+ const defaultCallSettings = this._defaults['listCustomTargetingValues'];
391
+ const callSettings = defaultCallSettings.merge(options);
392
+ this.initialize();
393
+ return this.descriptors.page.listCustomTargetingValues.createStream(this.innerApiCalls.listCustomTargetingValues, request, callSettings);
394
+ }
395
+ /**
396
+ * Equivalent to `listCustomTargetingValues`, but returns an iterable object.
397
+ *
398
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
399
+ * @param {Object} request
400
+ * The request object that will be sent.
401
+ * @param {string} request.parent
402
+ * Required. The parent, which owns this collection of CustomTargetingValues.
403
+ * Format:
404
+ * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}`
405
+ * @param {number} [request.pageSize]
406
+ * Optional. The maximum number of `CustomTargetingValues` to return. The
407
+ * service may return fewer than this value. If unspecified, at most 50
408
+ * `CustomTargetingValues` will be returned. The maximum value is 1000; values
409
+ * above 1000 will be coerced to 1000.
410
+ * @param {string} [request.pageToken]
411
+ * Optional. A page token, received from a previous
412
+ * `ListCustomTargetingValues` call. Provide this to retrieve the subsequent
413
+ * page.
414
+ *
415
+ * When paginating, all other parameters provided to
416
+ * `ListCustomTargetingValues` must match the call that provided the page
417
+ * token.
418
+ * @param {string} [request.filter]
419
+ * Optional. Expression to filter the response.
420
+ * See syntax details at
421
+ * https://developers.google.com/ad-manager/api/beta/filters
422
+ * @param {string} [request.orderBy]
423
+ * Optional. Expression to specify sorting order.
424
+ * See syntax details at
425
+ * https://developers.google.com/ad-manager/api/beta/filters#order
426
+ * @param {number} [request.skip]
427
+ * Optional. Number of individual resources to skip while paginating.
428
+ * @param {object} [options]
429
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
430
+ * @returns {Object}
431
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
432
+ * When you iterate the returned iterable, each element will be an object representing
433
+ * {@link protos.google.ads.admanager.v1.CustomTargetingValue|CustomTargetingValue}. The API will be called under the hood as needed, once per the page,
434
+ * so you can stop the iteration when you don't need more results.
435
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
436
+ * for more details and examples.
437
+ * @example <caption>include:samples/generated/v1/custom_targeting_value_service.list_custom_targeting_values.js</caption>
438
+ * region_tag:admanager_v1_generated_CustomTargetingValueService_ListCustomTargetingValues_async
439
+ */
440
+ listCustomTargetingValuesAsync(request, options) {
441
+ var _a;
442
+ request = request || {};
443
+ options = options || {};
444
+ options.otherArgs = options.otherArgs || {};
445
+ options.otherArgs.headers = options.otherArgs.headers || {};
446
+ options.otherArgs.headers['x-goog-request-params'] =
447
+ this._gaxModule.routingHeader.fromParams({
448
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
449
+ });
450
+ const defaultCallSettings = this._defaults['listCustomTargetingValues'];
451
+ const callSettings = defaultCallSettings.merge(options);
452
+ this.initialize();
453
+ return this.descriptors.page.listCustomTargetingValues.asyncIterate(this.innerApiCalls['listCustomTargetingValues'], request, callSettings);
454
+ }
455
+ // --------------------
456
+ // -- Path templates --
457
+ // --------------------
458
+ /**
459
+ * Return a fully-qualified adUnit resource name string.
460
+ *
461
+ * @param {string} network_code
462
+ * @param {string} ad_unit
463
+ * @returns {string} Resource name string.
464
+ */
465
+ adUnitPath(networkCode, adUnit) {
466
+ return this.pathTemplates.adUnitPathTemplate.render({
467
+ network_code: networkCode,
468
+ ad_unit: adUnit,
469
+ });
470
+ }
471
+ /**
472
+ * Parse the network_code from AdUnit resource.
473
+ *
474
+ * @param {string} adUnitName
475
+ * A fully-qualified path representing AdUnit resource.
476
+ * @returns {string} A string representing the network_code.
477
+ */
478
+ matchNetworkCodeFromAdUnitName(adUnitName) {
479
+ return this.pathTemplates.adUnitPathTemplate.match(adUnitName).network_code;
480
+ }
481
+ /**
482
+ * Parse the ad_unit from AdUnit resource.
483
+ *
484
+ * @param {string} adUnitName
485
+ * A fully-qualified path representing AdUnit resource.
486
+ * @returns {string} A string representing the ad_unit.
487
+ */
488
+ matchAdUnitFromAdUnitName(adUnitName) {
489
+ return this.pathTemplates.adUnitPathTemplate.match(adUnitName).ad_unit;
490
+ }
491
+ /**
492
+ * Return a fully-qualified company resource name string.
493
+ *
494
+ * @param {string} network_code
495
+ * @param {string} company
496
+ * @returns {string} Resource name string.
497
+ */
498
+ companyPath(networkCode, company) {
499
+ return this.pathTemplates.companyPathTemplate.render({
500
+ network_code: networkCode,
501
+ company: company,
502
+ });
503
+ }
504
+ /**
505
+ * Parse the network_code from Company resource.
506
+ *
507
+ * @param {string} companyName
508
+ * A fully-qualified path representing Company resource.
509
+ * @returns {string} A string representing the network_code.
510
+ */
511
+ matchNetworkCodeFromCompanyName(companyName) {
512
+ return this.pathTemplates.companyPathTemplate.match(companyName)
513
+ .network_code;
514
+ }
515
+ /**
516
+ * Parse the company from Company resource.
517
+ *
518
+ * @param {string} companyName
519
+ * A fully-qualified path representing Company resource.
520
+ * @returns {string} A string representing the company.
521
+ */
522
+ matchCompanyFromCompanyName(companyName) {
523
+ return this.pathTemplates.companyPathTemplate.match(companyName).company;
524
+ }
525
+ /**
526
+ * Return a fully-qualified contact resource name string.
527
+ *
528
+ * @param {string} network_code
529
+ * @param {string} contact
530
+ * @returns {string} Resource name string.
531
+ */
532
+ contactPath(networkCode, contact) {
533
+ return this.pathTemplates.contactPathTemplate.render({
534
+ network_code: networkCode,
535
+ contact: contact,
536
+ });
537
+ }
538
+ /**
539
+ * Parse the network_code from Contact resource.
540
+ *
541
+ * @param {string} contactName
542
+ * A fully-qualified path representing Contact resource.
543
+ * @returns {string} A string representing the network_code.
544
+ */
545
+ matchNetworkCodeFromContactName(contactName) {
546
+ return this.pathTemplates.contactPathTemplate.match(contactName)
547
+ .network_code;
548
+ }
549
+ /**
550
+ * Parse the contact from Contact resource.
551
+ *
552
+ * @param {string} contactName
553
+ * A fully-qualified path representing Contact resource.
554
+ * @returns {string} A string representing the contact.
555
+ */
556
+ matchContactFromContactName(contactName) {
557
+ return this.pathTemplates.contactPathTemplate.match(contactName).contact;
558
+ }
559
+ /**
560
+ * Return a fully-qualified customField resource name string.
561
+ *
562
+ * @param {string} network_code
563
+ * @param {string} custom_field
564
+ * @returns {string} Resource name string.
565
+ */
566
+ customFieldPath(networkCode, customField) {
567
+ return this.pathTemplates.customFieldPathTemplate.render({
568
+ network_code: networkCode,
569
+ custom_field: customField,
570
+ });
571
+ }
572
+ /**
573
+ * Parse the network_code from CustomField resource.
574
+ *
575
+ * @param {string} customFieldName
576
+ * A fully-qualified path representing CustomField resource.
577
+ * @returns {string} A string representing the network_code.
578
+ */
579
+ matchNetworkCodeFromCustomFieldName(customFieldName) {
580
+ return this.pathTemplates.customFieldPathTemplate.match(customFieldName)
581
+ .network_code;
582
+ }
583
+ /**
584
+ * Parse the custom_field from CustomField resource.
585
+ *
586
+ * @param {string} customFieldName
587
+ * A fully-qualified path representing CustomField resource.
588
+ * @returns {string} A string representing the custom_field.
589
+ */
590
+ matchCustomFieldFromCustomFieldName(customFieldName) {
591
+ return this.pathTemplates.customFieldPathTemplate.match(customFieldName)
592
+ .custom_field;
593
+ }
594
+ /**
595
+ * Return a fully-qualified customTargetingKey resource name string.
596
+ *
597
+ * @param {string} network_code
598
+ * @param {string} custom_targeting_key
599
+ * @returns {string} Resource name string.
600
+ */
601
+ customTargetingKeyPath(networkCode, customTargetingKey) {
602
+ return this.pathTemplates.customTargetingKeyPathTemplate.render({
603
+ network_code: networkCode,
604
+ custom_targeting_key: customTargetingKey,
605
+ });
606
+ }
607
+ /**
608
+ * Parse the network_code from CustomTargetingKey resource.
609
+ *
610
+ * @param {string} customTargetingKeyName
611
+ * A fully-qualified path representing CustomTargetingKey resource.
612
+ * @returns {string} A string representing the network_code.
613
+ */
614
+ matchNetworkCodeFromCustomTargetingKeyName(customTargetingKeyName) {
615
+ return this.pathTemplates.customTargetingKeyPathTemplate.match(customTargetingKeyName).network_code;
616
+ }
617
+ /**
618
+ * Parse the custom_targeting_key from CustomTargetingKey resource.
619
+ *
620
+ * @param {string} customTargetingKeyName
621
+ * A fully-qualified path representing CustomTargetingKey resource.
622
+ * @returns {string} A string representing the custom_targeting_key.
623
+ */
624
+ matchCustomTargetingKeyFromCustomTargetingKeyName(customTargetingKeyName) {
625
+ return this.pathTemplates.customTargetingKeyPathTemplate.match(customTargetingKeyName).custom_targeting_key;
626
+ }
627
+ /**
628
+ * Return a fully-qualified customTargetingValue resource name string.
629
+ *
630
+ * @param {string} network_code
631
+ * @param {string} custom_targeting_key
632
+ * @param {string} custom_targeting_value
633
+ * @returns {string} Resource name string.
634
+ */
635
+ customTargetingValuePath(networkCode, customTargetingKey, customTargetingValue) {
636
+ return this.pathTemplates.customTargetingValuePathTemplate.render({
637
+ network_code: networkCode,
638
+ custom_targeting_key: customTargetingKey,
639
+ custom_targeting_value: customTargetingValue,
640
+ });
641
+ }
642
+ /**
643
+ * Parse the network_code from CustomTargetingValue resource.
644
+ *
645
+ * @param {string} customTargetingValueName
646
+ * A fully-qualified path representing CustomTargetingValue resource.
647
+ * @returns {string} A string representing the network_code.
648
+ */
649
+ matchNetworkCodeFromCustomTargetingValueName(customTargetingValueName) {
650
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).network_code;
651
+ }
652
+ /**
653
+ * Parse the custom_targeting_key from CustomTargetingValue resource.
654
+ *
655
+ * @param {string} customTargetingValueName
656
+ * A fully-qualified path representing CustomTargetingValue resource.
657
+ * @returns {string} A string representing the custom_targeting_key.
658
+ */
659
+ matchCustomTargetingKeyFromCustomTargetingValueName(customTargetingValueName) {
660
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).custom_targeting_key;
661
+ }
662
+ /**
663
+ * Parse the custom_targeting_value from CustomTargetingValue resource.
664
+ *
665
+ * @param {string} customTargetingValueName
666
+ * A fully-qualified path representing CustomTargetingValue resource.
667
+ * @returns {string} A string representing the custom_targeting_value.
668
+ */
669
+ matchCustomTargetingValueFromCustomTargetingValueName(customTargetingValueName) {
670
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).custom_targeting_value;
671
+ }
672
+ /**
673
+ * Return a fully-qualified entitySignalsMapping resource name string.
674
+ *
675
+ * @param {string} network_code
676
+ * @param {string} entity_signals_mapping
677
+ * @returns {string} Resource name string.
678
+ */
679
+ entitySignalsMappingPath(networkCode, entitySignalsMapping) {
680
+ return this.pathTemplates.entitySignalsMappingPathTemplate.render({
681
+ network_code: networkCode,
682
+ entity_signals_mapping: entitySignalsMapping,
683
+ });
684
+ }
685
+ /**
686
+ * Parse the network_code from EntitySignalsMapping resource.
687
+ *
688
+ * @param {string} entitySignalsMappingName
689
+ * A fully-qualified path representing EntitySignalsMapping resource.
690
+ * @returns {string} A string representing the network_code.
691
+ */
692
+ matchNetworkCodeFromEntitySignalsMappingName(entitySignalsMappingName) {
693
+ return this.pathTemplates.entitySignalsMappingPathTemplate.match(entitySignalsMappingName).network_code;
694
+ }
695
+ /**
696
+ * Parse the entity_signals_mapping from EntitySignalsMapping resource.
697
+ *
698
+ * @param {string} entitySignalsMappingName
699
+ * A fully-qualified path representing EntitySignalsMapping resource.
700
+ * @returns {string} A string representing the entity_signals_mapping.
701
+ */
702
+ matchEntitySignalsMappingFromEntitySignalsMappingName(entitySignalsMappingName) {
703
+ return this.pathTemplates.entitySignalsMappingPathTemplate.match(entitySignalsMappingName).entity_signals_mapping;
704
+ }
705
+ /**
706
+ * Return a fully-qualified label resource name string.
707
+ *
708
+ * @param {string} network_code
709
+ * @param {string} label
710
+ * @returns {string} Resource name string.
711
+ */
712
+ labelPath(networkCode, label) {
713
+ return this.pathTemplates.labelPathTemplate.render({
714
+ network_code: networkCode,
715
+ label: label,
716
+ });
717
+ }
718
+ /**
719
+ * Parse the network_code from Label resource.
720
+ *
721
+ * @param {string} labelName
722
+ * A fully-qualified path representing Label resource.
723
+ * @returns {string} A string representing the network_code.
724
+ */
725
+ matchNetworkCodeFromLabelName(labelName) {
726
+ return this.pathTemplates.labelPathTemplate.match(labelName).network_code;
727
+ }
728
+ /**
729
+ * Parse the label from Label resource.
730
+ *
731
+ * @param {string} labelName
732
+ * A fully-qualified path representing Label resource.
733
+ * @returns {string} A string representing the label.
734
+ */
735
+ matchLabelFromLabelName(labelName) {
736
+ return this.pathTemplates.labelPathTemplate.match(labelName).label;
737
+ }
738
+ /**
739
+ * Return a fully-qualified network resource name string.
740
+ *
741
+ * @param {string} network_code
742
+ * @returns {string} Resource name string.
743
+ */
744
+ networkPath(networkCode) {
745
+ return this.pathTemplates.networkPathTemplate.render({
746
+ network_code: networkCode,
747
+ });
748
+ }
749
+ /**
750
+ * Parse the network_code from Network resource.
751
+ *
752
+ * @param {string} networkName
753
+ * A fully-qualified path representing Network resource.
754
+ * @returns {string} A string representing the network_code.
755
+ */
756
+ matchNetworkCodeFromNetworkName(networkName) {
757
+ return this.pathTemplates.networkPathTemplate.match(networkName)
758
+ .network_code;
759
+ }
760
+ /**
761
+ * Return a fully-qualified order resource name string.
762
+ *
763
+ * @param {string} network_code
764
+ * @param {string} order
765
+ * @returns {string} Resource name string.
766
+ */
767
+ orderPath(networkCode, order) {
768
+ return this.pathTemplates.orderPathTemplate.render({
769
+ network_code: networkCode,
770
+ order: order,
771
+ });
772
+ }
773
+ /**
774
+ * Parse the network_code from Order resource.
775
+ *
776
+ * @param {string} orderName
777
+ * A fully-qualified path representing Order resource.
778
+ * @returns {string} A string representing the network_code.
779
+ */
780
+ matchNetworkCodeFromOrderName(orderName) {
781
+ return this.pathTemplates.orderPathTemplate.match(orderName).network_code;
782
+ }
783
+ /**
784
+ * Parse the order from Order resource.
785
+ *
786
+ * @param {string} orderName
787
+ * A fully-qualified path representing Order resource.
788
+ * @returns {string} A string representing the order.
789
+ */
790
+ matchOrderFromOrderName(orderName) {
791
+ return this.pathTemplates.orderPathTemplate.match(orderName).order;
792
+ }
793
+ /**
794
+ * Return a fully-qualified placement resource name string.
795
+ *
796
+ * @param {string} network_code
797
+ * @param {string} placement
798
+ * @returns {string} Resource name string.
799
+ */
800
+ placementPath(networkCode, placement) {
801
+ return this.pathTemplates.placementPathTemplate.render({
802
+ network_code: networkCode,
803
+ placement: placement,
804
+ });
805
+ }
806
+ /**
807
+ * Parse the network_code from Placement resource.
808
+ *
809
+ * @param {string} placementName
810
+ * A fully-qualified path representing Placement resource.
811
+ * @returns {string} A string representing the network_code.
812
+ */
813
+ matchNetworkCodeFromPlacementName(placementName) {
814
+ return this.pathTemplates.placementPathTemplate.match(placementName)
815
+ .network_code;
816
+ }
817
+ /**
818
+ * Parse the placement from Placement resource.
819
+ *
820
+ * @param {string} placementName
821
+ * A fully-qualified path representing Placement resource.
822
+ * @returns {string} A string representing the placement.
823
+ */
824
+ matchPlacementFromPlacementName(placementName) {
825
+ return this.pathTemplates.placementPathTemplate.match(placementName)
826
+ .placement;
827
+ }
828
+ /**
829
+ * Return a fully-qualified report resource name string.
830
+ *
831
+ * @param {string} network_code
832
+ * @param {string} report
833
+ * @returns {string} Resource name string.
834
+ */
835
+ reportPath(networkCode, report) {
836
+ return this.pathTemplates.reportPathTemplate.render({
837
+ network_code: networkCode,
838
+ report: report,
839
+ });
840
+ }
841
+ /**
842
+ * Parse the network_code from Report resource.
843
+ *
844
+ * @param {string} reportName
845
+ * A fully-qualified path representing Report resource.
846
+ * @returns {string} A string representing the network_code.
847
+ */
848
+ matchNetworkCodeFromReportName(reportName) {
849
+ return this.pathTemplates.reportPathTemplate.match(reportName).network_code;
850
+ }
851
+ /**
852
+ * Parse the report from Report resource.
853
+ *
854
+ * @param {string} reportName
855
+ * A fully-qualified path representing Report resource.
856
+ * @returns {string} A string representing the report.
857
+ */
858
+ matchReportFromReportName(reportName) {
859
+ return this.pathTemplates.reportPathTemplate.match(reportName).report;
860
+ }
861
+ /**
862
+ * Return a fully-qualified role resource name string.
863
+ *
864
+ * @param {string} network_code
865
+ * @param {string} role
866
+ * @returns {string} Resource name string.
867
+ */
868
+ rolePath(networkCode, role) {
869
+ return this.pathTemplates.rolePathTemplate.render({
870
+ network_code: networkCode,
871
+ role: role,
872
+ });
873
+ }
874
+ /**
875
+ * Parse the network_code from Role resource.
876
+ *
877
+ * @param {string} roleName
878
+ * A fully-qualified path representing Role resource.
879
+ * @returns {string} A string representing the network_code.
880
+ */
881
+ matchNetworkCodeFromRoleName(roleName) {
882
+ return this.pathTemplates.rolePathTemplate.match(roleName).network_code;
883
+ }
884
+ /**
885
+ * Parse the role from Role resource.
886
+ *
887
+ * @param {string} roleName
888
+ * A fully-qualified path representing Role resource.
889
+ * @returns {string} A string representing the role.
890
+ */
891
+ matchRoleFromRoleName(roleName) {
892
+ return this.pathTemplates.rolePathTemplate.match(roleName).role;
893
+ }
894
+ /**
895
+ * Return a fully-qualified taxonomyCategory resource name string.
896
+ *
897
+ * @param {string} network_code
898
+ * @param {string} taxonomy_category
899
+ * @returns {string} Resource name string.
900
+ */
901
+ taxonomyCategoryPath(networkCode, taxonomyCategory) {
902
+ return this.pathTemplates.taxonomyCategoryPathTemplate.render({
903
+ network_code: networkCode,
904
+ taxonomy_category: taxonomyCategory,
905
+ });
906
+ }
907
+ /**
908
+ * Parse the network_code from TaxonomyCategory resource.
909
+ *
910
+ * @param {string} taxonomyCategoryName
911
+ * A fully-qualified path representing TaxonomyCategory resource.
912
+ * @returns {string} A string representing the network_code.
913
+ */
914
+ matchNetworkCodeFromTaxonomyCategoryName(taxonomyCategoryName) {
915
+ return this.pathTemplates.taxonomyCategoryPathTemplate.match(taxonomyCategoryName).network_code;
916
+ }
917
+ /**
918
+ * Parse the taxonomy_category from TaxonomyCategory resource.
919
+ *
920
+ * @param {string} taxonomyCategoryName
921
+ * A fully-qualified path representing TaxonomyCategory resource.
922
+ * @returns {string} A string representing the taxonomy_category.
923
+ */
924
+ matchTaxonomyCategoryFromTaxonomyCategoryName(taxonomyCategoryName) {
925
+ return this.pathTemplates.taxonomyCategoryPathTemplate.match(taxonomyCategoryName).taxonomy_category;
926
+ }
927
+ /**
928
+ * Return a fully-qualified team resource name string.
929
+ *
930
+ * @param {string} network_code
931
+ * @param {string} team
932
+ * @returns {string} Resource name string.
933
+ */
934
+ teamPath(networkCode, team) {
935
+ return this.pathTemplates.teamPathTemplate.render({
936
+ network_code: networkCode,
937
+ team: team,
938
+ });
939
+ }
940
+ /**
941
+ * Parse the network_code from Team resource.
942
+ *
943
+ * @param {string} teamName
944
+ * A fully-qualified path representing Team resource.
945
+ * @returns {string} A string representing the network_code.
946
+ */
947
+ matchNetworkCodeFromTeamName(teamName) {
948
+ return this.pathTemplates.teamPathTemplate.match(teamName).network_code;
949
+ }
950
+ /**
951
+ * Parse the team from Team resource.
952
+ *
953
+ * @param {string} teamName
954
+ * A fully-qualified path representing Team resource.
955
+ * @returns {string} A string representing the team.
956
+ */
957
+ matchTeamFromTeamName(teamName) {
958
+ return this.pathTemplates.teamPathTemplate.match(teamName).team;
959
+ }
960
+ /**
961
+ * Return a fully-qualified user resource name string.
962
+ *
963
+ * @param {string} network_code
964
+ * @param {string} user
965
+ * @returns {string} Resource name string.
966
+ */
967
+ userPath(networkCode, user) {
968
+ return this.pathTemplates.userPathTemplate.render({
969
+ network_code: networkCode,
970
+ user: user,
971
+ });
972
+ }
973
+ /**
974
+ * Parse the network_code from User resource.
975
+ *
976
+ * @param {string} userName
977
+ * A fully-qualified path representing User resource.
978
+ * @returns {string} A string representing the network_code.
979
+ */
980
+ matchNetworkCodeFromUserName(userName) {
981
+ return this.pathTemplates.userPathTemplate.match(userName).network_code;
982
+ }
983
+ /**
984
+ * Parse the user from User resource.
985
+ *
986
+ * @param {string} userName
987
+ * A fully-qualified path representing User resource.
988
+ * @returns {string} A string representing the user.
989
+ */
990
+ matchUserFromUserName(userName) {
991
+ return this.pathTemplates.userPathTemplate.match(userName).user;
992
+ }
993
+ /**
994
+ * Terminate the gRPC channel and close the client.
995
+ *
996
+ * The client will no longer be usable and all future behavior is undefined.
997
+ * @returns {Promise} A promise that resolves when the client is closed.
998
+ */
999
+ close() {
1000
+ if (this.customTargetingValueServiceStub && !this._terminated) {
1001
+ return this.customTargetingValueServiceStub.then(stub => {
1002
+ this._terminated = true;
1003
+ stub.close();
1004
+ });
1005
+ }
1006
+ return Promise.resolve();
1007
+ }
1008
+ }
1009
+ exports.CustomTargetingValueServiceClient = CustomTargetingValueServiceClient;
1010
+ //# sourceMappingURL=custom_targeting_value_service_client.js.map