Class: Translator::Smartling::ApiRequestsGenerator
- Inherits:
-
Object
- Object
- Translator::Smartling::ApiRequestsGenerator
- Defined in:
- lib/nexmo_developer/app/services/translator/smartling/api_requests_generator.rb
Class Method Summary collapse
- .create_batch(job_id:, requests:) ⇒ Object
- .create_job(locales:, due_date:) ⇒ Object
- .download_file(locale:, file_uri:) ⇒ Object
- .file_uris ⇒ Object
- .get_file_status(file_uri:) ⇒ Object
- .project_id ⇒ Object
- .token ⇒ Object
- .upload_file(batch_id:, translation_request:) ⇒ Object
Class Method Details
.create_batch(job_id:, requests:) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/nexmo_developer/app/services/translator/smartling/api_requests_generator.rb', line 13 def self.create_batch(job_id:, requests:) ::Translator::Smartling::API::CreateBatch.call( project_id: project_id, job_id: job_id, token: token, requests: requests ) end |
.create_job(locales:, due_date:) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/nexmo_developer/app/services/translator/smartling/api_requests_generator.rb', line 4 def self.create_job(locales:, due_date:) ::Translator::Smartling::API::CreateJob.call( locales: locales, due_date: due_date, project_id: project_id, token: token ) end |
.download_file(locale:, file_uri:) ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/nexmo_developer/app/services/translator/smartling/api_requests_generator.rb', line 46 def self.download_file(locale:, file_uri:) ::Translator::Smartling::API::DownloadFile.call( project_id: project_id, token: token, locale_id: locale, file_uri: file_uri ) end |
.file_uris ⇒ Object
31 32 33 34 35 36 |
# File 'lib/nexmo_developer/app/services/translator/smartling/api_requests_generator.rb', line 31 def self.file_uris ::Translator::Smartling::API::FileUris.call( project_id: project_id, token: token ) end |
.get_file_status(file_uri:) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/nexmo_developer/app/services/translator/smartling/api_requests_generator.rb', line 38 def self.get_file_status(file_uri:) ::Translator::Smartling::API::FileStatus.call( project_id: project_id, token: token, file_uri: file_uri ) end |
.project_id ⇒ Object
59 60 61 |
# File 'lib/nexmo_developer/app/services/translator/smartling/api_requests_generator.rb', line 59 def self.project_id @project_id ||= ENV['SMARTLING_PROJECT_ID'] end |
.token ⇒ Object
55 56 57 |
# File 'lib/nexmo_developer/app/services/translator/smartling/api_requests_generator.rb', line 55 def self.token @token ||= Translator::Smartling::TokenGenerator.token end |
.upload_file(batch_id:, translation_request:) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/nexmo_developer/app/services/translator/smartling/api_requests_generator.rb', line 22 def self.upload_file(batch_id:, translation_request:) ::Translator::Smartling::API::UploadFile.call( project_id: project_id, batch_id: batch_id, token: token, translation_request: translation_request ) end |