crowdin-api 1.1.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/docs.yml +31 -0
  3. data/.github/workflows/test-and-lint.yml +1 -1
  4. data/.gitignore +2 -2
  5. data/.rubocop_todo.yml +114 -48
  6. data/Gemfile +3 -0
  7. data/README.md +61 -17
  8. data/bin/crowdin-console +5 -5
  9. data/crowdin-api.gemspec +1 -2
  10. data/lib/crowdin-api/api_resources/bundles.rb +104 -0
  11. data/lib/crowdin-api/api_resources/dictionaries.rb +32 -0
  12. data/lib/crowdin-api/api_resources/distributions.rb +92 -0
  13. data/lib/crowdin-api/api_resources/glossaries.rb +248 -0
  14. data/lib/crowdin-api/api_resources/labels.rb +98 -0
  15. data/lib/crowdin-api/api_resources/languages.rb +61 -0
  16. data/lib/crowdin-api/api_resources/machine_translation_engines.rb +79 -0
  17. data/lib/crowdin-api/api_resources/projects.rb +151 -0
  18. data/lib/crowdin-api/api_resources/reports.rb +184 -0
  19. data/lib/crowdin-api/api_resources/screenshots.rb +172 -0
  20. data/lib/crowdin-api/api_resources/source_files.rb +305 -0
  21. data/lib/crowdin-api/{api-resources → api_resources}/source_strings.rb +19 -24
  22. data/lib/crowdin-api/api_resources/storages.rb +66 -0
  23. data/lib/crowdin-api/api_resources/string_comments.rb +68 -0
  24. data/lib/crowdin-api/api_resources/string_translations.rb +193 -0
  25. data/lib/crowdin-api/api_resources/tasks.rb +102 -0
  26. data/lib/crowdin-api/api_resources/teams.rb +135 -0
  27. data/lib/crowdin-api/api_resources/translation_memory.rb +131 -0
  28. data/lib/crowdin-api/{api-resources → api_resources}/translation_status.rb +24 -30
  29. data/lib/crowdin-api/{api-resources → api_resources}/translations.rb +41 -59
  30. data/lib/crowdin-api/api_resources/users.rb +161 -0
  31. data/lib/crowdin-api/api_resources/vendors.rb +21 -0
  32. data/lib/crowdin-api/api_resources/webhooks.rb +68 -0
  33. data/lib/crowdin-api/api_resources/workflows.rb +59 -0
  34. data/lib/crowdin-api/client/client.rb +155 -47
  35. data/lib/crowdin-api/client/configuration.rb +16 -12
  36. data/lib/crowdin-api/client/version.rb +1 -1
  37. data/lib/crowdin-api/core/errors.rb +3 -1
  38. data/lib/crowdin-api/core/{api_errors_raiser.rb → errors_raisers.rb} +21 -11
  39. data/lib/crowdin-api/core/fetch_all_extensions.rb +9 -0
  40. data/lib/crowdin-api/core/request.rb +50 -90
  41. data/lib/crowdin-api/core/send_request.rb +67 -0
  42. data/lib/crowdin-api.rb +21 -11
  43. data/spec/api_resources/bundles_spec.rb +61 -0
  44. data/spec/api_resources/dictionaries_spec.rb +23 -0
  45. data/spec/api_resources/distributions_spec.rb +71 -0
  46. data/spec/api_resources/glossaries_spec.rb +210 -0
  47. data/spec/api_resources/labels_spec.rb +71 -0
  48. data/spec/api_resources/languages_spec.rb +51 -0
  49. data/spec/api_resources/machine_translation_engines_spec.rb +63 -0
  50. data/spec/api_resources/projects_spec.rb +215 -0
  51. data/spec/api_resources/reports_spec.rb +145 -0
  52. data/spec/api_resources/screenshots_spec.rb +134 -0
  53. data/spec/api_resources/source_files_spec.rb +184 -0
  54. data/spec/api_resources/source_strings_spec.rb +51 -0
  55. data/spec/api_resources/storages_spec.rb +41 -0
  56. data/spec/api_resources/string_comments_spec.rb +51 -0
  57. data/spec/api_resources/string_translations_spec.rb +141 -0
  58. data/spec/api_resources/tasks_spec.rb +79 -0
  59. data/spec/api_resources/teams_spec.rb +100 -0
  60. data/spec/api_resources/translation_memory_spec.rb +114 -0
  61. data/spec/api_resources/translation_status_spec.rb +61 -0
  62. data/spec/api_resources/translations_spec.rb +107 -0
  63. data/spec/api_resources/users_spec.rb +117 -0
  64. data/spec/api_resources/vendors_spec.rb +13 -0
  65. data/spec/api_resources/webhooks_spec.rb +51 -0
  66. data/spec/api_resources/workflows_spec.rb +41 -0
  67. data/spec/spec_helper.rb +23 -2
  68. data/spec/unit/client_spec.rb +91 -0
  69. metadata +69 -28
  70. data/bin/setup +0 -6
  71. data/lib/crowdin-api/api-resources/languages.rb +0 -81
  72. data/lib/crowdin-api/api-resources/projects.rb +0 -134
  73. data/lib/crowdin-api/api-resources/source_files.rb +0 -303
  74. data/lib/crowdin-api/api-resources/storages.rb +0 -102
  75. data/lib/crowdin-api/api-resources/workflows.rb +0 -59
  76. data/spec/core/config-instance_spec.rb +0 -72
  77. data/spec/crowdin-api_spec.rb +0 -7
@@ -0,0 +1,151 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Crowdin
4
+ module ApiResources
5
+ module Projects
6
+ # * {https://developer.crowdin.com/api/v2/#operation/api.projects.getMany API Documentation}
7
+ # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.getMany Enterprise API Documentation}
8
+ # @param query [Hash] Request Body
9
+ def list_projects(query = {})
10
+ request = Web::Request.new(
11
+ connection,
12
+ :get,
13
+ "#{config.target_api_url}/projects",
14
+ { params: query }
15
+ )
16
+ Web::SendRequest.new(request).perform
17
+ end
18
+
19
+ # * {https://developer.crowdin.com/api/v2/#operation/api.projects.post API Documentation}
20
+ # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.post Enterprise API Documentation}
21
+ # @param query [Hash] Request Body
22
+ def add_project(query = {})
23
+ request = Web::Request.new(
24
+ connection,
25
+ :post,
26
+ "#{config.target_api_url}/projects",
27
+ { params: query }
28
+ )
29
+ Web::SendRequest.new(request).perform
30
+ end
31
+
32
+ # * {https://developer.crowdin.com/api/v2/#operation/api.projects.get API Documentation}
33
+ # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.get Enterprise API Documentation}
34
+ # @param project_id [Integer] Project ID
35
+ def get_project(project_id = nil)
36
+ project_id || raise_parameter_is_required_error(:project_id)
37
+
38
+ request = Web::Request.new(
39
+ connection,
40
+ :get,
41
+ "#{config.target_api_url}/projects/#{project_id}"
42
+ )
43
+ Web::SendRequest.new(request).perform
44
+ end
45
+
46
+ # * {https://developer.crowdin.com/api/v2/#operation/api.projects.delete API Documentation}
47
+ # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.delete Enterprise API Documentation}
48
+ # @param project_id [Integer] Project ID
49
+ def delete_project(project_id = nil)
50
+ project_id || raise_parameter_is_required_error(:project_id)
51
+
52
+ request = Web::Request.new(
53
+ connection,
54
+ :delete,
55
+ "#{config.target_api_url}/projects/#{project_id}"
56
+ )
57
+ Web::SendRequest.new(request).perform
58
+ end
59
+
60
+ # @param project_id [Integer] Project ID
61
+ # @param query [Hash] Request Body
62
+ # * {https://developer.crowdin.com/api/v2/#operation/api.projects.patch API Documentation}
63
+ # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.patch Enterprise API Documentation}
64
+ def edit_project(project_id = nil, query = {})
65
+ project_id || raise_parameter_is_required_error(:project_id)
66
+
67
+ request = Web::Request.new(
68
+ connection,
69
+ :patch,
70
+ "#{config.target_api_url}/projects/#{project_id}",
71
+ { params: query }
72
+ )
73
+ Web::SendRequest.new(request).perform
74
+ end
75
+
76
+ # -- For Enterprise mode only --
77
+
78
+ # @param query [Hash] Request Body
79
+ # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.getMany Enterprise API Documentation}
80
+ def list_groups(query = {})
81
+ enterprise_mode? || raise_only_for_enterprise_mode_error
82
+
83
+ request = Web::Request.new(
84
+ connection,
85
+ :get,
86
+ "#{config.target_api_url}/groups",
87
+ { params: query }
88
+ )
89
+ Web::SendRequest.new(request).perform
90
+ end
91
+
92
+ # @param query [Hash] Request Body
93
+ # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.post Enterprise API Documentation}
94
+ def add_group(query = {})
95
+ enterprise_mode? || raise_only_for_enterprise_mode_error
96
+
97
+ request = Web::Request.new(
98
+ connection,
99
+ :post,
100
+ "#{config.target_api_url}/groups",
101
+ { params: query }
102
+ )
103
+ Web::SendRequest.new(request).perform
104
+ end
105
+
106
+ # @param group_id [Integer] Group ID
107
+ # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.get Enterprise API Documentation}
108
+ def get_group(group_id = nil)
109
+ enterprise_mode? || raise_only_for_enterprise_mode_error
110
+ group_id || raise_parameter_is_required_error(:group_id)
111
+
112
+ request = Web::Request.new(
113
+ connection,
114
+ :get,
115
+ "#{config.target_api_url}/groups/#{group_id}"
116
+ )
117
+ Web::SendRequest.new(request).perform
118
+ end
119
+
120
+ # @param group_id [Integer] Group ID
121
+ # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.delete Enterprise API Documentation}
122
+ def delete_group(group_id = nil)
123
+ enterprise_mode? || raise_only_for_enterprise_mode_error
124
+ group_id || raise_parameter_is_required_error(:group_id)
125
+
126
+ request = Web::Request.new(
127
+ connection,
128
+ :delete,
129
+ "#{config.target_api_url}/groups/#{group_id}"
130
+ )
131
+ Web::SendRequest.new(request).perform
132
+ end
133
+
134
+ # @param group_id [Integer] Group ID
135
+ # @param query [Hash] Request Body
136
+ # * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.patch Enterprise API Documentation}
137
+ def edit_group(group_id = nil, query = {})
138
+ enterprise_mode? || raise_only_for_enterprise_mode_error
139
+ group_id || raise_parameter_is_required_error(:group_id)
140
+
141
+ request = Web::Request.new(
142
+ connection,
143
+ :patch,
144
+ "#{config.target_api_url}/groups/#{group_id}",
145
+ { params: query }
146
+ )
147
+ Web::SendRequest.new(request).perform
148
+ end
149
+ end
150
+ end
151
+ end
@@ -0,0 +1,184 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Crowdin
4
+ module ApiResources
5
+ module Reports
6
+ def generate_report(query = {}, project_id = config.project_id)
7
+ project_id || raise_project_id_is_required_error
8
+
9
+ request = Web::Request.new(
10
+ connection,
11
+ :post,
12
+ "#{config.target_api_url}/projects/#{project_id}/reports",
13
+ { params: query }
14
+ )
15
+ Web::SendRequest.new(request).perform
16
+ end
17
+
18
+ def check_report_generation_status(report_id = nil, project_id = config.project_id)
19
+ report_id || raise_parameter_is_required_error(:report_id)
20
+ project_id || raise_project_id_is_required_error
21
+
22
+ request = Web::Request.new(
23
+ connection,
24
+ :get,
25
+ "#{config.target_api_url}/projects/#{project_id}/reports/#{report_id}"
26
+ )
27
+ Web::SendRequest.new(request).perform
28
+ end
29
+
30
+ def download_report(report_id = nil, destination = nil, project_id = config.project_id)
31
+ report_id || raise_parameter_is_required_error(:report_id)
32
+ project_id || raise_project_id_is_required_error
33
+
34
+ request = Web::Request.new(
35
+ connection,
36
+ :get,
37
+ "#{config.target_api_url}/projects/#{project_id}/reports/#{report_id}/download"
38
+ )
39
+ Web::SendRequest.new(request, destination).perform
40
+ end
41
+
42
+ # -- For Enterprise mode only --
43
+
44
+ def generate_group_report(group_id = nil, query = {})
45
+ enterprise_mode? || raise_only_for_enterprise_mode_error
46
+ group_id || raise_parameter_is_required_error(:group_id)
47
+
48
+ request = Web::Request.new(
49
+ connection,
50
+ :post,
51
+ "#{config.target_api_url}/groups/#{group_id}/reports",
52
+ { params: query }
53
+ )
54
+ Web::SendRequest.new(request).perform
55
+ end
56
+
57
+ def check_group_report_generation_status(group_id = nil, report_id = nil)
58
+ enterprise_mode? || raise_only_for_enterprise_mode_error
59
+ group_id || raise_parameter_is_required_error(:group_id)
60
+ report_id || raise_parameter_is_required_error(:report_id)
61
+
62
+ request = Web::Request.new(
63
+ connection,
64
+ :get,
65
+ "#{config.target_api_url}/groups/#{group_id}/reports/#{report_id}"
66
+ )
67
+ Web::SendRequest.new(request).perform
68
+ end
69
+
70
+ def download_group_report(group_id = nil, report_id = nil, destination = nil)
71
+ enterprise_mode? || raise_only_for_enterprise_mode_error
72
+ group_id || raise_parameter_is_required_error(:group_id)
73
+ report_id || raise_parameter_is_required_error(:report_id)
74
+
75
+ request = Web::Request.new(
76
+ connection,
77
+ :get,
78
+ "#{config.target_api_url}/groups/#{group_id}/reports/#{report_id}/download"
79
+ )
80
+ Web::SendRequest.new(request, destination).perform
81
+ end
82
+
83
+ def generate_organization_report(query = {})
84
+ enterprise_mode? || raise_only_for_enterprise_mode_error
85
+
86
+ request = Web::Request.new(
87
+ connection,
88
+ :post,
89
+ "#{config.target_api_url}/reports",
90
+ { params: query }
91
+ )
92
+ Web::SendRequest.new(request).perform
93
+ end
94
+
95
+ def check_organization_report_generation_status(report_id = nil)
96
+ enterprise_mode? || raise_only_for_enterprise_mode_error
97
+ report_id || raise_parameter_is_required_error(:report_id)
98
+
99
+ request = Web::Request.new(
100
+ connection,
101
+ :get,
102
+ "#{config.target_api_url}/reports/#{report_id}"
103
+ )
104
+ Web::SendRequest.new(request).perform
105
+ end
106
+
107
+ def download_organization_report(report_id = nil, destination = nil)
108
+ enterprise_mode? || raise_only_for_enterprise_mode_error
109
+ report_id || raise_parameter_is_required_error(:report_id)
110
+
111
+ request = Web::Request.new(
112
+ connection,
113
+ :get,
114
+ "#{config.target_api_url}/reports/#{report_id}/download"
115
+ )
116
+ Web::SendRequest.new(request, destination).perform
117
+ end
118
+
119
+ def list_report_settings_templates(query = {}, project_id = config.project_id)
120
+ project_id || raise_project_id_is_required_error
121
+
122
+ request = Web::Request.new(
123
+ connection,
124
+ :get,
125
+ "#{config.target_api_url}/projects/#{project_id}/reports/settings-templates",
126
+ { params: query }
127
+ )
128
+ Web::SendRequest.new(request).perform
129
+ end
130
+
131
+ def add_report_settings_template(query = {}, project_id = config.project_id)
132
+ project_id || raise_project_id_is_required_error
133
+ %i[name currency unit mode config].each do |param|
134
+ query[param] || raise_parameter_is_required_error(param)
135
+ end
136
+
137
+ request = Web::Request.new(
138
+ connection,
139
+ :post,
140
+ "#{config.target_api_url}/projects/#{project_id}/reports/settings-templates",
141
+ { params: query }
142
+ )
143
+ Web::SendRequest.new(request).perform
144
+ end
145
+
146
+ def get_report_settings_template(template_id = nil, project_id = config.project_id)
147
+ project_id || raise_project_id_is_required_error
148
+ template_id || raise_parameter_is_required_error(:template_id)
149
+
150
+ request = Web::Request.new(
151
+ connection,
152
+ :get,
153
+ "#{config.target_api_url}/projects/#{project_id}/reports/settings-templates/#{template_id}"
154
+ )
155
+ Web::SendRequest.new(request).perform
156
+ end
157
+
158
+ def edit_report_settings_template(query = {}, template_id = nil, project_id = config.project_id)
159
+ project_id || raise_project_id_is_required_error
160
+ template_id || raise_parameter_is_required_error(:template_id)
161
+
162
+ request = Web::Request.new(
163
+ connection,
164
+ :patch,
165
+ "#{config.target_api_url}/projects/#{project_id}/reports/settings-templates/#{template_id}",
166
+ { params: query }
167
+ )
168
+ Web::SendRequest.new(request).perform
169
+ end
170
+
171
+ def delete_report_settings_template(template_id = nil, project_id = config.project_id)
172
+ project_id || raise_project_id_is_required_error
173
+ template_id || raise_parameter_is_required_error(:template_id)
174
+
175
+ request = Web::Request.new(
176
+ connection,
177
+ :delete,
178
+ "#{config.target_api_url}/projects/#{project_id}/reports/settings-templates/#{template_id}"
179
+ )
180
+ Web::SendRequest.new(request).perform
181
+ end
182
+ end
183
+ end
184
+ end
@@ -0,0 +1,172 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Crowdin
4
+ module ApiResources
5
+ module Screenshots
6
+ def list_screenshots(query = {}, project_id = config.project_id)
7
+ project_id || raise_project_id_is_required_error
8
+
9
+ request = Web::Request.new(
10
+ connection,
11
+ :get,
12
+ "#{config.target_api_url}/projects/#{project_id}/screenshots",
13
+ { params: query }
14
+ )
15
+ Web::SendRequest.new(request).perform
16
+ end
17
+
18
+ def add_screenshot(query = {}, project_id = config.project_id)
19
+ project_id || raise_project_id_is_required_error
20
+
21
+ request = Web::Request.new(
22
+ connection,
23
+ :post,
24
+ "#{config.target_api_url}/projects/#{project_id}/screenshots",
25
+ { params: query }
26
+ )
27
+ Web::SendRequest.new(request).perform
28
+ end
29
+
30
+ def get_screenshot(screenshot_id = nil, project_id = config.project_id)
31
+ screenshot_id || raise_parameter_is_required_error(:screenshot_id)
32
+ project_id || raise_project_id_is_required_error
33
+
34
+ request = Web::Request.new(
35
+ connection,
36
+ :get,
37
+ "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}"
38
+ )
39
+ Web::SendRequest.new(request).perform
40
+ end
41
+
42
+ def update_screenshot(screenshot_id = nil, query = {}, project_id = config.project_id)
43
+ screenshot_id || raise_parameter_is_required_error(:screenshot_id)
44
+ project_id || raise_project_id_is_required_error
45
+
46
+ request = Web::Request.new(
47
+ connection,
48
+ :put,
49
+ "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}",
50
+ { params: query }
51
+ )
52
+ Web::SendRequest.new(request).perform
53
+ end
54
+
55
+ def delete_screenshot(screenshot_id = nil, project_id = config.project_id)
56
+ screenshot_id || raise_parameter_is_required_error(:screenshot_id)
57
+ project_id || raise_project_id_is_required_error
58
+
59
+ request = Web::Request.new(
60
+ connection,
61
+ :delete,
62
+ "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}"
63
+ )
64
+ Web::SendRequest.new(request).perform
65
+ end
66
+
67
+ def edit_screenshot(screenshot_id = nil, query = {}, project_id = config.project_id)
68
+ screenshot_id || raise_parameter_is_required_error(:screenshot_id)
69
+ project_id || raise_project_id_is_required_error
70
+
71
+ request = Web::Request.new(
72
+ connection,
73
+ :patch,
74
+ "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}",
75
+ { params: query }
76
+ )
77
+ Web::SendRequest.new(request).perform
78
+ end
79
+
80
+ def list_tags(screenshot_id = nil, query = {}, project_id = config.project_id)
81
+ screenshot_id || raise_parameter_is_required_error(:screenshot_id)
82
+ project_id || raise_project_id_is_required_error
83
+
84
+ request = Web::Request.new(
85
+ connection,
86
+ :get,
87
+ "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags",
88
+ { params: query }
89
+ )
90
+ Web::SendRequest.new(request).perform
91
+ end
92
+
93
+ def replace_tags(screenshot_id = nil, query = {}, project_id = config.project_id)
94
+ screenshot_id || raise_parameter_is_required_error(:screenshot_id)
95
+ project_id || raise_project_id_is_required_error
96
+
97
+ request = Web::Request.new(
98
+ connection,
99
+ :put,
100
+ "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags",
101
+ { params: query }
102
+ )
103
+ Web::SendRequest.new(request).perform
104
+ end
105
+
106
+ def add_tag(screenshot_id = nil, query = {}, project_id = config.project_id)
107
+ screenshot_id || raise_parameter_is_required_error(:screenshot_id)
108
+ project_id || raise_project_id_is_required_error
109
+
110
+ request = Web::Request.new(
111
+ connection,
112
+ :post,
113
+ "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags",
114
+ { params: query }
115
+ )
116
+ Web::SendRequest.new(request).perform
117
+ end
118
+
119
+ def clear_tags(screenshot_id = nil, project_id = config.project_id)
120
+ screenshot_id || raise_parameter_is_required_error(:screenshot_id)
121
+ project_id || raise_project_id_is_required_error
122
+
123
+ request = Web::Request.new(
124
+ connection,
125
+ :delete,
126
+ "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags"
127
+ )
128
+ Web::SendRequest.new(request).perform
129
+ end
130
+
131
+ def get_tag(screenshot_id = nil, tag_id = nil, project_id = config.project_id)
132
+ screenshot_id || raise_parameter_is_required_error(:screenshot_id)
133
+ tag_id || raise_parameter_is_required_error(:tag_id)
134
+ project_id || raise_project_id_is_required_error
135
+
136
+ request = Web::Request.new(
137
+ connection,
138
+ :get,
139
+ "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags/#{tag_id}"
140
+ )
141
+ Web::SendRequest.new(request).perform
142
+ end
143
+
144
+ def delete_tag(screenshot_id = nil, tag_id = nil, project_id = config.project_id)
145
+ screenshot_id || raise_parameter_is_required_error(:screenshot_id)
146
+ tag_id || raise_parameter_is_required_error(:tag_id)
147
+ project_id || raise_project_id_is_required_error
148
+
149
+ request = Web::Request.new(
150
+ connection,
151
+ :delete,
152
+ "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags/#{tag_id}"
153
+ )
154
+ Web::SendRequest.new(request).perform
155
+ end
156
+
157
+ def edit_tag(screenshot_id = nil, tag_id = nil, query = {}, project_id = config.project_id)
158
+ screenshot_id || raise_parameter_is_required_error(:screenshot_id)
159
+ tag_id || raise_parameter_is_required_error(:tag_id)
160
+ project_id || raise_project_id_is_required_error
161
+
162
+ request = Web::Request.new(
163
+ connection,
164
+ :patch,
165
+ "#{config.target_api_url}/projects/#{project_id}/screenshots/#{screenshot_id}/tags/#{tag_id}",
166
+ { params: query }
167
+ )
168
+ Web::SendRequest.new(request).perform
169
+ end
170
+ end
171
+ end
172
+ end