mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Automatic implementation of url_parameters
This commit is contained in:
@@ -6,16 +6,28 @@
|
||||
post_parameters = [ {{ method.variadicParameter.name }}._identity for {{ method.variadicParameter.name }} in {{ method.variadicParameter.name }}s ]
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if method.mandatoryParameters %}
|
||||
post_parameters = {
|
||||
{% for parameter in method.mandatoryParameters %}
|
||||
{% for parameter in method.mandatoryParameters %}
|
||||
"{{ parameter.name }}": {{ parameter.name }},
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
}
|
||||
{% else %}
|
||||
post_parameters = dict()
|
||||
{% endif %}
|
||||
{% for parameter in method.optionalParameters %}
|
||||
if {{ parameter.name }} is not DefaultValueForOptionalParameters:
|
||||
post_parameters[ "{{ parameter.name }}" ] = {{ parameter.name }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if method.optionalParameters %}
|
||||
url_parameters = dict()
|
||||
{% for parameter in method.optionalParameters %}
|
||||
if {{ parameter.name }} is not DefaultValueForOptionalParameters:
|
||||
url_parameters[ "{{ parameter.name }}" ] = {{ parameter.name }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if method.request.urlParameters %}
|
||||
@@ -29,7 +41,7 @@
|
||||
status, headers, data = self.__requester.request(
|
||||
"{{ method.request.verb }}",
|
||||
{% include "GithubObject.Concatenation.py" with concatenation=method.request.url only %},
|
||||
{% if method.request.urlParameters %}
|
||||
{% if method.request.urlParameters or not method.request.postParameters and method.optionalParameters %}
|
||||
url_parameters,
|
||||
{% else %}
|
||||
None,
|
||||
|
||||
Reference in New Issue
Block a user