Skip to content

Latest commit

 

History

History
331 lines (232 loc) · 8.79 KB

StyleGuidesApi.md

File metadata and controls

331 lines (232 loc) · 8.79 KB

Phrase::StyleGuidesApi

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

Method HTTP request Description
styleguide_create POST /projects/{project_id}/styleguides Create a style guide
styleguide_delete DELETE /projects/{project_id}/styleguides/{id} Delete a style guide
styleguide_show GET /projects/{project_id}/styleguides/{id} Get a single style guide
styleguide_update PATCH /projects/{project_id}/styleguides/{id} Update a style guide
styleguides_list GET /projects/{project_id}/styleguides List style guides

styleguide_create

StyleguideDetails styleguide_create(project_id, styleguide_create_parameters, opts)

Create a style guide

Create a new style guide.

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::StyleGuidesApi.new
project_id = 'project_id_example' # String | Project ID
styleguide_create_parameters = Phrase::StyleguideCreateParameters.new({title: 'Web application style guide'}) # StyleguideCreateParameters | 
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Create a style guide
  result = api_instance.styleguide_create(project_id, styleguide_create_parameters, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling StyleGuidesApi->styleguide_create: #{e}"
end

Parameters

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

Return type

Response<(StyleguideDetails)>

Authorization

Basic, Token

HTTP request headers

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

styleguide_delete

styleguide_delete(project_id, id, opts)

Delete a style guide

Delete an existing style guide.

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

begin
  #Delete a style guide
  api_instance.styleguide_delete(project_id, id, opts)
rescue Phrase::ApiError => e
  puts "Exception when calling StyleGuidesApi->styleguide_delete: #{e}"
end

Parameters

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

styleguide_show

StyleguideDetails styleguide_show(project_id, id, opts)

Get a single style guide

Get details on a single style guide.

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::StyleGuidesApi.new
project_id = 'project_id_example' # String | Project 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 style guide
  result = api_instance.styleguide_show(project_id, id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling StyleGuidesApi->styleguide_show: #{e}"
end

Parameters

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

Return type

Response<(StyleguideDetails)>

Authorization

Basic, Token

HTTP request headers

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

styleguide_update

StyleguideDetails styleguide_update(project_id, id, styleguide_update_parameters, opts)

Update a style guide

Update an existing style guide.

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::StyleGuidesApi.new
project_id = 'project_id_example' # String | Project ID
id = 'id_example' # String | ID
styleguide_update_parameters = Phrase::StyleguideUpdateParameters.new # StyleguideUpdateParameters | 
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Update a style guide
  result = api_instance.styleguide_update(project_id, id, styleguide_update_parameters, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling StyleGuidesApi->styleguide_update: #{e}"
end

Parameters

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

Return type

Response<(StyleguideDetails)>

Authorization

Basic, Token

HTTP request headers

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

styleguides_list

Array<Styleguide> styleguides_list(project_id, opts)

List style guides

List all styleguides 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::StyleGuidesApi.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 style guides
  result = api_instance.styleguides_list(project_id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling StyleGuidesApi->styleguides_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<Styleguide>)>

Authorization

Basic, Token

HTTP request headers

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