Skip to content

Updated SparkData Classes & Fixed and Improved Rate-Limit Handling

Compare
Choose a tag to compare
@cmlccie cmlccie released this 04 Mar 05:22
· 415 commits to main since this release

In addition to fixing a bug ( #52 ) in the automated rate-limit handling and several testing improvements, this release also includes some substantial enhancements to the SparkData classes and how objects are created and returned by the API methods. 😎

New Features:

  • SparkData classes (Room, Person, Message, etc.) are now composed classes created by inheriting from the SparkData base class and type-specific mixin classes. This makes it easier to create your own composed classes (like we are doing with the enhanced data objects in the ciscosparksdk package).
  • The CiscoSparkAPI class now accepts an object_factory= parameter that not surprisingly accepts an object factory function, which is responsible for creating the objects returned by the API methods. This allows you to easily create your own object classes and have them returned by the CiscoSparkAPI methods. #EasilyExtensible 🔌
  • Automated rate-limit handling now generates a custom SparkRateLimitWarning ⚠️ warning message when a rate-limit response is received. If you want to know if your code is being rate-limited, you can easily catch and log warnings to see 🙈 what is going on.

Updated feature docs on the new object extensibility are coming soon. I wanted to go ahead and get the rate-limit fixes, and the initial object code out so the development can move forward on the ciscosparksdk package.

Happy Coding!