@google/genai 2.11.0 → 2.12.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.
- package/dist/genai.d.ts +666 -25
- package/dist/index.cjs +848 -100
- package/dist/index.mjs +848 -100
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +913 -165
- package/dist/node/index.mjs +913 -165
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +666 -25
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +1 -1
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +16 -0
- package/dist/vertex_internal/index.js +1 -1
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +913 -165
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +666 -25
- package/package.json +1 -1
package/dist/web/index.mjs
CHANGED
|
@@ -9710,6 +9710,18 @@ function contentEmbeddingStatisticsFromVertex(fromObject, _rootObject) {
|
|
|
9710
9710
|
if (fromTokenCount != null) {
|
|
9711
9711
|
setValueByPath(toObject, ['tokenCount'], fromTokenCount);
|
|
9712
9712
|
}
|
|
9713
|
+
const fromTokensDetails = getValueByPath(fromObject, [
|
|
9714
|
+
'tokensDetails',
|
|
9715
|
+
]);
|
|
9716
|
+
if (fromTokensDetails != null) {
|
|
9717
|
+
let transformedList = fromTokensDetails;
|
|
9718
|
+
if (Array.isArray(transformedList)) {
|
|
9719
|
+
transformedList = transformedList.map((item) => {
|
|
9720
|
+
return item;
|
|
9721
|
+
});
|
|
9722
|
+
}
|
|
9723
|
+
setValueByPath(toObject, ['tokensDetails'], transformedList);
|
|
9724
|
+
}
|
|
9713
9725
|
return toObject;
|
|
9714
9726
|
}
|
|
9715
9727
|
function contentToMldev$1(fromObject, rootObject) {
|
|
@@ -10339,6 +10351,10 @@ function embedContentResponseFromVertex(fromObject, rootObject) {
|
|
|
10339
10351
|
usageMetadata['promptTokenCount']) {
|
|
10340
10352
|
stats.tokenCount = usageMetadata['promptTokenCount'];
|
|
10341
10353
|
}
|
|
10354
|
+
if (usageMetadata &&
|
|
10355
|
+
usageMetadata['promptTokensDetails']) {
|
|
10356
|
+
stats.tokensDetails = usageMetadata['promptTokensDetails'];
|
|
10357
|
+
}
|
|
10342
10358
|
if (truncated) {
|
|
10343
10359
|
stats.truncated = truncated;
|
|
10344
10360
|
}
|
|
@@ -13494,7 +13510,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
13494
13510
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
13495
13511
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
13496
13512
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
13497
|
-
const SDK_VERSION = '2.
|
|
13513
|
+
const SDK_VERSION = '2.12.0'; // x-release-please-version
|
|
13498
13514
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
13499
13515
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
13500
13516
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -20507,9 +20523,9 @@ function unwrapAsAPIPromise(p) {
|
|
|
20507
20523
|
* Creates a new Agent (Typed version for SDK).
|
|
20508
20524
|
*/
|
|
20509
20525
|
function agentsCreate(client, body, api_version, options) {
|
|
20510
|
-
return new APIPromise($do$
|
|
20526
|
+
return new APIPromise($do$l(client, body, api_version, options));
|
|
20511
20527
|
}
|
|
20512
|
-
async function $do$
|
|
20528
|
+
async function $do$l(client, body, api_version, options) {
|
|
20513
20529
|
var _a, _b, _c;
|
|
20514
20530
|
const input = {
|
|
20515
20531
|
body: body,
|
|
@@ -20592,9 +20608,9 @@ async function $do$e(client, body, api_version, options) {
|
|
|
20592
20608
|
* Deletes an Agent.
|
|
20593
20609
|
*/
|
|
20594
20610
|
function agentsDelete(client, id, api_version, options) {
|
|
20595
|
-
return new APIPromise($do$
|
|
20611
|
+
return new APIPromise($do$k(client, id, api_version, options));
|
|
20596
20612
|
}
|
|
20597
|
-
async function $do$
|
|
20613
|
+
async function $do$k(client, id, api_version, options) {
|
|
20598
20614
|
var _a, _b, _c;
|
|
20599
20615
|
const input = {
|
|
20600
20616
|
id: id,
|
|
@@ -20680,9 +20696,9 @@ async function $do$d(client, id, api_version, options) {
|
|
|
20680
20696
|
* Gets a specific Agent.
|
|
20681
20697
|
*/
|
|
20682
20698
|
function agentsGet(client, id, api_version, options) {
|
|
20683
|
-
return new APIPromise($do$
|
|
20699
|
+
return new APIPromise($do$j(client, id, api_version, options));
|
|
20684
20700
|
}
|
|
20685
|
-
async function $do$
|
|
20701
|
+
async function $do$j(client, id, api_version, options) {
|
|
20686
20702
|
var _a, _b, _c;
|
|
20687
20703
|
const input = {
|
|
20688
20704
|
id: id,
|
|
@@ -20768,9 +20784,9 @@ async function $do$c(client, id, api_version, options) {
|
|
|
20768
20784
|
* Lists all Agents.
|
|
20769
20785
|
*/
|
|
20770
20786
|
function agentsList(client, api_version, page_size, page_token, parent, options) {
|
|
20771
|
-
return new APIPromise($do$
|
|
20787
|
+
return new APIPromise($do$i(client, api_version, page_size, page_token, parent, options));
|
|
20772
20788
|
}
|
|
20773
|
-
async function $do$
|
|
20789
|
+
async function $do$i(client, api_version, page_size, page_token, parent, options) {
|
|
20774
20790
|
var _a, _b, _c;
|
|
20775
20791
|
const input = {
|
|
20776
20792
|
api_version: api_version,
|
|
@@ -21042,9 +21058,9 @@ class GetInteractionByIdClientError extends GoogleGenAiError {
|
|
|
21042
21058
|
* Cancels an interaction by id. This only applies to background interactions that are still running.
|
|
21043
21059
|
*/
|
|
21044
21060
|
function interactionsCancel(client, id, api_version, options) {
|
|
21045
|
-
return new APIPromise($do$
|
|
21061
|
+
return new APIPromise($do$h(client, id, api_version, options));
|
|
21046
21062
|
}
|
|
21047
|
-
async function $do$
|
|
21063
|
+
async function $do$h(client, id, api_version, options) {
|
|
21048
21064
|
var _a, _b, _c;
|
|
21049
21065
|
const input = {
|
|
21050
21066
|
id: id,
|
|
@@ -21130,9 +21146,9 @@ async function $do$a(client, id, api_version, options) {
|
|
|
21130
21146
|
* g3-prettier-ignore-file
|
|
21131
21147
|
*/
|
|
21132
21148
|
function interactionsCreate(client, body, api_version, options) {
|
|
21133
|
-
return new APIPromise($do$
|
|
21149
|
+
return new APIPromise($do$g(client, body, api_version, options));
|
|
21134
21150
|
}
|
|
21135
|
-
async function $do$
|
|
21151
|
+
async function $do$g(client, body, api_version, options) {
|
|
21136
21152
|
var _a, _b, _c, _d;
|
|
21137
21153
|
const input = {
|
|
21138
21154
|
body: body,
|
|
@@ -21224,9 +21240,9 @@ async function $do$9(client, body, api_version, options) {
|
|
|
21224
21240
|
* Deletes the interaction by id.
|
|
21225
21241
|
*/
|
|
21226
21242
|
function interactionsDelete(client, id, api_version, options) {
|
|
21227
|
-
return new APIPromise($do$
|
|
21243
|
+
return new APIPromise($do$f(client, id, api_version, options));
|
|
21228
21244
|
}
|
|
21229
|
-
async function $do$
|
|
21245
|
+
async function $do$f(client, id, api_version, options) {
|
|
21230
21246
|
var _a, _b, _c;
|
|
21231
21247
|
const input = {
|
|
21232
21248
|
id: id,
|
|
@@ -21312,9 +21328,9 @@ async function $do$8(client, id, api_version, options) {
|
|
|
21312
21328
|
* g3-prettier-ignore-file
|
|
21313
21329
|
*/
|
|
21314
21330
|
function interactionsGet(client, id, stream, last_event_id, include_input, api_version, options) {
|
|
21315
|
-
return new APIPromise($do$
|
|
21331
|
+
return new APIPromise($do$e(client, id, stream, last_event_id, include_input, api_version, options));
|
|
21316
21332
|
}
|
|
21317
|
-
async function $do$
|
|
21333
|
+
async function $do$e(client, id, stream, last_event_id, include_input, api_version, options) {
|
|
21318
21334
|
var _a, _b, _c;
|
|
21319
21335
|
const input = {
|
|
21320
21336
|
id: id,
|
|
@@ -21447,12 +21463,12 @@ class Interactions extends ClientSDK {
|
|
|
21447
21463
|
* g3-prettier-ignore-file
|
|
21448
21464
|
*/
|
|
21449
21465
|
/**
|
|
21450
|
-
* Creates a new
|
|
21466
|
+
* Creates a new trigger that will invoke the specified agent on the given cron schedule.
|
|
21451
21467
|
*/
|
|
21452
|
-
function
|
|
21453
|
-
return new APIPromise($do$
|
|
21468
|
+
function triggersCreate(client, body, api_version, options) {
|
|
21469
|
+
return new APIPromise($do$d(client, body, api_version, options));
|
|
21454
21470
|
}
|
|
21455
|
-
async function $do$
|
|
21471
|
+
async function $do$d(client, body, api_version, options) {
|
|
21456
21472
|
var _a, _b, _c;
|
|
21457
21473
|
const input = {
|
|
21458
21474
|
body: body,
|
|
@@ -21463,7 +21479,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
21463
21479
|
const pathParams = {
|
|
21464
21480
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21465
21481
|
};
|
|
21466
|
-
const path = pathToFunc("/{api_version}/
|
|
21482
|
+
const path = pathToFunc("/{api_version}/triggers")(pathParams);
|
|
21467
21483
|
const headers = new Headers(compactMap({
|
|
21468
21484
|
"Content-Type": "application/json",
|
|
21469
21485
|
Accept: "application/json",
|
|
@@ -21473,7 +21489,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
21473
21489
|
const context = {
|
|
21474
21490
|
options: client._options,
|
|
21475
21491
|
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
21476
|
-
operation_id: "
|
|
21492
|
+
operation_id: "CreateTrigger",
|
|
21477
21493
|
o_auth2_scopes: null,
|
|
21478
21494
|
resolved_security: requestSecurity,
|
|
21479
21495
|
security_source: client._options.security,
|
|
@@ -21517,7 +21533,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
21517
21533
|
return [doResult, { status: "request-error", request: req }];
|
|
21518
21534
|
}
|
|
21519
21535
|
const response = doResult.value;
|
|
21520
|
-
const [result] = await match(
|
|
21536
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21521
21537
|
if (!result.ok) {
|
|
21522
21538
|
return [result, { status: "complete", request: req, response }];
|
|
21523
21539
|
}
|
|
@@ -21532,12 +21548,12 @@ async function $do$6(client, body, api_version, options) {
|
|
|
21532
21548
|
* g3-prettier-ignore-file
|
|
21533
21549
|
*/
|
|
21534
21550
|
/**
|
|
21535
|
-
* Deletes a
|
|
21551
|
+
* Deletes a trigger.
|
|
21536
21552
|
*/
|
|
21537
|
-
function
|
|
21538
|
-
return new APIPromise($do$
|
|
21553
|
+
function triggersDelete(client, id, api_version, options) {
|
|
21554
|
+
return new APIPromise($do$c(client, id, api_version, options));
|
|
21539
21555
|
}
|
|
21540
|
-
async function $do$
|
|
21556
|
+
async function $do$c(client, id, api_version, options) {
|
|
21541
21557
|
var _a, _b, _c;
|
|
21542
21558
|
const input = {
|
|
21543
21559
|
id: id,
|
|
@@ -21552,7 +21568,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
21552
21568
|
charEncoding: "percent",
|
|
21553
21569
|
}),
|
|
21554
21570
|
};
|
|
21555
|
-
const path = pathToFunc("/{api_version}/
|
|
21571
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
21556
21572
|
const headers = new Headers(compactMap({
|
|
21557
21573
|
Accept: "application/json",
|
|
21558
21574
|
}));
|
|
@@ -21561,7 +21577,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
21561
21577
|
const context = {
|
|
21562
21578
|
options: client._options,
|
|
21563
21579
|
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
21564
|
-
operation_id: "
|
|
21580
|
+
operation_id: "DeleteTrigger",
|
|
21565
21581
|
o_auth2_scopes: null,
|
|
21566
21582
|
resolved_security: requestSecurity,
|
|
21567
21583
|
security_source: client._options.security,
|
|
@@ -21605,7 +21621,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
21605
21621
|
return [doResult, { status: "request-error", request: req }];
|
|
21606
21622
|
}
|
|
21607
21623
|
const response = doResult.value;
|
|
21608
|
-
const [result] = await match(
|
|
21624
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21609
21625
|
if (!result.ok) {
|
|
21610
21626
|
return [result, { status: "complete", request: req, response }];
|
|
21611
21627
|
}
|
|
@@ -21620,12 +21636,12 @@ async function $do$5(client, id, api_version, options) {
|
|
|
21620
21636
|
* g3-prettier-ignore-file
|
|
21621
21637
|
*/
|
|
21622
21638
|
/**
|
|
21623
|
-
* Gets a
|
|
21639
|
+
* Gets details of a single trigger.
|
|
21624
21640
|
*/
|
|
21625
|
-
function
|
|
21626
|
-
return new APIPromise($do$
|
|
21641
|
+
function triggersGet(client, id, api_version, options) {
|
|
21642
|
+
return new APIPromise($do$b(client, id, api_version, options));
|
|
21627
21643
|
}
|
|
21628
|
-
async function $do$
|
|
21644
|
+
async function $do$b(client, id, api_version, options) {
|
|
21629
21645
|
var _a, _b, _c;
|
|
21630
21646
|
const input = {
|
|
21631
21647
|
id: id,
|
|
@@ -21640,7 +21656,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
21640
21656
|
charEncoding: "percent",
|
|
21641
21657
|
}),
|
|
21642
21658
|
};
|
|
21643
|
-
const path = pathToFunc("/{api_version}/
|
|
21659
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
21644
21660
|
const headers = new Headers(compactMap({
|
|
21645
21661
|
Accept: "application/json",
|
|
21646
21662
|
}));
|
|
@@ -21649,7 +21665,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
21649
21665
|
const context = {
|
|
21650
21666
|
options: client._options,
|
|
21651
21667
|
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
21652
|
-
operation_id: "
|
|
21668
|
+
operation_id: "GetTrigger",
|
|
21653
21669
|
o_auth2_scopes: null,
|
|
21654
21670
|
resolved_security: requestSecurity,
|
|
21655
21671
|
security_source: client._options.security,
|
|
@@ -21693,7 +21709,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
21693
21709
|
return [doResult, { status: "request-error", request: req }];
|
|
21694
21710
|
}
|
|
21695
21711
|
const response = doResult.value;
|
|
21696
|
-
const [result] = await match(
|
|
21712
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21697
21713
|
if (!result.ok) {
|
|
21698
21714
|
return [result, { status: "complete", request: req, response }];
|
|
21699
21715
|
}
|
|
@@ -21708,14 +21724,15 @@ async function $do$4(client, id, api_version, options) {
|
|
|
21708
21724
|
* g3-prettier-ignore-file
|
|
21709
21725
|
*/
|
|
21710
21726
|
/**
|
|
21711
|
-
* Lists
|
|
21727
|
+
* Lists executions for a trigger.
|
|
21712
21728
|
*/
|
|
21713
|
-
function
|
|
21714
|
-
return new APIPromise($do$
|
|
21729
|
+
function triggersListExecutions(client, trigger_id, api_version, page_size, page_token, options) {
|
|
21730
|
+
return new APIPromise($do$a(client, trigger_id, api_version, page_size, page_token, options));
|
|
21715
21731
|
}
|
|
21716
|
-
async function $do$
|
|
21732
|
+
async function $do$a(client, trigger_id, api_version, page_size, page_token, options) {
|
|
21717
21733
|
var _a, _b, _c;
|
|
21718
21734
|
const input = {
|
|
21735
|
+
trigger_id: trigger_id,
|
|
21719
21736
|
api_version: api_version,
|
|
21720
21737
|
page_size: page_size,
|
|
21721
21738
|
page_token: page_token,
|
|
@@ -21723,12 +21740,16 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
21723
21740
|
const payload = input;
|
|
21724
21741
|
const body = null;
|
|
21725
21742
|
const pathParams = {
|
|
21726
|
-
api_version: encodeSimple("api_version", (_a = payload
|
|
21743
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21744
|
+
trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
|
|
21745
|
+
explode: false,
|
|
21746
|
+
charEncoding: "percent",
|
|
21747
|
+
}),
|
|
21727
21748
|
};
|
|
21728
|
-
const path = pathToFunc("/{api_version}/
|
|
21749
|
+
const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
|
|
21729
21750
|
const query = encodeFormQuery({
|
|
21730
|
-
"page_size": payload
|
|
21731
|
-
"page_token": payload
|
|
21751
|
+
"page_size": payload.page_size,
|
|
21752
|
+
"page_token": payload.page_token,
|
|
21732
21753
|
});
|
|
21733
21754
|
const headers = new Headers(compactMap({
|
|
21734
21755
|
Accept: "application/json",
|
|
@@ -21738,7 +21759,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
21738
21759
|
const context = {
|
|
21739
21760
|
options: client._options,
|
|
21740
21761
|
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
21741
|
-
operation_id: "
|
|
21762
|
+
operation_id: "ListTriggerExecutions",
|
|
21742
21763
|
o_auth2_scopes: null,
|
|
21743
21764
|
resolved_security: requestSecurity,
|
|
21744
21765
|
security_source: client._options.security,
|
|
@@ -21783,7 +21804,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
21783
21804
|
return [doResult, { status: "request-error", request: req }];
|
|
21784
21805
|
}
|
|
21785
21806
|
const response = doResult.value;
|
|
21786
|
-
const [result] = await match(
|
|
21807
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21787
21808
|
if (!result.ok) {
|
|
21788
21809
|
return [result, { status: "complete", request: req, response }];
|
|
21789
21810
|
}
|
|
@@ -21798,30 +21819,31 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
21798
21819
|
* g3-prettier-ignore-file
|
|
21799
21820
|
*/
|
|
21800
21821
|
/**
|
|
21801
|
-
*
|
|
21822
|
+
* Lists triggers for a project.
|
|
21802
21823
|
*/
|
|
21803
|
-
function
|
|
21804
|
-
return new APIPromise($do$
|
|
21824
|
+
function triggersList(client, api_version, filter, page_size, page_token, options) {
|
|
21825
|
+
return new APIPromise($do$9(client, api_version, filter, page_size, page_token, options));
|
|
21805
21826
|
}
|
|
21806
|
-
async function $do$
|
|
21827
|
+
async function $do$9(client, api_version, filter, page_size, page_token, options) {
|
|
21807
21828
|
var _a, _b, _c;
|
|
21808
21829
|
const input = {
|
|
21809
|
-
id: id,
|
|
21810
21830
|
api_version: api_version,
|
|
21811
|
-
|
|
21831
|
+
filter: filter,
|
|
21832
|
+
page_size: page_size,
|
|
21833
|
+
page_token: page_token,
|
|
21812
21834
|
};
|
|
21813
21835
|
const payload = input;
|
|
21814
|
-
const body
|
|
21836
|
+
const body = null;
|
|
21815
21837
|
const pathParams = {
|
|
21816
|
-
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21817
|
-
id: encodeSimple("id", payload.id, {
|
|
21818
|
-
explode: false,
|
|
21819
|
-
charEncoding: "percent",
|
|
21820
|
-
}),
|
|
21838
|
+
api_version: encodeSimple("api_version", (_a = payload === null || payload === void 0 ? void 0 : payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21821
21839
|
};
|
|
21822
|
-
const path = pathToFunc("/{api_version}/
|
|
21840
|
+
const path = pathToFunc("/{api_version}/triggers")(pathParams);
|
|
21841
|
+
const query = encodeFormQuery({
|
|
21842
|
+
"filter": payload === null || payload === void 0 ? void 0 : payload.filter,
|
|
21843
|
+
"page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
|
|
21844
|
+
"page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
|
|
21845
|
+
});
|
|
21823
21846
|
const headers = new Headers(compactMap({
|
|
21824
|
-
"Content-Type": "application/json",
|
|
21825
21847
|
Accept: "application/json",
|
|
21826
21848
|
}));
|
|
21827
21849
|
const securityInput = await extractSecurity(client._options.security);
|
|
@@ -21829,7 +21851,7 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
21829
21851
|
const context = {
|
|
21830
21852
|
options: client._options,
|
|
21831
21853
|
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
21832
|
-
operation_id: "
|
|
21854
|
+
operation_id: "ListTriggers",
|
|
21833
21855
|
o_auth2_scopes: null,
|
|
21834
21856
|
resolved_security: requestSecurity,
|
|
21835
21857
|
security_source: client._options.security,
|
|
@@ -21851,11 +21873,12 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
21851
21873
|
};
|
|
21852
21874
|
const requestRes = client._createRequest(context, {
|
|
21853
21875
|
security: requestSecurity,
|
|
21854
|
-
method: "
|
|
21876
|
+
method: "GET",
|
|
21855
21877
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
21856
21878
|
path: path,
|
|
21857
21879
|
headers: headers,
|
|
21858
|
-
|
|
21880
|
+
query: query,
|
|
21881
|
+
body: body,
|
|
21859
21882
|
userAgent: client._options.user_agent,
|
|
21860
21883
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
21861
21884
|
}, options);
|
|
@@ -21873,7 +21896,7 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
21873
21896
|
return [doResult, { status: "request-error", request: req }];
|
|
21874
21897
|
}
|
|
21875
21898
|
const response = doResult.value;
|
|
21876
|
-
const [result] = await match(
|
|
21899
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21877
21900
|
if (!result.ok) {
|
|
21878
21901
|
return [result, { status: "complete", request: req, response }];
|
|
21879
21902
|
}
|
|
@@ -21888,30 +21911,28 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
21888
21911
|
* g3-prettier-ignore-file
|
|
21889
21912
|
*/
|
|
21890
21913
|
/**
|
|
21891
|
-
*
|
|
21914
|
+
* Runs a trigger immediately.
|
|
21892
21915
|
*/
|
|
21893
|
-
function
|
|
21894
|
-
return new APIPromise($do$
|
|
21916
|
+
function triggersRun(client, trigger_id, api_version, options) {
|
|
21917
|
+
return new APIPromise($do$8(client, trigger_id, api_version, options));
|
|
21895
21918
|
}
|
|
21896
|
-
async function $do$
|
|
21919
|
+
async function $do$8(client, trigger_id, api_version, options) {
|
|
21897
21920
|
var _a, _b, _c;
|
|
21898
21921
|
const input = {
|
|
21899
|
-
|
|
21922
|
+
trigger_id: trigger_id,
|
|
21900
21923
|
api_version: api_version,
|
|
21901
|
-
body: body,
|
|
21902
21924
|
};
|
|
21903
21925
|
const payload = input;
|
|
21904
|
-
const body
|
|
21926
|
+
const body = null;
|
|
21905
21927
|
const pathParams = {
|
|
21906
21928
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21907
|
-
|
|
21929
|
+
trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
|
|
21908
21930
|
explode: false,
|
|
21909
21931
|
charEncoding: "percent",
|
|
21910
21932
|
}),
|
|
21911
21933
|
};
|
|
21912
|
-
const path = pathToFunc("/{api_version}/
|
|
21934
|
+
const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
|
|
21913
21935
|
const headers = new Headers(compactMap({
|
|
21914
|
-
"Content-Type": "application/json",
|
|
21915
21936
|
Accept: "application/json",
|
|
21916
21937
|
}));
|
|
21917
21938
|
const securityInput = await extractSecurity(client._options.security);
|
|
@@ -21919,7 +21940,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
21919
21940
|
const context = {
|
|
21920
21941
|
options: client._options,
|
|
21921
21942
|
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
21922
|
-
operation_id: "
|
|
21943
|
+
operation_id: "RunTrigger",
|
|
21923
21944
|
o_auth2_scopes: null,
|
|
21924
21945
|
resolved_security: requestSecurity,
|
|
21925
21946
|
security_source: client._options.security,
|
|
@@ -21945,7 +21966,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
21945
21966
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
21946
21967
|
path: path,
|
|
21947
21968
|
headers: headers,
|
|
21948
|
-
body: body
|
|
21969
|
+
body: body,
|
|
21949
21970
|
userAgent: client._options.user_agent,
|
|
21950
21971
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
21951
21972
|
}, options);
|
|
@@ -21963,7 +21984,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
21963
21984
|
return [doResult, { status: "request-error", request: req }];
|
|
21964
21985
|
}
|
|
21965
21986
|
const response = doResult.value;
|
|
21966
|
-
const [result] = await match(
|
|
21987
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21967
21988
|
if (!result.ok) {
|
|
21968
21989
|
return [result, { status: "complete", request: req, response }];
|
|
21969
21990
|
}
|
|
@@ -21978,18 +21999,17 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
21978
21999
|
* g3-prettier-ignore-file
|
|
21979
22000
|
*/
|
|
21980
22001
|
/**
|
|
21981
|
-
* Updates
|
|
22002
|
+
* Updates a trigger.
|
|
21982
22003
|
*/
|
|
21983
|
-
function
|
|
21984
|
-
return new APIPromise($do(client, id,
|
|
22004
|
+
function triggersUpdate(client, id, body, api_version, options) {
|
|
22005
|
+
return new APIPromise($do$7(client, id, body, api_version, options));
|
|
21985
22006
|
}
|
|
21986
|
-
async function $do(client, id,
|
|
22007
|
+
async function $do$7(client, id, body, api_version, options) {
|
|
21987
22008
|
var _a, _b, _c;
|
|
21988
22009
|
const input = {
|
|
21989
22010
|
id: id,
|
|
21990
|
-
api_version: api_version,
|
|
21991
|
-
update_mask: update_mask,
|
|
21992
22011
|
body: body,
|
|
22012
|
+
api_version: api_version,
|
|
21993
22013
|
};
|
|
21994
22014
|
const payload = input;
|
|
21995
22015
|
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
@@ -22000,10 +22020,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22000
22020
|
charEncoding: "percent",
|
|
22001
22021
|
}),
|
|
22002
22022
|
};
|
|
22003
|
-
const path = pathToFunc("/{api_version}/
|
|
22004
|
-
const query = encodeFormQuery({
|
|
22005
|
-
"update_mask": payload.update_mask,
|
|
22006
|
-
});
|
|
22023
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
22007
22024
|
const headers = new Headers(compactMap({
|
|
22008
22025
|
"Content-Type": "application/json",
|
|
22009
22026
|
Accept: "application/json",
|
|
@@ -22013,7 +22030,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22013
22030
|
const context = {
|
|
22014
22031
|
options: client._options,
|
|
22015
22032
|
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
22016
|
-
operation_id: "
|
|
22033
|
+
operation_id: "UpdateTrigger",
|
|
22017
22034
|
o_auth2_scopes: null,
|
|
22018
22035
|
resolved_security: requestSecurity,
|
|
22019
22036
|
security_source: client._options.security,
|
|
@@ -22039,7 +22056,6 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22039
22056
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22040
22057
|
path: path,
|
|
22041
22058
|
headers: headers,
|
|
22042
|
-
query: query,
|
|
22043
22059
|
body: body$,
|
|
22044
22060
|
userAgent: client._options.user_agent,
|
|
22045
22061
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
@@ -22058,7 +22074,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22058
22074
|
return [doResult, { status: "request-error", request: req }];
|
|
22059
22075
|
}
|
|
22060
22076
|
const response = doResult.value;
|
|
22061
|
-
const [result] = await match(
|
|
22077
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
22062
22078
|
if (!result.ok) {
|
|
22063
22079
|
return [result, { status: "complete", request: req, response }];
|
|
22064
22080
|
}
|
|
@@ -22072,53 +22088,50 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22072
22088
|
*
|
|
22073
22089
|
* g3-prettier-ignore-file
|
|
22074
22090
|
*/
|
|
22075
|
-
class
|
|
22091
|
+
class Triggers extends ClientSDK {
|
|
22076
22092
|
/**
|
|
22077
|
-
* Creates a new
|
|
22093
|
+
* Creates a new trigger that will invoke the specified agent on the given cron schedule.
|
|
22078
22094
|
*/
|
|
22079
22095
|
create(params, options) {
|
|
22080
22096
|
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
22081
|
-
return unwrapAsAPIPromise(
|
|
22097
|
+
return unwrapAsAPIPromise(triggersCreate(this, body, api_version, options));
|
|
22082
22098
|
}
|
|
22083
22099
|
/**
|
|
22084
|
-
* Lists
|
|
22100
|
+
* Lists triggers for a project.
|
|
22085
22101
|
*/
|
|
22086
22102
|
list(params, options) {
|
|
22087
|
-
return unwrapAsAPIPromise(
|
|
22103
|
+
return unwrapAsAPIPromise(triggersList(this, params === null || params === void 0 ? void 0 : params.api_version, params === null || params === void 0 ? void 0 : params.filter, params === null || params === void 0 ? void 0 : params.page_size, params === null || params === void 0 ? void 0 : params.page_token, options));
|
|
22088
22104
|
}
|
|
22089
22105
|
/**
|
|
22090
|
-
* Gets a
|
|
22106
|
+
* Gets details of a single trigger.
|
|
22091
22107
|
*/
|
|
22092
22108
|
get(id, params, options) {
|
|
22093
|
-
return unwrapAsAPIPromise(
|
|
22109
|
+
return unwrapAsAPIPromise(triggersGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22094
22110
|
}
|
|
22095
22111
|
/**
|
|
22096
|
-
* Updates
|
|
22112
|
+
* Updates a trigger.
|
|
22097
22113
|
*/
|
|
22098
22114
|
update(id, params, options) {
|
|
22099
|
-
const
|
|
22100
|
-
|
|
22101
|
-
? undefined
|
|
22102
|
-
: body$body;
|
|
22103
|
-
return unwrapAsAPIPromise(webhooksUpdate(this, id, api_version, update_mask, body, options));
|
|
22115
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
22116
|
+
return unwrapAsAPIPromise(triggersUpdate(this, id, body, api_version, options));
|
|
22104
22117
|
}
|
|
22105
22118
|
/**
|
|
22106
|
-
* Deletes a
|
|
22119
|
+
* Deletes a trigger.
|
|
22107
22120
|
*/
|
|
22108
22121
|
delete(id, params, options) {
|
|
22109
|
-
return unwrapAsAPIPromise(
|
|
22122
|
+
return unwrapAsAPIPromise(triggersDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22110
22123
|
}
|
|
22111
22124
|
/**
|
|
22112
|
-
*
|
|
22125
|
+
* Runs a trigger immediately.
|
|
22113
22126
|
*/
|
|
22114
|
-
|
|
22115
|
-
return unwrapAsAPIPromise(
|
|
22127
|
+
run(trigger_id, params, options) {
|
|
22128
|
+
return unwrapAsAPIPromise(triggersRun(this, trigger_id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22116
22129
|
}
|
|
22117
22130
|
/**
|
|
22118
|
-
*
|
|
22131
|
+
* Lists executions for a trigger.
|
|
22119
22132
|
*/
|
|
22120
|
-
|
|
22121
|
-
return unwrapAsAPIPromise(
|
|
22133
|
+
listExecutions(trigger_id, params, options) {
|
|
22134
|
+
return unwrapAsAPIPromise(triggersListExecutions(this, trigger_id, params === null || params === void 0 ? void 0 : params.api_version, params === null || params === void 0 ? void 0 : params.page_size, params === null || params === void 0 ? void 0 : params.page_token, options));
|
|
22122
22135
|
}
|
|
22123
22136
|
}
|
|
22124
22137
|
|
|
@@ -22129,23 +22142,83 @@ class Webhooks extends ClientSDK {
|
|
|
22129
22142
|
*
|
|
22130
22143
|
* g3-prettier-ignore-file
|
|
22131
22144
|
*/
|
|
22132
|
-
|
|
22133
|
-
*
|
|
22145
|
+
/**
|
|
22146
|
+
* Creates a new Webhook.
|
|
22134
22147
|
*/
|
|
22135
|
-
|
|
22136
|
-
|
|
22137
|
-
|
|
22138
|
-
|
|
22148
|
+
function webhooksCreate(client, body, api_version, options) {
|
|
22149
|
+
return new APIPromise($do$6(client, body, api_version, options));
|
|
22150
|
+
}
|
|
22151
|
+
async function $do$6(client, body, api_version, options) {
|
|
22152
|
+
var _a, _b, _c;
|
|
22153
|
+
const input = {
|
|
22154
|
+
body: body,
|
|
22155
|
+
api_version: api_version,
|
|
22156
|
+
};
|
|
22157
|
+
const payload = input;
|
|
22158
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
22159
|
+
const pathParams = {
|
|
22160
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22161
|
+
};
|
|
22162
|
+
const path = pathToFunc("/{api_version}/webhooks")(pathParams);
|
|
22163
|
+
const headers = new Headers(compactMap({
|
|
22164
|
+
"Content-Type": "application/json",
|
|
22165
|
+
Accept: "application/json",
|
|
22166
|
+
}));
|
|
22167
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22168
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22169
|
+
const context = {
|
|
22170
|
+
options: client._options,
|
|
22171
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
22172
|
+
operation_id: "CreateWebhook",
|
|
22173
|
+
o_auth2_scopes: null,
|
|
22174
|
+
resolved_security: requestSecurity,
|
|
22175
|
+
security_source: client._options.security,
|
|
22176
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22177
|
+
|| client._options.retry_config
|
|
22178
|
+
|| {
|
|
22179
|
+
strategy: "attempt-count-backoff",
|
|
22180
|
+
backoff: {
|
|
22181
|
+
initialInterval: 500,
|
|
22182
|
+
maxInterval: 8000,
|
|
22183
|
+
exponent: 2,
|
|
22184
|
+
maxElapsedTime: 30000,
|
|
22185
|
+
},
|
|
22186
|
+
retryConnectionErrors: true,
|
|
22187
|
+
maxRetries: 4,
|
|
22188
|
+
}
|
|
22189
|
+
|| { strategy: "none" },
|
|
22190
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22191
|
+
};
|
|
22192
|
+
const requestRes = client._createRequest(context, {
|
|
22193
|
+
security: requestSecurity,
|
|
22194
|
+
method: "POST",
|
|
22195
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22196
|
+
path: path,
|
|
22197
|
+
headers: headers,
|
|
22198
|
+
body: body$,
|
|
22199
|
+
userAgent: client._options.user_agent,
|
|
22200
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22201
|
+
}, options);
|
|
22202
|
+
if (!requestRes.ok) {
|
|
22203
|
+
return [requestRes, { status: "invalid" }];
|
|
22139
22204
|
}
|
|
22140
|
-
|
|
22141
|
-
|
|
22142
|
-
|
|
22205
|
+
const req = requestRes.value;
|
|
22206
|
+
const doResult = await client._do(req, {
|
|
22207
|
+
context,
|
|
22208
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22209
|
+
retryConfig: context.retry_config,
|
|
22210
|
+
retryCodes: context.retry_codes,
|
|
22211
|
+
});
|
|
22212
|
+
if (!doResult.ok) {
|
|
22213
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22143
22214
|
}
|
|
22144
|
-
|
|
22145
|
-
|
|
22146
|
-
|
|
22215
|
+
const response = doResult.value;
|
|
22216
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22217
|
+
if (!result.ok) {
|
|
22218
|
+
return [result, { status: "complete", request: req, response }];
|
|
22147
22219
|
}
|
|
22148
|
-
};
|
|
22220
|
+
return [result, { status: "complete", request: req, response }];
|
|
22221
|
+
}
|
|
22149
22222
|
|
|
22150
22223
|
/**
|
|
22151
22224
|
* @license
|
|
@@ -22154,46 +22227,673 @@ let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
|
|
|
22154
22227
|
*
|
|
22155
22228
|
* g3-prettier-ignore-file
|
|
22156
22229
|
*/
|
|
22157
|
-
|
|
22158
|
-
|
|
22159
|
-
|
|
22160
|
-
|
|
22161
|
-
|
|
22162
|
-
const serverURL = parentClient.getBaseUrl();
|
|
22163
|
-
if (!serverURL) {
|
|
22164
|
-
throw new Error("Base URL must be set.");
|
|
22165
|
-
}
|
|
22166
|
-
return serverURL.replace(/\/+$/, "");
|
|
22167
|
-
}
|
|
22168
|
-
function getGoogleGenAIAPIVersion(parentClient) {
|
|
22169
|
-
const apiVersion = trimSlashes(parentClient.getApiVersion());
|
|
22170
|
-
const project = parentClient.getProject();
|
|
22171
|
-
const location = parentClient.getLocation();
|
|
22172
|
-
if (parentClient.isVertexAI() && apiVersion && project && location) {
|
|
22173
|
-
return (`${apiVersion}/projects/${encodeURIComponent(project)}` +
|
|
22174
|
-
`/locations/${encodeURIComponent(location)}`);
|
|
22175
|
-
}
|
|
22176
|
-
return apiVersion;
|
|
22177
|
-
}
|
|
22178
|
-
function buildGoogleGenAIClient(parentClient, options = {}) {
|
|
22179
|
-
var _a, _b, _c, _d;
|
|
22180
|
-
const sdk = new GoogleGenAI$1(Object.assign(Object.assign({}, options), { api_version: (_a = options.api_version) !== null && _a !== void 0 ? _a : getGoogleGenAIAPIVersion(parentClient), security: (_b = options.security) !== null && _b !== void 0 ? _b : new GoogleGenAISecurityProvider({
|
|
22181
|
-
defaultHeaders: (_c = parentClient.getDefaultHeaders) === null || _c === void 0 ? void 0 : _c.call(parentClient),
|
|
22182
|
-
getAuthHeaders: (url) => parentClient.getAuthHeaders(url),
|
|
22183
|
-
}), server_url: (_d = options.server_url) !== null && _d !== void 0 ? _d : getGoogleGenAIServerURL(parentClient) }));
|
|
22184
|
-
return sdk;
|
|
22230
|
+
/**
|
|
22231
|
+
* Deletes a Webhook.
|
|
22232
|
+
*/
|
|
22233
|
+
function webhooksDelete(client, id, api_version, options) {
|
|
22234
|
+
return new APIPromise($do$5(client, id, api_version, options));
|
|
22185
22235
|
}
|
|
22186
|
-
|
|
22187
|
-
|
|
22188
|
-
|
|
22189
|
-
|
|
22190
|
-
|
|
22191
|
-
|
|
22192
|
-
|
|
22193
|
-
|
|
22194
|
-
|
|
22195
|
-
}
|
|
22196
|
-
|
|
22236
|
+
async function $do$5(client, id, api_version, options) {
|
|
22237
|
+
var _a, _b, _c;
|
|
22238
|
+
const input = {
|
|
22239
|
+
id: id,
|
|
22240
|
+
api_version: api_version,
|
|
22241
|
+
};
|
|
22242
|
+
const payload = input;
|
|
22243
|
+
const body = null;
|
|
22244
|
+
const pathParams = {
|
|
22245
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22246
|
+
id: encodeSimple("id", payload.id, {
|
|
22247
|
+
explode: false,
|
|
22248
|
+
charEncoding: "percent",
|
|
22249
|
+
}),
|
|
22250
|
+
};
|
|
22251
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
22252
|
+
const headers = new Headers(compactMap({
|
|
22253
|
+
Accept: "application/json",
|
|
22254
|
+
}));
|
|
22255
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22256
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22257
|
+
const context = {
|
|
22258
|
+
options: client._options,
|
|
22259
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
22260
|
+
operation_id: "DeleteWebhook",
|
|
22261
|
+
o_auth2_scopes: null,
|
|
22262
|
+
resolved_security: requestSecurity,
|
|
22263
|
+
security_source: client._options.security,
|
|
22264
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22265
|
+
|| client._options.retry_config
|
|
22266
|
+
|| {
|
|
22267
|
+
strategy: "attempt-count-backoff",
|
|
22268
|
+
backoff: {
|
|
22269
|
+
initialInterval: 500,
|
|
22270
|
+
maxInterval: 8000,
|
|
22271
|
+
exponent: 2,
|
|
22272
|
+
maxElapsedTime: 30000,
|
|
22273
|
+
},
|
|
22274
|
+
retryConnectionErrors: true,
|
|
22275
|
+
maxRetries: 4,
|
|
22276
|
+
}
|
|
22277
|
+
|| { strategy: "none" },
|
|
22278
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22279
|
+
};
|
|
22280
|
+
const requestRes = client._createRequest(context, {
|
|
22281
|
+
security: requestSecurity,
|
|
22282
|
+
method: "DELETE",
|
|
22283
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22284
|
+
path: path,
|
|
22285
|
+
headers: headers,
|
|
22286
|
+
body: body,
|
|
22287
|
+
userAgent: client._options.user_agent,
|
|
22288
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22289
|
+
}, options);
|
|
22290
|
+
if (!requestRes.ok) {
|
|
22291
|
+
return [requestRes, { status: "invalid" }];
|
|
22292
|
+
}
|
|
22293
|
+
const req = requestRes.value;
|
|
22294
|
+
const doResult = await client._do(req, {
|
|
22295
|
+
context,
|
|
22296
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22297
|
+
retryConfig: context.retry_config,
|
|
22298
|
+
retryCodes: context.retry_codes,
|
|
22299
|
+
});
|
|
22300
|
+
if (!doResult.ok) {
|
|
22301
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22302
|
+
}
|
|
22303
|
+
const response = doResult.value;
|
|
22304
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22305
|
+
if (!result.ok) {
|
|
22306
|
+
return [result, { status: "complete", request: req, response }];
|
|
22307
|
+
}
|
|
22308
|
+
return [result, { status: "complete", request: req, response }];
|
|
22309
|
+
}
|
|
22310
|
+
|
|
22311
|
+
/**
|
|
22312
|
+
* @license
|
|
22313
|
+
* Copyright 2026 Google LLC
|
|
22314
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22315
|
+
*
|
|
22316
|
+
* g3-prettier-ignore-file
|
|
22317
|
+
*/
|
|
22318
|
+
/**
|
|
22319
|
+
* Gets a specific Webhook.
|
|
22320
|
+
*/
|
|
22321
|
+
function webhooksGet(client, id, api_version, options) {
|
|
22322
|
+
return new APIPromise($do$4(client, id, api_version, options));
|
|
22323
|
+
}
|
|
22324
|
+
async function $do$4(client, id, api_version, options) {
|
|
22325
|
+
var _a, _b, _c;
|
|
22326
|
+
const input = {
|
|
22327
|
+
id: id,
|
|
22328
|
+
api_version: api_version,
|
|
22329
|
+
};
|
|
22330
|
+
const payload = input;
|
|
22331
|
+
const body = null;
|
|
22332
|
+
const pathParams = {
|
|
22333
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22334
|
+
id: encodeSimple("id", payload.id, {
|
|
22335
|
+
explode: false,
|
|
22336
|
+
charEncoding: "percent",
|
|
22337
|
+
}),
|
|
22338
|
+
};
|
|
22339
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
22340
|
+
const headers = new Headers(compactMap({
|
|
22341
|
+
Accept: "application/json",
|
|
22342
|
+
}));
|
|
22343
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22344
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22345
|
+
const context = {
|
|
22346
|
+
options: client._options,
|
|
22347
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
22348
|
+
operation_id: "GetWebhook",
|
|
22349
|
+
o_auth2_scopes: null,
|
|
22350
|
+
resolved_security: requestSecurity,
|
|
22351
|
+
security_source: client._options.security,
|
|
22352
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22353
|
+
|| client._options.retry_config
|
|
22354
|
+
|| {
|
|
22355
|
+
strategy: "attempt-count-backoff",
|
|
22356
|
+
backoff: {
|
|
22357
|
+
initialInterval: 500,
|
|
22358
|
+
maxInterval: 8000,
|
|
22359
|
+
exponent: 2,
|
|
22360
|
+
maxElapsedTime: 30000,
|
|
22361
|
+
},
|
|
22362
|
+
retryConnectionErrors: true,
|
|
22363
|
+
maxRetries: 4,
|
|
22364
|
+
}
|
|
22365
|
+
|| { strategy: "none" },
|
|
22366
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22367
|
+
};
|
|
22368
|
+
const requestRes = client._createRequest(context, {
|
|
22369
|
+
security: requestSecurity,
|
|
22370
|
+
method: "GET",
|
|
22371
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22372
|
+
path: path,
|
|
22373
|
+
headers: headers,
|
|
22374
|
+
body: body,
|
|
22375
|
+
userAgent: client._options.user_agent,
|
|
22376
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22377
|
+
}, options);
|
|
22378
|
+
if (!requestRes.ok) {
|
|
22379
|
+
return [requestRes, { status: "invalid" }];
|
|
22380
|
+
}
|
|
22381
|
+
const req = requestRes.value;
|
|
22382
|
+
const doResult = await client._do(req, {
|
|
22383
|
+
context,
|
|
22384
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22385
|
+
retryConfig: context.retry_config,
|
|
22386
|
+
retryCodes: context.retry_codes,
|
|
22387
|
+
});
|
|
22388
|
+
if (!doResult.ok) {
|
|
22389
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22390
|
+
}
|
|
22391
|
+
const response = doResult.value;
|
|
22392
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22393
|
+
if (!result.ok) {
|
|
22394
|
+
return [result, { status: "complete", request: req, response }];
|
|
22395
|
+
}
|
|
22396
|
+
return [result, { status: "complete", request: req, response }];
|
|
22397
|
+
}
|
|
22398
|
+
|
|
22399
|
+
/**
|
|
22400
|
+
* @license
|
|
22401
|
+
* Copyright 2026 Google LLC
|
|
22402
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22403
|
+
*
|
|
22404
|
+
* g3-prettier-ignore-file
|
|
22405
|
+
*/
|
|
22406
|
+
/**
|
|
22407
|
+
* Lists all Webhooks.
|
|
22408
|
+
*/
|
|
22409
|
+
function webhooksList(client, api_version, page_size, page_token, options) {
|
|
22410
|
+
return new APIPromise($do$3(client, api_version, page_size, page_token, options));
|
|
22411
|
+
}
|
|
22412
|
+
async function $do$3(client, api_version, page_size, page_token, options) {
|
|
22413
|
+
var _a, _b, _c;
|
|
22414
|
+
const input = {
|
|
22415
|
+
api_version: api_version,
|
|
22416
|
+
page_size: page_size,
|
|
22417
|
+
page_token: page_token,
|
|
22418
|
+
};
|
|
22419
|
+
const payload = input;
|
|
22420
|
+
const body = null;
|
|
22421
|
+
const pathParams = {
|
|
22422
|
+
api_version: encodeSimple("api_version", (_a = payload === null || payload === void 0 ? void 0 : payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22423
|
+
};
|
|
22424
|
+
const path = pathToFunc("/{api_version}/webhooks")(pathParams);
|
|
22425
|
+
const query = encodeFormQuery({
|
|
22426
|
+
"page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
|
|
22427
|
+
"page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
|
|
22428
|
+
});
|
|
22429
|
+
const headers = new Headers(compactMap({
|
|
22430
|
+
Accept: "application/json",
|
|
22431
|
+
}));
|
|
22432
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22433
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22434
|
+
const context = {
|
|
22435
|
+
options: client._options,
|
|
22436
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
22437
|
+
operation_id: "ListWebhooks",
|
|
22438
|
+
o_auth2_scopes: null,
|
|
22439
|
+
resolved_security: requestSecurity,
|
|
22440
|
+
security_source: client._options.security,
|
|
22441
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22442
|
+
|| client._options.retry_config
|
|
22443
|
+
|| {
|
|
22444
|
+
strategy: "attempt-count-backoff",
|
|
22445
|
+
backoff: {
|
|
22446
|
+
initialInterval: 500,
|
|
22447
|
+
maxInterval: 8000,
|
|
22448
|
+
exponent: 2,
|
|
22449
|
+
maxElapsedTime: 30000,
|
|
22450
|
+
},
|
|
22451
|
+
retryConnectionErrors: true,
|
|
22452
|
+
maxRetries: 4,
|
|
22453
|
+
}
|
|
22454
|
+
|| { strategy: "none" },
|
|
22455
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22456
|
+
};
|
|
22457
|
+
const requestRes = client._createRequest(context, {
|
|
22458
|
+
security: requestSecurity,
|
|
22459
|
+
method: "GET",
|
|
22460
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22461
|
+
path: path,
|
|
22462
|
+
headers: headers,
|
|
22463
|
+
query: query,
|
|
22464
|
+
body: body,
|
|
22465
|
+
userAgent: client._options.user_agent,
|
|
22466
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22467
|
+
}, options);
|
|
22468
|
+
if (!requestRes.ok) {
|
|
22469
|
+
return [requestRes, { status: "invalid" }];
|
|
22470
|
+
}
|
|
22471
|
+
const req = requestRes.value;
|
|
22472
|
+
const doResult = await client._do(req, {
|
|
22473
|
+
context,
|
|
22474
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22475
|
+
retryConfig: context.retry_config,
|
|
22476
|
+
retryCodes: context.retry_codes,
|
|
22477
|
+
});
|
|
22478
|
+
if (!doResult.ok) {
|
|
22479
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22480
|
+
}
|
|
22481
|
+
const response = doResult.value;
|
|
22482
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22483
|
+
if (!result.ok) {
|
|
22484
|
+
return [result, { status: "complete", request: req, response }];
|
|
22485
|
+
}
|
|
22486
|
+
return [result, { status: "complete", request: req, response }];
|
|
22487
|
+
}
|
|
22488
|
+
|
|
22489
|
+
/**
|
|
22490
|
+
* @license
|
|
22491
|
+
* Copyright 2026 Google LLC
|
|
22492
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22493
|
+
*
|
|
22494
|
+
* g3-prettier-ignore-file
|
|
22495
|
+
*/
|
|
22496
|
+
/**
|
|
22497
|
+
* Sends a ping event to a Webhook.
|
|
22498
|
+
*/
|
|
22499
|
+
function webhooksPing(client, id, api_version, body, options) {
|
|
22500
|
+
return new APIPromise($do$2(client, id, api_version, body, options));
|
|
22501
|
+
}
|
|
22502
|
+
async function $do$2(client, id, api_version, body, options) {
|
|
22503
|
+
var _a, _b, _c;
|
|
22504
|
+
const input = {
|
|
22505
|
+
id: id,
|
|
22506
|
+
api_version: api_version,
|
|
22507
|
+
body: body,
|
|
22508
|
+
};
|
|
22509
|
+
const payload = input;
|
|
22510
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
22511
|
+
const pathParams = {
|
|
22512
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22513
|
+
id: encodeSimple("id", payload.id, {
|
|
22514
|
+
explode: false,
|
|
22515
|
+
charEncoding: "percent",
|
|
22516
|
+
}),
|
|
22517
|
+
};
|
|
22518
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}:ping")(pathParams);
|
|
22519
|
+
const headers = new Headers(compactMap({
|
|
22520
|
+
"Content-Type": "application/json",
|
|
22521
|
+
Accept: "application/json",
|
|
22522
|
+
}));
|
|
22523
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22524
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22525
|
+
const context = {
|
|
22526
|
+
options: client._options,
|
|
22527
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
22528
|
+
operation_id: "PingWebhook",
|
|
22529
|
+
o_auth2_scopes: null,
|
|
22530
|
+
resolved_security: requestSecurity,
|
|
22531
|
+
security_source: client._options.security,
|
|
22532
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22533
|
+
|| client._options.retry_config
|
|
22534
|
+
|| {
|
|
22535
|
+
strategy: "attempt-count-backoff",
|
|
22536
|
+
backoff: {
|
|
22537
|
+
initialInterval: 500,
|
|
22538
|
+
maxInterval: 8000,
|
|
22539
|
+
exponent: 2,
|
|
22540
|
+
maxElapsedTime: 30000,
|
|
22541
|
+
},
|
|
22542
|
+
retryConnectionErrors: true,
|
|
22543
|
+
maxRetries: 4,
|
|
22544
|
+
}
|
|
22545
|
+
|| { strategy: "none" },
|
|
22546
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22547
|
+
};
|
|
22548
|
+
const requestRes = client._createRequest(context, {
|
|
22549
|
+
security: requestSecurity,
|
|
22550
|
+
method: "POST",
|
|
22551
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22552
|
+
path: path,
|
|
22553
|
+
headers: headers,
|
|
22554
|
+
body: body$,
|
|
22555
|
+
userAgent: client._options.user_agent,
|
|
22556
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22557
|
+
}, options);
|
|
22558
|
+
if (!requestRes.ok) {
|
|
22559
|
+
return [requestRes, { status: "invalid" }];
|
|
22560
|
+
}
|
|
22561
|
+
const req = requestRes.value;
|
|
22562
|
+
const doResult = await client._do(req, {
|
|
22563
|
+
context,
|
|
22564
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22565
|
+
retryConfig: context.retry_config,
|
|
22566
|
+
retryCodes: context.retry_codes,
|
|
22567
|
+
});
|
|
22568
|
+
if (!doResult.ok) {
|
|
22569
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22570
|
+
}
|
|
22571
|
+
const response = doResult.value;
|
|
22572
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22573
|
+
if (!result.ok) {
|
|
22574
|
+
return [result, { status: "complete", request: req, response }];
|
|
22575
|
+
}
|
|
22576
|
+
return [result, { status: "complete", request: req, response }];
|
|
22577
|
+
}
|
|
22578
|
+
|
|
22579
|
+
/**
|
|
22580
|
+
* @license
|
|
22581
|
+
* Copyright 2026 Google LLC
|
|
22582
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22583
|
+
*
|
|
22584
|
+
* g3-prettier-ignore-file
|
|
22585
|
+
*/
|
|
22586
|
+
/**
|
|
22587
|
+
* Generates a new signing secret for a Webhook.
|
|
22588
|
+
*/
|
|
22589
|
+
function webhooksRotateSigningSecret(client, id, api_version, body, options) {
|
|
22590
|
+
return new APIPromise($do$1(client, id, api_version, body, options));
|
|
22591
|
+
}
|
|
22592
|
+
async function $do$1(client, id, api_version, body, options) {
|
|
22593
|
+
var _a, _b, _c;
|
|
22594
|
+
const input = {
|
|
22595
|
+
id: id,
|
|
22596
|
+
api_version: api_version,
|
|
22597
|
+
body: body,
|
|
22598
|
+
};
|
|
22599
|
+
const payload = input;
|
|
22600
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
22601
|
+
const pathParams = {
|
|
22602
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22603
|
+
id: encodeSimple("id", payload.id, {
|
|
22604
|
+
explode: false,
|
|
22605
|
+
charEncoding: "percent",
|
|
22606
|
+
}),
|
|
22607
|
+
};
|
|
22608
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}:rotateSigningSecret")(pathParams);
|
|
22609
|
+
const headers = new Headers(compactMap({
|
|
22610
|
+
"Content-Type": "application/json",
|
|
22611
|
+
Accept: "application/json",
|
|
22612
|
+
}));
|
|
22613
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22614
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22615
|
+
const context = {
|
|
22616
|
+
options: client._options,
|
|
22617
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
22618
|
+
operation_id: "RotateSigningSecret",
|
|
22619
|
+
o_auth2_scopes: null,
|
|
22620
|
+
resolved_security: requestSecurity,
|
|
22621
|
+
security_source: client._options.security,
|
|
22622
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22623
|
+
|| client._options.retry_config
|
|
22624
|
+
|| {
|
|
22625
|
+
strategy: "attempt-count-backoff",
|
|
22626
|
+
backoff: {
|
|
22627
|
+
initialInterval: 500,
|
|
22628
|
+
maxInterval: 8000,
|
|
22629
|
+
exponent: 2,
|
|
22630
|
+
maxElapsedTime: 30000,
|
|
22631
|
+
},
|
|
22632
|
+
retryConnectionErrors: true,
|
|
22633
|
+
maxRetries: 4,
|
|
22634
|
+
}
|
|
22635
|
+
|| { strategy: "none" },
|
|
22636
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22637
|
+
};
|
|
22638
|
+
const requestRes = client._createRequest(context, {
|
|
22639
|
+
security: requestSecurity,
|
|
22640
|
+
method: "POST",
|
|
22641
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22642
|
+
path: path,
|
|
22643
|
+
headers: headers,
|
|
22644
|
+
body: body$,
|
|
22645
|
+
userAgent: client._options.user_agent,
|
|
22646
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22647
|
+
}, options);
|
|
22648
|
+
if (!requestRes.ok) {
|
|
22649
|
+
return [requestRes, { status: "invalid" }];
|
|
22650
|
+
}
|
|
22651
|
+
const req = requestRes.value;
|
|
22652
|
+
const doResult = await client._do(req, {
|
|
22653
|
+
context,
|
|
22654
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22655
|
+
retryConfig: context.retry_config,
|
|
22656
|
+
retryCodes: context.retry_codes,
|
|
22657
|
+
});
|
|
22658
|
+
if (!doResult.ok) {
|
|
22659
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22660
|
+
}
|
|
22661
|
+
const response = doResult.value;
|
|
22662
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22663
|
+
if (!result.ok) {
|
|
22664
|
+
return [result, { status: "complete", request: req, response }];
|
|
22665
|
+
}
|
|
22666
|
+
return [result, { status: "complete", request: req, response }];
|
|
22667
|
+
}
|
|
22668
|
+
|
|
22669
|
+
/**
|
|
22670
|
+
* @license
|
|
22671
|
+
* Copyright 2026 Google LLC
|
|
22672
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22673
|
+
*
|
|
22674
|
+
* g3-prettier-ignore-file
|
|
22675
|
+
*/
|
|
22676
|
+
/**
|
|
22677
|
+
* Updates an existing Webhook.
|
|
22678
|
+
*/
|
|
22679
|
+
function webhooksUpdate(client, id, api_version, update_mask, body, options) {
|
|
22680
|
+
return new APIPromise($do(client, id, api_version, update_mask, body, options));
|
|
22681
|
+
}
|
|
22682
|
+
async function $do(client, id, api_version, update_mask, body, options) {
|
|
22683
|
+
var _a, _b, _c;
|
|
22684
|
+
const input = {
|
|
22685
|
+
id: id,
|
|
22686
|
+
api_version: api_version,
|
|
22687
|
+
update_mask: update_mask,
|
|
22688
|
+
body: body,
|
|
22689
|
+
};
|
|
22690
|
+
const payload = input;
|
|
22691
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
22692
|
+
const pathParams = {
|
|
22693
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22694
|
+
id: encodeSimple("id", payload.id, {
|
|
22695
|
+
explode: false,
|
|
22696
|
+
charEncoding: "percent",
|
|
22697
|
+
}),
|
|
22698
|
+
};
|
|
22699
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
22700
|
+
const query = encodeFormQuery({
|
|
22701
|
+
"update_mask": payload.update_mask,
|
|
22702
|
+
});
|
|
22703
|
+
const headers = new Headers(compactMap({
|
|
22704
|
+
"Content-Type": "application/json",
|
|
22705
|
+
Accept: "application/json",
|
|
22706
|
+
}));
|
|
22707
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22708
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22709
|
+
const context = {
|
|
22710
|
+
options: client._options,
|
|
22711
|
+
base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
|
|
22712
|
+
operation_id: "UpdateWebhook",
|
|
22713
|
+
o_auth2_scopes: null,
|
|
22714
|
+
resolved_security: requestSecurity,
|
|
22715
|
+
security_source: client._options.security,
|
|
22716
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22717
|
+
|| client._options.retry_config
|
|
22718
|
+
|| {
|
|
22719
|
+
strategy: "attempt-count-backoff",
|
|
22720
|
+
backoff: {
|
|
22721
|
+
initialInterval: 500,
|
|
22722
|
+
maxInterval: 8000,
|
|
22723
|
+
exponent: 2,
|
|
22724
|
+
maxElapsedTime: 30000,
|
|
22725
|
+
},
|
|
22726
|
+
retryConnectionErrors: true,
|
|
22727
|
+
maxRetries: 4,
|
|
22728
|
+
}
|
|
22729
|
+
|| { strategy: "none" },
|
|
22730
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22731
|
+
};
|
|
22732
|
+
const requestRes = client._createRequest(context, {
|
|
22733
|
+
security: requestSecurity,
|
|
22734
|
+
method: "PATCH",
|
|
22735
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22736
|
+
path: path,
|
|
22737
|
+
headers: headers,
|
|
22738
|
+
query: query,
|
|
22739
|
+
body: body$,
|
|
22740
|
+
userAgent: client._options.user_agent,
|
|
22741
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22742
|
+
}, options);
|
|
22743
|
+
if (!requestRes.ok) {
|
|
22744
|
+
return [requestRes, { status: "invalid" }];
|
|
22745
|
+
}
|
|
22746
|
+
const req = requestRes.value;
|
|
22747
|
+
const doResult = await client._do(req, {
|
|
22748
|
+
context,
|
|
22749
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22750
|
+
retryConfig: context.retry_config,
|
|
22751
|
+
retryCodes: context.retry_codes,
|
|
22752
|
+
});
|
|
22753
|
+
if (!doResult.ok) {
|
|
22754
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22755
|
+
}
|
|
22756
|
+
const response = doResult.value;
|
|
22757
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22758
|
+
if (!result.ok) {
|
|
22759
|
+
return [result, { status: "complete", request: req, response }];
|
|
22760
|
+
}
|
|
22761
|
+
return [result, { status: "complete", request: req, response }];
|
|
22762
|
+
}
|
|
22763
|
+
|
|
22764
|
+
/**
|
|
22765
|
+
* @license
|
|
22766
|
+
* Copyright 2026 Google LLC
|
|
22767
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22768
|
+
*
|
|
22769
|
+
* g3-prettier-ignore-file
|
|
22770
|
+
*/
|
|
22771
|
+
class Webhooks extends ClientSDK {
|
|
22772
|
+
/**
|
|
22773
|
+
* Creates a new Webhook.
|
|
22774
|
+
*/
|
|
22775
|
+
create(params, options) {
|
|
22776
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
22777
|
+
return unwrapAsAPIPromise(webhooksCreate(this, body, api_version, options));
|
|
22778
|
+
}
|
|
22779
|
+
/**
|
|
22780
|
+
* Lists all Webhooks.
|
|
22781
|
+
*/
|
|
22782
|
+
list(params, options) {
|
|
22783
|
+
return unwrapAsAPIPromise(webhooksList(this, params === null || params === void 0 ? void 0 : params.api_version, params === null || params === void 0 ? void 0 : params.page_size, params === null || params === void 0 ? void 0 : params.page_token, options));
|
|
22784
|
+
}
|
|
22785
|
+
/**
|
|
22786
|
+
* Gets a specific Webhook.
|
|
22787
|
+
*/
|
|
22788
|
+
get(id, params, options) {
|
|
22789
|
+
return unwrapAsAPIPromise(webhooksGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22790
|
+
}
|
|
22791
|
+
/**
|
|
22792
|
+
* Updates an existing Webhook.
|
|
22793
|
+
*/
|
|
22794
|
+
update(id, params, options) {
|
|
22795
|
+
const _a = params !== null && params !== void 0 ? params : {}, { api_version, update_mask } = _a, body$body = __rest(_a, ["api_version", "update_mask"]);
|
|
22796
|
+
const body = params === undefined || Object.keys(body$body).length === 0
|
|
22797
|
+
? undefined
|
|
22798
|
+
: body$body;
|
|
22799
|
+
return unwrapAsAPIPromise(webhooksUpdate(this, id, api_version, update_mask, body, options));
|
|
22800
|
+
}
|
|
22801
|
+
/**
|
|
22802
|
+
* Deletes a Webhook.
|
|
22803
|
+
*/
|
|
22804
|
+
delete(id, params, options) {
|
|
22805
|
+
return unwrapAsAPIPromise(webhooksDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22806
|
+
}
|
|
22807
|
+
/**
|
|
22808
|
+
* Generates a new signing secret for a Webhook.
|
|
22809
|
+
*/
|
|
22810
|
+
rotateSigningSecret(id, api_version, body, options) {
|
|
22811
|
+
return unwrapAsAPIPromise(webhooksRotateSigningSecret(this, id, api_version, body, options));
|
|
22812
|
+
}
|
|
22813
|
+
/**
|
|
22814
|
+
* Sends a ping event to a Webhook.
|
|
22815
|
+
*/
|
|
22816
|
+
ping(id, api_version, body, options) {
|
|
22817
|
+
return unwrapAsAPIPromise(webhooksPing(this, id, api_version, body, options));
|
|
22818
|
+
}
|
|
22819
|
+
}
|
|
22820
|
+
|
|
22821
|
+
/**
|
|
22822
|
+
* @license
|
|
22823
|
+
* Copyright 2026 Google LLC
|
|
22824
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22825
|
+
*
|
|
22826
|
+
* g3-prettier-ignore-file
|
|
22827
|
+
*/
|
|
22828
|
+
/*
|
|
22829
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
22830
|
+
*/
|
|
22831
|
+
let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
|
|
22832
|
+
get interactions() {
|
|
22833
|
+
var _a;
|
|
22834
|
+
return ((_a = this._interactions) !== null && _a !== void 0 ? _a : (this._interactions = new Interactions(this._options)));
|
|
22835
|
+
}
|
|
22836
|
+
get webhooks() {
|
|
22837
|
+
var _a;
|
|
22838
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Webhooks(this._options)));
|
|
22839
|
+
}
|
|
22840
|
+
get agents() {
|
|
22841
|
+
var _a;
|
|
22842
|
+
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Agents(this._options)));
|
|
22843
|
+
}
|
|
22844
|
+
get triggers() {
|
|
22845
|
+
var _a;
|
|
22846
|
+
return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Triggers(this._options)));
|
|
22847
|
+
}
|
|
22848
|
+
};
|
|
22849
|
+
|
|
22850
|
+
/**
|
|
22851
|
+
* @license
|
|
22852
|
+
* Copyright 2026 Google LLC
|
|
22853
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22854
|
+
*
|
|
22855
|
+
* g3-prettier-ignore-file
|
|
22856
|
+
*/
|
|
22857
|
+
const LEGACY_LYRIA_MODELS = new Set([
|
|
22858
|
+
"lyria-3-pro-preview",
|
|
22859
|
+
"lyria-3-clip-preview",
|
|
22860
|
+
]);
|
|
22861
|
+
function getGoogleGenAIServerURL(parentClient) {
|
|
22862
|
+
const serverURL = parentClient.getBaseUrl();
|
|
22863
|
+
if (!serverURL) {
|
|
22864
|
+
throw new Error("Base URL must be set.");
|
|
22865
|
+
}
|
|
22866
|
+
return serverURL.replace(/\/+$/, "");
|
|
22867
|
+
}
|
|
22868
|
+
function getGoogleGenAIAPIVersion(parentClient) {
|
|
22869
|
+
const apiVersion = trimSlashes(parentClient.getApiVersion());
|
|
22870
|
+
const project = parentClient.getProject();
|
|
22871
|
+
const location = parentClient.getLocation();
|
|
22872
|
+
if (parentClient.isVertexAI() && apiVersion && project && location) {
|
|
22873
|
+
return (`${apiVersion}/projects/${encodeURIComponent(project)}` +
|
|
22874
|
+
`/locations/${encodeURIComponent(location)}`);
|
|
22875
|
+
}
|
|
22876
|
+
return apiVersion;
|
|
22877
|
+
}
|
|
22878
|
+
function buildGoogleGenAIClient(parentClient, options = {}) {
|
|
22879
|
+
var _a, _b, _c, _d, _e;
|
|
22880
|
+
const sdk = new GoogleGenAI$1(Object.assign(Object.assign({}, options), { api_version: (_a = options.api_version) !== null && _a !== void 0 ? _a : getGoogleGenAIAPIVersion(parentClient), security: (_b = options.security) !== null && _b !== void 0 ? _b : new GoogleGenAISecurityProvider({
|
|
22881
|
+
defaultHeaders: Object.assign(Object.assign({}, (_c = parentClient.getDefaultHeaders) === null || _c === void 0 ? void 0 : _c.call(parentClient)), (_d = parentClient.getHeaders) === null || _d === void 0 ? void 0 : _d.call(parentClient)),
|
|
22882
|
+
getAuthHeaders: (url) => parentClient.getAuthHeaders(url),
|
|
22883
|
+
}), server_url: (_e = options.server_url) !== null && _e !== void 0 ? _e : getGoogleGenAIServerURL(parentClient) }));
|
|
22884
|
+
return sdk;
|
|
22885
|
+
}
|
|
22886
|
+
class GeminiNextGenInteractions {
|
|
22887
|
+
constructor(parentClient) {
|
|
22888
|
+
this.parentClient = parentClient;
|
|
22889
|
+
}
|
|
22890
|
+
async create(params, options) {
|
|
22891
|
+
const { api_version } = params, request = __rest(params, ["api_version"]);
|
|
22892
|
+
if (request.stream === true) {
|
|
22893
|
+
const response = await wrapSDKCall(() => this.getClient(api_version).interactions.create(Object.assign(Object.assign({}, request), { stream: true, api_version }), toGoogleGenAIRequestOptions(options, true)));
|
|
22894
|
+
return wrapStreamErrors(response);
|
|
22895
|
+
}
|
|
22896
|
+
const response = await unwrapWithSdkHttpResponse(interactionsCreate(this.getClient(api_version), request, api_version, toGoogleGenAIRequestOptions(options)));
|
|
22197
22897
|
return addOutputPropertiesIfInteraction(response);
|
|
22198
22898
|
}
|
|
22199
22899
|
async get(id, params = {}, options) {
|
|
@@ -22287,6 +22987,46 @@ class GeminiNextGenWebhooks {
|
|
|
22287
22987
|
return this.sdk;
|
|
22288
22988
|
}
|
|
22289
22989
|
}
|
|
22990
|
+
class GeminiNextGenTriggers {
|
|
22991
|
+
constructor(parentClient) {
|
|
22992
|
+
this.parentClient = parentClient;
|
|
22993
|
+
}
|
|
22994
|
+
async create(params, options) {
|
|
22995
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
22996
|
+
return unwrapWithSdkHttpResponse(triggersCreate(this.getClient(api_version), body, api_version, toGoogleGenAIRequestOptions(options)));
|
|
22997
|
+
}
|
|
22998
|
+
async list(params = {}, options) {
|
|
22999
|
+
const { api_version, filter, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
|
|
23000
|
+
return unwrapWithSdkHttpResponse(triggersList(this.getClient(api_version), api_version, filter, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
|
|
23001
|
+
}
|
|
23002
|
+
async get(id, params = {}, options) {
|
|
23003
|
+
return unwrapWithSdkHttpResponse(triggersGet(this.getClient(params === null || params === void 0 ? void 0 : params.api_version), id, params === null || params === void 0 ? void 0 : params.api_version, toGoogleGenAIRequestOptions(options)));
|
|
23004
|
+
}
|
|
23005
|
+
async update(id, params, options) {
|
|
23006
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
23007
|
+
return unwrapWithSdkHttpResponse(triggersUpdate(this.getClient(api_version), id, body, api_version, toGoogleGenAIRequestOptions(options)));
|
|
23008
|
+
}
|
|
23009
|
+
async delete(id, params = {}, options) {
|
|
23010
|
+
return unwrapWithSdkHttpResponse(triggersDelete(this.getClient(params === null || params === void 0 ? void 0 : params.api_version), id, params === null || params === void 0 ? void 0 : params.api_version, toGoogleGenAIRequestOptions(options)));
|
|
23011
|
+
}
|
|
23012
|
+
async run(trigger_id, params = {}, options) {
|
|
23013
|
+
return unwrapWithSdkHttpResponse(triggersRun(this.getClient(params === null || params === void 0 ? void 0 : params.api_version), trigger_id, params === null || params === void 0 ? void 0 : params.api_version, toGoogleGenAIRequestOptions(options)));
|
|
23014
|
+
}
|
|
23015
|
+
async listExecutions(trigger_id, params = {}, options) {
|
|
23016
|
+
const { api_version, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
|
|
23017
|
+
return unwrapWithSdkHttpResponse(triggersListExecutions(this.getClient(api_version), trigger_id, api_version, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
|
|
23018
|
+
}
|
|
23019
|
+
getClient(apiVersion) {
|
|
23020
|
+
var _a;
|
|
23021
|
+
if (apiVersion) {
|
|
23022
|
+
return buildGoogleGenAIClient(this.parentClient, {
|
|
23023
|
+
api_version: apiVersion,
|
|
23024
|
+
});
|
|
23025
|
+
}
|
|
23026
|
+
(_a = this.sdk) !== null && _a !== void 0 ? _a : (this.sdk = buildGoogleGenAIClient(this.parentClient));
|
|
23027
|
+
return this.sdk;
|
|
23028
|
+
}
|
|
23029
|
+
}
|
|
22290
23030
|
function trimSlashes(value) {
|
|
22291
23031
|
return value.replace(/^\/+|\/+$/g, "");
|
|
22292
23032
|
}
|
|
@@ -24597,6 +25337,14 @@ class GoogleGenAI {
|
|
|
24597
25337
|
this._agents = new GeminiNextGenAgents(this.apiClient);
|
|
24598
25338
|
return this._agents;
|
|
24599
25339
|
}
|
|
25340
|
+
get triggers() {
|
|
25341
|
+
if (this._triggers !== undefined) {
|
|
25342
|
+
return this._triggers;
|
|
25343
|
+
}
|
|
25344
|
+
console.warn('GoogleGenAI.triggers: Triggers usage is experimental and may change in future versions.');
|
|
25345
|
+
this._triggers = new GeminiNextGenTriggers(this.apiClient);
|
|
25346
|
+
return this._triggers;
|
|
25347
|
+
}
|
|
24600
25348
|
constructor(options) {
|
|
24601
25349
|
var _a;
|
|
24602
25350
|
if (options.apiKey == null) {
|