Example #1
0
    def get(self, request: Request, team: Team) -> Response:
        """
        Get the Notification Settings for a given User.
        ````````````````````````````````
        :pparam string team_slug: The slug of the team to get.
        :qparam string type: If set, filter the NotificationSettings to this type.
        :auth required:
        """

        type_option = validate_type_option(request.GET.get("type"))

        return Response(
            serialize(
                team,
                request.user,
                NotificationSettingsSerializer(),
                type=type_option,
            ), )
    def get(self, request: Request, user: User) -> Response:
        """
        Get the Notification Settings for a given User.
        ````````````````````````````````
        :pparam string user_id: A User's `user_id` or "me" for current user.
        :qparam string type: If set, filter the NotificationSettings to this type.

        :auth required:
        """

        type_option = validate_type_option(request.GET.get("type"))

        return Response(
            serialize(
                user,
                request.user,
                NotificationSettingsSerializer(),
                type=type_option,
            ), )
Example #3
0
    def get(self, request: Request, team: Team) -> Response:
        """
        Get the Notification Settings for a given User.
        ````````````````````````````````
        :pparam string team_slug: The slug of the team to get.
        :qparam string type: If set, filter the NotificationSettings to this type.
        :auth required:
        """
        if not features.has("organizations:notification-platform",
                            team.organization,
                            actor=request.user):
            raise ResourceDoesNotExist

        type_option = validate_type_option(request.GET.get("type"))

        return Response(
            serialize(
                team,
                request.user,
                NotificationSettingsSerializer(),
                type=type_option,
            ), )