@@ -30,6 +30,18 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) {
30
30
{%~ endfor %}
31
31
* @return [{{ method | returnType(spec , sdk .namespace | caseDot ) | raw }}]
32
32
*/
33
+ {%~ if method .deprecated %}
34
+ {% set deprecated_message = " This API is deprecated and uses outdated terminologies." %}
35
+ {% if method .replaceWith %}
36
+ {% set deprecated_message = deprecated_message ~ ' Please use ' ~ (method .replaceWith | capitalizeFirst ) ~ ' instead.' %}
37
+ @Deprecated(
38
+ "{{ deprecated_message }}",
39
+ ReplaceWith("{{ sdk .namespace | caseDot }}.services.{{ method .replaceWith | capitalizeFirst }}")
40
+ )
41
+ {% else %}
42
+ @Deprecated("{{ deprecated_message }}")
43
+ {% endif %}
44
+ {%~ endif %}
33
45
{%~ if method .parameters .all | reduce((carry , param ) => carry or not param .required ) %}
34
46
@JvmOverloads
35
47
{%~ endif %}
@@ -91,6 +103,18 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) {
91
103
{%~ endfor %}
92
104
* @return [{{ method | returnType(spec , sdk .namespace | caseDot ) | raw }}]
93
105
*/
106
+ {%~ if method .deprecated %}
107
+ {% set deprecated_message = " This API is deprecated and uses outdated terminologies." %}
108
+ {% if method .replaceWith %}
109
+ {% set deprecated_message = deprecated_message ~ ' Please use ' ~ (method .replaceWith | capitalizeFirst ) ~ ' instead.' %}
110
+ @Deprecated(
111
+ "{{ deprecated_message }}",
112
+ ReplaceWith("{{ sdk .namespace | caseDot }}.services.{{ method .replaceWith | capitalizeFirst }}")
113
+ )
114
+ {% else %}
115
+ @Deprecated("{{ deprecated_message }}")
116
+ {% endif %}
117
+ {%~ endif %}
94
118
{%~ if method .parameters .all | reduce((carry , param ) => carry or not param .required ) %}
95
119
@JvmOverloads
96
120
{%~ endif %}
0 commit comments