Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds
Service.macros
for creating, retrieving, updating, and deleting macros.Currently macros can be accessed via
Configurations
/ConfigurationFile
but creating a properMacros(Collection)
andMacro(Entity)
makes them much easier to work with.Almost all of the code, including tests, is copied and modified from the existing code for saved searches (
Service.saved_searches
) so you can interact with macros in the same manner.Tests
I added a few tests modeled after the existing ones for saved searches. The naming for macros with arguments means that
test_create_with_args
should probably move to another class (self.macro
created bysetUp
is not used) but I didn't want to get carried away until I know there's a desire to merge this (or not).I also had to remove the
app
parameter from theself.macro.acl_update
call because it was failing withArgument "app" is not supported by this handler
. It's not immediately clear to me why this is working for saved searches but not for macros.Usage
As mentioned above, the usage is almost identical to
Service.saved_searches
for saved searches today.List macros
Create a macro
Enable/disable a macro
Update a macro
Delete a macro