File: operation_group.py.jinja2

package info (click to toggle)
python-azure 20250603%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 851,724 kB
  • sloc: python: 7,362,925; ansic: 804; javascript: 287; makefile: 195; sh: 145; xml: 109
file content (28 lines) | stat: -rw-r--r-- 1,164 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{% for operation in operation_group.operations %}
    {% if operation.request_builder and not async_mode %}
{{ operation.request_builder }}
    {% endif %}
{% endfor %}
class {{ operation_group.name }}{{ "(" + operation_group.name.replace("Operations", "") + "ABC)" if operation_group.is_mixin else "" }}:
{% if not operation_group.is_mixin %}
    """
    {{ operation_group.doc(async_mode) }}
    """
    models = _models

    def __init__(self, *args, **kwargs):
        input_args = list(args)
        self._client = input_args.pop(0) if input_args else kwargs.pop("client")
        self._config = input_args.pop(0) if input_args else kwargs.pop("config")
        self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
        self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
        self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
{% else %}
    def _api_version(self, op_name: str) -> str:
       return self._get_api_version(op_name)

{% endif %}
    {% for operation in operation_group.operations %}
        {% include "operation.py.jinja2" %}

    {% endfor %}