diff --git a/engine/apps/alerts/models/escalation_policy.py b/engine/apps/alerts/models/escalation_policy.py index 0c10e31f1..7adb6554e 100644 --- a/engine/apps/alerts/models/escalation_policy.py +++ b/engine/apps/alerts/models/escalation_policy.py @@ -345,7 +345,7 @@ def sorted_users_queue(self): return sorted(self.notify_to_users_queue.all(), key=lambda user: (user.username or "", user.pk)) @property - def slack_integration_required(self): + def slack_integration_required(self) -> bool: if self.step in self.SLACK_INTEGRATION_REQUIRED_STEPS: return True else: diff --git a/engine/apps/api/serializers/alert_group_escalation_snapshot.py b/engine/apps/api/serializers/alert_group_escalation_snapshot.py index 296e8d266..9848e4edc 100644 --- a/engine/apps/api/serializers/alert_group_escalation_snapshot.py +++ b/engine/apps/api/serializers/alert_group_escalation_snapshot.py @@ -36,17 +36,17 @@ class Meta(EscalationPolicySerializer.Meta): class AlertGroupEscalationSnapshotAPISerializer(serializers.Serializer): """Serializes AlertGroup escalation snapshot for API endpoint""" - escalation_chain = serializers.SerializerMethodField() - channel_filter = serializers.SerializerMethodField() + class EscalationChainSnapshotAPISerializer(serializers.Serializer): + name = serializers.CharField() + + class ChannelFilterSnapshotAPISerializer(serializers.Serializer): + name = serializers.CharField(source="str_for_clients") + + escalation_chain = EscalationChainSnapshotAPISerializer(read_only=True, source="escalation_chain_snapshot") + channel_filter = ChannelFilterSnapshotAPISerializer(read_only=True, source="channel_filter_snapshot") escalation_policies = EscalationPolicySnapshotAPISerializer( source="escalation_policies_snapshots", many=True, read_only=True ) class Meta: fields = ["escalation_chain", "channel_filter", "escalation_policies"] - - def get_escalation_chain(self, obj): - return {"name": obj.escalation_chain_snapshot.name} - - def get_channel_filter(self, obj): - return {"name": obj.channel_filter_snapshot.str_for_clients} diff --git a/engine/apps/api/serializers/channel_filter.py b/engine/apps/api/serializers/channel_filter.py index 408759fb9..9f76dbe14 100644 --- a/engine/apps/api/serializers/channel_filter.py +++ b/engine/apps/api/serializers/channel_filter.py @@ -14,7 +14,17 @@ from common.utils import is_regex_valid +class SlackChannelDetails(typing.TypedDict): + display_name: str + slack_id: str + id: str + + class ChannelFilterSerializer(EagerLoadingMixin, serializers.ModelSerializer): + class TelegramChannelDetailsSerializer(serializers.Serializer): + display_name = serializers.CharField(source="channel_name") + id = serializers.CharField(source="channel_chat_id") + id = serializers.CharField(read_only=True, source="public_primary_key") alert_receive_channel = OrganizationFilteredPrimaryKeyRelatedField(queryset=AlertReceiveChannel.objects) escalation_chain = OrganizationFilteredPrimaryKeyRelatedField( @@ -28,7 +38,9 @@ class ChannelFilterSerializer(EagerLoadingMixin, serializers.ModelSerializer): telegram_channel = OrganizationFilteredPrimaryKeyRelatedField( queryset=TelegramToOrganizationConnector.objects, filter_field="organization", allow_null=True, required=False ) - telegram_channel_details = serializers.SerializerMethodField() + telegram_channel_details = TelegramChannelDetailsSerializer( + source="telegram_channel", read_only=True, allow_null=True + ) filtering_term_as_jinja2 = serializers.SerializerMethodField() filtering_term = serializers.CharField(required=False, allow_null=True, allow_blank=True) filtering_labels = LabelPairSerializer(many=True, required=False) @@ -86,7 +98,7 @@ def validate(self, data): raise serializers.ValidationError(["Expression type is incorrect"]) return data - def get_slack_channel(self, obj): + def get_slack_channel(self, obj) -> SlackChannelDetails | None: if obj.slack_channel_id is None: return None # display_name and id appears via annotate in ChannelFilterView.get_queryset() @@ -96,18 +108,6 @@ def get_slack_channel(self, obj): "id": obj.slack_channel_pk, } - def get_telegram_channel_details(self, obj) -> dict[str, typing.Any] | None: - if obj.telegram_channel_id is None: - return None - try: - telegram_channel = TelegramToOrganizationConnector.objects.get(pk=obj.telegram_channel_id) - return { - "display_name": telegram_channel.channel_name, - "id": telegram_channel.channel_chat_id, - } - except TelegramToOrganizationConnector.DoesNotExist: - return None - def validate_slack_channel(self, slack_channel_id): from apps.slack.models import SlackChannel @@ -182,21 +182,25 @@ class Meta: ] read_only_fields = ["created_at", "is_default"] + def _get_slack_channel(self, obj) -> SlackChannelDetails | None: + if obj.slack_channel_id is None: + return None + slack_team_identity = self.context["request"].auth.organization.slack_team_identity + if slack_team_identity is None: + return None + slack_channel = slack_team_identity.get_cached_channels(slack_id=obj.slack_channel_id).first() + if slack_channel is None: + return None + return { + "display_name": slack_channel.name, + "slack_id": slack_channel.slack_id, + "id": slack_channel.public_primary_key, + } + def to_representation(self, obj): """add correct slack channel data to result after instance creation/update""" result = super().to_representation(obj) - if obj.slack_channel_id is None: - result["slack_channel"] = None - else: - slack_team_identity = self.context["request"].auth.organization.slack_team_identity - if slack_team_identity is not None: - slack_channel = slack_team_identity.get_cached_channels(slack_id=obj.slack_channel_id).first() - if slack_channel: - result["slack_channel"] = { - "display_name": slack_channel.name, - "slack_id": obj.slack_channel_id, - "id": slack_channel.public_primary_key, - } + result["slack_channel"] = self._get_slack_channel(obj) return result def create(self, validated_data): @@ -218,3 +222,15 @@ def update(self, instance, validated_data): raise BadRequest(detail="Filtering term of default channel filter cannot be changed") return super().update(instance, validated_data) + + +class ChannelFilterUpdateResponseSerializer(ChannelFilterUpdateSerializer): + """ + This serializer is used in OpenAPI schema to show proper response structure, + as `slack_channel` field expects string on create/update and returns dict on response + """ + + slack_channel = serializers.SerializerMethodField() + + def get_slack_channel(self, obj) -> SlackChannelDetails | None: + return self._get_slack_channel(obj) diff --git a/engine/apps/api/serializers/escalation_chain.py b/engine/apps/api/serializers/escalation_chain.py index 45c76d764..b284048c9 100644 --- a/engine/apps/api/serializers/escalation_chain.py +++ b/engine/apps/api/serializers/escalation_chain.py @@ -22,11 +22,11 @@ class EscalationChainListSerializer(EscalationChainSerializer): class Meta(EscalationChainSerializer.Meta): fields = [*EscalationChainSerializer.Meta.fields, "number_of_integrations", "number_of_routes"] - def get_number_of_integrations(self, obj): + def get_number_of_integrations(self, obj) -> int: # num_integrations param added in queryset via annotate. Check EscalationChainViewSet.get_queryset return getattr(obj, "num_integrations", 0) - def get_number_of_routes(self, obj): + def get_number_of_routes(self, obj) -> int: # num_routes param added in queryset via annotate. Check EscalationChainViewSet.get_queryset return getattr(obj, "num_routes", 0) diff --git a/engine/apps/api/views/alert_group.py b/engine/apps/api/views/alert_group.py index e59ab7aa8..c8771a238 100644 --- a/engine/apps/api/views/alert_group.py +++ b/engine/apps/api/views/alert_group.py @@ -15,7 +15,7 @@ from rest_framework.response import Response from apps.alerts.constants import ActionSource -from apps.alerts.models import Alert, AlertGroup, AlertReceiveChannel, EscalationChain, ResolutionNote +from apps.alerts.models import Alert, AlertGroup, AlertReceiveChannel, ResolutionNote from apps.alerts.paging import unpage_user from apps.alerts.tasks import delete_alert_group, send_update_resolution_note_signal from apps.api.errors import AlertGroupAPIError @@ -35,32 +35,14 @@ DateRangeFilterMixin, ModelFieldFilterMixin, MultipleChoiceCharFilter, + get_escalation_chain_queryset, + get_integration_queryset, + get_user_queryset, ) from common.api_helpers.mixins import PreviewTemplateMixin, PublicPrimaryKeyMixin, TeamFilteringMixin from common.api_helpers.paginators import AlertGroupCursorPaginator -def get_integration_queryset(request): - if request is None: - return AlertReceiveChannel.objects.none() - - return AlertReceiveChannel.objects_with_maintenance.filter(organization=request.user.organization) - - -def get_escalation_chain_queryset(request): - if request is None: - return EscalationChain.objects.none() - - return EscalationChain.objects.filter(organization=request.user.organization) - - -def get_user_queryset(request): - if request is None: - return User.objects.none() - - return User.objects.filter(organization=request.user.organization).distinct() - - class AlertGroupFilter(DateRangeFilterMixin, ModelFieldFilterMixin, filters.FilterSet): """ Examples of possible date formats here https://docs.djangoproject.com/en/1.9/ref/settings/#datetime-input-formats @@ -925,6 +907,7 @@ def bulk_action_options(self, request): def get_alert_to_template(self, payload=None): return self.get_object().alerts.first() + @extend_schema(responses=AlertGroupEscalationSnapshotAPISerializer) @action(methods=["get"], detail=True) def escalation_snapshot(self, request, pk=None): alert_group = self.get_object() diff --git a/engine/apps/api/views/channel_filter.py b/engine/apps/api/views/channel_filter.py index 262c73d87..bf722a8d8 100644 --- a/engine/apps/api/views/channel_filter.py +++ b/engine/apps/api/views/channel_filter.py @@ -1,4 +1,6 @@ from django.db.models import OuterRef, Subquery +from django_filters import rest_framework as filters +from drf_spectacular.utils import extend_schema, extend_schema_view from rest_framework import status from rest_framework.decorators import action from rest_framework.permissions import IsAuthenticated @@ -9,11 +11,13 @@ from apps.api.serializers.channel_filter import ( ChannelFilterCreateSerializer, ChannelFilterSerializer, + ChannelFilterUpdateResponseSerializer, ChannelFilterUpdateSerializer, ) from apps.auth_token.auth import PluginAuthentication from apps.slack.models import SlackChannel from common.api_helpers.exceptions import BadRequest +from common.api_helpers.filters import ModelFieldFilterMixin, MultipleChoiceCharFilter, get_integration_queryset from common.api_helpers.mixins import ( CreateSerializerMixin, PublicPrimaryKeyMixin, @@ -24,6 +28,22 @@ from common.ordered_model.viewset import OrderedModelViewSet +class ChannelFilterFilter(ModelFieldFilterMixin, filters.FilterSet): + alert_receive_channel = MultipleChoiceCharFilter( + queryset=get_integration_queryset, + to_field_name="public_primary_key", + method=ModelFieldFilterMixin.filter_model_field.__name__, + ) + + +@extend_schema_view( + list=extend_schema(responses=ChannelFilterSerializer), + create=extend_schema(request=ChannelFilterCreateSerializer, responses=ChannelFilterUpdateResponseSerializer), + update=extend_schema(request=ChannelFilterUpdateSerializer, responses=ChannelFilterUpdateResponseSerializer), + partial_update=extend_schema( + request=ChannelFilterUpdateSerializer, responses=ChannelFilterUpdateResponseSerializer + ), +) class ChannelFilterView( TeamFilteringMixin, PublicPrimaryKeyMixin[ChannelFilter], @@ -31,6 +51,10 @@ class ChannelFilterView( UpdateSerializerMixin, OrderedModelViewSet, ): + """ + Internal API endpoints for channel filters (routes). + """ + authentication_classes = (PluginAuthentication,) permission_classes = (IsAuthenticated, RBACPermission) rbac_permissions = { @@ -45,19 +69,19 @@ class ChannelFilterView( "convert_from_regex_to_jinja2": [RBACPermission.Permissions.INTEGRATIONS_WRITE], } + queryset = ChannelFilter.objects.none() # needed for drf-spectacular introspection + model = ChannelFilter serializer_class = ChannelFilterSerializer update_serializer_class = ChannelFilterUpdateSerializer create_serializer_class = ChannelFilterCreateSerializer + filter_backends = (filters.DjangoFilterBackend,) + filterset_class = ChannelFilterFilter + TEAM_LOOKUP = "alert_receive_channel__team" def get_queryset(self, ignore_filtering_by_available_teams=False): - alert_receive_channel_id = self.request.query_params.get("alert_receive_channel", None) - lookup_kwargs = {} - if alert_receive_channel_id: - lookup_kwargs = {"alert_receive_channel__public_primary_key": alert_receive_channel_id} - slack_channels_subq = SlackChannel.objects.filter( slack_id=OuterRef("slack_channel_id"), slack_team_identity=self.request.auth.organization.slack_team_identity, @@ -66,7 +90,6 @@ def get_queryset(self, ignore_filtering_by_available_teams=False): queryset = ChannelFilter.objects.filter( alert_receive_channel__organization=self.request.auth.organization, alert_receive_channel__deleted_at=None, - **lookup_kwargs, ).annotate( slack_channel_name=Subquery(slack_channels_subq.values("name")[:1]), slack_channel_pk=Subquery(slack_channels_subq.values("public_primary_key")[:1]), @@ -109,6 +132,7 @@ def perform_update(self, serializer): new_state=new_state, ) + @extend_schema(request=None, responses={status.HTTP_200_OK: None}) @action(detail=True, methods=["put"]) def move_to_position(self, request, pk): instance = self.get_object() @@ -117,6 +141,7 @@ def move_to_position(self, request, pk): return super().move_to_position(request, pk) + @extend_schema(request=None, responses=ChannelFilterSerializer) @action(detail=True, methods=["post"]) def convert_from_regex_to_jinja2(self, request, pk): instance = self.get_object() diff --git a/engine/apps/api/views/escalation_chain.py b/engine/apps/api/views/escalation_chain.py index 952da9223..e48a96a48 100644 --- a/engine/apps/api/views/escalation_chain.py +++ b/engine/apps/api/views/escalation_chain.py @@ -1,7 +1,8 @@ from django.db.models import Count, Q from django_filters import rest_framework as filters +from drf_spectacular.utils import PolymorphicProxySerializer, extend_schema, extend_schema_view, inline_serializer from emoji import emojize -from rest_framework import status, viewsets +from rest_framework import serializers, status, viewsets from rest_framework.decorators import action from rest_framework.filters import SearchFilter from rest_framework.permissions import IsAuthenticated @@ -37,6 +38,17 @@ class EscalationChainFilter(ByTeamModelFieldFilterMixin, ModelFieldFilterMixin, team = TeamModelMultipleChoiceFilter() +@extend_schema_view( + list=extend_schema( + responses=PolymorphicProxySerializer( + component_name="EscalationChainPolymorphic", + serializers=[EscalationChainListSerializer, FilterEscalationChainSerializer], + resource_type_field_name=None, + ) + ), + update=extend_schema(responses=EscalationChainSerializer), + partial_update=extend_schema(responses=EscalationChainSerializer), +) class EscalationChainViewSet( TeamFilteringMixin, PublicPrimaryKeyMixin[EscalationChain], @@ -44,6 +56,10 @@ class EscalationChainViewSet( ListSerializerMixin, viewsets.ModelViewSet, ): + """ + Internal API endpoints for escalation chains. + """ + authentication_classes = ( MobileAppAuthTokenAuthentication, PluginAuthentication, @@ -62,6 +78,8 @@ class EscalationChainViewSet( "filters": [RBACPermission.Permissions.ESCALATION_CHAINS_READ], } + queryset = EscalationChain.objects.none() # needed for drf-spectacular introspection + filter_backends = [SearchFilter, filters.DjangoFilterBackend] search_fields = ("name",) filterset_class = EscalationChainFilter @@ -127,6 +145,7 @@ def perform_update(self, serializer): new_state=new_state, ) + @extend_schema(responses=EscalationChainSerializer) @action(methods=["post"], detail=True) def copy(self, request, pk): obj = self.get_object() @@ -155,6 +174,24 @@ def copy(self, request, pk): ) return Response(serializer.data) + @extend_schema( + responses=inline_serializer( + name="EscalationChainDetails", + fields={ + "id": serializers.CharField(), + "display_name": serializers.CharField(), + "channel_filters": inline_serializer( + name="EscalationChainDetailsChannelFilter", + fields={ + "id": serializers.CharField(), + "display_name": serializers.CharField(), + }, + many=True, + ), + }, + many=True, + ) + ) @action(methods=["get"], detail=True) def details(self, request, pk): obj = self.get_object() @@ -181,6 +218,18 @@ def details(self, request, pk): )["channel_filters"].append(channel_filter_data) return Response(data.values()) + @extend_schema( + responses=inline_serializer( + name="EscalationChainFilters", + fields={ + "name": serializers.CharField(), + "type": serializers.CharField(), + "href": serializers.CharField(required=False), + "global": serializers.BooleanField(required=False), + }, + many=True, + ) + ) @action(methods=["get"], detail=False) def filters(self, request): api_root = "/api/internal/v1/" diff --git a/engine/apps/api/views/escalation_policy.py b/engine/apps/api/views/escalation_policy.py index 945b63482..ace8740f5 100644 --- a/engine/apps/api/views/escalation_policy.py +++ b/engine/apps/api/views/escalation_policy.py @@ -1,10 +1,13 @@ from django.conf import settings from django.db.models import Q +from django_filters import rest_framework as filters +from drf_spectacular.utils import extend_schema, extend_schema_view, inline_serializer +from rest_framework import serializers from rest_framework.decorators import action from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response -from apps.alerts.models import EscalationPolicy +from apps.alerts.models import ChannelFilter, EscalationPolicy from apps.api.permissions import RBACPermission from apps.api.serializers.escalation_policy import ( EscalationPolicyCreateSerializer, @@ -13,6 +16,12 @@ ) from apps.auth_token.auth import PluginAuthentication from apps.mobile_app.auth import MobileAppAuthTokenAuthentication +from common.api_helpers.filters import ( + ModelChoicePublicPrimaryKeyFilter, + ModelFieldFilterMixin, + get_escalation_chain_queryset, + get_user_queryset, +) from common.api_helpers.mixins import ( CreateSerializerMixin, PublicPrimaryKeyMixin, @@ -23,6 +32,35 @@ from common.ordered_model.viewset import OrderedModelViewSet +def get_channel_filter_queryset(request): + if request is None: + return ChannelFilter.objects.none() + + return ChannelFilter.objects.filter(alert_receive_channel__organization=request.user.organization) + + +class EscalationPolicyFilter(ModelFieldFilterMixin, filters.FilterSet): + escalation_chain = ModelChoicePublicPrimaryKeyFilter( + queryset=get_escalation_chain_queryset, + ) + channel_filter = ModelChoicePublicPrimaryKeyFilter( + field_name="escalation_chain__channel_filters", + queryset=get_channel_filter_queryset, + ) + user = ModelChoicePublicPrimaryKeyFilter( + field_name="notify_to_users_queue", + queryset=get_user_queryset, + ) + slack_channel = filters.CharFilter( + field_name="escalation_chain__channel_filters__slack_channel_id", + ) + + +@extend_schema_view( + list=extend_schema(responses=EscalationPolicySerializer), + update=extend_schema(responses=EscalationPolicyUpdateSerializer), + partial_update=extend_schema(responses=EscalationPolicyUpdateSerializer), +) class EscalationPolicyView( TeamFilteringMixin, PublicPrimaryKeyMixin[EscalationPolicy], @@ -30,6 +68,10 @@ class EscalationPolicyView( UpdateSerializerMixin, OrderedModelViewSet, ): + """ + Internal API endpoints for escalation policies. + """ + authentication_classes = ( MobileAppAuthTokenAuthentication, PluginAuthentication, @@ -49,31 +91,20 @@ class EscalationPolicyView( "move_to_position": [RBACPermission.Permissions.ESCALATION_CHAINS_WRITE], } + queryset = EscalationPolicy.objects.none() # needed for drf-spectacular introspection + model = EscalationPolicy serializer_class = EscalationPolicySerializer update_serializer_class = EscalationPolicyUpdateSerializer create_serializer_class = EscalationPolicyCreateSerializer + filter_backends = (filters.DjangoFilterBackend,) + filterset_class = EscalationPolicyFilter + TEAM_LOOKUP = "escalation_chain__team" def get_queryset(self, ignore_filtering_by_available_teams=False): - escalation_chain_id = self.request.query_params.get("escalation_chain") - user_id = self.request.query_params.get("user") - slack_channel_id = self.request.query_params.get("slack_channel") - channel_filter_id = self.request.query_params.get("channel_filter") - - lookup_kwargs = {} - if escalation_chain_id is not None: - lookup_kwargs.update({"escalation_chain__public_primary_key": escalation_chain_id}) - if user_id is not None: - lookup_kwargs.update({"notify_to_users_queue__public_primary_key": user_id}) - if slack_channel_id is not None: - lookup_kwargs.update({"escalation_chain__channel_filters__slack_channel_id": slack_channel_id}) - if channel_filter_id is not None: - lookup_kwargs.update({"escalation_chain__channel_filters__public_primary_key": channel_filter_id}) - queryset = EscalationPolicy.objects.filter( - Q(**lookup_kwargs), Q(escalation_chain__organization=self.request.auth.organization), Q(escalation_chain__channel_filters__alert_receive_channel__deleted_at=None), Q(step__in=EscalationPolicy.INTERNAL_DB_STEPS) | Q(step__isnull=True), @@ -114,6 +145,19 @@ def perform_destroy(self, instance): ) instance.delete() + @extend_schema( + responses=inline_serializer( + name="EscalationPolicyOptions", + fields={ + "value": serializers.IntegerField(), + "display_name": serializers.CharField(), + "create_display_name": serializers.CharField(), + "slack_integration_required": serializers.BooleanField(), + "can_change_importance": serializers.BooleanField(), + }, + many=True, + ) + ) @action(detail=False, methods=["get"]) def escalation_options(self, request): choices = [] diff --git a/engine/apps/api/views/user_notification_policy.py b/engine/apps/api/views/user_notification_policy.py index 6a1311c21..82f6cc11b 100644 --- a/engine/apps/api/views/user_notification_policy.py +++ b/engine/apps/api/views/user_notification_policy.py @@ -1,5 +1,8 @@ from django.conf import settings from django.http import Http404 +from django_filters import rest_framework as filters +from drf_spectacular.utils import extend_schema, extend_schema_view, inline_serializer +from rest_framework import serializers from rest_framework.decorators import action from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response @@ -14,14 +17,29 @@ from apps.base.models import UserNotificationPolicy from apps.base.models.user_notification_policy import BUILT_IN_BACKENDS, NotificationChannelAPIOptions from apps.mobile_app.auth import MobileAppAuthTokenAuthentication -from apps.user_management.models import User -from common.api_helpers.exceptions import BadRequest +from common.api_helpers.filters import ModelChoicePublicPrimaryKeyFilter, get_user_queryset from common.api_helpers.mixins import UpdateSerializerMixin from common.insight_log import EntityEvent, write_resource_insight_log from common.ordered_model.viewset import OrderedModelViewSet +class UserNotificationPolicyFilter(filters.FilterSet): + important = filters.BooleanFilter() + user = ModelChoicePublicPrimaryKeyFilter( + queryset=get_user_queryset, + ) + + +@extend_schema_view( + list=extend_schema(responses=UserNotificationPolicySerializer), + update=extend_schema(responses=UserNotificationPolicyUpdateSerializer), + partial_update=extend_schema(responses=UserNotificationPolicyUpdateSerializer), +) class UserNotificationPolicyView(UpdateSerializerMixin, OrderedModelViewSet): + """ + Internal API endpoints for user notification policies. + """ + authentication_classes = ( MobileAppAuthTokenAuthentication, PluginAuthentication, @@ -54,25 +72,27 @@ class UserNotificationPolicyView(UpdateSerializerMixin, OrderedModelViewSet): "move_to_position", ], } + queryset = UserNotificationPolicy.objects.none() # needed for drf-spectacular introspection model = UserNotificationPolicy serializer_class = UserNotificationPolicySerializer update_serializer_class = UserNotificationPolicyUpdateSerializer + filter_backends = (filters.DjangoFilterBackend,) + filterset_class = UserNotificationPolicyFilter + def get_queryset(self): - important = self.request.query_params.get("important", None) == "true" - try: - user_id = self.request.query_params.get("user", None) - except ValueError: - raise BadRequest(detail="Invalid user param") - if user_id is None or user_id == self.request.user.public_primary_key: - target_user = self.request.user - else: - try: - target_user = User.objects.get(public_primary_key=user_id) - except User.DoesNotExist: - raise BadRequest(detail="User does not exist") - queryset = UserNotificationPolicy.objects.filter(user=target_user, important=important) + # if there are no query params, set default value + lookup_kwargs = {} + important = self.request.query_params.get("important", None) + user_id = self.request.query_params.get("user", None) + if important is None: + lookup_kwargs.update({"important": False}) + if user_id is None: + lookup_kwargs.update({"user": self.request.user}) + queryset = UserNotificationPolicy.objects.filter( + **lookup_kwargs, user__organization=self.request.auth.organization + ) return self.serializer_class.setup_eager_loading(queryset) def get_object(self): @@ -128,6 +148,17 @@ def perform_destroy(self, instance): new_state=new_state, ) + @extend_schema( + responses=inline_serializer( + name="UserNotificationPolicyDelayOptions", + fields={ + "value": serializers.CharField(), + "sec_value": serializers.IntegerField(), + "display_name": serializers.CharField(), + }, + many=True, + ) + ) @action(detail=False, methods=["get"]) def delay_options(self, request): choices = [] @@ -135,6 +166,18 @@ def delay_options(self, request): choices.append({"value": str(item[0]), "sec_value": item[0], "display_name": item[1]}) return Response(choices) + @extend_schema( + responses=inline_serializer( + name="UserNotificationPolicyNotifyByOptions", + fields={ + "value": serializers.IntegerField(), + "display_name": serializers.CharField(), + "slack_integration_required": serializers.BooleanField(), + "telegram_integration_required": serializers.BooleanField(), + }, + many=True, + ) + ) @action(detail=False, methods=["get"]) def notify_by_options(self, request): """ diff --git a/engine/common/api_helpers/custom_fields.py b/engine/common/api_helpers/custom_fields.py index d2b82bab5..2ddf607a1 100644 --- a/engine/common/api_helpers/custom_fields.py +++ b/engine/common/api_helpers/custom_fields.py @@ -82,6 +82,7 @@ def validate_empty_values(self, data): return super().validate_empty_values(data) +@extend_schema_field(serializers.ListField(child=serializers.CharField())) class UsersFilteredByOrganizationField(serializers.Field): """ This field reduces queries count when accessing User many related field (ex: notify_to_users_queue). diff --git a/engine/common/api_helpers/filters.py b/engine/common/api_helpers/filters.py index 851ff6f6a..22665ab7e 100644 --- a/engine/common/api_helpers/filters.py +++ b/engine/common/api_helpers/filters.py @@ -7,7 +7,8 @@ from drf_spectacular.utils import extend_schema_field from rest_framework import serializers -from apps.user_management.models import Team +from apps.alerts.models import AlertReceiveChannel, EscalationChain +from apps.user_management.models import Team, User from common.api_helpers.exceptions import BadRequest NO_TEAM_VALUE = "null" @@ -61,11 +62,22 @@ def parse_custom_datetime_range(cls, value): @extend_schema_field(serializers.CharField) class MultipleChoiceCharFilter(filters.ModelMultipleChoiceFilter): - """MultipleChoiceCharFilter with an explicit schema. Otherwise, drf-specacular may generate a wrong schema.""" + """MultipleChoiceCharFilter with an explicit schema. Otherwise, drf-spectacular may generate a wrong schema.""" pass +@extend_schema_field(serializers.CharField) +class ModelChoicePublicPrimaryKeyFilter(filters.ModelChoiceFilter): + """ + ModelChoicePublicPrimaryKeyFilter with an explicit schema. Otherwise, drf-spectacular may generate a wrong schema. + """ + + def __init__(self, *args, **kwargs): + kwargs.setdefault("to_field_name", "public_primary_key") + super().__init__(*args, **kwargs) + + class ModelFieldFilterMixin: def filter_model_field(self, queryset, name, value): if not value: @@ -107,6 +119,27 @@ def filter_model_field_with_multiple_values(self, queryset, name, values): return queryset.filter(teams_lookup).distinct() +def get_escalation_chain_queryset(request): + if request is None: + return EscalationChain.objects.none() + + return EscalationChain.objects.filter(organization=request.user.organization) + + +def get_integration_queryset(request): + if request is None: + return AlertReceiveChannel.objects.none() + + return AlertReceiveChannel.objects_with_maintenance.filter(organization=request.user.organization) + + +def get_user_queryset(request): + if request is None: + return User.objects.none() + + return User.objects.filter(organization=request.user.organization).distinct() + + def get_team_queryset(request): if request is None: return Team.objects.none() diff --git a/engine/settings/base.py b/engine/settings/base.py index 47ccb77db..473573ec4 100644 --- a/engine/settings/base.py +++ b/engine/settings/base.py @@ -348,6 +348,10 @@ class DatabaseTypes: "/alertgroups", "/alert_receive_channels", "/webhooks", + "/channel_filters", + "/escalation_chains", + "/escalation_policies", + "/notification_policies", # current user endpoint 👇, without trailing slash we pick-up /user_group endpoints, which we don't want for now "/user/", "/users", diff --git a/grafana-plugin/src/network/oncall-api/autogenerated-api.types.d.ts b/grafana-plugin/src/network/oncall-api/autogenerated-api.types.d.ts index 19836b72c..c72076b5e 100644 --- a/grafana-plugin/src/network/oncall-api/autogenerated-api.types.d.ts +++ b/grafana-plugin/src/network/oncall-api/autogenerated-api.types.d.ts @@ -849,58 +849,62 @@ export interface paths { patch?: never; trace?: never; }; - '/complete/{backend}/': { + '/channel_filters/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Authentication complete view */ - get: operations['complete_retrieve']; + /** @description Internal API endpoints for channel filters (routes). */ + get: operations['channel_filters_list']; put?: never; - post?: never; + /** @description Internal API endpoints for channel filters (routes). */ + post: operations['channel_filters_create']; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/disconnect/{backend}': { + '/channel_filters/{id}/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get: operations['disconnect_retrieve']; - put?: never; + /** @description Internal API endpoints for channel filters (routes). */ + get: operations['channel_filters_retrieve']; + /** @description Internal API endpoints for channel filters (routes). */ + put: operations['channel_filters_update']; post?: never; - delete?: never; + /** @description Internal API endpoints for channel filters (routes). */ + delete: operations['channel_filters_destroy']; options?: never; head?: never; - patch?: never; + /** @description Internal API endpoints for channel filters (routes). */ + patch: operations['channel_filters_partial_update']; trace?: never; }; - '/features/': { + '/channel_filters/{id}/convert_from_regex_to_jinja2/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Return whitelist of enabled features. - * It is needed to disable features for On-prem installations. */ - get: operations['features_retrieve']; + get?: never; put?: never; - post?: never; + /** @description Internal API endpoints for channel filters (routes). */ + post: operations['channel_filters_convert_from_regex_to_jinja2_create']; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/labels/': { + '/channel_filters/{id}/move_to_position/': { parameters: { query?: never; header?: never; @@ -908,26 +912,25 @@ export interface paths { cookie?: never; }; get?: never; - put?: never; - /** @description Create a new label key with values(Optional) */ - post: operations['labels_create']; + /** @description Internal API endpoints for channel filters (routes). */ + put: operations['channel_filters_move_to_position_update']; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/labels/id/{key_id}/': { + '/complete/{backend}/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description get_key returns LabelOption – key with the list of values */ - get: operations['labels_id_retrieve']; - /** @description Rename the key */ - put: operations['labels_id_update']; + /** @description Authentication complete view */ + get: operations['complete_retrieve']; + put?: never; post?: never; delete?: never; options?: never; @@ -935,84 +938,86 @@ export interface paths { patch?: never; trace?: never; }; - '/labels/id/{key_id}/values/': { + '/disconnect/{backend}': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; + get: operations['disconnect_retrieve']; put?: never; - /** @description Add a new value to the key */ - post: operations['labels_id_values_create']; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/labels/id/{key_id}/values/{value_id}/': { + '/escalation_chains/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description get_value returns a Value */ - get: operations['labels_id_values_retrieve']; - /** @description Rename the value */ - put: operations['labels_id_values_update']; - post?: never; + /** @description Internal API endpoints for escalation chains. */ + get: operations['escalation_chains_list']; + put?: never; + /** @description Internal API endpoints for escalation chains. */ + post: operations['escalation_chains_create']; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/labels/keys/': { + '/escalation_chains/{id}/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description List of labels keys */ - get: operations['labels_keys_list']; - put?: never; + /** @description Internal API endpoints for escalation chains. */ + get: operations['escalation_chains_retrieve']; + /** @description Internal API endpoints for escalation chains. */ + put: operations['escalation_chains_update']; post?: never; - delete?: never; + /** @description Internal API endpoints for escalation chains. */ + delete: operations['escalation_chains_destroy']; options?: never; head?: never; - patch?: never; + /** @description Internal API endpoints for escalation chains. */ + patch: operations['escalation_chains_partial_update']; trace?: never; }; - '/login/{backend}': { + '/escalation_chains/{id}/copy/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description overridden_login_social_auth starts the installation of integration which uses OAuth flow. */ - get: operations['login_retrieve']; + get?: never; put?: never; - post?: never; + /** @description Internal API endpoints for escalation chains. */ + post: operations['escalation_chains_copy_create']; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/login/{backend}/': { + '/escalation_chains/{id}/details/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description overridden_login_social_auth starts the installation of integration which uses OAuth flow. */ - get: operations['login_retrieve_2']; + /** @description Internal API endpoints for escalation chains. */ + get: operations['escalation_chains_details_list']; put?: never; post?: never; delete?: never; @@ -1021,15 +1026,16 @@ export interface paths { patch?: never; trace?: never; }; - '/user/': { + '/escalation_chains/filters/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get: operations['user_retrieve']; - put: operations['user_update']; + /** @description Internal API endpoints for escalation chains. */ + get: operations['escalation_chains_filters_list']; + put?: never; post?: never; delete?: never; options?: never; @@ -1037,71 +1043,71 @@ export interface paths { patch?: never; trace?: never; }; - '/users/': { + '/escalation_policies/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Internal API endpoints for users. */ - get: operations['users_list']; + /** @description Internal API endpoints for escalation policies. */ + get: operations['escalation_policies_list']; put?: never; - post?: never; + /** @description Internal API endpoints for escalation policies. */ + post: operations['escalation_policies_create']; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/users/{id}/': { + '/escalation_policies/{id}/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Internal API endpoints for users. */ - get: operations['users_retrieve']; - /** @description Internal API endpoints for users. */ - put: operations['users_update']; + /** @description Internal API endpoints for escalation policies. */ + get: operations['escalation_policies_retrieve']; + /** @description Internal API endpoints for escalation policies. */ + put: operations['escalation_policies_update']; post?: never; - delete?: never; + /** @description Internal API endpoints for escalation policies. */ + delete: operations['escalation_policies_destroy']; options?: never; head?: never; - /** @description Internal API endpoints for users. */ - patch: operations['users_partial_update']; + /** @description Internal API endpoints for escalation policies. */ + patch: operations['escalation_policies_partial_update']; trace?: never; }; - '/users/{id}/export_token/': { + '/escalation_policies/{id}/move_to_position/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Internal API endpoints for users. */ - get: operations['users_export_token_retrieve']; - put?: never; - /** @description Internal API endpoints for users. */ - post: operations['users_export_token_create']; - /** @description Internal API endpoints for users. */ - delete: operations['users_export_token_destroy']; + get?: never; + /** @description Internal API endpoints for escalation policies. */ + put: operations['escalation_policies_move_to_position_update']; + post?: never; + delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/users/{id}/forget_number/': { + '/escalation_policies/delay_options/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - /** @description Internal API endpoints for users. */ - put: operations['users_forget_number_update']; + /** @description Internal API endpoints for escalation policies. */ + get: operations['escalation_policies_delay_options_retrieve']; + put?: never; post?: never; delete?: never; options?: never; @@ -1109,15 +1115,15 @@ export interface paths { patch?: never; trace?: never; }; - '/users/{id}/get_backend_verification_code/': { + '/escalation_policies/escalation_options/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Internal API endpoints for users. */ - get: operations['users_get_backend_verification_code_retrieve']; + /** @description Internal API endpoints for escalation policies. */ + get: operations['escalation_policies_escalation_options_list']; put?: never; post?: never; delete?: never; @@ -1126,15 +1132,15 @@ export interface paths { patch?: never; trace?: never; }; - '/users/{id}/get_telegram_verification_code/': { + '/escalation_policies/num_minutes_in_window_options/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Internal API endpoints for users. */ - get: operations['users_get_telegram_verification_code_retrieve']; + /** @description Internal API endpoints for escalation policies. */ + get: operations['escalation_policies_num_minutes_in_window_options_retrieve']; put?: never; post?: never; delete?: never; @@ -1143,15 +1149,16 @@ export interface paths { patch?: never; trace?: never; }; - '/users/{id}/get_verification_call/': { + '/features/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Internal API endpoints for users. */ - get: operations['users_get_verification_call_retrieve']; + /** @description Return whitelist of enabled features. + * It is needed to disable features for On-prem installations. */ + get: operations['features_retrieve']; put?: never; post?: never; delete?: never; @@ -1160,41 +1167,42 @@ export interface paths { patch?: never; trace?: never; }; - '/users/{id}/get_verification_code/': { + '/labels/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Internal API endpoints for users. */ - get: operations['users_get_verification_code_retrieve']; + get?: never; put?: never; - post?: never; + /** @description Create a new label key with values(Optional) */ + post: operations['labels_create']; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/users/{id}/make_test_call/': { + '/labels/id/{key_id}/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - put?: never; - /** @description Internal API endpoints for users. */ - post: operations['users_make_test_call_create']; + /** @description get_key returns LabelOption – key with the list of values */ + get: operations['labels_id_retrieve']; + /** @description Rename the key */ + put: operations['labels_id_update']; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/users/{id}/send_test_push/': { + '/labels/id/{key_id}/values/': { parameters: { query?: never; header?: never; @@ -1203,126 +1211,131 @@ export interface paths { }; get?: never; put?: never; - /** @description Internal API endpoints for users. */ - post: operations['users_send_test_push_create']; + /** @description Add a new value to the key */ + post: operations['labels_id_values_create']; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/users/{id}/send_test_sms/': { + '/labels/id/{key_id}/values/{value_id}/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - put?: never; - /** @description Internal API endpoints for users. */ - post: operations['users_send_test_sms_create']; + /** @description get_value returns a Value */ + get: operations['labels_id_values_retrieve']; + /** @description Rename the value */ + put: operations['labels_id_values_update']; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/users/{id}/unlink_backend/': { + '/labels/keys/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; + /** @description List of labels keys */ + get: operations['labels_keys_list']; put?: never; - /** @description Internal API endpoints for users. */ - post: operations['users_unlink_backend_create']; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/users/{id}/unlink_slack/': { + '/login/{backend}': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; + /** @description overridden_login_social_auth starts the installation of integration which uses OAuth flow. */ + get: operations['login_retrieve']; put?: never; - /** @description Internal API endpoints for users. */ - post: operations['users_unlink_slack_create']; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/users/{id}/unlink_telegram/': { + '/login/{backend}/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; + /** @description overridden_login_social_auth starts the installation of integration which uses OAuth flow. */ + get: operations['login_retrieve_2']; put?: never; - /** @description Internal API endpoints for users. */ - post: operations['users_unlink_telegram_create']; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/users/{id}/upcoming_shifts/': { + '/notification_policies/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Internal API endpoints for users. */ - get: operations['users_upcoming_shifts_retrieve']; + /** @description Internal API endpoints for user notification policies. */ + get: operations['notification_policies_list']; put?: never; - post?: never; + /** @description Internal API endpoints for user notification policies. */ + post: operations['notification_policies_create']; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/users/{id}/verify_number/': { + '/notification_policies/{id}/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - /** @description Internal API endpoints for users. */ - put: operations['users_verify_number_update']; + /** @description Internal API endpoints for user notification policies. */ + get: operations['notification_policies_retrieve']; + /** @description Internal API endpoints for user notification policies. */ + put: operations['notification_policies_update']; post?: never; - delete?: never; + /** @description Internal API endpoints for user notification policies. */ + delete: operations['notification_policies_destroy']; options?: never; head?: never; - patch?: never; + /** @description Internal API endpoints for user notification policies. */ + patch: operations['notification_policies_partial_update']; trace?: never; }; - '/users/filters/': { + '/notification_policies/{id}/move_to_position/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Internal API endpoints for users. */ - get: operations['users_filters_list']; - put?: never; + get?: never; + /** @description Internal API endpoints for user notification policies. */ + put: operations['notification_policies_move_to_position_update']; post?: never; delete?: never; options?: never; @@ -1330,15 +1343,15 @@ export interface paths { patch?: never; trace?: never; }; - '/users/timezone_options/': { + '/notification_policies/delay_options/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Internal API endpoints for users. */ - get: operations['users_timezone_options_retrieve']; + /** @description Internal API endpoints for user notification policies. */ + get: operations['notification_policies_delay_options_list']; put?: never; post?: never; delete?: never; @@ -1347,112 +1360,104 @@ export interface paths { patch?: never; trace?: never; }; - '/webhooks/': { + '/notification_policies/notify_by_options/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} - * in case a requested instance doesn't belong to user's current_team. */ - get: operations['webhooks_list']; + /** @description Returns list of options for user notification policies dropping options that requires disabled features. */ + get: operations['notification_policies_notify_by_options_list']; put?: never; - /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} - * in case a requested instance doesn't belong to user's current_team. */ - post: operations['webhooks_create']; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/webhooks/{id}/': { + '/user/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} - * in case a requested instance doesn't belong to user's current_team. */ - get: operations['webhooks_retrieve']; - /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} - * in case a requested instance doesn't belong to user's current_team. */ - put: operations['webhooks_update']; + get: operations['user_retrieve']; + put: operations['user_update']; post?: never; - /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} - * in case a requested instance doesn't belong to user's current_team. */ - delete: operations['webhooks_destroy']; + delete?: never; options?: never; head?: never; - /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} - * in case a requested instance doesn't belong to user's current_team. */ - patch: operations['webhooks_partial_update']; + patch?: never; trace?: never; }; - '/webhooks/{id}/preview_template/': { + '/users/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; + /** @description Internal API endpoints for users. */ + get: operations['users_list']; put?: never; - /** @description Return webhook template preview. */ - post: operations['webhooks_preview_template_create']; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - '/webhooks/{id}/responses/': { + '/users/{id}/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Return recent responses data for the webhook. */ - get: operations['webhooks_responses_list']; - put?: never; + /** @description Internal API endpoints for users. */ + get: operations['users_retrieve']; + /** @description Internal API endpoints for users. */ + put: operations['users_update']; post?: never; delete?: never; options?: never; head?: never; - patch?: never; + /** @description Internal API endpoints for users. */ + patch: operations['users_partial_update']; trace?: never; }; - '/webhooks/{id}/trigger_manual/': { + '/users/{id}/export_token/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; + /** @description Internal API endpoints for users. */ + get: operations['users_export_token_retrieve']; put?: never; - /** @description Trigger specified webhook in the context of the given alert group. */ - post: operations['webhooks_trigger_manual_create']; - delete?: never; + /** @description Internal API endpoints for users. */ + post: operations['users_export_token_create']; + /** @description Internal API endpoints for users. */ + delete: operations['users_export_token_destroy']; options?: never; head?: never; patch?: never; trace?: never; }; - '/webhooks/filters/': { + '/users/{id}/forget_number/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} - * in case a requested instance doesn't belong to user's current_team. */ - get: operations['webhooks_filters_list']; - put?: never; + get?: never; + /** @description Internal API endpoints for users. */ + put: operations['users_forget_number_update']; post?: never; delete?: never; options?: never; @@ -1460,15 +1465,15 @@ export interface paths { patch?: never; trace?: never; }; - '/webhooks/preset_options/': { + '/users/{id}/get_backend_verification_code/': { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** @description Return available webhook preset options. */ - get: operations['webhooks_preset_options_retrieve']; + /** @description Internal API endpoints for users. */ + get: operations['users_get_backend_verification_code_retrieve']; put?: never; post?: never; delete?: never; @@ -1477,56 +1482,1488 @@ export interface paths { patch?: never; trace?: never; }; -} -export type webhooks = Record; -export interface components { + '/users/{id}/get_telegram_verification_code/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description Internal API endpoints for users. */ + get: operations['users_get_telegram_verification_code_retrieve']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/users/{id}/get_verification_call/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description Internal API endpoints for users. */ + get: operations['users_get_verification_call_retrieve']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/users/{id}/get_verification_code/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description Internal API endpoints for users. */ + get: operations['users_get_verification_code_retrieve']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/users/{id}/make_test_call/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** @description Internal API endpoints for users. */ + post: operations['users_make_test_call_create']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/users/{id}/send_test_push/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** @description Internal API endpoints for users. */ + post: operations['users_send_test_push_create']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/users/{id}/send_test_sms/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** @description Internal API endpoints for users. */ + post: operations['users_send_test_sms_create']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/users/{id}/unlink_backend/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** @description Internal API endpoints for users. */ + post: operations['users_unlink_backend_create']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/users/{id}/unlink_slack/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** @description Internal API endpoints for users. */ + post: operations['users_unlink_slack_create']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/users/{id}/unlink_telegram/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** @description Internal API endpoints for users. */ + post: operations['users_unlink_telegram_create']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/users/{id}/upcoming_shifts/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description Internal API endpoints for users. */ + get: operations['users_upcoming_shifts_retrieve']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/users/{id}/verify_number/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** @description Internal API endpoints for users. */ + put: operations['users_verify_number_update']; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/users/filters/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description Internal API endpoints for users. */ + get: operations['users_filters_list']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/users/timezone_options/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description Internal API endpoints for users. */ + get: operations['users_timezone_options_retrieve']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/webhooks/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} + * in case a requested instance doesn't belong to user's current_team. */ + get: operations['webhooks_list']; + put?: never; + /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} + * in case a requested instance doesn't belong to user's current_team. */ + post: operations['webhooks_create']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/webhooks/{id}/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} + * in case a requested instance doesn't belong to user's current_team. */ + get: operations['webhooks_retrieve']; + /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} + * in case a requested instance doesn't belong to user's current_team. */ + put: operations['webhooks_update']; + post?: never; + /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} + * in case a requested instance doesn't belong to user's current_team. */ + delete: operations['webhooks_destroy']; + options?: never; + head?: never; + /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} + * in case a requested instance doesn't belong to user's current_team. */ + patch: operations['webhooks_partial_update']; + trace?: never; + }; + '/webhooks/{id}/preview_template/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** @description Return webhook template preview. */ + post: operations['webhooks_preview_template_create']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/webhooks/{id}/responses/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description Return recent responses data for the webhook. */ + get: operations['webhooks_responses_list']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/webhooks/{id}/trigger_manual/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** @description Trigger specified webhook in the context of the given alert group. */ + post: operations['webhooks_trigger_manual_create']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/webhooks/filters/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description This mixin returns 403 and {"error_code": "wrong_team", "owner_team": {"name", "id", "email", "avatar_url"}} + * in case a requested instance doesn't belong to user's current_team. */ + get: operations['webhooks_filters_list']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/webhooks/preset_options/': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** @description Return available webhook preset options. */ + get: operations['webhooks_preset_options_retrieve']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +} +export type webhooks = Record; +export interface components { schemas: { /** - * @description * `acknowledge` - acknowledge - * * `resolve` - resolve - * * `silence` - silence - * * `restart` - restart - * @enum {string} + * @description * `acknowledge` - acknowledge + * * `resolve` - resolve + * * `silence` - silence + * * `restart` - restart + * @enum {string} + */ + ActionEnum: 'acknowledge' | 'resolve' | 'silence' | 'restart'; + AdditionalSettingsField: unknown; + Alert: { + readonly id: string; + /** Format: uri */ + link_to_upstream_details?: string | null; + readonly render_for_web: { + title: string; + message: string; + image_url: string | null; + source_link: string | null; + }; + /** Format: date-time */ + readonly created_at: string; + }; + AlertGroup: CustomApiSchemas['AlertGroup'] & { + readonly pk: string; + readonly alerts_count: number; + inside_organization_number?: number; + alert_receive_channel: components['schemas']['FastAlertReceiveChannel']; + resolved?: boolean; + resolved_by?: components['schemas']['ResolvedByEnum']; + resolved_by_user?: components['schemas']['FastUser']; + /** Format: date-time */ + resolved_at?: string | null; + /** Format: date-time */ + acknowledged_at?: string | null; + acknowledged?: boolean; + acknowledged_on_source?: boolean; + acknowledged_by_user?: components['schemas']['FastUser']; + silenced?: boolean; + silenced_by_user?: components['schemas']['FastUser']; + /** Format: date-time */ + silenced_at?: string | null; + /** Format: date-time */ + silenced_until?: string | null; + /** Format: date-time */ + readonly started_at: string; + readonly related_users: components['schemas']['UserShort'][]; + readonly render_for_web: + | { + title: string; + message: string; + image_url: string | null; + source_link: string | null; + } + | Record; + dependent_alert_groups: components['schemas']['ShortAlertGroup'][]; + root_alert_group: components['schemas']['ShortAlertGroup']; + readonly status: number; + /** @description Generate a link for AlertGroup to declare Grafana Incident by click */ + readonly declare_incident_link: string; + team: string | null; + grafana_incident_id?: string | null; + readonly labels: components['schemas']['AlertGroupLabel'][]; + readonly permalinks: { + slack: string | null; + slack_app: string | null; + telegram: string | null; + web: string; + }; + readonly alerts: components['schemas']['Alert'][]; + readonly render_after_resolve_report_json: { + time: string; + action: string; + /** @enum {string} */ + realm: 'user_notification' | 'alert_group' | 'resolution_note'; + type: number; + created_at: string; + author: { + username: string; + pk: string; + avatar: string; + avatar_full: string; + }; + }[]; + readonly slack_permalink: string | null; + /** Format: date-time */ + readonly last_alert_at: string; + readonly paged_users: { + id: number; + username: string; + name: string; + pk: string; + avatar: string; + avatar_full: string; + important: boolean; + }[]; + readonly external_urls: { + integration: string; + integration_type: string; + external_id: string; + url: string; + }[]; + }; + AlertGroupAttach: { + root_alert_group_pk: string; + }; + AlertGroupBulkActionOptions: { + value: components['schemas']['ActionEnum']; + display_name: components['schemas']['ActionEnum']; + }; + AlertGroupBulkActionRequest: { + alert_group_pks: string[]; + action: components['schemas']['ActionEnum']; + /** @description only applicable for silence */ + delay?: number | null; + }; + /** @description Serializes AlertGroup escalation snapshot for API endpoint */ + AlertGroupEscalationSnapshotAPI: { + readonly escalation_chain: components['schemas']['EscalationChainSnapshotAPI']; + readonly channel_filter: components['schemas']['ChannelFilterSnapshotAPI']; + readonly escalation_policies: components['schemas']['EscalationPolicySnapshotAPI'][]; + }; + AlertGroupFilters: { + name: string; + type: string; + href?: string; + global?: boolean; + default?: { + [key: string]: unknown; + }; + description?: string; + options: components['schemas']['AlertGroupFiltersOptions']; + }; + AlertGroupFiltersOptions: { + value: string; + display_name: number; + }; + AlertGroupLabel: { + key: components['schemas']['Key']; + value: components['schemas']['Value']; + }; + AlertGroupList: { + readonly pk: string; + readonly alerts_count: number; + inside_organization_number?: number; + alert_receive_channel: components['schemas']['FastAlertReceiveChannel']; + resolved?: boolean; + resolved_by?: components['schemas']['ResolvedByEnum']; + resolved_by_user?: components['schemas']['FastUser']; + /** Format: date-time */ + resolved_at?: string | null; + /** Format: date-time */ + acknowledged_at?: string | null; + acknowledged?: boolean; + acknowledged_on_source?: boolean; + acknowledged_by_user?: components['schemas']['FastUser']; + silenced?: boolean; + silenced_by_user?: components['schemas']['FastUser']; + /** Format: date-time */ + silenced_at?: string | null; + /** Format: date-time */ + silenced_until?: string | null; + /** Format: date-time */ + readonly started_at: string; + readonly related_users: components['schemas']['UserShort'][]; + readonly render_for_web: + | { + title: string; + message: string; + image_url: string | null; + source_link: string | null; + } + | Record; + dependent_alert_groups: components['schemas']['ShortAlertGroup'][]; + root_alert_group: components['schemas']['ShortAlertGroup']; + readonly status: number; + /** @description Generate a link for AlertGroup to declare Grafana Incident by click */ + readonly declare_incident_link: string; + team: string | null; + grafana_incident_id?: string | null; + readonly labels: components['schemas']['AlertGroupLabel'][]; + readonly permalinks: { + slack: string | null; + slack_app: string | null; + telegram: string | null; + web: string; + }; + }; + AlertGroupResolve: { + resolution_note?: string | null; + }; + AlertGroupSilence: { + delay: number; + }; + AlertGroupSilenceOptions: { + value: components['schemas']['AlertGroupSilenceOptionsValueEnum']; + display_name: components['schemas']['AlertGroupSilenceOptionsDisplayNameEnum']; + }; + /** + * @description * `30 minutes` - 30 minutes + * * `1 hour` - 1 hour + * * `2 hours` - 2 hours + * * `3 hours` - 3 hours + * * `4 hours` - 4 hours + * * `6 hours` - 6 hours + * * `12 hours` - 12 hours + * * `16 hours` - 16 hours + * * `20 hours` - 20 hours + * * `24 hours` - 24 hours + * * `Forever` - Forever + * @enum {string} + */ + AlertGroupSilenceOptionsDisplayNameEnum: + | '30 minutes' + | '1 hour' + | '2 hours' + | '3 hours' + | '4 hours' + | '6 hours' + | '12 hours' + | '16 hours' + | '20 hours' + | '24 hours' + | 'Forever'; + /** + * @description * `1800` - 1800 + * * `3600` - 3600 + * * `7200` - 7200 + * * `10800` - 10800 + * * `14400` - 14400 + * * `21600` - 21600 + * * `43200` - 43200 + * * `57600` - 57600 + * * `72000` - 72000 + * * `86400` - 86400 + * * `-1` - -1 + * @enum {integer} + */ + AlertGroupSilenceOptionsValueEnum: 1800 | 3600 | 7200 | 10800 | 14400 | 21600 | 43200 | 57600 | 72000 | 86400 | -1; + AlertGroupStats: { + count: number; + }; + AlertGroupUnpageUser: { + user_id: string; + }; + AlertReceiveChannel: { + readonly id: string; + readonly description: string | null; + description_short?: string | null; + integration: components['schemas']['IntegrationEnum']; + readonly smile_code: string; + verbal_name?: string | null; + readonly author: string; + readonly organization: string; + team?: string | null; + /** Format: date-time */ + readonly created_at: string; + readonly integration_url: string | null; + readonly alert_count: number; + readonly alert_groups_count: number; + allow_source_based_resolving?: boolean; + readonly instructions: string; + readonly is_able_to_autoresolve: boolean; + readonly default_channel_filter: string | null; + readonly demo_alert_enabled: boolean; + readonly maintenance_mode: (components['schemas']['Step923Enum'] | components['schemas']['NullEnum']) | null; + readonly maintenance_till: number | null; + readonly heartbeat: components['schemas']['IntegrationHeartBeat'] | null; + readonly is_available_for_integration_heartbeat: boolean; + readonly allow_delete: boolean; + readonly demo_alert_payload: { + [key: string]: unknown; + }; + readonly routes_count: number; + readonly connected_escalations_chains_count: number; + readonly is_based_on_alertmanager: boolean; + readonly inbound_email: string; + readonly is_legacy: boolean; + labels?: components['schemas']['LabelPair'][]; + alert_group_labels?: components['schemas']['IntegrationAlertGroupLabels']; + /** Format: date-time */ + readonly alertmanager_v2_migrated_at: string | null; + additional_settings?: components['schemas']['AdditionalSettingsField'] | null; + }; + AlertReceiveChannelConnectContactPoint: { + datasource_uid: string; + contact_point_name: string; + }; + AlertReceiveChannelConnectedChannel: { + readonly alert_receive_channel: components['schemas']['FastAlertReceiveChannel']; + backsync: boolean; + }; + AlertReceiveChannelConnectedContactPoints: { + uid: string; + name: string; + contact_points: components['schemas']['AlertReceiveChannelConnectedContactPointsInner'][]; + }; + AlertReceiveChannelConnectedContactPointsInner: { + name: string; + notification_connected: boolean; + }; + AlertReceiveChannelConnection: { + readonly source_alert_receive_channels: components['schemas']['AlertReceiveChannelSourceChannel'][]; + readonly connected_alert_receive_channels: components['schemas']['AlertReceiveChannelConnectedChannel'][]; + }; + AlertReceiveChannelContactPoints: { + uid: string; + name: string; + contact_points: string[]; + }; + AlertReceiveChannelCreate: { + readonly id: string; + readonly description: string | null; + description_short?: string | null; + integration: components['schemas']['IntegrationEnum']; + readonly smile_code: string; + verbal_name?: string | null; + readonly author: string; + readonly organization: string; + team?: string | null; + /** Format: date-time */ + readonly created_at: string; + readonly integration_url: string | null; + readonly alert_count: number; + readonly alert_groups_count: number; + allow_source_based_resolving?: boolean; + readonly instructions: string; + readonly is_able_to_autoresolve: boolean; + readonly default_channel_filter: string | null; + readonly demo_alert_enabled: boolean; + readonly maintenance_mode: (components['schemas']['Step923Enum'] | components['schemas']['NullEnum']) | null; + readonly maintenance_till: number | null; + readonly heartbeat: components['schemas']['IntegrationHeartBeat'] | null; + readonly is_available_for_integration_heartbeat: boolean; + readonly allow_delete: boolean; + readonly demo_alert_payload: { + [key: string]: unknown; + }; + readonly routes_count: number; + readonly connected_escalations_chains_count: number; + readonly is_based_on_alertmanager: boolean; + readonly inbound_email: string; + readonly is_legacy: boolean; + labels?: components['schemas']['LabelPair'][]; + alert_group_labels?: components['schemas']['IntegrationAlertGroupLabels']; + /** Format: date-time */ + readonly alertmanager_v2_migrated_at: string | null; + additional_settings?: components['schemas']['AdditionalSettingsField'] | null; + /** @default true */ + create_default_webhooks: boolean; + }; + AlertReceiveChannelCreateContactPoint: { + datasource_uid: string; + contact_point_name: string; + }; + AlertReceiveChannelDisconnectContactPoint: { + datasource_uid: string; + contact_point_name: string; + }; + AlertReceiveChannelFilters: { + name: string; + display_name?: string; + type: string; + href: string; + global?: boolean; + }; + AlertReceiveChannelIntegrationOptions: { + value: string; + display_name: string; + short_description: string; + featured: boolean; + featured_tag_name: string | null; + }; + AlertReceiveChannelNewConnection: { + id: string; + backsync: boolean; + }; + AlertReceiveChannelPolymorphic: + | components['schemas']['AlertReceiveChannel'] + | components['schemas']['FilterAlertReceiveChannel']; + AlertReceiveChannelSendDemoAlert: { + demo_alert_payload?: { + [key: string]: unknown; + } | null; + }; + AlertReceiveChannelSourceChannel: { + readonly alert_receive_channel: components['schemas']['FastAlertReceiveChannel']; + backsync: boolean; + }; + AlertReceiveChannelStartMaintenance: { + mode: components['schemas']['Step923Enum']; + duration: components['schemas']['DurationEnum']; + }; + AlertReceiveChannelUpdate: { + readonly id: string; + readonly description: string | null; + description_short?: string | null; + readonly integration: components['schemas']['IntegrationEnum']; + readonly smile_code: string; + verbal_name?: string | null; + readonly author: string; + readonly organization: string; + team?: string | null; + /** Format: date-time */ + readonly created_at: string; + readonly integration_url: string | null; + readonly alert_count: number; + readonly alert_groups_count: number; + allow_source_based_resolving?: boolean; + readonly instructions: string; + readonly is_able_to_autoresolve: boolean; + readonly default_channel_filter: string | null; + readonly demo_alert_enabled: boolean; + readonly maintenance_mode: (components['schemas']['Step923Enum'] | components['schemas']['NullEnum']) | null; + readonly maintenance_till: number | null; + readonly heartbeat: components['schemas']['IntegrationHeartBeat'] | null; + readonly is_available_for_integration_heartbeat: boolean; + readonly allow_delete: boolean; + readonly demo_alert_payload: { + [key: string]: unknown; + }; + readonly routes_count: number; + readonly connected_escalations_chains_count: number; + readonly is_based_on_alertmanager: boolean; + readonly inbound_email: string; + readonly is_legacy: boolean; + labels?: components['schemas']['LabelPair'][]; + alert_group_labels?: components['schemas']['IntegrationAlertGroupLabels']; + /** Format: date-time */ + readonly alertmanager_v2_migrated_at: string | null; + additional_settings?: components['schemas']['AdditionalSettingsField'] | null; + }; + ChannelFilter: { + readonly id: string; + alert_receive_channel: string; + escalation_chain?: string | null; + readonly slack_channel: { + display_name: string; + slack_id: string; + id: string; + } | null; + /** Format: date-time */ + readonly created_at: string; + filtering_labels?: components['schemas']['LabelPair'][]; + filtering_term?: string | null; + filtering_term_type?: components['schemas']['FilteringTermTypeEnum']; + telegram_channel?: string | null; + readonly is_default: boolean; + notify_in_slack?: boolean | null; + notify_in_telegram?: boolean | null; + notification_backends?: { + [key: string]: unknown; + } | null; + readonly filtering_term_as_jinja2: string; + readonly telegram_channel_details: components['schemas']['TelegramChannelDetails'] | null; + }; + ChannelFilterCreate: { + readonly id: string; + alert_receive_channel: string; + escalation_chain?: string | null; + slack_channel?: string | null; + /** Format: date-time */ + readonly created_at: string; + filtering_labels?: components['schemas']['LabelPair'][]; + filtering_term?: string | null; + filtering_term_type?: components['schemas']['FilteringTermTypeEnum']; + telegram_channel?: string | null; + readonly is_default: boolean; + notify_in_slack?: boolean | null; + notify_in_telegram?: boolean | null; + notification_backends?: { + [key: string]: unknown; + } | null; + }; + ChannelFilterSnapshotAPI: { + name: string; + }; + ChannelFilterUpdate: { + readonly id: string; + readonly alert_receive_channel: string; + escalation_chain?: string | null; + slack_channel?: string | null; + /** Format: date-time */ + readonly created_at: string; + filtering_labels?: components['schemas']['LabelPair'][]; + filtering_term?: string | null; + filtering_term_type?: components['schemas']['FilteringTermTypeEnum']; + telegram_channel?: string | null; + readonly is_default: boolean; + notify_in_slack?: boolean | null; + notify_in_telegram?: boolean | null; + notification_backends?: { + [key: string]: unknown; + } | null; + }; + /** @description This serializer is used in OpenAPI schema to show proper response structure, + * as `slack_channel` field expects string on create/update and returns dict on response */ + ChannelFilterUpdateResponse: { + readonly id: string; + readonly alert_receive_channel: string; + escalation_chain?: string | null; + readonly slack_channel: { + display_name: string; + slack_id: string; + id: string; + } | null; + /** Format: date-time */ + readonly created_at: string; + filtering_labels?: components['schemas']['LabelPair'][]; + filtering_term?: string | null; + filtering_term_type?: components['schemas']['FilteringTermTypeEnum']; + telegram_channel?: string | null; + readonly is_default: boolean; + notify_in_slack?: boolean | null; + notify_in_telegram?: boolean | null; + notification_backends?: { + [key: string]: unknown; + } | null; + }; + /** @enum {integer} */ + CloudConnectionStatusEnum: 0 | 1 | 2 | 3; + CurrentUser: { + readonly pk: string; + readonly organization: components['schemas']['FastOrganization']; + current_team?: string | null; + /** Format: email */ + readonly email: string; + readonly username: string; + readonly name: string; + readonly role: components['schemas']['RoleEnum']; + /** Format: uri */ + readonly avatar: string; + readonly avatar_full: string; + timezone?: string | null; + working_hours?: components['schemas']['WorkingHours']; + unverified_phone_number?: string | null; + /** @description Use property to highlight that _verified_phone_number should not be modified directly */ + readonly verified_phone_number: string | null; + readonly slack_user_identity: components['schemas']['SlackUserIdentity']; + readonly telegram_configuration: components['schemas']['TelegramToUserConnector']; + readonly messaging_backends: { + [key: string]: + | { + [key: string]: unknown; + } + | undefined; + }; + readonly notification_chain_verbal: { + default: string; + important: string; + }; + readonly cloud_connection_status: components['schemas']['CloudConnectionStatusEnum'] | null; + hide_phone_number?: boolean; + readonly has_google_oauth2_connected: boolean; + readonly is_currently_oncall: boolean; + google_calendar_settings?: components['schemas']['GoogleCalendarSettings']; + readonly rbac_permissions: components['schemas']['UserPermission'][]; + readonly google_oauth2_token_is_missing_scopes: boolean; + }; + /** @description This serializer is consistent with apps.api.serializers.labels.LabelPairSerializer, but allows null for value ID. */ + CustomLabel: { + key: components['schemas']['CustomLabelKey']; + value: components['schemas']['CustomLabelValue']; + }; + CustomLabelKey: { + id: string; + name: string; + /** @default false */ + prescribed: boolean; + }; + CustomLabelValue: { + id: string | null; + name: string; + /** @default false */ + prescribed: boolean; + }; + /** + * @description * `3600` - 3600 + * * `10800` - 10800 + * * `21600` - 21600 + * * `43200` - 43200 + * * `86400` - 86400 + * @enum {integer} + */ + DurationEnum: 3600 | 10800 | 21600 | 43200 | 86400; + EscalationChain: { + readonly id: string; + name: string; + team?: string | null; + }; + EscalationChainDetails: { + id: string; + display_name: string; + channel_filters: components['schemas']['EscalationChainDetailsChannelFilter'][]; + }; + EscalationChainDetailsChannelFilter: { + id: string; + display_name: string; + }; + EscalationChainFilters: { + name: string; + type: string; + href?: string; + global?: boolean; + }; + EscalationChainList: { + readonly id: string; + name: string; + team?: string | null; + readonly number_of_integrations: number; + readonly number_of_routes: number; + }; + EscalationChainPolymorphic: + | components['schemas']['EscalationChainList'] + | components['schemas']['FilterEscalationChain']; + EscalationChainSnapshotAPI: { + name: string; + }; + EscalationPolicy: { + readonly id: string; + step?: (components['schemas']['Step267Enum'] | components['schemas']['NullEnum']) | null; + /** Format: double */ + wait_delay?: number | null; + escalation_chain: string; + notify_to_users_queue?: string[]; + /** Format: time */ + from_time?: string | null; + /** Format: time */ + to_time?: string | null; + /** Format: int64 */ + num_alerts_in_window?: number | null; + num_minutes_in_window?: number | null; + readonly slack_integration_required: boolean; + custom_webhook?: string | null; + notify_schedule?: string | null; + notify_to_group?: string | null; + notify_to_team_members?: string | null; + important?: boolean; + }; + EscalationPolicyCreate: { + readonly id: string; + step?: (components['schemas']['Step267Enum'] | components['schemas']['NullEnum']) | null; + /** Format: double */ + wait_delay?: number | null; + escalation_chain: string; + notify_to_users_queue?: string[]; + /** Format: time */ + from_time?: string | null; + /** Format: time */ + to_time?: string | null; + /** Format: int64 */ + num_alerts_in_window?: number | null; + num_minutes_in_window?: number | null; + readonly slack_integration_required: boolean; + custom_webhook?: string | null; + notify_schedule?: string | null; + notify_to_group?: string | null; + notify_to_team_members?: string | null; + important?: boolean; + }; + EscalationPolicyOptions: { + value: number; + display_name: string; + create_display_name: string; + slack_integration_required: boolean; + can_change_importance: boolean; + }; + /** @description Serializes AlertGroup escalation policies snapshots for API endpoint */ + EscalationPolicySnapshotAPI: { + readonly step: (components['schemas']['Step267Enum'] | components['schemas']['NullEnum']) | null; + /** Format: double */ + wait_delay?: number | null; + readonly notify_to_users_queue: components['schemas']['FastUser'][]; + /** Format: time */ + readonly from_time: string | null; + /** Format: time */ + readonly to_time: string | null; + readonly num_alerts_in_window: number | null; + num_minutes_in_window?: number | null; + readonly slack_integration_required: boolean; + readonly custom_webhook: components['schemas']['WebhookFast']; + readonly notify_schedule: components['schemas']['ScheduleFast']; + readonly notify_to_group: components['schemas']['UserGroup']; + important?: boolean; + }; + EscalationPolicyUpdate: { + readonly id: string; + step?: (components['schemas']['Step267Enum'] | components['schemas']['NullEnum']) | null; + /** Format: double */ + wait_delay?: number | null; + readonly escalation_chain: string; + notify_to_users_queue?: string[]; + /** Format: time */ + from_time?: string | null; + /** Format: time */ + to_time?: string | null; + /** Format: int64 */ + num_alerts_in_window?: number | null; + num_minutes_in_window?: number | null; + readonly slack_integration_required: boolean; + custom_webhook?: string | null; + notify_schedule?: string | null; + notify_to_group?: string | null; + notify_to_team_members?: string | null; + important?: boolean; + }; + FastAlertReceiveChannel: { + readonly id: string; + readonly integration: string; + verbal_name?: string | null; + readonly deleted: boolean; + }; + FastOrganization: { + readonly pk: string; + readonly name: string; + }; + FastTeam: { + readonly id: string; + name: string; + email?: string | null; + /** Format: uri */ + avatar_url: string; + }; + FastUser: { + pk: string; + readonly username: string; + }; + FilterAlertReceiveChannel: { + readonly value: string; + readonly display_name: string; + readonly integration_url: string | null; + }; + FilterEscalationChain: { + value: string; + display_name: string; + }; + FilterUser: { + value: string; + display_name: string; + }; + /** + * @description * `0` - regex + * * `1` - jinja2 + * * `2` - labels + * @enum {integer} + */ + FilteringTermTypeEnum: 0 | 1 | 2; + GoogleCalendarSettings: { + oncall_schedules_to_consider_for_shift_swaps?: string[] | null; + }; + /** @description Alert group labels configuration for the integration. See AlertReceiveChannel.alert_group_labels for details. */ + IntegrationAlertGroupLabels: { + inheritable: { + [key: string]: boolean | undefined; + }; + custom: components['schemas']['CustomLabel'][]; + template: string | null; + }; + /** + * @description * `grafana_alerting` - Grafana Alerting + * * `webhook` - Webhook + * * `alertmanager` - Alertmanager + * * `formatted_webhook` - Formatted webhook + * * `kapacitor` - Kapacitor + * * `elastalert` - Elastalert + * * `heartbeat` - Heartbeat + * * `inbound_email` - Inbound Email + * * `maintenance` - Maintenance + * * `manual` - Manual + * * `slack_channel` - Slack Channel + * * `zabbix` - Zabbix + * * `direct_paging` - Direct paging + * * `grafana` - Grafana Legacy Alerting + * * `legacy_alertmanager` - (Legacy) AlertManager + * * `legacy_grafana_alerting` - (Deprecated) Grafana Alerting + * @enum {string} + */ + IntegrationEnum: + | 'grafana_alerting' + | 'webhook' + | 'alertmanager' + | 'formatted_webhook' + | 'kapacitor' + | 'elastalert' + | 'heartbeat' + | 'inbound_email' + | 'maintenance' + | 'manual' + | 'slack_channel' + | 'zabbix' + | 'direct_paging' + | 'grafana' + | 'legacy_alertmanager' + | 'legacy_grafana_alerting'; + IntegrationHeartBeat: { + readonly id: string; + timeout_seconds: components['schemas']['TimeoutSecondsEnum']; + alert_receive_channel: string; + readonly link: string | null; + readonly last_heartbeat_time_verbal: string | null; + /** @description Return bool indicates heartbeat status. + * True if first heartbeat signal was sent and flow is ok else False. + * If first heartbeat signal was not send it means that configuration was not finished and status not ok. */ + readonly status: boolean; + readonly instruction: string; + }; + IntegrationTokenPostResponse: { + token: string; + usage: string; + }; + Key: { + id: string; + name: string; + }; + LabelCreate: { + key: components['schemas']['LabelRepr']; + values: components['schemas']['LabelRepr'][]; + }; + LabelKey: { + id: string; + name: string; + /** @default false */ + prescribed: boolean; + }; + LabelOption: { + key: components['schemas']['LabelKey']; + values: components['schemas']['LabelValue'][]; + }; + LabelPair: { + key: components['schemas']['LabelKey']; + value: components['schemas']['LabelValue']; + }; + LabelRepr: { + name: string; + }; + LabelValue: { + id: string; + name: string; + /** @default false */ + prescribed: boolean; + }; + ListUser: { + readonly pk: string; + readonly organization: components['schemas']['FastOrganization']; + current_team?: string | null; + /** Format: email */ + readonly email: string; + readonly username: string; + readonly name: string; + readonly role: components['schemas']['RoleEnum']; + /** Format: uri */ + readonly avatar: string; + readonly avatar_full: string; + timezone?: string | null; + working_hours?: components['schemas']['WorkingHours']; + unverified_phone_number?: string | null; + /** @description Use property to highlight that _verified_phone_number should not be modified directly */ + readonly verified_phone_number: string | null; + readonly slack_user_identity: components['schemas']['SlackUserIdentity']; + readonly telegram_configuration: components['schemas']['TelegramToUserConnector']; + readonly messaging_backends: { + [key: string]: + | { + [key: string]: unknown; + } + | undefined; + }; + readonly notification_chain_verbal: { + default: string; + important: string; + }; + readonly cloud_connection_status: components['schemas']['CloudConnectionStatusEnum'] | null; + hide_phone_number?: boolean; + readonly has_google_oauth2_connected: boolean; + }; + /** + * @description * `0` - 0 + * * `1` - 1 + * * `2` - 2 + * * `3` - 3 + * * `5` - 5 + * * `6` - 6 + * * `8` - 8 + * @enum {integer} + */ + NotifyByEnum: 0 | 1 | 2 | 3 | 5 | 6 | 8; + /** @enum {unknown} */ + NullEnum: null; + PaginatedAlertGroupListList: { + /** + * Format: uri + * @example http://api.example.org/accounts/?cursor=cD00ODY%3D" + */ + next?: string | null; + /** + * Format: uri + * @example http://api.example.org/accounts/?cursor=cj0xJnA9NDg3 + */ + previous?: string | null; + results: components['schemas']['AlertGroupList'][]; + page_size?: number; + }; + PaginatedAlertReceiveChannelPolymorphicList: { + /** @example 123 */ + count: number; + /** + * Format: uri + * @example http://api.example.org/accounts/?page=4 + */ + next?: string | null; + /** + * Format: uri + * @example http://api.example.org/accounts/?page=2 + */ + previous?: string | null; + results: components['schemas']['AlertReceiveChannelPolymorphic'][]; + page_size?: number; + current_page_number?: number; + total_pages?: number; + }; + PaginatedUserPolymorphicList: { + /** @example 123 */ + count: number; + /** + * Format: uri + * @example http://api.example.org/accounts/?page=4 + */ + next?: string | null; + /** + * Format: uri + * @example http://api.example.org/accounts/?page=2 + */ + previous?: string | null; + results: components['schemas']['UserPolymorphic'][]; + page_size?: number; + current_page_number?: number; + total_pages?: number; + }; + PatchedAlertReceiveChannelUpdate: { + readonly id?: string; + readonly description?: string | null; + description_short?: string | null; + readonly integration?: components['schemas']['IntegrationEnum']; + readonly smile_code?: string; + verbal_name?: string | null; + readonly author?: string; + readonly organization?: string; + team?: string | null; + /** Format: date-time */ + readonly created_at?: string; + readonly integration_url?: string | null; + readonly alert_count?: number; + readonly alert_groups_count?: number; + allow_source_based_resolving?: boolean; + readonly instructions?: string; + readonly is_able_to_autoresolve?: boolean; + readonly default_channel_filter?: string | null; + readonly demo_alert_enabled?: boolean; + readonly maintenance_mode?: (components['schemas']['Step923Enum'] | components['schemas']['NullEnum']) | null; + readonly maintenance_till?: number | null; + readonly heartbeat?: components['schemas']['IntegrationHeartBeat'] | null; + readonly is_available_for_integration_heartbeat?: boolean; + readonly allow_delete?: boolean; + readonly demo_alert_payload?: { + [key: string]: unknown; + }; + readonly routes_count?: number; + readonly connected_escalations_chains_count?: number; + readonly is_based_on_alertmanager?: boolean; + readonly inbound_email?: string; + readonly is_legacy?: boolean; + labels?: components['schemas']['LabelPair'][]; + alert_group_labels?: components['schemas']['IntegrationAlertGroupLabels']; + /** Format: date-time */ + readonly alertmanager_v2_migrated_at?: string | null; + additional_settings?: components['schemas']['AdditionalSettingsField'] | null; + }; + PatchedChannelFilterUpdate: { + readonly id?: string; + readonly alert_receive_channel?: string; + escalation_chain?: string | null; + slack_channel?: string | null; + /** Format: date-time */ + readonly created_at?: string; + filtering_labels?: components['schemas']['LabelPair'][]; + filtering_term?: string | null; + filtering_term_type?: components['schemas']['FilteringTermTypeEnum']; + telegram_channel?: string | null; + readonly is_default?: boolean; + notify_in_slack?: boolean | null; + notify_in_telegram?: boolean | null; + notification_backends?: { + [key: string]: unknown; + } | null; + }; + PatchedEscalationChain: { + readonly id?: string; + name?: string; + team?: string | null; + }; + PatchedEscalationPolicyUpdate: { + readonly id?: string; + step?: (components['schemas']['Step267Enum'] | components['schemas']['NullEnum']) | null; + /** Format: double */ + wait_delay?: number | null; + readonly escalation_chain?: string; + notify_to_users_queue?: string[]; + /** Format: time */ + from_time?: string | null; + /** Format: time */ + to_time?: string | null; + /** Format: int64 */ + num_alerts_in_window?: number | null; + num_minutes_in_window?: number | null; + readonly slack_integration_required?: boolean; + custom_webhook?: string | null; + notify_schedule?: string | null; + notify_to_group?: string | null; + notify_to_team_members?: string | null; + important?: boolean; + }; + PatchedUser: { + readonly pk?: string; + readonly organization?: components['schemas']['FastOrganization']; + current_team?: string | null; + /** Format: email */ + readonly email?: string; + readonly username?: string; + readonly name?: string; + readonly role?: components['schemas']['RoleEnum']; + /** Format: uri */ + readonly avatar?: string; + readonly avatar_full?: string; + timezone?: string | null; + working_hours?: components['schemas']['WorkingHours']; + unverified_phone_number?: string | null; + /** @description Use property to highlight that _verified_phone_number should not be modified directly */ + readonly verified_phone_number?: string | null; + readonly slack_user_identity?: components['schemas']['SlackUserIdentity']; + readonly telegram_configuration?: components['schemas']['TelegramToUserConnector']; + readonly messaging_backends?: { + [key: string]: + | { + [key: string]: unknown; + } + | undefined; + }; + readonly notification_chain_verbal?: { + default: string; + important: string; + }; + readonly cloud_connection_status?: components['schemas']['CloudConnectionStatusEnum'] | null; + hide_phone_number?: boolean; + readonly has_google_oauth2_connected?: boolean; + readonly is_currently_oncall?: boolean; + google_calendar_settings?: components['schemas']['GoogleCalendarSettings']; + }; + PatchedUserNotificationPolicyUpdate: { + readonly id?: string; + /** @default 1 */ + step: components['schemas']['Step923Enum']; + /** @default 0 */ + notify_by: components['schemas']['NotifyByEnum']; + /** Format: double */ + wait_delay?: number | null; + readonly important?: boolean; + readonly user?: string; + readonly order?: number | null; + }; + PatchedWebhook: { + readonly id?: string; + name?: string | null; + is_webhook_enabled?: boolean | null; + is_legacy?: boolean | null; + team?: string | null; + username?: string | null; + password?: string | null; + authorization_header?: string | null; + trigger_template?: string | null; + headers?: string | null; + url?: string | null; + data?: string | null; + forward_all?: boolean | null; + http_method?: string | null; + trigger_type?: string | null; + readonly trigger_type_name?: string; + readonly last_response_log?: string; + integration_filter?: string[]; + preset?: string | null; + labels?: components['schemas']['LabelPair'][]; + }; + PreviewTemplateRequest: { + template_body?: string | null; + template_name?: string | null; + payload?: { + [key: string]: unknown; + } | null; + }; + PreviewTemplateResponse: { + preview: string | null; + is_valid_json_object: boolean; + }; + /** + * @description * `0` - source + * * `1` - user + * * `2` - not yet + * * `3` - last escalation step + * * `4` - archived + * * `5` - wiped + * * `6` - stop maintenance + * * `7` - not yet, autoresolve disabled + * @enum {integer} */ - ActionEnum: 'acknowledge' | 'resolve' | 'silence' | 'restart'; - AdditionalSettingsField: components['schemas']['Settings']; - Alert: { + ResolvedByEnum: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7; + /** + * @description * `0` - ADMIN + * * `1` - EDITOR + * * `2` - VIEWER + * * `3` - NONE + * @enum {integer} + */ + RoleEnum: 0 | 1 | 2 | 3; + ScheduleFast: { readonly id: string; - /** Format: uri */ - link_to_upstream_details?: string | null; - readonly render_for_web: { - title: string; - message: string; - image_url: string | null; - source_link: string | null; - }; - /** Format: date-time */ - readonly created_at: string; + name: string; }; - AlertGroup: CustomApiSchemas['AlertGroup'] & { + ShortAlertGroup: { readonly pk: string; - readonly alerts_count: number; - inside_organization_number?: number; - alert_receive_channel: components['schemas']['FastAlertReceiveChannel']; - resolved?: boolean; - resolved_by?: components['schemas']['ResolvedByEnum']; - resolved_by_user?: components['schemas']['FastUser']; - /** Format: date-time */ - resolved_at?: string | null; - /** Format: date-time */ - acknowledged_at?: string | null; - acknowledged?: boolean; - acknowledged_on_source?: boolean; - acknowledged_by_user?: components['schemas']['FastUser']; - silenced?: boolean; - silenced_by_user?: components['schemas']['FastUser']; - /** Format: date-time */ - silenced_at?: string | null; - /** Format: date-time */ - silenced_until?: string | null; - /** Format: date-time */ - readonly started_at: string; - readonly related_users: components['schemas']['UserShort'][]; readonly render_for_web: | { title: string; @@ -1535,68 +2972,118 @@ export interface components { source_link: string | null; } | Record; - dependent_alert_groups: components['schemas']['ShortAlertGroup'][]; - root_alert_group: components['schemas']['ShortAlertGroup']; - readonly status: number; - /** @description Generate a link for AlertGroup to declare Grafana Incident by click */ - readonly declare_incident_link: string; - team: string | null; - grafana_incident_id?: string | null; - readonly labels: components['schemas']['AlertGroupLabel'][]; - readonly permalinks: { - slack: string | null; - slack_app: string | null; - telegram: string | null; - web: string; - }; - readonly alerts: components['schemas']['Alert'][]; - readonly render_after_resolve_report_json: { - time: string; - action: string; - /** @enum {string} */ - realm: 'user_notification' | 'alert_group' | 'resolution_note'; - type: number; - created_at: string; - author: { - username: string; - pk: string; - avatar: string; - avatar_full: string; - }; - }[]; - readonly slack_permalink: string | null; - /** Format: date-time */ - readonly last_alert_at: string; - readonly paged_users: { - id: number; - username: string; - name: string; - pk: string; - avatar: string; - avatar_full: string; - important: boolean; - }[]; - readonly external_urls: { - integration: string; - integration_type: string; - external_id: string; - url: string; - }[]; + alert_receive_channel: components['schemas']['FastAlertReceiveChannel']; + readonly inside_organization_number: number; }; - AlertGroupAttach: { - root_alert_group_pk: string; + SlackUserIdentity: { + readonly slack_login: string; + readonly slack_id: string; + readonly avatar: string; + readonly name: string; + readonly display_name: string | null; + }; + /** + * @description * `0` - Wait + * * `1` - Notify User + * * `2` - Notify Whole Channel + * * `3` - Repeat Escalation (5 times max) + * * `4` - Resolve + * * `5` - Notify Group + * * `6` - Notify Schedule + * * `7` - Notify User (Important) + * * `8` - Notify Group (Important) + * * `9` - Notify Schedule (Important) + * * `10` - Trigger Outgoing Webhook + * * `11` - Notify User (next each time) + * * `12` - Continue escalation only if time is from + * * `13` - Notify multiple Users + * * `14` - Notify multiple Users (Important) + * * `15` - Continue escalation if >X alerts per Y minutes + * * `16` - Trigger Webhook + * * `17` - Notify all users in a Team + * * `18` - Notify all users in a Team (Important) + * @enum {integer} + */ + Step267Enum: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18; + /** + * @description * `0` - Debug + * * `1` - Maintenance + * @enum {integer} + */ + Step923Enum: 0 | 1; + TelegramChannelDetails: { + display_name: string; + id: string; + }; + TelegramToUserConnector: { + telegram_nick_name?: string | null; + /** Format: int64 */ + telegram_chat_id: number; + }; + /** + * @description * `60` - 1 minute + * * `120` - 2 minutes + * * `180` - 3 minutes + * * `300` - 5 minutes + * * `600` - 10 minutes + * * `900` - 15 minutes + * * `1800` - 30 minutes + * * `3600` - 1 hour + * * `43200` - 12 hours + * * `86400` - 1 day + * @enum {integer} + */ + TimeoutSecondsEnum: 60 | 120 | 180 | 300 | 600 | 900 | 1800 | 3600 | 43200 | 86400; + User: CustomApiSchemas['User'] & { + readonly pk: string; + readonly organization: components['schemas']['FastOrganization']; + current_team?: string | null; + /** Format: email */ + readonly email: string; + readonly username: string; + readonly name: string; + readonly role: components['schemas']['RoleEnum']; + /** Format: uri */ + readonly avatar: string; + readonly avatar_full: string; + timezone?: string | null; + working_hours?: components['schemas']['WorkingHours']; + unverified_phone_number?: string | null; + /** @description Use property to highlight that _verified_phone_number should not be modified directly */ + readonly verified_phone_number: string | null; + readonly slack_user_identity: components['schemas']['SlackUserIdentity']; + readonly telegram_configuration: components['schemas']['TelegramToUserConnector']; + readonly messaging_backends: { + [key: string]: + | { + [key: string]: unknown; + } + | undefined; + }; + readonly notification_chain_verbal: { + default: string; + important: string; + }; + readonly cloud_connection_status: components['schemas']['CloudConnectionStatusEnum'] | null; + hide_phone_number?: boolean; + readonly has_google_oauth2_connected: boolean; + readonly is_currently_oncall: boolean; + google_calendar_settings?: components['schemas']['GoogleCalendarSettings']; }; - AlertGroupBulkActionOptions: { - value: components['schemas']['ActionEnum']; - display_name: components['schemas']['ActionEnum']; + UserExportTokenGetResponse: { + /** Format: date-time */ + created_at: string; + /** Format: date-time */ + revoked_at: string | null; + active: boolean; }; - AlertGroupBulkActionRequest: { - alert_group_pks: string[]; - action: components['schemas']['ActionEnum']; - /** @description only applicable for silence */ - delay?: number | null; + UserExportTokenPostResponse: { + token: string; + /** Format: date-time */ + created_at: string; + export_url: string; }; - AlertGroupFilters: { + UserFilters: { name: string; type: string; href?: string; @@ -1604,1138 +3091,1126 @@ export interface components { default?: { [key: string]: unknown; }; - description?: string; - options: components['schemas']['AlertGroupFiltersOptions']; - }; - AlertGroupFiltersOptions: { - value: string; - display_name: number; - }; - AlertGroupLabel: { - key: components['schemas']['Key']; - value: components['schemas']['Value']; + description?: string; + options: components['schemas']['UserFiltersOptions']; + }; + UserFiltersOptions: { + value: string; + display_name: number; + }; + UserGetTelegramVerificationCode: { + telegram_code: string; + bot_link: string; + }; + UserGroup: { + readonly id: string; + name: string; + handle: string; + }; + UserIsCurrentlyOnCall: { + username: string; + pk: string; + avatar: string; + readonly avatar_full: string; + name: string; + readonly timezone: string | null; + readonly teams: components['schemas']['FastTeam'][]; + readonly is_currently_oncall: boolean; + }; + UserNotificationPolicy: { + readonly id: string; + /** @default 1 */ + step: components['schemas']['Step923Enum']; + /** @default 0 */ + notify_by: components['schemas']['NotifyByEnum']; + /** Format: double */ + wait_delay?: number | null; + important?: boolean; + user?: string | null; + readonly order: number | null; + }; + UserNotificationPolicyDelayOptions: { + value: string; + sec_value: number; + display_name: string; + }; + UserNotificationPolicyNotifyByOptions: { + value: number; + display_name: string; + slack_integration_required: boolean; + telegram_integration_required: boolean; + }; + UserNotificationPolicyUpdate: { + readonly id: string; + /** @default 1 */ + step: components['schemas']['Step923Enum']; + /** @default 0 */ + notify_by: components['schemas']['NotifyByEnum']; + /** Format: double */ + wait_delay?: number | null; + readonly important: boolean; + readonly user: string; + readonly order: number | null; + }; + UserPermission: { + readonly action: string; + }; + UserPolymorphic: + | components['schemas']['FilterUser'] + | components['schemas']['UserIsCurrentlyOnCall'] + | components['schemas']['ListUser']; + UserShort: { + username: string; + pk: string; + avatar: string; + readonly avatar_full: string; + }; + Value: { + id: string; + name: string; + }; + Webhook: CustomApiSchemas['Webhook'] & { + readonly id: string; + name?: string | null; + is_webhook_enabled?: boolean | null; + is_legacy?: boolean | null; + team?: string | null; + username?: string | null; + password?: string | null; + authorization_header?: string | null; + trigger_template?: string | null; + headers?: string | null; + url?: string | null; + data?: string | null; + forward_all?: boolean | null; + http_method?: string | null; + trigger_type: string | null; + readonly trigger_type_name: string; + readonly last_response_log: string; + integration_filter?: string[]; + preset?: string | null; + labels?: components['schemas']['LabelPair'][]; + }; + WebhookFast: { + readonly id: string; + name?: string | null; + }; + WebhookFilters: { + name: string; + display_name?: string; + type: string; + href: string; + global?: boolean; + }; + WebhookPresetOptions: { + id: string; + name: string; + logo: string; + description: string; + controlled_fields: string[]; + }; + WebhookPreviewTemplateRequest: { + template_body?: string | null; + template_name?: string | null; + payload?: { + [key: string]: unknown; + } | null; + }; + WebhookPreviewTemplateResponse: { + preview: string | null; + }; + WebhookResponse: { + /** Format: date-time */ + timestamp?: string; + url?: string | null; + request_trigger?: string | null; + request_headers?: string | null; + request_data?: string | null; + status_code?: number | null; + content?: string | null; + event_data?: string | null; + }; + WebhookTriggerManual: { + alert_group: string; + }; + WorkingHours: { + monday: components['schemas']['WorkingHoursPeriod'][]; + tuesday: components['schemas']['WorkingHoursPeriod'][]; + wednesday: components['schemas']['WorkingHoursPeriod'][]; + thursday: components['schemas']['WorkingHoursPeriod'][]; + friday: components['schemas']['WorkingHoursPeriod'][]; + saturday: components['schemas']['WorkingHoursPeriod'][]; + sunday: components['schemas']['WorkingHoursPeriod'][]; + }; + WorkingHoursPeriod: { + start: string; + end: string; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export interface operations { + alert_receive_channels_list: { + parameters: { + query?: { + id_ne?: string[]; + /** @description * `grafana_alerting` - Grafana Alerting + * * `webhook` - Webhook + * * `alertmanager` - Alertmanager + * * `formatted_webhook` - Formatted webhook + * * `kapacitor` - Kapacitor + * * `elastalert` - Elastalert + * * `heartbeat` - Heartbeat + * * `inbound_email` - Inbound Email + * * `maintenance` - Maintenance + * * `manual` - Manual + * * `slack_channel` - Slack Channel + * * `zabbix` - Zabbix + * * `direct_paging` - Direct paging + * * `grafana` - Grafana Legacy Alerting + * * `legacy_alertmanager` - (Legacy) AlertManager + * * `legacy_grafana_alerting` - (Deprecated) Grafana Alerting */ + integration?: ( + | 'alertmanager' + | 'direct_paging' + | 'elastalert' + | 'formatted_webhook' + | 'grafana' + | 'grafana_alerting' + | 'heartbeat' + | 'inbound_email' + | 'kapacitor' + | 'legacy_alertmanager' + | 'legacy_grafana_alerting' + | 'maintenance' + | 'manual' + | 'slack_channel' + | 'webhook' + | 'zabbix' + )[]; + /** @description * `grafana_alerting` - Grafana Alerting + * * `webhook` - Webhook + * * `alertmanager` - Alertmanager + * * `formatted_webhook` - Formatted webhook + * * `kapacitor` - Kapacitor + * * `elastalert` - Elastalert + * * `heartbeat` - Heartbeat + * * `inbound_email` - Inbound Email + * * `maintenance` - Maintenance + * * `manual` - Manual + * * `slack_channel` - Slack Channel + * * `zabbix` - Zabbix + * * `direct_paging` - Direct paging + * * `grafana` - Grafana Legacy Alerting + * * `legacy_alertmanager` - (Legacy) AlertManager + * * `legacy_grafana_alerting` - (Deprecated) Grafana Alerting */ + integration_ne?: ( + | 'alertmanager' + | 'direct_paging' + | 'elastalert' + | 'formatted_webhook' + | 'grafana' + | 'grafana_alerting' + | 'heartbeat' + | 'inbound_email' + | 'kapacitor' + | 'legacy_alertmanager' + | 'legacy_grafana_alerting' + | 'maintenance' + | 'manual' + | 'slack_channel' + | 'webhook' + | 'zabbix' + )[]; + /** @description * `0` - Debug + * * `1` - Maintenance */ + maintenance_mode?: (0 | 1)[]; + /** @description A page number within the paginated result set. */ + page?: number; + /** @description Number of results to return per page. */ + perpage?: number; + /** @description A search term. */ + search?: string; + team?: string[]; + }; + header?: never; + path?: never; + cookie?: never; }; - AlertGroupList: { - readonly pk: string; - readonly alerts_count: number; - inside_organization_number?: number; - alert_receive_channel: components['schemas']['FastAlertReceiveChannel']; - resolved?: boolean; - resolved_by?: components['schemas']['ResolvedByEnum']; - resolved_by_user?: components['schemas']['FastUser']; - /** Format: date-time */ - resolved_at?: string | null; - /** Format: date-time */ - acknowledged_at?: string | null; - acknowledged?: boolean; - acknowledged_on_source?: boolean; - acknowledged_by_user?: components['schemas']['FastUser']; - silenced?: boolean; - silenced_by_user?: components['schemas']['FastUser']; - /** Format: date-time */ - silenced_at?: string | null; - /** Format: date-time */ - silenced_until?: string | null; - /** Format: date-time */ - readonly started_at: string; - readonly related_users: components['schemas']['UserShort'][]; - readonly render_for_web: - | { - title: string; - message: string; - image_url: string | null; - source_link: string | null; - } - | Record; - dependent_alert_groups: components['schemas']['ShortAlertGroup'][]; - root_alert_group: components['schemas']['ShortAlertGroup']; - readonly status: number; - /** @description Generate a link for AlertGroup to declare Grafana Incident by click */ - readonly declare_incident_link: string; - team: string | null; - grafana_incident_id?: string | null; - readonly labels: components['schemas']['AlertGroupLabel'][]; - readonly permalinks: { - slack: string | null; - slack_app: string | null; - telegram: string | null; - web: string; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['PaginatedAlertReceiveChannelPolymorphicList']; + }; }; }; - AlertGroupResolve: { - resolution_note?: string | null; + }; + alert_receive_channels_create: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - AlertGroupSilence: { - delay: number; + requestBody: { + content: { + 'application/json': components['schemas']['AlertReceiveChannelCreate']; + 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelCreate']; + 'multipart/form-data': components['schemas']['AlertReceiveChannelCreate']; + }; }; - AlertGroupSilenceOptions: { - value: components['schemas']['AlertGroupSilenceOptionsValueEnum']; - display_name: components['schemas']['AlertGroupSilenceOptionsDisplayNameEnum']; + responses: { + 201: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['AlertReceiveChannelCreate']; + }; + }; }; - /** - * @description * `30 minutes` - 30 minutes - * * `1 hour` - 1 hour - * * `2 hours` - 2 hours - * * `3 hours` - 3 hours - * * `4 hours` - 4 hours - * * `6 hours` - 6 hours - * * `12 hours` - 12 hours - * * `16 hours` - 16 hours - * * `20 hours` - 20 hours - * * `24 hours` - 24 hours - * * `Forever` - Forever - * @enum {string} - */ - AlertGroupSilenceOptionsDisplayNameEnum: - | '30 minutes' - | '1 hour' - | '2 hours' - | '3 hours' - | '4 hours' - | '6 hours' - | '12 hours' - | '16 hours' - | '20 hours' - | '24 hours' - | 'Forever'; - /** - * @description * `1800` - 1800 - * * `3600` - 3600 - * * `7200` - 7200 - * * `10800` - 10800 - * * `14400` - 14400 - * * `21600` - 21600 - * * `43200` - 43200 - * * `57600` - 57600 - * * `72000` - 72000 - * * `86400` - 86400 - * * `-1` - -1 - * @enum {integer} - */ - AlertGroupSilenceOptionsValueEnum: 1800 | 3600 | 7200 | 10800 | 14400 | 21600 | 43200 | 57600 | 72000 | 86400 | -1; - AlertGroupStats: { - count: number; + }; + alert_receive_channels_retrieve: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - AlertGroupUnpageUser: { - user_id: string; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['AlertReceiveChannel']; + }; + }; }; - AlertReceiveChannel: { - readonly id: string; - readonly description: string | null; - description_short?: string | null; - integration: components['schemas']['IntegrationEnum']; - readonly smile_code: string; - verbal_name?: string | null; - readonly author: string; - readonly organization: string; - team?: string | null; - /** Format: date-time */ - readonly created_at: string; - readonly integration_url: string | null; - readonly alert_count: number; - readonly alert_groups_count: number; - allow_source_based_resolving?: boolean; - readonly instructions: string; - readonly is_able_to_autoresolve: boolean; - readonly default_channel_filter: string | null; - readonly demo_alert_enabled: boolean; - readonly maintenance_mode: - | (components['schemas']['MaintenanceModeEnum'] | components['schemas']['NullEnum']) - | null; - readonly maintenance_till: number | null; - readonly heartbeat: components['schemas']['IntegrationHeartBeat'] | null; - readonly is_available_for_integration_heartbeat: boolean; - readonly allow_delete: boolean; - readonly demo_alert_payload: { - [key: string]: unknown; + }; + alert_receive_channels_update: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; }; - readonly routes_count: number; - readonly connected_escalations_chains_count: number; - readonly is_based_on_alertmanager: boolean; - readonly inbound_email: string; - readonly is_legacy: boolean; - labels?: components['schemas']['LabelPair'][]; - alert_group_labels?: components['schemas']['IntegrationAlertGroupLabels']; - /** Format: date-time */ - readonly alertmanager_v2_migrated_at: string | null; - additional_settings?: components['schemas']['AdditionalSettingsField'] | null; + cookie?: never; }; - AlertReceiveChannelConnectContactPoint: { - datasource_uid: string; - contact_point_name: string; + requestBody?: { + content: { + 'application/json': components['schemas']['AlertReceiveChannelUpdate']; + 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelUpdate']; + 'multipart/form-data': components['schemas']['AlertReceiveChannelUpdate']; + }; }; - AlertReceiveChannelConnectedChannel: { - readonly alert_receive_channel: components['schemas']['FastAlertReceiveChannel']; - backsync: boolean; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['AlertReceiveChannelUpdate']; + }; + }; }; - AlertReceiveChannelConnectedContactPoints: { - uid: string; - name: string; - contact_points: components['schemas']['AlertReceiveChannelConnectedContactPointsInner'][]; + }; + alert_receive_channels_destroy: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - AlertReceiveChannelConnectedContactPointsInner: { - name: string; - notification_connected: boolean; + requestBody?: never; + responses: { + /** @description No response body */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - AlertReceiveChannelConnection: { - readonly source_alert_receive_channels: components['schemas']['AlertReceiveChannelSourceChannel'][]; - readonly connected_alert_receive_channels: components['schemas']['AlertReceiveChannelConnectedChannel'][]; + }; + alert_receive_channels_partial_update: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - AlertReceiveChannelContactPoints: { - uid: string; - name: string; - contact_points: string[]; + requestBody?: { + content: { + 'application/json': components['schemas']['PatchedAlertReceiveChannelUpdate']; + 'application/x-www-form-urlencoded': components['schemas']['PatchedAlertReceiveChannelUpdate']; + 'multipart/form-data': components['schemas']['PatchedAlertReceiveChannelUpdate']; + }; }; - AlertReceiveChannelCreate: { - readonly id: string; - readonly description: string | null; - description_short?: string | null; - integration: components['schemas']['IntegrationEnum']; - readonly smile_code: string; - verbal_name?: string | null; - readonly author: string; - readonly organization: string; - team?: string | null; - /** Format: date-time */ - readonly created_at: string; - readonly integration_url: string | null; - readonly alert_count: number; - readonly alert_groups_count: number; - allow_source_based_resolving?: boolean; - readonly instructions: string; - readonly is_able_to_autoresolve: boolean; - readonly default_channel_filter: string | null; - readonly demo_alert_enabled: boolean; - readonly maintenance_mode: - | (components['schemas']['MaintenanceModeEnum'] | components['schemas']['NullEnum']) - | null; - readonly maintenance_till: number | null; - readonly heartbeat: components['schemas']['IntegrationHeartBeat'] | null; - readonly is_available_for_integration_heartbeat: boolean; - readonly allow_delete: boolean; - readonly demo_alert_payload: { - [key: string]: unknown; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['AlertReceiveChannelUpdate']; + }; }; - readonly routes_count: number; - readonly connected_escalations_chains_count: number; - readonly is_based_on_alertmanager: boolean; - readonly inbound_email: string; - readonly is_legacy: boolean; - labels?: components['schemas']['LabelPair'][]; - alert_group_labels?: components['schemas']['IntegrationAlertGroupLabels']; - /** Format: date-time */ - readonly alertmanager_v2_migrated_at: string | null; - additional_settings?: components['schemas']['AdditionalSettingsField'] | null; - /** @default true */ - create_default_webhooks: boolean; }; - AlertReceiveChannelCreateContactPoint: { - datasource_uid: string; - contact_point_name: string; + }; + alert_receive_channels_api_token_retrieve: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - AlertReceiveChannelDisconnectContactPoint: { - datasource_uid: string; - contact_point_name: string; + requestBody?: never; + responses: { + /** @description No response body */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - AlertReceiveChannelFilters: { - name: string; - display_name?: string; - type: string; - href: string; - global?: boolean; + }; + alert_receive_channels_api_token_create: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - AlertReceiveChannelIntegrationOptions: { - value: string; - display_name: string; - short_description: string; - featured: boolean; - featured_tag_name: string | null; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['IntegrationTokenPostResponse']; + }; + }; }; - AlertReceiveChannelNewConnection: { - id: string; - backsync: boolean; + }; + alert_receive_channels_change_team_update: { + parameters: { + query: { + team_id: string; + }; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - AlertReceiveChannelPolymorphic: - | components['schemas']['AlertReceiveChannel'] - | components['schemas']['FilterAlertReceiveChannel']; - AlertReceiveChannelSendDemoAlert: { - demo_alert_payload?: { - [key: string]: unknown; - } | null; + requestBody?: never; + responses: { + /** @description No response body */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - AlertReceiveChannelSourceChannel: { - readonly alert_receive_channel: components['schemas']['FastAlertReceiveChannel']; - backsync: boolean; + }; + alert_receive_channels_connect_contact_point_create: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - AlertReceiveChannelStartMaintenance: { - mode: components['schemas']['ModeEnum']; - duration: components['schemas']['DurationEnum']; + requestBody: { + content: { + 'application/json': components['schemas']['AlertReceiveChannelConnectContactPoint']; + 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelConnectContactPoint']; + 'multipart/form-data': components['schemas']['AlertReceiveChannelConnectContactPoint']; + }; }; - AlertReceiveChannelUpdate: { - readonly id: string; - readonly description: string | null; - description_short?: string | null; - readonly integration: components['schemas']['IntegrationEnum']; - readonly smile_code: string; - verbal_name?: string | null; - readonly author: string; - readonly organization: string; - team?: string | null; - /** Format: date-time */ - readonly created_at: string; - readonly integration_url: string | null; - readonly alert_count: number; - readonly alert_groups_count: number; - allow_source_based_resolving?: boolean; - readonly instructions: string; - readonly is_able_to_autoresolve: boolean; - readonly default_channel_filter: string | null; - readonly demo_alert_enabled: boolean; - readonly maintenance_mode: - | (components['schemas']['MaintenanceModeEnum'] | components['schemas']['NullEnum']) - | null; - readonly maintenance_till: number | null; - readonly heartbeat: components['schemas']['IntegrationHeartBeat'] | null; - readonly is_available_for_integration_heartbeat: boolean; - readonly allow_delete: boolean; - readonly demo_alert_payload: { - [key: string]: unknown; + responses: { + /** @description No response body */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; }; - readonly routes_count: number; - readonly connected_escalations_chains_count: number; - readonly is_based_on_alertmanager: boolean; - readonly inbound_email: string; - readonly is_legacy: boolean; - labels?: components['schemas']['LabelPair'][]; - alert_group_labels?: components['schemas']['IntegrationAlertGroupLabels']; - /** Format: date-time */ - readonly alertmanager_v2_migrated_at: string | null; - additional_settings?: components['schemas']['AdditionalSettingsField'] | null; }; - /** @enum {integer} */ - CloudConnectionStatusEnum: 0 | 1 | 2 | 3; - CurrentUser: { - readonly pk: string; - readonly organization: components['schemas']['FastOrganization']; - current_team?: string | null; - /** Format: email */ - readonly email: string; - readonly username: string; - readonly name: string; - readonly role: components['schemas']['RoleEnum']; - /** Format: uri */ - readonly avatar: string; - readonly avatar_full: string; - timezone?: string | null; - working_hours?: components['schemas']['WorkingHours']; - unverified_phone_number?: string | null; - /** @description Use property to highlight that _verified_phone_number should not be modified directly */ - readonly verified_phone_number: string | null; - readonly slack_user_identity: components['schemas']['SlackUserIdentity']; - readonly telegram_configuration: components['schemas']['TelegramToUserConnector']; - readonly messaging_backends: { - [key: string]: { - [key: string]: unknown; + }; + alert_receive_channels_connected_alert_receive_channels_retrieve: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['AlertReceiveChannelConnection']; }; }; - readonly notification_chain_verbal: { - default: string; - important: string; + }; + }; + alert_receive_channels_connected_alert_receive_channels_create: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; }; - readonly cloud_connection_status: components['schemas']['CloudConnectionStatusEnum'] | null; - hide_phone_number?: boolean; - readonly has_google_oauth2_connected: boolean; - readonly is_currently_oncall: boolean; - google_calendar_settings?: components['schemas']['GoogleCalendarSettings']; - readonly rbac_permissions: components['schemas']['UserPermission'][]; - readonly google_oauth2_token_is_missing_scopes: boolean; + cookie?: never; }; - /** @description This serializer is consistent with apps.api.serializers.labels.LabelPairSerializer, but allows null for value ID. */ - CustomLabel: { - key: components['schemas']['CustomLabelKey']; - value: components['schemas']['CustomLabelValue']; + requestBody: { + content: { + 'application/json': components['schemas']['AlertReceiveChannelNewConnection'][]; + 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelNewConnection'][]; + 'multipart/form-data': components['schemas']['AlertReceiveChannelNewConnection'][]; + }; }; - CustomLabelKey: { - id: string; - name: string; - /** @default false */ - prescribed: boolean; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['AlertReceiveChannelConnection']; + }; + }; }; - CustomLabelValue: { - id: string | null; - name: string; - /** @default false */ - prescribed: boolean; + }; + alert_receive_channels_connected_alert_receive_channels_update: { + parameters: { + query?: never; + header?: never; + path: { + connected_alert_receive_channel_id: string; + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - /** - * @description * `3600` - 3600 - * * `10800` - 10800 - * * `21600` - 21600 - * * `43200` - 43200 - * * `86400` - 86400 - * @enum {integer} - */ - DurationEnum: 3600 | 10800 | 21600 | 43200 | 86400; - FastAlertReceiveChannel: { - readonly id: string; - readonly integration: string; - verbal_name?: string | null; - readonly deleted: boolean; + requestBody: { + content: { + 'application/json': components['schemas']['AlertReceiveChannelConnectedChannel']; + 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelConnectedChannel']; + 'multipart/form-data': components['schemas']['AlertReceiveChannelConnectedChannel']; + }; }; - FastOrganization: { - readonly pk: string; - readonly name: string; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['AlertReceiveChannelConnectedChannel']; + }; + }; }; - FastTeam: { - readonly id: string; - name: string; - email?: string | null; - /** Format: uri */ - avatar_url: string; + }; + alert_receive_channels_connected_alert_receive_channels_destroy: { + parameters: { + query?: never; + header?: never; + path: { + connected_alert_receive_channel_id: string; + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - FastUser: { - pk: string; - readonly username: string; + requestBody?: never; + responses: { + /** @description No response body */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - FilterAlertReceiveChannel: { - readonly value: string; - readonly display_name: string; - readonly integration_url: string | null; + }; + alert_receive_channels_connected_contact_points_list: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - FilterUser: { - value: string; - display_name: string; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['AlertReceiveChannelConnectedContactPoints'][]; + }; + }; }; - GoogleCalendarSettings: { - oncall_schedules_to_consider_for_shift_swaps?: string[] | null; + }; + alert_receive_channels_counters_per_integration_retrieve: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - /** @description Alert group labels configuration for the integration. See AlertReceiveChannel.alert_group_labels for details. */ - IntegrationAlertGroupLabels: { - inheritable: { - [key: string]: boolean; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': { + [key: string]: + | { + alerts_count: number; + alert_groups_count: number; + } + | undefined; + }; + }; }; - custom: components['schemas']['CustomLabel'][]; - template: string | null; }; - /** - * @description * `grafana_alerting` - Grafana Alerting - * * `webhook` - Webhook - * * `alertmanager` - Alertmanager - * * `formatted_webhook` - Formatted webhook - * * `kapacitor` - Kapacitor - * * `elastalert` - Elastalert - * * `heartbeat` - Heartbeat - * * `inbound_email` - Inbound Email - * * `maintenance` - Maintenance - * * `manual` - Manual - * * `slack_channel` - Slack Channel - * * `zabbix` - Zabbix - * * `direct_paging` - Direct paging - * * `grafana` - Grafana Legacy Alerting - * * `legacy_alertmanager` - (Legacy) AlertManager - * * `legacy_grafana_alerting` - (Deprecated) Grafana Alerting - * * `servicenow` - ServiceNow - * * `amazon_sns` - Amazon SNS - * * `stackdriver` - Stackdriver - * * `curler` - Curler - * * `datadog` - Datadog - * * `demo` - Demo - * * `fabric` - Fabric - * * `newrelic` - New Relic - * * `pagerduty` - Pagerduty - * * `pingdom` - Pingdom - * * `prtg` - PRTG - * * `sentry` - Sentry - * * `uptimerobot` - UptimeRobot - * * `jira` - Jira - * * `zendesk` - Zendesk - * * `appdynamics` - AppDynamics - * @enum {string} - */ - IntegrationEnum: - | 'grafana_alerting' - | 'webhook' - | 'alertmanager' - | 'formatted_webhook' - | 'kapacitor' - | 'elastalert' - | 'heartbeat' - | 'inbound_email' - | 'maintenance' - | 'manual' - | 'slack_channel' - | 'zabbix' - | 'direct_paging' - | 'grafana' - | 'legacy_alertmanager' - | 'legacy_grafana_alerting' - | 'servicenow' - | 'amazon_sns' - | 'stackdriver' - | 'curler' - | 'datadog' - | 'demo' - | 'fabric' - | 'newrelic' - | 'pagerduty' - | 'pingdom' - | 'prtg' - | 'sentry' - | 'uptimerobot' - | 'jira' - | 'zendesk' - | 'appdynamics'; - IntegrationHeartBeat: { - readonly id: string; - timeout_seconds: components['schemas']['TimeoutSecondsEnum']; - alert_receive_channel: string; - readonly link: string | null; - readonly last_heartbeat_time_verbal: string | null; - /** @description Return bool indicates heartbeat status. - * True if first heartbeat signal was sent and flow is ok else False. - * If first heartbeat signal was not send it means that configuration was not finished and status not ok. */ - readonly status: boolean; - readonly instruction: string; + }; + alert_receive_channels_create_contact_point_create: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - IntegrationTokenPostResponse: { - token: string; - usage: string; + requestBody: { + content: { + 'application/json': components['schemas']['AlertReceiveChannelCreateContactPoint']; + 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelCreateContactPoint']; + 'multipart/form-data': components['schemas']['AlertReceiveChannelCreateContactPoint']; + }; + }; + responses: { + /** @description No response body */ + 201: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - Key: { - id: string; - name: string; + }; + alert_receive_channels_disconnect_contact_point_create: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - LabelCreate: { - key: components['schemas']['LabelRepr']; - values: components['schemas']['LabelRepr'][]; + requestBody: { + content: { + 'application/json': components['schemas']['AlertReceiveChannelDisconnectContactPoint']; + 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelDisconnectContactPoint']; + 'multipart/form-data': components['schemas']['AlertReceiveChannelDisconnectContactPoint']; + }; }; - LabelKey: { - id: string; - name: string; - /** @default false */ - prescribed: boolean; + responses: { + /** @description No response body */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - LabelOption: { - key: components['schemas']['LabelKey']; - values: components['schemas']['LabelValue'][]; + }; + alert_receive_channels_migrate_create: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - LabelPair: { - key: components['schemas']['LabelKey']; - value: components['schemas']['LabelValue']; + requestBody?: never; + responses: { + /** @description No response body */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - LabelRepr: { - name: string; + }; + alert_receive_channels_preview_template_create: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - LabelValue: { - id: string; - name: string; - /** @default false */ - prescribed: boolean; + requestBody?: { + content: { + 'application/json': components['schemas']['PreviewTemplateRequest']; + 'application/x-www-form-urlencoded': components['schemas']['PreviewTemplateRequest']; + 'multipart/form-data': components['schemas']['PreviewTemplateRequest']; + }; }; - ListUser: { - readonly pk: string; - readonly organization: components['schemas']['FastOrganization']; - current_team?: string | null; - /** Format: email */ - readonly email: string; - readonly username: string; - readonly name: string; - readonly role: components['schemas']['RoleEnum']; - /** Format: uri */ - readonly avatar: string; - readonly avatar_full: string; - timezone?: string | null; - working_hours?: components['schemas']['WorkingHours']; - unverified_phone_number?: string | null; - /** @description Use property to highlight that _verified_phone_number should not be modified directly */ - readonly verified_phone_number: string | null; - readonly slack_user_identity: components['schemas']['SlackUserIdentity']; - readonly telegram_configuration: components['schemas']['TelegramToUserConnector']; - readonly messaging_backends: { - [key: string]: { - [key: string]: unknown; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['PreviewTemplateResponse']; }; }; - readonly notification_chain_verbal: { - default: string; - important: string; + }; + }; + alert_receive_channels_send_demo_alert_create: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; }; - readonly cloud_connection_status: components['schemas']['CloudConnectionStatusEnum'] | null; - hide_phone_number?: boolean; - readonly has_google_oauth2_connected: boolean; + cookie?: never; }; - /** - * @description * `0` - Debug - * * `1` - Maintenance - * @enum {integer} - */ - MaintenanceModeEnum: 0 | 1; - /** - * @description * `0` - Debug - * * `1` - Maintenance - * @enum {integer} - */ - ModeEnum: 0 | 1; - /** @enum {unknown} */ - NullEnum: null; - PaginatedAlertGroupListList: { - /** - * Format: uri - * @example http://api.example.org/accounts/?cursor=cD00ODY%3D" - */ - next?: string | null; - /** - * Format: uri - * @example http://api.example.org/accounts/?cursor=cj0xJnA9NDg3 - */ - previous?: string | null; - results: components['schemas']['AlertGroupList'][]; - page_size?: number; + requestBody?: { + content: { + 'application/json': components['schemas']['AlertReceiveChannelSendDemoAlert']; + 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelSendDemoAlert']; + 'multipart/form-data': components['schemas']['AlertReceiveChannelSendDemoAlert']; + }; }; - PaginatedAlertReceiveChannelPolymorphicList: { - /** @example 123 */ - count: number; - /** - * Format: uri - * @example http://api.example.org/accounts/?page=4 - */ - next?: string | null; - /** - * Format: uri - * @example http://api.example.org/accounts/?page=2 - */ - previous?: string | null; - results: components['schemas']['AlertReceiveChannelPolymorphic'][]; - page_size?: number; - current_page_number?: number; - total_pages?: number; + responses: { + /** @description No response body */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - PaginatedUserPolymorphicList: { - /** @example 123 */ - count: number; - /** - * Format: uri - * @example http://api.example.org/accounts/?page=4 - */ - next?: string | null; - /** - * Format: uri - * @example http://api.example.org/accounts/?page=2 - */ - previous?: string | null; - results: components['schemas']['UserPolymorphic'][]; - page_size?: number; - current_page_number?: number; - total_pages?: number; + }; + alert_receive_channels_start_maintenance_create: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - PatchedAlertReceiveChannelUpdate: { - readonly id?: string; - readonly description?: string | null; - description_short?: string | null; - readonly integration?: components['schemas']['IntegrationEnum']; - readonly smile_code?: string; - verbal_name?: string | null; - readonly author?: string; - readonly organization?: string; - team?: string | null; - /** Format: date-time */ - readonly created_at?: string; - readonly integration_url?: string | null; - readonly alert_count?: number; - readonly alert_groups_count?: number; - allow_source_based_resolving?: boolean; - readonly instructions?: string; - readonly is_able_to_autoresolve?: boolean; - readonly default_channel_filter?: string | null; - readonly demo_alert_enabled?: boolean; - readonly maintenance_mode?: - | (components['schemas']['MaintenanceModeEnum'] | components['schemas']['NullEnum']) - | null; - readonly maintenance_till?: number | null; - readonly heartbeat?: components['schemas']['IntegrationHeartBeat'] | null; - readonly is_available_for_integration_heartbeat?: boolean; - readonly allow_delete?: boolean; - readonly demo_alert_payload?: { - [key: string]: unknown; + requestBody: { + content: { + 'application/json': components['schemas']['AlertReceiveChannelStartMaintenance']; + 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelStartMaintenance']; + 'multipart/form-data': components['schemas']['AlertReceiveChannelStartMaintenance']; + }; + }; + responses: { + /** @description No response body */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + alert_receive_channels_status_options_retrieve: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; }; - readonly routes_count?: number; - readonly connected_escalations_chains_count?: number; - readonly is_based_on_alertmanager?: boolean; - readonly inbound_email?: string; - readonly is_legacy?: boolean; - labels?: components['schemas']['LabelPair'][]; - alert_group_labels?: components['schemas']['IntegrationAlertGroupLabels']; - /** Format: date-time */ - readonly alertmanager_v2_migrated_at?: string | null; - additional_settings?: components['schemas']['AdditionalSettingsField'] | null; + cookie?: never; }; - PatchedUser: { - readonly pk?: string; - readonly organization?: components['schemas']['FastOrganization']; - current_team?: string | null; - /** Format: email */ - readonly email?: string; - readonly username?: string; - readonly name?: string; - readonly role?: components['schemas']['RoleEnum']; - /** Format: uri */ - readonly avatar?: string; - readonly avatar_full?: string; - timezone?: string | null; - working_hours?: components['schemas']['WorkingHours']; - unverified_phone_number?: string | null; - /** @description Use property to highlight that _verified_phone_number should not be modified directly */ - readonly verified_phone_number?: string | null; - readonly slack_user_identity?: components['schemas']['SlackUserIdentity']; - readonly telegram_configuration?: components['schemas']['TelegramToUserConnector']; - readonly messaging_backends?: { - [key: string]: { - [key: string]: unknown; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': string[][]; }; }; - readonly notification_chain_verbal?: { - default: string; - important: string; + }; + }; + alert_receive_channels_stop_maintenance_create: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; }; - readonly cloud_connection_status?: components['schemas']['CloudConnectionStatusEnum'] | null; - hide_phone_number?: boolean; - readonly has_google_oauth2_connected?: boolean; - readonly is_currently_oncall?: boolean; - google_calendar_settings?: components['schemas']['GoogleCalendarSettings']; + cookie?: never; }; - PatchedWebhook: { - readonly id?: string; - name?: string | null; - is_webhook_enabled?: boolean | null; - is_legacy?: boolean | null; - team?: string | null; - username?: string | null; - password?: string | null; - authorization_header?: string | null; - trigger_template?: string | null; - headers?: string | null; - url?: string | null; - data?: string | null; - forward_all?: boolean | null; - http_method?: string | null; - trigger_type?: string | null; - readonly trigger_type_name?: string; - readonly last_response_log?: string; - integration_filter?: string[]; - preset?: string | null; - labels?: components['schemas']['LabelPair'][]; + requestBody?: never; + responses: { + /** @description No response body */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - PreviewTemplateRequest: { - template_body?: string | null; - template_name?: string | null; - payload?: { - [key: string]: unknown; - } | null; + }; + alert_receive_channels_test_connection_create_2: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - PreviewTemplateResponse: { - preview: string | null; - is_valid_json_object: boolean; + requestBody?: { + content: { + 'application/json': components['schemas']['AlertReceiveChannelUpdate']; + 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelUpdate']; + 'multipart/form-data': components['schemas']['AlertReceiveChannelUpdate']; + }; }; - /** - * @description * `0` - source - * * `1` - user - * * `2` - not yet - * * `3` - last escalation step - * * `4` - archived - * * `5` - wiped - * * `6` - stop maintenance - * * `7` - not yet, autoresolve disabled - * @enum {integer} - */ - ResolvedByEnum: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7; - /** - * @description * `0` - ADMIN - * * `1` - EDITOR - * * `2` - VIEWER - * * `3` - NONE - * @enum {integer} - */ - RoleEnum: 0 | 1 | 2 | 3; - Settings: { - instance_url: string; - username: string; - password: string; - /** @default { - * "firing": null, - * "acknowledged": null, - * "resolved": null, - * "silenced": null - * } */ - state_mapping: components['schemas']['StateMapping']; - /** @default false */ - is_configured: boolean; + responses: { + /** @description No response body */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - ShortAlertGroup: { - readonly pk: string; - readonly render_for_web: - | { - title: string; - message: string; - image_url: string | null; - source_link: string | null; - } - | Record; - alert_receive_channel: components['schemas']['FastAlertReceiveChannel']; - readonly inside_organization_number: number; + }; + alert_receive_channels_webhooks_list: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - SlackUserIdentity: { - readonly slack_login: string; - readonly slack_id: string; - readonly avatar: string; - readonly name: string; - readonly display_name: string | null; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['Webhook'][]; + }; + }; }; - StateMapping: { - firing: unknown[] | null; - acknowledged: unknown[] | null; - resolved: unknown[] | null; - silenced: unknown[] | null; + }; + alert_receive_channels_webhooks_create: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + }; + cookie?: never; }; - TelegramToUserConnector: { - telegram_nick_name?: string | null; - /** Format: int64 */ - telegram_chat_id: number; + requestBody: { + content: { + 'application/json': components['schemas']['Webhook']; + 'application/x-www-form-urlencoded': components['schemas']['Webhook']; + 'multipart/form-data': components['schemas']['Webhook']; + }; }; - /** - * @description * `60` - 1 minute - * * `120` - 2 minutes - * * `180` - 3 minutes - * * `300` - 5 minutes - * * `600` - 10 minutes - * * `900` - 15 minutes - * * `1800` - 30 minutes - * * `3600` - 1 hour - * * `43200` - 12 hours - * * `86400` - 1 day - * @enum {integer} - */ - TimeoutSecondsEnum: 60 | 120 | 180 | 300 | 600 | 900 | 1800 | 3600 | 43200 | 86400; - User: CustomApiSchemas['User'] & { - readonly pk: string; - readonly organization: components['schemas']['FastOrganization']; - current_team?: string | null; - /** Format: email */ - readonly email: string; - readonly username: string; - readonly name: string; - readonly role: components['schemas']['RoleEnum']; - /** Format: uri */ - readonly avatar: string; - readonly avatar_full: string; - timezone?: string | null; - working_hours?: components['schemas']['WorkingHours']; - unverified_phone_number?: string | null; - /** @description Use property to highlight that _verified_phone_number should not be modified directly */ - readonly verified_phone_number: string | null; - readonly slack_user_identity: components['schemas']['SlackUserIdentity']; - readonly telegram_configuration: components['schemas']['TelegramToUserConnector']; - readonly messaging_backends: { - [key: string]: { - [key: string]: unknown; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['Webhook']; }; }; - readonly notification_chain_verbal: { - default: string; - important: string; + }; + }; + alert_receive_channels_webhooks_update: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + webhook_id: string; }; - readonly cloud_connection_status: components['schemas']['CloudConnectionStatusEnum'] | null; - hide_phone_number?: boolean; - readonly has_google_oauth2_connected: boolean; - readonly is_currently_oncall: boolean; - google_calendar_settings?: components['schemas']['GoogleCalendarSettings']; - }; - UserExportTokenGetResponse: { - /** Format: date-time */ - created_at: string; - /** Format: date-time */ - revoked_at: string | null; - active: boolean; + cookie?: never; }; - UserExportTokenPostResponse: { - token: string; - /** Format: date-time */ - created_at: string; - export_url: string; + requestBody: { + content: { + 'application/json': components['schemas']['Webhook']; + 'application/x-www-form-urlencoded': components['schemas']['Webhook']; + 'multipart/form-data': components['schemas']['Webhook']; + }; }; - UserFilters: { - name: string; - type: string; - href?: string; - global?: boolean; - default?: { - [key: string]: unknown; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['Webhook']; + }; }; - description?: string; - options: components['schemas']['UserFiltersOptions']; }; - UserFiltersOptions: { - value: string; - display_name: number; + }; + alert_receive_channels_webhooks_destroy: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert receive channel. */ + id: string; + webhook_id: string; + }; + cookie?: never; }; - UserGetTelegramVerificationCode: { - telegram_code: string; - bot_link: string; + requestBody?: never; + responses: { + /** @description No response body */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - UserIsCurrentlyOnCall: { - username: string; - pk: string; - avatar: string; - readonly avatar_full: string; - name: string; - readonly timezone: string | null; - readonly teams: components['schemas']['FastTeam'][]; - readonly is_currently_oncall: boolean; + }; + alert_receive_channels_contact_points_list: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - UserPermission: { - readonly action: string; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['AlertReceiveChannelContactPoints'][]; + }; + }; }; - UserPolymorphic: - | components['schemas']['FilterUser'] - | components['schemas']['UserIsCurrentlyOnCall'] - | components['schemas']['ListUser']; - UserShort: { - username: string; - pk: string; - avatar: string; - readonly avatar_full: string; + }; + alert_receive_channels_counters_retrieve: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - Value: { - id: string; - name: string; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': { + [key: string]: + | { + alerts_count: number; + alert_groups_count: number; + } + | undefined; + }; + }; + }; }; - Webhook: CustomApiSchemas['Webhook'] & { - readonly id: string; - name?: string | null; - is_webhook_enabled?: boolean | null; - is_legacy?: boolean | null; - team?: string | null; - username?: string | null; - password?: string | null; - authorization_header?: string | null; - trigger_template?: string | null; - headers?: string | null; - url?: string | null; - data?: string | null; - forward_all?: boolean | null; - http_method?: string | null; - trigger_type: string | null; - readonly trigger_type_name: string; - readonly last_response_log: string; - integration_filter?: string[]; - preset?: string | null; - labels?: components['schemas']['LabelPair'][]; + }; + alert_receive_channels_filters_list: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - WebhookFilters: { - name: string; - display_name?: string; - type: string; - href: string; - global?: boolean; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['AlertReceiveChannelFilters'][]; + }; + }; }; - WebhookPresetOptions: { - id: string; - name: string; - logo: string; - description: string; - controlled_fields: string[]; + }; + alert_receive_channels_integration_options_list: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - WebhookPreviewTemplateRequest: { - template_body?: string | null; - template_name?: string | null; - payload?: { - [key: string]: unknown; - } | null; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['AlertReceiveChannelIntegrationOptions'][]; + }; + }; }; - WebhookPreviewTemplateResponse: { - preview: string | null; + }; + alert_receive_channels_test_connection_create: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - WebhookResponse: { - /** Format: date-time */ - timestamp?: string; - url?: string | null; - request_trigger?: string | null; - request_headers?: string | null; - request_data?: string | null; - status_code?: number | null; - content?: string | null; - event_data?: string | null; + requestBody: { + content: { + 'application/json': components['schemas']['AlertReceiveChannel']; + 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannel']; + 'multipart/form-data': components['schemas']['AlertReceiveChannel']; + }; }; - WebhookTriggerManual: { - alert_group: string; + responses: { + /** @description No response body */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - WorkingHours: { - monday: components['schemas']['WorkingHoursPeriod'][]; - tuesday: components['schemas']['WorkingHoursPeriod'][]; - wednesday: components['schemas']['WorkingHoursPeriod'][]; - thursday: components['schemas']['WorkingHoursPeriod'][]; - friday: components['schemas']['WorkingHoursPeriod'][]; - saturday: components['schemas']['WorkingHoursPeriod'][]; - sunday: components['schemas']['WorkingHoursPeriod'][]; + }; + alert_receive_channels_validate_name_retrieve: { + parameters: { + query: { + verbal_name: string; + }; + header?: never; + path?: never; + cookie?: never; }; - WorkingHoursPeriod: { - start: string; - end: string; + requestBody?: never; + responses: { + /** @description No response body */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description No response body */ + 409: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; }; - responses: never; - parameters: never; - requestBodies: never; - headers: never; - pathItems: never; -} -export type $defs = Record; -export interface operations { - alert_receive_channels_list: { + alertgroups_list: { parameters: { query?: { - id_ne?: string[]; - /** @description * `grafana_alerting` - Grafana Alerting - * * `webhook` - Webhook - * * `alertmanager` - Alertmanager - * * `formatted_webhook` - Formatted webhook - * * `kapacitor` - Kapacitor - * * `elastalert` - Elastalert - * * `heartbeat` - Heartbeat - * * `inbound_email` - Inbound Email - * * `maintenance` - Maintenance - * * `manual` - Manual - * * `slack_channel` - Slack Channel - * * `zabbix` - Zabbix - * * `direct_paging` - Direct paging - * * `grafana` - Grafana Legacy Alerting - * * `legacy_alertmanager` - (Legacy) AlertManager - * * `legacy_grafana_alerting` - (Deprecated) Grafana Alerting - * * `servicenow` - ServiceNow - * * `amazon_sns` - Amazon SNS - * * `stackdriver` - Stackdriver - * * `curler` - Curler - * * `datadog` - Datadog - * * `demo` - Demo - * * `fabric` - Fabric - * * `newrelic` - New Relic - * * `pagerduty` - Pagerduty - * * `pingdom` - Pingdom - * * `prtg` - PRTG - * * `sentry` - Sentry - * * `uptimerobot` - UptimeRobot - * * `jira` - Jira - * * `zendesk` - Zendesk - * * `appdynamics` - AppDynamics */ - integration?: ( - | 'alertmanager' - | 'amazon_sns' - | 'appdynamics' - | 'curler' - | 'datadog' - | 'demo' - | 'direct_paging' - | 'elastalert' - | 'fabric' - | 'formatted_webhook' - | 'grafana' - | 'grafana_alerting' - | 'heartbeat' - | 'inbound_email' - | 'jira' - | 'kapacitor' - | 'legacy_alertmanager' - | 'legacy_grafana_alerting' - | 'maintenance' - | 'manual' - | 'newrelic' - | 'pagerduty' - | 'pingdom' - | 'prtg' - | 'sentry' - | 'servicenow' - | 'slack_channel' - | 'stackdriver' - | 'uptimerobot' - | 'webhook' - | 'zabbix' - | 'zendesk' - )[]; - /** @description * `grafana_alerting` - Grafana Alerting - * * `webhook` - Webhook - * * `alertmanager` - Alertmanager - * * `formatted_webhook` - Formatted webhook - * * `kapacitor` - Kapacitor - * * `elastalert` - Elastalert - * * `heartbeat` - Heartbeat - * * `inbound_email` - Inbound Email - * * `maintenance` - Maintenance - * * `manual` - Manual - * * `slack_channel` - Slack Channel - * * `zabbix` - Zabbix - * * `direct_paging` - Direct paging - * * `grafana` - Grafana Legacy Alerting - * * `legacy_alertmanager` - (Legacy) AlertManager - * * `legacy_grafana_alerting` - (Deprecated) Grafana Alerting - * * `servicenow` - ServiceNow - * * `amazon_sns` - Amazon SNS - * * `stackdriver` - Stackdriver - * * `curler` - Curler - * * `datadog` - Datadog - * * `demo` - Demo - * * `fabric` - Fabric - * * `newrelic` - New Relic - * * `pagerduty` - Pagerduty - * * `pingdom` - Pingdom - * * `prtg` - PRTG - * * `sentry` - Sentry - * * `uptimerobot` - UptimeRobot - * * `jira` - Jira - * * `zendesk` - Zendesk - * * `appdynamics` - AppDynamics */ - integration_ne?: ( - | 'alertmanager' - | 'amazon_sns' - | 'appdynamics' - | 'curler' - | 'datadog' - | 'demo' - | 'direct_paging' - | 'elastalert' - | 'fabric' - | 'formatted_webhook' - | 'grafana' - | 'grafana_alerting' - | 'heartbeat' - | 'inbound_email' - | 'jira' - | 'kapacitor' - | 'legacy_alertmanager' - | 'legacy_grafana_alerting' - | 'maintenance' - | 'manual' - | 'newrelic' - | 'pagerduty' - | 'pingdom' - | 'prtg' - | 'sentry' - | 'servicenow' - | 'slack_channel' - | 'stackdriver' - | 'uptimerobot' - | 'webhook' - | 'zabbix' - | 'zendesk' - )[]; - /** @description * `0` - Debug - * * `1` - Maintenance */ - maintenance_mode?: (0 | 1 | null)[]; - /** @description A page number within the paginated result set. */ - page?: number; + acknowledged_by?: string[]; + /** @description The pagination cursor value. */ + cursor?: string; + escalation_chain?: string[]; + integration?: string[]; + invitees_are?: string[]; + involved_users_are?: string[]; + is_root?: boolean; + mine?: boolean; /** @description Number of results to return per page. */ perpage?: number; + resolved_at?: string; + resolved_by?: string[]; /** @description A search term. */ search?: string; - team?: string[]; + silenced_by?: string[]; + started_at?: string; + /** @description * `0` - New + * * `1` - Acknowledged + * * `2` - Resolved + * * `3` - Silenced */ + status?: (0 | 1 | 2 | 3)[]; + with_resolution_note?: boolean; }; header?: never; path?: never; @@ -2748,42 +4223,60 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['PaginatedAlertReceiveChannelPolymorphicList']; + 'application/json': components['schemas']['PaginatedAlertGroupListList']; }; }; }; }; - alert_receive_channels_create: { + alertgroups_retrieve: { parameters: { query?: never; header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': components['schemas']['AlertReceiveChannelCreate']; - 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelCreate']; - 'multipart/form-data': components['schemas']['AlertReceiveChannelCreate']; + path: { + /** @description A string identifying this alert group. */ + id: string; }; + cookie?: never; }; + requestBody?: never; responses: { - 201: { + 200: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertReceiveChannelCreate']; + 'application/json': components['schemas']['AlertGroup']; }; }; }; }; - alert_receive_channels_retrieve: { + alertgroups_destroy: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this alert group. */ + id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No response body */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + alertgroups_acknowledge_create: { + parameters: { + query?: never; + header?: never; + path: { + /** @description A string identifying this alert group. */ id: string; }; cookie?: never; @@ -2795,26 +4288,26 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertReceiveChannel']; + 'application/json': components['schemas']['AlertGroup']; }; }; }; }; - alert_receive_channels_update: { + alertgroups_attach_create: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this alert group. */ id: string; }; cookie?: never; }; - requestBody?: { + requestBody: { content: { - 'application/json': components['schemas']['AlertReceiveChannelUpdate']; - 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelUpdate']; - 'multipart/form-data': components['schemas']['AlertReceiveChannelUpdate']; + 'application/json': components['schemas']['AlertGroupAttach']; + 'application/x-www-form-urlencoded': components['schemas']['AlertGroupAttach']; + 'multipart/form-data': components['schemas']['AlertGroupAttach']; }; }; responses: { @@ -2823,47 +4316,48 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertReceiveChannelUpdate']; + 'application/json': components['schemas']['AlertGroup']; }; }; }; }; - alert_receive_channels_destroy: { + alertgroups_escalation_snapshot_retrieve: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this alert group. */ id: string; }; cookie?: never; }; requestBody?: never; responses: { - /** @description No response body */ - 204: { + 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['AlertGroupEscalationSnapshotAPI']; + }; }; }; }; - alert_receive_channels_partial_update: { + alertgroups_preview_template_create: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this alert group. */ id: string; }; cookie?: never; }; requestBody?: { content: { - 'application/json': components['schemas']['PatchedAlertReceiveChannelUpdate']; - 'application/x-www-form-urlencoded': components['schemas']['PatchedAlertReceiveChannelUpdate']; - 'multipart/form-data': components['schemas']['PatchedAlertReceiveChannelUpdate']; + 'application/json': components['schemas']['PreviewTemplateRequest']; + 'application/x-www-form-urlencoded': components['schemas']['PreviewTemplateRequest']; + 'multipart/form-data': components['schemas']['PreviewTemplateRequest']; }; }; responses: { @@ -2872,110 +4366,145 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertReceiveChannelUpdate']; + 'application/json': components['schemas']['PreviewTemplateResponse']; }; }; }; }; - alert_receive_channels_api_token_retrieve: { + alertgroups_resolve_create: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this alert group. */ id: string; }; cookie?: never; }; - requestBody?: never; + requestBody?: { + content: { + 'application/json': components['schemas']['AlertGroupResolve']; + 'application/x-www-form-urlencoded': components['schemas']['AlertGroupResolve']; + 'multipart/form-data': components['schemas']['AlertGroupResolve']; + }; + }; responses: { - /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['AlertGroup']; + }; }; }; }; - alert_receive_channels_api_token_create: { + alertgroups_silence_create: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this alert group. */ id: string; }; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + 'application/json': components['schemas']['AlertGroupSilence']; + 'application/x-www-form-urlencoded': components['schemas']['AlertGroupSilence']; + 'multipart/form-data': components['schemas']['AlertGroupSilence']; + }; + }; responses: { 200: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['IntegrationTokenPostResponse']; + 'application/json': components['schemas']['AlertGroup']; }; }; }; }; - alert_receive_channels_change_team_update: { + alertgroups_unacknowledge_create: { parameters: { - query: { - team_id: string; + query?: never; + header?: never; + path: { + /** @description A string identifying this alert group. */ + id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['AlertGroup']; + }; }; + }; + }; + alertgroups_unattach_create: { + parameters: { + query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this alert group. */ id: string; }; cookie?: never; }; requestBody?: never; responses: { - /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['AlertGroup']; + }; }; }; }; - alert_receive_channels_connect_contact_point_create: { + alertgroups_unpage_user_create: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this alert group. */ id: string; }; cookie?: never; }; requestBody: { content: { - 'application/json': components['schemas']['AlertReceiveChannelConnectContactPoint']; - 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelConnectContactPoint']; - 'multipart/form-data': components['schemas']['AlertReceiveChannelConnectContactPoint']; + 'application/json': components['schemas']['AlertGroupUnpageUser']; + 'application/x-www-form-urlencoded': components['schemas']['AlertGroupUnpageUser']; + 'multipart/form-data': components['schemas']['AlertGroupUnpageUser']; }; }; responses: { - /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['AlertGroup']; + }; }; }; }; - alert_receive_channels_connected_alert_receive_channels_retrieve: { + alertgroups_unresolve_create: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this alert group. */ id: string; }; cookie?: never; @@ -2987,98 +4516,81 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertReceiveChannelConnection']; + 'application/json': components['schemas']['AlertGroup']; }; }; }; }; - alert_receive_channels_connected_alert_receive_channels_create: { + alertgroups_unsilence_create: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this alert group. */ id: string; }; cookie?: never; }; - requestBody: { - content: { - 'application/json': components['schemas']['AlertReceiveChannelNewConnection'][]; - 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelNewConnection'][]; - 'multipart/form-data': components['schemas']['AlertReceiveChannelNewConnection'][]; - }; - }; + requestBody?: never; responses: { 200: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertReceiveChannelConnection']; + 'application/json': components['schemas']['AlertGroup']; }; }; }; }; - alert_receive_channels_connected_alert_receive_channels_update: { + alertgroups_bulk_action_create: { parameters: { query?: never; header?: never; - path: { - connected_alert_receive_channel_id: string; - /** @description A string identifying this alert receive channel. */ - id: string; - }; + path?: never; cookie?: never; }; requestBody: { content: { - 'application/json': components['schemas']['AlertReceiveChannelConnectedChannel']; - 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelConnectedChannel']; - 'multipart/form-data': components['schemas']['AlertReceiveChannelConnectedChannel']; + 'application/json': components['schemas']['AlertGroupBulkActionRequest']; + 'application/x-www-form-urlencoded': components['schemas']['AlertGroupBulkActionRequest']; + 'multipart/form-data': components['schemas']['AlertGroupBulkActionRequest']; }; }; responses: { + /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content: { - 'application/json': components['schemas']['AlertReceiveChannelConnectedChannel']; - }; + content?: never; }; }; }; - alert_receive_channels_connected_alert_receive_channels_destroy: { + alertgroups_bulk_action_options_list: { parameters: { query?: never; header?: never; - path: { - connected_alert_receive_channel_id: string; - /** @description A string identifying this alert receive channel. */ - id: string; - }; + path?: never; cookie?: never; }; requestBody?: never; responses: { - /** @description No response body */ - 204: { + 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['AlertGroupBulkActionOptions'][]; + }; }; }; }; - alert_receive_channels_connected_contact_points_list: { + alertgroups_filters_list: { parameters: { query?: never; header?: never; - path: { - /** @description A string identifying this alert receive channel. */ - id: string; - }; + path?: never; cookie?: never; }; requestBody?: never; @@ -3088,18 +4600,17 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertReceiveChannelConnectedContactPoints'][]; + 'application/json': components['schemas']['AlertGroupFilters'][]; }; }; }; }; - alert_receive_channels_counters_per_integration_retrieve: { + alertgroups_labels_id_retrieve: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ - id: string; + key_id: string; }; cookie?: never; }; @@ -3110,201 +4621,190 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': { - [key: string]: { - alerts_count: number; - alert_groups_count: number; - }; - }; + 'application/json': components['schemas']['LabelOption']; }; }; }; }; - alert_receive_channels_create_contact_point_create: { + alertgroups_labels_keys_list: { parameters: { query?: never; header?: never; - path: { - /** @description A string identifying this alert receive channel. */ - id: string; - }; + path?: never; cookie?: never; }; - requestBody: { - content: { - 'application/json': components['schemas']['AlertReceiveChannelCreateContactPoint']; - 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelCreateContactPoint']; - 'multipart/form-data': components['schemas']['AlertReceiveChannelCreateContactPoint']; - }; - }; + requestBody?: never; responses: { - /** @description No response body */ - 201: { + 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['LabelKey'][]; + }; }; }; }; - alert_receive_channels_disconnect_contact_point_create: { + alertgroups_silence_options_list: { parameters: { query?: never; header?: never; - path: { - /** @description A string identifying this alert receive channel. */ - id: string; - }; + path?: never; cookie?: never; }; - requestBody: { - content: { - 'application/json': components['schemas']['AlertReceiveChannelDisconnectContactPoint']; - 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelDisconnectContactPoint']; - 'multipart/form-data': components['schemas']['AlertReceiveChannelDisconnectContactPoint']; - }; - }; + requestBody?: never; responses: { - /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['AlertGroupSilenceOptions'][]; + }; }; }; }; - alert_receive_channels_migrate_create: { + alertgroups_stats_retrieve: { parameters: { - query?: never; - header?: never; - path: { - /** @description A string identifying this alert receive channel. */ - id: string; + query?: { + acknowledged_by?: string[]; + escalation_chain?: string[]; + integration?: string[]; + invitees_are?: string[]; + involved_users_are?: string[]; + is_root?: boolean; + mine?: boolean; + resolved_at?: string; + resolved_by?: string[]; + /** @description A search term. */ + search?: string; + silenced_by?: string[]; + started_at?: string; + /** @description * `0` - New + * * `1` - Acknowledged + * * `2` - Resolved + * * `3` - Silenced */ + status?: (0 | 1 | 2 | 3)[]; + with_resolution_note?: boolean; }; + header?: never; + path?: never; cookie?: never; }; requestBody?: never; responses: { - /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['AlertGroupStats']; + }; }; }; }; - alert_receive_channels_preview_template_create: { + channel_filters_list: { parameters: { - query?: never; - header?: never; - path: { - /** @description A string identifying this alert receive channel. */ - id: string; + query?: { + alert_receive_channel?: string[]; }; + header?: never; + path?: never; cookie?: never; }; - requestBody?: { - content: { - 'application/json': components['schemas']['PreviewTemplateRequest']; - 'application/x-www-form-urlencoded': components['schemas']['PreviewTemplateRequest']; - 'multipart/form-data': components['schemas']['PreviewTemplateRequest']; - }; - }; + requestBody?: never; responses: { 200: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['PreviewTemplateResponse']; + 'application/json': components['schemas']['ChannelFilter'][]; }; }; }; }; - alert_receive_channels_send_demo_alert_create: { + channel_filters_create: { parameters: { query?: never; header?: never; - path: { - /** @description A string identifying this alert receive channel. */ - id: string; - }; + path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - 'application/json': components['schemas']['AlertReceiveChannelSendDemoAlert']; - 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelSendDemoAlert']; - 'multipart/form-data': components['schemas']['AlertReceiveChannelSendDemoAlert']; + 'application/json': components['schemas']['ChannelFilterCreate']; + 'application/x-www-form-urlencoded': components['schemas']['ChannelFilterCreate']; + 'multipart/form-data': components['schemas']['ChannelFilterCreate']; }; }; responses: { - /** @description No response body */ - 200: { + 201: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['ChannelFilterUpdateResponse']; + }; }; }; }; - alert_receive_channels_start_maintenance_create: { + channel_filters_retrieve: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this channel filter. */ id: string; }; cookie?: never; }; - requestBody: { - content: { - 'application/json': components['schemas']['AlertReceiveChannelStartMaintenance']; - 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelStartMaintenance']; - 'multipart/form-data': components['schemas']['AlertReceiveChannelStartMaintenance']; - }; - }; + requestBody?: never; responses: { - /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['ChannelFilter']; + }; }; }; }; - alert_receive_channels_status_options_retrieve: { + channel_filters_update: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this channel filter. */ id: string; }; cookie?: never; }; - requestBody?: never; + requestBody?: { + content: { + 'application/json': components['schemas']['ChannelFilterUpdate']; + 'application/x-www-form-urlencoded': components['schemas']['ChannelFilterUpdate']; + 'multipart/form-data': components['schemas']['ChannelFilterUpdate']; + }; + }; responses: { 200: { headers: { [name: string]: unknown; }; content: { - 'application/json': string[][]; + 'application/json': components['schemas']['ChannelFilterUpdateResponse']; }; }; }; }; - alert_receive_channels_stop_maintenance_create: { + channel_filters_destroy: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this channel filter. */ id: string; }; cookie?: never; @@ -3312,7 +4812,7 @@ export interface operations { requestBody?: never; responses: { /** @description No response body */ - 200: { + 204: { headers: { [name: string]: unknown; }; @@ -3320,127 +4820,90 @@ export interface operations { }; }; }; - alert_receive_channels_test_connection_create_2: { + channel_filters_partial_update: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this channel filter. */ id: string; }; cookie?: never; }; requestBody?: { content: { - 'application/json': components['schemas']['AlertReceiveChannelUpdate']; - 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannelUpdate']; - 'multipart/form-data': components['schemas']['AlertReceiveChannelUpdate']; - }; - }; - responses: { - /** @description No response body */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - alert_receive_channels_webhooks_list: { - parameters: { - query?: never; - header?: never; - path: { - /** @description A string identifying this alert receive channel. */ - id: string; + 'application/json': components['schemas']['PatchedChannelFilterUpdate']; + 'application/x-www-form-urlencoded': components['schemas']['PatchedChannelFilterUpdate']; + 'multipart/form-data': components['schemas']['PatchedChannelFilterUpdate']; }; - cookie?: never; }; - requestBody?: never; responses: { 200: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['Webhook'][]; + 'application/json': components['schemas']['ChannelFilterUpdateResponse']; }; }; }; }; - alert_receive_channels_webhooks_create: { + channel_filters_convert_from_regex_to_jinja2_create: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this channel filter. */ id: string; }; cookie?: never; }; - requestBody: { - content: { - 'application/json': components['schemas']['Webhook']; - 'application/x-www-form-urlencoded': components['schemas']['Webhook']; - 'multipart/form-data': components['schemas']['Webhook']; - }; - }; + requestBody?: never; responses: { 200: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['Webhook']; + 'application/json': components['schemas']['ChannelFilter']; }; }; }; }; - alert_receive_channels_webhooks_update: { + channel_filters_move_to_position_update: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ + /** @description A string identifying this channel filter. */ id: string; - webhook_id: string; }; cookie?: never; }; - requestBody: { - content: { - 'application/json': components['schemas']['Webhook']; - 'application/x-www-form-urlencoded': components['schemas']['Webhook']; - 'multipart/form-data': components['schemas']['Webhook']; - }; - }; + requestBody?: never; responses: { + /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content: { - 'application/json': components['schemas']['Webhook']; - }; + content?: never; }; }; }; - alert_receive_channels_webhooks_destroy: { + complete_retrieve: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert receive channel. */ - id: string; - webhook_id: string; + backend: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description No response body */ - 204: { + 200: { headers: { [name: string]: unknown; }; @@ -3448,28 +4911,33 @@ export interface operations { }; }; }; - alert_receive_channels_contact_points_list: { + disconnect_retrieve: { parameters: { query?: never; header?: never; - path?: never; + path: { + backend: string; + }; cookie?: never; }; requestBody?: never; responses: { + /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content: { - 'application/json': components['schemas']['AlertReceiveChannelContactPoints'][]; - }; + content?: never; }; }; }; - alert_receive_channels_counters_retrieve: { + escalation_chains_list: { parameters: { - query?: never; + query?: { + /** @description A search term. */ + search?: string; + team?: string[]; + }; header?: never; path?: never; cookie?: never; @@ -3481,40 +4949,44 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': { - [key: string]: { - alerts_count: number; - alert_groups_count: number; - }; - }; + 'application/json': components['schemas']['EscalationChainPolymorphic'][]; }; }; }; }; - alert_receive_channels_filters_list: { + escalation_chains_create: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + 'application/json': components['schemas']['EscalationChain']; + 'application/x-www-form-urlencoded': components['schemas']['EscalationChain']; + 'multipart/form-data': components['schemas']['EscalationChain']; + }; + }; responses: { - 200: { + 201: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertReceiveChannelFilters'][]; + 'application/json': components['schemas']['EscalationChain']; }; }; }; }; - alert_receive_channels_integration_options_list: { + escalation_chains_retrieve: { parameters: { query?: never; header?: never; - path?: never; + path: { + /** @description A string identifying this escalation chain. */ + id: string; + }; cookie?: never; }; requestBody?: never; @@ -3524,55 +4996,53 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertReceiveChannelIntegrationOptions'][]; + 'application/json': components['schemas']['EscalationChainList']; }; }; }; }; - alert_receive_channels_test_connection_create: { + escalation_chains_update: { parameters: { query?: never; header?: never; - path?: never; + path: { + /** @description A string identifying this escalation chain. */ + id: string; + }; cookie?: never; }; requestBody: { content: { - 'application/json': components['schemas']['AlertReceiveChannel']; - 'application/x-www-form-urlencoded': components['schemas']['AlertReceiveChannel']; - 'multipart/form-data': components['schemas']['AlertReceiveChannel']; + 'application/json': components['schemas']['EscalationChain']; + 'application/x-www-form-urlencoded': components['schemas']['EscalationChain']; + 'multipart/form-data': components['schemas']['EscalationChain']; }; }; responses: { - /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['EscalationChain']; + }; }; }; }; - alert_receive_channels_validate_name_retrieve: { + escalation_chains_destroy: { parameters: { - query: { - verbal_name: string; - }; + query?: never; header?: never; - path?: never; + path: { + /** @description A string identifying this escalation chain. */ + id: string; + }; cookie?: never; }; requestBody?: never; responses: { /** @description No response body */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description No response body */ - 409: { + 204: { headers: { [name: string]: unknown; }; @@ -3580,55 +5050,40 @@ export interface operations { }; }; }; - alertgroups_list: { + escalation_chains_partial_update: { parameters: { - query?: { - acknowledged_by?: string[]; - /** @description The pagination cursor value. */ - cursor?: string; - escalation_chain?: string[]; - integration?: string[]; - invitees_are?: string[]; - involved_users_are?: string[]; - is_root?: boolean; - mine?: boolean; - /** @description Number of results to return per page. */ - perpage?: number; - resolved_at?: string; - resolved_by?: string[]; - /** @description A search term. */ - search?: string; - silenced_by?: string[]; - started_at?: string; - /** @description * `0` - New - * * `1` - Acknowledged - * * `2` - Resolved - * * `3` - Silenced */ - status?: (0 | 1 | 2 | 3)[]; - with_resolution_note?: boolean; - }; + query?: never; header?: never; - path?: never; + path: { + /** @description A string identifying this escalation chain. */ + id: string; + }; cookie?: never; }; - requestBody?: never; + requestBody?: { + content: { + 'application/json': components['schemas']['PatchedEscalationChain']; + 'application/x-www-form-urlencoded': components['schemas']['PatchedEscalationChain']; + 'multipart/form-data': components['schemas']['PatchedEscalationChain']; + }; + }; responses: { 200: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['PaginatedAlertGroupListList']; + 'application/json': components['schemas']['EscalationChain']; }; }; }; }; - alertgroups_retrieve: { + escalation_chains_copy_create: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert group. */ + /** @description A string identifying this escalation chain. */ id: string; }; cookie?: never; @@ -3640,40 +5095,62 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertGroup']; + 'application/json': components['schemas']['EscalationChain']; }; }; }; }; - alertgroups_destroy: { + escalation_chains_details_list: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert group. */ + /** @description A string identifying this escalation chain. */ id: string; }; cookie?: never; }; requestBody?: never; responses: { - /** @description No response body */ - 204: { + 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['EscalationChainDetails'][]; + }; }; }; }; - alertgroups_acknowledge_create: { + escalation_chains_filters_list: { parameters: { query?: never; header?: never; - path: { - /** @description A string identifying this alert group. */ - id: string; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['EscalationChainFilters'][]; + }; + }; + }; + }; + escalation_policies_list: { + parameters: { + query?: { + channel_filter?: string; + escalation_chain?: string; + slack_channel?: string; + user?: string; }; + header?: never; + path?: never; cookie?: never; }; requestBody?: never; @@ -3683,75 +5160,73 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertGroup']; + 'application/json': components['schemas']['EscalationPolicy'][]; }; }; }; }; - alertgroups_attach_create: { + escalation_policies_create: { parameters: { query?: never; header?: never; - path: { - /** @description A string identifying this alert group. */ - id: string; - }; + path?: never; cookie?: never; }; requestBody: { content: { - 'application/json': components['schemas']['AlertGroupAttach']; - 'application/x-www-form-urlencoded': components['schemas']['AlertGroupAttach']; - 'multipart/form-data': components['schemas']['AlertGroupAttach']; + 'application/json': components['schemas']['EscalationPolicyCreate']; + 'application/x-www-form-urlencoded': components['schemas']['EscalationPolicyCreate']; + 'multipart/form-data': components['schemas']['EscalationPolicyCreate']; }; }; responses: { - 200: { + 201: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertGroup']; + 'application/json': components['schemas']['EscalationPolicyCreate']; }; }; }; }; - alertgroups_escalation_snapshot_retrieve: { + escalation_policies_retrieve: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert group. */ + /** @description A string identifying this escalation policy. */ id: string; }; cookie?: never; }; requestBody?: never; responses: { - /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['EscalationPolicy']; + }; }; }; }; - alertgroups_preview_template_create: { + escalation_policies_update: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert group. */ + /** @description A string identifying this escalation policy. */ id: string; }; cookie?: never; }; requestBody?: { content: { - 'application/json': components['schemas']['PreviewTemplateRequest']; - 'application/x-www-form-urlencoded': components['schemas']['PreviewTemplateRequest']; - 'multipart/form-data': components['schemas']['PreviewTemplateRequest']; + 'application/json': components['schemas']['EscalationPolicyUpdate']; + 'application/x-www-form-urlencoded': components['schemas']['EscalationPolicyUpdate']; + 'multipart/form-data': components['schemas']['EscalationPolicyUpdate']; }; }; responses: { @@ -3760,54 +5235,47 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['PreviewTemplateResponse']; + 'application/json': components['schemas']['EscalationPolicyUpdate']; }; }; }; }; - alertgroups_resolve_create: { + escalation_policies_destroy: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert group. */ + /** @description A string identifying this escalation policy. */ id: string; }; cookie?: never; }; - requestBody?: { - content: { - 'application/json': components['schemas']['AlertGroupResolve']; - 'application/x-www-form-urlencoded': components['schemas']['AlertGroupResolve']; - 'multipart/form-data': components['schemas']['AlertGroupResolve']; - }; - }; + requestBody?: never; responses: { - 200: { + /** @description No response body */ + 204: { headers: { [name: string]: unknown; }; - content: { - 'application/json': components['schemas']['AlertGroup']; - }; + content?: never; }; }; }; - alertgroups_silence_create: { + escalation_policies_partial_update: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert group. */ + /** @description A string identifying this escalation policy. */ id: string; }; cookie?: never; }; - requestBody: { + requestBody?: { content: { - 'application/json': components['schemas']['AlertGroupSilence']; - 'application/x-www-form-urlencoded': components['schemas']['AlertGroupSilence']; - 'multipart/form-data': components['schemas']['AlertGroupSilence']; + 'application/json': components['schemas']['PatchedEscalationPolicyUpdate']; + 'application/x-www-form-urlencoded': components['schemas']['PatchedEscalationPolicyUpdate']; + 'multipart/form-data': components['schemas']['PatchedEscalationPolicyUpdate']; }; }; responses: { @@ -3816,113 +5284,92 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertGroup']; + 'application/json': components['schemas']['EscalationPolicyUpdate']; }; }; }; }; - alertgroups_unacknowledge_create: { + escalation_policies_move_to_position_update: { parameters: { query?: never; header?: never; path: { - /** @description A string identifying this alert group. */ + /** @description A string identifying this escalation policy. */ id: string; }; cookie?: never; }; requestBody?: never; responses: { + /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content: { - 'application/json': components['schemas']['AlertGroup']; - }; + content?: never; }; }; }; - alertgroups_unattach_create: { + escalation_policies_delay_options_retrieve: { parameters: { query?: never; header?: never; - path: { - /** @description A string identifying this alert group. */ - id: string; - }; + path?: never; cookie?: never; }; requestBody?: never; responses: { + /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content: { - 'application/json': components['schemas']['AlertGroup']; - }; - }; - }; - }; - alertgroups_unpage_user_create: { - parameters: { - query?: never; - header?: never; - path: { - /** @description A string identifying this alert group. */ - id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': components['schemas']['AlertGroupUnpageUser']; - 'application/x-www-form-urlencoded': components['schemas']['AlertGroupUnpageUser']; - 'multipart/form-data': components['schemas']['AlertGroupUnpageUser']; + content?: never; }; }; + }; + escalation_policies_escalation_options_list: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; responses: { 200: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertGroup']; + 'application/json': components['schemas']['EscalationPolicyOptions'][]; }; }; }; }; - alertgroups_unresolve_create: { + escalation_policies_num_minutes_in_window_options_retrieve: { parameters: { query?: never; header?: never; - path: { - /** @description A string identifying this alert group. */ - id: string; - }; + path?: never; cookie?: never; }; requestBody?: never; responses: { + /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content: { - 'application/json': components['schemas']['AlertGroup']; - }; + content?: never; }; }; }; - alertgroups_unsilence_create: { + features_retrieve: { parameters: { query?: never; header?: never; - path: { - /** @description A string identifying this alert group. */ - id: string; - }; + path?: never; cookie?: never; }; requestBody?: never; @@ -3932,12 +5379,23 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertGroup']; + 'application/json': ( + | 'msteams' + | 'slack' + | 'unified_slack' + | 'telegram' + | 'live_settings' + | 'grafana_cloud_notifications' + | 'grafana_cloud_connection' + | 'grafana_alerting_v2' + | 'labels' + | 'google_oauth2' + )[]; }; }; }; }; - alertgroups_bulk_action_create: { + labels_create: { parameters: { query?: never; header?: never; @@ -3946,26 +5404,29 @@ export interface operations { }; requestBody: { content: { - 'application/json': components['schemas']['AlertGroupBulkActionRequest']; - 'application/x-www-form-urlencoded': components['schemas']['AlertGroupBulkActionRequest']; - 'multipart/form-data': components['schemas']['AlertGroupBulkActionRequest']; + 'application/json': components['schemas']['LabelCreate'][]; + 'application/x-www-form-urlencoded': components['schemas']['LabelCreate'][]; + 'multipart/form-data': components['schemas']['LabelCreate'][]; }; }; responses: { - /** @description No response body */ - 200: { + 201: { headers: { [name: string]: unknown; }; - content?: never; + content: { + 'application/json': components['schemas']['LabelOption']; + }; }; }; }; - alertgroups_bulk_action_options_list: { + labels_id_retrieve: { parameters: { query?: never; header?: never; - path?: never; + path: { + key_id: string; + }; cookie?: never; }; requestBody?: never; @@ -3975,31 +5436,39 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertGroupBulkActionOptions'][]; + 'application/json': components['schemas']['LabelOption']; }; }; }; }; - alertgroups_filters_list: { + labels_id_update: { parameters: { query?: never; header?: never; - path?: never; + path: { + key_id: string; + }; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + 'application/json': components['schemas']['LabelRepr']; + 'application/x-www-form-urlencoded': components['schemas']['LabelRepr']; + 'multipart/form-data': components['schemas']['LabelRepr']; + }; + }; responses: { 200: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertGroupFilters'][]; + 'application/json': components['schemas']['LabelOption']; }; }; }; }; - alertgroups_labels_id_retrieve: { + labels_id_values_create: { parameters: { query?: never; header?: never; @@ -4008,7 +5477,13 @@ export interface operations { }; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + 'application/json': components['schemas']['LabelRepr']; + 'application/x-www-form-urlencoded': components['schemas']['LabelRepr']; + 'multipart/form-data': components['schemas']['LabelRepr']; + }; + }; responses: { 200: { headers: { @@ -4020,11 +5495,14 @@ export interface operations { }; }; }; - alertgroups_labels_keys_list: { + labels_id_values_retrieve: { parameters: { query?: never; header?: never; - path?: never; + path: { + key_id: string; + value_id: string; + }; cookie?: never; }; requestBody?: never; @@ -4034,53 +5512,42 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['LabelKey'][]; + 'application/json': components['schemas']['LabelValue']; }; }; }; }; - alertgroups_silence_options_list: { + labels_id_values_update: { parameters: { query?: never; header?: never; - path?: never; + path: { + key_id: string; + value_id: string; + }; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + 'application/json': components['schemas']['LabelRepr']; + 'application/x-www-form-urlencoded': components['schemas']['LabelRepr']; + 'multipart/form-data': components['schemas']['LabelRepr']; + }; + }; responses: { 200: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertGroupSilenceOptions'][]; + 'application/json': components['schemas']['LabelOption']; }; }; }; }; - alertgroups_stats_retrieve: { + labels_keys_list: { parameters: { - query?: { - acknowledged_by?: string[]; - escalation_chain?: string[]; - integration?: string[]; - invitees_are?: string[]; - involved_users_are?: string[]; - is_root?: boolean; - mine?: boolean; - resolved_at?: string; - resolved_by?: string[]; - /** @description A search term. */ - search?: string; - silenced_by?: string[]; - started_at?: string; - /** @description * `0` - New - * * `1` - Acknowledged - * * `2` - Resolved - * * `3` - Silenced */ - status?: (0 | 1 | 2 | 3)[]; - with_resolution_note?: boolean; - }; + query?: never; header?: never; path?: never; cookie?: never; @@ -4092,12 +5559,12 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['AlertGroupStats']; + 'application/json': components['schemas']['LabelKey'][]; }; }; }; }; - complete_retrieve: { + login_retrieve: { parameters: { query?: never; header?: never; @@ -4117,7 +5584,7 @@ export interface operations { }; }; }; - disconnect_retrieve: { + login_retrieve_2: { parameters: { query?: never; header?: never; @@ -4137,9 +5604,12 @@ export interface operations { }; }; }; - features_retrieve: { + notification_policies_list: { parameters: { - query?: never; + query?: { + important?: boolean; + user?: string; + }; header?: never; path?: never; cookie?: never; @@ -4151,34 +5621,23 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': ( - | 'msteams' - | 'slack' - | 'unified_slack' - | 'telegram' - | 'live_settings' - | 'grafana_cloud_notifications' - | 'grafana_cloud_connection' - | 'grafana_alerting_v2' - | 'labels' - | 'google_oauth2' - )[]; + 'application/json': components['schemas']['UserNotificationPolicy'][]; }; }; }; }; - labels_create: { + notification_policies_create: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody: { + requestBody?: { content: { - 'application/json': components['schemas']['LabelCreate'][]; - 'application/x-www-form-urlencoded': components['schemas']['LabelCreate'][]; - 'multipart/form-data': components['schemas']['LabelCreate'][]; + 'application/json': components['schemas']['UserNotificationPolicy']; + 'application/x-www-form-urlencoded': components['schemas']['UserNotificationPolicy']; + 'multipart/form-data': components['schemas']['UserNotificationPolicy']; }; }; responses: { @@ -4187,17 +5646,18 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['LabelOption']; + 'application/json': components['schemas']['UserNotificationPolicy']; }; }; }; }; - labels_id_retrieve: { + notification_policies_retrieve: { parameters: { query?: never; header?: never; path: { - key_id: string; + /** @description A unique integer value identifying this user notification policy. */ + id: number; }; cookie?: never; }; @@ -4208,25 +5668,26 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['LabelOption']; + 'application/json': components['schemas']['UserNotificationPolicy']; }; }; }; }; - labels_id_update: { + notification_policies_update: { parameters: { query?: never; header?: never; path: { - key_id: string; + /** @description A unique integer value identifying this user notification policy. */ + id: number; }; cookie?: never; }; - requestBody: { + requestBody?: { content: { - 'application/json': components['schemas']['LabelRepr']; - 'application/x-www-form-urlencoded': components['schemas']['LabelRepr']; - 'multipart/form-data': components['schemas']['LabelRepr']; + 'application/json': components['schemas']['UserNotificationPolicyUpdate']; + 'application/x-www-form-urlencoded': components['schemas']['UserNotificationPolicyUpdate']; + 'multipart/form-data': components['schemas']['UserNotificationPolicyUpdate']; }; }; responses: { @@ -4235,89 +5696,82 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['LabelOption']; + 'application/json': components['schemas']['UserNotificationPolicyUpdate']; }; }; }; }; - labels_id_values_create: { + notification_policies_destroy: { parameters: { query?: never; header?: never; path: { - key_id: string; + /** @description A unique integer value identifying this user notification policy. */ + id: number; }; cookie?: never; }; - requestBody: { - content: { - 'application/json': components['schemas']['LabelRepr']; - 'application/x-www-form-urlencoded': components['schemas']['LabelRepr']; - 'multipart/form-data': components['schemas']['LabelRepr']; - }; - }; + requestBody?: never; responses: { - 200: { + /** @description No response body */ + 204: { headers: { [name: string]: unknown; }; - content: { - 'application/json': components['schemas']['LabelOption']; - }; + content?: never; }; }; }; - labels_id_values_retrieve: { + notification_policies_partial_update: { parameters: { query?: never; header?: never; path: { - key_id: string; - value_id: string; + /** @description A unique integer value identifying this user notification policy. */ + id: number; }; cookie?: never; }; - requestBody?: never; + requestBody?: { + content: { + 'application/json': components['schemas']['PatchedUserNotificationPolicyUpdate']; + 'application/x-www-form-urlencoded': components['schemas']['PatchedUserNotificationPolicyUpdate']; + 'multipart/form-data': components['schemas']['PatchedUserNotificationPolicyUpdate']; + }; + }; responses: { 200: { headers: { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['LabelValue']; + 'application/json': components['schemas']['UserNotificationPolicyUpdate']; }; }; }; }; - labels_id_values_update: { + notification_policies_move_to_position_update: { parameters: { query?: never; header?: never; path: { - key_id: string; - value_id: string; + /** @description A unique integer value identifying this user notification policy. */ + id: number; }; cookie?: never; }; - requestBody: { - content: { - 'application/json': components['schemas']['LabelRepr']; - 'application/x-www-form-urlencoded': components['schemas']['LabelRepr']; - 'multipart/form-data': components['schemas']['LabelRepr']; - }; - }; + requestBody?: never; responses: { + /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content: { - 'application/json': components['schemas']['LabelOption']; - }; + content?: never; }; }; }; - labels_keys_list: { + notification_policies_delay_options_list: { parameters: { query?: never; header?: never; @@ -4331,48 +5785,27 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['LabelKey'][]; + 'application/json': components['schemas']['UserNotificationPolicyDelayOptions'][]; }; }; }; }; - login_retrieve: { + notification_policies_notify_by_options_list: { parameters: { query?: never; header?: never; - path: { - backend: string; - }; + path?: never; cookie?: never; }; requestBody?: never; responses: { - /** @description No response body */ 200: { headers: { [name: string]: unknown; }; - content?: never; - }; - }; - }; - login_retrieve_2: { - parameters: { - query?: never; - header?: never; - path: { - backend: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description No response body */ - 200: { - headers: { - [name: string]: unknown; + content: { + 'application/json': components['schemas']['UserNotificationPolicyNotifyByOptions'][]; }; - content?: never; }; }; };