@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.mjs
CHANGED
|
@@ -802,7 +802,7 @@ var PhishBlockThreshold;
|
|
|
802
802
|
*/
|
|
803
803
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
804
804
|
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
805
|
-
/** Specifies the function Behavior.
|
|
805
|
+
/** 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. */
|
|
806
806
|
var Behavior;
|
|
807
807
|
(function (Behavior) {
|
|
808
808
|
/**
|
|
@@ -1316,6 +1316,110 @@ var Modality;
|
|
|
1316
1316
|
*/
|
|
1317
1317
|
Modality["VIDEO"] = "VIDEO";
|
|
1318
1318
|
})(Modality || (Modality = {}));
|
|
1319
|
+
/** Delivery mode for the generated content. */
|
|
1320
|
+
var Delivery;
|
|
1321
|
+
(function (Delivery) {
|
|
1322
|
+
/**
|
|
1323
|
+
* Default value. This value is unused.
|
|
1324
|
+
*/
|
|
1325
|
+
Delivery["DELIVERY_UNSPECIFIED"] = "DELIVERY_UNSPECIFIED";
|
|
1326
|
+
/**
|
|
1327
|
+
* Generated bytes are returned inline in the response.
|
|
1328
|
+
*/
|
|
1329
|
+
Delivery["INLINE"] = "INLINE";
|
|
1330
|
+
/**
|
|
1331
|
+
* Generated content is stored and a URI is returned.
|
|
1332
|
+
*/
|
|
1333
|
+
Delivery["URI"] = "URI";
|
|
1334
|
+
})(Delivery || (Delivery = {}));
|
|
1335
|
+
/** The aspect ratio for the image output. */
|
|
1336
|
+
var AspectRatio;
|
|
1337
|
+
(function (AspectRatio) {
|
|
1338
|
+
/**
|
|
1339
|
+
* Default value. This value is unused.
|
|
1340
|
+
*/
|
|
1341
|
+
AspectRatio["ASPECT_RATIO_UNSPECIFIED"] = "ASPECT_RATIO_UNSPECIFIED";
|
|
1342
|
+
/**
|
|
1343
|
+
* 1:1 aspect ratio.
|
|
1344
|
+
*/
|
|
1345
|
+
AspectRatio["ASPECT_RATIO_ONE_BY_ONE"] = "ASPECT_RATIO_ONE_BY_ONE";
|
|
1346
|
+
/**
|
|
1347
|
+
* 2:3 aspect ratio.
|
|
1348
|
+
*/
|
|
1349
|
+
AspectRatio["ASPECT_RATIO_TWO_BY_THREE"] = "ASPECT_RATIO_TWO_BY_THREE";
|
|
1350
|
+
/**
|
|
1351
|
+
* 3:2 aspect ratio.
|
|
1352
|
+
*/
|
|
1353
|
+
AspectRatio["ASPECT_RATIO_THREE_BY_TWO"] = "ASPECT_RATIO_THREE_BY_TWO";
|
|
1354
|
+
/**
|
|
1355
|
+
* 3:4 aspect ratio.
|
|
1356
|
+
*/
|
|
1357
|
+
AspectRatio["ASPECT_RATIO_THREE_BY_FOUR"] = "ASPECT_RATIO_THREE_BY_FOUR";
|
|
1358
|
+
/**
|
|
1359
|
+
* 4:3 aspect ratio.
|
|
1360
|
+
*/
|
|
1361
|
+
AspectRatio["ASPECT_RATIO_FOUR_BY_THREE"] = "ASPECT_RATIO_FOUR_BY_THREE";
|
|
1362
|
+
/**
|
|
1363
|
+
* 4:5 aspect ratio.
|
|
1364
|
+
*/
|
|
1365
|
+
AspectRatio["ASPECT_RATIO_FOUR_BY_FIVE"] = "ASPECT_RATIO_FOUR_BY_FIVE";
|
|
1366
|
+
/**
|
|
1367
|
+
* 5:4 aspect ratio.
|
|
1368
|
+
*/
|
|
1369
|
+
AspectRatio["ASPECT_RATIO_FIVE_BY_FOUR"] = "ASPECT_RATIO_FIVE_BY_FOUR";
|
|
1370
|
+
/**
|
|
1371
|
+
* 9:16 aspect ratio.
|
|
1372
|
+
*/
|
|
1373
|
+
AspectRatio["ASPECT_RATIO_NINE_BY_SIXTEEN"] = "ASPECT_RATIO_NINE_BY_SIXTEEN";
|
|
1374
|
+
/**
|
|
1375
|
+
* 16:9 aspect ratio.
|
|
1376
|
+
*/
|
|
1377
|
+
AspectRatio["ASPECT_RATIO_SIXTEEN_BY_NINE"] = "ASPECT_RATIO_SIXTEEN_BY_NINE";
|
|
1378
|
+
/**
|
|
1379
|
+
* 21:9 aspect ratio.
|
|
1380
|
+
*/
|
|
1381
|
+
AspectRatio["ASPECT_RATIO_TWENTY_ONE_BY_NINE"] = "ASPECT_RATIO_TWENTY_ONE_BY_NINE";
|
|
1382
|
+
/**
|
|
1383
|
+
* 1:8 aspect ratio.
|
|
1384
|
+
*/
|
|
1385
|
+
AspectRatio["ASPECT_RATIO_ONE_BY_EIGHT"] = "ASPECT_RATIO_ONE_BY_EIGHT";
|
|
1386
|
+
/**
|
|
1387
|
+
* 8:1 aspect ratio.
|
|
1388
|
+
*/
|
|
1389
|
+
AspectRatio["ASPECT_RATIO_EIGHT_BY_ONE"] = "ASPECT_RATIO_EIGHT_BY_ONE";
|
|
1390
|
+
/**
|
|
1391
|
+
* 1:4 aspect ratio.
|
|
1392
|
+
*/
|
|
1393
|
+
AspectRatio["ASPECT_RATIO_ONE_BY_FOUR"] = "ASPECT_RATIO_ONE_BY_FOUR";
|
|
1394
|
+
/**
|
|
1395
|
+
* 4:1 aspect ratio.
|
|
1396
|
+
*/
|
|
1397
|
+
AspectRatio["ASPECT_RATIO_FOUR_BY_ONE"] = "ASPECT_RATIO_FOUR_BY_ONE";
|
|
1398
|
+
})(AspectRatio || (AspectRatio = {}));
|
|
1399
|
+
/** The size of the image output. */
|
|
1400
|
+
var ImageSize;
|
|
1401
|
+
(function (ImageSize) {
|
|
1402
|
+
/**
|
|
1403
|
+
* Default value. This value is unused.
|
|
1404
|
+
*/
|
|
1405
|
+
ImageSize["IMAGE_SIZE_UNSPECIFIED"] = "IMAGE_SIZE_UNSPECIFIED";
|
|
1406
|
+
/**
|
|
1407
|
+
* 512px image size.
|
|
1408
|
+
*/
|
|
1409
|
+
ImageSize["IMAGE_SIZE_FIVE_TWELVE"] = "IMAGE_SIZE_FIVE_TWELVE";
|
|
1410
|
+
/**
|
|
1411
|
+
* 1K image size.
|
|
1412
|
+
*/
|
|
1413
|
+
ImageSize["IMAGE_SIZE_ONE_K"] = "IMAGE_SIZE_ONE_K";
|
|
1414
|
+
/**
|
|
1415
|
+
* 2K image size.
|
|
1416
|
+
*/
|
|
1417
|
+
ImageSize["IMAGE_SIZE_TWO_K"] = "IMAGE_SIZE_TWO_K";
|
|
1418
|
+
/**
|
|
1419
|
+
* 4K image size.
|
|
1420
|
+
*/
|
|
1421
|
+
ImageSize["IMAGE_SIZE_FOUR_K"] = "IMAGE_SIZE_FOUR_K";
|
|
1422
|
+
})(ImageSize || (ImageSize = {}));
|
|
1319
1423
|
/** Tuning mode. This enum is not supported in Gemini API. */
|
|
1320
1424
|
var TuningMode;
|
|
1321
1425
|
(function (TuningMode) {
|
|
@@ -1364,6 +1468,58 @@ var AdapterSize;
|
|
|
1364
1468
|
*/
|
|
1365
1469
|
AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
|
|
1366
1470
|
})(AdapterSize || (AdapterSize = {}));
|
|
1471
|
+
/** Defines the type for parsing sample response. This enum is not supported in Gemini API. */
|
|
1472
|
+
var ResponseParseType;
|
|
1473
|
+
(function (ResponseParseType) {
|
|
1474
|
+
/**
|
|
1475
|
+
* Default value. Fallback to IDENTITY
|
|
1476
|
+
*/
|
|
1477
|
+
ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
|
|
1478
|
+
/**
|
|
1479
|
+
* Returns the sample response as is.
|
|
1480
|
+
*/
|
|
1481
|
+
ResponseParseType["IDENTITY"] = "IDENTITY";
|
|
1482
|
+
/**
|
|
1483
|
+
* 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.
|
|
1484
|
+
*/
|
|
1485
|
+
ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
|
|
1486
|
+
})(ResponseParseType || (ResponseParseType = {}));
|
|
1487
|
+
/** Match operation to use for evaluating rewards. This enum is not supported in Gemini API. */
|
|
1488
|
+
var MatchOperation;
|
|
1489
|
+
(function (MatchOperation) {
|
|
1490
|
+
/**
|
|
1491
|
+
* Default value. A user error will be returned if not set.
|
|
1492
|
+
*/
|
|
1493
|
+
MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
|
|
1494
|
+
/**
|
|
1495
|
+
* Equivalent to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains) `REGEX_CONTAINS(target, expression)`.
|
|
1496
|
+
*/
|
|
1497
|
+
MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
|
|
1498
|
+
/**
|
|
1499
|
+
* The match operation returns `true` if expression is a substring of the target.
|
|
1500
|
+
*/
|
|
1501
|
+
MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
|
|
1502
|
+
/**
|
|
1503
|
+
* The match operation returns `true` expression is an exact match of the target.
|
|
1504
|
+
*/
|
|
1505
|
+
MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
|
|
1506
|
+
})(MatchOperation || (MatchOperation = {}));
|
|
1507
|
+
/** Represents how much to think for the tuning job. */
|
|
1508
|
+
var ReinforcementTuningThinkingLevel;
|
|
1509
|
+
(function (ReinforcementTuningThinkingLevel) {
|
|
1510
|
+
/**
|
|
1511
|
+
* Unspecified thinking level.
|
|
1512
|
+
*/
|
|
1513
|
+
ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
|
|
1514
|
+
/**
|
|
1515
|
+
* Little to no thinking.
|
|
1516
|
+
*/
|
|
1517
|
+
ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
1518
|
+
/**
|
|
1519
|
+
* High thinking level.
|
|
1520
|
+
*/
|
|
1521
|
+
ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
|
|
1522
|
+
})(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
|
|
1367
1523
|
/** Job state. */
|
|
1368
1524
|
var JobState;
|
|
1369
1525
|
(function (JobState) {
|
|
@@ -1848,58 +2004,6 @@ var ImageResizeMode;
|
|
|
1848
2004
|
*/
|
|
1849
2005
|
ImageResizeMode["PAD"] = "PAD";
|
|
1850
2006
|
})(ImageResizeMode || (ImageResizeMode = {}));
|
|
1851
|
-
/** Defines how to parse sample response. */
|
|
1852
|
-
var ResponseParseType;
|
|
1853
|
-
(function (ResponseParseType) {
|
|
1854
|
-
/**
|
|
1855
|
-
* Default value. This value is unused.
|
|
1856
|
-
*/
|
|
1857
|
-
ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
|
|
1858
|
-
/**
|
|
1859
|
-
* Use the sample response as is.
|
|
1860
|
-
*/
|
|
1861
|
-
ResponseParseType["IDENTITY"] = "IDENTITY";
|
|
1862
|
-
/**
|
|
1863
|
-
* Use regex to extract the important part of sample response.
|
|
1864
|
-
*/
|
|
1865
|
-
ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
|
|
1866
|
-
})(ResponseParseType || (ResponseParseType = {}));
|
|
1867
|
-
/** Match operation to use for evaluation. */
|
|
1868
|
-
var MatchOperation;
|
|
1869
|
-
(function (MatchOperation) {
|
|
1870
|
-
/**
|
|
1871
|
-
* Default value. This value is unused.
|
|
1872
|
-
*/
|
|
1873
|
-
MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
|
|
1874
|
-
/**
|
|
1875
|
-
* Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
|
|
1876
|
-
*/
|
|
1877
|
-
MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
|
|
1878
|
-
/**
|
|
1879
|
-
* `expression` is a substring of target.
|
|
1880
|
-
*/
|
|
1881
|
-
MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
|
|
1882
|
-
/**
|
|
1883
|
-
* `expression` is an exact match of target.
|
|
1884
|
-
*/
|
|
1885
|
-
MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
|
|
1886
|
-
})(MatchOperation || (MatchOperation = {}));
|
|
1887
|
-
/** Represents how much to think for the tuning job. */
|
|
1888
|
-
var ReinforcementTuningThinkingLevel;
|
|
1889
|
-
(function (ReinforcementTuningThinkingLevel) {
|
|
1890
|
-
/**
|
|
1891
|
-
* Unspecified thinking level.
|
|
1892
|
-
*/
|
|
1893
|
-
ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
|
|
1894
|
-
/**
|
|
1895
|
-
* Little to no thinking.
|
|
1896
|
-
*/
|
|
1897
|
-
ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
1898
|
-
/**
|
|
1899
|
-
* High thinking level.
|
|
1900
|
-
*/
|
|
1901
|
-
ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
|
|
1902
|
-
})(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
|
|
1903
2007
|
/** Enum representing the tuning method. */
|
|
1904
2008
|
var TuningMethod;
|
|
1905
2009
|
(function (TuningMethod) {
|
|
@@ -2696,6 +2800,21 @@ class ListModelsResponse {
|
|
|
2696
2800
|
}
|
|
2697
2801
|
class DeleteModelResponse {
|
|
2698
2802
|
}
|
|
2803
|
+
/** Configuration for audio-specific output formatting. */
|
|
2804
|
+
class AudioResponseFormat {
|
|
2805
|
+
}
|
|
2806
|
+
/** Configuration for image-specific output formatting. */
|
|
2807
|
+
class ImageResponseFormat {
|
|
2808
|
+
}
|
|
2809
|
+
/** Configuration for text-specific output formatting. */
|
|
2810
|
+
class TextResponseFormat {
|
|
2811
|
+
}
|
|
2812
|
+
/** Configuration for video-specific output formatting. This data type is not supported in Gemini API. */
|
|
2813
|
+
class VideoResponseFormat {
|
|
2814
|
+
}
|
|
2815
|
+
/** Configuration for the model to configure output formatting and delivery. This data type is not supported in Gemini API. */
|
|
2816
|
+
class ResponseFormat {
|
|
2817
|
+
}
|
|
2699
2818
|
/** Response for counting tokens. */
|
|
2700
2819
|
class CountTokensResponse {
|
|
2701
2820
|
}
|
|
@@ -2724,10 +2843,10 @@ class GenerateVideosOperation {
|
|
|
2724
2843
|
return operation;
|
|
2725
2844
|
}
|
|
2726
2845
|
}
|
|
2727
|
-
/** Defines how to parse sample response for reinforcement tuning. */
|
|
2846
|
+
/** 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. */
|
|
2728
2847
|
class ReinforcementTuningParseResponseConfig {
|
|
2729
2848
|
}
|
|
2730
|
-
/** Scores responses by directly converting parsed autorater response to float reward
|
|
2849
|
+
/** 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. */
|
|
2731
2850
|
class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
|
|
2732
2851
|
}
|
|
2733
2852
|
/** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
|
|
@@ -5167,6 +5286,9 @@ function toolToMldev$4(fromObject) {
|
|
|
5167
5286
|
}
|
|
5168
5287
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
5169
5288
|
}
|
|
5289
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
5290
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5291
|
+
}
|
|
5170
5292
|
return toObject;
|
|
5171
5293
|
}
|
|
5172
5294
|
function vertexMultimodalDatasetDestinationFromVertex(fromObject) {
|
|
@@ -6637,6 +6759,9 @@ function toolToMldev$3(fromObject) {
|
|
|
6637
6759
|
}
|
|
6638
6760
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
6639
6761
|
}
|
|
6762
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
6763
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
6764
|
+
}
|
|
6640
6765
|
return toObject;
|
|
6641
6766
|
}
|
|
6642
6767
|
function toolToVertex$2(fromObject) {
|
|
@@ -6710,6 +6835,10 @@ function toolToVertex$2(fromObject) {
|
|
|
6710
6835
|
}
|
|
6711
6836
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
6712
6837
|
}
|
|
6838
|
+
const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
|
|
6839
|
+
if (fromExaAiSearch != null) {
|
|
6840
|
+
setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
|
|
6841
|
+
}
|
|
6713
6842
|
return toObject;
|
|
6714
6843
|
}
|
|
6715
6844
|
function updateCachedContentConfigToMldev(fromObject, parentObject) {
|
|
@@ -7798,7 +7927,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
7798
7927
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
7799
7928
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
7800
7929
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
7801
|
-
const SDK_VERSION = '2.
|
|
7930
|
+
const SDK_VERSION = '2.12.0'; // x-release-please-version
|
|
7802
7931
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
7803
7932
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
7804
7933
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -9663,17 +9792,14 @@ function env() {
|
|
|
9663
9792
|
* Populates global parameters with environment variables.
|
|
9664
9793
|
*/
|
|
9665
9794
|
function fillGlobals(options) {
|
|
9666
|
-
var _a, _b
|
|
9795
|
+
var _a, _b;
|
|
9667
9796
|
const clone = Object.assign({}, options);
|
|
9668
9797
|
const envVars = env();
|
|
9669
9798
|
if (typeof envVars.GOOGLE_GENAI_API_VERSION !== "undefined") {
|
|
9670
9799
|
(_a = clone.api_version) !== null && _a !== void 0 ? _a : (clone.api_version = envVars.GOOGLE_GENAI_API_VERSION);
|
|
9671
9800
|
}
|
|
9672
|
-
if (typeof envVars.GOOGLE_GENAI_API_REVISION !== "undefined") {
|
|
9673
|
-
(_b = clone.api_revision) !== null && _b !== void 0 ? _b : (clone.api_revision = envVars.GOOGLE_GENAI_API_REVISION);
|
|
9674
|
-
}
|
|
9675
9801
|
if (typeof envVars.GOOGLE_GENAI_USER_PROJECT !== "undefined") {
|
|
9676
|
-
(
|
|
9802
|
+
(_b = clone.user_project) !== null && _b !== void 0 ? _b : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
|
|
9677
9803
|
}
|
|
9678
9804
|
return clone;
|
|
9679
9805
|
}
|
|
@@ -9685,7 +9811,6 @@ function fillGlobals(options) {
|
|
|
9685
9811
|
*
|
|
9686
9812
|
* g3-prettier-ignore-file
|
|
9687
9813
|
*/
|
|
9688
|
-
const GOOGLE_GENAI_API_REVISION = "2026-05-20";
|
|
9689
9814
|
class GoogleGenAISecurityProvider {
|
|
9690
9815
|
constructor(options) {
|
|
9691
9816
|
this.options = options;
|
|
@@ -9703,7 +9828,6 @@ class GoogleGenAIAuthHook {
|
|
|
9703
9828
|
}
|
|
9704
9829
|
async beforeRequest(hookCtx, request) {
|
|
9705
9830
|
applyDefaultHeaders(request.headers, getStaticDefaultHeaders(hookCtx.security_source));
|
|
9706
|
-
applyApiRevision(hookCtx, request.headers);
|
|
9707
9831
|
applyUserProject(hookCtx, request.headers);
|
|
9708
9832
|
if (hasAuthHeaders(request.headers)) {
|
|
9709
9833
|
return request;
|
|
@@ -9783,12 +9907,6 @@ function applyDefaultHeaders(target, source) {
|
|
|
9783
9907
|
}
|
|
9784
9908
|
}
|
|
9785
9909
|
}
|
|
9786
|
-
function applyApiRevision(hookCtx, headers) {
|
|
9787
|
-
var _a;
|
|
9788
|
-
if (headers.get("api-revision") === null) {
|
|
9789
|
-
headers.set("Api-Revision", (_a = hookCtx.options.api_revision) !== null && _a !== void 0 ? _a : GOOGLE_GENAI_API_REVISION);
|
|
9790
|
-
}
|
|
9791
|
-
}
|
|
9792
9910
|
function applyUserProject(hookCtx, headers) {
|
|
9793
9911
|
if (hookCtx.options.user_project !== undefined &&
|
|
9794
9912
|
headers.get("x-goog-user-project") === null) {
|
|
@@ -10320,7 +10438,7 @@ function serverURLFromOptions(options) {
|
|
|
10320
10438
|
return new URL(u);
|
|
10321
10439
|
}
|
|
10322
10440
|
const SDK_METADATA = {
|
|
10323
|
-
userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.
|
|
10441
|
+
userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.913.3 v1beta @google/genai",
|
|
10324
10442
|
};
|
|
10325
10443
|
|
|
10326
10444
|
/**
|
|
@@ -11961,9 +12079,9 @@ function unwrapAsAPIPromise(p) {
|
|
|
11961
12079
|
* Creates a new Agent (Typed version for SDK).
|
|
11962
12080
|
*/
|
|
11963
12081
|
function agentsCreate(client, body, api_version, options) {
|
|
11964
|
-
return new APIPromise($do$
|
|
12082
|
+
return new APIPromise($do$l(client, body, api_version, options));
|
|
11965
12083
|
}
|
|
11966
|
-
async function $do$
|
|
12084
|
+
async function $do$l(client, body, api_version, options) {
|
|
11967
12085
|
var _a, _b, _c;
|
|
11968
12086
|
const input = {
|
|
11969
12087
|
body: body,
|
|
@@ -12046,9 +12164,9 @@ async function $do$e(client, body, api_version, options) {
|
|
|
12046
12164
|
* Deletes an Agent.
|
|
12047
12165
|
*/
|
|
12048
12166
|
function agentsDelete(client, id, api_version, options) {
|
|
12049
|
-
return new APIPromise($do$
|
|
12167
|
+
return new APIPromise($do$k(client, id, api_version, options));
|
|
12050
12168
|
}
|
|
12051
|
-
async function $do$
|
|
12169
|
+
async function $do$k(client, id, api_version, options) {
|
|
12052
12170
|
var _a, _b, _c;
|
|
12053
12171
|
const input = {
|
|
12054
12172
|
id: id,
|
|
@@ -12134,9 +12252,9 @@ async function $do$d(client, id, api_version, options) {
|
|
|
12134
12252
|
* Gets a specific Agent.
|
|
12135
12253
|
*/
|
|
12136
12254
|
function agentsGet(client, id, api_version, options) {
|
|
12137
|
-
return new APIPromise($do$
|
|
12255
|
+
return new APIPromise($do$j(client, id, api_version, options));
|
|
12138
12256
|
}
|
|
12139
|
-
async function $do$
|
|
12257
|
+
async function $do$j(client, id, api_version, options) {
|
|
12140
12258
|
var _a, _b, _c;
|
|
12141
12259
|
const input = {
|
|
12142
12260
|
id: id,
|
|
@@ -12222,9 +12340,9 @@ async function $do$c(client, id, api_version, options) {
|
|
|
12222
12340
|
* Lists all Agents.
|
|
12223
12341
|
*/
|
|
12224
12342
|
function agentsList(client, api_version, page_size, page_token, parent, options) {
|
|
12225
|
-
return new APIPromise($do$
|
|
12343
|
+
return new APIPromise($do$i(client, api_version, page_size, page_token, parent, options));
|
|
12226
12344
|
}
|
|
12227
|
-
async function $do$
|
|
12345
|
+
async function $do$i(client, api_version, page_size, page_token, parent, options) {
|
|
12228
12346
|
var _a, _b, _c;
|
|
12229
12347
|
const input = {
|
|
12230
12348
|
api_version: api_version,
|
|
@@ -12496,9 +12614,9 @@ class GetInteractionByIdClientError extends GoogleGenAiError {
|
|
|
12496
12614
|
* Cancels an interaction by id. This only applies to background interactions that are still running.
|
|
12497
12615
|
*/
|
|
12498
12616
|
function interactionsCancel(client, id, api_version, options) {
|
|
12499
|
-
return new APIPromise($do$
|
|
12617
|
+
return new APIPromise($do$h(client, id, api_version, options));
|
|
12500
12618
|
}
|
|
12501
|
-
async function $do$
|
|
12619
|
+
async function $do$h(client, id, api_version, options) {
|
|
12502
12620
|
var _a, _b, _c;
|
|
12503
12621
|
const input = {
|
|
12504
12622
|
id: id,
|
|
@@ -12584,9 +12702,9 @@ async function $do$a(client, id, api_version, options) {
|
|
|
12584
12702
|
* g3-prettier-ignore-file
|
|
12585
12703
|
*/
|
|
12586
12704
|
function interactionsCreate(client, body, api_version, options) {
|
|
12587
|
-
return new APIPromise($do$
|
|
12705
|
+
return new APIPromise($do$g(client, body, api_version, options));
|
|
12588
12706
|
}
|
|
12589
|
-
async function $do$
|
|
12707
|
+
async function $do$g(client, body, api_version, options) {
|
|
12590
12708
|
var _a, _b, _c, _d;
|
|
12591
12709
|
const input = {
|
|
12592
12710
|
body: body,
|
|
@@ -12678,9 +12796,9 @@ async function $do$9(client, body, api_version, options) {
|
|
|
12678
12796
|
* Deletes the interaction by id.
|
|
12679
12797
|
*/
|
|
12680
12798
|
function interactionsDelete(client, id, api_version, options) {
|
|
12681
|
-
return new APIPromise($do$
|
|
12799
|
+
return new APIPromise($do$f(client, id, api_version, options));
|
|
12682
12800
|
}
|
|
12683
|
-
async function $do$
|
|
12801
|
+
async function $do$f(client, id, api_version, options) {
|
|
12684
12802
|
var _a, _b, _c;
|
|
12685
12803
|
const input = {
|
|
12686
12804
|
id: id,
|
|
@@ -12766,9 +12884,9 @@ async function $do$8(client, id, api_version, options) {
|
|
|
12766
12884
|
* g3-prettier-ignore-file
|
|
12767
12885
|
*/
|
|
12768
12886
|
function interactionsGet(client, id, stream, last_event_id, include_input, api_version, options) {
|
|
12769
|
-
return new APIPromise($do$
|
|
12887
|
+
return new APIPromise($do$e(client, id, stream, last_event_id, include_input, api_version, options));
|
|
12770
12888
|
}
|
|
12771
|
-
async function $do$
|
|
12889
|
+
async function $do$e(client, id, stream, last_event_id, include_input, api_version, options) {
|
|
12772
12890
|
var _a, _b, _c;
|
|
12773
12891
|
const input = {
|
|
12774
12892
|
id: id,
|
|
@@ -12901,12 +13019,12 @@ class Interactions extends ClientSDK {
|
|
|
12901
13019
|
* g3-prettier-ignore-file
|
|
12902
13020
|
*/
|
|
12903
13021
|
/**
|
|
12904
|
-
* Creates a new
|
|
13022
|
+
* Creates a new trigger that will invoke the specified agent on the given cron schedule.
|
|
12905
13023
|
*/
|
|
12906
|
-
function
|
|
12907
|
-
return new APIPromise($do$
|
|
13024
|
+
function triggersCreate(client, body, api_version, options) {
|
|
13025
|
+
return new APIPromise($do$d(client, body, api_version, options));
|
|
12908
13026
|
}
|
|
12909
|
-
async function $do$
|
|
13027
|
+
async function $do$d(client, body, api_version, options) {
|
|
12910
13028
|
var _a, _b, _c;
|
|
12911
13029
|
const input = {
|
|
12912
13030
|
body: body,
|
|
@@ -12917,7 +13035,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
12917
13035
|
const pathParams = {
|
|
12918
13036
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
12919
13037
|
};
|
|
12920
|
-
const path = pathToFunc("/{api_version}/
|
|
13038
|
+
const path = pathToFunc("/{api_version}/triggers")(pathParams);
|
|
12921
13039
|
const headers = new Headers(compactMap({
|
|
12922
13040
|
"Content-Type": "application/json",
|
|
12923
13041
|
Accept: "application/json",
|
|
@@ -12927,7 +13045,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
12927
13045
|
const context = {
|
|
12928
13046
|
options: client._options,
|
|
12929
13047
|
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 : "",
|
|
12930
|
-
operation_id: "
|
|
13048
|
+
operation_id: "CreateTrigger",
|
|
12931
13049
|
o_auth2_scopes: null,
|
|
12932
13050
|
resolved_security: requestSecurity,
|
|
12933
13051
|
security_source: client._options.security,
|
|
@@ -12971,7 +13089,7 @@ async function $do$6(client, body, api_version, options) {
|
|
|
12971
13089
|
return [doResult, { status: "request-error", request: req }];
|
|
12972
13090
|
}
|
|
12973
13091
|
const response = doResult.value;
|
|
12974
|
-
const [result] = await match(
|
|
13092
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
12975
13093
|
if (!result.ok) {
|
|
12976
13094
|
return [result, { status: "complete", request: req, response }];
|
|
12977
13095
|
}
|
|
@@ -12986,12 +13104,12 @@ async function $do$6(client, body, api_version, options) {
|
|
|
12986
13104
|
* g3-prettier-ignore-file
|
|
12987
13105
|
*/
|
|
12988
13106
|
/**
|
|
12989
|
-
* Deletes a
|
|
13107
|
+
* Deletes a trigger.
|
|
12990
13108
|
*/
|
|
12991
|
-
function
|
|
12992
|
-
return new APIPromise($do$
|
|
13109
|
+
function triggersDelete(client, id, api_version, options) {
|
|
13110
|
+
return new APIPromise($do$c(client, id, api_version, options));
|
|
12993
13111
|
}
|
|
12994
|
-
async function $do$
|
|
13112
|
+
async function $do$c(client, id, api_version, options) {
|
|
12995
13113
|
var _a, _b, _c;
|
|
12996
13114
|
const input = {
|
|
12997
13115
|
id: id,
|
|
@@ -13006,7 +13124,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
13006
13124
|
charEncoding: "percent",
|
|
13007
13125
|
}),
|
|
13008
13126
|
};
|
|
13009
|
-
const path = pathToFunc("/{api_version}/
|
|
13127
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
13010
13128
|
const headers = new Headers(compactMap({
|
|
13011
13129
|
Accept: "application/json",
|
|
13012
13130
|
}));
|
|
@@ -13015,7 +13133,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
13015
13133
|
const context = {
|
|
13016
13134
|
options: client._options,
|
|
13017
13135
|
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 : "",
|
|
13018
|
-
operation_id: "
|
|
13136
|
+
operation_id: "DeleteTrigger",
|
|
13019
13137
|
o_auth2_scopes: null,
|
|
13020
13138
|
resolved_security: requestSecurity,
|
|
13021
13139
|
security_source: client._options.security,
|
|
@@ -13059,7 +13177,7 @@ async function $do$5(client, id, api_version, options) {
|
|
|
13059
13177
|
return [doResult, { status: "request-error", request: req }];
|
|
13060
13178
|
}
|
|
13061
13179
|
const response = doResult.value;
|
|
13062
|
-
const [result] = await match(
|
|
13180
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13063
13181
|
if (!result.ok) {
|
|
13064
13182
|
return [result, { status: "complete", request: req, response }];
|
|
13065
13183
|
}
|
|
@@ -13074,12 +13192,12 @@ async function $do$5(client, id, api_version, options) {
|
|
|
13074
13192
|
* g3-prettier-ignore-file
|
|
13075
13193
|
*/
|
|
13076
13194
|
/**
|
|
13077
|
-
* Gets a
|
|
13195
|
+
* Gets details of a single trigger.
|
|
13078
13196
|
*/
|
|
13079
|
-
function
|
|
13080
|
-
return new APIPromise($do$
|
|
13197
|
+
function triggersGet(client, id, api_version, options) {
|
|
13198
|
+
return new APIPromise($do$b(client, id, api_version, options));
|
|
13081
13199
|
}
|
|
13082
|
-
async function $do$
|
|
13200
|
+
async function $do$b(client, id, api_version, options) {
|
|
13083
13201
|
var _a, _b, _c;
|
|
13084
13202
|
const input = {
|
|
13085
13203
|
id: id,
|
|
@@ -13094,7 +13212,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
13094
13212
|
charEncoding: "percent",
|
|
13095
13213
|
}),
|
|
13096
13214
|
};
|
|
13097
|
-
const path = pathToFunc("/{api_version}/
|
|
13215
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
13098
13216
|
const headers = new Headers(compactMap({
|
|
13099
13217
|
Accept: "application/json",
|
|
13100
13218
|
}));
|
|
@@ -13103,7 +13221,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
13103
13221
|
const context = {
|
|
13104
13222
|
options: client._options,
|
|
13105
13223
|
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 : "",
|
|
13106
|
-
operation_id: "
|
|
13224
|
+
operation_id: "GetTrigger",
|
|
13107
13225
|
o_auth2_scopes: null,
|
|
13108
13226
|
resolved_security: requestSecurity,
|
|
13109
13227
|
security_source: client._options.security,
|
|
@@ -13147,7 +13265,7 @@ async function $do$4(client, id, api_version, options) {
|
|
|
13147
13265
|
return [doResult, { status: "request-error", request: req }];
|
|
13148
13266
|
}
|
|
13149
13267
|
const response = doResult.value;
|
|
13150
|
-
const [result] = await match(
|
|
13268
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13151
13269
|
if (!result.ok) {
|
|
13152
13270
|
return [result, { status: "complete", request: req, response }];
|
|
13153
13271
|
}
|
|
@@ -13162,14 +13280,15 @@ async function $do$4(client, id, api_version, options) {
|
|
|
13162
13280
|
* g3-prettier-ignore-file
|
|
13163
13281
|
*/
|
|
13164
13282
|
/**
|
|
13165
|
-
* Lists
|
|
13283
|
+
* Lists executions for a trigger.
|
|
13166
13284
|
*/
|
|
13167
|
-
function
|
|
13168
|
-
return new APIPromise($do$
|
|
13285
|
+
function triggersListExecutions(client, trigger_id, api_version, page_size, page_token, options) {
|
|
13286
|
+
return new APIPromise($do$a(client, trigger_id, api_version, page_size, page_token, options));
|
|
13169
13287
|
}
|
|
13170
|
-
async function $do$
|
|
13288
|
+
async function $do$a(client, trigger_id, api_version, page_size, page_token, options) {
|
|
13171
13289
|
var _a, _b, _c;
|
|
13172
13290
|
const input = {
|
|
13291
|
+
trigger_id: trigger_id,
|
|
13173
13292
|
api_version: api_version,
|
|
13174
13293
|
page_size: page_size,
|
|
13175
13294
|
page_token: page_token,
|
|
@@ -13177,12 +13296,16 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
13177
13296
|
const payload = input;
|
|
13178
13297
|
const body = null;
|
|
13179
13298
|
const pathParams = {
|
|
13180
|
-
api_version: encodeSimple("api_version", (_a = payload
|
|
13299
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13300
|
+
trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
|
|
13301
|
+
explode: false,
|
|
13302
|
+
charEncoding: "percent",
|
|
13303
|
+
}),
|
|
13181
13304
|
};
|
|
13182
|
-
const path = pathToFunc("/{api_version}/
|
|
13305
|
+
const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
|
|
13183
13306
|
const query = encodeFormQuery({
|
|
13184
|
-
"page_size": payload
|
|
13185
|
-
"page_token": payload
|
|
13307
|
+
"page_size": payload.page_size,
|
|
13308
|
+
"page_token": payload.page_token,
|
|
13186
13309
|
});
|
|
13187
13310
|
const headers = new Headers(compactMap({
|
|
13188
13311
|
Accept: "application/json",
|
|
@@ -13192,7 +13315,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
13192
13315
|
const context = {
|
|
13193
13316
|
options: client._options,
|
|
13194
13317
|
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 : "",
|
|
13195
|
-
operation_id: "
|
|
13318
|
+
operation_id: "ListTriggerExecutions",
|
|
13196
13319
|
o_auth2_scopes: null,
|
|
13197
13320
|
resolved_security: requestSecurity,
|
|
13198
13321
|
security_source: client._options.security,
|
|
@@ -13237,7 +13360,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
13237
13360
|
return [doResult, { status: "request-error", request: req }];
|
|
13238
13361
|
}
|
|
13239
13362
|
const response = doResult.value;
|
|
13240
|
-
const [result] = await match(
|
|
13363
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13241
13364
|
if (!result.ok) {
|
|
13242
13365
|
return [result, { status: "complete", request: req, response }];
|
|
13243
13366
|
}
|
|
@@ -13252,30 +13375,31 @@ async function $do$3(client, api_version, page_size, page_token, options) {
|
|
|
13252
13375
|
* g3-prettier-ignore-file
|
|
13253
13376
|
*/
|
|
13254
13377
|
/**
|
|
13255
|
-
*
|
|
13378
|
+
* Lists triggers for a project.
|
|
13256
13379
|
*/
|
|
13257
|
-
function
|
|
13258
|
-
return new APIPromise($do$
|
|
13380
|
+
function triggersList(client, api_version, filter, page_size, page_token, options) {
|
|
13381
|
+
return new APIPromise($do$9(client, api_version, filter, page_size, page_token, options));
|
|
13259
13382
|
}
|
|
13260
|
-
async function $do$
|
|
13383
|
+
async function $do$9(client, api_version, filter, page_size, page_token, options) {
|
|
13261
13384
|
var _a, _b, _c;
|
|
13262
13385
|
const input = {
|
|
13263
|
-
id: id,
|
|
13264
13386
|
api_version: api_version,
|
|
13265
|
-
|
|
13387
|
+
filter: filter,
|
|
13388
|
+
page_size: page_size,
|
|
13389
|
+
page_token: page_token,
|
|
13266
13390
|
};
|
|
13267
13391
|
const payload = input;
|
|
13268
|
-
const body
|
|
13392
|
+
const body = null;
|
|
13269
13393
|
const pathParams = {
|
|
13270
|
-
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13271
|
-
id: encodeSimple("id", payload.id, {
|
|
13272
|
-
explode: false,
|
|
13273
|
-
charEncoding: "percent",
|
|
13274
|
-
}),
|
|
13394
|
+
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" }),
|
|
13275
13395
|
};
|
|
13276
|
-
const path = pathToFunc("/{api_version}/
|
|
13396
|
+
const path = pathToFunc("/{api_version}/triggers")(pathParams);
|
|
13397
|
+
const query = encodeFormQuery({
|
|
13398
|
+
"filter": payload === null || payload === void 0 ? void 0 : payload.filter,
|
|
13399
|
+
"page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
|
|
13400
|
+
"page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
|
|
13401
|
+
});
|
|
13277
13402
|
const headers = new Headers(compactMap({
|
|
13278
|
-
"Content-Type": "application/json",
|
|
13279
13403
|
Accept: "application/json",
|
|
13280
13404
|
}));
|
|
13281
13405
|
const securityInput = await extractSecurity(client._options.security);
|
|
@@ -13283,7 +13407,7 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
13283
13407
|
const context = {
|
|
13284
13408
|
options: client._options,
|
|
13285
13409
|
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 : "",
|
|
13286
|
-
operation_id: "
|
|
13410
|
+
operation_id: "ListTriggers",
|
|
13287
13411
|
o_auth2_scopes: null,
|
|
13288
13412
|
resolved_security: requestSecurity,
|
|
13289
13413
|
security_source: client._options.security,
|
|
@@ -13305,11 +13429,12 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
13305
13429
|
};
|
|
13306
13430
|
const requestRes = client._createRequest(context, {
|
|
13307
13431
|
security: requestSecurity,
|
|
13308
|
-
method: "
|
|
13432
|
+
method: "GET",
|
|
13309
13433
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13310
13434
|
path: path,
|
|
13311
13435
|
headers: headers,
|
|
13312
|
-
|
|
13436
|
+
query: query,
|
|
13437
|
+
body: body,
|
|
13313
13438
|
userAgent: client._options.user_agent,
|
|
13314
13439
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13315
13440
|
}, options);
|
|
@@ -13327,7 +13452,7 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
13327
13452
|
return [doResult, { status: "request-error", request: req }];
|
|
13328
13453
|
}
|
|
13329
13454
|
const response = doResult.value;
|
|
13330
|
-
const [result] = await match(
|
|
13455
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13331
13456
|
if (!result.ok) {
|
|
13332
13457
|
return [result, { status: "complete", request: req, response }];
|
|
13333
13458
|
}
|
|
@@ -13342,30 +13467,28 @@ async function $do$2(client, id, api_version, body, options) {
|
|
|
13342
13467
|
* g3-prettier-ignore-file
|
|
13343
13468
|
*/
|
|
13344
13469
|
/**
|
|
13345
|
-
*
|
|
13470
|
+
* Runs a trigger immediately.
|
|
13346
13471
|
*/
|
|
13347
|
-
function
|
|
13348
|
-
return new APIPromise($do$
|
|
13472
|
+
function triggersRun(client, trigger_id, api_version, options) {
|
|
13473
|
+
return new APIPromise($do$8(client, trigger_id, api_version, options));
|
|
13349
13474
|
}
|
|
13350
|
-
async function $do$
|
|
13475
|
+
async function $do$8(client, trigger_id, api_version, options) {
|
|
13351
13476
|
var _a, _b, _c;
|
|
13352
13477
|
const input = {
|
|
13353
|
-
|
|
13478
|
+
trigger_id: trigger_id,
|
|
13354
13479
|
api_version: api_version,
|
|
13355
|
-
body: body,
|
|
13356
13480
|
};
|
|
13357
13481
|
const payload = input;
|
|
13358
|
-
const body
|
|
13482
|
+
const body = null;
|
|
13359
13483
|
const pathParams = {
|
|
13360
13484
|
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13361
|
-
|
|
13485
|
+
trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
|
|
13362
13486
|
explode: false,
|
|
13363
13487
|
charEncoding: "percent",
|
|
13364
13488
|
}),
|
|
13365
13489
|
};
|
|
13366
|
-
const path = pathToFunc("/{api_version}/
|
|
13490
|
+
const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
|
|
13367
13491
|
const headers = new Headers(compactMap({
|
|
13368
|
-
"Content-Type": "application/json",
|
|
13369
13492
|
Accept: "application/json",
|
|
13370
13493
|
}));
|
|
13371
13494
|
const securityInput = await extractSecurity(client._options.security);
|
|
@@ -13373,7 +13496,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
13373
13496
|
const context = {
|
|
13374
13497
|
options: client._options,
|
|
13375
13498
|
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 : "",
|
|
13376
|
-
operation_id: "
|
|
13499
|
+
operation_id: "RunTrigger",
|
|
13377
13500
|
o_auth2_scopes: null,
|
|
13378
13501
|
resolved_security: requestSecurity,
|
|
13379
13502
|
security_source: client._options.security,
|
|
@@ -13399,7 +13522,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
13399
13522
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13400
13523
|
path: path,
|
|
13401
13524
|
headers: headers,
|
|
13402
|
-
body: body
|
|
13525
|
+
body: body,
|
|
13403
13526
|
userAgent: client._options.user_agent,
|
|
13404
13527
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13405
13528
|
}, options);
|
|
@@ -13417,7 +13540,7 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
13417
13540
|
return [doResult, { status: "request-error", request: req }];
|
|
13418
13541
|
}
|
|
13419
13542
|
const response = doResult.value;
|
|
13420
|
-
const [result] = await match(
|
|
13543
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13421
13544
|
if (!result.ok) {
|
|
13422
13545
|
return [result, { status: "complete", request: req, response }];
|
|
13423
13546
|
}
|
|
@@ -13432,18 +13555,17 @@ async function $do$1(client, id, api_version, body, options) {
|
|
|
13432
13555
|
* g3-prettier-ignore-file
|
|
13433
13556
|
*/
|
|
13434
13557
|
/**
|
|
13435
|
-
* Updates
|
|
13558
|
+
* Updates a trigger.
|
|
13436
13559
|
*/
|
|
13437
|
-
function
|
|
13438
|
-
return new APIPromise($do(client, id,
|
|
13560
|
+
function triggersUpdate(client, id, body, api_version, options) {
|
|
13561
|
+
return new APIPromise($do$7(client, id, body, api_version, options));
|
|
13439
13562
|
}
|
|
13440
|
-
async function $do(client, id,
|
|
13563
|
+
async function $do$7(client, id, body, api_version, options) {
|
|
13441
13564
|
var _a, _b, _c;
|
|
13442
13565
|
const input = {
|
|
13443
13566
|
id: id,
|
|
13444
|
-
api_version: api_version,
|
|
13445
|
-
update_mask: update_mask,
|
|
13446
13567
|
body: body,
|
|
13568
|
+
api_version: api_version,
|
|
13447
13569
|
};
|
|
13448
13570
|
const payload = input;
|
|
13449
13571
|
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
@@ -13454,10 +13576,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
13454
13576
|
charEncoding: "percent",
|
|
13455
13577
|
}),
|
|
13456
13578
|
};
|
|
13457
|
-
const path = pathToFunc("/{api_version}/
|
|
13458
|
-
const query = encodeFormQuery({
|
|
13459
|
-
"update_mask": payload.update_mask,
|
|
13460
|
-
});
|
|
13579
|
+
const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
|
|
13461
13580
|
const headers = new Headers(compactMap({
|
|
13462
13581
|
"Content-Type": "application/json",
|
|
13463
13582
|
Accept: "application/json",
|
|
@@ -13467,7 +13586,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
13467
13586
|
const context = {
|
|
13468
13587
|
options: client._options,
|
|
13469
13588
|
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 : "",
|
|
13470
|
-
operation_id: "
|
|
13589
|
+
operation_id: "UpdateTrigger",
|
|
13471
13590
|
o_auth2_scopes: null,
|
|
13472
13591
|
resolved_security: requestSecurity,
|
|
13473
13592
|
security_source: client._options.security,
|
|
@@ -13493,7 +13612,6 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
13493
13612
|
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13494
13613
|
path: path,
|
|
13495
13614
|
headers: headers,
|
|
13496
|
-
query: query,
|
|
13497
13615
|
body: body$,
|
|
13498
13616
|
userAgent: client._options.user_agent,
|
|
13499
13617
|
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
@@ -13512,7 +13630,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
13512
13630
|
return [doResult, { status: "request-error", request: req }];
|
|
13513
13631
|
}
|
|
13514
13632
|
const response = doResult.value;
|
|
13515
|
-
const [result] = await match(
|
|
13633
|
+
const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
|
|
13516
13634
|
if (!result.ok) {
|
|
13517
13635
|
return [result, { status: "complete", request: req, response }];
|
|
13518
13636
|
}
|
|
@@ -13526,28 +13644,708 @@ async function $do(client, id, api_version, update_mask, body, options) {
|
|
|
13526
13644
|
*
|
|
13527
13645
|
* g3-prettier-ignore-file
|
|
13528
13646
|
*/
|
|
13529
|
-
class
|
|
13647
|
+
class Triggers extends ClientSDK {
|
|
13530
13648
|
/**
|
|
13531
|
-
* Creates a new
|
|
13649
|
+
* Creates a new trigger that will invoke the specified agent on the given cron schedule.
|
|
13532
13650
|
*/
|
|
13533
13651
|
create(params, options) {
|
|
13534
13652
|
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
13535
|
-
return unwrapAsAPIPromise(
|
|
13653
|
+
return unwrapAsAPIPromise(triggersCreate(this, body, api_version, options));
|
|
13536
13654
|
}
|
|
13537
13655
|
/**
|
|
13538
|
-
* Lists
|
|
13656
|
+
* Lists triggers for a project.
|
|
13539
13657
|
*/
|
|
13540
13658
|
list(params, options) {
|
|
13541
|
-
return unwrapAsAPIPromise(
|
|
13659
|
+
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));
|
|
13542
13660
|
}
|
|
13543
13661
|
/**
|
|
13544
|
-
* Gets a
|
|
13662
|
+
* Gets details of a single trigger.
|
|
13545
13663
|
*/
|
|
13546
13664
|
get(id, params, options) {
|
|
13547
|
-
return unwrapAsAPIPromise(
|
|
13665
|
+
return unwrapAsAPIPromise(triggersGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
13548
13666
|
}
|
|
13549
13667
|
/**
|
|
13550
|
-
* Updates
|
|
13668
|
+
* Updates a trigger.
|
|
13669
|
+
*/
|
|
13670
|
+
update(id, params, options) {
|
|
13671
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
13672
|
+
return unwrapAsAPIPromise(triggersUpdate(this, id, body, api_version, options));
|
|
13673
|
+
}
|
|
13674
|
+
/**
|
|
13675
|
+
* Deletes a trigger.
|
|
13676
|
+
*/
|
|
13677
|
+
delete(id, params, options) {
|
|
13678
|
+
return unwrapAsAPIPromise(triggersDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
13679
|
+
}
|
|
13680
|
+
/**
|
|
13681
|
+
* Runs a trigger immediately.
|
|
13682
|
+
*/
|
|
13683
|
+
run(trigger_id, params, options) {
|
|
13684
|
+
return unwrapAsAPIPromise(triggersRun(this, trigger_id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
13685
|
+
}
|
|
13686
|
+
/**
|
|
13687
|
+
* Lists executions for a trigger.
|
|
13688
|
+
*/
|
|
13689
|
+
listExecutions(trigger_id, params, options) {
|
|
13690
|
+
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));
|
|
13691
|
+
}
|
|
13692
|
+
}
|
|
13693
|
+
|
|
13694
|
+
/**
|
|
13695
|
+
* @license
|
|
13696
|
+
* Copyright 2026 Google LLC
|
|
13697
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13698
|
+
*
|
|
13699
|
+
* g3-prettier-ignore-file
|
|
13700
|
+
*/
|
|
13701
|
+
/**
|
|
13702
|
+
* Creates a new Webhook.
|
|
13703
|
+
*/
|
|
13704
|
+
function webhooksCreate(client, body, api_version, options) {
|
|
13705
|
+
return new APIPromise($do$6(client, body, api_version, options));
|
|
13706
|
+
}
|
|
13707
|
+
async function $do$6(client, body, api_version, options) {
|
|
13708
|
+
var _a, _b, _c;
|
|
13709
|
+
const input = {
|
|
13710
|
+
body: body,
|
|
13711
|
+
api_version: api_version,
|
|
13712
|
+
};
|
|
13713
|
+
const payload = input;
|
|
13714
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
13715
|
+
const pathParams = {
|
|
13716
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13717
|
+
};
|
|
13718
|
+
const path = pathToFunc("/{api_version}/webhooks")(pathParams);
|
|
13719
|
+
const headers = new Headers(compactMap({
|
|
13720
|
+
"Content-Type": "application/json",
|
|
13721
|
+
Accept: "application/json",
|
|
13722
|
+
}));
|
|
13723
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
13724
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
13725
|
+
const context = {
|
|
13726
|
+
options: client._options,
|
|
13727
|
+
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 : "",
|
|
13728
|
+
operation_id: "CreateWebhook",
|
|
13729
|
+
o_auth2_scopes: null,
|
|
13730
|
+
resolved_security: requestSecurity,
|
|
13731
|
+
security_source: client._options.security,
|
|
13732
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
13733
|
+
|| client._options.retry_config
|
|
13734
|
+
|| {
|
|
13735
|
+
strategy: "attempt-count-backoff",
|
|
13736
|
+
backoff: {
|
|
13737
|
+
initialInterval: 500,
|
|
13738
|
+
maxInterval: 8000,
|
|
13739
|
+
exponent: 2,
|
|
13740
|
+
maxElapsedTime: 30000,
|
|
13741
|
+
},
|
|
13742
|
+
retryConnectionErrors: true,
|
|
13743
|
+
maxRetries: 4,
|
|
13744
|
+
}
|
|
13745
|
+
|| { strategy: "none" },
|
|
13746
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
13747
|
+
};
|
|
13748
|
+
const requestRes = client._createRequest(context, {
|
|
13749
|
+
security: requestSecurity,
|
|
13750
|
+
method: "POST",
|
|
13751
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13752
|
+
path: path,
|
|
13753
|
+
headers: headers,
|
|
13754
|
+
body: body$,
|
|
13755
|
+
userAgent: client._options.user_agent,
|
|
13756
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13757
|
+
}, options);
|
|
13758
|
+
if (!requestRes.ok) {
|
|
13759
|
+
return [requestRes, { status: "invalid" }];
|
|
13760
|
+
}
|
|
13761
|
+
const req = requestRes.value;
|
|
13762
|
+
const doResult = await client._do(req, {
|
|
13763
|
+
context,
|
|
13764
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
13765
|
+
retryConfig: context.retry_config,
|
|
13766
|
+
retryCodes: context.retry_codes,
|
|
13767
|
+
});
|
|
13768
|
+
if (!doResult.ok) {
|
|
13769
|
+
return [doResult, { status: "request-error", request: req }];
|
|
13770
|
+
}
|
|
13771
|
+
const response = doResult.value;
|
|
13772
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
13773
|
+
if (!result.ok) {
|
|
13774
|
+
return [result, { status: "complete", request: req, response }];
|
|
13775
|
+
}
|
|
13776
|
+
return [result, { status: "complete", request: req, response }];
|
|
13777
|
+
}
|
|
13778
|
+
|
|
13779
|
+
/**
|
|
13780
|
+
* @license
|
|
13781
|
+
* Copyright 2026 Google LLC
|
|
13782
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13783
|
+
*
|
|
13784
|
+
* g3-prettier-ignore-file
|
|
13785
|
+
*/
|
|
13786
|
+
/**
|
|
13787
|
+
* Deletes a Webhook.
|
|
13788
|
+
*/
|
|
13789
|
+
function webhooksDelete(client, id, api_version, options) {
|
|
13790
|
+
return new APIPromise($do$5(client, id, api_version, options));
|
|
13791
|
+
}
|
|
13792
|
+
async function $do$5(client, id, api_version, options) {
|
|
13793
|
+
var _a, _b, _c;
|
|
13794
|
+
const input = {
|
|
13795
|
+
id: id,
|
|
13796
|
+
api_version: api_version,
|
|
13797
|
+
};
|
|
13798
|
+
const payload = input;
|
|
13799
|
+
const body = null;
|
|
13800
|
+
const pathParams = {
|
|
13801
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13802
|
+
id: encodeSimple("id", payload.id, {
|
|
13803
|
+
explode: false,
|
|
13804
|
+
charEncoding: "percent",
|
|
13805
|
+
}),
|
|
13806
|
+
};
|
|
13807
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
13808
|
+
const headers = new Headers(compactMap({
|
|
13809
|
+
Accept: "application/json",
|
|
13810
|
+
}));
|
|
13811
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
13812
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
13813
|
+
const context = {
|
|
13814
|
+
options: client._options,
|
|
13815
|
+
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 : "",
|
|
13816
|
+
operation_id: "DeleteWebhook",
|
|
13817
|
+
o_auth2_scopes: null,
|
|
13818
|
+
resolved_security: requestSecurity,
|
|
13819
|
+
security_source: client._options.security,
|
|
13820
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
13821
|
+
|| client._options.retry_config
|
|
13822
|
+
|| {
|
|
13823
|
+
strategy: "attempt-count-backoff",
|
|
13824
|
+
backoff: {
|
|
13825
|
+
initialInterval: 500,
|
|
13826
|
+
maxInterval: 8000,
|
|
13827
|
+
exponent: 2,
|
|
13828
|
+
maxElapsedTime: 30000,
|
|
13829
|
+
},
|
|
13830
|
+
retryConnectionErrors: true,
|
|
13831
|
+
maxRetries: 4,
|
|
13832
|
+
}
|
|
13833
|
+
|| { strategy: "none" },
|
|
13834
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
13835
|
+
};
|
|
13836
|
+
const requestRes = client._createRequest(context, {
|
|
13837
|
+
security: requestSecurity,
|
|
13838
|
+
method: "DELETE",
|
|
13839
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13840
|
+
path: path,
|
|
13841
|
+
headers: headers,
|
|
13842
|
+
body: body,
|
|
13843
|
+
userAgent: client._options.user_agent,
|
|
13844
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13845
|
+
}, options);
|
|
13846
|
+
if (!requestRes.ok) {
|
|
13847
|
+
return [requestRes, { status: "invalid" }];
|
|
13848
|
+
}
|
|
13849
|
+
const req = requestRes.value;
|
|
13850
|
+
const doResult = await client._do(req, {
|
|
13851
|
+
context,
|
|
13852
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
13853
|
+
retryConfig: context.retry_config,
|
|
13854
|
+
retryCodes: context.retry_codes,
|
|
13855
|
+
});
|
|
13856
|
+
if (!doResult.ok) {
|
|
13857
|
+
return [doResult, { status: "request-error", request: req }];
|
|
13858
|
+
}
|
|
13859
|
+
const response = doResult.value;
|
|
13860
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
13861
|
+
if (!result.ok) {
|
|
13862
|
+
return [result, { status: "complete", request: req, response }];
|
|
13863
|
+
}
|
|
13864
|
+
return [result, { status: "complete", request: req, response }];
|
|
13865
|
+
}
|
|
13866
|
+
|
|
13867
|
+
/**
|
|
13868
|
+
* @license
|
|
13869
|
+
* Copyright 2026 Google LLC
|
|
13870
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13871
|
+
*
|
|
13872
|
+
* g3-prettier-ignore-file
|
|
13873
|
+
*/
|
|
13874
|
+
/**
|
|
13875
|
+
* Gets a specific Webhook.
|
|
13876
|
+
*/
|
|
13877
|
+
function webhooksGet(client, id, api_version, options) {
|
|
13878
|
+
return new APIPromise($do$4(client, id, api_version, options));
|
|
13879
|
+
}
|
|
13880
|
+
async function $do$4(client, id, api_version, options) {
|
|
13881
|
+
var _a, _b, _c;
|
|
13882
|
+
const input = {
|
|
13883
|
+
id: id,
|
|
13884
|
+
api_version: api_version,
|
|
13885
|
+
};
|
|
13886
|
+
const payload = input;
|
|
13887
|
+
const body = null;
|
|
13888
|
+
const pathParams = {
|
|
13889
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
13890
|
+
id: encodeSimple("id", payload.id, {
|
|
13891
|
+
explode: false,
|
|
13892
|
+
charEncoding: "percent",
|
|
13893
|
+
}),
|
|
13894
|
+
};
|
|
13895
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
13896
|
+
const headers = new Headers(compactMap({
|
|
13897
|
+
Accept: "application/json",
|
|
13898
|
+
}));
|
|
13899
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
13900
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
13901
|
+
const context = {
|
|
13902
|
+
options: client._options,
|
|
13903
|
+
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 : "",
|
|
13904
|
+
operation_id: "GetWebhook",
|
|
13905
|
+
o_auth2_scopes: null,
|
|
13906
|
+
resolved_security: requestSecurity,
|
|
13907
|
+
security_source: client._options.security,
|
|
13908
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
13909
|
+
|| client._options.retry_config
|
|
13910
|
+
|| {
|
|
13911
|
+
strategy: "attempt-count-backoff",
|
|
13912
|
+
backoff: {
|
|
13913
|
+
initialInterval: 500,
|
|
13914
|
+
maxInterval: 8000,
|
|
13915
|
+
exponent: 2,
|
|
13916
|
+
maxElapsedTime: 30000,
|
|
13917
|
+
},
|
|
13918
|
+
retryConnectionErrors: true,
|
|
13919
|
+
maxRetries: 4,
|
|
13920
|
+
}
|
|
13921
|
+
|| { strategy: "none" },
|
|
13922
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
13923
|
+
};
|
|
13924
|
+
const requestRes = client._createRequest(context, {
|
|
13925
|
+
security: requestSecurity,
|
|
13926
|
+
method: "GET",
|
|
13927
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
13928
|
+
path: path,
|
|
13929
|
+
headers: headers,
|
|
13930
|
+
body: body,
|
|
13931
|
+
userAgent: client._options.user_agent,
|
|
13932
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
13933
|
+
}, options);
|
|
13934
|
+
if (!requestRes.ok) {
|
|
13935
|
+
return [requestRes, { status: "invalid" }];
|
|
13936
|
+
}
|
|
13937
|
+
const req = requestRes.value;
|
|
13938
|
+
const doResult = await client._do(req, {
|
|
13939
|
+
context,
|
|
13940
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
13941
|
+
retryConfig: context.retry_config,
|
|
13942
|
+
retryCodes: context.retry_codes,
|
|
13943
|
+
});
|
|
13944
|
+
if (!doResult.ok) {
|
|
13945
|
+
return [doResult, { status: "request-error", request: req }];
|
|
13946
|
+
}
|
|
13947
|
+
const response = doResult.value;
|
|
13948
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
13949
|
+
if (!result.ok) {
|
|
13950
|
+
return [result, { status: "complete", request: req, response }];
|
|
13951
|
+
}
|
|
13952
|
+
return [result, { status: "complete", request: req, response }];
|
|
13953
|
+
}
|
|
13954
|
+
|
|
13955
|
+
/**
|
|
13956
|
+
* @license
|
|
13957
|
+
* Copyright 2026 Google LLC
|
|
13958
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13959
|
+
*
|
|
13960
|
+
* g3-prettier-ignore-file
|
|
13961
|
+
*/
|
|
13962
|
+
/**
|
|
13963
|
+
* Lists all Webhooks.
|
|
13964
|
+
*/
|
|
13965
|
+
function webhooksList(client, api_version, page_size, page_token, options) {
|
|
13966
|
+
return new APIPromise($do$3(client, api_version, page_size, page_token, options));
|
|
13967
|
+
}
|
|
13968
|
+
async function $do$3(client, api_version, page_size, page_token, options) {
|
|
13969
|
+
var _a, _b, _c;
|
|
13970
|
+
const input = {
|
|
13971
|
+
api_version: api_version,
|
|
13972
|
+
page_size: page_size,
|
|
13973
|
+
page_token: page_token,
|
|
13974
|
+
};
|
|
13975
|
+
const payload = input;
|
|
13976
|
+
const body = null;
|
|
13977
|
+
const pathParams = {
|
|
13978
|
+
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" }),
|
|
13979
|
+
};
|
|
13980
|
+
const path = pathToFunc("/{api_version}/webhooks")(pathParams);
|
|
13981
|
+
const query = encodeFormQuery({
|
|
13982
|
+
"page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
|
|
13983
|
+
"page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
|
|
13984
|
+
});
|
|
13985
|
+
const headers = new Headers(compactMap({
|
|
13986
|
+
Accept: "application/json",
|
|
13987
|
+
}));
|
|
13988
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
13989
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
13990
|
+
const context = {
|
|
13991
|
+
options: client._options,
|
|
13992
|
+
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 : "",
|
|
13993
|
+
operation_id: "ListWebhooks",
|
|
13994
|
+
o_auth2_scopes: null,
|
|
13995
|
+
resolved_security: requestSecurity,
|
|
13996
|
+
security_source: client._options.security,
|
|
13997
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
13998
|
+
|| client._options.retry_config
|
|
13999
|
+
|| {
|
|
14000
|
+
strategy: "attempt-count-backoff",
|
|
14001
|
+
backoff: {
|
|
14002
|
+
initialInterval: 500,
|
|
14003
|
+
maxInterval: 8000,
|
|
14004
|
+
exponent: 2,
|
|
14005
|
+
maxElapsedTime: 30000,
|
|
14006
|
+
},
|
|
14007
|
+
retryConnectionErrors: true,
|
|
14008
|
+
maxRetries: 4,
|
|
14009
|
+
}
|
|
14010
|
+
|| { strategy: "none" },
|
|
14011
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
14012
|
+
};
|
|
14013
|
+
const requestRes = client._createRequest(context, {
|
|
14014
|
+
security: requestSecurity,
|
|
14015
|
+
method: "GET",
|
|
14016
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
14017
|
+
path: path,
|
|
14018
|
+
headers: headers,
|
|
14019
|
+
query: query,
|
|
14020
|
+
body: body,
|
|
14021
|
+
userAgent: client._options.user_agent,
|
|
14022
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
14023
|
+
}, options);
|
|
14024
|
+
if (!requestRes.ok) {
|
|
14025
|
+
return [requestRes, { status: "invalid" }];
|
|
14026
|
+
}
|
|
14027
|
+
const req = requestRes.value;
|
|
14028
|
+
const doResult = await client._do(req, {
|
|
14029
|
+
context,
|
|
14030
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
14031
|
+
retryConfig: context.retry_config,
|
|
14032
|
+
retryCodes: context.retry_codes,
|
|
14033
|
+
});
|
|
14034
|
+
if (!doResult.ok) {
|
|
14035
|
+
return [doResult, { status: "request-error", request: req }];
|
|
14036
|
+
}
|
|
14037
|
+
const response = doResult.value;
|
|
14038
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
14039
|
+
if (!result.ok) {
|
|
14040
|
+
return [result, { status: "complete", request: req, response }];
|
|
14041
|
+
}
|
|
14042
|
+
return [result, { status: "complete", request: req, response }];
|
|
14043
|
+
}
|
|
14044
|
+
|
|
14045
|
+
/**
|
|
14046
|
+
* @license
|
|
14047
|
+
* Copyright 2026 Google LLC
|
|
14048
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14049
|
+
*
|
|
14050
|
+
* g3-prettier-ignore-file
|
|
14051
|
+
*/
|
|
14052
|
+
/**
|
|
14053
|
+
* Sends a ping event to a Webhook.
|
|
14054
|
+
*/
|
|
14055
|
+
function webhooksPing(client, id, api_version, body, options) {
|
|
14056
|
+
return new APIPromise($do$2(client, id, api_version, body, options));
|
|
14057
|
+
}
|
|
14058
|
+
async function $do$2(client, id, api_version, body, options) {
|
|
14059
|
+
var _a, _b, _c;
|
|
14060
|
+
const input = {
|
|
14061
|
+
id: id,
|
|
14062
|
+
api_version: api_version,
|
|
14063
|
+
body: body,
|
|
14064
|
+
};
|
|
14065
|
+
const payload = input;
|
|
14066
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
14067
|
+
const pathParams = {
|
|
14068
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
14069
|
+
id: encodeSimple("id", payload.id, {
|
|
14070
|
+
explode: false,
|
|
14071
|
+
charEncoding: "percent",
|
|
14072
|
+
}),
|
|
14073
|
+
};
|
|
14074
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}:ping")(pathParams);
|
|
14075
|
+
const headers = new Headers(compactMap({
|
|
14076
|
+
"Content-Type": "application/json",
|
|
14077
|
+
Accept: "application/json",
|
|
14078
|
+
}));
|
|
14079
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
14080
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
14081
|
+
const context = {
|
|
14082
|
+
options: client._options,
|
|
14083
|
+
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 : "",
|
|
14084
|
+
operation_id: "PingWebhook",
|
|
14085
|
+
o_auth2_scopes: null,
|
|
14086
|
+
resolved_security: requestSecurity,
|
|
14087
|
+
security_source: client._options.security,
|
|
14088
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
14089
|
+
|| client._options.retry_config
|
|
14090
|
+
|| {
|
|
14091
|
+
strategy: "attempt-count-backoff",
|
|
14092
|
+
backoff: {
|
|
14093
|
+
initialInterval: 500,
|
|
14094
|
+
maxInterval: 8000,
|
|
14095
|
+
exponent: 2,
|
|
14096
|
+
maxElapsedTime: 30000,
|
|
14097
|
+
},
|
|
14098
|
+
retryConnectionErrors: true,
|
|
14099
|
+
maxRetries: 4,
|
|
14100
|
+
}
|
|
14101
|
+
|| { strategy: "none" },
|
|
14102
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
14103
|
+
};
|
|
14104
|
+
const requestRes = client._createRequest(context, {
|
|
14105
|
+
security: requestSecurity,
|
|
14106
|
+
method: "POST",
|
|
14107
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
14108
|
+
path: path,
|
|
14109
|
+
headers: headers,
|
|
14110
|
+
body: body$,
|
|
14111
|
+
userAgent: client._options.user_agent,
|
|
14112
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
14113
|
+
}, options);
|
|
14114
|
+
if (!requestRes.ok) {
|
|
14115
|
+
return [requestRes, { status: "invalid" }];
|
|
14116
|
+
}
|
|
14117
|
+
const req = requestRes.value;
|
|
14118
|
+
const doResult = await client._do(req, {
|
|
14119
|
+
context,
|
|
14120
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
14121
|
+
retryConfig: context.retry_config,
|
|
14122
|
+
retryCodes: context.retry_codes,
|
|
14123
|
+
});
|
|
14124
|
+
if (!doResult.ok) {
|
|
14125
|
+
return [doResult, { status: "request-error", request: req }];
|
|
14126
|
+
}
|
|
14127
|
+
const response = doResult.value;
|
|
14128
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
14129
|
+
if (!result.ok) {
|
|
14130
|
+
return [result, { status: "complete", request: req, response }];
|
|
14131
|
+
}
|
|
14132
|
+
return [result, { status: "complete", request: req, response }];
|
|
14133
|
+
}
|
|
14134
|
+
|
|
14135
|
+
/**
|
|
14136
|
+
* @license
|
|
14137
|
+
* Copyright 2026 Google LLC
|
|
14138
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14139
|
+
*
|
|
14140
|
+
* g3-prettier-ignore-file
|
|
14141
|
+
*/
|
|
14142
|
+
/**
|
|
14143
|
+
* Generates a new signing secret for a Webhook.
|
|
14144
|
+
*/
|
|
14145
|
+
function webhooksRotateSigningSecret(client, id, api_version, body, options) {
|
|
14146
|
+
return new APIPromise($do$1(client, id, api_version, body, options));
|
|
14147
|
+
}
|
|
14148
|
+
async function $do$1(client, id, api_version, body, options) {
|
|
14149
|
+
var _a, _b, _c;
|
|
14150
|
+
const input = {
|
|
14151
|
+
id: id,
|
|
14152
|
+
api_version: api_version,
|
|
14153
|
+
body: body,
|
|
14154
|
+
};
|
|
14155
|
+
const payload = input;
|
|
14156
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
14157
|
+
const pathParams = {
|
|
14158
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
14159
|
+
id: encodeSimple("id", payload.id, {
|
|
14160
|
+
explode: false,
|
|
14161
|
+
charEncoding: "percent",
|
|
14162
|
+
}),
|
|
14163
|
+
};
|
|
14164
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}:rotateSigningSecret")(pathParams);
|
|
14165
|
+
const headers = new Headers(compactMap({
|
|
14166
|
+
"Content-Type": "application/json",
|
|
14167
|
+
Accept: "application/json",
|
|
14168
|
+
}));
|
|
14169
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
14170
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
14171
|
+
const context = {
|
|
14172
|
+
options: client._options,
|
|
14173
|
+
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 : "",
|
|
14174
|
+
operation_id: "RotateSigningSecret",
|
|
14175
|
+
o_auth2_scopes: null,
|
|
14176
|
+
resolved_security: requestSecurity,
|
|
14177
|
+
security_source: client._options.security,
|
|
14178
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
14179
|
+
|| client._options.retry_config
|
|
14180
|
+
|| {
|
|
14181
|
+
strategy: "attempt-count-backoff",
|
|
14182
|
+
backoff: {
|
|
14183
|
+
initialInterval: 500,
|
|
14184
|
+
maxInterval: 8000,
|
|
14185
|
+
exponent: 2,
|
|
14186
|
+
maxElapsedTime: 30000,
|
|
14187
|
+
},
|
|
14188
|
+
retryConnectionErrors: true,
|
|
14189
|
+
maxRetries: 4,
|
|
14190
|
+
}
|
|
14191
|
+
|| { strategy: "none" },
|
|
14192
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
14193
|
+
};
|
|
14194
|
+
const requestRes = client._createRequest(context, {
|
|
14195
|
+
security: requestSecurity,
|
|
14196
|
+
method: "POST",
|
|
14197
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
14198
|
+
path: path,
|
|
14199
|
+
headers: headers,
|
|
14200
|
+
body: body$,
|
|
14201
|
+
userAgent: client._options.user_agent,
|
|
14202
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
14203
|
+
}, options);
|
|
14204
|
+
if (!requestRes.ok) {
|
|
14205
|
+
return [requestRes, { status: "invalid" }];
|
|
14206
|
+
}
|
|
14207
|
+
const req = requestRes.value;
|
|
14208
|
+
const doResult = await client._do(req, {
|
|
14209
|
+
context,
|
|
14210
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
14211
|
+
retryConfig: context.retry_config,
|
|
14212
|
+
retryCodes: context.retry_codes,
|
|
14213
|
+
});
|
|
14214
|
+
if (!doResult.ok) {
|
|
14215
|
+
return [doResult, { status: "request-error", request: req }];
|
|
14216
|
+
}
|
|
14217
|
+
const response = doResult.value;
|
|
14218
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
14219
|
+
if (!result.ok) {
|
|
14220
|
+
return [result, { status: "complete", request: req, response }];
|
|
14221
|
+
}
|
|
14222
|
+
return [result, { status: "complete", request: req, response }];
|
|
14223
|
+
}
|
|
14224
|
+
|
|
14225
|
+
/**
|
|
14226
|
+
* @license
|
|
14227
|
+
* Copyright 2026 Google LLC
|
|
14228
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14229
|
+
*
|
|
14230
|
+
* g3-prettier-ignore-file
|
|
14231
|
+
*/
|
|
14232
|
+
/**
|
|
14233
|
+
* Updates an existing Webhook.
|
|
14234
|
+
*/
|
|
14235
|
+
function webhooksUpdate(client, id, api_version, update_mask, body, options) {
|
|
14236
|
+
return new APIPromise($do(client, id, api_version, update_mask, body, options));
|
|
14237
|
+
}
|
|
14238
|
+
async function $do(client, id, api_version, update_mask, body, options) {
|
|
14239
|
+
var _a, _b, _c;
|
|
14240
|
+
const input = {
|
|
14241
|
+
id: id,
|
|
14242
|
+
api_version: api_version,
|
|
14243
|
+
update_mask: update_mask,
|
|
14244
|
+
body: body,
|
|
14245
|
+
};
|
|
14246
|
+
const payload = input;
|
|
14247
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
14248
|
+
const pathParams = {
|
|
14249
|
+
api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
|
|
14250
|
+
id: encodeSimple("id", payload.id, {
|
|
14251
|
+
explode: false,
|
|
14252
|
+
charEncoding: "percent",
|
|
14253
|
+
}),
|
|
14254
|
+
};
|
|
14255
|
+
const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
|
|
14256
|
+
const query = encodeFormQuery({
|
|
14257
|
+
"update_mask": payload.update_mask,
|
|
14258
|
+
});
|
|
14259
|
+
const headers = new Headers(compactMap({
|
|
14260
|
+
"Content-Type": "application/json",
|
|
14261
|
+
Accept: "application/json",
|
|
14262
|
+
}));
|
|
14263
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
14264
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
14265
|
+
const context = {
|
|
14266
|
+
options: client._options,
|
|
14267
|
+
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 : "",
|
|
14268
|
+
operation_id: "UpdateWebhook",
|
|
14269
|
+
o_auth2_scopes: null,
|
|
14270
|
+
resolved_security: requestSecurity,
|
|
14271
|
+
security_source: client._options.security,
|
|
14272
|
+
retry_config: (options === null || options === void 0 ? void 0 : options.retries)
|
|
14273
|
+
|| client._options.retry_config
|
|
14274
|
+
|| {
|
|
14275
|
+
strategy: "attempt-count-backoff",
|
|
14276
|
+
backoff: {
|
|
14277
|
+
initialInterval: 500,
|
|
14278
|
+
maxInterval: 8000,
|
|
14279
|
+
exponent: 2,
|
|
14280
|
+
maxElapsedTime: 30000,
|
|
14281
|
+
},
|
|
14282
|
+
retryConnectionErrors: true,
|
|
14283
|
+
maxRetries: 4,
|
|
14284
|
+
}
|
|
14285
|
+
|| { strategy: "none" },
|
|
14286
|
+
retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
|
|
14287
|
+
};
|
|
14288
|
+
const requestRes = client._createRequest(context, {
|
|
14289
|
+
security: requestSecurity,
|
|
14290
|
+
method: "PATCH",
|
|
14291
|
+
baseURL: options === null || options === void 0 ? void 0 : options.server_url,
|
|
14292
|
+
path: path,
|
|
14293
|
+
headers: headers,
|
|
14294
|
+
query: query,
|
|
14295
|
+
body: body$,
|
|
14296
|
+
userAgent: client._options.user_agent,
|
|
14297
|
+
timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
|
|
14298
|
+
}, options);
|
|
14299
|
+
if (!requestRes.ok) {
|
|
14300
|
+
return [requestRes, { status: "invalid" }];
|
|
14301
|
+
}
|
|
14302
|
+
const req = requestRes.value;
|
|
14303
|
+
const doResult = await client._do(req, {
|
|
14304
|
+
context,
|
|
14305
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
14306
|
+
retryConfig: context.retry_config,
|
|
14307
|
+
retryCodes: context.retry_codes,
|
|
14308
|
+
});
|
|
14309
|
+
if (!doResult.ok) {
|
|
14310
|
+
return [doResult, { status: "request-error", request: req }];
|
|
14311
|
+
}
|
|
14312
|
+
const response = doResult.value;
|
|
14313
|
+
const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
|
|
14314
|
+
if (!result.ok) {
|
|
14315
|
+
return [result, { status: "complete", request: req, response }];
|
|
14316
|
+
}
|
|
14317
|
+
return [result, { status: "complete", request: req, response }];
|
|
14318
|
+
}
|
|
14319
|
+
|
|
14320
|
+
/**
|
|
14321
|
+
* @license
|
|
14322
|
+
* Copyright 2026 Google LLC
|
|
14323
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14324
|
+
*
|
|
14325
|
+
* g3-prettier-ignore-file
|
|
14326
|
+
*/
|
|
14327
|
+
class Webhooks extends ClientSDK {
|
|
14328
|
+
/**
|
|
14329
|
+
* Creates a new Webhook.
|
|
14330
|
+
*/
|
|
14331
|
+
create(params, options) {
|
|
14332
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
14333
|
+
return unwrapAsAPIPromise(webhooksCreate(this, body, api_version, options));
|
|
14334
|
+
}
|
|
14335
|
+
/**
|
|
14336
|
+
* Lists all Webhooks.
|
|
14337
|
+
*/
|
|
14338
|
+
list(params, options) {
|
|
14339
|
+
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));
|
|
14340
|
+
}
|
|
14341
|
+
/**
|
|
14342
|
+
* Gets a specific Webhook.
|
|
14343
|
+
*/
|
|
14344
|
+
get(id, params, options) {
|
|
14345
|
+
return unwrapAsAPIPromise(webhooksGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
|
|
14346
|
+
}
|
|
14347
|
+
/**
|
|
14348
|
+
* Updates an existing Webhook.
|
|
13551
14349
|
*/
|
|
13552
14350
|
update(id, params, options) {
|
|
13553
14351
|
const _a = params !== null && params !== void 0 ? params : {}, { api_version, update_mask } = _a, body$body = __rest(_a, ["api_version", "update_mask"]);
|
|
@@ -13599,6 +14397,10 @@ let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
|
|
|
13599
14397
|
var _a;
|
|
13600
14398
|
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Agents(this._options)));
|
|
13601
14399
|
}
|
|
14400
|
+
get triggers() {
|
|
14401
|
+
var _a;
|
|
14402
|
+
return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Triggers(this._options)));
|
|
14403
|
+
}
|
|
13602
14404
|
};
|
|
13603
14405
|
|
|
13604
14406
|
/**
|
|
@@ -13630,11 +14432,11 @@ function getGoogleGenAIAPIVersion(parentClient) {
|
|
|
13630
14432
|
return apiVersion;
|
|
13631
14433
|
}
|
|
13632
14434
|
function buildGoogleGenAIClient(parentClient, options = {}) {
|
|
13633
|
-
var _a, _b, _c, _d;
|
|
14435
|
+
var _a, _b, _c, _d, _e;
|
|
13634
14436
|
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({
|
|
13635
|
-
defaultHeaders: (_c = parentClient.getDefaultHeaders) === null || _c === void 0 ? void 0 : _c.call(parentClient),
|
|
14437
|
+
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)),
|
|
13636
14438
|
getAuthHeaders: (url) => parentClient.getAuthHeaders(url),
|
|
13637
|
-
}), server_url: (
|
|
14439
|
+
}), server_url: (_e = options.server_url) !== null && _e !== void 0 ? _e : getGoogleGenAIServerURL(parentClient) }));
|
|
13638
14440
|
return sdk;
|
|
13639
14441
|
}
|
|
13640
14442
|
class GeminiNextGenInteractions {
|
|
@@ -13741,6 +14543,46 @@ class GeminiNextGenWebhooks {
|
|
|
13741
14543
|
return this.sdk;
|
|
13742
14544
|
}
|
|
13743
14545
|
}
|
|
14546
|
+
class GeminiNextGenTriggers {
|
|
14547
|
+
constructor(parentClient) {
|
|
14548
|
+
this.parentClient = parentClient;
|
|
14549
|
+
}
|
|
14550
|
+
async create(params, options) {
|
|
14551
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
14552
|
+
return unwrapWithSdkHttpResponse(triggersCreate(this.getClient(api_version), body, api_version, toGoogleGenAIRequestOptions(options)));
|
|
14553
|
+
}
|
|
14554
|
+
async list(params = {}, options) {
|
|
14555
|
+
const { api_version, filter, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
|
|
14556
|
+
return unwrapWithSdkHttpResponse(triggersList(this.getClient(api_version), api_version, filter, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
|
|
14557
|
+
}
|
|
14558
|
+
async get(id, params = {}, options) {
|
|
14559
|
+
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)));
|
|
14560
|
+
}
|
|
14561
|
+
async update(id, params, options) {
|
|
14562
|
+
const { api_version } = params, body = __rest(params, ["api_version"]);
|
|
14563
|
+
return unwrapWithSdkHttpResponse(triggersUpdate(this.getClient(api_version), id, body, api_version, toGoogleGenAIRequestOptions(options)));
|
|
14564
|
+
}
|
|
14565
|
+
async delete(id, params = {}, options) {
|
|
14566
|
+
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)));
|
|
14567
|
+
}
|
|
14568
|
+
async run(trigger_id, params = {}, options) {
|
|
14569
|
+
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)));
|
|
14570
|
+
}
|
|
14571
|
+
async listExecutions(trigger_id, params = {}, options) {
|
|
14572
|
+
const { api_version, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
|
|
14573
|
+
return unwrapWithSdkHttpResponse(triggersListExecutions(this.getClient(api_version), trigger_id, api_version, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
|
|
14574
|
+
}
|
|
14575
|
+
getClient(apiVersion) {
|
|
14576
|
+
var _a;
|
|
14577
|
+
if (apiVersion) {
|
|
14578
|
+
return buildGoogleGenAIClient(this.parentClient, {
|
|
14579
|
+
api_version: apiVersion,
|
|
14580
|
+
});
|
|
14581
|
+
}
|
|
14582
|
+
(_a = this.sdk) !== null && _a !== void 0 ? _a : (this.sdk = buildGoogleGenAIClient(this.parentClient));
|
|
14583
|
+
return this.sdk;
|
|
14584
|
+
}
|
|
14585
|
+
}
|
|
13744
14586
|
function trimSlashes(value) {
|
|
13745
14587
|
return value.replace(/^\/+|\/+$/g, "");
|
|
13746
14588
|
}
|
|
@@ -14261,7 +15103,7 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
14261
15103
|
}
|
|
14262
15104
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
14263
15105
|
if (fromSpeechConfig != null) {
|
|
14264
|
-
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
15106
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
|
|
14265
15107
|
}
|
|
14266
15108
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
14267
15109
|
'stopSequences',
|
|
@@ -14291,6 +15133,21 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
14291
15133
|
undefined) {
|
|
14292
15134
|
throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
14293
15135
|
}
|
|
15136
|
+
const fromResponseFormat = getValueByPath(fromObject, [
|
|
15137
|
+
'responseFormat',
|
|
15138
|
+
]);
|
|
15139
|
+
if (fromResponseFormat != null) {
|
|
15140
|
+
let transformedList = fromResponseFormat;
|
|
15141
|
+
if (Array.isArray(transformedList)) {
|
|
15142
|
+
transformedList = transformedList.map((item) => {
|
|
15143
|
+
return item;
|
|
15144
|
+
});
|
|
15145
|
+
}
|
|
15146
|
+
setValueByPath(toObject, ['responseFormat'], transformedList);
|
|
15147
|
+
}
|
|
15148
|
+
if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
|
|
15149
|
+
throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15150
|
+
}
|
|
14294
15151
|
return toObject;
|
|
14295
15152
|
}
|
|
14296
15153
|
function googleMapsToMldev$2(fromObject) {
|
|
@@ -14504,7 +15361,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
14504
15361
|
}
|
|
14505
15362
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
14506
15363
|
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
14507
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
|
|
15364
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
|
|
14508
15365
|
}
|
|
14509
15366
|
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
14510
15367
|
'thinkingConfig',
|
|
@@ -14793,6 +15650,22 @@ function mcpServerToVertex$1(fromObject) {
|
|
|
14793
15650
|
}
|
|
14794
15651
|
return toObject;
|
|
14795
15652
|
}
|
|
15653
|
+
function multiSpeakerVoiceConfigToVertex$1(fromObject) {
|
|
15654
|
+
const toObject = {};
|
|
15655
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
15656
|
+
'speakerVoiceConfigs',
|
|
15657
|
+
]);
|
|
15658
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
15659
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
15660
|
+
if (Array.isArray(transformedList)) {
|
|
15661
|
+
transformedList = transformedList.map((item) => {
|
|
15662
|
+
return speakerVoiceConfigToVertex$1(item);
|
|
15663
|
+
});
|
|
15664
|
+
}
|
|
15665
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
15666
|
+
}
|
|
15667
|
+
return toObject;
|
|
15668
|
+
}
|
|
14796
15669
|
function partToMldev$2(fromObject) {
|
|
14797
15670
|
const toObject = {};
|
|
14798
15671
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -14934,6 +15807,26 @@ function partToVertex$2(fromObject) {
|
|
|
14934
15807
|
}
|
|
14935
15808
|
return toObject;
|
|
14936
15809
|
}
|
|
15810
|
+
function replicatedVoiceConfigToVertex$1(fromObject) {
|
|
15811
|
+
const toObject = {};
|
|
15812
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
15813
|
+
if (fromMimeType != null) {
|
|
15814
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
15815
|
+
}
|
|
15816
|
+
const fromVoiceSampleAudio = getValueByPath(fromObject, [
|
|
15817
|
+
'voiceSampleAudio',
|
|
15818
|
+
]);
|
|
15819
|
+
if (fromVoiceSampleAudio != null) {
|
|
15820
|
+
setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
|
|
15821
|
+
}
|
|
15822
|
+
if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
|
|
15823
|
+
throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15824
|
+
}
|
|
15825
|
+
if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
|
|
15826
|
+
throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15827
|
+
}
|
|
15828
|
+
return toObject;
|
|
15829
|
+
}
|
|
14937
15830
|
function safetySettingToMldev$2(fromObject) {
|
|
14938
15831
|
const toObject = {};
|
|
14939
15832
|
const fromCategory = getValueByPath(fromObject, ['category']);
|
|
@@ -14960,6 +15853,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
14960
15853
|
}
|
|
14961
15854
|
return toObject;
|
|
14962
15855
|
}
|
|
15856
|
+
function speakerVoiceConfigToVertex$1(fromObject) {
|
|
15857
|
+
const toObject = {};
|
|
15858
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
15859
|
+
if (fromSpeaker != null) {
|
|
15860
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
15861
|
+
}
|
|
15862
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
15863
|
+
if (fromVoiceConfig != null) {
|
|
15864
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
15865
|
+
}
|
|
15866
|
+
return toObject;
|
|
15867
|
+
}
|
|
15868
|
+
function speechConfigToVertex$1(fromObject) {
|
|
15869
|
+
const toObject = {};
|
|
15870
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
15871
|
+
if (fromVoiceConfig != null) {
|
|
15872
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
15873
|
+
}
|
|
15874
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
15875
|
+
if (fromLanguageCode != null) {
|
|
15876
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
15877
|
+
}
|
|
15878
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
15879
|
+
'multiSpeakerVoiceConfig',
|
|
15880
|
+
]);
|
|
15881
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
15882
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
|
|
15883
|
+
}
|
|
15884
|
+
return toObject;
|
|
15885
|
+
}
|
|
14963
15886
|
function toolToMldev$2(fromObject) {
|
|
14964
15887
|
const toObject = {};
|
|
14965
15888
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
@@ -15025,6 +15948,9 @@ function toolToMldev$2(fromObject) {
|
|
|
15025
15948
|
}
|
|
15026
15949
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
15027
15950
|
}
|
|
15951
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
15952
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
15953
|
+
}
|
|
15028
15954
|
return toObject;
|
|
15029
15955
|
}
|
|
15030
15956
|
function toolToVertex$1(fromObject) {
|
|
@@ -15098,6 +16024,10 @@ function toolToVertex$1(fromObject) {
|
|
|
15098
16024
|
}
|
|
15099
16025
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
15100
16026
|
}
|
|
16027
|
+
const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
|
|
16028
|
+
if (fromExaAiSearch != null) {
|
|
16029
|
+
setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
|
|
16030
|
+
}
|
|
15101
16031
|
return toObject;
|
|
15102
16032
|
}
|
|
15103
16033
|
function usageMetadataFromVertex(fromObject) {
|
|
@@ -15204,6 +16134,22 @@ function voiceActivityFromVertex(fromObject) {
|
|
|
15204
16134
|
}
|
|
15205
16135
|
return toObject;
|
|
15206
16136
|
}
|
|
16137
|
+
function voiceConfigToVertex$1(fromObject) {
|
|
16138
|
+
const toObject = {};
|
|
16139
|
+
const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
|
|
16140
|
+
'replicatedVoiceConfig',
|
|
16141
|
+
]);
|
|
16142
|
+
if (fromReplicatedVoiceConfig != null) {
|
|
16143
|
+
setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
|
|
16144
|
+
}
|
|
16145
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
16146
|
+
'prebuiltVoiceConfig',
|
|
16147
|
+
]);
|
|
16148
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
16149
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
|
|
16150
|
+
}
|
|
16151
|
+
return toObject;
|
|
16152
|
+
}
|
|
15207
16153
|
|
|
15208
16154
|
/**
|
|
15209
16155
|
* @license
|
|
@@ -15424,6 +16370,18 @@ function contentEmbeddingStatisticsFromVertex(fromObject, _rootObject) {
|
|
|
15424
16370
|
if (fromTokenCount != null) {
|
|
15425
16371
|
setValueByPath(toObject, ['tokenCount'], fromTokenCount);
|
|
15426
16372
|
}
|
|
16373
|
+
const fromTokensDetails = getValueByPath(fromObject, [
|
|
16374
|
+
'tokensDetails',
|
|
16375
|
+
]);
|
|
16376
|
+
if (fromTokensDetails != null) {
|
|
16377
|
+
let transformedList = fromTokensDetails;
|
|
16378
|
+
if (Array.isArray(transformedList)) {
|
|
16379
|
+
transformedList = transformedList.map((item) => {
|
|
16380
|
+
return item;
|
|
16381
|
+
});
|
|
16382
|
+
}
|
|
16383
|
+
setValueByPath(toObject, ['tokensDetails'], transformedList);
|
|
16384
|
+
}
|
|
15427
16385
|
return toObject;
|
|
15428
16386
|
}
|
|
15429
16387
|
function contentToMldev$1(fromObject, rootObject) {
|
|
@@ -16053,6 +17011,10 @@ function embedContentResponseFromVertex(fromObject, rootObject) {
|
|
|
16053
17011
|
usageMetadata['promptTokenCount']) {
|
|
16054
17012
|
stats.tokenCount = usageMetadata['promptTokenCount'];
|
|
16055
17013
|
}
|
|
17014
|
+
if (usageMetadata &&
|
|
17015
|
+
usageMetadata['promptTokensDetails']) {
|
|
17016
|
+
stats.tokensDetails = usageMetadata['promptTokensDetails'];
|
|
17017
|
+
}
|
|
16056
17018
|
if (truncated) {
|
|
16057
17019
|
stats.truncated = truncated;
|
|
16058
17020
|
}
|
|
@@ -16457,7 +17419,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
16457
17419
|
}
|
|
16458
17420
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
16459
17421
|
if (fromSpeechConfig != null) {
|
|
16460
|
-
setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
|
|
17422
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
|
|
16461
17423
|
}
|
|
16462
17424
|
const fromAudioTimestamp = getValueByPath(fromObject, [
|
|
16463
17425
|
'audioTimestamp',
|
|
@@ -17344,7 +18306,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
|
|
|
17344
18306
|
}
|
|
17345
18307
|
return toObject;
|
|
17346
18308
|
}
|
|
17347
|
-
function generationConfigToVertex(fromObject,
|
|
18309
|
+
function generationConfigToVertex(fromObject, rootObject) {
|
|
17348
18310
|
const toObject = {};
|
|
17349
18311
|
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
17350
18312
|
'modelSelectionConfig',
|
|
@@ -17440,7 +18402,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
|
|
|
17440
18402
|
}
|
|
17441
18403
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
17442
18404
|
if (fromSpeechConfig != null) {
|
|
17443
|
-
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
18405
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
|
|
17444
18406
|
}
|
|
17445
18407
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
17446
18408
|
'stopSequences',
|
|
@@ -17470,6 +18432,21 @@ function generationConfigToVertex(fromObject, _rootObject) {
|
|
|
17470
18432
|
undefined) {
|
|
17471
18433
|
throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
17472
18434
|
}
|
|
18435
|
+
const fromResponseFormat = getValueByPath(fromObject, [
|
|
18436
|
+
'responseFormat',
|
|
18437
|
+
]);
|
|
18438
|
+
if (fromResponseFormat != null) {
|
|
18439
|
+
let transformedList = fromResponseFormat;
|
|
18440
|
+
if (Array.isArray(transformedList)) {
|
|
18441
|
+
transformedList = transformedList.map((item) => {
|
|
18442
|
+
return item;
|
|
18443
|
+
});
|
|
18444
|
+
}
|
|
18445
|
+
setValueByPath(toObject, ['responseFormat'], transformedList);
|
|
18446
|
+
}
|
|
18447
|
+
if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
|
|
18448
|
+
throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
18449
|
+
}
|
|
17473
18450
|
return toObject;
|
|
17474
18451
|
}
|
|
17475
18452
|
function getModelParametersToMldev(apiClient, fromObject, _rootObject) {
|
|
@@ -17907,6 +18884,22 @@ function modelFromVertex(fromObject, rootObject) {
|
|
|
17907
18884
|
}
|
|
17908
18885
|
return toObject;
|
|
17909
18886
|
}
|
|
18887
|
+
function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
|
|
18888
|
+
const toObject = {};
|
|
18889
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
18890
|
+
'speakerVoiceConfigs',
|
|
18891
|
+
]);
|
|
18892
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
18893
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
18894
|
+
if (Array.isArray(transformedList)) {
|
|
18895
|
+
transformedList = transformedList.map((item) => {
|
|
18896
|
+
return speakerVoiceConfigToVertex(item);
|
|
18897
|
+
});
|
|
18898
|
+
}
|
|
18899
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
18900
|
+
}
|
|
18901
|
+
return toObject;
|
|
18902
|
+
}
|
|
17910
18903
|
function partToMldev$1(fromObject, rootObject) {
|
|
17911
18904
|
const toObject = {};
|
|
17912
18905
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -18216,6 +19209,26 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
|
|
|
18216
19209
|
}
|
|
18217
19210
|
return toObject;
|
|
18218
19211
|
}
|
|
19212
|
+
function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
|
|
19213
|
+
const toObject = {};
|
|
19214
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
19215
|
+
if (fromMimeType != null) {
|
|
19216
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
19217
|
+
}
|
|
19218
|
+
const fromVoiceSampleAudio = getValueByPath(fromObject, [
|
|
19219
|
+
'voiceSampleAudio',
|
|
19220
|
+
]);
|
|
19221
|
+
if (fromVoiceSampleAudio != null) {
|
|
19222
|
+
setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
|
|
19223
|
+
}
|
|
19224
|
+
if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
|
|
19225
|
+
throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
19226
|
+
}
|
|
19227
|
+
if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
|
|
19228
|
+
throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
19229
|
+
}
|
|
19230
|
+
return toObject;
|
|
19231
|
+
}
|
|
18219
19232
|
function safetyAttributesFromMldev(fromObject, _rootObject) {
|
|
18220
19233
|
const toObject = {};
|
|
18221
19234
|
const fromCategories = getValueByPath(fromObject, [
|
|
@@ -18365,6 +19378,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
|
|
|
18365
19378
|
}
|
|
18366
19379
|
return toObject;
|
|
18367
19380
|
}
|
|
19381
|
+
function speakerVoiceConfigToVertex(fromObject, rootObject) {
|
|
19382
|
+
const toObject = {};
|
|
19383
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
19384
|
+
if (fromSpeaker != null) {
|
|
19385
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
19386
|
+
}
|
|
19387
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
19388
|
+
if (fromVoiceConfig != null) {
|
|
19389
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
|
|
19390
|
+
}
|
|
19391
|
+
return toObject;
|
|
19392
|
+
}
|
|
19393
|
+
function speechConfigToVertex(fromObject, rootObject) {
|
|
19394
|
+
const toObject = {};
|
|
19395
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
19396
|
+
if (fromVoiceConfig != null) {
|
|
19397
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
|
|
19398
|
+
}
|
|
19399
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
19400
|
+
if (fromLanguageCode != null) {
|
|
19401
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
19402
|
+
}
|
|
19403
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
19404
|
+
'multiSpeakerVoiceConfig',
|
|
19405
|
+
]);
|
|
19406
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
19407
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
|
|
19408
|
+
}
|
|
19409
|
+
return toObject;
|
|
19410
|
+
}
|
|
18368
19411
|
function toolConfigToMldev(fromObject, rootObject) {
|
|
18369
19412
|
const toObject = {};
|
|
18370
19413
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
@@ -18470,6 +19513,9 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
18470
19513
|
}
|
|
18471
19514
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
18472
19515
|
}
|
|
19516
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
19517
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19518
|
+
}
|
|
18473
19519
|
return toObject;
|
|
18474
19520
|
}
|
|
18475
19521
|
function toolToVertex(fromObject, rootObject) {
|
|
@@ -18543,6 +19589,10 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
18543
19589
|
}
|
|
18544
19590
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
18545
19591
|
}
|
|
19592
|
+
const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
|
|
19593
|
+
if (fromExaAiSearch != null) {
|
|
19594
|
+
setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
|
|
19595
|
+
}
|
|
18546
19596
|
return toObject;
|
|
18547
19597
|
}
|
|
18548
19598
|
function tunedModelInfoFromMldev(fromObject, _rootObject) {
|
|
@@ -18854,6 +19904,22 @@ function videoToVertex(fromObject, _rootObject) {
|
|
|
18854
19904
|
}
|
|
18855
19905
|
return toObject;
|
|
18856
19906
|
}
|
|
19907
|
+
function voiceConfigToVertex(fromObject, rootObject) {
|
|
19908
|
+
const toObject = {};
|
|
19909
|
+
const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
|
|
19910
|
+
'replicatedVoiceConfig',
|
|
19911
|
+
]);
|
|
19912
|
+
if (fromReplicatedVoiceConfig != null) {
|
|
19913
|
+
setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
|
|
19914
|
+
}
|
|
19915
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
19916
|
+
'prebuiltVoiceConfig',
|
|
19917
|
+
]);
|
|
19918
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
19919
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
|
|
19920
|
+
}
|
|
19921
|
+
return toObject;
|
|
19922
|
+
}
|
|
18857
19923
|
|
|
18858
19924
|
/**
|
|
18859
19925
|
* @license
|
|
@@ -19416,10 +20482,27 @@ class Live {
|
|
|
19416
20482
|
onopenResolve({});
|
|
19417
20483
|
};
|
|
19418
20484
|
const apiClient = this.apiClient;
|
|
20485
|
+
let sessionResolved = false;
|
|
20486
|
+
const messageQueue = [];
|
|
20487
|
+
let setupCompleteResolve = () => { };
|
|
20488
|
+
const setupCompletePromise = new Promise((resolve) => {
|
|
20489
|
+
setupCompleteResolve = resolve;
|
|
20490
|
+
});
|
|
19419
20491
|
const websocketCallbacks = {
|
|
19420
20492
|
onopen: onopenAwaitedCallback,
|
|
19421
20493
|
onmessage: (event) => {
|
|
19422
|
-
void handleWebSocketMessage(apiClient,
|
|
20494
|
+
void handleWebSocketMessage(apiClient, (msg) => {
|
|
20495
|
+
if (msg.setupComplete && !session.setupComplete) {
|
|
20496
|
+
session.setupComplete = msg.setupComplete;
|
|
20497
|
+
setupCompleteResolve({});
|
|
20498
|
+
}
|
|
20499
|
+
if (sessionResolved) {
|
|
20500
|
+
callbacks.onmessage(msg);
|
|
20501
|
+
}
|
|
20502
|
+
else {
|
|
20503
|
+
messageQueue.push(msg);
|
|
20504
|
+
}
|
|
20505
|
+
}, event);
|
|
19423
20506
|
},
|
|
19424
20507
|
onerror: (_a = callbacks === null || callbacks === void 0 ? void 0 : callbacks.onerror) !== null && _a !== void 0 ? _a : function (e) {
|
|
19425
20508
|
},
|
|
@@ -19481,8 +20564,14 @@ class Live {
|
|
|
19481
20564
|
clientMessage = liveConnectParametersToMldev(this.apiClient, liveConnectParameters);
|
|
19482
20565
|
}
|
|
19483
20566
|
delete clientMessage['config'];
|
|
20567
|
+
const session = new Session(conn, this.apiClient);
|
|
19484
20568
|
conn.send(JSON.stringify(clientMessage));
|
|
19485
|
-
|
|
20569
|
+
await setupCompletePromise;
|
|
20570
|
+
sessionResolved = true;
|
|
20571
|
+
for (const msg of messageQueue) {
|
|
20572
|
+
callbacks.onmessage(msg);
|
|
20573
|
+
}
|
|
20574
|
+
return session;
|
|
19486
20575
|
}
|
|
19487
20576
|
// TODO: b/416041229 - Abstract this method to a common place.
|
|
19488
20577
|
isCallableTool(tool) {
|
|
@@ -22011,6 +23100,9 @@ function toolToMldev(fromObject) {
|
|
|
22011
23100
|
}
|
|
22012
23101
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
22013
23102
|
}
|
|
23103
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
23104
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
23105
|
+
}
|
|
22014
23106
|
return toObject;
|
|
22015
23107
|
}
|
|
22016
23108
|
|
|
@@ -23105,6 +24197,18 @@ function generationConfigFromVertex(fromObject, _rootObject) {
|
|
|
23105
24197
|
if (fromTopP != null) {
|
|
23106
24198
|
setValueByPath(toObject, ['topP'], fromTopP);
|
|
23107
24199
|
}
|
|
24200
|
+
const fromResponseFormat = getValueByPath(fromObject, [
|
|
24201
|
+
'responseFormat',
|
|
24202
|
+
]);
|
|
24203
|
+
if (fromResponseFormat != null) {
|
|
24204
|
+
let transformedList = fromResponseFormat;
|
|
24205
|
+
if (Array.isArray(transformedList)) {
|
|
24206
|
+
transformedList = transformedList.map((item) => {
|
|
24207
|
+
return item;
|
|
24208
|
+
});
|
|
24209
|
+
}
|
|
24210
|
+
setValueByPath(toObject, ['responseFormat'], transformedList);
|
|
24211
|
+
}
|
|
23108
24212
|
return toObject;
|
|
23109
24213
|
}
|
|
23110
24214
|
function getTuningJobParametersToMldev(fromObject, _rootObject) {
|
|
@@ -24190,6 +25294,14 @@ class GoogleGenAI {
|
|
|
24190
25294
|
this._agents = new GeminiNextGenAgents(this.apiClient);
|
|
24191
25295
|
return this._agents;
|
|
24192
25296
|
}
|
|
25297
|
+
get triggers() {
|
|
25298
|
+
if (this._triggers !== undefined) {
|
|
25299
|
+
return this._triggers;
|
|
25300
|
+
}
|
|
25301
|
+
console.warn('GoogleGenAI.triggers: Triggers usage is experimental and may change in future versions.');
|
|
25302
|
+
this._triggers = new GeminiNextGenTriggers(this.apiClient);
|
|
25303
|
+
return this._triggers;
|
|
25304
|
+
}
|
|
24193
25305
|
constructor(options) {
|
|
24194
25306
|
var _a, _b;
|
|
24195
25307
|
if (options.apiKey == null) {
|
|
@@ -24228,5 +25340,5 @@ class GoogleGenAI {
|
|
|
24228
25340
|
}
|
|
24229
25341
|
}
|
|
24230
25342
|
|
|
24231
|
-
export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, EvaluateDatasetResponse, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImageResizeMode, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MatchOperation, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReinforcementTuningAutoraterScorerParsedResponseConversionScorer, ReinforcementTuningParseResponseConfig, ReinforcementTuningThinkingLevel, ReplayResponse, ResourceScope, ResponseParseType, SafetyFilterLevel, SafetyPolicy, Scale, SegmentImageResponse, SegmentMode, ServiceTier, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, ToolResponse, ToolType, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningSpeed, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, ValidateRewardResponse, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VideoOrientation, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
25343
|
+
export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AspectRatio, AudioResponseFormat, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, Delivery, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, EvaluateDatasetResponse, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImageResizeMode, ImageResponseFormat, ImageSize, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MatchOperation, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReinforcementTuningAutoraterScorerParsedResponseConversionScorer, ReinforcementTuningParseResponseConfig, ReinforcementTuningThinkingLevel, ReplayResponse, ResourceScope, ResponseFormat, ResponseParseType, SafetyFilterLevel, SafetyPolicy, Scale, SegmentImageResponse, SegmentMode, ServiceTier, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, TextResponseFormat, ThinkingLevel, Tokens, ToolResponse, ToolType, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningSpeed, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, ValidateRewardResponse, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VideoOrientation, VideoResponseFormat, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
24232
25344
|
//# sourceMappingURL=index.mjs.map
|