Evo Voice

<back to all web services

GetAlert

Get a specific alert

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
GET/alerts/{alertId}
import 'package:servicestack/servicestack.dart';

abstract class EntityInfo
{
    /**
    * The ID of the object
    */
    // @ApiMember(Description="The ID of the object")
    String? id;

    /**
    * The date the object was created
    */
    // @ApiMember(Description="The date the object was created")
    String? dateCreated;

    /**
    * The date the object was last modified
    */
    // @ApiMember(Description="The date the object was last modified")
    String? dateLastModified;

    /**
    * The user that created this object
    */
    // @ApiMember(Description="The user that created this object")
    String? createdBy;

    /**
    * The user that last modified this object
    */
    // @ApiMember(Description="The user that last modified this object")
    String? lastModifiedBy;

    EntityInfo({this.id,this.dateCreated,this.dateLastModified,this.createdBy,this.lastModifiedBy});
    EntityInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        dateCreated = json['dateCreated'];
        dateLastModified = json['dateLastModified'];
        createdBy = json['createdBy'];
        lastModifiedBy = json['lastModifiedBy'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'dateCreated': dateCreated,
        'dateLastModified': dateLastModified,
        'createdBy': createdBy,
        'lastModifiedBy': lastModifiedBy
    };

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

enum AlertTriggers
{
    CallSpend,
}

class AlertInfo extends EntityInfo implements IConvertible
{
    /**
    * The ID of the account associated with this alert
    */
    // @ApiMember(Description="The ID of the account associated with this alert")
    String? accountId;

    /**
    * The name of the alert
    */
    // @ApiMember(Description="The name of the alert")
    String? name;

    /**
    * The trigger alert
    */
    // @ApiMember(Description="The trigger alert")
    AlertTriggers? trigger;

    /**
    * The number of hours for the window over which the alert will trigger
    */
    // @ApiMember(Description="The number of hours for the window over which the alert will trigger")
    double? windowHours;

    /**
    * The value at which the alert will trigger
    */
    // @ApiMember(Description="The value at which the alert will trigger")
    double? threshold;

    /**
    * The email addresses (one per line) to notify
    */
    // @ApiMember(Description="The email addresses (one per line) to notify")
    String? notificationEmailAddresses;

    AlertInfo({this.accountId,this.name,this.trigger,this.windowHours,this.threshold,this.notificationEmailAddresses});
    AlertInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        accountId = json['accountId'];
        name = json['name'];
        trigger = JsonConverters.fromJson(json['trigger'],'AlertTriggers',context!);
        windowHours = JsonConverters.toDouble(json['windowHours']);
        threshold = JsonConverters.toDouble(json['threshold']);
        notificationEmailAddresses = json['notificationEmailAddresses'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'accountId': accountId,
        'name': name,
        'trigger': JsonConverters.toJson(trigger,'AlertTriggers',context!),
        'windowHours': windowHours,
        'threshold': threshold,
        'notificationEmailAddresses': notificationEmailAddresses
    });

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

/**
* Get a specific alert
*/
// @Api(Description="Get a specific alert")
class GetAlert implements IGet, IConvertible
{
    /**
    * The ID of the alert you want to get
    */
    // @ApiMember(Description="The ID of the alert you want to get")
    String? alertId;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'evovoice.io', types: <String, TypeInfo> {
    'EntityInfo': TypeInfo(TypeOf.AbstractClass),
    'AlertTriggers': TypeInfo(TypeOf.Enum, enumValues:AlertTriggers.values),
    'AlertInfo': TypeInfo(TypeOf.Class, create:() => AlertInfo()),
    'GetAlert': TypeInfo(TypeOf.Class, create:() => GetAlert()),
});

Dart GetAlert 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.

GET /alerts/{alertId} HTTP/1.1 
Host: evovoice.io 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	accountId: String,
	name: String,
	trigger: CallSpend,
	windowHours: 0,
	threshold: 0,
	notificationEmailAddresses: String,
	id: String,
	dateCreated: String,
	dateLastModified: String,
	createdBy: String,
	lastModifiedBy: String
}