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. |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BokaMera.API.ServiceModel.Dtos;
namespace BokaMera.API.ServiceModel.Dtos
{
public partial class CustomFieldLookupResponse
{
public virtual int? Id { get; set; }
public virtual bool? Active { get; set; }
public virtual int? SortOrder { get; set; }
public virtual string Value { get; set; }
}
public partial class CustomFieldQueryResponse
{
public CustomFieldQueryResponse()
{
Values = new List<CustomFieldLookupResponse>{};
Services = new List<CustomFieldServices>{};
}
///<summary>
///Custom field id
///</summary>
[ApiMember(Description="Custom field id")]
public virtual int Id { get; set; }
///<summary>
///Reference to company that owns the custom field configuration
///</summary>
[ApiMember(Description="Reference to company that owns the custom field configuration")]
public virtual Guid CompanyId { get; set; }
///<summary>
///Group id
///</summary>
[ApiMember(Description="Group id")]
public virtual int? GroupId { get; set; }
///<summary>
///Field id
///</summary>
[ApiMember(Description="Field id")]
public virtual int FieldId { get; set; }
///<summary>
///Configuration name. Example: 'Number of persons'.
///</summary>
[ApiMember(Description="Configuration name. Example: 'Number of persons'.")]
public virtual string Name { get; set; }
///<summary>
///Field width. Example: 20
///</summary>
[ApiMember(Description="Field width. Example: 20")]
public virtual int Width { get; set; }
///<summary>
///Column in database where to store the information. Example: 'TextField1'
///</summary>
[ApiMember(Description="Column in database where to store the information. Example: 'TextField1'")]
public virtual string Column { get; set; }
///<summary>
///Custom field description. Example: 'For how many persons is this booking?'
///</summary>
[ApiMember(Description="Custom field description. Example: 'For how many persons is this booking?'")]
public virtual string Description { get; set; }
///<summary>
///Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
///</summary>
[ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'")]
public virtual string DataType { get; set; }
///<summary>
///Default value of the field. Example: '3'
///</summary>
[ApiMember(Description="Default value of the field. Example: '3'")]
public virtual string DefaultValue { get; set; }
///<summary>
///Determines if the field is required to have a value or not
///</summary>
[ApiMember(Description="Determines if the field is required to have a value or not")]
public virtual bool IsMandatory { get; set; }
///<summary>
///Error message shown to the user if the field data is required but not entered
///</summary>
[ApiMember(Description="Error message shown to the user if the field data is required but not entered")]
public virtual string MandatoryErrorMessage { get; set; }
///<summary>
///Max lenght of the field
///</summary>
[ApiMember(Description="Max lenght of the field")]
public virtual int MaxLength { get; set; }
///<summary>
///If the field should have multiple lines
///</summary>
[ApiMember(Description="If the field should have multiple lines")]
public virtual bool MultipleLineText { get; set; }
///<summary>
///Regular expression used for validation of the field
///</summary>
[ApiMember(Description="Regular expression used for validation of the field")]
public virtual string RegEx { get; set; }
///<summary>
///Regular expression id for validation of the field
///</summary>
[ApiMember(Description="Regular expression id for validation of the field")]
public virtual int? RegExId { get; set; }
///<summary>
///Error message shown if the regular expression validation failed
///</summary>
[ApiMember(Description="Error message shown if the regular expression validation failed")]
public virtual string RegExErrorMessage { get; set; }
///<summary>
///If the field is visible to the customer
///</summary>
[ApiMember(Description="If the field is visible to the customer")]
public virtual bool IsPublic { get; set; }
///<summary>
///If the field should be hidden in lists
///</summary>
[ApiMember(Description="If the field should be hidden in lists")]
public virtual bool IsHidden { get; set; }
///<summary>
///Table to which the field belongs
///</summary>
[ApiMember(Description="Table to which the field belongs")]
public virtual string Table { get; set; }
///<summary>
///The values to select from if Datatype is DropDown for this custom field
///</summary>
[ApiMember(Description="The values to select from if Datatype is DropDown for this custom field")]
public virtual List<CustomFieldLookupResponse> Values { get; set; }
///<summary>
///The services that is connected to the custom field
///</summary>
[ApiMember(Description="The services that is connected to the custom field")]
public virtual List<CustomFieldServices> Services { get; set; }
}
public partial class CustomFieldServices
{
public virtual int Id { get; set; }
///<summary>
///Name of the service
///</summary>
[ApiMember(Description="Name of the service")]
public virtual string Name { get; set; }
///<summary>
///The image url of the service
///</summary>
[ApiMember(Description="The image url of the service")]
public virtual Uri ImageUrl { get; set; }
}
[ValidateRequest("IsAuthenticated")]
public partial class DeleteCustomField
: ICompany
{
///<summary>
///The company id, if empty will use the company id for the user you are logged in with.
///</summary>
[ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")]
public virtual Guid? CompanyId { get; set; }
///<summary>
///Id of the custom field to delete
///</summary>
[ApiMember(Description="Id of the custom field to delete", IsRequired=true, ParameterType="path")]
public virtual int Id { get; set; }
}
}
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>