SegmentDimensions.fromJson constructor

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

Implementation

factory SegmentDimensions.fromJson(Map<String, dynamic> json) {
  return SegmentDimensions(
    attributes: (json['Attributes'] as Map<String, dynamic>?)?.map((k, e) =>
        MapEntry(k, AttributeDimension.fromJson(e as Map<String, dynamic>))),
    behavior: json['Behavior'] != null
        ? SegmentBehaviors.fromJson(json['Behavior'] as Map<String, dynamic>)
        : null,
    demographic: json['Demographic'] != null
        ? SegmentDemographics.fromJson(
            json['Demographic'] as Map<String, dynamic>)
        : null,
    location: json['Location'] != null
        ? SegmentLocation.fromJson(json['Location'] as Map<String, dynamic>)
        : null,
    metrics: (json['Metrics'] as Map<String, dynamic>?)?.map((k, e) =>
        MapEntry(k, MetricDimension.fromJson(e as Map<String, dynamic>))),
    userAttributes: (json['UserAttributes'] as Map<String, dynamic>?)?.map((k,
            e) =>
        MapEntry(k, AttributeDimension.fromJson(e as Map<String, dynamic>))),
  );
}