@google/genai 2.11.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -7927,7 +7927,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
7927
7927
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
7928
7928
  const USER_AGENT_HEADER = 'User-Agent';
7929
7929
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
7930
- const SDK_VERSION = '2.11.0'; // x-release-please-version
7930
+ const SDK_VERSION = '2.13.0'; // x-release-please-version
7931
7931
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
7932
7932
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
7933
7933
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -10438,7 +10438,7 @@ function serverURLFromOptions(options) {
10438
10438
  return new URL(u);
10439
10439
  }
10440
10440
  const SDK_METADATA = {
10441
- userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.913.3 v1beta @google/genai",
10441
+ userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.918.3 v1beta @google/genai",
10442
10442
  };
10443
10443
 
10444
10444
  /**
@@ -10739,10 +10739,10 @@ const DEFAULT_FETCHER = (input, init) => {
10739
10739
  };
10740
10740
  class HTTPClient {
10741
10741
  constructor(options = {}) {
10742
- this.options = options;
10743
10742
  this.requestHooks = [];
10744
10743
  this.requestErrorHooks = [];
10745
10744
  this.responseHooks = [];
10745
+ this.options = options;
10746
10746
  this.fetcher = options.fetcher || DEFAULT_FETCHER;
10747
10747
  }
10748
10748
  async request(request) {
@@ -11846,11 +11846,10 @@ function unpackHeaders(headers) {
11846
11846
  *
11847
11847
  * g3-prettier-ignore-file
11848
11848
  */
11849
- var SecurityErrorCode;
11850
- (function (SecurityErrorCode) {
11851
- SecurityErrorCode["Incomplete"] = "incomplete";
11852
- SecurityErrorCode["UnrecognisedSecurityType"] = "unrecognized_security_type";
11853
- })(SecurityErrorCode || (SecurityErrorCode = {}));
11849
+ const SecurityErrorCode = {
11850
+ Incomplete: "incomplete",
11851
+ UnrecognisedSecurityType: "unrecognized_security_type",
11852
+ };
11854
11853
  class SecurityError extends Error {
11855
11854
  constructor(code, message) {
11856
11855
  super(message);
@@ -12079,9 +12078,9 @@ function unwrapAsAPIPromise(p) {
12079
12078
  * Creates a new Agent (Typed version for SDK).
12080
12079
  */
12081
12080
  function agentsCreate(client, body, api_version, options) {
12082
- return new APIPromise($do$e(client, body, api_version, options));
12081
+ return new APIPromise($do$l(client, body, api_version, options));
12083
12082
  }
12084
- async function $do$e(client, body, api_version, options) {
12083
+ async function $do$l(client, body, api_version, options) {
12085
12084
  var _a, _b, _c;
12086
12085
  const input = {
12087
12086
  body: body,
@@ -12164,9 +12163,9 @@ async function $do$e(client, body, api_version, options) {
12164
12163
  * Deletes an Agent.
12165
12164
  */
12166
12165
  function agentsDelete(client, id, api_version, options) {
12167
- return new APIPromise($do$d(client, id, api_version, options));
12166
+ return new APIPromise($do$k(client, id, api_version, options));
12168
12167
  }
12169
- async function $do$d(client, id, api_version, options) {
12168
+ async function $do$k(client, id, api_version, options) {
12170
12169
  var _a, _b, _c;
12171
12170
  const input = {
12172
12171
  id: id,
@@ -12252,9 +12251,9 @@ async function $do$d(client, id, api_version, options) {
12252
12251
  * Gets a specific Agent.
12253
12252
  */
12254
12253
  function agentsGet(client, id, api_version, options) {
12255
- return new APIPromise($do$c(client, id, api_version, options));
12254
+ return new APIPromise($do$j(client, id, api_version, options));
12256
12255
  }
12257
- async function $do$c(client, id, api_version, options) {
12256
+ async function $do$j(client, id, api_version, options) {
12258
12257
  var _a, _b, _c;
12259
12258
  const input = {
12260
12259
  id: id,
@@ -12340,9 +12339,9 @@ async function $do$c(client, id, api_version, options) {
12340
12339
  * Lists all Agents.
12341
12340
  */
12342
12341
  function agentsList(client, api_version, page_size, page_token, parent, options) {
12343
- return new APIPromise($do$b(client, api_version, page_size, page_token, parent, options));
12342
+ return new APIPromise($do$i(client, api_version, page_size, page_token, parent, options));
12344
12343
  }
12345
- async function $do$b(client, api_version, page_size, page_token, parent, options) {
12344
+ async function $do$i(client, api_version, page_size, page_token, parent, options) {
12346
12345
  var _a, _b, _c;
12347
12346
  const input = {
12348
12347
  api_version: api_version,
@@ -12608,15 +12607,596 @@ class GetInteractionByIdClientError extends GoogleGenAiError {
12608
12607
  * g3-prettier-ignore-file
12609
12608
  */
12610
12609
  /**
12611
- * Canceling an interaction
12612
- *
12613
- * @remarks
12614
- * Cancels an interaction by id. This only applies to background interactions that are still running.
12610
+ * Canceling an interaction
12611
+ *
12612
+ * @remarks
12613
+ * Cancels an interaction by id. This only applies to background interactions that are still running.
12614
+ */
12615
+ function interactionsCancel(client, id, api_version, options) {
12616
+ return new APIPromise($do$h(client, id, api_version, options));
12617
+ }
12618
+ async function $do$h(client, id, api_version, options) {
12619
+ var _a, _b, _c;
12620
+ const input = {
12621
+ id: id,
12622
+ api_version: api_version,
12623
+ };
12624
+ const payload = input;
12625
+ const body = null;
12626
+ const pathParams = {
12627
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
12628
+ id: encodeSimple("id", payload.id, {
12629
+ explode: false,
12630
+ charEncoding: "percent",
12631
+ }),
12632
+ };
12633
+ const path = pathToFunc("/{api_version}/interactions/{id}/cancel")(pathParams);
12634
+ const headers = new Headers(compactMap({
12635
+ Accept: "application/json",
12636
+ }));
12637
+ const securityInput = await extractSecurity(client._options.security);
12638
+ const requestSecurity = resolveGlobalSecurity(securityInput);
12639
+ const context = {
12640
+ options: client._options,
12641
+ 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 : "",
12642
+ operation_id: "cancelInteractionById",
12643
+ o_auth2_scopes: null,
12644
+ resolved_security: requestSecurity,
12645
+ security_source: client._options.security,
12646
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
12647
+ || client._options.retry_config
12648
+ || {
12649
+ strategy: "attempt-count-backoff",
12650
+ backoff: {
12651
+ initialInterval: 500,
12652
+ maxInterval: 8000,
12653
+ exponent: 2,
12654
+ maxElapsedTime: 30000,
12655
+ },
12656
+ retryConnectionErrors: true,
12657
+ maxRetries: 4,
12658
+ }
12659
+ || { strategy: "none" },
12660
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
12661
+ };
12662
+ const requestRes = client._createRequest(context, {
12663
+ security: requestSecurity,
12664
+ method: "POST",
12665
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
12666
+ path: path,
12667
+ headers: headers,
12668
+ body: body,
12669
+ userAgent: client._options.user_agent,
12670
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
12671
+ }, options);
12672
+ if (!requestRes.ok) {
12673
+ return [requestRes, { status: "invalid" }];
12674
+ }
12675
+ const req = requestRes.value;
12676
+ const doResult = await client._do(req, {
12677
+ context,
12678
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
12679
+ retryConfig: context.retry_config,
12680
+ retryCodes: context.retry_codes,
12681
+ });
12682
+ if (!doResult.ok) {
12683
+ return [doResult, { status: "request-error", request: req }];
12684
+ }
12685
+ const response = doResult.value;
12686
+ const responseFields = {
12687
+ httpMeta: { response: response, request: req },
12688
+ };
12689
+ const [result] = await match(json(200), jsonErr("4XX", CancelInteractionByIdClientError), jsonErr("5XX", CancelInteractionByIdServerError))(response, req, { extraFields: responseFields });
12690
+ if (!result.ok) {
12691
+ return [result, { status: "complete", request: req, response }];
12692
+ }
12693
+ return [result, { status: "complete", request: req, response }];
12694
+ }
12695
+
12696
+ /**
12697
+ * @license
12698
+ * Copyright 2026 Google LLC
12699
+ * SPDX-License-Identifier: Apache-2.0
12700
+ *
12701
+ * g3-prettier-ignore-file
12702
+ */
12703
+ function interactionsCreate(client, body, api_version, options) {
12704
+ return new APIPromise($do$g(client, body, api_version, options));
12705
+ }
12706
+ async function $do$g(client, body, api_version, options) {
12707
+ var _a, _b, _c, _d;
12708
+ const input = {
12709
+ body: body,
12710
+ api_version: api_version,
12711
+ };
12712
+ const payload = input;
12713
+ const body$ = encodeJSON("body", payload.body, { explode: true });
12714
+ const pathParams = {
12715
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
12716
+ };
12717
+ const path = pathToFunc("/{api_version}/interactions")(pathParams);
12718
+ const headers = new Headers(compactMap({
12719
+ "Content-Type": "application/json",
12720
+ Accept: ((_b = input === null || input === void 0 ? void 0 : input.body) === null || _b === void 0 ? void 0 : _b.stream) ? "text/event-stream" : "application/json",
12721
+ }));
12722
+ const securityInput = await extractSecurity(client._options.security);
12723
+ const requestSecurity = resolveGlobalSecurity(securityInput);
12724
+ const context = {
12725
+ options: client._options,
12726
+ base_url: (_d = (_c = options === null || options === void 0 ? void 0 : options.server_url) !== null && _c !== void 0 ? _c : client._baseURL) !== null && _d !== void 0 ? _d : "",
12727
+ operation_id: "CreateInteraction",
12728
+ o_auth2_scopes: null,
12729
+ resolved_security: requestSecurity,
12730
+ security_source: client._options.security,
12731
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
12732
+ || client._options.retry_config
12733
+ || {
12734
+ strategy: "attempt-count-backoff",
12735
+ backoff: {
12736
+ initialInterval: 500,
12737
+ maxInterval: 8000,
12738
+ exponent: 2,
12739
+ maxElapsedTime: 30000,
12740
+ },
12741
+ retryConnectionErrors: true,
12742
+ maxRetries: 4,
12743
+ }
12744
+ || { strategy: "none" },
12745
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
12746
+ };
12747
+ const requestRes = client._createRequest(context, {
12748
+ security: requestSecurity,
12749
+ method: "POST",
12750
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
12751
+ path: path,
12752
+ headers: headers,
12753
+ body: body$,
12754
+ userAgent: client._options.user_agent,
12755
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
12756
+ }, options);
12757
+ if (!requestRes.ok) {
12758
+ return [requestRes, { status: "invalid" }];
12759
+ }
12760
+ const req = requestRes.value;
12761
+ const doResult = await client._do(req, {
12762
+ context,
12763
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
12764
+ retryConfig: context.retry_config,
12765
+ retryCodes: context.retry_codes,
12766
+ });
12767
+ if (!doResult.ok) {
12768
+ return [doResult, { status: "request-error", request: req }];
12769
+ }
12770
+ const response = doResult.value;
12771
+ const responseFields = {
12772
+ httpMeta: { response: response, request: req },
12773
+ };
12774
+ const [result] = await match(json(200), sse(200, {
12775
+ sentinel: "[DONE]",
12776
+ flattened: true,
12777
+ }), jsonErr("4XX", CreateInteractionClientError), jsonErr("5XX", CreateInteractionServerError))(response, req, { extraFields: responseFields });
12778
+ if (!result.ok) {
12779
+ return [result, { status: "complete", request: req, response }];
12780
+ }
12781
+ return [result, { status: "complete", request: req, response }];
12782
+ }
12783
+
12784
+ /**
12785
+ * @license
12786
+ * Copyright 2026 Google LLC
12787
+ * SPDX-License-Identifier: Apache-2.0
12788
+ *
12789
+ * g3-prettier-ignore-file
12790
+ */
12791
+ /**
12792
+ * Deleting an interaction
12793
+ *
12794
+ * @remarks
12795
+ * Deletes the interaction by id.
12796
+ */
12797
+ function interactionsDelete(client, id, api_version, options) {
12798
+ return new APIPromise($do$f(client, id, api_version, options));
12799
+ }
12800
+ async function $do$f(client, id, api_version, options) {
12801
+ var _a, _b, _c;
12802
+ const input = {
12803
+ id: id,
12804
+ api_version: api_version,
12805
+ };
12806
+ const payload = input;
12807
+ const body = null;
12808
+ const pathParams = {
12809
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
12810
+ id: encodeSimple("id", payload.id, {
12811
+ explode: false,
12812
+ charEncoding: "percent",
12813
+ }),
12814
+ };
12815
+ const path = pathToFunc("/{api_version}/interactions/{id}")(pathParams);
12816
+ const headers = new Headers(compactMap({
12817
+ Accept: "application/json",
12818
+ }));
12819
+ const securityInput = await extractSecurity(client._options.security);
12820
+ const requestSecurity = resolveGlobalSecurity(securityInput);
12821
+ const context = {
12822
+ options: client._options,
12823
+ 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 : "",
12824
+ operation_id: "deleteInteraction",
12825
+ o_auth2_scopes: null,
12826
+ resolved_security: requestSecurity,
12827
+ security_source: client._options.security,
12828
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
12829
+ || client._options.retry_config
12830
+ || {
12831
+ strategy: "attempt-count-backoff",
12832
+ backoff: {
12833
+ initialInterval: 500,
12834
+ maxInterval: 8000,
12835
+ exponent: 2,
12836
+ maxElapsedTime: 30000,
12837
+ },
12838
+ retryConnectionErrors: true,
12839
+ maxRetries: 4,
12840
+ }
12841
+ || { strategy: "none" },
12842
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
12843
+ };
12844
+ const requestRes = client._createRequest(context, {
12845
+ security: requestSecurity,
12846
+ method: "DELETE",
12847
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
12848
+ path: path,
12849
+ headers: headers,
12850
+ body: body,
12851
+ userAgent: client._options.user_agent,
12852
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
12853
+ }, options);
12854
+ if (!requestRes.ok) {
12855
+ return [requestRes, { status: "invalid" }];
12856
+ }
12857
+ const req = requestRes.value;
12858
+ const doResult = await client._do(req, {
12859
+ context,
12860
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
12861
+ retryConfig: context.retry_config,
12862
+ retryCodes: context.retry_codes,
12863
+ });
12864
+ if (!doResult.ok) {
12865
+ return [doResult, { status: "request-error", request: req }];
12866
+ }
12867
+ const response = doResult.value;
12868
+ const responseFields = {
12869
+ httpMeta: { response: response, request: req },
12870
+ };
12871
+ const [result] = await match(nil(200), jsonErr("4XX", DeleteInteractionClientError), jsonErr("5XX", DeleteInteractionServerError))(response, req, { extraFields: responseFields });
12872
+ if (!result.ok) {
12873
+ return [result, { status: "complete", request: req, response }];
12874
+ }
12875
+ return [result, { status: "complete", request: req, response }];
12876
+ }
12877
+
12878
+ /**
12879
+ * @license
12880
+ * Copyright 2026 Google LLC
12881
+ * SPDX-License-Identifier: Apache-2.0
12882
+ *
12883
+ * g3-prettier-ignore-file
12884
+ */
12885
+ function interactionsGet(client, id, stream, last_event_id, include_input, api_version, options) {
12886
+ return new APIPromise($do$e(client, id, stream, last_event_id, include_input, api_version, options));
12887
+ }
12888
+ async function $do$e(client, id, stream, last_event_id, include_input, api_version, options) {
12889
+ var _a, _b, _c;
12890
+ const input = {
12891
+ id: id,
12892
+ stream: stream,
12893
+ last_event_id: last_event_id,
12894
+ include_input: include_input,
12895
+ api_version: api_version,
12896
+ };
12897
+ const payload = input;
12898
+ const body = null;
12899
+ const pathParams = {
12900
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
12901
+ id: encodeSimple("id", payload.id, {
12902
+ explode: false,
12903
+ charEncoding: "percent",
12904
+ }),
12905
+ };
12906
+ const path = pathToFunc("/{api_version}/interactions/{id}")(pathParams);
12907
+ const query = encodeFormQuery({
12908
+ "include_input": payload.include_input,
12909
+ "last_event_id": payload.last_event_id,
12910
+ "stream": payload.stream,
12911
+ });
12912
+ const headers = new Headers(compactMap({
12913
+ Accept: (input === null || input === void 0 ? void 0 : input.stream) ? "text/event-stream" : "application/json",
12914
+ }));
12915
+ const securityInput = await extractSecurity(client._options.security);
12916
+ const requestSecurity = resolveGlobalSecurity(securityInput);
12917
+ const context = {
12918
+ options: client._options,
12919
+ 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 : "",
12920
+ operation_id: "getInteractionById",
12921
+ o_auth2_scopes: null,
12922
+ resolved_security: requestSecurity,
12923
+ security_source: client._options.security,
12924
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
12925
+ || client._options.retry_config
12926
+ || {
12927
+ strategy: "attempt-count-backoff",
12928
+ backoff: {
12929
+ initialInterval: 500,
12930
+ maxInterval: 8000,
12931
+ exponent: 2,
12932
+ maxElapsedTime: 30000,
12933
+ },
12934
+ retryConnectionErrors: true,
12935
+ maxRetries: 4,
12936
+ }
12937
+ || { strategy: "none" },
12938
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
12939
+ };
12940
+ const requestRes = client._createRequest(context, {
12941
+ security: requestSecurity,
12942
+ method: "GET",
12943
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
12944
+ path: path,
12945
+ headers: headers,
12946
+ query: query,
12947
+ body: body,
12948
+ userAgent: client._options.user_agent,
12949
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
12950
+ }, options);
12951
+ if (!requestRes.ok) {
12952
+ return [requestRes, { status: "invalid" }];
12953
+ }
12954
+ const req = requestRes.value;
12955
+ const doResult = await client._do(req, {
12956
+ context,
12957
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
12958
+ retryConfig: context.retry_config,
12959
+ retryCodes: context.retry_codes,
12960
+ });
12961
+ if (!doResult.ok) {
12962
+ return [doResult, { status: "request-error", request: req }];
12963
+ }
12964
+ const response = doResult.value;
12965
+ const responseFields = {
12966
+ httpMeta: { response: response, request: req },
12967
+ };
12968
+ const [result] = await match(json(200), sse(200, {
12969
+ sentinel: "[DONE]",
12970
+ flattened: true,
12971
+ }), jsonErr("4XX", GetInteractionByIdClientError), jsonErr("5XX", GetInteractionByIdServerError))(response, req, { extraFields: responseFields });
12972
+ if (!result.ok) {
12973
+ return [result, { status: "complete", request: req, response }];
12974
+ }
12975
+ return [result, { status: "complete", request: req, response }];
12976
+ }
12977
+
12978
+ /**
12979
+ * @license
12980
+ * Copyright 2026 Google LLC
12981
+ * SPDX-License-Identifier: Apache-2.0
12982
+ *
12983
+ * g3-prettier-ignore-file
12984
+ */
12985
+ class Interactions extends ClientSDK {
12986
+ create(params, options) {
12987
+ const { api_version } = params, body = __rest(params, ["api_version"]);
12988
+ return unwrapAsAPIPromise(interactionsCreate(this, body, api_version, options));
12989
+ }
12990
+ get(id, params, options) {
12991
+ return unwrapAsAPIPromise(interactionsGet(this, id, params === null || params === void 0 ? void 0 : params.stream, params === null || params === void 0 ? void 0 : params.last_event_id, params === null || params === void 0 ? void 0 : params.include_input, params === null || params === void 0 ? void 0 : params.api_version, options));
12992
+ }
12993
+ /**
12994
+ * Deleting an interaction
12995
+ *
12996
+ * @remarks
12997
+ * Deletes the interaction by id.
12998
+ */
12999
+ delete(id, params, options) {
13000
+ return unwrapAsAPIPromise(interactionsDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
13001
+ }
13002
+ /**
13003
+ * Canceling an interaction
13004
+ *
13005
+ * @remarks
13006
+ * Cancels an interaction by id. This only applies to background interactions that are still running.
13007
+ */
13008
+ cancel(id, params, options) {
13009
+ return unwrapAsAPIPromise(interactionsCancel(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
13010
+ }
13011
+ }
13012
+
13013
+ /**
13014
+ * @license
13015
+ * Copyright 2026 Google LLC
13016
+ * SPDX-License-Identifier: Apache-2.0
13017
+ *
13018
+ * g3-prettier-ignore-file
13019
+ */
13020
+ /**
13021
+ * Creates a new trigger that will invoke the specified agent on the given cron schedule.
13022
+ */
13023
+ function triggersCreate(client, body, api_version, options) {
13024
+ return new APIPromise($do$d(client, body, api_version, options));
13025
+ }
13026
+ async function $do$d(client, body, api_version, options) {
13027
+ var _a, _b, _c;
13028
+ const input = {
13029
+ body: body,
13030
+ api_version: api_version,
13031
+ };
13032
+ const payload = input;
13033
+ const body$ = encodeJSON("body", payload.body, { explode: true });
13034
+ const pathParams = {
13035
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
13036
+ };
13037
+ const path = pathToFunc("/{api_version}/triggers")(pathParams);
13038
+ const headers = new Headers(compactMap({
13039
+ "Content-Type": "application/json",
13040
+ Accept: "application/json",
13041
+ }));
13042
+ const securityInput = await extractSecurity(client._options.security);
13043
+ const requestSecurity = resolveGlobalSecurity(securityInput);
13044
+ const context = {
13045
+ options: client._options,
13046
+ 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 : "",
13047
+ operation_id: "CreateTrigger",
13048
+ o_auth2_scopes: null,
13049
+ resolved_security: requestSecurity,
13050
+ security_source: client._options.security,
13051
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
13052
+ || client._options.retry_config
13053
+ || {
13054
+ strategy: "attempt-count-backoff",
13055
+ backoff: {
13056
+ initialInterval: 500,
13057
+ maxInterval: 8000,
13058
+ exponent: 2,
13059
+ maxElapsedTime: 30000,
13060
+ },
13061
+ retryConnectionErrors: true,
13062
+ maxRetries: 4,
13063
+ }
13064
+ || { strategy: "none" },
13065
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
13066
+ };
13067
+ const requestRes = client._createRequest(context, {
13068
+ security: requestSecurity,
13069
+ method: "POST",
13070
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
13071
+ path: path,
13072
+ headers: headers,
13073
+ body: body$,
13074
+ userAgent: client._options.user_agent,
13075
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
13076
+ }, options);
13077
+ if (!requestRes.ok) {
13078
+ return [requestRes, { status: "invalid" }];
13079
+ }
13080
+ const req = requestRes.value;
13081
+ const doResult = await client._do(req, {
13082
+ context,
13083
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
13084
+ retryConfig: context.retry_config,
13085
+ retryCodes: context.retry_codes,
13086
+ });
13087
+ if (!doResult.ok) {
13088
+ return [doResult, { status: "request-error", request: req }];
13089
+ }
13090
+ const response = doResult.value;
13091
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
13092
+ if (!result.ok) {
13093
+ return [result, { status: "complete", request: req, response }];
13094
+ }
13095
+ return [result, { status: "complete", request: req, response }];
13096
+ }
13097
+
13098
+ /**
13099
+ * @license
13100
+ * Copyright 2026 Google LLC
13101
+ * SPDX-License-Identifier: Apache-2.0
13102
+ *
13103
+ * g3-prettier-ignore-file
13104
+ */
13105
+ /**
13106
+ * Deletes a trigger.
13107
+ */
13108
+ function triggersDelete(client, id, api_version, options) {
13109
+ return new APIPromise($do$c(client, id, api_version, options));
13110
+ }
13111
+ async function $do$c(client, id, api_version, options) {
13112
+ var _a, _b, _c;
13113
+ const input = {
13114
+ id: id,
13115
+ api_version: api_version,
13116
+ };
13117
+ const payload = input;
13118
+ const body = null;
13119
+ const pathParams = {
13120
+ api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
13121
+ id: encodeSimple("id", payload.id, {
13122
+ explode: false,
13123
+ charEncoding: "percent",
13124
+ }),
13125
+ };
13126
+ const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
13127
+ const headers = new Headers(compactMap({
13128
+ Accept: "application/json",
13129
+ }));
13130
+ const securityInput = await extractSecurity(client._options.security);
13131
+ const requestSecurity = resolveGlobalSecurity(securityInput);
13132
+ const context = {
13133
+ options: client._options,
13134
+ 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 : "",
13135
+ operation_id: "DeleteTrigger",
13136
+ o_auth2_scopes: null,
13137
+ resolved_security: requestSecurity,
13138
+ security_source: client._options.security,
13139
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
13140
+ || client._options.retry_config
13141
+ || {
13142
+ strategy: "attempt-count-backoff",
13143
+ backoff: {
13144
+ initialInterval: 500,
13145
+ maxInterval: 8000,
13146
+ exponent: 2,
13147
+ maxElapsedTime: 30000,
13148
+ },
13149
+ retryConnectionErrors: true,
13150
+ maxRetries: 4,
13151
+ }
13152
+ || { strategy: "none" },
13153
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
13154
+ };
13155
+ const requestRes = client._createRequest(context, {
13156
+ security: requestSecurity,
13157
+ method: "DELETE",
13158
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
13159
+ path: path,
13160
+ headers: headers,
13161
+ body: body,
13162
+ userAgent: client._options.user_agent,
13163
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
13164
+ }, options);
13165
+ if (!requestRes.ok) {
13166
+ return [requestRes, { status: "invalid" }];
13167
+ }
13168
+ const req = requestRes.value;
13169
+ const doResult = await client._do(req, {
13170
+ context,
13171
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
13172
+ retryConfig: context.retry_config,
13173
+ retryCodes: context.retry_codes,
13174
+ });
13175
+ if (!doResult.ok) {
13176
+ return [doResult, { status: "request-error", request: req }];
13177
+ }
13178
+ const response = doResult.value;
13179
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
13180
+ if (!result.ok) {
13181
+ return [result, { status: "complete", request: req, response }];
13182
+ }
13183
+ return [result, { status: "complete", request: req, response }];
13184
+ }
13185
+
13186
+ /**
13187
+ * @license
13188
+ * Copyright 2026 Google LLC
13189
+ * SPDX-License-Identifier: Apache-2.0
13190
+ *
13191
+ * g3-prettier-ignore-file
13192
+ */
13193
+ /**
13194
+ * Gets details of a single trigger.
12615
13195
  */
12616
- function interactionsCancel(client, id, api_version, options) {
12617
- return new APIPromise($do$a(client, id, api_version, options));
13196
+ function triggersGet(client, id, api_version, options) {
13197
+ return new APIPromise($do$b(client, id, api_version, options));
12618
13198
  }
12619
- async function $do$a(client, id, api_version, options) {
13199
+ async function $do$b(client, id, api_version, options) {
12620
13200
  var _a, _b, _c;
12621
13201
  const input = {
12622
13202
  id: id,
@@ -12631,7 +13211,7 @@ async function $do$a(client, id, api_version, options) {
12631
13211
  charEncoding: "percent",
12632
13212
  }),
12633
13213
  };
12634
- const path = pathToFunc("/{api_version}/interactions/{id}/cancel")(pathParams);
13214
+ const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
12635
13215
  const headers = new Headers(compactMap({
12636
13216
  Accept: "application/json",
12637
13217
  }));
@@ -12640,7 +13220,7 @@ async function $do$a(client, id, api_version, options) {
12640
13220
  const context = {
12641
13221
  options: client._options,
12642
13222
  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 : "",
12643
- operation_id: "cancelInteractionById",
13223
+ operation_id: "GetTrigger",
12644
13224
  o_auth2_scopes: null,
12645
13225
  resolved_security: requestSecurity,
12646
13226
  security_source: client._options.security,
@@ -12662,7 +13242,7 @@ async function $do$a(client, id, api_version, options) {
12662
13242
  };
12663
13243
  const requestRes = client._createRequest(context, {
12664
13244
  security: requestSecurity,
12665
- method: "POST",
13245
+ method: "GET",
12666
13246
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
12667
13247
  path: path,
12668
13248
  headers: headers,
@@ -12684,10 +13264,7 @@ async function $do$a(client, id, api_version, options) {
12684
13264
  return [doResult, { status: "request-error", request: req }];
12685
13265
  }
12686
13266
  const response = doResult.value;
12687
- const responseFields = {
12688
- httpMeta: { response: response, request: req },
12689
- };
12690
- const [result] = await match(json(200), jsonErr("4XX", CancelInteractionByIdClientError), jsonErr("5XX", CancelInteractionByIdServerError))(response, req, { extraFields: responseFields });
13267
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
12691
13268
  if (!result.ok) {
12692
13269
  return [result, { status: "complete", request: req, response }];
12693
13270
  }
@@ -12701,31 +13278,43 @@ async function $do$a(client, id, api_version, options) {
12701
13278
  *
12702
13279
  * g3-prettier-ignore-file
12703
13280
  */
12704
- function interactionsCreate(client, body, api_version, options) {
12705
- return new APIPromise($do$9(client, body, api_version, options));
13281
+ /**
13282
+ * Lists executions for a trigger.
13283
+ */
13284
+ function triggersListExecutions(client, trigger_id, api_version, page_size, page_token, options) {
13285
+ return new APIPromise($do$a(client, trigger_id, api_version, page_size, page_token, options));
12706
13286
  }
12707
- async function $do$9(client, body, api_version, options) {
12708
- var _a, _b, _c, _d;
13287
+ async function $do$a(client, trigger_id, api_version, page_size, page_token, options) {
13288
+ var _a, _b, _c;
12709
13289
  const input = {
12710
- body: body,
13290
+ trigger_id: trigger_id,
12711
13291
  api_version: api_version,
13292
+ page_size: page_size,
13293
+ page_token: page_token,
12712
13294
  };
12713
13295
  const payload = input;
12714
- const body$ = encodeJSON("body", payload.body, { explode: true });
13296
+ const body = null;
12715
13297
  const pathParams = {
12716
13298
  api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
13299
+ trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
13300
+ explode: false,
13301
+ charEncoding: "percent",
13302
+ }),
12717
13303
  };
12718
- const path = pathToFunc("/{api_version}/interactions")(pathParams);
13304
+ const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
13305
+ const query = encodeFormQuery({
13306
+ "page_size": payload.page_size,
13307
+ "page_token": payload.page_token,
13308
+ });
12719
13309
  const headers = new Headers(compactMap({
12720
- "Content-Type": "application/json",
12721
- Accept: ((_b = input === null || input === void 0 ? void 0 : input.body) === null || _b === void 0 ? void 0 : _b.stream) ? "text/event-stream" : "application/json",
13310
+ Accept: "application/json",
12722
13311
  }));
12723
13312
  const securityInput = await extractSecurity(client._options.security);
12724
13313
  const requestSecurity = resolveGlobalSecurity(securityInput);
12725
13314
  const context = {
12726
13315
  options: client._options,
12727
- base_url: (_d = (_c = options === null || options === void 0 ? void 0 : options.server_url) !== null && _c !== void 0 ? _c : client._baseURL) !== null && _d !== void 0 ? _d : "",
12728
- operation_id: "CreateInteraction",
13316
+ 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 : "",
13317
+ operation_id: "ListTriggerExecutions",
12729
13318
  o_auth2_scopes: null,
12730
13319
  resolved_security: requestSecurity,
12731
13320
  security_source: client._options.security,
@@ -12747,11 +13336,12 @@ async function $do$9(client, body, api_version, options) {
12747
13336
  };
12748
13337
  const requestRes = client._createRequest(context, {
12749
13338
  security: requestSecurity,
12750
- method: "POST",
13339
+ method: "GET",
12751
13340
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
12752
13341
  path: path,
12753
13342
  headers: headers,
12754
- body: body$,
13343
+ query: query,
13344
+ body: body,
12755
13345
  userAgent: client._options.user_agent,
12756
13346
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
12757
13347
  }, options);
@@ -12769,13 +13359,7 @@ async function $do$9(client, body, api_version, options) {
12769
13359
  return [doResult, { status: "request-error", request: req }];
12770
13360
  }
12771
13361
  const response = doResult.value;
12772
- const responseFields = {
12773
- httpMeta: { response: response, request: req },
12774
- };
12775
- const [result] = await match(json(200), sse(200, {
12776
- sentinel: "[DONE]",
12777
- flattened: true,
12778
- }), jsonErr("4XX", CreateInteractionClientError), jsonErr("5XX", CreateInteractionServerError))(response, req, { extraFields: responseFields });
13362
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
12779
13363
  if (!result.ok) {
12780
13364
  return [result, { status: "complete", request: req, response }];
12781
13365
  }
@@ -12790,30 +13374,119 @@ async function $do$9(client, body, api_version, options) {
12790
13374
  * g3-prettier-ignore-file
12791
13375
  */
12792
13376
  /**
12793
- * Deleting an interaction
13377
+ * Lists triggers for a project.
13378
+ */
13379
+ function triggersList(client, api_version, filter, page_size, page_token, options) {
13380
+ return new APIPromise($do$9(client, api_version, filter, page_size, page_token, options));
13381
+ }
13382
+ async function $do$9(client, api_version, filter, page_size, page_token, options) {
13383
+ var _a, _b, _c;
13384
+ const input = {
13385
+ api_version: api_version,
13386
+ filter: filter,
13387
+ page_size: page_size,
13388
+ page_token: page_token,
13389
+ };
13390
+ const payload = input;
13391
+ const body = null;
13392
+ const pathParams = {
13393
+ 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" }),
13394
+ };
13395
+ const path = pathToFunc("/{api_version}/triggers")(pathParams);
13396
+ const query = encodeFormQuery({
13397
+ "filter": payload === null || payload === void 0 ? void 0 : payload.filter,
13398
+ "page_size": payload === null || payload === void 0 ? void 0 : payload.page_size,
13399
+ "page_token": payload === null || payload === void 0 ? void 0 : payload.page_token,
13400
+ });
13401
+ const headers = new Headers(compactMap({
13402
+ Accept: "application/json",
13403
+ }));
13404
+ const securityInput = await extractSecurity(client._options.security);
13405
+ const requestSecurity = resolveGlobalSecurity(securityInput);
13406
+ const context = {
13407
+ options: client._options,
13408
+ 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 : "",
13409
+ operation_id: "ListTriggers",
13410
+ o_auth2_scopes: null,
13411
+ resolved_security: requestSecurity,
13412
+ security_source: client._options.security,
13413
+ retry_config: (options === null || options === void 0 ? void 0 : options.retries)
13414
+ || client._options.retry_config
13415
+ || {
13416
+ strategy: "attempt-count-backoff",
13417
+ backoff: {
13418
+ initialInterval: 500,
13419
+ maxInterval: 8000,
13420
+ exponent: 2,
13421
+ maxElapsedTime: 30000,
13422
+ },
13423
+ retryConnectionErrors: true,
13424
+ maxRetries: 4,
13425
+ }
13426
+ || { strategy: "none" },
13427
+ retry_codes: (options === null || options === void 0 ? void 0 : options.retry_codes) || ["408", "409", "429", "5XX"],
13428
+ };
13429
+ const requestRes = client._createRequest(context, {
13430
+ security: requestSecurity,
13431
+ method: "GET",
13432
+ baseURL: options === null || options === void 0 ? void 0 : options.server_url,
13433
+ path: path,
13434
+ headers: headers,
13435
+ query: query,
13436
+ body: body,
13437
+ userAgent: client._options.user_agent,
13438
+ timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
13439
+ }, options);
13440
+ if (!requestRes.ok) {
13441
+ return [requestRes, { status: "invalid" }];
13442
+ }
13443
+ const req = requestRes.value;
13444
+ const doResult = await client._do(req, {
13445
+ context,
13446
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
13447
+ retryConfig: context.retry_config,
13448
+ retryCodes: context.retry_codes,
13449
+ });
13450
+ if (!doResult.ok) {
13451
+ return [doResult, { status: "request-error", request: req }];
13452
+ }
13453
+ const response = doResult.value;
13454
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
13455
+ if (!result.ok) {
13456
+ return [result, { status: "complete", request: req, response }];
13457
+ }
13458
+ return [result, { status: "complete", request: req, response }];
13459
+ }
13460
+
13461
+ /**
13462
+ * @license
13463
+ * Copyright 2026 Google LLC
13464
+ * SPDX-License-Identifier: Apache-2.0
12794
13465
  *
12795
- * @remarks
12796
- * Deletes the interaction by id.
13466
+ * g3-prettier-ignore-file
12797
13467
  */
12798
- function interactionsDelete(client, id, api_version, options) {
12799
- return new APIPromise($do$8(client, id, api_version, options));
13468
+ /**
13469
+ * Runs a trigger immediately.
13470
+ */
13471
+ function triggersRun(client, trigger_id, api_version, options) {
13472
+ return new APIPromise($do$8(client, trigger_id, api_version, options));
12800
13473
  }
12801
- async function $do$8(client, id, api_version, options) {
13474
+ async function $do$8(client, trigger_id, api_version, options) {
12802
13475
  var _a, _b, _c;
12803
13476
  const input = {
12804
- id: id,
13477
+ trigger_id: trigger_id,
12805
13478
  api_version: api_version,
12806
13479
  };
12807
13480
  const payload = input;
12808
13481
  const body = null;
12809
13482
  const pathParams = {
12810
13483
  api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
12811
- id: encodeSimple("id", payload.id, {
13484
+ trigger_id: encodeSimple("trigger_id", payload.trigger_id, {
12812
13485
  explode: false,
12813
13486
  charEncoding: "percent",
12814
13487
  }),
12815
13488
  };
12816
- const path = pathToFunc("/{api_version}/interactions/{id}")(pathParams);
13489
+ const path = pathToFunc("/{api_version}/triggers/{trigger_id}/executions")(pathParams);
12817
13490
  const headers = new Headers(compactMap({
12818
13491
  Accept: "application/json",
12819
13492
  }));
@@ -12822,7 +13495,7 @@ async function $do$8(client, id, api_version, options) {
12822
13495
  const context = {
12823
13496
  options: client._options,
12824
13497
  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 : "",
12825
- operation_id: "deleteInteraction",
13498
+ operation_id: "RunTrigger",
12826
13499
  o_auth2_scopes: null,
12827
13500
  resolved_security: requestSecurity,
12828
13501
  security_source: client._options.security,
@@ -12844,7 +13517,7 @@ async function $do$8(client, id, api_version, options) {
12844
13517
  };
12845
13518
  const requestRes = client._createRequest(context, {
12846
13519
  security: requestSecurity,
12847
- method: "DELETE",
13520
+ method: "POST",
12848
13521
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
12849
13522
  path: path,
12850
13523
  headers: headers,
@@ -12866,10 +13539,7 @@ async function $do$8(client, id, api_version, options) {
12866
13539
  return [doResult, { status: "request-error", request: req }];
12867
13540
  }
12868
13541
  const response = doResult.value;
12869
- const responseFields = {
12870
- httpMeta: { response: response, request: req },
12871
- };
12872
- const [result] = await match(nil(200), jsonErr("4XX", DeleteInteractionClientError), jsonErr("5XX", DeleteInteractionServerError))(response, req, { extraFields: responseFields });
13542
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
12873
13543
  if (!result.ok) {
12874
13544
  return [result, { status: "complete", request: req, response }];
12875
13545
  }
@@ -12883,20 +13553,21 @@ async function $do$8(client, id, api_version, options) {
12883
13553
  *
12884
13554
  * g3-prettier-ignore-file
12885
13555
  */
12886
- function interactionsGet(client, id, stream, last_event_id, include_input, api_version, options) {
12887
- return new APIPromise($do$7(client, id, stream, last_event_id, include_input, api_version, options));
13556
+ /**
13557
+ * Updates a trigger.
13558
+ */
13559
+ function triggersUpdate(client, id, body, api_version, options) {
13560
+ return new APIPromise($do$7(client, id, body, api_version, options));
12888
13561
  }
12889
- async function $do$7(client, id, stream, last_event_id, include_input, api_version, options) {
13562
+ async function $do$7(client, id, body, api_version, options) {
12890
13563
  var _a, _b, _c;
12891
13564
  const input = {
12892
13565
  id: id,
12893
- stream: stream,
12894
- last_event_id: last_event_id,
12895
- include_input: include_input,
13566
+ body: body,
12896
13567
  api_version: api_version,
12897
13568
  };
12898
13569
  const payload = input;
12899
- const body = null;
13570
+ const body$ = encodeJSON("body", payload.body, { explode: true });
12900
13571
  const pathParams = {
12901
13572
  api_version: encodeSimple("api_version", (_a = payload.api_version) !== null && _a !== void 0 ? _a : client._options.api_version, { explode: false, charEncoding: "percent" }),
12902
13573
  id: encodeSimple("id", payload.id, {
@@ -12904,21 +13575,17 @@ async function $do$7(client, id, stream, last_event_id, include_input, api_versi
12904
13575
  charEncoding: "percent",
12905
13576
  }),
12906
13577
  };
12907
- const path = pathToFunc("/{api_version}/interactions/{id}")(pathParams);
12908
- const query = encodeFormQuery({
12909
- "include_input": payload.include_input,
12910
- "last_event_id": payload.last_event_id,
12911
- "stream": payload.stream,
12912
- });
13578
+ const path = pathToFunc("/{api_version}/triggers/{id}")(pathParams);
12913
13579
  const headers = new Headers(compactMap({
12914
- Accept: (input === null || input === void 0 ? void 0 : input.stream) ? "text/event-stream" : "application/json",
13580
+ "Content-Type": "application/json",
13581
+ Accept: "application/json",
12915
13582
  }));
12916
13583
  const securityInput = await extractSecurity(client._options.security);
12917
13584
  const requestSecurity = resolveGlobalSecurity(securityInput);
12918
13585
  const context = {
12919
13586
  options: client._options,
12920
13587
  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 : "",
12921
- operation_id: "getInteractionById",
13588
+ operation_id: "UpdateTrigger",
12922
13589
  o_auth2_scopes: null,
12923
13590
  resolved_security: requestSecurity,
12924
13591
  security_source: client._options.security,
@@ -12940,12 +13607,11 @@ async function $do$7(client, id, stream, last_event_id, include_input, api_versi
12940
13607
  };
12941
13608
  const requestRes = client._createRequest(context, {
12942
13609
  security: requestSecurity,
12943
- method: "GET",
13610
+ method: "PATCH",
12944
13611
  baseURL: options === null || options === void 0 ? void 0 : options.server_url,
12945
13612
  path: path,
12946
13613
  headers: headers,
12947
- query: query,
12948
- body: body,
13614
+ body: body$,
12949
13615
  userAgent: client._options.user_agent,
12950
13616
  timeout_ms: (options === null || options === void 0 ? void 0 : options.timeout_ms) || client._options.timeout_ms || -1,
12951
13617
  }, options);
@@ -12963,13 +13629,7 @@ async function $do$7(client, id, stream, last_event_id, include_input, api_versi
12963
13629
  return [doResult, { status: "request-error", request: req }];
12964
13630
  }
12965
13631
  const response = doResult.value;
12966
- const responseFields = {
12967
- httpMeta: { response: response, request: req },
12968
- };
12969
- const [result] = await match(json(200), sse(200, {
12970
- sentinel: "[DONE]",
12971
- flattened: true,
12972
- }), jsonErr("4XX", GetInteractionByIdClientError), jsonErr("5XX", GetInteractionByIdServerError))(response, req, { extraFields: responseFields });
13632
+ const [result] = await match(json(200), fail("4XX"), fail("5XX"))(response, req);
12973
13633
  if (!result.ok) {
12974
13634
  return [result, { status: "complete", request: req, response }];
12975
13635
  }
@@ -12983,31 +13643,50 @@ async function $do$7(client, id, stream, last_event_id, include_input, api_versi
12983
13643
  *
12984
13644
  * g3-prettier-ignore-file
12985
13645
  */
12986
- class Interactions extends ClientSDK {
13646
+ class Triggers extends ClientSDK {
13647
+ /**
13648
+ * Creates a new trigger that will invoke the specified agent on the given cron schedule.
13649
+ */
12987
13650
  create(params, options) {
12988
13651
  const { api_version } = params, body = __rest(params, ["api_version"]);
12989
- return unwrapAsAPIPromise(interactionsCreate(this, body, api_version, options));
13652
+ return unwrapAsAPIPromise(triggersCreate(this, body, api_version, options));
13653
+ }
13654
+ /**
13655
+ * Lists triggers for a project.
13656
+ */
13657
+ list(params, options) {
13658
+ 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));
12990
13659
  }
13660
+ /**
13661
+ * Gets details of a single trigger.
13662
+ */
12991
13663
  get(id, params, options) {
12992
- return unwrapAsAPIPromise(interactionsGet(this, id, params === null || params === void 0 ? void 0 : params.stream, params === null || params === void 0 ? void 0 : params.last_event_id, params === null || params === void 0 ? void 0 : params.include_input, params === null || params === void 0 ? void 0 : params.api_version, options));
13664
+ return unwrapAsAPIPromise(triggersGet(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
12993
13665
  }
12994
13666
  /**
12995
- * Deleting an interaction
12996
- *
12997
- * @remarks
12998
- * Deletes the interaction by id.
13667
+ * Updates a trigger.
13668
+ */
13669
+ update(id, params, options) {
13670
+ const { api_version } = params, body = __rest(params, ["api_version"]);
13671
+ return unwrapAsAPIPromise(triggersUpdate(this, id, body, api_version, options));
13672
+ }
13673
+ /**
13674
+ * Deletes a trigger.
12999
13675
  */
13000
13676
  delete(id, params, options) {
13001
- return unwrapAsAPIPromise(interactionsDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
13677
+ return unwrapAsAPIPromise(triggersDelete(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
13002
13678
  }
13003
13679
  /**
13004
- * Canceling an interaction
13005
- *
13006
- * @remarks
13007
- * Cancels an interaction by id. This only applies to background interactions that are still running.
13680
+ * Runs a trigger immediately.
13008
13681
  */
13009
- cancel(id, params, options) {
13010
- return unwrapAsAPIPromise(interactionsCancel(this, id, params === null || params === void 0 ? void 0 : params.api_version, options));
13682
+ run(trigger_id, params, options) {
13683
+ return unwrapAsAPIPromise(triggersRun(this, trigger_id, params === null || params === void 0 ? void 0 : params.api_version, options));
13684
+ }
13685
+ /**
13686
+ * Lists executions for a trigger.
13687
+ */
13688
+ listExecutions(trigger_id, params, options) {
13689
+ 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));
13011
13690
  }
13012
13691
  }
13013
13692
 
@@ -13717,6 +14396,10 @@ let GoogleGenAI$1 = class GoogleGenAI extends ClientSDK {
13717
14396
  var _a;
13718
14397
  return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Agents(this._options)));
13719
14398
  }
14399
+ get triggers() {
14400
+ var _a;
14401
+ return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Triggers(this._options)));
14402
+ }
13720
14403
  };
13721
14404
 
13722
14405
  /**
@@ -13748,11 +14431,11 @@ function getGoogleGenAIAPIVersion(parentClient) {
13748
14431
  return apiVersion;
13749
14432
  }
13750
14433
  function buildGoogleGenAIClient(parentClient, options = {}) {
13751
- var _a, _b, _c, _d;
14434
+ var _a, _b, _c, _d, _e;
13752
14435
  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({
13753
- defaultHeaders: (_c = parentClient.getDefaultHeaders) === null || _c === void 0 ? void 0 : _c.call(parentClient),
14436
+ 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)),
13754
14437
  getAuthHeaders: (url) => parentClient.getAuthHeaders(url),
13755
- }), server_url: (_d = options.server_url) !== null && _d !== void 0 ? _d : getGoogleGenAIServerURL(parentClient) }));
14438
+ }), server_url: (_e = options.server_url) !== null && _e !== void 0 ? _e : getGoogleGenAIServerURL(parentClient) }));
13756
14439
  return sdk;
13757
14440
  }
13758
14441
  class GeminiNextGenInteractions {
@@ -13859,6 +14542,46 @@ class GeminiNextGenWebhooks {
13859
14542
  return this.sdk;
13860
14543
  }
13861
14544
  }
14545
+ class GeminiNextGenTriggers {
14546
+ constructor(parentClient) {
14547
+ this.parentClient = parentClient;
14548
+ }
14549
+ async create(params, options) {
14550
+ const { api_version } = params, body = __rest(params, ["api_version"]);
14551
+ return unwrapWithSdkHttpResponse(triggersCreate(this.getClient(api_version), body, api_version, toGoogleGenAIRequestOptions(options)));
14552
+ }
14553
+ async list(params = {}, options) {
14554
+ const { api_version, filter, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
14555
+ return unwrapWithSdkHttpResponse(triggersList(this.getClient(api_version), api_version, filter, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
14556
+ }
14557
+ async get(id, params = {}, options) {
14558
+ 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)));
14559
+ }
14560
+ async update(id, params, options) {
14561
+ const { api_version } = params, body = __rest(params, ["api_version"]);
14562
+ return unwrapWithSdkHttpResponse(triggersUpdate(this.getClient(api_version), id, body, api_version, toGoogleGenAIRequestOptions(options)));
14563
+ }
14564
+ async delete(id, params = {}, options) {
14565
+ 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)));
14566
+ }
14567
+ async run(trigger_id, params = {}, options) {
14568
+ 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)));
14569
+ }
14570
+ async listExecutions(trigger_id, params = {}, options) {
14571
+ const { api_version, pageSize, pageToken } = params !== null && params !== void 0 ? params : {};
14572
+ return unwrapWithSdkHttpResponse(triggersListExecutions(this.getClient(api_version), trigger_id, api_version, pageSize, pageToken, toGoogleGenAIRequestOptions(options)));
14573
+ }
14574
+ getClient(apiVersion) {
14575
+ var _a;
14576
+ if (apiVersion) {
14577
+ return buildGoogleGenAIClient(this.parentClient, {
14578
+ api_version: apiVersion,
14579
+ });
14580
+ }
14581
+ (_a = this.sdk) !== null && _a !== void 0 ? _a : (this.sdk = buildGoogleGenAIClient(this.parentClient));
14582
+ return this.sdk;
14583
+ }
14584
+ }
13862
14585
  function trimSlashes(value) {
13863
14586
  return value.replace(/^\/+|\/+$/g, "");
13864
14587
  }
@@ -14107,6 +14830,12 @@ function audioTranscriptionConfigToMldev$1(fromObject) {
14107
14830
  if (fromLanguageHints != null) {
14108
14831
  setValueByPath(toObject, ['languageHints'], fromLanguageHints);
14109
14832
  }
14833
+ const fromCustomVocabulary = getValueByPath(fromObject, [
14834
+ 'customVocabulary',
14835
+ ]);
14836
+ if (fromCustomVocabulary != null) {
14837
+ setValueByPath(toObject, ['customVocabulary'], fromCustomVocabulary);
14838
+ }
14110
14839
  const fromAdaptationPhrases = getValueByPath(fromObject, [
14111
14840
  'adaptationPhrases',
14112
14841
  ]);
@@ -15646,6 +16375,18 @@ function contentEmbeddingStatisticsFromVertex(fromObject, _rootObject) {
15646
16375
  if (fromTokenCount != null) {
15647
16376
  setValueByPath(toObject, ['tokenCount'], fromTokenCount);
15648
16377
  }
16378
+ const fromTokensDetails = getValueByPath(fromObject, [
16379
+ 'tokensDetails',
16380
+ ]);
16381
+ if (fromTokensDetails != null) {
16382
+ let transformedList = fromTokensDetails;
16383
+ if (Array.isArray(transformedList)) {
16384
+ transformedList = transformedList.map((item) => {
16385
+ return item;
16386
+ });
16387
+ }
16388
+ setValueByPath(toObject, ['tokensDetails'], transformedList);
16389
+ }
15649
16390
  return toObject;
15650
16391
  }
15651
16392
  function contentToMldev$1(fromObject, rootObject) {
@@ -16275,6 +17016,10 @@ function embedContentResponseFromVertex(fromObject, rootObject) {
16275
17016
  usageMetadata['promptTokenCount']) {
16276
17017
  stats.tokenCount = usageMetadata['promptTokenCount'];
16277
17018
  }
17019
+ if (usageMetadata &&
17020
+ usageMetadata['promptTokensDetails']) {
17021
+ stats.tokensDetails = usageMetadata['promptTokensDetails'];
17022
+ }
16278
17023
  if (truncated) {
16279
17024
  stats.truncated = truncated;
16280
17025
  }
@@ -21875,6 +22620,12 @@ function audioTranscriptionConfigToMldev(fromObject) {
21875
22620
  if (fromLanguageHints != null) {
21876
22621
  setValueByPath(toObject, ['languageHints'], fromLanguageHints);
21877
22622
  }
22623
+ const fromCustomVocabulary = getValueByPath(fromObject, [
22624
+ 'customVocabulary',
22625
+ ]);
22626
+ if (fromCustomVocabulary != null) {
22627
+ setValueByPath(toObject, ['customVocabulary'], fromCustomVocabulary);
22628
+ }
21878
22629
  const fromAdaptationPhrases = getValueByPath(fromObject, [
21879
22630
  'adaptationPhrases',
21880
22631
  ]);
@@ -24554,6 +25305,14 @@ class GoogleGenAI {
24554
25305
  this._agents = new GeminiNextGenAgents(this.apiClient);
24555
25306
  return this._agents;
24556
25307
  }
25308
+ get triggers() {
25309
+ if (this._triggers !== undefined) {
25310
+ return this._triggers;
25311
+ }
25312
+ console.warn('GoogleGenAI.triggers: Triggers usage is experimental and may change in future versions.');
25313
+ this._triggers = new GeminiNextGenTriggers(this.apiClient);
25314
+ return this._triggers;
25315
+ }
24557
25316
  constructor(options) {
24558
25317
  var _a, _b;
24559
25318
  if (options.apiKey == null) {