# Path: tmapi/exceptions.py
# class ModelConstraintException (TMAPIRuntimeException):
# 
#     """This exception is used to report Topic Maps - Data Model
#     constraint violations."""
# 
#     def __init__ (self, reporter, message):
#         """Creates a new ModelConstraintException with the specified
#         message.
# 
#         :param reporter: the construct which has thrown this exception
#         :type reporter: `Construct`
#         :param message: the detail message
#         :type message: string
# 
#         """
#         self._reporter = reporter
#         self._message = message
#     
#     def get_reporter (self):
#         """Return the `Construct` which has thrown the exception.
# 
#         :rtype: `Construct`
# 
#         """
#         return self._reporter


from tmapi.exceptions import ModelConstraintException
from construct_fields import ConstructFields
from reifiable import Reifiable
from role import Role
from scoped import Scoped
from topic import Topic
from typed import Typed
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




class Association (ConstructFields, Reifiable, Scoped, Typed):
    
    class Meta:
        app_label = 'tmapi'

    def create_role (self, role_type, player):
        """Creates a new role representing a role in this association.

        :param role_type: the role type
        :type role_type: `Topic`
        :param player: the role player
        :type player: `Topic`
        :rtype: `Role`

        """
        if role_type is None:

# Path: tmapi/exceptions.py
# class ModelConstraintException (TMAPIRuntimeException):
# 
#     """This exception is used to report Topic Maps - Data Model
#     constraint violations."""
# 
#     def __init__ (self, reporter, message):
#         """Creates a new ModelConstraintException with the specified
#         message.
# 
#         :param reporter: the construct which has thrown this exception
#         :type reporter: `Construct`
#         :param message: the detail message
#         :type message: string
# 
#         """
#         self._reporter = reporter
#         self._message = message
#     
#     def get_reporter (self):
#         """Return the `Construct` which has thrown the exception.
# 
#         :rtype: `Construct`
# 
#         """
#         return self._reporter


# Path: tmapi/models/association.py
from tmapi.exceptions import ModelConstraintException
from construct_fields import ConstructFields
from reifiable import Reifiable
from role import Role
from scoped import Scoped
from topic import Topic
from typed import Typed

# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




class Association (ConstructFields, Reifiable, Scoped, Typed):
    
    class Meta:
        app_label = 'tmapi'

    def create_role (self, role_type, player):
        """Creates a new role representing a role in this association.

        :param role_type: the role type
        :type role_type: `Topic`
        :param player: the role player
        :type player: `Topic`
        :rtype: `Role`

        """
        if role_type is None:

            raise ModelConstraintException(self, 'The type may not be None')