import uuid


def create_api_release(client, resource_group_name, service_name, api_id, api_revision, release_id=None, if_match=None, notes=None):
    """Creates a new Release for the API."""
    if release_id is None:
        release_id = uuid.uuid4().hex

    api_revision_to_release_and_make_current = "/apis/" + api_id + ";rev=" + api_revision
    if_match = "*" if if_match is None else if_match

    return client.create_or_update(resource_group_name, service_name, api_id, release_id, if_match, api_revision_to_release_and_make_current, notes)