Skip to content

Latest commit

 

History

History
390 lines (266 loc) · 12.4 KB

RepoSyncsApi.md

File metadata and controls

390 lines (266 loc) · 12.4 KB

Phrase\RepoSyncsApi

All URIs are relative to https://api.phrase.com/v2

Method HTTP request Description
repoSyncActivate POST /accounts/{account_id}/repo_syncs/{id}/activate Activate a Repo Sync
repoSyncDeactivate POST /accounts/{account_id}/repo_syncs/{id}/deactivate Deactivate a Repo Sync
repoSyncExport POST /accounts/{account_id}/repo_syncs/{id}/export Export to code repository
repoSyncImport POST /accounts/{account_id}/repo_syncs/{id}/import Import from code repository
repoSyncList GET /accounts/{account_id}/repo_syncs Get Repo Syncs
repoSyncShow GET /accounts/{account_id}/repo_syncs/{id} Get a single Repo Sync

repoSyncActivate

\Phrase\Model\RepoSync repoSyncActivate($account_id, $id, $x_phrase_app_otp)

Activate a Repo Sync

Activate a deactivated Repo Sync. Active syncs can be used to import and export translations, and imports to Phrase are automatically triggered by pushes to the repository, if configured.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\RepoSyncsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 'account_id_example'; // string | Account ID
$id = 'id_example'; // string | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

try {
    $result = $apiInstance->repoSyncActivate($account_id, $id, $x_phrase_app_otp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RepoSyncsApi->repoSyncActivate: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
account_id string Account ID
id string ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\RepoSync

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

repoSyncDeactivate

\Phrase\Model\RepoSync repoSyncDeactivate($account_id, $id, $x_phrase_app_otp)

Deactivate a Repo Sync

Deactivate an active Repo Sync. Import and export can't be performed on deactivated syncs and the pushes to the repository won't trigger the import to Phrase.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\RepoSyncsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 'account_id_example'; // string | Account ID
$id = 'id_example'; // string | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

try {
    $result = $apiInstance->repoSyncDeactivate($account_id, $id, $x_phrase_app_otp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RepoSyncsApi->repoSyncDeactivate: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
account_id string Account ID
id string ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\RepoSync

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

repoSyncExport

\Phrase\Model\RepoSyncEvent repoSyncExport($account_id, $id, $x_phrase_app_otp)

Export to code repository

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.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\RepoSyncsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 'account_id_example'; // string | Account ID
$id = 'id_example'; // string | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

try {
    $result = $apiInstance->repoSyncExport($account_id, $id, $x_phrase_app_otp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RepoSyncsApi->repoSyncExport: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
account_id string Account ID
id string ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\RepoSyncEvent

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

repoSyncImport

\Phrase\Model\RepoSyncEvent repoSyncImport($account_id, $id, $x_phrase_app_otp)

Import from code repository

Import translations from repository provider to Phrase Strings according to the .phrase.yml file within the code repository. Import is done asynchronously and may take several seconds depending on the project size.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\RepoSyncsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 'account_id_example'; // string | Account ID
$id = 'id_example'; // string | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

try {
    $result = $apiInstance->repoSyncImport($account_id, $id, $x_phrase_app_otp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RepoSyncsApi->repoSyncImport: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
account_id string Account ID
id string ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\RepoSyncEvent

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

repoSyncList

\Phrase\Model\RepoSync[] repoSyncList($account_id, $x_phrase_app_otp)

Get Repo Syncs

Lists all Repo Syncs from an account

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\RepoSyncsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 'account_id_example'; // string | Account ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

try {
    $result = $apiInstance->repoSyncList($account_id, $x_phrase_app_otp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RepoSyncsApi->repoSyncList: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
account_id string Account ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\RepoSync[]

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

repoSyncShow

\Phrase\Model\RepoSync repoSyncShow($account_id, $id, $x_phrase_app_otp)

Get a single Repo Sync

Shows a single Repo Sync setting.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\RepoSyncsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 'account_id_example'; // string | Account ID
$id = 'id_example'; // string | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

try {
    $result = $apiInstance->repoSyncShow($account_id, $id, $x_phrase_app_otp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RepoSyncsApi->repoSyncShow: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
account_id string Account ID
id string ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\RepoSync

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]