Skip to content

Latest commit

 

History

History
520 lines (364 loc) · 13.7 KB

RepoSyncsApi.md

File metadata and controls

520 lines (364 loc) · 13.7 KB

Phrase::RepoSyncsApi

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

Method HTTP request Description
repo_sync_activate POST /accounts/{account_id}/repo_syncs/{id}/activate Activate a Repo Sync
repo_sync_deactivate POST /accounts/{account_id}/repo_syncs/{id}/deactivate Deactivate a Repo Sync
repo_sync_event_show GET /accounts/{account_id}/repo_syncs/{repo_sync_id}/events/{id} Get a single Repo Sync Event
repo_sync_events GET /accounts/{account_id}/repo_syncs/{id}/events Repository Syncs History
repo_sync_export POST /accounts/{account_id}/repo_syncs/{id}/export Export to code repository
repo_sync_import POST /accounts/{account_id}/repo_syncs/{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/{id} Get a single Repo Sync

repo_sync_activate

RepoSync repo_sync_activate(account_id, id, opts)

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

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::RepoSyncsApi.new
account_id = 'account_id_example' # String | Account ID
id = 'id_example' # String | ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Activate a Repo Sync
  result = api_instance.repo_sync_activate(account_id, id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling RepoSyncsApi->repo_sync_activate: #{e}"
end

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

Response<(RepoSync)>

Authorization

Basic, Token

HTTP request headers

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

repo_sync_deactivate

RepoSync repo_sync_deactivate(account_id, id, opts)

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

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::RepoSyncsApi.new
account_id = 'account_id_example' # String | Account ID
id = 'id_example' # String | ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Deactivate a Repo Sync
  result = api_instance.repo_sync_deactivate(account_id, id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling RepoSyncsApi->repo_sync_deactivate: #{e}"
end

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

Response<(RepoSync)>

Authorization

Basic, Token

HTTP request headers

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

repo_sync_event_show

RepoSyncEvent repo_sync_event_show(account_id, repo_sync_id, id, opts)

Get a single Repo Sync Event

Shows a single Repo Sync event.

Example

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::RepoSyncsApi.new
account_id = 'account_id_example' # String | Account ID
repo_sync_id = 'repo_sync_id_example' # String | Repo Sync ID
id = 'id_example' # String | ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Get a single Repo Sync Event
  result = api_instance.repo_sync_event_show(account_id, repo_sync_id, id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling RepoSyncsApi->repo_sync_event_show: #{e}"
end

Parameters

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

Return type

Response<(RepoSyncEvent)>

Authorization

Basic, Token

HTTP request headers

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

repo_sync_events

Array<RepoSyncEvent> repo_sync_events(account_id, id, opts)

Repository Syncs History

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

Example

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::RepoSyncsApi.new
account_id = 'account_id_example' # String | Account ID
id = 'id_example' # String | ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Repository Syncs History
  result = api_instance.repo_sync_events(account_id, id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling RepoSyncsApi->repo_sync_events: #{e}"
end

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

Response<(Array<RepoSyncEvent>)>

Authorization

Basic, Token

HTTP request headers

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

repo_sync_export

RepoSyncEvent repo_sync_export(account_id, id, opts)

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

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::RepoSyncsApi.new
account_id = 'account_id_example' # String | Account ID
id = 'id_example' # String | ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Export to code repository
  result = api_instance.repo_sync_export(account_id, id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling RepoSyncsApi->repo_sync_export: #{e}"
end

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

Response<(RepoSyncEvent)>

Authorization

Basic, Token

HTTP request headers

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

repo_sync_import

RepoSyncEvent repo_sync_import(account_id, id, opts)

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

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::RepoSyncsApi.new
account_id = 'account_id_example' # String | Account ID
id = 'id_example' # String | ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Import from code repository
  result = api_instance.repo_sync_import(account_id, id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling RepoSyncsApi->repo_sync_import: #{e}"
end

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

Response<(RepoSyncEvent)>

Authorization

Basic, Token

HTTP request headers

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

repo_sync_list

Array<RepoSync> repo_sync_list(account_id, opts)

Get Repo Syncs

Lists all Repo Syncs from an account

Example

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::RepoSyncsApi.new
account_id = 'account_id_example' # String | Account ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Get Repo Syncs
  result = api_instance.repo_sync_list(account_id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling RepoSyncsApi->repo_sync_list: #{e}"
end

Parameters

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

Return type

Response<(Array<RepoSync>)>

Authorization

Basic, Token

HTTP request headers

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

repo_sync_show

RepoSync repo_sync_show(account_id, id, opts)

Get a single Repo Sync

Shows a single Repo Sync setting.

Example

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::RepoSyncsApi.new
account_id = 'account_id_example' # String | Account ID
id = 'id_example' # String | ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Get a single Repo Sync
  result = api_instance.repo_sync_show(account_id, id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling RepoSyncsApi->repo_sync_show: #{e}"
end

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

Response<(RepoSync)>

Authorization

Basic, Token

HTTP request headers

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