# Path: monasca_api/common/repositories/notifications_repository.py
# class NotificationsRepository(object):
#     def create_notification(self, tenant_id, name, notification_type,
#                             address, period):
#     def list_notifications(self, tenant_id, sort_by, offset, limit):
#     def delete_notification(self, tenant_id, notification_id):
#     def list_notification(self, tenant_id, notification_id):
#     def update_notification(self, notification_id, tenant_id, name, notification_type,
#                             address, period):
# 
# Path: monasca_api/common/repositories/sqla/models.py
# def get_all_metadata():
# def create_a_model(metadata=None):
# def create_sadd_model(metadata=None):
# def create_aa_model(metadata=None):
# def create_md_model(metadata=None):
# def create_mde_model(metadata=None):
# def create_nm_model(metadata=None):
# def create_nmt_model(metadata=None):
# def create_mdd_model(metadata=None):
# def create_am_model(metadata=None):
# def create_ad_model(metadata=None):
# def create_sa_model(metadata=None):
# def create_sad_model(metadata=None):
#     def __init__(self, columns, separator=',', order_by=None):
# def _group_concat_oracle(element, compiler_, **kw):
# def _group_concat_postgresql(element, compiler_, **kw):
# def _group_concat_sybase(element, compiler_, **kw):
# def _group_concat_mysql(element, compiler_, **kw):
# def _group_concat_default(element, compiler_, **kw):
#     def __init__(self, column, fields):
# def _field_sort_mysql(element, compiler_, **kw):
# def _field_sort_general(element, compiler_, **kw):
# class group_concat(expression.ColumnElement):
# class field_sort(expression.ColumnElement):


import datetime
import six
from oslo_utils import uuidutils
from monasca_api.common.repositories import exceptions
from monasca_api.common.repositories import notifications_repository as nr
from monasca_api.common.repositories.sqla import models
from monasca_api.common.repositories.sqla import sql_repository
from sqlalchemy import MetaData, update, insert, delete
from sqlalchemy import select, bindparam, func, and_, literal_column

        self._select_nm_count_id_query = (select([func.count()])
                                          .select_from(nm)
                                          .where(
                                              and_(nm.c.tenant_id == bindparam('b_tenant_id'),
                                                   nm.c.id == bindparam('b_id'))))

        self._insert_nm_query = (insert(nm)
                                 .values(
                                     id=bindparam('b_id'),
                                     tenant_id=bindparam('b_tenant_id'),
                                     name=bindparam('b_name'),
                                     type=bindparam('b_type'),
                                     address=bindparam('b_address'),
                                     period=bindparam('b_period'),
                                     created_at=bindparam('b_created_at'),
                                     updated_at=bindparam('b_updated_at')))

        self._delete_nm_query = (delete(nm)
                                 .where(nm.c.tenant_id == bindparam('b_tenant_id'))
                                 .where(nm.c.id == bindparam('b_id')))

        self._update_nm_query = (update(nm)
                                 .where(nm.c.tenant_id == bindparam('b_tenant_id'))
                                 .where(nm.c.id == bindparam('b_id'))
                                 .values(
                                     name=bindparam('b_name'),
                                     type=bindparam('b_type'),
                                     address=bindparam('b_address'),
                                     period=bindparam('b_period'),

# Path: monasca_api/common/repositories/notifications_repository.py
# class NotificationsRepository(object):
#     def create_notification(self, tenant_id, name, notification_type,
#                             address, period):
#     def list_notifications(self, tenant_id, sort_by, offset, limit):
#     def delete_notification(self, tenant_id, notification_id):
#     def list_notification(self, tenant_id, notification_id):
#     def update_notification(self, notification_id, tenant_id, name, notification_type,
#                             address, period):
# 
# Path: monasca_api/common/repositories/sqla/models.py
# def get_all_metadata():
# def create_a_model(metadata=None):
# def create_sadd_model(metadata=None):
# def create_aa_model(metadata=None):
# def create_md_model(metadata=None):
# def create_mde_model(metadata=None):
# def create_nm_model(metadata=None):
# def create_nmt_model(metadata=None):
# def create_mdd_model(metadata=None):
# def create_am_model(metadata=None):
# def create_ad_model(metadata=None):
# def create_sa_model(metadata=None):
# def create_sad_model(metadata=None):
#     def __init__(self, columns, separator=',', order_by=None):
# def _group_concat_oracle(element, compiler_, **kw):
# def _group_concat_postgresql(element, compiler_, **kw):
# def _group_concat_sybase(element, compiler_, **kw):
# def _group_concat_mysql(element, compiler_, **kw):
# def _group_concat_default(element, compiler_, **kw):
#     def __init__(self, column, fields):
# def _field_sort_mysql(element, compiler_, **kw):
# def _field_sort_general(element, compiler_, **kw):
# class group_concat(expression.ColumnElement):
# class field_sort(expression.ColumnElement):


# Path: monasca_api/common/repositories/sqla/notifications_repository.py
import datetime
import six
from oslo_utils import uuidutils
from monasca_api.common.repositories import exceptions
from monasca_api.common.repositories import notifications_repository as nr
from monasca_api.common.repositories.sqla import models
from monasca_api.common.repositories.sqla import sql_repository
from sqlalchemy import MetaData, update, insert, delete
from sqlalchemy import select, bindparam, func, and_, literal_column


        self._select_nm_count_id_query = (select([func.count()])
                                          .select_from(nm)
                                          .where(
                                              and_(nm.c.tenant_id == bindparam('b_tenant_id'),
                                                   nm.c.id == bindparam('b_id'))))

        self._insert_nm_query = (insert(nm)
                                 .values(
                                     id=bindparam('b_id'),
                                     tenant_id=bindparam('b_tenant_id'),
                                     name=bindparam('b_name'),
                                     type=bindparam('b_type'),
                                     address=bindparam('b_address'),
                                     period=bindparam('b_period'),
                                     created_at=bindparam('b_created_at'),
                                     updated_at=bindparam('b_updated_at')))

        self._delete_nm_query = (delete(nm)
                                 .where(nm.c.tenant_id == bindparam('b_tenant_id'))
                                 .where(nm.c.id == bindparam('b_id')))

        self._update_nm_query = (update(nm)
                                 .where(nm.c.tenant_id == bindparam('b_tenant_id'))
                                 .where(nm.c.id == bindparam('b_id'))
                                 .values(
                                     name=bindparam('b_name'),
                                     type=bindparam('b_type'),
                                     address=bindparam('b_address'),
                                     period=bindparam('b_period'),

                                     updated_at=bindparam('b_updated_at')))