def post(self, request, identifier, trait_key, *args, **kwargs):  # type: ignore[no-untyped-def]
        """
        THIS ENDPOINT IS DEPRECATED. Please use `/traits/` instead.
        """
        trait_data = request.data

        if "trait_value" not in trait_data:
            error = {"detail": "Trait value not provided"}
            return Response(error, status=status.HTTP_400_BAD_REQUEST)

        # if we have identifier fetch, or create if does not exist
        if identifier:
            identity, _ = Identity.objects.get_or_create(
                identifier=identifier,
                environment=request.environment,
            )

        else:
            return Response(
                {"detail": "Missing identifier"}, status=status.HTTP_400_BAD_REQUEST
            )

        # if we have identity trait fetch, or create if does not exist
        if trait_key:
            # need to create one if does not exist
            trait, _ = Trait.objects.get_or_create(
                identity=identity,
                trait_key=trait_key,
            )

        else:
            return Response(
                {"detail": "Missing trait key"}, status=status.HTTP_400_BAD_REQUEST
            )

        if trait and "trait_value" in trait_data:
            # Check if trait value was provided with request data. If so, we need to figure out value_type from
            # the given value and also use correct value field e.g. boolean_value, float_value, integer_value or
            # string_value, and override request data
            trait_data = trait.generate_trait_value_data(trait_data["trait_value"])

            trait_full_serializer = TraitSerializerFull(
                trait, data=trait_data, partial=True
            )

            if trait_full_serializer.is_valid():
                trait_full_serializer.save()
                return Response(
                    self.get_serializer(trait).data, status=status.HTTP_200_OK
                )
            else:
                return Response(
                    trait_full_serializer.errors, status=status.HTTP_400_BAD_REQUEST
                )

        else:
            return Response(
                {"detail": "Failed to update user trait"},
                status=status.HTTP_400_BAD_REQUEST,
            )

        THIS ENDPOINT IS DEPRECATED. Please use `/traits/` instead.
        
api/environments/identities/traits/views.py