def __init__(self, api_token, endpoint="<STR_LIT>", version=None):
self.api_token = api_token<EOL>self.endpoint = endpoint<EOL>self.parsed_endpoint = urllib.parse.urlparse(self.endpoint)<EOL>self.api_version = version <EOL>schema_url = self.parsed_endpoint.path<EOL>if version:<EOL><INDENT>schema_url = schema_url + '<STR_LIT>' + version<EOL><DEDENT>self.schema = self._get_data(schema_url)<EOL>self.api_version = self.schema['<STR_LIT:version>']<EOL>for resource in self.schema['<STR_LIT>']:<EOL><INDENT>if "<STR_LIT:GET>" in resource['<STR_LIT>']:<EOL><INDENT>read_callable = _generate_read_callable(resource['<STR_LIT:name>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'])<EOL>setattr(self, read_callable.__name__, new.instancemethod(read_callable, self, self.__class__))<EOL><DEDENT>if "<STR_LIT>" in resource['<STR_LIT>']:<EOL><INDENT>update_callable = _generate_update_callable(resource['<STR_LIT:name>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'])<EOL>setattr(self, update_callable.__name__, new.instancemethod(update_callable, self, self.__class__))<EOL><DEDENT>if "<STR_LIT:POST>" in resource['<STR_LIT>']:<EOL><INDENT>create_callable = _generate_create_callable(resource['<STR_LIT:name>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'], resource['<STR_LIT>'])<EOL>setattr(self, create_callable.__name__, new.instancemethod(create_callable, self, self.__class__))<EOL><DEDENT>if "<STR_LIT>" in resource['<STR_LIT>']:<EOL><INDENT>delete_callable = _generate_delete_callable(resource['<STR_LIT:name>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'],<EOL>resource['<STR_LIT>'])<EOL>setattr(self, delete_callable.__name__, new.instancemethod(delete_callable, self, self.__class__))<EOL><DEDENT><DEDENT>
endpoint must be the full url to the API schema document, like `http://127.0.0.1:8000/api/backbone/schema'
api_token is the unique string associated with your account's profile which allows API access