WebhookEvent.fromJson constructor

WebhookEvent.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory WebhookEvent.fromJson(Map<String, dynamic> json) {
  return WebhookEvent(
    cancellationReason: json['cancellationReason'] != null ? WebhookCancellationReason.fromJson(json['cancellationReason'] as String) : null,
    currency: json['currency'] as String?,
    environment: WebhookEventEnvironment.fromJson(json['environment'] as String),
    expiresAt: (json['expiresAt'] as num?)?.toDouble(),
    id: json['id'] as String,
    occurredAt: (json['occurredAt'] as num).toDouble(),
    platform: IapPlatform.fromJson(json['platform'] as String),
    priceAmountMicros: (json['priceAmountMicros'] as num?)?.toDouble(),
    productId: json['productId'] as String?,
    projectId: json['projectId'] as String,
    purchaseToken: json['purchaseToken'] as String?,
    rawSignedPayload: json['rawSignedPayload'] as String?,
    receivedAt: (json['receivedAt'] as num).toDouble(),
    renewsAt: (json['renewsAt'] as num?)?.toDouble(),
    source: WebhookEventSource.fromJson(json['source'] as String),
    subscriptionState: json['subscriptionState'] != null ? SubscriptionState.fromJson(json['subscriptionState'] as String) : null,
    type: WebhookEventType.fromJson(json['type'] as String),
  );
}