1 ##############################################################################
2 # Copyright (c) 2015 Orange
3 # guyrodrigue.koffi@orange.com / koffirodrigue@gmail.com
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 from opnfv_testapi.tornado_swagger import swagger
13 class ProjectCreateRequest(object):
14 def __init__(self, name, description=''):
16 self.description = description
21 "description": self.description,
26 class ProjectUpdateRequest(object):
27 def __init__(self, name='', description=''):
29 self.description = description
34 "description": self.description,
39 class Project(object):
41 name=None, _id=None, description=None, create_date=None):
44 self.description = description
45 self.creation_date = create_date
48 def from_dict(res_dict):
54 t._id = res_dict.get('_id')
55 t.creation_date = res_dict.get('creation_date')
56 t.name = res_dict.get('name')
57 t.description = res_dict.get('description')
64 "description": self.description,
65 "creation_date": str(self.creation_date)
68 def format_http(self):
72 "description": self.description,
73 "creation_date": str(self.creation_date),
78 class Projects(object):
81 @ptype projects: C{list} of L{Project}
84 self.projects = list()
87 def from_dict(res_dict):
92 for project in res_dict.get('projects'):
93 res.projects.append(Project.from_dict(project))