Skip to content
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
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,26 @@ try {
> **Note:** `StockKeepingUnit` and `QtyBasedPricing` have no standalone API endpoints.
> Access them via `include` on `didGroups` and `capacityPools` respectively.

## Date and Datetime Fields

The SDK distinguishes between date-only and datetime fields:

- **Datetime fields** — deserialized as `OffsetDateTime`:
- All `getCreatedAt()` methods — present on most resources
- Expiry fields: `Did.getExpiresAt()`, `DidReservation.getExpireAt()`, `Proof.getExpiresAt()`, `EncryptedFile.getExpireAt()`
- **Date-only fields** — deserialized as `LocalDate`:
- `Identity.getBirthDate()`
- **Date-only fields kept as strings** (`CapacityPool.getRenewDate()`, `DidOrderItem.getBilledFrom()`, `DidOrderItem.getBilledTo()`) — remain as `String`.

```java
Did did = client.dids().find("uuid").getData();
System.out.println(did.getCreatedAt()); // 2024-01-15T10:00:00Z (OffsetDateTime)
System.out.println(did.getExpiresAt()); // null or 2025-01-15T10:00:00Z

Identity identity = client.identities().find("uuid").getData();
System.out.println(identity.getBirthDate()); // 1990-05-20 (LocalDate)
```

## Enums

The SDK provides enum classes in `com.didww.sdk.resource.enums`:
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/didww/sdk/resource/CapacityPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.github.jasminb.jsonapi.annotations.Type;
import lombok.Getter;

import java.time.LocalDate;
import java.util.List;

@Type("capacity_pools")
Expand All @@ -17,7 +16,7 @@ public class CapacityPool extends BaseResource {
private String name;

@JsonProperty(value = "renew_date", access = JsonProperty.Access.WRITE_ONLY)
private LocalDate renewDate;
private String renewDate;

@JsonProperty("total_channels_count")
private Integer totalChannelsCount;
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/com/didww/sdk/resource/EncryptedFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ public class EncryptedFile extends BaseResource {
@JsonProperty(value = "expire_at", access = JsonProperty.Access.WRITE_ONLY)
private OffsetDateTime expireAt;

@JsonProperty(value = "created_at", access = JsonProperty.Access.WRITE_ONLY)
private OffsetDateTime createdAt;

public void setDescription(String description) {
this.description = markDirty("description", description);
}
Expand Down
Loading