Module: Crowdin::ApiResources::TranslationStatus

Defined in:
lib/crowdin-api/api_resources/translation_status.rb

Instance Method Summary collapse

Instance Method Details

#get_branch_progress(branch_id = nil, query = {}, project_id = config.project_id) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/crowdin-api/api_resources/translation_status.rb', line 6

def get_branch_progress(branch_id = nil, query = {}, project_id = config.project_id)
  branch_id  || raise_parameter_is_required_error(:branch_id)
  project_id || raise_project_id_is_required_error

  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/projects/#{project_id}/branches/#{branch_id}/languages/progress",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#get_directory_progress(directory_id = nil, query = {}, project_id = config.project_id) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/crowdin-api/api_resources/translation_status.rb', line 19

def get_directory_progress(directory_id = nil, query = {}, project_id = config.project_id)
  directory_id || raise_parameter_is_required_error(:directory_id)
  project_id   || raise_project_id_is_required_error

  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/projects/#{project_id}/directories/#{directory_id}/languages/progress",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#get_file_progress(file_id = nil, query = {}, project_id = config.project_id) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/crowdin-api/api_resources/translation_status.rb', line 32

def get_file_progress(file_id = nil, query = {}, project_id = config.project_id)
  file_id    || raise_parameter_is_required_error(:file_id)
  project_id || raise_project_id_is_required_error

  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/projects/#{project_id}/files/#{file_id}/languages/progress",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#get_language_progress(language_id = nil, query = {}, project_id = config.project_id) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/crowdin-api/api_resources/translation_status.rb', line 45

def get_language_progress(language_id = nil, query = {}, project_id = config.project_id)
  language_id || raise_parameter_is_required_error(:language_id)
  project_id  || raise_project_id_is_required_error

  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/projects/#{project_id}/languages/#{language_id}/progress",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#get_project_progress(query = {}, project_id = config.project_id) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
# File 'lib/crowdin-api/api_resources/translation_status.rb', line 58

def get_project_progress(query = {}, project_id = config.project_id)
  project_id || raise_project_id_is_required_error

  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/projects/#{project_id}/languages/progress",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#get_qa_progress(query = {}, project_id = config.project_id) ⇒ Object



70
71
72
73
74
75
76
77
78
79
80
# File 'lib/crowdin-api/api_resources/translation_status.rb', line 70

def get_qa_progress(query = {}, project_id = config.project_id)
  project_id || raise_project_id_is_required_error

  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/projects/#{project_id}/qa-checks",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end