OAuth2ServiceAccountauthentication method
WebAPIno longer needs to be constructed after an event loop is running.unmanage_async_context_syncrenamed tounmanage_async_context- unused async version removed
- returns a
asyncio.Eventinstead ofasyncio.Semaphorefor releasing context - returns a
asyncio.Task[T]instead ofTand does not assume__aenter__returns self
- unused
run_sync_ensured
WebAPI._get_, _post, _put, _patch, _deletemethods with serialization and deserialization- Return type can have
from_jsonclassmethod for deserialization. None for no deserialization, str for text content, or a single-parameter constructor which will get the JSON response object. - Data parameter can have
to_jsonmethod for serialization, asdict for dataclasses, or passed as-is. TypedDictis one good way to define the JSON response type, and will work without any extra code.
- Return type can have
WebAPI._use_form_datais used for the above methods.
delete_json(for HTTP DELETE) method
OAuth2AppandOAuth2Userno longer overload the dataclass constructor- use
.from_json_obj()or.from_json_file()instead
- use
WebAPIis no longerAsyncInit, and should not be awaitedAPIKeyrenamed toUrlApiKey,APIErrortoApiErrorAuth.sign_requestrenamed toAuth.signWebAPInow requires anAuthobject, not None- use
Auth.none()for no auth
- use
OAuth2Userno longer keeps asource_pathand does not do any IO
- Interactive wizard for granting credentials
- Google flavor app/client JSON files can now be used to create
OAuth2 - Success local flow page styling, light/dark
HeaderApiKeyfor adding API keys to theAuthorizationheader, or any other headerWebAPI._parameter_list_delimiterfor serialization. Only applies to URL parameters.NoAuthimplementation ofAuthOAuth2accepts a callback for when user tokens are refreshed.- separate
METHOD_form()methods for form-parameter requests
EnumParam,EnumParamstypes. Instead, useset[str]orset[T]whereTis an enum type.- Make sure to convert any sets or lists to strings with the appropriate delimter for whichever API you are using.
- Alternatively, set
WebAPI._parameter_list_delimiterto the appropriate delimiter for your API.
APIObjdid not provide much value as a base class, and could make usage less clear.Auth.refreshandAuth.flow, which could not be implemented by many authorization schemes.AsyncInitbase class, which was no longer needed.
OAuth1andOAuth1Userconstructors accept a string as a path to a JSON file.