authentik.enterprise.providers.google_workspace.api.groups
GoogleWorkspaceProviderGroup API Views
1"""GoogleWorkspaceProviderGroup API Views""" 2 3from rest_framework import mixins 4from rest_framework.viewsets import GenericViewSet 5 6from authentik.core.api.used_by import UsedByMixin 7from authentik.core.api.users import PartialGroupSerializer 8from authentik.core.api.utils import ModelSerializer 9from authentik.enterprise.providers.google_workspace.models import GoogleWorkspaceProviderGroup 10from authentik.lib.sync.outgoing.api import OutgoingSyncConnectionCreateMixin 11 12 13class GoogleWorkspaceProviderGroupSerializer(ModelSerializer): 14 """GoogleWorkspaceProviderGroup Serializer""" 15 16 group_obj = PartialGroupSerializer(source="group", read_only=True) 17 18 class Meta: 19 20 model = GoogleWorkspaceProviderGroup 21 fields = [ 22 "id", 23 "google_id", 24 "group", 25 "group_obj", 26 "provider", 27 "attributes", 28 ] 29 extra_kwargs = {"attributes": {"read_only": True}} 30 31 32class GoogleWorkspaceProviderGroupViewSet( 33 mixins.CreateModelMixin, 34 OutgoingSyncConnectionCreateMixin, 35 mixins.RetrieveModelMixin, 36 mixins.DestroyModelMixin, 37 UsedByMixin, 38 mixins.ListModelMixin, 39 GenericViewSet, 40): 41 """GoogleWorkspaceProviderGroup Viewset""" 42 43 queryset = GoogleWorkspaceProviderGroup.objects.all().select_related("group") 44 serializer_class = GoogleWorkspaceProviderGroupSerializer 45 filterset_fields = ["provider__id", "group__name", "group__group_uuid"] 46 search_fields = ["provider__name", "group__name"] 47 ordering = ["group__name"]
14class GoogleWorkspaceProviderGroupSerializer(ModelSerializer): 15 """GoogleWorkspaceProviderGroup Serializer""" 16 17 group_obj = PartialGroupSerializer(source="group", read_only=True) 18 19 class Meta: 20 21 model = GoogleWorkspaceProviderGroup 22 fields = [ 23 "id", 24 "google_id", 25 "group", 26 "group_obj", 27 "provider", 28 "attributes", 29 ] 30 extra_kwargs = {"attributes": {"read_only": True}}
GoogleWorkspaceProviderGroup Serializer
Inherited Members
class
GoogleWorkspaceProviderGroupSerializer.Meta:
19 class Meta: 20 21 model = GoogleWorkspaceProviderGroup 22 fields = [ 23 "id", 24 "google_id", 25 "group", 26 "group_obj", 27 "provider", 28 "attributes", 29 ] 30 extra_kwargs = {"attributes": {"read_only": True}}
class
GoogleWorkspaceProviderGroupViewSet(rest_framework.mixins.CreateModelMixin, authentik.lib.sync.outgoing.api.OutgoingSyncConnectionCreateMixin, rest_framework.mixins.RetrieveModelMixin, rest_framework.mixins.DestroyModelMixin, authentik.core.api.used_by.UsedByMixin, rest_framework.mixins.ListModelMixin, rest_framework.viewsets.GenericViewSet):
33class GoogleWorkspaceProviderGroupViewSet( 34 mixins.CreateModelMixin, 35 OutgoingSyncConnectionCreateMixin, 36 mixins.RetrieveModelMixin, 37 mixins.DestroyModelMixin, 38 UsedByMixin, 39 mixins.ListModelMixin, 40 GenericViewSet, 41): 42 """GoogleWorkspaceProviderGroup Viewset""" 43 44 queryset = GoogleWorkspaceProviderGroup.objects.all().select_related("group") 45 serializer_class = GoogleWorkspaceProviderGroupSerializer 46 filterset_fields = ["provider__id", "group__name", "group__group_uuid"] 47 search_fields = ["provider__name", "group__name"] 48 ordering = ["group__name"]
GoogleWorkspaceProviderGroup Viewset
serializer_class =
<class 'GoogleWorkspaceProviderGroupSerializer'>