/* Options: Date: 2024-07-03 13:17:41 Version: 8.23 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://api.bokamera.se //Package: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: CustomFieldQuery.* //ExcludeTypes: //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: java.math.*,java.util.*,net.servicestack.client.*,com.google.gson.annotations.*,com.google.gson.reflect.* */ import java.math.* import java.util.* import net.servicestack.client.* import com.google.gson.annotations.* import com.google.gson.reflect.* @Route(Path="/customfields", Verbs="GET") @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401) // @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403) @ValidateRequest(Validator="IsAuthenticated") open class CustomFieldQuery : QueryDb(), IReturn>, ICompany { /** * One or multiple id's of custom fields to find */ @ApiMember(Description="One or multiple id's of custom fields to find", ParameterType="query") var Ids:ArrayList? = null /** * Company id to find custom fields for */ @ApiMember(Description="Company id to find custom fields for", ParameterType="query") var CompanyId:UUID? = null /** * Table to which the custom field belongs to */ @ApiMember(Description="Table to which the custom field belongs to", ParameterType="query") var Table:String? = null /** * Active or removed fields, empty parameter includes both */ @ApiMember(Description="Active or removed fields, empty parameter includes both", ParameterType="query") var Active:Boolean? = null /** * If you want to include the custom fields values to select from when using dropdown as datatype */ @ApiMember(Description="If you want to include the custom fields values to select from when using dropdown as datatype", ParameterType="query") var IncludeCustomFieldValues:Boolean? = null /** * If you want to include the connected services for the custom field */ @ApiMember(DataType="bool", Description="If you want to include the connected services for the custom field", ParameterType="query") var IncludeConnectedServices:Boolean? = null companion object { private val responseType = object : TypeToken>(){}.type } override fun getResponseType(): Any? = CustomFieldQuery.responseType } @DataContract open class QueryResponse { @DataMember(Order=1) var Offset:Int? = null @DataMember(Order=2) var Total:Int? = null @DataMember(Order=3) var Results:ArrayList = ArrayList() @DataMember(Order=4) var Meta:HashMap = HashMap() @DataMember(Order=5) var ResponseStatus:ResponseStatus? = null } open class QueryDb : QueryBase() { } open interface ICompany { var CompanyId:UUID? } open class CustomFieldConfig : BaseModel() { @Ignore() var Values:ArrayList = ArrayList() var CustomField:CustomField? = null @Ignore() var RegEx:RegEx? = null @Ignore() var Services:ArrayList = ArrayList() var CustomFieldServiceRelation:ArrayList = ArrayList() @Required() var CompanyId:UUID? = null var Id:Int? = null var GroupId:Int? = null @Required() var FieldId:Int? = null @Required() var IconId:Int? = null var RegExId:Int? = null @Required() var Name:String? = null @Required() var Description:String? = null @Required() var Datatype:String? = null @Required() var MaxLength:Int? = null @Required() var IsPublic:Boolean? = null @Required() var IsHidden:Boolean? = null @Required() var IsMandatory:Boolean? = null var DefaultValue:String? = null var RegExErrorMessage:String? = null var MandatoryErrorMessage:String? = null var Width:Int? = null @Required() var MultipleLineText:Boolean? = null var ModifiedDate:Date? = null } open class CustomFieldServices { var Id:Int? = null /** * Name of the service */ @ApiMember(Description="Name of the service") var Name:String? = null /** * The image url of the service */ @ApiMember(Description="The image url of the service") var ImageUrl:Uri? = null } open class CustomFieldLookupResponse { var Id:Int? = null var Active:Boolean? = null var SortOrder:Int? = null var Value:String? = null } @DataContract open class QueryBase { /** * Skip over a given number of elements in a sequence and then return the remainder. Use this when you need paging.

Example:
?skip=10&orderBy=Id */ @DataMember(Order=1) var Skip:Int? = null /** * Return a given number of elements in a sequence and then skip over the remainder. Use this when you need paging.

Example:
?take=20 */ @DataMember(Order=2) var Take:Int? = null /** * Comma separated list of fields to order by. Prefix the field name with a minus if you wan't to invert the sort for that field.

Example:
?orderBy=Id,-Age,FirstName */ @DataMember(Order=3) var OrderBy:String? = null /** * Comma separated list of fields to order by in descending order. Prefix the field name with a minus if you wan't to invert the sort for that field.

Example:
?orderByDesc=Id,-Age,FirstName */ @DataMember(Order=4) var OrderByDesc:String? = null /** * Include any of the aggregates AVG, COUNT, FIRST, LAST, MAX, MIN, SUM in your result set. The results will be returned in the meta field.

Example:
?include=COUNT(*) as Total

or multiple fields with
?include=Count(*) Total, Min(Age), AVG(Age) AverageAge

or unique with
?include=COUNT(DISTINCT LivingStatus) as UniqueStatus */ @DataMember(Order=5) var Include:String? = null @DataMember(Order=6) var Fields:String? = null @DataMember(Order=7) var Meta:HashMap = HashMap() } open class BaseModel { } open class CustomFieldValue : BaseModel() { @Required() var CompanyId:UUID? = null var Id:Int? = null @Required() var Value:String? = null @Required() var Active:Boolean? = null var SortOrder:Short? = null var ModifiedDate:Date? = null } open class CustomField : BaseModel() { @Required() var Table:String? = null @Required() var Column:String? = null @Required() var DataType:String? = null @Required() var Description:String? = null @Required() var Active:Boolean? = null var ModifiedDate:Date? = null var Id:Int? = null } open class RegEx : BaseModel() { @Required() var Name:String? = null @Required() var Description:String? = null @Required() var RegExCode:String? = null var ErrorMessage:String? = null var ModifiedDate:Date? = null var Id:Int? = null } open class CustomFieldServiceRelation : BaseModel() { @Required() var CompanyId:UUID? = null var Id:Int? = null @Required() var CustomFieldConfigId:Int? = null @Required() var ServiceId:Int? = null var ModifiedDate:Date? = null } open class CustomFieldQueryResponse { /** * Custom field id */ @ApiMember(Description="Custom field id") var Id:Int? = null /** * Reference to company that owns the custom field configuration */ @ApiMember(Description="Reference to company that owns the custom field configuration") var CompanyId:UUID? = null /** * Group id */ @ApiMember(Description="Group id") var GroupId:Int? = null /** * Field id */ @ApiMember(Description="Field id") var FieldId:Int? = null /** * Configuration name. Example: 'Number of persons'. */ @ApiMember(Description="Configuration name. Example: 'Number of persons'.") var Name:String? = null /** * Field width. Example: 20 */ @ApiMember(Description="Field width. Example: 20") var Width:Int? = null /** * Column in database where to store the information. Example: 'TextField1' */ @ApiMember(Description="Column in database where to store the information. Example: 'TextField1'") var Column:String? = 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?'") var Description:String? = 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'") var DataType:String? = null /** * Default value of the field. Example: '3' */ @ApiMember(Description="Default value of the field. Example: '3'") var DefaultValue:String? = 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") var IsMandatory:Boolean? = 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") var MandatoryErrorMessage:String? = null /** * Max lenght of the field */ @ApiMember(Description="Max lenght of the field") var MaxLength:Int? = null /** * If the field should have multiple lines */ @ApiMember(Description="If the field should have multiple lines") var MultipleLineText:Boolean? = null /** * Regular expression used for validation of the field */ @ApiMember(Description="Regular expression used for validation of the field") var RegEx:String? = null /** * Regular expression id for validation of the field */ @ApiMember(Description="Regular expression id for validation of the field") var RegExId:Int? = null /** * Error message shown if the regular expression validation failed */ @ApiMember(Description="Error message shown if the regular expression validation failed") var RegExErrorMessage:String? = null /** * If the field is visible to the customer */ @ApiMember(Description="If the field is visible to the customer") var IsPublic:Boolean? = null /** * If the field should be hidden in lists */ @ApiMember(Description="If the field should be hidden in lists") var IsHidden:Boolean? = null /** * Table to which the field belongs */ @ApiMember(Description="Table to which the field belongs") var Table:String? = 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") var Values:ArrayList = ArrayList() /** * The services that is connected to the custom field */ @ApiMember(Description="The services that is connected to the custom field") var Services:ArrayList = ArrayList() }