def METHOD_NAME(self, category, endpoint):
    # Getting parameters
    path_params = list(map(lambda x: self.to_snake_case(x), self.get_path_params(endpoint)))
    mandatory_query_params = list(map(lambda x: self.to_snake_case(x), self.get_mandatory_query_params(endpoint)))
    # Getting parameters description
    params_descriptions = []
    for param in self.parameters:
        desc = self.get_parameter_description(param)
        if self.parameters[param]['allowedValues']:
            desc += ' Allowed values: {}'.format(
                self.get_parameter_allowed_values(param).split(',')
            )
        line = '{}:param {} {}: {}'.format(
                    ' ' * 8,
                    self.param_types[self.get_parameter_type(param)],
                    self.to_snake_case(param),
                    desc
            )
        if self.is_required(param):
            line += ' (REQUIRED)'
            params_descriptions.insert(0, self.format_line(line))
        else:
            params_descriptions.append(self.format_line(line))
    params_descriptions = '\n'.join(params_descriptions)
    # Method arguments
    method_args = ['self']
    method_args += path_params
    method_args += mandatory_query_params
    if endpoint['method'] == 'POST' and 'data' in self.parameters.keys() and 'data' not in mandatory_query_params:
        method_args.append('data=None')
    method_args += ['**options']
    method_args = ', '.join(method_args)
    # Method body
    method_body = ['{i}options[\'{r}\'] = {r}'.format(i=' ' * 8, r=required_parameter)
                   for required_parameter in mandatory_query_params if required_parameter != 'data']
    # Call arguments
    call_args = []
    if self.action is not None:
        call_args = ['\'{}\''.format(self.action)]
    if self.id1 is not None:
        call_args.append('query_id={}'.format(self.to_snake_case(self.id1)))
    if self.subcategory is not None:
        call_args.append('subcategory=\'{}\''.format(self.subcategory))
    if self.id2 is not None:
        call_args.append('second_query_id={}'.format(self.to_snake_case(self.id2)))
    if endpoint['method'] == 'POST' and 'data' in self.parameters:
        call_args.append('data=data')
    call_args.append('**options')
    call_args = ', '.join(call_args)
    # Method text
    text = []
    text.append('{}def {}({}):'.format(' ' * 4, self.get_method_name(endpoint, category), method_args))
    text.append('{}"""'.format(' ' * 8))
    text.append(self.format_line('{}{}'.format(' ' * 8, self.get_endpoint_description(endpoint))))
    text.append('{}PATH: {}'.format(' ' * 8, endpoint['path']))
    if params_descriptions:
        text.append('')
        text.append(params_descriptions)
    text.append('{}"""'.format(' ' * 8))
    text.append('')
    if method_body:
        text += method_body
    text.append('{}return self.{}({})'.format(' ' * 8, '_' + endpoint['method'].lower(), call_args))
    text.append('')
    return '\n'.join(text)