@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.
@@ -862,7 +862,7 @@ exports.PhishBlockThreshold = void 0;
862
862
  */
863
863
  PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
864
864
  })(exports.PhishBlockThreshold || (exports.PhishBlockThreshold = {}));
865
- /** Specifies the function Behavior. Currently only non-blocking functions are supported. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method. */
865
+ /** 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. */
866
866
  exports.Behavior = void 0;
867
867
  (function (Behavior) {
868
868
  /**
@@ -1376,6 +1376,110 @@ exports.Modality = void 0;
1376
1376
  */
1377
1377
  Modality["VIDEO"] = "VIDEO";
1378
1378
  })(exports.Modality || (exports.Modality = {}));
1379
+ /** Delivery mode for the generated content. */
1380
+ exports.Delivery = void 0;
1381
+ (function (Delivery) {
1382
+ /**
1383
+ * Default value. This value is unused.
1384
+ */
1385
+ Delivery["DELIVERY_UNSPECIFIED"] = "DELIVERY_UNSPECIFIED";
1386
+ /**
1387
+ * Generated bytes are returned inline in the response.
1388
+ */
1389
+ Delivery["INLINE"] = "INLINE";
1390
+ /**
1391
+ * Generated content is stored and a URI is returned.
1392
+ */
1393
+ Delivery["URI"] = "URI";
1394
+ })(exports.Delivery || (exports.Delivery = {}));
1395
+ /** The aspect ratio for the image output. */
1396
+ exports.AspectRatio = void 0;
1397
+ (function (AspectRatio) {
1398
+ /**
1399
+ * Default value. This value is unused.
1400
+ */
1401
+ AspectRatio["ASPECT_RATIO_UNSPECIFIED"] = "ASPECT_RATIO_UNSPECIFIED";
1402
+ /**
1403
+ * 1:1 aspect ratio.
1404
+ */
1405
+ AspectRatio["ASPECT_RATIO_ONE_BY_ONE"] = "ASPECT_RATIO_ONE_BY_ONE";
1406
+ /**
1407
+ * 2:3 aspect ratio.
1408
+ */
1409
+ AspectRatio["ASPECT_RATIO_TWO_BY_THREE"] = "ASPECT_RATIO_TWO_BY_THREE";
1410
+ /**
1411
+ * 3:2 aspect ratio.
1412
+ */
1413
+ AspectRatio["ASPECT_RATIO_THREE_BY_TWO"] = "ASPECT_RATIO_THREE_BY_TWO";
1414
+ /**
1415
+ * 3:4 aspect ratio.
1416
+ */
1417
+ AspectRatio["ASPECT_RATIO_THREE_BY_FOUR"] = "ASPECT_RATIO_THREE_BY_FOUR";
1418
+ /**
1419
+ * 4:3 aspect ratio.
1420
+ */
1421
+ AspectRatio["ASPECT_RATIO_FOUR_BY_THREE"] = "ASPECT_RATIO_FOUR_BY_THREE";
1422
+ /**
1423
+ * 4:5 aspect ratio.
1424
+ */
1425
+ AspectRatio["ASPECT_RATIO_FOUR_BY_FIVE"] = "ASPECT_RATIO_FOUR_BY_FIVE";
1426
+ /**
1427
+ * 5:4 aspect ratio.
1428
+ */
1429
+ AspectRatio["ASPECT_RATIO_FIVE_BY_FOUR"] = "ASPECT_RATIO_FIVE_BY_FOUR";
1430
+ /**
1431
+ * 9:16 aspect ratio.
1432
+ */
1433
+ AspectRatio["ASPECT_RATIO_NINE_BY_SIXTEEN"] = "ASPECT_RATIO_NINE_BY_SIXTEEN";
1434
+ /**
1435
+ * 16:9 aspect ratio.
1436
+ */
1437
+ AspectRatio["ASPECT_RATIO_SIXTEEN_BY_NINE"] = "ASPECT_RATIO_SIXTEEN_BY_NINE";
1438
+ /**
1439
+ * 21:9 aspect ratio.
1440
+ */
1441
+ AspectRatio["ASPECT_RATIO_TWENTY_ONE_BY_NINE"] = "ASPECT_RATIO_TWENTY_ONE_BY_NINE";
1442
+ /**
1443
+ * 1:8 aspect ratio.
1444
+ */
1445
+ AspectRatio["ASPECT_RATIO_ONE_BY_EIGHT"] = "ASPECT_RATIO_ONE_BY_EIGHT";
1446
+ /**
1447
+ * 8:1 aspect ratio.
1448
+ */
1449
+ AspectRatio["ASPECT_RATIO_EIGHT_BY_ONE"] = "ASPECT_RATIO_EIGHT_BY_ONE";
1450
+ /**
1451
+ * 1:4 aspect ratio.
1452
+ */
1453
+ AspectRatio["ASPECT_RATIO_ONE_BY_FOUR"] = "ASPECT_RATIO_ONE_BY_FOUR";
1454
+ /**
1455
+ * 4:1 aspect ratio.
1456
+ */
1457
+ AspectRatio["ASPECT_RATIO_FOUR_BY_ONE"] = "ASPECT_RATIO_FOUR_BY_ONE";
1458
+ })(exports.AspectRatio || (exports.AspectRatio = {}));
1459
+ /** The size of the image output. */
1460
+ exports.ImageSize = void 0;
1461
+ (function (ImageSize) {
1462
+ /**
1463
+ * Default value. This value is unused.
1464
+ */
1465
+ ImageSize["IMAGE_SIZE_UNSPECIFIED"] = "IMAGE_SIZE_UNSPECIFIED";
1466
+ /**
1467
+ * 512px image size.
1468
+ */
1469
+ ImageSize["IMAGE_SIZE_FIVE_TWELVE"] = "IMAGE_SIZE_FIVE_TWELVE";
1470
+ /**
1471
+ * 1K image size.
1472
+ */
1473
+ ImageSize["IMAGE_SIZE_ONE_K"] = "IMAGE_SIZE_ONE_K";
1474
+ /**
1475
+ * 2K image size.
1476
+ */
1477
+ ImageSize["IMAGE_SIZE_TWO_K"] = "IMAGE_SIZE_TWO_K";
1478
+ /**
1479
+ * 4K image size.
1480
+ */
1481
+ ImageSize["IMAGE_SIZE_FOUR_K"] = "IMAGE_SIZE_FOUR_K";
1482
+ })(exports.ImageSize || (exports.ImageSize = {}));
1379
1483
  /** Tuning mode. This enum is not supported in Gemini API. */
1380
1484
  exports.TuningMode = void 0;
1381
1485
  (function (TuningMode) {
@@ -1424,6 +1528,58 @@ exports.AdapterSize = void 0;
1424
1528
  */
1425
1529
  AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
1426
1530
  })(exports.AdapterSize || (exports.AdapterSize = {}));
1531
+ /** Defines the type for parsing sample response. This enum is not supported in Gemini API. */
1532
+ exports.ResponseParseType = void 0;
1533
+ (function (ResponseParseType) {
1534
+ /**
1535
+ * Default value. Fallback to IDENTITY
1536
+ */
1537
+ ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1538
+ /**
1539
+ * Returns the sample response as is.
1540
+ */
1541
+ ResponseParseType["IDENTITY"] = "IDENTITY";
1542
+ /**
1543
+ * 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.
1544
+ */
1545
+ ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1546
+ })(exports.ResponseParseType || (exports.ResponseParseType = {}));
1547
+ /** Match operation to use for evaluating rewards. This enum is not supported in Gemini API. */
1548
+ exports.MatchOperation = void 0;
1549
+ (function (MatchOperation) {
1550
+ /**
1551
+ * Default value. A user error will be returned if not set.
1552
+ */
1553
+ MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1554
+ /**
1555
+ * Equivalent to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains) `REGEX_CONTAINS(target, expression)`.
1556
+ */
1557
+ MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1558
+ /**
1559
+ * The match operation returns `true` if expression is a substring of the target.
1560
+ */
1561
+ MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1562
+ /**
1563
+ * The match operation returns `true` expression is an exact match of the target.
1564
+ */
1565
+ MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1566
+ })(exports.MatchOperation || (exports.MatchOperation = {}));
1567
+ /** Represents how much to think for the tuning job. */
1568
+ exports.ReinforcementTuningThinkingLevel = void 0;
1569
+ (function (ReinforcementTuningThinkingLevel) {
1570
+ /**
1571
+ * Unspecified thinking level.
1572
+ */
1573
+ ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1574
+ /**
1575
+ * Little to no thinking.
1576
+ */
1577
+ ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1578
+ /**
1579
+ * High thinking level.
1580
+ */
1581
+ ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1582
+ })(exports.ReinforcementTuningThinkingLevel || (exports.ReinforcementTuningThinkingLevel = {}));
1427
1583
  /** Job state. */
1428
1584
  exports.JobState = void 0;
1429
1585
  (function (JobState) {
@@ -1908,58 +2064,6 @@ exports.ImageResizeMode = void 0;
1908
2064
  */
1909
2065
  ImageResizeMode["PAD"] = "PAD";
1910
2066
  })(exports.ImageResizeMode || (exports.ImageResizeMode = {}));
1911
- /** Defines how to parse sample response. */
1912
- exports.ResponseParseType = void 0;
1913
- (function (ResponseParseType) {
1914
- /**
1915
- * Default value. This value is unused.
1916
- */
1917
- ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1918
- /**
1919
- * Use the sample response as is.
1920
- */
1921
- ResponseParseType["IDENTITY"] = "IDENTITY";
1922
- /**
1923
- * Use regex to extract the important part of sample response.
1924
- */
1925
- ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1926
- })(exports.ResponseParseType || (exports.ResponseParseType = {}));
1927
- /** Match operation to use for evaluation. */
1928
- exports.MatchOperation = void 0;
1929
- (function (MatchOperation) {
1930
- /**
1931
- * Default value. This value is unused.
1932
- */
1933
- MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1934
- /**
1935
- * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
1936
- */
1937
- MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1938
- /**
1939
- * `expression` is a substring of target.
1940
- */
1941
- MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1942
- /**
1943
- * `expression` is an exact match of target.
1944
- */
1945
- MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1946
- })(exports.MatchOperation || (exports.MatchOperation = {}));
1947
- /** Represents how much to think for the tuning job. */
1948
- exports.ReinforcementTuningThinkingLevel = void 0;
1949
- (function (ReinforcementTuningThinkingLevel) {
1950
- /**
1951
- * Unspecified thinking level.
1952
- */
1953
- ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1954
- /**
1955
- * Little to no thinking.
1956
- */
1957
- ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1958
- /**
1959
- * High thinking level.
1960
- */
1961
- ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1962
- })(exports.ReinforcementTuningThinkingLevel || (exports.ReinforcementTuningThinkingLevel = {}));
1963
2067
  /** Enum representing the tuning method. */
1964
2068
  exports.TuningMethod = void 0;
1965
2069
  (function (TuningMethod) {
@@ -2756,6 +2860,21 @@ class ListModelsResponse {
2756
2860
  }
2757
2861
  class DeleteModelResponse {
2758
2862
  }
2863
+ /** Configuration for audio-specific output formatting. */
2864
+ class AudioResponseFormat {
2865
+ }
2866
+ /** Configuration for image-specific output formatting. */
2867
+ class ImageResponseFormat {
2868
+ }
2869
+ /** Configuration for text-specific output formatting. */
2870
+ class TextResponseFormat {
2871
+ }
2872
+ /** Configuration for video-specific output formatting. This data type is not supported in Gemini API. */
2873
+ class VideoResponseFormat {
2874
+ }
2875
+ /** Configuration for the model to configure output formatting and delivery. This data type is not supported in Gemini API. */
2876
+ class ResponseFormat {
2877
+ }
2759
2878
  /** Response for counting tokens. */
2760
2879
  class CountTokensResponse {
2761
2880
  }
@@ -2784,10 +2903,10 @@ class GenerateVideosOperation {
2784
2903
  return operation;
2785
2904
  }
2786
2905
  }
2787
- /** Defines how to parse sample response for reinforcement tuning. */
2906
+ /** 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. */
2788
2907
  class ReinforcementTuningParseResponseConfig {
2789
2908
  }
2790
- /** Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]). */
2909
+ /** 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. */
2791
2910
  class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
2792
2911
  }
2793
2912
  /** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
@@ -5227,6 +5346,9 @@ function toolToMldev$4(fromObject) {
5227
5346
  }
5228
5347
  setValueByPath(toObject, ['mcpServers'], transformedList);
5229
5348
  }
5349
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
5350
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
5351
+ }
5230
5352
  return toObject;
5231
5353
  }
5232
5354
  function vertexMultimodalDatasetDestinationFromVertex(fromObject) {
@@ -6697,6 +6819,9 @@ function toolToMldev$3(fromObject) {
6697
6819
  }
6698
6820
  setValueByPath(toObject, ['mcpServers'], transformedList);
6699
6821
  }
6822
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
6823
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
6824
+ }
6700
6825
  return toObject;
6701
6826
  }
6702
6827
  function toolToVertex$2(fromObject) {
@@ -6770,6 +6895,10 @@ function toolToVertex$2(fromObject) {
6770
6895
  }
6771
6896
  setValueByPath(toObject, ['mcpServers'], transformedList);
6772
6897
  }
6898
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
6899
+ if (fromExaAiSearch != null) {
6900
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
6901
+ }
6773
6902
  return toObject;
6774
6903
  }
6775
6904
  function updateCachedContentConfigToMldev(fromObject, parentObject) {
@@ -8344,7 +8473,7 @@ function generationConfigToVertex$1(fromObject) {
8344
8473
  }
8345
8474
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8346
8475
  if (fromSpeechConfig != null) {
8347
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
8476
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
8348
8477
  }
8349
8478
  const fromStopSequences = getValueByPath(fromObject, [
8350
8479
  'stopSequences',
@@ -8374,6 +8503,21 @@ function generationConfigToVertex$1(fromObject) {
8374
8503
  undefined) {
8375
8504
  throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8376
8505
  }
8506
+ const fromResponseFormat = getValueByPath(fromObject, [
8507
+ 'responseFormat',
8508
+ ]);
8509
+ if (fromResponseFormat != null) {
8510
+ let transformedList = fromResponseFormat;
8511
+ if (Array.isArray(transformedList)) {
8512
+ transformedList = transformedList.map((item) => {
8513
+ return item;
8514
+ });
8515
+ }
8516
+ setValueByPath(toObject, ['responseFormat'], transformedList);
8517
+ }
8518
+ if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
8519
+ throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
8520
+ }
8377
8521
  return toObject;
8378
8522
  }
8379
8523
  function googleMapsToMldev$2(fromObject) {
@@ -8587,7 +8731,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
8587
8731
  }
8588
8732
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8589
8733
  if (parentObject !== undefined && fromSpeechConfig != null) {
8590
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
8734
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
8591
8735
  }
8592
8736
  const fromThinkingConfig = getValueByPath(fromObject, [
8593
8737
  'thinkingConfig',
@@ -8876,6 +9020,22 @@ function mcpServerToVertex$1(fromObject) {
8876
9020
  }
8877
9021
  return toObject;
8878
9022
  }
9023
+ function multiSpeakerVoiceConfigToVertex$1(fromObject) {
9024
+ const toObject = {};
9025
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
9026
+ 'speakerVoiceConfigs',
9027
+ ]);
9028
+ if (fromSpeakerVoiceConfigs != null) {
9029
+ let transformedList = fromSpeakerVoiceConfigs;
9030
+ if (Array.isArray(transformedList)) {
9031
+ transformedList = transformedList.map((item) => {
9032
+ return speakerVoiceConfigToVertex$1(item);
9033
+ });
9034
+ }
9035
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
9036
+ }
9037
+ return toObject;
9038
+ }
8879
9039
  function partToMldev$2(fromObject) {
8880
9040
  const toObject = {};
8881
9041
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -9017,6 +9177,26 @@ function partToVertex$2(fromObject) {
9017
9177
  }
9018
9178
  return toObject;
9019
9179
  }
9180
+ function replicatedVoiceConfigToVertex$1(fromObject) {
9181
+ const toObject = {};
9182
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9183
+ if (fromMimeType != null) {
9184
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
9185
+ }
9186
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
9187
+ 'voiceSampleAudio',
9188
+ ]);
9189
+ if (fromVoiceSampleAudio != null) {
9190
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
9191
+ }
9192
+ if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
9193
+ throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
9194
+ }
9195
+ if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
9196
+ throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
9197
+ }
9198
+ return toObject;
9199
+ }
9020
9200
  function safetySettingToMldev$2(fromObject) {
9021
9201
  const toObject = {};
9022
9202
  const fromCategory = getValueByPath(fromObject, ['category']);
@@ -9043,6 +9223,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
9043
9223
  }
9044
9224
  return toObject;
9045
9225
  }
9226
+ function speakerVoiceConfigToVertex$1(fromObject) {
9227
+ const toObject = {};
9228
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
9229
+ if (fromSpeaker != null) {
9230
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
9231
+ }
9232
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
9233
+ if (fromVoiceConfig != null) {
9234
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
9235
+ }
9236
+ return toObject;
9237
+ }
9238
+ function speechConfigToVertex$1(fromObject) {
9239
+ const toObject = {};
9240
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
9241
+ if (fromVoiceConfig != null) {
9242
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
9243
+ }
9244
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
9245
+ if (fromLanguageCode != null) {
9246
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
9247
+ }
9248
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
9249
+ 'multiSpeakerVoiceConfig',
9250
+ ]);
9251
+ if (fromMultiSpeakerVoiceConfig != null) {
9252
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
9253
+ }
9254
+ return toObject;
9255
+ }
9046
9256
  function toolToMldev$2(fromObject) {
9047
9257
  const toObject = {};
9048
9258
  if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
@@ -9108,6 +9318,9 @@ function toolToMldev$2(fromObject) {
9108
9318
  }
9109
9319
  setValueByPath(toObject, ['mcpServers'], transformedList);
9110
9320
  }
9321
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
9322
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
9323
+ }
9111
9324
  return toObject;
9112
9325
  }
9113
9326
  function toolToVertex$1(fromObject) {
@@ -9181,6 +9394,10 @@ function toolToVertex$1(fromObject) {
9181
9394
  }
9182
9395
  setValueByPath(toObject, ['mcpServers'], transformedList);
9183
9396
  }
9397
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
9398
+ if (fromExaAiSearch != null) {
9399
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
9400
+ }
9184
9401
  return toObject;
9185
9402
  }
9186
9403
  function usageMetadataFromVertex(fromObject) {
@@ -9287,6 +9504,22 @@ function voiceActivityFromVertex(fromObject) {
9287
9504
  }
9288
9505
  return toObject;
9289
9506
  }
9507
+ function voiceConfigToVertex$1(fromObject) {
9508
+ const toObject = {};
9509
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
9510
+ 'replicatedVoiceConfig',
9511
+ ]);
9512
+ if (fromReplicatedVoiceConfig != null) {
9513
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
9514
+ }
9515
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
9516
+ 'prebuiltVoiceConfig',
9517
+ ]);
9518
+ if (fromPrebuiltVoiceConfig != null) {
9519
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
9520
+ }
9521
+ return toObject;
9522
+ }
9290
9523
 
9291
9524
  /**
9292
9525
  * @license
@@ -9507,6 +9740,18 @@ function contentEmbeddingStatisticsFromVertex(fromObject, _rootObject) {
9507
9740
  if (fromTokenCount != null) {
9508
9741
  setValueByPath(toObject, ['tokenCount'], fromTokenCount);
9509
9742
  }
9743
+ const fromTokensDetails = getValueByPath(fromObject, [
9744
+ 'tokensDetails',
9745
+ ]);
9746
+ if (fromTokensDetails != null) {
9747
+ let transformedList = fromTokensDetails;
9748
+ if (Array.isArray(transformedList)) {
9749
+ transformedList = transformedList.map((item) => {
9750
+ return item;
9751
+ });
9752
+ }
9753
+ setValueByPath(toObject, ['tokensDetails'], transformedList);
9754
+ }
9510
9755
  return toObject;
9511
9756
  }
9512
9757
  function contentToMldev$1(fromObject, rootObject) {
@@ -10136,6 +10381,10 @@ function embedContentResponseFromVertex(fromObject, rootObject) {
10136
10381
  usageMetadata['promptTokenCount']) {
10137
10382
  stats.tokenCount = usageMetadata['promptTokenCount'];
10138
10383
  }
10384
+ if (usageMetadata &&
10385
+ usageMetadata['promptTokensDetails']) {
10386
+ stats.tokensDetails = usageMetadata['promptTokensDetails'];
10387
+ }
10139
10388
  if (truncated) {
10140
10389
  stats.truncated = truncated;
10141
10390
  }
@@ -10540,7 +10789,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
10540
10789
  }
10541
10790
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
10542
10791
  if (fromSpeechConfig != null) {
10543
- setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
10792
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
10544
10793
  }
10545
10794
  const fromAudioTimestamp = getValueByPath(fromObject, [
10546
10795
  'audioTimestamp',
@@ -11427,7 +11676,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
11427
11676
  }
11428
11677
  return toObject;
11429
11678
  }
11430
- function generationConfigToVertex(fromObject, _rootObject) {
11679
+ function generationConfigToVertex(fromObject, rootObject) {
11431
11680
  const toObject = {};
11432
11681
  const fromModelSelectionConfig = getValueByPath(fromObject, [
11433
11682
  'modelSelectionConfig',
@@ -11523,7 +11772,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
11523
11772
  }
11524
11773
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
11525
11774
  if (fromSpeechConfig != null) {
11526
- setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
11775
+ setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
11527
11776
  }
11528
11777
  const fromStopSequences = getValueByPath(fromObject, [
11529
11778
  'stopSequences',
@@ -11553,6 +11802,21 @@ function generationConfigToVertex(fromObject, _rootObject) {
11553
11802
  undefined) {
11554
11803
  throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11555
11804
  }
11805
+ const fromResponseFormat = getValueByPath(fromObject, [
11806
+ 'responseFormat',
11807
+ ]);
11808
+ if (fromResponseFormat != null) {
11809
+ let transformedList = fromResponseFormat;
11810
+ if (Array.isArray(transformedList)) {
11811
+ transformedList = transformedList.map((item) => {
11812
+ return item;
11813
+ });
11814
+ }
11815
+ setValueByPath(toObject, ['responseFormat'], transformedList);
11816
+ }
11817
+ if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
11818
+ throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
11819
+ }
11556
11820
  return toObject;
11557
11821
  }
11558
11822
  function getModelParametersToMldev(apiClient, fromObject, _rootObject) {
@@ -11990,6 +12254,22 @@ function modelFromVertex(fromObject, rootObject) {
11990
12254
  }
11991
12255
  return toObject;
11992
12256
  }
12257
+ function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
12258
+ const toObject = {};
12259
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
12260
+ 'speakerVoiceConfigs',
12261
+ ]);
12262
+ if (fromSpeakerVoiceConfigs != null) {
12263
+ let transformedList = fromSpeakerVoiceConfigs;
12264
+ if (Array.isArray(transformedList)) {
12265
+ transformedList = transformedList.map((item) => {
12266
+ return speakerVoiceConfigToVertex(item);
12267
+ });
12268
+ }
12269
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
12270
+ }
12271
+ return toObject;
12272
+ }
11993
12273
  function partToMldev$1(fromObject, rootObject) {
11994
12274
  const toObject = {};
11995
12275
  const fromMediaResolution = getValueByPath(fromObject, [
@@ -12299,6 +12579,26 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
12299
12579
  }
12300
12580
  return toObject;
12301
12581
  }
12582
+ function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
12583
+ const toObject = {};
12584
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
12585
+ if (fromMimeType != null) {
12586
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
12587
+ }
12588
+ const fromVoiceSampleAudio = getValueByPath(fromObject, [
12589
+ 'voiceSampleAudio',
12590
+ ]);
12591
+ if (fromVoiceSampleAudio != null) {
12592
+ setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
12593
+ }
12594
+ if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
12595
+ throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
12596
+ }
12597
+ if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
12598
+ throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
12599
+ }
12600
+ return toObject;
12601
+ }
12302
12602
  function safetyAttributesFromMldev(fromObject, _rootObject) {
12303
12603
  const toObject = {};
12304
12604
  const fromCategories = getValueByPath(fromObject, [
@@ -12448,6 +12748,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
12448
12748
  }
12449
12749
  return toObject;
12450
12750
  }
12751
+ function speakerVoiceConfigToVertex(fromObject, rootObject) {
12752
+ const toObject = {};
12753
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
12754
+ if (fromSpeaker != null) {
12755
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
12756
+ }
12757
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
12758
+ if (fromVoiceConfig != null) {
12759
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
12760
+ }
12761
+ return toObject;
12762
+ }
12763
+ function speechConfigToVertex(fromObject, rootObject) {
12764
+ const toObject = {};
12765
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
12766
+ if (fromVoiceConfig != null) {
12767
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
12768
+ }
12769
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
12770
+ if (fromLanguageCode != null) {
12771
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
12772
+ }
12773
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
12774
+ 'multiSpeakerVoiceConfig',
12775
+ ]);
12776
+ if (fromMultiSpeakerVoiceConfig != null) {
12777
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
12778
+ }
12779
+ return toObject;
12780
+ }
12451
12781
  function toolConfigToMldev(fromObject, rootObject) {
12452
12782
  const toObject = {};
12453
12783
  const fromRetrievalConfig = getValueByPath(fromObject, [
@@ -12553,6 +12883,9 @@ function toolToMldev$1(fromObject, rootObject) {
12553
12883
  }
12554
12884
  setValueByPath(toObject, ['mcpServers'], transformedList);
12555
12885
  }
12886
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
12887
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
12888
+ }
12556
12889
  return toObject;
12557
12890
  }
12558
12891
  function toolToVertex(fromObject, rootObject) {
@@ -12626,6 +12959,10 @@ function toolToVertex(fromObject, rootObject) {
12626
12959
  }
12627
12960
  setValueByPath(toObject, ['mcpServers'], transformedList);
12628
12961
  }
12962
+ const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
12963
+ if (fromExaAiSearch != null) {
12964
+ setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
12965
+ }
12629
12966
  return toObject;
12630
12967
  }
12631
12968
  function tunedModelInfoFromMldev(fromObject, _rootObject) {
@@ -12937,9 +13274,25 @@ function videoToVertex(fromObject, _rootObject) {
12937
13274
  }
12938
13275
  return toObject;
12939
13276
  }
12940
-
12941
- /**
12942
- * @license
13277
+ function voiceConfigToVertex(fromObject, rootObject) {
13278
+ const toObject = {};
13279
+ const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
13280
+ 'replicatedVoiceConfig',
13281
+ ]);
13282
+ if (fromReplicatedVoiceConfig != null) {
13283
+ setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
13284
+ }
13285
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
13286
+ 'prebuiltVoiceConfig',
13287
+ ]);
13288
+ if (fromPrebuiltVoiceConfig != null) {
13289
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
13290
+ }
13291
+ return toObject;
13292
+ }
13293
+
13294
+ /**
13295
+ * @license
12943
13296
  * Copyright 2025 Google LLC
12944
13297
  * SPDX-License-Identifier: Apache-2.0
12945
13298
  */
@@ -13187,7 +13540,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
13187
13540
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
13188
13541
  const USER_AGENT_HEADER = 'User-Agent';
13189
13542
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
13190
- const SDK_VERSION = '2.10.0'; // x-release-please-version
13543
+ const SDK_VERSION = '2.12.0'; // x-release-please-version
13191
13544
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
13192
13545
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
13193
13546
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -14441,10 +14794,27 @@ class Live {
14441
14794
  onopenResolve({});
14442
14795
  };
14443
14796
  const apiClient = this.apiClient;
14797
+ let sessionResolved = false;
14798
+ const messageQueue = [];
14799
+ let setupCompleteResolve = () => { };
14800
+ const setupCompletePromise = new Promise((resolve) => {
14801
+ setupCompleteResolve = resolve;
14802
+ });
14444
14803
  const websocketCallbacks = {
14445
14804
  onopen: onopenAwaitedCallback,
14446
14805
  onmessage: (event) => {
14447
- void handleWebSocketMessage(apiClient, callbacks.onmessage, event);
14806
+ void handleWebSocketMessage(apiClient, (msg) => {
14807
+ if (msg.setupComplete && !session.setupComplete) {
14808
+ session.setupComplete = msg.setupComplete;
14809
+ setupCompleteResolve({});
14810
+ }
14811
+ if (sessionResolved) {
14812
+ callbacks.onmessage(msg);
14813
+ }
14814
+ else {
14815
+ messageQueue.push(msg);
14816
+ }
14817
+ }, event);
14448
14818
  },
14449
14819
  onerror: (_a = callbacks === null || callbacks === void 0 ? void 0 : callbacks.onerror) !== null && _a !== void 0 ? _a : function (e) {
14450
14820
  },
@@ -14506,8 +14876,14 @@ class Live {
14506
14876
  clientMessage = liveConnectParametersToMldev(this.apiClient, liveConnectParameters);
14507
14877
  }
14508
14878
  delete clientMessage['config'];
14879
+ const session = new Session(conn, this.apiClient);
14509
14880
  conn.send(JSON.stringify(clientMessage));
14510
- return new Session(conn, this.apiClient);
14881
+ await setupCompletePromise;
14882
+ sessionResolved = true;
14883
+ for (const msg of messageQueue) {
14884
+ callbacks.onmessage(msg);
14885
+ }
14886
+ return session;
14511
14887
  }
14512
14888
  // TODO: b/416041229 - Abstract this method to a common place.
14513
14889
  isCallableTool(tool) {
@@ -17036,6 +17412,9 @@ function toolToMldev(fromObject) {
17036
17412
  }
17037
17413
  setValueByPath(toObject, ['mcpServers'], transformedList);
17038
17414
  }
17415
+ if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
17416
+ throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
17417
+ }
17039
17418
  return toObject;
17040
17419
  }
17041
17420
 
@@ -17887,17 +18266,14 @@ function env() {
17887
18266
  * Populates global parameters with environment variables.
17888
18267
  */
17889
18268
  function fillGlobals(options) {
17890
- var _a, _b, _c;
18269
+ var _a, _b;
17891
18270
  const clone = Object.assign({}, options);
17892
18271
  const envVars = env();
17893
18272
  if (typeof envVars.GOOGLE_GENAI_API_VERSION !== "undefined") {
17894
18273
  (_a = clone.api_version) !== null && _a !== void 0 ? _a : (clone.api_version = envVars.GOOGLE_GENAI_API_VERSION);
17895
18274
  }
17896
- if (typeof envVars.GOOGLE_GENAI_API_REVISION !== "undefined") {
17897
- (_b = clone.api_revision) !== null && _b !== void 0 ? _b : (clone.api_revision = envVars.GOOGLE_GENAI_API_REVISION);
17898
- }
17899
18275
  if (typeof envVars.GOOGLE_GENAI_USER_PROJECT !== "undefined") {
17900
- (_c = clone.user_project) !== null && _c !== void 0 ? _c : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
18276
+ (_b = clone.user_project) !== null && _b !== void 0 ? _b : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
17901
18277
  }
17902
18278
  return clone;
17903
18279
  }
@@ -17909,7 +18285,6 @@ function fillGlobals(options) {
17909
18285
  *
17910
18286
  * g3-prettier-ignore-file
17911
18287
  */
17912
- const GOOGLE_GENAI_API_REVISION = "2026-05-20";
17913
18288
  class GoogleGenAISecurityProvider {
17914
18289
  constructor(options) {
17915
18290
  this.options = options;
@@ -17927,7 +18302,6 @@ class GoogleGenAIAuthHook {
17927
18302
  }
17928
18303
  async beforeRequest(hookCtx, request) {
17929
18304
  applyDefaultHeaders(request.headers, getStaticDefaultHeaders(hookCtx.security_source));
17930
- applyApiRevision(hookCtx, request.headers);
17931
18305
  applyUserProject(hookCtx, request.headers);
17932
18306
  if (hasAuthHeaders(request.headers)) {
17933
18307
  return request;
@@ -18007,12 +18381,6 @@ function applyDefaultHeaders(target, source) {
18007
18381
  }
18008
18382
  }
18009
18383
  }
18010
- function applyApiRevision(hookCtx, headers) {
18011
- var _a;
18012
- if (headers.get("api-revision") === null) {
18013
- headers.set("Api-Revision", (_a = hookCtx.options.api_revision) !== null && _a !== void 0 ? _a : GOOGLE_GENAI_API_REVISION);
18014
- }
18015
- }
18016
18384
  function applyUserProject(hookCtx, headers) {
18017
18385
  if (hookCtx.options.user_project !== undefined &&
18018
18386
  headers.get("x-goog-user-project") === null) {
@@ -18544,7 +18912,7 @@ function serverURLFromOptions(options) {
18544
18912
  return new URL(u);
18545
18913
  }
18546
18914
  const SDK_METADATA = {
18547
- userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.911.0 v1beta @google/genai",
18915
+ userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.913.3 v1beta @google/genai",
18548
18916
  };
18549
18917
 
18550
18918
  /**
@@ -20185,9 +20553,9 @@ function unwrapAsAPIPromise(p) {
20185
20553
  * Creates a new Agent (Typed version for SDK).
20186
20554
  */
20187
20555
  function agentsCreate(client, body, api_version, options) {
20188
- return new APIPromise($do$e(client, body, api_version, options));
20556
+ return new APIPromise($do$l(client, body, api_version, options));
20189
20557
  }
20190
- async function $do$e(client, body, api_version, options) {
20558
+ async function $do$l(client, body, api_version, options) {
20191
20559
  var _a, _b, _c;
20192
20560
  const input = {
20193
20561
  body: body,
@@ -20270,9 +20638,9 @@ async function $do$e(client, body, api_version, options) {
20270
20638
  * Deletes an Agent.
20271
20639
  */
20272
20640
  function agentsDelete(client, id, api_version, options) {
20273
- return new APIPromise($do$d(client, id, api_version, options));
20641
+ return new APIPromise($do$k(client, id, api_version, options));
20274
20642
  }
20275
- async function $do$d(client, id, api_version, options) {
20643
+ async function $do$k(client, id, api_version, options) {
20276
20644
  var _a, _b, _c;
20277
20645
  const input = {
20278
20646
  id: id,
@@ -20358,9 +20726,9 @@ async function $do$d(client, id, api_version, options) {
20358
20726
  * Gets a specific Agent.
20359
20727
  */
20360
20728
  function agentsGet(client, id, api_version, options) {
20361
- return new APIPromise($do$c(client, id, api_version, options));
20729
+ return new APIPromise($do$j(client, id, api_version, options));
20362
20730
  }
20363
- async function $do$c(client, id, api_version, options) {
20731
+ async function $do$j(client, id, api_version, options) {
20364
20732
  var _a, _b, _c;
20365
20733
  const input = {
20366
20734
  id: id,
@@ -20446,9 +20814,9 @@ async function $do$c(client, id, api_version, options) {
20446
20814
  * Lists all Agents.
20447
20815
  */
20448
20816
  function agentsList(client, api_version, page_size, page_token, parent, options) {
20449
- return new APIPromise($do$b(client, api_version, page_size, page_token, parent, options));
20817
+ return new APIPromise($do$i(client, api_version, page_size, page_token, parent, options));
20450
20818
  }
20451
- async function $do$b(client, api_version, page_size, page_token, parent, options) {
20819
+ async function $do$i(client, api_version, page_size, page_token, parent, options) {
20452
20820
  var _a, _b, _c;
20453
20821
  const input = {
20454
20822
  api_version: api_version,
@@ -20720,9 +21088,9 @@ class GetInteractionByIdClientError extends GoogleGenAiError {
20720
21088
  * Cancels an interaction by id. This only applies to background interactions that are still running.
20721
21089
  */
20722
21090
  function interactionsCancel(client, id, api_version, options) {
20723
- return new APIPromise($do$a(client, id, api_version, options));
21091
+ return new APIPromise($do$h(client, id, api_version, options));
20724
21092
  }
20725
- async function $do$a(client, id, api_version, options) {
21093
+ async function $do$h(client, id, api_version, options) {
20726
21094
  var _a, _b, _c;
20727
21095
  const input = {
20728
21096
  id: id,
@@ -20808,9 +21176,9 @@ async function $do$a(client, id, api_version, options) {
20808
21176
  * g3-prettier-ignore-file
20809
21177
  */
20810
21178
  function interactionsCreate(client, body, api_version, options) {
20811
- return new APIPromise($do$9(client, body, api_version, options));
21179
+ return new APIPromise($do$g(client, body, api_version, options));
20812
21180
  }
20813
- async function $do$9(client, body, api_version, options) {
21181
+ async function $do$g(client, body, api_version, options) {
20814
21182
  var _a, _b, _c, _d;
20815
21183
  const input = {
20816
21184
  body: body,
@@ -20902,9 +21270,9 @@ async function $do$9(client, body, api_version, options) {
20902
21270
  * Deletes the interaction by id.
20903
21271
  */
20904
21272
  function interactionsDelete(client, id, api_version, options) {
20905
- return new APIPromise($do$8(client, id, api_version, options));
21273
+ return new APIPromise($do$f(client, id, api_version, options));
20906
21274
  }
20907
- async function $do$8(client, id, api_version, options) {
21275
+ async function $do$f(client, id, api_version, options) {
20908
21276
  var _a, _b, _c;
20909
21277
  const input = {
20910
21278
  id: id,
@@ -20990,9 +21358,9 @@ async function $do$8(client, id, api_version, options) {
20990
21358
  * g3-prettier-ignore-file
20991
21359
  */
20992
21360
  function interactionsGet(client, id, stream, last_event_id, include_input, api_version, options) {
20993
- return new APIPromise($do$7(client, id, stream, last_event_id, include_input, api_version, options));
21361
+ return new APIPromise($do$e(client, id, stream, last_event_id, include_input, api_version, options));
20994
21362
  }
20995
- async function $do$7(client, id, stream, last_event_id, include_input, api_version, options) {
21363
+ async function $do$e(client, id, stream, last_event_id, include_input, api_version, options) {
20996
21364
  var _a, _b, _c;
20997
21365
  const input = {
20998
21366
  id: id,
@@ -21125,12 +21493,12 @@ class Interactions extends ClientSDK {
21125
21493
  * g3-prettier-ignore-file
21126
21494
  */
21127
21495
  /**
21128
- * Creates a new Webhook.
21496
+ * Creates a new trigger that will invoke the specified agent on the given cron schedule.
21129
21497
  */
21130
- function webhooksCreate(client, body, api_version, options) {
21131
- return new APIPromise($do$6(client, body, api_version, options));
21498
+ function triggersCreate(client, body, api_version, options) {
21499
+ return new APIPromise($do$d(client, body, api_version, options));
21132
21500
  }
21133
- async function $do$6(client, body, api_version, options) {
21501
+ async function $do$d(client, body, api_version, options) {
21134
21502
  var _a, _b, _c;
21135
21503
  const input = {
21136
21504
  body: body,
@@ -21141,7 +21509,7 @@ async function $do$6(client, body, api_version, options) {
21141
21509
  const pathParams = {
21142
21510
  api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
21143
21511
  };
21144
- const path = pathToFunc("/{api_version}/webhooks")(pathParams);
21512
+ const path = pathToFunc("/{api_version}/triggers")(pathParams);
21145
21513
  const headers = new Headers(compactMap({
21146
21514
  "Content-Type": "application/json",
21147
21515
  Accept: "application/json",
@@ -21151,7 +21519,7 @@ async function $do$6(client, body, api_version, options) {
21151
21519
  const context = {
21152
21520
  options: client._options,
21153
21521
  base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
21154
- operation_id: "CreateWebhook",
21522
+ operation_id: "CreateTrigger",
21155
21523
  o_auth2_scopes: null,
21156
21524
  resolved_security: requestSecurity,
21157
21525
  security_source: client._options.security,
@@ -21195,7 +21563,7 @@ async function $do$6(client, body, api_version, options) {
21195
21563
  return [doResult, { status: "request-error", request: req }];
21196
21564
  }
21197
21565
  const response = doResult.value;
21198
- const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
21566
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
21199
21567
  if (!result.ok) {
21200
21568
  return [result, { status: "complete", request: req, response }];
21201
21569
  }
@@ -21210,12 +21578,12 @@ async function $do$6(client, body, api_version, options) {
21210
21578
  * g3-prettier-ignore-file
21211
21579
  */
21212
21580
  /**
21213
- * Deletes a Webhook.
21581
+ * Deletes a trigger.
21214
21582
  */
21215
- function webhooksDelete(client, id, api_version, options) {
21216
- return new APIPromise($do$5(client, id, api_version, options));
21583
+ function triggersDelete(client, id, api_version, options) {
21584
+ return new APIPromise($do$c(client, id, api_version, options));
21217
21585
  }
21218
- async function $do$5(client, id, api_version, options) {
21586
+ async function $do$c(client, id, api_version, options) {
21219
21587
  var _a, _b, _c;
21220
21588
  const input = {
21221
21589
  id: id,
@@ -21230,7 +21598,7 @@ async function $do$5(client, id, api_version, options) {
21230
21598
  charEncoding: "percent",
21231
21599
  }),
21232
21600
  };
21233
- const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
21601
+ const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
21234
21602
  const headers = new Headers(compactMap({
21235
21603
  Accept: "application/json",
21236
21604
  }));
@@ -21239,7 +21607,7 @@ async function $do$5(client, id, api_version, options) {
21239
21607
  const context = {
21240
21608
  options: client._options,
21241
21609
  base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
21242
- operation_id: "DeleteWebhook",
21610
+ operation_id: "DeleteTrigger",
21243
21611
  o_auth2_scopes: null,
21244
21612
  resolved_security: requestSecurity,
21245
21613
  security_source: client._options.security,
@@ -21283,7 +21651,7 @@ async function $do$5(client, id, api_version, options) {
21283
21651
  return [doResult, { status: "request-error", request: req }];
21284
21652
  }
21285
21653
  const response = doResult.value;
21286
- const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
21654
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
21287
21655
  if (!result.ok) {
21288
21656
  return [result, { status: "complete", request: req, response }];
21289
21657
  }
@@ -21298,12 +21666,12 @@ async function $do$5(client, id, api_version, options) {
21298
21666
  * g3-prettier-ignore-file
21299
21667
  */
21300
21668
  /**
21301
- * Gets a specific Webhook.
21669
+ * Gets details of a single trigger.
21302
21670
  */
21303
- function webhooksGet(client, id, api_version, options) {
21304
- return new APIPromise($do$4(client, id, api_version, options));
21671
+ function triggersGet(client, id, api_version, options) {
21672
+ return new APIPromise($do$b(client, id, api_version, options));
21305
21673
  }
21306
- async function $do$4(client, id, api_version, options) {
21674
+ async function $do$b(client, id, api_version, options) {
21307
21675
  var _a, _b, _c;
21308
21676
  const input = {
21309
21677
  id: id,
@@ -21318,7 +21686,7 @@ async function $do$4(client, id, api_version, options) {
21318
21686
  charEncoding: "percent",
21319
21687
  }),
21320
21688
  };
21321
- const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
21689
+ const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
21322
21690
  const headers = new Headers(compactMap({
21323
21691
  Accept: "application/json",
21324
21692
  }));
@@ -21327,7 +21695,7 @@ async function $do$4(client, id, api_version, options) {
21327
21695
  const context = {
21328
21696
  options: client._options,
21329
21697
  base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
21330
- operation_id: "GetWebhook",
21698
+ operation_id: "GetTrigger",
21331
21699
  o_auth2_scopes: null,
21332
21700
  resolved_security: requestSecurity,
21333
21701
  security_source: client._options.security,
@@ -21371,7 +21739,7 @@ async function $do$4(client, id, api_version, options) {
21371
21739
  return [doResult, { status: "request-error", request: req }];
21372
21740
  }
21373
21741
  const response = doResult.value;
21374
- const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
21742
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
21375
21743
  if (!result.ok) {
21376
21744
  return [result, { status: "complete", request: req, response }];
21377
21745
  }
@@ -21386,14 +21754,15 @@ async function $do$4(client, id, api_version, options) {
21386
21754
  * g3-prettier-ignore-file
21387
21755
  */
21388
21756
  /**
21389
- * Lists all Webhooks.
21757
+ * Lists executions for a trigger.
21390
21758
  */
21391
- function webhooksList(client, api_version, page_size, page_token, options) {
21392
- return new APIPromise($do$3(client, api_version, page_size, page_token, options));
21759
+ function triggersListExecutions(client, trigger_id, api_version, page_size, page_token, options) {
21760
+ return new APIPromise($do$a(client, trigger_id, api_version, page_size, page_token, options));
21393
21761
  }
21394
- async function $do$3(client, api_version, page_size, page_token, options) {
21762
+ async function $do$a(client, trigger_id, api_version, page_size, page_token, options) {
21395
21763
  var _a, _b, _c;
21396
21764
  const input = {
21765
+ trigger_id: trigger_id,
21397
21766
  api_version: api_version,
21398
21767
  page_size: page_size,
21399
21768
  page_token: page_token,
@@ -21401,12 +21770,16 @@ async function $do$3(client, api_version, page_size, page_token, options) {
21401
21770
  const payload = input;
21402
21771
  const body = null;
21403
21772
  const pathParams = {
21404
- 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" }),
21773
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
21774
+ trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
21775
+ explode: false,
21776
+ charEncoding: "percent",
21777
+ }),
21405
21778
  };
21406
- const path = pathToFunc("/{api_version}/webhooks")(pathParams);
21779
+ const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
21407
21780
  const query = encodeFormQuery({
21408
- "page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
21409
- "page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
21781
+ "page_size": payload.page_size,
21782
+ "page_token": payload.page_token,
21410
21783
  });
21411
21784
  const headers = new Headers(compactMap({
21412
21785
  Accept: "application/json",
@@ -21416,7 +21789,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
21416
21789
  const context = {
21417
21790
  options: client._options,
21418
21791
  base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
21419
- operation_id: "ListWebhooks",
21792
+ operation_id: "ListTriggerExecutions",
21420
21793
  o_auth2_scopes: null,
21421
21794
  resolved_security: requestSecurity,
21422
21795
  security_source: client._options.security,
@@ -21461,7 +21834,7 @@ async function $do$3(client, api_version, page_size, page_token, options) {
21461
21834
  return [doResult, { status: "request-error", request: req }];
21462
21835
  }
21463
21836
  const response = doResult.value;
21464
- const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
21837
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
21465
21838
  if (!result.ok) {
21466
21839
  return [result, { status: "complete", request: req, response }];
21467
21840
  }
@@ -21476,30 +21849,31 @@ async function $do$3(client, api_version, page_size, page_token, options) {
21476
21849
  * g3-prettier-ignore-file
21477
21850
  */
21478
21851
  /**
21479
- * Sends a ping event to a Webhook.
21852
+ * Lists triggers for a project.
21480
21853
  */
21481
- function webhooksPing(client, id, api_version, body, options) {
21482
- return new APIPromise($do$2(client, id, api_version, body, options));
21854
+ function triggersList(client, api_version, filter, page_size, page_token, options) {
21855
+ return new APIPromise($do$9(client, api_version, filter, page_size, page_token, options));
21483
21856
  }
21484
- async function $do$2(client, id, api_version, body, options) {
21857
+ async function $do$9(client, api_version, filter, page_size, page_token, options) {
21485
21858
  var _a, _b, _c;
21486
21859
  const input = {
21487
- id: id,
21488
21860
  api_version: api_version,
21489
- body: body,
21861
+ filter: filter,
21862
+ page_size: page_size,
21863
+ page_token: page_token,
21490
21864
  };
21491
21865
  const payload = input;
21492
- const body$ = encodeJSON("body", payload.body, { explode: true });
21866
+ const body = null;
21493
21867
  const pathParams = {
21494
- api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
21495
- id: encodeSimple("id", payload.id, {
21496
- explode: false,
21497
- charEncoding: "percent",
21498
- }),
21868
+ api_version: encodeSimple("api_version", (_a = payload === null || payload === void 0 ? void 0 : payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
21499
21869
  };
21500
- const path = pathToFunc("/{api_version}/webhooks/{id}:ping")(pathParams);
21870
+ const path = pathToFunc("/{api_version}/triggers")(pathParams);
21871
+ const query = encodeFormQuery({
21872
+ "filter": payload === null || payload === void 0 ? void 0 : payload.filter,
21873
+ "page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
21874
+ "page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
21875
+ });
21501
21876
  const headers = new Headers(compactMap({
21502
- "Content-Type": "application/json",
21503
21877
  Accept: "application/json",
21504
21878
  }));
21505
21879
  const securityInput = await extractSecurity(client._options.security);
@@ -21507,7 +21881,7 @@ async function $do$2(client, id, api_version, body, options) {
21507
21881
  const context = {
21508
21882
  options: client._options,
21509
21883
  base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
21510
- operation_id: "PingWebhook",
21884
+ operation_id: "ListTriggers",
21511
21885
  o_auth2_scopes: null,
21512
21886
  resolved_security: requestSecurity,
21513
21887
  security_source: client._options.security,
@@ -21529,11 +21903,12 @@ async function $do$2(client, id, api_version, body, options) {
21529
21903
  };
21530
21904
  const requestRes = client._createRequest(context, {
21531
21905
  security: requestSecurity,
21532
- method: "POST",
21906
+ method: "GET",
21533
21907
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
21534
21908
  path: path,
21535
21909
  headers: headers,
21536
- body: body$,
21910
+ query: query,
21911
+ body: body,
21537
21912
  userAgent: client._options.user_agent,
21538
21913
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
21539
21914
  }, options);
@@ -21551,7 +21926,7 @@ async function $do$2(client, id, api_version, body, options) {
21551
21926
  return [doResult, { status: "request-error", request: req }];
21552
21927
  }
21553
21928
  const response = doResult.value;
21554
- const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
21929
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
21555
21930
  if (!result.ok) {
21556
21931
  return [result, { status: "complete", request: req, response }];
21557
21932
  }
@@ -21566,30 +21941,28 @@ async function $do$2(client, id, api_version, body, options) {
21566
21941
  * g3-prettier-ignore-file
21567
21942
  */
21568
21943
  /**
21569
- * Generates a new signing secret for a Webhook.
21944
+ * Runs a trigger immediately.
21570
21945
  */
21571
- function webhooksRotateSigningSecret(client, id, api_version, body, options) {
21572
- return new APIPromise($do$1(client, id, api_version, body, options));
21946
+ function triggersRun(client, trigger_id, api_version, options) {
21947
+ return new APIPromise($do$8(client, trigger_id, api_version, options));
21573
21948
  }
21574
- async function $do$1(client, id, api_version, body, options) {
21949
+ async function $do$8(client, trigger_id, api_version, options) {
21575
21950
  var _a, _b, _c;
21576
21951
  const input = {
21577
- id: id,
21952
+ trigger_id: trigger_id,
21578
21953
  api_version: api_version,
21579
- body: body,
21580
21954
  };
21581
21955
  const payload = input;
21582
- const body$ = encodeJSON("body", payload.body, { explode: true });
21956
+ const body = null;
21583
21957
  const pathParams = {
21584
21958
  api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
21585
- id: encodeSimple("id", payload.id, {
21959
+ trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
21586
21960
  explode: false,
21587
21961
  charEncoding: "percent",
21588
21962
  }),
21589
21963
  };
21590
- const path = pathToFunc("/{api_version}/webhooks/{id}:rotateSigningSecret")(pathParams);
21964
+ const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
21591
21965
  const headers = new Headers(compactMap({
21592
- "Content-Type": "application/json",
21593
21966
  Accept: "application/json",
21594
21967
  }));
21595
21968
  const securityInput = await extractSecurity(client._options.security);
@@ -21597,7 +21970,7 @@ async function $do$1(client, id, api_version, body, options) {
21597
21970
  const context = {
21598
21971
  options: client._options,
21599
21972
  base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
21600
- operation_id: "RotateSigningSecret",
21973
+ operation_id: "RunTrigger",
21601
21974
  o_auth2_scopes: null,
21602
21975
  resolved_security: requestSecurity,
21603
21976
  security_source: client._options.security,
@@ -21623,7 +21996,7 @@ async function $do$1(client, id, api_version, body, options) {
21623
21996
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
21624
21997
  path: path,
21625
21998
  headers: headers,
21626
- body: body$,
21999
+ body: body,
21627
22000
  userAgent: client._options.user_agent,
21628
22001
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
21629
22002
  }, options);
@@ -21641,7 +22014,7 @@ async function $do$1(client, id, api_version, body, options) {
21641
22014
  return [doResult, { status: "request-error", request: req }];
21642
22015
  }
21643
22016
  const response = doResult.value;
21644
- const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
22017
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
21645
22018
  if (!result.ok) {
21646
22019
  return [result, { status: "complete", request: req, response }];
21647
22020
  }
@@ -21656,18 +22029,17 @@ async function $do$1(client, id, api_version, body, options) {
21656
22029
  * g3-prettier-ignore-file
21657
22030
  */
21658
22031
  /**
21659
- * Updates an existing Webhook.
22032
+ * Updates a trigger.
21660
22033
  */
21661
- function webhooksUpdate(client, id, api_version, update_mask, body, options) {
21662
- return new APIPromise($do(client, id, api_version, update_mask, body, options));
22034
+ function triggersUpdate(client, id, body, api_version, options) {
22035
+ return new APIPromise($do$7(client, id, body, api_version, options));
21663
22036
  }
21664
- async function $do(client, id, api_version, update_mask, body, options) {
22037
+ async function $do$7(client, id, body, api_version, options) {
21665
22038
  var _a, _b, _c;
21666
22039
  const input = {
21667
22040
  id: id,
21668
- api_version: api_version,
21669
- update_mask: update_mask,
21670
22041
  body: body,
22042
+ api_version: api_version,
21671
22043
  };
21672
22044
  const payload = input;
21673
22045
  const body$ = encodeJSON("body", payload.body, { explode: true });
@@ -21678,10 +22050,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
21678
22050
  charEncoding: "percent",
21679
22051
  }),
21680
22052
  };
21681
- const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
21682
- const query = encodeFormQuery({
21683
- "update_mask": payload.update_mask,
21684
- });
22053
+ const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
21685
22054
  const headers = new Headers(compactMap({
21686
22055
  "Content-Type": "application/json",
21687
22056
  Accept: "application/json",
@@ -21691,7 +22060,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
21691
22060
  const context = {
21692
22061
  options: client._options,
21693
22062
  base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
21694
- operation_id: "UpdateWebhook",
22063
+ operation_id: "UpdateTrigger",
21695
22064
  o_auth2_scopes: null,
21696
22065
  resolved_security: requestSecurity,
21697
22066
  security_source: client._options.security,
@@ -21717,7 +22086,6 @@ async function $do(client, id, api_version, update_mask, body, options) {
21717
22086
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
21718
22087
  path: path,
21719
22088
  headers: headers,
21720
- query: query,
21721
22089
  body: body$,
21722
22090
  userAgent: client._options.user_agent,
21723
22091
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
@@ -21736,7 +22104,7 @@ async function $do(client, id, api_version, update_mask, body, options) {
21736
22104
  return [doResult, { status: "request-error", request: req }];
21737
22105
  }
21738
22106
  const response = doResult.value;
21739
- const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
22107
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
21740
22108
  if (!result.ok) {
21741
22109
  return [result, { status: "complete", request: req, response }];
21742
22110
  }
@@ -21750,53 +22118,50 @@ async function $do(client, id, api_version, update_mask, body, options) {
21750
22118
  *
21751
22119
  * g3-prettier-ignore-file
21752
22120
  */
21753
- class Webhooks extends ClientSDK {
22121
+ class Triggers extends ClientSDK {
21754
22122
  /**
21755
- * Creates a new Webhook.
22123
+ * Creates a new trigger that will invoke the specified agent on the given cron schedule.
21756
22124
  */
21757
22125
  create(params, options) {
21758
22126
  const { api_version } = params, body = __rest(params, ["api_version"]);
21759
- return unwrapAsAPIPromise(webhooksCreate(this, body, api_version, options));
22127
+ return unwrapAsAPIPromise(triggersCreate(this, body, api_version, options));
21760
22128
  }
21761
22129
  /**
21762
- * Lists all Webhooks.
22130
+ * Lists triggers for a project.
21763
22131
  */
21764
22132
  list(params, options) {
21765
- 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));
22133
+ return unwrapAsAPIPromise(triggersList(this, params === null || params === void 0 ? void 0 : params.api_version, params === null || params === void 0 ? void 0 : params.filter, params === null || params === void 0 ? void 0 : params.page_size, params === null || params === void 0 ? void 0 : params.page_token, options));
21766
22134
  }
21767
22135
  /**
21768
- * Gets a specific Webhook.
22136
+ * Gets details of a single trigger.
21769
22137
  */
21770
22138
  get(id, params, options) {
21771
- return unwrapAsAPIPromise(webhooksGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
22139
+ return unwrapAsAPIPromise(triggersGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
21772
22140
  }
21773
22141
  /**
21774
- * Updates an existing Webhook.
22142
+ * Updates a trigger.
21775
22143
  */
21776
22144
  update(id, params, options) {
21777
- const _a = params !== null && params !== void 0 ? params : {}, { api_version, update_mask } = _a, body$body = __rest(_a, ["api_version", "update_mask"]);
21778
- const body = params === undefined || Object.keys(body$body).length === 0
21779
- ? undefined
21780
- : body$body;
21781
- return unwrapAsAPIPromise(webhooksUpdate(this, id, api_version, update_mask, body, options));
22145
+ const { api_version } = params, body = __rest(params, ["api_version"]);
22146
+ return unwrapAsAPIPromise(triggersUpdate(this, id, body, api_version, options));
21782
22147
  }
21783
22148
  /**
21784
- * Deletes a Webhook.
22149
+ * Deletes a trigger.
21785
22150
  */
21786
22151
  delete(id, params, options) {
21787
- return unwrapAsAPIPromise(webhooksDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
22152
+ return unwrapAsAPIPromise(triggersDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
21788
22153
  }
21789
22154
  /**
21790
- * Generates a new signing secret for a Webhook.
22155
+ * Runs a trigger immediately.
21791
22156
  */
21792
- rotateSigningSecret(id, api_version, body, options) {
21793
- return unwrapAsAPIPromise(webhooksRotateSigningSecret(this, id, api_version, body, options));
22157
+ run(trigger_id, params, options) {
22158
+ return unwrapAsAPIPromise(triggersRun(this, trigger_id, params === null || params === void 0 ? void 0 : params.api_version, options));
21794
22159
  }
21795
22160
  /**
21796
- * Sends a ping event to a Webhook.
22161
+ * Lists executions for a trigger.
21797
22162
  */
21798
- ping(id, api_version, body, options) {
21799
- return unwrapAsAPIPromise(webhooksPing(this, id, api_version, body, options));
22163
+ listExecutions(trigger_id, params, options) {
22164
+ return unwrapAsAPIPromise(triggersListExecutions(this, trigger_id, params === null || params === void 0 ? void 0 : params.api_version, params === null || params === void 0 ? void 0 : params.page_size, params === null || params === void 0 ? void 0 : params.page_token, options));
21800
22165
  }
21801
22166
  }
21802
22167
 
@@ -21807,23 +22172,83 @@ class Webhooks extends ClientSDK {
21807
22172
  *
21808
22173
  * g3-prettier-ignore-file
21809
22174
  */
21810
- /*
21811
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
22175
+ /**
22176
+ * Creates a new Webhook.
21812
22177
  */
21813
- let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
21814
- get interactions() {
21815
- var _a;
21816
- return ((_a = this._interactions) !== null && _a !== void 0 ? _a : (this._interactions = new Interactions(this._options)));
22178
+ function webhooksCreate(client, body, api_version, options) {
22179
+ return new APIPromise($do$6(client, body, api_version, options));
22180
+ }
22181
+ async function $do$6(client, body, api_version, options) {
22182
+ var _a, _b, _c;
22183
+ const input = {
22184
+ body: body,
22185
+ api_version: api_version,
22186
+ };
22187
+ const payload = input;
22188
+ const body$ = encodeJSON("body", payload.body, { explode: true });
22189
+ const pathParams = {
22190
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
22191
+ };
22192
+ const path = pathToFunc("/{api_version}/webhooks")(pathParams);
22193
+ const headers = new Headers(compactMap({
22194
+ "Content-Type": "application/json",
22195
+ Accept: "application/json",
22196
+ }));
22197
+ const securityInput = await extractSecurity(client._options.security);
22198
+ const requestSecurity = resolveGlobalSecurity(securityInput);
22199
+ const context = {
22200
+ options: client._options,
22201
+ base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
22202
+ operation_id: "CreateWebhook",
22203
+ o_auth2_scopes: null,
22204
+ resolved_security: requestSecurity,
22205
+ security_source: client._options.security,
22206
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
22207
+ || client._options.retry_config
22208
+ || {
22209
+ strategy: "attempt-count-backoff",
22210
+ backoff: {
22211
+ initialInterval: 500,
22212
+ maxInterval: 8000,
22213
+ exponent: 2,
22214
+ maxElapsedTime: 30000,
22215
+ },
22216
+ retryConnectionErrors: true,
22217
+ maxRetries: 4,
22218
+ }
22219
+ || { strategy: "none" },
22220
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
22221
+ };
22222
+ const requestRes = client._createRequest(context, {
22223
+ security: requestSecurity,
22224
+ method: "POST",
22225
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
22226
+ path: path,
22227
+ headers: headers,
22228
+ body: body$,
22229
+ userAgent: client._options.user_agent,
22230
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
22231
+ }, options);
22232
+ if (!requestRes.ok) {
22233
+ return [requestRes, { status: "invalid" }];
21817
22234
  }
21818
- get webhooks() {
21819
- var _a;
21820
- return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Webhooks(this._options)));
22235
+ const req = requestRes.value;
22236
+ const doResult = await client._do(req, {
22237
+ context,
22238
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
22239
+ retryConfig: context.retry_config,
22240
+ retryCodes: context.retry_codes,
22241
+ });
22242
+ if (!doResult.ok) {
22243
+ return [doResult, { status: "request-error", request: req }];
21821
22244
  }
21822
- get agents() {
21823
- var _a;
21824
- return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Agents(this._options)));
22245
+ const response = doResult.value;
22246
+ const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
22247
+ if (!result.ok) {
22248
+ return [result, { status: "complete", request: req, response }];
21825
22249
  }
21826
- };
22250
+ return [result, { status: "complete", request: req, response }];
22251
+ }
21827
22252
 
21828
22253
  /**
21829
22254
  * @license
@@ -21832,33 +22257,660 @@ let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
21832
22257
  *
21833
22258
  * g3-prettier-ignore-file
21834
22259
  */
21835
- const LEGACY_LYRIA_MODELS = new Set([
21836
- "lyria-3-pro-preview",
21837
- "lyria-3-clip-preview",
21838
- ]);
21839
- function getGoogleGenAIServerURL(parentClient) {
21840
- const serverURL = parentClient.getBaseUrl();
21841
- if (!serverURL) {
21842
- throw new Error("Base URL must be set.");
21843
- }
21844
- return serverURL.replace(/\/+$/, "");
21845
- }
21846
- function getGoogleGenAIAPIVersion(parentClient) {
21847
- const apiVersion = trimSlashes(parentClient.getApiVersion());
21848
- const project = parentClient.getProject();
21849
- const location = parentClient.getLocation();
21850
- if (parentClient.isVertexAI() && apiVersion && project && location) {
21851
- return (`${apiVersion}/projects/${encodeURIComponent(project)}` +
21852
- `/locations/${encodeURIComponent(location)}`);
21853
- }
21854
- return apiVersion;
22260
+ /**
22261
+ * Deletes a Webhook.
22262
+ */
22263
+ function webhooksDelete(client, id, api_version, options) {
22264
+ return new APIPromise($do$5(client, id, api_version, options));
21855
22265
  }
21856
- function buildGoogleGenAIClient(parentClient, options = {}) {
21857
- var _a, _b, _c, _d;
21858
- 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({
21859
- defaultHeaders: (_c = parentClient.getDefaultHeaders) === null || _c === void 0 ? void 0 : _c.call(parentClient),
22266
+ async function $do$5(client, id, api_version, options) {
22267
+ var _a, _b, _c;
22268
+ const input = {
22269
+ id: id,
22270
+ api_version: api_version,
22271
+ };
22272
+ const payload = input;
22273
+ const body = null;
22274
+ const pathParams = {
22275
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
22276
+ id: encodeSimple("id", payload.id, {
22277
+ explode: false,
22278
+ charEncoding: "percent",
22279
+ }),
22280
+ };
22281
+ const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
22282
+ const headers = new Headers(compactMap({
22283
+ Accept: "application/json",
22284
+ }));
22285
+ const securityInput = await extractSecurity(client._options.security);
22286
+ const requestSecurity = resolveGlobalSecurity(securityInput);
22287
+ const context = {
22288
+ options: client._options,
22289
+ base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
22290
+ operation_id: "DeleteWebhook",
22291
+ o_auth2_scopes: null,
22292
+ resolved_security: requestSecurity,
22293
+ security_source: client._options.security,
22294
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
22295
+ || client._options.retry_config
22296
+ || {
22297
+ strategy: "attempt-count-backoff",
22298
+ backoff: {
22299
+ initialInterval: 500,
22300
+ maxInterval: 8000,
22301
+ exponent: 2,
22302
+ maxElapsedTime: 30000,
22303
+ },
22304
+ retryConnectionErrors: true,
22305
+ maxRetries: 4,
22306
+ }
22307
+ || { strategy: "none" },
22308
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
22309
+ };
22310
+ const requestRes = client._createRequest(context, {
22311
+ security: requestSecurity,
22312
+ method: "DELETE",
22313
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
22314
+ path: path,
22315
+ headers: headers,
22316
+ body: body,
22317
+ userAgent: client._options.user_agent,
22318
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
22319
+ }, options);
22320
+ if (!requestRes.ok) {
22321
+ return [requestRes, { status: "invalid" }];
22322
+ }
22323
+ const req = requestRes.value;
22324
+ const doResult = await client._do(req, {
22325
+ context,
22326
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
22327
+ retryConfig: context.retry_config,
22328
+ retryCodes: context.retry_codes,
22329
+ });
22330
+ if (!doResult.ok) {
22331
+ return [doResult, { status: "request-error", request: req }];
22332
+ }
22333
+ const response = doResult.value;
22334
+ const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
22335
+ if (!result.ok) {
22336
+ return [result, { status: "complete", request: req, response }];
22337
+ }
22338
+ return [result, { status: "complete", request: req, response }];
22339
+ }
22340
+
22341
+ /**
22342
+ * @license
22343
+ * Copyright 2026 Google LLC
22344
+ * SPDX-License-Identifier: Apache-2.0
22345
+ *
22346
+ * g3-prettier-ignore-file
22347
+ */
22348
+ /**
22349
+ * Gets a specific Webhook.
22350
+ */
22351
+ function webhooksGet(client, id, api_version, options) {
22352
+ return new APIPromise($do$4(client, id, api_version, options));
22353
+ }
22354
+ async function $do$4(client, id, api_version, options) {
22355
+ var _a, _b, _c;
22356
+ const input = {
22357
+ id: id,
22358
+ api_version: api_version,
22359
+ };
22360
+ const payload = input;
22361
+ const body = null;
22362
+ const pathParams = {
22363
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
22364
+ id: encodeSimple("id", payload.id, {
22365
+ explode: false,
22366
+ charEncoding: "percent",
22367
+ }),
22368
+ };
22369
+ const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
22370
+ const headers = new Headers(compactMap({
22371
+ Accept: "application/json",
22372
+ }));
22373
+ const securityInput = await extractSecurity(client._options.security);
22374
+ const requestSecurity = resolveGlobalSecurity(securityInput);
22375
+ const context = {
22376
+ options: client._options,
22377
+ base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
22378
+ operation_id: "GetWebhook",
22379
+ o_auth2_scopes: null,
22380
+ resolved_security: requestSecurity,
22381
+ security_source: client._options.security,
22382
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
22383
+ || client._options.retry_config
22384
+ || {
22385
+ strategy: "attempt-count-backoff",
22386
+ backoff: {
22387
+ initialInterval: 500,
22388
+ maxInterval: 8000,
22389
+ exponent: 2,
22390
+ maxElapsedTime: 30000,
22391
+ },
22392
+ retryConnectionErrors: true,
22393
+ maxRetries: 4,
22394
+ }
22395
+ || { strategy: "none" },
22396
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
22397
+ };
22398
+ const requestRes = client._createRequest(context, {
22399
+ security: requestSecurity,
22400
+ method: "GET",
22401
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
22402
+ path: path,
22403
+ headers: headers,
22404
+ body: body,
22405
+ userAgent: client._options.user_agent,
22406
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
22407
+ }, options);
22408
+ if (!requestRes.ok) {
22409
+ return [requestRes, { status: "invalid" }];
22410
+ }
22411
+ const req = requestRes.value;
22412
+ const doResult = await client._do(req, {
22413
+ context,
22414
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
22415
+ retryConfig: context.retry_config,
22416
+ retryCodes: context.retry_codes,
22417
+ });
22418
+ if (!doResult.ok) {
22419
+ return [doResult, { status: "request-error", request: req }];
22420
+ }
22421
+ const response = doResult.value;
22422
+ const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
22423
+ if (!result.ok) {
22424
+ return [result, { status: "complete", request: req, response }];
22425
+ }
22426
+ return [result, { status: "complete", request: req, response }];
22427
+ }
22428
+
22429
+ /**
22430
+ * @license
22431
+ * Copyright 2026 Google LLC
22432
+ * SPDX-License-Identifier: Apache-2.0
22433
+ *
22434
+ * g3-prettier-ignore-file
22435
+ */
22436
+ /**
22437
+ * Lists all Webhooks.
22438
+ */
22439
+ function webhooksList(client, api_version, page_size, page_token, options) {
22440
+ return new APIPromise($do$3(client, api_version, page_size, page_token, options));
22441
+ }
22442
+ async function $do$3(client, api_version, page_size, page_token, options) {
22443
+ var _a, _b, _c;
22444
+ const input = {
22445
+ api_version: api_version,
22446
+ page_size: page_size,
22447
+ page_token: page_token,
22448
+ };
22449
+ const payload = input;
22450
+ const body = null;
22451
+ const pathParams = {
22452
+ api_version: encodeSimple("api_version", (_a = payload === null || payload === void 0 ? void 0 : payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
22453
+ };
22454
+ const path = pathToFunc("/{api_version}/webhooks")(pathParams);
22455
+ const query = encodeFormQuery({
22456
+ "page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
22457
+ "page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
22458
+ });
22459
+ const headers = new Headers(compactMap({
22460
+ Accept: "application/json",
22461
+ }));
22462
+ const securityInput = await extractSecurity(client._options.security);
22463
+ const requestSecurity = resolveGlobalSecurity(securityInput);
22464
+ const context = {
22465
+ options: client._options,
22466
+ base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
22467
+ operation_id: "ListWebhooks",
22468
+ o_auth2_scopes: null,
22469
+ resolved_security: requestSecurity,
22470
+ security_source: client._options.security,
22471
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
22472
+ || client._options.retry_config
22473
+ || {
22474
+ strategy: "attempt-count-backoff",
22475
+ backoff: {
22476
+ initialInterval: 500,
22477
+ maxInterval: 8000,
22478
+ exponent: 2,
22479
+ maxElapsedTime: 30000,
22480
+ },
22481
+ retryConnectionErrors: true,
22482
+ maxRetries: 4,
22483
+ }
22484
+ || { strategy: "none" },
22485
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
22486
+ };
22487
+ const requestRes = client._createRequest(context, {
22488
+ security: requestSecurity,
22489
+ method: "GET",
22490
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
22491
+ path: path,
22492
+ headers: headers,
22493
+ query: query,
22494
+ body: body,
22495
+ userAgent: client._options.user_agent,
22496
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
22497
+ }, options);
22498
+ if (!requestRes.ok) {
22499
+ return [requestRes, { status: "invalid" }];
22500
+ }
22501
+ const req = requestRes.value;
22502
+ const doResult = await client._do(req, {
22503
+ context,
22504
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
22505
+ retryConfig: context.retry_config,
22506
+ retryCodes: context.retry_codes,
22507
+ });
22508
+ if (!doResult.ok) {
22509
+ return [doResult, { status: "request-error", request: req }];
22510
+ }
22511
+ const response = doResult.value;
22512
+ const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
22513
+ if (!result.ok) {
22514
+ return [result, { status: "complete", request: req, response }];
22515
+ }
22516
+ return [result, { status: "complete", request: req, response }];
22517
+ }
22518
+
22519
+ /**
22520
+ * @license
22521
+ * Copyright 2026 Google LLC
22522
+ * SPDX-License-Identifier: Apache-2.0
22523
+ *
22524
+ * g3-prettier-ignore-file
22525
+ */
22526
+ /**
22527
+ * Sends a ping event to a Webhook.
22528
+ */
22529
+ function webhooksPing(client, id, api_version, body, options) {
22530
+ return new APIPromise($do$2(client, id, api_version, body, options));
22531
+ }
22532
+ async function $do$2(client, id, api_version, body, options) {
22533
+ var _a, _b, _c;
22534
+ const input = {
22535
+ id: id,
22536
+ api_version: api_version,
22537
+ body: body,
22538
+ };
22539
+ const payload = input;
22540
+ const body$ = encodeJSON("body", payload.body, { explode: true });
22541
+ const pathParams = {
22542
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
22543
+ id: encodeSimple("id", payload.id, {
22544
+ explode: false,
22545
+ charEncoding: "percent",
22546
+ }),
22547
+ };
22548
+ const path = pathToFunc("/{api_version}/webhooks/{id}:ping")(pathParams);
22549
+ const headers = new Headers(compactMap({
22550
+ "Content-Type": "application/json",
22551
+ Accept: "application/json",
22552
+ }));
22553
+ const securityInput = await extractSecurity(client._options.security);
22554
+ const requestSecurity = resolveGlobalSecurity(securityInput);
22555
+ const context = {
22556
+ options: client._options,
22557
+ base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
22558
+ operation_id: "PingWebhook",
22559
+ o_auth2_scopes: null,
22560
+ resolved_security: requestSecurity,
22561
+ security_source: client._options.security,
22562
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
22563
+ || client._options.retry_config
22564
+ || {
22565
+ strategy: "attempt-count-backoff",
22566
+ backoff: {
22567
+ initialInterval: 500,
22568
+ maxInterval: 8000,
22569
+ exponent: 2,
22570
+ maxElapsedTime: 30000,
22571
+ },
22572
+ retryConnectionErrors: true,
22573
+ maxRetries: 4,
22574
+ }
22575
+ || { strategy: "none" },
22576
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
22577
+ };
22578
+ const requestRes = client._createRequest(context, {
22579
+ security: requestSecurity,
22580
+ method: "POST",
22581
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
22582
+ path: path,
22583
+ headers: headers,
22584
+ body: body$,
22585
+ userAgent: client._options.user_agent,
22586
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
22587
+ }, options);
22588
+ if (!requestRes.ok) {
22589
+ return [requestRes, { status: "invalid" }];
22590
+ }
22591
+ const req = requestRes.value;
22592
+ const doResult = await client._do(req, {
22593
+ context,
22594
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
22595
+ retryConfig: context.retry_config,
22596
+ retryCodes: context.retry_codes,
22597
+ });
22598
+ if (!doResult.ok) {
22599
+ return [doResult, { status: "request-error", request: req }];
22600
+ }
22601
+ const response = doResult.value;
22602
+ const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
22603
+ if (!result.ok) {
22604
+ return [result, { status: "complete", request: req, response }];
22605
+ }
22606
+ return [result, { status: "complete", request: req, response }];
22607
+ }
22608
+
22609
+ /**
22610
+ * @license
22611
+ * Copyright 2026 Google LLC
22612
+ * SPDX-License-Identifier: Apache-2.0
22613
+ *
22614
+ * g3-prettier-ignore-file
22615
+ */
22616
+ /**
22617
+ * Generates a new signing secret for a Webhook.
22618
+ */
22619
+ function webhooksRotateSigningSecret(client, id, api_version, body, options) {
22620
+ return new APIPromise($do$1(client, id, api_version, body, options));
22621
+ }
22622
+ async function $do$1(client, id, api_version, body, options) {
22623
+ var _a, _b, _c;
22624
+ const input = {
22625
+ id: id,
22626
+ api_version: api_version,
22627
+ body: body,
22628
+ };
22629
+ const payload = input;
22630
+ const body$ = encodeJSON("body", payload.body, { explode: true });
22631
+ const pathParams = {
22632
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
22633
+ id: encodeSimple("id", payload.id, {
22634
+ explode: false,
22635
+ charEncoding: "percent",
22636
+ }),
22637
+ };
22638
+ const path = pathToFunc("/{api_version}/webhooks/{id}:rotateSigningSecret")(pathParams);
22639
+ const headers = new Headers(compactMap({
22640
+ "Content-Type": "application/json",
22641
+ Accept: "application/json",
22642
+ }));
22643
+ const securityInput = await extractSecurity(client._options.security);
22644
+ const requestSecurity = resolveGlobalSecurity(securityInput);
22645
+ const context = {
22646
+ options: client._options,
22647
+ base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
22648
+ operation_id: "RotateSigningSecret",
22649
+ o_auth2_scopes: null,
22650
+ resolved_security: requestSecurity,
22651
+ security_source: client._options.security,
22652
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
22653
+ || client._options.retry_config
22654
+ || {
22655
+ strategy: "attempt-count-backoff",
22656
+ backoff: {
22657
+ initialInterval: 500,
22658
+ maxInterval: 8000,
22659
+ exponent: 2,
22660
+ maxElapsedTime: 30000,
22661
+ },
22662
+ retryConnectionErrors: true,
22663
+ maxRetries: 4,
22664
+ }
22665
+ || { strategy: "none" },
22666
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
22667
+ };
22668
+ const requestRes = client._createRequest(context, {
22669
+ security: requestSecurity,
22670
+ method: "POST",
22671
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
22672
+ path: path,
22673
+ headers: headers,
22674
+ body: body$,
22675
+ userAgent: client._options.user_agent,
22676
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
22677
+ }, options);
22678
+ if (!requestRes.ok) {
22679
+ return [requestRes, { status: "invalid" }];
22680
+ }
22681
+ const req = requestRes.value;
22682
+ const doResult = await client._do(req, {
22683
+ context,
22684
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
22685
+ retryConfig: context.retry_config,
22686
+ retryCodes: context.retry_codes,
22687
+ });
22688
+ if (!doResult.ok) {
22689
+ return [doResult, { status: "request-error", request: req }];
22690
+ }
22691
+ const response = doResult.value;
22692
+ const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
22693
+ if (!result.ok) {
22694
+ return [result, { status: "complete", request: req, response }];
22695
+ }
22696
+ return [result, { status: "complete", request: req, response }];
22697
+ }
22698
+
22699
+ /**
22700
+ * @license
22701
+ * Copyright 2026 Google LLC
22702
+ * SPDX-License-Identifier: Apache-2.0
22703
+ *
22704
+ * g3-prettier-ignore-file
22705
+ */
22706
+ /**
22707
+ * Updates an existing Webhook.
22708
+ */
22709
+ function webhooksUpdate(client, id, api_version, update_mask, body, options) {
22710
+ return new APIPromise($do(client, id, api_version, update_mask, body, options));
22711
+ }
22712
+ async function $do(client, id, api_version, update_mask, body, options) {
22713
+ var _a, _b, _c;
22714
+ const input = {
22715
+ id: id,
22716
+ api_version: api_version,
22717
+ update_mask: update_mask,
22718
+ body: body,
22719
+ };
22720
+ const payload = input;
22721
+ const body$ = encodeJSON("body", payload.body, { explode: true });
22722
+ const pathParams = {
22723
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
22724
+ id: encodeSimple("id", payload.id, {
22725
+ explode: false,
22726
+ charEncoding: "percent",
22727
+ }),
22728
+ };
22729
+ const path = pathToFunc("/{api_version}/webhooks/{id}")(pathParams);
22730
+ const query = encodeFormQuery({
22731
+ "update_mask": payload.update_mask,
22732
+ });
22733
+ const headers = new Headers(compactMap({
22734
+ "Content-Type": "application/json",
22735
+ Accept: "application/json",
22736
+ }));
22737
+ const securityInput = await extractSecurity(client._options.security);
22738
+ const requestSecurity = resolveGlobalSecurity(securityInput);
22739
+ const context = {
22740
+ options: client._options,
22741
+ base_url: (_c = (_b = options === null || options === void 0 ? void 0 : options.server_url) !== null && _b !== void 0 ? _b : client._baseURL) !== null && _c !== void 0 ? _c : "",
22742
+ operation_id: "UpdateWebhook",
22743
+ o_auth2_scopes: null,
22744
+ resolved_security: requestSecurity,
22745
+ security_source: client._options.security,
22746
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
22747
+ || client._options.retry_config
22748
+ || {
22749
+ strategy: "attempt-count-backoff",
22750
+ backoff: {
22751
+ initialInterval: 500,
22752
+ maxInterval: 8000,
22753
+ exponent: 2,
22754
+ maxElapsedTime: 30000,
22755
+ },
22756
+ retryConnectionErrors: true,
22757
+ maxRetries: 4,
22758
+ }
22759
+ || { strategy: "none" },
22760
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
22761
+ };
22762
+ const requestRes = client._createRequest(context, {
22763
+ security: requestSecurity,
22764
+ method: "PATCH",
22765
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
22766
+ path: path,
22767
+ headers: headers,
22768
+ query: query,
22769
+ body: body$,
22770
+ userAgent: client._options.user_agent,
22771
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
22772
+ }, options);
22773
+ if (!requestRes.ok) {
22774
+ return [requestRes, { status: "invalid" }];
22775
+ }
22776
+ const req = requestRes.value;
22777
+ const doResult = await client._do(req, {
22778
+ context,
22779
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
22780
+ retryConfig: context.retry_config,
22781
+ retryCodes: context.retry_codes,
22782
+ });
22783
+ if (!doResult.ok) {
22784
+ return [doResult, { status: "request-error", request: req }];
22785
+ }
22786
+ const response = doResult.value;
22787
+ const [result] = await match(fail("4XX"), fail("5XX"), json("default"))(response, req);
22788
+ if (!result.ok) {
22789
+ return [result, { status: "complete", request: req, response }];
22790
+ }
22791
+ return [result, { status: "complete", request: req, response }];
22792
+ }
22793
+
22794
+ /**
22795
+ * @license
22796
+ * Copyright 2026 Google LLC
22797
+ * SPDX-License-Identifier: Apache-2.0
22798
+ *
22799
+ * g3-prettier-ignore-file
22800
+ */
22801
+ class Webhooks extends ClientSDK {
22802
+ /**
22803
+ * Creates a new Webhook.
22804
+ */
22805
+ create(params, options) {
22806
+ const { api_version } = params, body = __rest(params, ["api_version"]);
22807
+ return unwrapAsAPIPromise(webhooksCreate(this, body, api_version, options));
22808
+ }
22809
+ /**
22810
+ * Lists all Webhooks.
22811
+ */
22812
+ list(params, options) {
22813
+ return unwrapAsAPIPromise(webhooksList(this, params === null || params === void 0 ? void 0 : params.api_version, params === null || params === void 0 ? void 0 : params.page_size, params === null || params === void 0 ? void 0 : params.page_token, options));
22814
+ }
22815
+ /**
22816
+ * Gets a specific Webhook.
22817
+ */
22818
+ get(id, params, options) {
22819
+ return unwrapAsAPIPromise(webhooksGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
22820
+ }
22821
+ /**
22822
+ * Updates an existing Webhook.
22823
+ */
22824
+ update(id, params, options) {
22825
+ const _a = params !== null && params !== void 0 ? params : {}, { api_version, update_mask } = _a, body$body = __rest(_a, ["api_version", "update_mask"]);
22826
+ const body = params === undefined || Object.keys(body$body).length === 0
22827
+ ? undefined
22828
+ : body$body;
22829
+ return unwrapAsAPIPromise(webhooksUpdate(this, id, api_version, update_mask, body, options));
22830
+ }
22831
+ /**
22832
+ * Deletes a Webhook.
22833
+ */
22834
+ delete(id, params, options) {
22835
+ return unwrapAsAPIPromise(webhooksDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
22836
+ }
22837
+ /**
22838
+ * Generates a new signing secret for a Webhook.
22839
+ */
22840
+ rotateSigningSecret(id, api_version, body, options) {
22841
+ return unwrapAsAPIPromise(webhooksRotateSigningSecret(this, id, api_version, body, options));
22842
+ }
22843
+ /**
22844
+ * Sends a ping event to a Webhook.
22845
+ */
22846
+ ping(id, api_version, body, options) {
22847
+ return unwrapAsAPIPromise(webhooksPing(this, id, api_version, body, options));
22848
+ }
22849
+ }
22850
+
22851
+ /**
22852
+ * @license
22853
+ * Copyright 2026 Google LLC
22854
+ * SPDX-License-Identifier: Apache-2.0
22855
+ *
22856
+ * g3-prettier-ignore-file
22857
+ */
22858
+ /*
22859
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
22860
+ */
22861
+ let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
22862
+ get interactions() {
22863
+ var _a;
22864
+ return ((_a = this._interactions) !== null && _a !== void 0 ? _a : (this._interactions = new Interactions(this._options)));
22865
+ }
22866
+ get webhooks() {
22867
+ var _a;
22868
+ return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Webhooks(this._options)));
22869
+ }
22870
+ get agents() {
22871
+ var _a;
22872
+ return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Agents(this._options)));
22873
+ }
22874
+ get triggers() {
22875
+ var _a;
22876
+ return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Triggers(this._options)));
22877
+ }
22878
+ };
22879
+
22880
+ /**
22881
+ * @license
22882
+ * Copyright 2026 Google LLC
22883
+ * SPDX-License-Identifier: Apache-2.0
22884
+ *
22885
+ * g3-prettier-ignore-file
22886
+ */
22887
+ const LEGACY_LYRIA_MODELS = new Set([
22888
+ "lyria-3-pro-preview",
22889
+ "lyria-3-clip-preview",
22890
+ ]);
22891
+ function getGoogleGenAIServerURL(parentClient) {
22892
+ const serverURL = parentClient.getBaseUrl();
22893
+ if (!serverURL) {
22894
+ throw new Error("Base URL must be set.");
22895
+ }
22896
+ return serverURL.replace(/\/+$/, "");
22897
+ }
22898
+ function getGoogleGenAIAPIVersion(parentClient) {
22899
+ const apiVersion = trimSlashes(parentClient.getApiVersion());
22900
+ const project = parentClient.getProject();
22901
+ const location = parentClient.getLocation();
22902
+ if (parentClient.isVertexAI() && apiVersion && project && location) {
22903
+ return (`${apiVersion}/projects/${encodeURIComponent(project)}` +
22904
+ `/locations/${encodeURIComponent(location)}`);
22905
+ }
22906
+ return apiVersion;
22907
+ }
22908
+ function buildGoogleGenAIClient(parentClient, options = {}) {
22909
+ var _a, _b, _c, _d, _e;
22910
+ const sdk = new GoogleGenAI$1(Object.assign(Object.assign({}, options), { api_version: (_a = options.api_version) !== null && _a !== void 0 ? _a : getGoogleGenAIAPIVersion(parentClient), security: (_b = options.security) !== null && _b !== void 0 ? _b : new GoogleGenAISecurityProvider({
22911
+ defaultHeaders: Object.assign(Object.assign({}, (_c = parentClient.getDefaultHeaders) === null || _c === void 0 ? void 0 : _c.call(parentClient)), (_d = parentClient.getHeaders) === null || _d === void 0 ? void 0 : _d.call(parentClient)),
21860
22912
  getAuthHeaders: (url) => parentClient.getAuthHeaders(url),
21861
- }), server_url: (_d = options.server_url) !== null && _d !== void 0 ? _d : getGoogleGenAIServerURL(parentClient) }));
22913
+ }), server_url: (_e = options.server_url) !== null && _e !== void 0 ? _e : getGoogleGenAIServerURL(parentClient) }));
21862
22914
  return sdk;
21863
22915
  }
21864
22916
  class GeminiNextGenInteractions {
@@ -21965,6 +23017,46 @@ class GeminiNextGenWebhooks {
21965
23017
  return this.sdk;
21966
23018
  }
21967
23019
  }
23020
+ class GeminiNextGenTriggers {
23021
+ constructor(parentClient) {
23022
+ this.parentClient = parentClient;
23023
+ }
23024
+ async create(params, options) {
23025
+ const { api_version } = params, body = __rest(params, ["api_version"]);
23026
+ return unwrapWithSdkHttpResponse(triggersCreate(this.getClient(api_version), body, api_version, toGoogleGenAIRequestOptions(options)));
23027
+ }
23028
+ async list(params = {}, options) {
23029
+ const { api_version, filter, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
23030
+ return unwrapWithSdkHttpResponse(triggersList(this.getClient(api_version), api_version, filter, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
23031
+ }
23032
+ async get(id, params = {}, options) {
23033
+ return unwrapWithSdkHttpResponse(triggersGet(this.getClient(params === null || params === void 0 ? void 0 : params.api_version), id, params === null || params === void 0 ? void 0 : params.api_version, toGoogleGenAIRequestOptions(options)));
23034
+ }
23035
+ async update(id, params, options) {
23036
+ const { api_version } = params, body = __rest(params, ["api_version"]);
23037
+ return unwrapWithSdkHttpResponse(triggersUpdate(this.getClient(api_version), id, body, api_version, toGoogleGenAIRequestOptions(options)));
23038
+ }
23039
+ async delete(id, params = {}, options) {
23040
+ return unwrapWithSdkHttpResponse(triggersDelete(this.getClient(params === null || params === void 0 ? void 0 : params.api_version), id, params === null || params === void 0 ? void 0 : params.api_version, toGoogleGenAIRequestOptions(options)));
23041
+ }
23042
+ async run(trigger_id, params = {}, options) {
23043
+ return unwrapWithSdkHttpResponse(triggersRun(this.getClient(params === null || params === void 0 ? void 0 : params.api_version), trigger_id, params === null || params === void 0 ? void 0 : params.api_version, toGoogleGenAIRequestOptions(options)));
23044
+ }
23045
+ async listExecutions(trigger_id, params = {}, options) {
23046
+ const { api_version, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
23047
+ return unwrapWithSdkHttpResponse(triggersListExecutions(this.getClient(api_version), trigger_id, api_version, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
23048
+ }
23049
+ getClient(apiVersion) {
23050
+ var _a;
23051
+ if (apiVersion) {
23052
+ return buildGoogleGenAIClient(this.parentClient, {
23053
+ api_version: apiVersion,
23054
+ });
23055
+ }
23056
+ (_a = this.sdk) !== null && _a !== void 0 ? _a : (this.sdk = buildGoogleGenAIClient(this.parentClient));
23057
+ return this.sdk;
23058
+ }
23059
+ }
21968
23060
  function trimSlashes(value) {
21969
23061
  return value.replace(/^\/+|\/+$/g, "");
21970
23062
  }
@@ -23193,6 +24285,18 @@ function generationConfigFromVertex(fromObject, _rootObject) {
23193
24285
  if (fromTopP != null) {
23194
24286
  setValueByPath(toObject, ['topP'], fromTopP);
23195
24287
  }
24288
+ const fromResponseFormat = getValueByPath(fromObject, [
24289
+ 'responseFormat',
24290
+ ]);
24291
+ if (fromResponseFormat != null) {
24292
+ let transformedList = fromResponseFormat;
24293
+ if (Array.isArray(transformedList)) {
24294
+ transformedList = transformedList.map((item) => {
24295
+ return item;
24296
+ });
24297
+ }
24298
+ setValueByPath(toObject, ['responseFormat'], transformedList);
24299
+ }
23196
24300
  return toObject;
23197
24301
  }
23198
24302
  function getTuningJobParametersToMldev(fromObject, _rootObject) {
@@ -24635,6 +25739,14 @@ class GoogleGenAI {
24635
25739
  this._agents = new GeminiNextGenAgents(this.apiClient);
24636
25740
  return this._agents;
24637
25741
  }
25742
+ get triggers() {
25743
+ if (this._triggers !== undefined) {
25744
+ return this._triggers;
25745
+ }
25746
+ console.warn('GoogleGenAI.triggers: Triggers usage is experimental and may change in future versions.');
25747
+ this._triggers = new GeminiNextGenTriggers(this.apiClient);
25748
+ return this._triggers;
25749
+ }
24638
25750
  constructor(options) {
24639
25751
  var _a, _b, _c, _d;
24640
25752
  // Validate explicitly set initializer values.
@@ -24742,6 +25854,7 @@ function getApiKeyFromEnv() {
24742
25854
  }
24743
25855
 
24744
25856
  exports.ApiError = ApiError;
25857
+ exports.AudioResponseFormat = AudioResponseFormat;
24745
25858
  exports.Batches = Batches;
24746
25859
  exports.Caches = Caches;
24747
25860
  exports.CancelTuningJobResponse = CancelTuningJobResponse;
@@ -24771,6 +25884,7 @@ exports.GenerateVideosOperation = GenerateVideosOperation;
24771
25884
  exports.GenerateVideosResponse = GenerateVideosResponse;
24772
25885
  exports.GoogleGenAI = GoogleGenAI;
24773
25886
  exports.HttpResponse = HttpResponse;
25887
+ exports.ImageResponseFormat = ImageResponseFormat;
24774
25888
  exports.ImportFileOperation = ImportFileOperation;
24775
25889
  exports.ImportFileResponse = ImportFileResponse;
24776
25890
  exports.InlinedEmbedContentResponse = InlinedEmbedContentResponse;
@@ -24797,11 +25911,13 @@ exports.RegisterFilesResponse = RegisterFilesResponse;
24797
25911
  exports.ReinforcementTuningAutoraterScorerParsedResponseConversionScorer = ReinforcementTuningAutoraterScorerParsedResponseConversionScorer;
24798
25912
  exports.ReinforcementTuningParseResponseConfig = ReinforcementTuningParseResponseConfig;
24799
25913
  exports.ReplayResponse = ReplayResponse;
25914
+ exports.ResponseFormat = ResponseFormat;
24800
25915
  exports.SegmentImageResponse = SegmentImageResponse;
24801
25916
  exports.Session = Session;
24802
25917
  exports.SingleEmbedContentResponse = SingleEmbedContentResponse;
24803
25918
  exports.StyleReferenceImage = StyleReferenceImage;
24804
25919
  exports.SubjectReferenceImage = SubjectReferenceImage;
25920
+ exports.TextResponseFormat = TextResponseFormat;
24805
25921
  exports.Tokens = Tokens;
24806
25922
  exports.ToolResponse = ToolResponse;
24807
25923
  exports.UploadToFileSearchStoreOperation = UploadToFileSearchStoreOperation;
@@ -24809,6 +25925,7 @@ exports.UploadToFileSearchStoreResponse = UploadToFileSearchStoreResponse;
24809
25925
  exports.UploadToFileSearchStoreResumableResponse = UploadToFileSearchStoreResumableResponse;
24810
25926
  exports.UpscaleImageResponse = UpscaleImageResponse;
24811
25927
  exports.ValidateRewardResponse = ValidateRewardResponse;
25928
+ exports.VideoResponseFormat = VideoResponseFormat;
24812
25929
  exports.createFunctionResponsePartFromBase64 = createFunctionResponsePartFromBase64;
24813
25930
  exports.createFunctionResponsePartFromUri = createFunctionResponsePartFromUri;
24814
25931
  exports.createModelContent = createModelContent;