CoreService

<back to all web services

GetUserNote

UserNote - CRUD

Returns a single user note

Requires Authentication
Required roles:TenantReader, TenantReader
The following routes are available for this service:
GET/api/usernotes/{Id}Returns a single user note
GET/usernotes/{Id}Returns a single user note
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,
}

class UserNoteDto implements IConvertible
{
    String id = "";
    String message = "";
    String configItemId = "";
    ObjectTypes configItemType;
    String configItemName = "";
    String tenantId = "";
    DateTime created = DateTime(0);
    String createUser = "";
    String createUserId = "";
    DateTime modified = DateTime(0);
    String modifyUser = "";
    String modifyUserId = "";
    String selfLink = "";
    ObjectTypes objectType;

    UserNoteDto({this.id,this.message,this.configItemId,this.configItemType,this.configItemName,this.tenantId,this.created,this.createUser,this.createUserId,this.modified,this.modifyUser,this.modifyUserId,this.selfLink,this.objectType});
    UserNoteDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        message = json['message'];
        configItemId = json['configItemId'];
        configItemType = JsonConverters.fromJson(json['configItemType'],'ObjectTypes',context!);
        configItemName = json['configItemName'];
        tenantId = json['tenantId'];
        created = JsonConverters.fromJson(json['created'],'DateTime',context!);
        createUser = json['createUser'];
        createUserId = json['createUserId'];
        modified = JsonConverters.fromJson(json['modified'],'DateTime',context!);
        modifyUser = json['modifyUser'];
        modifyUserId = json['modifyUserId'];
        selfLink = json['selfLink'];
        objectType = JsonConverters.fromJson(json['objectType'],'ObjectTypes',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'message': message,
        'configItemId': configItemId,
        'configItemType': JsonConverters.toJson(configItemType,'ObjectTypes',context!),
        'configItemName': configItemName,
        'tenantId': tenantId,
        'created': JsonConverters.toJson(created,'DateTime',context!),
        'createUser': createUser,
        'createUserId': createUserId,
        'modified': JsonConverters.toJson(modified,'DateTime',context!),
        'modifyUser': modifyUser,
        'modifyUserId': modifyUserId,
        'selfLink': selfLink,
        'objectType': JsonConverters.toJson(objectType,'ObjectTypes',context!)
    };

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

/**
* Returns a single user note
*/
// @Api(Description="Returns a single user note")
// @ApiResponse(Description="Ok", ResponseType=typeof(UserNoteDto), StatusCode=200)
class GetUserNote implements IBaseRequest, IHasTenantName, IGet, IConvertible
{
    /**
    * The id of the user note
    */
    // @ApiMember(DataType="string", Description="The id of the user note", Format="guid", IsRequired=true, ParameterType="path")
    String id = "";

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

    GetUserNote({this.id,this.tenantName});
    GetUserNote.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() => "GetUserNote";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'duneframework.com', types: <String, TypeInfo> {
    'ObjectTypes': TypeInfo(TypeOf.Enum, enumValues:ObjectTypes.values),
    'UserNoteDto': TypeInfo(TypeOf.Class, create:() => UserNoteDto()),
    'GetUserNote': TypeInfo(TypeOf.Class, create:() => GetUserNote()),
});

Dart GetUserNote 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/usernotes/{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","message":"String","configItemId":"00000000-0000-0000-0000-000000000000","configItemType":"None","configItemName":"String","tenantId":"00000000-0000-0000-0000-000000000000","created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","selfLink":"/usernotes/00000000-0000-0000-0000-000000000000","objectType":"UserNote"}