

@staticmethod
def get_class(api_name, version, version_map):
    "Returns the client class for the requested API version\n\n        :param api_name: the name of the API, e.g. 'compute', 'image', etc\n        :param version: the requested API version\n        :param version_map: a dict of client classes keyed by version\n        :rtype: a client class for the requested API version\n        "
    try:
        client_path = version_map[str(version)]
    except (KeyError, ValueError):
        msg = (_("Invalid %(api_name)s client version '%(version)s'. Must be one of: %(version_map)s") % {
            'api_name': api_name,
            'version': version,
            'version_map': ', '.join(version_map.keys()),
        })
        raise exceptions.UnsupportedVersion(msg)
    return importutils.import_class(client_path)

dataset/ETHPy150Open openstack-infra/python-storyboardclient/storyboardclient/openstack/common/apiclient/client.py BaseClient.get_class/original