@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,1352 @@
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.ReportServiceClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ /**
23
+ * Client JSON configuration object, loaded from
24
+ * `src/v1/report_service_client_config.json`.
25
+ * This file defines retry strategy and timeouts for all API methods in this library.
26
+ */
27
+ const gapicConfig = require("./report_service_client_config.json");
28
+ const version = require('../../../package.json').version;
29
+ /**
30
+ * Provides methods for interacting with reports.
31
+ * @class
32
+ * @memberof v1
33
+ */
34
+ class ReportServiceClient {
35
+ /**
36
+ * Construct an instance of ReportServiceClient.
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 ReportServiceClient({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
+ listReports: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'reports'),
180
+ fetchReportResultRows: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'rows'),
181
+ };
182
+ const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
183
+ // This API contains "long-running operations", which return a
184
+ // an Operation object that allows for tracking of the operation,
185
+ // rather than holding a request open.
186
+ const lroOptions = {
187
+ auth: this.auth,
188
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
189
+ };
190
+ if (opts.fallback) {
191
+ lroOptions.protoJson = protoFilesRoot;
192
+ lroOptions.httpRules = [
193
+ {
194
+ selector: 'google.longrunning.Operations.GetOperation',
195
+ get: '/v1/{name=networks/*/operations/reports/runs/*}',
196
+ additional_bindings: [
197
+ { get: '/v1/{name=networks/*/operations/reports/exports/*}' },
198
+ ],
199
+ },
200
+ ];
201
+ }
202
+ this.operationsClient = this._gaxModule
203
+ .lro(lroOptions)
204
+ .operationsClient(opts);
205
+ const runReportResponse = protoFilesRoot.lookup('.google.ads.admanager.v1.RunReportResponse');
206
+ const runReportMetadata = protoFilesRoot.lookup('.google.ads.admanager.v1.RunReportMetadata');
207
+ this.descriptors.longrunning = {
208
+ runReport: new this._gaxModule.LongrunningDescriptor(this.operationsClient, runReportResponse.decode.bind(runReportResponse), runReportMetadata.decode.bind(runReportMetadata)),
209
+ };
210
+ // Put together the default options sent with requests.
211
+ this._defaults = this._gaxGrpc.constructSettings('google.ads.admanager.v1.ReportService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
212
+ // Set up a dictionary of "inner API calls"; the core implementation
213
+ // of calling the API is handled in `google-gax`, with this code
214
+ // merely providing the destination and request information.
215
+ this.innerApiCalls = {};
216
+ // Add a warn function to the client constructor so it can be easily tested.
217
+ this.warn = this._gaxModule.warn;
218
+ }
219
+ /**
220
+ * Initialize the client.
221
+ * Performs asynchronous operations (such as authentication) and prepares the client.
222
+ * This function will be called automatically when any class method is called for the
223
+ * first time, but if you need to initialize it before calling an actual method,
224
+ * feel free to call initialize() directly.
225
+ *
226
+ * You can await on this method if you want to make sure the client is initialized.
227
+ *
228
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
229
+ */
230
+ initialize() {
231
+ // If the client stub promise is already initialized, return immediately.
232
+ if (this.reportServiceStub) {
233
+ return this.reportServiceStub;
234
+ }
235
+ // Put together the "service stub" for
236
+ // google.ads.admanager.v1.ReportService.
237
+ this.reportServiceStub = this._gaxGrpc.createStub(this._opts.fallback
238
+ ? this._protos.lookupService('google.ads.admanager.v1.ReportService')
239
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
240
+ this._protos.google.ads.admanager.v1.ReportService, this._opts, this._providedCustomServicePath);
241
+ // Iterate over each of the methods that the service provides
242
+ // and create an API call method for each.
243
+ const reportServiceStubMethods = [
244
+ 'getReport',
245
+ 'listReports',
246
+ 'createReport',
247
+ 'updateReport',
248
+ 'runReport',
249
+ 'fetchReportResultRows',
250
+ ];
251
+ for (const methodName of reportServiceStubMethods) {
252
+ const callPromise = this.reportServiceStub.then(stub => (...args) => {
253
+ if (this._terminated) {
254
+ return Promise.reject('The client has already been closed.');
255
+ }
256
+ const func = stub[methodName];
257
+ return func.apply(stub, args);
258
+ }, (err) => () => {
259
+ throw err;
260
+ });
261
+ const descriptor = this.descriptors.page[methodName] ||
262
+ this.descriptors.longrunning[methodName] ||
263
+ undefined;
264
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
265
+ this.innerApiCalls[methodName] = apiCall;
266
+ }
267
+ return this.reportServiceStub;
268
+ }
269
+ /**
270
+ * The DNS address for this API service.
271
+ * @deprecated Use the apiEndpoint method of the client instance.
272
+ * @returns {string} The DNS address for this service.
273
+ */
274
+ static get servicePath() {
275
+ if (typeof process === 'object' &&
276
+ typeof process.emitWarning === 'function') {
277
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
278
+ }
279
+ return 'admanager.googleapis.com';
280
+ }
281
+ /**
282
+ * The DNS address for this API service - same as servicePath.
283
+ * @deprecated Use the apiEndpoint method of the client instance.
284
+ * @returns {string} The DNS address for this service.
285
+ */
286
+ static get apiEndpoint() {
287
+ if (typeof process === 'object' &&
288
+ typeof process.emitWarning === 'function') {
289
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
290
+ }
291
+ return 'admanager.googleapis.com';
292
+ }
293
+ /**
294
+ * The DNS address for this API service.
295
+ * @returns {string} The DNS address for this service.
296
+ */
297
+ get apiEndpoint() {
298
+ return this._servicePath;
299
+ }
300
+ get universeDomain() {
301
+ return this._universeDomain;
302
+ }
303
+ /**
304
+ * The port for this API service.
305
+ * @returns {number} The default port for this service.
306
+ */
307
+ static get port() {
308
+ return 443;
309
+ }
310
+ /**
311
+ * The scopes needed to make gRPC calls for every method defined
312
+ * in this service.
313
+ * @returns {string[]} List of default scopes.
314
+ */
315
+ static get scopes() {
316
+ return [];
317
+ }
318
+ /**
319
+ * Return the project ID used by this class.
320
+ * @returns {Promise} A promise that resolves to string containing the project ID.
321
+ */
322
+ getProjectId(callback) {
323
+ if (callback) {
324
+ this.auth.getProjectId(callback);
325
+ return;
326
+ }
327
+ return this.auth.getProjectId();
328
+ }
329
+ getReport(request, optionsOrCallback, callback) {
330
+ var _a;
331
+ request = request || {};
332
+ let options;
333
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
334
+ callback = optionsOrCallback;
335
+ options = {};
336
+ }
337
+ else {
338
+ options = optionsOrCallback;
339
+ }
340
+ options = options || {};
341
+ options.otherArgs = options.otherArgs || {};
342
+ options.otherArgs.headers = options.otherArgs.headers || {};
343
+ options.otherArgs.headers['x-goog-request-params'] =
344
+ this._gaxModule.routingHeader.fromParams({
345
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
346
+ });
347
+ this.initialize();
348
+ return this.innerApiCalls.getReport(request, options, callback);
349
+ }
350
+ createReport(request, optionsOrCallback, callback) {
351
+ var _a;
352
+ request = request || {};
353
+ let options;
354
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
355
+ callback = optionsOrCallback;
356
+ options = {};
357
+ }
358
+ else {
359
+ options = optionsOrCallback;
360
+ }
361
+ options = options || {};
362
+ options.otherArgs = options.otherArgs || {};
363
+ options.otherArgs.headers = options.otherArgs.headers || {};
364
+ options.otherArgs.headers['x-goog-request-params'] =
365
+ this._gaxModule.routingHeader.fromParams({
366
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
367
+ });
368
+ this.initialize();
369
+ return this.innerApiCalls.createReport(request, options, callback);
370
+ }
371
+ updateReport(request, optionsOrCallback, callback) {
372
+ var _a;
373
+ request = request || {};
374
+ let options;
375
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
376
+ callback = optionsOrCallback;
377
+ options = {};
378
+ }
379
+ else {
380
+ options = optionsOrCallback;
381
+ }
382
+ options = options || {};
383
+ options.otherArgs = options.otherArgs || {};
384
+ options.otherArgs.headers = options.otherArgs.headers || {};
385
+ options.otherArgs.headers['x-goog-request-params'] =
386
+ this._gaxModule.routingHeader.fromParams({
387
+ 'report.name': (_a = request.report.name) !== null && _a !== void 0 ? _a : '',
388
+ });
389
+ this.initialize();
390
+ return this.innerApiCalls.updateReport(request, options, callback);
391
+ }
392
+ runReport(request, optionsOrCallback, callback) {
393
+ var _a;
394
+ request = request || {};
395
+ let options;
396
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
397
+ callback = optionsOrCallback;
398
+ options = {};
399
+ }
400
+ else {
401
+ options = optionsOrCallback;
402
+ }
403
+ options = options || {};
404
+ options.otherArgs = options.otherArgs || {};
405
+ options.otherArgs.headers = options.otherArgs.headers || {};
406
+ options.otherArgs.headers['x-goog-request-params'] =
407
+ this._gaxModule.routingHeader.fromParams({
408
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
409
+ });
410
+ this.initialize();
411
+ return this.innerApiCalls.runReport(request, options, callback);
412
+ }
413
+ /**
414
+ * Check the status of the long running operation returned by `runReport()`.
415
+ * @param {String} name
416
+ * The operation name that will be passed.
417
+ * @returns {Promise} - The promise which resolves to an object.
418
+ * The decoded operation object has result and metadata field to get information from.
419
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
420
+ * for more details and examples.
421
+ * @example <caption>include:samples/generated/v1/report_service.run_report.js</caption>
422
+ * region_tag:admanager_v1_generated_ReportService_RunReport_async
423
+ */
424
+ async checkRunReportProgress(name) {
425
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
426
+ const [operation] = await this.operationsClient.getOperation(request);
427
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runReport, this._gaxModule.createDefaultBackoffSettings());
428
+ return decodeOperation;
429
+ }
430
+ listReports(request, optionsOrCallback, callback) {
431
+ var _a;
432
+ request = request || {};
433
+ let options;
434
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
435
+ callback = optionsOrCallback;
436
+ options = {};
437
+ }
438
+ else {
439
+ options = optionsOrCallback;
440
+ }
441
+ options = options || {};
442
+ options.otherArgs = options.otherArgs || {};
443
+ options.otherArgs.headers = options.otherArgs.headers || {};
444
+ options.otherArgs.headers['x-goog-request-params'] =
445
+ this._gaxModule.routingHeader.fromParams({
446
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
447
+ });
448
+ this.initialize();
449
+ return this.innerApiCalls.listReports(request, options, callback);
450
+ }
451
+ /**
452
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
453
+ * @param {Object} request
454
+ * The request object that will be sent.
455
+ * @param {string} request.parent
456
+ * Required. The parent, which owns this collection of reports.
457
+ * Format: `networks/{network_code}`
458
+ * @param {number} [request.pageSize]
459
+ * Optional. The maximum number of `Reports` to return. The service may return
460
+ * fewer than this value. If unspecified, at most 50 `Reports` will be
461
+ * returned. The maximum value is 1000; values above 1000 will be coerced to
462
+ * 1000.
463
+ * @param {string} [request.pageToken]
464
+ * Optional. A page token, received from a previous `ListReports` call.
465
+ * Provide this to retrieve the subsequent page.
466
+ *
467
+ * When paginating, all other parameters provided to `ListReports` must
468
+ * match the call that provided the page token.
469
+ * @param {string} [request.filter]
470
+ * Optional. Expression to filter the response.
471
+ * See syntax details at
472
+ * https://developers.google.com/ad-manager/api/beta/filters
473
+ * @param {string} [request.orderBy]
474
+ * Optional. Expression to specify sorting order.
475
+ * See syntax details at
476
+ * https://developers.google.com/ad-manager/api/beta/filters#order
477
+ * @param {number} [request.skip]
478
+ * Optional. Number of individual resources to skip while paginating.
479
+ * @param {object} [options]
480
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
481
+ * @returns {Stream}
482
+ * An object stream which emits an object representing {@link protos.google.ads.admanager.v1.Report|Report} on 'data' event.
483
+ * The client library will perform auto-pagination by default: it will call the API as many
484
+ * times as needed. Note that it can affect your quota.
485
+ * We recommend using `listReportsAsync()`
486
+ * method described below for async iteration which you can stop as needed.
487
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
488
+ * for more details and examples.
489
+ */
490
+ listReportsStream(request, options) {
491
+ var _a;
492
+ request = request || {};
493
+ options = options || {};
494
+ options.otherArgs = options.otherArgs || {};
495
+ options.otherArgs.headers = options.otherArgs.headers || {};
496
+ options.otherArgs.headers['x-goog-request-params'] =
497
+ this._gaxModule.routingHeader.fromParams({
498
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
499
+ });
500
+ const defaultCallSettings = this._defaults['listReports'];
501
+ const callSettings = defaultCallSettings.merge(options);
502
+ this.initialize();
503
+ return this.descriptors.page.listReports.createStream(this.innerApiCalls.listReports, request, callSettings);
504
+ }
505
+ /**
506
+ * Equivalent to `listReports`, but returns an iterable object.
507
+ *
508
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
509
+ * @param {Object} request
510
+ * The request object that will be sent.
511
+ * @param {string} request.parent
512
+ * Required. The parent, which owns this collection of reports.
513
+ * Format: `networks/{network_code}`
514
+ * @param {number} [request.pageSize]
515
+ * Optional. The maximum number of `Reports` to return. The service may return
516
+ * fewer than this value. If unspecified, at most 50 `Reports` will be
517
+ * returned. The maximum value is 1000; values above 1000 will be coerced to
518
+ * 1000.
519
+ * @param {string} [request.pageToken]
520
+ * Optional. A page token, received from a previous `ListReports` call.
521
+ * Provide this to retrieve the subsequent page.
522
+ *
523
+ * When paginating, all other parameters provided to `ListReports` must
524
+ * match the call that provided the page token.
525
+ * @param {string} [request.filter]
526
+ * Optional. Expression to filter the response.
527
+ * See syntax details at
528
+ * https://developers.google.com/ad-manager/api/beta/filters
529
+ * @param {string} [request.orderBy]
530
+ * Optional. Expression to specify sorting order.
531
+ * See syntax details at
532
+ * https://developers.google.com/ad-manager/api/beta/filters#order
533
+ * @param {number} [request.skip]
534
+ * Optional. Number of individual resources to skip while paginating.
535
+ * @param {object} [options]
536
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
537
+ * @returns {Object}
538
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
539
+ * When you iterate the returned iterable, each element will be an object representing
540
+ * {@link protos.google.ads.admanager.v1.Report|Report}. The API will be called under the hood as needed, once per the page,
541
+ * so you can stop the iteration when you don't need more results.
542
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
543
+ * for more details and examples.
544
+ * @example <caption>include:samples/generated/v1/report_service.list_reports.js</caption>
545
+ * region_tag:admanager_v1_generated_ReportService_ListReports_async
546
+ */
547
+ listReportsAsync(request, options) {
548
+ var _a;
549
+ request = request || {};
550
+ options = options || {};
551
+ options.otherArgs = options.otherArgs || {};
552
+ options.otherArgs.headers = options.otherArgs.headers || {};
553
+ options.otherArgs.headers['x-goog-request-params'] =
554
+ this._gaxModule.routingHeader.fromParams({
555
+ parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
556
+ });
557
+ const defaultCallSettings = this._defaults['listReports'];
558
+ const callSettings = defaultCallSettings.merge(options);
559
+ this.initialize();
560
+ return this.descriptors.page.listReports.asyncIterate(this.innerApiCalls['listReports'], request, callSettings);
561
+ }
562
+ fetchReportResultRows(request, optionsOrCallback, callback) {
563
+ var _a;
564
+ request = request || {};
565
+ let options;
566
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
567
+ callback = optionsOrCallback;
568
+ options = {};
569
+ }
570
+ else {
571
+ options = optionsOrCallback;
572
+ }
573
+ options = options || {};
574
+ options.otherArgs = options.otherArgs || {};
575
+ options.otherArgs.headers = options.otherArgs.headers || {};
576
+ options.otherArgs.headers['x-goog-request-params'] =
577
+ this._gaxModule.routingHeader.fromParams({
578
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
579
+ });
580
+ this.initialize();
581
+ return this.innerApiCalls.fetchReportResultRows(request, options, callback);
582
+ }
583
+ /**
584
+ * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
585
+ * @param {Object} request
586
+ * The request object that will be sent.
587
+ * @param {string} request.name
588
+ * The report result being fetched.
589
+ * Format:
590
+ * `networks/{network_code}/reports/{report_id}/results/{report_result_id}`
591
+ * @param {number} [request.pageSize]
592
+ * Optional. The maximum number of rows to return. The service may return
593
+ * fewer than this value. If unspecified, at most 1,000 rows will be returned.
594
+ * The maximum value is 10,000; values above 10,000 will be reduced to 10,000.
595
+ * @param {string} [request.pageToken]
596
+ * Optional. A page token, received from a previous `FetchReportResultRows`
597
+ * call. Provide this to retrieve the second and subsequent batches of rows.
598
+ * @param {object} [options]
599
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
600
+ * @returns {Stream}
601
+ * An object stream which emits an object representing {@link protos.google.ads.admanager.v1.Report.DataTable.Row|Row} on 'data' event.
602
+ * The client library will perform auto-pagination by default: it will call the API as many
603
+ * times as needed. Note that it can affect your quota.
604
+ * We recommend using `fetchReportResultRowsAsync()`
605
+ * method described below for async iteration which you can stop as needed.
606
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
607
+ * for more details and examples.
608
+ */
609
+ fetchReportResultRowsStream(request, options) {
610
+ var _a;
611
+ request = request || {};
612
+ options = options || {};
613
+ options.otherArgs = options.otherArgs || {};
614
+ options.otherArgs.headers = options.otherArgs.headers || {};
615
+ options.otherArgs.headers['x-goog-request-params'] =
616
+ this._gaxModule.routingHeader.fromParams({
617
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
618
+ });
619
+ const defaultCallSettings = this._defaults['fetchReportResultRows'];
620
+ const callSettings = defaultCallSettings.merge(options);
621
+ this.initialize();
622
+ return this.descriptors.page.fetchReportResultRows.createStream(this.innerApiCalls.fetchReportResultRows, request, callSettings);
623
+ }
624
+ /**
625
+ * Equivalent to `fetchReportResultRows`, but returns an iterable object.
626
+ *
627
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
628
+ * @param {Object} request
629
+ * The request object that will be sent.
630
+ * @param {string} request.name
631
+ * The report result being fetched.
632
+ * Format:
633
+ * `networks/{network_code}/reports/{report_id}/results/{report_result_id}`
634
+ * @param {number} [request.pageSize]
635
+ * Optional. The maximum number of rows to return. The service may return
636
+ * fewer than this value. If unspecified, at most 1,000 rows will be returned.
637
+ * The maximum value is 10,000; values above 10,000 will be reduced to 10,000.
638
+ * @param {string} [request.pageToken]
639
+ * Optional. A page token, received from a previous `FetchReportResultRows`
640
+ * call. Provide this to retrieve the second and subsequent batches of rows.
641
+ * @param {object} [options]
642
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
643
+ * @returns {Object}
644
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
645
+ * When you iterate the returned iterable, each element will be an object representing
646
+ * {@link protos.google.ads.admanager.v1.Report.DataTable.Row|Row}. The API will be called under the hood as needed, once per the page,
647
+ * so you can stop the iteration when you don't need more results.
648
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
649
+ * for more details and examples.
650
+ * @example <caption>include:samples/generated/v1/report_service.fetch_report_result_rows.js</caption>
651
+ * region_tag:admanager_v1_generated_ReportService_FetchReportResultRows_async
652
+ */
653
+ fetchReportResultRowsAsync(request, options) {
654
+ var _a;
655
+ request = request || {};
656
+ options = options || {};
657
+ options.otherArgs = options.otherArgs || {};
658
+ options.otherArgs.headers = options.otherArgs.headers || {};
659
+ options.otherArgs.headers['x-goog-request-params'] =
660
+ this._gaxModule.routingHeader.fromParams({
661
+ name: (_a = request.name) !== null && _a !== void 0 ? _a : '',
662
+ });
663
+ const defaultCallSettings = this._defaults['fetchReportResultRows'];
664
+ const callSettings = defaultCallSettings.merge(options);
665
+ this.initialize();
666
+ return this.descriptors.page.fetchReportResultRows.asyncIterate(this.innerApiCalls['fetchReportResultRows'], request, callSettings);
667
+ }
668
+ /**
669
+ * Gets the latest state of a long-running operation. Clients can use this
670
+ * method to poll the operation result at intervals as recommended by the API
671
+ * service.
672
+ *
673
+ * @param {Object} request - The request object that will be sent.
674
+ * @param {string} request.name - The name of the operation resource.
675
+ * @param {Object=} options
676
+ * Optional parameters. You can override the default settings for this call,
677
+ * e.g, timeout, retries, paginations, etc. See {@link
678
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
679
+ * for the details.
680
+ * @param {function(?Error, ?Object)=} callback
681
+ * The function which will be called with the result of the API call.
682
+ *
683
+ * The second parameter to the callback is an object representing
684
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
685
+ * @return {Promise} - The promise which resolves to an array.
686
+ * The first element of the array is an object representing
687
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
688
+ * The promise has a method named "cancel" which cancels the ongoing API call.
689
+ *
690
+ * @example
691
+ * ```
692
+ * const client = longrunning.operationsClient();
693
+ * const name = '';
694
+ * const [response] = await client.getOperation({name});
695
+ * // doThingsWith(response)
696
+ * ```
697
+ */
698
+ getOperation(request, options, callback) {
699
+ return this.operationsClient.getOperation(request, options, callback);
700
+ }
701
+ /**
702
+ * Lists operations that match the specified filter in the request. If the
703
+ * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
704
+ *
705
+ * For-await-of syntax is used with the iterable to recursively get response element on-demand.
706
+ *
707
+ * @param {Object} request - The request object that will be sent.
708
+ * @param {string} request.name - The name of the operation collection.
709
+ * @param {string} request.filter - The standard list filter.
710
+ * @param {number=} request.pageSize -
711
+ * The maximum number of resources contained in the underlying API
712
+ * response. If page streaming is performed per-resource, this
713
+ * parameter does not affect the return value. If page streaming is
714
+ * performed per-page, this determines the maximum number of
715
+ * resources in a page.
716
+ * @param {Object=} options
717
+ * Optional parameters. You can override the default settings for this call,
718
+ * e.g, timeout, retries, paginations, etc. See {@link
719
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
720
+ * details.
721
+ * @returns {Object}
722
+ * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
723
+ *
724
+ * @example
725
+ * ```
726
+ * const client = longrunning.operationsClient();
727
+ * for await (const response of client.listOperationsAsync(request));
728
+ * // doThingsWith(response)
729
+ * ```
730
+ */
731
+ listOperationsAsync(request, options) {
732
+ return this.operationsClient.listOperationsAsync(request, options);
733
+ }
734
+ /**
735
+ * Starts asynchronous cancellation on a long-running operation. The server
736
+ * makes a best effort to cancel the operation, but success is not
737
+ * guaranteed. If the server doesn't support this method, it returns
738
+ * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
739
+ * {@link Operations.GetOperation} or
740
+ * other methods to check whether the cancellation succeeded or whether the
741
+ * operation completed despite cancellation. On successful cancellation,
742
+ * the operation is not deleted; instead, it becomes an operation with
743
+ * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
744
+ * 1, corresponding to `Code.CANCELLED`.
745
+ *
746
+ * @param {Object} request - The request object that will be sent.
747
+ * @param {string} request.name - The name of the operation resource to be cancelled.
748
+ * @param {Object=} options
749
+ * Optional parameters. You can override the default settings for this call,
750
+ * e.g, timeout, retries, paginations, etc. See {@link
751
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
752
+ * details.
753
+ * @param {function(?Error)=} callback
754
+ * The function which will be called with the result of the API call.
755
+ * @return {Promise} - The promise which resolves when API call finishes.
756
+ * The promise has a method named "cancel" which cancels the ongoing API
757
+ * call.
758
+ *
759
+ * @example
760
+ * ```
761
+ * const client = longrunning.operationsClient();
762
+ * await client.cancelOperation({name: ''});
763
+ * ```
764
+ */
765
+ cancelOperation(request, options, callback) {
766
+ return this.operationsClient.cancelOperation(request, options, callback);
767
+ }
768
+ /**
769
+ * Deletes a long-running operation. This method indicates that the client is
770
+ * no longer interested in the operation result. It does not cancel the
771
+ * operation. If the server doesn't support this method, it returns
772
+ * `google.rpc.Code.UNIMPLEMENTED`.
773
+ *
774
+ * @param {Object} request - The request object that will be sent.
775
+ * @param {string} request.name - The name of the operation resource to be deleted.
776
+ * @param {Object=} options
777
+ * Optional parameters. You can override the default settings for this call,
778
+ * e.g, timeout, retries, paginations, etc. See {@link
779
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
780
+ * for the details.
781
+ * @param {function(?Error)=} callback
782
+ * The function which will be called with the result of the API call.
783
+ * @return {Promise} - The promise which resolves when API call finishes.
784
+ * The promise has a method named "cancel" which cancels the ongoing API
785
+ * call.
786
+ *
787
+ * @example
788
+ * ```
789
+ * const client = longrunning.operationsClient();
790
+ * await client.deleteOperation({name: ''});
791
+ * ```
792
+ */
793
+ deleteOperation(request, options, callback) {
794
+ return this.operationsClient.deleteOperation(request, options, callback);
795
+ }
796
+ // --------------------
797
+ // -- Path templates --
798
+ // --------------------
799
+ /**
800
+ * Return a fully-qualified adUnit resource name string.
801
+ *
802
+ * @param {string} network_code
803
+ * @param {string} ad_unit
804
+ * @returns {string} Resource name string.
805
+ */
806
+ adUnitPath(networkCode, adUnit) {
807
+ return this.pathTemplates.adUnitPathTemplate.render({
808
+ network_code: networkCode,
809
+ ad_unit: adUnit,
810
+ });
811
+ }
812
+ /**
813
+ * Parse the network_code from AdUnit resource.
814
+ *
815
+ * @param {string} adUnitName
816
+ * A fully-qualified path representing AdUnit resource.
817
+ * @returns {string} A string representing the network_code.
818
+ */
819
+ matchNetworkCodeFromAdUnitName(adUnitName) {
820
+ return this.pathTemplates.adUnitPathTemplate.match(adUnitName).network_code;
821
+ }
822
+ /**
823
+ * Parse the ad_unit from AdUnit resource.
824
+ *
825
+ * @param {string} adUnitName
826
+ * A fully-qualified path representing AdUnit resource.
827
+ * @returns {string} A string representing the ad_unit.
828
+ */
829
+ matchAdUnitFromAdUnitName(adUnitName) {
830
+ return this.pathTemplates.adUnitPathTemplate.match(adUnitName).ad_unit;
831
+ }
832
+ /**
833
+ * Return a fully-qualified company resource name string.
834
+ *
835
+ * @param {string} network_code
836
+ * @param {string} company
837
+ * @returns {string} Resource name string.
838
+ */
839
+ companyPath(networkCode, company) {
840
+ return this.pathTemplates.companyPathTemplate.render({
841
+ network_code: networkCode,
842
+ company: company,
843
+ });
844
+ }
845
+ /**
846
+ * Parse the network_code from Company resource.
847
+ *
848
+ * @param {string} companyName
849
+ * A fully-qualified path representing Company resource.
850
+ * @returns {string} A string representing the network_code.
851
+ */
852
+ matchNetworkCodeFromCompanyName(companyName) {
853
+ return this.pathTemplates.companyPathTemplate.match(companyName)
854
+ .network_code;
855
+ }
856
+ /**
857
+ * Parse the company from Company resource.
858
+ *
859
+ * @param {string} companyName
860
+ * A fully-qualified path representing Company resource.
861
+ * @returns {string} A string representing the company.
862
+ */
863
+ matchCompanyFromCompanyName(companyName) {
864
+ return this.pathTemplates.companyPathTemplate.match(companyName).company;
865
+ }
866
+ /**
867
+ * Return a fully-qualified contact resource name string.
868
+ *
869
+ * @param {string} network_code
870
+ * @param {string} contact
871
+ * @returns {string} Resource name string.
872
+ */
873
+ contactPath(networkCode, contact) {
874
+ return this.pathTemplates.contactPathTemplate.render({
875
+ network_code: networkCode,
876
+ contact: contact,
877
+ });
878
+ }
879
+ /**
880
+ * Parse the network_code from Contact resource.
881
+ *
882
+ * @param {string} contactName
883
+ * A fully-qualified path representing Contact resource.
884
+ * @returns {string} A string representing the network_code.
885
+ */
886
+ matchNetworkCodeFromContactName(contactName) {
887
+ return this.pathTemplates.contactPathTemplate.match(contactName)
888
+ .network_code;
889
+ }
890
+ /**
891
+ * Parse the contact from Contact resource.
892
+ *
893
+ * @param {string} contactName
894
+ * A fully-qualified path representing Contact resource.
895
+ * @returns {string} A string representing the contact.
896
+ */
897
+ matchContactFromContactName(contactName) {
898
+ return this.pathTemplates.contactPathTemplate.match(contactName).contact;
899
+ }
900
+ /**
901
+ * Return a fully-qualified customField resource name string.
902
+ *
903
+ * @param {string} network_code
904
+ * @param {string} custom_field
905
+ * @returns {string} Resource name string.
906
+ */
907
+ customFieldPath(networkCode, customField) {
908
+ return this.pathTemplates.customFieldPathTemplate.render({
909
+ network_code: networkCode,
910
+ custom_field: customField,
911
+ });
912
+ }
913
+ /**
914
+ * Parse the network_code from CustomField resource.
915
+ *
916
+ * @param {string} customFieldName
917
+ * A fully-qualified path representing CustomField resource.
918
+ * @returns {string} A string representing the network_code.
919
+ */
920
+ matchNetworkCodeFromCustomFieldName(customFieldName) {
921
+ return this.pathTemplates.customFieldPathTemplate.match(customFieldName)
922
+ .network_code;
923
+ }
924
+ /**
925
+ * Parse the custom_field from CustomField resource.
926
+ *
927
+ * @param {string} customFieldName
928
+ * A fully-qualified path representing CustomField resource.
929
+ * @returns {string} A string representing the custom_field.
930
+ */
931
+ matchCustomFieldFromCustomFieldName(customFieldName) {
932
+ return this.pathTemplates.customFieldPathTemplate.match(customFieldName)
933
+ .custom_field;
934
+ }
935
+ /**
936
+ * Return a fully-qualified customTargetingKey resource name string.
937
+ *
938
+ * @param {string} network_code
939
+ * @param {string} custom_targeting_key
940
+ * @returns {string} Resource name string.
941
+ */
942
+ customTargetingKeyPath(networkCode, customTargetingKey) {
943
+ return this.pathTemplates.customTargetingKeyPathTemplate.render({
944
+ network_code: networkCode,
945
+ custom_targeting_key: customTargetingKey,
946
+ });
947
+ }
948
+ /**
949
+ * Parse the network_code from CustomTargetingKey resource.
950
+ *
951
+ * @param {string} customTargetingKeyName
952
+ * A fully-qualified path representing CustomTargetingKey resource.
953
+ * @returns {string} A string representing the network_code.
954
+ */
955
+ matchNetworkCodeFromCustomTargetingKeyName(customTargetingKeyName) {
956
+ return this.pathTemplates.customTargetingKeyPathTemplate.match(customTargetingKeyName).network_code;
957
+ }
958
+ /**
959
+ * Parse the custom_targeting_key from CustomTargetingKey resource.
960
+ *
961
+ * @param {string} customTargetingKeyName
962
+ * A fully-qualified path representing CustomTargetingKey resource.
963
+ * @returns {string} A string representing the custom_targeting_key.
964
+ */
965
+ matchCustomTargetingKeyFromCustomTargetingKeyName(customTargetingKeyName) {
966
+ return this.pathTemplates.customTargetingKeyPathTemplate.match(customTargetingKeyName).custom_targeting_key;
967
+ }
968
+ /**
969
+ * Return a fully-qualified customTargetingValue resource name string.
970
+ *
971
+ * @param {string} network_code
972
+ * @param {string} custom_targeting_key
973
+ * @param {string} custom_targeting_value
974
+ * @returns {string} Resource name string.
975
+ */
976
+ customTargetingValuePath(networkCode, customTargetingKey, customTargetingValue) {
977
+ return this.pathTemplates.customTargetingValuePathTemplate.render({
978
+ network_code: networkCode,
979
+ custom_targeting_key: customTargetingKey,
980
+ custom_targeting_value: customTargetingValue,
981
+ });
982
+ }
983
+ /**
984
+ * Parse the network_code from CustomTargetingValue resource.
985
+ *
986
+ * @param {string} customTargetingValueName
987
+ * A fully-qualified path representing CustomTargetingValue resource.
988
+ * @returns {string} A string representing the network_code.
989
+ */
990
+ matchNetworkCodeFromCustomTargetingValueName(customTargetingValueName) {
991
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).network_code;
992
+ }
993
+ /**
994
+ * Parse the custom_targeting_key from CustomTargetingValue resource.
995
+ *
996
+ * @param {string} customTargetingValueName
997
+ * A fully-qualified path representing CustomTargetingValue resource.
998
+ * @returns {string} A string representing the custom_targeting_key.
999
+ */
1000
+ matchCustomTargetingKeyFromCustomTargetingValueName(customTargetingValueName) {
1001
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).custom_targeting_key;
1002
+ }
1003
+ /**
1004
+ * Parse the custom_targeting_value from CustomTargetingValue resource.
1005
+ *
1006
+ * @param {string} customTargetingValueName
1007
+ * A fully-qualified path representing CustomTargetingValue resource.
1008
+ * @returns {string} A string representing the custom_targeting_value.
1009
+ */
1010
+ matchCustomTargetingValueFromCustomTargetingValueName(customTargetingValueName) {
1011
+ return this.pathTemplates.customTargetingValuePathTemplate.match(customTargetingValueName).custom_targeting_value;
1012
+ }
1013
+ /**
1014
+ * Return a fully-qualified entitySignalsMapping resource name string.
1015
+ *
1016
+ * @param {string} network_code
1017
+ * @param {string} entity_signals_mapping
1018
+ * @returns {string} Resource name string.
1019
+ */
1020
+ entitySignalsMappingPath(networkCode, entitySignalsMapping) {
1021
+ return this.pathTemplates.entitySignalsMappingPathTemplate.render({
1022
+ network_code: networkCode,
1023
+ entity_signals_mapping: entitySignalsMapping,
1024
+ });
1025
+ }
1026
+ /**
1027
+ * Parse the network_code from EntitySignalsMapping resource.
1028
+ *
1029
+ * @param {string} entitySignalsMappingName
1030
+ * A fully-qualified path representing EntitySignalsMapping resource.
1031
+ * @returns {string} A string representing the network_code.
1032
+ */
1033
+ matchNetworkCodeFromEntitySignalsMappingName(entitySignalsMappingName) {
1034
+ return this.pathTemplates.entitySignalsMappingPathTemplate.match(entitySignalsMappingName).network_code;
1035
+ }
1036
+ /**
1037
+ * Parse the entity_signals_mapping from EntitySignalsMapping resource.
1038
+ *
1039
+ * @param {string} entitySignalsMappingName
1040
+ * A fully-qualified path representing EntitySignalsMapping resource.
1041
+ * @returns {string} A string representing the entity_signals_mapping.
1042
+ */
1043
+ matchEntitySignalsMappingFromEntitySignalsMappingName(entitySignalsMappingName) {
1044
+ return this.pathTemplates.entitySignalsMappingPathTemplate.match(entitySignalsMappingName).entity_signals_mapping;
1045
+ }
1046
+ /**
1047
+ * Return a fully-qualified label resource name string.
1048
+ *
1049
+ * @param {string} network_code
1050
+ * @param {string} label
1051
+ * @returns {string} Resource name string.
1052
+ */
1053
+ labelPath(networkCode, label) {
1054
+ return this.pathTemplates.labelPathTemplate.render({
1055
+ network_code: networkCode,
1056
+ label: label,
1057
+ });
1058
+ }
1059
+ /**
1060
+ * Parse the network_code from Label resource.
1061
+ *
1062
+ * @param {string} labelName
1063
+ * A fully-qualified path representing Label resource.
1064
+ * @returns {string} A string representing the network_code.
1065
+ */
1066
+ matchNetworkCodeFromLabelName(labelName) {
1067
+ return this.pathTemplates.labelPathTemplate.match(labelName).network_code;
1068
+ }
1069
+ /**
1070
+ * Parse the label from Label resource.
1071
+ *
1072
+ * @param {string} labelName
1073
+ * A fully-qualified path representing Label resource.
1074
+ * @returns {string} A string representing the label.
1075
+ */
1076
+ matchLabelFromLabelName(labelName) {
1077
+ return this.pathTemplates.labelPathTemplate.match(labelName).label;
1078
+ }
1079
+ /**
1080
+ * Return a fully-qualified network resource name string.
1081
+ *
1082
+ * @param {string} network_code
1083
+ * @returns {string} Resource name string.
1084
+ */
1085
+ networkPath(networkCode) {
1086
+ return this.pathTemplates.networkPathTemplate.render({
1087
+ network_code: networkCode,
1088
+ });
1089
+ }
1090
+ /**
1091
+ * Parse the network_code from Network resource.
1092
+ *
1093
+ * @param {string} networkName
1094
+ * A fully-qualified path representing Network resource.
1095
+ * @returns {string} A string representing the network_code.
1096
+ */
1097
+ matchNetworkCodeFromNetworkName(networkName) {
1098
+ return this.pathTemplates.networkPathTemplate.match(networkName)
1099
+ .network_code;
1100
+ }
1101
+ /**
1102
+ * Return a fully-qualified order resource name string.
1103
+ *
1104
+ * @param {string} network_code
1105
+ * @param {string} order
1106
+ * @returns {string} Resource name string.
1107
+ */
1108
+ orderPath(networkCode, order) {
1109
+ return this.pathTemplates.orderPathTemplate.render({
1110
+ network_code: networkCode,
1111
+ order: order,
1112
+ });
1113
+ }
1114
+ /**
1115
+ * Parse the network_code from Order resource.
1116
+ *
1117
+ * @param {string} orderName
1118
+ * A fully-qualified path representing Order resource.
1119
+ * @returns {string} A string representing the network_code.
1120
+ */
1121
+ matchNetworkCodeFromOrderName(orderName) {
1122
+ return this.pathTemplates.orderPathTemplate.match(orderName).network_code;
1123
+ }
1124
+ /**
1125
+ * Parse the order from Order resource.
1126
+ *
1127
+ * @param {string} orderName
1128
+ * A fully-qualified path representing Order resource.
1129
+ * @returns {string} A string representing the order.
1130
+ */
1131
+ matchOrderFromOrderName(orderName) {
1132
+ return this.pathTemplates.orderPathTemplate.match(orderName).order;
1133
+ }
1134
+ /**
1135
+ * Return a fully-qualified placement resource name string.
1136
+ *
1137
+ * @param {string} network_code
1138
+ * @param {string} placement
1139
+ * @returns {string} Resource name string.
1140
+ */
1141
+ placementPath(networkCode, placement) {
1142
+ return this.pathTemplates.placementPathTemplate.render({
1143
+ network_code: networkCode,
1144
+ placement: placement,
1145
+ });
1146
+ }
1147
+ /**
1148
+ * Parse the network_code from Placement resource.
1149
+ *
1150
+ * @param {string} placementName
1151
+ * A fully-qualified path representing Placement resource.
1152
+ * @returns {string} A string representing the network_code.
1153
+ */
1154
+ matchNetworkCodeFromPlacementName(placementName) {
1155
+ return this.pathTemplates.placementPathTemplate.match(placementName)
1156
+ .network_code;
1157
+ }
1158
+ /**
1159
+ * Parse the placement from Placement resource.
1160
+ *
1161
+ * @param {string} placementName
1162
+ * A fully-qualified path representing Placement resource.
1163
+ * @returns {string} A string representing the placement.
1164
+ */
1165
+ matchPlacementFromPlacementName(placementName) {
1166
+ return this.pathTemplates.placementPathTemplate.match(placementName)
1167
+ .placement;
1168
+ }
1169
+ /**
1170
+ * Return a fully-qualified report resource name string.
1171
+ *
1172
+ * @param {string} network_code
1173
+ * @param {string} report
1174
+ * @returns {string} Resource name string.
1175
+ */
1176
+ reportPath(networkCode, report) {
1177
+ return this.pathTemplates.reportPathTemplate.render({
1178
+ network_code: networkCode,
1179
+ report: report,
1180
+ });
1181
+ }
1182
+ /**
1183
+ * Parse the network_code from Report resource.
1184
+ *
1185
+ * @param {string} reportName
1186
+ * A fully-qualified path representing Report resource.
1187
+ * @returns {string} A string representing the network_code.
1188
+ */
1189
+ matchNetworkCodeFromReportName(reportName) {
1190
+ return this.pathTemplates.reportPathTemplate.match(reportName).network_code;
1191
+ }
1192
+ /**
1193
+ * Parse the report from Report resource.
1194
+ *
1195
+ * @param {string} reportName
1196
+ * A fully-qualified path representing Report resource.
1197
+ * @returns {string} A string representing the report.
1198
+ */
1199
+ matchReportFromReportName(reportName) {
1200
+ return this.pathTemplates.reportPathTemplate.match(reportName).report;
1201
+ }
1202
+ /**
1203
+ * Return a fully-qualified role resource name string.
1204
+ *
1205
+ * @param {string} network_code
1206
+ * @param {string} role
1207
+ * @returns {string} Resource name string.
1208
+ */
1209
+ rolePath(networkCode, role) {
1210
+ return this.pathTemplates.rolePathTemplate.render({
1211
+ network_code: networkCode,
1212
+ role: role,
1213
+ });
1214
+ }
1215
+ /**
1216
+ * Parse the network_code from Role resource.
1217
+ *
1218
+ * @param {string} roleName
1219
+ * A fully-qualified path representing Role resource.
1220
+ * @returns {string} A string representing the network_code.
1221
+ */
1222
+ matchNetworkCodeFromRoleName(roleName) {
1223
+ return this.pathTemplates.rolePathTemplate.match(roleName).network_code;
1224
+ }
1225
+ /**
1226
+ * Parse the role from Role resource.
1227
+ *
1228
+ * @param {string} roleName
1229
+ * A fully-qualified path representing Role resource.
1230
+ * @returns {string} A string representing the role.
1231
+ */
1232
+ matchRoleFromRoleName(roleName) {
1233
+ return this.pathTemplates.rolePathTemplate.match(roleName).role;
1234
+ }
1235
+ /**
1236
+ * Return a fully-qualified taxonomyCategory resource name string.
1237
+ *
1238
+ * @param {string} network_code
1239
+ * @param {string} taxonomy_category
1240
+ * @returns {string} Resource name string.
1241
+ */
1242
+ taxonomyCategoryPath(networkCode, taxonomyCategory) {
1243
+ return this.pathTemplates.taxonomyCategoryPathTemplate.render({
1244
+ network_code: networkCode,
1245
+ taxonomy_category: taxonomyCategory,
1246
+ });
1247
+ }
1248
+ /**
1249
+ * Parse the network_code from TaxonomyCategory resource.
1250
+ *
1251
+ * @param {string} taxonomyCategoryName
1252
+ * A fully-qualified path representing TaxonomyCategory resource.
1253
+ * @returns {string} A string representing the network_code.
1254
+ */
1255
+ matchNetworkCodeFromTaxonomyCategoryName(taxonomyCategoryName) {
1256
+ return this.pathTemplates.taxonomyCategoryPathTemplate.match(taxonomyCategoryName).network_code;
1257
+ }
1258
+ /**
1259
+ * Parse the taxonomy_category from TaxonomyCategory resource.
1260
+ *
1261
+ * @param {string} taxonomyCategoryName
1262
+ * A fully-qualified path representing TaxonomyCategory resource.
1263
+ * @returns {string} A string representing the taxonomy_category.
1264
+ */
1265
+ matchTaxonomyCategoryFromTaxonomyCategoryName(taxonomyCategoryName) {
1266
+ return this.pathTemplates.taxonomyCategoryPathTemplate.match(taxonomyCategoryName).taxonomy_category;
1267
+ }
1268
+ /**
1269
+ * Return a fully-qualified team resource name string.
1270
+ *
1271
+ * @param {string} network_code
1272
+ * @param {string} team
1273
+ * @returns {string} Resource name string.
1274
+ */
1275
+ teamPath(networkCode, team) {
1276
+ return this.pathTemplates.teamPathTemplate.render({
1277
+ network_code: networkCode,
1278
+ team: team,
1279
+ });
1280
+ }
1281
+ /**
1282
+ * Parse the network_code from Team resource.
1283
+ *
1284
+ * @param {string} teamName
1285
+ * A fully-qualified path representing Team resource.
1286
+ * @returns {string} A string representing the network_code.
1287
+ */
1288
+ matchNetworkCodeFromTeamName(teamName) {
1289
+ return this.pathTemplates.teamPathTemplate.match(teamName).network_code;
1290
+ }
1291
+ /**
1292
+ * Parse the team from Team resource.
1293
+ *
1294
+ * @param {string} teamName
1295
+ * A fully-qualified path representing Team resource.
1296
+ * @returns {string} A string representing the team.
1297
+ */
1298
+ matchTeamFromTeamName(teamName) {
1299
+ return this.pathTemplates.teamPathTemplate.match(teamName).team;
1300
+ }
1301
+ /**
1302
+ * Return a fully-qualified user resource name string.
1303
+ *
1304
+ * @param {string} network_code
1305
+ * @param {string} user
1306
+ * @returns {string} Resource name string.
1307
+ */
1308
+ userPath(networkCode, user) {
1309
+ return this.pathTemplates.userPathTemplate.render({
1310
+ network_code: networkCode,
1311
+ user: user,
1312
+ });
1313
+ }
1314
+ /**
1315
+ * Parse the network_code from User resource.
1316
+ *
1317
+ * @param {string} userName
1318
+ * A fully-qualified path representing User resource.
1319
+ * @returns {string} A string representing the network_code.
1320
+ */
1321
+ matchNetworkCodeFromUserName(userName) {
1322
+ return this.pathTemplates.userPathTemplate.match(userName).network_code;
1323
+ }
1324
+ /**
1325
+ * Parse the user from User resource.
1326
+ *
1327
+ * @param {string} userName
1328
+ * A fully-qualified path representing User resource.
1329
+ * @returns {string} A string representing the user.
1330
+ */
1331
+ matchUserFromUserName(userName) {
1332
+ return this.pathTemplates.userPathTemplate.match(userName).user;
1333
+ }
1334
+ /**
1335
+ * Terminate the gRPC channel and close the client.
1336
+ *
1337
+ * The client will no longer be usable and all future behavior is undefined.
1338
+ * @returns {Promise} A promise that resolves when the client is closed.
1339
+ */
1340
+ close() {
1341
+ if (this.reportServiceStub && !this._terminated) {
1342
+ return this.reportServiceStub.then(stub => {
1343
+ this._terminated = true;
1344
+ stub.close();
1345
+ this.operationsClient.close();
1346
+ });
1347
+ }
1348
+ return Promise.resolve();
1349
+ }
1350
+ }
1351
+ exports.ReportServiceClient = ReportServiceClient;
1352
+ //# sourceMappingURL=report_service_client.js.map