File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5454)
5555
5656__all__ = [
57+ # Generic resource base
58+ "GenericResourceBase" ,
5759 # HTTP Models
5860 "CoreBaseModel" ,
5961 "CoreRequestBaseModel" ,
Original file line number Diff line number Diff line change 1+ from typing import Any , Dict , Optional
2+ from pydantic import BaseModel , Field , ConfigDict
3+
4+ # --- GenericResourceBase (voor alle providers) ---
5+ class GenericResourceBase (BaseModel ):
6+ """
7+ Base class for generic resource models with common fields and configuration.
8+ Provides common schema fields (location, tags) en shared Pydantic config.
9+ """
10+ location : str = Field (..., description = "Location or region" )
11+ tags : Optional [Dict [str , str ]] = Field (None , description = "Resource tags for categorization" )
12+ model_config = ConfigDict (
13+ str_strip_whitespace = True ,
14+ arbitrary_types_allowed = True ,
15+ )
116"""
217Base HTTP models for the ITL ControlPlane SDK.
318
Original file line number Diff line number Diff line change 99from .config import FastAPIConfig
1010from .crud_routes import create_crud_routes
1111from .generic_routes import setup_generic_routes
12- from .models import GenericResourceBase
1312from .observability_routes import setup_observability_routes
1413from .provider_server import BaseProviderServer
1514from .provider_setup import (
2827 "add_audit_middleware" ,
2928 "BaseProviderServer" ,
3029 "create_crud_routes" ,
31- "GenericResourceBase" ,
3230 "register_resource_types" ,
3331 "setup_generic_routes" ,
3432 "setup_observability_routes" ,
Original file line number Diff line number Diff line change 1010from pydantic import BaseModel , Field , ConfigDict
1111
1212
13- class GenericResourceBase (BaseModel ):
14- """
15- Base class for generic resource models with common fields and configuration.
16-
17- Provides common schema fields (location, tags) and shared Pydantic configuration
18- that can be inherited by request and response models across all providers.
19-
20- This base class ensures consistency across the platform while allowing
21- providers to extend with their own specific fields.
22-
23- Example:
24- class MyProviderRequest(GenericResourceBase):
25- subscription_id: str
26- resource_group: str
27- resource_name: str
28- # Additional provider-specific fields here
29- """
30-
31- location : str = Field (..., description = "Location or region" )
32- tags : Optional [Dict [str , str ]] = Field (None , description = "Resource tags for categorization" )
33-
34- model_config = ConfigDict (
35- str_strip_whitespace = True ,
36- arbitrary_types_allowed = True ,
37- )
You can’t perform that action at this time.
0 commit comments