def _generate_api_defs(self, use_cache=True, strict_cache=True):
data = self._get_defs(use_cache, strict_cache=strict_cache)<EOL>resource_defs = {}<EOL>for res_name, res_dct in six.iteritems(data["<STR_LIT>"]["<STR_LIT>"]):<EOL><INDENT>new_resource, extra_foreign_methods = parse_resource_definition(<EOL>res_name.lower(),<EOL>res_dct,<EOL>)<EOL>if res_name in resource_defs:<EOL><INDENT>old_res = resource_defs[res_name]<EOL>for prop_name, prop_val in six.iteritems(new_resource):<EOL><INDENT>if (<EOL>prop_name == '<STR_LIT>' and<EOL>prop_name in new_resource<EOL>):<EOL><INDENT>old_res[prop_name].union(prop_val)<EOL>continue<EOL><DEDENT>if prop_name.startswith('<STR_LIT:_>'):<EOL><INDENT>continue<EOL><DEDENT>if prop_name in old_res:<EOL><INDENT>logger.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>prop_name,<EOL>res_name,<EOL>)<EOL>continue<EOL><DEDENT>old_res[prop_name] = prop_val<EOL><DEDENT><DEDENT>else:<EOL><INDENT>resource_defs[res_name] = new_resource<EOL><DEDENT>for f_res_name, f_methods in six.iteritems(extra_foreign_methods):<EOL><INDENT>methods = resource_defs.setdefault(<EOL>f_res_name,<EOL>{'<STR_LIT>': set()},<EOL>)<EOL>for f_mname, f_method in six.iteritems(f_methods):<EOL><INDENT>if f_mname in methods:<EOL><INDENT>logger.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>f_mname,<EOL>f_res_name,<EOL>)<EOL>continue<EOL><DEDENT>methods[f_mname] = f_method<EOL>methods['<STR_LIT>'].add(f_mname)<EOL><DEDENT><DEDENT><DEDENT>for resource_name, resource_data in six.iteritems(resource_defs):<EOL><INDENT>new_resource = ResourceMeta.__new__(<EOL>ResourceMeta,<EOL>str(resource_name),<EOL>(Resource,),<EOL>resource_data,<EOL>)<EOL>if not resource_data['<STR_LIT>']:<EOL><INDENT>logger.debug('<STR_LIT>' % resource_name)<EOL>continue<EOL><DEDENT>instance = new_resource(self)<EOL>setattr(self, resource_name, instance)<EOL><DEDENT>
This method populates the class with the api definitions.

:param use_cache: If set, will try to get the definitions from the
    local cache first, then from the remote server, and at last will
    try to get the closest one from the local cached
:param strict_cache: If True, will not accept a similar version cached
    definitions file as valid