Package dev.dosya.sdk.resource
Class MeResource
java.lang.Object
dev.dosya.sdk.resource.MeResource
Provides operations for the authenticated user's profile and API keys.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionMeResource(@NotNull DosyaHttpClient http) Creates a newMeResourcebacked by the given HTTP client. -
Method Summary
Modifier and TypeMethodDescription@NotNull CreatedApiKeycreateApiKey(@NotNull CreateApiKeyParams params) Creates a new API key for the authenticated user.voiddeleteApiKey(@NotNull String keyId) Deletes an API key.@NotNull List<ApiKeyItem>Lists all API keys belonging to the authenticated user.@NotNull UserProfileprofile()Retrieves the authenticated user's profile.
-
Constructor Details
-
MeResource
Creates a newMeResourcebacked by the given HTTP client.- Parameters:
http- the HTTP client used to make API requests
-
-
Method Details
-
profile
Retrieves the authenticated user's profile.- Returns:
- the user profile
- Throws:
DosyaApiException- if the API returns an error
-
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
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
Deletes an API key.- Parameters:
keyId- the unique identifier of the API key to delete- Throws:
DosyaApiException- if the API returns an error
-