Module: Crowdin::ApiResources::Screenshots

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

Instance Method Summary collapse

Instance Method Details

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



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

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

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

#add_tag(screenshot_id = nil, query = {}, project_id = config.project_id) ⇒ Object



106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/crowdin-api/api_resources/screenshots.rb', line 106

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

  request = Web::Request.new(
    connection,
    :post,
    "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#clear_tags(screenshot_id = nil, project_id = config.project_id) ⇒ Object



119
120
121
122
123
124
125
126
127
128
129
# File 'lib/crowdin-api/api_resources/screenshots.rb', line 119

def clear_tags(screenshot_id = nil, project_id = config.project_id)
  screenshot_id || raise_parameter_is_required_error(:screenshot_id)
  project_id    || raise_project_id_is_required_error

  request = Web::Request.new(
    connection,
    :delete,
    "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags"
  )
  Web::SendRequest.new(request).perform
end

#delete_screenshot(screenshot_id = nil, project_id = config.project_id) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/crowdin-api/api_resources/screenshots.rb', line 55

def delete_screenshot(screenshot_id = nil, project_id = config.project_id)
  screenshot_id || raise_parameter_is_required_error(:screenshot_id)
  project_id    || raise_project_id_is_required_error

  request = Web::Request.new(
    connection,
    :delete,
    "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}"
  )
  Web::SendRequest.new(request).perform
end

#delete_tag(screenshot_id = nil, tag_id = nil, project_id = config.project_id) ⇒ Object



144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/crowdin-api/api_resources/screenshots.rb', line 144

def delete_tag(screenshot_id = nil, tag_id = nil, project_id = config.project_id)
  screenshot_id || raise_parameter_is_required_error(:screenshot_id)
  tag_id        || raise_parameter_is_required_error(:tag_id)
  project_id    || raise_project_id_is_required_error

  request = Web::Request.new(
    connection,
    :delete,
    "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags/#{tag_id}"
  )
  Web::SendRequest.new(request).perform
end

#edit_screenshot(screenshot_id = nil, query = {}, project_id = config.project_id) ⇒ Object



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

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

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

#edit_tag(screenshot_id = nil, tag_id = nil, query = {}, project_id = config.project_id) ⇒ Object



157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/crowdin-api/api_resources/screenshots.rb', line 157

def edit_tag(screenshot_id = nil, tag_id = nil, query = {}, project_id = config.project_id)
  screenshot_id || raise_parameter_is_required_error(:screenshot_id)
  tag_id        || raise_parameter_is_required_error(:tag_id)
  project_id    || raise_project_id_is_required_error

  request = Web::Request.new(
    connection,
    :patch,
    "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags/#{tag_id}",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#get_screenshot(screenshot_id = nil, project_id = config.project_id) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/crowdin-api/api_resources/screenshots.rb', line 30

def get_screenshot(screenshot_id = nil, project_id = config.project_id)
  screenshot_id || raise_parameter_is_required_error(:screenshot_id)
  project_id    || raise_project_id_is_required_error

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

#get_tag(screenshot_id = nil, tag_id = nil, project_id = config.project_id) ⇒ Object



131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/crowdin-api/api_resources/screenshots.rb', line 131

def get_tag(screenshot_id = nil, tag_id = nil, project_id = config.project_id)
  screenshot_id || raise_parameter_is_required_error(:screenshot_id)
  tag_id        || raise_parameter_is_required_error(:tag_id)
  project_id    || raise_project_id_is_required_error

  request = Web::Request.new(
    connection,
    :get,
    "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags/#{tag_id}"
  )
  Web::SendRequest.new(request).perform
end

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



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

def list_screenshots(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}/screenshots",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#list_tags(screenshot_id = nil, query = {}, project_id = config.project_id) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/crowdin-api/api_resources/screenshots.rb', line 80

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

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

#replace_tags(screenshot_id = nil, query = {}, project_id = config.project_id) ⇒ Object



93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/crowdin-api/api_resources/screenshots.rb', line 93

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

  request = Web::Request.new(
    connection,
    :put,
    "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags",
    { params: query }
  )
  Web::SendRequest.new(request).perform
end

#update_screenshot(screenshot_id = nil, query = {}, project_id = config.project_id) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/crowdin-api/api_resources/screenshots.rb', line 42

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

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