/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { translationsCreate } from "../funcs/translationsCreate.js"; import { translationsDelete } from "../funcs/translationsDelete.js"; import { translationsRetrieve } from "../funcs/translationsRetrieve.js"; import { translationsUpload } from "../funcs/translationsUpload.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { Groups } from "./groups.js"; import { Master } from "./master.js"; export class Translations extends ClientSDK { private _groups?: Groups; get groups(): Groups { return (this._groups ??= new Groups(this._options)); } private _master?: Master; get master(): Master { return (this._master ??= new Master(this._options)); } /** * Create a translation * * @remarks * Create a translation for a specific workflow and locale, if the translation already exists, it will be updated */ async create( createTranslationRequestDto: components.CreateTranslationRequestDto, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(translationsCreate( this, createTranslationRequestDto, idempotencyKey, options, )); } /** * Retrieve a translation * * @remarks * Retrieve a specific translation by resource type, resource ID and locale */ async retrieve( request: operations.TranslationControllerGetSingleTranslationRequest, options?: RequestOptions, ): Promise { return unwrapAsync(translationsRetrieve( this, request, options, )); } /** * Delete a translation * * @remarks * Delete a specific translation by resource type, resource ID and locale */ async delete( request: operations.TranslationControllerDeleteTranslationEndpointRequest, options?: RequestOptions, ): Promise { return unwrapAsync(translationsDelete( this, request, options, )); } /** * Upload translation files * * @remarks * Upload one or more JSON translation files for a specific workflow. Files name must match the locale, e.g. en_US.json. Supports both "files" and "files[]" field names for backwards compatibility. */ async upload( requestBody: operations.TranslationControllerUploadTranslationFilesRequestBody, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(translationsUpload( this, requestBody, idempotencyKey, options, )); } }