Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/java/com/hellosign/sdk/resource/SignatureRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.hellosign.sdk.resource.support.Attachment;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
Expand All @@ -22,6 +23,7 @@ public class SignatureRequest extends AbstractRequest {

public static final String SIGREQ_KEY = "signature_request";
public static final String SIGREQ_ID = "signature_request_id";
public static final String SIGREQ_CREATED_AT = "created_at";
public static final String SIGREQ_SIGNERS = "signers";
public static final String SIGREQ_SIGNER_EMAIL = "email_address";
public static final String SIGREQ_SIGNER_NAME = "name";
Expand Down Expand Up @@ -94,6 +96,15 @@ public boolean hasId() {
return has(SIGREQ_ID);
}

/**
* The time that this request was created.
*
* @return Date
*/
public Date getCreatedAt() {
return getDate(SIGREQ_CREATED_AT);
}

/**
* Returns the CC email addresses for this request.
*
Expand Down
7 changes: 7 additions & 0 deletions src/test/java/com/hellosign/sdk/HelloSignClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.net.URL;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Month;
import java.time.ZoneId;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -304,6 +308,9 @@ public void testGetSignatureRequest() throws Exception {
SignatureRequest request = client.getSignatureRequest(id);
assertNotNull(request);
assertEquals(id, request.getId());

assertEquals(LocalDate.of(2022, Month.FEBRUARY, 11),
LocalDateTime.ofInstant(request.getCreatedAt().toInstant(), ZoneId.of("UTC")).toLocalDate());
}

@Test(expected = HelloSignException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"message": null,
"metadata": {
},
"created_at": 1644606159,
"is_complete": false,
"is_declined": false,
"has_error": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"message": "Hello, world!",
"metadata": {
},
"created_at": 1644606159,
"is_complete": true,
"is_declined": false,
"has_error": false,
Expand Down Expand Up @@ -62,6 +63,7 @@
"message": null,
"metadata": {
},
"created_at": 1644606159,
"is_complete": false,
"is_declined": false,
"has_error": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"message": "Hello, world!",
"metadata": {
},
"created_at": 1644606159,
"is_complete": true,
"is_declined": false,
"has_error": false,
Expand Down Expand Up @@ -62,6 +63,7 @@
"message": null,
"metadata": {
},
"created_at": 1644606159,
"is_complete": false,
"is_declined": false,
"has_error": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"message": null,
"metadata": {
},
"created_at": 1644606159,
"is_complete": false,
"is_declined": false,
"has_error": false,
Expand Down