def load(core_rest_api): blueprint = Blueprint('voicemails', __name__, url_prefix='/%s/voicemails' % config.API_VERSION) document = core_rest_api.content_parser.document( Field('id', Int()), Field('name', Unicode()), Field('number', Unicode()), Field('context', Unicode()), Field('password', Unicode()), Field('email', Unicode()), Field('language', Unicode()), Field('timezone', Unicode()), Field('pager', Unicode()), Field('max_messages', Int()), Field('attach_audio', Boolean()), Field('delete_messages', Boolean()), Field('ask_password', Boolean()), Field('enabled', Boolean()), Field('options', OptionType())) converter = Converter.resource(document, Voicemail) service = build_service() resource = VoicemailResource(service, converter) DecoratorChain.register_scrud(core_rest_api, blueprint, resource)
def setUp(self): self.opttype = OptionType()