| GET | /{Workspace}/API/Team/Schema | ||
|---|---|---|---|
| GET, PUT, POST, DELETE | /{Workspace}/API/Team/{Id} | ||
| GET, PUT, POST, DELETE | /{Workspace}/API/Team |
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@DataContract
public static class PublicTeam
{
@DataMember
public String Id = null;
@DataMember
public String Workspace = null;
@DataMember
public Team Team = null;
@DataMember
public ArrayList<Team> Teams = null;
public String getId() { return Id; }
public PublicTeam setId(String value) { this.Id = value; return this; }
public String getWorkspace() { return Workspace; }
public PublicTeam setWorkspace(String value) { this.Workspace = value; return this; }
public Team getTeam() { return Team; }
public PublicTeam setTeam(Team value) { this.Team = value; return this; }
public ArrayList<Team> getTeams() { return Teams; }
public PublicTeam setTeams(ArrayList<Team> value) { this.Teams = value; return this; }
}
/**
* Represents a DTO for a team in a workspace. Calls without an ObjectId will retrieve an array of all team objects for the workspace.
*/
public static class Team
{
public String Workspace = null;
public String TimeZone = null;
public String ObjectId = null;
public String ExternalId = null;
public String VersionId = null;
public String BasedOn = null;
public String Name = null;
public Boolean Enabled = null;
public ArrayList<DomainItem> Members = null;
public DomainItem Lead = null;
public DomainItem Parent = null;
public Address Address = null;
public HashMap<String,String> Data = null;
public ArrayList<String> Teams = null;
public ArrayList<EventItem> Events = null;
public String CreatedBy = null;
public HashMap<String,Object> ActiveLaborTypes = null;
public String getWorkspace() { return Workspace; }
public Team setWorkspace(String value) { this.Workspace = value; return this; }
public String getTimeZone() { return TimeZone; }
public Team setTimeZone(String value) { this.TimeZone = value; return this; }
public String getObjectId() { return ObjectId; }
public Team setObjectId(String value) { this.ObjectId = value; return this; }
public String getExternalId() { return ExternalId; }
public Team setExternalId(String value) { this.ExternalId = value; return this; }
public String getVersionId() { return VersionId; }
public Team setVersionId(String value) { this.VersionId = value; return this; }
public String getBasedOn() { return BasedOn; }
public Team setBasedOn(String value) { this.BasedOn = value; return this; }
public String getName() { return Name; }
public Team setName(String value) { this.Name = value; return this; }
public Boolean isEnabled() { return Enabled; }
public Team setEnabled(Boolean value) { this.Enabled = value; return this; }
public ArrayList<DomainItem> getMembers() { return Members; }
public Team setMembers(ArrayList<DomainItem> value) { this.Members = value; return this; }
public DomainItem getLead() { return Lead; }
public Team setLead(DomainItem value) { this.Lead = value; return this; }
public DomainItem getParent() { return Parent; }
public Team setParent(DomainItem value) { this.Parent = value; return this; }
public Address getAddress() { return Address; }
public Team setAddress(Address value) { this.Address = value; return this; }
public HashMap<String,String> getData() { return Data; }
public Team setData(HashMap<String,String> value) { this.Data = value; return this; }
public ArrayList<String> getTeams() { return Teams; }
public Team setTeams(ArrayList<String> value) { this.Teams = value; return this; }
public ArrayList<EventItem> getEvents() { return Events; }
public Team setEvents(ArrayList<EventItem> value) { this.Events = value; return this; }
public String getCreatedBy() { return CreatedBy; }
public Team setCreatedBy(String value) { this.CreatedBy = value; return this; }
public HashMap<String,Object> getActiveLaborTypes() { return ActiveLaborTypes; }
public Team setActiveLaborTypes(HashMap<String,Object> value) { this.ActiveLaborTypes = value; return this; }
}
public static class DomainItem
{
public String Workspace = null;
public String ObjectId = null;
public String VersionId = null;
public String LastUpdated = null;
public String getWorkspace() { return Workspace; }
public DomainItem setWorkspace(String value) { this.Workspace = value; return this; }
public String getObjectId() { return ObjectId; }
public DomainItem setObjectId(String value) { this.ObjectId = value; return this; }
public String getVersionId() { return VersionId; }
public DomainItem setVersionId(String value) { this.VersionId = value; return this; }
public String getLastUpdated() { return LastUpdated; }
public DomainItem setLastUpdated(String value) { this.LastUpdated = value; return this; }
}
public static class Address
{
public String Street = null;
public String Unit = null;
public String City = null;
public String State = null;
public String Zip = null;
public String ContactTitle = null;
public String ContactName = null;
public String ContactPhone = null;
public String ContactEmail = null;
public Location Location = null;
public String SiteName = null;
public Boolean GeocodeFailed = null;
public String Country = null;
public String getStreet() { return Street; }
public Address setStreet(String value) { this.Street = value; return this; }
public String getUnit() { return Unit; }
public Address setUnit(String value) { this.Unit = value; return this; }
public String getCity() { return City; }
public Address setCity(String value) { this.City = value; return this; }
public String getState() { return State; }
public Address setState(String value) { this.State = value; return this; }
public String getZip() { return Zip; }
public Address setZip(String value) { this.Zip = value; return this; }
public String getContactTitle() { return ContactTitle; }
public Address setContactTitle(String value) { this.ContactTitle = value; return this; }
public String getContactName() { return ContactName; }
public Address setContactName(String value) { this.ContactName = value; return this; }
public String getContactPhone() { return ContactPhone; }
public Address setContactPhone(String value) { this.ContactPhone = value; return this; }
public String getContactEmail() { return ContactEmail; }
public Address setContactEmail(String value) { this.ContactEmail = value; return this; }
public Location getLocation() { return Location; }
public Address setLocation(Location value) { this.Location = value; return this; }
public String getSiteName() { return SiteName; }
public Address setSiteName(String value) { this.SiteName = value; return this; }
public Boolean isGeocodeFailed() { return GeocodeFailed; }
public Address setGeocodeFailed(Boolean value) { this.GeocodeFailed = value; return this; }
public String getCountry() { return Country; }
public Address setCountry(String value) { this.Country = value; return this; }
}
public static class Location
{
public Double y = null;
public Double x = null;
public Double getY() { return y; }
public Location setY(Double value) { this.y = value; return this; }
public Double getX() { return x; }
public Location setX(Double value) { this.x = value; return this; }
}
public static class EventItem
{
public String ObjectId = null;
public String Date = null;
public Location Location = null;
public String Barcode = null;
public String Details = null;
public String Type = null;
public Boolean IsScan = null;
public String User = null;
public String SelectedBy = null;
public String Status = null;
public String StatusType = null;
public String DateCreated = null;
public Boolean Automatic = null;
public String getObjectId() { return ObjectId; }
public EventItem setObjectId(String value) { this.ObjectId = value; return this; }
public String getDate() { return Date; }
public EventItem setDate(String value) { this.Date = value; return this; }
public Location getLocation() { return Location; }
public EventItem setLocation(Location value) { this.Location = value; return this; }
public String getBarcode() { return Barcode; }
public EventItem setBarcode(String value) { this.Barcode = value; return this; }
public String getDetails() { return Details; }
public EventItem setDetails(String value) { this.Details = value; return this; }
public String getType() { return Type; }
public EventItem setType(String value) { this.Type = value; return this; }
public Boolean getIsScan() { return IsScan; }
public EventItem setIsScan(Boolean value) { this.IsScan = value; return this; }
public String getUser() { return User; }
public EventItem setUser(String value) { this.User = value; return this; }
public String getSelectedBy() { return SelectedBy; }
public EventItem setSelectedBy(String value) { this.SelectedBy = value; return this; }
public String getStatus() { return Status; }
public EventItem setStatus(String value) { this.Status = value; return this; }
public String getStatusType() { return StatusType; }
public EventItem setStatusType(String value) { this.StatusType = value; return this; }
public String getDateCreated() { return DateCreated; }
public EventItem setDateCreated(String value) { this.DateCreated = value; return this; }
public Boolean isAutomatic() { return Automatic; }
public EventItem setAutomatic(Boolean value) { this.Automatic = value; return this; }
}
}
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}/API/Team/{Id} HTTP/1.1
Host: dev.fieldsquared.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<PublicTeam xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.PublicApi.Teams">
<Id>String</Id>
<Team>
<City>String</City>
<Country>String</Country>
<Created>String</Created>
<Data xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringanyType>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value />
</d3p1:KeyValueOfstringanyType>
</Data>
<Enabled>false</Enabled>
<ExternalId>String</ExternalId>
<LastUpdated>String</LastUpdated>
<Lat>0</Lat>
<Lon>0</Lon>
<Members xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</Members>
<Name>String</Name>
<State>String</State>
<StreetAddress>String</StreetAddress>
<Teams xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</Teams>
<Unit>String</Unit>
<Zip>String</Zip>
</Team>
<Teams>
<Team>
<City>String</City>
<Country>String</Country>
<Created>String</Created>
<Data xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringanyType>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value />
</d4p1:KeyValueOfstringanyType>
</Data>
<Enabled>false</Enabled>
<ExternalId>String</ExternalId>
<LastUpdated>String</LastUpdated>
<Lat>0</Lat>
<Lon>0</Lon>
<Members xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</Members>
<Name>String</Name>
<State>String</State>
<StreetAddress>String</StreetAddress>
<Teams xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</Teams>
<Unit>String</Unit>
<Zip>String</Zip>
</Team>
</Teams>
<Workspace>String</Workspace>
</PublicTeam>