Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
`jira/client.py` ---------------- * Added `cloud_api` convenience decorator for client methods that make calls that are only available on the `cloud_api` api. It checks the `client` instance to see if it `_is_cloud`. If not, it logs a warning and returns `None`. This was the convention seen on other endpoints on the `client`. * Added `experimental_atlassian_api` convenience decorator for client methods that make calls that are experimental. It attempts to run the client method, if a `JIRAError` is raised that has a response object, the response is checked for a status code in `[404, 405]` indicating either the path no longer accepts the HTTP verb or no longer exists, and then logs a warning and returns `None`. Otherwise it re-raises the error * Imported `DashboardItemProperty`, `DashboardItemPropertyKey`, and `DashboardGadget` resources to client for use in new methods. * Updated the `dashboards` method to include the `gadgets` that exist on a given dashboard. This is a logical association that makes sense, but isn't directly exposed in the API. * Added `create_dashboard` method. It creates a dashboard via the API and returns a `Dashboard` object. * Added `copy_dashboard` method. * Added `update_dashboard_automatic_refresh_seconds` method. This calls the `internal` API, which is why it's decorated with `experimental_atlassian_api` and `cloud_api`. This might change in the future, but it really is a handy thing to have, otherwise, the user has to configure this in the web interface. --- * Added `dashboard_item_property` method. This is available on both `cloud_api` and `server`. * Added `dashboard_item_property_keys` method. This is available on both `cloud_api` and `server`. * Added `set_dashboard_item_property` method. This is available on both `cloud_api` and `server`. --- ^^ These methods all provide a means of adding arbitrary metadata to `dashboard_items` (`gadgets`) and/or configure them via specific keys. * Added `dashboard_gadgets` method. This returns the gadgets associated with a given dashboard. It also iterates over the `keys` for this `gadget`'s properties, generating a list of `DashboardItemProperty` objects that are associated with each gadget. This makes it really easy for the user to associate which configuration/metadata goes with which gadget. * Added `all_dashboard_gadgets` method. This returns a list of from `jira` of all the `gadgets` that are available to add to any dashboard. * Added `add_gadget_to_dashboard` method. This allows the user to add gadgets to a specified dashboard. * Added the protected method `_get_internal_url`. This is very similar to `get_url` or `get_latest` url, where `options` are updated to allow for easy resolution of paths that are on the `internal` `jira` api. * Updated the `_find_for_resource` typehint on `ids` because it is possible that a resource requires more than `2` ids to resolve it's url. jira/resources.py ----------------- * Added the new resources `DashboardItemProperty`, `DashboardItemPropertyKey`, and `Gadget` to the `__all__` list so they are represented. * Added a `gadgets` attribute to the `Dashboard` resource to house `gadget` references. * Added `DashboardItemPropertyKey` resource. * Added `DashboardItemProperty` resource. The `update` and `delete` methods are overridden here because it does not have a `self` attribute. This is kind of in an in between space as far as being considered a resource, but for ease of use as an interface, it makes sense for it to be considered. * Added `DashboardGadget` resource. It too has overridden `update` and `delete` methods for the aforementioned reasons. jira/utils/__init__.py ---------------------- * Added `remove_empty_attributes` convenience method. I found myself having to remove empty attributes or add a lot of branching in order to accommodate optional payload parameters or path parameters. This function made that easier. jira/utils/exceptions.py ------------------------ * Created `NotJIRAInstanceError` exception. This is raised in the case one of the convenience decorators utilized on a client method is improperly applied to some other kind of object.
- Loading branch information