# Path: s3transfer/compat.py
# def accepts_kwargs(func):
#     return inspect.getfullargspec(func)[2]
# 
# Path: s3transfer/exceptions.py
# class InvalidSubscriberMethodError(Exception):
#     pass


from s3transfer.compat import accepts_kwargs
from s3transfer.exceptions import InvalidSubscriberMethodError
# or in the "license" file accompanying this file. This file 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 BaseSubscriber:
    """The base subscriber class

    It is recommended that all subscriber implementations subclass and then
    override the subscription methods (i.e. on_{subsribe_type}() methods).
    """

    VALID_SUBSCRIBER_TYPES = ['queued', 'progress', 'done']

    def __new__(cls, *args, **kwargs):
        cls._validate_subscriber_methods()
        return super().__new__(cls)

    @classmethod
    def _validate_subscriber_methods(cls):
        for subscriber_type in cls.VALID_SUBSCRIBER_TYPES:
            subscriber_method = getattr(cls, 'on_' + subscriber_type)
            if not callable(subscriber_method):
                raise InvalidSubscriberMethodError(
                    'Subscriber method %s must be callable.'
                    % subscriber_method
                )

            if not accepts_kwargs(subscriber_method):

# Path: s3transfer/compat.py
# def accepts_kwargs(func):
#     return inspect.getfullargspec(func)[2]
# 
# Path: s3transfer/exceptions.py
# class InvalidSubscriberMethodError(Exception):
#     pass


# Path: s3transfer/subscribers.py
from s3transfer.compat import accepts_kwargs
from s3transfer.exceptions import InvalidSubscriberMethodError

# or in the "license" file accompanying this file. This file 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 BaseSubscriber:
    """The base subscriber class

    It is recommended that all subscriber implementations subclass and then
    override the subscription methods (i.e. on_{subsribe_type}() methods).
    """

    VALID_SUBSCRIBER_TYPES = ['queued', 'progress', 'done']

    def __new__(cls, *args, **kwargs):
        cls._validate_subscriber_methods()
        return super().__new__(cls)

    @classmethod
    def _validate_subscriber_methods(cls):
        for subscriber_type in cls.VALID_SUBSCRIBER_TYPES:
            subscriber_method = getattr(cls, 'on_' + subscriber_type)
            if not callable(subscriber_method):
                raise InvalidSubscriberMethodError(
                    'Subscriber method %s must be callable.'
                    % subscriber_method
                )

            if not accepts_kwargs(subscriber_method):

                raise InvalidSubscriberMethodError(