// GENERATED CODE - DO NOT MODIFY BY HAND part of 'llm_observability_models.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** LLMTrace _$LLMTraceFromJson(Map json) => $checkedCreate( 'LLMTrace', json, ($checkedConvert) { final val = LLMTrace( id: $checkedConvert('id', (v) => v as String), traceId: $checkedConvert('traceId', (v) => v as String), provider: $checkedConvert('provider', (v) => v as String), model: $checkedConvert('model', (v) => v as String), userId: $checkedConvert('userId', (v) => v as String?), sessionId: $checkedConvert('sessionId', (v) => v as String?), timestamp: $checkedConvert( 'createdAt', (v) => const TimestampConverter().fromJson(v)), request: $checkedConvert( 'request', (v) => LLMRequest.fromJson(v as Map)), response: $checkedConvert( 'response', (v) => v == null ? null : LLMResponse.fromJson(v as Map)), performance: $checkedConvert( 'performance', (v) => v == null ? null : LLMPerformanceMetrics.fromJson(v as Map)), error: $checkedConvert( 'error', (v) => v == null ? null : LLMError.fromJson(v as Map)), toolCalls: $checkedConvert( 'toolCalls', (v) => (v as List?) ?.map((e) => LLMToolCall.fromJson(e as Map)) .toList()), metadata: $checkedConvert('metadata', (v) => v as Map?), status: $checkedConvert( 'status', (v) => $enumDecodeNullable(_$LLMTraceStatusEnumMap, v) ?? LLMTraceStatus.pending), isStreaming: $checkedConvert('isStreaming', (v) => v as bool? ?? false), ); return val; }, fieldKeyMap: const {'timestamp': 'createdAt'}, ); Map _$LLMTraceToJson(LLMTrace instance) { final val = { 'id': instance.id, 'traceId': instance.traceId, 'provider': instance.provider, 'model': instance.model, }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('userId', instance.userId); writeNotNull('sessionId', instance.sessionId); writeNotNull( 'createdAt', const TimestampConverter().toJson(instance.timestamp)); val['request'] = instance.request.toJson(); writeNotNull('response', instance.response?.toJson()); writeNotNull('performance', instance.performance?.toJson()); writeNotNull('error', instance.error?.toJson()); writeNotNull( 'toolCalls', instance.toolCalls?.map((e) => e.toJson()).toList()); writeNotNull('metadata', instance.metadata); val['status'] = _$LLMTraceStatusEnumMap[instance.status]!; val['isStreaming'] = instance.isStreaming; return val; } const _$LLMTraceStatusEnumMap = { LLMTraceStatus.pending: 'pending', LLMTraceStatus.success: 'success', LLMTraceStatus.error: 'error', LLMTraceStatus.timeout: 'timeout', LLMTraceStatus.cancelled: 'cancelled', }; LLMRequest _$LLMRequestFromJson(Map json) => $checkedCreate( 'LLMRequest', json, ($checkedConvert) { final val = LLMRequest( messages: $checkedConvert( 'messages', (v) => (v as List?) ?.map((e) => LLMMessage.fromJson(e as Map)) .toList()), temperature: $checkedConvert('temperature', (v) => (v as num?)?.toDouble()), topP: $checkedConvert('topP', (v) => (v as num?)?.toDouble()), topK: $checkedConvert('topK', (v) => (v as num?)?.toInt()), maxTokens: $checkedConvert('maxTokens', (v) => (v as num?)?.toInt()), seed: $checkedConvert('seed', (v) => (v as num?)?.toInt()), tools: $checkedConvert( 'tools', (v) => (v as List?) ?.map((e) => LLMTool.fromJson(e as Map)) .toList()), toolChoice: $checkedConvert('toolChoice', (v) => v as String?), responseFormat: $checkedConvert('responseFormat', (v) => v as String?), additionalParameters: $checkedConvert( 'additionalParameters', (v) => v as Map?), ); return val; }, ); Map _$LLMRequestToJson(LLMRequest instance) { final val = {}; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('messages', instance.messages?.map((e) => e.toJson()).toList()); writeNotNull('temperature', instance.temperature); writeNotNull('topP', instance.topP); writeNotNull('topK', instance.topK); writeNotNull('maxTokens', instance.maxTokens); writeNotNull('seed', instance.seed); writeNotNull('tools', instance.tools?.map((e) => e.toJson()).toList()); writeNotNull('toolChoice', instance.toolChoice); writeNotNull('responseFormat', instance.responseFormat); writeNotNull('additionalParameters', instance.additionalParameters); return val; } LLMResponse _$LLMResponseFromJson(Map json) => $checkedCreate( 'LLMResponse', json, ($checkedConvert) { final val = LLMResponse( id: $checkedConvert('id', (v) => v as String?), content: $checkedConvert('content', (v) => v as String?), tokenUsage: $checkedConvert( 'tokenUsage', (v) => v == null ? null : LLMTokenUsage.fromJson(v as Map)), finishReason: $checkedConvert('finishReason', (v) => v as String?), toolCallResults: $checkedConvert( 'toolCallResults', (v) => (v as List?) ?.map((e) => LLMToolCallResult.fromJson(e as Map)) .toList()), metadata: $checkedConvert('metadata', (v) => v as Map?), streamChunks: $checkedConvert('streamChunks', (v) => (v as List?)?.map((e) => e as String).toList()), ); return val; }, ); Map _$LLMResponseToJson(LLMResponse instance) { final val = {}; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('id', instance.id); writeNotNull('content', instance.content); writeNotNull('tokenUsage', instance.tokenUsage?.toJson()); writeNotNull('finishReason', instance.finishReason); writeNotNull('toolCallResults', instance.toolCallResults?.map((e) => e.toJson()).toList()); writeNotNull('metadata', instance.metadata); writeNotNull('streamChunks', instance.streamChunks); return val; } LLMMessage _$LLMMessageFromJson(Map json) => $checkedCreate( 'LLMMessage', json, ($checkedConvert) { final val = LLMMessage( role: $checkedConvert('role', (v) => v as String), content: $checkedConvert('content', (v) => v as String?), name: $checkedConvert('name', (v) => v as String?), metadata: $checkedConvert('metadata', (v) => v as Map?), ); return val; }, ); Map _$LLMMessageToJson(LLMMessage instance) { final val = { 'role': instance.role, }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('content', instance.content); writeNotNull('name', instance.name); writeNotNull('metadata', instance.metadata); return val; } LLMTool _$LLMToolFromJson(Map json) => $checkedCreate( 'LLMTool', json, ($checkedConvert) { final val = LLMTool( name: $checkedConvert('name', (v) => v as String), description: $checkedConvert('description', (v) => v as String?), parameters: $checkedConvert('parameters', (v) => v as Map?), ); return val; }, ); Map _$LLMToolToJson(LLMTool instance) { final val = { 'name': instance.name, }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('description', instance.description); writeNotNull('parameters', instance.parameters); return val; } LLMToolCall _$LLMToolCallFromJson(Map json) => $checkedCreate( 'LLMToolCall', json, ($checkedConvert) { final val = LLMToolCall( id: $checkedConvert('id', (v) => v as String), name: $checkedConvert('name', (v) => v as String), arguments: $checkedConvert('arguments', (v) => v as Map?), timestamp: $checkedConvert('timestamp', (v) => v == null ? null : DateTime.parse(v as String)), ); return val; }, ); Map _$LLMToolCallToJson(LLMToolCall instance) { final val = { 'id': instance.id, 'name': instance.name, }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('arguments', instance.arguments); writeNotNull('timestamp', instance.timestamp?.toIso8601String()); return val; } LLMToolCallResult _$LLMToolCallResultFromJson(Map json) => $checkedCreate( 'LLMToolCallResult', json, ($checkedConvert) { final val = LLMToolCallResult( toolCallId: $checkedConvert('toolCallId', (v) => v as String), result: $checkedConvert('result', (v) => v as String?), error: $checkedConvert( 'error', (v) => v == null ? null : LLMError.fromJson(v as Map)), ); return val; }, ); Map _$LLMToolCallResultToJson(LLMToolCallResult instance) { final val = { 'toolCallId': instance.toolCallId, }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('result', instance.result); writeNotNull('error', instance.error?.toJson()); return val; } LLMTokenUsage _$LLMTokenUsageFromJson(Map json) => $checkedCreate( 'LLMTokenUsage', json, ($checkedConvert) { final val = LLMTokenUsage( promptTokens: $checkedConvert('promptTokens', (v) => (v as num?)?.toInt()), completionTokens: $checkedConvert('completionTokens', (v) => (v as num?)?.toInt()), totalTokens: $checkedConvert('totalTokens', (v) => (v as num?)?.toInt()), inputTokens: $checkedConvert('inputTokens', (v) => (v as num?)?.toInt()), outputTokens: $checkedConvert('outputTokens', (v) => (v as num?)?.toInt()), reasoningTokens: $checkedConvert('reasoningTokens', (v) => (v as num?)?.toInt()), cachedTokens: $checkedConvert('cachedTokens', (v) => (v as num?)?.toInt()), ); return val; }, ); Map _$LLMTokenUsageToJson(LLMTokenUsage instance) { final val = {}; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('promptTokens', instance.promptTokens); writeNotNull('completionTokens', instance.completionTokens); writeNotNull('totalTokens', instance.totalTokens); writeNotNull('inputTokens', instance.inputTokens); writeNotNull('outputTokens', instance.outputTokens); writeNotNull('reasoningTokens', instance.reasoningTokens); writeNotNull('cachedTokens', instance.cachedTokens); return val; } LLMPerformanceMetrics _$LLMPerformanceMetricsFromJson( Map json) => $checkedCreate( 'LLMPerformanceMetrics', json, ($checkedConvert) { final val = LLMPerformanceMetrics( requestLatencyMs: $checkedConvert('requestLatencyMs', (v) => (v as num?)?.toInt()), firstTokenLatencyMs: $checkedConvert( 'firstTokenLatencyMs', (v) => (v as num?)?.toInt()), totalDurationMs: $checkedConvert('totalDurationMs', (v) => (v as num?)?.toInt()), tokensPerSecond: $checkedConvert( 'tokensPerSecond', (v) => (v as num?)?.toDouble()), charactersPerSecond: $checkedConvert( 'charactersPerSecond', (v) => (v as num?)?.toDouble()), queueTimeMs: $checkedConvert('queueTimeMs', (v) => (v as num?)?.toInt()), processingTimeMs: $checkedConvert('processingTimeMs', (v) => (v as num?)?.toInt()), ); return val; }, ); Map _$LLMPerformanceMetricsToJson( LLMPerformanceMetrics instance) { final val = {}; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('requestLatencyMs', instance.requestLatencyMs); writeNotNull('firstTokenLatencyMs', instance.firstTokenLatencyMs); writeNotNull('totalDurationMs', instance.totalDurationMs); writeNotNull('tokensPerSecond', instance.tokensPerSecond); writeNotNull('charactersPerSecond', instance.charactersPerSecond); writeNotNull('queueTimeMs', instance.queueTimeMs); writeNotNull('processingTimeMs', instance.processingTimeMs); return val; } LLMError _$LLMErrorFromJson(Map json) => $checkedCreate( 'LLMError', json, ($checkedConvert) { final val = LLMError( type: $checkedConvert('type', (v) => v as String?), message: $checkedConvert('message', (v) => v as String?), code: $checkedConvert('code', (v) => v as String?), stackTrace: $checkedConvert('stackTrace', (v) => v as String?), details: $checkedConvert('details', (v) => v as Map?), ); return val; }, ); Map _$LLMErrorToJson(LLMError instance) { final val = {}; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('type', instance.type); writeNotNull('message', instance.message); writeNotNull('code', instance.code); writeNotNull('stackTrace', instance.stackTrace); writeNotNull('details', instance.details); return val; } LLMStatistics _$LLMStatisticsFromJson(Map json) => $checkedCreate( 'LLMStatistics', json, ($checkedConvert) { final val = LLMStatistics( totalCalls: $checkedConvert('totalCalls', (v) => (v as num).toInt()), successfulCalls: $checkedConvert('successfulCalls', (v) => (v as num).toInt()), failedCalls: $checkedConvert('failedCalls', (v) => (v as num).toInt()), successRate: $checkedConvert('successRate', (v) => (v as num).toDouble()), averageLatency: $checkedConvert('averageLatency', (v) => (v as num).toDouble()), totalTokens: $checkedConvert('totalTokens', (v) => (v as num).toInt()), startTime: $checkedConvert('startTime', (v) => v == null ? null : DateTime.parse(v as String)), endTime: $checkedConvert( 'endTime', (v) => v == null ? null : DateTime.parse(v as String)), details: $checkedConvert('details', (v) => v as Map?), ); return val; }, ); Map _$LLMStatisticsToJson(LLMStatistics instance) { final val = { 'totalCalls': instance.totalCalls, 'successfulCalls': instance.successfulCalls, 'failedCalls': instance.failedCalls, 'successRate': instance.successRate, 'averageLatency': instance.averageLatency, 'totalTokens': instance.totalTokens, }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('startTime', instance.startTime?.toIso8601String()); writeNotNull('endTime', instance.endTime?.toIso8601String()); writeNotNull('details', instance.details); return val; } ProviderStatistics _$ProviderStatisticsFromJson(Map json) => $checkedCreate( 'ProviderStatistics', json, ($checkedConvert) { final val = ProviderStatistics( provider: $checkedConvert('provider', (v) => v as String), statistics: $checkedConvert('statistics', (v) => LLMStatistics.fromJson(v as Map)), models: $checkedConvert( 'models', (v) => (v as List) .map((e) => ModelStatistics.fromJson(e as Map)) .toList()), ); return val; }, ); Map _$ProviderStatisticsToJson(ProviderStatistics instance) => { 'provider': instance.provider, 'statistics': instance.statistics.toJson(), 'models': instance.models.map((e) => e.toJson()).toList(), }; ModelStatistics _$ModelStatisticsFromJson(Map json) => $checkedCreate( 'ModelStatistics', json, ($checkedConvert) { final val = ModelStatistics( modelName: $checkedConvert('modelName', (v) => v as String), provider: $checkedConvert('provider', (v) => v as String), statistics: $checkedConvert('statistics', (v) => LLMStatistics.fromJson(v as Map)), ); return val; }, ); Map _$ModelStatisticsToJson(ModelStatistics instance) => { 'modelName': instance.modelName, 'provider': instance.provider, 'statistics': instance.statistics.toJson(), }; UserStatistics _$UserStatisticsFromJson(Map json) => $checkedCreate( 'UserStatistics', json, ($checkedConvert) { final val = UserStatistics( userId: $checkedConvert('userId', (v) => v as String), username: $checkedConvert('username', (v) => v as String?), statistics: $checkedConvert('statistics', (v) => LLMStatistics.fromJson(v as Map)), topModels: $checkedConvert('topModels', (v) => (v as List).map((e) => e as String).toList()), topProviders: $checkedConvert('topProviders', (v) => (v as List).map((e) => e as String).toList()), ); return val; }, ); Map _$UserStatisticsToJson(UserStatistics instance) { final val = { 'userId': instance.userId, }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('username', instance.username); val['statistics'] = instance.statistics.toJson(); val['topModels'] = instance.topModels; val['topProviders'] = instance.topProviders; return val; } ErrorStatistics _$ErrorStatisticsFromJson(Map json) => $checkedCreate( 'ErrorStatistics', json, ($checkedConvert) { final val = ErrorStatistics( errorType: $checkedConvert('errorType', (v) => v as String), count: $checkedConvert('count', (v) => (v as num).toInt()), percentage: $checkedConvert('percentage', (v) => (v as num).toDouble()), topErrorMessages: $checkedConvert('topErrorMessages', (v) => (v as List).map((e) => e as String).toList()), affectedModels: $checkedConvert('affectedModels', (v) => (v as List).map((e) => e as String).toList()), ); return val; }, ); Map _$ErrorStatisticsToJson(ErrorStatistics instance) => { 'errorType': instance.errorType, 'count': instance.count, 'percentage': instance.percentage, 'topErrorMessages': instance.topErrorMessages, 'affectedModels': instance.affectedModels, }; PerformanceStatistics _$PerformanceStatisticsFromJson( Map json) => $checkedCreate( 'PerformanceStatistics', json, ($checkedConvert) { final val = PerformanceStatistics( averageLatency: $checkedConvert('averageLatency', (v) => (v as num).toDouble()), medianLatency: $checkedConvert('medianLatency', (v) => (v as num).toDouble()), p95Latency: $checkedConvert('p95Latency', (v) => (v as num).toDouble()), p99Latency: $checkedConvert('p99Latency', (v) => (v as num).toDouble()), averageThroughput: $checkedConvert( 'averageThroughput', (v) => (v as num).toDouble()), latencyTrends: $checkedConvert( 'latencyTrends', (v) => (v as List) .map((e) => TimeBasedMetric.fromJson(e as Map)) .toList()), throughputTrends: $checkedConvert( 'throughputTrends', (v) => (v as List) .map((e) => TimeBasedMetric.fromJson(e as Map)) .toList()), ); return val; }, ); Map _$PerformanceStatisticsToJson( PerformanceStatistics instance) => { 'averageLatency': instance.averageLatency, 'medianLatency': instance.medianLatency, 'p95Latency': instance.p95Latency, 'p99Latency': instance.p99Latency, 'averageThroughput': instance.averageThroughput, 'latencyTrends': instance.latencyTrends.map((e) => e.toJson()).toList(), 'throughputTrends': instance.throughputTrends.map((e) => e.toJson()).toList(), }; TimeBasedMetric _$TimeBasedMetricFromJson(Map json) => $checkedCreate( 'TimeBasedMetric', json, ($checkedConvert) { final val = TimeBasedMetric( timestamp: $checkedConvert('timestamp', (v) => DateTime.parse(v as String)), value: $checkedConvert('value', (v) => (v as num).toDouble()), label: $checkedConvert('label', (v) => v as String?), ); return val; }, ); Map _$TimeBasedMetricToJson(TimeBasedMetric instance) { final val = { 'timestamp': instance.timestamp.toIso8601String(), 'value': instance.value, }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('label', instance.label); return val; } SystemHealthStatus _$SystemHealthStatusFromJson(Map json) => $checkedCreate( 'SystemHealthStatus', json, ($checkedConvert) { final val = SystemHealthStatus( status: $checkedConvert( 'status', (v) => $enumDecodeNullable(_$HealthStatusEnumMap, v) ?? HealthStatus.healthy), components: $checkedConvert( 'components', (v) => (v as Map).map( (k, e) => MapEntry( k, ComponentHealth.fromJson(e as Map)), )), message: $checkedConvert('message', (v) => v as String?), lastChecked: $checkedConvert('lastChecked', (v) => v == null ? null : DateTime.parse(v as String)), ); return val; }, ); Map _$SystemHealthStatusToJson(SystemHealthStatus instance) { final val = { 'status': _$HealthStatusEnumMap[instance.status]!, 'components': instance.components.map((k, e) => MapEntry(k, e.toJson())), }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('message', instance.message); writeNotNull('lastChecked', instance.lastChecked?.toIso8601String()); return val; } const _$HealthStatusEnumMap = { HealthStatus.healthy: 'healthy', HealthStatus.degraded: 'degraded', HealthStatus.unhealthy: 'unhealthy', HealthStatus.unknown: 'unknown', }; ComponentHealth _$ComponentHealthFromJson(Map json) => $checkedCreate( 'ComponentHealth', json, ($checkedConvert) { final val = ComponentHealth( status: $checkedConvert( 'status', (v) => $enumDecodeNullable(_$HealthStatusEnumMap, v) ?? HealthStatus.healthy), message: $checkedConvert('message', (v) => v as String?), metrics: $checkedConvert('metrics', (v) => v as Map?), ); return val; }, ); Map _$ComponentHealthToJson(ComponentHealth instance) { final val = { 'status': _$HealthStatusEnumMap[instance.status]!, }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('message', instance.message); writeNotNull('metrics', instance.metrics); return val; } LLMTraceSearchCriteria _$LLMTraceSearchCriteriaFromJson( Map json) => $checkedCreate( 'LLMTraceSearchCriteria', json, ($checkedConvert) { final val = LLMTraceSearchCriteria( userId: $checkedConvert('userId', (v) => v as String?), provider: $checkedConvert('provider', (v) => v as String?), model: $checkedConvert('model', (v) => v as String?), sessionId: $checkedConvert('sessionId', (v) => v as String?), hasError: $checkedConvert('hasError', (v) => v as bool?), status: $checkedConvert( 'status', (v) => $enumDecodeNullable(_$LLMTraceStatusEnumMap, v)), startTime: $checkedConvert('startTime', (v) => v == null ? null : DateTime.parse(v as String)), endTime: $checkedConvert( 'endTime', (v) => v == null ? null : DateTime.parse(v as String)), page: $checkedConvert('page', (v) => (v as num?)?.toInt() ?? 0), size: $checkedConvert('size', (v) => (v as num?)?.toInt() ?? 20), sortBy: $checkedConvert('sortBy', (v) => v as String? ?? 'timestamp'), sortDir: $checkedConvert('sortDir', (v) => v as String? ?? 'desc'), ); return val; }, ); Map _$LLMTraceSearchCriteriaToJson( LLMTraceSearchCriteria instance) { final val = {}; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('userId', instance.userId); writeNotNull('provider', instance.provider); writeNotNull('model', instance.model); writeNotNull('sessionId', instance.sessionId); writeNotNull('hasError', instance.hasError); writeNotNull('status', _$LLMTraceStatusEnumMap[instance.status]); writeNotNull('startTime', instance.startTime?.toIso8601String()); writeNotNull('endTime', instance.endTime?.toIso8601String()); val['page'] = instance.page; val['size'] = instance.size; val['sortBy'] = instance.sortBy; val['sortDir'] = instance.sortDir; return val; } ApiResponse _$ApiResponseFromJson( Map json, T Function(Object? json) fromJsonT, ) => $checkedCreate( 'ApiResponse', json, ($checkedConvert) { final val = ApiResponse( success: $checkedConvert('success', (v) => v as bool), message: $checkedConvert('message', (v) => v as String?), data: $checkedConvert( 'data', (v) => _$nullableGenericFromJson(v, fromJsonT)), error: $checkedConvert('error', (v) => v as String?), ); return val; }, ); Map _$ApiResponseToJson( ApiResponse instance, Object? Function(T value) toJsonT, ) { final val = { 'success': instance.success, }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('message', instance.message); writeNotNull('data', _$nullableGenericToJson(instance.data, toJsonT)); writeNotNull('error', instance.error); return val; } T? _$nullableGenericFromJson( Object? input, T Function(Object? json) fromJson, ) => input == null ? null : fromJson(input); Object? _$nullableGenericToJson( T? input, Object? Function(T value) toJson, ) => input == null ? null : toJson(input); PagedResponse _$PagedResponseFromJson( Map json, T Function(Object? json) fromJsonT, ) => $checkedCreate( 'PagedResponse', json, ($checkedConvert) { final val = PagedResponse( content: $checkedConvert( 'content', (v) => (v as List).map(fromJsonT).toList()), page: $checkedConvert('page', (v) => (v as num).toInt()), size: $checkedConvert('size', (v) => (v as num).toInt()), totalElements: $checkedConvert('totalElements', (v) => (v as num).toInt()), totalPages: $checkedConvert('totalPages', (v) => (v as num).toInt()), first: $checkedConvert('first', (v) => v as bool? ?? false), last: $checkedConvert('last', (v) => v as bool? ?? false), ); return val; }, ); Map _$PagedResponseToJson( PagedResponse instance, Object? Function(T value) toJsonT, ) => { 'content': instance.content.map(toJsonT).toList(), 'page': instance.page, 'size': instance.size, 'totalElements': instance.totalElements, 'totalPages': instance.totalPages, 'first': instance.first, 'last': instance.last, }; CursorPageResponse _$CursorPageResponseFromJson( Map json, T Function(Object? json) fromJsonT, ) => $checkedCreate( 'CursorPageResponse', json, ($checkedConvert) { final val = CursorPageResponse( items: $checkedConvert( 'items', (v) => (v as List).map(fromJsonT).toList()), nextCursor: $checkedConvert('nextCursor', (v) => v as String?), hasMore: $checkedConvert('hasMore', (v) => v as bool? ?? false), ); return val; }, ); Map _$CursorPageResponseToJson( CursorPageResponse instance, Object? Function(T value) toJsonT, ) { final val = { 'items': instance.items.map(toJsonT).toList(), }; void writeNotNull(String key, dynamic value) { if (value != null) { val[key] = value; } } writeNotNull('nextCursor', instance.nextCursor); val['hasMore'] = instance.hasMore; return val; }