コード例 #1
0
class CliArgument(ValueObject):
    name: str = required()
    type: Type = required()
    default: Any = optional()
    required: bool = optional(default=False)
    help: str = optional()
    alias: List[str] = list_()
コード例 #2
0
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(' ')
コード例 #3
0
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
コード例 #4
0
class CliApp(AggregateRoot):
    id: str = id_()
    name: str = required(str)
    description: str = optional(str)
    endpoints: List[CliEndpoint] = list_()