Skip to content

Latest commit

 

History

History
463 lines (326 loc) · 14.2 KB

GitLabSyncApi.md

File metadata and controls

463 lines (326 loc) · 14.2 KB

Phrase::GitLabSyncApi

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

Method HTTP request Description
gitlab_sync_delete DELETE /gitlab_syncs/{id} Delete single Sync Setting
gitlab_sync_export POST /gitlab_syncs/{gitlab_sync_id}/export Export from Phrase Strings to GitLab
gitlab_sync_history GET /gitlab_syncs/{gitlab_sync_id}/history History of single Sync Setting
gitlab_sync_import POST /gitlab_syncs/{gitlab_sync_id}/import Import from GitLab to Phrase
gitlab_sync_list GET /gitlab_syncs List GitLab syncs
gitlab_sync_show GET /gitlab_syncs/{id} Get single Sync Setting
gitlab_sync_update PUT /gitlab_syncs/{id} Update single Sync Setting

gitlab_sync_delete

gitlab_sync_delete(id, opts)

Delete single Sync Setting

Deletes a single GitLab 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::GitLabSyncApi.new
id = 'id_example' # String | ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
  account_id: 'abcd1234' # String | Account ID to specify the actual account the GitLab Sync should be created in. Required if the requesting user is a member of multiple accounts.
}

begin
  #Delete single Sync Setting
  api_instance.gitlab_sync_delete(id, opts)
rescue Phrase::ApiError => e
  puts "Exception when calling GitLabSyncApi->gitlab_sync_delete: #{e}"
end

Parameters

Name Type Description Notes
id String ID
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]
account_id String Account ID to specify the actual account the GitLab Sync should be created in. Required if the requesting user is a member of multiple accounts. [optional]

Return type

Response<(nil (empty response body))>

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

gitlab_sync_export

GitlabSyncExport gitlab_sync_export(gitlab_sync_id, gitlab_sync_export_parameters, opts)

Export from Phrase Strings to GitLab

Export translations from Phrase Strings to GitLab according to the .phraseapp.yml file within the GitLab repository.

Note: 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::GitLabSyncApi.new
gitlab_sync_id = 'gitlab_sync_id_example' # String | Gitlab Sync ID
gitlab_sync_export_parameters = Phrase::GitlabSyncExportParameters.new # GitlabSyncExportParameters | 
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Export from Phrase Strings to GitLab
  result = api_instance.gitlab_sync_export(gitlab_sync_id, gitlab_sync_export_parameters, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling GitLabSyncApi->gitlab_sync_export: #{e}"
end

Parameters

Name Type Description Notes
gitlab_sync_id String Gitlab Sync ID
gitlab_sync_export_parameters GitlabSyncExportParameters
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]

Return type

Response<(GitlabSyncExport)>

Authorization

Basic, Token

HTTP request headers

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

gitlab_sync_history

Array<GitlabSyncHistory> gitlab_sync_history(gitlab_sync_id, opts)

History of single Sync Setting

List history for a single 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::GitLabSyncApi.new
gitlab_sync_id = 'gitlab_sync_id_example' # String | Gitlab Sync ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
  page: 1, # Integer | Page number
  per_page: 25, # Integer | Limit on the number of objects to be returned, between 1 and 100. 25 by default
  account_id: 'abcd1234' # String | Account ID to specify the actual account the GitLab Sync should be created in. Required if the requesting user is a member of multiple accounts.
}

begin
  #History of single Sync Setting
  result = api_instance.gitlab_sync_history(gitlab_sync_id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling GitLabSyncApi->gitlab_sync_history: #{e}"
end

Parameters

Name Type Description Notes
gitlab_sync_id String Gitlab Sync ID
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]
page Integer Page number [optional]
per_page Integer Limit on the number of objects to be returned, between 1 and 100. 25 by default [optional]
account_id String Account ID to specify the actual account the GitLab Sync should be created in. Required if the requesting user is a member of multiple accounts. [optional]

Return type

Response<(Array<GitlabSyncHistory>)>

Authorization

Basic, Token

HTTP request headers

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

gitlab_sync_import

Array<Upload> gitlab_sync_import(gitlab_sync_id, gitlab_sync_import_parameters, opts)

Import from GitLab to Phrase

Import translations from GitLab to Phrase Strings according to the .phraseapp.yml file within the GitLab repository.

Note: 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::GitLabSyncApi.new
gitlab_sync_id = 'gitlab_sync_id_example' # String | Gitlab Sync ID
gitlab_sync_import_parameters = Phrase::GitlabSyncImportParameters.new # GitlabSyncImportParameters | 
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Import from GitLab to Phrase
  result = api_instance.gitlab_sync_import(gitlab_sync_id, gitlab_sync_import_parameters, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling GitLabSyncApi->gitlab_sync_import: #{e}"
end

Parameters

Name Type Description Notes
gitlab_sync_id String Gitlab Sync ID
gitlab_sync_import_parameters GitlabSyncImportParameters
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]

Return type

Response<(Array<Upload>)>

Authorization

Basic, Token

HTTP request headers

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

gitlab_sync_list

Array<GitlabSync> gitlab_sync_list(opts)

List GitLab syncs

List all GitLab Sync Settings for which synchronisation with Phrase Strings and GitLab is activated.

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::GitLabSyncApi.new
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
  account_id: 'abcd1234' # String | Account ID to specify the actual account the GitLab Sync should be created in. Required if the requesting user is a member of multiple accounts.
}

begin
  #List GitLab syncs
  result = api_instance.gitlab_sync_list(opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling GitLabSyncApi->gitlab_sync_list: #{e}"
end

Parameters

Name Type Description Notes
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]
account_id String Account ID to specify the actual account the GitLab Sync should be created in. Required if the requesting user is a member of multiple accounts. [optional]

Return type

Response<(Array<GitlabSync>)>

Authorization

Basic, Token

HTTP request headers

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

gitlab_sync_show

GitlabSync gitlab_sync_show(id, opts)

Get single Sync Setting

Shows a single GitLab 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::GitLabSyncApi.new
id = 'id_example' # String | ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
  account_id: 'abcd1234' # String | Account ID to specify the actual account the GitLab Sync should be created in. Required if the requesting user is a member of multiple accounts.
}

begin
  #Get single Sync Setting
  result = api_instance.gitlab_sync_show(id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling GitLabSyncApi->gitlab_sync_show: #{e}"
end

Parameters

Name Type Description Notes
id String ID
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]
account_id String Account ID to specify the actual account the GitLab Sync should be created in. Required if the requesting user is a member of multiple accounts. [optional]

Return type

Response<(GitlabSync)>

Authorization

Basic, Token

HTTP request headers

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

gitlab_sync_update

GitlabSync gitlab_sync_update(id, opts)

Update single Sync Setting

Updates a single GitLab 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::GitLabSyncApi.new
id = 'id_example' # String | ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
  account_id: 'abcd1234', # String | Account ID to specify the actual account the GitLab Sync should be created in. Required if the requesting user is a member of multiple accounts.
  phrase_project_code: '3456abcd', # String | Code of the related Phrase Strings Project.
  gitlab_project_id: 12345, # Integer | ID of the related GitLab Project.
  gitlab_branch_name: 'feature-development' # String | Name of the GitLab Branch.
}

begin
  #Update single Sync Setting
  result = api_instance.gitlab_sync_update(id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling GitLabSyncApi->gitlab_sync_update: #{e}"
end

Parameters

Name Type Description Notes
id String ID
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]
account_id String Account ID to specify the actual account the GitLab Sync should be created in. Required if the requesting user is a member of multiple accounts. [optional]
phrase_project_code String Code of the related Phrase Strings Project. [optional]
gitlab_project_id Integer ID of the related GitLab Project. [optional]
gitlab_branch_name String Name of the GitLab Branch. [optional]

Return type

Response<(GitlabSync)>

Authorization

Basic, Token

HTTP request headers

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