Skip to content

Commit

Permalink
Deploying from phrase/openapi@033be100
Browse files Browse the repository at this point in the history
  • Loading branch information
Phrase committed Dec 20, 2024
1 parent dd7d0ce commit e049e18
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 117 deletions.
1 change: 1 addition & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ src/apis/ProjectsApi.ts
src/apis/QualityPerformanceScoreApi.ts
src/apis/ReleaseTriggersApi.ts
src/apis/ReleasesApi.ts
src/apis/RepoSyncEventsApi.ts
src/apis/RepoSyncsApi.ts
src/apis/ReportsApi.ts
src/apis/ScreenshotMarkersApi.ts
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,10 @@ Class | Method | HTTP request | Description
*ReleasesApi* | **releaseShow** | **GET** /accounts/{account_id}/distributions/{distribution_id}/releases/{id} | Get a single release
*ReleasesApi* | **releaseUpdate** | **PATCH** /accounts/{account_id}/distributions/{distribution_id}/releases/{id} | Update a release
*ReleasesApi* | **releasesList** | **GET** /accounts/{account_id}/distributions/{distribution_id}/releases | List releases
*RepoSyncEventsApi* | **repoSyncEventList** | **GET** /accounts/{account_id}/repo_syncs/{id}/events | Repository Syncs History
*RepoSyncEventsApi* | **repoSyncEventShow** | **GET** /accounts/{account_id}/repo_syncs/{repo_sync_id}/events/{id} | Get a single Repo Sync Event
*RepoSyncsApi* | **repoSyncActivate** | **POST** /accounts/{account_id}/repo_syncs/{id}/activate | Activate a Repo Sync
*RepoSyncsApi* | **repoSyncDeactivate** | **POST** /accounts/{account_id}/repo_syncs/{id}/deactivate | Deactivate a Repo Sync
*RepoSyncsApi* | **repoSyncEventShow** | **GET** /accounts/{account_id}/repo_syncs/{repo_sync_id}/events/{id} | Get a single Repo Sync Event
*RepoSyncsApi* | **repoSyncEvents** | **GET** /accounts/{account_id}/repo_syncs/{id}/events | Repository Syncs History
*RepoSyncsApi* | **repoSyncExport** | **POST** /accounts/{account_id}/repo_syncs/{id}/export | Export to code repository
*RepoSyncsApi* | **repoSyncImport** | **POST** /accounts/{account_id}/repo_syncs/{id}/import | Import from code repository
*RepoSyncsApi* | **repoSyncList** | **GET** /accounts/{account_id}/repo_syncs | Get Repo Syncs
Expand Down
138 changes: 138 additions & 0 deletions src/apis/RepoSyncEventsApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/* tslint:disable */
/* eslint-disable */
/**
* Phrase Strings API Reference
*
* The version of the OpenAPI document: 2.0.0
* Contact: support@phrase.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


import * as runtime from '../runtime';
import {
RepoSyncEvent,
RepoSyncEventFromJSON,
RepoSyncEventToJSON,
} from '../models';

export interface RepoSyncEventListRequest {
accountId: string;
id: string;
xPhraseAppOTP?: string;
}

export interface RepoSyncEventShowRequest {
accountId: string;
repoSyncId: string;
id: string;
xPhraseAppOTP?: string;
}

/**
*
*/
export class RepoSyncEventsApi extends runtime.BaseAPI {

/**
* Get the history of a single Repo Sync. The history includes all imports and exports performed by the Repo Sync.
* Repository Syncs History
*/
async repoSyncEventListRaw(requestParameters: RepoSyncEventListRequest): Promise<runtime.ApiResponse<Array<RepoSyncEvent>>> {
if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling repoSyncEventList.');
}

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

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

if (requestParameters.xPhraseAppOTP !== undefined && requestParameters.xPhraseAppOTP !== null) {
headerParameters['X-PhraseApp-OTP'] = String(requestParameters.xPhraseAppOTP);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // Token authentication
}

const response = await this.request({
path: `/accounts/{account_id}/repo_syncs/{id}/events`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
});

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(RepoSyncEventFromJSON));
}

/**
* Get the history of a single Repo Sync. The history includes all imports and exports performed by the Repo Sync.
* Repository Syncs History
*/
async repoSyncEventList(requestParameters: RepoSyncEventListRequest): Promise<Array<RepoSyncEvent>> {
const response = await this.repoSyncEventListRaw(requestParameters);
return await response.value();
}

/**
* Shows a single Repo Sync event.
* Get a single Repo Sync Event
*/
async repoSyncEventShowRaw(requestParameters: RepoSyncEventShowRequest): Promise<runtime.ApiResponse<RepoSyncEvent>> {
if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling repoSyncEventShow.');
}

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

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

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

if (requestParameters.xPhraseAppOTP !== undefined && requestParameters.xPhraseAppOTP !== null) {
headerParameters['X-PhraseApp-OTP'] = String(requestParameters.xPhraseAppOTP);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // Token authentication
}

const response = await this.request({
path: `/accounts/{account_id}/repo_syncs/{repo_sync_id}/events/{id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))).replace(`{${"repo_sync_id"}}`, encodeURIComponent(String(requestParameters.repoSyncId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
});

return new runtime.JSONApiResponse(response, (jsonValue) => RepoSyncEventFromJSON(jsonValue));
}

/**
* Shows a single Repo Sync event.
* Get a single Repo Sync Event
*/
async repoSyncEventShow(requestParameters: RepoSyncEventShowRequest): Promise<RepoSyncEvent> {
const response = await this.repoSyncEventShowRaw(requestParameters);
return await response.value();
}

}
111 changes: 0 additions & 111 deletions src/apis/RepoSyncsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@ export interface RepoSyncDeactivateRequest {
xPhraseAppOTP?: string;
}

export interface RepoSyncEventShowRequest {
accountId: string;
repoSyncId: string;
id: string;
xPhraseAppOTP?: string;
}

export interface RepoSyncEventsRequest {
accountId: string;
id: string;
xPhraseAppOTP?: string;
}

export interface RepoSyncExportRequest {
accountId: string;
id: string;
Expand Down Expand Up @@ -169,104 +156,6 @@ export class RepoSyncsApi extends runtime.BaseAPI {
return await response.value();
}

/**
* Shows a single Repo Sync event.
* Get a single Repo Sync Event
*/
async repoSyncEventShowRaw(requestParameters: RepoSyncEventShowRequest): Promise<runtime.ApiResponse<RepoSyncEvent>> {
if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling repoSyncEventShow.');
}

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

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

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

if (requestParameters.xPhraseAppOTP !== undefined && requestParameters.xPhraseAppOTP !== null) {
headerParameters['X-PhraseApp-OTP'] = String(requestParameters.xPhraseAppOTP);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // Token authentication
}

const response = await this.request({
path: `/accounts/{account_id}/repo_syncs/{repo_sync_id}/events/{id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))).replace(`{${"repo_sync_id"}}`, encodeURIComponent(String(requestParameters.repoSyncId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
});

return new runtime.JSONApiResponse(response, (jsonValue) => RepoSyncEventFromJSON(jsonValue));
}

/**
* Shows a single Repo Sync event.
* Get a single Repo Sync Event
*/
async repoSyncEventShow(requestParameters: RepoSyncEventShowRequest): Promise<RepoSyncEvent> {
const response = await this.repoSyncEventShowRaw(requestParameters);
return await response.value();
}

/**
* Get the history of a single Repo Sync. The history includes all imports and exports performed by the Repo Sync.
* Repository Syncs History
*/
async repoSyncEventsRaw(requestParameters: RepoSyncEventsRequest): Promise<runtime.ApiResponse<Array<RepoSyncEvent>>> {
if (requestParameters.accountId === null || requestParameters.accountId === undefined) {
throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling repoSyncEvents.');
}

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

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

if (requestParameters.xPhraseAppOTP !== undefined && requestParameters.xPhraseAppOTP !== null) {
headerParameters['X-PhraseApp-OTP'] = String(requestParameters.xPhraseAppOTP);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // Token authentication
}

const response = await this.request({
path: `/accounts/{account_id}/repo_syncs/{id}/events`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
});

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(RepoSyncEventFromJSON));
}

/**
* Get the history of a single Repo Sync. The history includes all imports and exports performed by the Repo Sync.
* Repository Syncs History
*/
async repoSyncEvents(requestParameters: RepoSyncEventsRequest): Promise<Array<RepoSyncEvent>> {
const response = await this.repoSyncEventsRaw(requestParameters);
return await response.value();
}

/**
* Export translations from Phrase Strings to repository provider according to the .phrase.yml file within the code repository. *Export is done asynchronously and may take several seconds depending on the project size.*
* Export to code repository
Expand Down
1 change: 1 addition & 0 deletions src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export * from './ProjectsApi';
export * from './QualityPerformanceScoreApi';
export * from './ReleaseTriggersApi';
export * from './ReleasesApi';
export * from './RepoSyncEventsApi';
export * from './RepoSyncsApi';
export * from './ReportsApi';
export * from './ScreenshotMarkersApi';
Expand Down
8 changes: 4 additions & 4 deletions src/models/RepoSyncEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface RepoSyncEvent {
* @type {string}
* @memberof RepoSyncEvent
*/
eventType?: RepoSyncEventEventTypeEnum;
type?: RepoSyncEventTypeEnum;
/**
*
* @type {Date}
Expand Down Expand Up @@ -80,7 +80,7 @@ export function RepoSyncEventFromJSONTyped(json: any, ignoreDiscriminator: boole
return {

'id': !exists(json, 'id') ? undefined : json['id'],
'eventType': !exists(json, 'event_type') ? undefined : json['event_type'],
'type': !exists(json, 'type') ? undefined : json['type'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'status': !exists(json, 'status') ? undefined : json['status'],
'pullRequestUrl': !exists(json, 'pull_request_url') ? undefined : json['pull_request_url'],
Expand All @@ -99,7 +99,7 @@ export function RepoSyncEventToJSON(value?: RepoSyncEvent | null): any {
return {

'id': value.id,
'event_type': value.eventType,
'type': value.type,
'created_at': value.createdAt === undefined ? undefined : (value.createdAt.toISOString()),
'status': value.status,
'pull_request_url': value.pullRequestUrl,
Expand All @@ -112,7 +112,7 @@ export function RepoSyncEventToJSON(value?: RepoSyncEvent | null): any {
* @export
* @enum {string}
*/
export enum RepoSyncEventEventTypeEnum {
export enum RepoSyncEventTypeEnum {
Import = 'import',
Export = 'export'
}
Expand Down

0 comments on commit e049e18

Please sign in to comment.