Class MeResource

java.lang.Object
dev.dosya.sdk.resource.MeResource

public final class MeResource extends Object
Provides operations for the authenticated user's profile and API keys.
Since:
0.1.0
  • Constructor Details

    • MeResource

      public MeResource(@NotNull @NotNull DosyaHttpClient http)
      Creates a new MeResource backed by the given HTTP client.
      Parameters:
      http - the HTTP client used to make API requests
  • Method Details

    • profile

      @NotNull public @NotNull UserProfile profile()
      Retrieves the authenticated user's profile.
      Returns:
      the user profile
      Throws:
      DosyaApiException - if the API returns an error
    • listApiKeys

      @NotNull public @NotNull List<ApiKeyItem> listApiKeys()
      Lists all API keys belonging to the authenticated user.
      Returns:
      the list of API key items
      Throws:
      DosyaApiException - if the API returns an error
    • createApiKey

      @NotNull public @NotNull CreatedApiKey createApiKey(@NotNull @NotNull CreateApiKeyParams params)
      Creates a new API key for the authenticated user.
      Parameters:
      params - the API key creation parameters including name and optional scope/expiration
      Returns:
      the created API key, including the plain-text key (shown only once)
      Throws:
      DosyaApiException - if the API returns an error
    • deleteApiKey

      public void deleteApiKey(@NotNull @NotNull String keyId)
      Deletes an API key.
      Parameters:
      keyId - the unique identifier of the API key to delete
      Throws:
      DosyaApiException - if the API returns an error