Profile data
The profile operation returns account identity, provider metadata, account state, product entitlements, roles, active subscriptions, and team dashboard memberships for the authenticated user.
Complete example
from Analog_WakaTime_SDK.exceptions import ApiException
import Analog_WakaTime_SDK
import asyncio
import json
import os
async def main() -> None:
configuration = Analog_WakaTime_SDK.Configuration(
access_token=os.environ["ANALOG_WAKATIME_API_TOKEN"],
)
try:
async with Analog_WakaTime_SDK.ApiClient(configuration) as api_client:
profile_api = Analog_WakaTime_SDK.ProfileApi(api_client)
profile = await profile_api.main_api_v1_get_my_profile_info_get()
print(json.dumps(profile.to_dict(), indent=2, default=str))
except ApiException as error:
print(f"API error {error.status}: {error.body or error.reason}")
if __name__ == "__main__":
asyncio.run(main())
The example prints every profile field described by the SDK response model. If you need the JSON string directly, use:
profile_json = profile.to_json()
print(profile_json)
Reading individual fields (optional)
Access fields directly only when your application needs particular values:
print(profile.uuid)
print(profile.name)
print(profile.email)
print(profile.created_at)
print(profile.updated_at)
Conversion helpers
profile_dict = profile.to_dict()
profile_json = profile.to_json()
to_dict() returns all fields known to the generated SDK model as a Python
dictionary. to_json() returns the same model as a JSON string. After
regenerating the SDK from the current OpenAPI document, this model includes
identity and provider fields, entitlement flags, roles, team roles,
subscriptions, and team dashboard memberships. Use to_dict() before combining
multiple SDK responses into one application-level result. Date and time fields
remain typed values; pass default=str when serializing them with the standard
json module.
Request timeout
profile = await profile_api.main_api_v1_get_my_profile_info_get(
_request_timeout=(5, 30),
)
The tuple contains connection and read timeouts in seconds.