| POST | /Authentication |
|---|
import 'package:servicestack/servicestack.dart';
class Authentication implements IConvertible
{
String? Email;
String? Password;
String? Code;
dynamic? SubscriptionObject;
String? DeviceId;
Authentication({this.Email,this.Password,this.Code,this.SubscriptionObject,this.DeviceId});
Authentication.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Email = json['Email'];
Password = json['Password'];
Code = json['Code'];
SubscriptionObject = JsonConverters.fromJson(json['SubscriptionObject'],'dynamic',context!);
DeviceId = json['DeviceId'];
return this;
}
Map<String, dynamic> toJson() => {
'Email': Email,
'Password': Password,
'Code': Code,
'SubscriptionObject': JsonConverters.toJson(SubscriptionObject,'dynamic',context!),
'DeviceId': DeviceId
};
getTypeName() => "Authentication";
TypeContext? context = _ctx;
}
class AuthenticationResponse implements IConvertible
{
String? AuthToken;
String? Workspace;
String? UserId;
List<String>? Teams;
int? MobileTaskRangePast;
int? MobileTaskRangeFuture;
String? RetainCustomerDatabase;
String? RetainAssetDatabase;
String? UserType;
AuthenticationResponse({this.AuthToken,this.Workspace,this.UserId,this.Teams,this.MobileTaskRangePast,this.MobileTaskRangeFuture,this.RetainCustomerDatabase,this.RetainAssetDatabase,this.UserType});
AuthenticationResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
AuthToken = json['AuthToken'];
Workspace = json['Workspace'];
UserId = json['UserId'];
Teams = JsonConverters.fromJson(json['Teams'],'List<String>',context!);
MobileTaskRangePast = json['MobileTaskRangePast'];
MobileTaskRangeFuture = json['MobileTaskRangeFuture'];
RetainCustomerDatabase = json['RetainCustomerDatabase'];
RetainAssetDatabase = json['RetainAssetDatabase'];
UserType = json['UserType'];
return this;
}
Map<String, dynamic> toJson() => {
'AuthToken': AuthToken,
'Workspace': Workspace,
'UserId': UserId,
'Teams': JsonConverters.toJson(Teams,'List<String>',context!),
'MobileTaskRangePast': MobileTaskRangePast,
'MobileTaskRangeFuture': MobileTaskRangeFuture,
'RetainCustomerDatabase': RetainCustomerDatabase,
'RetainAssetDatabase': RetainAssetDatabase,
'UserType': UserType
};
getTypeName() => "AuthenticationResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
'Authentication': TypeInfo(TypeOf.Class, create:() => Authentication()),
'AuthenticationResponse': TypeInfo(TypeOf.Class, create:() => AuthenticationResponse()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Authentication HTTP/1.1
Host: dev.fieldsquared.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"Email":"String","Password":"String","Code":"String","SubscriptionObject":{},"DeviceId":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"AuthToken":"String","Workspace":"String","UserId":"String","Teams":["String"],"MobileTaskRangePast":0,"MobileTaskRangeFuture":0,"RetainCustomerDatabase":"String","RetainAssetDatabase":"String","UserType":"String"}