-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathFilesApi.java
More file actions
140 lines (119 loc) · 6.87 KB
/
FilesApi.java
File metadata and controls
140 lines (119 loc) · 6.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
package com.smartling.api.files.v2;
import com.smartling.api.files.v2.pto.DeleteFilePTO;
import com.smartling.api.files.v2.pto.DownloadAllFileTranslationsPTO;
import com.smartling.api.files.v2.pto.DownloadMultipleFilesTranslationsPTO;
import com.smartling.api.files.v2.pto.DownloadMultipleTranslationsPTO;
import com.smartling.api.files.v2.pto.DownloadTranslationPTO;
import com.smartling.api.files.v2.pto.ExportTranslationsPTO;
import com.smartling.api.files.v2.pto.FileItemPTO;
import com.smartling.api.files.v2.pto.FileLocaleLastModifiedPTO;
import com.smartling.api.files.v2.pto.FileLocaleStatusResponse;
import com.smartling.api.files.v2.pto.FileStatusResponse;
import com.smartling.api.files.v2.pto.FileTypesListPTO;
import com.smartling.api.files.v2.pto.GetFileLastModifiedPTO;
import com.smartling.api.files.v2.pto.GetFilesListPTO;
import com.smartling.api.files.v2.pto.GetRecentlyPublishedFilesPTO;
import com.smartling.api.files.v2.pto.ImportTranslationsPTO;
import com.smartling.api.files.v2.pto.ImportTranslationsResponse;
import com.smartling.api.files.v2.pto.RecentlyPublishedFileItemPTO;
import com.smartling.api.files.v2.pto.RenameFilePto;
import com.smartling.api.files.v2.pto.UploadFilePTO;
import com.smartling.api.files.v2.pto.UploadFileResponse;
import com.smartling.api.files.v2.resteasy.ext.TranslatedFileMultipart;
import com.smartling.api.v2.client.exception.server.DetailedErrorMessage;
import com.smartling.api.v2.response.EmptyData;
import com.smartling.api.v2.response.ListResponse;
import org.jboss.resteasy.annotations.providers.multipart.MultipartForm;
import javax.ws.rs.BeanParam;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import java.io.InputStream;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static javax.ws.rs.core.MediaType.MULTIPART_FORM_DATA;
import static javax.ws.rs.core.MediaType.WILDCARD;
import static org.jboss.resteasy.plugins.providers.multipart.MultipartConstants.MULTIPART_MIXED;
@Produces(APPLICATION_JSON)
@Consumes(APPLICATION_JSON)
@DetailedErrorMessage(args = "fileUri")
public interface FilesApi extends AutoCloseable
{
@POST
@Path("/files-api/v2/projects/{projectId}/file")
@Consumes(MULTIPART_FORM_DATA)
UploadFileResponse uploadFile(@PathParam("projectId") String projectId, @MultipartForm UploadFilePTO uploadFilePTO);
@GET
@Path("/files-api/v2/projects/{projectId}/file")
@Produces(WILDCARD)
InputStream downloadSourceFile(@PathParam("projectId") String projectId, @QueryParam("fileUri") String fileUri);
@GET
@Path("/files-api/v2/projects/{projectId}/file/status")
FileStatusResponse getFileStatus(@PathParam("projectId") String projectId, @QueryParam("fileUri") String fileUri);
@GET
@Path("/files-api/v2/projects/{projectId}/locales/{localeId}/file/status")
FileLocaleStatusResponse getFileLocaleStatus(@PathParam("projectId") String projectId, @PathParam("localeId") String localeId, @QueryParam("fileUri") String fileUri);
@GET
@Path("/files-api/v2/projects/{projectId}/locales/{localeId}/file")
@Produces(WILDCARD)
InputStream downloadTranslatedFile(@PathParam("projectId") String projectId, @PathParam("localeId") String localeId, @BeanParam DownloadTranslationPTO downloadTranslationPTO);
@GET
@Path("/files-api/v2/projects/{projectId}/locales/{localeId}/file")
@Produces(MULTIPART_MIXED)
TranslatedFileMultipart downloadTranslatedFileMultipart(@PathParam("projectId") String projectId, @PathParam("localeId") String localeId, @BeanParam DownloadTranslationPTO downloadTranslationPTO);
@GET
@Path("/files-api/v2/projects/{projectId}/locales/all/file/zip")
@Produces(WILDCARD)
InputStream downloadAllFileTranslations(@PathParam("projectId") String projectId, @BeanParam DownloadAllFileTranslationsPTO downloadAllFileTranslationsPTO);
/**
* @deprecated use downloadMultipleFileTranslations with POST method
*/
@Deprecated
@GET
@Path("/files-api/v2/projects/{projectId}/files/zip")
@Produces(WILDCARD)
InputStream downloadMultipleFileTranslations(@PathParam("projectId") String projectId, @BeanParam DownloadMultipleTranslationsPTO downloadMultipleTranslationsPTO);
/**
* Download multiple translated files as zip archive
*
* @return {@link InputStream} for zip archive with translated files, if files found for the given file filter;
* null, if no files found for the given file filter.
*/
@POST
@Path("/files-api/v2/projects/{projectId}/files/zip")
@Produces(WILDCARD)
InputStream downloadMultipleFileTranslations(@PathParam("projectId") String projectId, DownloadMultipleFilesTranslationsPTO downloadMultipleTranslationsPTO);
@GET
@Path("/files-api/v2/projects/{projectId}/files/list")
ListResponse<FileItemPTO> getFilesList(@PathParam("projectId") String projectId, @BeanParam GetFilesListPTO getFilesListPTO);
@GET
@Path("/published-files-api/v2/projects/{projectId}/files/list/recently-published")
ListResponse<RecentlyPublishedFileItemPTO> getRecentlyPublishedFiles(@PathParam("projectId") String projectId, @BeanParam GetRecentlyPublishedFilesPTO getRecentlyPublishedFilesPTO);
@GET
@Path("/files-api/v2/projects/{projectId}/file-types")
FileTypesListPTO getFilesTypesList(@PathParam("projectId") String projectId);
@POST
@Path("/files-api/v2/projects/{projectId}/file/rename")
EmptyData renameFile(@PathParam("projectId") String projectId, RenameFilePto renameFilePto);
@POST
@Path("/files-api/v2/projects/{projectId}/file/delete")
EmptyData deleteFile(@PathParam("projectId") String projectId, DeleteFilePTO deleteFilePTO);
@GET
@Path("/files-api/v2/projects/{projectId}/file/last-modified")
ListResponse<FileLocaleLastModifiedPTO> getFileLastModified(@PathParam("projectId") String projectId, @BeanParam GetFileLastModifiedPTO getFileLastModifiedPto);
@GET
@Path("/files-api/v2/projects/{projectId}/locales/{localeId}/file/last-modified")
FileLocaleLastModifiedPTO getFileLocaleLastModified(@PathParam("projectId") String projectId, @PathParam("localeId") String localeId, @BeanParam GetFileLastModifiedPTO getFileLastModifiedPto);
@POST
@Path("/files-api/v2/projects/{projectId}/locales/{localeId}/file/import")
@Consumes(MULTIPART_FORM_DATA)
ImportTranslationsResponse importTranslations(@PathParam("projectId") String projectId, @PathParam("localeId") String localeId, @MultipartForm ImportTranslationsPTO importTranslationsPTO);
@POST
@Path("/files-api/v2/projects/{projectId}/locales/{localeId}/file/get-translations")
@Consumes(MULTIPART_FORM_DATA)
@Produces(WILDCARD)
InputStream exportTranslations(@PathParam("projectId") String projectId, @PathParam("localeId") String localeId, @MultipartForm ExportTranslationsPTO exportTranslationsPTO);
}