Module: Crowdin::ApiResources::MachineTranslationEngines
- Defined in:
- lib/crowdin-api/api_resources/machine_translation_engines.rb
Instance Method Summary collapse
- #add_mt(query = {}) ⇒ Object
- #delete_mt(mt_id = nil) ⇒ Object
- #edit_mt(mt_id = nil, query = {}) ⇒ Object
- #get_mt(mt_id = nil) ⇒ Object
- #list_mts(query = {}) ⇒ Object
- #translate_via_mt(mt_id = nil, query = {}) ⇒ Object
Instance Method Details
#add_mt(query = {}) ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/crowdin-api/api_resources/machine_translation_engines.rb', line 69 def add_mt(query = {}) enterprise_mode? || raise_only_for_enterprise_mode_error request = Web::Request.new( connection, :post, "#{config.target_api_url}/mts", { params: query } ) Web::SendRequest.new(request).perform end |
#delete_mt(mt_id = nil) ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/crowdin-api/api_resources/machine_translation_engines.rb', line 83 def delete_mt(mt_id = nil) enterprise_mode? || raise_only_for_enterprise_mode_error mt_id || raise_parameter_is_required_error(:mt_id) request = Web::Request.new( connection, :delete, "#{config.target_api_url}/mts/#{mt_id}" ) Web::SendRequest.new(request).perform end |
#edit_mt(mt_id = nil, query = {}) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/crowdin-api/api_resources/machine_translation_engines.rb', line 54 def edit_mt(mt_id = nil, query = {}) enterprise_mode? || raise_only_for_enterprise_mode_error mt_id || raise_parameter_is_required_error(:mt_id) request = Web::Request.new( connection, :patch, "#{config.target_api_url}/mts/#{mt_id}", { params: query } ) Web::SendRequest.new(request).perform end |
#get_mt(mt_id = nil) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/crowdin-api/api_resources/machine_translation_engines.rb', line 22 def get_mt(mt_id = nil) mt_id || raise_parameter_is_required_error(:mt_id) request = Web::Request.new( connection, :get, "#{config.target_api_url}/mts/#{mt_id}" ) Web::SendRequest.new(request).perform end |
#list_mts(query = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/crowdin-api/api_resources/machine_translation_engines.rb', line 9 def list_mts(query = {}) request = Web::Request.new( connection, :get, "#{config.target_api_url}/mts", { params: query } ) Web::SendRequest.new(request).perform end |
#translate_via_mt(mt_id = nil, query = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/crowdin-api/api_resources/machine_translation_engines.rb', line 37 def translate_via_mt(mt_id = nil, query = {}) mt_id || raise_parameter_is_required_error(:mt_id) request = Web::Request.new( connection, :post, "#{config.target_api_url}/mts/#{mt_id}/translations", { params: query } ) Web::SendRequest.new(request).perform end |