class documentation

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_BASE_URL Undocumented
Instance Variable raw Undocumented
Method _default_headers Undocumented
Method _find_by_url Finds a resource on the specified url.
Method _get_url Gets the url for the specified path.
Method _load Load a resource.
Method _parse_raw Parse a raw dictionary to create a resource.
Constant _HASH_IDS Undocumented
Constant _READABLE_IDS Undocumented
Instance Variable _base_url Undocumented
Instance Variable _options Undocumented
Instance Variable _resource Undocumented
Instance Variable _session Undocumented
def __eq__(self, other: Any) -> bool: (source)

Default equality test. Checks the types look about right and that the relevant attributes that uniquely identify a resource are equal.

def __getattr__(self, item: str) -> Any: (source)

Allow access of attributes via names. Args: item (str): Attribute Name Raises: AttributeError: When attribute does not exist. Returns: Any: Attribute value.

def __getstate__(self) -> Dict[str, Any]: (source)

Pickling the resource.

def __hash__(self) -> int: (source)

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.

def __repr__(self) -> str: (source)

Identify the class and include any and all relevant values. Returns: str

def __setstate__(self, raw_pickled: Dict[str, Any]): (source)

Unpickling of the resource.

def __str__(self) -> str: (source)

Return the first value we find that is likely to be human-readable. Returns: str

def delete(self, params: Optional[Dict[str, Any]] = None) -> Optional[Response]: (source)

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

def find(self, id: 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

def update(self, fields: Optional[Dict[str, Any]] = None, async_: Optional[bool] = None, jira: JIRA = None, notify: bool = True, **kwargs: Any): (source)

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_BASE_URL: str = (source)

Undocumented

Value
'{server}/rest/{rest_path}/{rest_api_version}/{path}'
def _default_headers(self, user_headers): (source)

Undocumented

def _find_by_url(self, url: str, params: Optional[Dict[str, str]] = None): (source)

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

def _get_url(self, path: str) -> str: (source)

Gets the url for the specified path. Args: path (str): str Returns: str

def _load(self, url: 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

def _parse_raw(self, raw: Dict[str, Any]): (source)

Parse a raw dictionary to create a resource. Args: raw (Dict[str, Any])

_HASH_IDS: tuple[str, ...] = (source)

Undocumented

Value
('self', 'type', 'key', 'id', 'name')
_READABLE_IDS: tuple[str, ...] = (source)

Undocumented

Value
('displayName',
 'key',
 'name',
 'accountId',
 'filename',
 'value',
 'scope',
...
_base_url = (source)

Undocumented

_options = (source)

Undocumented

_resource = (source)

Undocumented

_session = (source)

Undocumented