OpenRouterCurrentApiKey.fromMap constructor
OpenRouterCurrentApiKey.fromMap(
- Map<String, dynamic> map
)
Implementation
factory OpenRouterCurrentApiKey.fromMap(Map<String, dynamic> map) =>
OpenRouterCurrentApiKey(
byokUsage: _asDouble(map['byok_usage']),
byokUsageDaily: _asDouble(map['byok_usage_daily']),
byokUsageWeekly: _asDouble(map['byok_usage_weekly']),
byokUsageMonthly: _asDouble(map['byok_usage_monthly']),
creatorUserId: _asString(map['creator_user_id']),
includeByokInLimit: _asBool(map['include_byok_in_limit']),
isFreeTier: _asBool(map['is_free_tier']),
isManagementKey: _asBool(map['is_management_key']),
isProvisioningKey: _asBool(map['is_provisioning_key']),
label: _asString(map['label']),
limit: _asDouble(map['limit']),
limitRemaining: _asDouble(map['limit_remaining']),
limitReset: OpenRouterApiKeyLimitResetX.fromWireValue(
_asString(map['limit_reset']),
),
usage: _asDouble(map['usage']),
usageDaily: _asDouble(map['usage_daily']),
usageWeekly: _asDouble(map['usage_weekly']),
usageMonthly: _asDouble(map['usage_monthly']),
rateLimit:
map['rate_limit'] is Map<String, dynamic>
? OpenRouterCurrentApiKeyRateLimit.fromMap(
map['rate_limit'] as Map<String, dynamic>,
)
: null,
expiresAt: _asDateTime(map['expires_at']),
);