class Resource: (source)
Known subclasses: jira.Comment
, jira.Issue
, jira.Priority
, jira.Project
, jira.resources.AgileResource
, jira.resources.Attachment
, jira.resources.Component
, jira.resources.Customer
, jira.resources.CustomFieldOption
, jira.resources.Dashboard
, jira.resources.Filter
, jira.resources.Group
, jira.resources.IssueLink
, jira.resources.IssueLinkType
, jira.resources.IssueProperty
, jira.resources.IssueSecurityLevelScheme
, jira.resources.IssueType
, jira.resources.IssueTypeScheme
, jira.resources.NotificationScheme
, jira.resources.PermissionScheme
, jira.resources.PriorityScheme
, jira.resources.RemoteLink
, jira.resources.RequestType
, jira.resources.Resolution
, jira.resources.SecurityLevel
, jira.resources.ServiceDesk
, jira.resources.Status
, jira.resources.StatusCategory
, jira.resources.TimeTracking
, jira.resources.UnknownResource
, jira.resources.Version
, jira.resources.Votes
, jira.resources.WorkflowScheme
, jira.Role
, jira.User
, jira.Watchers
, jira.Worklog
Models a URL-addressable resource in the Jira REST API. All Resource objects provide the following: ``find()`` -- get a resource from the server and load it into the current object (though clients should use the methods in the JIRA class instead of this method directly) ``update()`` -- changes the value of this resource on the server and returns a new resource object for it ``delete()`` -- deletes this resource from the server ``self`` -- the URL of this resource on the server ``raw`` -- dict of properties parsed out of the JSON response from the server Subclasses will implement ``update()`` and ``delete()`` as appropriate for the specific resource. All Resources have a resource path of the form: * ``issue`` * ``project/{0}`` * ``issue/{0}/votes`` * ``issue/{0}/comment/{1}`` where the bracketed numerals are placeholders for ID values that are filled in from the ``ids`` parameter to ``find()``.
Method | __eq__ |
Default equality test. |
Method | __getattr__ |
Allow access of attributes via names. |
Method | __getstate__ |
Pickling the resource. |
Method | __hash__ |
Hash calculation. |
Method | __init__ |
Initializes a generic resource. |
Method | __repr__ |
Identify the class and include any and all relevant values. |
Method | __setstate__ |
Unpickling of the resource. |
Method | __str__ |
Return the first value we find that is likely to be human-readable. |
Method | delete |
Delete this resource from the server, passing the specified query parameters. |
Method | find |
Finds a resource based on the input parameters. |
Method | update |
Update this resource on the server. |
Constant | JIRA |
Undocumented |
Instance Variable | raw |
Undocumented |
Method | _default |
Undocumented |
Method | _find |
Finds a resource on the specified url. |
Method | _get |
Gets the url for the specified path. |
Method | _load |
Load a resource. |
Method | _parse |
Parse a raw dictionary to create a resource. |
Constant | _HASH |
Undocumented |
Constant | _READABLE |
Undocumented |
Instance Variable | _base |
Undocumented |
Instance Variable | _options |
Undocumented |
Instance Variable | _resource |
Undocumented |
Instance Variable | _session |
Undocumented |
Default equality test. Checks the types look about right and that the relevant attributes that uniquely identify a resource are equal.
Allow access of attributes via names. Args: item (str): Attribute Name Raises: AttributeError: When attribute does not exist. Returns: Any: Attribute value.
Hash calculation. We try to find unique identifier like properties to form our hash object. Technically 'self', if present, is the unique URL to the object, and should be sufficient to generate a unique hash.
str
, options: Dict[ str, Any]
, session: ResilientSession
, base_url: str
= JIRA_BASE_URL):
(source)
¶
jira.Comment
, jira.Issue
, jira.Priority
, jira.Project
, jira.resources.AgileResource
, jira.resources.Attachment
, jira.resources.Component
, jira.resources.Customer
, jira.resources.CustomFieldOption
, jira.resources.Dashboard
, jira.resources.Filter
, jira.resources.Group
, jira.resources.IssueLink
, jira.resources.IssueLinkType
, jira.resources.IssueProperty
, jira.resources.IssueSecurityLevelScheme
, jira.resources.IssueType
, jira.resources.IssueTypeScheme
, jira.resources.NotificationScheme
, jira.resources.PermissionScheme
, jira.resources.PriorityScheme
, jira.resources.RemoteLink
, jira.resources.RequestType
, jira.resources.Resolution
, jira.resources.SecurityLevel
, jira.resources.ServiceDesk
, jira.resources.Status
, jira.resources.StatusCategory
, jira.resources.TimeTracking
, jira.resources.UnknownResource
, jira.resources.Version
, jira.resources.Votes
, jira.resources.WorkflowScheme
, jira.Role
, jira.User
, jira.Watchers
, jira.Worklog
Initializes a generic resource. Args: resource (str): The name of the resource. options (Dict[str,str]): Options for the new resource session (ResilientSession): Session used for the resource. base_url (Optional[str]): The Base Jira url.
jira.Issue
, jira.resources.Component
, jira.resources.Version
, jira.Watchers
, jira.Worklog
Delete this resource from the server, passing the specified query parameters. If this resource doesn't support ``DELETE``, a :py:exc:`.JIRAError` will be raised; subclasses that specialize this method will only raise errors in case of user error. Args: params: Parameters for the delete request. Returns: Optional[Response]: Returns None if async
Union[ Tuple[ str, str], int, str]
, params: Optional[ Dict[ str, str]]
= None):
(source)
¶
Finds a resource based on the input parameters. Args: id (Union[Tuple[str, str], int, str]): id params (Optional[Dict[str, str]]): params
Optional[ Dict[ str, Any]]
= None, async_: Optional[ bool]
= None, jira: JIRA
= None, notify: bool
= True, **kwargs: Any
):
(source)
¶
jira.Comment
, jira.Issue
, jira.resources.RemoteLink
, jira.resources.Version
, jira.Role
Update this resource on the server. Keyword arguments are marshalled into a dict before being sent. If this resource doesn't support ``PUT``, a :py:exc:`.JIRAError` will be raised; subclasses that specialize this method will only raise errors in case of user error. Args: fields (Optional[Dict[str, Any]]): Fields which should be updated for the object. async_ (Optional[bool]): True to add the request to the queue, so it can be executed later using async_run() jira (jira.client.JIRA): Instance of Jira Client notify (bool): True to notify watchers about the update, sets parameter notifyUsers. (Default: ``True``). Admin or project admin permissions are required to disable the notification. kwargs (Any): extra arguments to the PUT request.
jira.Comment
, jira.Issue
, jira.Priority
, jira.Project
, jira.resources.AgileResource
, jira.resources.Attachment
, jira.resources.Component
, jira.resources.Customer
, jira.resources.CustomFieldOption
, jira.resources.Dashboard
, jira.resources.Filter
, jira.resources.Group
, jira.resources.IssueLink
, jira.resources.IssueLinkType
, jira.resources.IssueProperty
, jira.resources.IssueSecurityLevelScheme
, jira.resources.IssueType
, jira.resources.IssueTypeScheme
, jira.resources.NotificationScheme
, jira.resources.PermissionScheme
, jira.resources.PriorityScheme
, jira.resources.RemoteLink
, jira.resources.RequestType
, jira.resources.Resolution
, jira.resources.SecurityLevel
, jira.resources.ServiceDesk
, jira.resources.Status
, jira.resources.StatusCategory
, jira.resources.TimeTracking
, jira.resources.UnknownResource
, jira.resources.Version
, jira.resources.Votes
, jira.resources.WorkflowScheme
, jira.Role
, jira.User
, jira.Watchers
, jira.Worklog
Undocumented
jira.resources.IssueProperty
Finds a resource on the specified url. The resource is loaded with the JSON data returned by doing a request on the specified url. Args: url (str): url params (Optional[Dict[str, str]]): params
str
, headers=CaseInsensitiveDict(), params: Optional[ Dict[ str, str]]
= None, path: Optional[ str]
= None):
(source)
¶
Load a resource. Args: url (str): url headers (Optional[CaseInsensitiveDict]): headers. Defaults to CaseInsensitiveDict(). params (Optional[Dict[str,str]]): params to get request. Defaults to None. path (Optional[str]): field to get. Defaults to None. Raises: ValueError: If json cannot be loaded