Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/schema/parameteriser.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.6.5, created at 2024-11-15 02:12 +0000

1#!/usr/bin/env python 

2# -*- coding: utf-8 -*- 

3from marshmallow import Schema, fields 

4 

5from daiquiri.core.schema.component import ComponentSchema 

6 

7 

8# Config Schema 

9class ParameterSchema(Schema): 

10 actor = fields.Str(required=True) 

11 require_staff = fields.Bool() 

12 

13 

14class ParameteriserConfigSchema(ComponentSchema): 

15 root = fields.Str(metadata={"title": "Root directory"}) 

16 parametertypes = fields.Dict( 

17 keys=fields.Str(required=True), values=fields.Nested(ParameterSchema, many=True) 

18 ) 

19 

20 

21# Endpoint Schema 

22class AvailableParametersSchema(Schema): 

23 parameter_type = fields.Str(metadata={"title": "Parameter type"}) 

24 instance_type = fields.Str(metadata={"title": "Instance class"}) 

25 name = fields.Str(metadata={"title": "Instance name"}) 

26 file_name = fields.Str(metadata={"title": "File name"}) 

27 directory = fields.Str(metadata={"title": "File directory"}) 

28 parameters = fields.Dict()