| GET,POST,PUT,DELETE | /{Workspace}/User/{ObjectId} | ||
|---|---|---|---|
| GET | /{Workspace}/User |
import 'package:servicestack/servicestack.dart';
class Location implements IConvertible
{
double? y;
double? x;
Location({this.y,this.x});
Location.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
y = JsonConverters.toDouble(json['y']);
x = JsonConverters.toDouble(json['x']);
return this;
}
Map<String, dynamic> toJson() => {
'y': y,
'x': x
};
getTypeName() => "Location";
TypeContext? context = _ctx;
}
enum UserStatus
{
NotStarted,
Driving,
InProgress,
Complete,
Blocked,
}
class Address implements IConvertible
{
String? Street;
String? Unit;
String? City;
String? State;
String? Zip;
String? ContactTitle;
String? ContactName;
String? ContactPhone;
String? ContactEmail;
Location? Location;
String? SiteName;
bool? GeocodeFailed;
String? Country;
Address({this.Street,this.Unit,this.City,this.State,this.Zip,this.ContactTitle,this.ContactName,this.ContactPhone,this.ContactEmail,this.Location,this.SiteName,this.GeocodeFailed,this.Country});
Address.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Street = json['Street'];
Unit = json['Unit'];
City = json['City'];
State = json['State'];
Zip = json['Zip'];
ContactTitle = json['ContactTitle'];
ContactName = json['ContactName'];
ContactPhone = json['ContactPhone'];
ContactEmail = json['ContactEmail'];
Location = JsonConverters.fromJson(json['Location'],'Location',context!);
SiteName = json['SiteName'];
GeocodeFailed = json['GeocodeFailed'];
Country = json['Country'];
return this;
}
Map<String, dynamic> toJson() => {
'Street': Street,
'Unit': Unit,
'City': City,
'State': State,
'Zip': Zip,
'ContactTitle': ContactTitle,
'ContactName': ContactName,
'ContactPhone': ContactPhone,
'ContactEmail': ContactEmail,
'Location': JsonConverters.toJson(Location,'Location',context!),
'SiteName': SiteName,
'GeocodeFailed': GeocodeFailed,
'Country': Country
};
getTypeName() => "Address";
TypeContext? context = _ctx;
}
class UIColumnPref implements IConvertible
{
String? Name;
double? Width;
UIColumnPref({this.Name,this.Width});
UIColumnPref.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Name = json['Name'];
Width = JsonConverters.toDouble(json['Width']);
return this;
}
Map<String, dynamic> toJson() => {
'Name': Name,
'Width': Width
};
getTypeName() => "UIColumnPref";
TypeContext? context = _ctx;
}
class EventItem implements IConvertible
{
String? ObjectId;
String? Date;
Location? Location;
String? Barcode;
String? Details;
String? Type;
bool? IsScan;
String? User;
String? SelectedBy;
String? Status;
String? StatusType;
String? DateCreated;
bool? Automatic;
EventItem({this.ObjectId,this.Date,this.Location,this.Barcode,this.Details,this.Type,this.IsScan,this.User,this.SelectedBy,this.Status,this.StatusType,this.DateCreated,this.Automatic});
EventItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ObjectId = json['ObjectId'];
Date = json['Date'];
Location = JsonConverters.fromJson(json['Location'],'Location',context!);
Barcode = json['Barcode'];
Details = json['Details'];
Type = json['Type'];
IsScan = json['IsScan'];
User = json['User'];
SelectedBy = json['SelectedBy'];
Status = json['Status'];
StatusType = json['StatusType'];
DateCreated = json['DateCreated'];
Automatic = json['Automatic'];
return this;
}
Map<String, dynamic> toJson() => {
'ObjectId': ObjectId,
'Date': Date,
'Location': JsonConverters.toJson(Location,'Location',context!),
'Barcode': Barcode,
'Details': Details,
'Type': Type,
'IsScan': IsScan,
'User': User,
'SelectedBy': SelectedBy,
'Status': Status,
'StatusType': StatusType,
'DateCreated': DateCreated,
'Automatic': Automatic
};
getTypeName() => "EventItem";
TypeContext? context = _ctx;
}
class WorkDay implements IConvertible
{
int? DayOfWeek;
int? Start;
int? End;
int? Lunch;
WorkDay({this.DayOfWeek,this.Start,this.End,this.Lunch});
WorkDay.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
DayOfWeek = json['DayOfWeek'];
Start = json['Start'];
End = json['End'];
Lunch = json['Lunch'];
return this;
}
Map<String, dynamic> toJson() => {
'DayOfWeek': DayOfWeek,
'Start': Start,
'End': End,
'Lunch': Lunch
};
getTypeName() => "WorkDay";
TypeContext? context = _ctx;
}
class CustomSchedule implements IConvertible
{
String? Date;
int? Start;
int? End;
String? Type;
CustomSchedule({this.Date,this.Start,this.End,this.Type});
CustomSchedule.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Date = json['Date'];
Start = json['Start'];
End = json['End'];
Type = json['Type'];
return this;
}
Map<String, dynamic> toJson() => {
'Date': Date,
'Start': Start,
'End': End,
'Type': Type
};
getTypeName() => "CustomSchedule";
TypeContext? context = _ctx;
}
/**
* Represents a DTO for a user in a workspace. Calls without an ObjectId will retrieve an array of all user objects for the workspace.
*/
class User implements IConvertible
{
String? Workspace;
String? TimeZone;
String? ObjectId;
String? VersionId;
String? Created;
String? LastUpdated;
String? BasedOn;
String? ExternalId;
String? Name;
String? Initials;
String? Phone;
String? Email;
String? Password;
String? RequestUser;
Location? Location;
String? UserType;
List<Location>? ProposedRoute;
List<Location>? ActualRoute;
String? Image;
UserStatus? UserStatus;
String? RecordStatus;
List<String>? Documents;
bool? SubscribeToEmails;
Address? Address;
List<String>? SkillTags;
bool? Enabled;
List<String>? UIPrefTaskColumnsOff;
List<UIColumnPref>? UIPrefTaskColumns;
Map<String,String?>? Data;
List<String>? Teams;
List<EventItem>? Events;
String? Color;
String? VehicleAsset;
bool? ExternalAuth;
String? CreatedBy;
bool? ServiceAccount;
List<String>? Assets;
bool? TfaRequired;
String? TfaPreference;
List<WorkDay>? WorkWeek;
bool? CustomSchedulesEnabled;
List<CustomSchedule>? CustomSchedules;
bool? OverrideSso;
User({this.Workspace,this.TimeZone,this.ObjectId,this.VersionId,this.Created,this.LastUpdated,this.BasedOn,this.ExternalId,this.Name,this.Initials,this.Phone,this.Email,this.Password,this.RequestUser,this.Location,this.UserType,this.ProposedRoute,this.ActualRoute,this.Image,this.UserStatus,this.RecordStatus,this.Documents,this.SubscribeToEmails,this.Address,this.SkillTags,this.Enabled,this.UIPrefTaskColumnsOff,this.UIPrefTaskColumns,this.Data,this.Teams,this.Events,this.Color,this.VehicleAsset,this.ExternalAuth,this.CreatedBy,this.ServiceAccount,this.Assets,this.TfaRequired,this.TfaPreference,this.WorkWeek,this.CustomSchedulesEnabled,this.CustomSchedules,this.OverrideSso});
User.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Workspace = json['Workspace'];
TimeZone = json['TimeZone'];
ObjectId = json['ObjectId'];
VersionId = json['VersionId'];
Created = json['Created'];
LastUpdated = json['LastUpdated'];
BasedOn = json['BasedOn'];
ExternalId = json['ExternalId'];
Name = json['Name'];
Initials = json['Initials'];
Phone = json['Phone'];
Email = json['Email'];
Password = json['Password'];
RequestUser = json['RequestUser'];
Location = JsonConverters.fromJson(json['Location'],'Location',context!);
UserType = json['UserType'];
ProposedRoute = JsonConverters.fromJson(json['ProposedRoute'],'List<Location>',context!);
ActualRoute = JsonConverters.fromJson(json['ActualRoute'],'List<Location>',context!);
Image = json['Image'];
UserStatus = JsonConverters.fromJson(json['UserStatus'],'UserStatus',context!);
RecordStatus = json['RecordStatus'];
Documents = JsonConverters.fromJson(json['Documents'],'List<String>',context!);
SubscribeToEmails = json['SubscribeToEmails'];
Address = JsonConverters.fromJson(json['Address'],'Address',context!);
SkillTags = JsonConverters.fromJson(json['SkillTags'],'List<String>',context!);
Enabled = json['Enabled'];
UIPrefTaskColumnsOff = JsonConverters.fromJson(json['UIPrefTaskColumnsOff'],'List<String>',context!);
UIPrefTaskColumns = JsonConverters.fromJson(json['UIPrefTaskColumns'],'List<UIColumnPref>',context!);
Data = JsonConverters.toStringMap(json['Data']);
Teams = JsonConverters.fromJson(json['Teams'],'List<String>',context!);
Events = JsonConverters.fromJson(json['Events'],'List<EventItem>',context!);
Color = json['Color'];
VehicleAsset = json['VehicleAsset'];
ExternalAuth = json['ExternalAuth'];
CreatedBy = json['CreatedBy'];
ServiceAccount = json['ServiceAccount'];
Assets = JsonConverters.fromJson(json['Assets'],'List<String>',context!);
TfaRequired = json['TfaRequired'];
TfaPreference = json['TfaPreference'];
WorkWeek = JsonConverters.fromJson(json['WorkWeek'],'List<WorkDay>',context!);
CustomSchedulesEnabled = json['CustomSchedulesEnabled'];
CustomSchedules = JsonConverters.fromJson(json['CustomSchedules'],'List<CustomSchedule>',context!);
OverrideSso = json['OverrideSso'];
return this;
}
Map<String, dynamic> toJson() => {
'Workspace': Workspace,
'TimeZone': TimeZone,
'ObjectId': ObjectId,
'VersionId': VersionId,
'Created': Created,
'LastUpdated': LastUpdated,
'BasedOn': BasedOn,
'ExternalId': ExternalId,
'Name': Name,
'Initials': Initials,
'Phone': Phone,
'Email': Email,
'Password': Password,
'RequestUser': RequestUser,
'Location': JsonConverters.toJson(Location,'Location',context!),
'UserType': UserType,
'ProposedRoute': JsonConverters.toJson(ProposedRoute,'List<Location>',context!),
'ActualRoute': JsonConverters.toJson(ActualRoute,'List<Location>',context!),
'Image': Image,
'UserStatus': JsonConverters.toJson(UserStatus,'UserStatus',context!),
'RecordStatus': RecordStatus,
'Documents': JsonConverters.toJson(Documents,'List<String>',context!),
'SubscribeToEmails': SubscribeToEmails,
'Address': JsonConverters.toJson(Address,'Address',context!),
'SkillTags': JsonConverters.toJson(SkillTags,'List<String>',context!),
'Enabled': Enabled,
'UIPrefTaskColumnsOff': JsonConverters.toJson(UIPrefTaskColumnsOff,'List<String>',context!),
'UIPrefTaskColumns': JsonConverters.toJson(UIPrefTaskColumns,'List<UIColumnPref>',context!),
'Data': Data,
'Teams': JsonConverters.toJson(Teams,'List<String>',context!),
'Events': JsonConverters.toJson(Events,'List<EventItem>',context!),
'Color': Color,
'VehicleAsset': VehicleAsset,
'ExternalAuth': ExternalAuth,
'CreatedBy': CreatedBy,
'ServiceAccount': ServiceAccount,
'Assets': JsonConverters.toJson(Assets,'List<String>',context!),
'TfaRequired': TfaRequired,
'TfaPreference': TfaPreference,
'WorkWeek': JsonConverters.toJson(WorkWeek,'List<WorkDay>',context!),
'CustomSchedulesEnabled': CustomSchedulesEnabled,
'CustomSchedules': JsonConverters.toJson(CustomSchedules,'List<CustomSchedule>',context!),
'OverrideSso': OverrideSso
};
getTypeName() => "User";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
'Location': TypeInfo(TypeOf.Class, create:() => Location()),
'UserStatus': TypeInfo(TypeOf.Enum, enumValues:UserStatus.values),
'Address': TypeInfo(TypeOf.Class, create:() => Address()),
'UIColumnPref': TypeInfo(TypeOf.Class, create:() => UIColumnPref()),
'EventItem': TypeInfo(TypeOf.Class, create:() => EventItem()),
'WorkDay': TypeInfo(TypeOf.Class, create:() => WorkDay()),
'CustomSchedule': TypeInfo(TypeOf.Class, create:() => CustomSchedule()),
'User': TypeInfo(TypeOf.Class, create:() => User()),
'List<Location>': TypeInfo(TypeOf.Class, create:() => <Location>[]),
'List<UIColumnPref>': TypeInfo(TypeOf.Class, create:() => <UIColumnPref>[]),
'List<EventItem>': TypeInfo(TypeOf.Class, create:() => <EventItem>[]),
'List<WorkDay>': TypeInfo(TypeOf.Class, create:() => <WorkDay>[]),
'List<CustomSchedule>': TypeInfo(TypeOf.Class, create:() => <CustomSchedule>[]),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /{Workspace}/User/{ObjectId} HTTP/1.1
Host: dev.fieldsquared.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<User xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Users">
<ActualRoute xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
<d2p1:Location>
<d2p1:x>0</d2p1:x>
<d2p1:y>0</d2p1:y>
</d2p1:Location>
</ActualRoute>
<Address xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
<d2p1:City>String</d2p1:City>
<d2p1:ContactEmail>String</d2p1:ContactEmail>
<d2p1:ContactName>String</d2p1:ContactName>
<d2p1:ContactPhone>String</d2p1:ContactPhone>
<d2p1:ContactTitle>String</d2p1:ContactTitle>
<d2p1:Country>String</d2p1:Country>
<d2p1:GeocodeFailed>false</d2p1:GeocodeFailed>
<d2p1:Location>
<d2p1:x>0</d2p1:x>
<d2p1:y>0</d2p1:y>
</d2p1:Location>
<d2p1:SiteName>String</d2p1:SiteName>
<d2p1:State>String</d2p1:State>
<d2p1:Street>String</d2p1:Street>
<d2p1:Unit>String</d2p1:Unit>
<d2p1:Zip>String</d2p1:Zip>
</Address>
<Assets xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Assets>
<BasedOn>String</BasedOn>
<Color>String</Color>
<Created>String</Created>
<CreatedBy>String</CreatedBy>
<CustomSchedules>
<CustomSchedule>
<Date>String</Date>
<End>0</End>
<Start>0</Start>
<Type>String</Type>
</CustomSchedule>
</CustomSchedules>
<CustomSchedulesEnabled>false</CustomSchedulesEnabled>
<Data xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringstring>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value>String</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</Data>
<Documents xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Documents>
<Email>String</Email>
<Enabled>false</Enabled>
<Events xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
<d2p1:EventItem>
<d2p1:Automatic>false</d2p1:Automatic>
<d2p1:Barcode>String</d2p1:Barcode>
<d2p1:Date>String</d2p1:Date>
<d2p1:DateCreated>String</d2p1:DateCreated>
<d2p1:Details>String</d2p1:Details>
<d2p1:IsScan>false</d2p1:IsScan>
<d2p1:Location>
<d2p1:x>0</d2p1:x>
<d2p1:y>0</d2p1:y>
</d2p1:Location>
<d2p1:ObjectId>String</d2p1:ObjectId>
<d2p1:SelectedBy>String</d2p1:SelectedBy>
<d2p1:Status>String</d2p1:Status>
<d2p1:StatusType>String</d2p1:StatusType>
<d2p1:Type>String</d2p1:Type>
<d2p1:User>String</d2p1:User>
</d2p1:EventItem>
</Events>
<ExternalAuth>false</ExternalAuth>
<ExternalId>String</ExternalId>
<Image>String</Image>
<Initials>String</Initials>
<LastUpdated>String</LastUpdated>
<Location xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
<d2p1:x>0</d2p1:x>
<d2p1:y>0</d2p1:y>
</Location>
<Name>String</Name>
<ObjectId>String</ObjectId>
<OverrideSso>false</OverrideSso>
<Password>String</Password>
<Phone>String</Phone>
<ProposedRoute xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
<d2p1:Location>
<d2p1:x>0</d2p1:x>
<d2p1:y>0</d2p1:y>
</d2p1:Location>
</ProposedRoute>
<RecordStatus>String</RecordStatus>
<RequestUser>String</RequestUser>
<ServiceAccount>false</ServiceAccount>
<SkillTags xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</SkillTags>
<SubscribeToEmails>false</SubscribeToEmails>
<Teams xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Teams>
<TfaPreference>String</TfaPreference>
<TfaRequired>false</TfaRequired>
<TimeZone>String</TimeZone>
<UIPrefTaskColumns xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model">
<d2p1:UIColumnPref>
<d2p1:Name>String</d2p1:Name>
<d2p1:Width>0</d2p1:Width>
</d2p1:UIColumnPref>
</UIPrefTaskColumns>
<UIPrefTaskColumnsOff xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</UIPrefTaskColumnsOff>
<UserStatus>NotStarted</UserStatus>
<UserType>String</UserType>
<VehicleAsset>String</VehicleAsset>
<VersionId>String</VersionId>
<WorkWeek xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Workspaces">
<d2p1:WorkDay>
<d2p1:DayOfWeek>0</d2p1:DayOfWeek>
<d2p1:End>0</d2p1:End>
<d2p1:Lunch>0</d2p1:Lunch>
<d2p1:Start>0</d2p1:Start>
</d2p1:WorkDay>
</WorkWeek>
<Workspace>String</Workspace>
</User>