Trendsic Platform Service

<back to all web services

WorkerEnableAccessRequest

Requires Authentication
Required role:Administrator
The following routes are available for this service:
POST,OPTIONS/v1/worker/enable-access
import 'package:servicestack/servicestack.dart';

class WorkerEnableAccessResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    bool? Success;
    bool? AlreadyEnabled;
    String? Username;
    String? TempPassword;
    String? InviteEmailedTo;
    String? Message;

    WorkerEnableAccessResponse({this.ResponseStatus,this.Success,this.AlreadyEnabled,this.Username,this.TempPassword,this.InviteEmailedTo,this.Message});
    WorkerEnableAccessResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class WorkerEnableAccessRequest implements IConvertible
{
    int? ContactId;
    bool? IsCrewLead;

    WorkerEnableAccessRequest({this.ContactId,this.IsCrewLead});
    WorkerEnableAccessRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

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

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

{
	ContactId: 0,
	IsCrewLead: 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
		}
	},
	Success: False,
	AlreadyEnabled: False,
	Username: String,
	TempPassword: String,
	InviteEmailedTo: String,
	Message: String
}