# generated from rosidl_generator_py/resource/_idl.py.em
# with input from bcr_bot:srv/GetVisualTopics.idl
# generated code does not contain a copyright notice


# Import statements for member types

import builtins  # noqa: E402, I100

import rosidl_parser.definition  # noqa: E402, I100


class Metaclass_GetVisualTopics_Request(type):
    """Metaclass of message 'GetVisualTopics_Request'."""

    _CREATE_ROS_MESSAGE = None
    _CONVERT_FROM_PY = None
    _CONVERT_TO_PY = None
    _DESTROY_ROS_MESSAGE = None
    _TYPE_SUPPORT = None

    __constants = {
    }

    @classmethod
    def __import_type_support__(cls):
        try:
            from rosidl_generator_py import import_type_support
            module = import_type_support('bcr_bot')
        except ImportError:
            import logging
            import traceback
            logger = logging.getLogger(
                'bcr_bot.srv.GetVisualTopics_Request')
            logger.debug(
                'Failed to import needed modules for type support:\n' +
                traceback.format_exc())
        else:
            cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__srv__get_visual_topics__request
            cls._CONVERT_FROM_PY = module.convert_from_py_msg__srv__get_visual_topics__request
            cls._CONVERT_TO_PY = module.convert_to_py_msg__srv__get_visual_topics__request
            cls._TYPE_SUPPORT = module.type_support_msg__srv__get_visual_topics__request
            cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__srv__get_visual_topics__request

    @classmethod
    def __prepare__(cls, name, bases, **kwargs):
        # list constant names here so that they appear in the help text of
        # the message class under "Data and other attributes defined here:"
        # as well as populate each message instance
        return {
        }


class GetVisualTopics_Request(metaclass=Metaclass_GetVisualTopics_Request):
    """Message class 'GetVisualTopics_Request'."""

    __slots__ = [
        '_refresh',
    ]

    _fields_and_field_types = {
        'refresh': 'boolean',
    }

    SLOT_TYPES = (
        rosidl_parser.definition.BasicType('boolean'),  # noqa: E501
    )

    def __init__(self, **kwargs):
        assert all('_' + key in self.__slots__ for key in kwargs.keys()), \
            'Invalid arguments passed to constructor: %s' % \
            ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__))
        self.refresh = kwargs.get('refresh', bool())

    def __repr__(self):
        typename = self.__class__.__module__.split('.')
        typename.pop()
        typename.append(self.__class__.__name__)
        args = []
        for s, t in zip(self.__slots__, self.SLOT_TYPES):
            field = getattr(self, s)
            fieldstr = repr(field)
            # We use Python array type for fields that can be directly stored
            # in them, and "normal" sequences for everything else.  If it is
            # a type that we store in an array, strip off the 'array' portion.
            if (
                isinstance(t, rosidl_parser.definition.AbstractSequence) and
                isinstance(t.value_type, rosidl_parser.definition.BasicType) and
                t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64']
            ):
                if len(field) == 0:
                    fieldstr = '[]'
                else:
                    assert fieldstr.startswith('array(')
                    prefix = "array('X', "
                    suffix = ')'
                    fieldstr = fieldstr[len(prefix):-len(suffix)]
            args.append(s[1:] + '=' + fieldstr)
        return '%s(%s)' % ('.'.join(typename), ', '.join(args))

    def __eq__(self, other):
        if not isinstance(other, self.__class__):
            return False
        if self.refresh != other.refresh:
            return False
        return True

    @classmethod
    def get_fields_and_field_types(cls):
        from copy import copy
        return copy(cls._fields_and_field_types)

    @builtins.property
    def refresh(self):
        """Message field 'refresh'."""
        return self._refresh

    @refresh.setter
    def refresh(self, value):
        if __debug__:
            assert \
                isinstance(value, bool), \
                "The 'refresh' field must be of type 'bool'"
        self._refresh = value


# Import statements for member types

# already imported above
# import builtins

# already imported above
# import rosidl_parser.definition


class Metaclass_GetVisualTopics_Response(type):
    """Metaclass of message 'GetVisualTopics_Response'."""

    _CREATE_ROS_MESSAGE = None
    _CONVERT_FROM_PY = None
    _CONVERT_TO_PY = None
    _DESTROY_ROS_MESSAGE = None
    _TYPE_SUPPORT = None

    __constants = {
    }

    @classmethod
    def __import_type_support__(cls):
        try:
            from rosidl_generator_py import import_type_support
            module = import_type_support('bcr_bot')
        except ImportError:
            import logging
            import traceback
            logger = logging.getLogger(
                'bcr_bot.srv.GetVisualTopics_Response')
            logger.debug(
                'Failed to import needed modules for type support:\n' +
                traceback.format_exc())
        else:
            cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__srv__get_visual_topics__response
            cls._CONVERT_FROM_PY = module.convert_from_py_msg__srv__get_visual_topics__response
            cls._CONVERT_TO_PY = module.convert_to_py_msg__srv__get_visual_topics__response
            cls._TYPE_SUPPORT = module.type_support_msg__srv__get_visual_topics__response
            cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__srv__get_visual_topics__response

    @classmethod
    def __prepare__(cls, name, bases, **kwargs):
        # list constant names here so that they appear in the help text of
        # the message class under "Data and other attributes defined here:"
        # as well as populate each message instance
        return {
        }


class GetVisualTopics_Response(metaclass=Metaclass_GetVisualTopics_Response):
    """Message class 'GetVisualTopics_Response'."""

    __slots__ = [
        '_depth_image_topics',
        '_rgb_image_topics',
        '_camera_info_topics',
        '_point_cloud_topics',
    ]

    _fields_and_field_types = {
        'depth_image_topics': 'sequence<string>',
        'rgb_image_topics': 'sequence<string>',
        'camera_info_topics': 'sequence<string>',
        'point_cloud_topics': 'sequence<string>',
    }

    SLOT_TYPES = (
        rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()),  # noqa: E501
        rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()),  # noqa: E501
        rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()),  # noqa: E501
        rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()),  # noqa: E501
    )

    def __init__(self, **kwargs):
        assert all('_' + key in self.__slots__ for key in kwargs.keys()), \
            'Invalid arguments passed to constructor: %s' % \
            ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__))
        self.depth_image_topics = kwargs.get('depth_image_topics', [])
        self.rgb_image_topics = kwargs.get('rgb_image_topics', [])
        self.camera_info_topics = kwargs.get('camera_info_topics', [])
        self.point_cloud_topics = kwargs.get('point_cloud_topics', [])

    def __repr__(self):
        typename = self.__class__.__module__.split('.')
        typename.pop()
        typename.append(self.__class__.__name__)
        args = []
        for s, t in zip(self.__slots__, self.SLOT_TYPES):
            field = getattr(self, s)
            fieldstr = repr(field)
            # We use Python array type for fields that can be directly stored
            # in them, and "normal" sequences for everything else.  If it is
            # a type that we store in an array, strip off the 'array' portion.
            if (
                isinstance(t, rosidl_parser.definition.AbstractSequence) and
                isinstance(t.value_type, rosidl_parser.definition.BasicType) and
                t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64']
            ):
                if len(field) == 0:
                    fieldstr = '[]'
                else:
                    assert fieldstr.startswith('array(')
                    prefix = "array('X', "
                    suffix = ')'
                    fieldstr = fieldstr[len(prefix):-len(suffix)]
            args.append(s[1:] + '=' + fieldstr)
        return '%s(%s)' % ('.'.join(typename), ', '.join(args))

    def __eq__(self, other):
        if not isinstance(other, self.__class__):
            return False
        if self.depth_image_topics != other.depth_image_topics:
            return False
        if self.rgb_image_topics != other.rgb_image_topics:
            return False
        if self.camera_info_topics != other.camera_info_topics:
            return False
        if self.point_cloud_topics != other.point_cloud_topics:
            return False
        return True

    @classmethod
    def get_fields_and_field_types(cls):
        from copy import copy
        return copy(cls._fields_and_field_types)

    @builtins.property
    def depth_image_topics(self):
        """Message field 'depth_image_topics'."""
        return self._depth_image_topics

    @depth_image_topics.setter
    def depth_image_topics(self, value):
        if __debug__:
            from collections.abc import Sequence
            from collections.abc import Set
            from collections import UserList
            from collections import UserString
            assert \
                ((isinstance(value, Sequence) or
                  isinstance(value, Set) or
                  isinstance(value, UserList)) and
                 not isinstance(value, str) and
                 not isinstance(value, UserString) and
                 all(isinstance(v, str) for v in value) and
                 True), \
                "The 'depth_image_topics' field must be a set or sequence and each value of type 'str'"
        self._depth_image_topics = value

    @builtins.property
    def rgb_image_topics(self):
        """Message field 'rgb_image_topics'."""
        return self._rgb_image_topics

    @rgb_image_topics.setter
    def rgb_image_topics(self, value):
        if __debug__:
            from collections.abc import Sequence
            from collections.abc import Set
            from collections import UserList
            from collections import UserString
            assert \
                ((isinstance(value, Sequence) or
                  isinstance(value, Set) or
                  isinstance(value, UserList)) and
                 not isinstance(value, str) and
                 not isinstance(value, UserString) and
                 all(isinstance(v, str) for v in value) and
                 True), \
                "The 'rgb_image_topics' field must be a set or sequence and each value of type 'str'"
        self._rgb_image_topics = value

    @builtins.property
    def camera_info_topics(self):
        """Message field 'camera_info_topics'."""
        return self._camera_info_topics

    @camera_info_topics.setter
    def camera_info_topics(self, value):
        if __debug__:
            from collections.abc import Sequence
            from collections.abc import Set
            from collections import UserList
            from collections import UserString
            assert \
                ((isinstance(value, Sequence) or
                  isinstance(value, Set) or
                  isinstance(value, UserList)) and
                 not isinstance(value, str) and
                 not isinstance(value, UserString) and
                 all(isinstance(v, str) for v in value) and
                 True), \
                "The 'camera_info_topics' field must be a set or sequence and each value of type 'str'"
        self._camera_info_topics = value

    @builtins.property
    def point_cloud_topics(self):
        """Message field 'point_cloud_topics'."""
        return self._point_cloud_topics

    @point_cloud_topics.setter
    def point_cloud_topics(self, value):
        if __debug__:
            from collections.abc import Sequence
            from collections.abc import Set
            from collections import UserList
            from collections import UserString
            assert \
                ((isinstance(value, Sequence) or
                  isinstance(value, Set) or
                  isinstance(value, UserList)) and
                 not isinstance(value, str) and
                 not isinstance(value, UserString) and
                 all(isinstance(v, str) for v in value) and
                 True), \
                "The 'point_cloud_topics' field must be a set or sequence and each value of type 'str'"
        self._point_cloud_topics = value


class Metaclass_GetVisualTopics(type):
    """Metaclass of service 'GetVisualTopics'."""

    _TYPE_SUPPORT = None

    @classmethod
    def __import_type_support__(cls):
        try:
            from rosidl_generator_py import import_type_support
            module = import_type_support('bcr_bot')
        except ImportError:
            import logging
            import traceback
            logger = logging.getLogger(
                'bcr_bot.srv.GetVisualTopics')
            logger.debug(
                'Failed to import needed modules for type support:\n' +
                traceback.format_exc())
        else:
            cls._TYPE_SUPPORT = module.type_support_srv__srv__get_visual_topics

            from bcr_bot.srv import _get_visual_topics
            if _get_visual_topics.Metaclass_GetVisualTopics_Request._TYPE_SUPPORT is None:
                _get_visual_topics.Metaclass_GetVisualTopics_Request.__import_type_support__()
            if _get_visual_topics.Metaclass_GetVisualTopics_Response._TYPE_SUPPORT is None:
                _get_visual_topics.Metaclass_GetVisualTopics_Response.__import_type_support__()


class GetVisualTopics(metaclass=Metaclass_GetVisualTopics):
    from bcr_bot.srv._get_visual_topics import GetVisualTopics_Request as Request
    from bcr_bot.srv._get_visual_topics import GetVisualTopics_Response as Response

    def __init__(self):
        raise NotImplementedError('Service classes can not be instantiated')
