Module: Crowdin::ApiResources::Applications

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

Instance Method Summary collapse

Instance Method Details

#add_application_data(query = {}, application_identifier = nil, path = nil) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/crowdin-api/api_resources/applications.rb', line 37

def add_application_data(query = {}, application_identifier = nil, path = nil)
  application_identifier || raise_parameter_is_required_error(:application_identifier)
  application_identifier || raise_parameter_is_required_error(:path)

  request = Web::Request.new(
    connection,
    :post,
    "#{config.target_api_url}/applications/#{application_identifier}/api/#{path}",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#delete_application_data(query = {}, application_identifier = nil, path = nil) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/crowdin-api/api_resources/applications.rb', line 52

def delete_application_data(query = {}, application_identifier = nil, path = nil)
  application_identifier || raise_parameter_is_required_error(:application_identifier)
  application_identifier || raise_parameter_is_required_error(:path)

  request = Web::Request.new(
    connection,
    :delete,
    "#{config.target_api_url}/applications/#{application_identifier}/api/#{path}",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#edit_application_data(query = {}, application_identifier = nil, path = nil) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/crowdin-api/api_resources/applications.rb', line 67

def edit_application_data(query = {}, application_identifier = nil, path = nil)
  application_identifier || raise_parameter_is_required_error(:application_identifier)
  application_identifier || raise_parameter_is_required_error(:path)

  request = Web::Request.new(
    connection,
    :patch,
    "#{config.target_api_url}/applications/#{application_identifier}/api/#{path}",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#get_application_data(application_identifier = nil, path = nil) ⇒ Object



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

def get_application_data(application_identifier = nil, path = nil)
  application_identifier || raise_parameter_is_required_error(:application_identifier)
  application_identifier || raise_parameter_is_required_error(:path)

  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/applications/#{application_identifier}/api/#{path}"
  )
  Web::SendRequest.new(request).perform
end

#update_or_restore_application_data(query = {}, application_identifier = nil, path = nil) ⇒ Object



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

def update_or_restore_application_data(query = {}, application_identifier = nil, path = nil)
  application_identifier || raise_parameter_is_required_error(:application_identifier)
  application_identifier || raise_parameter_is_required_error(:path)

  request = Web::Request.new(
    connection,
    :put,
    "#{config.target_api_url}/applications/#{application_identifier}/api/#{path}",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end