Skip to content

Duplicate definition for methods in JamaClient #65

@automas-dev

Description

@automas-dev

Describe the bug
There are multiple definitions of some methods in JamaClient. for the get_item_versions method in JamaClient

JamaClient.get_item_versions

  • def get_item_versions(self, item_id):
    """
    Get all versions for the item with the specified ID
    Args:
    item_id: the item id of the item to fetch
    Returns: JSON array with all versions for the item
    """
    resource_path = 'items/' + str(item_id) + '/versions'
    versions = self.__get_all(resource_path)
    return versions
  • def get_item_versions(self, item_id, allowed_results_per_page=__allowed_results_per_page):
    """
    Get all versions for the item with the specified ID
    Args:
    item_id: the item id of the item to fetch
    allowed_results_per_page: number of results per page
    Returns: JSON array with all versions for the item
    """
    resource_path = 'items/' + str(item_id) + '/versions'
    versions = self.__get_all(resource_path, allowed_results_per_page=allowed_results_per_page)
    return versions

JamaClient.get_item_version (singular)

  • def get_item_version(self, item_id, version_num):
    """
    Get the numbered version for the item with the specified ID
    Args:
    item_id: the item id of the item to fetch
    version_num: the version number for the item
    Returns: a dictionary object representing the numbered version
    """
    resource_path = 'items/' + str(item_id) + '/versions/' + str(version_num)
    try:
    response = self.__core.get(resource_path)
    except CoreException as err:
    py_jama_rest_client_logger.error(err)
    raise APIException(str(err))
    JamaClient.__handle_response_status(response)
    return response.json()['data']
  • def get_item_version(self, item_id, version_num):
    """
    Get the numbered version for the item with the specified ID
    Args:
    item_id: the item id of the item to fetch
    version_num: the version number for the item
    Returns: a dictionary object representing the numbered version
    """
    resource_path = 'items/' + str(item_id) + '/versions/' + str(version_num)
    response = self.__core.get(resource_path)
    JamaClient.__handle_response_status(response)
    return response.json()['data']

JamaClient.get_versioned_item

  • def get_versioned_item(self, item_id, version_num):
    """
    Get the snapshot of the item at the specified version
    Args:
    item_id: the item id of the item to fetch
    version_num: the version number for the item
    Returns: a dictionary object representing the versioned item
    """
    resource_path = 'items/' + str(item_id) + '/versions/' + str(version_num) + '/versioneditem'
    try:
    response = self.__core.get(resource_path)
    except CoreException as err:
    py_jama_rest_client_logger.error(err)
    raise APIException(str(err))
    JamaClient.__handle_response_status(response)
    return response.json()['data']
  • def get_versioned_item(self, item_id, version_num):
    """
    Get the snapshot of the item at the specified version
    Args:
    item_id: the item id of the item to fetch
    version_num: the version number for the item
    Returns: a dictionary object representing the versioned item
    """
    resource_path = 'items/' + str(item_id) + '/versions/' + str(version_num) + '/versioneditem'
    response = self.__core.get(resource_path)
    JamaClient.__handle_response_status(response)
    return response.json()['data']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions