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