Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
DELETE | /customfields/{Id} | Delete a custom field | Delete a custom field for the currently logged in user, only administrators are allowed to delete custom fields. |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@ValidateRequest(Validator="IsAuthenticated")
public static class DeleteCustomField implements ICompany
{
/**
* The company id, if empty will use the company id for the user you are logged in with.
*/
@ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
public UUID CompanyId = null;
/**
* Id of the custom field to delete
*/
@ApiMember(Description="Id of the custom field to delete", IsRequired=true, ParameterType="path")
public Integer Id = null;
public UUID getCompanyId() { return CompanyId; }
public DeleteCustomField setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Integer getId() { return Id; }
public DeleteCustomField setId(Integer value) { this.Id = value; return this; }
}
public static class CustomFieldQueryResponse
{
/**
* Custom field id
*/
@ApiMember(Description="Custom field id")
public Integer Id = null;
/**
* Reference to company that owns the custom field configuration
*/
@ApiMember(Description="Reference to company that owns the custom field configuration")
public UUID CompanyId = null;
/**
* Group id
*/
@ApiMember(Description="Group id")
public Integer GroupId = null;
/**
* Field id
*/
@ApiMember(Description="Field id")
public Integer FieldId = null;
/**
* Configuration name. Example: 'Number of persons'.
*/
@ApiMember(Description="Configuration name. Example: 'Number of persons'.")
public String Name = null;
/**
* Field width. Example: 20
*/
@ApiMember(Description="Field width. Example: 20")
public Integer Width = null;
/**
* Column in database where to store the information. Example: 'TextField1'
*/
@ApiMember(Description="Column in database where to store the information. Example: 'TextField1'")
public String Column = null;
/**
* Custom field description. Example: 'For how many persons is this booking?'
*/
@ApiMember(Description="Custom field description. Example: 'For how many persons is this booking?'")
public String Description = null;
/**
* Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
*/
@ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'")
public String DataType = null;
/**
* Default value of the field. Example: '3'
*/
@ApiMember(Description="Default value of the field. Example: '3'")
public String DefaultValue = null;
/**
* Determines if the field is required to have a value or not
*/
@ApiMember(Description="Determines if the field is required to have a value or not")
public Boolean IsMandatory = null;
/**
* Error message shown to the user if the field data is required but not entered
*/
@ApiMember(Description="Error message shown to the user if the field data is required but not entered")
public String MandatoryErrorMessage = null;
/**
* Max lenght of the field
*/
@ApiMember(Description="Max lenght of the field")
public Integer MaxLength = null;
/**
* If the field should have multiple lines
*/
@ApiMember(Description="If the field should have multiple lines")
public Boolean MultipleLineText = null;
/**
* Regular expression used for validation of the field
*/
@ApiMember(Description="Regular expression used for validation of the field")
public String RegEx = null;
/**
* Regular expression id for validation of the field
*/
@ApiMember(Description="Regular expression id for validation of the field")
public Integer RegExId = null;
/**
* Error message shown if the regular expression validation failed
*/
@ApiMember(Description="Error message shown if the regular expression validation failed")
public String RegExErrorMessage = null;
/**
* If the field is visible to the customer
*/
@ApiMember(Description="If the field is visible to the customer")
public Boolean IsPublic = null;
/**
* If the field should be hidden in lists
*/
@ApiMember(Description="If the field should be hidden in lists")
public Boolean IsHidden = null;
/**
* Table to which the field belongs
*/
@ApiMember(Description="Table to which the field belongs")
public String Table = null;
/**
* The values to select from if Datatype is DropDown for this custom field
*/
@ApiMember(Description="The values to select from if Datatype is DropDown for this custom field")
public ArrayList<CustomFieldLookupResponse> Values = null;
/**
* The services that is connected to the custom field
*/
@ApiMember(Description="The services that is connected to the custom field")
public ArrayList<CustomFieldServices> Services = null;
public Integer getId() { return Id; }
public CustomFieldQueryResponse setId(Integer value) { this.Id = value; return this; }
public UUID getCompanyId() { return CompanyId; }
public CustomFieldQueryResponse setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Integer getGroupId() { return GroupId; }
public CustomFieldQueryResponse setGroupId(Integer value) { this.GroupId = value; return this; }
public Integer getFieldId() { return FieldId; }
public CustomFieldQueryResponse setFieldId(Integer value) { this.FieldId = value; return this; }
public String getName() { return Name; }
public CustomFieldQueryResponse setName(String value) { this.Name = value; return this; }
public Integer getWidth() { return Width; }
public CustomFieldQueryResponse setWidth(Integer value) { this.Width = value; return this; }
public String getColumn() { return Column; }
public CustomFieldQueryResponse setColumn(String value) { this.Column = value; return this; }
public String getDescription() { return Description; }
public CustomFieldQueryResponse setDescription(String value) { this.Description = value; return this; }
public String getDataType() { return DataType; }
public CustomFieldQueryResponse setDataType(String value) { this.DataType = value; return this; }
public String getDefaultValue() { return DefaultValue; }
public CustomFieldQueryResponse setDefaultValue(String value) { this.DefaultValue = value; return this; }
public Boolean getIsMandatory() { return IsMandatory; }
public CustomFieldQueryResponse setIsMandatory(Boolean value) { this.IsMandatory = value; return this; }
public String getMandatoryErrorMessage() { return MandatoryErrorMessage; }
public CustomFieldQueryResponse setMandatoryErrorMessage(String value) { this.MandatoryErrorMessage = value; return this; }
public Integer getMaxLength() { return MaxLength; }
public CustomFieldQueryResponse setMaxLength(Integer value) { this.MaxLength = value; return this; }
public Boolean isMultipleLineText() { return MultipleLineText; }
public CustomFieldQueryResponse setMultipleLineText(Boolean value) { this.MultipleLineText = value; return this; }
public String getRegEx() { return RegEx; }
public CustomFieldQueryResponse setRegEx(String value) { this.RegEx = value; return this; }
public Integer getRegExId() { return RegExId; }
public CustomFieldQueryResponse setRegExId(Integer value) { this.RegExId = value; return this; }
public String getRegExErrorMessage() { return RegExErrorMessage; }
public CustomFieldQueryResponse setRegExErrorMessage(String value) { this.RegExErrorMessage = value; return this; }
public Boolean getIsPublic() { return IsPublic; }
public CustomFieldQueryResponse setIsPublic(Boolean value) { this.IsPublic = value; return this; }
public Boolean getIsHidden() { return IsHidden; }
public CustomFieldQueryResponse setIsHidden(Boolean value) { this.IsHidden = value; return this; }
public String getTable() { return Table; }
public CustomFieldQueryResponse setTable(String value) { this.Table = value; return this; }
public ArrayList<CustomFieldLookupResponse> getValues() { return Values; }
public CustomFieldQueryResponse setValues(ArrayList<CustomFieldLookupResponse> value) { this.Values = value; return this; }
public ArrayList<CustomFieldServices> getServices() { return Services; }
public CustomFieldQueryResponse setServices(ArrayList<CustomFieldServices> value) { this.Services = value; return this; }
}
public static class CustomFieldLookupResponse
{
public Integer Id = null;
public Boolean Active = null;
public Integer SortOrder = null;
public String Value = null;
public Integer getId() { return Id; }
public CustomFieldLookupResponse setId(Integer value) { this.Id = value; return this; }
public Boolean isActive() { return Active; }
public CustomFieldLookupResponse setActive(Boolean value) { this.Active = value; return this; }
public Integer getSortOrder() { return SortOrder; }
public CustomFieldLookupResponse setSortOrder(Integer value) { this.SortOrder = value; return this; }
public String getValue() { return Value; }
public CustomFieldLookupResponse setValue(String value) { this.Value = value; return this; }
}
public static class CustomFieldServices
{
public Integer Id = null;
/**
* Name of the service
*/
@ApiMember(Description="Name of the service")
public String Name = null;
/**
* The image url of the service
*/
@ApiMember(Description="The image url of the service")
public Uri ImageUrl = null;
public Integer getId() { return Id; }
public CustomFieldServices setId(Integer value) { this.Id = value; return this; }
public String getName() { return Name; }
public CustomFieldServices setName(String value) { this.Name = value; return this; }
public Uri getImageUrl() { return ImageUrl; }
public CustomFieldServices setImageUrl(Uri value) { this.ImageUrl = 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.
DELETE /customfields/{Id} HTTP/1.1 Host: api.bokamera.se Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CustomFieldQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <Column>String</Column> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <DataType>String</DataType> <DefaultValue>String</DefaultValue> <Description>String</Description> <FieldId>0</FieldId> <GroupId>0</GroupId> <Id>0</Id> <IsHidden>false</IsHidden> <IsMandatory>false</IsMandatory> <IsPublic>false</IsPublic> <MandatoryErrorMessage>String</MandatoryErrorMessage> <MaxLength>0</MaxLength> <MultipleLineText>false</MultipleLineText> <Name>String</Name> <RegEx>String</RegEx> <RegExErrorMessage>String</RegExErrorMessage> <RegExId>0</RegExId> <Services> <CustomFieldServices> <Id>0</Id> <ImageUrl i:nil="true" /> <Name>String</Name> </CustomFieldServices> </Services> <Table>String</Table> <Values> <CustomFieldLookupResponse> <Active>false</Active> <Id>0</Id> <SortOrder>0</SortOrder> <Value>String</Value> </CustomFieldLookupResponse> </Values> <Width>0</Width> </CustomFieldQueryResponse>