@google/genai 2.10.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 +1623 -595
- package/dist/index.cjs +1296 -179
- package/dist/index.mjs +1292 -180
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +1347 -230
- package/dist/node/index.mjs +1343 -231
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +1623 -595
- package/dist/tokenizer/node.cjs +157 -53
- package/dist/tokenizer/node.d.ts +204 -4
- package/dist/tokenizer/node.mjs +157 -53
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +158 -54
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +308 -67
- package/dist/vertex_internal/index.js +158 -54
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +1343 -231
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +1623 -595
- package/package.json +2 -9
package/dist/index.cjs
CHANGED
|
@@ -804,7 +804,7 @@ exports.PhishBlockThreshold = void 0;
|
|
|
804
804
|
*/
|
|
805
805
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
806
806
|
})(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
|
|
807
|
-
/** Specifies the function Behavior.
|
|
807
|
+
/** Specifies the function Behavior. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method. */
|
|
808
808
|
exports.Behavior = void 0;
|
|
809
809
|
(function (Behavior) {
|
|
810
810
|
/**
|
|
@@ -1318,6 +1318,110 @@ exports.Modality = void 0;
|
|
|
1318
1318
|
*/
|
|
1319
1319
|
Modality["VIDEO"] = "VIDEO";
|
|
1320
1320
|
})(exports.Modality || (exports.Modality = {}));
|
|
1321
|
+
/** Delivery mode for the generated content. */
|
|
1322
|
+
exports.Delivery = void 0;
|
|
1323
|
+
(function (Delivery) {
|
|
1324
|
+
/**
|
|
1325
|
+
* Default value. This value is unused.
|
|
1326
|
+
*/
|
|
1327
|
+
Delivery["DELIVERY_UNSPECIFIED"] = "DELIVERY_UNSPECIFIED";
|
|
1328
|
+
/**
|
|
1329
|
+
* Generated bytes are returned inline in the response.
|
|
1330
|
+
*/
|
|
1331
|
+
Delivery["INLINE"] = "INLINE";
|
|
1332
|
+
/**
|
|
1333
|
+
* Generated content is stored and a URI is returned.
|
|
1334
|
+
*/
|
|
1335
|
+
Delivery["URI"] = "URI";
|
|
1336
|
+
})(exports.Delivery || (exports.Delivery = {}));
|
|
1337
|
+
/** The aspect ratio for the image output. */
|
|
1338
|
+
exports.AspectRatio = void 0;
|
|
1339
|
+
(function (AspectRatio) {
|
|
1340
|
+
/**
|
|
1341
|
+
* Default value. This value is unused.
|
|
1342
|
+
*/
|
|
1343
|
+
AspectRatio["ASPECT_RATIO_UNSPECIFIED"] = "ASPECT_RATIO_UNSPECIFIED";
|
|
1344
|
+
/**
|
|
1345
|
+
* 1:1 aspect ratio.
|
|
1346
|
+
*/
|
|
1347
|
+
AspectRatio["ASPECT_RATIO_ONE_BY_ONE"] = "ASPECT_RATIO_ONE_BY_ONE";
|
|
1348
|
+
/**
|
|
1349
|
+
* 2:3 aspect ratio.
|
|
1350
|
+
*/
|
|
1351
|
+
AspectRatio["ASPECT_RATIO_TWO_BY_THREE"] = "ASPECT_RATIO_TWO_BY_THREE";
|
|
1352
|
+
/**
|
|
1353
|
+
* 3:2 aspect ratio.
|
|
1354
|
+
*/
|
|
1355
|
+
AspectRatio["ASPECT_RATIO_THREE_BY_TWO"] = "ASPECT_RATIO_THREE_BY_TWO";
|
|
1356
|
+
/**
|
|
1357
|
+
* 3:4 aspect ratio.
|
|
1358
|
+
*/
|
|
1359
|
+
AspectRatio["ASPECT_RATIO_THREE_BY_FOUR"] = "ASPECT_RATIO_THREE_BY_FOUR";
|
|
1360
|
+
/**
|
|
1361
|
+
* 4:3 aspect ratio.
|
|
1362
|
+
*/
|
|
1363
|
+
AspectRatio["ASPECT_RATIO_FOUR_BY_THREE"] = "ASPECT_RATIO_FOUR_BY_THREE";
|
|
1364
|
+
/**
|
|
1365
|
+
* 4:5 aspect ratio.
|
|
1366
|
+
*/
|
|
1367
|
+
AspectRatio["ASPECT_RATIO_FOUR_BY_FIVE"] = "ASPECT_RATIO_FOUR_BY_FIVE";
|
|
1368
|
+
/**
|
|
1369
|
+
* 5:4 aspect ratio.
|
|
1370
|
+
*/
|
|
1371
|
+
AspectRatio["ASPECT_RATIO_FIVE_BY_FOUR"] = "ASPECT_RATIO_FIVE_BY_FOUR";
|
|
1372
|
+
/**
|
|
1373
|
+
* 9:16 aspect ratio.
|
|
1374
|
+
*/
|
|
1375
|
+
AspectRatio["ASPECT_RATIO_NINE_BY_SIXTEEN"] = "ASPECT_RATIO_NINE_BY_SIXTEEN";
|
|
1376
|
+
/**
|
|
1377
|
+
* 16:9 aspect ratio.
|
|
1378
|
+
*/
|
|
1379
|
+
AspectRatio["ASPECT_RATIO_SIXTEEN_BY_NINE"] = "ASPECT_RATIO_SIXTEEN_BY_NINE";
|
|
1380
|
+
/**
|
|
1381
|
+
* 21:9 aspect ratio.
|
|
1382
|
+
*/
|
|
1383
|
+
AspectRatio["ASPECT_RATIO_TWENTY_ONE_BY_NINE"] = "ASPECT_RATIO_TWENTY_ONE_BY_NINE";
|
|
1384
|
+
/**
|
|
1385
|
+
* 1:8 aspect ratio.
|
|
1386
|
+
*/
|
|
1387
|
+
AspectRatio["ASPECT_RATIO_ONE_BY_EIGHT"] = "ASPECT_RATIO_ONE_BY_EIGHT";
|
|
1388
|
+
/**
|
|
1389
|
+
* 8:1 aspect ratio.
|
|
1390
|
+
*/
|
|
1391
|
+
AspectRatio["ASPECT_RATIO_EIGHT_BY_ONE"] = "ASPECT_RATIO_EIGHT_BY_ONE";
|
|
1392
|
+
/**
|
|
1393
|
+
* 1:4 aspect ratio.
|
|
1394
|
+
*/
|
|
1395
|
+
AspectRatio["ASPECT_RATIO_ONE_BY_FOUR"] = "ASPECT_RATIO_ONE_BY_FOUR";
|
|
1396
|
+
/**
|
|
1397
|
+
* 4:1 aspect ratio.
|
|
1398
|
+
*/
|
|
1399
|
+
AspectRatio["ASPECT_RATIO_FOUR_BY_ONE"] = "ASPECT_RATIO_FOUR_BY_ONE";
|
|
1400
|
+
})(exports.AspectRatio || (exports.AspectRatio = {}));
|
|
1401
|
+
/** The size of the image output. */
|
|
1402
|
+
exports.ImageSize = void 0;
|
|
1403
|
+
(function (ImageSize) {
|
|
1404
|
+
/**
|
|
1405
|
+
* Default value. This value is unused.
|
|
1406
|
+
*/
|
|
1407
|
+
ImageSize["IMAGE_SIZE_UNSPECIFIED"] = "IMAGE_SIZE_UNSPECIFIED";
|
|
1408
|
+
/**
|
|
1409
|
+
* 512px image size.
|
|
1410
|
+
*/
|
|
1411
|
+
ImageSize["IMAGE_SIZE_FIVE_TWELVE"] = "IMAGE_SIZE_FIVE_TWELVE";
|
|
1412
|
+
/**
|
|
1413
|
+
* 1K image size.
|
|
1414
|
+
*/
|
|
1415
|
+
ImageSize["IMAGE_SIZE_ONE_K"] = "IMAGE_SIZE_ONE_K";
|
|
1416
|
+
/**
|
|
1417
|
+
* 2K image size.
|
|
1418
|
+
*/
|
|
1419
|
+
ImageSize["IMAGE_SIZE_TWO_K"] = "IMAGE_SIZE_TWO_K";
|
|
1420
|
+
/**
|
|
1421
|
+
* 4K image size.
|
|
1422
|
+
*/
|
|
1423
|
+
ImageSize["IMAGE_SIZE_FOUR_K"] = "IMAGE_SIZE_FOUR_K";
|
|
1424
|
+
})(exports.ImageSize || (exports.ImageSize = {}));
|
|
1321
1425
|
/** Tuning mode. This enum is not supported in Gemini API. */
|
|
1322
1426
|
exports.TuningMode = void 0;
|
|
1323
1427
|
(function (TuningMode) {
|
|
@@ -1366,6 +1470,58 @@ exports.AdapterSize = void 0;
|
|
|
1366
1470
|
*/
|
|
1367
1471
|
AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
|
|
1368
1472
|
})(exports.AdapterSize || (exports.AdapterSize = {}));
|
|
1473
|
+
/** Defines the type for parsing sample response. This enum is not supported in Gemini API. */
|
|
1474
|
+
exports.ResponseParseType = void 0;
|
|
1475
|
+
(function (ResponseParseType) {
|
|
1476
|
+
/**
|
|
1477
|
+
* Default value. Fallback to IDENTITY
|
|
1478
|
+
*/
|
|
1479
|
+
ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
|
|
1480
|
+
/**
|
|
1481
|
+
* Returns the sample response as is.
|
|
1482
|
+
*/
|
|
1483
|
+
ResponseParseType["IDENTITY"] = "IDENTITY";
|
|
1484
|
+
/**
|
|
1485
|
+
* Uses regex to extract the important part of sample response. Similar to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_extract) `REGEX_EXTRACT(response, regex_extract_expression)`, but different in that if there are multiple matches, the last match will be returned.
|
|
1486
|
+
*/
|
|
1487
|
+
ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
|
|
1488
|
+
})(exports.ResponseParseType || (exports.ResponseParseType = {}));
|
|
1489
|
+
/** Match operation to use for evaluating rewards. This enum is not supported in Gemini API. */
|
|
1490
|
+
exports.MatchOperation = void 0;
|
|
1491
|
+
(function (MatchOperation) {
|
|
1492
|
+
/**
|
|
1493
|
+
* Default value. A user error will be returned if not set.
|
|
1494
|
+
*/
|
|
1495
|
+
MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
|
|
1496
|
+
/**
|
|
1497
|
+
* Equivalent to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains) `REGEX_CONTAINS(target, expression)`.
|
|
1498
|
+
*/
|
|
1499
|
+
MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
|
|
1500
|
+
/**
|
|
1501
|
+
* The match operation returns `true` if expression is a substring of the target.
|
|
1502
|
+
*/
|
|
1503
|
+
MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
|
|
1504
|
+
/**
|
|
1505
|
+
* The match operation returns `true` expression is an exact match of the target.
|
|
1506
|
+
*/
|
|
1507
|
+
MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
|
|
1508
|
+
})(exports.MatchOperation || (exports.MatchOperation = {}));
|
|
1509
|
+
/** Represents how much to think for the tuning job. */
|
|
1510
|
+
exports.ReinforcementTuningThinkingLevel = void 0;
|
|
1511
|
+
(function (ReinforcementTuningThinkingLevel) {
|
|
1512
|
+
/**
|
|
1513
|
+
* Unspecified thinking level.
|
|
1514
|
+
*/
|
|
1515
|
+
ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
|
|
1516
|
+
/**
|
|
1517
|
+
* Little to no thinking.
|
|
1518
|
+
*/
|
|
1519
|
+
ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
1520
|
+
/**
|
|
1521
|
+
* High thinking level.
|
|
1522
|
+
*/
|
|
1523
|
+
ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
|
|
1524
|
+
})(exports.ReinforcementTuningThinkingLevel || (exports.ReinforcementTuningThinkingLevel = {}));
|
|
1369
1525
|
/** Job state. */
|
|
1370
1526
|
exports.JobState = void 0;
|
|
1371
1527
|
(function (JobState) {
|
|
@@ -1850,58 +2006,6 @@ exports.ImageResizeMode = void 0;
|
|
|
1850
2006
|
*/
|
|
1851
2007
|
ImageResizeMode["PAD"] = "PAD";
|
|
1852
2008
|
})(exports.ImageResizeMode || (exports.ImageResizeMode = {}));
|
|
1853
|
-
/** Defines how to parse sample response. */
|
|
1854
|
-
exports.ResponseParseType = void 0;
|
|
1855
|
-
(function (ResponseParseType) {
|
|
1856
|
-
/**
|
|
1857
|
-
* Default value. This value is unused.
|
|
1858
|
-
*/
|
|
1859
|
-
ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
|
|
1860
|
-
/**
|
|
1861
|
-
* Use the sample response as is.
|
|
1862
|
-
*/
|
|
1863
|
-
ResponseParseType["IDENTITY"] = "IDENTITY";
|
|
1864
|
-
/**
|
|
1865
|
-
* Use regex to extract the important part of sample response.
|
|
1866
|
-
*/
|
|
1867
|
-
ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
|
|
1868
|
-
})(exports.ResponseParseType || (exports.ResponseParseType = {}));
|
|
1869
|
-
/** Match operation to use for evaluation. */
|
|
1870
|
-
exports.MatchOperation = void 0;
|
|
1871
|
-
(function (MatchOperation) {
|
|
1872
|
-
/**
|
|
1873
|
-
* Default value. This value is unused.
|
|
1874
|
-
*/
|
|
1875
|
-
MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
|
|
1876
|
-
/**
|
|
1877
|
-
* Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
|
|
1878
|
-
*/
|
|
1879
|
-
MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
|
|
1880
|
-
/**
|
|
1881
|
-
* `expression` is a substring of target.
|
|
1882
|
-
*/
|
|
1883
|
-
MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
|
|
1884
|
-
/**
|
|
1885
|
-
* `expression` is an exact match of target.
|
|
1886
|
-
*/
|
|
1887
|
-
MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
|
|
1888
|
-
})(exports.MatchOperation || (exports.MatchOperation = {}));
|
|
1889
|
-
/** Represents how much to think for the tuning job. */
|
|
1890
|
-
exports.ReinforcementTuningThinkingLevel = void 0;
|
|
1891
|
-
(function (ReinforcementTuningThinkingLevel) {
|
|
1892
|
-
/**
|
|
1893
|
-
* Unspecified thinking level.
|
|
1894
|
-
*/
|
|
1895
|
-
ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
|
|
1896
|
-
/**
|
|
1897
|
-
* Little to no thinking.
|
|
1898
|
-
*/
|
|
1899
|
-
ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
1900
|
-
/**
|
|
1901
|
-
* High thinking level.
|
|
1902
|
-
*/
|
|
1903
|
-
ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
|
|
1904
|
-
})(exports.ReinforcementTuningThinkingLevel || (exports.ReinforcementTuningThinkingLevel = {}));
|
|
1905
2009
|
/** Enum representing the tuning method. */
|
|
1906
2010
|
exports.TuningMethod = void 0;
|
|
1907
2011
|
(function (TuningMethod) {
|
|
@@ -2698,6 +2802,21 @@ class ListModelsResponse {
|
|
|
2698
2802
|
}
|
|
2699
2803
|
class DeleteModelResponse {
|
|
2700
2804
|
}
|
|
2805
|
+
/** Configuration for audio-specific output formatting. */
|
|
2806
|
+
class AudioResponseFormat {
|
|
2807
|
+
}
|
|
2808
|
+
/** Configuration for image-specific output formatting. */
|
|
2809
|
+
class ImageResponseFormat {
|
|
2810
|
+
}
|
|
2811
|
+
/** Configuration for text-specific output formatting. */
|
|
2812
|
+
class TextResponseFormat {
|
|
2813
|
+
}
|
|
2814
|
+
/** Configuration for video-specific output formatting. This data type is not supported in Gemini API. */
|
|
2815
|
+
class VideoResponseFormat {
|
|
2816
|
+
}
|
|
2817
|
+
/** Configuration for the model to configure output formatting and delivery. This data type is not supported in Gemini API. */
|
|
2818
|
+
class ResponseFormat {
|
|
2819
|
+
}
|
|
2701
2820
|
/** Response for counting tokens. */
|
|
2702
2821
|
class CountTokensResponse {
|
|
2703
2822
|
}
|
|
@@ -2726,10 +2845,10 @@ class GenerateVideosOperation {
|
|
|
2726
2845
|
return operation;
|
|
2727
2846
|
}
|
|
2728
2847
|
}
|
|
2729
|
-
/** Defines how to parse sample response for reinforcement tuning. */
|
|
2848
|
+
/** Defines how to parse sample response config for reinforcement tuning. The parsed response (i.e., substring) will be passed to the reward functions. For example, the input prompt might be: > "Perform step-by-step thoughts first to problem A, finally output answer in the <ans> </ans> block." The sample response from the model under tuning might look like: > "<ans>Yes</ans>" Here, users can define the following parse config: ``` { "parseType": "REGEX_EXTRACT", "regexExtractExpression": ".*(.*?)" } ``` The resulting parsed response would be `"Yes"` and will be passed to the reward functions for evaluating rewards. This data type is not supported in Gemini API. */
|
|
2730
2849
|
class ReinforcementTuningParseResponseConfig {
|
|
2731
2850
|
}
|
|
2732
|
-
/** Scores responses by directly converting parsed autorater response to float reward
|
|
2851
|
+
/** Scores responses by directly converting the parsed autorater response to a float reward. Note: Reward is clipped to be within `[-1, 1]`, i.e., `reward = max(min(reward, 1.0), -1.0)`. This data type is not supported in Gemini API. */
|
|
2733
2852
|
class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
|
|
2734
2853
|
}
|
|
2735
2854
|
/** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
|
|
@@ -5169,6 +5288,9 @@ function toolToMldev$4(fromObject) {
|
|
|
5169
5288
|
}
|
|
5170
5289
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
5171
5290
|
}
|
|
5291
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
5292
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5293
|
+
}
|
|
5172
5294
|
return toObject;
|
|
5173
5295
|
}
|
|
5174
5296
|
function vertexMultimodalDatasetDestinationFromVertex(fromObject) {
|
|
@@ -6639,6 +6761,9 @@ function toolToMldev$3(fromObject) {
|
|
|
6639
6761
|
}
|
|
6640
6762
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
6641
6763
|
}
|
|
6764
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
6765
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
6766
|
+
}
|
|
6642
6767
|
return toObject;
|
|
6643
6768
|
}
|
|
6644
6769
|
function toolToVertex$2(fromObject) {
|
|
@@ -6712,6 +6837,10 @@ function toolToVertex$2(fromObject) {
|
|
|
6712
6837
|
}
|
|
6713
6838
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
6714
6839
|
}
|
|
6840
|
+
const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
|
|
6841
|
+
if (fromExaAiSearch != null) {
|
|
6842
|
+
setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
|
|
6843
|
+
}
|
|
6715
6844
|
return toObject;
|
|
6716
6845
|
}
|
|
6717
6846
|
function updateCachedContentConfigToMldev(fromObject, parentObject) {
|
|
@@ -7800,7 +7929,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
7800
7929
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
7801
7930
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
7802
7931
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
7803
|
-
const SDK_VERSION = '2.
|
|
7932
|
+
const SDK_VERSION = '2.12.0'; // x-release-please-version
|
|
7804
7933
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
7805
7934
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
7806
7935
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -9665,17 +9794,14 @@ function env() {
|
|
|
9665
9794
|
* Populates global parameters with environment variables.
|
|
9666
9795
|
*/
|
|
9667
9796
|
function fillGlobals(options) {
|
|
9668
|
-
var _a, _b
|
|
9797
|
+
var _a, _b;
|
|
9669
9798
|
const clone = Object.assign({}, options);
|
|
9670
9799
|
const envVars = env();
|
|
9671
9800
|
if (typeof envVars.GOOGLE_GENAI_API_VERSION !== "undefined") {
|
|
9672
9801
|
(_a = clone.api_version) !== null && _a !== void 0 ? _a : (clone.api_version = envVars.GOOGLE_GENAI_API_VERSION);
|
|
9673
9802
|
}
|
|
9674
|
-
if (typeof envVars.GOOGLE_GENAI_API_REVISION !== "undefined") {
|
|
9675
|
-
(_b = clone.api_revision) !== null && _b !== void 0 ? _b : (clone.api_revision = envVars.GOOGLE_GENAI_API_REVISION);
|
|
9676
|
-
}
|
|
9677
9803
|
if (typeof envVars.GOOGLE_GENAI_USER_PROJECT !== "undefined") {
|
|
9678
|
-
(
|
|
9804
|
+
(_b = clone.user_project) !== null && _b !== void 0 ? _b : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
|
|
9679
9805
|
}
|
|
9680
9806
|
return clone;
|
|
9681
9807
|
}
|
|
@@ -9687,7 +9813,6 @@ function fillGlobals(options) {
|
|
|
9687
9813
|
*
|
|
9688
9814
|
* g3-prettier-ignore-file
|
|
9689
9815
|
*/
|
|
9690
|
-
const GOOGLE_GENAI_API_REVISION = "2026-05-20";
|
|
9691
9816
|
class GoogleGenAISecurityProvider {
|
|
9692
9817
|
constructor(options) {
|
|
9693
9818
|
this.options = options;
|
|
@@ -9705,7 +9830,6 @@ class GoogleGenAIAuthHook {
|
|
|
9705
9830
|
}
|
|
9706
9831
|
async beforeRequest(hookCtx, request) {
|
|
9707
9832
|
applyDefaultHeaders(request.headers, getStaticDefaultHeaders(hookCtx.security_source));
|
|
9708
|
-
applyApiRevision(hookCtx, request.headers);
|
|
9709
9833
|
applyUserProject(hookCtx, request.headers);
|
|
9710
9834
|
if (hasAuthHeaders(request.headers)) {
|
|
9711
9835
|
return request;
|
|
@@ -9785,12 +9909,6 @@ function applyDefaultHeaders(target, source) {
|
|
|
9785
9909
|
}
|
|
9786
9910
|
}
|
|
9787
9911
|
}
|
|
9788
|
-
function applyApiRevision(hookCtx, headers) {
|
|
9789
|
-
var _a;
|
|
9790
|
-
if (headers.get("api-revision") === null) {
|
|
9791
|
-
headers.set("Api-Revision", (_a = hookCtx.options.api_revision) !== null && _a !== void 0 ? _a : GOOGLE_GENAI_API_REVISION);
|
|
9792
|
-
}
|
|
9793
|
-
}
|
|
9794
9912
|
function applyUserProject(hookCtx, headers) {
|
|
9795
9913
|
if (hookCtx.options.user_project !== undefined &&
|
|
9796
9914
|
headers.get("x-goog-user-project") === null) {
|
|
@@ -10322,7 +10440,7 @@ function serverURLFromOptions(options) {
|
|
|
10322
10440
|
return new URL(u);
|
|
10323
10441
|
}
|
|
10324
10442
|
const SDK_METADATA = {
|
|
10325
|
-
userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.
|
|
10443
|
+
userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.913.3 v1beta @google/genai",
|
|
10326
10444
|
};
|
|
10327
10445
|
|
|
10328
10446
|
/**
|
|
@@ -11963,9 +12081,9 @@ function unwrapAsAPIPromise(p) {
|
|
|
11963
12081
|
* Creates a new Agent (Typed version for SDK).
|
|
11964
12082
|
*/
|
|
11965
12083
|
function agentsCreate(client, body, api_version, options) {
|
|
11966
|
-
return new APIPromise($do$
|
|
12084
|
+
return new APIPromise($do$l(client, body, api_version, options));
|
|
11967
12085
|
}
|
|
11968
|
-
async function $do$
|
|
12086
|
+
async function $do$l(client, body, api_version, options) {
|
|
11969
12087
|
var _a, _b, _c;
|
|
11970
12088
|
const input = {
|
|
11971
12089
|
body: body,
|
|
@@ -12048,9 +12166,9 @@ async function $do$e(client, body, api_version, options) {
|
|
|
12048
12166
|
* Deletes an Agent.
|
|
12049
12167
|
*/
|
|
12050
12168
|
function agentsDelete(client, id, api_version, options) {
|
|
12051
|
-
return new APIPromise($do$
|
|
12169
|
+
return new APIPromise($do$k(client, id, api_version, options));
|
|
12052
12170
|
}
|
|
12053
|
-
async function $do$
|
|
12171
|
+
async function $do$k(client, id, api_version, options) {
|
|
12054
12172
|
var _a, _b, _c;
|
|
12055
12173
|
const input = {
|
|
12056
12174
|
id: id,
|
|
@@ -12136,9 +12254,9 @@ async function $do$d(client, id, api_version, options) {
|
|
|
12136
12254
|
* Gets a specific Agent.
|
|
12137
12255
|
*/
|
|
12138
12256
|
function agentsGet(client, id, api_version, options) {
|
|
12139
|
-
return new APIPromise($do$
|
|
12257
|
+
return new APIPromise($do$j(client, id, api_version, options));
|
|
12140
12258
|
}
|
|
12141
|
-
async function $do$
|
|
12259
|
+
async function $do$j(client, id, api_version, options) {
|
|
12142
12260
|
var _a, _b, _c;
|
|
12143
12261
|
const input = {
|
|
12144
12262
|
id: id,
|
|
@@ -12224,9 +12342,9 @@ async function $do$c(client, id, api_version, options) {
|
|
|
12224
12342
|
* Lists all Agents.
|
|
12225
12343
|
*/
|
|
12226
12344
|
function agentsList(client, api_version, page_size, page_token, parent, options) {
|
|
12227
|
-
return new APIPromise($do$
|
|
12345
|
+
return new APIPromise($do$i(client, api_version, page_size, page_token, parent, options));
|
|
12228
12346
|
}
|
|
12229
|
-
async function $do$
|
|
12347
|
+
async function $do$i(client, api_version, page_size, page_token, parent, options) {
|
|
12230
12348
|
var _a, _b, _c;
|
|
12231
12349
|
const input = {
|
|
12232
12350
|
api_version: api_version,
|
|
@@ -12498,9 +12616,9 @@ class GetInteractionByIdClientError extends GoogleGenAiError {
|
|
|
12498
12616
|
* Cancels an interaction by id. This only applies to background interactions that are still running.
|
|
12499
12617
|
*/
|
|
12500
12618
|
function interactionsCancel(client, id, api_version, options) {
|
|
12501
|
-
return new APIPromise($do$
|
|
12619
|
+
return new APIPromise($do$h(client, id, api_version, options));
|
|
12502
12620
|
}
|
|
12503
|
-
async function $do$
|
|
12621
|
+
async function $do$h(client, id, api_version, options) {
|
|
12504
12622
|
var _a, _b, _c;
|
|
12505
12623
|
const input = {
|
|
12506
12624
|
id: id,
|
|
@@ -12586,9 +12704,9 @@ async function $do$a(client, id, api_version, options) {
|
|
|
12586
12704
|
* g3-prettier-ignore-file
|
|
12587
12705
|
*/
|
|
12588
12706
|
function interactionsCreate(client, body, api_version, options) {
|
|
12589
|
-
return new APIPromise($do$
|
|
12707
|
+
return new APIPromise($do$g(client, body, api_version, options));
|
|
12590
12708
|
}
|
|
12591
|
-
async function $do$
|
|
12709
|
+
async function $do$g(client, body, api_version, options) {
|
|
12592
12710
|
var _a, _b, _c, _d;
|
|
12593
12711
|
const input = {
|
|
12594
12712
|
body: body,
|
|
@@ -12680,9 +12798,9 @@ async function $do$9(client, body, api_version, options) {
|
|
|
12680
12798
|
* Deletes the interaction by id.
|
|
12681
12799
|
*/
|
|
12682
12800
|
function interactionsDelete(client, id, api_version, options) {
|
|
12683
|
-
return new APIPromise($do$
|
|
12801
|
+
return new APIPromise($do$f(client, id, api_version, options));
|
|
12684
12802
|
}
|
|
12685
|
-
async function $do$
|
|
12803
|
+
async function $do$f(client, id, api_version, options) {
|
|
12686
12804
|
var _a, _b, _c;
|
|
12687
12805
|
const input = {
|
|
12688
12806
|
id: id,
|
|
@@ -12768,9 +12886,9 @@ async function $do$8(client, id, api_version, options) {
|
|
|
12768
12886
|
* g3-prettier-ignore-file
|
|
12769
12887
|
*/
|
|
12770
12888
|
function interactionsGet(client, id, stream, last_event_id, include_input, api_version, options) {
|
|
12771
|
-
return new APIPromise($do$
|
|
12889
|
+
return new APIPromise($do$e(client, id, stream, last_event_id, include_input, api_version, options));
|
|
12772
12890
|
}
|
|
12773
|
-
async function $do$
|
|
12891
|
+
async function $do$e(client, id, stream, last_event_id, include_input, api_version, options) {
|
|
12774
12892
|
var _a, _b, _c;
|
|
12775
12893
|
const input = {
|
|
12776
12894
|
id: id,
|
|
@@ -12903,12 +13021,12 @@ class Interactions extends ClientSDK {
|
|
|
12903
13021
|
* g3-prettier-ignore-file
|
|
12904
13022
|
*/
|
|
12905
13023
|
/**
|
|
12906
|
-
* Creates a new
|
|
13024
|
+
* Creates a new trigger that will invoke the specified agent on the given cron schedule.
|
|
12907
13025
|
*/
|
|
12908
|
-
function
|
|
12909
|
-
return new APIPromise($do$
|
|
13026
|
+
function triggersCreate(client, body, api_version, options) {
|
|
13027
|
+
return new APIPromise($do$d(client, body, api_version, options));
|
|
12910
13028
|
}
|
|
12911
|
-
async function $do$
|
|
13029
|
+
async function $do$d(client, body, api_version, options) {
|
|
12912
13030
|
var _a, _b, _c;
|
|
12913
13031
|
const input = {
|
|
12914
13032
|
body: body,
|
|
@@ -12919,7 +13037,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
12919
13037
|
const pathParams = {
|
|
12920
13038
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
12921
13039
|
};
|
|
12922
|
-
const path = pathToFunc("/{api_version}/
|
|
13040
|
+
const path = pathToFunc("/{api_version}/triggers")(pathParams);
|
|
12923
13041
|
const headers = new Headers(compactMap({
|
|
12924
13042
|
"Content-Type": "application/json",
|
|
12925
13043
|
Accept: "application/json",
|
|
@@ -12929,7 +13047,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
12929
13047
|
const context = {
|
|
12930
13048
|
options: client._options,
|
|
12931
13049
|
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 : "",
|
|
12932
|
-
operation_id: "
|
|
13050
|
+
operation_id: "CreateTrigger",
|
|
12933
13051
|
o_auth2_scopes: null,
|
|
12934
13052
|
resolved_security: requestSecurity,
|
|
12935
13053
|
security_source: client._options.security,
|
|
@@ -12973,7 +13091,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
12973
13091
|
return [doResult, { status: "request-error", request: req }];
|
|
12974
13092
|
}
|
|
12975
13093
|
const response = doResult.value;
|
|
12976
|
-
const [result] = await match(
|
|
13094
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
12977
13095
|
if (!result.ok) {
|
|
12978
13096
|
return [result, { status: "complete", request: req, response }];
|
|
12979
13097
|
}
|
|
@@ -12988,12 +13106,12 @@ async function $do$6(client, body, api_version, options) {
|
|
|
12988
13106
|
* g3-prettier-ignore-file
|
|
12989
13107
|
*/
|
|
12990
13108
|
/**
|
|
12991
|
-
* Deletes a
|
|
13109
|
+
* Deletes a trigger.
|
|
12992
13110
|
*/
|
|
12993
|
-
function
|
|
12994
|
-
return new APIPromise($do$
|
|
13111
|
+
function triggersDelete(client, id, api_version, options) {
|
|
13112
|
+
return new APIPromise($do$c(client, id, api_version, options));
|
|
12995
13113
|
}
|
|
12996
|
-
async function $do$
|
|
13114
|
+
async function $do$c(client, id, api_version, options) {
|
|
12997
13115
|
var _a, _b, _c;
|
|
12998
13116
|
const input = {
|
|
12999
13117
|
id: id,
|
|
@@ -13008,7 +13126,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
13008
13126
|
charEncoding: "percent",
|
|
13009
13127
|
}),
|
|
13010
13128
|
};
|
|
13011
|
-
const path = pathToFunc("/{api_version}/
|
|
13129
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
13012
13130
|
const headers = new Headers(compactMap({
|
|
13013
13131
|
Accept: "application/json",
|
|
13014
13132
|
}));
|
|
@@ -13017,7 +13135,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
13017
13135
|
const context = {
|
|
13018
13136
|
options: client._options,
|
|
13019
13137
|
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 : "",
|
|
13020
|
-
operation_id: "
|
|
13138
|
+
operation_id: "DeleteTrigger",
|
|
13021
13139
|
o_auth2_scopes: null,
|
|
13022
13140
|
resolved_security: requestSecurity,
|
|
13023
13141
|
security_source: client._options.security,
|
|
@@ -13061,7 +13179,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
13061
13179
|
return [doResult, { status: "request-error", request: req }];
|
|
13062
13180
|
}
|
|
13063
13181
|
const response = doResult.value;
|
|
13064
|
-
const [result] = await match(
|
|
13182
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13065
13183
|
if (!result.ok) {
|
|
13066
13184
|
return [result, { status: "complete", request: req, response }];
|
|
13067
13185
|
}
|
|
@@ -13076,12 +13194,12 @@ async function $do$5(client, id, api_version, options) {
|
|
|
13076
13194
|
* g3-prettier-ignore-file
|
|
13077
13195
|
*/
|
|
13078
13196
|
/**
|
|
13079
|
-
* Gets a
|
|
13197
|
+
* Gets details of a single trigger.
|
|
13080
13198
|
*/
|
|
13081
|
-
function
|
|
13082
|
-
return new APIPromise($do$
|
|
13199
|
+
function triggersGet(client, id, api_version, options) {
|
|
13200
|
+
return new APIPromise($do$b(client, id, api_version, options));
|
|
13083
13201
|
}
|
|
13084
|
-
async function $do$
|
|
13202
|
+
async function $do$b(client, id, api_version, options) {
|
|
13085
13203
|
var _a, _b, _c;
|
|
13086
13204
|
const input = {
|
|
13087
13205
|
id: id,
|
|
@@ -13096,7 +13214,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
13096
13214
|
charEncoding: "percent",
|
|
13097
13215
|
}),
|
|
13098
13216
|
};
|
|
13099
|
-
const path = pathToFunc("/{api_version}/
|
|
13217
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
13100
13218
|
const headers = new Headers(compactMap({
|
|
13101
13219
|
Accept: "application/json",
|
|
13102
13220
|
}));
|
|
@@ -13105,7 +13223,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
13105
13223
|
const context = {
|
|
13106
13224
|
options: client._options,
|
|
13107
13225
|
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 : "",
|
|
13108
|
-
operation_id: "
|
|
13226
|
+
operation_id: "GetTrigger",
|
|
13109
13227
|
o_auth2_scopes: null,
|
|
13110
13228
|
resolved_security: requestSecurity,
|
|
13111
13229
|
security_source: client._options.security,
|
|
@@ -13149,7 +13267,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
13149
13267
|
return [doResult, { status: "request-error", request: req }];
|
|
13150
13268
|
}
|
|
13151
13269
|
const response = doResult.value;
|
|
13152
|
-
const [result] = await match(
|
|
13270
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13153
13271
|
if (!result.ok) {
|
|
13154
13272
|
return [result, { status: "complete", request: req, response }];
|
|
13155
13273
|
}
|
|
@@ -13164,14 +13282,15 @@ async function $do$4(client, id, api_version, options) {
|
|
|
13164
13282
|
* g3-prettier-ignore-file
|
|
13165
13283
|
*/
|
|
13166
13284
|
/**
|
|
13167
|
-
* Lists
|
|
13285
|
+
* Lists executions for a trigger.
|
|
13168
13286
|
*/
|
|
13169
|
-
function
|
|
13170
|
-
return new APIPromise($do$
|
|
13287
|
+
function triggersListExecutions(client, trigger_id, api_version, page_size, page_token, options) {
|
|
13288
|
+
return new APIPromise($do$a(client, trigger_id, api_version, page_size, page_token, options));
|
|
13171
13289
|
}
|
|
13172
|
-
async function $do$
|
|
13290
|
+
async function $do$a(client, trigger_id, api_version, page_size, page_token, options) {
|
|
13173
13291
|
var _a, _b, _c;
|
|
13174
13292
|
const input = {
|
|
13293
|
+
trigger_id: trigger_id,
|
|
13175
13294
|
api_version: api_version,
|
|
13176
13295
|
page_size: page_size,
|
|
13177
13296
|
page_token: page_token,
|
|
@@ -13179,12 +13298,16 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
13179
13298
|
const payload = input;
|
|
13180
13299
|
const body = null;
|
|
13181
13300
|
const pathParams = {
|
|
13182
|
-
api_version: encodeSimple("api_version", (_a = payload
|
|
13301
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13302
|
+
trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
|
|
13303
|
+
explode: false,
|
|
13304
|
+
charEncoding: "percent",
|
|
13305
|
+
}),
|
|
13183
13306
|
};
|
|
13184
|
-
const path = pathToFunc("/{api_version}/
|
|
13307
|
+
const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
|
|
13185
13308
|
const query = encodeFormQuery({
|
|
13186
|
-
"page_size": payload
|
|
13187
|
-
"page_token": payload
|
|
13309
|
+
"page_size": payload.page_size,
|
|
13310
|
+
"page_token": payload.page_token,
|
|
13188
13311
|
});
|
|
13189
13312
|
const headers = new Headers(compactMap({
|
|
13190
13313
|
Accept: "application/json",
|
|
@@ -13194,7 +13317,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
13194
13317
|
const context = {
|
|
13195
13318
|
options: client._options,
|
|
13196
13319
|
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 : "",
|
|
13197
|
-
operation_id: "
|
|
13320
|
+
operation_id: "ListTriggerExecutions",
|
|
13198
13321
|
o_auth2_scopes: null,
|
|
13199
13322
|
resolved_security: requestSecurity,
|
|
13200
13323
|
security_source: client._options.security,
|
|
@@ -13239,7 +13362,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
13239
13362
|
return [doResult, { status: "request-error", request: req }];
|
|
13240
13363
|
}
|
|
13241
13364
|
const response = doResult.value;
|
|
13242
|
-
const [result] = await match(
|
|
13365
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13243
13366
|
if (!result.ok) {
|
|
13244
13367
|
return [result, { status: "complete", request: req, response }];
|
|
13245
13368
|
}
|
|
@@ -13254,30 +13377,31 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
13254
13377
|
* g3-prettier-ignore-file
|
|
13255
13378
|
*/
|
|
13256
13379
|
/**
|
|
13257
|
-
*
|
|
13380
|
+
* Lists triggers for a project.
|
|
13258
13381
|
*/
|
|
13259
|
-
function
|
|
13260
|
-
return new APIPromise($do$
|
|
13382
|
+
function triggersList(client, api_version, filter, page_size, page_token, options) {
|
|
13383
|
+
return new APIPromise($do$9(client, api_version, filter, page_size, page_token, options));
|
|
13261
13384
|
}
|
|
13262
|
-
async function $do$
|
|
13385
|
+
async function $do$9(client, api_version, filter, page_size, page_token, options) {
|
|
13263
13386
|
var _a, _b, _c;
|
|
13264
13387
|
const input = {
|
|
13265
|
-
id: id,
|
|
13266
13388
|
api_version: api_version,
|
|
13267
|
-
|
|
13389
|
+
filter: filter,
|
|
13390
|
+
page_size: page_size,
|
|
13391
|
+
page_token: page_token,
|
|
13268
13392
|
};
|
|
13269
13393
|
const payload = input;
|
|
13270
|
-
const body
|
|
13394
|
+
const body = null;
|
|
13271
13395
|
const pathParams = {
|
|
13272
|
-
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13273
|
-
id: encodeSimple("id", payload.id, {
|
|
13274
|
-
explode: false,
|
|
13275
|
-
charEncoding: "percent",
|
|
13276
|
-
}),
|
|
13396
|
+
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" }),
|
|
13277
13397
|
};
|
|
13278
|
-
const path = pathToFunc("/{api_version}/
|
|
13398
|
+
const path = pathToFunc("/{api_version}/triggers")(pathParams);
|
|
13399
|
+
const query = encodeFormQuery({
|
|
13400
|
+
"filter": payload === null || payload === void 0 ? void 0 : payload.filter,
|
|
13401
|
+
"page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
|
|
13402
|
+
"page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
|
|
13403
|
+
});
|
|
13279
13404
|
const headers = new Headers(compactMap({
|
|
13280
|
-
"Content-Type": "application/json",
|
|
13281
13405
|
Accept: "application/json",
|
|
13282
13406
|
}));
|
|
13283
13407
|
const securityInput = await extractSecurity(client._options.security);
|
|
@@ -13285,7 +13409,7 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
13285
13409
|
const context = {
|
|
13286
13410
|
options: client._options,
|
|
13287
13411
|
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 : "",
|
|
13288
|
-
operation_id: "
|
|
13412
|
+
operation_id: "ListTriggers",
|
|
13289
13413
|
o_auth2_scopes: null,
|
|
13290
13414
|
resolved_security: requestSecurity,
|
|
13291
13415
|
security_source: client._options.security,
|
|
@@ -13307,11 +13431,12 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
13307
13431
|
};
|
|
13308
13432
|
const requestRes = client._createRequest(context, {
|
|
13309
13433
|
security: requestSecurity,
|
|
13310
|
-
method: "
|
|
13434
|
+
method: "GET",
|
|
13311
13435
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13312
13436
|
path: path,
|
|
13313
13437
|
headers: headers,
|
|
13314
|
-
|
|
13438
|
+
query: query,
|
|
13439
|
+
body: body,
|
|
13315
13440
|
userAgent: client._options.user_agent,
|
|
13316
13441
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13317
13442
|
}, options);
|
|
@@ -13329,7 +13454,7 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
13329
13454
|
return [doResult, { status: "request-error", request: req }];
|
|
13330
13455
|
}
|
|
13331
13456
|
const response = doResult.value;
|
|
13332
|
-
const [result] = await match(
|
|
13457
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13333
13458
|
if (!result.ok) {
|
|
13334
13459
|
return [result, { status: "complete", request: req, response }];
|
|
13335
13460
|
}
|
|
@@ -13344,30 +13469,28 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
13344
13469
|
* g3-prettier-ignore-file
|
|
13345
13470
|
*/
|
|
13346
13471
|
/**
|
|
13347
|
-
*
|
|
13472
|
+
* Runs a trigger immediately.
|
|
13348
13473
|
*/
|
|
13349
|
-
function
|
|
13350
|
-
return new APIPromise($do$
|
|
13474
|
+
function triggersRun(client, trigger_id, api_version, options) {
|
|
13475
|
+
return new APIPromise($do$8(client, trigger_id, api_version, options));
|
|
13351
13476
|
}
|
|
13352
|
-
async function $do$
|
|
13477
|
+
async function $do$8(client, trigger_id, api_version, options) {
|
|
13353
13478
|
var _a, _b, _c;
|
|
13354
13479
|
const input = {
|
|
13355
|
-
|
|
13480
|
+
trigger_id: trigger_id,
|
|
13356
13481
|
api_version: api_version,
|
|
13357
|
-
body: body,
|
|
13358
13482
|
};
|
|
13359
13483
|
const payload = input;
|
|
13360
|
-
const body
|
|
13484
|
+
const body = null;
|
|
13361
13485
|
const pathParams = {
|
|
13362
13486
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13363
|
-
|
|
13487
|
+
trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
|
|
13364
13488
|
explode: false,
|
|
13365
13489
|
charEncoding: "percent",
|
|
13366
13490
|
}),
|
|
13367
13491
|
};
|
|
13368
|
-
const path = pathToFunc("/{api_version}/
|
|
13492
|
+
const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
|
|
13369
13493
|
const headers = new Headers(compactMap({
|
|
13370
|
-
"Content-Type": "application/json",
|
|
13371
13494
|
Accept: "application/json",
|
|
13372
13495
|
}));
|
|
13373
13496
|
const securityInput = await extractSecurity(client._options.security);
|
|
@@ -13375,7 +13498,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
13375
13498
|
const context = {
|
|
13376
13499
|
options: client._options,
|
|
13377
13500
|
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 : "",
|
|
13378
|
-
operation_id: "
|
|
13501
|
+
operation_id: "RunTrigger",
|
|
13379
13502
|
o_auth2_scopes: null,
|
|
13380
13503
|
resolved_security: requestSecurity,
|
|
13381
13504
|
security_source: client._options.security,
|
|
@@ -13401,7 +13524,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
13401
13524
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13402
13525
|
path: path,
|
|
13403
13526
|
headers: headers,
|
|
13404
|
-
body: body
|
|
13527
|
+
body: body,
|
|
13405
13528
|
userAgent: client._options.user_agent,
|
|
13406
13529
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13407
13530
|
}, options);
|
|
@@ -13419,7 +13542,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
13419
13542
|
return [doResult, { status: "request-error", request: req }];
|
|
13420
13543
|
}
|
|
13421
13544
|
const response = doResult.value;
|
|
13422
|
-
const [result] = await match(
|
|
13545
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13423
13546
|
if (!result.ok) {
|
|
13424
13547
|
return [result, { status: "complete", request: req, response }];
|
|
13425
13548
|
}
|
|
@@ -13434,18 +13557,17 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
13434
13557
|
* g3-prettier-ignore-file
|
|
13435
13558
|
*/
|
|
13436
13559
|
/**
|
|
13437
|
-
* Updates
|
|
13560
|
+
* Updates a trigger.
|
|
13438
13561
|
*/
|
|
13439
|
-
function
|
|
13440
|
-
return new APIPromise($do(client, id,
|
|
13562
|
+
function triggersUpdate(client, id, body, api_version, options) {
|
|
13563
|
+
return new APIPromise($do$7(client, id, body, api_version, options));
|
|
13441
13564
|
}
|
|
13442
|
-
async function $do(client, id,
|
|
13565
|
+
async function $do$7(client, id, body, api_version, options) {
|
|
13443
13566
|
var _a, _b, _c;
|
|
13444
13567
|
const input = {
|
|
13445
13568
|
id: id,
|
|
13446
|
-
api_version: api_version,
|
|
13447
|
-
update_mask: update_mask,
|
|
13448
13569
|
body: body,
|
|
13570
|
+
api_version: api_version,
|
|
13449
13571
|
};
|
|
13450
13572
|
const payload = input;
|
|
13451
13573
|
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
@@ -13456,10 +13578,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
13456
13578
|
charEncoding: "percent",
|
|
13457
13579
|
}),
|
|
13458
13580
|
};
|
|
13459
|
-
const path = pathToFunc("/{api_version}/
|
|
13460
|
-
const query = encodeFormQuery({
|
|
13461
|
-
"update_mask": payload.update_mask,
|
|
13462
|
-
});
|
|
13581
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
13463
13582
|
const headers = new Headers(compactMap({
|
|
13464
13583
|
"Content-Type": "application/json",
|
|
13465
13584
|
Accept: "application/json",
|
|
@@ -13469,7 +13588,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
13469
13588
|
const context = {
|
|
13470
13589
|
options: client._options,
|
|
13471
13590
|
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 : "",
|
|
13472
|
-
operation_id: "
|
|
13591
|
+
operation_id: "UpdateTrigger",
|
|
13473
13592
|
o_auth2_scopes: null,
|
|
13474
13593
|
resolved_security: requestSecurity,
|
|
13475
13594
|
security_source: client._options.security,
|
|
@@ -13495,7 +13614,6 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
13495
13614
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13496
13615
|
path: path,
|
|
13497
13616
|
headers: headers,
|
|
13498
|
-
query: query,
|
|
13499
13617
|
body: body$,
|
|
13500
13618
|
userAgent: client._options.user_agent,
|
|
13501
13619
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
@@ -13514,7 +13632,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
13514
13632
|
return [doResult, { status: "request-error", request: req }];
|
|
13515
13633
|
}
|
|
13516
13634
|
const response = doResult.value;
|
|
13517
|
-
const [result] = await match(
|
|
13635
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13518
13636
|
if (!result.ok) {
|
|
13519
13637
|
return [result, { status: "complete", request: req, response }];
|
|
13520
13638
|
}
|
|
@@ -13528,28 +13646,708 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
13528
13646
|
*
|
|
13529
13647
|
* g3-prettier-ignore-file
|
|
13530
13648
|
*/
|
|
13531
|
-
class
|
|
13649
|
+
class Triggers extends ClientSDK {
|
|
13532
13650
|
/**
|
|
13533
|
-
* Creates a new
|
|
13651
|
+
* Creates a new trigger that will invoke the specified agent on the given cron schedule.
|
|
13534
13652
|
*/
|
|
13535
13653
|
create(params, options) {
|
|
13536
13654
|
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
13537
|
-
return unwrapAsAPIPromise(
|
|
13655
|
+
return unwrapAsAPIPromise(triggersCreate(this, body, api_version, options));
|
|
13538
13656
|
}
|
|
13539
13657
|
/**
|
|
13540
|
-
* Lists
|
|
13658
|
+
* Lists triggers for a project.
|
|
13541
13659
|
*/
|
|
13542
13660
|
list(params, options) {
|
|
13543
|
-
return unwrapAsAPIPromise(
|
|
13661
|
+
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));
|
|
13544
13662
|
}
|
|
13545
13663
|
/**
|
|
13546
|
-
* Gets a
|
|
13664
|
+
* Gets details of a single trigger.
|
|
13547
13665
|
*/
|
|
13548
13666
|
get(id, params, options) {
|
|
13549
|
-
return unwrapAsAPIPromise(
|
|
13667
|
+
return unwrapAsAPIPromise(triggersGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
13550
13668
|
}
|
|
13551
13669
|
/**
|
|
13552
|
-
* Updates
|
|
13670
|
+
* Updates a trigger.
|
|
13671
|
+
*/
|
|
13672
|
+
update(id, params, options) {
|
|
13673
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
13674
|
+
return unwrapAsAPIPromise(triggersUpdate(this, id, body, api_version, options));
|
|
13675
|
+
}
|
|
13676
|
+
/**
|
|
13677
|
+
* Deletes a trigger.
|
|
13678
|
+
*/
|
|
13679
|
+
delete(id, params, options) {
|
|
13680
|
+
return unwrapAsAPIPromise(triggersDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
13681
|
+
}
|
|
13682
|
+
/**
|
|
13683
|
+
* Runs a trigger immediately.
|
|
13684
|
+
*/
|
|
13685
|
+
run(trigger_id, params, options) {
|
|
13686
|
+
return unwrapAsAPIPromise(triggersRun(this, trigger_id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
13687
|
+
}
|
|
13688
|
+
/**
|
|
13689
|
+
* Lists executions for a trigger.
|
|
13690
|
+
*/
|
|
13691
|
+
listExecutions(trigger_id, params, options) {
|
|
13692
|
+
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));
|
|
13693
|
+
}
|
|
13694
|
+
}
|
|
13695
|
+
|
|
13696
|
+
/**
|
|
13697
|
+
* @license
|
|
13698
|
+
* Copyright 2026 Google LLC
|
|
13699
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13700
|
+
*
|
|
13701
|
+
* g3-prettier-ignore-file
|
|
13702
|
+
*/
|
|
13703
|
+
/**
|
|
13704
|
+
* Creates a new Webhook.
|
|
13705
|
+
*/
|
|
13706
|
+
function webhooksCreate(client, body, api_version, options) {
|
|
13707
|
+
return new APIPromise($do$6(client, body, api_version, options));
|
|
13708
|
+
}
|
|
13709
|
+
async function $do$6(client, body, api_version, options) {
|
|
13710
|
+
var _a, _b, _c;
|
|
13711
|
+
const input = {
|
|
13712
|
+
body: body,
|
|
13713
|
+
api_version: api_version,
|
|
13714
|
+
};
|
|
13715
|
+
const payload = input;
|
|
13716
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
13717
|
+
const pathParams = {
|
|
13718
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13719
|
+
};
|
|
13720
|
+
const path = pathToFunc("/{api_version}/webhooks")(pathParams);
|
|
13721
|
+
const headers = new Headers(compactMap({
|
|
13722
|
+
"Content-Type": "application/json",
|
|
13723
|
+
Accept: "application/json",
|
|
13724
|
+
}));
|
|
13725
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
13726
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
13727
|
+
const context = {
|
|
13728
|
+
options: client._options,
|
|
13729
|
+
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 : "",
|
|
13730
|
+
operation_id: "CreateWebhook",
|
|
13731
|
+
o_auth2_scopes: null,
|
|
13732
|
+
resolved_security: requestSecurity,
|
|
13733
|
+
security_source: client._options.security,
|
|
13734
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
13735
|
+
|| client._options.retry_config
|
|
13736
|
+
|| {
|
|
13737
|
+
strategy: "attempt-count-backoff",
|
|
13738
|
+
backoff: {
|
|
13739
|
+
initialInterval: 500,
|
|
13740
|
+
maxInterval: 8000,
|
|
13741
|
+
exponent: 2,
|
|
13742
|
+
maxElapsedTime: 30000,
|
|
13743
|
+
},
|
|
13744
|
+
retryConnectionErrors: true,
|
|
13745
|
+
maxRetries: 4,
|
|
13746
|
+
}
|
|
13747
|
+
|| { strategy: "none" },
|
|
13748
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
13749
|
+
};
|
|
13750
|
+
const requestRes = client._createRequest(context, {
|
|
13751
|
+
security: requestSecurity,
|
|
13752
|
+
method: "POST",
|
|
13753
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13754
|
+
path: path,
|
|
13755
|
+
headers: headers,
|
|
13756
|
+
body: body$,
|
|
13757
|
+
userAgent: client._options.user_agent,
|
|
13758
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13759
|
+
}, options);
|
|
13760
|
+
if (!requestRes.ok) {
|
|
13761
|
+
return [requestRes, { status: "invalid" }];
|
|
13762
|
+
}
|
|
13763
|
+
const req = requestRes.value;
|
|
13764
|
+
const doResult = await client._do(req, {
|
|
13765
|
+
context,
|
|
13766
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
13767
|
+
retryConfig: context.retry_config,
|
|
13768
|
+
retryCodes: context.retry_codes,
|
|
13769
|
+
});
|
|
13770
|
+
if (!doResult.ok) {
|
|
13771
|
+
return [doResult, { status: "request-error", request: req }];
|
|
13772
|
+
}
|
|
13773
|
+
const response = doResult.value;
|
|
13774
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
13775
|
+
if (!result.ok) {
|
|
13776
|
+
return [result, { status: "complete", request: req, response }];
|
|
13777
|
+
}
|
|
13778
|
+
return [result, { status: "complete", request: req, response }];
|
|
13779
|
+
}
|
|
13780
|
+
|
|
13781
|
+
/**
|
|
13782
|
+
* @license
|
|
13783
|
+
* Copyright 2026 Google LLC
|
|
13784
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13785
|
+
*
|
|
13786
|
+
* g3-prettier-ignore-file
|
|
13787
|
+
*/
|
|
13788
|
+
/**
|
|
13789
|
+
* Deletes a Webhook.
|
|
13790
|
+
*/
|
|
13791
|
+
function webhooksDelete(client, id, api_version, options) {
|
|
13792
|
+
return new APIPromise($do$5(client, id, api_version, options));
|
|
13793
|
+
}
|
|
13794
|
+
async function $do$5(client, id, api_version, options) {
|
|
13795
|
+
var _a, _b, _c;
|
|
13796
|
+
const input = {
|
|
13797
|
+
id: id,
|
|
13798
|
+
api_version: api_version,
|
|
13799
|
+
};
|
|
13800
|
+
const payload = input;
|
|
13801
|
+
const body = null;
|
|
13802
|
+
const pathParams = {
|
|
13803
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13804
|
+
id: encodeSimple("id", payload.id, {
|
|
13805
|
+
explode: false,
|
|
13806
|
+
charEncoding: "percent",
|
|
13807
|
+
}),
|
|
13808
|
+
};
|
|
13809
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
13810
|
+
const headers = new Headers(compactMap({
|
|
13811
|
+
Accept: "application/json",
|
|
13812
|
+
}));
|
|
13813
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
13814
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
13815
|
+
const context = {
|
|
13816
|
+
options: client._options,
|
|
13817
|
+
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 : "",
|
|
13818
|
+
operation_id: "DeleteWebhook",
|
|
13819
|
+
o_auth2_scopes: null,
|
|
13820
|
+
resolved_security: requestSecurity,
|
|
13821
|
+
security_source: client._options.security,
|
|
13822
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
13823
|
+
|| client._options.retry_config
|
|
13824
|
+
|| {
|
|
13825
|
+
strategy: "attempt-count-backoff",
|
|
13826
|
+
backoff: {
|
|
13827
|
+
initialInterval: 500,
|
|
13828
|
+
maxInterval: 8000,
|
|
13829
|
+
exponent: 2,
|
|
13830
|
+
maxElapsedTime: 30000,
|
|
13831
|
+
},
|
|
13832
|
+
retryConnectionErrors: true,
|
|
13833
|
+
maxRetries: 4,
|
|
13834
|
+
}
|
|
13835
|
+
|| { strategy: "none" },
|
|
13836
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
13837
|
+
};
|
|
13838
|
+
const requestRes = client._createRequest(context, {
|
|
13839
|
+
security: requestSecurity,
|
|
13840
|
+
method: "DELETE",
|
|
13841
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13842
|
+
path: path,
|
|
13843
|
+
headers: headers,
|
|
13844
|
+
body: body,
|
|
13845
|
+
userAgent: client._options.user_agent,
|
|
13846
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13847
|
+
}, options);
|
|
13848
|
+
if (!requestRes.ok) {
|
|
13849
|
+
return [requestRes, { status: "invalid" }];
|
|
13850
|
+
}
|
|
13851
|
+
const req = requestRes.value;
|
|
13852
|
+
const doResult = await client._do(req, {
|
|
13853
|
+
context,
|
|
13854
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
13855
|
+
retryConfig: context.retry_config,
|
|
13856
|
+
retryCodes: context.retry_codes,
|
|
13857
|
+
});
|
|
13858
|
+
if (!doResult.ok) {
|
|
13859
|
+
return [doResult, { status: "request-error", request: req }];
|
|
13860
|
+
}
|
|
13861
|
+
const response = doResult.value;
|
|
13862
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
13863
|
+
if (!result.ok) {
|
|
13864
|
+
return [result, { status: "complete", request: req, response }];
|
|
13865
|
+
}
|
|
13866
|
+
return [result, { status: "complete", request: req, response }];
|
|
13867
|
+
}
|
|
13868
|
+
|
|
13869
|
+
/**
|
|
13870
|
+
* @license
|
|
13871
|
+
* Copyright 2026 Google LLC
|
|
13872
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13873
|
+
*
|
|
13874
|
+
* g3-prettier-ignore-file
|
|
13875
|
+
*/
|
|
13876
|
+
/**
|
|
13877
|
+
* Gets a specific Webhook.
|
|
13878
|
+
*/
|
|
13879
|
+
function webhooksGet(client, id, api_version, options) {
|
|
13880
|
+
return new APIPromise($do$4(client, id, api_version, options));
|
|
13881
|
+
}
|
|
13882
|
+
async function $do$4(client, id, api_version, options) {
|
|
13883
|
+
var _a, _b, _c;
|
|
13884
|
+
const input = {
|
|
13885
|
+
id: id,
|
|
13886
|
+
api_version: api_version,
|
|
13887
|
+
};
|
|
13888
|
+
const payload = input;
|
|
13889
|
+
const body = null;
|
|
13890
|
+
const pathParams = {
|
|
13891
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13892
|
+
id: encodeSimple("id", payload.id, {
|
|
13893
|
+
explode: false,
|
|
13894
|
+
charEncoding: "percent",
|
|
13895
|
+
}),
|
|
13896
|
+
};
|
|
13897
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
13898
|
+
const headers = new Headers(compactMap({
|
|
13899
|
+
Accept: "application/json",
|
|
13900
|
+
}));
|
|
13901
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
13902
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
13903
|
+
const context = {
|
|
13904
|
+
options: client._options,
|
|
13905
|
+
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 : "",
|
|
13906
|
+
operation_id: "GetWebhook",
|
|
13907
|
+
o_auth2_scopes: null,
|
|
13908
|
+
resolved_security: requestSecurity,
|
|
13909
|
+
security_source: client._options.security,
|
|
13910
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
13911
|
+
|| client._options.retry_config
|
|
13912
|
+
|| {
|
|
13913
|
+
strategy: "attempt-count-backoff",
|
|
13914
|
+
backoff: {
|
|
13915
|
+
initialInterval: 500,
|
|
13916
|
+
maxInterval: 8000,
|
|
13917
|
+
exponent: 2,
|
|
13918
|
+
maxElapsedTime: 30000,
|
|
13919
|
+
},
|
|
13920
|
+
retryConnectionErrors: true,
|
|
13921
|
+
maxRetries: 4,
|
|
13922
|
+
}
|
|
13923
|
+
|| { strategy: "none" },
|
|
13924
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
13925
|
+
};
|
|
13926
|
+
const requestRes = client._createRequest(context, {
|
|
13927
|
+
security: requestSecurity,
|
|
13928
|
+
method: "GET",
|
|
13929
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13930
|
+
path: path,
|
|
13931
|
+
headers: headers,
|
|
13932
|
+
body: body,
|
|
13933
|
+
userAgent: client._options.user_agent,
|
|
13934
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13935
|
+
}, options);
|
|
13936
|
+
if (!requestRes.ok) {
|
|
13937
|
+
return [requestRes, { status: "invalid" }];
|
|
13938
|
+
}
|
|
13939
|
+
const req = requestRes.value;
|
|
13940
|
+
const doResult = await client._do(req, {
|
|
13941
|
+
context,
|
|
13942
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
13943
|
+
retryConfig: context.retry_config,
|
|
13944
|
+
retryCodes: context.retry_codes,
|
|
13945
|
+
});
|
|
13946
|
+
if (!doResult.ok) {
|
|
13947
|
+
return [doResult, { status: "request-error", request: req }];
|
|
13948
|
+
}
|
|
13949
|
+
const response = doResult.value;
|
|
13950
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
13951
|
+
if (!result.ok) {
|
|
13952
|
+
return [result, { status: "complete", request: req, response }];
|
|
13953
|
+
}
|
|
13954
|
+
return [result, { status: "complete", request: req, response }];
|
|
13955
|
+
}
|
|
13956
|
+
|
|
13957
|
+
/**
|
|
13958
|
+
* @license
|
|
13959
|
+
* Copyright 2026 Google LLC
|
|
13960
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13961
|
+
*
|
|
13962
|
+
* g3-prettier-ignore-file
|
|
13963
|
+
*/
|
|
13964
|
+
/**
|
|
13965
|
+
* Lists all Webhooks.
|
|
13966
|
+
*/
|
|
13967
|
+
function webhooksList(client, api_version, page_size, page_token, options) {
|
|
13968
|
+
return new APIPromise($do$3(client, api_version, page_size, page_token, options));
|
|
13969
|
+
}
|
|
13970
|
+
async function $do$3(client, api_version, page_size, page_token, options) {
|
|
13971
|
+
var _a, _b, _c;
|
|
13972
|
+
const input = {
|
|
13973
|
+
api_version: api_version,
|
|
13974
|
+
page_size: page_size,
|
|
13975
|
+
page_token: page_token,
|
|
13976
|
+
};
|
|
13977
|
+
const payload = input;
|
|
13978
|
+
const body = null;
|
|
13979
|
+
const pathParams = {
|
|
13980
|
+
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" }),
|
|
13981
|
+
};
|
|
13982
|
+
const path = pathToFunc("/{api_version}/webhooks")(pathParams);
|
|
13983
|
+
const query = encodeFormQuery({
|
|
13984
|
+
"page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
|
|
13985
|
+
"page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
|
|
13986
|
+
});
|
|
13987
|
+
const headers = new Headers(compactMap({
|
|
13988
|
+
Accept: "application/json",
|
|
13989
|
+
}));
|
|
13990
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
13991
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
13992
|
+
const context = {
|
|
13993
|
+
options: client._options,
|
|
13994
|
+
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 : "",
|
|
13995
|
+
operation_id: "ListWebhooks",
|
|
13996
|
+
o_auth2_scopes: null,
|
|
13997
|
+
resolved_security: requestSecurity,
|
|
13998
|
+
security_source: client._options.security,
|
|
13999
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
14000
|
+
|| client._options.retry_config
|
|
14001
|
+
|| {
|
|
14002
|
+
strategy: "attempt-count-backoff",
|
|
14003
|
+
backoff: {
|
|
14004
|
+
initialInterval: 500,
|
|
14005
|
+
maxInterval: 8000,
|
|
14006
|
+
exponent: 2,
|
|
14007
|
+
maxElapsedTime: 30000,
|
|
14008
|
+
},
|
|
14009
|
+
retryConnectionErrors: true,
|
|
14010
|
+
maxRetries: 4,
|
|
14011
|
+
}
|
|
14012
|
+
|| { strategy: "none" },
|
|
14013
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
14014
|
+
};
|
|
14015
|
+
const requestRes = client._createRequest(context, {
|
|
14016
|
+
security: requestSecurity,
|
|
14017
|
+
method: "GET",
|
|
14018
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
14019
|
+
path: path,
|
|
14020
|
+
headers: headers,
|
|
14021
|
+
query: query,
|
|
14022
|
+
body: body,
|
|
14023
|
+
userAgent: client._options.user_agent,
|
|
14024
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
14025
|
+
}, options);
|
|
14026
|
+
if (!requestRes.ok) {
|
|
14027
|
+
return [requestRes, { status: "invalid" }];
|
|
14028
|
+
}
|
|
14029
|
+
const req = requestRes.value;
|
|
14030
|
+
const doResult = await client._do(req, {
|
|
14031
|
+
context,
|
|
14032
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
14033
|
+
retryConfig: context.retry_config,
|
|
14034
|
+
retryCodes: context.retry_codes,
|
|
14035
|
+
});
|
|
14036
|
+
if (!doResult.ok) {
|
|
14037
|
+
return [doResult, { status: "request-error", request: req }];
|
|
14038
|
+
}
|
|
14039
|
+
const response = doResult.value;
|
|
14040
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
14041
|
+
if (!result.ok) {
|
|
14042
|
+
return [result, { status: "complete", request: req, response }];
|
|
14043
|
+
}
|
|
14044
|
+
return [result, { status: "complete", request: req, response }];
|
|
14045
|
+
}
|
|
14046
|
+
|
|
14047
|
+
/**
|
|
14048
|
+
* @license
|
|
14049
|
+
* Copyright 2026 Google LLC
|
|
14050
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14051
|
+
*
|
|
14052
|
+
* g3-prettier-ignore-file
|
|
14053
|
+
*/
|
|
14054
|
+
/**
|
|
14055
|
+
* Sends a ping event to a Webhook.
|
|
14056
|
+
*/
|
|
14057
|
+
function webhooksPing(client, id, api_version, body, options) {
|
|
14058
|
+
return new APIPromise($do$2(client, id, api_version, body, options));
|
|
14059
|
+
}
|
|
14060
|
+
async function $do$2(client, id, api_version, body, options) {
|
|
14061
|
+
var _a, _b, _c;
|
|
14062
|
+
const input = {
|
|
14063
|
+
id: id,
|
|
14064
|
+
api_version: api_version,
|
|
14065
|
+
body: body,
|
|
14066
|
+
};
|
|
14067
|
+
const payload = input;
|
|
14068
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
14069
|
+
const pathParams = {
|
|
14070
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
14071
|
+
id: encodeSimple("id", payload.id, {
|
|
14072
|
+
explode: false,
|
|
14073
|
+
charEncoding: "percent",
|
|
14074
|
+
}),
|
|
14075
|
+
};
|
|
14076
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}:ping")(pathParams);
|
|
14077
|
+
const headers = new Headers(compactMap({
|
|
14078
|
+
"Content-Type": "application/json",
|
|
14079
|
+
Accept: "application/json",
|
|
14080
|
+
}));
|
|
14081
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
14082
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
14083
|
+
const context = {
|
|
14084
|
+
options: client._options,
|
|
14085
|
+
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 : "",
|
|
14086
|
+
operation_id: "PingWebhook",
|
|
14087
|
+
o_auth2_scopes: null,
|
|
14088
|
+
resolved_security: requestSecurity,
|
|
14089
|
+
security_source: client._options.security,
|
|
14090
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
14091
|
+
|| client._options.retry_config
|
|
14092
|
+
|| {
|
|
14093
|
+
strategy: "attempt-count-backoff",
|
|
14094
|
+
backoff: {
|
|
14095
|
+
initialInterval: 500,
|
|
14096
|
+
maxInterval: 8000,
|
|
14097
|
+
exponent: 2,
|
|
14098
|
+
maxElapsedTime: 30000,
|
|
14099
|
+
},
|
|
14100
|
+
retryConnectionErrors: true,
|
|
14101
|
+
maxRetries: 4,
|
|
14102
|
+
}
|
|
14103
|
+
|| { strategy: "none" },
|
|
14104
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
14105
|
+
};
|
|
14106
|
+
const requestRes = client._createRequest(context, {
|
|
14107
|
+
security: requestSecurity,
|
|
14108
|
+
method: "POST",
|
|
14109
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
14110
|
+
path: path,
|
|
14111
|
+
headers: headers,
|
|
14112
|
+
body: body$,
|
|
14113
|
+
userAgent: client._options.user_agent,
|
|
14114
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
14115
|
+
}, options);
|
|
14116
|
+
if (!requestRes.ok) {
|
|
14117
|
+
return [requestRes, { status: "invalid" }];
|
|
14118
|
+
}
|
|
14119
|
+
const req = requestRes.value;
|
|
14120
|
+
const doResult = await client._do(req, {
|
|
14121
|
+
context,
|
|
14122
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
14123
|
+
retryConfig: context.retry_config,
|
|
14124
|
+
retryCodes: context.retry_codes,
|
|
14125
|
+
});
|
|
14126
|
+
if (!doResult.ok) {
|
|
14127
|
+
return [doResult, { status: "request-error", request: req }];
|
|
14128
|
+
}
|
|
14129
|
+
const response = doResult.value;
|
|
14130
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
14131
|
+
if (!result.ok) {
|
|
14132
|
+
return [result, { status: "complete", request: req, response }];
|
|
14133
|
+
}
|
|
14134
|
+
return [result, { status: "complete", request: req, response }];
|
|
14135
|
+
}
|
|
14136
|
+
|
|
14137
|
+
/**
|
|
14138
|
+
* @license
|
|
14139
|
+
* Copyright 2026 Google LLC
|
|
14140
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14141
|
+
*
|
|
14142
|
+
* g3-prettier-ignore-file
|
|
14143
|
+
*/
|
|
14144
|
+
/**
|
|
14145
|
+
* Generates a new signing secret for a Webhook.
|
|
14146
|
+
*/
|
|
14147
|
+
function webhooksRotateSigningSecret(client, id, api_version, body, options) {
|
|
14148
|
+
return new APIPromise($do$1(client, id, api_version, body, options));
|
|
14149
|
+
}
|
|
14150
|
+
async function $do$1(client, id, api_version, body, options) {
|
|
14151
|
+
var _a, _b, _c;
|
|
14152
|
+
const input = {
|
|
14153
|
+
id: id,
|
|
14154
|
+
api_version: api_version,
|
|
14155
|
+
body: body,
|
|
14156
|
+
};
|
|
14157
|
+
const payload = input;
|
|
14158
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
14159
|
+
const pathParams = {
|
|
14160
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
14161
|
+
id: encodeSimple("id", payload.id, {
|
|
14162
|
+
explode: false,
|
|
14163
|
+
charEncoding: "percent",
|
|
14164
|
+
}),
|
|
14165
|
+
};
|
|
14166
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}:rotateSigningSecret")(pathParams);
|
|
14167
|
+
const headers = new Headers(compactMap({
|
|
14168
|
+
"Content-Type": "application/json",
|
|
14169
|
+
Accept: "application/json",
|
|
14170
|
+
}));
|
|
14171
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
14172
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
14173
|
+
const context = {
|
|
14174
|
+
options: client._options,
|
|
14175
|
+
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 : "",
|
|
14176
|
+
operation_id: "RotateSigningSecret",
|
|
14177
|
+
o_auth2_scopes: null,
|
|
14178
|
+
resolved_security: requestSecurity,
|
|
14179
|
+
security_source: client._options.security,
|
|
14180
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
14181
|
+
|| client._options.retry_config
|
|
14182
|
+
|| {
|
|
14183
|
+
strategy: "attempt-count-backoff",
|
|
14184
|
+
backoff: {
|
|
14185
|
+
initialInterval: 500,
|
|
14186
|
+
maxInterval: 8000,
|
|
14187
|
+
exponent: 2,
|
|
14188
|
+
maxElapsedTime: 30000,
|
|
14189
|
+
},
|
|
14190
|
+
retryConnectionErrors: true,
|
|
14191
|
+
maxRetries: 4,
|
|
14192
|
+
}
|
|
14193
|
+
|| { strategy: "none" },
|
|
14194
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
14195
|
+
};
|
|
14196
|
+
const requestRes = client._createRequest(context, {
|
|
14197
|
+
security: requestSecurity,
|
|
14198
|
+
method: "POST",
|
|
14199
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
14200
|
+
path: path,
|
|
14201
|
+
headers: headers,
|
|
14202
|
+
body: body$,
|
|
14203
|
+
userAgent: client._options.user_agent,
|
|
14204
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
14205
|
+
}, options);
|
|
14206
|
+
if (!requestRes.ok) {
|
|
14207
|
+
return [requestRes, { status: "invalid" }];
|
|
14208
|
+
}
|
|
14209
|
+
const req = requestRes.value;
|
|
14210
|
+
const doResult = await client._do(req, {
|
|
14211
|
+
context,
|
|
14212
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
14213
|
+
retryConfig: context.retry_config,
|
|
14214
|
+
retryCodes: context.retry_codes,
|
|
14215
|
+
});
|
|
14216
|
+
if (!doResult.ok) {
|
|
14217
|
+
return [doResult, { status: "request-error", request: req }];
|
|
14218
|
+
}
|
|
14219
|
+
const response = doResult.value;
|
|
14220
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
14221
|
+
if (!result.ok) {
|
|
14222
|
+
return [result, { status: "complete", request: req, response }];
|
|
14223
|
+
}
|
|
14224
|
+
return [result, { status: "complete", request: req, response }];
|
|
14225
|
+
}
|
|
14226
|
+
|
|
14227
|
+
/**
|
|
14228
|
+
* @license
|
|
14229
|
+
* Copyright 2026 Google LLC
|
|
14230
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14231
|
+
*
|
|
14232
|
+
* g3-prettier-ignore-file
|
|
14233
|
+
*/
|
|
14234
|
+
/**
|
|
14235
|
+
* Updates an existing Webhook.
|
|
14236
|
+
*/
|
|
14237
|
+
function webhooksUpdate(client, id, api_version, update_mask, body, options) {
|
|
14238
|
+
return new APIPromise($do(client, id, api_version, update_mask, body, options));
|
|
14239
|
+
}
|
|
14240
|
+
async function $do(client, id, api_version, update_mask, body, options) {
|
|
14241
|
+
var _a, _b, _c;
|
|
14242
|
+
const input = {
|
|
14243
|
+
id: id,
|
|
14244
|
+
api_version: api_version,
|
|
14245
|
+
update_mask: update_mask,
|
|
14246
|
+
body: body,
|
|
14247
|
+
};
|
|
14248
|
+
const payload = input;
|
|
14249
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
14250
|
+
const pathParams = {
|
|
14251
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
14252
|
+
id: encodeSimple("id", payload.id, {
|
|
14253
|
+
explode: false,
|
|
14254
|
+
charEncoding: "percent",
|
|
14255
|
+
}),
|
|
14256
|
+
};
|
|
14257
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
14258
|
+
const query = encodeFormQuery({
|
|
14259
|
+
"update_mask": payload.update_mask,
|
|
14260
|
+
});
|
|
14261
|
+
const headers = new Headers(compactMap({
|
|
14262
|
+
"Content-Type": "application/json",
|
|
14263
|
+
Accept: "application/json",
|
|
14264
|
+
}));
|
|
14265
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
14266
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
14267
|
+
const context = {
|
|
14268
|
+
options: client._options,
|
|
14269
|
+
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 : "",
|
|
14270
|
+
operation_id: "UpdateWebhook",
|
|
14271
|
+
o_auth2_scopes: null,
|
|
14272
|
+
resolved_security: requestSecurity,
|
|
14273
|
+
security_source: client._options.security,
|
|
14274
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
14275
|
+
|| client._options.retry_config
|
|
14276
|
+
|| {
|
|
14277
|
+
strategy: "attempt-count-backoff",
|
|
14278
|
+
backoff: {
|
|
14279
|
+
initialInterval: 500,
|
|
14280
|
+
maxInterval: 8000,
|
|
14281
|
+
exponent: 2,
|
|
14282
|
+
maxElapsedTime: 30000,
|
|
14283
|
+
},
|
|
14284
|
+
retryConnectionErrors: true,
|
|
14285
|
+
maxRetries: 4,
|
|
14286
|
+
}
|
|
14287
|
+
|| { strategy: "none" },
|
|
14288
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
14289
|
+
};
|
|
14290
|
+
const requestRes = client._createRequest(context, {
|
|
14291
|
+
security: requestSecurity,
|
|
14292
|
+
method: "PATCH",
|
|
14293
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
14294
|
+
path: path,
|
|
14295
|
+
headers: headers,
|
|
14296
|
+
query: query,
|
|
14297
|
+
body: body$,
|
|
14298
|
+
userAgent: client._options.user_agent,
|
|
14299
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
14300
|
+
}, options);
|
|
14301
|
+
if (!requestRes.ok) {
|
|
14302
|
+
return [requestRes, { status: "invalid" }];
|
|
14303
|
+
}
|
|
14304
|
+
const req = requestRes.value;
|
|
14305
|
+
const doResult = await client._do(req, {
|
|
14306
|
+
context,
|
|
14307
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
14308
|
+
retryConfig: context.retry_config,
|
|
14309
|
+
retryCodes: context.retry_codes,
|
|
14310
|
+
});
|
|
14311
|
+
if (!doResult.ok) {
|
|
14312
|
+
return [doResult, { status: "request-error", request: req }];
|
|
14313
|
+
}
|
|
14314
|
+
const response = doResult.value;
|
|
14315
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
14316
|
+
if (!result.ok) {
|
|
14317
|
+
return [result, { status: "complete", request: req, response }];
|
|
14318
|
+
}
|
|
14319
|
+
return [result, { status: "complete", request: req, response }];
|
|
14320
|
+
}
|
|
14321
|
+
|
|
14322
|
+
/**
|
|
14323
|
+
* @license
|
|
14324
|
+
* Copyright 2026 Google LLC
|
|
14325
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14326
|
+
*
|
|
14327
|
+
* g3-prettier-ignore-file
|
|
14328
|
+
*/
|
|
14329
|
+
class Webhooks extends ClientSDK {
|
|
14330
|
+
/**
|
|
14331
|
+
* Creates a new Webhook.
|
|
14332
|
+
*/
|
|
14333
|
+
create(params, options) {
|
|
14334
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
14335
|
+
return unwrapAsAPIPromise(webhooksCreate(this, body, api_version, options));
|
|
14336
|
+
}
|
|
14337
|
+
/**
|
|
14338
|
+
* Lists all Webhooks.
|
|
14339
|
+
*/
|
|
14340
|
+
list(params, options) {
|
|
14341
|
+
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));
|
|
14342
|
+
}
|
|
14343
|
+
/**
|
|
14344
|
+
* Gets a specific Webhook.
|
|
14345
|
+
*/
|
|
14346
|
+
get(id, params, options) {
|
|
14347
|
+
return unwrapAsAPIPromise(webhooksGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
14348
|
+
}
|
|
14349
|
+
/**
|
|
14350
|
+
* Updates an existing Webhook.
|
|
13553
14351
|
*/
|
|
13554
14352
|
update(id, params, options) {
|
|
13555
14353
|
const _a = params !== null && params !== void 0 ? params : {}, { api_version, update_mask } = _a, body$body = __rest(_a, ["api_version", "update_mask"]);
|
|
@@ -13601,6 +14399,10 @@ let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
|
|
|
13601
14399
|
var _a;
|
|
13602
14400
|
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Agents(this._options)));
|
|
13603
14401
|
}
|
|
14402
|
+
get triggers() {
|
|
14403
|
+
var _a;
|
|
14404
|
+
return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Triggers(this._options)));
|
|
14405
|
+
}
|
|
13604
14406
|
};
|
|
13605
14407
|
|
|
13606
14408
|
/**
|
|
@@ -13632,11 +14434,11 @@ function getGoogleGenAIAPIVersion(parentClient) {
|
|
|
13632
14434
|
return apiVersion;
|
|
13633
14435
|
}
|
|
13634
14436
|
function buildGoogleGenAIClient(parentClient, options = {}) {
|
|
13635
|
-
var _a, _b, _c, _d;
|
|
14437
|
+
var _a, _b, _c, _d, _e;
|
|
13636
14438
|
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({
|
|
13637
|
-
defaultHeaders: (_c = parentClient.getDefaultHeaders) === null || _c === void 0 ? void 0 : _c.call(parentClient),
|
|
14439
|
+
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)),
|
|
13638
14440
|
getAuthHeaders: (url) => parentClient.getAuthHeaders(url),
|
|
13639
|
-
}), server_url: (
|
|
14441
|
+
}), server_url: (_e = options.server_url) !== null && _e !== void 0 ? _e : getGoogleGenAIServerURL(parentClient) }));
|
|
13640
14442
|
return sdk;
|
|
13641
14443
|
}
|
|
13642
14444
|
class GeminiNextGenInteractions {
|
|
@@ -13743,6 +14545,46 @@ class GeminiNextGenWebhooks {
|
|
|
13743
14545
|
return this.sdk;
|
|
13744
14546
|
}
|
|
13745
14547
|
}
|
|
14548
|
+
class GeminiNextGenTriggers {
|
|
14549
|
+
constructor(parentClient) {
|
|
14550
|
+
this.parentClient = parentClient;
|
|
14551
|
+
}
|
|
14552
|
+
async create(params, options) {
|
|
14553
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
14554
|
+
return unwrapWithSdkHttpResponse(triggersCreate(this.getClient(api_version), body, api_version, toGoogleGenAIRequestOptions(options)));
|
|
14555
|
+
}
|
|
14556
|
+
async list(params = {}, options) {
|
|
14557
|
+
const { api_version, filter, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
|
|
14558
|
+
return unwrapWithSdkHttpResponse(triggersList(this.getClient(api_version), api_version, filter, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
|
|
14559
|
+
}
|
|
14560
|
+
async get(id, params = {}, options) {
|
|
14561
|
+
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)));
|
|
14562
|
+
}
|
|
14563
|
+
async update(id, params, options) {
|
|
14564
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
14565
|
+
return unwrapWithSdkHttpResponse(triggersUpdate(this.getClient(api_version), id, body, api_version, toGoogleGenAIRequestOptions(options)));
|
|
14566
|
+
}
|
|
14567
|
+
async delete(id, params = {}, options) {
|
|
14568
|
+
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)));
|
|
14569
|
+
}
|
|
14570
|
+
async run(trigger_id, params = {}, options) {
|
|
14571
|
+
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)));
|
|
14572
|
+
}
|
|
14573
|
+
async listExecutions(trigger_id, params = {}, options) {
|
|
14574
|
+
const { api_version, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
|
|
14575
|
+
return unwrapWithSdkHttpResponse(triggersListExecutions(this.getClient(api_version), trigger_id, api_version, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
|
|
14576
|
+
}
|
|
14577
|
+
getClient(apiVersion) {
|
|
14578
|
+
var _a;
|
|
14579
|
+
if (apiVersion) {
|
|
14580
|
+
return buildGoogleGenAIClient(this.parentClient, {
|
|
14581
|
+
api_version: apiVersion,
|
|
14582
|
+
});
|
|
14583
|
+
}
|
|
14584
|
+
(_a = this.sdk) !== null && _a !== void 0 ? _a : (this.sdk = buildGoogleGenAIClient(this.parentClient));
|
|
14585
|
+
return this.sdk;
|
|
14586
|
+
}
|
|
14587
|
+
}
|
|
13746
14588
|
function trimSlashes(value) {
|
|
13747
14589
|
return value.replace(/^\/+|\/+$/g, "");
|
|
13748
14590
|
}
|
|
@@ -14263,7 +15105,7 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
14263
15105
|
}
|
|
14264
15106
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
14265
15107
|
if (fromSpeechConfig != null) {
|
|
14266
|
-
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
15108
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
|
|
14267
15109
|
}
|
|
14268
15110
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
14269
15111
|
'stopSequences',
|
|
@@ -14293,6 +15135,21 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
14293
15135
|
undefined) {
|
|
14294
15136
|
throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
14295
15137
|
}
|
|
15138
|
+
const fromResponseFormat = getValueByPath(fromObject, [
|
|
15139
|
+
'responseFormat',
|
|
15140
|
+
]);
|
|
15141
|
+
if (fromResponseFormat != null) {
|
|
15142
|
+
let transformedList = fromResponseFormat;
|
|
15143
|
+
if (Array.isArray(transformedList)) {
|
|
15144
|
+
transformedList = transformedList.map((item) => {
|
|
15145
|
+
return item;
|
|
15146
|
+
});
|
|
15147
|
+
}
|
|
15148
|
+
setValueByPath(toObject, ['responseFormat'], transformedList);
|
|
15149
|
+
}
|
|
15150
|
+
if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
|
|
15151
|
+
throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15152
|
+
}
|
|
14296
15153
|
return toObject;
|
|
14297
15154
|
}
|
|
14298
15155
|
function googleMapsToMldev$2(fromObject) {
|
|
@@ -14506,7 +15363,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
14506
15363
|
}
|
|
14507
15364
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
14508
15365
|
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
14509
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
|
|
15366
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
|
|
14510
15367
|
}
|
|
14511
15368
|
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
14512
15369
|
'thinkingConfig',
|
|
@@ -14795,6 +15652,22 @@ function mcpServerToVertex$1(fromObject) {
|
|
|
14795
15652
|
}
|
|
14796
15653
|
return toObject;
|
|
14797
15654
|
}
|
|
15655
|
+
function multiSpeakerVoiceConfigToVertex$1(fromObject) {
|
|
15656
|
+
const toObject = {};
|
|
15657
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
15658
|
+
'speakerVoiceConfigs',
|
|
15659
|
+
]);
|
|
15660
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
15661
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
15662
|
+
if (Array.isArray(transformedList)) {
|
|
15663
|
+
transformedList = transformedList.map((item) => {
|
|
15664
|
+
return speakerVoiceConfigToVertex$1(item);
|
|
15665
|
+
});
|
|
15666
|
+
}
|
|
15667
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
15668
|
+
}
|
|
15669
|
+
return toObject;
|
|
15670
|
+
}
|
|
14798
15671
|
function partToMldev$2(fromObject) {
|
|
14799
15672
|
const toObject = {};
|
|
14800
15673
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -14936,6 +15809,26 @@ function partToVertex$2(fromObject) {
|
|
|
14936
15809
|
}
|
|
14937
15810
|
return toObject;
|
|
14938
15811
|
}
|
|
15812
|
+
function replicatedVoiceConfigToVertex$1(fromObject) {
|
|
15813
|
+
const toObject = {};
|
|
15814
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
15815
|
+
if (fromMimeType != null) {
|
|
15816
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
15817
|
+
}
|
|
15818
|
+
const fromVoiceSampleAudio = getValueByPath(fromObject, [
|
|
15819
|
+
'voiceSampleAudio',
|
|
15820
|
+
]);
|
|
15821
|
+
if (fromVoiceSampleAudio != null) {
|
|
15822
|
+
setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
|
|
15823
|
+
}
|
|
15824
|
+
if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
|
|
15825
|
+
throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15826
|
+
}
|
|
15827
|
+
if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
|
|
15828
|
+
throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15829
|
+
}
|
|
15830
|
+
return toObject;
|
|
15831
|
+
}
|
|
14939
15832
|
function safetySettingToMldev$2(fromObject) {
|
|
14940
15833
|
const toObject = {};
|
|
14941
15834
|
const fromCategory = getValueByPath(fromObject, ['category']);
|
|
@@ -14962,6 +15855,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
14962
15855
|
}
|
|
14963
15856
|
return toObject;
|
|
14964
15857
|
}
|
|
15858
|
+
function speakerVoiceConfigToVertex$1(fromObject) {
|
|
15859
|
+
const toObject = {};
|
|
15860
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
15861
|
+
if (fromSpeaker != null) {
|
|
15862
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
15863
|
+
}
|
|
15864
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
15865
|
+
if (fromVoiceConfig != null) {
|
|
15866
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
15867
|
+
}
|
|
15868
|
+
return toObject;
|
|
15869
|
+
}
|
|
15870
|
+
function speechConfigToVertex$1(fromObject) {
|
|
15871
|
+
const toObject = {};
|
|
15872
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
15873
|
+
if (fromVoiceConfig != null) {
|
|
15874
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
15875
|
+
}
|
|
15876
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
15877
|
+
if (fromLanguageCode != null) {
|
|
15878
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
15879
|
+
}
|
|
15880
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
15881
|
+
'multiSpeakerVoiceConfig',
|
|
15882
|
+
]);
|
|
15883
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
15884
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
|
|
15885
|
+
}
|
|
15886
|
+
return toObject;
|
|
15887
|
+
}
|
|
14965
15888
|
function toolToMldev$2(fromObject) {
|
|
14966
15889
|
const toObject = {};
|
|
14967
15890
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
@@ -15027,6 +15950,9 @@ function toolToMldev$2(fromObject) {
|
|
|
15027
15950
|
}
|
|
15028
15951
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
15029
15952
|
}
|
|
15953
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
15954
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
15955
|
+
}
|
|
15030
15956
|
return toObject;
|
|
15031
15957
|
}
|
|
15032
15958
|
function toolToVertex$1(fromObject) {
|
|
@@ -15100,6 +16026,10 @@ function toolToVertex$1(fromObject) {
|
|
|
15100
16026
|
}
|
|
15101
16027
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
15102
16028
|
}
|
|
16029
|
+
const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
|
|
16030
|
+
if (fromExaAiSearch != null) {
|
|
16031
|
+
setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
|
|
16032
|
+
}
|
|
15103
16033
|
return toObject;
|
|
15104
16034
|
}
|
|
15105
16035
|
function usageMetadataFromVertex(fromObject) {
|
|
@@ -15206,6 +16136,22 @@ function voiceActivityFromVertex(fromObject) {
|
|
|
15206
16136
|
}
|
|
15207
16137
|
return toObject;
|
|
15208
16138
|
}
|
|
16139
|
+
function voiceConfigToVertex$1(fromObject) {
|
|
16140
|
+
const toObject = {};
|
|
16141
|
+
const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
|
|
16142
|
+
'replicatedVoiceConfig',
|
|
16143
|
+
]);
|
|
16144
|
+
if (fromReplicatedVoiceConfig != null) {
|
|
16145
|
+
setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
|
|
16146
|
+
}
|
|
16147
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
16148
|
+
'prebuiltVoiceConfig',
|
|
16149
|
+
]);
|
|
16150
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
16151
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
|
|
16152
|
+
}
|
|
16153
|
+
return toObject;
|
|
16154
|
+
}
|
|
15209
16155
|
|
|
15210
16156
|
/**
|
|
15211
16157
|
* @license
|
|
@@ -15426,6 +16372,18 @@ function contentEmbeddingStatisticsFromVertex(fromObject, _rootObject) {
|
|
|
15426
16372
|
if (fromTokenCount != null) {
|
|
15427
16373
|
setValueByPath(toObject, ['tokenCount'], fromTokenCount);
|
|
15428
16374
|
}
|
|
16375
|
+
const fromTokensDetails = getValueByPath(fromObject, [
|
|
16376
|
+
'tokensDetails',
|
|
16377
|
+
]);
|
|
16378
|
+
if (fromTokensDetails != null) {
|
|
16379
|
+
let transformedList = fromTokensDetails;
|
|
16380
|
+
if (Array.isArray(transformedList)) {
|
|
16381
|
+
transformedList = transformedList.map((item) => {
|
|
16382
|
+
return item;
|
|
16383
|
+
});
|
|
16384
|
+
}
|
|
16385
|
+
setValueByPath(toObject, ['tokensDetails'], transformedList);
|
|
16386
|
+
}
|
|
15429
16387
|
return toObject;
|
|
15430
16388
|
}
|
|
15431
16389
|
function contentToMldev$1(fromObject, rootObject) {
|
|
@@ -16055,6 +17013,10 @@ function embedContentResponseFromVertex(fromObject, rootObject) {
|
|
|
16055
17013
|
usageMetadata['promptTokenCount']) {
|
|
16056
17014
|
stats.tokenCount = usageMetadata['promptTokenCount'];
|
|
16057
17015
|
}
|
|
17016
|
+
if (usageMetadata &&
|
|
17017
|
+
usageMetadata['promptTokensDetails']) {
|
|
17018
|
+
stats.tokensDetails = usageMetadata['promptTokensDetails'];
|
|
17019
|
+
}
|
|
16058
17020
|
if (truncated) {
|
|
16059
17021
|
stats.truncated = truncated;
|
|
16060
17022
|
}
|
|
@@ -16459,7 +17421,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
16459
17421
|
}
|
|
16460
17422
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
16461
17423
|
if (fromSpeechConfig != null) {
|
|
16462
|
-
setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
|
|
17424
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
|
|
16463
17425
|
}
|
|
16464
17426
|
const fromAudioTimestamp = getValueByPath(fromObject, [
|
|
16465
17427
|
'audioTimestamp',
|
|
@@ -17346,7 +18308,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
|
|
|
17346
18308
|
}
|
|
17347
18309
|
return toObject;
|
|
17348
18310
|
}
|
|
17349
|
-
function generationConfigToVertex(fromObject,
|
|
18311
|
+
function generationConfigToVertex(fromObject, rootObject) {
|
|
17350
18312
|
const toObject = {};
|
|
17351
18313
|
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
17352
18314
|
'modelSelectionConfig',
|
|
@@ -17442,7 +18404,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
|
|
|
17442
18404
|
}
|
|
17443
18405
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
17444
18406
|
if (fromSpeechConfig != null) {
|
|
17445
|
-
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
18407
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
|
|
17446
18408
|
}
|
|
17447
18409
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
17448
18410
|
'stopSequences',
|
|
@@ -17472,6 +18434,21 @@ function generationConfigToVertex(fromObject, _rootObject) {
|
|
|
17472
18434
|
undefined) {
|
|
17473
18435
|
throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
17474
18436
|
}
|
|
18437
|
+
const fromResponseFormat = getValueByPath(fromObject, [
|
|
18438
|
+
'responseFormat',
|
|
18439
|
+
]);
|
|
18440
|
+
if (fromResponseFormat != null) {
|
|
18441
|
+
let transformedList = fromResponseFormat;
|
|
18442
|
+
if (Array.isArray(transformedList)) {
|
|
18443
|
+
transformedList = transformedList.map((item) => {
|
|
18444
|
+
return item;
|
|
18445
|
+
});
|
|
18446
|
+
}
|
|
18447
|
+
setValueByPath(toObject, ['responseFormat'], transformedList);
|
|
18448
|
+
}
|
|
18449
|
+
if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
|
|
18450
|
+
throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
18451
|
+
}
|
|
17475
18452
|
return toObject;
|
|
17476
18453
|
}
|
|
17477
18454
|
function getModelParametersToMldev(apiClient, fromObject, _rootObject) {
|
|
@@ -17909,6 +18886,22 @@ function modelFromVertex(fromObject, rootObject) {
|
|
|
17909
18886
|
}
|
|
17910
18887
|
return toObject;
|
|
17911
18888
|
}
|
|
18889
|
+
function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
|
|
18890
|
+
const toObject = {};
|
|
18891
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
18892
|
+
'speakerVoiceConfigs',
|
|
18893
|
+
]);
|
|
18894
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
18895
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
18896
|
+
if (Array.isArray(transformedList)) {
|
|
18897
|
+
transformedList = transformedList.map((item) => {
|
|
18898
|
+
return speakerVoiceConfigToVertex(item);
|
|
18899
|
+
});
|
|
18900
|
+
}
|
|
18901
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
18902
|
+
}
|
|
18903
|
+
return toObject;
|
|
18904
|
+
}
|
|
17912
18905
|
function partToMldev$1(fromObject, rootObject) {
|
|
17913
18906
|
const toObject = {};
|
|
17914
18907
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -18218,6 +19211,26 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
|
|
|
18218
19211
|
}
|
|
18219
19212
|
return toObject;
|
|
18220
19213
|
}
|
|
19214
|
+
function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
|
|
19215
|
+
const toObject = {};
|
|
19216
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
19217
|
+
if (fromMimeType != null) {
|
|
19218
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
19219
|
+
}
|
|
19220
|
+
const fromVoiceSampleAudio = getValueByPath(fromObject, [
|
|
19221
|
+
'voiceSampleAudio',
|
|
19222
|
+
]);
|
|
19223
|
+
if (fromVoiceSampleAudio != null) {
|
|
19224
|
+
setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
|
|
19225
|
+
}
|
|
19226
|
+
if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
|
|
19227
|
+
throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
19228
|
+
}
|
|
19229
|
+
if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
|
|
19230
|
+
throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
19231
|
+
}
|
|
19232
|
+
return toObject;
|
|
19233
|
+
}
|
|
18221
19234
|
function safetyAttributesFromMldev(fromObject, _rootObject) {
|
|
18222
19235
|
const toObject = {};
|
|
18223
19236
|
const fromCategories = getValueByPath(fromObject, [
|
|
@@ -18367,6 +19380,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
|
|
|
18367
19380
|
}
|
|
18368
19381
|
return toObject;
|
|
18369
19382
|
}
|
|
19383
|
+
function speakerVoiceConfigToVertex(fromObject, rootObject) {
|
|
19384
|
+
const toObject = {};
|
|
19385
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
19386
|
+
if (fromSpeaker != null) {
|
|
19387
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
19388
|
+
}
|
|
19389
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
19390
|
+
if (fromVoiceConfig != null) {
|
|
19391
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
|
|
19392
|
+
}
|
|
19393
|
+
return toObject;
|
|
19394
|
+
}
|
|
19395
|
+
function speechConfigToVertex(fromObject, rootObject) {
|
|
19396
|
+
const toObject = {};
|
|
19397
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
19398
|
+
if (fromVoiceConfig != null) {
|
|
19399
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
|
|
19400
|
+
}
|
|
19401
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
19402
|
+
if (fromLanguageCode != null) {
|
|
19403
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
19404
|
+
}
|
|
19405
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
19406
|
+
'multiSpeakerVoiceConfig',
|
|
19407
|
+
]);
|
|
19408
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
19409
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
|
|
19410
|
+
}
|
|
19411
|
+
return toObject;
|
|
19412
|
+
}
|
|
18370
19413
|
function toolConfigToMldev(fromObject, rootObject) {
|
|
18371
19414
|
const toObject = {};
|
|
18372
19415
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
@@ -18472,6 +19515,9 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
18472
19515
|
}
|
|
18473
19516
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
18474
19517
|
}
|
|
19518
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
19519
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19520
|
+
}
|
|
18475
19521
|
return toObject;
|
|
18476
19522
|
}
|
|
18477
19523
|
function toolToVertex(fromObject, rootObject) {
|
|
@@ -18545,6 +19591,10 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
18545
19591
|
}
|
|
18546
19592
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
18547
19593
|
}
|
|
19594
|
+
const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
|
|
19595
|
+
if (fromExaAiSearch != null) {
|
|
19596
|
+
setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
|
|
19597
|
+
}
|
|
18548
19598
|
return toObject;
|
|
18549
19599
|
}
|
|
18550
19600
|
function tunedModelInfoFromMldev(fromObject, _rootObject) {
|
|
@@ -18856,6 +19906,22 @@ function videoToVertex(fromObject, _rootObject) {
|
|
|
18856
19906
|
}
|
|
18857
19907
|
return toObject;
|
|
18858
19908
|
}
|
|
19909
|
+
function voiceConfigToVertex(fromObject, rootObject) {
|
|
19910
|
+
const toObject = {};
|
|
19911
|
+
const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
|
|
19912
|
+
'replicatedVoiceConfig',
|
|
19913
|
+
]);
|
|
19914
|
+
if (fromReplicatedVoiceConfig != null) {
|
|
19915
|
+
setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
|
|
19916
|
+
}
|
|
19917
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
19918
|
+
'prebuiltVoiceConfig',
|
|
19919
|
+
]);
|
|
19920
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
19921
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
|
|
19922
|
+
}
|
|
19923
|
+
return toObject;
|
|
19924
|
+
}
|
|
18859
19925
|
|
|
18860
19926
|
/**
|
|
18861
19927
|
* @license
|
|
@@ -19418,10 +20484,27 @@ class Live {
|
|
|
19418
20484
|
onopenResolve({});
|
|
19419
20485
|
};
|
|
19420
20486
|
const apiClient = this.apiClient;
|
|
20487
|
+
let sessionResolved = false;
|
|
20488
|
+
const messageQueue = [];
|
|
20489
|
+
let setupCompleteResolve = () => { };
|
|
20490
|
+
const setupCompletePromise = new Promise((resolve) => {
|
|
20491
|
+
setupCompleteResolve = resolve;
|
|
20492
|
+
});
|
|
19421
20493
|
const websocketCallbacks = {
|
|
19422
20494
|
onopen: onopenAwaitedCallback,
|
|
19423
20495
|
onmessage: (event) => {
|
|
19424
|
-
void handleWebSocketMessage(apiClient,
|
|
20496
|
+
void handleWebSocketMessage(apiClient, (msg) => {
|
|
20497
|
+
if (msg.setupComplete && !session.setupComplete) {
|
|
20498
|
+
session.setupComplete = msg.setupComplete;
|
|
20499
|
+
setupCompleteResolve({});
|
|
20500
|
+
}
|
|
20501
|
+
if (sessionResolved) {
|
|
20502
|
+
callbacks.onmessage(msg);
|
|
20503
|
+
}
|
|
20504
|
+
else {
|
|
20505
|
+
messageQueue.push(msg);
|
|
20506
|
+
}
|
|
20507
|
+
}, event);
|
|
19425
20508
|
},
|
|
19426
20509
|
onerror: (_a = callbacks === null || callbacks === void 0 ? void 0 : callbacks.onerror) !== null && _a !== void 0 ? _a : function (e) {
|
|
19427
20510
|
},
|
|
@@ -19483,8 +20566,14 @@ class Live {
|
|
|
19483
20566
|
clientMessage = liveConnectParametersToMldev(this.apiClient, liveConnectParameters);
|
|
19484
20567
|
}
|
|
19485
20568
|
delete clientMessage['config'];
|
|
20569
|
+
const session = new Session(conn, this.apiClient);
|
|
19486
20570
|
conn.send(JSON.stringify(clientMessage));
|
|
19487
|
-
|
|
20571
|
+
await setupCompletePromise;
|
|
20572
|
+
sessionResolved = true;
|
|
20573
|
+
for (const msg of messageQueue) {
|
|
20574
|
+
callbacks.onmessage(msg);
|
|
20575
|
+
}
|
|
20576
|
+
return session;
|
|
19488
20577
|
}
|
|
19489
20578
|
// TODO: b/416041229 - Abstract this method to a common place.
|
|
19490
20579
|
isCallableTool(tool) {
|
|
@@ -22013,6 +23102,9 @@ function toolToMldev(fromObject) {
|
|
|
22013
23102
|
}
|
|
22014
23103
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
22015
23104
|
}
|
|
23105
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
23106
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
23107
|
+
}
|
|
22016
23108
|
return toObject;
|
|
22017
23109
|
}
|
|
22018
23110
|
|
|
@@ -23107,6 +24199,18 @@ function generationConfigFromVertex(fromObject, _rootObject) {
|
|
|
23107
24199
|
if (fromTopP != null) {
|
|
23108
24200
|
setValueByPath(toObject, ['topP'], fromTopP);
|
|
23109
24201
|
}
|
|
24202
|
+
const fromResponseFormat = getValueByPath(fromObject, [
|
|
24203
|
+
'responseFormat',
|
|
24204
|
+
]);
|
|
24205
|
+
if (fromResponseFormat != null) {
|
|
24206
|
+
let transformedList = fromResponseFormat;
|
|
24207
|
+
if (Array.isArray(transformedList)) {
|
|
24208
|
+
transformedList = transformedList.map((item) => {
|
|
24209
|
+
return item;
|
|
24210
|
+
});
|
|
24211
|
+
}
|
|
24212
|
+
setValueByPath(toObject, ['responseFormat'], transformedList);
|
|
24213
|
+
}
|
|
23110
24214
|
return toObject;
|
|
23111
24215
|
}
|
|
23112
24216
|
function getTuningJobParametersToMldev(fromObject, _rootObject) {
|
|
@@ -24192,6 +25296,14 @@ class GoogleGenAI {
|
|
|
24192
25296
|
this._agents = new GeminiNextGenAgents(this.apiClient);
|
|
24193
25297
|
return this._agents;
|
|
24194
25298
|
}
|
|
25299
|
+
get triggers() {
|
|
25300
|
+
if (this._triggers !== undefined) {
|
|
25301
|
+
return this._triggers;
|
|
25302
|
+
}
|
|
25303
|
+
console.warn('GoogleGenAI.triggers: Triggers usage is experimental and may change in future versions.');
|
|
25304
|
+
this._triggers = new GeminiNextGenTriggers(this.apiClient);
|
|
25305
|
+
return this._triggers;
|
|
25306
|
+
}
|
|
24195
25307
|
constructor(options) {
|
|
24196
25308
|
var _a, _b;
|
|
24197
25309
|
if (options.apiKey == null) {
|
|
@@ -24231,6 +25343,7 @@ class GoogleGenAI {
|
|
|
24231
25343
|
}
|
|
24232
25344
|
|
|
24233
25345
|
exports.ApiError = ApiError;
|
|
25346
|
+
exports.AudioResponseFormat = AudioResponseFormat;
|
|
24234
25347
|
exports.Batches = Batches;
|
|
24235
25348
|
exports.Caches = Caches;
|
|
24236
25349
|
exports.CancelTuningJobResponse = CancelTuningJobResponse;
|
|
@@ -24260,6 +25373,7 @@ exports.GenerateVideosOperation = GenerateVideosOperation;
|
|
|
24260
25373
|
exports.GenerateVideosResponse = GenerateVideosResponse;
|
|
24261
25374
|
exports.GoogleGenAI = GoogleGenAI;
|
|
24262
25375
|
exports.HttpResponse = HttpResponse;
|
|
25376
|
+
exports.ImageResponseFormat = ImageResponseFormat;
|
|
24263
25377
|
exports.ImportFileOperation = ImportFileOperation;
|
|
24264
25378
|
exports.ImportFileResponse = ImportFileResponse;
|
|
24265
25379
|
exports.InlinedEmbedContentResponse = InlinedEmbedContentResponse;
|
|
@@ -24286,11 +25400,13 @@ exports.RegisterFilesResponse = RegisterFilesResponse;
|
|
|
24286
25400
|
exports.ReinforcementTuningAutoraterScorerParsedResponseConversionScorer = ReinforcementTuningAutoraterScorerParsedResponseConversionScorer;
|
|
24287
25401
|
exports.ReinforcementTuningParseResponseConfig = ReinforcementTuningParseResponseConfig;
|
|
24288
25402
|
exports.ReplayResponse = ReplayResponse;
|
|
25403
|
+
exports.ResponseFormat = ResponseFormat;
|
|
24289
25404
|
exports.SegmentImageResponse = SegmentImageResponse;
|
|
24290
25405
|
exports.Session = Session;
|
|
24291
25406
|
exports.SingleEmbedContentResponse = SingleEmbedContentResponse;
|
|
24292
25407
|
exports.StyleReferenceImage = StyleReferenceImage;
|
|
24293
25408
|
exports.SubjectReferenceImage = SubjectReferenceImage;
|
|
25409
|
+
exports.TextResponseFormat = TextResponseFormat;
|
|
24294
25410
|
exports.Tokens = Tokens;
|
|
24295
25411
|
exports.ToolResponse = ToolResponse;
|
|
24296
25412
|
exports.UploadToFileSearchStoreOperation = UploadToFileSearchStoreOperation;
|
|
@@ -24298,6 +25414,7 @@ exports.UploadToFileSearchStoreResponse = UploadToFileSearchStoreResponse;
|
|
|
24298
25414
|
exports.UploadToFileSearchStoreResumableResponse = UploadToFileSearchStoreResumableResponse;
|
|
24299
25415
|
exports.UpscaleImageResponse = UpscaleImageResponse;
|
|
24300
25416
|
exports.ValidateRewardResponse = ValidateRewardResponse;
|
|
25417
|
+
exports.VideoResponseFormat = VideoResponseFormat;
|
|
24301
25418
|
exports.createFunctionResponsePartFromBase64 = createFunctionResponsePartFromBase64;
|
|
24302
25419
|
exports.createFunctionResponsePartFromUri = createFunctionResponsePartFromUri;
|
|
24303
25420
|
exports.createModelContent = createModelContent;
|