Skip to content
Open
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
178 changes: 178 additions & 0 deletions go/openapi/client.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions java/changelog.d/CDPSDK-2561.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `lookupEndUser` to `EndUserClient` for looking up end users by email across all email-based authentication methods.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.coinbase.cdp.CdpClient;
import com.coinbase.cdp.auth.TokenProvider;
import com.coinbase.cdp.client.enduser.EndUserClientOptions.ListEndUsersOptions;
import com.coinbase.cdp.client.enduser.EndUserClientOptions.LookupEndUserOptions;
import com.coinbase.cdp.openapi.ApiClient;
import com.coinbase.cdp.openapi.ApiException;
import com.coinbase.cdp.openapi.api.EmbeddedWalletsApi;
Expand All @@ -19,6 +20,7 @@
import com.coinbase.cdp.openapi.model.GetDelegationForEndUser200Response;
import com.coinbase.cdp.openapi.model.ImportEndUserRequest;
import com.coinbase.cdp.openapi.model.ListEndUsers200Response;
import com.coinbase.cdp.openapi.model.LookupEndUser200Response;
import com.coinbase.cdp.openapi.model.RevokeDelegationForEndUserRequest;
import com.coinbase.cdp.openapi.model.SendEvmAssetWithEndUserAccount200Response;
import com.coinbase.cdp.openapi.model.SendEvmAssetWithEndUserAccountRequest;
Expand Down Expand Up @@ -181,6 +183,19 @@ public EndUser getEndUser(String userId) throws ApiException {
return endUserAccountsApi.getEndUser(userId);
}

/**
* Looks up end users by a single identity parameter.
*
* <p>Searches across all email-based authentication methods (email, Google, Apple, GitHub).
*
* @param options the lookup options specifying the identity parameter to search by
* @return the lookup response containing matching end users
* @throws ApiException if the API call fails
*/
public LookupEndUser200Response lookupEndUser(LookupEndUserOptions options) throws ApiException {
return endUserAccountsApi.lookupEndUser(options.email());
}

/**
* Validates an end user's access token.
*
Expand Down Expand Up @@ -331,7 +346,7 @@ public void revokeDelegation(String userId) throws ApiException {
RevokeDelegationForEndUserRequest request = new RevokeDelegationForEndUserRequest();
String walletJwt =
generateWalletJwt("POST", "/v2/end-users/" + userId + "/revoke-delegation", request);
embeddedWalletsApi.revokeDelegationForEndUser(userId, request, walletJwt, null, null);
embeddedWalletsApi.revokeDelegationForEndUser(userId, request, walletJwt, null, null, null);
}

// ==================== Delegated EVM Sign Methods ====================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,43 @@
* Options records for EndUser client operations.
*
* <p>For operations that accept request bodies, use the generated OpenAPI request types directly.
* This file contains only options for listing operations with pagination.
* This file contains options classes for operations that use query parameters.
*/
public final class EndUserClientOptions {
private EndUserClientOptions() {}

/** Options for looking up end users by a single identity parameter. */
public static final class LookupEndUserOptions {
private final String email;

private LookupEndUserOptions(Builder builder) {
this.email = builder.email;
}

public String email() {
return email;
}

public static Builder builder() {
return new Builder();
}

public static final class Builder {
private String email;

private Builder() {}

public Builder email(String email) {
this.email = email;
return this;
}

public LookupEndUserOptions build() {
return new LookupEndUserOptions(this);
}
}
}

/** Options for listing end users with pagination and sorting. */
public record ListEndUsersOptions(Integer pageSize, String pageToken, List<String> sort) {
public static Builder builder() {
Expand Down
Loading
Loading