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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import co.dfns.sdk.allocations.model.*;
import java.util.List;
import co.dfns.sdk.PaginatedList;
import java.util.Map;
import java.util.concurrent.CompletableFuture;

public class AllocationsAsyncClient {
Expand All @@ -30,7 +29,7 @@ public CompletableFuture<PaginatedList<AllocationAction>> listAllocationActions(
}

/** Create Allocation Action */
public CompletableFuture<Allocation> createAllocationAction(String allocationId, CreateAllocationActionRequest body) {
public CompletableFuture<Allocation> createAllocationAction(String allocationId, Object body) {
return httpClient.postAsync("/allocations/" + allocationId + "/actions", java.util.Map.of(), body, Allocation.class, true);
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/co/dfns/sdk/allocations/AllocationsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import co.dfns.sdk.allocations.model.*;
import java.util.List;
import co.dfns.sdk.PaginatedList;
import java.util.Map;

public class AllocationsClient {
private final DfnsHttpClient httpClient;
Expand All @@ -29,7 +28,7 @@ public PaginatedList<AllocationAction> listAllocationActions(String allocationId
}

/** Create Allocation Action */
public Allocation createAllocationAction(String allocationId, CreateAllocationActionRequest body) {
public Allocation createAllocationAction(String allocationId, Object body) {
return httpClient.post("/allocations/" + allocationId + "/actions", java.util.Map.of(), body, Allocation.class, true);
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/co/dfns/sdk/allocations/model/Allocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonIgnoreProperties(ignoreUnknown = true)
public record Allocation(
@JsonProperty("id") String id,
@JsonProperty("walletId") String walletId,
@JsonProperty("protocol") String protocol,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("provider") String provider,
@JsonProperty("amount") Object amount,
@JsonProperty("rewards") Object rewards,
@JsonProperty("dateCreated") String dateCreated
Expand Down
25 changes: 21 additions & 4 deletions src/main/java/co/dfns/sdk/auth/AuthAsyncClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ public CompletableFuture<ActivateCredentialResponse> activateCredential(Activate
return httpClient.putAsync("/auth/credentials/activate", java.util.Map.of(), body, ActivateCredentialResponse.class, true);
}

/** Delete Credential */
@SuppressWarnings("unchecked")
public CompletableFuture<Map<String, Object>> deleteCredential(String credentialUuid) {
return httpClient.deleteAsync("/auth/credentials/" + credentialUuid, java.util.Map.of(), null, (Class<Map<String, Object>>) (Class<?>) Map.class, true);
}

/** Deactivate Credential */
public CompletableFuture<DeactivateCredentialResponse> deactivateCredential(DeactivateCredentialRequest body) {
return httpClient.putAsync("/auth/credentials/deactivate", java.util.Map.of(), body, DeactivateCredentialResponse.class, true);
Expand Down Expand Up @@ -126,6 +132,11 @@ public CompletableFuture<InitiateSsoLoginResponse> initiateSsoLogin(InitiateSsoL
return httpClient.postAsync("/auth/login/sso/init", java.util.Map.of(), body, InitiateSsoLoginResponse.class, false);
}

/** Exchange Access Token */
public CompletableFuture<ExchangeAccessTokenResponse> exchangeAccessToken(ExchangeAccessTokenRequest body) {
return httpClient.postAsync("/auth/tokens", java.util.Map.of(), body, ExchangeAccessTokenResponse.class, false);
}

/** List Personal Access Tokens */
public CompletableFuture<ListPersonalAccessTokensResponse> listPersonalAccessTokens() {
return httpClient.getAsync("/auth/pats", java.util.Map.of(), ListPersonalAccessTokensResponse.class);
Expand Down Expand Up @@ -232,8 +243,8 @@ public CompletableFuture<UpdateServiceAccountResponse> updateServiceAccount(Stri
}

/** Delete Service Account */
public CompletableFuture<DeleteServiceAccountResponse> deleteServiceAccount(String serviceAccountId) {
return httpClient.deleteAsync("/auth/service-accounts/" + serviceAccountId, java.util.Map.of(), null, DeleteServiceAccountResponse.class, true);
public CompletableFuture<DeleteServiceAccountResponse> deleteServiceAccount(String serviceAccountId, DeleteServiceAccountQuery query) {
return httpClient.deleteAsync("/auth/service-accounts/" + serviceAccountId, query.toMap(), null, DeleteServiceAccountResponse.class, true);
}

/** Activate Service Account */
Expand All @@ -242,8 +253,8 @@ public CompletableFuture<ActivateServiceAccountResponse> activateServiceAccount(
}

/** Deactivate Service Account */
public CompletableFuture<DeactivateServiceAccountResponse> deactivateServiceAccount(String serviceAccountId) {
return httpClient.putAsync("/auth/service-accounts/" + serviceAccountId + "/deactivate", java.util.Map.of(), null, DeactivateServiceAccountResponse.class, true);
public CompletableFuture<DeactivateServiceAccountResponse> deactivateServiceAccount(String serviceAccountId, DeactivateServiceAccountRequest body) {
return httpClient.putAsync("/auth/service-accounts/" + serviceAccountId + "/deactivate", java.util.Map.of(), body, DeactivateServiceAccountResponse.class, true);
}

/** Activate User */
Expand Down Expand Up @@ -280,4 +291,10 @@ public CompletableFuture<PaginatedList<User>> listUsers(ListUsersQuery query) {
public CompletableFuture<User> createUser(CreateUserRequest body) {
return httpClient.postAsync("/auth/users", java.util.Map.of(), body, User.class, true);
}

/** Invite Tenant User */
@SuppressWarnings("unchecked")
public CompletableFuture<Map<String, Object>> inviteTenantUser(InviteTenantUserRequest body) {
return httpClient.postAsync("/auth/users/invite", java.util.Map.of(), body, (Class<Map<String, Object>>) (Class<?>) Map.class, true);
}
}
25 changes: 21 additions & 4 deletions src/main/java/co/dfns/sdk/auth/AuthClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ public ActivateCredentialResponse activateCredential(ActivateCredentialRequest b
return httpClient.put("/auth/credentials/activate", java.util.Map.of(), body, ActivateCredentialResponse.class, true);
}

/** Delete Credential */
@SuppressWarnings("unchecked")
public Map<String, Object> deleteCredential(String credentialUuid) {
return httpClient.delete("/auth/credentials/" + credentialUuid, java.util.Map.of(), null, (Class<Map<String, Object>>) (Class<?>) Map.class, true);
}

/** Deactivate Credential */
public DeactivateCredentialResponse deactivateCredential(DeactivateCredentialRequest body) {
return httpClient.put("/auth/credentials/deactivate", java.util.Map.of(), body, DeactivateCredentialResponse.class, true);
Expand Down Expand Up @@ -125,6 +131,11 @@ public InitiateSsoLoginResponse initiateSsoLogin(InitiateSsoLoginRequest body) {
return httpClient.post("/auth/login/sso/init", java.util.Map.of(), body, InitiateSsoLoginResponse.class, false);
}

/** Exchange Access Token */
public ExchangeAccessTokenResponse exchangeAccessToken(ExchangeAccessTokenRequest body) {
return httpClient.post("/auth/tokens", java.util.Map.of(), body, ExchangeAccessTokenResponse.class, false);
}

/** List Personal Access Tokens */
public ListPersonalAccessTokensResponse listPersonalAccessTokens() {
return httpClient.get("/auth/pats", java.util.Map.of(), ListPersonalAccessTokensResponse.class);
Expand Down Expand Up @@ -231,8 +242,8 @@ public UpdateServiceAccountResponse updateServiceAccount(String serviceAccountId
}

/** Delete Service Account */
public DeleteServiceAccountResponse deleteServiceAccount(String serviceAccountId) {
return httpClient.delete("/auth/service-accounts/" + serviceAccountId, java.util.Map.of(), null, DeleteServiceAccountResponse.class, true);
public DeleteServiceAccountResponse deleteServiceAccount(String serviceAccountId, DeleteServiceAccountQuery query) {
return httpClient.delete("/auth/service-accounts/" + serviceAccountId, query.toMap(), null, DeleteServiceAccountResponse.class, true);
}

/** Activate Service Account */
Expand All @@ -241,8 +252,8 @@ public ActivateServiceAccountResponse activateServiceAccount(String serviceAccou
}

/** Deactivate Service Account */
public DeactivateServiceAccountResponse deactivateServiceAccount(String serviceAccountId) {
return httpClient.put("/auth/service-accounts/" + serviceAccountId + "/deactivate", java.util.Map.of(), null, DeactivateServiceAccountResponse.class, true);
public DeactivateServiceAccountResponse deactivateServiceAccount(String serviceAccountId, DeactivateServiceAccountRequest body) {
return httpClient.put("/auth/service-accounts/" + serviceAccountId + "/deactivate", java.util.Map.of(), body, DeactivateServiceAccountResponse.class, true);
}

/** Activate User */
Expand Down Expand Up @@ -279,4 +290,10 @@ public PaginatedList<User> listUsers(ListUsersQuery query) {
public User createUser(CreateUserRequest body) {
return httpClient.post("/auth/users", java.util.Map.of(), body, User.class, true);
}

/** Invite Tenant User */
@SuppressWarnings("unchecked")
public Map<String, Object> inviteTenantUser(InviteTenantUserRequest body) {
return httpClient.post("/auth/users/invite", java.util.Map.of(), body, (Class<Map<String, Object>>) (Class<?>) Map.class, true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
public record CreateLoginChallengeRequest(
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("username") String username,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("orgId") String orgId,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("tenantId") String tenantId,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("loginCode") String loginCode
) {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonIgnoreProperties(ignoreUnknown = true)
public record CreateRecoveryChallengeRequest(
@JsonProperty("username") String username,
@JsonProperty("verificationCode") String verificationCode,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("orgId") String orgId,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("tenantId") String tenantId,
@JsonProperty("credentialId") String credentialId
) {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonIgnoreProperties(ignoreUnknown = true)
public record CreateRegistrationChallengeRequest(
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("orgId") String orgId,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("tenantId") String tenantId,
@JsonProperty("username") String username,
@JsonProperty("registrationCode") String registrationCode
) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package co.dfns.sdk.auth.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonIgnoreProperties(ignoreUnknown = true)
public record DeactivateServiceAccountRequest(
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("force") Boolean force
) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package co.dfns.sdk.auth.model;

import java.util.HashMap;
import java.util.Map;

public class DeleteServiceAccountQuery {
private Object force;

public DeleteServiceAccountQuery force(Object force) {
this.force = force;
return this;
}

public Map<String, String> toMap() {
Map<String, String> map = new HashMap<>();
if (force != null) map.put("force", String.valueOf(force));
return map;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package co.dfns.sdk.auth.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public record ExchangeAccessTokenRequest(
@JsonProperty("target") String target
) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package co.dfns.sdk.auth.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public record ExchangeAccessTokenResponse(
@JsonProperty("token") String token
) {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Map;

@JsonIgnoreProperties(ignoreUnknown = true)
public record FirstFactorAttestation(
@JsonProperty("credentialKind") String credentialKind,
@JsonProperty("credentialInfo") Map<String, Object> credentialInfo,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("credentialName") String credentialName
) {}
10 changes: 10 additions & 0 deletions src/main/java/co/dfns/sdk/auth/model/InviteTenantUserRequest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package co.dfns.sdk.auth.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public record InviteTenantUserRequest(
@JsonProperty("email") String email,
@JsonProperty("kind") String kind
) {}
15 changes: 10 additions & 5 deletions src/main/java/co/dfns/sdk/auth/model/Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum Network {
BerachainBepolia("BerachainBepolia"),
Bitcoin("Bitcoin"),
BitcoinSignet("BitcoinSignet"),
BitcoinTestnet3("BitcoinTestnet3"),
BitcoinTestnet4("BitcoinTestnet4"),
BitcoinCash("BitcoinCash"),
Bob("Bob"),
BobSepolia("BobSepolia"),
Expand All @@ -45,10 +45,7 @@ public enum Network {
EthereumClassic("EthereumClassic"),
EthereumClassicMordor("EthereumClassicMordor"),
EthereumSepolia("EthereumSepolia"),
EthereumHolesky("EthereumHolesky"),
EthereumHoodi("EthereumHoodi"),
FantomOpera("FantomOpera"),
FantomTestnet("FantomTestnet"),
FlareC("FlareC"),
FlareCCoston2("FlareCCoston2"),
FlowEvm("FlowEvm"),
Expand All @@ -62,11 +59,12 @@ public enum Network {
IonTestnet("IonTestnet"),
Iota("Iota"),
IotaTestnet("IotaTestnet"),
Kaspa("Kaspa"),
Kusama("Kusama"),
KusamaAssetHub("KusamaAssetHub"),
Litecoin("Litecoin"),
LitecoinTestnet("LitecoinTestnet"),
Movement("Movement"),
MovementTestnet("MovementTestnet"),
Near("Near"),
NearTestnet("NearTestnet"),
Optimism("Optimism"),
Expand All @@ -90,6 +88,8 @@ public enum Network {
SeiPacific1("SeiPacific1"),
Solana("Solana"),
SolanaDevnet("SolanaDevnet"),
Sonic("Sonic"),
SonicTestnet("SonicTestnet"),
Starknet("Starknet"),
StarknetSepolia("StarknetSepolia"),
Stellar("Stellar"),
Expand All @@ -98,6 +98,7 @@ public enum Network {
SuiTestnet("SuiTestnet"),
Tezos("Tezos"),
TezosGhostnet("TezosGhostnet"),
TezosShadownet("TezosShadownet"),
Tempo("Tempo"),
TempoModerato("TempoModerato"),
Tsc("Tsc"),
Expand All @@ -108,6 +109,10 @@ public enum Network {
TronNile("TronNile"),
Westend("Westend"),
WestendAssetHub("WestendAssetHub"),
Xdc("Xdc"),
XdcApothem("XdcApothem"),
XLayer("XLayer"),
XLayerSepolia("XLayerSepolia"),
XrpLedger("XrpLedger"),
XrpLedgerTestnet("XrpLedgerTestnet"),
UNKNOWN(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public record RecoveryKeyAttestation(
@JsonProperty("credentialInfo") Map<String, Object> credentialInfo,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("encryptedPrivateKey") String encryptedPrivateKey,
@JsonProperty("credentialName") String credentialName,
@JsonProperty("challengeIdentifier") String challengeIdentifier
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("credentialName") String credentialName
) {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonIgnoreProperties(ignoreUnknown = true)
public record ResendRegistrationCodeRequest(
@JsonProperty("username") String username,
@JsonProperty("orgId") String orgId
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("orgId") String orgId,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("tenantId") String tenantId
) {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Map;

@JsonIgnoreProperties(ignoreUnknown = true)
public record SecondFactorAttestation(
@JsonProperty("credentialKind") String credentialKind,
@JsonProperty("credentialInfo") Map<String, Object> credentialInfo,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("credentialName") String credentialName
) {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonIgnoreProperties(ignoreUnknown = true)
public record SendLoginCodeRequest(
@JsonProperty("username") String username,
@JsonProperty("orgId") String orgId
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("orgId") String orgId,
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("tenantId") String tenantId
) {}
Loading
Loading