@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/node/index.cjs
CHANGED
|
@@ -9740,6 +9740,18 @@ function contentEmbeddingStatisticsFromVertex(fromObject, _rootObject) {
|
|
|
9740
9740
|
if (fromTokenCount != null) {
|
|
9741
9741
|
setValueByPath(toObject, ['tokenCount'], fromTokenCount);
|
|
9742
9742
|
}
|
|
9743
|
+
const fromTokensDetails = getValueByPath(fromObject, [
|
|
9744
|
+
'tokensDetails',
|
|
9745
|
+
]);
|
|
9746
|
+
if (fromTokensDetails != null) {
|
|
9747
|
+
let transformedList = fromTokensDetails;
|
|
9748
|
+
if (Array.isArray(transformedList)) {
|
|
9749
|
+
transformedList = transformedList.map((item) => {
|
|
9750
|
+
return item;
|
|
9751
|
+
});
|
|
9752
|
+
}
|
|
9753
|
+
setValueByPath(toObject, ['tokensDetails'], transformedList);
|
|
9754
|
+
}
|
|
9743
9755
|
return toObject;
|
|
9744
9756
|
}
|
|
9745
9757
|
function contentToMldev$1(fromObject, rootObject) {
|
|
@@ -10369,6 +10381,10 @@ function embedContentResponseFromVertex(fromObject, rootObject) {
|
|
|
10369
10381
|
usageMetadata['promptTokenCount']) {
|
|
10370
10382
|
stats.tokenCount = usageMetadata['promptTokenCount'];
|
|
10371
10383
|
}
|
|
10384
|
+
if (usageMetadata &&
|
|
10385
|
+
usageMetadata['promptTokensDetails']) {
|
|
10386
|
+
stats.tokensDetails = usageMetadata['promptTokensDetails'];
|
|
10387
|
+
}
|
|
10372
10388
|
if (truncated) {
|
|
10373
10389
|
stats.truncated = truncated;
|
|
10374
10390
|
}
|
|
@@ -13524,7 +13540,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
13524
13540
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
13525
13541
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
13526
13542
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
13527
|
-
const SDK_VERSION = '2.
|
|
13543
|
+
const SDK_VERSION = '2.12.0'; // x-release-please-version
|
|
13528
13544
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
13529
13545
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
13530
13546
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -20537,9 +20553,9 @@ function unwrapAsAPIPromise(p) {
|
|
|
20537
20553
|
* Creates a new Agent (Typed version for SDK).
|
|
20538
20554
|
*/
|
|
20539
20555
|
function agentsCreate(client, body, api_version, options) {
|
|
20540
|
-
return new APIPromise($do$
|
|
20556
|
+
return new APIPromise($do$l(client, body, api_version, options));
|
|
20541
20557
|
}
|
|
20542
|
-
async function $do$
|
|
20558
|
+
async function $do$l(client, body, api_version, options) {
|
|
20543
20559
|
var _a, _b, _c;
|
|
20544
20560
|
const input = {
|
|
20545
20561
|
body: body,
|
|
@@ -20622,9 +20638,9 @@ async function $do$e(client, body, api_version, options) {
|
|
|
20622
20638
|
* Deletes an Agent.
|
|
20623
20639
|
*/
|
|
20624
20640
|
function agentsDelete(client, id, api_version, options) {
|
|
20625
|
-
return new APIPromise($do$
|
|
20641
|
+
return new APIPromise($do$k(client, id, api_version, options));
|
|
20626
20642
|
}
|
|
20627
|
-
async function $do$
|
|
20643
|
+
async function $do$k(client, id, api_version, options) {
|
|
20628
20644
|
var _a, _b, _c;
|
|
20629
20645
|
const input = {
|
|
20630
20646
|
id: id,
|
|
@@ -20710,9 +20726,9 @@ async function $do$d(client, id, api_version, options) {
|
|
|
20710
20726
|
* Gets a specific Agent.
|
|
20711
20727
|
*/
|
|
20712
20728
|
function agentsGet(client, id, api_version, options) {
|
|
20713
|
-
return new APIPromise($do$
|
|
20729
|
+
return new APIPromise($do$j(client, id, api_version, options));
|
|
20714
20730
|
}
|
|
20715
|
-
async function $do$
|
|
20731
|
+
async function $do$j(client, id, api_version, options) {
|
|
20716
20732
|
var _a, _b, _c;
|
|
20717
20733
|
const input = {
|
|
20718
20734
|
id: id,
|
|
@@ -20798,9 +20814,9 @@ async function $do$c(client, id, api_version, options) {
|
|
|
20798
20814
|
* Lists all Agents.
|
|
20799
20815
|
*/
|
|
20800
20816
|
function agentsList(client, api_version, page_size, page_token, parent, options) {
|
|
20801
|
-
return new APIPromise($do$
|
|
20817
|
+
return new APIPromise($do$i(client, api_version, page_size, page_token, parent, options));
|
|
20802
20818
|
}
|
|
20803
|
-
async function $do$
|
|
20819
|
+
async function $do$i(client, api_version, page_size, page_token, parent, options) {
|
|
20804
20820
|
var _a, _b, _c;
|
|
20805
20821
|
const input = {
|
|
20806
20822
|
api_version: api_version,
|
|
@@ -21072,9 +21088,9 @@ class GetInteractionByIdClientError extends GoogleGenAiError {
|
|
|
21072
21088
|
* Cancels an interaction by id. This only applies to background interactions that are still running.
|
|
21073
21089
|
*/
|
|
21074
21090
|
function interactionsCancel(client, id, api_version, options) {
|
|
21075
|
-
return new APIPromise($do$
|
|
21091
|
+
return new APIPromise($do$h(client, id, api_version, options));
|
|
21076
21092
|
}
|
|
21077
|
-
async function $do$
|
|
21093
|
+
async function $do$h(client, id, api_version, options) {
|
|
21078
21094
|
var _a, _b, _c;
|
|
21079
21095
|
const input = {
|
|
21080
21096
|
id: id,
|
|
@@ -21160,9 +21176,9 @@ async function $do$a(client, id, api_version, options) {
|
|
|
21160
21176
|
* g3-prettier-ignore-file
|
|
21161
21177
|
*/
|
|
21162
21178
|
function interactionsCreate(client, body, api_version, options) {
|
|
21163
|
-
return new APIPromise($do$
|
|
21179
|
+
return new APIPromise($do$g(client, body, api_version, options));
|
|
21164
21180
|
}
|
|
21165
|
-
async function $do$
|
|
21181
|
+
async function $do$g(client, body, api_version, options) {
|
|
21166
21182
|
var _a, _b, _c, _d;
|
|
21167
21183
|
const input = {
|
|
21168
21184
|
body: body,
|
|
@@ -21254,9 +21270,9 @@ async function $do$9(client, body, api_version, options) {
|
|
|
21254
21270
|
* Deletes the interaction by id.
|
|
21255
21271
|
*/
|
|
21256
21272
|
function interactionsDelete(client, id, api_version, options) {
|
|
21257
|
-
return new APIPromise($do$
|
|
21273
|
+
return new APIPromise($do$f(client, id, api_version, options));
|
|
21258
21274
|
}
|
|
21259
|
-
async function $do$
|
|
21275
|
+
async function $do$f(client, id, api_version, options) {
|
|
21260
21276
|
var _a, _b, _c;
|
|
21261
21277
|
const input = {
|
|
21262
21278
|
id: id,
|
|
@@ -21342,9 +21358,9 @@ async function $do$8(client, id, api_version, options) {
|
|
|
21342
21358
|
* g3-prettier-ignore-file
|
|
21343
21359
|
*/
|
|
21344
21360
|
function interactionsGet(client, id, stream, last_event_id, include_input, api_version, options) {
|
|
21345
|
-
return new APIPromise($do$
|
|
21361
|
+
return new APIPromise($do$e(client, id, stream, last_event_id, include_input, api_version, options));
|
|
21346
21362
|
}
|
|
21347
|
-
async function $do$
|
|
21363
|
+
async function $do$e(client, id, stream, last_event_id, include_input, api_version, options) {
|
|
21348
21364
|
var _a, _b, _c;
|
|
21349
21365
|
const input = {
|
|
21350
21366
|
id: id,
|
|
@@ -21477,12 +21493,12 @@ class Interactions extends ClientSDK {
|
|
|
21477
21493
|
* g3-prettier-ignore-file
|
|
21478
21494
|
*/
|
|
21479
21495
|
/**
|
|
21480
|
-
* Creates a new
|
|
21496
|
+
* Creates a new trigger that will invoke the specified agent on the given cron schedule.
|
|
21481
21497
|
*/
|
|
21482
|
-
function
|
|
21483
|
-
return new APIPromise($do$
|
|
21498
|
+
function triggersCreate(client, body, api_version, options) {
|
|
21499
|
+
return new APIPromise($do$d(client, body, api_version, options));
|
|
21484
21500
|
}
|
|
21485
|
-
async function $do$
|
|
21501
|
+
async function $do$d(client, body, api_version, options) {
|
|
21486
21502
|
var _a, _b, _c;
|
|
21487
21503
|
const input = {
|
|
21488
21504
|
body: body,
|
|
@@ -21493,7 +21509,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
21493
21509
|
const pathParams = {
|
|
21494
21510
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21495
21511
|
};
|
|
21496
|
-
const path = pathToFunc("/{api_version}/
|
|
21512
|
+
const path = pathToFunc("/{api_version}/triggers")(pathParams);
|
|
21497
21513
|
const headers = new Headers(compactMap({
|
|
21498
21514
|
"Content-Type": "application/json",
|
|
21499
21515
|
Accept: "application/json",
|
|
@@ -21503,7 +21519,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
21503
21519
|
const context = {
|
|
21504
21520
|
options: client._options,
|
|
21505
21521
|
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 : "",
|
|
21506
|
-
operation_id: "
|
|
21522
|
+
operation_id: "CreateTrigger",
|
|
21507
21523
|
o_auth2_scopes: null,
|
|
21508
21524
|
resolved_security: requestSecurity,
|
|
21509
21525
|
security_source: client._options.security,
|
|
@@ -21547,7 +21563,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
21547
21563
|
return [doResult, { status: "request-error", request: req }];
|
|
21548
21564
|
}
|
|
21549
21565
|
const response = doResult.value;
|
|
21550
|
-
const [result] = await match(
|
|
21566
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21551
21567
|
if (!result.ok) {
|
|
21552
21568
|
return [result, { status: "complete", request: req, response }];
|
|
21553
21569
|
}
|
|
@@ -21562,12 +21578,12 @@ async function $do$6(client, body, api_version, options) {
|
|
|
21562
21578
|
* g3-prettier-ignore-file
|
|
21563
21579
|
*/
|
|
21564
21580
|
/**
|
|
21565
|
-
* Deletes a
|
|
21581
|
+
* Deletes a trigger.
|
|
21566
21582
|
*/
|
|
21567
|
-
function
|
|
21568
|
-
return new APIPromise($do$
|
|
21583
|
+
function triggersDelete(client, id, api_version, options) {
|
|
21584
|
+
return new APIPromise($do$c(client, id, api_version, options));
|
|
21569
21585
|
}
|
|
21570
|
-
async function $do$
|
|
21586
|
+
async function $do$c(client, id, api_version, options) {
|
|
21571
21587
|
var _a, _b, _c;
|
|
21572
21588
|
const input = {
|
|
21573
21589
|
id: id,
|
|
@@ -21582,7 +21598,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
21582
21598
|
charEncoding: "percent",
|
|
21583
21599
|
}),
|
|
21584
21600
|
};
|
|
21585
|
-
const path = pathToFunc("/{api_version}/
|
|
21601
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
21586
21602
|
const headers = new Headers(compactMap({
|
|
21587
21603
|
Accept: "application/json",
|
|
21588
21604
|
}));
|
|
@@ -21591,7 +21607,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
21591
21607
|
const context = {
|
|
21592
21608
|
options: client._options,
|
|
21593
21609
|
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 : "",
|
|
21594
|
-
operation_id: "
|
|
21610
|
+
operation_id: "DeleteTrigger",
|
|
21595
21611
|
o_auth2_scopes: null,
|
|
21596
21612
|
resolved_security: requestSecurity,
|
|
21597
21613
|
security_source: client._options.security,
|
|
@@ -21635,7 +21651,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
21635
21651
|
return [doResult, { status: "request-error", request: req }];
|
|
21636
21652
|
}
|
|
21637
21653
|
const response = doResult.value;
|
|
21638
|
-
const [result] = await match(
|
|
21654
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21639
21655
|
if (!result.ok) {
|
|
21640
21656
|
return [result, { status: "complete", request: req, response }];
|
|
21641
21657
|
}
|
|
@@ -21650,12 +21666,12 @@ async function $do$5(client, id, api_version, options) {
|
|
|
21650
21666
|
* g3-prettier-ignore-file
|
|
21651
21667
|
*/
|
|
21652
21668
|
/**
|
|
21653
|
-
* Gets a
|
|
21669
|
+
* Gets details of a single trigger.
|
|
21654
21670
|
*/
|
|
21655
|
-
function
|
|
21656
|
-
return new APIPromise($do$
|
|
21671
|
+
function triggersGet(client, id, api_version, options) {
|
|
21672
|
+
return new APIPromise($do$b(client, id, api_version, options));
|
|
21657
21673
|
}
|
|
21658
|
-
async function $do$
|
|
21674
|
+
async function $do$b(client, id, api_version, options) {
|
|
21659
21675
|
var _a, _b, _c;
|
|
21660
21676
|
const input = {
|
|
21661
21677
|
id: id,
|
|
@@ -21670,7 +21686,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
21670
21686
|
charEncoding: "percent",
|
|
21671
21687
|
}),
|
|
21672
21688
|
};
|
|
21673
|
-
const path = pathToFunc("/{api_version}/
|
|
21689
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
21674
21690
|
const headers = new Headers(compactMap({
|
|
21675
21691
|
Accept: "application/json",
|
|
21676
21692
|
}));
|
|
@@ -21679,7 +21695,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
21679
21695
|
const context = {
|
|
21680
21696
|
options: client._options,
|
|
21681
21697
|
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 : "",
|
|
21682
|
-
operation_id: "
|
|
21698
|
+
operation_id: "GetTrigger",
|
|
21683
21699
|
o_auth2_scopes: null,
|
|
21684
21700
|
resolved_security: requestSecurity,
|
|
21685
21701
|
security_source: client._options.security,
|
|
@@ -21723,7 +21739,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
21723
21739
|
return [doResult, { status: "request-error", request: req }];
|
|
21724
21740
|
}
|
|
21725
21741
|
const response = doResult.value;
|
|
21726
|
-
const [result] = await match(
|
|
21742
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21727
21743
|
if (!result.ok) {
|
|
21728
21744
|
return [result, { status: "complete", request: req, response }];
|
|
21729
21745
|
}
|
|
@@ -21738,14 +21754,15 @@ async function $do$4(client, id, api_version, options) {
|
|
|
21738
21754
|
* g3-prettier-ignore-file
|
|
21739
21755
|
*/
|
|
21740
21756
|
/**
|
|
21741
|
-
* Lists
|
|
21757
|
+
* Lists executions for a trigger.
|
|
21742
21758
|
*/
|
|
21743
|
-
function
|
|
21744
|
-
return new APIPromise($do$
|
|
21759
|
+
function triggersListExecutions(client, trigger_id, api_version, page_size, page_token, options) {
|
|
21760
|
+
return new APIPromise($do$a(client, trigger_id, api_version, page_size, page_token, options));
|
|
21745
21761
|
}
|
|
21746
|
-
async function $do$
|
|
21762
|
+
async function $do$a(client, trigger_id, api_version, page_size, page_token, options) {
|
|
21747
21763
|
var _a, _b, _c;
|
|
21748
21764
|
const input = {
|
|
21765
|
+
trigger_id: trigger_id,
|
|
21749
21766
|
api_version: api_version,
|
|
21750
21767
|
page_size: page_size,
|
|
21751
21768
|
page_token: page_token,
|
|
@@ -21753,12 +21770,16 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
21753
21770
|
const payload = input;
|
|
21754
21771
|
const body = null;
|
|
21755
21772
|
const pathParams = {
|
|
21756
|
-
api_version: encodeSimple("api_version", (_a = payload
|
|
21773
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21774
|
+
trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
|
|
21775
|
+
explode: false,
|
|
21776
|
+
charEncoding: "percent",
|
|
21777
|
+
}),
|
|
21757
21778
|
};
|
|
21758
|
-
const path = pathToFunc("/{api_version}/
|
|
21779
|
+
const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
|
|
21759
21780
|
const query = encodeFormQuery({
|
|
21760
|
-
"page_size": payload
|
|
21761
|
-
"page_token": payload
|
|
21781
|
+
"page_size": payload.page_size,
|
|
21782
|
+
"page_token": payload.page_token,
|
|
21762
21783
|
});
|
|
21763
21784
|
const headers = new Headers(compactMap({
|
|
21764
21785
|
Accept: "application/json",
|
|
@@ -21768,7 +21789,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
21768
21789
|
const context = {
|
|
21769
21790
|
options: client._options,
|
|
21770
21791
|
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 : "",
|
|
21771
|
-
operation_id: "
|
|
21792
|
+
operation_id: "ListTriggerExecutions",
|
|
21772
21793
|
o_auth2_scopes: null,
|
|
21773
21794
|
resolved_security: requestSecurity,
|
|
21774
21795
|
security_source: client._options.security,
|
|
@@ -21813,7 +21834,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
21813
21834
|
return [doResult, { status: "request-error", request: req }];
|
|
21814
21835
|
}
|
|
21815
21836
|
const response = doResult.value;
|
|
21816
|
-
const [result] = await match(
|
|
21837
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21817
21838
|
if (!result.ok) {
|
|
21818
21839
|
return [result, { status: "complete", request: req, response }];
|
|
21819
21840
|
}
|
|
@@ -21828,30 +21849,31 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
21828
21849
|
* g3-prettier-ignore-file
|
|
21829
21850
|
*/
|
|
21830
21851
|
/**
|
|
21831
|
-
*
|
|
21852
|
+
* Lists triggers for a project.
|
|
21832
21853
|
*/
|
|
21833
|
-
function
|
|
21834
|
-
return new APIPromise($do$
|
|
21854
|
+
function triggersList(client, api_version, filter, page_size, page_token, options) {
|
|
21855
|
+
return new APIPromise($do$9(client, api_version, filter, page_size, page_token, options));
|
|
21835
21856
|
}
|
|
21836
|
-
async function $do$
|
|
21857
|
+
async function $do$9(client, api_version, filter, page_size, page_token, options) {
|
|
21837
21858
|
var _a, _b, _c;
|
|
21838
21859
|
const input = {
|
|
21839
|
-
id: id,
|
|
21840
21860
|
api_version: api_version,
|
|
21841
|
-
|
|
21861
|
+
filter: filter,
|
|
21862
|
+
page_size: page_size,
|
|
21863
|
+
page_token: page_token,
|
|
21842
21864
|
};
|
|
21843
21865
|
const payload = input;
|
|
21844
|
-
const body
|
|
21866
|
+
const body = null;
|
|
21845
21867
|
const pathParams = {
|
|
21846
|
-
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21847
|
-
id: encodeSimple("id", payload.id, {
|
|
21848
|
-
explode: false,
|
|
21849
|
-
charEncoding: "percent",
|
|
21850
|
-
}),
|
|
21868
|
+
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" }),
|
|
21851
21869
|
};
|
|
21852
|
-
const path = pathToFunc("/{api_version}/
|
|
21870
|
+
const path = pathToFunc("/{api_version}/triggers")(pathParams);
|
|
21871
|
+
const query = encodeFormQuery({
|
|
21872
|
+
"filter": payload === null || payload === void 0 ? void 0 : payload.filter,
|
|
21873
|
+
"page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
|
|
21874
|
+
"page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
|
|
21875
|
+
});
|
|
21853
21876
|
const headers = new Headers(compactMap({
|
|
21854
|
-
"Content-Type": "application/json",
|
|
21855
21877
|
Accept: "application/json",
|
|
21856
21878
|
}));
|
|
21857
21879
|
const securityInput = await extractSecurity(client._options.security);
|
|
@@ -21859,7 +21881,7 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
21859
21881
|
const context = {
|
|
21860
21882
|
options: client._options,
|
|
21861
21883
|
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 : "",
|
|
21862
|
-
operation_id: "
|
|
21884
|
+
operation_id: "ListTriggers",
|
|
21863
21885
|
o_auth2_scopes: null,
|
|
21864
21886
|
resolved_security: requestSecurity,
|
|
21865
21887
|
security_source: client._options.security,
|
|
@@ -21881,11 +21903,12 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
21881
21903
|
};
|
|
21882
21904
|
const requestRes = client._createRequest(context, {
|
|
21883
21905
|
security: requestSecurity,
|
|
21884
|
-
method: "
|
|
21906
|
+
method: "GET",
|
|
21885
21907
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
21886
21908
|
path: path,
|
|
21887
21909
|
headers: headers,
|
|
21888
|
-
|
|
21910
|
+
query: query,
|
|
21911
|
+
body: body,
|
|
21889
21912
|
userAgent: client._options.user_agent,
|
|
21890
21913
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
21891
21914
|
}, options);
|
|
@@ -21903,7 +21926,7 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
21903
21926
|
return [doResult, { status: "request-error", request: req }];
|
|
21904
21927
|
}
|
|
21905
21928
|
const response = doResult.value;
|
|
21906
|
-
const [result] = await match(
|
|
21929
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21907
21930
|
if (!result.ok) {
|
|
21908
21931
|
return [result, { status: "complete", request: req, response }];
|
|
21909
21932
|
}
|
|
@@ -21918,30 +21941,28 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
21918
21941
|
* g3-prettier-ignore-file
|
|
21919
21942
|
*/
|
|
21920
21943
|
/**
|
|
21921
|
-
*
|
|
21944
|
+
* Runs a trigger immediately.
|
|
21922
21945
|
*/
|
|
21923
|
-
function
|
|
21924
|
-
return new APIPromise($do$
|
|
21946
|
+
function triggersRun(client, trigger_id, api_version, options) {
|
|
21947
|
+
return new APIPromise($do$8(client, trigger_id, api_version, options));
|
|
21925
21948
|
}
|
|
21926
|
-
async function $do$
|
|
21949
|
+
async function $do$8(client, trigger_id, api_version, options) {
|
|
21927
21950
|
var _a, _b, _c;
|
|
21928
21951
|
const input = {
|
|
21929
|
-
|
|
21952
|
+
trigger_id: trigger_id,
|
|
21930
21953
|
api_version: api_version,
|
|
21931
|
-
body: body,
|
|
21932
21954
|
};
|
|
21933
21955
|
const payload = input;
|
|
21934
|
-
const body
|
|
21956
|
+
const body = null;
|
|
21935
21957
|
const pathParams = {
|
|
21936
21958
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21937
|
-
|
|
21959
|
+
trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
|
|
21938
21960
|
explode: false,
|
|
21939
21961
|
charEncoding: "percent",
|
|
21940
21962
|
}),
|
|
21941
21963
|
};
|
|
21942
|
-
const path = pathToFunc("/{api_version}/
|
|
21964
|
+
const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
|
|
21943
21965
|
const headers = new Headers(compactMap({
|
|
21944
|
-
"Content-Type": "application/json",
|
|
21945
21966
|
Accept: "application/json",
|
|
21946
21967
|
}));
|
|
21947
21968
|
const securityInput = await extractSecurity(client._options.security);
|
|
@@ -21949,7 +21970,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
21949
21970
|
const context = {
|
|
21950
21971
|
options: client._options,
|
|
21951
21972
|
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 : "",
|
|
21952
|
-
operation_id: "
|
|
21973
|
+
operation_id: "RunTrigger",
|
|
21953
21974
|
o_auth2_scopes: null,
|
|
21954
21975
|
resolved_security: requestSecurity,
|
|
21955
21976
|
security_source: client._options.security,
|
|
@@ -21975,7 +21996,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
21975
21996
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
21976
21997
|
path: path,
|
|
21977
21998
|
headers: headers,
|
|
21978
|
-
body: body
|
|
21999
|
+
body: body,
|
|
21979
22000
|
userAgent: client._options.user_agent,
|
|
21980
22001
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
21981
22002
|
}, options);
|
|
@@ -21993,7 +22014,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
21993
22014
|
return [doResult, { status: "request-error", request: req }];
|
|
21994
22015
|
}
|
|
21995
22016
|
const response = doResult.value;
|
|
21996
|
-
const [result] = await match(
|
|
22017
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21997
22018
|
if (!result.ok) {
|
|
21998
22019
|
return [result, { status: "complete", request: req, response }];
|
|
21999
22020
|
}
|
|
@@ -22008,18 +22029,17 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
22008
22029
|
* g3-prettier-ignore-file
|
|
22009
22030
|
*/
|
|
22010
22031
|
/**
|
|
22011
|
-
* Updates
|
|
22032
|
+
* Updates a trigger.
|
|
22012
22033
|
*/
|
|
22013
|
-
function
|
|
22014
|
-
return new APIPromise($do(client, id,
|
|
22034
|
+
function triggersUpdate(client, id, body, api_version, options) {
|
|
22035
|
+
return new APIPromise($do$7(client, id, body, api_version, options));
|
|
22015
22036
|
}
|
|
22016
|
-
async function $do(client, id,
|
|
22037
|
+
async function $do$7(client, id, body, api_version, options) {
|
|
22017
22038
|
var _a, _b, _c;
|
|
22018
22039
|
const input = {
|
|
22019
22040
|
id: id,
|
|
22020
|
-
api_version: api_version,
|
|
22021
|
-
update_mask: update_mask,
|
|
22022
22041
|
body: body,
|
|
22042
|
+
api_version: api_version,
|
|
22023
22043
|
};
|
|
22024
22044
|
const payload = input;
|
|
22025
22045
|
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
@@ -22030,10 +22050,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22030
22050
|
charEncoding: "percent",
|
|
22031
22051
|
}),
|
|
22032
22052
|
};
|
|
22033
|
-
const path = pathToFunc("/{api_version}/
|
|
22034
|
-
const query = encodeFormQuery({
|
|
22035
|
-
"update_mask": payload.update_mask,
|
|
22036
|
-
});
|
|
22053
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
22037
22054
|
const headers = new Headers(compactMap({
|
|
22038
22055
|
"Content-Type": "application/json",
|
|
22039
22056
|
Accept: "application/json",
|
|
@@ -22043,7 +22060,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22043
22060
|
const context = {
|
|
22044
22061
|
options: client._options,
|
|
22045
22062
|
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 : "",
|
|
22046
|
-
operation_id: "
|
|
22063
|
+
operation_id: "UpdateTrigger",
|
|
22047
22064
|
o_auth2_scopes: null,
|
|
22048
22065
|
resolved_security: requestSecurity,
|
|
22049
22066
|
security_source: client._options.security,
|
|
@@ -22069,7 +22086,6 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22069
22086
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22070
22087
|
path: path,
|
|
22071
22088
|
headers: headers,
|
|
22072
|
-
query: query,
|
|
22073
22089
|
body: body$,
|
|
22074
22090
|
userAgent: client._options.user_agent,
|
|
22075
22091
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
@@ -22088,7 +22104,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22088
22104
|
return [doResult, { status: "request-error", request: req }];
|
|
22089
22105
|
}
|
|
22090
22106
|
const response = doResult.value;
|
|
22091
|
-
const [result] = await match(
|
|
22107
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
22092
22108
|
if (!result.ok) {
|
|
22093
22109
|
return [result, { status: "complete", request: req, response }];
|
|
22094
22110
|
}
|
|
@@ -22102,53 +22118,50 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22102
22118
|
*
|
|
22103
22119
|
* g3-prettier-ignore-file
|
|
22104
22120
|
*/
|
|
22105
|
-
class
|
|
22121
|
+
class Triggers extends ClientSDK {
|
|
22106
22122
|
/**
|
|
22107
|
-
* Creates a new
|
|
22123
|
+
* Creates a new trigger that will invoke the specified agent on the given cron schedule.
|
|
22108
22124
|
*/
|
|
22109
22125
|
create(params, options) {
|
|
22110
22126
|
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
22111
|
-
return unwrapAsAPIPromise(
|
|
22127
|
+
return unwrapAsAPIPromise(triggersCreate(this, body, api_version, options));
|
|
22112
22128
|
}
|
|
22113
22129
|
/**
|
|
22114
|
-
* Lists
|
|
22130
|
+
* Lists triggers for a project.
|
|
22115
22131
|
*/
|
|
22116
22132
|
list(params, options) {
|
|
22117
|
-
return unwrapAsAPIPromise(
|
|
22133
|
+
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));
|
|
22118
22134
|
}
|
|
22119
22135
|
/**
|
|
22120
|
-
* Gets a
|
|
22136
|
+
* Gets details of a single trigger.
|
|
22121
22137
|
*/
|
|
22122
22138
|
get(id, params, options) {
|
|
22123
|
-
return unwrapAsAPIPromise(
|
|
22139
|
+
return unwrapAsAPIPromise(triggersGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22124
22140
|
}
|
|
22125
22141
|
/**
|
|
22126
|
-
* Updates
|
|
22142
|
+
* Updates a trigger.
|
|
22127
22143
|
*/
|
|
22128
22144
|
update(id, params, options) {
|
|
22129
|
-
const
|
|
22130
|
-
|
|
22131
|
-
? undefined
|
|
22132
|
-
: body$body;
|
|
22133
|
-
return unwrapAsAPIPromise(webhooksUpdate(this, id, api_version, update_mask, body, options));
|
|
22145
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
22146
|
+
return unwrapAsAPIPromise(triggersUpdate(this, id, body, api_version, options));
|
|
22134
22147
|
}
|
|
22135
22148
|
/**
|
|
22136
|
-
* Deletes a
|
|
22149
|
+
* Deletes a trigger.
|
|
22137
22150
|
*/
|
|
22138
22151
|
delete(id, params, options) {
|
|
22139
|
-
return unwrapAsAPIPromise(
|
|
22152
|
+
return unwrapAsAPIPromise(triggersDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22140
22153
|
}
|
|
22141
22154
|
/**
|
|
22142
|
-
*
|
|
22155
|
+
* Runs a trigger immediately.
|
|
22143
22156
|
*/
|
|
22144
|
-
|
|
22145
|
-
return unwrapAsAPIPromise(
|
|
22157
|
+
run(trigger_id, params, options) {
|
|
22158
|
+
return unwrapAsAPIPromise(triggersRun(this, trigger_id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22146
22159
|
}
|
|
22147
22160
|
/**
|
|
22148
|
-
*
|
|
22161
|
+
* Lists executions for a trigger.
|
|
22149
22162
|
*/
|
|
22150
|
-
|
|
22151
|
-
return unwrapAsAPIPromise(
|
|
22163
|
+
listExecutions(trigger_id, params, options) {
|
|
22164
|
+
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));
|
|
22152
22165
|
}
|
|
22153
22166
|
}
|
|
22154
22167
|
|
|
@@ -22159,23 +22172,83 @@ class Webhooks extends ClientSDK {
|
|
|
22159
22172
|
*
|
|
22160
22173
|
* g3-prettier-ignore-file
|
|
22161
22174
|
*/
|
|
22162
|
-
|
|
22163
|
-
*
|
|
22175
|
+
/**
|
|
22176
|
+
* Creates a new Webhook.
|
|
22164
22177
|
*/
|
|
22165
|
-
|
|
22166
|
-
|
|
22167
|
-
|
|
22168
|
-
|
|
22178
|
+
function webhooksCreate(client, body, api_version, options) {
|
|
22179
|
+
return new APIPromise($do$6(client, body, api_version, options));
|
|
22180
|
+
}
|
|
22181
|
+
async function $do$6(client, body, api_version, options) {
|
|
22182
|
+
var _a, _b, _c;
|
|
22183
|
+
const input = {
|
|
22184
|
+
body: body,
|
|
22185
|
+
api_version: api_version,
|
|
22186
|
+
};
|
|
22187
|
+
const payload = input;
|
|
22188
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
22189
|
+
const pathParams = {
|
|
22190
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22191
|
+
};
|
|
22192
|
+
const path = pathToFunc("/{api_version}/webhooks")(pathParams);
|
|
22193
|
+
const headers = new Headers(compactMap({
|
|
22194
|
+
"Content-Type": "application/json",
|
|
22195
|
+
Accept: "application/json",
|
|
22196
|
+
}));
|
|
22197
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22198
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22199
|
+
const context = {
|
|
22200
|
+
options: client._options,
|
|
22201
|
+
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 : "",
|
|
22202
|
+
operation_id: "CreateWebhook",
|
|
22203
|
+
o_auth2_scopes: null,
|
|
22204
|
+
resolved_security: requestSecurity,
|
|
22205
|
+
security_source: client._options.security,
|
|
22206
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22207
|
+
|| client._options.retry_config
|
|
22208
|
+
|| {
|
|
22209
|
+
strategy: "attempt-count-backoff",
|
|
22210
|
+
backoff: {
|
|
22211
|
+
initialInterval: 500,
|
|
22212
|
+
maxInterval: 8000,
|
|
22213
|
+
exponent: 2,
|
|
22214
|
+
maxElapsedTime: 30000,
|
|
22215
|
+
},
|
|
22216
|
+
retryConnectionErrors: true,
|
|
22217
|
+
maxRetries: 4,
|
|
22218
|
+
}
|
|
22219
|
+
|| { strategy: "none" },
|
|
22220
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22221
|
+
};
|
|
22222
|
+
const requestRes = client._createRequest(context, {
|
|
22223
|
+
security: requestSecurity,
|
|
22224
|
+
method: "POST",
|
|
22225
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22226
|
+
path: path,
|
|
22227
|
+
headers: headers,
|
|
22228
|
+
body: body$,
|
|
22229
|
+
userAgent: client._options.user_agent,
|
|
22230
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22231
|
+
}, options);
|
|
22232
|
+
if (!requestRes.ok) {
|
|
22233
|
+
return [requestRes, { status: "invalid" }];
|
|
22169
22234
|
}
|
|
22170
|
-
|
|
22171
|
-
|
|
22172
|
-
|
|
22235
|
+
const req = requestRes.value;
|
|
22236
|
+
const doResult = await client._do(req, {
|
|
22237
|
+
context,
|
|
22238
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22239
|
+
retryConfig: context.retry_config,
|
|
22240
|
+
retryCodes: context.retry_codes,
|
|
22241
|
+
});
|
|
22242
|
+
if (!doResult.ok) {
|
|
22243
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22173
22244
|
}
|
|
22174
|
-
|
|
22175
|
-
|
|
22176
|
-
|
|
22245
|
+
const response = doResult.value;
|
|
22246
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22247
|
+
if (!result.ok) {
|
|
22248
|
+
return [result, { status: "complete", request: req, response }];
|
|
22177
22249
|
}
|
|
22178
|
-
};
|
|
22250
|
+
return [result, { status: "complete", request: req, response }];
|
|
22251
|
+
}
|
|
22179
22252
|
|
|
22180
22253
|
/**
|
|
22181
22254
|
* @license
|
|
@@ -22184,46 +22257,673 @@ let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
|
|
|
22184
22257
|
*
|
|
22185
22258
|
* g3-prettier-ignore-file
|
|
22186
22259
|
*/
|
|
22187
|
-
|
|
22188
|
-
|
|
22189
|
-
|
|
22190
|
-
|
|
22191
|
-
|
|
22192
|
-
const serverURL = parentClient.getBaseUrl();
|
|
22193
|
-
if (!serverURL) {
|
|
22194
|
-
throw new Error("Base URL must be set.");
|
|
22195
|
-
}
|
|
22196
|
-
return serverURL.replace(/\/+$/, "");
|
|
22197
|
-
}
|
|
22198
|
-
function getGoogleGenAIAPIVersion(parentClient) {
|
|
22199
|
-
const apiVersion = trimSlashes(parentClient.getApiVersion());
|
|
22200
|
-
const project = parentClient.getProject();
|
|
22201
|
-
const location = parentClient.getLocation();
|
|
22202
|
-
if (parentClient.isVertexAI() && apiVersion && project && location) {
|
|
22203
|
-
return (`${apiVersion}/projects/${encodeURIComponent(project)}` +
|
|
22204
|
-
`/locations/${encodeURIComponent(location)}`);
|
|
22205
|
-
}
|
|
22206
|
-
return apiVersion;
|
|
22207
|
-
}
|
|
22208
|
-
function buildGoogleGenAIClient(parentClient, options = {}) {
|
|
22209
|
-
var _a, _b, _c, _d;
|
|
22210
|
-
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({
|
|
22211
|
-
defaultHeaders: (_c = parentClient.getDefaultHeaders) === null || _c === void 0 ? void 0 : _c.call(parentClient),
|
|
22212
|
-
getAuthHeaders: (url) => parentClient.getAuthHeaders(url),
|
|
22213
|
-
}), server_url: (_d = options.server_url) !== null && _d !== void 0 ? _d : getGoogleGenAIServerURL(parentClient) }));
|
|
22214
|
-
return sdk;
|
|
22260
|
+
/**
|
|
22261
|
+
* Deletes a Webhook.
|
|
22262
|
+
*/
|
|
22263
|
+
function webhooksDelete(client, id, api_version, options) {
|
|
22264
|
+
return new APIPromise($do$5(client, id, api_version, options));
|
|
22215
22265
|
}
|
|
22216
|
-
|
|
22217
|
-
|
|
22218
|
-
|
|
22219
|
-
|
|
22220
|
-
|
|
22221
|
-
|
|
22222
|
-
|
|
22223
|
-
|
|
22224
|
-
|
|
22225
|
-
}
|
|
22226
|
-
|
|
22266
|
+
async function $do$5(client, id, api_version, options) {
|
|
22267
|
+
var _a, _b, _c;
|
|
22268
|
+
const input = {
|
|
22269
|
+
id: id,
|
|
22270
|
+
api_version: api_version,
|
|
22271
|
+
};
|
|
22272
|
+
const payload = input;
|
|
22273
|
+
const body = null;
|
|
22274
|
+
const pathParams = {
|
|
22275
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22276
|
+
id: encodeSimple("id", payload.id, {
|
|
22277
|
+
explode: false,
|
|
22278
|
+
charEncoding: "percent",
|
|
22279
|
+
}),
|
|
22280
|
+
};
|
|
22281
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
22282
|
+
const headers = new Headers(compactMap({
|
|
22283
|
+
Accept: "application/json",
|
|
22284
|
+
}));
|
|
22285
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22286
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22287
|
+
const context = {
|
|
22288
|
+
options: client._options,
|
|
22289
|
+
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 : "",
|
|
22290
|
+
operation_id: "DeleteWebhook",
|
|
22291
|
+
o_auth2_scopes: null,
|
|
22292
|
+
resolved_security: requestSecurity,
|
|
22293
|
+
security_source: client._options.security,
|
|
22294
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22295
|
+
|| client._options.retry_config
|
|
22296
|
+
|| {
|
|
22297
|
+
strategy: "attempt-count-backoff",
|
|
22298
|
+
backoff: {
|
|
22299
|
+
initialInterval: 500,
|
|
22300
|
+
maxInterval: 8000,
|
|
22301
|
+
exponent: 2,
|
|
22302
|
+
maxElapsedTime: 30000,
|
|
22303
|
+
},
|
|
22304
|
+
retryConnectionErrors: true,
|
|
22305
|
+
maxRetries: 4,
|
|
22306
|
+
}
|
|
22307
|
+
|| { strategy: "none" },
|
|
22308
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22309
|
+
};
|
|
22310
|
+
const requestRes = client._createRequest(context, {
|
|
22311
|
+
security: requestSecurity,
|
|
22312
|
+
method: "DELETE",
|
|
22313
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22314
|
+
path: path,
|
|
22315
|
+
headers: headers,
|
|
22316
|
+
body: body,
|
|
22317
|
+
userAgent: client._options.user_agent,
|
|
22318
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22319
|
+
}, options);
|
|
22320
|
+
if (!requestRes.ok) {
|
|
22321
|
+
return [requestRes, { status: "invalid" }];
|
|
22322
|
+
}
|
|
22323
|
+
const req = requestRes.value;
|
|
22324
|
+
const doResult = await client._do(req, {
|
|
22325
|
+
context,
|
|
22326
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22327
|
+
retryConfig: context.retry_config,
|
|
22328
|
+
retryCodes: context.retry_codes,
|
|
22329
|
+
});
|
|
22330
|
+
if (!doResult.ok) {
|
|
22331
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22332
|
+
}
|
|
22333
|
+
const response = doResult.value;
|
|
22334
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22335
|
+
if (!result.ok) {
|
|
22336
|
+
return [result, { status: "complete", request: req, response }];
|
|
22337
|
+
}
|
|
22338
|
+
return [result, { status: "complete", request: req, response }];
|
|
22339
|
+
}
|
|
22340
|
+
|
|
22341
|
+
/**
|
|
22342
|
+
* @license
|
|
22343
|
+
* Copyright 2026 Google LLC
|
|
22344
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22345
|
+
*
|
|
22346
|
+
* g3-prettier-ignore-file
|
|
22347
|
+
*/
|
|
22348
|
+
/**
|
|
22349
|
+
* Gets a specific Webhook.
|
|
22350
|
+
*/
|
|
22351
|
+
function webhooksGet(client, id, api_version, options) {
|
|
22352
|
+
return new APIPromise($do$4(client, id, api_version, options));
|
|
22353
|
+
}
|
|
22354
|
+
async function $do$4(client, id, api_version, options) {
|
|
22355
|
+
var _a, _b, _c;
|
|
22356
|
+
const input = {
|
|
22357
|
+
id: id,
|
|
22358
|
+
api_version: api_version,
|
|
22359
|
+
};
|
|
22360
|
+
const payload = input;
|
|
22361
|
+
const body = null;
|
|
22362
|
+
const pathParams = {
|
|
22363
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22364
|
+
id: encodeSimple("id", payload.id, {
|
|
22365
|
+
explode: false,
|
|
22366
|
+
charEncoding: "percent",
|
|
22367
|
+
}),
|
|
22368
|
+
};
|
|
22369
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
22370
|
+
const headers = new Headers(compactMap({
|
|
22371
|
+
Accept: "application/json",
|
|
22372
|
+
}));
|
|
22373
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22374
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22375
|
+
const context = {
|
|
22376
|
+
options: client._options,
|
|
22377
|
+
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 : "",
|
|
22378
|
+
operation_id: "GetWebhook",
|
|
22379
|
+
o_auth2_scopes: null,
|
|
22380
|
+
resolved_security: requestSecurity,
|
|
22381
|
+
security_source: client._options.security,
|
|
22382
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22383
|
+
|| client._options.retry_config
|
|
22384
|
+
|| {
|
|
22385
|
+
strategy: "attempt-count-backoff",
|
|
22386
|
+
backoff: {
|
|
22387
|
+
initialInterval: 500,
|
|
22388
|
+
maxInterval: 8000,
|
|
22389
|
+
exponent: 2,
|
|
22390
|
+
maxElapsedTime: 30000,
|
|
22391
|
+
},
|
|
22392
|
+
retryConnectionErrors: true,
|
|
22393
|
+
maxRetries: 4,
|
|
22394
|
+
}
|
|
22395
|
+
|| { strategy: "none" },
|
|
22396
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22397
|
+
};
|
|
22398
|
+
const requestRes = client._createRequest(context, {
|
|
22399
|
+
security: requestSecurity,
|
|
22400
|
+
method: "GET",
|
|
22401
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22402
|
+
path: path,
|
|
22403
|
+
headers: headers,
|
|
22404
|
+
body: body,
|
|
22405
|
+
userAgent: client._options.user_agent,
|
|
22406
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22407
|
+
}, options);
|
|
22408
|
+
if (!requestRes.ok) {
|
|
22409
|
+
return [requestRes, { status: "invalid" }];
|
|
22410
|
+
}
|
|
22411
|
+
const req = requestRes.value;
|
|
22412
|
+
const doResult = await client._do(req, {
|
|
22413
|
+
context,
|
|
22414
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22415
|
+
retryConfig: context.retry_config,
|
|
22416
|
+
retryCodes: context.retry_codes,
|
|
22417
|
+
});
|
|
22418
|
+
if (!doResult.ok) {
|
|
22419
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22420
|
+
}
|
|
22421
|
+
const response = doResult.value;
|
|
22422
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22423
|
+
if (!result.ok) {
|
|
22424
|
+
return [result, { status: "complete", request: req, response }];
|
|
22425
|
+
}
|
|
22426
|
+
return [result, { status: "complete", request: req, response }];
|
|
22427
|
+
}
|
|
22428
|
+
|
|
22429
|
+
/**
|
|
22430
|
+
* @license
|
|
22431
|
+
* Copyright 2026 Google LLC
|
|
22432
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22433
|
+
*
|
|
22434
|
+
* g3-prettier-ignore-file
|
|
22435
|
+
*/
|
|
22436
|
+
/**
|
|
22437
|
+
* Lists all Webhooks.
|
|
22438
|
+
*/
|
|
22439
|
+
function webhooksList(client, api_version, page_size, page_token, options) {
|
|
22440
|
+
return new APIPromise($do$3(client, api_version, page_size, page_token, options));
|
|
22441
|
+
}
|
|
22442
|
+
async function $do$3(client, api_version, page_size, page_token, options) {
|
|
22443
|
+
var _a, _b, _c;
|
|
22444
|
+
const input = {
|
|
22445
|
+
api_version: api_version,
|
|
22446
|
+
page_size: page_size,
|
|
22447
|
+
page_token: page_token,
|
|
22448
|
+
};
|
|
22449
|
+
const payload = input;
|
|
22450
|
+
const body = null;
|
|
22451
|
+
const pathParams = {
|
|
22452
|
+
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" }),
|
|
22453
|
+
};
|
|
22454
|
+
const path = pathToFunc("/{api_version}/webhooks")(pathParams);
|
|
22455
|
+
const query = encodeFormQuery({
|
|
22456
|
+
"page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
|
|
22457
|
+
"page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
|
|
22458
|
+
});
|
|
22459
|
+
const headers = new Headers(compactMap({
|
|
22460
|
+
Accept: "application/json",
|
|
22461
|
+
}));
|
|
22462
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22463
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22464
|
+
const context = {
|
|
22465
|
+
options: client._options,
|
|
22466
|
+
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 : "",
|
|
22467
|
+
operation_id: "ListWebhooks",
|
|
22468
|
+
o_auth2_scopes: null,
|
|
22469
|
+
resolved_security: requestSecurity,
|
|
22470
|
+
security_source: client._options.security,
|
|
22471
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22472
|
+
|| client._options.retry_config
|
|
22473
|
+
|| {
|
|
22474
|
+
strategy: "attempt-count-backoff",
|
|
22475
|
+
backoff: {
|
|
22476
|
+
initialInterval: 500,
|
|
22477
|
+
maxInterval: 8000,
|
|
22478
|
+
exponent: 2,
|
|
22479
|
+
maxElapsedTime: 30000,
|
|
22480
|
+
},
|
|
22481
|
+
retryConnectionErrors: true,
|
|
22482
|
+
maxRetries: 4,
|
|
22483
|
+
}
|
|
22484
|
+
|| { strategy: "none" },
|
|
22485
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22486
|
+
};
|
|
22487
|
+
const requestRes = client._createRequest(context, {
|
|
22488
|
+
security: requestSecurity,
|
|
22489
|
+
method: "GET",
|
|
22490
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22491
|
+
path: path,
|
|
22492
|
+
headers: headers,
|
|
22493
|
+
query: query,
|
|
22494
|
+
body: body,
|
|
22495
|
+
userAgent: client._options.user_agent,
|
|
22496
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22497
|
+
}, options);
|
|
22498
|
+
if (!requestRes.ok) {
|
|
22499
|
+
return [requestRes, { status: "invalid" }];
|
|
22500
|
+
}
|
|
22501
|
+
const req = requestRes.value;
|
|
22502
|
+
const doResult = await client._do(req, {
|
|
22503
|
+
context,
|
|
22504
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22505
|
+
retryConfig: context.retry_config,
|
|
22506
|
+
retryCodes: context.retry_codes,
|
|
22507
|
+
});
|
|
22508
|
+
if (!doResult.ok) {
|
|
22509
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22510
|
+
}
|
|
22511
|
+
const response = doResult.value;
|
|
22512
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22513
|
+
if (!result.ok) {
|
|
22514
|
+
return [result, { status: "complete", request: req, response }];
|
|
22515
|
+
}
|
|
22516
|
+
return [result, { status: "complete", request: req, response }];
|
|
22517
|
+
}
|
|
22518
|
+
|
|
22519
|
+
/**
|
|
22520
|
+
* @license
|
|
22521
|
+
* Copyright 2026 Google LLC
|
|
22522
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22523
|
+
*
|
|
22524
|
+
* g3-prettier-ignore-file
|
|
22525
|
+
*/
|
|
22526
|
+
/**
|
|
22527
|
+
* Sends a ping event to a Webhook.
|
|
22528
|
+
*/
|
|
22529
|
+
function webhooksPing(client, id, api_version, body, options) {
|
|
22530
|
+
return new APIPromise($do$2(client, id, api_version, body, options));
|
|
22531
|
+
}
|
|
22532
|
+
async function $do$2(client, id, api_version, body, options) {
|
|
22533
|
+
var _a, _b, _c;
|
|
22534
|
+
const input = {
|
|
22535
|
+
id: id,
|
|
22536
|
+
api_version: api_version,
|
|
22537
|
+
body: body,
|
|
22538
|
+
};
|
|
22539
|
+
const payload = input;
|
|
22540
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
22541
|
+
const pathParams = {
|
|
22542
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22543
|
+
id: encodeSimple("id", payload.id, {
|
|
22544
|
+
explode: false,
|
|
22545
|
+
charEncoding: "percent",
|
|
22546
|
+
}),
|
|
22547
|
+
};
|
|
22548
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}:ping")(pathParams);
|
|
22549
|
+
const headers = new Headers(compactMap({
|
|
22550
|
+
"Content-Type": "application/json",
|
|
22551
|
+
Accept: "application/json",
|
|
22552
|
+
}));
|
|
22553
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22554
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22555
|
+
const context = {
|
|
22556
|
+
options: client._options,
|
|
22557
|
+
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 : "",
|
|
22558
|
+
operation_id: "PingWebhook",
|
|
22559
|
+
o_auth2_scopes: null,
|
|
22560
|
+
resolved_security: requestSecurity,
|
|
22561
|
+
security_source: client._options.security,
|
|
22562
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22563
|
+
|| client._options.retry_config
|
|
22564
|
+
|| {
|
|
22565
|
+
strategy: "attempt-count-backoff",
|
|
22566
|
+
backoff: {
|
|
22567
|
+
initialInterval: 500,
|
|
22568
|
+
maxInterval: 8000,
|
|
22569
|
+
exponent: 2,
|
|
22570
|
+
maxElapsedTime: 30000,
|
|
22571
|
+
},
|
|
22572
|
+
retryConnectionErrors: true,
|
|
22573
|
+
maxRetries: 4,
|
|
22574
|
+
}
|
|
22575
|
+
|| { strategy: "none" },
|
|
22576
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22577
|
+
};
|
|
22578
|
+
const requestRes = client._createRequest(context, {
|
|
22579
|
+
security: requestSecurity,
|
|
22580
|
+
method: "POST",
|
|
22581
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22582
|
+
path: path,
|
|
22583
|
+
headers: headers,
|
|
22584
|
+
body: body$,
|
|
22585
|
+
userAgent: client._options.user_agent,
|
|
22586
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22587
|
+
}, options);
|
|
22588
|
+
if (!requestRes.ok) {
|
|
22589
|
+
return [requestRes, { status: "invalid" }];
|
|
22590
|
+
}
|
|
22591
|
+
const req = requestRes.value;
|
|
22592
|
+
const doResult = await client._do(req, {
|
|
22593
|
+
context,
|
|
22594
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22595
|
+
retryConfig: context.retry_config,
|
|
22596
|
+
retryCodes: context.retry_codes,
|
|
22597
|
+
});
|
|
22598
|
+
if (!doResult.ok) {
|
|
22599
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22600
|
+
}
|
|
22601
|
+
const response = doResult.value;
|
|
22602
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22603
|
+
if (!result.ok) {
|
|
22604
|
+
return [result, { status: "complete", request: req, response }];
|
|
22605
|
+
}
|
|
22606
|
+
return [result, { status: "complete", request: req, response }];
|
|
22607
|
+
}
|
|
22608
|
+
|
|
22609
|
+
/**
|
|
22610
|
+
* @license
|
|
22611
|
+
* Copyright 2026 Google LLC
|
|
22612
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22613
|
+
*
|
|
22614
|
+
* g3-prettier-ignore-file
|
|
22615
|
+
*/
|
|
22616
|
+
/**
|
|
22617
|
+
* Generates a new signing secret for a Webhook.
|
|
22618
|
+
*/
|
|
22619
|
+
function webhooksRotateSigningSecret(client, id, api_version, body, options) {
|
|
22620
|
+
return new APIPromise($do$1(client, id, api_version, body, options));
|
|
22621
|
+
}
|
|
22622
|
+
async function $do$1(client, id, api_version, body, options) {
|
|
22623
|
+
var _a, _b, _c;
|
|
22624
|
+
const input = {
|
|
22625
|
+
id: id,
|
|
22626
|
+
api_version: api_version,
|
|
22627
|
+
body: body,
|
|
22628
|
+
};
|
|
22629
|
+
const payload = input;
|
|
22630
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
22631
|
+
const pathParams = {
|
|
22632
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22633
|
+
id: encodeSimple("id", payload.id, {
|
|
22634
|
+
explode: false,
|
|
22635
|
+
charEncoding: "percent",
|
|
22636
|
+
}),
|
|
22637
|
+
};
|
|
22638
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}:rotateSigningSecret")(pathParams);
|
|
22639
|
+
const headers = new Headers(compactMap({
|
|
22640
|
+
"Content-Type": "application/json",
|
|
22641
|
+
Accept: "application/json",
|
|
22642
|
+
}));
|
|
22643
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22644
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22645
|
+
const context = {
|
|
22646
|
+
options: client._options,
|
|
22647
|
+
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 : "",
|
|
22648
|
+
operation_id: "RotateSigningSecret",
|
|
22649
|
+
o_auth2_scopes: null,
|
|
22650
|
+
resolved_security: requestSecurity,
|
|
22651
|
+
security_source: client._options.security,
|
|
22652
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22653
|
+
|| client._options.retry_config
|
|
22654
|
+
|| {
|
|
22655
|
+
strategy: "attempt-count-backoff",
|
|
22656
|
+
backoff: {
|
|
22657
|
+
initialInterval: 500,
|
|
22658
|
+
maxInterval: 8000,
|
|
22659
|
+
exponent: 2,
|
|
22660
|
+
maxElapsedTime: 30000,
|
|
22661
|
+
},
|
|
22662
|
+
retryConnectionErrors: true,
|
|
22663
|
+
maxRetries: 4,
|
|
22664
|
+
}
|
|
22665
|
+
|| { strategy: "none" },
|
|
22666
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22667
|
+
};
|
|
22668
|
+
const requestRes = client._createRequest(context, {
|
|
22669
|
+
security: requestSecurity,
|
|
22670
|
+
method: "POST",
|
|
22671
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22672
|
+
path: path,
|
|
22673
|
+
headers: headers,
|
|
22674
|
+
body: body$,
|
|
22675
|
+
userAgent: client._options.user_agent,
|
|
22676
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22677
|
+
}, options);
|
|
22678
|
+
if (!requestRes.ok) {
|
|
22679
|
+
return [requestRes, { status: "invalid" }];
|
|
22680
|
+
}
|
|
22681
|
+
const req = requestRes.value;
|
|
22682
|
+
const doResult = await client._do(req, {
|
|
22683
|
+
context,
|
|
22684
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22685
|
+
retryConfig: context.retry_config,
|
|
22686
|
+
retryCodes: context.retry_codes,
|
|
22687
|
+
});
|
|
22688
|
+
if (!doResult.ok) {
|
|
22689
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22690
|
+
}
|
|
22691
|
+
const response = doResult.value;
|
|
22692
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22693
|
+
if (!result.ok) {
|
|
22694
|
+
return [result, { status: "complete", request: req, response }];
|
|
22695
|
+
}
|
|
22696
|
+
return [result, { status: "complete", request: req, response }];
|
|
22697
|
+
}
|
|
22698
|
+
|
|
22699
|
+
/**
|
|
22700
|
+
* @license
|
|
22701
|
+
* Copyright 2026 Google LLC
|
|
22702
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22703
|
+
*
|
|
22704
|
+
* g3-prettier-ignore-file
|
|
22705
|
+
*/
|
|
22706
|
+
/**
|
|
22707
|
+
* Updates an existing Webhook.
|
|
22708
|
+
*/
|
|
22709
|
+
function webhooksUpdate(client, id, api_version, update_mask, body, options) {
|
|
22710
|
+
return new APIPromise($do(client, id, api_version, update_mask, body, options));
|
|
22711
|
+
}
|
|
22712
|
+
async function $do(client, id, api_version, update_mask, body, options) {
|
|
22713
|
+
var _a, _b, _c;
|
|
22714
|
+
const input = {
|
|
22715
|
+
id: id,
|
|
22716
|
+
api_version: api_version,
|
|
22717
|
+
update_mask: update_mask,
|
|
22718
|
+
body: body,
|
|
22719
|
+
};
|
|
22720
|
+
const payload = input;
|
|
22721
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
22722
|
+
const pathParams = {
|
|
22723
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22724
|
+
id: encodeSimple("id", payload.id, {
|
|
22725
|
+
explode: false,
|
|
22726
|
+
charEncoding: "percent",
|
|
22727
|
+
}),
|
|
22728
|
+
};
|
|
22729
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
22730
|
+
const query = encodeFormQuery({
|
|
22731
|
+
"update_mask": payload.update_mask,
|
|
22732
|
+
});
|
|
22733
|
+
const headers = new Headers(compactMap({
|
|
22734
|
+
"Content-Type": "application/json",
|
|
22735
|
+
Accept: "application/json",
|
|
22736
|
+
}));
|
|
22737
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22738
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22739
|
+
const context = {
|
|
22740
|
+
options: client._options,
|
|
22741
|
+
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 : "",
|
|
22742
|
+
operation_id: "UpdateWebhook",
|
|
22743
|
+
o_auth2_scopes: null,
|
|
22744
|
+
resolved_security: requestSecurity,
|
|
22745
|
+
security_source: client._options.security,
|
|
22746
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22747
|
+
|| client._options.retry_config
|
|
22748
|
+
|| {
|
|
22749
|
+
strategy: "attempt-count-backoff",
|
|
22750
|
+
backoff: {
|
|
22751
|
+
initialInterval: 500,
|
|
22752
|
+
maxInterval: 8000,
|
|
22753
|
+
exponent: 2,
|
|
22754
|
+
maxElapsedTime: 30000,
|
|
22755
|
+
},
|
|
22756
|
+
retryConnectionErrors: true,
|
|
22757
|
+
maxRetries: 4,
|
|
22758
|
+
}
|
|
22759
|
+
|| { strategy: "none" },
|
|
22760
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22761
|
+
};
|
|
22762
|
+
const requestRes = client._createRequest(context, {
|
|
22763
|
+
security: requestSecurity,
|
|
22764
|
+
method: "PATCH",
|
|
22765
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22766
|
+
path: path,
|
|
22767
|
+
headers: headers,
|
|
22768
|
+
query: query,
|
|
22769
|
+
body: body$,
|
|
22770
|
+
userAgent: client._options.user_agent,
|
|
22771
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22772
|
+
}, options);
|
|
22773
|
+
if (!requestRes.ok) {
|
|
22774
|
+
return [requestRes, { status: "invalid" }];
|
|
22775
|
+
}
|
|
22776
|
+
const req = requestRes.value;
|
|
22777
|
+
const doResult = await client._do(req, {
|
|
22778
|
+
context,
|
|
22779
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22780
|
+
retryConfig: context.retry_config,
|
|
22781
|
+
retryCodes: context.retry_codes,
|
|
22782
|
+
});
|
|
22783
|
+
if (!doResult.ok) {
|
|
22784
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22785
|
+
}
|
|
22786
|
+
const response = doResult.value;
|
|
22787
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22788
|
+
if (!result.ok) {
|
|
22789
|
+
return [result, { status: "complete", request: req, response }];
|
|
22790
|
+
}
|
|
22791
|
+
return [result, { status: "complete", request: req, response }];
|
|
22792
|
+
}
|
|
22793
|
+
|
|
22794
|
+
/**
|
|
22795
|
+
* @license
|
|
22796
|
+
* Copyright 2026 Google LLC
|
|
22797
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22798
|
+
*
|
|
22799
|
+
* g3-prettier-ignore-file
|
|
22800
|
+
*/
|
|
22801
|
+
class Webhooks extends ClientSDK {
|
|
22802
|
+
/**
|
|
22803
|
+
* Creates a new Webhook.
|
|
22804
|
+
*/
|
|
22805
|
+
create(params, options) {
|
|
22806
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
22807
|
+
return unwrapAsAPIPromise(webhooksCreate(this, body, api_version, options));
|
|
22808
|
+
}
|
|
22809
|
+
/**
|
|
22810
|
+
* Lists all Webhooks.
|
|
22811
|
+
*/
|
|
22812
|
+
list(params, options) {
|
|
22813
|
+
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));
|
|
22814
|
+
}
|
|
22815
|
+
/**
|
|
22816
|
+
* Gets a specific Webhook.
|
|
22817
|
+
*/
|
|
22818
|
+
get(id, params, options) {
|
|
22819
|
+
return unwrapAsAPIPromise(webhooksGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22820
|
+
}
|
|
22821
|
+
/**
|
|
22822
|
+
* Updates an existing Webhook.
|
|
22823
|
+
*/
|
|
22824
|
+
update(id, params, options) {
|
|
22825
|
+
const _a = params !== null && params !== void 0 ? params : {}, { api_version, update_mask } = _a, body$body = __rest(_a, ["api_version", "update_mask"]);
|
|
22826
|
+
const body = params === undefined || Object.keys(body$body).length === 0
|
|
22827
|
+
? undefined
|
|
22828
|
+
: body$body;
|
|
22829
|
+
return unwrapAsAPIPromise(webhooksUpdate(this, id, api_version, update_mask, body, options));
|
|
22830
|
+
}
|
|
22831
|
+
/**
|
|
22832
|
+
* Deletes a Webhook.
|
|
22833
|
+
*/
|
|
22834
|
+
delete(id, params, options) {
|
|
22835
|
+
return unwrapAsAPIPromise(webhooksDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22836
|
+
}
|
|
22837
|
+
/**
|
|
22838
|
+
* Generates a new signing secret for a Webhook.
|
|
22839
|
+
*/
|
|
22840
|
+
rotateSigningSecret(id, api_version, body, options) {
|
|
22841
|
+
return unwrapAsAPIPromise(webhooksRotateSigningSecret(this, id, api_version, body, options));
|
|
22842
|
+
}
|
|
22843
|
+
/**
|
|
22844
|
+
* Sends a ping event to a Webhook.
|
|
22845
|
+
*/
|
|
22846
|
+
ping(id, api_version, body, options) {
|
|
22847
|
+
return unwrapAsAPIPromise(webhooksPing(this, id, api_version, body, options));
|
|
22848
|
+
}
|
|
22849
|
+
}
|
|
22850
|
+
|
|
22851
|
+
/**
|
|
22852
|
+
* @license
|
|
22853
|
+
* Copyright 2026 Google LLC
|
|
22854
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22855
|
+
*
|
|
22856
|
+
* g3-prettier-ignore-file
|
|
22857
|
+
*/
|
|
22858
|
+
/*
|
|
22859
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
22860
|
+
*/
|
|
22861
|
+
let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
|
|
22862
|
+
get interactions() {
|
|
22863
|
+
var _a;
|
|
22864
|
+
return ((_a = this._interactions) !== null && _a !== void 0 ? _a : (this._interactions = new Interactions(this._options)));
|
|
22865
|
+
}
|
|
22866
|
+
get webhooks() {
|
|
22867
|
+
var _a;
|
|
22868
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Webhooks(this._options)));
|
|
22869
|
+
}
|
|
22870
|
+
get agents() {
|
|
22871
|
+
var _a;
|
|
22872
|
+
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Agents(this._options)));
|
|
22873
|
+
}
|
|
22874
|
+
get triggers() {
|
|
22875
|
+
var _a;
|
|
22876
|
+
return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Triggers(this._options)));
|
|
22877
|
+
}
|
|
22878
|
+
};
|
|
22879
|
+
|
|
22880
|
+
/**
|
|
22881
|
+
* @license
|
|
22882
|
+
* Copyright 2026 Google LLC
|
|
22883
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22884
|
+
*
|
|
22885
|
+
* g3-prettier-ignore-file
|
|
22886
|
+
*/
|
|
22887
|
+
const LEGACY_LYRIA_MODELS = new Set([
|
|
22888
|
+
"lyria-3-pro-preview",
|
|
22889
|
+
"lyria-3-clip-preview",
|
|
22890
|
+
]);
|
|
22891
|
+
function getGoogleGenAIServerURL(parentClient) {
|
|
22892
|
+
const serverURL = parentClient.getBaseUrl();
|
|
22893
|
+
if (!serverURL) {
|
|
22894
|
+
throw new Error("Base URL must be set.");
|
|
22895
|
+
}
|
|
22896
|
+
return serverURL.replace(/\/+$/, "");
|
|
22897
|
+
}
|
|
22898
|
+
function getGoogleGenAIAPIVersion(parentClient) {
|
|
22899
|
+
const apiVersion = trimSlashes(parentClient.getApiVersion());
|
|
22900
|
+
const project = parentClient.getProject();
|
|
22901
|
+
const location = parentClient.getLocation();
|
|
22902
|
+
if (parentClient.isVertexAI() && apiVersion && project && location) {
|
|
22903
|
+
return (`${apiVersion}/projects/${encodeURIComponent(project)}` +
|
|
22904
|
+
`/locations/${encodeURIComponent(location)}`);
|
|
22905
|
+
}
|
|
22906
|
+
return apiVersion;
|
|
22907
|
+
}
|
|
22908
|
+
function buildGoogleGenAIClient(parentClient, options = {}) {
|
|
22909
|
+
var _a, _b, _c, _d, _e;
|
|
22910
|
+
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({
|
|
22911
|
+
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)),
|
|
22912
|
+
getAuthHeaders: (url) => parentClient.getAuthHeaders(url),
|
|
22913
|
+
}), server_url: (_e = options.server_url) !== null && _e !== void 0 ? _e : getGoogleGenAIServerURL(parentClient) }));
|
|
22914
|
+
return sdk;
|
|
22915
|
+
}
|
|
22916
|
+
class GeminiNextGenInteractions {
|
|
22917
|
+
constructor(parentClient) {
|
|
22918
|
+
this.parentClient = parentClient;
|
|
22919
|
+
}
|
|
22920
|
+
async create(params, options) {
|
|
22921
|
+
const { api_version } = params, request = __rest(params, ["api_version"]);
|
|
22922
|
+
if (request.stream === true) {
|
|
22923
|
+
const response = await wrapSDKCall(() => this.getClient(api_version).interactions.create(Object.assign(Object.assign({}, request), { stream: true, api_version }), toGoogleGenAIRequestOptions(options, true)));
|
|
22924
|
+
return wrapStreamErrors(response);
|
|
22925
|
+
}
|
|
22926
|
+
const response = await unwrapWithSdkHttpResponse(interactionsCreate(this.getClient(api_version), request, api_version, toGoogleGenAIRequestOptions(options)));
|
|
22227
22927
|
return addOutputPropertiesIfInteraction(response);
|
|
22228
22928
|
}
|
|
22229
22929
|
async get(id, params = {}, options) {
|
|
@@ -22317,6 +23017,46 @@ class GeminiNextGenWebhooks {
|
|
|
22317
23017
|
return this.sdk;
|
|
22318
23018
|
}
|
|
22319
23019
|
}
|
|
23020
|
+
class GeminiNextGenTriggers {
|
|
23021
|
+
constructor(parentClient) {
|
|
23022
|
+
this.parentClient = parentClient;
|
|
23023
|
+
}
|
|
23024
|
+
async create(params, options) {
|
|
23025
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
23026
|
+
return unwrapWithSdkHttpResponse(triggersCreate(this.getClient(api_version), body, api_version, toGoogleGenAIRequestOptions(options)));
|
|
23027
|
+
}
|
|
23028
|
+
async list(params = {}, options) {
|
|
23029
|
+
const { api_version, filter, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
|
|
23030
|
+
return unwrapWithSdkHttpResponse(triggersList(this.getClient(api_version), api_version, filter, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
|
|
23031
|
+
}
|
|
23032
|
+
async get(id, params = {}, options) {
|
|
23033
|
+
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)));
|
|
23034
|
+
}
|
|
23035
|
+
async update(id, params, options) {
|
|
23036
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
23037
|
+
return unwrapWithSdkHttpResponse(triggersUpdate(this.getClient(api_version), id, body, api_version, toGoogleGenAIRequestOptions(options)));
|
|
23038
|
+
}
|
|
23039
|
+
async delete(id, params = {}, options) {
|
|
23040
|
+
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)));
|
|
23041
|
+
}
|
|
23042
|
+
async run(trigger_id, params = {}, options) {
|
|
23043
|
+
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)));
|
|
23044
|
+
}
|
|
23045
|
+
async listExecutions(trigger_id, params = {}, options) {
|
|
23046
|
+
const { api_version, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
|
|
23047
|
+
return unwrapWithSdkHttpResponse(triggersListExecutions(this.getClient(api_version), trigger_id, api_version, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
|
|
23048
|
+
}
|
|
23049
|
+
getClient(apiVersion) {
|
|
23050
|
+
var _a;
|
|
23051
|
+
if (apiVersion) {
|
|
23052
|
+
return buildGoogleGenAIClient(this.parentClient, {
|
|
23053
|
+
api_version: apiVersion,
|
|
23054
|
+
});
|
|
23055
|
+
}
|
|
23056
|
+
(_a = this.sdk) !== null && _a !== void 0 ? _a : (this.sdk = buildGoogleGenAIClient(this.parentClient));
|
|
23057
|
+
return this.sdk;
|
|
23058
|
+
}
|
|
23059
|
+
}
|
|
22320
23060
|
function trimSlashes(value) {
|
|
22321
23061
|
return value.replace(/^\/+|\/+$/g, "");
|
|
22322
23062
|
}
|
|
@@ -24999,6 +25739,14 @@ class GoogleGenAI {
|
|
|
24999
25739
|
this._agents = new GeminiNextGenAgents(this.apiClient);
|
|
25000
25740
|
return this._agents;
|
|
25001
25741
|
}
|
|
25742
|
+
get triggers() {
|
|
25743
|
+
if (this._triggers !== undefined) {
|
|
25744
|
+
return this._triggers;
|
|
25745
|
+
}
|
|
25746
|
+
console.warn('GoogleGenAI.triggers: Triggers usage is experimental and may change in future versions.');
|
|
25747
|
+
this._triggers = new GeminiNextGenTriggers(this.apiClient);
|
|
25748
|
+
return this._triggers;
|
|
25749
|
+
}
|
|
25002
25750
|
constructor(options) {
|
|
25003
25751
|
var _a, _b, _c, _d;
|
|
25004
25752
|
// Validate explicitly set initializer values.
|