-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add javadocs for operations and deprecate old paginator methods (…
- Loading branch information
Showing
5 changed files
with
63 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 19 additions & 18 deletions
37
...or/openapi/src/main/resources/templates/expediagroup-sdk/client/paginatorMethods.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
{{#operation}} | ||
{{#vendorExtensions}} | ||
{{#x-sdk-paginated}} | ||
{{#returnType}} | ||
@JvmOverloads | ||
fun {{operationId}}Paginator({{>client/apiParamsDecleration}}): Paginator<{{{returnType}}}> { | ||
val response = {{operationId}}WithResponse({{>client/apiParamsPassed}}) | ||
return Paginator(this, response, {{#fallbackBody}}{{/fallbackBody}}) { it.body<{{{returnType}}}>() } | ||
} | ||
{{#returnType}} | ||
@JvmOverloads | ||
fun getPaginator(operation: {{operationIdCamelCase}}Operation): ResponsePaginator<{{{returnType}}}> { | ||
val response = execute(operation) | ||
return ResponsePaginator(this, response, {{fallbackBody}}) { it.body<{{{returnType}}}>() } | ||
} | ||
|
||
@JvmOverloads | ||
fun {{operationId}}PaginatorWithResponse({{>client/apiParamsDecleration}}): ResponsePaginator<{{{returnType}}}> { | ||
val response = {{operationId}}WithResponse({{>client/apiParamsPassed}}) | ||
return ResponsePaginator(this, response, {{#fallbackBody}}{{/fallbackBody}}) { it.body<{{{returnType}}}>() } | ||
} | ||
@JvmOverloads | ||
@Deprecated("Use getPaginator method instead", ReplaceWith("getPaginator(operation: {{operationIdCamelCase}}Operation)")) | ||
fun {{operationId}}Paginator({{>client/apiParamsDecleration}}): Paginator<{{{returnType}}}> { | ||
val response = {{operationId}}WithResponse({{>client/apiParamsPassed}}) | ||
return Paginator(this, response, {{fallbackBody}}) { it.body<{{{returnType}}}>() } | ||
} | ||
|
||
{{/returnType}} | ||
{{/x-sdk-paginated}} | ||
{{/vendorExtensions}} | ||
{{/operation}} | ||
@JvmOverloads | ||
@Deprecated("Use getPaginator method instead", ReplaceWith("getPaginator(operation: {{operationIdCamelCase}}Operation)")) | ||
fun {{operationId}}PaginatorWithResponse({{>client/apiParamsDecleration}}): ResponsePaginator<{{{returnType}}}> { | ||
val response = {{operationId}}WithResponse({{>client/apiParamsPassed}}) | ||
return ResponsePaginator(this, response, {{fallbackBody}}) { it.body<{{{returnType}}}>() } | ||
} | ||
{{/returnType}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters