Trendsic Platform Service

<back to all web services

WorkerDeviceRequest

Requires Authentication
The following routes are available for this service:
DELETE,OPTIONS/v1/worker/device/{DeviceId}
POST,OPTIONS/v1/worker/device
import 'package:servicestack/servicestack.dart';

class WorkerDeviceResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    bool? Success;

    WorkerDeviceResponse({this.ResponseStatus,this.Success});
    WorkerDeviceResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        Success = json['Success'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Success': Success
    };

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

class WorkerDeviceRequest implements IConvertible
{
    String? DeviceId;
    String? Platform;
    String? Model;
    String? Lang;

    WorkerDeviceRequest({this.DeviceId,this.Platform,this.Model,this.Lang});
    WorkerDeviceRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        DeviceId = json['DeviceId'];
        Platform = json['Platform'];
        Model = json['Model'];
        Lang = json['Lang'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'DeviceId': DeviceId,
        'Platform': Platform,
        'Model': Model,
        'Lang': Lang
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'WorkerDeviceResponse': TypeInfo(TypeOf.Class, create:() => WorkerDeviceResponse()),
    'WorkerDeviceRequest': TypeInfo(TypeOf.Class, create:() => WorkerDeviceRequest()),
});

Dart WorkerDeviceRequest 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/worker/device HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	DeviceId: String,
	Platform: String,
	Model: String,
	Lang: String
}
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
		}
	},
	Success: False
}