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_id1 = "/apis/" + api_id + ";rev=" + api_revision

    return client.api_release.create_or_update(
        resource_group_name, service_name, api_id, release_id, "*" if if_match is None else if_match, api_id1, notes)