Skip to content

Commit e15149f

Browse files
committed
chore: finish deprecation for all sdks
1 parent 6b40a01 commit e15149f

File tree

14 files changed

+27
-15
lines changed

14 files changed

+27
-15
lines changed

templates/apple/Sources/Services/Service.swift.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ open class {{ service.name | caseUcfirst | overrideIdentifier }}: Service {
2424
@available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *)
2525
{%~ endif %}
2626
{%~ if method.deprecated %}
27-
@available(*, deprecated, message: "This API is deprecated and uses outdated terminologies. Please use `{{ method.replaceWith | capitalizeFirst }}` instead.")
27+
@available(*, deprecated, message: "This API is deprecated since {{ method.deprecatedVersion }} and uses outdated terminologies. Please use `{{ method.replaceWith | capitalizeFirst }}` instead.")
2828
{%~ endif %}
2929
open func {{ method.name | caseCamel | overrideIdentifier }}{% if method.responseModel | hasGenericType(spec) %}<T>{% endif %}(
3030
{%~ for parameter in method.parameters.all %}
@@ -91,7 +91,7 @@ open class {{ service.name | caseUcfirst | overrideIdentifier }}: Service {
9191
@available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *)
9292
{%~ endif %}
9393
{%~ if method.deprecated %}
94-
@available(*, deprecated, message: "This API is deprecated and uses outdated terminologies. Please use `{{ method.replaceWith | capitalizeFirst }}` instead.")
94+
@available(*, deprecated, message: "This API is deprecated since {{ method.deprecatedVersion }} and uses outdated terminologies. Please use `{{ method.replaceWith | capitalizeFirst }}` instead.")
9595
{%~ endif %}
9696
open func {{ method.name | caseCamel }}(
9797
{%~ for parameter in method.parameters.all %}

templates/cli/lib/commands/command.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const {{ service.name | caseLower }}{{ method.name | caseUcfirst }} = async ({
7373
{% if hasConsolePreview(method.name,service.name) %}, console{%- endif -%}
7474
}) => {
7575
{% if method.deprecated %}
76-
console.warn('Warning: This command is deprecated.{% if method.replaceWith %} Please use "{{ method.replaceWith | replace({'.': ' '}) }}" instead.{% endif %}');
76+
console.warn('Warning: This command is deprecated since {{ method.deprecatedVersion }}.{% if method.replaceWith %} Please use "{{ method.replaceWith | replace({'.': ' '}) }}" instead.{% endif %}');
7777
{% endif %}
7878
let client = !sdk ? await {% if service.name == "projects" %}sdkForConsole(){% else %}sdkForProject(){% endif %} :
7979
sdk;

templates/dart/lib/services/service.dart.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class {{ service.name | caseUcfirst }} extends Service {
1818
{{ method.description | dartComment }}
1919
{% endif %}
2020
{%~ if method.deprecated %}
21-
@Deprecated('This API is deprecated and uses outdated terminologies. Please use `{{ method.replaceWith | capitalizeFirst }}` instead.')
21+
@Deprecated('This API is deprecated since {{ method.deprecatedVersion }} and uses outdated terminologies. Please use `{{ method.replaceWith | capitalizeFirst }}` instead.')
2222
{%~ endif %}
2323
{% if method.type == 'location' %}Future<Uint8List>{% else %}{% if method.responseModel and method.responseModel != 'any' %}Future<models.{{method.responseModel | caseUcfirst | overrideIdentifier}}>{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel | overrideIdentifier }}({{ _self.method_parameters(method.parameters.all, method.consumes) }}) async {
2424
final String apiPath = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | overrideIdentifier }}{% if parameter.enumValues | length > 0 %}.value{% endif %}){% endfor %};

templates/deno/src/services/service.ts.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class {{ service.name | caseUcfirst }} extends Service {
7878
* @throws {AppwriteException}
7979
* @returns {Promise}
8080
{%~ if method.deprecated %}
81-
* @deprecated This API is deprecated and uses outdated terminologies.{% if method.replaceWith %} Please use `{{ method.replaceWith | capitalizeFirst }}` instead.{% endif %}
81+
* @deprecated This API is deprecated since {{ method.deprecatedVersion }} and uses outdated terminologies.{% if method.replaceWith %} Please use `{{ method.replaceWith | capitalizeFirst }}` instead.{% endif %}
8282
{%~ endif %}
8383
*/
8484
async {{ method.name | caseCamel }}{% if generics %}<{{generics}}>{% endif %}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required or parameter.nullable %}?{% endif %}: {{ parameter | typeName }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): Promise<{% if method.type == 'webAuth' %}string{% elseif method.type == 'location' %}ArrayBuffer{% else %}{% if method.responseModel and method.responseModel != 'any' %}{% if not spec.definitions[method.responseModel].additionalProperties %}Models.{% endif %}{{method.responseModel | caseUcfirst}}{% if generics_return %}<{{generics_return}}>{% endif %}{% else %}Response{% endif %}{% endif %}> {

templates/dotnet/Package/Services/ServiceTemplate.cs.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ namespace {{ spec.title | caseUcfirst }}.Services
2626
/// </para>
2727
{%~ endif %}
2828
/// </summary>
29+
{%~ if method.deprecated %}
30+
[Obsolete("This API is deprecated since {{ method.deprecatedVersion }} and uses outdated terminologies. Please use `{{ method.replaceWith | capitalizeFirst }}` instead.")]
31+
{%~ endif %}
2932
public Task{% if method.type == "webAuth" %}<String>{% else %}<{{ utils.resultType(spec.title, method) }}>{% endif %} {{ method.name | caseUcfirst }}({{ utils.method_parameters(method.parameters, method.consumes) }})
3033
{
3134
var apiPath = "{{ method.path }}"{% if method.parameters.path | length == 0 %};{% endif %}

templates/flutter/lib/services/service.dart.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class {{ service.name | caseUcfirst }} extends Service {
1919
{{ method.description|dartComment }}
2020
{% endif %}
2121
{%~ if method.deprecated %}
22-
@Deprecated('This API is deprecated and uses outdated terminologies. Please use `{{ method.replaceWith | capitalizeFirst }}` instead.')
22+
@Deprecated('This API is deprecated since {{ method.deprecatedVersion }} and uses outdated terminologies. Please use `{{ method.replaceWith | capitalizeFirst }}` instead.')
2323
{%~ endif %}
2424
{% if method.type == 'webAuth' %}Future{% elseif method.type == 'location' %}Future<Uint8List>{% else %}{% if method.responseModel and method.responseModel != 'any' %}Future<models.{{method.responseModel | caseUcfirst | overrideIdentifier}}>{% else %}Future{% endif %}{% endif %} {{ method.name | caseCamel | overrideIdentifier }}({{ _self.method_parameters(method.parameters.all, method.consumes) }}) async {
2525
{% if method.parameters.path | length > 0 %}final{% else %}const{% endif %} String apiPath = '{{ method.path }}'{% for parameter in method.parameters.path %}.replaceAll('{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}', {{ parameter.name | caseCamel | overrideIdentifier }}{% if parameter.enumValues | length > 0 %}.value{% endif %}){% endfor %};

templates/go/services/service.go.twig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ func (srv *{{ service.name | caseUcfirst }}) With{{ method.name | caseUcfirst }}
8787
{% else %}
8888
// {{ method.name | caseUcfirst }}
8989
{% endif %}
90+
{% if method.deprecated %}
91+
//
92+
// Deprecated: This API is deprecated since {{ method.deprecatedVersion }} and uses outdated terminologies. Please use `{{ method.replaceWith | capitalizeFirst }}` instead.
93+
{% endif %}
9094
func (srv *{{ service.name | caseUcfirst }}) {{ method.name | caseUcfirst }}({{ params }})(*{{ method | returnType(spec, spec.title | caseLower) }}, error) {
9195
{% if method.parameters.path|length > 0 %}
9296
r := strings.NewReplacer({% for parameter in method.parameters.path %}"{{ '{' }}{{ parameter.name | caseCamel }}{{ '}' }}", {{ parameter.name | caseUcfirst }}{% if not loop.last %}, {% endif %}{% endfor %})

templates/node/src/services/template.ts.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class {{ service.name | caseUcfirst }} {
3636
* @throws {{ '{' }}{{ spec.title | caseUcfirst}}Exception}
3737
* @returns {{ '{' }}{{ method | getReturn(spec) | raw }}{{ '}' }}
3838
{%~ if method.deprecated %}
39-
* @deprecated This API is deprecated and uses outdated terminologies.{% if method.replaceWith %} Please use `{{ method.replaceWith | capitalizeFirst }}` instead.{% endif %}
39+
* @deprecated This API is deprecated since {{ method.deprecatedVersion }} and uses outdated terminologies.{% if method.replaceWith %} Please use `{{ method.replaceWith | capitalizeFirst }}` instead.{% endif %}
4040
{%~ endif %}
4141
*/
4242
{{ method.name | caseCamel }}{{ method.responseModel | getGenerics(spec) | raw }}({% for parameter in method.parameters.all %}{{ parameter.name | caseCamel | escapeKeyword }}{% if not parameter.required or parameter.nullable %}?{% endif %}: {{ parameter | getPropertyType(method) | raw }}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, onProgress = (progress: UploadProgress) => {}{% endif %}): {{ method | getReturn(spec) | raw }} {

templates/php/src/Services/Service.php.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class {{ service.name | caseUcfirst }} extends Service
4545
{% if method.deprecated %}
4646
*
4747
{% set method_name = method.replaceWith | split('.') | last | caseCamel %}
48-
{% set deprecated_message = deprecated_message ~ 'Please use ' ~ method_name ~ '() instead.' %}
48+
{% set deprecated_message = deprecated_message ~ 'This API is deprecated since ' ~ method.deprecatedVersion ~ ' and uses outdated terminologies. Please use `' ~ method_name ~ '()` instead.' %}
4949
* @deprecated {{ deprecated_message }}
5050
{% if method.replaceWith %}
5151
* @see {{ method.replaceWith | replace({'.': '::'}) | capitalizeFirst }}

templates/python/package/services/service.py.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ class {{ service.name | caseUcfirst }}(Service):
3535
{% if method.parameters.all|length > 0 or 'multipart/form-data' in method.consumes %}
3636

3737
{% if method.deprecated %}
38-
.. deprecated::
39-
This API is deprecated and uses outdated terminologies.{% if method.replaceWith %} Please use `{{ method.replaceWith | caseSnakeExceptFirstDot }}` instead.{% endif %}
38+
.. deprecated::{{ method.deprecatedVersion }}
39+
This API is deprecated since {{ method.deprecatedVersion }} and uses outdated terminologies.{% if method.replaceWith %} Please use `{{ method.replaceWith | caseSnakeExceptFirstDot }}` instead.{% endif %}
4040
{% endif %}
4141

4242
Parameters

0 commit comments

Comments
 (0)