MCPcopy Create free account
hub / github.com/github/copilot-sdk / AccountQuotaSnapshot

Class AccountQuotaSnapshot

python/copilot/generated/rpc.py:241–292  ·  view source on GitHub ↗

Schema for the `AccountQuotaSnapshot` type.

Source from the content-addressed store, hash-verified

239# Experimental: this type is part of an experimental API and may change or be removed.
240@dataclass
241class AccountQuotaSnapshot:
242 """Schema for the `AccountQuotaSnapshot` type."""
243
244 entitlement_requests: int
245 """Number of requests included in the entitlement, or -1 for unlimited entitlements"""
246
247 is_unlimited_entitlement: bool
248 """Whether the user has an unlimited usage entitlement"""
249
250 overage: float
251 """Number of additional usage requests made this period"""
252
253 overage_allowed_with_exhausted_quota: bool
254 """Whether additional usage is allowed when quota is exhausted"""
255
256 remaining_percentage: float
257 """Percentage of entitlement remaining"""
258
259 usage_allowed_with_exhausted_quota: bool
260 """Whether usage is still permitted after quota exhaustion"""
261
262 used_requests: int
263 """Number of requests used so far this period"""
264
265 reset_date: str | None = None
266 """Date when the quota resets (ISO 8601 string)"""
267
268 @staticmethod
269 def from_dict(obj: Any) -> 'AccountQuotaSnapshot':
270 assert isinstance(obj, dict)
271 entitlement_requests = from_int(obj.get("entitlementRequests"))
272 is_unlimited_entitlement = from_bool(obj.get("isUnlimitedEntitlement"))
273 overage = from_float(obj.get("overage"))
274 overage_allowed_with_exhausted_quota = from_bool(obj.get("overageAllowedWithExhaustedQuota"))
275 remaining_percentage = from_float(obj.get("remainingPercentage"))
276 usage_allowed_with_exhausted_quota = from_bool(obj.get("usageAllowedWithExhaustedQuota"))
277 used_requests = from_int(obj.get("usedRequests"))
278 reset_date = from_union([from_str, from_none], obj.get("resetDate"))
279 return AccountQuotaSnapshot(entitlement_requests, is_unlimited_entitlement, overage, overage_allowed_with_exhausted_quota, remaining_percentage, usage_allowed_with_exhausted_quota, used_requests, reset_date)
280
281 def to_dict(self) -> dict:
282 result: dict = {}
283 result["entitlementRequests"] = from_int(self.entitlement_requests)
284 result["isUnlimitedEntitlement"] = from_bool(self.is_unlimited_entitlement)
285 result["overage"] = to_float(self.overage)
286 result["overageAllowedWithExhaustedQuota"] = from_bool(self.overage_allowed_with_exhausted_quota)
287 result["remainingPercentage"] = to_float(self.remaining_percentage)
288 result["usageAllowedWithExhaustedQuota"] = from_bool(self.usage_allowed_with_exhausted_quota)
289 result["usedRequests"] = from_int(self.used_requests)
290 if self.reset_date is not None:
291 result["resetDate"] = from_union([from_str, from_none], self.reset_date)
292 return result
293
294# Experimental: this type is part of an experimental API and may change or be removed.
295@dataclass

Callers 1

from_dictMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…