11package com .crowdin .client .bundles ;
22
3- import com .crowdin .client .bundles .model .*;
3+ import com .crowdin .client .bundles .model .AddBundleRequest ;
4+ import com .crowdin .client .bundles .model .Bundle ;
5+ import com .crowdin .client .bundles .model .BundleExport ;
6+ import com .crowdin .client .bundles .model .BundleExportResponseObject ;
7+ import com .crowdin .client .bundles .model .BundleResponseList ;
8+ import com .crowdin .client .bundles .model .BundleResponseObject ;
49import com .crowdin .client .core .CrowdinApi ;
510import com .crowdin .client .core .http .HttpRequestConfig ;
611import com .crowdin .client .core .http .exceptions .HttpBadRequestException ;
712import com .crowdin .client .core .http .exceptions .HttpException ;
8- import com .crowdin .client .core .model .*;
13+ import com .crowdin .client .core .model .ClientConfig ;
14+ import com .crowdin .client .core .model .Credentials ;
15+ import com .crowdin .client .core .model .DownloadLink ;
16+ import com .crowdin .client .core .model .DownloadLinkResponseObject ;
17+ import com .crowdin .client .core .model .PatchRequest ;
18+ import com .crowdin .client .core .model .ResponseList ;
19+ import com .crowdin .client .core .model .ResponseObject ;
20+ import com .crowdin .client .sourcefiles .model .Branch ;
21+ import com .crowdin .client .sourcefiles .model .BranchResponseList ;
922import com .crowdin .client .sourcefiles .model .FileInfo ;
1023import com .crowdin .client .sourcefiles .model .FileInfoResponseList ;
1124
@@ -39,7 +52,7 @@ public ResponseList<Bundle> listBundles(Long projectId) throws HttpException, Ht
3952
4053 /**
4154 * @param projectId project identifier
42- * @param request request object
55+ * @param request request object
4356 * @return newly created bundle
4457 * @see <ul>
4558 * <li><a href="https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.post" target="_blank"><b>API Documentation</b></a></li>
@@ -53,7 +66,7 @@ public ResponseObject<Bundle> addBundle(Long projectId, AddBundleRequest request
5366
5467 /**
5568 * @param projectId project identifier
56- * @param bundleId bundle identifier
69+ * @param bundleId bundle identifier
5770 * @return bundle object
5871 * @see <ul>
5972 * <li><a href="https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.get" target="_blank"><b>API Documentation</b></a></li>
@@ -67,7 +80,7 @@ public ResponseObject<Bundle> getBundle(Long projectId, Long bundleId) throws Ht
6780
6881 /**
6982 * @param projectId project identifier
70- * @param bundleId bundle identifier
83+ * @param bundleId bundle identifier
7184 * @see <ul>
7285 * <li><a href="https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.delete" target="_blank"><b>API Documentation</b></a></li>
7386 * <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.bundles.delete" target="_blank"><b>Enterprise API Documentation</b></a></li>
@@ -79,8 +92,8 @@ public void deleteBundle(Long projectId, Long bundleId) throws HttpException, Ht
7992
8093 /**
8194 * @param projectId project identifier
82- * @param bundleId bundle identifier
83- * @param request request object
95+ * @param bundleId bundle identifier
96+ * @param request request object
8497 * @return updated bundle
8598 * @see <ul>
8699 * <li><a href="https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.patch" target="_blank"><b>API Documentation</b></a></li>
@@ -94,9 +107,9 @@ public ResponseObject<Bundle> editBundle(Long projectId, Long bundleId, List<Pat
94107
95108 /**
96109 * @param projectId project identifier
97- * @param bundleId bundle identifier
98- * @param limit maximum number of items to retrieve (default 25)
99- * @param offset starting offset in the collection (default 0)
110+ * @param bundleId bundle identifier
111+ * @param limit maximum number of items to retrieve (default 25)
112+ * @param offset starting offset in the collection (default 0)
100113 * @return list of bundles file resource
101114 * @see <ul>
102115 * <li><a href="https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.files.getMany" target="_blank"><b>API Documentation</b></a></li>
@@ -114,8 +127,23 @@ public ResponseList<? extends FileInfo> listBundleFiles(Long projectId, Long bun
114127
115128 /**
116129 * @param projectId project identifier
117- * @param bundleId bundle identifier
118- * @param exportId export identifier, consists of 36 characters
130+ * @param bundleId bundle identifier
131+ * @param limit maximum number of items to retrieve (default 25)
132+ * @param offset starting offset in the collection (default 0)
133+ */
134+ public ResponseList <Branch > listBundleBranches (Long projectId , Long bundleId , Integer limit , Integer offset ) throws HttpException , HttpBadRequestException {
135+ Map <String , Optional <Object >> queryParams = HttpRequestConfig .buildUrlParams (
136+ "limit" , Optional .ofNullable (limit ),
137+ "offset" , Optional .ofNullable (offset )
138+ );
139+ BranchResponseList response = this .httpClient .get (this .url + "/projects/" + projectId + "/bundles/" + bundleId + "/branches" , new HttpRequestConfig (queryParams ), BranchResponseList .class );
140+ return BranchResponseList .to (response );
141+ }
142+
143+ /**
144+ * @param projectId project identifier
145+ * @param bundleId bundle identifier
146+ * @param exportId export identifier, consists of 36 characters
119147 * @return download link to bundle
120148 * @see <ul>
121149 * <li><a href="https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.exports.download.get" target="_blank"><b>API Documentation</b></a></li>
@@ -132,7 +160,7 @@ public ResponseObject<DownloadLink> downloadBundle(Long projectId, Long bundleId
132160
133161 /**
134162 * @param projectId project identifier
135- * @param bundleId bundle identifier
163+ * @param bundleId bundle identifier
136164 * @return freshly created bundle export object
137165 * @see <ul>
138166 * <li><a href="https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.exports.post" target="_blank"><b>API Documentation</b></a></li>
@@ -149,8 +177,8 @@ public ResponseObject<BundleExport> exportBundle(Long projectId, Long bundleId)
149177
150178 /**
151179 * @param projectId project identifier
152- * @param bundleId bundle identifier
153- * @param exportId export identifier, consists of 36 characters
180+ * @param bundleId bundle identifier
181+ * @param exportId export identifier, consists of 36 characters
154182 * @return requested bundle export object
155183 * @see <ul>
156184 * <li><a href="https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.exports.get" target="_blank"><b>API Documentation</b></a></li>
0 commit comments