Module: RubyLokaliseApi::Rest::CustomTranslationStatuses

Included in:
RubyLokaliseApi::Rest
Defined in:
lib/ruby_lokalise_api/rest/custom_translation_statuses.rb

Instance Method Summary collapse

Instance Method Details

#create_custom_translation_status(project_id, req_params) ⇒ RubyLokaliseApi::Resources::CustomTranslationStatus

Creates a custom translation status

Parameters:

  • project_id (String)
  • req_params (Hash)

Returns:

See Also:



41
42
43
44
45
46
47
# File 'lib/ruby_lokalise_api/rest/custom_translation_statuses.rb', line 41

def create_custom_translation_status(project_id, req_params)
  params = { query: project_id, req: req_params }

  data = endpoint(name: 'CustomTranslationStatuses', params: params).do_post

  resource 'CustomTranslationStatus', data
end

#custom_translation_status(project_id, status_id) ⇒ RubyLokaliseApi::Resources::CustomTranslationStatus

Returns a custom translation status

Parameters:

  • project_id (String)
  • status_id (String, Integer)

Returns:

See Also:



12
13
14
15
16
17
18
# File 'lib/ruby_lokalise_api/rest/custom_translation_statuses.rb', line 12

def custom_translation_status(project_id, status_id)
  params = { query: [project_id, status_id] }

  data = endpoint(name: 'CustomTranslationStatuses', params: params).do_get

  resource 'CustomTranslationStatus', data
end

#custom_translation_status_colors(project_id) ⇒ RubyLokaliseApi::Generics::CustomStatusAvailableColors

Retrieves an array of available colors that can be assigned to custom translation statuses



83
84
85
86
87
88
89
# File 'lib/ruby_lokalise_api/rest/custom_translation_statuses.rb', line 83

def custom_translation_status_colors(project_id)
  params = { query: [project_id, :colors] }

  data = endpoint(name: 'CustomTranslationStatuses', params: params).do_get

  RubyLokaliseApi::Generics::CustomStatusAvailableColors.new data.content
end

#custom_translation_statuses(project_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::CustomTranslationStatuses

Returns custom translation statuses for the project

Parameters:

  • project_id (String)
  • req_params (Hash) (defaults to: {})

Returns:

See Also:



26
27
28
29
30
31
32
33
# File 'lib/ruby_lokalise_api/rest/custom_translation_statuses.rb', line 26

def custom_translation_statuses(project_id, req_params = {})
  name = 'CustomTranslationStatuses'
  params = { query: project_id, req: req_params }

  data = endpoint(name: name, params: params).do_get

  collection name, data
end

#destroy_custom_translation_status(project_id, status_id) ⇒ RubyLokaliseApi::Generics::DeletedResource

Deletes a custom translation status

Parameters:

  • project_id (String)
  • status_id (Integer, String)

Returns:

See Also:



70
71
72
73
74
75
76
# File 'lib/ruby_lokalise_api/rest/custom_translation_statuses.rb', line 70

def destroy_custom_translation_status(project_id, status_id)
  params = { query: [project_id, status_id] }

  data = endpoint(name: 'CustomTranslationStatuses', params: params).do_delete

  RubyLokaliseApi::Generics::DeletedResource.new data.content
end

#update_custom_translation_status(project_id, status_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::CustomTranslationStatus

Updates a custom translation status

Parameters:

  • project_id (String)
  • status_id (Integer, String)
  • req_params (Hash) (defaults to: {})

Returns:

See Also:



56
57
58
59
60
61
62
# File 'lib/ruby_lokalise_api/rest/custom_translation_statuses.rb', line 56

def update_custom_translation_status(project_id, status_id, req_params = {})
  params = { query: [project_id, status_id], req: req_params }

  data = endpoint(name: 'CustomTranslationStatuses', params: params).do_put

  resource 'CustomTranslationStatus', data
end