# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from __future__ import annotations

from alibabacloud_dataphin_public20230630 import models as main_models
from darabonba.model import DaraModel

class ListResourcePermissionsRequest(DaraModel):
    def __init__(
        self,
        list_query: main_models.ListResourcePermissionsRequestListQuery = None,
        op_tenant_id: int = None,
    ):
        # This parameter is required.
        self.list_query = list_query
        # This parameter is required.
        self.op_tenant_id = op_tenant_id

    def validate(self):
        if self.list_query:
            self.list_query.validate()

    def to_map(self):
        result = dict()
        _map = super().to_map()
        if _map is not None:
            result = _map
        if self.list_query is not None:
            result['ListQuery'] = self.list_query.to_map()

        if self.op_tenant_id is not None:
            result['OpTenantId'] = self.op_tenant_id

        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('ListQuery') is not None:
            temp_model = main_models.ListResourcePermissionsRequestListQuery()
            self.list_query = temp_model.from_map(m.get('ListQuery'))

        if m.get('OpTenantId') is not None:
            self.op_tenant_id = m.get('OpTenantId')

        return self

class ListResourcePermissionsRequestListQuery(DaraModel):
    def __init__(
        self,
        page: int = None,
        page_size: int = None,
        search_text: str = None,
        tab_type: str = None,
    ):
        # This parameter is required.
        self.page = page
        # This parameter is required.
        self.page_size = page_size
        self.search_text = search_text
        # This parameter is required.
        self.tab_type = tab_type

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        _map = super().to_map()
        if _map is not None:
            result = _map
        if self.page is not None:
            result['Page'] = self.page

        if self.page_size is not None:
            result['PageSize'] = self.page_size

        if self.search_text is not None:
            result['SearchText'] = self.search_text

        if self.tab_type is not None:
            result['TabType'] = self.tab_type

        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('Page') is not None:
            self.page = m.get('Page')

        if m.get('PageSize') is not None:
            self.page_size = m.get('PageSize')

        if m.get('SearchText') is not None:
            self.search_text = m.get('SearchText')

        if m.get('TabType') is not None:
            self.tab_type = m.get('TabType')

        return self

