@google-cloud/agentregistry 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.
@@ -0,0 +1,2672 @@
1
+ "use strict";
2
+ // Copyright 2026 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.AgentRegistryClient = void 0;
21
+ const jsonProtos = require("../../protos/protos.json");
22
+ const google_gax_1 = require("google-gax");
23
+ /**
24
+ * Client JSON configuration object, loaded from
25
+ * `src/v1/agent_registry_client_config.json`.
26
+ * This file defines retry strategy and timeouts for all API methods in this library.
27
+ */
28
+ const gapicConfig = require("./agent_registry_client_config.json");
29
+ const version = require('../../../package.json').version;
30
+ /**
31
+ * Service for managing Agents, Endpoints, McpServers, Services, and Bindings.
32
+ * @class
33
+ * @memberof v1
34
+ */
35
+ class AgentRegistryClient {
36
+ _terminated = false;
37
+ _opts;
38
+ _providedCustomServicePath;
39
+ _gaxModule;
40
+ _gaxGrpc;
41
+ _protos;
42
+ _defaults;
43
+ _universeDomain;
44
+ _servicePath;
45
+ _log = google_gax_1.loggingUtils.log('agentregistry');
46
+ auth;
47
+ descriptors = {
48
+ page: {},
49
+ stream: {},
50
+ longrunning: {},
51
+ batching: {},
52
+ };
53
+ warn;
54
+ innerApiCalls;
55
+ locationsClient;
56
+ pathTemplates;
57
+ operationsClient;
58
+ agentRegistryStub;
59
+ /**
60
+ * Construct an instance of AgentRegistryClient.
61
+ *
62
+ * @param {object} [options] - The configuration object.
63
+ * The options accepted by the constructor are described in detail
64
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
65
+ * The common options are:
66
+ * @param {object} [options.credentials] - Credentials object.
67
+ * @param {string} [options.credentials.client_email]
68
+ * @param {string} [options.credentials.private_key]
69
+ * @param {string} [options.email] - Account email address. Required when
70
+ * using a .pem or .p12 keyFilename.
71
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
72
+ * .p12 key downloaded from the Google Developers Console. If you provide
73
+ * a path to a JSON file, the projectId option below is not necessary.
74
+ * NOTE: .pem and .p12 require you to specify options.email as well.
75
+ * @param {number} [options.port] - The port on which to connect to
76
+ * the remote host.
77
+ * @param {string} [options.projectId] - The project ID from the Google
78
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
79
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
80
+ * app is running in an environment which supports
81
+ * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
82
+ * your project ID will be detected automatically.
83
+ * @param {string} [options.apiEndpoint] - The domain name of the
84
+ * API remote host.
85
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
86
+ * Follows the structure of {@link gapicConfig}.
87
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
88
+ * For more information, please check the
89
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
90
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
91
+ * need to avoid loading the default gRPC version and want to use the fallback
92
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
93
+ * ```
94
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
95
+ * const client = new AgentRegistryClient({fallback: true}, gax);
96
+ * ```
97
+ */
98
+ constructor(opts, gaxInstance) {
99
+ // Ensure that options include all the required fields.
100
+ const staticMembers = this.constructor;
101
+ if (opts?.universe_domain &&
102
+ opts?.universeDomain &&
103
+ opts?.universe_domain !== opts?.universeDomain) {
104
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
105
+ }
106
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
107
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
108
+ : undefined;
109
+ this._universeDomain =
110
+ opts?.universeDomain ??
111
+ opts?.universe_domain ??
112
+ universeDomainEnvVar ??
113
+ 'googleapis.com';
114
+ this._servicePath = 'agentregistry.' + this._universeDomain;
115
+ const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath;
116
+ this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint);
117
+ const port = opts?.port || staticMembers.port;
118
+ const clientConfig = opts?.clientConfig ?? {};
119
+ const fallback = opts?.fallback ??
120
+ (typeof window !== 'undefined' && typeof window?.fetch === 'function');
121
+ opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
122
+ // Request numeric enum values if REST transport is used.
123
+ opts.numericEnums = true;
124
+ // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
125
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
126
+ opts['scopes'] = staticMembers.scopes;
127
+ }
128
+ // Load google-gax module synchronously if needed
129
+ if (!gaxInstance) {
130
+ gaxInstance = require('google-gax');
131
+ }
132
+ // Choose either gRPC or proto-over-HTTP implementation of google-gax.
133
+ this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
134
+ // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
135
+ this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
136
+ // Save options to use in initialize() method.
137
+ this._opts = opts;
138
+ // Save the auth object to the client, for use by other methods.
139
+ this.auth = this._gaxGrpc.auth;
140
+ // Set useJWTAccessWithScope on the auth object.
141
+ this.auth.useJWTAccessWithScope = true;
142
+ // Set defaultServicePath on the auth object.
143
+ this.auth.defaultServicePath = this._servicePath;
144
+ // Set the default scopes in auth client if needed.
145
+ if (servicePath === this._servicePath) {
146
+ this.auth.defaultScopes = staticMembers.scopes;
147
+ }
148
+ this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
149
+ // Determine the client header string.
150
+ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
151
+ if (typeof process === 'object' && 'versions' in process) {
152
+ clientHeader.push(`gl-node/${process.versions.node}`);
153
+ }
154
+ else {
155
+ clientHeader.push(`gl-web/${this._gaxModule.version}`);
156
+ }
157
+ if (!opts.fallback) {
158
+ clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
159
+ }
160
+ else {
161
+ clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
162
+ }
163
+ if (opts.libName && opts.libVersion) {
164
+ clientHeader.push(`${opts.libName}/${opts.libVersion}`);
165
+ }
166
+ // Load the applicable protos.
167
+ this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
168
+ // This API contains "path templates"; forward-slash-separated
169
+ // identifiers to uniquely identify resources within the API.
170
+ // Create useful helper objects for these.
171
+ this.pathTemplates = {
172
+ agentPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/agents/{agent}'),
173
+ bindingPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/bindings/{binding}'),
174
+ endpointPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/endpoints/{endpoint}'),
175
+ locationPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}'),
176
+ mcpServerPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/mcpServers/{mcp_server}'),
177
+ projectPathTemplate: new this._gaxModule.PathTemplate('projects/{project}'),
178
+ servicePathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/services/{service}'),
179
+ };
180
+ // Some of the methods on this service return "paged" results,
181
+ // (e.g. 50 results at a time, with tokens to get subsequent
182
+ // pages). Denote the keys used for pagination and results.
183
+ this.descriptors.page = {
184
+ listAgents: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'agents'),
185
+ searchAgents: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'agents'),
186
+ listEndpoints: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'endpoints'),
187
+ listMcpServers: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'mcpServers'),
188
+ searchMcpServers: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'mcpServers'),
189
+ listServices: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'services'),
190
+ listBindings: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'bindings'),
191
+ fetchAvailableBindings: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'bindings'),
192
+ };
193
+ const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos);
194
+ // This API contains "long-running operations", which return a
195
+ // an Operation object that allows for tracking of the operation,
196
+ // rather than holding a request open.
197
+ const lroOptions = {
198
+ auth: this.auth,
199
+ grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
200
+ };
201
+ if (opts.fallback) {
202
+ lroOptions.protoJson = protoFilesRoot;
203
+ lroOptions.httpRules = [
204
+ {
205
+ selector: 'google.cloud.location.Locations.GetLocation',
206
+ get: '/v1/{name=projects/*/locations/*}',
207
+ },
208
+ {
209
+ selector: 'google.cloud.location.Locations.ListLocations',
210
+ get: '/v1/{name=projects/*}/locations',
211
+ },
212
+ {
213
+ selector: 'google.longrunning.Operations.CancelOperation',
214
+ post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',
215
+ body: '*',
216
+ },
217
+ {
218
+ selector: 'google.longrunning.Operations.DeleteOperation',
219
+ delete: '/v1/{name=projects/*/locations/*/operations/*}',
220
+ },
221
+ {
222
+ selector: 'google.longrunning.Operations.GetOperation',
223
+ get: '/v1/{name=projects/*/locations/*/operations/*}',
224
+ },
225
+ {
226
+ selector: 'google.longrunning.Operations.ListOperations',
227
+ get: '/v1/{name=projects/*/locations/*}/operations',
228
+ },
229
+ ];
230
+ }
231
+ this.operationsClient = this._gaxModule
232
+ .lro(lroOptions)
233
+ .operationsClient(opts);
234
+ const createServiceResponse = protoFilesRoot.lookup('.google.cloud.agentregistry.v1.Service');
235
+ const createServiceMetadata = protoFilesRoot.lookup('.google.cloud.agentregistry.v1.OperationMetadata');
236
+ const updateServiceResponse = protoFilesRoot.lookup('.google.cloud.agentregistry.v1.Service');
237
+ const updateServiceMetadata = protoFilesRoot.lookup('.google.cloud.agentregistry.v1.OperationMetadata');
238
+ const deleteServiceResponse = protoFilesRoot.lookup('.google.protobuf.Empty');
239
+ const deleteServiceMetadata = protoFilesRoot.lookup('.google.cloud.agentregistry.v1.OperationMetadata');
240
+ const createBindingResponse = protoFilesRoot.lookup('.google.cloud.agentregistry.v1.Binding');
241
+ const createBindingMetadata = protoFilesRoot.lookup('.google.cloud.agentregistry.v1.OperationMetadata');
242
+ const updateBindingResponse = protoFilesRoot.lookup('.google.cloud.agentregistry.v1.Binding');
243
+ const updateBindingMetadata = protoFilesRoot.lookup('.google.cloud.agentregistry.v1.OperationMetadata');
244
+ const deleteBindingResponse = protoFilesRoot.lookup('.google.protobuf.Empty');
245
+ const deleteBindingMetadata = protoFilesRoot.lookup('.google.cloud.agentregistry.v1.OperationMetadata');
246
+ this.descriptors.longrunning = {
247
+ createService: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createServiceResponse.decode.bind(createServiceResponse), createServiceMetadata.decode.bind(createServiceMetadata)),
248
+ updateService: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateServiceResponse.decode.bind(updateServiceResponse), updateServiceMetadata.decode.bind(updateServiceMetadata)),
249
+ deleteService: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteServiceResponse.decode.bind(deleteServiceResponse), deleteServiceMetadata.decode.bind(deleteServiceMetadata)),
250
+ createBinding: new this._gaxModule.LongrunningDescriptor(this.operationsClient, createBindingResponse.decode.bind(createBindingResponse), createBindingMetadata.decode.bind(createBindingMetadata)),
251
+ updateBinding: new this._gaxModule.LongrunningDescriptor(this.operationsClient, updateBindingResponse.decode.bind(updateBindingResponse), updateBindingMetadata.decode.bind(updateBindingMetadata)),
252
+ deleteBinding: new this._gaxModule.LongrunningDescriptor(this.operationsClient, deleteBindingResponse.decode.bind(deleteBindingResponse), deleteBindingMetadata.decode.bind(deleteBindingMetadata)),
253
+ };
254
+ // Put together the default options sent with requests.
255
+ this._defaults = this._gaxGrpc.constructSettings('google.cloud.agentregistry.v1.AgentRegistry', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
256
+ // Set up a dictionary of "inner API calls"; the core implementation
257
+ // of calling the API is handled in `google-gax`, with this code
258
+ // merely providing the destination and request information.
259
+ this.innerApiCalls = {};
260
+ // Add a warn function to the client constructor so it can be easily tested.
261
+ this.warn = this._gaxModule.warn;
262
+ }
263
+ /**
264
+ * Initialize the client.
265
+ * Performs asynchronous operations (such as authentication) and prepares the client.
266
+ * This function will be called automatically when any class method is called for the
267
+ * first time, but if you need to initialize it before calling an actual method,
268
+ * feel free to call initialize() directly.
269
+ *
270
+ * You can await on this method if you want to make sure the client is initialized.
271
+ *
272
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
273
+ */
274
+ initialize() {
275
+ // If the client stub promise is already initialized, return immediately.
276
+ if (this.agentRegistryStub) {
277
+ return this.agentRegistryStub;
278
+ }
279
+ // Put together the "service stub" for
280
+ // google.cloud.agentregistry.v1.AgentRegistry.
281
+ this.agentRegistryStub = this._gaxGrpc.createStub(this._opts.fallback
282
+ ? this._protos.lookupService('google.cloud.agentregistry.v1.AgentRegistry')
283
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any
284
+ this._protos.google.cloud.agentregistry.v1.AgentRegistry, this._opts, this._providedCustomServicePath);
285
+ // Iterate over each of the methods that the service provides
286
+ // and create an API call method for each.
287
+ const agentRegistryStubMethods = [
288
+ 'listAgents',
289
+ 'searchAgents',
290
+ 'getAgent',
291
+ 'listEndpoints',
292
+ 'getEndpoint',
293
+ 'listMcpServers',
294
+ 'searchMcpServers',
295
+ 'getMcpServer',
296
+ 'listServices',
297
+ 'getService',
298
+ 'createService',
299
+ 'updateService',
300
+ 'deleteService',
301
+ 'listBindings',
302
+ 'getBinding',
303
+ 'createBinding',
304
+ 'updateBinding',
305
+ 'deleteBinding',
306
+ 'fetchAvailableBindings',
307
+ ];
308
+ for (const methodName of agentRegistryStubMethods) {
309
+ const callPromise = this.agentRegistryStub.then((stub) => (...args) => {
310
+ if (this._terminated) {
311
+ return Promise.reject('The client has already been closed.');
312
+ }
313
+ const func = stub[methodName];
314
+ return func.apply(stub, args);
315
+ }, (err) => () => {
316
+ throw err;
317
+ });
318
+ const descriptor = this.descriptors.page[methodName] ||
319
+ this.descriptors.longrunning[methodName] ||
320
+ undefined;
321
+ const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
322
+ this.innerApiCalls[methodName] = apiCall;
323
+ }
324
+ return this.agentRegistryStub;
325
+ }
326
+ /**
327
+ * The DNS address for this API service.
328
+ * @deprecated Use the apiEndpoint method of the client instance.
329
+ * @returns {string} The DNS address for this service.
330
+ */
331
+ static get servicePath() {
332
+ if (typeof process === 'object' &&
333
+ typeof process.emitWarning === 'function') {
334
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
335
+ }
336
+ return 'agentregistry.googleapis.com';
337
+ }
338
+ /**
339
+ * The DNS address for this API service - same as servicePath.
340
+ * @deprecated Use the apiEndpoint method of the client instance.
341
+ * @returns {string} The DNS address for this service.
342
+ */
343
+ static get apiEndpoint() {
344
+ if (typeof process === 'object' &&
345
+ typeof process.emitWarning === 'function') {
346
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
347
+ }
348
+ return 'agentregistry.googleapis.com';
349
+ }
350
+ /**
351
+ * The DNS address for this API service.
352
+ * @returns {string} The DNS address for this service.
353
+ */
354
+ get apiEndpoint() {
355
+ return this._servicePath;
356
+ }
357
+ get universeDomain() {
358
+ return this._universeDomain;
359
+ }
360
+ /**
361
+ * The port for this API service.
362
+ * @returns {number} The default port for this service.
363
+ */
364
+ static get port() {
365
+ return 443;
366
+ }
367
+ /**
368
+ * The scopes needed to make gRPC calls for every method defined
369
+ * in this service.
370
+ * @returns {string[]} List of default scopes.
371
+ */
372
+ static get scopes() {
373
+ return [
374
+ 'https://www.googleapis.com/auth/agentregistry.read-only',
375
+ 'https://www.googleapis.com/auth/agentregistry.read-write',
376
+ 'https://www.googleapis.com/auth/cloud-platform',
377
+ 'https://www.googleapis.com/auth/cloud-platform.read-only',
378
+ ];
379
+ }
380
+ /**
381
+ * Return the project ID used by this class.
382
+ * @returns {Promise} A promise that resolves to string containing the project ID.
383
+ */
384
+ getProjectId(callback) {
385
+ if (callback) {
386
+ this.auth.getProjectId(callback);
387
+ return;
388
+ }
389
+ return this.auth.getProjectId();
390
+ }
391
+ getAgent(request, optionsOrCallback, callback) {
392
+ request = request || {};
393
+ let options;
394
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
395
+ callback = optionsOrCallback;
396
+ options = {};
397
+ }
398
+ else {
399
+ options = optionsOrCallback;
400
+ }
401
+ options = options || {};
402
+ options.otherArgs = options.otherArgs || {};
403
+ options.otherArgs.headers = options.otherArgs.headers || {};
404
+ options.otherArgs.headers['x-goog-request-params'] =
405
+ this._gaxModule.routingHeader.fromParams({
406
+ name: request.name ?? '',
407
+ });
408
+ this.initialize().catch((err) => {
409
+ throw err;
410
+ });
411
+ this._log.info('getAgent request %j', request);
412
+ const wrappedCallback = callback
413
+ ? (error, response, options, rawResponse) => {
414
+ this._log.info('getAgent response %j', response);
415
+ callback(error, response, options, rawResponse); // We verified callback above.
416
+ }
417
+ : undefined;
418
+ return this.innerApiCalls
419
+ .getAgent(request, options, wrappedCallback)
420
+ ?.then(([response, options, rawResponse]) => {
421
+ this._log.info('getAgent response %j', response);
422
+ return [response, options, rawResponse];
423
+ })
424
+ .catch((error) => {
425
+ if (error &&
426
+ 'statusDetails' in error &&
427
+ error.statusDetails instanceof Array) {
428
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
429
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
430
+ }
431
+ throw error;
432
+ });
433
+ }
434
+ getEndpoint(request, optionsOrCallback, callback) {
435
+ request = request || {};
436
+ let options;
437
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
438
+ callback = optionsOrCallback;
439
+ options = {};
440
+ }
441
+ else {
442
+ options = optionsOrCallback;
443
+ }
444
+ options = options || {};
445
+ options.otherArgs = options.otherArgs || {};
446
+ options.otherArgs.headers = options.otherArgs.headers || {};
447
+ options.otherArgs.headers['x-goog-request-params'] =
448
+ this._gaxModule.routingHeader.fromParams({
449
+ name: request.name ?? '',
450
+ });
451
+ this.initialize().catch((err) => {
452
+ throw err;
453
+ });
454
+ this._log.info('getEndpoint request %j', request);
455
+ const wrappedCallback = callback
456
+ ? (error, response, options, rawResponse) => {
457
+ this._log.info('getEndpoint response %j', response);
458
+ callback(error, response, options, rawResponse); // We verified callback above.
459
+ }
460
+ : undefined;
461
+ return this.innerApiCalls
462
+ .getEndpoint(request, options, wrappedCallback)
463
+ ?.then(([response, options, rawResponse]) => {
464
+ this._log.info('getEndpoint response %j', response);
465
+ return [response, options, rawResponse];
466
+ })
467
+ .catch((error) => {
468
+ if (error &&
469
+ 'statusDetails' in error &&
470
+ error.statusDetails instanceof Array) {
471
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
472
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
473
+ }
474
+ throw error;
475
+ });
476
+ }
477
+ getMcpServer(request, optionsOrCallback, callback) {
478
+ request = request || {};
479
+ let options;
480
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
481
+ callback = optionsOrCallback;
482
+ options = {};
483
+ }
484
+ else {
485
+ options = optionsOrCallback;
486
+ }
487
+ options = options || {};
488
+ options.otherArgs = options.otherArgs || {};
489
+ options.otherArgs.headers = options.otherArgs.headers || {};
490
+ options.otherArgs.headers['x-goog-request-params'] =
491
+ this._gaxModule.routingHeader.fromParams({
492
+ name: request.name ?? '',
493
+ });
494
+ this.initialize().catch((err) => {
495
+ throw err;
496
+ });
497
+ this._log.info('getMcpServer request %j', request);
498
+ const wrappedCallback = callback
499
+ ? (error, response, options, rawResponse) => {
500
+ this._log.info('getMcpServer response %j', response);
501
+ callback(error, response, options, rawResponse); // We verified callback above.
502
+ }
503
+ : undefined;
504
+ return this.innerApiCalls
505
+ .getMcpServer(request, options, wrappedCallback)
506
+ ?.then(([response, options, rawResponse]) => {
507
+ this._log.info('getMcpServer response %j', response);
508
+ return [response, options, rawResponse];
509
+ })
510
+ .catch((error) => {
511
+ if (error &&
512
+ 'statusDetails' in error &&
513
+ error.statusDetails instanceof Array) {
514
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
515
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
516
+ }
517
+ throw error;
518
+ });
519
+ }
520
+ getService(request, optionsOrCallback, callback) {
521
+ request = request || {};
522
+ let options;
523
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
524
+ callback = optionsOrCallback;
525
+ options = {};
526
+ }
527
+ else {
528
+ options = optionsOrCallback;
529
+ }
530
+ options = options || {};
531
+ options.otherArgs = options.otherArgs || {};
532
+ options.otherArgs.headers = options.otherArgs.headers || {};
533
+ options.otherArgs.headers['x-goog-request-params'] =
534
+ this._gaxModule.routingHeader.fromParams({
535
+ name: request.name ?? '',
536
+ });
537
+ this.initialize().catch((err) => {
538
+ throw err;
539
+ });
540
+ this._log.info('getService request %j', request);
541
+ const wrappedCallback = callback
542
+ ? (error, response, options, rawResponse) => {
543
+ this._log.info('getService response %j', response);
544
+ callback(error, response, options, rawResponse); // We verified callback above.
545
+ }
546
+ : undefined;
547
+ return this.innerApiCalls
548
+ .getService(request, options, wrappedCallback)
549
+ ?.then(([response, options, rawResponse]) => {
550
+ this._log.info('getService response %j', response);
551
+ return [response, options, rawResponse];
552
+ })
553
+ .catch((error) => {
554
+ if (error &&
555
+ 'statusDetails' in error &&
556
+ error.statusDetails instanceof Array) {
557
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
558
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
559
+ }
560
+ throw error;
561
+ });
562
+ }
563
+ getBinding(request, optionsOrCallback, callback) {
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: request.name ?? '',
579
+ });
580
+ this.initialize().catch((err) => {
581
+ throw err;
582
+ });
583
+ this._log.info('getBinding request %j', request);
584
+ const wrappedCallback = callback
585
+ ? (error, response, options, rawResponse) => {
586
+ this._log.info('getBinding response %j', response);
587
+ callback(error, response, options, rawResponse); // We verified callback above.
588
+ }
589
+ : undefined;
590
+ return this.innerApiCalls
591
+ .getBinding(request, options, wrappedCallback)
592
+ ?.then(([response, options, rawResponse]) => {
593
+ this._log.info('getBinding response %j', response);
594
+ return [response, options, rawResponse];
595
+ })
596
+ .catch((error) => {
597
+ if (error &&
598
+ 'statusDetails' in error &&
599
+ error.statusDetails instanceof Array) {
600
+ const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
601
+ error.statusDetails = (0, google_gax_1.decodeAnyProtosInArray)(error.statusDetails, protos);
602
+ }
603
+ throw error;
604
+ });
605
+ }
606
+ createService(request, optionsOrCallback, callback) {
607
+ request = request || {};
608
+ let options;
609
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
610
+ callback = optionsOrCallback;
611
+ options = {};
612
+ }
613
+ else {
614
+ options = optionsOrCallback;
615
+ }
616
+ options = options || {};
617
+ options.otherArgs = options.otherArgs || {};
618
+ options.otherArgs.headers = options.otherArgs.headers || {};
619
+ options.otherArgs.headers['x-goog-request-params'] =
620
+ this._gaxModule.routingHeader.fromParams({
621
+ parent: request.parent ?? '',
622
+ });
623
+ this.initialize().catch((err) => {
624
+ throw err;
625
+ });
626
+ const wrappedCallback = callback
627
+ ? (error, response, rawResponse, _) => {
628
+ this._log.info('createService response %j', rawResponse);
629
+ callback(error, response, rawResponse, _); // We verified callback above.
630
+ }
631
+ : undefined;
632
+ this._log.info('createService request %j', request);
633
+ return this.innerApiCalls
634
+ .createService(request, options, wrappedCallback)
635
+ ?.then(([response, rawResponse, _]) => {
636
+ this._log.info('createService response %j', rawResponse);
637
+ return [response, rawResponse, _];
638
+ });
639
+ }
640
+ /**
641
+ * Check the status of the long running operation returned by `createService()`.
642
+ * @param {String} name
643
+ * The operation name that will be passed.
644
+ * @returns {Promise} - The promise which resolves to an object.
645
+ * The decoded operation object has result and metadata field to get information from.
646
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
647
+ * for more details and examples.
648
+ * @example <caption>include:samples/generated/v1/agent_registry.create_service.js</caption>
649
+ * region_tag:agentregistry_v1_generated_AgentRegistry_CreateService_async
650
+ */
651
+ async checkCreateServiceProgress(name) {
652
+ this._log.info('createService long-running');
653
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
654
+ const [operation] = await this.operationsClient.getOperation(request);
655
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createService, this._gaxModule.createDefaultBackoffSettings());
656
+ return decodeOperation;
657
+ }
658
+ updateService(request, optionsOrCallback, callback) {
659
+ request = request || {};
660
+ let options;
661
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
662
+ callback = optionsOrCallback;
663
+ options = {};
664
+ }
665
+ else {
666
+ options = optionsOrCallback;
667
+ }
668
+ options = options || {};
669
+ options.otherArgs = options.otherArgs || {};
670
+ options.otherArgs.headers = options.otherArgs.headers || {};
671
+ options.otherArgs.headers['x-goog-request-params'] =
672
+ this._gaxModule.routingHeader.fromParams({
673
+ 'service.name': request.service.name ?? '',
674
+ });
675
+ this.initialize().catch((err) => {
676
+ throw err;
677
+ });
678
+ const wrappedCallback = callback
679
+ ? (error, response, rawResponse, _) => {
680
+ this._log.info('updateService response %j', rawResponse);
681
+ callback(error, response, rawResponse, _); // We verified callback above.
682
+ }
683
+ : undefined;
684
+ this._log.info('updateService request %j', request);
685
+ return this.innerApiCalls
686
+ .updateService(request, options, wrappedCallback)
687
+ ?.then(([response, rawResponse, _]) => {
688
+ this._log.info('updateService response %j', rawResponse);
689
+ return [response, rawResponse, _];
690
+ });
691
+ }
692
+ /**
693
+ * Check the status of the long running operation returned by `updateService()`.
694
+ * @param {String} name
695
+ * The operation name that will be passed.
696
+ * @returns {Promise} - The promise which resolves to an object.
697
+ * The decoded operation object has result and metadata field to get information from.
698
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
699
+ * for more details and examples.
700
+ * @example <caption>include:samples/generated/v1/agent_registry.update_service.js</caption>
701
+ * region_tag:agentregistry_v1_generated_AgentRegistry_UpdateService_async
702
+ */
703
+ async checkUpdateServiceProgress(name) {
704
+ this._log.info('updateService long-running');
705
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
706
+ const [operation] = await this.operationsClient.getOperation(request);
707
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateService, this._gaxModule.createDefaultBackoffSettings());
708
+ return decodeOperation;
709
+ }
710
+ deleteService(request, optionsOrCallback, callback) {
711
+ request = request || {};
712
+ let options;
713
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
714
+ callback = optionsOrCallback;
715
+ options = {};
716
+ }
717
+ else {
718
+ options = optionsOrCallback;
719
+ }
720
+ options = options || {};
721
+ options.otherArgs = options.otherArgs || {};
722
+ options.otherArgs.headers = options.otherArgs.headers || {};
723
+ options.otherArgs.headers['x-goog-request-params'] =
724
+ this._gaxModule.routingHeader.fromParams({
725
+ name: request.name ?? '',
726
+ });
727
+ this.initialize().catch((err) => {
728
+ throw err;
729
+ });
730
+ const wrappedCallback = callback
731
+ ? (error, response, rawResponse, _) => {
732
+ this._log.info('deleteService response %j', rawResponse);
733
+ callback(error, response, rawResponse, _); // We verified callback above.
734
+ }
735
+ : undefined;
736
+ this._log.info('deleteService request %j', request);
737
+ return this.innerApiCalls
738
+ .deleteService(request, options, wrappedCallback)
739
+ ?.then(([response, rawResponse, _]) => {
740
+ this._log.info('deleteService response %j', rawResponse);
741
+ return [response, rawResponse, _];
742
+ });
743
+ }
744
+ /**
745
+ * Check the status of the long running operation returned by `deleteService()`.
746
+ * @param {String} name
747
+ * The operation name that will be passed.
748
+ * @returns {Promise} - The promise which resolves to an object.
749
+ * The decoded operation object has result and metadata field to get information from.
750
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
751
+ * for more details and examples.
752
+ * @example <caption>include:samples/generated/v1/agent_registry.delete_service.js</caption>
753
+ * region_tag:agentregistry_v1_generated_AgentRegistry_DeleteService_async
754
+ */
755
+ async checkDeleteServiceProgress(name) {
756
+ this._log.info('deleteService long-running');
757
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
758
+ const [operation] = await this.operationsClient.getOperation(request);
759
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteService, this._gaxModule.createDefaultBackoffSettings());
760
+ return decodeOperation;
761
+ }
762
+ createBinding(request, optionsOrCallback, callback) {
763
+ request = request || {};
764
+ let options;
765
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
766
+ callback = optionsOrCallback;
767
+ options = {};
768
+ }
769
+ else {
770
+ options = optionsOrCallback;
771
+ }
772
+ options = options || {};
773
+ options.otherArgs = options.otherArgs || {};
774
+ options.otherArgs.headers = options.otherArgs.headers || {};
775
+ options.otherArgs.headers['x-goog-request-params'] =
776
+ this._gaxModule.routingHeader.fromParams({
777
+ parent: request.parent ?? '',
778
+ });
779
+ this.initialize().catch((err) => {
780
+ throw err;
781
+ });
782
+ const wrappedCallback = callback
783
+ ? (error, response, rawResponse, _) => {
784
+ this._log.info('createBinding response %j', rawResponse);
785
+ callback(error, response, rawResponse, _); // We verified callback above.
786
+ }
787
+ : undefined;
788
+ this._log.info('createBinding request %j', request);
789
+ return this.innerApiCalls
790
+ .createBinding(request, options, wrappedCallback)
791
+ ?.then(([response, rawResponse, _]) => {
792
+ this._log.info('createBinding response %j', rawResponse);
793
+ return [response, rawResponse, _];
794
+ });
795
+ }
796
+ /**
797
+ * Check the status of the long running operation returned by `createBinding()`.
798
+ * @param {String} name
799
+ * The operation name that will be passed.
800
+ * @returns {Promise} - The promise which resolves to an object.
801
+ * The decoded operation object has result and metadata field to get information from.
802
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
803
+ * for more details and examples.
804
+ * @example <caption>include:samples/generated/v1/agent_registry.create_binding.js</caption>
805
+ * region_tag:agentregistry_v1_generated_AgentRegistry_CreateBinding_async
806
+ */
807
+ async checkCreateBindingProgress(name) {
808
+ this._log.info('createBinding long-running');
809
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
810
+ const [operation] = await this.operationsClient.getOperation(request);
811
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBinding, this._gaxModule.createDefaultBackoffSettings());
812
+ return decodeOperation;
813
+ }
814
+ updateBinding(request, optionsOrCallback, callback) {
815
+ request = request || {};
816
+ let options;
817
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
818
+ callback = optionsOrCallback;
819
+ options = {};
820
+ }
821
+ else {
822
+ options = optionsOrCallback;
823
+ }
824
+ options = options || {};
825
+ options.otherArgs = options.otherArgs || {};
826
+ options.otherArgs.headers = options.otherArgs.headers || {};
827
+ options.otherArgs.headers['x-goog-request-params'] =
828
+ this._gaxModule.routingHeader.fromParams({
829
+ 'binding.name': request.binding.name ?? '',
830
+ });
831
+ this.initialize().catch((err) => {
832
+ throw err;
833
+ });
834
+ const wrappedCallback = callback
835
+ ? (error, response, rawResponse, _) => {
836
+ this._log.info('updateBinding response %j', rawResponse);
837
+ callback(error, response, rawResponse, _); // We verified callback above.
838
+ }
839
+ : undefined;
840
+ this._log.info('updateBinding request %j', request);
841
+ return this.innerApiCalls
842
+ .updateBinding(request, options, wrappedCallback)
843
+ ?.then(([response, rawResponse, _]) => {
844
+ this._log.info('updateBinding response %j', rawResponse);
845
+ return [response, rawResponse, _];
846
+ });
847
+ }
848
+ /**
849
+ * Check the status of the long running operation returned by `updateBinding()`.
850
+ * @param {String} name
851
+ * The operation name that will be passed.
852
+ * @returns {Promise} - The promise which resolves to an object.
853
+ * The decoded operation object has result and metadata field to get information from.
854
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
855
+ * for more details and examples.
856
+ * @example <caption>include:samples/generated/v1/agent_registry.update_binding.js</caption>
857
+ * region_tag:agentregistry_v1_generated_AgentRegistry_UpdateBinding_async
858
+ */
859
+ async checkUpdateBindingProgress(name) {
860
+ this._log.info('updateBinding long-running');
861
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
862
+ const [operation] = await this.operationsClient.getOperation(request);
863
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateBinding, this._gaxModule.createDefaultBackoffSettings());
864
+ return decodeOperation;
865
+ }
866
+ deleteBinding(request, optionsOrCallback, callback) {
867
+ request = request || {};
868
+ let options;
869
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
870
+ callback = optionsOrCallback;
871
+ options = {};
872
+ }
873
+ else {
874
+ options = optionsOrCallback;
875
+ }
876
+ options = options || {};
877
+ options.otherArgs = options.otherArgs || {};
878
+ options.otherArgs.headers = options.otherArgs.headers || {};
879
+ options.otherArgs.headers['x-goog-request-params'] =
880
+ this._gaxModule.routingHeader.fromParams({
881
+ name: request.name ?? '',
882
+ });
883
+ this.initialize().catch((err) => {
884
+ throw err;
885
+ });
886
+ const wrappedCallback = callback
887
+ ? (error, response, rawResponse, _) => {
888
+ this._log.info('deleteBinding response %j', rawResponse);
889
+ callback(error, response, rawResponse, _); // We verified callback above.
890
+ }
891
+ : undefined;
892
+ this._log.info('deleteBinding request %j', request);
893
+ return this.innerApiCalls
894
+ .deleteBinding(request, options, wrappedCallback)
895
+ ?.then(([response, rawResponse, _]) => {
896
+ this._log.info('deleteBinding response %j', rawResponse);
897
+ return [response, rawResponse, _];
898
+ });
899
+ }
900
+ /**
901
+ * Check the status of the long running operation returned by `deleteBinding()`.
902
+ * @param {String} name
903
+ * The operation name that will be passed.
904
+ * @returns {Promise} - The promise which resolves to an object.
905
+ * The decoded operation object has result and metadata field to get information from.
906
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation }
907
+ * for more details and examples.
908
+ * @example <caption>include:samples/generated/v1/agent_registry.delete_binding.js</caption>
909
+ * region_tag:agentregistry_v1_generated_AgentRegistry_DeleteBinding_async
910
+ */
911
+ async checkDeleteBindingProgress(name) {
912
+ this._log.info('deleteBinding long-running');
913
+ const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({ name });
914
+ const [operation] = await this.operationsClient.getOperation(request);
915
+ const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBinding, this._gaxModule.createDefaultBackoffSettings());
916
+ return decodeOperation;
917
+ }
918
+ listAgents(request, optionsOrCallback, callback) {
919
+ request = request || {};
920
+ let options;
921
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
922
+ callback = optionsOrCallback;
923
+ options = {};
924
+ }
925
+ else {
926
+ options = optionsOrCallback;
927
+ }
928
+ options = options || {};
929
+ options.otherArgs = options.otherArgs || {};
930
+ options.otherArgs.headers = options.otherArgs.headers || {};
931
+ options.otherArgs.headers['x-goog-request-params'] =
932
+ this._gaxModule.routingHeader.fromParams({
933
+ parent: request.parent ?? '',
934
+ });
935
+ this.initialize().catch((err) => {
936
+ throw err;
937
+ });
938
+ const wrappedCallback = callback
939
+ ? (error, values, nextPageRequest, rawResponse) => {
940
+ this._log.info('listAgents values %j', values);
941
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
942
+ }
943
+ : undefined;
944
+ this._log.info('listAgents request %j', request);
945
+ return this.innerApiCalls
946
+ .listAgents(request, options, wrappedCallback)
947
+ ?.then(([response, input, output]) => {
948
+ this._log.info('listAgents values %j', response);
949
+ return [response, input, output];
950
+ });
951
+ }
952
+ /**
953
+ * Equivalent to `listAgents`, but returns a NodeJS Stream object.
954
+ * @param {Object} request
955
+ * The request object that will be sent.
956
+ * @param {string} request.parent
957
+ * Required. Parent value for ListAgentsRequest
958
+ * @param {number} [request.pageSize]
959
+ * Optional. Requested page size. Server may return fewer items than
960
+ * requested. If unspecified, server will pick an appropriate default.
961
+ * @param {string} [request.pageToken]
962
+ * Optional. A token identifying a page of results the server should return.
963
+ * @param {string} [request.filter]
964
+ * Optional. Filtering results
965
+ * @param {string} [request.orderBy]
966
+ * Optional. Hint for how to order the results
967
+ * @param {object} [options]
968
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
969
+ * @returns {Stream}
970
+ * An object stream which emits an object representing {@link protos.google.cloud.agentregistry.v1.Agent|Agent} on 'data' event.
971
+ * The client library will perform auto-pagination by default: it will call the API as many
972
+ * times as needed. Note that it can affect your quota.
973
+ * We recommend using `listAgentsAsync()`
974
+ * method described below for async iteration which you can stop as needed.
975
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
976
+ * for more details and examples.
977
+ */
978
+ listAgentsStream(request, options) {
979
+ request = request || {};
980
+ options = options || {};
981
+ options.otherArgs = options.otherArgs || {};
982
+ options.otherArgs.headers = options.otherArgs.headers || {};
983
+ options.otherArgs.headers['x-goog-request-params'] =
984
+ this._gaxModule.routingHeader.fromParams({
985
+ parent: request.parent ?? '',
986
+ });
987
+ const defaultCallSettings = this._defaults['listAgents'];
988
+ const callSettings = defaultCallSettings.merge(options);
989
+ this.initialize().catch((err) => {
990
+ throw err;
991
+ });
992
+ this._log.info('listAgents stream %j', request);
993
+ return this.descriptors.page.listAgents.createStream(this.innerApiCalls.listAgents, request, callSettings);
994
+ }
995
+ /**
996
+ * Equivalent to `listAgents`, but returns an iterable object.
997
+ *
998
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
999
+ * @param {Object} request
1000
+ * The request object that will be sent.
1001
+ * @param {string} request.parent
1002
+ * Required. Parent value for ListAgentsRequest
1003
+ * @param {number} [request.pageSize]
1004
+ * Optional. Requested page size. Server may return fewer items than
1005
+ * requested. If unspecified, server will pick an appropriate default.
1006
+ * @param {string} [request.pageToken]
1007
+ * Optional. A token identifying a page of results the server should return.
1008
+ * @param {string} [request.filter]
1009
+ * Optional. Filtering results
1010
+ * @param {string} [request.orderBy]
1011
+ * Optional. Hint for how to order the results
1012
+ * @param {object} [options]
1013
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1014
+ * @returns {Object}
1015
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1016
+ * When you iterate the returned iterable, each element will be an object representing
1017
+ * {@link protos.google.cloud.agentregistry.v1.Agent|Agent}. The API will be called under the hood as needed, once per the page,
1018
+ * so you can stop the iteration when you don't need more results.
1019
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1020
+ * for more details and examples.
1021
+ * @example <caption>include:samples/generated/v1/agent_registry.list_agents.js</caption>
1022
+ * region_tag:agentregistry_v1_generated_AgentRegistry_ListAgents_async
1023
+ */
1024
+ listAgentsAsync(request, options) {
1025
+ request = request || {};
1026
+ options = options || {};
1027
+ options.otherArgs = options.otherArgs || {};
1028
+ options.otherArgs.headers = options.otherArgs.headers || {};
1029
+ options.otherArgs.headers['x-goog-request-params'] =
1030
+ this._gaxModule.routingHeader.fromParams({
1031
+ parent: request.parent ?? '',
1032
+ });
1033
+ const defaultCallSettings = this._defaults['listAgents'];
1034
+ const callSettings = defaultCallSettings.merge(options);
1035
+ this.initialize().catch((err) => {
1036
+ throw err;
1037
+ });
1038
+ this._log.info('listAgents iterate %j', request);
1039
+ return this.descriptors.page.listAgents.asyncIterate(this.innerApiCalls['listAgents'], request, callSettings);
1040
+ }
1041
+ searchAgents(request, optionsOrCallback, callback) {
1042
+ request = request || {};
1043
+ let options;
1044
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1045
+ callback = optionsOrCallback;
1046
+ options = {};
1047
+ }
1048
+ else {
1049
+ options = optionsOrCallback;
1050
+ }
1051
+ options = options || {};
1052
+ options.otherArgs = options.otherArgs || {};
1053
+ options.otherArgs.headers = options.otherArgs.headers || {};
1054
+ options.otherArgs.headers['x-goog-request-params'] =
1055
+ this._gaxModule.routingHeader.fromParams({
1056
+ parent: request.parent ?? '',
1057
+ });
1058
+ this.initialize().catch((err) => {
1059
+ throw err;
1060
+ });
1061
+ const wrappedCallback = callback
1062
+ ? (error, values, nextPageRequest, rawResponse) => {
1063
+ this._log.info('searchAgents values %j', values);
1064
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1065
+ }
1066
+ : undefined;
1067
+ this._log.info('searchAgents request %j', request);
1068
+ return this.innerApiCalls
1069
+ .searchAgents(request, options, wrappedCallback)
1070
+ ?.then(([response, input, output]) => {
1071
+ this._log.info('searchAgents values %j', response);
1072
+ return [response, input, output];
1073
+ });
1074
+ }
1075
+ /**
1076
+ * Equivalent to `searchAgents`, but returns a NodeJS Stream object.
1077
+ * @param {Object} request
1078
+ * The request object that will be sent.
1079
+ * @param {string} request.parent
1080
+ * Required. Parent value for SearchAgentsRequest. Format:
1081
+ * `projects/{project}/locations/{location}`.
1082
+ * @param {string} [request.searchString]
1083
+ * Optional. Search criteria used to select the Agents to return. If no search
1084
+ * criteria is specified then all accessible Agents will be returned.
1085
+ *
1086
+ * Search expressions can be used to restrict results based upon searchable
1087
+ * fields, where the operators can be used along with the suffix wildcard
1088
+ * symbol `*`. See
1089
+ * [instructions](https://docs.cloud.google.com/agent-registry/search-agents-and-tools)
1090
+ * for more details.
1091
+ *
1092
+ * Allowed operators: `=`, `:`, `NOT`, `AND`, `OR`, and `()`.
1093
+ *
1094
+ * Searchable fields:
1095
+ *
1096
+ * | Field | `=` | `:` | `*` | Keyword Search |
1097
+ * |--------------------|-----|-----|-----|----------------|
1098
+ * | agentId | Yes | Yes | Yes | Included |
1099
+ * | name | No | Yes | Yes | Included |
1100
+ * | displayName | No | Yes | Yes | Included |
1101
+ * | description | No | Yes | No | Included |
1102
+ * | skills | No | Yes | No | Included |
1103
+ * | skills.id | No | Yes | No | Included |
1104
+ * | skills.name | No | Yes | No | Included |
1105
+ * | skills.description | No | Yes | No | Included |
1106
+ * | skills.tags | No | Yes | No | Included |
1107
+ * | skills.examples | No | Yes | No | Included |
1108
+ *
1109
+ * Examples:
1110
+ *
1111
+ * * `agentId="urn:agent:projects-123:projects:123:locations:us-central1:reasoningEngines:1234"`
1112
+ * to find the agent with the specified agent ID.
1113
+ * * `name:important` to find agents whose name contains `important` as a
1114
+ * word.
1115
+ * * `displayName:works*` to find agents whose display name contains words
1116
+ * that start with `works`.
1117
+ * * `skills.tags:test` to find agents whose skills tags contain `test`.
1118
+ * * `planner OR booking` to find agents whose metadata contains the words
1119
+ * `planner` or `booking`.
1120
+ * @param {number} [request.pageSize]
1121
+ * Optional. The maximum number of search results to return per page. The page
1122
+ * size is capped at `100`, even if a larger value is specified. A negative
1123
+ * value will result in an `INVALID_ARGUMENT` error. If unspecified or set to
1124
+ * `0`, a default value of `20` will be used. The server may return fewer
1125
+ * results than requested.
1126
+ * @param {string} [request.pageToken]
1127
+ * Optional. If present, retrieve the next batch of results from the preceding
1128
+ * call to this method. `page_token` must be the value of `next_page_token`
1129
+ * from the previous response. The values of all other method parameters, must
1130
+ * be identical to those in the previous call.
1131
+ * @param {object} [options]
1132
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1133
+ * @returns {Stream}
1134
+ * An object stream which emits an object representing {@link protos.google.cloud.agentregistry.v1.Agent|Agent} on 'data' event.
1135
+ * The client library will perform auto-pagination by default: it will call the API as many
1136
+ * times as needed. Note that it can affect your quota.
1137
+ * We recommend using `searchAgentsAsync()`
1138
+ * method described below for async iteration which you can stop as needed.
1139
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1140
+ * for more details and examples.
1141
+ */
1142
+ searchAgentsStream(request, options) {
1143
+ request = request || {};
1144
+ options = options || {};
1145
+ options.otherArgs = options.otherArgs || {};
1146
+ options.otherArgs.headers = options.otherArgs.headers || {};
1147
+ options.otherArgs.headers['x-goog-request-params'] =
1148
+ this._gaxModule.routingHeader.fromParams({
1149
+ parent: request.parent ?? '',
1150
+ });
1151
+ const defaultCallSettings = this._defaults['searchAgents'];
1152
+ const callSettings = defaultCallSettings.merge(options);
1153
+ this.initialize().catch((err) => {
1154
+ throw err;
1155
+ });
1156
+ this._log.info('searchAgents stream %j', request);
1157
+ return this.descriptors.page.searchAgents.createStream(this.innerApiCalls.searchAgents, request, callSettings);
1158
+ }
1159
+ /**
1160
+ * Equivalent to `searchAgents`, but returns an iterable object.
1161
+ *
1162
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1163
+ * @param {Object} request
1164
+ * The request object that will be sent.
1165
+ * @param {string} request.parent
1166
+ * Required. Parent value for SearchAgentsRequest. Format:
1167
+ * `projects/{project}/locations/{location}`.
1168
+ * @param {string} [request.searchString]
1169
+ * Optional. Search criteria used to select the Agents to return. If no search
1170
+ * criteria is specified then all accessible Agents will be returned.
1171
+ *
1172
+ * Search expressions can be used to restrict results based upon searchable
1173
+ * fields, where the operators can be used along with the suffix wildcard
1174
+ * symbol `*`. See
1175
+ * [instructions](https://docs.cloud.google.com/agent-registry/search-agents-and-tools)
1176
+ * for more details.
1177
+ *
1178
+ * Allowed operators: `=`, `:`, `NOT`, `AND`, `OR`, and `()`.
1179
+ *
1180
+ * Searchable fields:
1181
+ *
1182
+ * | Field | `=` | `:` | `*` | Keyword Search |
1183
+ * |--------------------|-----|-----|-----|----------------|
1184
+ * | agentId | Yes | Yes | Yes | Included |
1185
+ * | name | No | Yes | Yes | Included |
1186
+ * | displayName | No | Yes | Yes | Included |
1187
+ * | description | No | Yes | No | Included |
1188
+ * | skills | No | Yes | No | Included |
1189
+ * | skills.id | No | Yes | No | Included |
1190
+ * | skills.name | No | Yes | No | Included |
1191
+ * | skills.description | No | Yes | No | Included |
1192
+ * | skills.tags | No | Yes | No | Included |
1193
+ * | skills.examples | No | Yes | No | Included |
1194
+ *
1195
+ * Examples:
1196
+ *
1197
+ * * `agentId="urn:agent:projects-123:projects:123:locations:us-central1:reasoningEngines:1234"`
1198
+ * to find the agent with the specified agent ID.
1199
+ * * `name:important` to find agents whose name contains `important` as a
1200
+ * word.
1201
+ * * `displayName:works*` to find agents whose display name contains words
1202
+ * that start with `works`.
1203
+ * * `skills.tags:test` to find agents whose skills tags contain `test`.
1204
+ * * `planner OR booking` to find agents whose metadata contains the words
1205
+ * `planner` or `booking`.
1206
+ * @param {number} [request.pageSize]
1207
+ * Optional. The maximum number of search results to return per page. The page
1208
+ * size is capped at `100`, even if a larger value is specified. A negative
1209
+ * value will result in an `INVALID_ARGUMENT` error. If unspecified or set to
1210
+ * `0`, a default value of `20` will be used. The server may return fewer
1211
+ * results than requested.
1212
+ * @param {string} [request.pageToken]
1213
+ * Optional. If present, retrieve the next batch of results from the preceding
1214
+ * call to this method. `page_token` must be the value of `next_page_token`
1215
+ * from the previous response. The values of all other method parameters, must
1216
+ * be identical to those in the previous call.
1217
+ * @param {object} [options]
1218
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1219
+ * @returns {Object}
1220
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1221
+ * When you iterate the returned iterable, each element will be an object representing
1222
+ * {@link protos.google.cloud.agentregistry.v1.Agent|Agent}. The API will be called under the hood as needed, once per the page,
1223
+ * so you can stop the iteration when you don't need more results.
1224
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1225
+ * for more details and examples.
1226
+ * @example <caption>include:samples/generated/v1/agent_registry.search_agents.js</caption>
1227
+ * region_tag:agentregistry_v1_generated_AgentRegistry_SearchAgents_async
1228
+ */
1229
+ searchAgentsAsync(request, options) {
1230
+ request = request || {};
1231
+ options = options || {};
1232
+ options.otherArgs = options.otherArgs || {};
1233
+ options.otherArgs.headers = options.otherArgs.headers || {};
1234
+ options.otherArgs.headers['x-goog-request-params'] =
1235
+ this._gaxModule.routingHeader.fromParams({
1236
+ parent: request.parent ?? '',
1237
+ });
1238
+ const defaultCallSettings = this._defaults['searchAgents'];
1239
+ const callSettings = defaultCallSettings.merge(options);
1240
+ this.initialize().catch((err) => {
1241
+ throw err;
1242
+ });
1243
+ this._log.info('searchAgents iterate %j', request);
1244
+ return this.descriptors.page.searchAgents.asyncIterate(this.innerApiCalls['searchAgents'], request, callSettings);
1245
+ }
1246
+ listEndpoints(request, optionsOrCallback, callback) {
1247
+ request = request || {};
1248
+ let options;
1249
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1250
+ callback = optionsOrCallback;
1251
+ options = {};
1252
+ }
1253
+ else {
1254
+ options = optionsOrCallback;
1255
+ }
1256
+ options = options || {};
1257
+ options.otherArgs = options.otherArgs || {};
1258
+ options.otherArgs.headers = options.otherArgs.headers || {};
1259
+ options.otherArgs.headers['x-goog-request-params'] =
1260
+ this._gaxModule.routingHeader.fromParams({
1261
+ parent: request.parent ?? '',
1262
+ });
1263
+ this.initialize().catch((err) => {
1264
+ throw err;
1265
+ });
1266
+ const wrappedCallback = callback
1267
+ ? (error, values, nextPageRequest, rawResponse) => {
1268
+ this._log.info('listEndpoints values %j', values);
1269
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1270
+ }
1271
+ : undefined;
1272
+ this._log.info('listEndpoints request %j', request);
1273
+ return this.innerApiCalls
1274
+ .listEndpoints(request, options, wrappedCallback)
1275
+ ?.then(([response, input, output]) => {
1276
+ this._log.info('listEndpoints values %j', response);
1277
+ return [response, input, output];
1278
+ });
1279
+ }
1280
+ /**
1281
+ * Equivalent to `listEndpoints`, but returns a NodeJS Stream object.
1282
+ * @param {Object} request
1283
+ * The request object that will be sent.
1284
+ * @param {string} request.parent
1285
+ * Required. The project and location to list endpoints in.
1286
+ * Expected format: `projects/{project}/locations/{location}`.
1287
+ * @param {number} [request.pageSize]
1288
+ * Optional. Requested page size. Server may return fewer items than
1289
+ * requested. If unspecified, server will pick an appropriate default.
1290
+ * @param {string} [request.pageToken]
1291
+ * Optional. A token identifying a page of results the server should return.
1292
+ * @param {string} [request.filter]
1293
+ * Optional. A query string used to filter the list of endpoints returned.
1294
+ * The filter expression must follow AIP-160 syntax.
1295
+ *
1296
+ * Filtering is supported on the `name`, `display_name`, `description`,
1297
+ * `version`, and `interfaces` fields.
1298
+ *
1299
+ * Some examples:
1300
+ *
1301
+ * * `name = "projects/p1/locations/l1/endpoints/e1"`
1302
+ * * `display_name = "my-endpoint"`
1303
+ * * `description = "my-endpoint-description"`
1304
+ * * `version = "v1"`
1305
+ * * `interfaces.transport = "HTTP_JSON"`
1306
+ * @param {object} [options]
1307
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1308
+ * @returns {Stream}
1309
+ * An object stream which emits an object representing {@link protos.google.cloud.agentregistry.v1.Endpoint|Endpoint} on 'data' event.
1310
+ * The client library will perform auto-pagination by default: it will call the API as many
1311
+ * times as needed. Note that it can affect your quota.
1312
+ * We recommend using `listEndpointsAsync()`
1313
+ * method described below for async iteration which you can stop as needed.
1314
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1315
+ * for more details and examples.
1316
+ */
1317
+ listEndpointsStream(request, options) {
1318
+ request = request || {};
1319
+ options = options || {};
1320
+ options.otherArgs = options.otherArgs || {};
1321
+ options.otherArgs.headers = options.otherArgs.headers || {};
1322
+ options.otherArgs.headers['x-goog-request-params'] =
1323
+ this._gaxModule.routingHeader.fromParams({
1324
+ parent: request.parent ?? '',
1325
+ });
1326
+ const defaultCallSettings = this._defaults['listEndpoints'];
1327
+ const callSettings = defaultCallSettings.merge(options);
1328
+ this.initialize().catch((err) => {
1329
+ throw err;
1330
+ });
1331
+ this._log.info('listEndpoints stream %j', request);
1332
+ return this.descriptors.page.listEndpoints.createStream(this.innerApiCalls.listEndpoints, request, callSettings);
1333
+ }
1334
+ /**
1335
+ * Equivalent to `listEndpoints`, but returns an iterable object.
1336
+ *
1337
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1338
+ * @param {Object} request
1339
+ * The request object that will be sent.
1340
+ * @param {string} request.parent
1341
+ * Required. The project and location to list endpoints in.
1342
+ * Expected format: `projects/{project}/locations/{location}`.
1343
+ * @param {number} [request.pageSize]
1344
+ * Optional. Requested page size. Server may return fewer items than
1345
+ * requested. If unspecified, server will pick an appropriate default.
1346
+ * @param {string} [request.pageToken]
1347
+ * Optional. A token identifying a page of results the server should return.
1348
+ * @param {string} [request.filter]
1349
+ * Optional. A query string used to filter the list of endpoints returned.
1350
+ * The filter expression must follow AIP-160 syntax.
1351
+ *
1352
+ * Filtering is supported on the `name`, `display_name`, `description`,
1353
+ * `version`, and `interfaces` fields.
1354
+ *
1355
+ * Some examples:
1356
+ *
1357
+ * * `name = "projects/p1/locations/l1/endpoints/e1"`
1358
+ * * `display_name = "my-endpoint"`
1359
+ * * `description = "my-endpoint-description"`
1360
+ * * `version = "v1"`
1361
+ * * `interfaces.transport = "HTTP_JSON"`
1362
+ * @param {object} [options]
1363
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1364
+ * @returns {Object}
1365
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1366
+ * When you iterate the returned iterable, each element will be an object representing
1367
+ * {@link protos.google.cloud.agentregistry.v1.Endpoint|Endpoint}. The API will be called under the hood as needed, once per the page,
1368
+ * so you can stop the iteration when you don't need more results.
1369
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1370
+ * for more details and examples.
1371
+ * @example <caption>include:samples/generated/v1/agent_registry.list_endpoints.js</caption>
1372
+ * region_tag:agentregistry_v1_generated_AgentRegistry_ListEndpoints_async
1373
+ */
1374
+ listEndpointsAsync(request, options) {
1375
+ request = request || {};
1376
+ options = options || {};
1377
+ options.otherArgs = options.otherArgs || {};
1378
+ options.otherArgs.headers = options.otherArgs.headers || {};
1379
+ options.otherArgs.headers['x-goog-request-params'] =
1380
+ this._gaxModule.routingHeader.fromParams({
1381
+ parent: request.parent ?? '',
1382
+ });
1383
+ const defaultCallSettings = this._defaults['listEndpoints'];
1384
+ const callSettings = defaultCallSettings.merge(options);
1385
+ this.initialize().catch((err) => {
1386
+ throw err;
1387
+ });
1388
+ this._log.info('listEndpoints iterate %j', request);
1389
+ return this.descriptors.page.listEndpoints.asyncIterate(this.innerApiCalls['listEndpoints'], request, callSettings);
1390
+ }
1391
+ listMcpServers(request, optionsOrCallback, callback) {
1392
+ request = request || {};
1393
+ let options;
1394
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1395
+ callback = optionsOrCallback;
1396
+ options = {};
1397
+ }
1398
+ else {
1399
+ options = optionsOrCallback;
1400
+ }
1401
+ options = options || {};
1402
+ options.otherArgs = options.otherArgs || {};
1403
+ options.otherArgs.headers = options.otherArgs.headers || {};
1404
+ options.otherArgs.headers['x-goog-request-params'] =
1405
+ this._gaxModule.routingHeader.fromParams({
1406
+ parent: request.parent ?? '',
1407
+ });
1408
+ this.initialize().catch((err) => {
1409
+ throw err;
1410
+ });
1411
+ const wrappedCallback = callback
1412
+ ? (error, values, nextPageRequest, rawResponse) => {
1413
+ this._log.info('listMcpServers values %j', values);
1414
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1415
+ }
1416
+ : undefined;
1417
+ this._log.info('listMcpServers request %j', request);
1418
+ return this.innerApiCalls
1419
+ .listMcpServers(request, options, wrappedCallback)
1420
+ ?.then(([response, input, output]) => {
1421
+ this._log.info('listMcpServers values %j', response);
1422
+ return [response, input, output];
1423
+ });
1424
+ }
1425
+ /**
1426
+ * Equivalent to `listMcpServers`, but returns a NodeJS Stream object.
1427
+ * @param {Object} request
1428
+ * The request object that will be sent.
1429
+ * @param {string} request.parent
1430
+ * Required. Parent value for ListMcpServersRequest. Format:
1431
+ * `projects/{project}/locations/{location}`.
1432
+ * @param {number} [request.pageSize]
1433
+ * Optional. Requested page size. Server may return fewer items than
1434
+ * requested. If unspecified, server will pick an appropriate default.
1435
+ * @param {string} [request.pageToken]
1436
+ * Optional. A token identifying a page of results the server should return.
1437
+ * @param {string} [request.filter]
1438
+ * Optional. Filtering results
1439
+ * @param {string} [request.orderBy]
1440
+ * Optional. Hint for how to order the results
1441
+ * @param {object} [options]
1442
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1443
+ * @returns {Stream}
1444
+ * An object stream which emits an object representing {@link protos.google.cloud.agentregistry.v1.McpServer|McpServer} on 'data' event.
1445
+ * The client library will perform auto-pagination by default: it will call the API as many
1446
+ * times as needed. Note that it can affect your quota.
1447
+ * We recommend using `listMcpServersAsync()`
1448
+ * method described below for async iteration which you can stop as needed.
1449
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1450
+ * for more details and examples.
1451
+ */
1452
+ listMcpServersStream(request, options) {
1453
+ request = request || {};
1454
+ options = options || {};
1455
+ options.otherArgs = options.otherArgs || {};
1456
+ options.otherArgs.headers = options.otherArgs.headers || {};
1457
+ options.otherArgs.headers['x-goog-request-params'] =
1458
+ this._gaxModule.routingHeader.fromParams({
1459
+ parent: request.parent ?? '',
1460
+ });
1461
+ const defaultCallSettings = this._defaults['listMcpServers'];
1462
+ const callSettings = defaultCallSettings.merge(options);
1463
+ this.initialize().catch((err) => {
1464
+ throw err;
1465
+ });
1466
+ this._log.info('listMcpServers stream %j', request);
1467
+ return this.descriptors.page.listMcpServers.createStream(this.innerApiCalls.listMcpServers, request, callSettings);
1468
+ }
1469
+ /**
1470
+ * Equivalent to `listMcpServers`, but returns an iterable object.
1471
+ *
1472
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1473
+ * @param {Object} request
1474
+ * The request object that will be sent.
1475
+ * @param {string} request.parent
1476
+ * Required. Parent value for ListMcpServersRequest. Format:
1477
+ * `projects/{project}/locations/{location}`.
1478
+ * @param {number} [request.pageSize]
1479
+ * Optional. Requested page size. Server may return fewer items than
1480
+ * requested. If unspecified, server will pick an appropriate default.
1481
+ * @param {string} [request.pageToken]
1482
+ * Optional. A token identifying a page of results the server should return.
1483
+ * @param {string} [request.filter]
1484
+ * Optional. Filtering results
1485
+ * @param {string} [request.orderBy]
1486
+ * Optional. Hint for how to order the results
1487
+ * @param {object} [options]
1488
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1489
+ * @returns {Object}
1490
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1491
+ * When you iterate the returned iterable, each element will be an object representing
1492
+ * {@link protos.google.cloud.agentregistry.v1.McpServer|McpServer}. The API will be called under the hood as needed, once per the page,
1493
+ * so you can stop the iteration when you don't need more results.
1494
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1495
+ * for more details and examples.
1496
+ * @example <caption>include:samples/generated/v1/agent_registry.list_mcp_servers.js</caption>
1497
+ * region_tag:agentregistry_v1_generated_AgentRegistry_ListMcpServers_async
1498
+ */
1499
+ listMcpServersAsync(request, options) {
1500
+ request = request || {};
1501
+ options = options || {};
1502
+ options.otherArgs = options.otherArgs || {};
1503
+ options.otherArgs.headers = options.otherArgs.headers || {};
1504
+ options.otherArgs.headers['x-goog-request-params'] =
1505
+ this._gaxModule.routingHeader.fromParams({
1506
+ parent: request.parent ?? '',
1507
+ });
1508
+ const defaultCallSettings = this._defaults['listMcpServers'];
1509
+ const callSettings = defaultCallSettings.merge(options);
1510
+ this.initialize().catch((err) => {
1511
+ throw err;
1512
+ });
1513
+ this._log.info('listMcpServers iterate %j', request);
1514
+ return this.descriptors.page.listMcpServers.asyncIterate(this.innerApiCalls['listMcpServers'], request, callSettings);
1515
+ }
1516
+ searchMcpServers(request, optionsOrCallback, callback) {
1517
+ request = request || {};
1518
+ let options;
1519
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1520
+ callback = optionsOrCallback;
1521
+ options = {};
1522
+ }
1523
+ else {
1524
+ options = optionsOrCallback;
1525
+ }
1526
+ options = options || {};
1527
+ options.otherArgs = options.otherArgs || {};
1528
+ options.otherArgs.headers = options.otherArgs.headers || {};
1529
+ options.otherArgs.headers['x-goog-request-params'] =
1530
+ this._gaxModule.routingHeader.fromParams({
1531
+ parent: request.parent ?? '',
1532
+ });
1533
+ this.initialize().catch((err) => {
1534
+ throw err;
1535
+ });
1536
+ const wrappedCallback = callback
1537
+ ? (error, values, nextPageRequest, rawResponse) => {
1538
+ this._log.info('searchMcpServers values %j', values);
1539
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1540
+ }
1541
+ : undefined;
1542
+ this._log.info('searchMcpServers request %j', request);
1543
+ return this.innerApiCalls
1544
+ .searchMcpServers(request, options, wrappedCallback)
1545
+ ?.then(([response, input, output]) => {
1546
+ this._log.info('searchMcpServers values %j', response);
1547
+ return [response, input, output];
1548
+ });
1549
+ }
1550
+ /**
1551
+ * Equivalent to `searchMcpServers`, but returns a NodeJS Stream object.
1552
+ * @param {Object} request
1553
+ * The request object that will be sent.
1554
+ * @param {string} request.parent
1555
+ * Required. Parent value for SearchMcpServersRequest. Format:
1556
+ * `projects/{project}/locations/{location}`.
1557
+ * @param {string} [request.searchString]
1558
+ * Optional. Search criteria used to select the MCP Servers to return. If no
1559
+ * search criteria is specified then all accessible MCP Servers will be
1560
+ * returned.
1561
+ *
1562
+ * Search expressions can be used to restrict results based upon searchable
1563
+ * fields, where the operators can be used along with the suffix wildcard
1564
+ * symbol `*`. See
1565
+ * [instructions](https://docs.cloud.google.com/agent-registry/search-agents-and-tools)
1566
+ * for more details.
1567
+ *
1568
+ * Allowed operators: `=`, `:`, `NOT`, `AND`, `OR`, and `()`.
1569
+ *
1570
+ * Searchable fields:
1571
+ *
1572
+ * | Field | `=` | `:` | `*` | Keyword Search |
1573
+ * |--------------------|-----|-----|-----|----------------|
1574
+ * | mcpServerId | Yes | Yes | Yes | Included |
1575
+ * | name | No | Yes | Yes | Included |
1576
+ * | displayName | No | Yes | Yes | Included |
1577
+ *
1578
+ * Examples:
1579
+ *
1580
+ * * `mcpServerId="urn:mcp:projects-123:projects:123:locations:us-central1:agentregistry:services:service-id"`
1581
+ * to find the MCP Server with the specified MCP Server ID.
1582
+ * * `name:important` to find MCP Servers whose name contains `important` as a
1583
+ * word.
1584
+ * * `displayName:works*` to find MCP Servers whose display name contains
1585
+ * words that start with `works`.
1586
+ * * `planner OR booking` to find MCP Servers whose metadata contains the
1587
+ * words `planner` or `booking`.
1588
+ * * `mcpServerId:service-id AND (displayName:planner OR
1589
+ * displayName:booking)` to find MCP Servers whose MCP Server ID contains
1590
+ * `service-id` and whose display name contains `planner` or
1591
+ * `booking`.
1592
+ * @param {number} [request.pageSize]
1593
+ * Optional. The maximum number of search results to return per page. The page
1594
+ * size is capped at `100`, even if a larger value is specified. A negative
1595
+ * value will result in an `INVALID_ARGUMENT` error. If unspecified or set to
1596
+ * `0`, a default value of `20` will be used. The server may return fewer
1597
+ * results than requested.
1598
+ * @param {string} [request.pageToken]
1599
+ * Optional. If present, retrieve the next batch of results from the preceding
1600
+ * call to this method. `page_token` must be the value of `next_page_token`
1601
+ * from the previous response. The values of all other method parameters, must
1602
+ * be identical to those in the previous call.
1603
+ * @param {object} [options]
1604
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1605
+ * @returns {Stream}
1606
+ * An object stream which emits an object representing {@link protos.google.cloud.agentregistry.v1.McpServer|McpServer} on 'data' event.
1607
+ * The client library will perform auto-pagination by default: it will call the API as many
1608
+ * times as needed. Note that it can affect your quota.
1609
+ * We recommend using `searchMcpServersAsync()`
1610
+ * method described below for async iteration which you can stop as needed.
1611
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1612
+ * for more details and examples.
1613
+ */
1614
+ searchMcpServersStream(request, options) {
1615
+ request = request || {};
1616
+ options = options || {};
1617
+ options.otherArgs = options.otherArgs || {};
1618
+ options.otherArgs.headers = options.otherArgs.headers || {};
1619
+ options.otherArgs.headers['x-goog-request-params'] =
1620
+ this._gaxModule.routingHeader.fromParams({
1621
+ parent: request.parent ?? '',
1622
+ });
1623
+ const defaultCallSettings = this._defaults['searchMcpServers'];
1624
+ const callSettings = defaultCallSettings.merge(options);
1625
+ this.initialize().catch((err) => {
1626
+ throw err;
1627
+ });
1628
+ this._log.info('searchMcpServers stream %j', request);
1629
+ return this.descriptors.page.searchMcpServers.createStream(this.innerApiCalls.searchMcpServers, request, callSettings);
1630
+ }
1631
+ /**
1632
+ * Equivalent to `searchMcpServers`, but returns an iterable object.
1633
+ *
1634
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1635
+ * @param {Object} request
1636
+ * The request object that will be sent.
1637
+ * @param {string} request.parent
1638
+ * Required. Parent value for SearchMcpServersRequest. Format:
1639
+ * `projects/{project}/locations/{location}`.
1640
+ * @param {string} [request.searchString]
1641
+ * Optional. Search criteria used to select the MCP Servers to return. If no
1642
+ * search criteria is specified then all accessible MCP Servers will be
1643
+ * returned.
1644
+ *
1645
+ * Search expressions can be used to restrict results based upon searchable
1646
+ * fields, where the operators can be used along with the suffix wildcard
1647
+ * symbol `*`. See
1648
+ * [instructions](https://docs.cloud.google.com/agent-registry/search-agents-and-tools)
1649
+ * for more details.
1650
+ *
1651
+ * Allowed operators: `=`, `:`, `NOT`, `AND`, `OR`, and `()`.
1652
+ *
1653
+ * Searchable fields:
1654
+ *
1655
+ * | Field | `=` | `:` | `*` | Keyword Search |
1656
+ * |--------------------|-----|-----|-----|----------------|
1657
+ * | mcpServerId | Yes | Yes | Yes | Included |
1658
+ * | name | No | Yes | Yes | Included |
1659
+ * | displayName | No | Yes | Yes | Included |
1660
+ *
1661
+ * Examples:
1662
+ *
1663
+ * * `mcpServerId="urn:mcp:projects-123:projects:123:locations:us-central1:agentregistry:services:service-id"`
1664
+ * to find the MCP Server with the specified MCP Server ID.
1665
+ * * `name:important` to find MCP Servers whose name contains `important` as a
1666
+ * word.
1667
+ * * `displayName:works*` to find MCP Servers whose display name contains
1668
+ * words that start with `works`.
1669
+ * * `planner OR booking` to find MCP Servers whose metadata contains the
1670
+ * words `planner` or `booking`.
1671
+ * * `mcpServerId:service-id AND (displayName:planner OR
1672
+ * displayName:booking)` to find MCP Servers whose MCP Server ID contains
1673
+ * `service-id` and whose display name contains `planner` or
1674
+ * `booking`.
1675
+ * @param {number} [request.pageSize]
1676
+ * Optional. The maximum number of search results to return per page. The page
1677
+ * size is capped at `100`, even if a larger value is specified. A negative
1678
+ * value will result in an `INVALID_ARGUMENT` error. If unspecified or set to
1679
+ * `0`, a default value of `20` will be used. The server may return fewer
1680
+ * results than requested.
1681
+ * @param {string} [request.pageToken]
1682
+ * Optional. If present, retrieve the next batch of results from the preceding
1683
+ * call to this method. `page_token` must be the value of `next_page_token`
1684
+ * from the previous response. The values of all other method parameters, must
1685
+ * be identical to those in the previous call.
1686
+ * @param {object} [options]
1687
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1688
+ * @returns {Object}
1689
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1690
+ * When you iterate the returned iterable, each element will be an object representing
1691
+ * {@link protos.google.cloud.agentregistry.v1.McpServer|McpServer}. The API will be called under the hood as needed, once per the page,
1692
+ * so you can stop the iteration when you don't need more results.
1693
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1694
+ * for more details and examples.
1695
+ * @example <caption>include:samples/generated/v1/agent_registry.search_mcp_servers.js</caption>
1696
+ * region_tag:agentregistry_v1_generated_AgentRegistry_SearchMcpServers_async
1697
+ */
1698
+ searchMcpServersAsync(request, options) {
1699
+ request = request || {};
1700
+ options = options || {};
1701
+ options.otherArgs = options.otherArgs || {};
1702
+ options.otherArgs.headers = options.otherArgs.headers || {};
1703
+ options.otherArgs.headers['x-goog-request-params'] =
1704
+ this._gaxModule.routingHeader.fromParams({
1705
+ parent: request.parent ?? '',
1706
+ });
1707
+ const defaultCallSettings = this._defaults['searchMcpServers'];
1708
+ const callSettings = defaultCallSettings.merge(options);
1709
+ this.initialize().catch((err) => {
1710
+ throw err;
1711
+ });
1712
+ this._log.info('searchMcpServers iterate %j', request);
1713
+ return this.descriptors.page.searchMcpServers.asyncIterate(this.innerApiCalls['searchMcpServers'], request, callSettings);
1714
+ }
1715
+ listServices(request, optionsOrCallback, callback) {
1716
+ request = request || {};
1717
+ let options;
1718
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1719
+ callback = optionsOrCallback;
1720
+ options = {};
1721
+ }
1722
+ else {
1723
+ options = optionsOrCallback;
1724
+ }
1725
+ options = options || {};
1726
+ options.otherArgs = options.otherArgs || {};
1727
+ options.otherArgs.headers = options.otherArgs.headers || {};
1728
+ options.otherArgs.headers['x-goog-request-params'] =
1729
+ this._gaxModule.routingHeader.fromParams({
1730
+ parent: request.parent ?? '',
1731
+ });
1732
+ this.initialize().catch((err) => {
1733
+ throw err;
1734
+ });
1735
+ const wrappedCallback = callback
1736
+ ? (error, values, nextPageRequest, rawResponse) => {
1737
+ this._log.info('listServices values %j', values);
1738
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1739
+ }
1740
+ : undefined;
1741
+ this._log.info('listServices request %j', request);
1742
+ return this.innerApiCalls
1743
+ .listServices(request, options, wrappedCallback)
1744
+ ?.then(([response, input, output]) => {
1745
+ this._log.info('listServices values %j', response);
1746
+ return [response, input, output];
1747
+ });
1748
+ }
1749
+ /**
1750
+ * Equivalent to `listServices`, but returns a NodeJS Stream object.
1751
+ * @param {Object} request
1752
+ * The request object that will be sent.
1753
+ * @param {string} request.parent
1754
+ * Required. The project and location to list services in.
1755
+ * Expected format: `projects/{project}/locations/{location}`.
1756
+ * @param {number} [request.pageSize]
1757
+ * Optional. Requested page size. Server may return fewer items than
1758
+ * requested. If unspecified, server will pick an appropriate default.
1759
+ * @param {string} [request.pageToken]
1760
+ * Optional. A token identifying a page of results the server should return.
1761
+ * @param {string} [request.filter]
1762
+ * Optional. A query string used to filter the list of services returned.
1763
+ * The filter expression must follow AIP-160 syntax.
1764
+ *
1765
+ * Filtering is supported on the `name`, `display_name`, `description`,
1766
+ * and `labels` fields.
1767
+ *
1768
+ * Some examples:
1769
+ *
1770
+ * * `name = "projects/p1/locations/l1/services/s1"`
1771
+ * * `display_name = "my-service"`
1772
+ * * `description : "myservice description"`
1773
+ * * `labels.env = "prod"`
1774
+ * @param {object} [options]
1775
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1776
+ * @returns {Stream}
1777
+ * An object stream which emits an object representing {@link protos.google.cloud.agentregistry.v1.Service|Service} on 'data' event.
1778
+ * The client library will perform auto-pagination by default: it will call the API as many
1779
+ * times as needed. Note that it can affect your quota.
1780
+ * We recommend using `listServicesAsync()`
1781
+ * method described below for async iteration which you can stop as needed.
1782
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1783
+ * for more details and examples.
1784
+ */
1785
+ listServicesStream(request, options) {
1786
+ request = request || {};
1787
+ options = options || {};
1788
+ options.otherArgs = options.otherArgs || {};
1789
+ options.otherArgs.headers = options.otherArgs.headers || {};
1790
+ options.otherArgs.headers['x-goog-request-params'] =
1791
+ this._gaxModule.routingHeader.fromParams({
1792
+ parent: request.parent ?? '',
1793
+ });
1794
+ const defaultCallSettings = this._defaults['listServices'];
1795
+ const callSettings = defaultCallSettings.merge(options);
1796
+ this.initialize().catch((err) => {
1797
+ throw err;
1798
+ });
1799
+ this._log.info('listServices stream %j', request);
1800
+ return this.descriptors.page.listServices.createStream(this.innerApiCalls.listServices, request, callSettings);
1801
+ }
1802
+ /**
1803
+ * Equivalent to `listServices`, but returns an iterable object.
1804
+ *
1805
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1806
+ * @param {Object} request
1807
+ * The request object that will be sent.
1808
+ * @param {string} request.parent
1809
+ * Required. The project and location to list services in.
1810
+ * Expected format: `projects/{project}/locations/{location}`.
1811
+ * @param {number} [request.pageSize]
1812
+ * Optional. Requested page size. Server may return fewer items than
1813
+ * requested. If unspecified, server will pick an appropriate default.
1814
+ * @param {string} [request.pageToken]
1815
+ * Optional. A token identifying a page of results the server should return.
1816
+ * @param {string} [request.filter]
1817
+ * Optional. A query string used to filter the list of services returned.
1818
+ * The filter expression must follow AIP-160 syntax.
1819
+ *
1820
+ * Filtering is supported on the `name`, `display_name`, `description`,
1821
+ * and `labels` fields.
1822
+ *
1823
+ * Some examples:
1824
+ *
1825
+ * * `name = "projects/p1/locations/l1/services/s1"`
1826
+ * * `display_name = "my-service"`
1827
+ * * `description : "myservice description"`
1828
+ * * `labels.env = "prod"`
1829
+ * @param {object} [options]
1830
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1831
+ * @returns {Object}
1832
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1833
+ * When you iterate the returned iterable, each element will be an object representing
1834
+ * {@link protos.google.cloud.agentregistry.v1.Service|Service}. The API will be called under the hood as needed, once per the page,
1835
+ * so you can stop the iteration when you don't need more results.
1836
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1837
+ * for more details and examples.
1838
+ * @example <caption>include:samples/generated/v1/agent_registry.list_services.js</caption>
1839
+ * region_tag:agentregistry_v1_generated_AgentRegistry_ListServices_async
1840
+ */
1841
+ listServicesAsync(request, options) {
1842
+ request = request || {};
1843
+ options = options || {};
1844
+ options.otherArgs = options.otherArgs || {};
1845
+ options.otherArgs.headers = options.otherArgs.headers || {};
1846
+ options.otherArgs.headers['x-goog-request-params'] =
1847
+ this._gaxModule.routingHeader.fromParams({
1848
+ parent: request.parent ?? '',
1849
+ });
1850
+ const defaultCallSettings = this._defaults['listServices'];
1851
+ const callSettings = defaultCallSettings.merge(options);
1852
+ this.initialize().catch((err) => {
1853
+ throw err;
1854
+ });
1855
+ this._log.info('listServices iterate %j', request);
1856
+ return this.descriptors.page.listServices.asyncIterate(this.innerApiCalls['listServices'], request, callSettings);
1857
+ }
1858
+ listBindings(request, optionsOrCallback, callback) {
1859
+ request = request || {};
1860
+ let options;
1861
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1862
+ callback = optionsOrCallback;
1863
+ options = {};
1864
+ }
1865
+ else {
1866
+ options = optionsOrCallback;
1867
+ }
1868
+ options = options || {};
1869
+ options.otherArgs = options.otherArgs || {};
1870
+ options.otherArgs.headers = options.otherArgs.headers || {};
1871
+ options.otherArgs.headers['x-goog-request-params'] =
1872
+ this._gaxModule.routingHeader.fromParams({
1873
+ parent: request.parent ?? '',
1874
+ });
1875
+ this.initialize().catch((err) => {
1876
+ throw err;
1877
+ });
1878
+ const wrappedCallback = callback
1879
+ ? (error, values, nextPageRequest, rawResponse) => {
1880
+ this._log.info('listBindings values %j', values);
1881
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
1882
+ }
1883
+ : undefined;
1884
+ this._log.info('listBindings request %j', request);
1885
+ return this.innerApiCalls
1886
+ .listBindings(request, options, wrappedCallback)
1887
+ ?.then(([response, input, output]) => {
1888
+ this._log.info('listBindings values %j', response);
1889
+ return [response, input, output];
1890
+ });
1891
+ }
1892
+ /**
1893
+ * Equivalent to `listBindings`, but returns a NodeJS Stream object.
1894
+ * @param {Object} request
1895
+ * The request object that will be sent.
1896
+ * @param {string} request.parent
1897
+ * Required. The project and location to list bindings in.
1898
+ * Expected format: `projects/{project}/locations/{location}`.
1899
+ * @param {number} [request.pageSize]
1900
+ * Optional. Requested page size. Server may return fewer items than
1901
+ * requested. Page size is 500 if unspecified and is capped at `500` even if a
1902
+ * larger value is given.
1903
+ * @param {string} [request.pageToken]
1904
+ * Optional. A token identifying a page of results the server should return.
1905
+ * @param {string} [request.filter]
1906
+ * Optional. A query string used to filter the list of bindings returned.
1907
+ * The filter expression must follow AIP-160 syntax.
1908
+ * @param {string} [request.orderBy]
1909
+ * Optional. Hint for how to order the results
1910
+ * @param {object} [options]
1911
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1912
+ * @returns {Stream}
1913
+ * An object stream which emits an object representing {@link protos.google.cloud.agentregistry.v1.Binding|Binding} on 'data' event.
1914
+ * The client library will perform auto-pagination by default: it will call the API as many
1915
+ * times as needed. Note that it can affect your quota.
1916
+ * We recommend using `listBindingsAsync()`
1917
+ * method described below for async iteration which you can stop as needed.
1918
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1919
+ * for more details and examples.
1920
+ */
1921
+ listBindingsStream(request, options) {
1922
+ request = request || {};
1923
+ options = options || {};
1924
+ options.otherArgs = options.otherArgs || {};
1925
+ options.otherArgs.headers = options.otherArgs.headers || {};
1926
+ options.otherArgs.headers['x-goog-request-params'] =
1927
+ this._gaxModule.routingHeader.fromParams({
1928
+ parent: request.parent ?? '',
1929
+ });
1930
+ const defaultCallSettings = this._defaults['listBindings'];
1931
+ const callSettings = defaultCallSettings.merge(options);
1932
+ this.initialize().catch((err) => {
1933
+ throw err;
1934
+ });
1935
+ this._log.info('listBindings stream %j', request);
1936
+ return this.descriptors.page.listBindings.createStream(this.innerApiCalls.listBindings, request, callSettings);
1937
+ }
1938
+ /**
1939
+ * Equivalent to `listBindings`, but returns an iterable object.
1940
+ *
1941
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1942
+ * @param {Object} request
1943
+ * The request object that will be sent.
1944
+ * @param {string} request.parent
1945
+ * Required. The project and location to list bindings in.
1946
+ * Expected format: `projects/{project}/locations/{location}`.
1947
+ * @param {number} [request.pageSize]
1948
+ * Optional. Requested page size. Server may return fewer items than
1949
+ * requested. Page size is 500 if unspecified and is capped at `500` even if a
1950
+ * larger value is given.
1951
+ * @param {string} [request.pageToken]
1952
+ * Optional. A token identifying a page of results the server should return.
1953
+ * @param {string} [request.filter]
1954
+ * Optional. A query string used to filter the list of bindings returned.
1955
+ * The filter expression must follow AIP-160 syntax.
1956
+ * @param {string} [request.orderBy]
1957
+ * Optional. Hint for how to order the results
1958
+ * @param {object} [options]
1959
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1960
+ * @returns {Object}
1961
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1962
+ * When you iterate the returned iterable, each element will be an object representing
1963
+ * {@link protos.google.cloud.agentregistry.v1.Binding|Binding}. The API will be called under the hood as needed, once per the page,
1964
+ * so you can stop the iteration when you don't need more results.
1965
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1966
+ * for more details and examples.
1967
+ * @example <caption>include:samples/generated/v1/agent_registry.list_bindings.js</caption>
1968
+ * region_tag:agentregistry_v1_generated_AgentRegistry_ListBindings_async
1969
+ */
1970
+ listBindingsAsync(request, options) {
1971
+ request = request || {};
1972
+ options = options || {};
1973
+ options.otherArgs = options.otherArgs || {};
1974
+ options.otherArgs.headers = options.otherArgs.headers || {};
1975
+ options.otherArgs.headers['x-goog-request-params'] =
1976
+ this._gaxModule.routingHeader.fromParams({
1977
+ parent: request.parent ?? '',
1978
+ });
1979
+ const defaultCallSettings = this._defaults['listBindings'];
1980
+ const callSettings = defaultCallSettings.merge(options);
1981
+ this.initialize().catch((err) => {
1982
+ throw err;
1983
+ });
1984
+ this._log.info('listBindings iterate %j', request);
1985
+ return this.descriptors.page.listBindings.asyncIterate(this.innerApiCalls['listBindings'], request, callSettings);
1986
+ }
1987
+ fetchAvailableBindings(request, optionsOrCallback, callback) {
1988
+ request = request || {};
1989
+ let options;
1990
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
1991
+ callback = optionsOrCallback;
1992
+ options = {};
1993
+ }
1994
+ else {
1995
+ options = optionsOrCallback;
1996
+ }
1997
+ options = options || {};
1998
+ options.otherArgs = options.otherArgs || {};
1999
+ options.otherArgs.headers = options.otherArgs.headers || {};
2000
+ options.otherArgs.headers['x-goog-request-params'] =
2001
+ this._gaxModule.routingHeader.fromParams({
2002
+ parent: request.parent ?? '',
2003
+ });
2004
+ this.initialize().catch((err) => {
2005
+ throw err;
2006
+ });
2007
+ const wrappedCallback = callback
2008
+ ? (error, values, nextPageRequest, rawResponse) => {
2009
+ this._log.info('fetchAvailableBindings values %j', values);
2010
+ callback(error, values, nextPageRequest, rawResponse); // We verified callback above.
2011
+ }
2012
+ : undefined;
2013
+ this._log.info('fetchAvailableBindings request %j', request);
2014
+ return this.innerApiCalls
2015
+ .fetchAvailableBindings(request, options, wrappedCallback)
2016
+ ?.then(([response, input, output]) => {
2017
+ this._log.info('fetchAvailableBindings values %j', response);
2018
+ return [response, input, output];
2019
+ });
2020
+ }
2021
+ /**
2022
+ * Equivalent to `fetchAvailableBindings`, but returns a NodeJS Stream object.
2023
+ * @param {Object} request
2024
+ * The request object that will be sent.
2025
+ * @param {string} request.sourceIdentifier
2026
+ * The identifier of the source Agent.
2027
+ * Format:
2028
+ *
2029
+ * * `urn:agent:{publisher}:{namespace}:{name}`
2030
+ * @param {string} [request.targetIdentifier]
2031
+ * Optional. The identifier of the target Agent, MCP Server, or Endpoint.
2032
+ * Format:
2033
+ *
2034
+ * * `urn:agent:{publisher}:{namespace}:{name}`
2035
+ * * `urn:mcp:{publisher}:{namespace}:{name}`
2036
+ * * `urn:endpoint:{publisher}:{namespace}:{name}`
2037
+ * @param {string} request.parent
2038
+ * Required. The parent, in the format
2039
+ * `projects/{project}/locations/{location}`.
2040
+ * @param {number} [request.pageSize]
2041
+ * Optional. Requested page size. Server may return fewer items than
2042
+ * requested. Page size is 500 if unspecified and is capped at `500` even if a
2043
+ * larger value is given.
2044
+ * @param {string} [request.pageToken]
2045
+ * Optional. A token identifying a page of results the server should return.
2046
+ * @param {object} [options]
2047
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2048
+ * @returns {Stream}
2049
+ * An object stream which emits an object representing {@link protos.google.cloud.agentregistry.v1.Binding|Binding} on 'data' event.
2050
+ * The client library will perform auto-pagination by default: it will call the API as many
2051
+ * times as needed. Note that it can affect your quota.
2052
+ * We recommend using `fetchAvailableBindingsAsync()`
2053
+ * method described below for async iteration which you can stop as needed.
2054
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
2055
+ * for more details and examples.
2056
+ */
2057
+ fetchAvailableBindingsStream(request, options) {
2058
+ request = request || {};
2059
+ options = options || {};
2060
+ options.otherArgs = options.otherArgs || {};
2061
+ options.otherArgs.headers = options.otherArgs.headers || {};
2062
+ options.otherArgs.headers['x-goog-request-params'] =
2063
+ this._gaxModule.routingHeader.fromParams({
2064
+ parent: request.parent ?? '',
2065
+ });
2066
+ const defaultCallSettings = this._defaults['fetchAvailableBindings'];
2067
+ const callSettings = defaultCallSettings.merge(options);
2068
+ this.initialize().catch((err) => {
2069
+ throw err;
2070
+ });
2071
+ this._log.info('fetchAvailableBindings stream %j', request);
2072
+ return this.descriptors.page.fetchAvailableBindings.createStream(this.innerApiCalls.fetchAvailableBindings, request, callSettings);
2073
+ }
2074
+ /**
2075
+ * Equivalent to `fetchAvailableBindings`, but returns an iterable object.
2076
+ *
2077
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
2078
+ * @param {Object} request
2079
+ * The request object that will be sent.
2080
+ * @param {string} request.sourceIdentifier
2081
+ * The identifier of the source Agent.
2082
+ * Format:
2083
+ *
2084
+ * * `urn:agent:{publisher}:{namespace}:{name}`
2085
+ * @param {string} [request.targetIdentifier]
2086
+ * Optional. The identifier of the target Agent, MCP Server, or Endpoint.
2087
+ * Format:
2088
+ *
2089
+ * * `urn:agent:{publisher}:{namespace}:{name}`
2090
+ * * `urn:mcp:{publisher}:{namespace}:{name}`
2091
+ * * `urn:endpoint:{publisher}:{namespace}:{name}`
2092
+ * @param {string} request.parent
2093
+ * Required. The parent, in the format
2094
+ * `projects/{project}/locations/{location}`.
2095
+ * @param {number} [request.pageSize]
2096
+ * Optional. Requested page size. Server may return fewer items than
2097
+ * requested. Page size is 500 if unspecified and is capped at `500` even if a
2098
+ * larger value is given.
2099
+ * @param {string} [request.pageToken]
2100
+ * Optional. A token identifying a page of results the server should return.
2101
+ * @param {object} [options]
2102
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2103
+ * @returns {Object}
2104
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
2105
+ * When you iterate the returned iterable, each element will be an object representing
2106
+ * {@link protos.google.cloud.agentregistry.v1.Binding|Binding}. The API will be called under the hood as needed, once per the page,
2107
+ * so you can stop the iteration when you don't need more results.
2108
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
2109
+ * for more details and examples.
2110
+ * @example <caption>include:samples/generated/v1/agent_registry.fetch_available_bindings.js</caption>
2111
+ * region_tag:agentregistry_v1_generated_AgentRegistry_FetchAvailableBindings_async
2112
+ */
2113
+ fetchAvailableBindingsAsync(request, options) {
2114
+ request = request || {};
2115
+ options = options || {};
2116
+ options.otherArgs = options.otherArgs || {};
2117
+ options.otherArgs.headers = options.otherArgs.headers || {};
2118
+ options.otherArgs.headers['x-goog-request-params'] =
2119
+ this._gaxModule.routingHeader.fromParams({
2120
+ parent: request.parent ?? '',
2121
+ });
2122
+ const defaultCallSettings = this._defaults['fetchAvailableBindings'];
2123
+ const callSettings = defaultCallSettings.merge(options);
2124
+ this.initialize().catch((err) => {
2125
+ throw err;
2126
+ });
2127
+ this._log.info('fetchAvailableBindings iterate %j', request);
2128
+ return this.descriptors.page.fetchAvailableBindings.asyncIterate(this.innerApiCalls['fetchAvailableBindings'], request, callSettings);
2129
+ }
2130
+ /**
2131
+ * Gets information about a location.
2132
+ *
2133
+ * @param {Object} request
2134
+ * The request object that will be sent.
2135
+ * @param {string} request.name
2136
+ * Resource name for the location.
2137
+ * @param {object} [options]
2138
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
2139
+ * @returns {Promise} - The promise which resolves to an array.
2140
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
2141
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
2142
+ * for more details and examples.
2143
+ * @example
2144
+ * ```
2145
+ * const [response] = await client.getLocation(request);
2146
+ * ```
2147
+ */
2148
+ getLocation(request, options, callback) {
2149
+ return this.locationsClient.getLocation(request, options, callback);
2150
+ }
2151
+ /**
2152
+ * Lists information about the supported locations for this service. Returns an iterable object.
2153
+ *
2154
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
2155
+ * @param {Object} request
2156
+ * The request object that will be sent.
2157
+ * @param {string} request.name
2158
+ * The resource that owns the locations collection, if applicable.
2159
+ * @param {string} request.filter
2160
+ * The standard list filter.
2161
+ * @param {number} request.pageSize
2162
+ * The standard list page size.
2163
+ * @param {string} request.pageToken
2164
+ * The standard list page token.
2165
+ * @param {object} [options]
2166
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2167
+ * @returns {Object}
2168
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
2169
+ * When you iterate the returned iterable, each element will be an object representing
2170
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
2171
+ * so you can stop the iteration when you don't need more results.
2172
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
2173
+ * for more details and examples.
2174
+ * @example
2175
+ * ```
2176
+ * const iterable = client.listLocationsAsync(request);
2177
+ * for await (const response of iterable) {
2178
+ * // process response
2179
+ * }
2180
+ * ```
2181
+ */
2182
+ listLocationsAsync(request, options) {
2183
+ return this.locationsClient.listLocationsAsync(request, options);
2184
+ }
2185
+ /**
2186
+ * Gets the latest state of a long-running operation. Clients can use this
2187
+ * method to poll the operation result at intervals as recommended by the API
2188
+ * service.
2189
+ *
2190
+ * @param {Object} request - The request object that will be sent.
2191
+ * @param {string} request.name - The name of the operation resource.
2192
+ * @param {Object=} options
2193
+ * Optional parameters. You can override the default settings for this call,
2194
+ * e.g, timeout, retries, paginations, etc. See {@link
2195
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
2196
+ * for the details.
2197
+ * @param {function(?Error, ?Object)=} callback
2198
+ * The function which will be called with the result of the API call.
2199
+ *
2200
+ * The second parameter to the callback is an object representing
2201
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
2202
+ * @return {Promise} - The promise which resolves to an array.
2203
+ * The first element of the array is an object representing
2204
+ * {@link google.longrunning.Operation | google.longrunning.Operation}.
2205
+ * The promise has a method named "cancel" which cancels the ongoing API call.
2206
+ *
2207
+ * @example
2208
+ * ```
2209
+ * const client = longrunning.operationsClient();
2210
+ * const name = '';
2211
+ * const [response] = await client.getOperation({name});
2212
+ * // doThingsWith(response)
2213
+ * ```
2214
+ */
2215
+ getOperation(request, optionsOrCallback, callback) {
2216
+ let options;
2217
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
2218
+ callback = optionsOrCallback;
2219
+ options = {};
2220
+ }
2221
+ else {
2222
+ options = optionsOrCallback;
2223
+ }
2224
+ options = options || {};
2225
+ options.otherArgs = options.otherArgs || {};
2226
+ options.otherArgs.headers = options.otherArgs.headers || {};
2227
+ options.otherArgs.headers['x-goog-request-params'] =
2228
+ this._gaxModule.routingHeader.fromParams({
2229
+ name: request.name ?? '',
2230
+ });
2231
+ return this.operationsClient.getOperation(request, options, callback);
2232
+ }
2233
+ /**
2234
+ * Lists operations that match the specified filter in the request. If the
2235
+ * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
2236
+ *
2237
+ * For-await-of syntax is used with the iterable to recursively get response element on-demand.
2238
+ *
2239
+ * @param {Object} request - The request object that will be sent.
2240
+ * @param {string} request.name - The name of the operation collection.
2241
+ * @param {string} request.filter - The standard list filter.
2242
+ * @param {number=} request.pageSize -
2243
+ * The maximum number of resources contained in the underlying API
2244
+ * response. If page streaming is performed per-resource, this
2245
+ * parameter does not affect the return value. If page streaming is
2246
+ * performed per-page, this determines the maximum number of
2247
+ * resources in a page.
2248
+ * @param {Object=} options
2249
+ * Optional parameters. You can override the default settings for this call,
2250
+ * e.g, timeout, retries, paginations, etc. See {@link
2251
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
2252
+ * details.
2253
+ * @returns {Object}
2254
+ * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
2255
+ *
2256
+ * @example
2257
+ * ```
2258
+ * const client = longrunning.operationsClient();
2259
+ * for await (const response of client.listOperationsAsync(request));
2260
+ * // doThingsWith(response)
2261
+ * ```
2262
+ */
2263
+ listOperationsAsync(request, options) {
2264
+ options = options || {};
2265
+ options.otherArgs = options.otherArgs || {};
2266
+ options.otherArgs.headers = options.otherArgs.headers || {};
2267
+ options.otherArgs.headers['x-goog-request-params'] =
2268
+ this._gaxModule.routingHeader.fromParams({
2269
+ name: request.name ?? '',
2270
+ });
2271
+ return this.operationsClient.listOperationsAsync(request, options);
2272
+ }
2273
+ /**
2274
+ * Starts asynchronous cancellation on a long-running operation. The server
2275
+ * makes a best effort to cancel the operation, but success is not
2276
+ * guaranteed. If the server doesn't support this method, it returns
2277
+ * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
2278
+ * {@link Operations.GetOperation} or
2279
+ * other methods to check whether the cancellation succeeded or whether the
2280
+ * operation completed despite cancellation. On successful cancellation,
2281
+ * the operation is not deleted; instead, it becomes an operation with
2282
+ * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
2283
+ * 1, corresponding to `Code.CANCELLED`.
2284
+ *
2285
+ * @param {Object} request - The request object that will be sent.
2286
+ * @param {string} request.name - The name of the operation resource to be cancelled.
2287
+ * @param {Object=} options
2288
+ * Optional parameters. You can override the default settings for this call,
2289
+ * e.g, timeout, retries, paginations, etc. See {@link
2290
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
2291
+ * details.
2292
+ * @param {function(?Error)=} callback
2293
+ * The function which will be called with the result of the API call.
2294
+ * @return {Promise} - The promise which resolves when API call finishes.
2295
+ * The promise has a method named "cancel" which cancels the ongoing API
2296
+ * call.
2297
+ *
2298
+ * @example
2299
+ * ```
2300
+ * const client = longrunning.operationsClient();
2301
+ * await client.cancelOperation({name: ''});
2302
+ * ```
2303
+ */
2304
+ cancelOperation(request, optionsOrCallback, callback) {
2305
+ let options;
2306
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
2307
+ callback = optionsOrCallback;
2308
+ options = {};
2309
+ }
2310
+ else {
2311
+ options = optionsOrCallback;
2312
+ }
2313
+ options = options || {};
2314
+ options.otherArgs = options.otherArgs || {};
2315
+ options.otherArgs.headers = options.otherArgs.headers || {};
2316
+ options.otherArgs.headers['x-goog-request-params'] =
2317
+ this._gaxModule.routingHeader.fromParams({
2318
+ name: request.name ?? '',
2319
+ });
2320
+ return this.operationsClient.cancelOperation(request, options, callback);
2321
+ }
2322
+ /**
2323
+ * Deletes a long-running operation. This method indicates that the client is
2324
+ * no longer interested in the operation result. It does not cancel the
2325
+ * operation. If the server doesn't support this method, it returns
2326
+ * `google.rpc.Code.UNIMPLEMENTED`.
2327
+ *
2328
+ * @param {Object} request - The request object that will be sent.
2329
+ * @param {string} request.name - The name of the operation resource to be deleted.
2330
+ * @param {Object=} options
2331
+ * Optional parameters. You can override the default settings for this call,
2332
+ * e.g, timeout, retries, paginations, etc. See {@link
2333
+ * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
2334
+ * for the details.
2335
+ * @param {function(?Error)=} callback
2336
+ * The function which will be called with the result of the API call.
2337
+ * @return {Promise} - The promise which resolves when API call finishes.
2338
+ * The promise has a method named "cancel" which cancels the ongoing API
2339
+ * call.
2340
+ *
2341
+ * @example
2342
+ * ```
2343
+ * const client = longrunning.operationsClient();
2344
+ * await client.deleteOperation({name: ''});
2345
+ * ```
2346
+ */
2347
+ deleteOperation(request, optionsOrCallback, callback) {
2348
+ let options;
2349
+ if (typeof optionsOrCallback === 'function' && callback === undefined) {
2350
+ callback = optionsOrCallback;
2351
+ options = {};
2352
+ }
2353
+ else {
2354
+ options = optionsOrCallback;
2355
+ }
2356
+ options = options || {};
2357
+ options.otherArgs = options.otherArgs || {};
2358
+ options.otherArgs.headers = options.otherArgs.headers || {};
2359
+ options.otherArgs.headers['x-goog-request-params'] =
2360
+ this._gaxModule.routingHeader.fromParams({
2361
+ name: request.name ?? '',
2362
+ });
2363
+ return this.operationsClient.deleteOperation(request, options, callback);
2364
+ }
2365
+ // --------------------
2366
+ // -- Path templates --
2367
+ // --------------------
2368
+ /**
2369
+ * Return a fully-qualified agent resource name string.
2370
+ *
2371
+ * @param {string} project
2372
+ * @param {string} location
2373
+ * @param {string} agent
2374
+ * @returns {string} Resource name string.
2375
+ */
2376
+ agentPath(project, location, agent) {
2377
+ return this.pathTemplates.agentPathTemplate.render({
2378
+ project: project,
2379
+ location: location,
2380
+ agent: agent,
2381
+ });
2382
+ }
2383
+ /**
2384
+ * Parse the project from Agent resource.
2385
+ *
2386
+ * @param {string} agentName
2387
+ * A fully-qualified path representing Agent resource.
2388
+ * @returns {string} A string representing the project.
2389
+ */
2390
+ matchProjectFromAgentName(agentName) {
2391
+ return this.pathTemplates.agentPathTemplate.match(agentName).project;
2392
+ }
2393
+ /**
2394
+ * Parse the location from Agent resource.
2395
+ *
2396
+ * @param {string} agentName
2397
+ * A fully-qualified path representing Agent resource.
2398
+ * @returns {string} A string representing the location.
2399
+ */
2400
+ matchLocationFromAgentName(agentName) {
2401
+ return this.pathTemplates.agentPathTemplate.match(agentName).location;
2402
+ }
2403
+ /**
2404
+ * Parse the agent from Agent resource.
2405
+ *
2406
+ * @param {string} agentName
2407
+ * A fully-qualified path representing Agent resource.
2408
+ * @returns {string} A string representing the agent.
2409
+ */
2410
+ matchAgentFromAgentName(agentName) {
2411
+ return this.pathTemplates.agentPathTemplate.match(agentName).agent;
2412
+ }
2413
+ /**
2414
+ * Return a fully-qualified binding resource name string.
2415
+ *
2416
+ * @param {string} project
2417
+ * @param {string} location
2418
+ * @param {string} binding
2419
+ * @returns {string} Resource name string.
2420
+ */
2421
+ bindingPath(project, location, binding) {
2422
+ return this.pathTemplates.bindingPathTemplate.render({
2423
+ project: project,
2424
+ location: location,
2425
+ binding: binding,
2426
+ });
2427
+ }
2428
+ /**
2429
+ * Parse the project from Binding resource.
2430
+ *
2431
+ * @param {string} bindingName
2432
+ * A fully-qualified path representing Binding resource.
2433
+ * @returns {string} A string representing the project.
2434
+ */
2435
+ matchProjectFromBindingName(bindingName) {
2436
+ return this.pathTemplates.bindingPathTemplate.match(bindingName).project;
2437
+ }
2438
+ /**
2439
+ * Parse the location from Binding resource.
2440
+ *
2441
+ * @param {string} bindingName
2442
+ * A fully-qualified path representing Binding resource.
2443
+ * @returns {string} A string representing the location.
2444
+ */
2445
+ matchLocationFromBindingName(bindingName) {
2446
+ return this.pathTemplates.bindingPathTemplate.match(bindingName).location;
2447
+ }
2448
+ /**
2449
+ * Parse the binding from Binding resource.
2450
+ *
2451
+ * @param {string} bindingName
2452
+ * A fully-qualified path representing Binding resource.
2453
+ * @returns {string} A string representing the binding.
2454
+ */
2455
+ matchBindingFromBindingName(bindingName) {
2456
+ return this.pathTemplates.bindingPathTemplate.match(bindingName).binding;
2457
+ }
2458
+ /**
2459
+ * Return a fully-qualified endpoint resource name string.
2460
+ *
2461
+ * @param {string} project
2462
+ * @param {string} location
2463
+ * @param {string} endpoint
2464
+ * @returns {string} Resource name string.
2465
+ */
2466
+ endpointPath(project, location, endpoint) {
2467
+ return this.pathTemplates.endpointPathTemplate.render({
2468
+ project: project,
2469
+ location: location,
2470
+ endpoint: endpoint,
2471
+ });
2472
+ }
2473
+ /**
2474
+ * Parse the project from Endpoint resource.
2475
+ *
2476
+ * @param {string} endpointName
2477
+ * A fully-qualified path representing Endpoint resource.
2478
+ * @returns {string} A string representing the project.
2479
+ */
2480
+ matchProjectFromEndpointName(endpointName) {
2481
+ return this.pathTemplates.endpointPathTemplate.match(endpointName).project;
2482
+ }
2483
+ /**
2484
+ * Parse the location from Endpoint resource.
2485
+ *
2486
+ * @param {string} endpointName
2487
+ * A fully-qualified path representing Endpoint resource.
2488
+ * @returns {string} A string representing the location.
2489
+ */
2490
+ matchLocationFromEndpointName(endpointName) {
2491
+ return this.pathTemplates.endpointPathTemplate.match(endpointName).location;
2492
+ }
2493
+ /**
2494
+ * Parse the endpoint from Endpoint resource.
2495
+ *
2496
+ * @param {string} endpointName
2497
+ * A fully-qualified path representing Endpoint resource.
2498
+ * @returns {string} A string representing the endpoint.
2499
+ */
2500
+ matchEndpointFromEndpointName(endpointName) {
2501
+ return this.pathTemplates.endpointPathTemplate.match(endpointName).endpoint;
2502
+ }
2503
+ /**
2504
+ * Return a fully-qualified location resource name string.
2505
+ *
2506
+ * @param {string} project
2507
+ * @param {string} location
2508
+ * @returns {string} Resource name string.
2509
+ */
2510
+ locationPath(project, location) {
2511
+ return this.pathTemplates.locationPathTemplate.render({
2512
+ project: project,
2513
+ location: location,
2514
+ });
2515
+ }
2516
+ /**
2517
+ * Parse the project from Location resource.
2518
+ *
2519
+ * @param {string} locationName
2520
+ * A fully-qualified path representing Location resource.
2521
+ * @returns {string} A string representing the project.
2522
+ */
2523
+ matchProjectFromLocationName(locationName) {
2524
+ return this.pathTemplates.locationPathTemplate.match(locationName).project;
2525
+ }
2526
+ /**
2527
+ * Parse the location from Location resource.
2528
+ *
2529
+ * @param {string} locationName
2530
+ * A fully-qualified path representing Location resource.
2531
+ * @returns {string} A string representing the location.
2532
+ */
2533
+ matchLocationFromLocationName(locationName) {
2534
+ return this.pathTemplates.locationPathTemplate.match(locationName).location;
2535
+ }
2536
+ /**
2537
+ * Return a fully-qualified mcpServer resource name string.
2538
+ *
2539
+ * @param {string} project
2540
+ * @param {string} location
2541
+ * @param {string} mcp_server
2542
+ * @returns {string} Resource name string.
2543
+ */
2544
+ mcpServerPath(project, location, mcpServer) {
2545
+ return this.pathTemplates.mcpServerPathTemplate.render({
2546
+ project: project,
2547
+ location: location,
2548
+ mcp_server: mcpServer,
2549
+ });
2550
+ }
2551
+ /**
2552
+ * Parse the project from McpServer resource.
2553
+ *
2554
+ * @param {string} mcpServerName
2555
+ * A fully-qualified path representing McpServer resource.
2556
+ * @returns {string} A string representing the project.
2557
+ */
2558
+ matchProjectFromMcpServerName(mcpServerName) {
2559
+ return this.pathTemplates.mcpServerPathTemplate.match(mcpServerName)
2560
+ .project;
2561
+ }
2562
+ /**
2563
+ * Parse the location from McpServer resource.
2564
+ *
2565
+ * @param {string} mcpServerName
2566
+ * A fully-qualified path representing McpServer resource.
2567
+ * @returns {string} A string representing the location.
2568
+ */
2569
+ matchLocationFromMcpServerName(mcpServerName) {
2570
+ return this.pathTemplates.mcpServerPathTemplate.match(mcpServerName)
2571
+ .location;
2572
+ }
2573
+ /**
2574
+ * Parse the mcp_server from McpServer resource.
2575
+ *
2576
+ * @param {string} mcpServerName
2577
+ * A fully-qualified path representing McpServer resource.
2578
+ * @returns {string} A string representing the mcp_server.
2579
+ */
2580
+ matchMcpServerFromMcpServerName(mcpServerName) {
2581
+ return this.pathTemplates.mcpServerPathTemplate.match(mcpServerName)
2582
+ .mcp_server;
2583
+ }
2584
+ /**
2585
+ * Return a fully-qualified project resource name string.
2586
+ *
2587
+ * @param {string} project
2588
+ * @returns {string} Resource name string.
2589
+ */
2590
+ projectPath(project) {
2591
+ return this.pathTemplates.projectPathTemplate.render({
2592
+ project: project,
2593
+ });
2594
+ }
2595
+ /**
2596
+ * Parse the project from Project resource.
2597
+ *
2598
+ * @param {string} projectName
2599
+ * A fully-qualified path representing Project resource.
2600
+ * @returns {string} A string representing the project.
2601
+ */
2602
+ matchProjectFromProjectName(projectName) {
2603
+ return this.pathTemplates.projectPathTemplate.match(projectName).project;
2604
+ }
2605
+ /**
2606
+ * Return a fully-qualified service resource name string.
2607
+ *
2608
+ * @param {string} project
2609
+ * @param {string} location
2610
+ * @param {string} service
2611
+ * @returns {string} Resource name string.
2612
+ */
2613
+ servicePath(project, location, service) {
2614
+ return this.pathTemplates.servicePathTemplate.render({
2615
+ project: project,
2616
+ location: location,
2617
+ service: service,
2618
+ });
2619
+ }
2620
+ /**
2621
+ * Parse the project from Service resource.
2622
+ *
2623
+ * @param {string} serviceName
2624
+ * A fully-qualified path representing Service resource.
2625
+ * @returns {string} A string representing the project.
2626
+ */
2627
+ matchProjectFromServiceName(serviceName) {
2628
+ return this.pathTemplates.servicePathTemplate.match(serviceName).project;
2629
+ }
2630
+ /**
2631
+ * Parse the location from Service resource.
2632
+ *
2633
+ * @param {string} serviceName
2634
+ * A fully-qualified path representing Service resource.
2635
+ * @returns {string} A string representing the location.
2636
+ */
2637
+ matchLocationFromServiceName(serviceName) {
2638
+ return this.pathTemplates.servicePathTemplate.match(serviceName).location;
2639
+ }
2640
+ /**
2641
+ * Parse the service from Service resource.
2642
+ *
2643
+ * @param {string} serviceName
2644
+ * A fully-qualified path representing Service resource.
2645
+ * @returns {string} A string representing the service.
2646
+ */
2647
+ matchServiceFromServiceName(serviceName) {
2648
+ return this.pathTemplates.servicePathTemplate.match(serviceName).service;
2649
+ }
2650
+ /**
2651
+ * Terminate the gRPC channel and close the client.
2652
+ *
2653
+ * The client will no longer be usable and all future behavior is undefined.
2654
+ * @returns {Promise} A promise that resolves when the client is closed.
2655
+ */
2656
+ close() {
2657
+ if (this.agentRegistryStub && !this._terminated) {
2658
+ return this.agentRegistryStub.then((stub) => {
2659
+ this._log.info('ending gRPC channel');
2660
+ this._terminated = true;
2661
+ stub.close();
2662
+ this.locationsClient.close().catch((err) => {
2663
+ throw err;
2664
+ });
2665
+ void this.operationsClient.close();
2666
+ });
2667
+ }
2668
+ return Promise.resolve();
2669
+ }
2670
+ }
2671
+ exports.AgentRegistryClient = AgentRegistryClient;
2672
+ //# sourceMappingURL=agent_registry_client.js.map