CoreService

<back to all web services

GetChangeLog

ChangeLog - CRUD

Returns a single changelog by its id

Requires Authentication
Required role:TenantAdmin
The following routes are available for this service:
GET/api/changelogs/{Id}Returns a changelog
GET/changelogs/{Id}Returns a changelog
import 'package:servicestack/servicestack.dart';

enum ObjectTypes
{
    None,
    ConfigItem,
    Tenant,
    Collection,
    Resource,
    ComputeNode,
    VirtualMachine,
    PhysicalMachine,
    Disk,
    Subnet,
    IPAddress,
    Job,
    JobEvent,
    FreezePeriod,
    ResourceGroup,
    Deployment,
    ResourceGroupTemplate,
    DeploymentTemplate,
    ResourceProvider,
    GenericResource,
    Role,
    Permission,
    User,
    PatchingWindow,
    Update,
    ReportDefinition,
    TimeSeries,
    DataPoint,
    Action,
    ActionAssignment,
    UserNote,
}

enum ChangeTypes
{
    Create,
    Update,
    Delete,
}

class ValueChangeDto implements IConvertible
{
    String? oldValue;
    String? newValue;

    ValueChangeDto({this.oldValue,this.newValue});
    ValueChangeDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class ChangeLogDto implements IHasTenantId, IConvertible
{
    String id = "";
    String tenantId = "";
    DateTime timeStamp = DateTime(0);
    String objectId = "";
    String objectName = "";
    ObjectTypes objectType;
    ChangeTypes changeType;
    String description = "";
    Map<String,ValueChangeDto?> changes = {};
    String modifyUserId = "";
    String modifyUserEmail = "";

    ChangeLogDto({this.id,this.tenantId,this.timeStamp,this.objectId,this.objectName,this.objectType,this.changeType,this.description,this.changes,this.modifyUserId,this.modifyUserEmail});
    ChangeLogDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        tenantId = json['tenantId'];
        timeStamp = JsonConverters.fromJson(json['timeStamp'],'DateTime',context!);
        objectId = json['objectId'];
        objectName = json['objectName'];
        objectType = JsonConverters.fromJson(json['objectType'],'ObjectTypes',context!);
        changeType = JsonConverters.fromJson(json['changeType'],'ChangeTypes',context!);
        description = json['description'];
        changes = JsonConverters.fromJson(json['changes'],'Map<String,ValueChangeDto?>',context!);
        modifyUserId = json['modifyUserId'];
        modifyUserEmail = json['modifyUserEmail'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'tenantId': tenantId,
        'timeStamp': JsonConverters.toJson(timeStamp,'DateTime',context!),
        'objectId': objectId,
        'objectName': objectName,
        'objectType': JsonConverters.toJson(objectType,'ObjectTypes',context!),
        'changeType': JsonConverters.toJson(changeType,'ChangeTypes',context!),
        'description': description,
        'changes': JsonConverters.toJson(changes,'Map<String,ValueChangeDto?>',context!),
        'modifyUserId': modifyUserId,
        'modifyUserEmail': modifyUserEmail
    };

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

/**
* Returns a single changelog by its id
*/
// @Api(Description="Returns a single changelog by its id")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(ChangeLogDto), StatusCode=200)
class GetChangeLog implements IBaseRequest, IHasId, IHasTenantName, IGet, IConvertible
{
    /**
    * The unique id of the object
    */
    // @ApiMember(DataType="string", Description="The unique id of the object", Format="guid", IsRequired=true, ParameterType="path")
    String id = "";

    // @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
    // @Validate(Validator="NotEmpty")
    String tenantName = "";

    GetChangeLog({this.id,this.tenantName});
    GetChangeLog.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

TypeContext _ctx = TypeContext(library: 'duneframework.com', types: <String, TypeInfo> {
    'ObjectTypes': TypeInfo(TypeOf.Enum, enumValues:ObjectTypes.values),
    'ChangeTypes': TypeInfo(TypeOf.Enum, enumValues:ChangeTypes.values),
    'ValueChangeDto': TypeInfo(TypeOf.Class, create:() => ValueChangeDto()),
    'ChangeLogDto': TypeInfo(TypeOf.Class, create:() => ChangeLogDto()),
    'Map<String,ValueChangeDto?>': TypeInfo(TypeOf.Class, create:() => Map<String,ValueChangeDto?>()),
    'GetChangeLog': TypeInfo(TypeOf.Class, create:() => GetChangeLog()),
});

Dart GetChangeLog DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /api/changelogs/{Id} HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":"00000000-0000-0000-0000-000000000000","tenantId":"00000000-0000-0000-0000-000000000000","timeStamp":"0001-01-01T00:00:00.0000000Z","objectId":"String","objectName":"String","objectType":"None","changeType":"Create","description":"String","changes":{"String":{"oldValue":"String","newValue":"String"}},"modifyUserId":"String","modifyUserEmail":"String"}