"""Settings Whitelisted Resources Schema.""" from marshmallow import fields from marshmallow.validate import OneOf from permissions.constants import constants from permissions.validations import ma class TenantAccessCheckSchema(ma.Schema): """ Schema for validating a single tenant in the request body of POST /check-admin-access. Attributes: tenant_type (str): The type of tenant. Must be one of ADMIN_ASSIGNABLE_TENANT_TYPES. tenant_uuid (str): The unique identifier of the tenant. """ tenant_type = fields.Str(validate=OneOf(constants.ADMIN_ASSIGNABLE_TENANT_TYPES), required=True) tenant_uuid = fields.Str(required=True) class TenantAccessCheckListSchema(ma.Schema): """ Schema for validating the request body of POST /check-admin-access. Attributes: tenants (list): A list of tenants, each adhering to the TenantAccessCheckSchema. """ tenants = fields.List(fields.Nested(TenantAccessCheckSchema), required=True)