def as_view(request, *args, **kwargs):
    from users.models import UserModel
    from rest_framework.exceptions import ValidationError

    email_address = request.data.get('email_address')
    phone_number = request.data.get('phone_number')

    if phone_number:
        obj = UserModel.objects.filter(phone_number=request.data.get('phone_number')).first()
        obj.send_verification_code(platforms=['SMS']) if obj else None
    elif email_address:
        obj = UserModel.objects.filter(email_address=request.data.get('email_address')).first()
        obj.send_verification_code(platforms=['Email']) if obj else None
    else:
        raise ValidationError({'detail': 'Enter one of the phone number or email items.'})
