Skip to content

Commit

Permalink
chore(api): Publish ProjectFiltersEndpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanSkonnord committed Oct 10, 2024
1 parent ff44e53 commit 4b4661d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/sentry/api/endpoints/project_filters.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
from drf_spectacular.utils import extend_schema
from rest_framework.request import Request
from rest_framework.response import Response

from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import region_silo_endpoint
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.serializers.models.project_filters import ProjectFiltersResponse
from sentry.apidocs.constants import RESPONSE_BAD_REQUEST, RESPONSE_UNAUTHORIZED
from sentry.apidocs.parameters import GlobalParams
from sentry.apidocs.utils import inline_sentry_response_serializer
from sentry.ingest import inbound_filters


@extend_schema(tags=["Projects"])
@region_silo_endpoint
class ProjectFiltersEndpoint(ProjectEndpoint):
owner = ApiOwner.UNOWNED
publish_status = {
"GET": ApiPublishStatus.UNKNOWN,
"GET": ApiPublishStatus.PUBLIC,
}

@extend_schema(
operation_id="List a Project's Filters",
parameters=[GlobalParams.ORG_ID_OR_SLUG, GlobalParams.PROJECT_ID_OR_SLUG],
responses={
200: inline_sentry_response_serializer(
"ProjectFiltersResponse", ProjectFiltersResponse
),
400: RESPONSE_BAD_REQUEST,
401: RESPONSE_UNAUTHORIZED,
},
)
def get(self, request: Request, project) -> Response:
"""
List a project's filters
Expand Down
6 changes: 6 additions & 0 deletions src/sentry/api/serializers/models/project_filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import TypedDict


class ProjectFiltersResponse(TypedDict):
id: int
active: bool

0 comments on commit 4b4661d

Please sign in to comment.