From 115dd1778479634ab1f19d04cbd1af65f22a60a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Mon, 4 Mar 2024 14:55:47 +0100 Subject: [PATCH] chore(go): add missing ACLs in description, remove duplicated deprecation notice (#2825) --- templates/go/api.mustache | 45 ++------------------- templates/go/operation_description.mustache | 23 +++++++++++ 2 files changed, 26 insertions(+), 42 deletions(-) create mode 100644 templates/go/operation_description.mustache diff --git a/templates/go/api.mustache b/templates/go/api.mustache index 1cc66b915d..bd2c7606d7 100644 --- a/templates/go/api.mustache +++ b/templates/go/api.mustache @@ -109,53 +109,14 @@ func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/s {{/hasParams}} /* {{operationId}} Wraps {{nickname}}WithContext using context.Background. -{{#notes}} - -{{{unescapedNotes}}} -{{/notes}} -{{#vendorExtensions}} -{{#x-acl.0}} - -Required API Key ACLs:{{/x-acl.0}} -{{#x-acl}} - - {{.}} -{{/x-acl}} -{{/vendorExtensions}} - -Request can be constructed by NewApi{{operationId}}Request with parameters below. - {{#allParams}} - @param {{paramName}} {{dataType}}{{#description}} - {{{.}}}{{/description}} - {{/allParams}} - {{#returnType}}@return {{{.}}}{{/returnType}} -{{#isDeprecated}} - -Deprecated -{{/isDeprecated}} -*/ -{{#isDeprecated}} -// Deprecated -{{/isDeprecated}} +{{> operation_description}} func (c *APIClient) {{nickname}}({{#hasParams}}r {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request,{{/hasParams}} opts ...Option) ({{#returnType}}{{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}error) { return c.{{nickname}}WithContext(context.Background(), {{#hasParams}}r,{{/hasParams}} opts...) } /* {{operationId}} -{{#notes}} - -{{{unescapedNotes}}} -{{/notes}} - -Request can be constructed by NewApi{{operationId}}Request with parameters below. - {{#allParams}} - @param {{paramName}} {{dataType}}{{#description}} - {{{.}}}{{/description}} - {{/allParams}} - {{#returnType}}@return {{{.}}}{{/returnType}} -{{#isDeprecated}} - -Deprecated -{{/isDeprecated}} -*/ +{{> operation_description}} func (c *APIClient) {{nickname}}WithContext(ctx context.Context, {{#hasParams}}r {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request,{{/hasParams}} opts ...Option) ({{#returnType}}{{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}error) { var ( postBody any @@ -317,4 +278,4 @@ func (c *APIClient) {{nickname}}WithContext(ctx context.Context, {{#hasParams}}r {{#isSearchClient}} {{> search_helpers}} -{{/isSearchClient}} +{{/isSearchClient}} \ No newline at end of file diff --git a/templates/go/operation_description.mustache b/templates/go/operation_description.mustache new file mode 100644 index 0000000000..14976120b3 --- /dev/null +++ b/templates/go/operation_description.mustache @@ -0,0 +1,23 @@ +{{#notes}} + +{{{unescapedNotes}}} +{{/notes}} +{{#vendorExtensions}} +{{#x-acl.0}} + +Required API Key ACLs:{{/x-acl.0}} +{{#x-acl}} + - {{.}} +{{/x-acl}} +{{/vendorExtensions}} + +Request can be constructed by NewApi{{operationId}}Request with parameters below. + {{#allParams}} + @param {{paramName}} {{dataType}}{{#description}} - {{{.}}}{{/description}} + {{/allParams}} + {{#returnType}}@return {{{.}}}{{/returnType}} +{{#isDeprecated}} + +Deprecated +{{/isDeprecated}} +*/ \ No newline at end of file