Skip to content

Latest commit

 

History

History
489 lines (352 loc) · 19.3 KB

RepoSyncsApi.md

File metadata and controls

489 lines (352 loc) · 19.3 KB

phrase_api.RepoSyncsApi

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

Method HTTP request Description
repo_sync_activate POST /accounts/{account_id}/repo_syncs/{repo_sync_id}/activate Activate a Repo Sync
repo_sync_deactivate POST /accounts/{account_id}/repo_syncs/{repo_sync_id}/deactivate Deactivate a Repo Sync
repo_sync_events GET /accounts/{account_id}/repo_syncs/{repo_sync_id}/events Repository Syncs History
repo_sync_export POST /accounts/{account_id}/repo_syncs/{repo_sync_id}/export Export to code repository
repo_sync_import POST /accounts/{account_id}/repo_syncs/{repo_sync_id}/import Import from code repository
repo_sync_list GET /accounts/{account_id}/repo_syncs Get Repo Syncs
repo_sync_show GET /accounts/{account_id}/repo_syncs/{repo_sync_id} Get a single Repo Sync

repo_sync_activate

RepoSync repo_sync_activate(account_id, repo_sync_id, x_phrase_app_otp=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

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.RepoSyncsApi(api_client)
    account_id = 'account_id_example' # str | Account ID (required)
    repo_sync_id = 'repo_sync_id_example' # str | Repo Sync ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Activate a Repo Sync
        api_response = api_instance.repo_sync_activate(account_id, repo_sync_id, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RepoSyncsApi->repo_sync_activate: %s\n" % e)

Parameters

Name Type Description Notes
account_id str Account ID
repo_sync_id str Repo Sync ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

RepoSync

Authorization

Basic, Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

repo_sync_deactivate

RepoSync repo_sync_deactivate(account_id, repo_sync_id, x_phrase_app_otp=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

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.RepoSyncsApi(api_client)
    account_id = 'account_id_example' # str | Account ID (required)
    repo_sync_id = 'repo_sync_id_example' # str | Repo Sync ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Deactivate a Repo Sync
        api_response = api_instance.repo_sync_deactivate(account_id, repo_sync_id, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RepoSyncsApi->repo_sync_deactivate: %s\n" % e)

Parameters

Name Type Description Notes
account_id str Account ID
repo_sync_id str Repo Sync ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

RepoSync

Authorization

Basic, Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

repo_sync_events

List[RepoSyncEvent] repo_sync_events(account_id, repo_sync_id, x_phrase_app_otp=x_phrase_app_otp)

Repository Syncs History

Get the history of a single Repo Sync. The history includes all imports and exports performed by the Repo Sync.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.RepoSyncsApi(api_client)
    account_id = 'account_id_example' # str | Account ID (required)
    repo_sync_id = 'repo_sync_id_example' # str | Repo Sync ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Repository Syncs History
        api_response = api_instance.repo_sync_events(account_id, repo_sync_id, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RepoSyncsApi->repo_sync_events: %s\n" % e)

Parameters

Name Type Description Notes
account_id str Account ID
repo_sync_id str Repo Sync ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

List[RepoSyncEvent]

Authorization

Basic, Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
* Link -
* Pagination -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

repo_sync_export

RepoSyncExport repo_sync_export(account_id, repo_sync_id, x_phrase_app_otp=x_phrase_app_otp)

Export to code repository

Beta: this feature will change in the future. 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

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.RepoSyncsApi(api_client)
    account_id = 'account_id_example' # str | Account ID (required)
    repo_sync_id = 'repo_sync_id_example' # str | Repo Sync ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Export to code repository
        api_response = api_instance.repo_sync_export(account_id, repo_sync_id, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RepoSyncsApi->repo_sync_export: %s\n" % e)

Parameters

Name Type Description Notes
account_id str Account ID
repo_sync_id str Repo Sync ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

RepoSyncExport

Authorization

Basic, Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

repo_sync_import

RepoSyncImport repo_sync_import(account_id, repo_sync_id, x_phrase_app_otp=x_phrase_app_otp)

Import from code repository

Beta: this feature will change in the future. 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

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.RepoSyncsApi(api_client)
    account_id = 'account_id_example' # str | Account ID (required)
    repo_sync_id = 'repo_sync_id_example' # str | Repo Sync ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Import from code repository
        api_response = api_instance.repo_sync_import(account_id, repo_sync_id, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RepoSyncsApi->repo_sync_import: %s\n" % e)

Parameters

Name Type Description Notes
account_id str Account ID
repo_sync_id str Repo Sync ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

RepoSyncImport

Authorization

Basic, Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

repo_sync_list

List[RepoSync] repo_sync_list(account_id, x_phrase_app_otp=x_phrase_app_otp)

Get Repo Syncs

Lists all Repo Syncs from an account

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.RepoSyncsApi(api_client)
    account_id = 'account_id_example' # str | Account ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Get Repo Syncs
        api_response = api_instance.repo_sync_list(account_id, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RepoSyncsApi->repo_sync_list: %s\n" % e)

Parameters

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

Return type

List[RepoSync]

Authorization

Basic, Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
* Link -
* Pagination -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

repo_sync_show

RepoSync repo_sync_show(account_id, repo_sync_id, x_phrase_app_otp=x_phrase_app_otp)

Get a single Repo Sync

Shows a single Repo Sync setting.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.RepoSyncsApi(api_client)
    account_id = 'account_id_example' # str | Account ID (required)
    repo_sync_id = 'repo_sync_id_example' # str | Repo Sync ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Get a single Repo Sync
        api_response = api_instance.repo_sync_show(account_id, repo_sync_id, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling RepoSyncsApi->repo_sync_show: %s\n" % e)

Parameters

Name Type Description Notes
account_id str Account ID
repo_sync_id str Repo Sync ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

RepoSync

Authorization

Basic, Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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