Skip to content

Commit

Permalink
Only named args in methods
Browse files Browse the repository at this point in the history
  • Loading branch information
artsmolin committed Nov 1, 2023
1 parent 9a23ce2 commit 720aa79
Show file tree
Hide file tree
Showing 10 changed files with 185 additions and 8 deletions.
22 changes: 21 additions & 1 deletion examples/petstore/client_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# Generator info:
# GitHub Page: https://github.com/artsmolin/pythogen
# Version: 0.2.31
# Version: 0.2.32
# ==============================================================================

# jinja2: lstrip_blocks: "True"
Expand Down Expand Up @@ -502,6 +502,7 @@ def __init__(

async def findPetsByStatus(
self,
*,
query_params: FindPetsByStatusQueryParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -588,6 +589,7 @@ async def findPetsByStatus(

async def findPetsByTags(
self,
*,
query_params: FindPetsByTagsQueryParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -674,6 +676,7 @@ async def findPetsByTags(

async def getPetById(
self,
*,
path_params: GetPetByIdPathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -771,6 +774,7 @@ async def getPetById(

async def getInventory(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
meta: PythogenMetaBox | None = None,
Expand Down Expand Up @@ -842,6 +846,7 @@ async def getInventory(

async def getOrderById(
self,
*,
path_params: GetOrderByIdPathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -939,6 +944,7 @@ async def getOrderById(

async def loginUser(
self,
*,
query_params: LoginUserQueryParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -1025,6 +1031,7 @@ async def loginUser(

async def logoutUser(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
meta: PythogenMetaBox | None = None,
Expand Down Expand Up @@ -1093,6 +1100,7 @@ async def logoutUser(

async def getUserByName(
self,
*,
path_params: GetUserByNamePathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -1190,6 +1198,7 @@ async def getUserByName(

async def addPet(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
body: Pet | dict[str, Any] | None = None,
Expand Down Expand Up @@ -1280,6 +1289,7 @@ async def addPet(

async def addPetOrTag(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
body: AddpetortagRequestBody | dict[str, Any] | None = None,
Expand Down Expand Up @@ -1370,6 +1380,7 @@ async def addPetOrTag(

async def updatePetWithForm(
self,
*,
path_params: UpdatePetWithFormPathParams | dict[str, Any],
query_params: UpdatePetWithFormQueryParams | dict[str, Any],
auth: BasicAuth | None = None,
Expand Down Expand Up @@ -1457,6 +1468,7 @@ async def updatePetWithForm(

async def uploadFile(
self,
*,
path_params: UploadFilePathParams | dict[str, Any],
query_params: UploadFileQueryParams | dict[str, Any],
auth: BasicAuth | None = None,
Expand Down Expand Up @@ -1544,6 +1556,7 @@ async def uploadFile(

async def placeOrder(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
body: Order | dict[str, Any] | None = None,
Expand Down Expand Up @@ -1634,6 +1647,7 @@ async def placeOrder(

async def createUser(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
body: User | dict[str, Any] | None = None,
Expand Down Expand Up @@ -1710,6 +1724,7 @@ async def createUser(

async def createUsersWithListInput(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
body: list[User] | dict[str, Any] | None = None,
Expand Down Expand Up @@ -1789,6 +1804,7 @@ async def createUsersWithListInput(

async def updatePet(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
body: Pet | dict[str, Any] | None = None,
Expand Down Expand Up @@ -1901,6 +1917,7 @@ async def updatePet(

async def updateUser(
self,
*,
path_params: UpdateUserPathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -1981,6 +1998,7 @@ async def updateUser(

async def deletePet(
self,
*,
path_params: DeletePetPathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -2070,6 +2088,7 @@ async def deletePet(

async def deleteOrder(
self,
*,
path_params: DeleteOrderPathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -2164,6 +2183,7 @@ async def deleteOrder(

async def deleteUser(
self,
*,
path_params: DeleteUserPathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down
22 changes: 21 additions & 1 deletion examples/petstore/client_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# Generator info:
# GitHub Page: https://github.com/artsmolin/pythogen
# Version: 0.2.31
# Version: 0.2.32
# ==============================================================================

# jinja2: lstrip_blocks: "True"
Expand Down Expand Up @@ -502,6 +502,7 @@ def __init__(

def findPetsByStatus(
self,
*,
query_params: FindPetsByStatusQueryParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -586,6 +587,7 @@ def findPetsByStatus(

def findPetsByTags(
self,
*,
query_params: FindPetsByTagsQueryParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -670,6 +672,7 @@ def findPetsByTags(

def getPetById(
self,
*,
path_params: GetPetByIdPathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -765,6 +768,7 @@ def getPetById(

def getInventory(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
meta: PythogenMetaBox | None = None,
Expand Down Expand Up @@ -834,6 +838,7 @@ def getInventory(

def getOrderById(
self,
*,
path_params: GetOrderByIdPathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -929,6 +934,7 @@ def getOrderById(

def loginUser(
self,
*,
query_params: LoginUserQueryParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -1013,6 +1019,7 @@ def loginUser(

def logoutUser(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
meta: PythogenMetaBox | None = None,
Expand Down Expand Up @@ -1079,6 +1086,7 @@ def logoutUser(

def getUserByName(
self,
*,
path_params: GetUserByNamePathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -1174,6 +1182,7 @@ def getUserByName(

def addPet(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
body: Pet | dict[str, Any] | None = None,
Expand Down Expand Up @@ -1264,6 +1273,7 @@ def addPet(

def addPetOrTag(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
body: AddpetortagRequestBody | dict[str, Any] | None = None,
Expand Down Expand Up @@ -1354,6 +1364,7 @@ def addPetOrTag(

def updatePetWithForm(
self,
*,
path_params: UpdatePetWithFormPathParams | dict[str, Any],
query_params: UpdatePetWithFormQueryParams | dict[str, Any],
auth: BasicAuth | None = None,
Expand Down Expand Up @@ -1439,6 +1450,7 @@ def updatePetWithForm(

def uploadFile(
self,
*,
path_params: UploadFilePathParams | dict[str, Any],
query_params: UploadFileQueryParams | dict[str, Any],
auth: BasicAuth | None = None,
Expand Down Expand Up @@ -1526,6 +1538,7 @@ def uploadFile(

def placeOrder(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
body: Order | dict[str, Any] | None = None,
Expand Down Expand Up @@ -1616,6 +1629,7 @@ def placeOrder(

def createUser(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
body: User | dict[str, Any] | None = None,
Expand Down Expand Up @@ -1692,6 +1706,7 @@ def createUser(

def createUsersWithListInput(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
body: list[User] | dict[str, Any] | None = None,
Expand Down Expand Up @@ -1771,6 +1786,7 @@ def createUsersWithListInput(

def updatePet(
self,
*,
auth: BasicAuth | None = None,
content: str | bytes | None = None,
body: Pet | dict[str, Any] | None = None,
Expand Down Expand Up @@ -1883,6 +1899,7 @@ def updatePet(

def updateUser(
self,
*,
path_params: UpdateUserPathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -1963,6 +1980,7 @@ def updateUser(

def deletePet(
self,
*,
path_params: DeletePetPathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -2050,6 +2068,7 @@ def deletePet(

def deleteOrder(
self,
*,
path_params: DeleteOrderPathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down Expand Up @@ -2142,6 +2161,7 @@ def deleteOrder(

def deleteUser(
self,
*,
path_params: DeleteUserPathParams | dict[str, Any],
auth: BasicAuth | None = None,
content: str | bytes | None = None,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pythogen"
version = "0.2.31"
version = "0.2.32"
description = "Generator of python HTTP-clients from OpenApi specification."
homepage = "https://github.com/artsmolin/pythogen"
repository = "https://github.com/artsmolin/pythogen"
Expand Down
1 change: 1 addition & 0 deletions pythogen/templates/http_client/method.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
async def {{ operation.fn_name }}(
{%- endif %}
self,
*,
{#- path params -#}
{% if operation.path_params %}
path_params: {{ classname(operation.fn_name) }}PathParams | dict[str, Any],
Expand Down
Loading

0 comments on commit 720aa79

Please sign in to comment.