Trendsic Platform Service

<back to all web services

CustomerNotesRequest

Requires Authentication
Requires any of the roles:Agent, Administrator, Agent, Administrator
The following routes are available for this service:
GET,POST,OPTIONS/v1/customercheckins/{Id}/notes
import 'package:servicestack/servicestack.dart';

class CustomerNote implements IConvertible
{
    int? NoteId;
    String? Scope;
    String? Text;
    bool? IsPriority;
    String? CreatedByUserId;
    String? CreatedByName;
    DateTime? CreatedAt;
    DateTime? DoneAt;
    bool? IsCarry;
    DateTime? ShownAt;

    CustomerNote({this.NoteId,this.Scope,this.Text,this.IsPriority,this.CreatedByUserId,this.CreatedByName,this.CreatedAt,this.DoneAt,this.IsCarry,this.ShownAt});
    CustomerNote.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        NoteId = json['NoteId'];
        Scope = json['Scope'];
        Text = json['Text'];
        IsPriority = json['IsPriority'];
        CreatedByUserId = json['CreatedByUserId'];
        CreatedByName = json['CreatedByName'];
        CreatedAt = JsonConverters.fromJson(json['CreatedAt'],'DateTime',context!);
        DoneAt = JsonConverters.fromJson(json['DoneAt'],'DateTime',context!);
        IsCarry = json['IsCarry'];
        ShownAt = JsonConverters.fromJson(json['ShownAt'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'NoteId': NoteId,
        'Scope': Scope,
        'Text': Text,
        'IsPriority': IsPriority,
        'CreatedByUserId': CreatedByUserId,
        'CreatedByName': CreatedByName,
        'CreatedAt': JsonConverters.toJson(CreatedAt,'DateTime',context!),
        'DoneAt': JsonConverters.toJson(DoneAt,'DateTime',context!),
        'IsCarry': IsCarry,
        'ShownAt': JsonConverters.toJson(ShownAt,'DateTime',context!)
    };

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

class CustomerNoteResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<CustomerNote>? Notes = [];
    List<CustomerNote>? Carry = [];
    bool? CanPriority;
    CustomerNote? Note;

    CustomerNoteResponse({this.ResponseStatus,this.Notes,this.Carry,this.CanPriority,this.Note});
    CustomerNoteResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        Notes = JsonConverters.fromJson(json['Notes'],'List<CustomerNote>',context!);
        Carry = JsonConverters.fromJson(json['Carry'],'List<CustomerNote>',context!);
        CanPriority = json['CanPriority'];
        Note = JsonConverters.fromJson(json['Note'],'CustomerNote',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Notes': JsonConverters.toJson(Notes,'List<CustomerNote>',context!),
        'Carry': JsonConverters.toJson(Carry,'List<CustomerNote>',context!),
        'CanPriority': CanPriority,
        'Note': JsonConverters.toJson(Note,'CustomerNote',context!)
    };

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

class CustomerNotesRequest implements IConvertible
{
    String? Id;
    String? Text;
    String? Scope;
    bool? IsPriority;

    CustomerNotesRequest({this.Id,this.Text,this.Scope,this.IsPriority});
    CustomerNotesRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Text = json['Text'];
        Scope = json['Scope'];
        IsPriority = json['IsPriority'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Text': Text,
        'Scope': Scope,
        'IsPriority': IsPriority
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'CustomerNote': TypeInfo(TypeOf.Class, create:() => CustomerNote()),
    'CustomerNoteResponse': TypeInfo(TypeOf.Class, create:() => CustomerNoteResponse()),
    'List<CustomerNote>': TypeInfo(TypeOf.Class, create:() => <CustomerNote>[]),
    'CustomerNotesRequest': TypeInfo(TypeOf.Class, create:() => CustomerNotesRequest()),
});

Dart CustomerNotesRequest 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 /v1/customercheckins/{Id}/notes HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Id: 00000000000000000000000000000000,
	Text: String,
	Scope: String,
	IsPriority: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Notes: 
	[
		{
			NoteId: 0,
			Scope: String,
			Text: String,
			IsPriority: False,
			CreatedByUserId: 00000000000000000000000000000000,
			CreatedByName: String,
			CreatedAt: 0001-01-01,
			DoneAt: 0001-01-01,
			IsCarry: False,
			ShownAt: 0001-01-01
		}
	],
	Carry: 
	[
		{
			NoteId: 0,
			Scope: String,
			Text: String,
			IsPriority: False,
			CreatedByUserId: 00000000000000000000000000000000,
			CreatedByName: String,
			CreatedAt: 0001-01-01,
			DoneAt: 0001-01-01,
			IsCarry: False,
			ShownAt: 0001-01-01
		}
	],
	CanPriority: False,
	Note: 
	{
		NoteId: 0,
		Scope: String,
		Text: String,
		IsPriority: False,
		CreatedByUserId: 00000000000000000000000000000000,
		CreatedByName: String,
		CreatedAt: 0001-01-01,
		DoneAt: 0001-01-01,
		IsCarry: False,
		ShownAt: 0001-01-01
	}
}