# -*- coding: utf-8 -*-
# Copyright (c) 2020, JINGROW
# For license information, please see license.txt


# import jingrow
from jingrow.model.page import Page
from jingrow.utils import cstr

from jcloud.api.bench import apps


class ReleaseGroupApp(Page):
	# begin: auto-generated types
	# This code is auto-generated. Do not modify anything in this block.

	from typing import TYPE_CHECKING

	if TYPE_CHECKING:
		from jingrow.types import DF

		app: DF.Link
		enable_auto_deploy: DF.Check
		parent: DF.Data
		parentfield: DF.Data
		parenttype: DF.Data
		source: DF.Link
		title: DF.Data
	# end: auto-generated types

	dashboard_fields = ["app"]

	@staticmethod
	def get_list_query(query, filters=None, **list_args):
		group = cstr(filters.get("parent", "")) if filters else None
		return apps(group)
