@fiss_cmd<EOL>def config_validate(args):
r = fapi.validate_config(args.project, args.workspace, args.namespace,<EOL>args.config)<EOL>fapi._check_response_code(r, <NUM_LIT:200>)<EOL>entity_d = None<EOL>config_d = r.json()<EOL>if args.entity:<EOL><INDENT>entity_type = config_d['<STR_LIT>']['<STR_LIT>']<EOL>entity_r = fapi.get_entity(args.project, args.workspace,<EOL>entity_type, args.entity)<EOL>fapi._check_response_code(entity_r, [<NUM_LIT:200>,<NUM_LIT>])<EOL>if entity_r.status_code == <NUM_LIT>:<EOL><INDENT>eprint("<STR_LIT>".format(entity_type, args.entity))<EOL>return <NUM_LIT:2><EOL><DEDENT>else:<EOL><INDENT>entity_d = entity_r.json()<EOL><DEDENT><DEDENT>w = fapi.get_workspace(args.project, args.workspace)<EOL>fapi._check_response_code(w, <NUM_LIT:200>)<EOL>workspace_d = w.json()<EOL>ii, io, ma, mwa = _validate_helper(args, config_d, workspace_d, entity_d)<EOL>ii_msg = "<STR_LIT>"<EOL>io_msg = "<STR_LIT>"<EOL>ma_msg = "<STR_LIT>".format(entity_type, args.entity) if args.entity else "<STR_LIT>"<EOL>mwa_msg = "<STR_LIT>".format(args.project, args.workspace)<EOL>for errs, msg in zip([ii, io, ma, mwa], [ii_msg, io_msg, ma_msg, mwa_msg]):<EOL><INDENT>if errs:<EOL><INDENT>print(msg)<EOL>for inp, val in errs:<EOL><INDENT>print("<STR_LIT>".format(inp, val))<EOL><DEDENT><DEDENT><DEDENT>if ii + io + ma + mwa:<EOL><INDENT>return <NUM_LIT:1><EOL><DEDENT>
Validate a workspace configuration: if an entity was specified (i.e.
        upon which the configuration should operate), then also validate that
        the entity has the necessary attributes