Skip to content

Commit 86d1380

Browse files
feat(organizations): add manifiesto ZIP download URL
1 parent c255177 commit 86d1380

5 files changed

Lines changed: 87 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.4.0] - 2026-11-05
9+
10+
### Added
11+
12+
- Add `organizations().downloadManifiestoZipUrl(String id)` to obtain a temporary URL for downloading the signed Carta Manifiesto ZIP associated with the organization's certificate RFC.
13+
814
## [2.3.0] - 2026-10-07
915

1016
### Added

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>io.facturapi</groupId>
66
<artifactId>facturapi-java</artifactId>
7-
<version>2.3.0</version>
7+
<version>2.4.0</version>
88
<name>facturapi-java</name>
99
<description>Official Java SDK for Facturapi</description>
1010
<url>https://github.com/facturapi/facturapi-java</url>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package io.facturapi.models;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import java.time.Instant;
5+
6+
@JsonIgnoreProperties(ignoreUnknown = true)
7+
public class SignedDownloadUrl {
8+
private String url;
9+
private Instant expiresAt;
10+
private String contentType;
11+
private String filename;
12+
13+
public String getUrl() {
14+
return url;
15+
}
16+
17+
public void setUrl(String url) {
18+
this.url = url;
19+
}
20+
21+
public Instant getExpiresAt() {
22+
return expiresAt;
23+
}
24+
25+
public void setExpiresAt(Instant expiresAt) {
26+
this.expiresAt = expiresAt;
27+
}
28+
29+
public String getContentType() {
30+
return contentType;
31+
}
32+
33+
public void setContentType(String contentType) {
34+
this.contentType = contentType;
35+
}
36+
37+
public String getFilename() {
38+
return filename;
39+
}
40+
41+
public void setFilename(String filename) {
42+
this.filename = filename;
43+
}
44+
}

‎src/main/java/io/facturapi/resources/OrganizationsResource.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import io.facturapi.models.OrganizationUserAccess;
1515
import io.facturapi.models.SearchResult;
1616
import io.facturapi.models.Series;
17+
import io.facturapi.models.SignedDownloadUrl;
1718
import java.io.File;
1819
import java.io.IOException;
1920
import java.nio.file.Files;
@@ -134,6 +135,17 @@ public Organization deleteCertificate(String id) {
134135
return delete("/organizations/" + id + "/certificate", null, Organization.class);
135136
}
136137

138+
/**
139+
* Gets a temporary URL for downloading the signed Carta Manifiesto ZIP.
140+
*/
141+
public SignedDownloadUrl downloadManifiestoZipUrl(String id) {
142+
return get(
143+
"/organizations/" + id + "/manifiesto/download-url",
144+
null,
145+
SignedDownloadUrl.class
146+
);
147+
}
148+
137149
/**
138150
* Permanently removes an organization.
139151
*/

‎src/test/java/io/facturapi/FacturapiResourcesTest.java‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,30 @@ void organizationCertificateUploadsAcceptBytes() {
372372
assertEquals("/v2/organizations/org_1/certificate", httpClient.requests().get(0).uri().getPath());
373373
}
374374

375+
@Test
376+
void organizationManifiestoZipDownloadUrlIsTyped() {
377+
StubHttpClient httpClient = new StubHttpClient();
378+
httpClient.enqueueJson(
379+
200,
380+
"{\"url\":\"https://storage.googleapis.com/signed-download\",\"expires_at\":\"2030-01-01T00:00:00Z\",\"content_type\":\"application/zip\",\"filename\":\"manifiesto_AAA010101AAA.zip\"}"
381+
);
382+
383+
Facturapi sdk = new Facturapi(
384+
FacturapiConfig.builder("sk_test")
385+
.httpClient(httpClient.client())
386+
.build()
387+
);
388+
389+
var response = sdk.organizations().downloadManifiestoZipUrl("org_1");
390+
391+
assertEquals("application/zip", response.getContentType());
392+
assertEquals("manifiesto_AAA010101AAA.zip", response.getFilename());
393+
assertEquals(Instant.parse("2030-01-01T00:00:00Z"), response.getExpiresAt());
394+
var request = httpClient.requests().get(0);
395+
assertEquals("GET", request.method());
396+
assertEquals("/v2/organizations/org_1/manifiesto/download-url", request.uri().getPath());
397+
}
398+
375399
@Test
376400
void sdkExposesAccessorBasedSurface() {
377401
StubHttpClient httpClient = new StubHttpClient();

0 commit comments

Comments
 (0)