in templates/python/facebook_business/api.py [0:0]
def execute(self):
params = copy.deepcopy(self._params)
if self._api_type == "EDGE" and self._method == "GET":
cursor = Cursor(
target_objects_class=self._target_class,
params=params,
fields=self._fields,
include_summary=self._include_summary,
api=self._api,
node_id=self._node_id,
endpoint=self._endpoint,
)
cursor.load_next_page()
return cursor
if self._fields:
params['fields'] = ','.join(self._fields)
with open_files(self._file_params) as files:
response = self._api.call(
method=self._method,
path=(self._path),
params=params,
files=files,
api_version=self._api_version,
)
if response.error():
raise response.error()
if self._response_parser:
return self._response_parser.parse_single(response.json())
else:
return response