def metadata_record_show_schema(deserialize_json=False): schema = metadata_record_create_schema() _make_show_schema(schema) schema.update({ 'owner_org': [v.convert_id_to_name('organization')], 'metadata_standard_id': [convert_from_extras, v.convert_id_to_name('metadata_standard')], 'metadata_json': [convert_from_extras, v.format_json(deserialize_json)], 'doi': [convert_from_extras], 'sid': [convert_from_extras], 'metadata_collection_id': [convert_from_extras, v.convert_id_to_name('metadata_collection')], 'validated': [convert_from_extras, boolean_validator], 'errors': [convert_from_extras, v.format_json(deserialize_json)], 'workflow_state_id': [ convert_from_extras, default(None), v.convert_id_to_name('workflow_state') ], 'private': [], 'extras': _extras_schema(), 'display_name': [], }) return schema
def workflow_annotation_show_schema(deserialize_json=False): schema = workflow_annotation_create_schema() _make_show_schema(schema) schema.update({ 'attributes': [v.format_json(deserialize_json)], }) return schema
def workflow_state_show_schema(deserialize_json=False): schema = workflow_state_create_schema() _make_show_schema(schema) schema.update({ 'workflow_rules_json': [v.format_json(deserialize_json)], 'revert_state_id': [v.convert_id_to_name('workflow_state')], 'display_name': [], }) return schema
def metadata_standard_show_schema(deserialize_json=False): schema = metadata_standard_create_schema() _make_show_schema(schema) schema.update({ 'parent_standard_id': [v.convert_id_to_name('metadata_standard')], 'metadata_template_json': [v.format_json(deserialize_json)], 'display_name': [], }) return schema
def metadata_schema_show_schema(deserialize_json=False): schema = metadata_schema_create_schema() _make_show_schema(schema) schema.update({ 'schema_json': [v.format_json(deserialize_json)], 'metadata_standard_id': [v.convert_id_to_name('metadata_standard')], 'organization_id': [v.convert_id_to_name('organization')], 'infrastructure_id': [v.convert_id_to_name('infrastructure')], 'display_name': [], }) return schema
def metadata_record_workflow_annotation_show_schema(deserialize_json=False): """ Translates from the default JSONPatch output schema. """ schema = { '__before': [v.copy('id', 'jsonpatch_id'), ignore], 'id': [v.copy_from('object_id')], 'key': [ v.copy_from('operation'), v.extract_item('path'), v.extract_re_group(r'/(\w+)') ], 'value': [ v.copy_from('operation'), v.extract_item('value'), v.format_json(deserialize_json) ], 'object_id': [], 'operation': [], } return schema