class StartTestRunParamsModel(AbstractAPIModel): """Start a new run session. Args: tests (TestModel): the main test to build the run suite from. run_data (RunDataModel): the run data details of the current run. """ PROPERTIES = [ StringField(name="token", required=True), ModelField(name="tests", model=TestModel, required=True), ModelField(name="run_data", model=RunDataModel, required=True) ]
class UpdateFieldsParamsModel(AbstractAPIModel): """Update fields of a given resource. Args: resource_descriptor (ResourceDescriptorModel): describes the resources to change. changes (dict): keys are the object's fields and values are the values to change the fields into. """ PROPERTIES = [ ModelField(name="resource_descriptor", required=True, model=ResourceDescriptorModel), ModelField(name="changes", required=True, model=GenericModel), ]
class AddTestResultParamsModel(AbstractAPIModel): """Add a test result to a given test. Args: test_details (TestControlOperationParamsModel): the details of the relevant session datas. result (TestResultModel): the result of the test. """ PROPERTIES = [ ModelField(name="test_details", model=TestControlOperationParamsModel, required=True, location="query"), ModelField(name="result", model=TestResultModel, required=True) ]
class UpdateRunDataParamsModel(AbstractAPIModel): """Update run data of a given session run. Args: run_data (RunDataModel): the new run data to update to. token (str): the token of the current session run. """ PROPERTIES = [ ModelField(name="run_data", model=RunDataModel, required=True), StringField(name="token", required=True) ]
class ResourceDescriptorModel(AbstractAPIModel): """Descriptor of a resource. Args: type (str): the type of the resource. properties (dict): django filter properties of the model. """ TITLE = "Resource Descriptor" PROPERTIES = [ StringField(name="type", required=True, example="resources.models.CalculatorData"), ModelField(name="properties", model=GenericModel, required=True) ]
class UpdateResourcesParamsModel(AbstractAPIModel): """Update the given resources test data. Args: descriptors (list): list of ResourceDescriptorModel. The resources to be updated. test_details (TestControlOperationParamsModel): the details of the relevant session datas. """ PROPERTIES = [ ArrayField(name="descriptors", items_type=ResourceDescriptorModel, required=True), ModelField(name="test_details", model=TestControlOperationParamsModel, required=True, location="query") ]
class FailureResponseModel(AbstractResponse): """Returns when an invalid request is received.""" PROPERTIES = [ StringField(name="details", required=True), ModelField(name="errors", model=GenericModel) ]