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.")
        writer.write_enum_value("hive", self.hive)
        writer.write_str_value("key", self.key)
        writer.write_str_value("@odata.type", self.odata_type)
        writer.write_str_value("oldKey", self.old_key)
        writer.write_str_value("oldValueData", self.old_value_data)
        writer.write_str_value("oldValueName", self.old_value_name)
        writer.write_enum_value("operation", self.operation)
        writer.write_int_value("processId", self.process_id)
        writer.write_str_value("valueData", self.value_data)
        writer.write_str_value("valueName", self.value_name)
        writer.write_enum_value("valueType", self.value_type)
        writer.write_additional_data_value(self.additional_data)

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