Skip to content

Commit 990cbc9

Browse files
feat(sdk): v4.17.0 - Auto-generated from unified API spec
Generated from unified API spec v4.17.0 Changes: - Auto-generated SDK updates This PR was automatically created by the API generation pipeline.
1 parent a0dd5af commit 990cbc9

14 files changed

Lines changed: 402 additions & 11 deletions

.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ docs/GetMyUsage200Response.md
199199
docs/GetMyUsage200ResponseDaily.md
200200
docs/GetMyUsage200ResponseMonthly.md
201201
docs/GetMyUsage200ResponseQuota.md
202+
docs/GetMyUsage200ResponseQuotaDailyLimit.md
203+
docs/GetMyUsage200ResponseQuotaMonthlyLimit.md
202204
docs/GetSkill200Response.md
203205
docs/GetSkill200ResponseSkill.md
204206
docs/GetSlackBot200Response.md
@@ -654,6 +656,8 @@ quantcdn/models/get_my_usage200_response.py
654656
quantcdn/models/get_my_usage200_response_daily.py
655657
quantcdn/models/get_my_usage200_response_monthly.py
656658
quantcdn/models/get_my_usage200_response_quota.py
659+
quantcdn/models/get_my_usage200_response_quota_daily_limit.py
660+
quantcdn/models/get_my_usage200_response_quota_monthly_limit.py
657661
quantcdn/models/get_skill200_response.py
658662
quantcdn/models/get_skill200_response_skill.py
659663
quantcdn/models/get_slack_bot200_response.py
@@ -1085,6 +1089,8 @@ test/test_get_my_usage200_response.py
10851089
test/test_get_my_usage200_response_daily.py
10861090
test/test_get_my_usage200_response_monthly.py
10871091
test/test_get_my_usage200_response_quota.py
1092+
test/test_get_my_usage200_response_quota_daily_limit.py
1093+
test/test_get_my_usage200_response_quota_monthly_limit.py
10881094
test/test_get_skill200_response.py
10891095
test/test_get_skill200_response_skill.py
10901096
test/test_get_slack_bot200_response.py

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,8 @@ Class | Method | HTTP request | Description
511511
- [GetMyUsage200ResponseDaily](docs/GetMyUsage200ResponseDaily.md)
512512
- [GetMyUsage200ResponseMonthly](docs/GetMyUsage200ResponseMonthly.md)
513513
- [GetMyUsage200ResponseQuota](docs/GetMyUsage200ResponseQuota.md)
514+
- [GetMyUsage200ResponseQuotaDailyLimit](docs/GetMyUsage200ResponseQuotaDailyLimit.md)
515+
- [GetMyUsage200ResponseQuotaMonthlyLimit](docs/GetMyUsage200ResponseQuotaMonthlyLimit.md)
514516
- [GetSkill200Response](docs/GetSkill200Response.md)
515517
- [GetSkill200ResponseSkill](docs/GetSkill200ResponseSkill.md)
516518
- [GetSlackBot200Response](docs/GetSlackBot200Response.md)

docs/GetMyUsage200ResponseQuota.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8-
**monthly_limit** | **int** | Per-user monthly budget in US cents | [optional]
9-
**daily_limit** | **int** | Per-user daily budget in US cents | [optional]
8+
**monthly_limit** | [**GetMyUsage200ResponseQuotaMonthlyLimit**](GetMyUsage200ResponseQuotaMonthlyLimit.md) | | [optional]
9+
**daily_limit** | [**GetMyUsage200ResponseQuotaDailyLimit**](GetMyUsage200ResponseQuotaDailyLimit.md) | | [optional]
1010

1111
## Example
1212

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# GetMyUsage200ResponseQuotaDailyLimit
2+
3+
Per-user daily spend cap (object form, present when an org-level perUserDailyBudget is configured)
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**limit_cents** | **int** | The configured daily cap in US cents | [optional]
10+
**used_percent** | **float** | Percentage of the cap consumed today (0–100+) | [optional]
11+
**remaining_cents** | **int** | Cents remaining before the cap is hit; can be negative if overspent | [optional]
12+
**resets_at** | **datetime** | UTC timestamp when the daily counter resets (always next UTC midnight) | [optional]
13+
14+
## Example
15+
16+
```python
17+
from quantcdn.models.get_my_usage200_response_quota_daily_limit import GetMyUsage200ResponseQuotaDailyLimit
18+
19+
# TODO update the JSON string below
20+
json = "{}"
21+
# create an instance of GetMyUsage200ResponseQuotaDailyLimit from a JSON string
22+
get_my_usage200_response_quota_daily_limit_instance = GetMyUsage200ResponseQuotaDailyLimit.from_json(json)
23+
# print the JSON string representation of the object
24+
print(GetMyUsage200ResponseQuotaDailyLimit.to_json())
25+
26+
# convert the object into a dict
27+
get_my_usage200_response_quota_daily_limit_dict = get_my_usage200_response_quota_daily_limit_instance.to_dict()
28+
# create an instance of GetMyUsage200ResponseQuotaDailyLimit from a dict
29+
get_my_usage200_response_quota_daily_limit_from_dict = GetMyUsage200ResponseQuotaDailyLimit.from_dict(get_my_usage200_response_quota_daily_limit_dict)
30+
```
31+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
32+
33+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# GetMyUsage200ResponseQuotaMonthlyLimit
2+
3+
Per-user monthly spend cap (object form, present when an org-level perUserMonthlyBudget is configured)
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**limit_cents** | **int** | The configured monthly cap in US cents | [optional]
10+
**used_percent** | **float** | Percentage of the cap consumed this month (0–100+) | [optional]
11+
**remaining_cents** | **int** | Cents remaining before the cap is hit; can be negative if overspent | [optional]
12+
13+
## Example
14+
15+
```python
16+
from quantcdn.models.get_my_usage200_response_quota_monthly_limit import GetMyUsage200ResponseQuotaMonthlyLimit
17+
18+
# TODO update the JSON string below
19+
json = "{}"
20+
# create an instance of GetMyUsage200ResponseQuotaMonthlyLimit from a JSON string
21+
get_my_usage200_response_quota_monthly_limit_instance = GetMyUsage200ResponseQuotaMonthlyLimit.from_json(json)
22+
# print the JSON string representation of the object
23+
print(GetMyUsage200ResponseQuotaMonthlyLimit.to_json())
24+
25+
# convert the object into a dict
26+
get_my_usage200_response_quota_monthly_limit_dict = get_my_usage200_response_quota_monthly_limit_instance.to_dict()
27+
# create an instance of GetMyUsage200ResponseQuotaMonthlyLimit from a dict
28+
get_my_usage200_response_quota_monthly_limit_from_dict = GetMyUsage200ResponseQuotaMonthlyLimit.from_dict(get_my_usage200_response_quota_monthly_limit_dict)
29+
```
30+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
31+
32+

quantcdn/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@
237237
from quantcdn.models.get_my_usage200_response_daily import GetMyUsage200ResponseDaily
238238
from quantcdn.models.get_my_usage200_response_monthly import GetMyUsage200ResponseMonthly
239239
from quantcdn.models.get_my_usage200_response_quota import GetMyUsage200ResponseQuota
240+
from quantcdn.models.get_my_usage200_response_quota_daily_limit import GetMyUsage200ResponseQuotaDailyLimit
241+
from quantcdn.models.get_my_usage200_response_quota_monthly_limit import GetMyUsage200ResponseQuotaMonthlyLimit
240242
from quantcdn.models.get_skill200_response import GetSkill200Response
241243
from quantcdn.models.get_skill200_response_skill import GetSkill200ResponseSkill
242244
from quantcdn.models.get_slack_bot200_response import GetSlackBot200Response

quantcdn/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@
182182
from quantcdn.models.get_my_usage200_response_daily import GetMyUsage200ResponseDaily
183183
from quantcdn.models.get_my_usage200_response_monthly import GetMyUsage200ResponseMonthly
184184
from quantcdn.models.get_my_usage200_response_quota import GetMyUsage200ResponseQuota
185+
from quantcdn.models.get_my_usage200_response_quota_daily_limit import GetMyUsage200ResponseQuotaDailyLimit
186+
from quantcdn.models.get_my_usage200_response_quota_monthly_limit import GetMyUsage200ResponseQuotaMonthlyLimit
185187
from quantcdn.models.get_skill200_response import GetSkill200Response
186188
from quantcdn.models.get_skill200_response_skill import GetSkill200ResponseSkill
187189
from quantcdn.models.get_slack_bot200_response import GetSlackBot200Response

quantcdn/models/get_my_usage200_response_quota.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@
1717
import re # noqa: F401
1818
import json
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictInt
20+
from pydantic import BaseModel, ConfigDict, Field
2121
from typing import Any, ClassVar, Dict, List, Optional
22+
from quantcdn.models.get_my_usage200_response_quota_daily_limit import GetMyUsage200ResponseQuotaDailyLimit
23+
from quantcdn.models.get_my_usage200_response_quota_monthly_limit import GetMyUsage200ResponseQuotaMonthlyLimit
2224
from typing import Optional, Set
2325
from typing_extensions import Self
2426

2527
class GetMyUsage200ResponseQuota(BaseModel):
2628
"""
2729
GetMyUsage200ResponseQuota
2830
""" # noqa: E501
29-
monthly_limit: Optional[StrictInt] = Field(default=None, description="Per-user monthly budget in US cents", alias="monthlyLimit")
30-
daily_limit: Optional[StrictInt] = Field(default=None, description="Per-user daily budget in US cents", alias="dailyLimit")
31+
monthly_limit: Optional[GetMyUsage200ResponseQuotaMonthlyLimit] = Field(default=None, alias="monthlyLimit")
32+
daily_limit: Optional[GetMyUsage200ResponseQuotaDailyLimit] = Field(default=None, alias="dailyLimit")
3133
__properties: ClassVar[List[str]] = ["monthlyLimit", "dailyLimit"]
3234

3335
model_config = ConfigDict(
@@ -69,6 +71,12 @@ def to_dict(self) -> Dict[str, Any]:
6971
exclude=excluded_fields,
7072
exclude_none=True,
7173
)
74+
# override the default output from pydantic by calling `to_dict()` of monthly_limit
75+
if self.monthly_limit:
76+
_dict['monthlyLimit'] = self.monthly_limit.to_dict()
77+
# override the default output from pydantic by calling `to_dict()` of daily_limit
78+
if self.daily_limit:
79+
_dict['dailyLimit'] = self.daily_limit.to_dict()
7280
# set to None if monthly_limit (nullable) is None
7381
# and model_fields_set contains the field
7482
if self.monthly_limit is None and "monthly_limit" in self.model_fields_set:
@@ -91,8 +99,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
9199
return cls.model_validate(obj)
92100

93101
_obj = cls.model_validate({
94-
"monthlyLimit": obj.get("monthlyLimit"),
95-
"dailyLimit": obj.get("dailyLimit")
102+
"monthlyLimit": GetMyUsage200ResponseQuotaMonthlyLimit.from_dict(obj["monthlyLimit"]) if obj.get("monthlyLimit") is not None else None,
103+
"dailyLimit": GetMyUsage200ResponseQuotaDailyLimit.from_dict(obj["dailyLimit"]) if obj.get("dailyLimit") is not None else None
96104
})
97105
return _obj
98106

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# coding: utf-8
2+
3+
"""
4+
QuantCDN API
5+
6+
Unified API for QuantCDN Admin and QuantCloud Platform services
7+
8+
The version of the OpenAPI document: 4.17.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
15+
from __future__ import annotations
16+
import pprint
17+
import re # noqa: F401
18+
import json
19+
20+
from datetime import datetime
21+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
22+
from typing import Any, ClassVar, Dict, List, Optional, Union
23+
from typing import Optional, Set
24+
from typing_extensions import Self
25+
26+
class GetMyUsage200ResponseQuotaDailyLimit(BaseModel):
27+
"""
28+
Per-user daily spend cap (object form, present when an org-level perUserDailyBudget is configured)
29+
""" # noqa: E501
30+
limit_cents: Optional[StrictInt] = Field(default=None, description="The configured daily cap in US cents", alias="limitCents")
31+
used_percent: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percentage of the cap consumed today (0–100+)", alias="usedPercent")
32+
remaining_cents: Optional[StrictInt] = Field(default=None, description="Cents remaining before the cap is hit; can be negative if overspent", alias="remainingCents")
33+
resets_at: Optional[datetime] = Field(default=None, description="UTC timestamp when the daily counter resets (always next UTC midnight)", alias="resetsAt")
34+
__properties: ClassVar[List[str]] = ["limitCents", "usedPercent", "remainingCents", "resetsAt"]
35+
36+
model_config = ConfigDict(
37+
populate_by_name=True,
38+
validate_assignment=True,
39+
protected_namespaces=(),
40+
)
41+
42+
43+
def to_str(self) -> str:
44+
"""Returns the string representation of the model using alias"""
45+
return pprint.pformat(self.model_dump(by_alias=True))
46+
47+
def to_json(self) -> str:
48+
"""Returns the JSON representation of the model using alias"""
49+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50+
return json.dumps(self.to_dict())
51+
52+
@classmethod
53+
def from_json(cls, json_str: str) -> Optional[Self]:
54+
"""Create an instance of GetMyUsage200ResponseQuotaDailyLimit from a JSON string"""
55+
return cls.from_dict(json.loads(json_str))
56+
57+
def to_dict(self) -> Dict[str, Any]:
58+
"""Return the dictionary representation of the model using alias.
59+
60+
This has the following differences from calling pydantic's
61+
`self.model_dump(by_alias=True)`:
62+
63+
* `None` is only added to the output dict for nullable fields that
64+
were set at model initialization. Other fields with value `None`
65+
are ignored.
66+
"""
67+
excluded_fields: Set[str] = set([
68+
])
69+
70+
_dict = self.model_dump(
71+
by_alias=True,
72+
exclude=excluded_fields,
73+
exclude_none=True,
74+
)
75+
return _dict
76+
77+
@classmethod
78+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79+
"""Create an instance of GetMyUsage200ResponseQuotaDailyLimit from a dict"""
80+
if obj is None:
81+
return None
82+
83+
if not isinstance(obj, dict):
84+
return cls.model_validate(obj)
85+
86+
_obj = cls.model_validate({
87+
"limitCents": obj.get("limitCents"),
88+
"usedPercent": obj.get("usedPercent"),
89+
"remainingCents": obj.get("remainingCents"),
90+
"resetsAt": obj.get("resetsAt")
91+
})
92+
return _obj
93+
94+
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# coding: utf-8
2+
3+
"""
4+
QuantCDN API
5+
6+
Unified API for QuantCDN Admin and QuantCloud Platform services
7+
8+
The version of the OpenAPI document: 4.17.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
15+
from __future__ import annotations
16+
import pprint
17+
import re # noqa: F401
18+
import json
19+
20+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
21+
from typing import Any, ClassVar, Dict, List, Optional, Union
22+
from typing import Optional, Set
23+
from typing_extensions import Self
24+
25+
class GetMyUsage200ResponseQuotaMonthlyLimit(BaseModel):
26+
"""
27+
Per-user monthly spend cap (object form, present when an org-level perUserMonthlyBudget is configured)
28+
""" # noqa: E501
29+
limit_cents: Optional[StrictInt] = Field(default=None, description="The configured monthly cap in US cents", alias="limitCents")
30+
used_percent: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percentage of the cap consumed this month (0–100+)", alias="usedPercent")
31+
remaining_cents: Optional[StrictInt] = Field(default=None, description="Cents remaining before the cap is hit; can be negative if overspent", alias="remainingCents")
32+
__properties: ClassVar[List[str]] = ["limitCents", "usedPercent", "remainingCents"]
33+
34+
model_config = ConfigDict(
35+
populate_by_name=True,
36+
validate_assignment=True,
37+
protected_namespaces=(),
38+
)
39+
40+
41+
def to_str(self) -> str:
42+
"""Returns the string representation of the model using alias"""
43+
return pprint.pformat(self.model_dump(by_alias=True))
44+
45+
def to_json(self) -> str:
46+
"""Returns the JSON representation of the model using alias"""
47+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48+
return json.dumps(self.to_dict())
49+
50+
@classmethod
51+
def from_json(cls, json_str: str) -> Optional[Self]:
52+
"""Create an instance of GetMyUsage200ResponseQuotaMonthlyLimit from a JSON string"""
53+
return cls.from_dict(json.loads(json_str))
54+
55+
def to_dict(self) -> Dict[str, Any]:
56+
"""Return the dictionary representation of the model using alias.
57+
58+
This has the following differences from calling pydantic's
59+
`self.model_dump(by_alias=True)`:
60+
61+
* `None` is only added to the output dict for nullable fields that
62+
were set at model initialization. Other fields with value `None`
63+
are ignored.
64+
"""
65+
excluded_fields: Set[str] = set([
66+
])
67+
68+
_dict = self.model_dump(
69+
by_alias=True,
70+
exclude=excluded_fields,
71+
exclude_none=True,
72+
)
73+
return _dict
74+
75+
@classmethod
76+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77+
"""Create an instance of GetMyUsage200ResponseQuotaMonthlyLimit from a dict"""
78+
if obj is None:
79+
return None
80+
81+
if not isinstance(obj, dict):
82+
return cls.model_validate(obj)
83+
84+
_obj = cls.model_validate({
85+
"limitCents": obj.get("limitCents"),
86+
"usedPercent": obj.get("usedPercent"),
87+
"remainingCents": obj.get("remainingCents")
88+
})
89+
return _obj
90+
91+

0 commit comments

Comments
 (0)