.generator/src/generator/templates/api.j2 in datadog_api_client-2.2.0 vs .generator/src/generator/templates/api.j2 in datadog_api_client-2.3.0
- old
+ new
@@ -29,18 +29,25 @@
{%- if operation.description %}
#
{{ operation.description|block_comment|indent(4) }}
#
{%- endif %}
+ {%- if operation.deprecated %}
+ # @deprecated This API is deprecated.
+ #
+ {%- endif %}
{%- for name, parameter in operation|parameters if parameter.required %}
# @param {{ name|attribute_name }} [{{ get_type_for_parameter(parameter) }}] {{ parameter.get("description", "").replace('\n', ' ') }}
{%- endfor %}
# @param opts [Hash] the optional parameters
{%- for name, parameter in operation|parameters if not parameter.required %}
# @option opts [{{ get_type_for_parameter(parameter) }}] :{{ name|attribute_name }} {{ parameter.get("description", "").replace('\n', ' ') }}{% if "default" in parameter%} (default to {{ parameter.default|json }}) {% endif %}
{%- endfor %}
# @return [Array<({% if returnType %}{{ returnType }}{% else %}nil{% endif %}, Integer, Hash)>] {% if returnType %}{{ returnType }} data{% else %}nil{% endif %}, response status code and response headers
def {{ operation.operationId|snake_case }}_with_http_info({% for name, parameter in operation|parameters if parameter.required %}{{ name|attribute_name }}, {% endfor %}opts = {})
+ {%- if operation.deprecated %}
+ warn "[DEPRECATION] `{{ operation.operationId }}` is deprecated."
+ {%- endif %}
{%- if "x-unstable" in operation %}
unstable_enabled = @api_client.config.unstable_operations["{{ version }}.{{ operation.operationId|snake_case }}".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "{{ version }}.{{ operation.operationId|snake_case }}")
else