NAS-129754 / 24.10 / Update `api_key.py` to use the new API style
The goal of this PR is to continue replacing the old @accepts and @returns decorators with the new @api_method decorator which enforces types using Pydantic. The eventual end goal is to entirely replace the old style.
Please note that the type hints added will work with the Pydantic validation and with the @api_method decorator, but they are not entirely truthful. This is because I have preserved our use of dictionaries for now until further discussion can be had about whether to completely move to using Pydantic models instead of dictionaries. This will enforce greater type control and allow for nicer syntax (e.g. data.name instead of data["name"], but it may come at the cost of sometimes needing to convert between dictionaries and Pydantic models.
Jira URL: https://ixsystems.atlassian.net/browse/NAS-129754
This PR has been merged and conversations have been locked. If you would like to discuss more about this issue please use our forums or raise a Jira ticket.