toJsonLd method

  1. @override
Map<String, dynamic> toJsonLd()
override

Serialize SchemaInteractionCounter to JSON-LD

Implementation

@override
Map<String, dynamic> toJsonLd() => removeEmpty({
      ...super.toJsonLd(),
      '@type': 'InteractionCounter',
      'endTime': convertToJsonLd(endTime, [String]),
      'interactionService': convertToJsonLd(
          interactionService, [SchemaSoftwareApplication, SchemaWebSite]),
      'interactionType': convertToJsonLd(interactionType, [SchemaAction]),
      'location': convertToJsonLd(location,
          [SchemaPlace, SchemaPostalAddress, String, SchemaVirtualLocation]),
      'startTime': convertToJsonLd(startTime, [String]),
      'userInteractionCount': convertToJsonLd(userInteractionCount, [int]),
    });