Skip to content

Commit 7084d24

Browse files
committed
whitespace changes
1 parent acbe9b1 commit 7084d24

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

templates/endpoint_module/attributes.jinja

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{% macro add_lookup(property) %}
2-
{% set lookup_endpoint = lookup_parameters.get(property.name) %}
3-
{% set lookup_entity = lookup_endpoint.data["x-cli-entity"] if lookup_endpoint %}
4-
{% set lookup_type = property.get_instance_type_string() %}
5-
{% if lookup_type == 'list' %}
6-
{% set lookup_type = property.inner_property.get_instance_type_string() %}
7-
{% endif %}
8-
{% if lookup_endpoint -%}
2+
{% set lookup_endpoint = lookup_parameters.get(property.name) %}
3+
{% set lookup_entity = lookup_endpoint.data["x-cli-entity"] if lookup_endpoint %}
4+
{% set lookup_type = property.get_instance_type_string() %}
5+
{% if lookup_type == 'list' %}
6+
{% set lookup_type = property.inner_property.get_instance_type_string() %}
7+
{% endif %}
8+
{% if lookup_endpoint -%}
99
def {{ lookup_function(property, lookup_entity.id) }}(ref: str) -> Union[None, {{ lookup_type }}]:
1010
return api_{{ python_identifier(lookup_endpoint.name) }}.Command(self._context).lookup(ref)
1111

12-
{% endif %}
12+
{% endif %}
1313
{% endmacro %}
1414

1515
{% macro add_primitive(property, argument) %}
@@ -74,20 +74,20 @@
7474

7575
{% macro lookup_function(property, entity_id) %}
7676
{% filter trim %}
77-
{% set suffix = "_" + entity_id %}
78-
{# Normalize property.python_name of "server"/"server_id"/"server_ids" to "server_id" #}
79-
lookup_{{ property.python_name.removesuffix(suffix+"s").removesuffix(suffix) }}{{ suffix }}
77+
{% set suffix = "_" + entity_id %}
78+
{# Normalize property.python_name of "server"/"server_id"/"server_ids" to "server_id" #}
79+
lookup_{{ property.python_name.removesuffix(suffix+"s").removesuffix(suffix) }}{{ suffix }}
8080
{% endfilter %}
8181
{% endmacro %}
8282

8383
{% macro remove_suffix(value, suffix) %}
8484
{% filter trim %}
85-
{% if value.endswith(suffix + "s") %}
86-
{{ value.removesuffix(suffix + "s") }}s
87-
{% elif value.endswith(suffix) %}
88-
{{ value.removesuffix(suffix) }}
89-
{% else %}
90-
{{ value }}
91-
{% endif %}
85+
{% if value.endswith(suffix + "s") %}
86+
{{ value.removesuffix(suffix + "s") }}s
87+
{% elif value.endswith(suffix) %}
88+
{{ value.removesuffix(suffix) }}
89+
{% else %}
90+
{{ value }}
91+
{% endif %}
9292
{% endfilter %}
9393
{% endmacro %}

0 commit comments

Comments
 (0)