Skip to content

Latest commit

 

History

History
589 lines (414 loc) · 15.6 KB

File metadata and controls

589 lines (414 loc) · 15.6 KB

Phrase::BranchesApi

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

Method HTTP request Description
branch_compare GET /projects/{project_id}/branches/{name}/compare Compare branches
branch_comparison_create POST /projects/{project_id}/branches/{name}/compare Create comparison (async.)
branch_create POST /projects/{project_id}/branches Create a branch
branch_delete DELETE /projects/{project_id}/branches/{name} Delete a branch
branch_merge PATCH /projects/{project_id}/branches/{name}/merge Merge a branch
branch_show GET /projects/{project_id}/branches/{name} Get a single branch
branch_sync PATCH /projects/{project_id}/branches/{name}/sync Sync a branch
branch_update PATCH /projects/{project_id}/branches/{name} Update a branch
branches_list GET /projects/{project_id}/branches List branches

branch_compare

branch_compare(project_id, name, opts)

Compare branches

Compare branch with main branch. Note: Comparing a branch may take several minutes depending on the project size. Consider using the POST /compare endpoint for creating comparison asynchronously.

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::BranchesApi.new
project_id = 'project_id_example' # String | Project ID
name = 'name_example' # String | name
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Compare branches
  api_instance.branch_compare(project_id, name, opts)
rescue Phrase::ApiError => e
  puts "Exception when calling BranchesApi->branch_compare: #{e}"
end

Parameters

Name Type Description Notes
project_id String Project ID
name String name
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]

Return type

Response<(nil (empty response body))>

Authorization

Basic, Token

HTTP request headers

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

branch_comparison_create

branch_comparison_create(project_id, name, branch_create_comparison_parameters, opts)

Create comparison (async.)

Create a branch comparison asynchronously.

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::BranchesApi.new
project_id = 'project_id_example' # String | Project ID
name = 'name_example' # String | name
branch_create_comparison_parameters = Phrase::BranchCreateComparisonParameters.new # BranchCreateComparisonParameters | 
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Create comparison (async.)
  api_instance.branch_comparison_create(project_id, name, branch_create_comparison_parameters, opts)
rescue Phrase::ApiError => e
  puts "Exception when calling BranchesApi->branch_comparison_create: #{e}"
end

Parameters

Name Type Description Notes
project_id String Project ID
name String name
branch_create_comparison_parameters BranchCreateComparisonParameters
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]

Return type

Response<(nil (empty response body))>

Authorization

Basic, Token

HTTP request headers

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

branch_create

Branch branch_create(project_id, branch_create_parameters, opts)

Create a branch

Create a new branch. Note: Creating a new branch may take several minutes 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::BranchesApi.new
project_id = 'project_id_example' # String | Project ID
branch_create_parameters = Phrase::BranchCreateParameters.new({name: 'my-branch'}) # BranchCreateParameters | 
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Create a branch
  result = api_instance.branch_create(project_id, branch_create_parameters, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling BranchesApi->branch_create: #{e}"
end

Parameters

Name Type Description Notes
project_id String Project ID
branch_create_parameters BranchCreateParameters
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]

Return type

Response<(Branch)>

Authorization

Basic, Token

HTTP request headers

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

branch_delete

branch_delete(project_id, name, opts)

Delete a branch

Delete an existing branch.

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::BranchesApi.new
project_id = 'project_id_example' # String | Project ID
name = 'name_example' # String | name
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Delete a branch
  api_instance.branch_delete(project_id, name, opts)
rescue Phrase::ApiError => e
  puts "Exception when calling BranchesApi->branch_delete: #{e}"
end

Parameters

Name Type Description Notes
project_id String Project ID
name String name
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]

Return type

Response<(nil (empty response body))>

Authorization

Basic, Token

HTTP request headers

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

branch_merge

branch_merge(project_id, name, branch_merge_parameters, opts)

Merge a branch

Merge an existing branch. Note: Merging a branch may take several minutes depending on diff 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::BranchesApi.new
project_id = 'project_id_example' # String | Project ID
name = 'name_example' # String | name
branch_merge_parameters = Phrase::BranchMergeParameters.new # BranchMergeParameters | 
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Merge a branch
  api_instance.branch_merge(project_id, name, branch_merge_parameters, opts)
rescue Phrase::ApiError => e
  puts "Exception when calling BranchesApi->branch_merge: #{e}"
end

Parameters

Name Type Description Notes
project_id String Project ID
name String name
branch_merge_parameters BranchMergeParameters
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]

Return type

Response<(nil (empty response body))>

Authorization

Basic, Token

HTTP request headers

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

branch_show

Branch branch_show(project_id, name, opts)

Get a single branch

Get details on a single branch for a given project.

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::BranchesApi.new
project_id = 'project_id_example' # String | Project ID
name = 'name_example' # String | name
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Get a single branch
  result = api_instance.branch_show(project_id, name, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling BranchesApi->branch_show: #{e}"
end

Parameters

Name Type Description Notes
project_id String Project ID
name String name
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]

Return type

Response<(Branch)>

Authorization

Basic, Token

HTTP request headers

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

branch_sync

branch_sync(project_id, name, branch_sync_parameters, opts)

Sync a branch

Sync an existing branch. Note: Only available for branches created with new branching.

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::BranchesApi.new
project_id = 'project_id_example' # String | Project ID
name = 'name_example' # String | name
branch_sync_parameters = Phrase::BranchSyncParameters.new # BranchSyncParameters | 
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Sync a branch
  api_instance.branch_sync(project_id, name, branch_sync_parameters, opts)
rescue Phrase::ApiError => e
  puts "Exception when calling BranchesApi->branch_sync: #{e}"
end

Parameters

Name Type Description Notes
project_id String Project ID
name String name
branch_sync_parameters BranchSyncParameters
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]

Return type

Response<(nil (empty response body))>

Authorization

Basic, Token

HTTP request headers

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

branch_update

Branch branch_update(project_id, name, branch_update_parameters, opts)

Update a branch

Update an existing branch.

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::BranchesApi.new
project_id = 'project_id_example' # String | Project ID
name = 'name_example' # String | name
branch_update_parameters = Phrase::BranchUpdateParameters.new # BranchUpdateParameters | 
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Update a branch
  result = api_instance.branch_update(project_id, name, branch_update_parameters, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling BranchesApi->branch_update: #{e}"
end

Parameters

Name Type Description Notes
project_id String Project ID
name String name
branch_update_parameters BranchUpdateParameters
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]

Return type

Response<(Branch)>

Authorization

Basic, Token

HTTP request headers

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

branches_list

Array<Branch> branches_list(project_id, opts)

List branches

List all branches the of the current project.

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::BranchesApi.new
project_id = 'project_id_example' # String | Project 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
}

begin
  #List branches
  result = api_instance.branches_list(project_id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling BranchesApi->branches_list: #{e}"
end

Parameters

Name Type Description Notes
project_id String Project 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]

Return type

Response<(Array<Branch>)>

Authorization

Basic, Token

HTTP request headers

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