(self, current_page: int, page_size: int, instance: Dict)
| 480 | ) |
| 481 | |
| 482 | def page(self, current_page: int, page_size: int, instance: Dict): |
| 483 | self.is_valid(raise_exception=True) |
| 484 | req_dict = ApplicationQueryRequest(data=instance) |
| 485 | req_dict.is_valid(raise_exception=True) |
| 486 | workspace_id = self.data.get("workspace_id") |
| 487 | user_id = self.data.get("user_id") |
| 488 | workspace_manage = is_workspace_manage_permission_read(user_id, workspace_id, "APPLICATION:READ") |
| 489 | is_x_pack_ee = self.is_x_pack_ee() |
| 490 | result = native_page_search( |
| 491 | current_page, |
| 492 | page_size, |
| 493 | self.get_query_set(req_dict.data, workspace_manage, is_x_pack_ee), |
| 494 | get_file_content( |
| 495 | os.path.join( |
| 496 | PROJECT_DIR, |
| 497 | "apps", |
| 498 | "application", |
| 499 | "sql", |
| 500 | "list_application.sql" |
| 501 | if workspace_manage |
| 502 | else ("list_application_user_ee.sql" if is_x_pack_ee else "list_application_user.sql"), |
| 503 | ) |
| 504 | ), |
| 505 | ) |
| 506 | |
| 507 | return ResourceMappingSerializer().get_resource_count(result) |
| 508 | |
| 509 | |
| 510 | class ApplicationImportRequest(serializers.Serializer): |
no test coverage detected