2
2
3
3
namespace CrowdinApiClient \Api ;
4
4
5
+ use CrowdinApiClient \Model \DownloadFile ;
6
+ use CrowdinApiClient \Model \FileFormatSettings ;
5
7
use CrowdinApiClient \Model \Project ;
6
8
use CrowdinApiClient \ModelCollection ;
7
9
13
15
*/
14
16
class ProjectApi extends AbstractApi
15
17
{
16
-
17
18
/**
18
19
* List Projects
19
20
* @link https://developer.crowdin.com/api/v2/#operation/api.projects.getMany API Documentation
@@ -36,9 +37,6 @@ public function list(array $params = []): ModelCollection
36
37
* Get Project Info
37
38
* @link https://developer.crowdin.com/api/v2/#operation/api.projects.get API Documentation
38
39
* @link https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.get API Documentation Enterprise
39
- *
40
- * @param int $projectId
41
- * @return Project|null
42
40
*/
43
41
public function get (int $ projectId ): ?Project
44
42
{
@@ -81,9 +79,6 @@ public function create(array $data): ?Project
81
79
* Edit Project Info
82
80
* @link https://developer.crowdin.com/api/v2/#operation/api.projects.patch API Documentation
83
81
* @link https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.patch API Documentation Enterprise
84
- *
85
- * @param Project $project
86
- * @return mixed
87
82
*/
88
83
public function update (Project $ project ): ?Project
89
84
{
@@ -102,4 +97,85 @@ public function delete(int $projectId)
102
97
{
103
98
return $ this ->client ->apiRequest ('delete ' , 'projects/ ' . $ projectId );
104
99
}
100
+
101
+ /**
102
+ * Download Project File Format Settings Custom Segmentation
103
+ * @link https://support.crowdin.com/developer/api/v2/#tag/Projects/operation/api.projects.file-format-settings.custom-segmentations.get
104
+ * @link https://support.crowdin.com/developer/enterprise/api/v2/#tag/Projects-and-Groups/operation/api.projects.file-format-settings.custom-segmentations.get
105
+ */
106
+ public function downloadFileFormatSettingsCustomSegmentation (
107
+ int $ projectId ,
108
+ int $ fileFormatSettingsId
109
+ ): ?DownloadFile {
110
+ $ path = sprintf ('projects/%d/file-format-settings/%d/custom-segmentations ' , $ projectId , $ fileFormatSettingsId );
111
+ return $ this ->_get ($ path , DownloadFile::class);
112
+ }
113
+
114
+ /**
115
+ * Reset Project File Format Settings Custom Segmentation
116
+ * @link https://support.crowdin.com/developer/api/v2/#tag/Projects/operation/api.projects.file-format-settings.custom-segmentations.delete
117
+ * @link https://support.crowdin.com/developer/enterprise/api/v2/#tag/Projects-and-Groups/operation/api.projects.file-format-settings.custom-segmentations.delete
118
+ */
119
+ public function resetFileFormatSettingsCustomSegmentation (int $ projectId , int $ fileFormatSettingsId ): void
120
+ {
121
+ $ this ->_delete (
122
+ sprintf ('projects/%d/file-format-settings/%d/custom-segmentations ' , $ projectId , $ fileFormatSettingsId )
123
+ );
124
+ }
125
+
126
+ /**
127
+ * List Project File Format Settings
128
+ * @link https://support.crowdin.com/developer/api/v2/#tag/Projects/operation/api.projects.file-format-settings.getMany
129
+ * @link https://support.crowdin.com/developer/enterprise/api/v2/#tag/Projects-and-Groups/operation/api.projects.file-format-settings.getMany
130
+ */
131
+ public function listFileFormatSettings (int $ projectId , array $ params = []): ModelCollection
132
+ {
133
+ $ path = sprintf ('projects/%d/file-format-settings ' , $ projectId );
134
+ return $ this ->_list ($ path , FileFormatSettings::class, $ params );
135
+ }
136
+
137
+ /**
138
+ * Add Project File Format Settings
139
+ * @link https://support.crowdin.com/developer/api/v2/#tag/Projects/operation/api.projects.file-format-settings.post
140
+ * @link https://support.crowdin.com/developer/enterprise/api/v2/#tag/Projects-and-Groups/operation/api.projects.file-format-settings.post
141
+ */
142
+ public function createFileFormatSettings (int $ projectId , array $ data ): ?FileFormatSettings
143
+ {
144
+ $ path = sprintf ('projects/%d/file-format-settings ' , $ projectId );
145
+ return $ this ->_create ($ path , FileFormatSettings::class, $ data );
146
+ }
147
+
148
+ /**
149
+ * Get Project File Format Settings
150
+ * @link https://support.crowdin.com/developer/api/v2/#tag/Projects/operation/api.projects.file-format-settings.get
151
+ * @link https://support.crowdin.com/developer/enterprise/api/v2/#tag/Projects-and-Groups/operation/api.projects.file-format-settings.get
152
+ */
153
+ public function getFileFormatSettings (int $ projectId , int $ fileFormatSettingsId ): ?FileFormatSettings
154
+ {
155
+ $ path = sprintf ('projects/%d/file-format-settings/%d ' , $ projectId , $ fileFormatSettingsId );
156
+ return $ this ->_get ($ path , FileFormatSettings::class);
157
+ }
158
+
159
+ /**
160
+ * Delete Project File Format Settings
161
+ * @link https://support.crowdin.com/developer/api/v2/#tag/Projects/operation/api.projects.file-format-settings.delete
162
+ * @link https://support.crowdin.com/developer/enterprise/api/v2/#tag/Projects-and-Groups/operation/api.projects.file-format-settings.delete
163
+ */
164
+ public function deleteFileFormatSettings (int $ projectId , int $ fileFormatSettingsId ): void
165
+ {
166
+ $ this ->_delete (sprintf ('projects/%d/file-format-settings/%d ' , $ projectId , $ fileFormatSettingsId ));
167
+ }
168
+
169
+ /**
170
+ * Edit Project File Format Settings
171
+ * @link https://support.crowdin.com/developer/api/v2/#tag/Projects/operation/api.projects.file-format-settings.patch
172
+ * @link https://support.crowdin.com/developer/enterprise/api/v2/#tag/Projects-and-Groups/operation/api.projects.file-format-settings.patch
173
+ */
174
+ public function updateFileFormatSettings (
175
+ int $ projectId ,
176
+ FileFormatSettings $ fileFormatSettings
177
+ ): ?FileFormatSettings {
178
+ $ path = sprintf ('projects/%d/file-format-settings/%d ' , $ projectId , $ fileFormatSettings ->getId ());
179
+ return $ this ->_update ($ path , $ fileFormatSettings );
180
+ }
105
181
}
0 commit comments