Skip to content

Commit 7a631ef

Browse files
Update api spec (#529)
* YOYO NEW API SPEC! * I have generated the latest API! --------- Co-authored-by: zoo-github-actions-auth[bot] <zoo-github-actions-auth[bot]@users.noreply.github.com>
1 parent eb54852 commit 7a631ef

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

kittycad.py.patch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@
995995
"op": "add",
996996
"path": "/paths/~1user~1payment~1methods~1{id}/delete/x-python",
997997
"value": {
998-
"example": "\n\ndef example_delete_payment_method_for_user():\n client = KittyCAD() # Uses KITTYCAD_API_TOKEN environment variable\n\n client.payments.delete_payment_method_for_user(id=\"<string>\")\n\n",
998+
"example": "\n\ndef example_delete_payment_method_for_user():\n client = KittyCAD() # Uses KITTYCAD_API_TOKEN environment variable\n\n client.payments.delete_payment_method_for_user(id=\"<string>\",\n force=False)\n\n",
999999
"libDocsLink": "https://python.api.docs.zoo.dev/_autosummary/kittycad.KittyCAD.html#kittycad.KittyCAD.payments"
10001000
}
10011001
},

kittycad/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7597,11 +7597,19 @@ def list_payment_methods_for_user(
75977597
def delete_payment_method_for_user(
75987598
self,
75997599
id: str,
7600+
*,
7601+
force: Optional[bool] = None,
76007602
):
76017603
"""This endpoint requires authentication by any Zoo user. It deletes the specified payment method for the authenticated user."""
76027604

76037605
url = "{}/user/payment/methods/{id}".format(self.client.base_url, id=id)
76047606

7607+
if force is not None:
7608+
if "?" in url:
7609+
url = url + "&force=" + str(force).lower()
7610+
else:
7611+
url = url + "?force=" + str(force).lower()
7612+
76057613
_client = self.client.get_http_client()
76067614

76077615
response = _client.delete(
@@ -8476,11 +8484,19 @@ async def list_payment_methods_for_user(
84768484
async def delete_payment_method_for_user(
84778485
self,
84788486
id: str,
8487+
*,
8488+
force: Optional[bool] = None,
84798489
):
84808490
"""This endpoint requires authentication by any Zoo user. It deletes the specified payment method for the authenticated user."""
84818491

84828492
url = "{}/user/payment/methods/{id}".format(self.client.base_url, id=id)
84838493

8494+
if force is not None:
8495+
if "?" in url:
8496+
url = url + "&force=" + str(force).lower()
8497+
else:
8498+
url = url + "?force=" + str(force).lower()
8499+
84848500
_client = self.client.get_http_client()
84858501

84868502
response = await _client.delete(

kittycad/tests/test_examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,7 @@ async def test_list_payment_methods_for_user_async():
29872987
def test_delete_payment_method_for_user():
29882988
client = KittyCAD() # Uses KITTYCAD_API_TOKEN environment variable
29892989

2990-
client.payments.delete_payment_method_for_user(id="<string>")
2990+
client.payments.delete_payment_method_for_user(id="<string>", force=False)
29912991

29922992

29932993
# OR run async
@@ -2996,7 +2996,7 @@ def test_delete_payment_method_for_user():
29962996
async def test_delete_payment_method_for_user_async():
29972997
client = AsyncKittyCAD() # Uses KITTYCAD_API_TOKEN environment variable
29982998

2999-
await client.payments.delete_payment_method_for_user(id="<string>")
2999+
await client.payments.delete_payment_method_for_user(id="<string>", force=False)
30003000

30013001

30023002
@pytest.mark.skip

spec.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17116,6 +17116,14 @@
1711617116
"schema": {
1711717117
"type": "string"
1711817118
}
17119+
},
17120+
{
17121+
"in": "query",
17122+
"name": "force",
17123+
"description": "If true, force the deletion by bypassing our only-payment-method check.",
17124+
"schema": {
17125+
"type": "boolean"
17126+
}
1711917127
}
1712017128
],
1712117129
"responses": {

0 commit comments

Comments
 (0)