class CliArgument(ValueObject): name: str = required() type: Type = required() default: Any = optional() required: bool = optional(default=False) help: str = optional() alias: List[str] = list_()
class CliEndpoint(Endpoint): app: str = required(str) command: str = required(str) description: str = optional(str) alias: List[str] = list_() help: str = optional() arguments: List[CliArgument] = list_() def command_parts(self): return self.command.split(' ')
class HttpEndpoint(Endpoint): gateway: str = optional(str) route: str = required(str) method: str = optional(str, default='GET') query_params: dict = optional(dict) service: type = optional() secured: bool = optional(default=True) scopes: List[str] = list_() def __eq__(self, other): return isinstance( other, HttpEndpoint ) and self.route == other.route and self.method == other.method
class CliApp(AggregateRoot): id: str = id_() name: str = required(str) description: str = optional(str) endpoints: List[CliEndpoint] = list_()