-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying from phrase/openapi@033be100
- Loading branch information
Phrase
committed
Dec 20, 2024
1 parent
dd7d0ce
commit e049e18
Showing
6 changed files
with
146 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters