@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.mjs
CHANGED
|
@@ -9718,6 +9718,18 @@ function contentEmbeddingStatisticsFromVertex(fromObject, _rootObject) {
|
|
|
9718
9718
|
if (fromTokenCount != null) {
|
|
9719
9719
|
setValueByPath(toObject, ['tokenCount'], fromTokenCount);
|
|
9720
9720
|
}
|
|
9721
|
+
const fromTokensDetails = getValueByPath(fromObject, [
|
|
9722
|
+
'tokensDetails',
|
|
9723
|
+
]);
|
|
9724
|
+
if (fromTokensDetails != null) {
|
|
9725
|
+
let transformedList = fromTokensDetails;
|
|
9726
|
+
if (Array.isArray(transformedList)) {
|
|
9727
|
+
transformedList = transformedList.map((item) => {
|
|
9728
|
+
return item;
|
|
9729
|
+
});
|
|
9730
|
+
}
|
|
9731
|
+
setValueByPath(toObject, ['tokensDetails'], transformedList);
|
|
9732
|
+
}
|
|
9721
9733
|
return toObject;
|
|
9722
9734
|
}
|
|
9723
9735
|
function contentToMldev$1(fromObject, rootObject) {
|
|
@@ -10347,6 +10359,10 @@ function embedContentResponseFromVertex(fromObject, rootObject) {
|
|
|
10347
10359
|
usageMetadata['promptTokenCount']) {
|
|
10348
10360
|
stats.tokenCount = usageMetadata['promptTokenCount'];
|
|
10349
10361
|
}
|
|
10362
|
+
if (usageMetadata &&
|
|
10363
|
+
usageMetadata['promptTokensDetails']) {
|
|
10364
|
+
stats.tokensDetails = usageMetadata['promptTokensDetails'];
|
|
10365
|
+
}
|
|
10350
10366
|
if (truncated) {
|
|
10351
10367
|
stats.truncated = truncated;
|
|
10352
10368
|
}
|
|
@@ -13502,7 +13518,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
13502
13518
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
13503
13519
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
13504
13520
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
13505
|
-
const SDK_VERSION = '2.
|
|
13521
|
+
const SDK_VERSION = '2.12.0'; // x-release-please-version
|
|
13506
13522
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
13507
13523
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
13508
13524
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -20515,9 +20531,9 @@ function unwrapAsAPIPromise(p) {
|
|
|
20515
20531
|
* Creates a new Agent (Typed version for SDK).
|
|
20516
20532
|
*/
|
|
20517
20533
|
function agentsCreate(client, body, api_version, options) {
|
|
20518
|
-
return new APIPromise($do$
|
|
20534
|
+
return new APIPromise($do$l(client, body, api_version, options));
|
|
20519
20535
|
}
|
|
20520
|
-
async function $do$
|
|
20536
|
+
async function $do$l(client, body, api_version, options) {
|
|
20521
20537
|
var _a, _b, _c;
|
|
20522
20538
|
const input = {
|
|
20523
20539
|
body: body,
|
|
@@ -20600,9 +20616,9 @@ async function $do$e(client, body, api_version, options) {
|
|
|
20600
20616
|
* Deletes an Agent.
|
|
20601
20617
|
*/
|
|
20602
20618
|
function agentsDelete(client, id, api_version, options) {
|
|
20603
|
-
return new APIPromise($do$
|
|
20619
|
+
return new APIPromise($do$k(client, id, api_version, options));
|
|
20604
20620
|
}
|
|
20605
|
-
async function $do$
|
|
20621
|
+
async function $do$k(client, id, api_version, options) {
|
|
20606
20622
|
var _a, _b, _c;
|
|
20607
20623
|
const input = {
|
|
20608
20624
|
id: id,
|
|
@@ -20688,9 +20704,9 @@ async function $do$d(client, id, api_version, options) {
|
|
|
20688
20704
|
* Gets a specific Agent.
|
|
20689
20705
|
*/
|
|
20690
20706
|
function agentsGet(client, id, api_version, options) {
|
|
20691
|
-
return new APIPromise($do$
|
|
20707
|
+
return new APIPromise($do$j(client, id, api_version, options));
|
|
20692
20708
|
}
|
|
20693
|
-
async function $do$
|
|
20709
|
+
async function $do$j(client, id, api_version, options) {
|
|
20694
20710
|
var _a, _b, _c;
|
|
20695
20711
|
const input = {
|
|
20696
20712
|
id: id,
|
|
@@ -20776,9 +20792,9 @@ async function $do$c(client, id, api_version, options) {
|
|
|
20776
20792
|
* Lists all Agents.
|
|
20777
20793
|
*/
|
|
20778
20794
|
function agentsList(client, api_version, page_size, page_token, parent, options) {
|
|
20779
|
-
return new APIPromise($do$
|
|
20795
|
+
return new APIPromise($do$i(client, api_version, page_size, page_token, parent, options));
|
|
20780
20796
|
}
|
|
20781
|
-
async function $do$
|
|
20797
|
+
async function $do$i(client, api_version, page_size, page_token, parent, options) {
|
|
20782
20798
|
var _a, _b, _c;
|
|
20783
20799
|
const input = {
|
|
20784
20800
|
api_version: api_version,
|
|
@@ -21050,9 +21066,9 @@ class GetInteractionByIdClientError extends GoogleGenAiError {
|
|
|
21050
21066
|
* Cancels an interaction by id. This only applies to background interactions that are still running.
|
|
21051
21067
|
*/
|
|
21052
21068
|
function interactionsCancel(client, id, api_version, options) {
|
|
21053
|
-
return new APIPromise($do$
|
|
21069
|
+
return new APIPromise($do$h(client, id, api_version, options));
|
|
21054
21070
|
}
|
|
21055
|
-
async function $do$
|
|
21071
|
+
async function $do$h(client, id, api_version, options) {
|
|
21056
21072
|
var _a, _b, _c;
|
|
21057
21073
|
const input = {
|
|
21058
21074
|
id: id,
|
|
@@ -21138,9 +21154,9 @@ async function $do$a(client, id, api_version, options) {
|
|
|
21138
21154
|
* g3-prettier-ignore-file
|
|
21139
21155
|
*/
|
|
21140
21156
|
function interactionsCreate(client, body, api_version, options) {
|
|
21141
|
-
return new APIPromise($do$
|
|
21157
|
+
return new APIPromise($do$g(client, body, api_version, options));
|
|
21142
21158
|
}
|
|
21143
|
-
async function $do$
|
|
21159
|
+
async function $do$g(client, body, api_version, options) {
|
|
21144
21160
|
var _a, _b, _c, _d;
|
|
21145
21161
|
const input = {
|
|
21146
21162
|
body: body,
|
|
@@ -21232,9 +21248,9 @@ async function $do$9(client, body, api_version, options) {
|
|
|
21232
21248
|
* Deletes the interaction by id.
|
|
21233
21249
|
*/
|
|
21234
21250
|
function interactionsDelete(client, id, api_version, options) {
|
|
21235
|
-
return new APIPromise($do$
|
|
21251
|
+
return new APIPromise($do$f(client, id, api_version, options));
|
|
21236
21252
|
}
|
|
21237
|
-
async function $do$
|
|
21253
|
+
async function $do$f(client, id, api_version, options) {
|
|
21238
21254
|
var _a, _b, _c;
|
|
21239
21255
|
const input = {
|
|
21240
21256
|
id: id,
|
|
@@ -21320,9 +21336,9 @@ async function $do$8(client, id, api_version, options) {
|
|
|
21320
21336
|
* g3-prettier-ignore-file
|
|
21321
21337
|
*/
|
|
21322
21338
|
function interactionsGet(client, id, stream, last_event_id, include_input, api_version, options) {
|
|
21323
|
-
return new APIPromise($do$
|
|
21339
|
+
return new APIPromise($do$e(client, id, stream, last_event_id, include_input, api_version, options));
|
|
21324
21340
|
}
|
|
21325
|
-
async function $do$
|
|
21341
|
+
async function $do$e(client, id, stream, last_event_id, include_input, api_version, options) {
|
|
21326
21342
|
var _a, _b, _c;
|
|
21327
21343
|
const input = {
|
|
21328
21344
|
id: id,
|
|
@@ -21455,12 +21471,12 @@ class Interactions extends ClientSDK {
|
|
|
21455
21471
|
* g3-prettier-ignore-file
|
|
21456
21472
|
*/
|
|
21457
21473
|
/**
|
|
21458
|
-
* Creates a new
|
|
21474
|
+
* Creates a new trigger that will invoke the specified agent on the given cron schedule.
|
|
21459
21475
|
*/
|
|
21460
|
-
function
|
|
21461
|
-
return new APIPromise($do$
|
|
21476
|
+
function triggersCreate(client, body, api_version, options) {
|
|
21477
|
+
return new APIPromise($do$d(client, body, api_version, options));
|
|
21462
21478
|
}
|
|
21463
|
-
async function $do$
|
|
21479
|
+
async function $do$d(client, body, api_version, options) {
|
|
21464
21480
|
var _a, _b, _c;
|
|
21465
21481
|
const input = {
|
|
21466
21482
|
body: body,
|
|
@@ -21471,7 +21487,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
21471
21487
|
const pathParams = {
|
|
21472
21488
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21473
21489
|
};
|
|
21474
|
-
const path = pathToFunc("/{api_version}/
|
|
21490
|
+
const path = pathToFunc("/{api_version}/triggers")(pathParams);
|
|
21475
21491
|
const headers = new Headers(compactMap({
|
|
21476
21492
|
"Content-Type": "application/json",
|
|
21477
21493
|
Accept: "application/json",
|
|
@@ -21481,7 +21497,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
21481
21497
|
const context = {
|
|
21482
21498
|
options: client._options,
|
|
21483
21499
|
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 : "",
|
|
21484
|
-
operation_id: "
|
|
21500
|
+
operation_id: "CreateTrigger",
|
|
21485
21501
|
o_auth2_scopes: null,
|
|
21486
21502
|
resolved_security: requestSecurity,
|
|
21487
21503
|
security_source: client._options.security,
|
|
@@ -21525,7 +21541,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
21525
21541
|
return [doResult, { status: "request-error", request: req }];
|
|
21526
21542
|
}
|
|
21527
21543
|
const response = doResult.value;
|
|
21528
|
-
const [result] = await match(
|
|
21544
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21529
21545
|
if (!result.ok) {
|
|
21530
21546
|
return [result, { status: "complete", request: req, response }];
|
|
21531
21547
|
}
|
|
@@ -21540,12 +21556,12 @@ async function $do$6(client, body, api_version, options) {
|
|
|
21540
21556
|
* g3-prettier-ignore-file
|
|
21541
21557
|
*/
|
|
21542
21558
|
/**
|
|
21543
|
-
* Deletes a
|
|
21559
|
+
* Deletes a trigger.
|
|
21544
21560
|
*/
|
|
21545
|
-
function
|
|
21546
|
-
return new APIPromise($do$
|
|
21561
|
+
function triggersDelete(client, id, api_version, options) {
|
|
21562
|
+
return new APIPromise($do$c(client, id, api_version, options));
|
|
21547
21563
|
}
|
|
21548
|
-
async function $do$
|
|
21564
|
+
async function $do$c(client, id, api_version, options) {
|
|
21549
21565
|
var _a, _b, _c;
|
|
21550
21566
|
const input = {
|
|
21551
21567
|
id: id,
|
|
@@ -21560,7 +21576,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
21560
21576
|
charEncoding: "percent",
|
|
21561
21577
|
}),
|
|
21562
21578
|
};
|
|
21563
|
-
const path = pathToFunc("/{api_version}/
|
|
21579
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
21564
21580
|
const headers = new Headers(compactMap({
|
|
21565
21581
|
Accept: "application/json",
|
|
21566
21582
|
}));
|
|
@@ -21569,7 +21585,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
21569
21585
|
const context = {
|
|
21570
21586
|
options: client._options,
|
|
21571
21587
|
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 : "",
|
|
21572
|
-
operation_id: "
|
|
21588
|
+
operation_id: "DeleteTrigger",
|
|
21573
21589
|
o_auth2_scopes: null,
|
|
21574
21590
|
resolved_security: requestSecurity,
|
|
21575
21591
|
security_source: client._options.security,
|
|
@@ -21613,7 +21629,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
21613
21629
|
return [doResult, { status: "request-error", request: req }];
|
|
21614
21630
|
}
|
|
21615
21631
|
const response = doResult.value;
|
|
21616
|
-
const [result] = await match(
|
|
21632
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21617
21633
|
if (!result.ok) {
|
|
21618
21634
|
return [result, { status: "complete", request: req, response }];
|
|
21619
21635
|
}
|
|
@@ -21628,12 +21644,12 @@ async function $do$5(client, id, api_version, options) {
|
|
|
21628
21644
|
* g3-prettier-ignore-file
|
|
21629
21645
|
*/
|
|
21630
21646
|
/**
|
|
21631
|
-
* Gets a
|
|
21647
|
+
* Gets details of a single trigger.
|
|
21632
21648
|
*/
|
|
21633
|
-
function
|
|
21634
|
-
return new APIPromise($do$
|
|
21649
|
+
function triggersGet(client, id, api_version, options) {
|
|
21650
|
+
return new APIPromise($do$b(client, id, api_version, options));
|
|
21635
21651
|
}
|
|
21636
|
-
async function $do$
|
|
21652
|
+
async function $do$b(client, id, api_version, options) {
|
|
21637
21653
|
var _a, _b, _c;
|
|
21638
21654
|
const input = {
|
|
21639
21655
|
id: id,
|
|
@@ -21648,7 +21664,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
21648
21664
|
charEncoding: "percent",
|
|
21649
21665
|
}),
|
|
21650
21666
|
};
|
|
21651
|
-
const path = pathToFunc("/{api_version}/
|
|
21667
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
21652
21668
|
const headers = new Headers(compactMap({
|
|
21653
21669
|
Accept: "application/json",
|
|
21654
21670
|
}));
|
|
@@ -21657,7 +21673,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
21657
21673
|
const context = {
|
|
21658
21674
|
options: client._options,
|
|
21659
21675
|
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 : "",
|
|
21660
|
-
operation_id: "
|
|
21676
|
+
operation_id: "GetTrigger",
|
|
21661
21677
|
o_auth2_scopes: null,
|
|
21662
21678
|
resolved_security: requestSecurity,
|
|
21663
21679
|
security_source: client._options.security,
|
|
@@ -21701,7 +21717,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
21701
21717
|
return [doResult, { status: "request-error", request: req }];
|
|
21702
21718
|
}
|
|
21703
21719
|
const response = doResult.value;
|
|
21704
|
-
const [result] = await match(
|
|
21720
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21705
21721
|
if (!result.ok) {
|
|
21706
21722
|
return [result, { status: "complete", request: req, response }];
|
|
21707
21723
|
}
|
|
@@ -21716,14 +21732,15 @@ async function $do$4(client, id, api_version, options) {
|
|
|
21716
21732
|
* g3-prettier-ignore-file
|
|
21717
21733
|
*/
|
|
21718
21734
|
/**
|
|
21719
|
-
* Lists
|
|
21735
|
+
* Lists executions for a trigger.
|
|
21720
21736
|
*/
|
|
21721
|
-
function
|
|
21722
|
-
return new APIPromise($do$
|
|
21737
|
+
function triggersListExecutions(client, trigger_id, api_version, page_size, page_token, options) {
|
|
21738
|
+
return new APIPromise($do$a(client, trigger_id, api_version, page_size, page_token, options));
|
|
21723
21739
|
}
|
|
21724
|
-
async function $do$
|
|
21740
|
+
async function $do$a(client, trigger_id, api_version, page_size, page_token, options) {
|
|
21725
21741
|
var _a, _b, _c;
|
|
21726
21742
|
const input = {
|
|
21743
|
+
trigger_id: trigger_id,
|
|
21727
21744
|
api_version: api_version,
|
|
21728
21745
|
page_size: page_size,
|
|
21729
21746
|
page_token: page_token,
|
|
@@ -21731,12 +21748,16 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
21731
21748
|
const payload = input;
|
|
21732
21749
|
const body = null;
|
|
21733
21750
|
const pathParams = {
|
|
21734
|
-
api_version: encodeSimple("api_version", (_a = payload
|
|
21751
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21752
|
+
trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
|
|
21753
|
+
explode: false,
|
|
21754
|
+
charEncoding: "percent",
|
|
21755
|
+
}),
|
|
21735
21756
|
};
|
|
21736
|
-
const path = pathToFunc("/{api_version}/
|
|
21757
|
+
const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
|
|
21737
21758
|
const query = encodeFormQuery({
|
|
21738
|
-
"page_size": payload
|
|
21739
|
-
"page_token": payload
|
|
21759
|
+
"page_size": payload.page_size,
|
|
21760
|
+
"page_token": payload.page_token,
|
|
21740
21761
|
});
|
|
21741
21762
|
const headers = new Headers(compactMap({
|
|
21742
21763
|
Accept: "application/json",
|
|
@@ -21746,7 +21767,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
21746
21767
|
const context = {
|
|
21747
21768
|
options: client._options,
|
|
21748
21769
|
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 : "",
|
|
21749
|
-
operation_id: "
|
|
21770
|
+
operation_id: "ListTriggerExecutions",
|
|
21750
21771
|
o_auth2_scopes: null,
|
|
21751
21772
|
resolved_security: requestSecurity,
|
|
21752
21773
|
security_source: client._options.security,
|
|
@@ -21791,7 +21812,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
21791
21812
|
return [doResult, { status: "request-error", request: req }];
|
|
21792
21813
|
}
|
|
21793
21814
|
const response = doResult.value;
|
|
21794
|
-
const [result] = await match(
|
|
21815
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21795
21816
|
if (!result.ok) {
|
|
21796
21817
|
return [result, { status: "complete", request: req, response }];
|
|
21797
21818
|
}
|
|
@@ -21806,30 +21827,31 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
21806
21827
|
* g3-prettier-ignore-file
|
|
21807
21828
|
*/
|
|
21808
21829
|
/**
|
|
21809
|
-
*
|
|
21830
|
+
* Lists triggers for a project.
|
|
21810
21831
|
*/
|
|
21811
|
-
function
|
|
21812
|
-
return new APIPromise($do$
|
|
21832
|
+
function triggersList(client, api_version, filter, page_size, page_token, options) {
|
|
21833
|
+
return new APIPromise($do$9(client, api_version, filter, page_size, page_token, options));
|
|
21813
21834
|
}
|
|
21814
|
-
async function $do$
|
|
21835
|
+
async function $do$9(client, api_version, filter, page_size, page_token, options) {
|
|
21815
21836
|
var _a, _b, _c;
|
|
21816
21837
|
const input = {
|
|
21817
|
-
id: id,
|
|
21818
21838
|
api_version: api_version,
|
|
21819
|
-
|
|
21839
|
+
filter: filter,
|
|
21840
|
+
page_size: page_size,
|
|
21841
|
+
page_token: page_token,
|
|
21820
21842
|
};
|
|
21821
21843
|
const payload = input;
|
|
21822
|
-
const body
|
|
21844
|
+
const body = null;
|
|
21823
21845
|
const pathParams = {
|
|
21824
|
-
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21825
|
-
id: encodeSimple("id", payload.id, {
|
|
21826
|
-
explode: false,
|
|
21827
|
-
charEncoding: "percent",
|
|
21828
|
-
}),
|
|
21846
|
+
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" }),
|
|
21829
21847
|
};
|
|
21830
|
-
const path = pathToFunc("/{api_version}/
|
|
21848
|
+
const path = pathToFunc("/{api_version}/triggers")(pathParams);
|
|
21849
|
+
const query = encodeFormQuery({
|
|
21850
|
+
"filter": payload === null || payload === void 0 ? void 0 : payload.filter,
|
|
21851
|
+
"page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
|
|
21852
|
+
"page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
|
|
21853
|
+
});
|
|
21831
21854
|
const headers = new Headers(compactMap({
|
|
21832
|
-
"Content-Type": "application/json",
|
|
21833
21855
|
Accept: "application/json",
|
|
21834
21856
|
}));
|
|
21835
21857
|
const securityInput = await extractSecurity(client._options.security);
|
|
@@ -21837,7 +21859,7 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
21837
21859
|
const context = {
|
|
21838
21860
|
options: client._options,
|
|
21839
21861
|
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 : "",
|
|
21840
|
-
operation_id: "
|
|
21862
|
+
operation_id: "ListTriggers",
|
|
21841
21863
|
o_auth2_scopes: null,
|
|
21842
21864
|
resolved_security: requestSecurity,
|
|
21843
21865
|
security_source: client._options.security,
|
|
@@ -21859,11 +21881,12 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
21859
21881
|
};
|
|
21860
21882
|
const requestRes = client._createRequest(context, {
|
|
21861
21883
|
security: requestSecurity,
|
|
21862
|
-
method: "
|
|
21884
|
+
method: "GET",
|
|
21863
21885
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
21864
21886
|
path: path,
|
|
21865
21887
|
headers: headers,
|
|
21866
|
-
|
|
21888
|
+
query: query,
|
|
21889
|
+
body: body,
|
|
21867
21890
|
userAgent: client._options.user_agent,
|
|
21868
21891
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
21869
21892
|
}, options);
|
|
@@ -21881,7 +21904,7 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
21881
21904
|
return [doResult, { status: "request-error", request: req }];
|
|
21882
21905
|
}
|
|
21883
21906
|
const response = doResult.value;
|
|
21884
|
-
const [result] = await match(
|
|
21907
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21885
21908
|
if (!result.ok) {
|
|
21886
21909
|
return [result, { status: "complete", request: req, response }];
|
|
21887
21910
|
}
|
|
@@ -21896,30 +21919,28 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
21896
21919
|
* g3-prettier-ignore-file
|
|
21897
21920
|
*/
|
|
21898
21921
|
/**
|
|
21899
|
-
*
|
|
21922
|
+
* Runs a trigger immediately.
|
|
21900
21923
|
*/
|
|
21901
|
-
function
|
|
21902
|
-
return new APIPromise($do$
|
|
21924
|
+
function triggersRun(client, trigger_id, api_version, options) {
|
|
21925
|
+
return new APIPromise($do$8(client, trigger_id, api_version, options));
|
|
21903
21926
|
}
|
|
21904
|
-
async function $do$
|
|
21927
|
+
async function $do$8(client, trigger_id, api_version, options) {
|
|
21905
21928
|
var _a, _b, _c;
|
|
21906
21929
|
const input = {
|
|
21907
|
-
|
|
21930
|
+
trigger_id: trigger_id,
|
|
21908
21931
|
api_version: api_version,
|
|
21909
|
-
body: body,
|
|
21910
21932
|
};
|
|
21911
21933
|
const payload = input;
|
|
21912
|
-
const body
|
|
21934
|
+
const body = null;
|
|
21913
21935
|
const pathParams = {
|
|
21914
21936
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
21915
|
-
|
|
21937
|
+
trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
|
|
21916
21938
|
explode: false,
|
|
21917
21939
|
charEncoding: "percent",
|
|
21918
21940
|
}),
|
|
21919
21941
|
};
|
|
21920
|
-
const path = pathToFunc("/{api_version}/
|
|
21942
|
+
const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
|
|
21921
21943
|
const headers = new Headers(compactMap({
|
|
21922
|
-
"Content-Type": "application/json",
|
|
21923
21944
|
Accept: "application/json",
|
|
21924
21945
|
}));
|
|
21925
21946
|
const securityInput = await extractSecurity(client._options.security);
|
|
@@ -21927,7 +21948,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
21927
21948
|
const context = {
|
|
21928
21949
|
options: client._options,
|
|
21929
21950
|
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 : "",
|
|
21930
|
-
operation_id: "
|
|
21951
|
+
operation_id: "RunTrigger",
|
|
21931
21952
|
o_auth2_scopes: null,
|
|
21932
21953
|
resolved_security: requestSecurity,
|
|
21933
21954
|
security_source: client._options.security,
|
|
@@ -21953,7 +21974,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
21953
21974
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
21954
21975
|
path: path,
|
|
21955
21976
|
headers: headers,
|
|
21956
|
-
body: body
|
|
21977
|
+
body: body,
|
|
21957
21978
|
userAgent: client._options.user_agent,
|
|
21958
21979
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
21959
21980
|
}, options);
|
|
@@ -21971,7 +21992,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
21971
21992
|
return [doResult, { status: "request-error", request: req }];
|
|
21972
21993
|
}
|
|
21973
21994
|
const response = doResult.value;
|
|
21974
|
-
const [result] = await match(
|
|
21995
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
21975
21996
|
if (!result.ok) {
|
|
21976
21997
|
return [result, { status: "complete", request: req, response }];
|
|
21977
21998
|
}
|
|
@@ -21986,18 +22007,17 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
21986
22007
|
* g3-prettier-ignore-file
|
|
21987
22008
|
*/
|
|
21988
22009
|
/**
|
|
21989
|
-
* Updates
|
|
22010
|
+
* Updates a trigger.
|
|
21990
22011
|
*/
|
|
21991
|
-
function
|
|
21992
|
-
return new APIPromise($do(client, id,
|
|
22012
|
+
function triggersUpdate(client, id, body, api_version, options) {
|
|
22013
|
+
return new APIPromise($do$7(client, id, body, api_version, options));
|
|
21993
22014
|
}
|
|
21994
|
-
async function $do(client, id,
|
|
22015
|
+
async function $do$7(client, id, body, api_version, options) {
|
|
21995
22016
|
var _a, _b, _c;
|
|
21996
22017
|
const input = {
|
|
21997
22018
|
id: id,
|
|
21998
|
-
api_version: api_version,
|
|
21999
|
-
update_mask: update_mask,
|
|
22000
22019
|
body: body,
|
|
22020
|
+
api_version: api_version,
|
|
22001
22021
|
};
|
|
22002
22022
|
const payload = input;
|
|
22003
22023
|
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
@@ -22008,10 +22028,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22008
22028
|
charEncoding: "percent",
|
|
22009
22029
|
}),
|
|
22010
22030
|
};
|
|
22011
|
-
const path = pathToFunc("/{api_version}/
|
|
22012
|
-
const query = encodeFormQuery({
|
|
22013
|
-
"update_mask": payload.update_mask,
|
|
22014
|
-
});
|
|
22031
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
22015
22032
|
const headers = new Headers(compactMap({
|
|
22016
22033
|
"Content-Type": "application/json",
|
|
22017
22034
|
Accept: "application/json",
|
|
@@ -22021,7 +22038,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22021
22038
|
const context = {
|
|
22022
22039
|
options: client._options,
|
|
22023
22040
|
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 : "",
|
|
22024
|
-
operation_id: "
|
|
22041
|
+
operation_id: "UpdateTrigger",
|
|
22025
22042
|
o_auth2_scopes: null,
|
|
22026
22043
|
resolved_security: requestSecurity,
|
|
22027
22044
|
security_source: client._options.security,
|
|
@@ -22047,7 +22064,6 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22047
22064
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22048
22065
|
path: path,
|
|
22049
22066
|
headers: headers,
|
|
22050
|
-
query: query,
|
|
22051
22067
|
body: body$,
|
|
22052
22068
|
userAgent: client._options.user_agent,
|
|
22053
22069
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
@@ -22066,7 +22082,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22066
22082
|
return [doResult, { status: "request-error", request: req }];
|
|
22067
22083
|
}
|
|
22068
22084
|
const response = doResult.value;
|
|
22069
|
-
const [result] = await match(
|
|
22085
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
22070
22086
|
if (!result.ok) {
|
|
22071
22087
|
return [result, { status: "complete", request: req, response }];
|
|
22072
22088
|
}
|
|
@@ -22080,53 +22096,50 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
22080
22096
|
*
|
|
22081
22097
|
* g3-prettier-ignore-file
|
|
22082
22098
|
*/
|
|
22083
|
-
class
|
|
22099
|
+
class Triggers extends ClientSDK {
|
|
22084
22100
|
/**
|
|
22085
|
-
* Creates a new
|
|
22101
|
+
* Creates a new trigger that will invoke the specified agent on the given cron schedule.
|
|
22086
22102
|
*/
|
|
22087
22103
|
create(params, options) {
|
|
22088
22104
|
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
22089
|
-
return unwrapAsAPIPromise(
|
|
22105
|
+
return unwrapAsAPIPromise(triggersCreate(this, body, api_version, options));
|
|
22090
22106
|
}
|
|
22091
22107
|
/**
|
|
22092
|
-
* Lists
|
|
22108
|
+
* Lists triggers for a project.
|
|
22093
22109
|
*/
|
|
22094
22110
|
list(params, options) {
|
|
22095
|
-
return unwrapAsAPIPromise(
|
|
22111
|
+
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));
|
|
22096
22112
|
}
|
|
22097
22113
|
/**
|
|
22098
|
-
* Gets a
|
|
22114
|
+
* Gets details of a single trigger.
|
|
22099
22115
|
*/
|
|
22100
22116
|
get(id, params, options) {
|
|
22101
|
-
return unwrapAsAPIPromise(
|
|
22117
|
+
return unwrapAsAPIPromise(triggersGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22102
22118
|
}
|
|
22103
22119
|
/**
|
|
22104
|
-
* Updates
|
|
22120
|
+
* Updates a trigger.
|
|
22105
22121
|
*/
|
|
22106
22122
|
update(id, params, options) {
|
|
22107
|
-
const
|
|
22108
|
-
|
|
22109
|
-
? undefined
|
|
22110
|
-
: body$body;
|
|
22111
|
-
return unwrapAsAPIPromise(webhooksUpdate(this, id, api_version, update_mask, body, options));
|
|
22123
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
22124
|
+
return unwrapAsAPIPromise(triggersUpdate(this, id, body, api_version, options));
|
|
22112
22125
|
}
|
|
22113
22126
|
/**
|
|
22114
|
-
* Deletes a
|
|
22127
|
+
* Deletes a trigger.
|
|
22115
22128
|
*/
|
|
22116
22129
|
delete(id, params, options) {
|
|
22117
|
-
return unwrapAsAPIPromise(
|
|
22130
|
+
return unwrapAsAPIPromise(triggersDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22118
22131
|
}
|
|
22119
22132
|
/**
|
|
22120
|
-
*
|
|
22133
|
+
* Runs a trigger immediately.
|
|
22121
22134
|
*/
|
|
22122
|
-
|
|
22123
|
-
return unwrapAsAPIPromise(
|
|
22135
|
+
run(trigger_id, params, options) {
|
|
22136
|
+
return unwrapAsAPIPromise(triggersRun(this, trigger_id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22124
22137
|
}
|
|
22125
22138
|
/**
|
|
22126
|
-
*
|
|
22139
|
+
* Lists executions for a trigger.
|
|
22127
22140
|
*/
|
|
22128
|
-
|
|
22129
|
-
return unwrapAsAPIPromise(
|
|
22141
|
+
listExecutions(trigger_id, params, options) {
|
|
22142
|
+
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));
|
|
22130
22143
|
}
|
|
22131
22144
|
}
|
|
22132
22145
|
|
|
@@ -22137,23 +22150,83 @@ class Webhooks extends ClientSDK {
|
|
|
22137
22150
|
*
|
|
22138
22151
|
* g3-prettier-ignore-file
|
|
22139
22152
|
*/
|
|
22140
|
-
|
|
22141
|
-
*
|
|
22153
|
+
/**
|
|
22154
|
+
* Creates a new Webhook.
|
|
22142
22155
|
*/
|
|
22143
|
-
|
|
22144
|
-
|
|
22145
|
-
|
|
22146
|
-
|
|
22156
|
+
function webhooksCreate(client, body, api_version, options) {
|
|
22157
|
+
return new APIPromise($do$6(client, body, api_version, options));
|
|
22158
|
+
}
|
|
22159
|
+
async function $do$6(client, body, api_version, options) {
|
|
22160
|
+
var _a, _b, _c;
|
|
22161
|
+
const input = {
|
|
22162
|
+
body: body,
|
|
22163
|
+
api_version: api_version,
|
|
22164
|
+
};
|
|
22165
|
+
const payload = input;
|
|
22166
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
22167
|
+
const pathParams = {
|
|
22168
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22169
|
+
};
|
|
22170
|
+
const path = pathToFunc("/{api_version}/webhooks")(pathParams);
|
|
22171
|
+
const headers = new Headers(compactMap({
|
|
22172
|
+
"Content-Type": "application/json",
|
|
22173
|
+
Accept: "application/json",
|
|
22174
|
+
}));
|
|
22175
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22176
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22177
|
+
const context = {
|
|
22178
|
+
options: client._options,
|
|
22179
|
+
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 : "",
|
|
22180
|
+
operation_id: "CreateWebhook",
|
|
22181
|
+
o_auth2_scopes: null,
|
|
22182
|
+
resolved_security: requestSecurity,
|
|
22183
|
+
security_source: client._options.security,
|
|
22184
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22185
|
+
|| client._options.retry_config
|
|
22186
|
+
|| {
|
|
22187
|
+
strategy: "attempt-count-backoff",
|
|
22188
|
+
backoff: {
|
|
22189
|
+
initialInterval: 500,
|
|
22190
|
+
maxInterval: 8000,
|
|
22191
|
+
exponent: 2,
|
|
22192
|
+
maxElapsedTime: 30000,
|
|
22193
|
+
},
|
|
22194
|
+
retryConnectionErrors: true,
|
|
22195
|
+
maxRetries: 4,
|
|
22196
|
+
}
|
|
22197
|
+
|| { strategy: "none" },
|
|
22198
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22199
|
+
};
|
|
22200
|
+
const requestRes = client._createRequest(context, {
|
|
22201
|
+
security: requestSecurity,
|
|
22202
|
+
method: "POST",
|
|
22203
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22204
|
+
path: path,
|
|
22205
|
+
headers: headers,
|
|
22206
|
+
body: body$,
|
|
22207
|
+
userAgent: client._options.user_agent,
|
|
22208
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22209
|
+
}, options);
|
|
22210
|
+
if (!requestRes.ok) {
|
|
22211
|
+
return [requestRes, { status: "invalid" }];
|
|
22147
22212
|
}
|
|
22148
|
-
|
|
22149
|
-
|
|
22150
|
-
|
|
22213
|
+
const req = requestRes.value;
|
|
22214
|
+
const doResult = await client._do(req, {
|
|
22215
|
+
context,
|
|
22216
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22217
|
+
retryConfig: context.retry_config,
|
|
22218
|
+
retryCodes: context.retry_codes,
|
|
22219
|
+
});
|
|
22220
|
+
if (!doResult.ok) {
|
|
22221
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22151
22222
|
}
|
|
22152
|
-
|
|
22153
|
-
|
|
22154
|
-
|
|
22223
|
+
const response = doResult.value;
|
|
22224
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22225
|
+
if (!result.ok) {
|
|
22226
|
+
return [result, { status: "complete", request: req, response }];
|
|
22155
22227
|
}
|
|
22156
|
-
};
|
|
22228
|
+
return [result, { status: "complete", request: req, response }];
|
|
22229
|
+
}
|
|
22157
22230
|
|
|
22158
22231
|
/**
|
|
22159
22232
|
* @license
|
|
@@ -22162,46 +22235,673 @@ let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
|
|
|
22162
22235
|
*
|
|
22163
22236
|
* g3-prettier-ignore-file
|
|
22164
22237
|
*/
|
|
22165
|
-
|
|
22166
|
-
|
|
22167
|
-
|
|
22168
|
-
|
|
22169
|
-
|
|
22170
|
-
const serverURL = parentClient.getBaseUrl();
|
|
22171
|
-
if (!serverURL) {
|
|
22172
|
-
throw new Error("Base URL must be set.");
|
|
22173
|
-
}
|
|
22174
|
-
return serverURL.replace(/\/+$/, "");
|
|
22175
|
-
}
|
|
22176
|
-
function getGoogleGenAIAPIVersion(parentClient) {
|
|
22177
|
-
const apiVersion = trimSlashes(parentClient.getApiVersion());
|
|
22178
|
-
const project = parentClient.getProject();
|
|
22179
|
-
const location = parentClient.getLocation();
|
|
22180
|
-
if (parentClient.isVertexAI() && apiVersion && project && location) {
|
|
22181
|
-
return (`${apiVersion}/projects/${encodeURIComponent(project)}` +
|
|
22182
|
-
`/locations/${encodeURIComponent(location)}`);
|
|
22183
|
-
}
|
|
22184
|
-
return apiVersion;
|
|
22185
|
-
}
|
|
22186
|
-
function buildGoogleGenAIClient(parentClient, options = {}) {
|
|
22187
|
-
var _a, _b, _c, _d;
|
|
22188
|
-
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({
|
|
22189
|
-
defaultHeaders: (_c = parentClient.getDefaultHeaders) === null || _c === void 0 ? void 0 : _c.call(parentClient),
|
|
22190
|
-
getAuthHeaders: (url) => parentClient.getAuthHeaders(url),
|
|
22191
|
-
}), server_url: (_d = options.server_url) !== null && _d !== void 0 ? _d : getGoogleGenAIServerURL(parentClient) }));
|
|
22192
|
-
return sdk;
|
|
22238
|
+
/**
|
|
22239
|
+
* Deletes a Webhook.
|
|
22240
|
+
*/
|
|
22241
|
+
function webhooksDelete(client, id, api_version, options) {
|
|
22242
|
+
return new APIPromise($do$5(client, id, api_version, options));
|
|
22193
22243
|
}
|
|
22194
|
-
|
|
22195
|
-
|
|
22196
|
-
|
|
22197
|
-
|
|
22198
|
-
|
|
22199
|
-
|
|
22200
|
-
|
|
22201
|
-
|
|
22202
|
-
|
|
22203
|
-
}
|
|
22204
|
-
|
|
22244
|
+
async function $do$5(client, id, api_version, options) {
|
|
22245
|
+
var _a, _b, _c;
|
|
22246
|
+
const input = {
|
|
22247
|
+
id: id,
|
|
22248
|
+
api_version: api_version,
|
|
22249
|
+
};
|
|
22250
|
+
const payload = input;
|
|
22251
|
+
const body = null;
|
|
22252
|
+
const pathParams = {
|
|
22253
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22254
|
+
id: encodeSimple("id", payload.id, {
|
|
22255
|
+
explode: false,
|
|
22256
|
+
charEncoding: "percent",
|
|
22257
|
+
}),
|
|
22258
|
+
};
|
|
22259
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
22260
|
+
const headers = new Headers(compactMap({
|
|
22261
|
+
Accept: "application/json",
|
|
22262
|
+
}));
|
|
22263
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22264
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22265
|
+
const context = {
|
|
22266
|
+
options: client._options,
|
|
22267
|
+
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 : "",
|
|
22268
|
+
operation_id: "DeleteWebhook",
|
|
22269
|
+
o_auth2_scopes: null,
|
|
22270
|
+
resolved_security: requestSecurity,
|
|
22271
|
+
security_source: client._options.security,
|
|
22272
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22273
|
+
|| client._options.retry_config
|
|
22274
|
+
|| {
|
|
22275
|
+
strategy: "attempt-count-backoff",
|
|
22276
|
+
backoff: {
|
|
22277
|
+
initialInterval: 500,
|
|
22278
|
+
maxInterval: 8000,
|
|
22279
|
+
exponent: 2,
|
|
22280
|
+
maxElapsedTime: 30000,
|
|
22281
|
+
},
|
|
22282
|
+
retryConnectionErrors: true,
|
|
22283
|
+
maxRetries: 4,
|
|
22284
|
+
}
|
|
22285
|
+
|| { strategy: "none" },
|
|
22286
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22287
|
+
};
|
|
22288
|
+
const requestRes = client._createRequest(context, {
|
|
22289
|
+
security: requestSecurity,
|
|
22290
|
+
method: "DELETE",
|
|
22291
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22292
|
+
path: path,
|
|
22293
|
+
headers: headers,
|
|
22294
|
+
body: body,
|
|
22295
|
+
userAgent: client._options.user_agent,
|
|
22296
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22297
|
+
}, options);
|
|
22298
|
+
if (!requestRes.ok) {
|
|
22299
|
+
return [requestRes, { status: "invalid" }];
|
|
22300
|
+
}
|
|
22301
|
+
const req = requestRes.value;
|
|
22302
|
+
const doResult = await client._do(req, {
|
|
22303
|
+
context,
|
|
22304
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22305
|
+
retryConfig: context.retry_config,
|
|
22306
|
+
retryCodes: context.retry_codes,
|
|
22307
|
+
});
|
|
22308
|
+
if (!doResult.ok) {
|
|
22309
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22310
|
+
}
|
|
22311
|
+
const response = doResult.value;
|
|
22312
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22313
|
+
if (!result.ok) {
|
|
22314
|
+
return [result, { status: "complete", request: req, response }];
|
|
22315
|
+
}
|
|
22316
|
+
return [result, { status: "complete", request: req, response }];
|
|
22317
|
+
}
|
|
22318
|
+
|
|
22319
|
+
/**
|
|
22320
|
+
* @license
|
|
22321
|
+
* Copyright 2026 Google LLC
|
|
22322
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22323
|
+
*
|
|
22324
|
+
* g3-prettier-ignore-file
|
|
22325
|
+
*/
|
|
22326
|
+
/**
|
|
22327
|
+
* Gets a specific Webhook.
|
|
22328
|
+
*/
|
|
22329
|
+
function webhooksGet(client, id, api_version, options) {
|
|
22330
|
+
return new APIPromise($do$4(client, id, api_version, options));
|
|
22331
|
+
}
|
|
22332
|
+
async function $do$4(client, id, api_version, options) {
|
|
22333
|
+
var _a, _b, _c;
|
|
22334
|
+
const input = {
|
|
22335
|
+
id: id,
|
|
22336
|
+
api_version: api_version,
|
|
22337
|
+
};
|
|
22338
|
+
const payload = input;
|
|
22339
|
+
const body = null;
|
|
22340
|
+
const pathParams = {
|
|
22341
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22342
|
+
id: encodeSimple("id", payload.id, {
|
|
22343
|
+
explode: false,
|
|
22344
|
+
charEncoding: "percent",
|
|
22345
|
+
}),
|
|
22346
|
+
};
|
|
22347
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
22348
|
+
const headers = new Headers(compactMap({
|
|
22349
|
+
Accept: "application/json",
|
|
22350
|
+
}));
|
|
22351
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22352
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22353
|
+
const context = {
|
|
22354
|
+
options: client._options,
|
|
22355
|
+
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 : "",
|
|
22356
|
+
operation_id: "GetWebhook",
|
|
22357
|
+
o_auth2_scopes: null,
|
|
22358
|
+
resolved_security: requestSecurity,
|
|
22359
|
+
security_source: client._options.security,
|
|
22360
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22361
|
+
|| client._options.retry_config
|
|
22362
|
+
|| {
|
|
22363
|
+
strategy: "attempt-count-backoff",
|
|
22364
|
+
backoff: {
|
|
22365
|
+
initialInterval: 500,
|
|
22366
|
+
maxInterval: 8000,
|
|
22367
|
+
exponent: 2,
|
|
22368
|
+
maxElapsedTime: 30000,
|
|
22369
|
+
},
|
|
22370
|
+
retryConnectionErrors: true,
|
|
22371
|
+
maxRetries: 4,
|
|
22372
|
+
}
|
|
22373
|
+
|| { strategy: "none" },
|
|
22374
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22375
|
+
};
|
|
22376
|
+
const requestRes = client._createRequest(context, {
|
|
22377
|
+
security: requestSecurity,
|
|
22378
|
+
method: "GET",
|
|
22379
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22380
|
+
path: path,
|
|
22381
|
+
headers: headers,
|
|
22382
|
+
body: body,
|
|
22383
|
+
userAgent: client._options.user_agent,
|
|
22384
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22385
|
+
}, options);
|
|
22386
|
+
if (!requestRes.ok) {
|
|
22387
|
+
return [requestRes, { status: "invalid" }];
|
|
22388
|
+
}
|
|
22389
|
+
const req = requestRes.value;
|
|
22390
|
+
const doResult = await client._do(req, {
|
|
22391
|
+
context,
|
|
22392
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22393
|
+
retryConfig: context.retry_config,
|
|
22394
|
+
retryCodes: context.retry_codes,
|
|
22395
|
+
});
|
|
22396
|
+
if (!doResult.ok) {
|
|
22397
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22398
|
+
}
|
|
22399
|
+
const response = doResult.value;
|
|
22400
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22401
|
+
if (!result.ok) {
|
|
22402
|
+
return [result, { status: "complete", request: req, response }];
|
|
22403
|
+
}
|
|
22404
|
+
return [result, { status: "complete", request: req, response }];
|
|
22405
|
+
}
|
|
22406
|
+
|
|
22407
|
+
/**
|
|
22408
|
+
* @license
|
|
22409
|
+
* Copyright 2026 Google LLC
|
|
22410
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22411
|
+
*
|
|
22412
|
+
* g3-prettier-ignore-file
|
|
22413
|
+
*/
|
|
22414
|
+
/**
|
|
22415
|
+
* Lists all Webhooks.
|
|
22416
|
+
*/
|
|
22417
|
+
function webhooksList(client, api_version, page_size, page_token, options) {
|
|
22418
|
+
return new APIPromise($do$3(client, api_version, page_size, page_token, options));
|
|
22419
|
+
}
|
|
22420
|
+
async function $do$3(client, api_version, page_size, page_token, options) {
|
|
22421
|
+
var _a, _b, _c;
|
|
22422
|
+
const input = {
|
|
22423
|
+
api_version: api_version,
|
|
22424
|
+
page_size: page_size,
|
|
22425
|
+
page_token: page_token,
|
|
22426
|
+
};
|
|
22427
|
+
const payload = input;
|
|
22428
|
+
const body = null;
|
|
22429
|
+
const pathParams = {
|
|
22430
|
+
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" }),
|
|
22431
|
+
};
|
|
22432
|
+
const path = pathToFunc("/{api_version}/webhooks")(pathParams);
|
|
22433
|
+
const query = encodeFormQuery({
|
|
22434
|
+
"page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
|
|
22435
|
+
"page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
|
|
22436
|
+
});
|
|
22437
|
+
const headers = new Headers(compactMap({
|
|
22438
|
+
Accept: "application/json",
|
|
22439
|
+
}));
|
|
22440
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22441
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22442
|
+
const context = {
|
|
22443
|
+
options: client._options,
|
|
22444
|
+
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 : "",
|
|
22445
|
+
operation_id: "ListWebhooks",
|
|
22446
|
+
o_auth2_scopes: null,
|
|
22447
|
+
resolved_security: requestSecurity,
|
|
22448
|
+
security_source: client._options.security,
|
|
22449
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22450
|
+
|| client._options.retry_config
|
|
22451
|
+
|| {
|
|
22452
|
+
strategy: "attempt-count-backoff",
|
|
22453
|
+
backoff: {
|
|
22454
|
+
initialInterval: 500,
|
|
22455
|
+
maxInterval: 8000,
|
|
22456
|
+
exponent: 2,
|
|
22457
|
+
maxElapsedTime: 30000,
|
|
22458
|
+
},
|
|
22459
|
+
retryConnectionErrors: true,
|
|
22460
|
+
maxRetries: 4,
|
|
22461
|
+
}
|
|
22462
|
+
|| { strategy: "none" },
|
|
22463
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22464
|
+
};
|
|
22465
|
+
const requestRes = client._createRequest(context, {
|
|
22466
|
+
security: requestSecurity,
|
|
22467
|
+
method: "GET",
|
|
22468
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22469
|
+
path: path,
|
|
22470
|
+
headers: headers,
|
|
22471
|
+
query: query,
|
|
22472
|
+
body: body,
|
|
22473
|
+
userAgent: client._options.user_agent,
|
|
22474
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22475
|
+
}, options);
|
|
22476
|
+
if (!requestRes.ok) {
|
|
22477
|
+
return [requestRes, { status: "invalid" }];
|
|
22478
|
+
}
|
|
22479
|
+
const req = requestRes.value;
|
|
22480
|
+
const doResult = await client._do(req, {
|
|
22481
|
+
context,
|
|
22482
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22483
|
+
retryConfig: context.retry_config,
|
|
22484
|
+
retryCodes: context.retry_codes,
|
|
22485
|
+
});
|
|
22486
|
+
if (!doResult.ok) {
|
|
22487
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22488
|
+
}
|
|
22489
|
+
const response = doResult.value;
|
|
22490
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22491
|
+
if (!result.ok) {
|
|
22492
|
+
return [result, { status: "complete", request: req, response }];
|
|
22493
|
+
}
|
|
22494
|
+
return [result, { status: "complete", request: req, response }];
|
|
22495
|
+
}
|
|
22496
|
+
|
|
22497
|
+
/**
|
|
22498
|
+
* @license
|
|
22499
|
+
* Copyright 2026 Google LLC
|
|
22500
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22501
|
+
*
|
|
22502
|
+
* g3-prettier-ignore-file
|
|
22503
|
+
*/
|
|
22504
|
+
/**
|
|
22505
|
+
* Sends a ping event to a Webhook.
|
|
22506
|
+
*/
|
|
22507
|
+
function webhooksPing(client, id, api_version, body, options) {
|
|
22508
|
+
return new APIPromise($do$2(client, id, api_version, body, options));
|
|
22509
|
+
}
|
|
22510
|
+
async function $do$2(client, id, api_version, body, options) {
|
|
22511
|
+
var _a, _b, _c;
|
|
22512
|
+
const input = {
|
|
22513
|
+
id: id,
|
|
22514
|
+
api_version: api_version,
|
|
22515
|
+
body: body,
|
|
22516
|
+
};
|
|
22517
|
+
const payload = input;
|
|
22518
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
22519
|
+
const pathParams = {
|
|
22520
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22521
|
+
id: encodeSimple("id", payload.id, {
|
|
22522
|
+
explode: false,
|
|
22523
|
+
charEncoding: "percent",
|
|
22524
|
+
}),
|
|
22525
|
+
};
|
|
22526
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}:ping")(pathParams);
|
|
22527
|
+
const headers = new Headers(compactMap({
|
|
22528
|
+
"Content-Type": "application/json",
|
|
22529
|
+
Accept: "application/json",
|
|
22530
|
+
}));
|
|
22531
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22532
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22533
|
+
const context = {
|
|
22534
|
+
options: client._options,
|
|
22535
|
+
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 : "",
|
|
22536
|
+
operation_id: "PingWebhook",
|
|
22537
|
+
o_auth2_scopes: null,
|
|
22538
|
+
resolved_security: requestSecurity,
|
|
22539
|
+
security_source: client._options.security,
|
|
22540
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22541
|
+
|| client._options.retry_config
|
|
22542
|
+
|| {
|
|
22543
|
+
strategy: "attempt-count-backoff",
|
|
22544
|
+
backoff: {
|
|
22545
|
+
initialInterval: 500,
|
|
22546
|
+
maxInterval: 8000,
|
|
22547
|
+
exponent: 2,
|
|
22548
|
+
maxElapsedTime: 30000,
|
|
22549
|
+
},
|
|
22550
|
+
retryConnectionErrors: true,
|
|
22551
|
+
maxRetries: 4,
|
|
22552
|
+
}
|
|
22553
|
+
|| { strategy: "none" },
|
|
22554
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22555
|
+
};
|
|
22556
|
+
const requestRes = client._createRequest(context, {
|
|
22557
|
+
security: requestSecurity,
|
|
22558
|
+
method: "POST",
|
|
22559
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22560
|
+
path: path,
|
|
22561
|
+
headers: headers,
|
|
22562
|
+
body: body$,
|
|
22563
|
+
userAgent: client._options.user_agent,
|
|
22564
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22565
|
+
}, options);
|
|
22566
|
+
if (!requestRes.ok) {
|
|
22567
|
+
return [requestRes, { status: "invalid" }];
|
|
22568
|
+
}
|
|
22569
|
+
const req = requestRes.value;
|
|
22570
|
+
const doResult = await client._do(req, {
|
|
22571
|
+
context,
|
|
22572
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22573
|
+
retryConfig: context.retry_config,
|
|
22574
|
+
retryCodes: context.retry_codes,
|
|
22575
|
+
});
|
|
22576
|
+
if (!doResult.ok) {
|
|
22577
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22578
|
+
}
|
|
22579
|
+
const response = doResult.value;
|
|
22580
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22581
|
+
if (!result.ok) {
|
|
22582
|
+
return [result, { status: "complete", request: req, response }];
|
|
22583
|
+
}
|
|
22584
|
+
return [result, { status: "complete", request: req, response }];
|
|
22585
|
+
}
|
|
22586
|
+
|
|
22587
|
+
/**
|
|
22588
|
+
* @license
|
|
22589
|
+
* Copyright 2026 Google LLC
|
|
22590
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22591
|
+
*
|
|
22592
|
+
* g3-prettier-ignore-file
|
|
22593
|
+
*/
|
|
22594
|
+
/**
|
|
22595
|
+
* Generates a new signing secret for a Webhook.
|
|
22596
|
+
*/
|
|
22597
|
+
function webhooksRotateSigningSecret(client, id, api_version, body, options) {
|
|
22598
|
+
return new APIPromise($do$1(client, id, api_version, body, options));
|
|
22599
|
+
}
|
|
22600
|
+
async function $do$1(client, id, api_version, body, options) {
|
|
22601
|
+
var _a, _b, _c;
|
|
22602
|
+
const input = {
|
|
22603
|
+
id: id,
|
|
22604
|
+
api_version: api_version,
|
|
22605
|
+
body: body,
|
|
22606
|
+
};
|
|
22607
|
+
const payload = input;
|
|
22608
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
22609
|
+
const pathParams = {
|
|
22610
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22611
|
+
id: encodeSimple("id", payload.id, {
|
|
22612
|
+
explode: false,
|
|
22613
|
+
charEncoding: "percent",
|
|
22614
|
+
}),
|
|
22615
|
+
};
|
|
22616
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}:rotateSigningSecret")(pathParams);
|
|
22617
|
+
const headers = new Headers(compactMap({
|
|
22618
|
+
"Content-Type": "application/json",
|
|
22619
|
+
Accept: "application/json",
|
|
22620
|
+
}));
|
|
22621
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22622
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22623
|
+
const context = {
|
|
22624
|
+
options: client._options,
|
|
22625
|
+
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 : "",
|
|
22626
|
+
operation_id: "RotateSigningSecret",
|
|
22627
|
+
o_auth2_scopes: null,
|
|
22628
|
+
resolved_security: requestSecurity,
|
|
22629
|
+
security_source: client._options.security,
|
|
22630
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22631
|
+
|| client._options.retry_config
|
|
22632
|
+
|| {
|
|
22633
|
+
strategy: "attempt-count-backoff",
|
|
22634
|
+
backoff: {
|
|
22635
|
+
initialInterval: 500,
|
|
22636
|
+
maxInterval: 8000,
|
|
22637
|
+
exponent: 2,
|
|
22638
|
+
maxElapsedTime: 30000,
|
|
22639
|
+
},
|
|
22640
|
+
retryConnectionErrors: true,
|
|
22641
|
+
maxRetries: 4,
|
|
22642
|
+
}
|
|
22643
|
+
|| { strategy: "none" },
|
|
22644
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22645
|
+
};
|
|
22646
|
+
const requestRes = client._createRequest(context, {
|
|
22647
|
+
security: requestSecurity,
|
|
22648
|
+
method: "POST",
|
|
22649
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22650
|
+
path: path,
|
|
22651
|
+
headers: headers,
|
|
22652
|
+
body: body$,
|
|
22653
|
+
userAgent: client._options.user_agent,
|
|
22654
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22655
|
+
}, options);
|
|
22656
|
+
if (!requestRes.ok) {
|
|
22657
|
+
return [requestRes, { status: "invalid" }];
|
|
22658
|
+
}
|
|
22659
|
+
const req = requestRes.value;
|
|
22660
|
+
const doResult = await client._do(req, {
|
|
22661
|
+
context,
|
|
22662
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22663
|
+
retryConfig: context.retry_config,
|
|
22664
|
+
retryCodes: context.retry_codes,
|
|
22665
|
+
});
|
|
22666
|
+
if (!doResult.ok) {
|
|
22667
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22668
|
+
}
|
|
22669
|
+
const response = doResult.value;
|
|
22670
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22671
|
+
if (!result.ok) {
|
|
22672
|
+
return [result, { status: "complete", request: req, response }];
|
|
22673
|
+
}
|
|
22674
|
+
return [result, { status: "complete", request: req, response }];
|
|
22675
|
+
}
|
|
22676
|
+
|
|
22677
|
+
/**
|
|
22678
|
+
* @license
|
|
22679
|
+
* Copyright 2026 Google LLC
|
|
22680
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22681
|
+
*
|
|
22682
|
+
* g3-prettier-ignore-file
|
|
22683
|
+
*/
|
|
22684
|
+
/**
|
|
22685
|
+
* Updates an existing Webhook.
|
|
22686
|
+
*/
|
|
22687
|
+
function webhooksUpdate(client, id, api_version, update_mask, body, options) {
|
|
22688
|
+
return new APIPromise($do(client, id, api_version, update_mask, body, options));
|
|
22689
|
+
}
|
|
22690
|
+
async function $do(client, id, api_version, update_mask, body, options) {
|
|
22691
|
+
var _a, _b, _c;
|
|
22692
|
+
const input = {
|
|
22693
|
+
id: id,
|
|
22694
|
+
api_version: api_version,
|
|
22695
|
+
update_mask: update_mask,
|
|
22696
|
+
body: body,
|
|
22697
|
+
};
|
|
22698
|
+
const payload = input;
|
|
22699
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
22700
|
+
const pathParams = {
|
|
22701
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
22702
|
+
id: encodeSimple("id", payload.id, {
|
|
22703
|
+
explode: false,
|
|
22704
|
+
charEncoding: "percent",
|
|
22705
|
+
}),
|
|
22706
|
+
};
|
|
22707
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
22708
|
+
const query = encodeFormQuery({
|
|
22709
|
+
"update_mask": payload.update_mask,
|
|
22710
|
+
});
|
|
22711
|
+
const headers = new Headers(compactMap({
|
|
22712
|
+
"Content-Type": "application/json",
|
|
22713
|
+
Accept: "application/json",
|
|
22714
|
+
}));
|
|
22715
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
22716
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
22717
|
+
const context = {
|
|
22718
|
+
options: client._options,
|
|
22719
|
+
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 : "",
|
|
22720
|
+
operation_id: "UpdateWebhook",
|
|
22721
|
+
o_auth2_scopes: null,
|
|
22722
|
+
resolved_security: requestSecurity,
|
|
22723
|
+
security_source: client._options.security,
|
|
22724
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
22725
|
+
|| client._options.retry_config
|
|
22726
|
+
|| {
|
|
22727
|
+
strategy: "attempt-count-backoff",
|
|
22728
|
+
backoff: {
|
|
22729
|
+
initialInterval: 500,
|
|
22730
|
+
maxInterval: 8000,
|
|
22731
|
+
exponent: 2,
|
|
22732
|
+
maxElapsedTime: 30000,
|
|
22733
|
+
},
|
|
22734
|
+
retryConnectionErrors: true,
|
|
22735
|
+
maxRetries: 4,
|
|
22736
|
+
}
|
|
22737
|
+
|| { strategy: "none" },
|
|
22738
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
22739
|
+
};
|
|
22740
|
+
const requestRes = client._createRequest(context, {
|
|
22741
|
+
security: requestSecurity,
|
|
22742
|
+
method: "PATCH",
|
|
22743
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
22744
|
+
path: path,
|
|
22745
|
+
headers: headers,
|
|
22746
|
+
query: query,
|
|
22747
|
+
body: body$,
|
|
22748
|
+
userAgent: client._options.user_agent,
|
|
22749
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
22750
|
+
}, options);
|
|
22751
|
+
if (!requestRes.ok) {
|
|
22752
|
+
return [requestRes, { status: "invalid" }];
|
|
22753
|
+
}
|
|
22754
|
+
const req = requestRes.value;
|
|
22755
|
+
const doResult = await client._do(req, {
|
|
22756
|
+
context,
|
|
22757
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
22758
|
+
retryConfig: context.retry_config,
|
|
22759
|
+
retryCodes: context.retry_codes,
|
|
22760
|
+
});
|
|
22761
|
+
if (!doResult.ok) {
|
|
22762
|
+
return [doResult, { status: "request-error", request: req }];
|
|
22763
|
+
}
|
|
22764
|
+
const response = doResult.value;
|
|
22765
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
22766
|
+
if (!result.ok) {
|
|
22767
|
+
return [result, { status: "complete", request: req, response }];
|
|
22768
|
+
}
|
|
22769
|
+
return [result, { status: "complete", request: req, response }];
|
|
22770
|
+
}
|
|
22771
|
+
|
|
22772
|
+
/**
|
|
22773
|
+
* @license
|
|
22774
|
+
* Copyright 2026 Google LLC
|
|
22775
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22776
|
+
*
|
|
22777
|
+
* g3-prettier-ignore-file
|
|
22778
|
+
*/
|
|
22779
|
+
class Webhooks extends ClientSDK {
|
|
22780
|
+
/**
|
|
22781
|
+
* Creates a new Webhook.
|
|
22782
|
+
*/
|
|
22783
|
+
create(params, options) {
|
|
22784
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
22785
|
+
return unwrapAsAPIPromise(webhooksCreate(this, body, api_version, options));
|
|
22786
|
+
}
|
|
22787
|
+
/**
|
|
22788
|
+
* Lists all Webhooks.
|
|
22789
|
+
*/
|
|
22790
|
+
list(params, options) {
|
|
22791
|
+
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));
|
|
22792
|
+
}
|
|
22793
|
+
/**
|
|
22794
|
+
* Gets a specific Webhook.
|
|
22795
|
+
*/
|
|
22796
|
+
get(id, params, options) {
|
|
22797
|
+
return unwrapAsAPIPromise(webhooksGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22798
|
+
}
|
|
22799
|
+
/**
|
|
22800
|
+
* Updates an existing Webhook.
|
|
22801
|
+
*/
|
|
22802
|
+
update(id, params, options) {
|
|
22803
|
+
const _a = params !== null && params !== void 0 ? params : {}, { api_version, update_mask } = _a, body$body = __rest(_a, ["api_version", "update_mask"]);
|
|
22804
|
+
const body = params === undefined || Object.keys(body$body).length === 0
|
|
22805
|
+
? undefined
|
|
22806
|
+
: body$body;
|
|
22807
|
+
return unwrapAsAPIPromise(webhooksUpdate(this, id, api_version, update_mask, body, options));
|
|
22808
|
+
}
|
|
22809
|
+
/**
|
|
22810
|
+
* Deletes a Webhook.
|
|
22811
|
+
*/
|
|
22812
|
+
delete(id, params, options) {
|
|
22813
|
+
return unwrapAsAPIPromise(webhooksDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
22814
|
+
}
|
|
22815
|
+
/**
|
|
22816
|
+
* Generates a new signing secret for a Webhook.
|
|
22817
|
+
*/
|
|
22818
|
+
rotateSigningSecret(id, api_version, body, options) {
|
|
22819
|
+
return unwrapAsAPIPromise(webhooksRotateSigningSecret(this, id, api_version, body, options));
|
|
22820
|
+
}
|
|
22821
|
+
/**
|
|
22822
|
+
* Sends a ping event to a Webhook.
|
|
22823
|
+
*/
|
|
22824
|
+
ping(id, api_version, body, options) {
|
|
22825
|
+
return unwrapAsAPIPromise(webhooksPing(this, id, api_version, body, options));
|
|
22826
|
+
}
|
|
22827
|
+
}
|
|
22828
|
+
|
|
22829
|
+
/**
|
|
22830
|
+
* @license
|
|
22831
|
+
* Copyright 2026 Google LLC
|
|
22832
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22833
|
+
*
|
|
22834
|
+
* g3-prettier-ignore-file
|
|
22835
|
+
*/
|
|
22836
|
+
/*
|
|
22837
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
22838
|
+
*/
|
|
22839
|
+
let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
|
|
22840
|
+
get interactions() {
|
|
22841
|
+
var _a;
|
|
22842
|
+
return ((_a = this._interactions) !== null && _a !== void 0 ? _a : (this._interactions = new Interactions(this._options)));
|
|
22843
|
+
}
|
|
22844
|
+
get webhooks() {
|
|
22845
|
+
var _a;
|
|
22846
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Webhooks(this._options)));
|
|
22847
|
+
}
|
|
22848
|
+
get agents() {
|
|
22849
|
+
var _a;
|
|
22850
|
+
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Agents(this._options)));
|
|
22851
|
+
}
|
|
22852
|
+
get triggers() {
|
|
22853
|
+
var _a;
|
|
22854
|
+
return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Triggers(this._options)));
|
|
22855
|
+
}
|
|
22856
|
+
};
|
|
22857
|
+
|
|
22858
|
+
/**
|
|
22859
|
+
* @license
|
|
22860
|
+
* Copyright 2026 Google LLC
|
|
22861
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
22862
|
+
*
|
|
22863
|
+
* g3-prettier-ignore-file
|
|
22864
|
+
*/
|
|
22865
|
+
const LEGACY_LYRIA_MODELS = new Set([
|
|
22866
|
+
"lyria-3-pro-preview",
|
|
22867
|
+
"lyria-3-clip-preview",
|
|
22868
|
+
]);
|
|
22869
|
+
function getGoogleGenAIServerURL(parentClient) {
|
|
22870
|
+
const serverURL = parentClient.getBaseUrl();
|
|
22871
|
+
if (!serverURL) {
|
|
22872
|
+
throw new Error("Base URL must be set.");
|
|
22873
|
+
}
|
|
22874
|
+
return serverURL.replace(/\/+$/, "");
|
|
22875
|
+
}
|
|
22876
|
+
function getGoogleGenAIAPIVersion(parentClient) {
|
|
22877
|
+
const apiVersion = trimSlashes(parentClient.getApiVersion());
|
|
22878
|
+
const project = parentClient.getProject();
|
|
22879
|
+
const location = parentClient.getLocation();
|
|
22880
|
+
if (parentClient.isVertexAI() && apiVersion && project && location) {
|
|
22881
|
+
return (`${apiVersion}/projects/${encodeURIComponent(project)}` +
|
|
22882
|
+
`/locations/${encodeURIComponent(location)}`);
|
|
22883
|
+
}
|
|
22884
|
+
return apiVersion;
|
|
22885
|
+
}
|
|
22886
|
+
function buildGoogleGenAIClient(parentClient, options = {}) {
|
|
22887
|
+
var _a, _b, _c, _d, _e;
|
|
22888
|
+
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({
|
|
22889
|
+
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)),
|
|
22890
|
+
getAuthHeaders: (url) => parentClient.getAuthHeaders(url),
|
|
22891
|
+
}), server_url: (_e = options.server_url) !== null && _e !== void 0 ? _e : getGoogleGenAIServerURL(parentClient) }));
|
|
22892
|
+
return sdk;
|
|
22893
|
+
}
|
|
22894
|
+
class GeminiNextGenInteractions {
|
|
22895
|
+
constructor(parentClient) {
|
|
22896
|
+
this.parentClient = parentClient;
|
|
22897
|
+
}
|
|
22898
|
+
async create(params, options) {
|
|
22899
|
+
const { api_version } = params, request = __rest(params, ["api_version"]);
|
|
22900
|
+
if (request.stream === true) {
|
|
22901
|
+
const response = await wrapSDKCall(() => this.getClient(api_version).interactions.create(Object.assign(Object.assign({}, request), { stream: true, api_version }), toGoogleGenAIRequestOptions(options, true)));
|
|
22902
|
+
return wrapStreamErrors(response);
|
|
22903
|
+
}
|
|
22904
|
+
const response = await unwrapWithSdkHttpResponse(interactionsCreate(this.getClient(api_version), request, api_version, toGoogleGenAIRequestOptions(options)));
|
|
22205
22905
|
return addOutputPropertiesIfInteraction(response);
|
|
22206
22906
|
}
|
|
22207
22907
|
async get(id, params = {}, options) {
|
|
@@ -22295,6 +22995,46 @@ class GeminiNextGenWebhooks {
|
|
|
22295
22995
|
return this.sdk;
|
|
22296
22996
|
}
|
|
22297
22997
|
}
|
|
22998
|
+
class GeminiNextGenTriggers {
|
|
22999
|
+
constructor(parentClient) {
|
|
23000
|
+
this.parentClient = parentClient;
|
|
23001
|
+
}
|
|
23002
|
+
async create(params, options) {
|
|
23003
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
23004
|
+
return unwrapWithSdkHttpResponse(triggersCreate(this.getClient(api_version), body, api_version, toGoogleGenAIRequestOptions(options)));
|
|
23005
|
+
}
|
|
23006
|
+
async list(params = {}, options) {
|
|
23007
|
+
const { api_version, filter, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
|
|
23008
|
+
return unwrapWithSdkHttpResponse(triggersList(this.getClient(api_version), api_version, filter, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
|
|
23009
|
+
}
|
|
23010
|
+
async get(id, params = {}, options) {
|
|
23011
|
+
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)));
|
|
23012
|
+
}
|
|
23013
|
+
async update(id, params, options) {
|
|
23014
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
23015
|
+
return unwrapWithSdkHttpResponse(triggersUpdate(this.getClient(api_version), id, body, api_version, toGoogleGenAIRequestOptions(options)));
|
|
23016
|
+
}
|
|
23017
|
+
async delete(id, params = {}, options) {
|
|
23018
|
+
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)));
|
|
23019
|
+
}
|
|
23020
|
+
async run(trigger_id, params = {}, options) {
|
|
23021
|
+
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)));
|
|
23022
|
+
}
|
|
23023
|
+
async listExecutions(trigger_id, params = {}, options) {
|
|
23024
|
+
const { api_version, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
|
|
23025
|
+
return unwrapWithSdkHttpResponse(triggersListExecutions(this.getClient(api_version), trigger_id, api_version, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
|
|
23026
|
+
}
|
|
23027
|
+
getClient(apiVersion) {
|
|
23028
|
+
var _a;
|
|
23029
|
+
if (apiVersion) {
|
|
23030
|
+
return buildGoogleGenAIClient(this.parentClient, {
|
|
23031
|
+
api_version: apiVersion,
|
|
23032
|
+
});
|
|
23033
|
+
}
|
|
23034
|
+
(_a = this.sdk) !== null && _a !== void 0 ? _a : (this.sdk = buildGoogleGenAIClient(this.parentClient));
|
|
23035
|
+
return this.sdk;
|
|
23036
|
+
}
|
|
23037
|
+
}
|
|
22298
23038
|
function trimSlashes(value) {
|
|
22299
23039
|
return value.replace(/^\/+|\/+$/g, "");
|
|
22300
23040
|
}
|
|
@@ -24977,6 +25717,14 @@ class GoogleGenAI {
|
|
|
24977
25717
|
this._agents = new GeminiNextGenAgents(this.apiClient);
|
|
24978
25718
|
return this._agents;
|
|
24979
25719
|
}
|
|
25720
|
+
get triggers() {
|
|
25721
|
+
if (this._triggers !== undefined) {
|
|
25722
|
+
return this._triggers;
|
|
25723
|
+
}
|
|
25724
|
+
console.warn('GoogleGenAI.triggers: Triggers usage is experimental and may change in future versions.');
|
|
25725
|
+
this._triggers = new GeminiNextGenTriggers(this.apiClient);
|
|
25726
|
+
return this._triggers;
|
|
25727
|
+
}
|
|
24980
25728
|
constructor(options) {
|
|
24981
25729
|
var _a, _b, _c, _d;
|
|
24982
25730
|
// Validate explicitly set initializer values.
|