@@ -45,7 +45,7 @@ export class Documents {
4545 /**
4646 * List Documents
4747 *
48- * @param {Corti.Uuid } id - The unique identifier of the interaction . Must be a valid UUID.
48+ * @param {string } id - The interaction ID representing the context for the request . Must be a valid UUID.
4949 * @param {Documents.RequestOptions } requestOptions - Request-specific configuration.
5050 *
5151 * @throws {@link Corti.BadRequestError }
@@ -54,24 +54,24 @@ export class Documents {
5454 * @throws {@link Corti.GatewayTimeoutError }
5555 *
5656 * @example
57- * await client.documents.list("f47ac10b-58cc-4372-a567-0e02b2c3d479 ")
57+ * await client.documents.listDocuments("id ")
5858 */
59- public list (
60- id : Corti . Uuid ,
59+ public listDocuments (
60+ id : string ,
6161 requestOptions ?: Documents . RequestOptions ,
6262 ) : core . HttpResponsePromise < Corti . DocumentsListResponse > {
63- return core . HttpResponsePromise . fromPromise ( this . __list ( id , requestOptions ) ) ;
63+ return core . HttpResponsePromise . fromPromise ( this . __listDocuments ( id , requestOptions ) ) ;
6464 }
6565
66- private async __list (
67- id : Corti . Uuid ,
66+ private async __listDocuments (
67+ id : string ,
6868 requestOptions ?: Documents . RequestOptions ,
6969 ) : Promise < core . WithRawResponse < Corti . DocumentsListResponse > > {
7070 const _response = await core . fetcher ( {
7171 url : core . url . join (
7272 ( await core . Supplier . get ( this . _options . baseUrl ) ) ??
7373 ( await core . Supplier . get ( this . _options . environment ) ) . base ,
74- `interactions/${ encodeURIComponent ( serializers . Uuid . jsonOrThrow ( id , { omitUndefined : true } ) ) } /documents/` ,
74+ `interactions/${ encodeURIComponent ( id ) } /documents/` ,
7575 ) ,
7676 method : "GET" ,
7777 headers : mergeHeaders (
@@ -156,7 +156,7 @@ export class Documents {
156156 /**
157157 * Generate Document.
158158 *
159- * @param {Corti.Uuid } id - The unique identifier of the interaction . Must be a valid UUID.
159+ * @param {string } id - The interaction ID representing the context for the request . Must be a valid UUID.
160160 * @param {Corti.DocumentsCreateRequest } request
161161 * @param {Documents.RequestOptions } requestOptions - Request-specific configuration.
162162 *
@@ -166,36 +166,30 @@ export class Documents {
166166 * @throws {@link Corti.GatewayTimeoutError }
167167 *
168168 * @example
169- * await client.documents.create("f47ac10b-58cc-4372-a567-0e02b2c3d479", {
170- * context: [{
171- * type: "facts",
172- * data: [{
173- * text: "text",
174- * source: "core"
175- * }]
176- * }],
169+ * await client.documents.generateDocument("id", {
170+ * context: [],
177171 * templateKey: "templateKey",
178172 * outputLanguage: "outputLanguage"
179173 * })
180174 */
181- public create (
182- id : Corti . Uuid ,
175+ public generateDocument (
176+ id : string ,
183177 request : Corti . DocumentsCreateRequest ,
184178 requestOptions ?: Documents . RequestOptions ,
185179 ) : core . HttpResponsePromise < Corti . DocumentsGetResponse > {
186- return core . HttpResponsePromise . fromPromise ( this . __create ( id , request , requestOptions ) ) ;
180+ return core . HttpResponsePromise . fromPromise ( this . __generateDocument ( id , request , requestOptions ) ) ;
187181 }
188182
189- private async __create (
190- id : Corti . Uuid ,
183+ private async __generateDocument (
184+ id : string ,
191185 request : Corti . DocumentsCreateRequest ,
192186 requestOptions ?: Documents . RequestOptions ,
193187 ) : Promise < core . WithRawResponse < Corti . DocumentsGetResponse > > {
194188 const _response = await core . fetcher ( {
195189 url : core . url . join (
196190 ( await core . Supplier . get ( this . _options . baseUrl ) ) ??
197191 ( await core . Supplier . get ( this . _options . environment ) ) . base ,
198- `interactions/${ encodeURIComponent ( serializers . Uuid . jsonOrThrow ( id , { omitUndefined : true } ) ) } /documents/` ,
192+ `interactions/${ encodeURIComponent ( id ) } /documents/` ,
199193 ) ,
200194 method : "POST" ,
201195 headers : mergeHeaders (
@@ -286,8 +280,9 @@ export class Documents {
286280 /**
287281 * Get Document.
288282 *
289- * @param {Corti.Uuid } id - The unique identifier of the interaction. Must be a valid UUID.
290- * @param {Corti.Uuid } documentId - The document ID representing the context for the request. Must be a valid UUID.
283+ * @param {string } id - The interaction ID representing the context for the request. Must be a valid UUID.
284+ * @param {string } documentId - The document ID representing the context for the request. Must be a valid UUID.
285+ * @param {Corti.GetInteractionsIdDocumentsDocumentIdRequest } request
291286 * @param {Documents.RequestOptions } requestOptions - Request-specific configuration.
292287 *
293288 * @throws {@link Corti.BadRequestError }
@@ -296,26 +291,34 @@ export class Documents {
296291 * @throws {@link Corti.GatewayTimeoutError }
297292 *
298293 * @example
299- * await client.documents.get("f47ac10b-58cc-4372-a567-0e02b2c3d479 ", "f47ac10b-58cc-4372-a567-0e02b2c3d479 ")
294+ * await client.documents.getDocument("id ", "documentId ")
300295 */
301- public get (
302- id : Corti . Uuid ,
303- documentId : Corti . Uuid ,
296+ public getDocument (
297+ id : string ,
298+ documentId : string ,
299+ request : Corti . GetInteractionsIdDocumentsDocumentIdRequest = { } ,
304300 requestOptions ?: Documents . RequestOptions ,
305301 ) : core . HttpResponsePromise < Corti . DocumentsGetResponse > {
306- return core . HttpResponsePromise . fromPromise ( this . __get ( id , documentId , requestOptions ) ) ;
302+ return core . HttpResponsePromise . fromPromise ( this . __getDocument ( id , documentId , request , requestOptions ) ) ;
307303 }
308304
309- private async __get (
310- id : Corti . Uuid ,
311- documentId : Corti . Uuid ,
305+ private async __getDocument (
306+ id : string ,
307+ documentId : string ,
308+ request : Corti . GetInteractionsIdDocumentsDocumentIdRequest = { } ,
312309 requestOptions ?: Documents . RequestOptions ,
313310 ) : Promise < core . WithRawResponse < Corti . DocumentsGetResponse > > {
311+ const { context } = request ;
312+ const _queryParams : Record < string , string | string [ ] | object | object [ ] | null > = { } ;
313+ if ( context !== undefined ) {
314+ _queryParams [ "context" ] = context ?. toString ( ) ?? null ;
315+ }
316+
314317 const _response = await core . fetcher ( {
315318 url : core . url . join (
316319 ( await core . Supplier . get ( this . _options . baseUrl ) ) ??
317320 ( await core . Supplier . get ( this . _options . environment ) ) . base ,
318- `interactions/${ encodeURIComponent ( serializers . Uuid . jsonOrThrow ( id , { omitUndefined : true } ) ) } /documents/${ encodeURIComponent ( serializers . Uuid . jsonOrThrow ( documentId , { omitUndefined : true } ) ) } ` ,
321+ `interactions/${ encodeURIComponent ( id ) } /documents/${ encodeURIComponent ( documentId ) } ` ,
319322 ) ,
320323 method : "GET" ,
321324 headers : mergeHeaders (
@@ -326,6 +329,7 @@ export class Documents {
326329 } ) ,
327330 requestOptions ?. headers ,
328331 ) ,
332+ queryParameters : _queryParams ,
329333 timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 60000 ,
330334 maxRetries : requestOptions ?. maxRetries ,
331335 abortSignal : requestOptions ?. abortSignal ,
@@ -400,8 +404,8 @@ export class Documents {
400404 }
401405
402406 /**
403- * @param {Corti.Uuid } id - The unique identifier of the interaction . Must be a valid UUID.
404- * @param {Corti.Uuid } documentId - The document ID representing the context for the request. Must be a valid UUID.
407+ * @param {string } id - The interaction ID representing the context for the request . Must be a valid UUID.
408+ * @param {string } documentId - The document ID representing the context for the request. Must be a valid UUID.
405409 * @param {Documents.RequestOptions } requestOptions - Request-specific configuration.
406410 *
407411 * @throws {@link Corti.ForbiddenError }
@@ -410,26 +414,26 @@ export class Documents {
410414 * @throws {@link Corti.GatewayTimeoutError }
411415 *
412416 * @example
413- * await client.documents.delete("f47ac10b-58cc-4372-a567-0e02b2c3d479 ", "f47ac10b-58cc-4372-a567-0e02b2c3d479 ")
417+ * await client.documents.deleteDocument("id ", "documentId ")
414418 */
415- public delete (
416- id : Corti . Uuid ,
417- documentId : Corti . Uuid ,
419+ public deleteDocument (
420+ id : string ,
421+ documentId : string ,
418422 requestOptions ?: Documents . RequestOptions ,
419423 ) : core . HttpResponsePromise < void > {
420- return core . HttpResponsePromise . fromPromise ( this . __delete ( id , documentId , requestOptions ) ) ;
424+ return core . HttpResponsePromise . fromPromise ( this . __deleteDocument ( id , documentId , requestOptions ) ) ;
421425 }
422426
423- private async __delete (
424- id : Corti . Uuid ,
425- documentId : Corti . Uuid ,
427+ private async __deleteDocument (
428+ id : string ,
429+ documentId : string ,
426430 requestOptions ?: Documents . RequestOptions ,
427431 ) : Promise < core . WithRawResponse < void > > {
428432 const _response = await core . fetcher ( {
429433 url : core . url . join (
430434 ( await core . Supplier . get ( this . _options . baseUrl ) ) ??
431435 ( await core . Supplier . get ( this . _options . environment ) ) . base ,
432- `interactions/${ encodeURIComponent ( serializers . Uuid . jsonOrThrow ( id , { omitUndefined : true } ) ) } /documents/${ encodeURIComponent ( serializers . Uuid . jsonOrThrow ( documentId , { omitUndefined : true } ) ) } ` ,
436+ `interactions/${ encodeURIComponent ( id ) } /documents/${ encodeURIComponent ( documentId ) } ` ,
433437 ) ,
434438 method : "DELETE" ,
435439 headers : mergeHeaders (
@@ -514,8 +518,8 @@ export class Documents {
514518 }
515519
516520 /**
517- * @param {Corti.Uuid } id - The unique identifier of the interaction . Must be a valid UUID.
518- * @param {Corti.Uuid } documentId - The document ID representing the context for the request. Must be a valid UUID.
521+ * @param {string } id - The interaction ID representing the context for the request . Must be a valid UUID.
522+ * @param {string } documentId - The document ID representing the context for the request. Must be a valid UUID.
519523 * @param {Corti.DocumentsUpdateRequest } request
520524 * @param {Documents.RequestOptions } requestOptions - Request-specific configuration.
521525 *
@@ -525,28 +529,28 @@ export class Documents {
525529 * @throws {@link Corti.GatewayTimeoutError }
526530 *
527531 * @example
528- * await client.documents.update("f47ac10b-58cc-4372-a567-0e02b2c3d479 ", "f47ac10b-58cc-4372-a567-0e02b2c3d479 ")
532+ * await client.documents.updateDocument("id ", "documentId ")
529533 */
530- public update (
531- id : Corti . Uuid ,
532- documentId : Corti . Uuid ,
534+ public updateDocument (
535+ id : string ,
536+ documentId : string ,
533537 request : Corti . DocumentsUpdateRequest = { } ,
534538 requestOptions ?: Documents . RequestOptions ,
535539 ) : core . HttpResponsePromise < Corti . DocumentsGetResponse > {
536- return core . HttpResponsePromise . fromPromise ( this . __update ( id , documentId , request , requestOptions ) ) ;
540+ return core . HttpResponsePromise . fromPromise ( this . __updateDocument ( id , documentId , request , requestOptions ) ) ;
537541 }
538542
539- private async __update (
540- id : Corti . Uuid ,
541- documentId : Corti . Uuid ,
543+ private async __updateDocument (
544+ id : string ,
545+ documentId : string ,
542546 request : Corti . DocumentsUpdateRequest = { } ,
543547 requestOptions ?: Documents . RequestOptions ,
544548 ) : Promise < core . WithRawResponse < Corti . DocumentsGetResponse > > {
545549 const _response = await core . fetcher ( {
546550 url : core . url . join (
547551 ( await core . Supplier . get ( this . _options . baseUrl ) ) ??
548552 ( await core . Supplier . get ( this . _options . environment ) ) . base ,
549- `interactions/${ encodeURIComponent ( serializers . Uuid . jsonOrThrow ( id , { omitUndefined : true } ) ) } /documents/${ encodeURIComponent ( serializers . Uuid . jsonOrThrow ( documentId , { omitUndefined : true } ) ) } ` ,
553+ `interactions/${ encodeURIComponent ( id ) } /documents/${ encodeURIComponent ( documentId ) } ` ,
550554 ) ,
551555 method : "PATCH" ,
552556 headers : mergeHeaders (
0 commit comments