@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,999 @@
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.PlacementServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1/placement_service_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./placement_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Provides methods for handling `Placement` objects.
31
+ * @class
32
+ * @memberof v1
33
+ */
34
+ class PlacementServiceClient {
35
+ /**
36
+ * Construct an instance of PlacementServiceClient.
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 PlacementServiceClient({fallback: true}, gax);
72
+ * ```
73
+ */
74
+ constructor(opts, gaxInstance) {
75
+ var _a, _b, _c, _d, _e, _f;
76
+ this._terminated = false;
77
+ this.descriptors = {
78
+ page: {},
79
+ stream: {},
80
+ longrunning: {},
81
+ batching: {},
82
+ };
83
+ // Ensure that options include all the required fields.
84
+ const staticMembers = this.constructor;
85
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
86
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
87
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
88
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
89
+ }
90
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
91
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
92
+ : undefined;
93
+ this._universeDomain =
94
+ (_c = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
95
+ this._servicePath = 'admanager.' + this._universeDomain;
96
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
97
+ this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
98
+ const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
99
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
100
+ // Implicitly enable HTTP transport for the APIs that use REST as transport (e.g. Google Cloud Compute).
101
+ if (!opts) {
102
+ opts = { fallback: true };
103
+ }
104
+ else {
105
+ opts.fallback = (_e = opts.fallback) !== null && _e !== void 0 ? _e : true;
106
+ }
107
+ const fallback = (_f = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _f !== void 0 ? _f : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
108
+ opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
109
+ // Request numeric enum values if REST transport is used.
110
+ opts.numericEnums = true;
111
+ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
112
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
113
+ opts['scopes'] = staticMembers.scopes;
114
+ }
115
+ // Load google-gax module synchronously if needed
116
+ if (!gaxInstance) {
117
+ gaxInstance = require('google-gax');
118
+ }
119
+ // Choose either gRPC or proto-over-HTTP implementation of google-gax.
120
+ this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
121
+ // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
122
+ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
123
+ // Save options to use in initialize() method.
124
+ this._opts = opts;
125
+ // Save the auth object to the client, for use by other methods.
126
+ this.auth = this._gaxGrpc.auth;
127
+ // Set useJWTAccessWithScope on the auth object.
128
+ this.auth.useJWTAccessWithScope = true;
129
+ // Set defaultServicePath on the auth object.
130
+ this.auth.defaultServicePath = this._servicePath;
131
+ // Set the default scopes in auth client if needed.
132
+ if (servicePath === this._servicePath) {
133
+ this.auth.defaultScopes = staticMembers.scopes;
134
+ }
135
+ // Determine the client header string.
136
+ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
137
+ if (typeof process === 'object' && 'versions' in process) {
138
+ clientHeader.push(`gl-node/${process.versions.node}`);
139
+ }
140
+ else {
141
+ clientHeader.push(`gl-web/${this._gaxModule.version}`);
142
+ }
143
+ if (!opts.fallback) {
144
+ clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
145
+ }
146
+ else {
147
+ clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
148
+ }
149
+ if (opts.libName && opts.libVersion) {
150
+ clientHeader.push(`${opts.libName}/${opts.libVersion}`);
151
+ }
152
+ // Load the applicable protos.
153
+ this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
154
+ // This API contains "path templates"; forward-slash-separated
155
+ // identifiers to uniquely identify resources within the API.
156
+ // Create useful helper objects for these.
157
+ this.pathTemplates = {
158
+ adUnitPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/adUnits/{ad_unit}'),
159
+ companyPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/companies/{company}'),
160
+ contactPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/contacts/{contact}'),
161
+ customFieldPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/customFields/{custom_field}'),
162
+ customTargetingKeyPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/customTargetingKeys/{custom_targeting_key}'),
163
+ customTargetingValuePathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/customTargetingKeys/{custom_targeting_key}/customTargetingValues/{custom_targeting_value}'),
164
+ entitySignalsMappingPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/entitySignalsMappings/{entity_signals_mapping}'),
165
+ labelPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/labels/{label}'),
166
+ networkPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}'),
167
+ orderPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/orders/{order}'),
168
+ placementPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/placements/{placement}'),
169
+ reportPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/reports/{report}'),
170
+ rolePathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/roles/{role}'),
171
+ taxonomyCategoryPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/taxonomyCategories/{taxonomy_category}'),
172
+ teamPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/teams/{team}'),
173
+ userPathTemplate: new this._gaxModule.PathTemplate('networks/{network_code}/users/{user}'),
174
+ };
175
+ // Some of the methods on this service return "paged" results,
176
+ // (e.g. 50 results at a time, with tokens to get subsequent
177
+ // pages). Denote the keys used for pagination and results.
178
+ this.descriptors.page = {
179
+ listPlacements: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'placements'),
180
+ };
181
+ // Put together the default options sent with requests.
182
+ this._defaults = this._gaxGrpc.constructSettings('google.ads.admanager.v1.PlacementService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
183
+ // Set up a dictionary of "inner API calls"; the core implementation
184
+ // of calling the API is handled in `google-gax`, with this code
185
+ // merely providing the destination and request information.
186
+ this.innerApiCalls = {};
187
+ // Add a warn function to the client constructor so it can be easily tested.
188
+ this.warn = this._gaxModule.warn;
189
+ }
190
+ /**
191
+ * Initialize the client.
192
+ * Performs asynchronous operations (such as authentication) and prepares the client.
193
+ * This function will be called automatically when any class method is called for the
194
+ * first time, but if you need to initialize it before calling an actual method,
195
+ * feel free to call initialize() directly.
196
+ *
197
+ * You can await on this method if you want to make sure the client is initialized.
198
+ *
199
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
200
+ */
201
+ initialize() {
202
+ // If the client stub promise is already initialized, return immediately.
203
+ if (this.placementServiceStub) {
204
+ return this.placementServiceStub;
205
+ }
206
+ // Put together the "service stub" for
207
+ // google.ads.admanager.v1.PlacementService.
208
+ this.placementServiceStub = this._gaxGrpc.createStub(this._opts.fallback
209
+ ? this._protos.lookupService('google.ads.admanager.v1.PlacementService')
210
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
211
+ this._protos.google.ads.admanager.v1.PlacementService, this._opts, this._providedCustomServicePath);
212
+ // Iterate over each of the methods that the service provides
213
+ // and create an API call method for each.
214
+ const placementServiceStubMethods = ['getPlacement', 'listPlacements'];
215
+ for (const methodName of placementServiceStubMethods) {
216
+ const callPromise = this.placementServiceStub.then(stub => (...args) => {
217
+ if (this._terminated) {
218
+ return Promise.reject('The client has already been closed.');
219
+ }
220
+ const func = stub[methodName];
221
+ return func.apply(stub, args);
222
+ }, (err) => () => {
223
+ throw err;
224
+ });
225
+ const descriptor = this.descriptors.page[methodName] || undefined;
226
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
227
+ this.innerApiCalls[methodName] = apiCall;
228
+ }
229
+ return this.placementServiceStub;
230
+ }
231
+ /**
232
+ * The DNS address for this API service.
233
+ * @deprecated Use the apiEndpoint method of the client instance.
234
+ * @returns {string} The DNS address for this service.
235
+ */
236
+ static get servicePath() {
237
+ if (typeof process === 'object' &&
238
+ typeof process.emitWarning === 'function') {
239
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
240
+ }
241
+ return 'admanager.googleapis.com';
242
+ }
243
+ /**
244
+ * The DNS address for this API service - same as servicePath.
245
+ * @deprecated Use the apiEndpoint method of the client instance.
246
+ * @returns {string} The DNS address for this service.
247
+ */
248
+ static get apiEndpoint() {
249
+ if (typeof process === 'object' &&
250
+ typeof process.emitWarning === 'function') {
251
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
252
+ }
253
+ return 'admanager.googleapis.com';
254
+ }
255
+ /**
256
+ * The DNS address for this API service.
257
+ * @returns {string} The DNS address for this service.
258
+ */
259
+ get apiEndpoint() {
260
+ return this._servicePath;
261
+ }
262
+ get universeDomain() {
263
+ return this._universeDomain;
264
+ }
265
+ /**
266
+ * The port for this API service.
267
+ * @returns {number} The default port for this service.
268
+ */
269
+ static get port() {
270
+ return 443;
271
+ }
272
+ /**
273
+ * The scopes needed to make gRPC calls for every method defined
274
+ * in this service.
275
+ * @returns {string[]} List of default scopes.
276
+ */
277
+ static get scopes() {
278
+ return [];
279
+ }
280
+ /**
281
+ * Return the project ID used by this class.
282
+ * @returns {Promise} A promise that resolves to string containing the project ID.
283
+ */
284
+ getProjectId(callback) {
285
+ if (callback) {
286
+ this.auth.getProjectId(callback);
287
+ return;
288
+ }
289
+ return this.auth.getProjectId();
290
+ }
291
+ getPlacement(request, optionsOrCallback, callback) {
292
+ var _a;
293
+ request = request || {};
294
+ let options;
295
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
296
+ callback = optionsOrCallback;
297
+ options = {};
298
+ }
299
+ else {
300
+ options = optionsOrCallback;
301
+ }
302
+ options = options || {};
303
+ options.otherArgs = options.otherArgs || {};
304
+ options.otherArgs.headers = options.otherArgs.headers || {};
305
+ options.otherArgs.headers['x-goog-request-params'] =
306
+ this._gaxModule.routingHeader.fromParams({
307
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
308
+ });
309
+ this.initialize();
310
+ return this.innerApiCalls.getPlacement(request, options, callback);
311
+ }
312
+ listPlacements(request, optionsOrCallback, callback) {
313
+ var _a;
314
+ request = request || {};
315
+ let options;
316
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
317
+ callback = optionsOrCallback;
318
+ options = {};
319
+ }
320
+ else {
321
+ options = optionsOrCallback;
322
+ }
323
+ options = options || {};
324
+ options.otherArgs = options.otherArgs || {};
325
+ options.otherArgs.headers = options.otherArgs.headers || {};
326
+ options.otherArgs.headers['x-goog-request-params'] =
327
+ this._gaxModule.routingHeader.fromParams({
328
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
329
+ });
330
+ this.initialize();
331
+ return this.innerApiCalls.listPlacements(request, options, callback);
332
+ }
333
+ /**
334
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
335
+ * @param {Object} request
336
+ * The request object that will be sent.
337
+ * @param {string} request.parent
338
+ * Required. The parent, which owns this collection of Placements.
339
+ * Format: `networks/{network_code}`
340
+ * @param {number} [request.pageSize]
341
+ * Optional. The maximum number of `Placements` to return. The service may
342
+ * return fewer than this value. If unspecified, at most 50 `Placements` will
343
+ * be returned. The maximum value is 1000; values above 1000 will be coerced
344
+ * to 1000.
345
+ * @param {string} [request.pageToken]
346
+ * Optional. A page token, received from a previous `ListPlacements` call.
347
+ * Provide this to retrieve the subsequent page.
348
+ *
349
+ * When paginating, all other parameters provided to `ListPlacements` must
350
+ * match the call that provided the page token.
351
+ * @param {string} [request.filter]
352
+ * Optional. Expression to filter the response.
353
+ * See syntax details at
354
+ * https://developers.google.com/ad-manager/api/beta/filters
355
+ * @param {string} [request.orderBy]
356
+ * Optional. Expression to specify sorting order.
357
+ * See syntax details at
358
+ * https://developers.google.com/ad-manager/api/beta/filters#order
359
+ * @param {number} [request.skip]
360
+ * Optional. Number of individual resources to skip while paginating.
361
+ * @param {object} [options]
362
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
363
+ * @returns {Stream}
364
+ * An object stream which emits an object representing {@link protos.google.ads.admanager.v1.Placement|Placement} on 'data' event.
365
+ * The client library will perform auto-pagination by default: it will call the API as many
366
+ * times as needed. Note that it can affect your quota.
367
+ * We recommend using `listPlacementsAsync()`
368
+ * method described below for async iteration which you can stop as needed.
369
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
370
+ * for more details and examples.
371
+ */
372
+ listPlacementsStream(request, options) {
373
+ var _a;
374
+ request = request || {};
375
+ options = options || {};
376
+ options.otherArgs = options.otherArgs || {};
377
+ options.otherArgs.headers = options.otherArgs.headers || {};
378
+ options.otherArgs.headers['x-goog-request-params'] =
379
+ this._gaxModule.routingHeader.fromParams({
380
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
381
+ });
382
+ const defaultCallSettings = this._defaults['listPlacements'];
383
+ const callSettings = defaultCallSettings.merge(options);
384
+ this.initialize();
385
+ return this.descriptors.page.listPlacements.createStream(this.innerApiCalls.listPlacements, request, callSettings);
386
+ }
387
+ /**
388
+ * Equivalent to `listPlacements`, but returns an iterable object.
389
+ *
390
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
391
+ * @param {Object} request
392
+ * The request object that will be sent.
393
+ * @param {string} request.parent
394
+ * Required. The parent, which owns this collection of Placements.
395
+ * Format: `networks/{network_code}`
396
+ * @param {number} [request.pageSize]
397
+ * Optional. The maximum number of `Placements` to return. The service may
398
+ * return fewer than this value. If unspecified, at most 50 `Placements` will
399
+ * be returned. The maximum value is 1000; values above 1000 will be coerced
400
+ * to 1000.
401
+ * @param {string} [request.pageToken]
402
+ * Optional. A page token, received from a previous `ListPlacements` call.
403
+ * Provide this to retrieve the subsequent page.
404
+ *
405
+ * When paginating, all other parameters provided to `ListPlacements` must
406
+ * match the call that provided the page token.
407
+ * @param {string} [request.filter]
408
+ * Optional. Expression to filter the response.
409
+ * See syntax details at
410
+ * https://developers.google.com/ad-manager/api/beta/filters
411
+ * @param {string} [request.orderBy]
412
+ * Optional. Expression to specify sorting order.
413
+ * See syntax details at
414
+ * https://developers.google.com/ad-manager/api/beta/filters#order
415
+ * @param {number} [request.skip]
416
+ * Optional. Number of individual resources to skip while paginating.
417
+ * @param {object} [options]
418
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
419
+ * @returns {Object}
420
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
421
+ * When you iterate the returned iterable, each element will be an object representing
422
+ * {@link protos.google.ads.admanager.v1.Placement|Placement}. The API will be called under the hood as needed, once per the page,
423
+ * so you can stop the iteration when you don't need more results.
424
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
425
+ * for more details and examples.
426
+ * @example <caption>include:samples/generated/v1/placement_service.list_placements.js</caption>
427
+ * region_tag:admanager_v1_generated_PlacementService_ListPlacements_async
428
+ */
429
+ listPlacementsAsync(request, options) {
430
+ var _a;
431
+ request = request || {};
432
+ options = options || {};
433
+ options.otherArgs = options.otherArgs || {};
434
+ options.otherArgs.headers = options.otherArgs.headers || {};
435
+ options.otherArgs.headers['x-goog-request-params'] =
436
+ this._gaxModule.routingHeader.fromParams({
437
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
438
+ });
439
+ const defaultCallSettings = this._defaults['listPlacements'];
440
+ const callSettings = defaultCallSettings.merge(options);
441
+ this.initialize();
442
+ return this.descriptors.page.listPlacements.asyncIterate(this.innerApiCalls['listPlacements'], request, callSettings);
443
+ }
444
+ // --------------------
445
+ // -- Path templates --
446
+ // --------------------
447
+ /**
448
+ * Return a fully-qualified adUnit resource name string.
449
+ *
450
+ * @param {string} network_code
451
+ * @param {string} ad_unit
452
+ * @returns {string} Resource name string.
453
+ */
454
+ adUnitPath(networkCode, adUnit) {
455
+ return this.pathTemplates.adUnitPathTemplate.render({
456
+ network_code: networkCode,
457
+ ad_unit: adUnit,
458
+ });
459
+ }
460
+ /**
461
+ * Parse the network_code from AdUnit resource.
462
+ *
463
+ * @param {string} adUnitName
464
+ * A fully-qualified path representing AdUnit resource.
465
+ * @returns {string} A string representing the network_code.
466
+ */
467
+ matchNetworkCodeFromAdUnitName(adUnitName) {
468
+ return this.pathTemplates.adUnitPathTemplate.match(adUnitName).network_code;
469
+ }
470
+ /**
471
+ * Parse the ad_unit from AdUnit resource.
472
+ *
473
+ * @param {string} adUnitName
474
+ * A fully-qualified path representing AdUnit resource.
475
+ * @returns {string} A string representing the ad_unit.
476
+ */
477
+ matchAdUnitFromAdUnitName(adUnitName) {
478
+ return this.pathTemplates.adUnitPathTemplate.match(adUnitName).ad_unit;
479
+ }
480
+ /**
481
+ * Return a fully-qualified company resource name string.
482
+ *
483
+ * @param {string} network_code
484
+ * @param {string} company
485
+ * @returns {string} Resource name string.
486
+ */
487
+ companyPath(networkCode, company) {
488
+ return this.pathTemplates.companyPathTemplate.render({
489
+ network_code: networkCode,
490
+ company: company,
491
+ });
492
+ }
493
+ /**
494
+ * Parse the network_code from Company resource.
495
+ *
496
+ * @param {string} companyName
497
+ * A fully-qualified path representing Company resource.
498
+ * @returns {string} A string representing the network_code.
499
+ */
500
+ matchNetworkCodeFromCompanyName(companyName) {
501
+ return this.pathTemplates.companyPathTemplate.match(companyName)
502
+ .network_code;
503
+ }
504
+ /**
505
+ * Parse the company from Company resource.
506
+ *
507
+ * @param {string} companyName
508
+ * A fully-qualified path representing Company resource.
509
+ * @returns {string} A string representing the company.
510
+ */
511
+ matchCompanyFromCompanyName(companyName) {
512
+ return this.pathTemplates.companyPathTemplate.match(companyName).company;
513
+ }
514
+ /**
515
+ * Return a fully-qualified contact resource name string.
516
+ *
517
+ * @param {string} network_code
518
+ * @param {string} contact
519
+ * @returns {string} Resource name string.
520
+ */
521
+ contactPath(networkCode, contact) {
522
+ return this.pathTemplates.contactPathTemplate.render({
523
+ network_code: networkCode,
524
+ contact: contact,
525
+ });
526
+ }
527
+ /**
528
+ * Parse the network_code from Contact resource.
529
+ *
530
+ * @param {string} contactName
531
+ * A fully-qualified path representing Contact resource.
532
+ * @returns {string} A string representing the network_code.
533
+ */
534
+ matchNetworkCodeFromContactName(contactName) {
535
+ return this.pathTemplates.contactPathTemplate.match(contactName)
536
+ .network_code;
537
+ }
538
+ /**
539
+ * Parse the contact from Contact resource.
540
+ *
541
+ * @param {string} contactName
542
+ * A fully-qualified path representing Contact resource.
543
+ * @returns {string} A string representing the contact.
544
+ */
545
+ matchContactFromContactName(contactName) {
546
+ return this.pathTemplates.contactPathTemplate.match(contactName).contact;
547
+ }
548
+ /**
549
+ * Return a fully-qualified customField resource name string.
550
+ *
551
+ * @param {string} network_code
552
+ * @param {string} custom_field
553
+ * @returns {string} Resource name string.
554
+ */
555
+ customFieldPath(networkCode, customField) {
556
+ return this.pathTemplates.customFieldPathTemplate.render({
557
+ network_code: networkCode,
558
+ custom_field: customField,
559
+ });
560
+ }
561
+ /**
562
+ * Parse the network_code from CustomField resource.
563
+ *
564
+ * @param {string} customFieldName
565
+ * A fully-qualified path representing CustomField resource.
566
+ * @returns {string} A string representing the network_code.
567
+ */
568
+ matchNetworkCodeFromCustomFieldName(customFieldName) {
569
+ return this.pathTemplates.customFieldPathTemplate.match(customFieldName)
570
+ .network_code;
571
+ }
572
+ /**
573
+ * Parse the custom_field from CustomField resource.
574
+ *
575
+ * @param {string} customFieldName
576
+ * A fully-qualified path representing CustomField resource.
577
+ * @returns {string} A string representing the custom_field.
578
+ */
579
+ matchCustomFieldFromCustomFieldName(customFieldName) {
580
+ return this.pathTemplates.customFieldPathTemplate.match(customFieldName)
581
+ .custom_field;
582
+ }
583
+ /**
584
+ * Return a fully-qualified customTargetingKey resource name string.
585
+ *
586
+ * @param {string} network_code
587
+ * @param {string} custom_targeting_key
588
+ * @returns {string} Resource name string.
589
+ */
590
+ customTargetingKeyPath(networkCode, customTargetingKey) {
591
+ return this.pathTemplates.customTargetingKeyPathTemplate.render({
592
+ network_code: networkCode,
593
+ custom_targeting_key: customTargetingKey,
594
+ });
595
+ }
596
+ /**
597
+ * Parse the network_code from CustomTargetingKey resource.
598
+ *
599
+ * @param {string} customTargetingKeyName
600
+ * A fully-qualified path representing CustomTargetingKey resource.
601
+ * @returns {string} A string representing the network_code.
602
+ */
603
+ matchNetworkCodeFromCustomTargetingKeyName(customTargetingKeyName) {
604
+ return this.pathTemplates.customTargetingKeyPathTemplate.match(customTargetingKeyName).network_code;
605
+ }
606
+ /**
607
+ * Parse the custom_targeting_key from CustomTargetingKey resource.
608
+ *
609
+ * @param {string} customTargetingKeyName
610
+ * A fully-qualified path representing CustomTargetingKey resource.
611
+ * @returns {string} A string representing the custom_targeting_key.
612
+ */
613
+ matchCustomTargetingKeyFromCustomTargetingKeyName(customTargetingKeyName) {
614
+ return this.pathTemplates.customTargetingKeyPathTemplate.match(customTargetingKeyName).custom_targeting_key;
615
+ }
616
+ /**
617
+ * Return a fully-qualified customTargetingValue resource name string.
618
+ *
619
+ * @param {string} network_code
620
+ * @param {string} custom_targeting_key
621
+ * @param {string} custom_targeting_value
622
+ * @returns {string} Resource name string.
623
+ */
624
+ customTargetingValuePath(networkCode, customTargetingKey, customTargetingValue) {
625
+ return this.pathTemplates.customTargetingValuePathTemplate.render({
626
+ network_code: networkCode,
627
+ custom_targeting_key: customTargetingKey,
628
+ custom_targeting_value: customTargetingValue,
629
+ });
630
+ }
631
+ /**
632
+ * Parse the network_code from CustomTargetingValue resource.
633
+ *
634
+ * @param {string} customTargetingValueName
635
+ * A fully-qualified path representing CustomTargetingValue resource.
636
+ * @returns {string} A string representing the network_code.
637
+ */
638
+ matchNetworkCodeFromCustomTargetingValueName(customTargetingValueName) {
639
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).network_code;
640
+ }
641
+ /**
642
+ * Parse the custom_targeting_key from CustomTargetingValue resource.
643
+ *
644
+ * @param {string} customTargetingValueName
645
+ * A fully-qualified path representing CustomTargetingValue resource.
646
+ * @returns {string} A string representing the custom_targeting_key.
647
+ */
648
+ matchCustomTargetingKeyFromCustomTargetingValueName(customTargetingValueName) {
649
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).custom_targeting_key;
650
+ }
651
+ /**
652
+ * Parse the custom_targeting_value from CustomTargetingValue resource.
653
+ *
654
+ * @param {string} customTargetingValueName
655
+ * A fully-qualified path representing CustomTargetingValue resource.
656
+ * @returns {string} A string representing the custom_targeting_value.
657
+ */
658
+ matchCustomTargetingValueFromCustomTargetingValueName(customTargetingValueName) {
659
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).custom_targeting_value;
660
+ }
661
+ /**
662
+ * Return a fully-qualified entitySignalsMapping resource name string.
663
+ *
664
+ * @param {string} network_code
665
+ * @param {string} entity_signals_mapping
666
+ * @returns {string} Resource name string.
667
+ */
668
+ entitySignalsMappingPath(networkCode, entitySignalsMapping) {
669
+ return this.pathTemplates.entitySignalsMappingPathTemplate.render({
670
+ network_code: networkCode,
671
+ entity_signals_mapping: entitySignalsMapping,
672
+ });
673
+ }
674
+ /**
675
+ * Parse the network_code from EntitySignalsMapping resource.
676
+ *
677
+ * @param {string} entitySignalsMappingName
678
+ * A fully-qualified path representing EntitySignalsMapping resource.
679
+ * @returns {string} A string representing the network_code.
680
+ */
681
+ matchNetworkCodeFromEntitySignalsMappingName(entitySignalsMappingName) {
682
+ return this.pathTemplates.entitySignalsMappingPathTemplate.match(entitySignalsMappingName).network_code;
683
+ }
684
+ /**
685
+ * Parse the entity_signals_mapping from EntitySignalsMapping resource.
686
+ *
687
+ * @param {string} entitySignalsMappingName
688
+ * A fully-qualified path representing EntitySignalsMapping resource.
689
+ * @returns {string} A string representing the entity_signals_mapping.
690
+ */
691
+ matchEntitySignalsMappingFromEntitySignalsMappingName(entitySignalsMappingName) {
692
+ return this.pathTemplates.entitySignalsMappingPathTemplate.match(entitySignalsMappingName).entity_signals_mapping;
693
+ }
694
+ /**
695
+ * Return a fully-qualified label resource name string.
696
+ *
697
+ * @param {string} network_code
698
+ * @param {string} label
699
+ * @returns {string} Resource name string.
700
+ */
701
+ labelPath(networkCode, label) {
702
+ return this.pathTemplates.labelPathTemplate.render({
703
+ network_code: networkCode,
704
+ label: label,
705
+ });
706
+ }
707
+ /**
708
+ * Parse the network_code from Label resource.
709
+ *
710
+ * @param {string} labelName
711
+ * A fully-qualified path representing Label resource.
712
+ * @returns {string} A string representing the network_code.
713
+ */
714
+ matchNetworkCodeFromLabelName(labelName) {
715
+ return this.pathTemplates.labelPathTemplate.match(labelName).network_code;
716
+ }
717
+ /**
718
+ * Parse the label from Label resource.
719
+ *
720
+ * @param {string} labelName
721
+ * A fully-qualified path representing Label resource.
722
+ * @returns {string} A string representing the label.
723
+ */
724
+ matchLabelFromLabelName(labelName) {
725
+ return this.pathTemplates.labelPathTemplate.match(labelName).label;
726
+ }
727
+ /**
728
+ * Return a fully-qualified network resource name string.
729
+ *
730
+ * @param {string} network_code
731
+ * @returns {string} Resource name string.
732
+ */
733
+ networkPath(networkCode) {
734
+ return this.pathTemplates.networkPathTemplate.render({
735
+ network_code: networkCode,
736
+ });
737
+ }
738
+ /**
739
+ * Parse the network_code from Network resource.
740
+ *
741
+ * @param {string} networkName
742
+ * A fully-qualified path representing Network resource.
743
+ * @returns {string} A string representing the network_code.
744
+ */
745
+ matchNetworkCodeFromNetworkName(networkName) {
746
+ return this.pathTemplates.networkPathTemplate.match(networkName)
747
+ .network_code;
748
+ }
749
+ /**
750
+ * Return a fully-qualified order resource name string.
751
+ *
752
+ * @param {string} network_code
753
+ * @param {string} order
754
+ * @returns {string} Resource name string.
755
+ */
756
+ orderPath(networkCode, order) {
757
+ return this.pathTemplates.orderPathTemplate.render({
758
+ network_code: networkCode,
759
+ order: order,
760
+ });
761
+ }
762
+ /**
763
+ * Parse the network_code from Order resource.
764
+ *
765
+ * @param {string} orderName
766
+ * A fully-qualified path representing Order resource.
767
+ * @returns {string} A string representing the network_code.
768
+ */
769
+ matchNetworkCodeFromOrderName(orderName) {
770
+ return this.pathTemplates.orderPathTemplate.match(orderName).network_code;
771
+ }
772
+ /**
773
+ * Parse the order from Order resource.
774
+ *
775
+ * @param {string} orderName
776
+ * A fully-qualified path representing Order resource.
777
+ * @returns {string} A string representing the order.
778
+ */
779
+ matchOrderFromOrderName(orderName) {
780
+ return this.pathTemplates.orderPathTemplate.match(orderName).order;
781
+ }
782
+ /**
783
+ * Return a fully-qualified placement resource name string.
784
+ *
785
+ * @param {string} network_code
786
+ * @param {string} placement
787
+ * @returns {string} Resource name string.
788
+ */
789
+ placementPath(networkCode, placement) {
790
+ return this.pathTemplates.placementPathTemplate.render({
791
+ network_code: networkCode,
792
+ placement: placement,
793
+ });
794
+ }
795
+ /**
796
+ * Parse the network_code from Placement resource.
797
+ *
798
+ * @param {string} placementName
799
+ * A fully-qualified path representing Placement resource.
800
+ * @returns {string} A string representing the network_code.
801
+ */
802
+ matchNetworkCodeFromPlacementName(placementName) {
803
+ return this.pathTemplates.placementPathTemplate.match(placementName)
804
+ .network_code;
805
+ }
806
+ /**
807
+ * Parse the placement from Placement resource.
808
+ *
809
+ * @param {string} placementName
810
+ * A fully-qualified path representing Placement resource.
811
+ * @returns {string} A string representing the placement.
812
+ */
813
+ matchPlacementFromPlacementName(placementName) {
814
+ return this.pathTemplates.placementPathTemplate.match(placementName)
815
+ .placement;
816
+ }
817
+ /**
818
+ * Return a fully-qualified report resource name string.
819
+ *
820
+ * @param {string} network_code
821
+ * @param {string} report
822
+ * @returns {string} Resource name string.
823
+ */
824
+ reportPath(networkCode, report) {
825
+ return this.pathTemplates.reportPathTemplate.render({
826
+ network_code: networkCode,
827
+ report: report,
828
+ });
829
+ }
830
+ /**
831
+ * Parse the network_code from Report resource.
832
+ *
833
+ * @param {string} reportName
834
+ * A fully-qualified path representing Report resource.
835
+ * @returns {string} A string representing the network_code.
836
+ */
837
+ matchNetworkCodeFromReportName(reportName) {
838
+ return this.pathTemplates.reportPathTemplate.match(reportName).network_code;
839
+ }
840
+ /**
841
+ * Parse the report from Report resource.
842
+ *
843
+ * @param {string} reportName
844
+ * A fully-qualified path representing Report resource.
845
+ * @returns {string} A string representing the report.
846
+ */
847
+ matchReportFromReportName(reportName) {
848
+ return this.pathTemplates.reportPathTemplate.match(reportName).report;
849
+ }
850
+ /**
851
+ * Return a fully-qualified role resource name string.
852
+ *
853
+ * @param {string} network_code
854
+ * @param {string} role
855
+ * @returns {string} Resource name string.
856
+ */
857
+ rolePath(networkCode, role) {
858
+ return this.pathTemplates.rolePathTemplate.render({
859
+ network_code: networkCode,
860
+ role: role,
861
+ });
862
+ }
863
+ /**
864
+ * Parse the network_code from Role resource.
865
+ *
866
+ * @param {string} roleName
867
+ * A fully-qualified path representing Role resource.
868
+ * @returns {string} A string representing the network_code.
869
+ */
870
+ matchNetworkCodeFromRoleName(roleName) {
871
+ return this.pathTemplates.rolePathTemplate.match(roleName).network_code;
872
+ }
873
+ /**
874
+ * Parse the role from Role resource.
875
+ *
876
+ * @param {string} roleName
877
+ * A fully-qualified path representing Role resource.
878
+ * @returns {string} A string representing the role.
879
+ */
880
+ matchRoleFromRoleName(roleName) {
881
+ return this.pathTemplates.rolePathTemplate.match(roleName).role;
882
+ }
883
+ /**
884
+ * Return a fully-qualified taxonomyCategory resource name string.
885
+ *
886
+ * @param {string} network_code
887
+ * @param {string} taxonomy_category
888
+ * @returns {string} Resource name string.
889
+ */
890
+ taxonomyCategoryPath(networkCode, taxonomyCategory) {
891
+ return this.pathTemplates.taxonomyCategoryPathTemplate.render({
892
+ network_code: networkCode,
893
+ taxonomy_category: taxonomyCategory,
894
+ });
895
+ }
896
+ /**
897
+ * Parse the network_code from TaxonomyCategory resource.
898
+ *
899
+ * @param {string} taxonomyCategoryName
900
+ * A fully-qualified path representing TaxonomyCategory resource.
901
+ * @returns {string} A string representing the network_code.
902
+ */
903
+ matchNetworkCodeFromTaxonomyCategoryName(taxonomyCategoryName) {
904
+ return this.pathTemplates.taxonomyCategoryPathTemplate.match(taxonomyCategoryName).network_code;
905
+ }
906
+ /**
907
+ * Parse the taxonomy_category from TaxonomyCategory resource.
908
+ *
909
+ * @param {string} taxonomyCategoryName
910
+ * A fully-qualified path representing TaxonomyCategory resource.
911
+ * @returns {string} A string representing the taxonomy_category.
912
+ */
913
+ matchTaxonomyCategoryFromTaxonomyCategoryName(taxonomyCategoryName) {
914
+ return this.pathTemplates.taxonomyCategoryPathTemplate.match(taxonomyCategoryName).taxonomy_category;
915
+ }
916
+ /**
917
+ * Return a fully-qualified team resource name string.
918
+ *
919
+ * @param {string} network_code
920
+ * @param {string} team
921
+ * @returns {string} Resource name string.
922
+ */
923
+ teamPath(networkCode, team) {
924
+ return this.pathTemplates.teamPathTemplate.render({
925
+ network_code: networkCode,
926
+ team: team,
927
+ });
928
+ }
929
+ /**
930
+ * Parse the network_code from Team resource.
931
+ *
932
+ * @param {string} teamName
933
+ * A fully-qualified path representing Team resource.
934
+ * @returns {string} A string representing the network_code.
935
+ */
936
+ matchNetworkCodeFromTeamName(teamName) {
937
+ return this.pathTemplates.teamPathTemplate.match(teamName).network_code;
938
+ }
939
+ /**
940
+ * Parse the team from Team resource.
941
+ *
942
+ * @param {string} teamName
943
+ * A fully-qualified path representing Team resource.
944
+ * @returns {string} A string representing the team.
945
+ */
946
+ matchTeamFromTeamName(teamName) {
947
+ return this.pathTemplates.teamPathTemplate.match(teamName).team;
948
+ }
949
+ /**
950
+ * Return a fully-qualified user resource name string.
951
+ *
952
+ * @param {string} network_code
953
+ * @param {string} user
954
+ * @returns {string} Resource name string.
955
+ */
956
+ userPath(networkCode, user) {
957
+ return this.pathTemplates.userPathTemplate.render({
958
+ network_code: networkCode,
959
+ user: user,
960
+ });
961
+ }
962
+ /**
963
+ * Parse the network_code from User resource.
964
+ *
965
+ * @param {string} userName
966
+ * A fully-qualified path representing User resource.
967
+ * @returns {string} A string representing the network_code.
968
+ */
969
+ matchNetworkCodeFromUserName(userName) {
970
+ return this.pathTemplates.userPathTemplate.match(userName).network_code;
971
+ }
972
+ /**
973
+ * Parse the user from User resource.
974
+ *
975
+ * @param {string} userName
976
+ * A fully-qualified path representing User resource.
977
+ * @returns {string} A string representing the user.
978
+ */
979
+ matchUserFromUserName(userName) {
980
+ return this.pathTemplates.userPathTemplate.match(userName).user;
981
+ }
982
+ /**
983
+ * Terminate the gRPC channel and close the client.
984
+ *
985
+ * The client will no longer be usable and all future behavior is undefined.
986
+ * @returns {Promise} A promise that resolves when the client is closed.
987
+ */
988
+ close() {
989
+ if (this.placementServiceStub && !this._terminated) {
990
+ return this.placementServiceStub.then(stub => {
991
+ this._terminated = true;
992
+ stub.close();
993
+ });
994
+ }
995
+ return Promise.resolve();
996
+ }
997
+ }
998
+ exports.PlacementServiceClient = PlacementServiceClient;
999
+ //# sourceMappingURL=placement_service_client.js.map