Module: Crowdin::ApiResources::Workflows

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

Instance Method Summary collapse

Instance Method Details

#get_workflow_step(step_id = nil, project_id = config.project_id) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/crowdin-api/api_resources/workflows.rb', line 21

def get_workflow_step(step_id = nil, project_id = config.project_id)
  enterprise_mode? || raise_only_for_enterprise_mode_error
  step_id          || raise_parameter_is_required_error(:step_id)
  project_id       || raise_project_id_is_required_error

  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/projects/#{project_id}/workflow-steps/#{step_id}"
  )
  Web::SendRequest.new(request).perform
end

#get_workflow_template(template_id = nil) ⇒ Object



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

def get_workflow_template(template_id = nil)
  enterprise_mode? || raise_only_for_enterprise_mode_error
  template_id      || raise_parameter_is_required_error(:template_id)

  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/workflow-templates/#{template_id}"
  )
  Web::SendRequest.new(request).perform
end

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

– For Enterprise mode only –



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/crowdin-api/api_resources/workflows.rb', line 8

def list_workflow_steps(query = {}, project_id = config.project_id)
  enterprise_mode? || raise_only_for_enterprise_mode_error
  project_id       || raise_project_id_is_required_error

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

#list_workflow_templates(query = {}) ⇒ Object



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

def list_workflow_templates(query = {})
  enterprise_mode? || raise_only_for_enterprise_mode_error

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