Skip to content

Commit

Permalink
chore(go): add missing ACLs in description, remove duplicated depreca…
Browse files Browse the repository at this point in the history
…tion notice (#2825)
  • Loading branch information
shortcuts authored Mar 4, 2024
1 parent 7e19906 commit 115dd17
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 42 deletions.
45 changes: 3 additions & 42 deletions templates/go/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -317,4 +278,4 @@ func (c *APIClient) {{nickname}}WithContext(ctx context.Context, {{#hasParams}}r

{{#isSearchClient}}
{{> search_helpers}}
{{/isSearchClient}}
{{/isSearchClient}}
23 changes: 23 additions & 0 deletions templates/go/operation_description.mustache
Original file line number Diff line number Diff line change
@@ -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}}
*/

1 comment on commit 115dd17

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.