<back to all web services

GetCustomMetricValuesMessage

The following routes are available for this service:
All Verbs/RestApi/Sitefinity/Analytics/GetCustomMetricValues
import 'package:servicestack/servicestack.dart';

class GetCustomMetricValuesMessage implements IConvertible
{
    List<String>? MetricNames;
    int? LastNDays;
    int? MaxNDays;
    String? SiteId;

    GetCustomMetricValuesMessage({this.MetricNames,this.LastNDays,this.MaxNDays,this.SiteId});
    GetCustomMetricValuesMessage.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        MetricNames = JsonConverters.fromJson(json['MetricNames'],'List<String>',context!);
        LastNDays = json['LastNDays'];
        MaxNDays = json['MaxNDays'];
        SiteId = json['SiteId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'MetricNames': JsonConverters.toJson(MetricNames,'List<String>',context!),
        'LastNDays': LastNDays,
        'MaxNDays': MaxNDays,
        'SiteId': SiteId
    };

    getTypeName() => "GetCustomMetricValuesMessage";
    TypeContext? context = _ctx;
}

// @DataContract
class DimensionItem implements IConvertible
{
    // @DataMember
    String? Value;

    // @DataMember
    String? Name;

    DimensionItem({this.Value,this.Name});
    DimensionItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Value = json['Value'];
        Name = json['Name'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Value': Value,
        'Name': Name
    };

    getTypeName() => "DimensionItem";
    TypeContext? context = _ctx;
}

// @DataContract
class MetricItem implements IConvertible
{
    // @DataMember
    double? Value;

    MetricItem({this.Value});
    MetricItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Value = JsonConverters.toDouble(json['Value']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Value': Value
    };

    getTypeName() => "MetricItem";
    TypeContext? context = _ctx;
}

// @DataContract
class AnalyticsItem implements IConvertible
{
    // @DataMember
    List<DimensionItem>? Dimensions;

    // @DataMember
    List<MetricItem>? Metrics;

    // @DataMember
    double? TotalItems;

    AnalyticsItem({this.Dimensions,this.Metrics,this.TotalItems});
    AnalyticsItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Dimensions = JsonConverters.fromJson(json['Dimensions'],'List<DimensionItem>',context!);
        Metrics = JsonConverters.fromJson(json['Metrics'],'List<MetricItem>',context!);
        TotalItems = JsonConverters.toDouble(json['TotalItems']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Dimensions': JsonConverters.toJson(Dimensions,'List<DimensionItem>',context!),
        'Metrics': JsonConverters.toJson(Metrics,'List<MetricItem>',context!),
        'TotalItems': TotalItems
    };

    getTypeName() => "AnalyticsItem";
    TypeContext? context = _ctx;
}

class GetCustomMetricValuesData implements IConvertible
{
    List<AnalyticsItem>? Result;
    List<String>? MetricDisplayNames;

    GetCustomMetricValuesData({this.Result,this.MetricDisplayNames});
    GetCustomMetricValuesData.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Result = JsonConverters.fromJson(json['Result'],'List<AnalyticsItem>',context!);
        MetricDisplayNames = JsonConverters.fromJson(json['MetricDisplayNames'],'List<String>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Result': JsonConverters.toJson(Result,'List<AnalyticsItem>',context!),
        'MetricDisplayNames': JsonConverters.toJson(MetricDisplayNames,'List<String>',context!)
    };

    getTypeName() => "GetCustomMetricValuesData";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'www.asg.com.au', types: <String, TypeInfo> {
    'GetCustomMetricValuesMessage': TypeInfo(TypeOf.Class, create:() => GetCustomMetricValuesMessage()),
    'DimensionItem': TypeInfo(TypeOf.Class, create:() => DimensionItem()),
    'MetricItem': TypeInfo(TypeOf.Class, create:() => MetricItem()),
    'AnalyticsItem': TypeInfo(TypeOf.Class, create:() => AnalyticsItem()),
    'List<DimensionItem>': TypeInfo(TypeOf.Class, create:() => <DimensionItem>[]),
    'List<MetricItem>': TypeInfo(TypeOf.Class, create:() => <MetricItem>[]),
    'GetCustomMetricValuesData': TypeInfo(TypeOf.Class, create:() => GetCustomMetricValuesData()),
    'List<AnalyticsItem>': TypeInfo(TypeOf.Class, create:() => <AnalyticsItem>[]),
});

Dart GetCustomMetricValuesMessage DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /RestApi/Sitefinity/Analytics/GetCustomMetricValues HTTP/1.1 
Host: www.asg.com.au 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	MetricNames: 
	[
		String
	],
	LastNDays: 0,
	MaxNDays: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Result: 
	[
		{
			
		}
	],
	MetricDisplayNames: 
	[
		String
	]
}