@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,877 @@
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.NetworkServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1/network_service_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./network_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Provides methods for handling Network objects.
31
+ * @class
32
+ * @memberof v1
33
+ */
34
+ class NetworkServiceClient {
35
+ /**
36
+ * Construct an instance of NetworkServiceClient.
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 NetworkServiceClient({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
+ // Put together the default options sent with requests.
176
+ this._defaults = this._gaxGrpc.constructSettings('google.ads.admanager.v1.NetworkService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
177
+ // Set up a dictionary of "inner API calls"; the core implementation
178
+ // of calling the API is handled in `google-gax`, with this code
179
+ // merely providing the destination and request information.
180
+ this.innerApiCalls = {};
181
+ // Add a warn function to the client constructor so it can be easily tested.
182
+ this.warn = this._gaxModule.warn;
183
+ }
184
+ /**
185
+ * Initialize the client.
186
+ * Performs asynchronous operations (such as authentication) and prepares the client.
187
+ * This function will be called automatically when any class method is called for the
188
+ * first time, but if you need to initialize it before calling an actual method,
189
+ * feel free to call initialize() directly.
190
+ *
191
+ * You can await on this method if you want to make sure the client is initialized.
192
+ *
193
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
194
+ */
195
+ initialize() {
196
+ // If the client stub promise is already initialized, return immediately.
197
+ if (this.networkServiceStub) {
198
+ return this.networkServiceStub;
199
+ }
200
+ // Put together the "service stub" for
201
+ // google.ads.admanager.v1.NetworkService.
202
+ this.networkServiceStub = this._gaxGrpc.createStub(this._opts.fallback
203
+ ? this._protos.lookupService('google.ads.admanager.v1.NetworkService')
204
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
205
+ this._protos.google.ads.admanager.v1.NetworkService, this._opts, this._providedCustomServicePath);
206
+ // Iterate over each of the methods that the service provides
207
+ // and create an API call method for each.
208
+ const networkServiceStubMethods = ['getNetwork', 'listNetworks'];
209
+ for (const methodName of networkServiceStubMethods) {
210
+ const callPromise = this.networkServiceStub.then(stub => (...args) => {
211
+ if (this._terminated) {
212
+ return Promise.reject('The client has already been closed.');
213
+ }
214
+ const func = stub[methodName];
215
+ return func.apply(stub, args);
216
+ }, (err) => () => {
217
+ throw err;
218
+ });
219
+ const descriptor = undefined;
220
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
221
+ this.innerApiCalls[methodName] = apiCall;
222
+ }
223
+ return this.networkServiceStub;
224
+ }
225
+ /**
226
+ * The DNS address for this API service.
227
+ * @deprecated Use the apiEndpoint method of the client instance.
228
+ * @returns {string} The DNS address for this service.
229
+ */
230
+ static get servicePath() {
231
+ if (typeof process === 'object' &&
232
+ typeof process.emitWarning === 'function') {
233
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
234
+ }
235
+ return 'admanager.googleapis.com';
236
+ }
237
+ /**
238
+ * The DNS address for this API service - same as servicePath.
239
+ * @deprecated Use the apiEndpoint method of the client instance.
240
+ * @returns {string} The DNS address for this service.
241
+ */
242
+ static get apiEndpoint() {
243
+ if (typeof process === 'object' &&
244
+ typeof process.emitWarning === 'function') {
245
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
246
+ }
247
+ return 'admanager.googleapis.com';
248
+ }
249
+ /**
250
+ * The DNS address for this API service.
251
+ * @returns {string} The DNS address for this service.
252
+ */
253
+ get apiEndpoint() {
254
+ return this._servicePath;
255
+ }
256
+ get universeDomain() {
257
+ return this._universeDomain;
258
+ }
259
+ /**
260
+ * The port for this API service.
261
+ * @returns {number} The default port for this service.
262
+ */
263
+ static get port() {
264
+ return 443;
265
+ }
266
+ /**
267
+ * The scopes needed to make gRPC calls for every method defined
268
+ * in this service.
269
+ * @returns {string[]} List of default scopes.
270
+ */
271
+ static get scopes() {
272
+ return [];
273
+ }
274
+ /**
275
+ * Return the project ID used by this class.
276
+ * @returns {Promise} A promise that resolves to string containing the project ID.
277
+ */
278
+ getProjectId(callback) {
279
+ if (callback) {
280
+ this.auth.getProjectId(callback);
281
+ return;
282
+ }
283
+ return this.auth.getProjectId();
284
+ }
285
+ getNetwork(request, optionsOrCallback, callback) {
286
+ var _a;
287
+ request = request || {};
288
+ let options;
289
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
290
+ callback = optionsOrCallback;
291
+ options = {};
292
+ }
293
+ else {
294
+ options = optionsOrCallback;
295
+ }
296
+ options = options || {};
297
+ options.otherArgs = options.otherArgs || {};
298
+ options.otherArgs.headers = options.otherArgs.headers || {};
299
+ options.otherArgs.headers['x-goog-request-params'] =
300
+ this._gaxModule.routingHeader.fromParams({
301
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
302
+ });
303
+ this.initialize();
304
+ return this.innerApiCalls.getNetwork(request, options, callback);
305
+ }
306
+ listNetworks(request, optionsOrCallback, callback) {
307
+ request = request || {};
308
+ let options;
309
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
310
+ callback = optionsOrCallback;
311
+ options = {};
312
+ }
313
+ else {
314
+ options = optionsOrCallback;
315
+ }
316
+ options = options || {};
317
+ options.otherArgs = options.otherArgs || {};
318
+ options.otherArgs.headers = options.otherArgs.headers || {};
319
+ this.initialize();
320
+ return this.innerApiCalls.listNetworks(request, options, callback);
321
+ }
322
+ // --------------------
323
+ // -- Path templates --
324
+ // --------------------
325
+ /**
326
+ * Return a fully-qualified adUnit resource name string.
327
+ *
328
+ * @param {string} network_code
329
+ * @param {string} ad_unit
330
+ * @returns {string} Resource name string.
331
+ */
332
+ adUnitPath(networkCode, adUnit) {
333
+ return this.pathTemplates.adUnitPathTemplate.render({
334
+ network_code: networkCode,
335
+ ad_unit: adUnit,
336
+ });
337
+ }
338
+ /**
339
+ * Parse the network_code from AdUnit resource.
340
+ *
341
+ * @param {string} adUnitName
342
+ * A fully-qualified path representing AdUnit resource.
343
+ * @returns {string} A string representing the network_code.
344
+ */
345
+ matchNetworkCodeFromAdUnitName(adUnitName) {
346
+ return this.pathTemplates.adUnitPathTemplate.match(adUnitName).network_code;
347
+ }
348
+ /**
349
+ * Parse the ad_unit from AdUnit resource.
350
+ *
351
+ * @param {string} adUnitName
352
+ * A fully-qualified path representing AdUnit resource.
353
+ * @returns {string} A string representing the ad_unit.
354
+ */
355
+ matchAdUnitFromAdUnitName(adUnitName) {
356
+ return this.pathTemplates.adUnitPathTemplate.match(adUnitName).ad_unit;
357
+ }
358
+ /**
359
+ * Return a fully-qualified company resource name string.
360
+ *
361
+ * @param {string} network_code
362
+ * @param {string} company
363
+ * @returns {string} Resource name string.
364
+ */
365
+ companyPath(networkCode, company) {
366
+ return this.pathTemplates.companyPathTemplate.render({
367
+ network_code: networkCode,
368
+ company: company,
369
+ });
370
+ }
371
+ /**
372
+ * Parse the network_code from Company resource.
373
+ *
374
+ * @param {string} companyName
375
+ * A fully-qualified path representing Company resource.
376
+ * @returns {string} A string representing the network_code.
377
+ */
378
+ matchNetworkCodeFromCompanyName(companyName) {
379
+ return this.pathTemplates.companyPathTemplate.match(companyName)
380
+ .network_code;
381
+ }
382
+ /**
383
+ * Parse the company from Company resource.
384
+ *
385
+ * @param {string} companyName
386
+ * A fully-qualified path representing Company resource.
387
+ * @returns {string} A string representing the company.
388
+ */
389
+ matchCompanyFromCompanyName(companyName) {
390
+ return this.pathTemplates.companyPathTemplate.match(companyName).company;
391
+ }
392
+ /**
393
+ * Return a fully-qualified contact resource name string.
394
+ *
395
+ * @param {string} network_code
396
+ * @param {string} contact
397
+ * @returns {string} Resource name string.
398
+ */
399
+ contactPath(networkCode, contact) {
400
+ return this.pathTemplates.contactPathTemplate.render({
401
+ network_code: networkCode,
402
+ contact: contact,
403
+ });
404
+ }
405
+ /**
406
+ * Parse the network_code from Contact resource.
407
+ *
408
+ * @param {string} contactName
409
+ * A fully-qualified path representing Contact resource.
410
+ * @returns {string} A string representing the network_code.
411
+ */
412
+ matchNetworkCodeFromContactName(contactName) {
413
+ return this.pathTemplates.contactPathTemplate.match(contactName)
414
+ .network_code;
415
+ }
416
+ /**
417
+ * Parse the contact from Contact resource.
418
+ *
419
+ * @param {string} contactName
420
+ * A fully-qualified path representing Contact resource.
421
+ * @returns {string} A string representing the contact.
422
+ */
423
+ matchContactFromContactName(contactName) {
424
+ return this.pathTemplates.contactPathTemplate.match(contactName).contact;
425
+ }
426
+ /**
427
+ * Return a fully-qualified customField resource name string.
428
+ *
429
+ * @param {string} network_code
430
+ * @param {string} custom_field
431
+ * @returns {string} Resource name string.
432
+ */
433
+ customFieldPath(networkCode, customField) {
434
+ return this.pathTemplates.customFieldPathTemplate.render({
435
+ network_code: networkCode,
436
+ custom_field: customField,
437
+ });
438
+ }
439
+ /**
440
+ * Parse the network_code from CustomField resource.
441
+ *
442
+ * @param {string} customFieldName
443
+ * A fully-qualified path representing CustomField resource.
444
+ * @returns {string} A string representing the network_code.
445
+ */
446
+ matchNetworkCodeFromCustomFieldName(customFieldName) {
447
+ return this.pathTemplates.customFieldPathTemplate.match(customFieldName)
448
+ .network_code;
449
+ }
450
+ /**
451
+ * Parse the custom_field from CustomField resource.
452
+ *
453
+ * @param {string} customFieldName
454
+ * A fully-qualified path representing CustomField resource.
455
+ * @returns {string} A string representing the custom_field.
456
+ */
457
+ matchCustomFieldFromCustomFieldName(customFieldName) {
458
+ return this.pathTemplates.customFieldPathTemplate.match(customFieldName)
459
+ .custom_field;
460
+ }
461
+ /**
462
+ * Return a fully-qualified customTargetingKey resource name string.
463
+ *
464
+ * @param {string} network_code
465
+ * @param {string} custom_targeting_key
466
+ * @returns {string} Resource name string.
467
+ */
468
+ customTargetingKeyPath(networkCode, customTargetingKey) {
469
+ return this.pathTemplates.customTargetingKeyPathTemplate.render({
470
+ network_code: networkCode,
471
+ custom_targeting_key: customTargetingKey,
472
+ });
473
+ }
474
+ /**
475
+ * Parse the network_code from CustomTargetingKey resource.
476
+ *
477
+ * @param {string} customTargetingKeyName
478
+ * A fully-qualified path representing CustomTargetingKey resource.
479
+ * @returns {string} A string representing the network_code.
480
+ */
481
+ matchNetworkCodeFromCustomTargetingKeyName(customTargetingKeyName) {
482
+ return this.pathTemplates.customTargetingKeyPathTemplate.match(customTargetingKeyName).network_code;
483
+ }
484
+ /**
485
+ * Parse the custom_targeting_key from CustomTargetingKey resource.
486
+ *
487
+ * @param {string} customTargetingKeyName
488
+ * A fully-qualified path representing CustomTargetingKey resource.
489
+ * @returns {string} A string representing the custom_targeting_key.
490
+ */
491
+ matchCustomTargetingKeyFromCustomTargetingKeyName(customTargetingKeyName) {
492
+ return this.pathTemplates.customTargetingKeyPathTemplate.match(customTargetingKeyName).custom_targeting_key;
493
+ }
494
+ /**
495
+ * Return a fully-qualified customTargetingValue resource name string.
496
+ *
497
+ * @param {string} network_code
498
+ * @param {string} custom_targeting_key
499
+ * @param {string} custom_targeting_value
500
+ * @returns {string} Resource name string.
501
+ */
502
+ customTargetingValuePath(networkCode, customTargetingKey, customTargetingValue) {
503
+ return this.pathTemplates.customTargetingValuePathTemplate.render({
504
+ network_code: networkCode,
505
+ custom_targeting_key: customTargetingKey,
506
+ custom_targeting_value: customTargetingValue,
507
+ });
508
+ }
509
+ /**
510
+ * Parse the network_code from CustomTargetingValue resource.
511
+ *
512
+ * @param {string} customTargetingValueName
513
+ * A fully-qualified path representing CustomTargetingValue resource.
514
+ * @returns {string} A string representing the network_code.
515
+ */
516
+ matchNetworkCodeFromCustomTargetingValueName(customTargetingValueName) {
517
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).network_code;
518
+ }
519
+ /**
520
+ * Parse the custom_targeting_key from CustomTargetingValue resource.
521
+ *
522
+ * @param {string} customTargetingValueName
523
+ * A fully-qualified path representing CustomTargetingValue resource.
524
+ * @returns {string} A string representing the custom_targeting_key.
525
+ */
526
+ matchCustomTargetingKeyFromCustomTargetingValueName(customTargetingValueName) {
527
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).custom_targeting_key;
528
+ }
529
+ /**
530
+ * Parse the custom_targeting_value from CustomTargetingValue resource.
531
+ *
532
+ * @param {string} customTargetingValueName
533
+ * A fully-qualified path representing CustomTargetingValue resource.
534
+ * @returns {string} A string representing the custom_targeting_value.
535
+ */
536
+ matchCustomTargetingValueFromCustomTargetingValueName(customTargetingValueName) {
537
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).custom_targeting_value;
538
+ }
539
+ /**
540
+ * Return a fully-qualified entitySignalsMapping resource name string.
541
+ *
542
+ * @param {string} network_code
543
+ * @param {string} entity_signals_mapping
544
+ * @returns {string} Resource name string.
545
+ */
546
+ entitySignalsMappingPath(networkCode, entitySignalsMapping) {
547
+ return this.pathTemplates.entitySignalsMappingPathTemplate.render({
548
+ network_code: networkCode,
549
+ entity_signals_mapping: entitySignalsMapping,
550
+ });
551
+ }
552
+ /**
553
+ * Parse the network_code from EntitySignalsMapping resource.
554
+ *
555
+ * @param {string} entitySignalsMappingName
556
+ * A fully-qualified path representing EntitySignalsMapping resource.
557
+ * @returns {string} A string representing the network_code.
558
+ */
559
+ matchNetworkCodeFromEntitySignalsMappingName(entitySignalsMappingName) {
560
+ return this.pathTemplates.entitySignalsMappingPathTemplate.match(entitySignalsMappingName).network_code;
561
+ }
562
+ /**
563
+ * Parse the entity_signals_mapping from EntitySignalsMapping resource.
564
+ *
565
+ * @param {string} entitySignalsMappingName
566
+ * A fully-qualified path representing EntitySignalsMapping resource.
567
+ * @returns {string} A string representing the entity_signals_mapping.
568
+ */
569
+ matchEntitySignalsMappingFromEntitySignalsMappingName(entitySignalsMappingName) {
570
+ return this.pathTemplates.entitySignalsMappingPathTemplate.match(entitySignalsMappingName).entity_signals_mapping;
571
+ }
572
+ /**
573
+ * Return a fully-qualified label resource name string.
574
+ *
575
+ * @param {string} network_code
576
+ * @param {string} label
577
+ * @returns {string} Resource name string.
578
+ */
579
+ labelPath(networkCode, label) {
580
+ return this.pathTemplates.labelPathTemplate.render({
581
+ network_code: networkCode,
582
+ label: label,
583
+ });
584
+ }
585
+ /**
586
+ * Parse the network_code from Label resource.
587
+ *
588
+ * @param {string} labelName
589
+ * A fully-qualified path representing Label resource.
590
+ * @returns {string} A string representing the network_code.
591
+ */
592
+ matchNetworkCodeFromLabelName(labelName) {
593
+ return this.pathTemplates.labelPathTemplate.match(labelName).network_code;
594
+ }
595
+ /**
596
+ * Parse the label from Label resource.
597
+ *
598
+ * @param {string} labelName
599
+ * A fully-qualified path representing Label resource.
600
+ * @returns {string} A string representing the label.
601
+ */
602
+ matchLabelFromLabelName(labelName) {
603
+ return this.pathTemplates.labelPathTemplate.match(labelName).label;
604
+ }
605
+ /**
606
+ * Return a fully-qualified network resource name string.
607
+ *
608
+ * @param {string} network_code
609
+ * @returns {string} Resource name string.
610
+ */
611
+ networkPath(networkCode) {
612
+ return this.pathTemplates.networkPathTemplate.render({
613
+ network_code: networkCode,
614
+ });
615
+ }
616
+ /**
617
+ * Parse the network_code from Network resource.
618
+ *
619
+ * @param {string} networkName
620
+ * A fully-qualified path representing Network resource.
621
+ * @returns {string} A string representing the network_code.
622
+ */
623
+ matchNetworkCodeFromNetworkName(networkName) {
624
+ return this.pathTemplates.networkPathTemplate.match(networkName)
625
+ .network_code;
626
+ }
627
+ /**
628
+ * Return a fully-qualified order resource name string.
629
+ *
630
+ * @param {string} network_code
631
+ * @param {string} order
632
+ * @returns {string} Resource name string.
633
+ */
634
+ orderPath(networkCode, order) {
635
+ return this.pathTemplates.orderPathTemplate.render({
636
+ network_code: networkCode,
637
+ order: order,
638
+ });
639
+ }
640
+ /**
641
+ * Parse the network_code from Order resource.
642
+ *
643
+ * @param {string} orderName
644
+ * A fully-qualified path representing Order resource.
645
+ * @returns {string} A string representing the network_code.
646
+ */
647
+ matchNetworkCodeFromOrderName(orderName) {
648
+ return this.pathTemplates.orderPathTemplate.match(orderName).network_code;
649
+ }
650
+ /**
651
+ * Parse the order from Order resource.
652
+ *
653
+ * @param {string} orderName
654
+ * A fully-qualified path representing Order resource.
655
+ * @returns {string} A string representing the order.
656
+ */
657
+ matchOrderFromOrderName(orderName) {
658
+ return this.pathTemplates.orderPathTemplate.match(orderName).order;
659
+ }
660
+ /**
661
+ * Return a fully-qualified placement resource name string.
662
+ *
663
+ * @param {string} network_code
664
+ * @param {string} placement
665
+ * @returns {string} Resource name string.
666
+ */
667
+ placementPath(networkCode, placement) {
668
+ return this.pathTemplates.placementPathTemplate.render({
669
+ network_code: networkCode,
670
+ placement: placement,
671
+ });
672
+ }
673
+ /**
674
+ * Parse the network_code from Placement resource.
675
+ *
676
+ * @param {string} placementName
677
+ * A fully-qualified path representing Placement resource.
678
+ * @returns {string} A string representing the network_code.
679
+ */
680
+ matchNetworkCodeFromPlacementName(placementName) {
681
+ return this.pathTemplates.placementPathTemplate.match(placementName)
682
+ .network_code;
683
+ }
684
+ /**
685
+ * Parse the placement from Placement resource.
686
+ *
687
+ * @param {string} placementName
688
+ * A fully-qualified path representing Placement resource.
689
+ * @returns {string} A string representing the placement.
690
+ */
691
+ matchPlacementFromPlacementName(placementName) {
692
+ return this.pathTemplates.placementPathTemplate.match(placementName)
693
+ .placement;
694
+ }
695
+ /**
696
+ * Return a fully-qualified report resource name string.
697
+ *
698
+ * @param {string} network_code
699
+ * @param {string} report
700
+ * @returns {string} Resource name string.
701
+ */
702
+ reportPath(networkCode, report) {
703
+ return this.pathTemplates.reportPathTemplate.render({
704
+ network_code: networkCode,
705
+ report: report,
706
+ });
707
+ }
708
+ /**
709
+ * Parse the network_code from Report resource.
710
+ *
711
+ * @param {string} reportName
712
+ * A fully-qualified path representing Report resource.
713
+ * @returns {string} A string representing the network_code.
714
+ */
715
+ matchNetworkCodeFromReportName(reportName) {
716
+ return this.pathTemplates.reportPathTemplate.match(reportName).network_code;
717
+ }
718
+ /**
719
+ * Parse the report from Report resource.
720
+ *
721
+ * @param {string} reportName
722
+ * A fully-qualified path representing Report resource.
723
+ * @returns {string} A string representing the report.
724
+ */
725
+ matchReportFromReportName(reportName) {
726
+ return this.pathTemplates.reportPathTemplate.match(reportName).report;
727
+ }
728
+ /**
729
+ * Return a fully-qualified role resource name string.
730
+ *
731
+ * @param {string} network_code
732
+ * @param {string} role
733
+ * @returns {string} Resource name string.
734
+ */
735
+ rolePath(networkCode, role) {
736
+ return this.pathTemplates.rolePathTemplate.render({
737
+ network_code: networkCode,
738
+ role: role,
739
+ });
740
+ }
741
+ /**
742
+ * Parse the network_code from Role resource.
743
+ *
744
+ * @param {string} roleName
745
+ * A fully-qualified path representing Role resource.
746
+ * @returns {string} A string representing the network_code.
747
+ */
748
+ matchNetworkCodeFromRoleName(roleName) {
749
+ return this.pathTemplates.rolePathTemplate.match(roleName).network_code;
750
+ }
751
+ /**
752
+ * Parse the role from Role resource.
753
+ *
754
+ * @param {string} roleName
755
+ * A fully-qualified path representing Role resource.
756
+ * @returns {string} A string representing the role.
757
+ */
758
+ matchRoleFromRoleName(roleName) {
759
+ return this.pathTemplates.rolePathTemplate.match(roleName).role;
760
+ }
761
+ /**
762
+ * Return a fully-qualified taxonomyCategory resource name string.
763
+ *
764
+ * @param {string} network_code
765
+ * @param {string} taxonomy_category
766
+ * @returns {string} Resource name string.
767
+ */
768
+ taxonomyCategoryPath(networkCode, taxonomyCategory) {
769
+ return this.pathTemplates.taxonomyCategoryPathTemplate.render({
770
+ network_code: networkCode,
771
+ taxonomy_category: taxonomyCategory,
772
+ });
773
+ }
774
+ /**
775
+ * Parse the network_code from TaxonomyCategory resource.
776
+ *
777
+ * @param {string} taxonomyCategoryName
778
+ * A fully-qualified path representing TaxonomyCategory resource.
779
+ * @returns {string} A string representing the network_code.
780
+ */
781
+ matchNetworkCodeFromTaxonomyCategoryName(taxonomyCategoryName) {
782
+ return this.pathTemplates.taxonomyCategoryPathTemplate.match(taxonomyCategoryName).network_code;
783
+ }
784
+ /**
785
+ * Parse the taxonomy_category from TaxonomyCategory resource.
786
+ *
787
+ * @param {string} taxonomyCategoryName
788
+ * A fully-qualified path representing TaxonomyCategory resource.
789
+ * @returns {string} A string representing the taxonomy_category.
790
+ */
791
+ matchTaxonomyCategoryFromTaxonomyCategoryName(taxonomyCategoryName) {
792
+ return this.pathTemplates.taxonomyCategoryPathTemplate.match(taxonomyCategoryName).taxonomy_category;
793
+ }
794
+ /**
795
+ * Return a fully-qualified team resource name string.
796
+ *
797
+ * @param {string} network_code
798
+ * @param {string} team
799
+ * @returns {string} Resource name string.
800
+ */
801
+ teamPath(networkCode, team) {
802
+ return this.pathTemplates.teamPathTemplate.render({
803
+ network_code: networkCode,
804
+ team: team,
805
+ });
806
+ }
807
+ /**
808
+ * Parse the network_code from Team resource.
809
+ *
810
+ * @param {string} teamName
811
+ * A fully-qualified path representing Team resource.
812
+ * @returns {string} A string representing the network_code.
813
+ */
814
+ matchNetworkCodeFromTeamName(teamName) {
815
+ return this.pathTemplates.teamPathTemplate.match(teamName).network_code;
816
+ }
817
+ /**
818
+ * Parse the team from Team resource.
819
+ *
820
+ * @param {string} teamName
821
+ * A fully-qualified path representing Team resource.
822
+ * @returns {string} A string representing the team.
823
+ */
824
+ matchTeamFromTeamName(teamName) {
825
+ return this.pathTemplates.teamPathTemplate.match(teamName).team;
826
+ }
827
+ /**
828
+ * Return a fully-qualified user resource name string.
829
+ *
830
+ * @param {string} network_code
831
+ * @param {string} user
832
+ * @returns {string} Resource name string.
833
+ */
834
+ userPath(networkCode, user) {
835
+ return this.pathTemplates.userPathTemplate.render({
836
+ network_code: networkCode,
837
+ user: user,
838
+ });
839
+ }
840
+ /**
841
+ * Parse the network_code from User resource.
842
+ *
843
+ * @param {string} userName
844
+ * A fully-qualified path representing User resource.
845
+ * @returns {string} A string representing the network_code.
846
+ */
847
+ matchNetworkCodeFromUserName(userName) {
848
+ return this.pathTemplates.userPathTemplate.match(userName).network_code;
849
+ }
850
+ /**
851
+ * Parse the user from User resource.
852
+ *
853
+ * @param {string} userName
854
+ * A fully-qualified path representing User resource.
855
+ * @returns {string} A string representing the user.
856
+ */
857
+ matchUserFromUserName(userName) {
858
+ return this.pathTemplates.userPathTemplate.match(userName).user;
859
+ }
860
+ /**
861
+ * Terminate the gRPC channel and close the client.
862
+ *
863
+ * The client will no longer be usable and all future behavior is undefined.
864
+ * @returns {Promise} A promise that resolves when the client is closed.
865
+ */
866
+ close() {
867
+ if (this.networkServiceStub && !this._terminated) {
868
+ return this.networkServiceStub.then(stub => {
869
+ this._terminated = true;
870
+ stub.close();
871
+ });
872
+ }
873
+ return Promise.resolve();
874
+ }
875
+ }
876
+ exports.NetworkServiceClient = NetworkServiceClient;
877
+ //# sourceMappingURL=network_service_client.js.map