def serialize(self,writer: SerializationWriter) -> None:
        """
        Serializes information the current object
        param writer: Serialization writer to use to serialize this model
        Returns: None
        """
        if writer is None:
            raise TypeError("writer cannot be null.")
        super().serialize(writer)
        writer.write_str_value("deviceId", self.device_id)
        writer.write_enum_value("enrollmentType", self.enrollment_type)
        writer.write_enum_value("failureCategory", self.failure_category)
        writer.write_str_value("failureReason", self.failure_reason)
        writer.write_str_value("managedDeviceIdentifier", self.managed_device_identifier)
        writer.write_str_value("operatingSystem", self.operating_system)
        writer.write_str_value("osVersion", self.os_version)
        writer.write_str_value("userId", self.user_id)

        Serializes information the current object
        param writer: Serialization writer to use to serialize this model
        Returns: None
        
msgraph/generated/models/enrollment_troubleshooting_event.py