From 09e57761524a04a8cd5203442a34af3e1e795f48 Mon Sep 17 00:00:00 2001 From: artsmolin Date: Sat, 16 Sep 2023 13:23:20 +0300 Subject: [PATCH] Add docs to methods --- examples/petstore/client_async.py | 160 ++++++++++++++++++- examples/petstore/client_sync.py | 160 ++++++++++++++++++- pyproject.toml | 2 +- pythogen/templates/http_client/main.j2 | 18 +++ pythogen/templates/http_client/method.j2 | 6 + tests/clients/async_client.py | 174 ++++++++++++++++++++- tests/clients/async_client_with_headers.py | 174 ++++++++++++++++++++- tests/clients/async_client_with_metrics.py | 174 ++++++++++++++++++++- tests/clients/sync_client.py | 174 ++++++++++++++++++++- tests/clients/sync_client_with_metrics.py | 174 ++++++++++++++++++++- 10 files changed, 1208 insertions(+), 8 deletions(-) diff --git a/examples/petstore/client_async.py b/examples/petstore/client_async.py index c187e99..66aa415 100644 --- a/examples/petstore/client_async.py +++ b/examples/petstore/client_async.py @@ -7,7 +7,7 @@ # # Generator info: # GitHub Page: https://github.com/artsmolin/pythogen -# Version: 0.2.24 +# Version: 0.2.25 # ============================================================================== # jinja2: lstrip_blocks: "True" @@ -470,6 +470,24 @@ def __init__( metrics_integration: MetricsIntegration | None = None, logs_integration: LogsIntegration | None = DefaultLogsIntegration(), ): + """ + Parameters + ---------- + base_url + Base URL + timeout + In seconds + client_name + Used in metrics + client + httpx-client + headers + Headers that will be passed in all requests + metrics_integration + The object that is responsible for collecting and sending metrics + logs_integration + The object that is responsible for logging events + """ self.client = client or httpx.AsyncClient(timeout=Timeout(timeout)) self.base_url = base_url self.headers = headers or {} @@ -483,6 +501,13 @@ async def findPetsByStatus( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | list[Pet]: + """ + GET /pet/findByStatus + Operation ID: findPetsByStatus + Summary: Finds Pets by status + Description: Multiple status values can be provided with comma separated strings + """ + method = "get" path = "/pet/findByStatus" @@ -557,6 +582,13 @@ async def findPetsByTags( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | list[Pet]: + """ + GET /pet/findByTags + Operation ID: findPetsByTags + Summary: Finds Pets by tags + Description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + """ + method = "get" path = "/pet/findByTags" @@ -631,6 +663,13 @@ async def getPetById( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | Pet: + """ + GET /pet/{petId} + Operation ID: getPetById + Summary: Find pet by ID + Description: Returns a single pet + """ + method = "get" if isinstance(path_params, GetPetByIdPathParams): @@ -715,6 +754,13 @@ async def getInventory( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetinventoryResponse200 | None: + """ + GET /store/inventory + Operation ID: getInventory + Summary: Returns pet inventories by status + Description: Returns a map of status codes to quantities + """ + method = "get" path = "/store/inventory" @@ -775,6 +821,13 @@ async def getOrderById( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | Order: + """ + GET /store/order/{orderId} + Operation ID: getOrderById + Summary: Find purchase order by ID + Description: For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. + """ + method = "get" if isinstance(path_params, GetOrderByIdPathParams): @@ -860,6 +913,13 @@ async def loginUser( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | str: + """ + GET /user/login + Operation ID: loginUser + Summary: Logs user into the system + Description: + """ + method = "get" path = "/user/login" @@ -933,6 +993,13 @@ async def logoutUser( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> None: + """ + GET /user/logout + Operation ID: logoutUser + Summary: Logs out current logged in user session + Description: + """ + method = "get" path = "/user/logout" @@ -990,6 +1057,13 @@ async def getUserByName( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | User: + """ + GET /user/{username} + Operation ID: getUserByName + Summary: Get user by user name + Description: + """ + method = "get" if isinstance(path_params, GetUserByNamePathParams): @@ -1075,6 +1149,13 @@ async def addPet( content: str | bytes | None = None, body: Pet | dict[str, Any] | None = None, ) -> EmptyBody | Pet: + """ + POST /pet + Operation ID: addPet + Summary: Add a new pet to the store + Description: Add a new pet to the store + """ + method = "post" path = "/pet" @@ -1153,6 +1234,13 @@ async def addPetOrTag( content: str | bytes | None = None, body: AddpetortagRequestBody | dict[str, Any] | None = None, ) -> AddpetortagResponse200 | EmptyBody: + """ + POST /pet_or_tag + Operation ID: addPetOrTag + Summary: Add a new pet or tag to the store + Description: Add a new pet or tag to the store + """ + method = "post" path = "/pet_or_tag" @@ -1232,6 +1320,13 @@ async def updatePetWithForm( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | None: + """ + POST /pet/{petId} + Operation ID: updatePetWithForm + Summary: Updates a pet in the store with form data + Description: + """ + method = "post" if isinstance(path_params, UpdatePetWithFormPathParams): @@ -1308,6 +1403,13 @@ async def uploadFile( content: str | bytes | None = None, body: bytes | dict[str, Any] | None = None, ) -> ApiResponse | None: + """ + POST /pet/{petId}/uploadImage + Operation ID: uploadFile + Summary: uploads an image + Description: + """ + method = "post" if isinstance(path_params, UploadFilePathParams): @@ -1381,6 +1483,13 @@ async def placeOrder( content: str | bytes | None = None, body: Order | dict[str, Any] | None = None, ) -> EmptyBody | Order: + """ + POST /store/order + Operation ID: placeOrder + Summary: Place an order for a pet + Description: Place a new order in the store + """ + method = "post" path = "/store/order" @@ -1459,6 +1568,13 @@ async def createUser( content: str | bytes | None = None, body: User | dict[str, Any] | None = None, ) -> None: + """ + POST /user + Operation ID: createUser + Summary: Create user + Description: This can only be done by the logged in user. + """ + method = "post" path = "/user" @@ -1523,6 +1639,13 @@ async def createUsersWithListInput( content: str | bytes | None = None, body: list[User] | dict[str, Any] | None = None, ) -> User | None: + """ + POST /user/createWithList + Operation ID: createUsersWithListInput + Summary: Creates list of users with given input array + Description: Creates list of users with given input array + """ + method = "post" path = "/user/createWithList" @@ -1590,6 +1713,13 @@ async def updatePet( content: str | bytes | None = None, body: Pet | dict[str, Any] | None = None, ) -> EmptyBody | Pet: + """ + PUT /pet + Operation ID: updatePet + Summary: Update an existing pet + Description: Update an existing pet by Id + """ + method = "put" path = "/pet" @@ -1691,6 +1821,13 @@ async def updateUser( content: str | bytes | None = None, body: User | dict[str, Any] | None = None, ) -> None: + """ + PUT /user/{username} + Operation ID: updateUser + Summary: Update user + Description: This can only be done by the logged in user. + """ + method = "put" if isinstance(path_params, UpdateUserPathParams): @@ -1759,6 +1896,13 @@ async def deletePet( content: str | bytes | None = None, headers: DeletePetHeaders | dict[str, Any] | None = None, ) -> EmptyBody | None: + """ + DELETE /pet/{petId} + Operation ID: deletePet + Summary: Deletes a pet + Description: + """ + method = "delete" if isinstance(path_params, DeletePetPathParams): @@ -1835,6 +1979,13 @@ async def deleteOrder( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | None: + """ + DELETE /store/order/{orderId} + Operation ID: deleteOrder + Summary: Delete purchase order by ID + Description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + """ + method = "delete" if isinstance(path_params, DeleteOrderPathParams): @@ -1917,6 +2068,13 @@ async def deleteUser( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | None: + """ + DELETE /user/{username} + Operation ID: deleteUser + Summary: Delete user + Description: This can only be done by the logged in user. + """ + method = "delete" if isinstance(path_params, DeleteUserPathParams): diff --git a/examples/petstore/client_sync.py b/examples/petstore/client_sync.py index 7eb6044..70cd155 100644 --- a/examples/petstore/client_sync.py +++ b/examples/petstore/client_sync.py @@ -7,7 +7,7 @@ # # Generator info: # GitHub Page: https://github.com/artsmolin/pythogen -# Version: 0.2.24 +# Version: 0.2.25 # ============================================================================== # jinja2: lstrip_blocks: "True" @@ -470,6 +470,24 @@ def __init__( metrics_integration: MetricsIntegration | None = None, logs_integration: LogsIntegration | None = DefaultLogsIntegration(), ): + """ + Parameters + ---------- + base_url + Base URL + timeout + In seconds + client_name + Used in metrics + client + httpx-client + headers + Headers that will be passed in all requests + metrics_integration + The object that is responsible for collecting and sending metrics + logs_integration + The object that is responsible for logging events + """ self.client = client or httpx.Client(timeout=Timeout(timeout)) self.base_url = base_url self.headers = headers or {} @@ -483,6 +501,13 @@ def findPetsByStatus( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | list[Pet]: + """ + GET /pet/findByStatus + Operation ID: findPetsByStatus + Summary: Finds Pets by status + Description: Multiple status values can be provided with comma separated strings + """ + method = "get" path = "/pet/findByStatus" @@ -555,6 +580,13 @@ def findPetsByTags( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | list[Pet]: + """ + GET /pet/findByTags + Operation ID: findPetsByTags + Summary: Finds Pets by tags + Description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + """ + method = "get" path = "/pet/findByTags" @@ -627,6 +659,13 @@ def getPetById( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | Pet: + """ + GET /pet/{petId} + Operation ID: getPetById + Summary: Find pet by ID + Description: Returns a single pet + """ + method = "get" if isinstance(path_params, GetPetByIdPathParams): @@ -709,6 +748,13 @@ def getInventory( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetinventoryResponse200 | None: + """ + GET /store/inventory + Operation ID: getInventory + Summary: Returns pet inventories by status + Description: Returns a map of status codes to quantities + """ + method = "get" path = "/store/inventory" @@ -767,6 +813,13 @@ def getOrderById( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | Order: + """ + GET /store/order/{orderId} + Operation ID: getOrderById + Summary: Find purchase order by ID + Description: For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. + """ + method = "get" if isinstance(path_params, GetOrderByIdPathParams): @@ -850,6 +903,13 @@ def loginUser( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | str: + """ + GET /user/login + Operation ID: loginUser + Summary: Logs user into the system + Description: + """ + method = "get" path = "/user/login" @@ -921,6 +981,13 @@ def logoutUser( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> None: + """ + GET /user/logout + Operation ID: logoutUser + Summary: Logs out current logged in user session + Description: + """ + method = "get" path = "/user/logout" @@ -976,6 +1043,13 @@ def getUserByName( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | User: + """ + GET /user/{username} + Operation ID: getUserByName + Summary: Get user by user name + Description: + """ + method = "get" if isinstance(path_params, GetUserByNamePathParams): @@ -1059,6 +1133,13 @@ def addPet( content: str | bytes | None = None, body: Pet | dict[str, Any] | None = None, ) -> EmptyBody | Pet: + """ + POST /pet + Operation ID: addPet + Summary: Add a new pet to the store + Description: Add a new pet to the store + """ + method = "post" path = "/pet" @@ -1137,6 +1218,13 @@ def addPetOrTag( content: str | bytes | None = None, body: AddpetortagRequestBody | dict[str, Any] | None = None, ) -> AddpetortagResponse200 | EmptyBody: + """ + POST /pet_or_tag + Operation ID: addPetOrTag + Summary: Add a new pet or tag to the store + Description: Add a new pet or tag to the store + """ + method = "post" path = "/pet_or_tag" @@ -1216,6 +1304,13 @@ def updatePetWithForm( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | None: + """ + POST /pet/{petId} + Operation ID: updatePetWithForm + Summary: Updates a pet in the store with form data + Description: + """ + method = "post" if isinstance(path_params, UpdatePetWithFormPathParams): @@ -1290,6 +1385,13 @@ def uploadFile( content: str | bytes | None = None, body: bytes | dict[str, Any] | None = None, ) -> ApiResponse | None: + """ + POST /pet/{petId}/uploadImage + Operation ID: uploadFile + Summary: uploads an image + Description: + """ + method = "post" if isinstance(path_params, UploadFilePathParams): @@ -1363,6 +1465,13 @@ def placeOrder( content: str | bytes | None = None, body: Order | dict[str, Any] | None = None, ) -> EmptyBody | Order: + """ + POST /store/order + Operation ID: placeOrder + Summary: Place an order for a pet + Description: Place a new order in the store + """ + method = "post" path = "/store/order" @@ -1441,6 +1550,13 @@ def createUser( content: str | bytes | None = None, body: User | dict[str, Any] | None = None, ) -> None: + """ + POST /user + Operation ID: createUser + Summary: Create user + Description: This can only be done by the logged in user. + """ + method = "post" path = "/user" @@ -1505,6 +1621,13 @@ def createUsersWithListInput( content: str | bytes | None = None, body: list[User] | dict[str, Any] | None = None, ) -> User | None: + """ + POST /user/createWithList + Operation ID: createUsersWithListInput + Summary: Creates list of users with given input array + Description: Creates list of users with given input array + """ + method = "post" path = "/user/createWithList" @@ -1572,6 +1695,13 @@ def updatePet( content: str | bytes | None = None, body: Pet | dict[str, Any] | None = None, ) -> EmptyBody | Pet: + """ + PUT /pet + Operation ID: updatePet + Summary: Update an existing pet + Description: Update an existing pet by Id + """ + method = "put" path = "/pet" @@ -1673,6 +1803,13 @@ def updateUser( content: str | bytes | None = None, body: User | dict[str, Any] | None = None, ) -> None: + """ + PUT /user/{username} + Operation ID: updateUser + Summary: Update user + Description: This can only be done by the logged in user. + """ + method = "put" if isinstance(path_params, UpdateUserPathParams): @@ -1741,6 +1878,13 @@ def deletePet( content: str | bytes | None = None, headers: DeletePetHeaders | dict[str, Any] | None = None, ) -> EmptyBody | None: + """ + DELETE /pet/{petId} + Operation ID: deletePet + Summary: Deletes a pet + Description: + """ + method = "delete" if isinstance(path_params, DeletePetPathParams): @@ -1815,6 +1959,13 @@ def deleteOrder( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | None: + """ + DELETE /store/order/{orderId} + Operation ID: deleteOrder + Summary: Delete purchase order by ID + Description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + """ + method = "delete" if isinstance(path_params, DeleteOrderPathParams): @@ -1895,6 +2046,13 @@ def deleteUser( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> EmptyBody | None: + """ + DELETE /user/{username} + Operation ID: deleteUser + Summary: Delete user + Description: This can only be done by the logged in user. + """ + method = "delete" if isinstance(path_params, DeleteUserPathParams): diff --git a/pyproject.toml b/pyproject.toml index 0352000..6891430 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pythogen" -version = "0.2.24" +version = "0.2.25" description = "Generator of python HTTP-clients from OpenApi specification." homepage = "https://github.com/artsmolin/pythogen" repository = "https://github.com/artsmolin/pythogen" diff --git a/pythogen/templates/http_client/main.j2 b/pythogen/templates/http_client/main.j2 index a016367..37f6cf4 100644 --- a/pythogen/templates/http_client/main.j2 +++ b/pythogen/templates/http_client/main.j2 @@ -327,6 +327,24 @@ class {{ name }}: metrics_integration: MetricsIntegration | None = None, logs_integration: LogsIntegration | None = DefaultLogsIntegration(), ): + """ + Parameters + ---------- + base_url + Base URL + timeout + In seconds + client_name + Used in metrics + client + httpx-client + headers + Headers that will be passed in all requests + metrics_integration + The object that is responsible for collecting and sending metrics + logs_integration + The object that is responsible for logging events + """ {%- if sync %} self.client = client or httpx.Client(timeout=Timeout(timeout)) {%- else %} diff --git a/pythogen/templates/http_client/method.j2 b/pythogen/templates/http_client/method.j2 index 00a1602..5ae8614 100644 --- a/pythogen/templates/http_client/method.j2 +++ b/pythogen/templates/http_client/method.j2 @@ -34,6 +34,12 @@ headers: {{ classname(operation.fn_name) }}Headers | dict[str, Any] | None = None, {% endif %} ) -> {{ responserepr(operation.responses, document) }}: + """ + {{ operation.method.value|upper }} {{ operation.path_str }} + Operation ID: {{ operation.operation_id }} + Summary: {{ operation.summary }} + Description: {{ operation.description }} + """ method = "{{ method }}" diff --git a/tests/clients/async_client.py b/tests/clients/async_client.py index 7bf2b26..43d3051 100644 --- a/tests/clients/async_client.py +++ b/tests/clients/async_client.py @@ -7,7 +7,7 @@ # # Generator info: # GitHub Page: https://github.com/artsmolin/pythogen -# Version: 0.2.24 +# Version: 0.2.25 # ============================================================================== # jinja2: lstrip_blocks: "True" @@ -709,6 +709,24 @@ def __init__( metrics_integration: MetricsIntegration | None = None, logs_integration: LogsIntegration | None = DefaultLogsIntegration(), ): + """ + Parameters + ---------- + base_url + Base URL + timeout + In seconds + client_name + Used in metrics + client + httpx-client + headers + Headers that will be passed in all requests + metrics_integration + The object that is responsible for collecting and sending metrics + logs_integration + The object that is responsible for logging events + """ self.client = client or httpx.AsyncClient(timeout=Timeout(timeout)) self.base_url = base_url self.headers = headers or {} @@ -723,6 +741,13 @@ async def get_object_no_ref_schema( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectNoRefSchemaResponse200 | None: + """ + GET /objects/no-ref-schema/{object_id} + Operation ID: get_object_no_ref_schema + Summary: Get Object No Ref Schema + Description: None + """ + method = "get" if isinstance(path_params, GetObjectNoRefSchemaPathParams): @@ -790,6 +815,13 @@ async def get_object( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectResp | UnknownError: + """ + GET /objects/{object_id} + Operation ID: get_object + Summary: Get Object + Description: None + """ + method = "get" if isinstance(path_params, GetObjectPathParams): @@ -866,6 +898,13 @@ async def get_object_with_array_response( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> list[GetObjectWithArrayResponseResponse200Item] | None: + """ + GET /object-with-array-response + Operation ID: get_object_with_array_response + Summary: Get Object With Inline Array + Description: None + """ + method = "get" path = "/object-with-array-response" @@ -925,6 +964,13 @@ async def get_object_with_inline_array( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectWithInlineArrayResponse200 | None: + """ + GET /object-with-inline-array + Operation ID: get_object_with_inline_array + Summary: Get Object With Inline Array + Description: None + """ + method = "get" path = "/object-with-inline-array" @@ -984,6 +1030,13 @@ async def get_list_objects( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> list[GetObjectResp] | None: + """ + GET /objects + Operation ID: get_list_objects + Summary: Get list objects + Description: None + """ + method = "get" path = "/objects" @@ -1043,6 +1096,13 @@ async def get_text( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> str | None: + """ + GET /text + Operation ID: get_text + Summary: Get Text + Description: None + """ + method = "get" path = "/text" @@ -1102,6 +1162,13 @@ async def get_text_as_integer( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> int | None: + """ + GET /text_as_integer + Operation ID: get_text_as_integer + Summary: Get Text As Integer + Description: None + """ + method = "get" path = "/text_as_integer" @@ -1162,6 +1229,13 @@ async def get_empty( content: str | bytes | None = None, headers: GetEmptyHeaders | dict[str, Any] | None = None, ) -> EmptyBody | None: + """ + GET /empty + Operation ID: get_empty + Summary: Get Empty + Description: None + """ + method = "get" path = "/empty" @@ -1227,6 +1301,13 @@ async def get_no_operation_id( content: str | bytes | None = None, headers: GetNoOperationIdHeaders | dict[str, Any] | None = None, ) -> EmptyBody | None: + """ + GET /no-operation-id + Operation ID: None + Summary: No operation ID + Description: None + """ + method = "get" path = "/no-operation-id" @@ -1291,6 +1372,13 @@ async def get_binary( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> bytes | None: + """ + GET /binary + Operation ID: get_binary + Summary: Get Binary + Description: None + """ + method = "get" path = "/binary" @@ -1350,6 +1438,13 @@ async def get_allof( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> AllOfResp | None: + """ + GET /allof + Operation ID: get_allof + Summary: Get Allof + Description: None + """ + method = "get" path = "/allof" @@ -1411,6 +1506,13 @@ async def get_object_slow( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectResp | UnknownError: + """ + GET /slow/objects/{object_id} + Operation ID: get_object_slow + Summary: Get Object Slow + Description: None + """ + method = "get" if isinstance(path_params, GetObjectSlowPathParams): @@ -1487,6 +1589,13 @@ async def response_body_list_of_anyof( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> ListAnyOfResp | None: + """ + GET /nested-any-of + Operation ID: response_body_list_of_anyof + Summary: Post Object With Request Body AnyOf + Description: None + """ + method = "get" path = "/nested-any-of" @@ -1546,6 +1655,13 @@ async def post_object_without_body( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> PostObjectResp | None: + """ + POST /post-without-body + Operation ID: post_object_without_body + Summary: Post Object Without Body + Description: None + """ + method = "post" path = "/post-without-body" @@ -1606,6 +1722,13 @@ async def post_object( content: str | bytes | None = None, body: PostObjectData | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /objects + Operation ID: post_object + Summary: Post Object + Description: None + """ + method = "post" path = "/objects" @@ -1673,6 +1796,13 @@ async def post_form_object( content: str | bytes | None = None, body: PostObjectData | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /objects-form-data + Operation ID: post_form_object + Summary: Post Form Object + Description: None + """ + method = "post" path = "/objects-form-data" @@ -1742,6 +1872,13 @@ async def post_multipart_form_data( files: Mapping[str, FileTypes] | Sequence[tuple[str, FileTypes]] | None = None, body: PostFile | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /multipart-form-data + Operation ID: post_multipart_form_data + Summary: Post Multipart Form Data + Description: None + """ + method = "post" path = "/multipart-form-data" @@ -1813,6 +1950,13 @@ async def request_body_anyof( content: str | bytes | None = None, body: RequestBodyAnyofRequestBody | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /request-body-anyof + Operation ID: request_body_anyof + Summary: Post Object With Request Body AnyOf + Description: None + """ + method = "post" path = "/request-body-anyof" @@ -1881,6 +2025,13 @@ async def patch_object( content: str | bytes | None = None, body: PatchObjectData | dict[str, Any] | None = None, ) -> PatchObjectResp | None: + """ + PATCH /objects/{object_id} + Operation ID: patch_object + Summary: Patch Object + Description: None + """ + method = "patch" if isinstance(path_params, PatchObjectPathParams): @@ -1952,6 +2103,13 @@ async def put_object( content: str | bytes | None = None, body: PutObjectData | dict[str, Any] | None = None, ) -> PutObjectResp | None: + """ + PUT /objects/{object_id} + Operation ID: put_object + Summary: Put Object + Description: None + """ + method = "put" if isinstance(path_params, PutObjectPathParams): @@ -2023,6 +2181,13 @@ async def put_object_slow( content: str | bytes | None = None, body: PutObjectData | dict[str, Any] | None = None, ) -> PutObjectResp | None: + """ + PUT /slow/objects/{object_id} + Operation ID: put_object_slow + Summary: Put Object Slow + Description: None + """ + method = "put" if isinstance(path_params, PutObjectSlowPathParams): @@ -2093,6 +2258,13 @@ async def delete_object( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> DeleteObjectResp | None: + """ + DELETE /objects/{object_id} + Operation ID: delete_object + Summary: Delete Object + Description: None + """ + method = "delete" if isinstance(path_params, DeleteObjectPathParams): diff --git a/tests/clients/async_client_with_headers.py b/tests/clients/async_client_with_headers.py index 5d50332..5d7a8df 100644 --- a/tests/clients/async_client_with_headers.py +++ b/tests/clients/async_client_with_headers.py @@ -7,7 +7,7 @@ # # Generator info: # GitHub Page: https://github.com/artsmolin/pythogen -# Version: 0.2.24 +# Version: 0.2.25 # ============================================================================== # jinja2: lstrip_blocks: "True" @@ -709,6 +709,24 @@ def __init__( metrics_integration: MetricsIntegration | None = None, logs_integration: LogsIntegration | None = DefaultLogsIntegration(), ): + """ + Parameters + ---------- + base_url + Base URL + timeout + In seconds + client_name + Used in metrics + client + httpx-client + headers + Headers that will be passed in all requests + metrics_integration + The object that is responsible for collecting and sending metrics + logs_integration + The object that is responsible for logging events + """ self.client = client or httpx.AsyncClient(timeout=Timeout(timeout)) self.base_url = base_url self.headers = headers or {} @@ -726,6 +744,13 @@ async def get_object_no_ref_schema( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectNoRefSchemaResponse200 | None: + """ + GET /objects/no-ref-schema/{object_id} + Operation ID: get_object_no_ref_schema + Summary: Get Object No Ref Schema + Description: None + """ + method = "get" if isinstance(path_params, GetObjectNoRefSchemaPathParams): @@ -793,6 +818,13 @@ async def get_object( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectResp | UnknownError: + """ + GET /objects/{object_id} + Operation ID: get_object + Summary: Get Object + Description: None + """ + method = "get" if isinstance(path_params, GetObjectPathParams): @@ -869,6 +901,13 @@ async def get_object_with_array_response( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> list[GetObjectWithArrayResponseResponse200Item] | None: + """ + GET /object-with-array-response + Operation ID: get_object_with_array_response + Summary: Get Object With Inline Array + Description: None + """ + method = "get" path = "/object-with-array-response" @@ -928,6 +967,13 @@ async def get_object_with_inline_array( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectWithInlineArrayResponse200 | None: + """ + GET /object-with-inline-array + Operation ID: get_object_with_inline_array + Summary: Get Object With Inline Array + Description: None + """ + method = "get" path = "/object-with-inline-array" @@ -987,6 +1033,13 @@ async def get_list_objects( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> list[GetObjectResp] | None: + """ + GET /objects + Operation ID: get_list_objects + Summary: Get list objects + Description: None + """ + method = "get" path = "/objects" @@ -1046,6 +1099,13 @@ async def get_text( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> str | None: + """ + GET /text + Operation ID: get_text + Summary: Get Text + Description: None + """ + method = "get" path = "/text" @@ -1105,6 +1165,13 @@ async def get_text_as_integer( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> int | None: + """ + GET /text_as_integer + Operation ID: get_text_as_integer + Summary: Get Text As Integer + Description: None + """ + method = "get" path = "/text_as_integer" @@ -1165,6 +1232,13 @@ async def get_empty( content: str | bytes | None = None, headers: GetEmptyHeaders | dict[str, Any] | None = None, ) -> EmptyBody | None: + """ + GET /empty + Operation ID: get_empty + Summary: Get Empty + Description: None + """ + method = "get" path = "/empty" @@ -1230,6 +1304,13 @@ async def get_no_operation_id( content: str | bytes | None = None, headers: GetNoOperationIdHeaders | dict[str, Any] | None = None, ) -> EmptyBody | None: + """ + GET /no-operation-id + Operation ID: None + Summary: No operation ID + Description: None + """ + method = "get" path = "/no-operation-id" @@ -1294,6 +1375,13 @@ async def get_binary( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> bytes | None: + """ + GET /binary + Operation ID: get_binary + Summary: Get Binary + Description: None + """ + method = "get" path = "/binary" @@ -1353,6 +1441,13 @@ async def get_allof( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> AllOfResp | None: + """ + GET /allof + Operation ID: get_allof + Summary: Get Allof + Description: None + """ + method = "get" path = "/allof" @@ -1414,6 +1509,13 @@ async def get_object_slow( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectResp | UnknownError: + """ + GET /slow/objects/{object_id} + Operation ID: get_object_slow + Summary: Get Object Slow + Description: None + """ + method = "get" if isinstance(path_params, GetObjectSlowPathParams): @@ -1490,6 +1592,13 @@ async def response_body_list_of_anyof( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> ListAnyOfResp | None: + """ + GET /nested-any-of + Operation ID: response_body_list_of_anyof + Summary: Post Object With Request Body AnyOf + Description: None + """ + method = "get" path = "/nested-any-of" @@ -1549,6 +1658,13 @@ async def post_object_without_body( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> PostObjectResp | None: + """ + POST /post-without-body + Operation ID: post_object_without_body + Summary: Post Object Without Body + Description: None + """ + method = "post" path = "/post-without-body" @@ -1609,6 +1725,13 @@ async def post_object( content: str | bytes | None = None, body: PostObjectData | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /objects + Operation ID: post_object + Summary: Post Object + Description: None + """ + method = "post" path = "/objects" @@ -1676,6 +1799,13 @@ async def post_form_object( content: str | bytes | None = None, body: PostObjectData | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /objects-form-data + Operation ID: post_form_object + Summary: Post Form Object + Description: None + """ + method = "post" path = "/objects-form-data" @@ -1745,6 +1875,13 @@ async def post_multipart_form_data( files: Mapping[str, FileTypes] | Sequence[tuple[str, FileTypes]] | None = None, body: PostFile | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /multipart-form-data + Operation ID: post_multipart_form_data + Summary: Post Multipart Form Data + Description: None + """ + method = "post" path = "/multipart-form-data" @@ -1816,6 +1953,13 @@ async def request_body_anyof( content: str | bytes | None = None, body: RequestBodyAnyofRequestBody | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /request-body-anyof + Operation ID: request_body_anyof + Summary: Post Object With Request Body AnyOf + Description: None + """ + method = "post" path = "/request-body-anyof" @@ -1884,6 +2028,13 @@ async def patch_object( content: str | bytes | None = None, body: PatchObjectData | dict[str, Any] | None = None, ) -> PatchObjectResp | None: + """ + PATCH /objects/{object_id} + Operation ID: patch_object + Summary: Patch Object + Description: None + """ + method = "patch" if isinstance(path_params, PatchObjectPathParams): @@ -1955,6 +2106,13 @@ async def put_object( content: str | bytes | None = None, body: PutObjectData | dict[str, Any] | None = None, ) -> PutObjectResp | None: + """ + PUT /objects/{object_id} + Operation ID: put_object + Summary: Put Object + Description: None + """ + method = "put" if isinstance(path_params, PutObjectPathParams): @@ -2026,6 +2184,13 @@ async def put_object_slow( content: str | bytes | None = None, body: PutObjectData | dict[str, Any] | None = None, ) -> PutObjectResp | None: + """ + PUT /slow/objects/{object_id} + Operation ID: put_object_slow + Summary: Put Object Slow + Description: None + """ + method = "put" if isinstance(path_params, PutObjectSlowPathParams): @@ -2096,6 +2261,13 @@ async def delete_object( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> DeleteObjectResp | None: + """ + DELETE /objects/{object_id} + Operation ID: delete_object + Summary: Delete Object + Description: None + """ + method = "delete" if isinstance(path_params, DeleteObjectPathParams): diff --git a/tests/clients/async_client_with_metrics.py b/tests/clients/async_client_with_metrics.py index 0e6a081..84218e1 100644 --- a/tests/clients/async_client_with_metrics.py +++ b/tests/clients/async_client_with_metrics.py @@ -7,7 +7,7 @@ # # Generator info: # GitHub Page: https://github.com/artsmolin/pythogen -# Version: 0.2.24 +# Version: 0.2.25 # ============================================================================== # jinja2: lstrip_blocks: "True" @@ -741,6 +741,24 @@ def __init__( metrics_integration: MetricsIntegration | None = None, logs_integration: LogsIntegration | None = DefaultLogsIntegration(), ): + """ + Parameters + ---------- + base_url + Base URL + timeout + In seconds + client_name + Used in metrics + client + httpx-client + headers + Headers that will be passed in all requests + metrics_integration + The object that is responsible for collecting and sending metrics + logs_integration + The object that is responsible for logging events + """ self.client = client or httpx.AsyncClient(timeout=Timeout(timeout)) self.base_url = base_url self.headers = headers or {} @@ -755,6 +773,13 @@ async def get_object_no_ref_schema( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectNoRefSchemaResponse200 | None: + """ + GET /objects/no-ref-schema/{object_id} + Operation ID: get_object_no_ref_schema + Summary: Get Object No Ref Schema + Description: None + """ + method = "get" if isinstance(path_params, GetObjectNoRefSchemaPathParams): @@ -822,6 +847,13 @@ async def get_object( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectResp | UnknownError: + """ + GET /objects/{object_id} + Operation ID: get_object + Summary: Get Object + Description: None + """ + method = "get" if isinstance(path_params, GetObjectPathParams): @@ -898,6 +930,13 @@ async def get_object_with_array_response( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> list[GetObjectWithArrayResponseResponse200Item] | None: + """ + GET /object-with-array-response + Operation ID: get_object_with_array_response + Summary: Get Object With Inline Array + Description: None + """ + method = "get" path = "/object-with-array-response" @@ -957,6 +996,13 @@ async def get_object_with_inline_array( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectWithInlineArrayResponse200 | None: + """ + GET /object-with-inline-array + Operation ID: get_object_with_inline_array + Summary: Get Object With Inline Array + Description: None + """ + method = "get" path = "/object-with-inline-array" @@ -1016,6 +1062,13 @@ async def get_list_objects( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> list[GetObjectResp] | None: + """ + GET /objects + Operation ID: get_list_objects + Summary: Get list objects + Description: None + """ + method = "get" path = "/objects" @@ -1075,6 +1128,13 @@ async def get_text( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> str | None: + """ + GET /text + Operation ID: get_text + Summary: Get Text + Description: None + """ + method = "get" path = "/text" @@ -1134,6 +1194,13 @@ async def get_text_as_integer( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> int | None: + """ + GET /text_as_integer + Operation ID: get_text_as_integer + Summary: Get Text As Integer + Description: None + """ + method = "get" path = "/text_as_integer" @@ -1194,6 +1261,13 @@ async def get_empty( content: str | bytes | None = None, headers: GetEmptyHeaders | dict[str, Any] | None = None, ) -> EmptyBody | None: + """ + GET /empty + Operation ID: get_empty + Summary: Get Empty + Description: None + """ + method = "get" path = "/empty" @@ -1259,6 +1333,13 @@ async def get_no_operation_id( content: str | bytes | None = None, headers: GetNoOperationIdHeaders | dict[str, Any] | None = None, ) -> EmptyBody | None: + """ + GET /no-operation-id + Operation ID: None + Summary: No operation ID + Description: None + """ + method = "get" path = "/no-operation-id" @@ -1323,6 +1404,13 @@ async def get_binary( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> bytes | None: + """ + GET /binary + Operation ID: get_binary + Summary: Get Binary + Description: None + """ + method = "get" path = "/binary" @@ -1382,6 +1470,13 @@ async def get_allof( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> AllOfResp | None: + """ + GET /allof + Operation ID: get_allof + Summary: Get Allof + Description: None + """ + method = "get" path = "/allof" @@ -1443,6 +1538,13 @@ async def get_object_slow( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectResp | UnknownError: + """ + GET /slow/objects/{object_id} + Operation ID: get_object_slow + Summary: Get Object Slow + Description: None + """ + method = "get" if isinstance(path_params, GetObjectSlowPathParams): @@ -1519,6 +1621,13 @@ async def response_body_list_of_anyof( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> ListAnyOfResp | None: + """ + GET /nested-any-of + Operation ID: response_body_list_of_anyof + Summary: Post Object With Request Body AnyOf + Description: None + """ + method = "get" path = "/nested-any-of" @@ -1578,6 +1687,13 @@ async def post_object_without_body( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> PostObjectResp | None: + """ + POST /post-without-body + Operation ID: post_object_without_body + Summary: Post Object Without Body + Description: None + """ + method = "post" path = "/post-without-body" @@ -1638,6 +1754,13 @@ async def post_object( content: str | bytes | None = None, body: PostObjectData | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /objects + Operation ID: post_object + Summary: Post Object + Description: None + """ + method = "post" path = "/objects" @@ -1705,6 +1828,13 @@ async def post_form_object( content: str | bytes | None = None, body: PostObjectData | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /objects-form-data + Operation ID: post_form_object + Summary: Post Form Object + Description: None + """ + method = "post" path = "/objects-form-data" @@ -1774,6 +1904,13 @@ async def post_multipart_form_data( files: Mapping[str, FileTypes] | Sequence[tuple[str, FileTypes]] | None = None, body: PostFile | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /multipart-form-data + Operation ID: post_multipart_form_data + Summary: Post Multipart Form Data + Description: None + """ + method = "post" path = "/multipart-form-data" @@ -1845,6 +1982,13 @@ async def request_body_anyof( content: str | bytes | None = None, body: RequestBodyAnyofRequestBody | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /request-body-anyof + Operation ID: request_body_anyof + Summary: Post Object With Request Body AnyOf + Description: None + """ + method = "post" path = "/request-body-anyof" @@ -1913,6 +2057,13 @@ async def patch_object( content: str | bytes | None = None, body: PatchObjectData | dict[str, Any] | None = None, ) -> PatchObjectResp | None: + """ + PATCH /objects/{object_id} + Operation ID: patch_object + Summary: Patch Object + Description: None + """ + method = "patch" if isinstance(path_params, PatchObjectPathParams): @@ -1984,6 +2135,13 @@ async def put_object( content: str | bytes | None = None, body: PutObjectData | dict[str, Any] | None = None, ) -> PutObjectResp | None: + """ + PUT /objects/{object_id} + Operation ID: put_object + Summary: Put Object + Description: None + """ + method = "put" if isinstance(path_params, PutObjectPathParams): @@ -2055,6 +2213,13 @@ async def put_object_slow( content: str | bytes | None = None, body: PutObjectData | dict[str, Any] | None = None, ) -> PutObjectResp | None: + """ + PUT /slow/objects/{object_id} + Operation ID: put_object_slow + Summary: Put Object Slow + Description: None + """ + method = "put" if isinstance(path_params, PutObjectSlowPathParams): @@ -2125,6 +2290,13 @@ async def delete_object( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> DeleteObjectResp | None: + """ + DELETE /objects/{object_id} + Operation ID: delete_object + Summary: Delete Object + Description: None + """ + method = "delete" if isinstance(path_params, DeleteObjectPathParams): diff --git a/tests/clients/sync_client.py b/tests/clients/sync_client.py index 5247e8c..9ac069e 100644 --- a/tests/clients/sync_client.py +++ b/tests/clients/sync_client.py @@ -7,7 +7,7 @@ # # Generator info: # GitHub Page: https://github.com/artsmolin/pythogen -# Version: 0.2.24 +# Version: 0.2.25 # ============================================================================== # jinja2: lstrip_blocks: "True" @@ -709,6 +709,24 @@ def __init__( metrics_integration: MetricsIntegration | None = None, logs_integration: LogsIntegration | None = DefaultLogsIntegration(), ): + """ + Parameters + ---------- + base_url + Base URL + timeout + In seconds + client_name + Used in metrics + client + httpx-client + headers + Headers that will be passed in all requests + metrics_integration + The object that is responsible for collecting and sending metrics + logs_integration + The object that is responsible for logging events + """ self.client = client or httpx.Client(timeout=Timeout(timeout)) self.base_url = base_url self.headers = headers or {} @@ -723,6 +741,13 @@ def get_object_no_ref_schema( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectNoRefSchemaResponse200 | None: + """ + GET /objects/no-ref-schema/{object_id} + Operation ID: get_object_no_ref_schema + Summary: Get Object No Ref Schema + Description: None + """ + method = "get" if isinstance(path_params, GetObjectNoRefSchemaPathParams): @@ -788,6 +813,13 @@ def get_object( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectResp | UnknownError: + """ + GET /objects/{object_id} + Operation ID: get_object + Summary: Get Object + Description: None + """ + method = "get" if isinstance(path_params, GetObjectPathParams): @@ -862,6 +894,13 @@ def get_object_with_array_response( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> list[GetObjectWithArrayResponseResponse200Item] | None: + """ + GET /object-with-array-response + Operation ID: get_object_with_array_response + Summary: Get Object With Inline Array + Description: None + """ + method = "get" path = "/object-with-array-response" @@ -919,6 +958,13 @@ def get_object_with_inline_array( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectWithInlineArrayResponse200 | None: + """ + GET /object-with-inline-array + Operation ID: get_object_with_inline_array + Summary: Get Object With Inline Array + Description: None + """ + method = "get" path = "/object-with-inline-array" @@ -976,6 +1022,13 @@ def get_list_objects( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> list[GetObjectResp] | None: + """ + GET /objects + Operation ID: get_list_objects + Summary: Get list objects + Description: None + """ + method = "get" path = "/objects" @@ -1033,6 +1086,13 @@ def get_text( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> str | None: + """ + GET /text + Operation ID: get_text + Summary: Get Text + Description: None + """ + method = "get" path = "/text" @@ -1090,6 +1150,13 @@ def get_text_as_integer( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> int | None: + """ + GET /text_as_integer + Operation ID: get_text_as_integer + Summary: Get Text As Integer + Description: None + """ + method = "get" path = "/text_as_integer" @@ -1148,6 +1215,13 @@ def get_empty( content: str | bytes | None = None, headers: GetEmptyHeaders | dict[str, Any] | None = None, ) -> EmptyBody | None: + """ + GET /empty + Operation ID: get_empty + Summary: Get Empty + Description: None + """ + method = "get" path = "/empty" @@ -1211,6 +1285,13 @@ def get_no_operation_id( content: str | bytes | None = None, headers: GetNoOperationIdHeaders | dict[str, Any] | None = None, ) -> EmptyBody | None: + """ + GET /no-operation-id + Operation ID: None + Summary: No operation ID + Description: None + """ + method = "get" path = "/no-operation-id" @@ -1273,6 +1354,13 @@ def get_binary( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> bytes | None: + """ + GET /binary + Operation ID: get_binary + Summary: Get Binary + Description: None + """ + method = "get" path = "/binary" @@ -1330,6 +1418,13 @@ def get_allof( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> AllOfResp | None: + """ + GET /allof + Operation ID: get_allof + Summary: Get Allof + Description: None + """ + method = "get" path = "/allof" @@ -1389,6 +1484,13 @@ def get_object_slow( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectResp | UnknownError: + """ + GET /slow/objects/{object_id} + Operation ID: get_object_slow + Summary: Get Object Slow + Description: None + """ + method = "get" if isinstance(path_params, GetObjectSlowPathParams): @@ -1463,6 +1565,13 @@ def response_body_list_of_anyof( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> ListAnyOfResp | None: + """ + GET /nested-any-of + Operation ID: response_body_list_of_anyof + Summary: Post Object With Request Body AnyOf + Description: None + """ + method = "get" path = "/nested-any-of" @@ -1520,6 +1629,13 @@ def post_object_without_body( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> PostObjectResp | None: + """ + POST /post-without-body + Operation ID: post_object_without_body + Summary: Post Object Without Body + Description: None + """ + method = "post" path = "/post-without-body" @@ -1578,6 +1694,13 @@ def post_object( content: str | bytes | None = None, body: PostObjectData | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /objects + Operation ID: post_object + Summary: Post Object + Description: None + """ + method = "post" path = "/objects" @@ -1645,6 +1768,13 @@ def post_form_object( content: str | bytes | None = None, body: PostObjectData | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /objects-form-data + Operation ID: post_form_object + Summary: Post Form Object + Description: None + """ + method = "post" path = "/objects-form-data" @@ -1714,6 +1844,13 @@ def post_multipart_form_data( files: Mapping[str, FileTypes] | Sequence[tuple[str, FileTypes]] | None = None, body: PostFile | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /multipart-form-data + Operation ID: post_multipart_form_data + Summary: Post Multipart Form Data + Description: None + """ + method = "post" path = "/multipart-form-data" @@ -1785,6 +1922,13 @@ def request_body_anyof( content: str | bytes | None = None, body: RequestBodyAnyofRequestBody | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /request-body-anyof + Operation ID: request_body_anyof + Summary: Post Object With Request Body AnyOf + Description: None + """ + method = "post" path = "/request-body-anyof" @@ -1853,6 +1997,13 @@ def patch_object( content: str | bytes | None = None, body: PatchObjectData | dict[str, Any] | None = None, ) -> PatchObjectResp | None: + """ + PATCH /objects/{object_id} + Operation ID: patch_object + Summary: Patch Object + Description: None + """ + method = "patch" if isinstance(path_params, PatchObjectPathParams): @@ -1924,6 +2075,13 @@ def put_object( content: str | bytes | None = None, body: PutObjectData | dict[str, Any] | None = None, ) -> PutObjectResp | None: + """ + PUT /objects/{object_id} + Operation ID: put_object + Summary: Put Object + Description: None + """ + method = "put" if isinstance(path_params, PutObjectPathParams): @@ -1995,6 +2153,13 @@ def put_object_slow( content: str | bytes | None = None, body: PutObjectData | dict[str, Any] | None = None, ) -> PutObjectResp | None: + """ + PUT /slow/objects/{object_id} + Operation ID: put_object_slow + Summary: Put Object Slow + Description: None + """ + method = "put" if isinstance(path_params, PutObjectSlowPathParams): @@ -2065,6 +2230,13 @@ def delete_object( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> DeleteObjectResp | None: + """ + DELETE /objects/{object_id} + Operation ID: delete_object + Summary: Delete Object + Description: None + """ + method = "delete" if isinstance(path_params, DeleteObjectPathParams): diff --git a/tests/clients/sync_client_with_metrics.py b/tests/clients/sync_client_with_metrics.py index e0c857d..b8e5189 100644 --- a/tests/clients/sync_client_with_metrics.py +++ b/tests/clients/sync_client_with_metrics.py @@ -7,7 +7,7 @@ # # Generator info: # GitHub Page: https://github.com/artsmolin/pythogen -# Version: 0.2.24 +# Version: 0.2.25 # ============================================================================== # jinja2: lstrip_blocks: "True" @@ -741,6 +741,24 @@ def __init__( metrics_integration: MetricsIntegration | None = None, logs_integration: LogsIntegration | None = DefaultLogsIntegration(), ): + """ + Parameters + ---------- + base_url + Base URL + timeout + In seconds + client_name + Used in metrics + client + httpx-client + headers + Headers that will be passed in all requests + metrics_integration + The object that is responsible for collecting and sending metrics + logs_integration + The object that is responsible for logging events + """ self.client = client or httpx.Client(timeout=Timeout(timeout)) self.base_url = base_url self.headers = headers or {} @@ -755,6 +773,13 @@ def get_object_no_ref_schema( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectNoRefSchemaResponse200 | None: + """ + GET /objects/no-ref-schema/{object_id} + Operation ID: get_object_no_ref_schema + Summary: Get Object No Ref Schema + Description: None + """ + method = "get" if isinstance(path_params, GetObjectNoRefSchemaPathParams): @@ -820,6 +845,13 @@ def get_object( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectResp | UnknownError: + """ + GET /objects/{object_id} + Operation ID: get_object + Summary: Get Object + Description: None + """ + method = "get" if isinstance(path_params, GetObjectPathParams): @@ -894,6 +926,13 @@ def get_object_with_array_response( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> list[GetObjectWithArrayResponseResponse200Item] | None: + """ + GET /object-with-array-response + Operation ID: get_object_with_array_response + Summary: Get Object With Inline Array + Description: None + """ + method = "get" path = "/object-with-array-response" @@ -951,6 +990,13 @@ def get_object_with_inline_array( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectWithInlineArrayResponse200 | None: + """ + GET /object-with-inline-array + Operation ID: get_object_with_inline_array + Summary: Get Object With Inline Array + Description: None + """ + method = "get" path = "/object-with-inline-array" @@ -1008,6 +1054,13 @@ def get_list_objects( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> list[GetObjectResp] | None: + """ + GET /objects + Operation ID: get_list_objects + Summary: Get list objects + Description: None + """ + method = "get" path = "/objects" @@ -1065,6 +1118,13 @@ def get_text( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> str | None: + """ + GET /text + Operation ID: get_text + Summary: Get Text + Description: None + """ + method = "get" path = "/text" @@ -1122,6 +1182,13 @@ def get_text_as_integer( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> int | None: + """ + GET /text_as_integer + Operation ID: get_text_as_integer + Summary: Get Text As Integer + Description: None + """ + method = "get" path = "/text_as_integer" @@ -1180,6 +1247,13 @@ def get_empty( content: str | bytes | None = None, headers: GetEmptyHeaders | dict[str, Any] | None = None, ) -> EmptyBody | None: + """ + GET /empty + Operation ID: get_empty + Summary: Get Empty + Description: None + """ + method = "get" path = "/empty" @@ -1243,6 +1317,13 @@ def get_no_operation_id( content: str | bytes | None = None, headers: GetNoOperationIdHeaders | dict[str, Any] | None = None, ) -> EmptyBody | None: + """ + GET /no-operation-id + Operation ID: None + Summary: No operation ID + Description: None + """ + method = "get" path = "/no-operation-id" @@ -1305,6 +1386,13 @@ def get_binary( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> bytes | None: + """ + GET /binary + Operation ID: get_binary + Summary: Get Binary + Description: None + """ + method = "get" path = "/binary" @@ -1362,6 +1450,13 @@ def get_allof( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> AllOfResp | None: + """ + GET /allof + Operation ID: get_allof + Summary: Get Allof + Description: None + """ + method = "get" path = "/allof" @@ -1421,6 +1516,13 @@ def get_object_slow( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> GetObjectResp | UnknownError: + """ + GET /slow/objects/{object_id} + Operation ID: get_object_slow + Summary: Get Object Slow + Description: None + """ + method = "get" if isinstance(path_params, GetObjectSlowPathParams): @@ -1495,6 +1597,13 @@ def response_body_list_of_anyof( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> ListAnyOfResp | None: + """ + GET /nested-any-of + Operation ID: response_body_list_of_anyof + Summary: Post Object With Request Body AnyOf + Description: None + """ + method = "get" path = "/nested-any-of" @@ -1552,6 +1661,13 @@ def post_object_without_body( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> PostObjectResp | None: + """ + POST /post-without-body + Operation ID: post_object_without_body + Summary: Post Object Without Body + Description: None + """ + method = "post" path = "/post-without-body" @@ -1610,6 +1726,13 @@ def post_object( content: str | bytes | None = None, body: PostObjectData | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /objects + Operation ID: post_object + Summary: Post Object + Description: None + """ + method = "post" path = "/objects" @@ -1677,6 +1800,13 @@ def post_form_object( content: str | bytes | None = None, body: PostObjectData | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /objects-form-data + Operation ID: post_form_object + Summary: Post Form Object + Description: None + """ + method = "post" path = "/objects-form-data" @@ -1746,6 +1876,13 @@ def post_multipart_form_data( files: Mapping[str, FileTypes] | Sequence[tuple[str, FileTypes]] | None = None, body: PostFile | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /multipart-form-data + Operation ID: post_multipart_form_data + Summary: Post Multipart Form Data + Description: None + """ + method = "post" path = "/multipart-form-data" @@ -1817,6 +1954,13 @@ def request_body_anyof( content: str | bytes | None = None, body: RequestBodyAnyofRequestBody | dict[str, Any] | None = None, ) -> PostObjectResp | None: + """ + POST /request-body-anyof + Operation ID: request_body_anyof + Summary: Post Object With Request Body AnyOf + Description: None + """ + method = "post" path = "/request-body-anyof" @@ -1885,6 +2029,13 @@ def patch_object( content: str | bytes | None = None, body: PatchObjectData | dict[str, Any] | None = None, ) -> PatchObjectResp | None: + """ + PATCH /objects/{object_id} + Operation ID: patch_object + Summary: Patch Object + Description: None + """ + method = "patch" if isinstance(path_params, PatchObjectPathParams): @@ -1956,6 +2107,13 @@ def put_object( content: str | bytes | None = None, body: PutObjectData | dict[str, Any] | None = None, ) -> PutObjectResp | None: + """ + PUT /objects/{object_id} + Operation ID: put_object + Summary: Put Object + Description: None + """ + method = "put" if isinstance(path_params, PutObjectPathParams): @@ -2027,6 +2185,13 @@ def put_object_slow( content: str | bytes | None = None, body: PutObjectData | dict[str, Any] | None = None, ) -> PutObjectResp | None: + """ + PUT /slow/objects/{object_id} + Operation ID: put_object_slow + Summary: Put Object Slow + Description: None + """ + method = "put" if isinstance(path_params, PutObjectSlowPathParams): @@ -2097,6 +2262,13 @@ def delete_object( auth: BasicAuth | None = None, content: str | bytes | None = None, ) -> DeleteObjectResp | None: + """ + DELETE /objects/{object_id} + Operation ID: delete_object + Summary: Delete Object + Description: None + """ + method = "delete" if isinstance(path_params, DeleteObjectPathParams):