Skip to content

Commit 7733b06

Browse files
Update api spec (#429)
* YOYO NEW API SPEC! * I have generated the latest API! --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent cfcad06 commit 7733b06

File tree

6 files changed

+485
-449
lines changed

6 files changed

+485
-449
lines changed

kittycad.py.patch.json

Lines changed: 411 additions & 411 deletions
Large diffs are not rendered by default.

kittycad/models/customer_balance.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ class CustomerBalance(BaseModel):
2121

2222
modeling_app_enterprise_price: Optional[SubscriptionTierPrice] = None
2323

24-
monthly_credits_remaining: float
24+
monthly_api_credits_remaining: int
2525

26-
pre_pay_cash_remaining: float
26+
monthly_api_credits_remaining_monetary_value: float
2727

28-
pre_pay_credits_remaining: float
28+
stable_api_credits_remaining: int
29+
30+
stable_api_credits_remaining_monetary_value: float
2931

3032
subscription_details: Optional[ZooProductSubscriptions] = None
3133

kittycad/models/modeling_app_subscription_tier.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ class ModelingAppSubscriptionTier(BaseModel):
2626

2727
features: Optional[List[SubscriptionTierFeature]] = None
2828

29+
monthly_pay_as_you_go_api_credits: int = 0
30+
31+
monthly_pay_as_you_go_api_credits_monetary_value: float
32+
2933
name: ModelingAppSubscriptionTierName
3034

31-
pay_as_you_go_credits: float
35+
pay_as_you_go_api_credit_price: float = 0.0
3236

3337
price: SubscriptionTierPrice
3438

kittycad/models/update_payment_balance.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
class UpdatePaymentBalance(BaseModel):
77
"""The data for updating a balance."""
88

9-
monthly_credits_remaining: Optional[float] = None
9+
monthly_api_credits_remaining_monetary_value: Optional[float] = None
1010

11-
pre_pay_cash_remaining: Optional[float] = None
12-
13-
pre_pay_credits_remaining: Optional[float] = None
11+
stable_api_credits_remaining_monetary_value: Optional[float] = None
1412

1513
model_config = ConfigDict(protected_namespaces=())

kittycad/models/zoo_product_subscription.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ class ZooProductSubscription(BaseModel):
2626

2727
features: Optional[List[SubscriptionTierFeature]] = None
2828

29+
monthly_pay_as_you_go_api_credits: int = 0
30+
31+
monthly_pay_as_you_go_api_credits_monetary_value: float
32+
2933
name: ModelingAppSubscriptionTierName
3034

31-
pay_as_you_go_credits: float
35+
pay_as_you_go_api_credit_price: float = 0.0
3236

3337
price: SubscriptionTierPrice
3438

spec.json

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19874,21 +19874,27 @@
1987419874
}
1987519875
]
1987619876
},
19877-
"monthly_credits_remaining": {
19878-
"title": "double",
19879-
"description": "The monthy credits remaining in the balance. This gets re-upped every month, but if the credits are not used for a month they do not carry over to the next month. It is a stable amount granted to the customer per month.",
19880-
"type": "number",
19881-
"format": "money-usd"
19877+
"monthly_api_credits_remaining": {
19878+
"description": "The number of monthly API credits remaining in the balance. This is the number of credits remaining in the balance.\n\nBoth the monetary value and the number of credits are returned, but they reflect the same value in the database.",
19879+
"type": "integer",
19880+
"format": "uint64",
19881+
"minimum": 0
1988219882
},
19883-
"pre_pay_cash_remaining": {
19883+
"monthly_api_credits_remaining_monetary_value": {
1988419884
"title": "double",
19885-
"description": "The amount of pre-pay cash remaining in the balance. This number goes down as the customer uses their pre-paid credits. The reason we track this amount is if a customer ever wants to withdraw their pre-pay cash, we can use this amount to determine how much to give them. Say a customer has $100 in pre-paid cash, their bill is worth, $50 after subtracting any other credits (like monthly etc.) Their bill is $50, their pre-pay cash remaining will be subtracted by 50 to pay the bill and their `pre_pay_credits_remaining` will be subtracted by 50 to pay the bill. This way if they want to withdraw money after, they can only withdraw $50 since that is the amount of cash they have remaining.",
19885+
"description": "The monetary value of the monthy API credits remaining in the balance. This gets re-upped every month, but if the credits are not used for a month they do not carry over to the next month.\n\nBoth the monetary value and the number of credits are returned, but they reflect the same value in the database.",
1988619886
"type": "number",
1988719887
"format": "money-usd"
1988819888
},
19889-
"pre_pay_credits_remaining": {
19889+
"stable_api_credits_remaining": {
19890+
"description": "The number of stable API credits remaining in the balance. These do not get reset or re-upped every month. This is separate from the monthly credits. Credits will first pull from the monthly credits, then the stable credits. Stable just means that they do not get reset every month. A user will have stable credits if a Zoo employee granted them credits.\n\nBoth the monetary value and the number of credits are returned, but they reflect the same value in the database.",
19891+
"type": "integer",
19892+
"format": "uint64",
19893+
"minimum": 0
19894+
},
19895+
"stable_api_credits_remaining_monetary_value": {
1989019896
"title": "double",
19891-
"description": "The amount of credits remaining in the balance. This is typically the amount of cash * some multiplier they get for pre-paying their account. This number lowers every time a bill is paid with the balance. This number increases every time a customer adds funds to their balance. This may be through a subscription or a one off payment.",
19897+
"description": "The monetary value of stable API credits remaining in the balance. These do not get reset or re-upped every month. This is separate from the monthly credits. Credits will first pull from the monthly credits, then the stable credits. Stable just means that they do not get reset every month. A user will have stable credits if a Zoo employee granted them credits.\n\nBoth the monetary value and the number of credits are returned, but they reflect the same value in the database.",
1989219898
"type": "number",
1989319899
"format": "money-usd"
1989419900
},
@@ -19923,9 +19929,10 @@
1992319929
"created_at",
1992419930
"id",
1992519931
"map_id",
19926-
"monthly_credits_remaining",
19927-
"pre_pay_cash_remaining",
19928-
"pre_pay_credits_remaining",
19932+
"monthly_api_credits_remaining",
19933+
"monthly_api_credits_remaining_monetary_value",
19934+
"stable_api_credits_remaining",
19935+
"stable_api_credits_remaining_monetary_value",
1992919936
"total_due",
1993019937
"updated_at"
1993119938
]
@@ -23745,6 +23752,19 @@
2374523752
"minItems": 0,
2374623753
"maxItems": 15
2374723754
},
23755+
"monthly_pay_as_you_go_api_credits": {
23756+
"description": "The amount of pay-as-you-go API credits the individual or org gets outside the modeling app per month. This re-ups on the 1st of each month. This is equivalent to the monetary value divided by the price of an API credit.",
23757+
"default": 0,
23758+
"type": "integer",
23759+
"format": "uint64",
23760+
"minimum": 0
23761+
},
23762+
"monthly_pay_as_you_go_api_credits_monetary_value": {
23763+
"title": "double",
23764+
"description": "The monetary value of pay-as-you-go API credits the individual or org gets outside the modeling app per month. This re-ups on the 1st of each month.",
23765+
"type": "number",
23766+
"format": "money-usd"
23767+
},
2374823768
"name": {
2374923769
"description": "The name of the tier.",
2375023770
"allOf": [
@@ -23753,9 +23773,10 @@
2375323773
}
2375423774
]
2375523775
},
23756-
"pay_as_you_go_credits": {
23776+
"pay_as_you_go_api_credit_price": {
2375723777
"title": "double",
23758-
"description": "The amount of pay-as-you-go credits the individual or org gets outside the modeling app.",
23778+
"description": "The price of an API credit (meaning 1 credit = 1 minute of API usage).",
23779+
"default": 0.0,
2375923780
"type": "number",
2376023781
"format": "money-usd"
2376123782
},
@@ -23808,8 +23829,8 @@
2380823829
},
2380923830
"required": [
2381023831
"description",
23832+
"monthly_pay_as_you_go_api_credits_monetary_value",
2381123833
"name",
23812-
"pay_as_you_go_credits",
2381323834
"price",
2381423835
"support_tier",
2381523836
"training_data_behavior",
@@ -35762,24 +35783,17 @@
3576235783
"description": "The data for updating a balance.",
3576335784
"type": "object",
3576435785
"properties": {
35765-
"monthly_credits_remaining": {
35766-
"nullable": true,
35767-
"title": "double",
35768-
"description": "The monthy credits remaining in the balance. This gets re-upped every month, but if the credits are not used for a month they do not carry over to the next month. It is a stable amount granted to the user per month.",
35769-
"type": "number",
35770-
"format": "money-usd"
35771-
},
35772-
"pre_pay_cash_remaining": {
35786+
"monthly_api_credits_remaining_monetary_value": {
3577335787
"nullable": true,
3577435788
"title": "double",
35775-
"description": "The amount of pre-pay cash remaining in the balance. This number goes down as the user uses their pre-paid credits. The reason we track this amount is if a user ever wants to withdraw their pre-pay cash, we can use this amount to determine how much to give them. Say a user has $100 in pre-paid cash, their bill is worth, $50 after subtracting any other credits (like monthly etc.) Their bill is $50, their pre-pay cash remaining will be subtracted by 50 to pay the bill and their `pre_pay_credits_remaining` will be subtracted by 50 to pay the bill. This way if they want to withdraw money after, they can only withdraw $50 since that is the amount of cash they have remaining.",
35789+
"description": "The monetary value of the monthy API credits remaining in the balance. This gets re-upped every month,",
3577635790
"type": "number",
3577735791
"format": "money-usd"
3577835792
},
35779-
"pre_pay_credits_remaining": {
35793+
"stable_api_credits_remaining_monetary_value": {
3578035794
"nullable": true,
3578135795
"title": "double",
35782-
"description": "The amount of credits remaining in the balance. This is typically the amount of cash * some multiplier they get for pre-paying their account. This number lowers every time a bill is paid with the balance. This number increases every time a user adds funds to their balance. This may be through a subscription or a one off payment.",
35796+
"description": "The monetary value of stable API credits remaining in the balance. These do not get reset or re-upped every month. This is separate from the monthly credits. Credits will first pull from the monthly credits, then the stable credits. Stable just means that they do not get reset every month. A user will have stable credits if a Zoo employee granted them credits.",
3578335797
"type": "number",
3578435798
"format": "money-usd"
3578535799
}
@@ -36444,6 +36458,19 @@
3644436458
"minItems": 0,
3644536459
"maxItems": 15
3644636460
},
36461+
"monthly_pay_as_you_go_api_credits": {
36462+
"description": "The amount of pay-as-you-go API credits the individual or org gets outside the modeling app per month. This re-ups on the 1st of each month. This is equivalent to the monetary value divided by the price of an API credit.",
36463+
"default": 0,
36464+
"type": "integer",
36465+
"format": "uint64",
36466+
"minimum": 0
36467+
},
36468+
"monthly_pay_as_you_go_api_credits_monetary_value": {
36469+
"title": "double",
36470+
"description": "The monetary value of pay-as-you-go API credits the individual or org gets outside the modeling app per month. This re-ups on the 1st of each month.",
36471+
"type": "number",
36472+
"format": "money-usd"
36473+
},
3644736474
"name": {
3644836475
"description": "The name of the tier.",
3644936476
"allOf": [
@@ -36452,9 +36479,10 @@
3645236479
}
3645336480
]
3645436481
},
36455-
"pay_as_you_go_credits": {
36482+
"pay_as_you_go_api_credit_price": {
3645636483
"title": "double",
36457-
"description": "The amount of pay-as-you-go credits the individual or org gets outside the modeling app.",
36484+
"description": "The price of an API credit (meaning 1 credit = 1 minute of API usage).",
36485+
"default": 0.0,
3645836486
"type": "number",
3645936487
"format": "money-usd"
3646036488
},
@@ -36507,8 +36535,8 @@
3650736535
},
3650836536
"required": [
3650936537
"description",
36538+
"monthly_pay_as_you_go_api_credits_monetary_value",
3651036539
"name",
36511-
"pay_as_you_go_credits",
3651236540
"price",
3651336541
"support_tier",
3651436542
"training_data_behavior",

0 commit comments

Comments
 (0)