Skip to content

Latest commit

 

History

History
273 lines (193 loc) · 7.1 KB

TagsApi.md

File metadata and controls

273 lines (193 loc) · 7.1 KB

Phrase::TagsApi

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

Method HTTP request Description
tag_create POST /projects/{project_id}/tags Create a tag
tag_delete DELETE /projects/{project_id}/tags/{name} Delete a tag
tag_show GET /projects/{project_id}/tags/{name} Get a single tag
tags_list GET /projects/{project_id}/tags List tags

tag_create

TagWithStats tag_create(project_id, tag_create_parameters, opts)

Create a tag

Create a new tag.

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

begin
  #Create a tag
  result = api_instance.tag_create(project_id, tag_create_parameters, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling TagsApi->tag_create: #{e}"
end

Parameters

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

Return type

Response<(TagWithStats)>

Authorization

Basic, Token

HTTP request headers

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

tag_delete

tag_delete(project_id, name, opts)

Delete a tag

Delete an existing tag.

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::TagsApi.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)
  branch: 'my-feature-branch' # String | specify the branch to use
}

begin
  #Delete a tag
  api_instance.tag_delete(project_id, name, opts)
rescue Phrase::ApiError => e
  puts "Exception when calling TagsApi->tag_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]
branch String specify the branch to use [optional]

Return type

Response<(nil (empty response body))>

Authorization

Basic, Token

HTTP request headers

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

tag_show

TagWithStats tag_show(project_id, name, opts)

Get a single tag

Get details and progress information on a single tag 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::TagsApi.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)
  branch: 'my-feature-branch' # String | specify the branch to use
}

begin
  #Get a single tag
  result = api_instance.tag_show(project_id, name, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling TagsApi->tag_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]
branch String specify the branch to use [optional]

Return type

Response<(TagWithStats)>

Authorization

Basic, Token

HTTP request headers

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

tags_list

Array<Tag> tags_list(project_id, opts)

List tags

List all tags for the 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::TagsApi.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
  exclude_system_tags: true, # Boolean | excludes tags generated by the system, e.g. job, upload or figma tags
  branch: 'my-feature-branch' # String | specify the branch to use
}

begin
  #List tags
  result = api_instance.tags_list(project_id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling TagsApi->tags_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]
exclude_system_tags Boolean excludes tags generated by the system, e.g. job, upload or figma tags [optional]
branch String specify the branch to use [optional]

Return type

Response<(Array<Tag>)>

Authorization

Basic, Token

HTTP request headers

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