예제 #1
0
 def get_association(self, parent_id, resource_id):
     association = self.service.get(parent_id, resource_id)
     response = self.converter.encode(association)
     location = url_for('.get_association',
                        parent_id=parent_id,
                        resource_id=resource_id)
     return build_response(response, location=location)
예제 #2
0
 def get_association(self, parent_id, resource_id):
     association = self.service.get(parent_id, resource_id)
     response = self.converter.encode(association)
     location = url_for('.get_association',
                        parent_id=parent_id,
                        resource_id=resource_id)
     return build_response(response, location=location)
예제 #3
0
 def associate_collection(self, parent_id):
     association = self.converter.decode(request)
     created_association = self.service.associate(association)
     response = self.converter.encode(created_association)
     location = url_for('.get_association',
                        parent_id=parent_id,
                        resource_id=created_association.agent_id)
     return build_response(response, 201, location)
예제 #4
0
 def associate_collection(self, parent_id):
     association = self.converter.decode(request)
     created_association = self.service.associate(association)
     response = self.converter.encode(created_association)
     location = url_for('.get_association',
                        parent_id=parent_id,
                        resource_id=created_association.agent_id)
     return build_response(response, 201, location)
예제 #5
0
 def get(self):
     info = self.dao.get()
     response = self.converter.encode(info)
     return build_response(response)
예제 #6
0
 def search_by_view(self, args):
     search_result = self.service.search(**args)
     converter = self.find_converter(args.get('view'))
     response = converter.encode_list(search_result.items, search_result.total)
     return build_response(response)
예제 #7
0
 def search_by_fullname(self, fullname):
     items = self.service.find_all_by_fullname(fullname)
     response = self.converter.encode_list(items)
     return build_response(response)
예제 #8
0
 def get(self):
     resource = self.service.get()
     response = self.converter.encode(resource)
     return build_response(response)
예제 #9
0
 def get(self):
     info = self.dao.get()
     response = self.converter.encode(info)
     return build_response(response)
예제 #10
0
 def list_associations_by_child(self, voicemail_id):
     self.service.validate_resource(voicemail_id)
     associations = self.service.list_by_child(voicemail_id)
     response = self.converter.encode_list(associations)
     return build_response(response)
예제 #11
0
 def get(self):
     resource = self.service.get()
     response = self.converter.encode(resource)
     return build_response(response)
예제 #12
0
 def get_by_extension(self, extension_id):
     association = self.service.get_by_extension_id(extension_id)
     response = self.converter.encode(association)
     location = url_for('.get_by_extension', extension_id=extension_id)
     return build_response(response, location=location)