Billhighway Cloud API

<back to all web services

CacheClearRq

The following routes are available for this service:
DELETE/devops/api/caches/{location}
import 'package:servicestack/servicestack.dart';

// @Flags()
class CacheResult
{
    static const CacheResult None = const CacheResult._(0);
    static const CacheResult Miss = const CacheResult._(1);
    static const CacheResult Hit = const CacheResult._(2);
    static const CacheResult Put = const CacheResult._(4);
    static const CacheResult Deleted = const CacheResult._(8);
    static const CacheResult Cleared = const CacheResult._(16);
    static const CacheResult Added = const CacheResult._(32);
    static const CacheResult Updated = const CacheResult._(64);
    static const CacheResult Unavailable = const CacheResult._(128);
    static const CacheResult Expired = const CacheResult._(256);

    final int _value;
    const CacheResult._(this._value);
    int get value => _value;
    static List<CacheResult> get values => const [None,Miss,Hit,Put,Deleted,Cleared,Added,Updated,Unavailable,Expired];
}

class CacheLocation
{
    static const CacheLocation None = const CacheLocation._(0);
    static const CacheLocation OutOfProcess = const CacheLocation._(1);
    static const CacheLocation InProcess = const CacheLocation._(2);
    static const CacheLocation InContext = const CacheLocation._(3);

    final int _value;
    const CacheLocation._(this._value);
    int get value => _value;
    static List<CacheLocation> get values => const [None,OutOfProcess,InProcess,InContext];
}

class CacheKey implements IConvertible
{
    String? Region;
    String? BaseKey;
    String? Key;
    int? ExpirationSeconds;

    CacheKey({this.Region,this.BaseKey,this.Key,this.ExpirationSeconds});
    CacheKey.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Region = json['Region'];
        BaseKey = json['BaseKey'];
        Key = json['Key'];
        ExpirationSeconds = json['ExpirationSeconds'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Region': Region,
        'BaseKey': BaseKey,
        'Key': Key,
        'ExpirationSeconds': ExpirationSeconds
    };

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

abstract class CacheResultBase
{
    CacheResult? Result;
    CacheLocation? Location;
    CacheKey? Key;

    CacheResultBase({this.Result,this.Location,this.Key});
    CacheResultBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Result = JsonConverters.fromJson(json['Result'],'CacheResult',context!);
        Location = JsonConverters.fromJson(json['Location'],'CacheLocation',context!);
        Key = JsonConverters.fromJson(json['Key'],'CacheKey',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Result': JsonConverters.toJson(Result,'CacheResult',context!),
        'Location': JsonConverters.toJson(Location,'CacheLocation',context!),
        'Key': JsonConverters.toJson(Key,'CacheKey',context!)
    };

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

class CacheClearResult extends CacheResultBase implements IConvertible
{
    bool? IsCleared;

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

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'IsCleared': IsCleared
    });

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

class CacheStat implements IConvertible
{
    String? Name;
    String? Value;

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

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

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

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

class CacheStatResult extends CacheResultBase implements IConvertible
{
    List<CacheStat>? Statistics;
    bool? IsHit;

    CacheStatResult({this.Statistics,this.IsHit});
    CacheStatResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Statistics = JsonConverters.fromJson(json['Statistics'],'List<CacheStat>',context!);
        IsHit = json['IsHit'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Statistics': JsonConverters.toJson(Statistics,'List<CacheStat>',context!),
        'IsHit': IsHit
    });

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

class CacheClearRs implements IConvertible
{
    CacheClearResult? Result;
    CacheStatResult? BeforeStatistics;
    CacheStatResult? AfterStatistics;

    CacheClearRs({this.Result,this.BeforeStatistics,this.AfterStatistics});
    CacheClearRs.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Result = JsonConverters.fromJson(json['Result'],'CacheClearResult',context!);
        BeforeStatistics = JsonConverters.fromJson(json['BeforeStatistics'],'CacheStatResult',context!);
        AfterStatistics = JsonConverters.fromJson(json['AfterStatistics'],'CacheStatResult',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Result': JsonConverters.toJson(Result,'CacheClearResult',context!),
        'BeforeStatistics': JsonConverters.toJson(BeforeStatistics,'CacheStatResult',context!),
        'AfterStatistics': JsonConverters.toJson(AfterStatistics,'CacheStatResult',context!)
    };

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

class CacheClearRq implements IConvertible
{
    String? location;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'devapi.billhighway.com', types: <String, TypeInfo> {
    'CacheResult': TypeInfo(TypeOf.Enum, enumValues:CacheResult.values),
    'CacheLocation': TypeInfo(TypeOf.Enum, enumValues:CacheLocation.values),
    'CacheKey': TypeInfo(TypeOf.Class, create:() => CacheKey()),
    'CacheResultBase': TypeInfo(TypeOf.AbstractClass),
    'CacheClearResult': TypeInfo(TypeOf.Class, create:() => CacheClearResult()),
    'CacheStat': TypeInfo(TypeOf.Class, create:() => CacheStat()),
    'CacheStatResult': TypeInfo(TypeOf.Class, create:() => CacheStatResult()),
    'List<CacheStat>': TypeInfo(TypeOf.Class, create:() => <CacheStat>[]),
    'CacheClearRs': TypeInfo(TypeOf.Class, create:() => CacheClearRs()),
    'CacheClearRq': TypeInfo(TypeOf.Class, create:() => CacheClearRq()),
});

Dart CacheClearRq DTOs

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

HTTP + XML

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

DELETE /devops/api/caches/{location} HTTP/1.1 
Host: devapi.billhighway.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CacheClearRs xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Caching.Api.Response">
  <AfterStatistics xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.Caching">
    <d2p1:Key i:nil="true" />
    <d2p1:Location>None</d2p1:Location>
    <d2p1:Result>None</d2p1:Result>
    <d2p1:Statistics>
      <d2p1:CacheStat>
        <d2p1:_x003C_Name_x003E_k__BackingField>String</d2p1:_x003C_Name_x003E_k__BackingField>
        <d2p1:_x003C_Value_x003E_k__BackingField>String</d2p1:_x003C_Value_x003E_k__BackingField>
      </d2p1:CacheStat>
    </d2p1:Statistics>
  </AfterStatistics>
  <BeforeStatistics xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.Caching">
    <d2p1:Key i:nil="true" />
    <d2p1:Location>None</d2p1:Location>
    <d2p1:Result>None</d2p1:Result>
    <d2p1:Statistics>
      <d2p1:CacheStat>
        <d2p1:_x003C_Name_x003E_k__BackingField>String</d2p1:_x003C_Name_x003E_k__BackingField>
        <d2p1:_x003C_Value_x003E_k__BackingField>String</d2p1:_x003C_Value_x003E_k__BackingField>
      </d2p1:CacheStat>
    </d2p1:Statistics>
  </BeforeStatistics>
  <Result xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.Caching">
    <d2p1:Key i:nil="true" />
    <d2p1:Location>None</d2p1:Location>
    <d2p1:Result>None</d2p1:Result>
  </Result>
</CacheClearRs>