Skip to content

Commit

Permalink
Deploying from phrase/openapi@d810e9eb
Browse files Browse the repository at this point in the history
  • Loading branch information
Phrase committed Apr 23, 2024
1 parent 086b82a commit 5d6d434
Show file tree
Hide file tree
Showing 34 changed files with 116 additions and 99 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ Class | Method | HTTP request | Description
*GlossaryTermsApi* | **glossaryTermShow** | **GET** /accounts/{account_id}/glossaries/{glossary_id}/terms/{id} | Get a single term
*GlossaryTermsApi* | **glossaryTermUpdate** | **PATCH** /accounts/{account_id}/glossaries/{glossary_id}/terms/{id} | Update a term
*GlossaryTermsApi* | **glossaryTermsList** | **GET** /accounts/{account_id}/glossaries/{glossary_id}/terms | List terms
*ICUApi* | **icuSkeleton** | **POST** /icu/skeleton | Build icu skeletons
*ICUApi* | **icuSkeleton** | **POST** /icu/skeleton | Build ICU skeletons
*InvitationsApi* | **invitationCreate** | **POST** /accounts/{account_id}/invitations | Create a new invitation
*InvitationsApi* | **invitationDelete** | **DELETE** /accounts/{account_id}/invitations/{id} | Delete an invitation
*InvitationsApi* | **invitationResend** | **POST** /accounts/{account_id}/invitations/{id}/resend | Resend an invitation
Expand Down Expand Up @@ -338,7 +338,7 @@ Class | Method | HTTP request | Description
*LinkedKeysApi* | **keyLinksBatchDestroy** | **DELETE** /projects/{project_id}/keys/{id}/key_links | Batch unlink child keys from a parent key
*LinkedKeysApi* | **keyLinksCreate** | **POST** /projects/{project_id}/keys/{id}/key_links | Link child keys to a parent key
*LinkedKeysApi* | **keyLinksDestroy** | **DELETE** /projects/{project_id}/keys/{id}/key_links/{child_key_id} | Unlink a child key from a parent key
*LinkedKeysApi* | **keyLinksIndex** | **GET** /projects/{project_id}/keys/{id}/key_links | Retrieve all child keys linked to a specific parent key
*LinkedKeysApi* | **keyLinksIndex** | **GET** /projects/{project_id}/keys/{id}/key_links | List child keys of a parent key
*LocalesApi* | **accountLocales** | **GET** /accounts/{id}/locales | List locales used in account
*LocalesApi* | **localeCreate** | **POST** /projects/{project_id}/locales | Create a locale
*LocalesApi* | **localeDelete** | **DELETE** /projects/{project_id}/locales/{id} | Delete a locale
Expand Down
4 changes: 3 additions & 1 deletion __tests__/BasicApiTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ describe('UploadsApi', () => {
test('uploads a file', async () => {
const projectId = 'my-project-id';
const file = fs.createReadStream('package.json');
const fileFormat = 'json';
const localeId = 'en';

await api.uploadCreate({projectId, file}).then((response) => {
await api.uploadCreate({projectId, file, fileFormat, localeId}).then((response) => {
expect(response.id).toBe('upload_id');
});

Expand Down
8 changes: 4 additions & 4 deletions src/apis/ICUApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export interface IcuSkeletonRequest {
export class ICUApi extends runtime.BaseAPI {

/**
* Returns icu skeletons for multiple locale codes based on a source content.
* Build icu skeletons
* Returns ICU skeletons for multiple locale codes based on a source content.
* Build ICU skeletons
*/
async icuSkeletonRaw(requestParameters: IcuSkeletonRequest): Promise<runtime.ApiResponse<Icu>> {
if (requestParameters.icuSkeletonParameters === null || requestParameters.icuSkeletonParameters === undefined) {
Expand Down Expand Up @@ -70,8 +70,8 @@ export class ICUApi extends runtime.BaseAPI {
}

/**
* Returns icu skeletons for multiple locale codes based on a source content.
* Build icu skeletons
* Returns ICU skeletons for multiple locale codes based on a source content.
* Build ICU skeletons
*/
async icuSkeleton(requestParameters: IcuSkeletonRequest): Promise<Icu> {
const response = await this.icuSkeletonRaw(requestParameters);
Expand Down
9 changes: 2 additions & 7 deletions src/apis/LinkedKeysApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export interface KeyLinksBatchDestroyRequest {
id: string;
keyLinksBatchDestroyParameters: KeyLinksBatchDestroyParameters;
xPhraseAppOTP?: string;
unlinkParent?: boolean;
}

export interface KeyLinksCreateRequest {
Expand Down Expand Up @@ -83,10 +82,6 @@ export class LinkedKeysApi extends runtime.BaseAPI {

const queryParameters: any = {};

if (requestParameters.unlinkParent !== undefined) {
queryParameters['unlink_parent'] = requestParameters.unlinkParent;
}

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';
Expand Down Expand Up @@ -229,7 +224,7 @@ export class LinkedKeysApi extends runtime.BaseAPI {

/**
* Returns detailed information about a parent key, including its linked child keys.
* Retrieve all child keys linked to a specific parent key
* List child keys of a parent key
*/
async keyLinksIndexRaw(requestParameters: KeyLinksIndexRequest): Promise<runtime.ApiResponse<KeyLink>> {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
Expand Down Expand Up @@ -267,7 +262,7 @@ export class LinkedKeysApi extends runtime.BaseAPI {

/**
* Returns detailed information about a parent key, including its linked child keys.
* Retrieve all child keys linked to a specific parent key
* List child keys of a parent key
*/
async keyLinksIndex(requestParameters: KeyLinksIndexRequest): Promise<KeyLink> {
const response = await this.keyLinksIndexRaw(requestParameters);
Expand Down
18 changes: 15 additions & 3 deletions src/apis/UploadsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import {

export interface UploadCreateRequest {
projectId: string;
file: Blob;
fileFormat: string;
localeId: string;
xPhraseAppOTP?: string;
branch?: string;
file?: Blob;
fileFormat?: string;
localeId?: string;
tags?: string;
updateTranslations?: boolean;
updateDescriptions?: boolean;
Expand Down Expand Up @@ -69,6 +69,18 @@ export class UploadsApi extends runtime.BaseAPI {
throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling uploadCreate.');
}

if (requestParameters.file === null || requestParameters.file === undefined) {
throw new runtime.RequiredError('file','Required parameter requestParameters.file was null or undefined when calling uploadCreate.');
}

if (requestParameters.fileFormat === null || requestParameters.fileFormat === undefined) {
throw new runtime.RequiredError('fileFormat','Required parameter requestParameters.fileFormat was null or undefined when calling uploadCreate.');
}

if (requestParameters.localeId === null || requestParameters.localeId === undefined) {
throw new runtime.RequiredError('localeId','Required parameter requestParameters.localeId was null or undefined when calling uploadCreate.');
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};
Expand Down
4 changes: 2 additions & 2 deletions src/models/AuthorizationCreateParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface AuthorizationCreateParameters {
* @type {string}
* @memberof AuthorizationCreateParameters
*/
note?: string;
note: string;
/**
* A list of scopes that the access can be used for.
* @type {Array<string>}
Expand All @@ -48,7 +48,7 @@ export function AuthorizationCreateParametersFromJSONTyped(json: any, ignoreDisc
}
return {

'note': !exists(json, 'note') ? undefined : json['note'],
'note': json['note'],
'scopes': !exists(json, 'scopes') ? undefined : json['scopes'],
'expiresAt': !exists(json, 'expires_at') ? undefined : (new Date(json['expires_at'])),
};
Expand Down
4 changes: 2 additions & 2 deletions src/models/BlacklistedKeyCreateParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface BlacklistedKeyCreateParameters {
* @type {string}
* @memberof BlacklistedKeyCreateParameters
*/
name?: string;
name: string;
}

export function BlacklistedKeyCreateParametersFromJSON(json: any): BlacklistedKeyCreateParameters {
Expand All @@ -36,7 +36,7 @@ export function BlacklistedKeyCreateParametersFromJSONTyped(json: any, ignoreDis
}
return {

'name': !exists(json, 'name') ? undefined : json['name'],
'name': json['name'],
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/models/BranchCreateParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface BranchCreateParameters {
* @type {string}
* @memberof BranchCreateParameters
*/
name?: string;
name: string;
}

export function BranchCreateParametersFromJSON(json: any): BranchCreateParameters {
Expand All @@ -36,7 +36,7 @@ export function BranchCreateParametersFromJSONTyped(json: any, ignoreDiscriminat
}
return {

'name': !exists(json, 'name') ? undefined : json['name'],
'name': json['name'],
};
}

Expand Down
8 changes: 4 additions & 4 deletions src/models/DistributionCreateParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export interface DistributionCreateParameters {
* @type {string}
* @memberof DistributionCreateParameters
*/
name?: string;
name: string;
/**
* Project id the distribution should be assigned to.
* @type {string}
* @memberof DistributionCreateParameters
*/
projectId?: string;
projectId: string;
/**
* List of platforms the distribution should support. Valid values are: * `android` * `ios` * `flutter` * `i18next` * `rails`
* @type {Array<string>}
Expand Down Expand Up @@ -84,8 +84,8 @@ export function DistributionCreateParametersFromJSONTyped(json: any, ignoreDiscr
}
return {

'name': !exists(json, 'name') ? undefined : json['name'],
'projectId': !exists(json, 'project_id') ? undefined : json['project_id'],
'name': json['name'],
'projectId': json['project_id'],
'platforms': !exists(json, 'platforms') ? undefined : json['platforms'],
'localeIds': !exists(json, 'locale_ids') ? undefined : json['locale_ids'],
'formatOptions': !exists(json, 'format_options') ? undefined : json['format_options'],
Expand Down
4 changes: 2 additions & 2 deletions src/models/FigmaAttachmentCreateParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface FigmaAttachmentCreateParameters {
* @type {string}
* @memberof FigmaAttachmentCreateParameters
*/
url?: string;
url: string;
}

export function FigmaAttachmentCreateParametersFromJSON(json: any): FigmaAttachmentCreateParameters {
Expand All @@ -43,7 +43,7 @@ export function FigmaAttachmentCreateParametersFromJSONTyped(json: any, ignoreDi
return {

'branch': !exists(json, 'branch') ? undefined : json['branch'],
'url': !exists(json, 'url') ? undefined : json['url'],
'url': json['url'],
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/models/GlossaryCreateParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface GlossaryCreateParameters {
* @type {string}
* @memberof GlossaryCreateParameters
*/
name?: string;
name: string;
/**
* List of project ids the glossary should be assigned to.
* @type {string}
Expand All @@ -48,7 +48,7 @@ export function GlossaryCreateParametersFromJSONTyped(json: any, ignoreDiscrimin
}
return {

'name': !exists(json, 'name') ? undefined : json['name'],
'name': json['name'],
'projectIds': !exists(json, 'project_ids') ? undefined : json['project_ids'],
'spaceIds': !exists(json, 'space_ids') ? undefined : json['space_ids'],
};
Expand Down
4 changes: 2 additions & 2 deletions src/models/GlossaryTermCreateParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface GlossaryTermCreateParameters {
* @type {string}
* @memberof GlossaryTermCreateParameters
*/
term?: string;
term: string;
/**
* Description of term
* @type {string}
Expand Down Expand Up @@ -54,7 +54,7 @@ export function GlossaryTermCreateParametersFromJSONTyped(json: any, ignoreDiscr
}
return {

'term': !exists(json, 'term') ? undefined : json['term'],
'term': json['term'],
'description': !exists(json, 'description') ? undefined : json['description'],
'translatable': !exists(json, 'translatable') ? undefined : json['translatable'],
'caseSensitive': !exists(json, 'case_sensitive') ? undefined : json['case_sensitive'],
Expand Down
8 changes: 4 additions & 4 deletions src/models/GlossaryTermTranslationCreateParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export interface GlossaryTermTranslationCreateParameters {
* @type {string}
* @memberof GlossaryTermTranslationCreateParameters
*/
localeCode?: string;
localeCode: string;
/**
* The content of the translation
* @type {string}
* @memberof GlossaryTermTranslationCreateParameters
*/
content?: string;
content: string;
}

export function GlossaryTermTranslationCreateParametersFromJSON(json: any): GlossaryTermTranslationCreateParameters {
Expand All @@ -42,8 +42,8 @@ export function GlossaryTermTranslationCreateParametersFromJSONTyped(json: any,
}
return {

'localeCode': !exists(json, 'locale_code') ? undefined : json['locale_code'],
'content': !exists(json, 'content') ? undefined : json['content'],
'localeCode': json['locale_code'],
'content': json['content'],
};
}

Expand Down
8 changes: 4 additions & 4 deletions src/models/InvitationCreateParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export interface InvitationCreateParameters {
* @type {string}
* @memberof InvitationCreateParameters
*/
email?: string;
email: string;
/**
* Invitiation role, can be any of Manager, Developer, Translator.
* @type {string}
* @memberof InvitationCreateParameters
*/
role?: string;
role: string;
/**
* List of project ids the invited user has access to.
* @type {string}
Expand Down Expand Up @@ -78,8 +78,8 @@ export function InvitationCreateParametersFromJSONTyped(json: any, ignoreDiscrim
}
return {

'email': !exists(json, 'email') ? undefined : json['email'],
'role': !exists(json, 'role') ? undefined : json['role'],
'email': json['email'],
'role': json['role'],
'projectIds': !exists(json, 'project_ids') ? undefined : json['project_ids'],
'localeIds': !exists(json, 'locale_ids') ? undefined : json['locale_ids'],
'spaceIds': !exists(json, 'space_ids') ? undefined : json['space_ids'],
Expand Down
4 changes: 2 additions & 2 deletions src/models/JobCreateParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface JobCreateParameters {
* @type {string}
* @memberof JobCreateParameters
*/
name?: string;
name: string;
/**
* The API id of the source language
* @type {string}
Expand Down Expand Up @@ -85,7 +85,7 @@ export function JobCreateParametersFromJSONTyped(json: any, ignoreDiscriminator:
return {

'branch': !exists(json, 'branch') ? undefined : json['branch'],
'name': !exists(json, 'name') ? undefined : json['name'],
'name': json['name'],
'sourceLocaleId': !exists(json, 'source_locale_id') ? undefined : json['source_locale_id'],
'briefing': !exists(json, 'briefing') ? undefined : json['briefing'],
'dueDate': !exists(json, 'due_date') ? undefined : (json['due_date'] === null ? null : new Date(json['due_date'])),
Expand Down
4 changes: 2 additions & 2 deletions src/models/KeyCreateParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface KeyCreateParameters {
* @type {string}
* @memberof KeyCreateParameters
*/
name?: string;
name: string;
/**
* Key description (usually includes contextual information for translators)
* @type {string}
Expand Down Expand Up @@ -133,7 +133,7 @@ export function KeyCreateParametersFromJSONTyped(json: any, ignoreDiscriminator:
return {

'branch': !exists(json, 'branch') ? undefined : json['branch'],
'name': !exists(json, 'name') ? undefined : json['name'],
'name': json['name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'plural': !exists(json, 'plural') ? undefined : json['plural'],
'namePlural': !exists(json, 'name_plural') ? undefined : json['name_plural'],
Expand Down
Loading

0 comments on commit 5d6d434

Please sign in to comment.