/* Options: Date: 2024-06-26 10:29:28 Version: 8.23 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://testapi.bokamera.se //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: CreateCustomField.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; abstract class ICompany { String? CompanyId; } class CustomFieldGroupValue implements IConvertible { int? SortOrder; String? Value; CustomFieldGroupValue({this.SortOrder,this.Value}); CustomFieldGroupValue.fromJson(Map json) { fromMap(json); } fromMap(Map json) { SortOrder = json['SortOrder']; Value = json['Value']; return this; } Map toJson() => { 'SortOrder': SortOrder, 'Value': Value }; getTypeName() => "CustomFieldGroupValue"; TypeContext? context = _ctx; } class CustomFieldServices implements IConvertible { int? Id; /** * Name of the service */ // @ApiMember(Description="Name of the service") String? Name; /** * The image url of the service */ // @ApiMember(Description="The image url of the service") Uri? ImageUrl; CustomFieldServices({this.Id,this.Name,this.ImageUrl}); CustomFieldServices.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; Name = json['Name']; ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!); return this; } Map toJson() => { 'Id': Id, 'Name': Name, 'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!) }; getTypeName() => "CustomFieldServices"; TypeContext? context = _ctx; } class CustomFieldLookupResponse implements IConvertible { int? Id; bool? Active; int? SortOrder; String? Value; CustomFieldLookupResponse({this.Id,this.Active,this.SortOrder,this.Value}); CustomFieldLookupResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; Active = json['Active']; SortOrder = json['SortOrder']; Value = json['Value']; return this; } Map toJson() => { 'Id': Id, 'Active': Active, 'SortOrder': SortOrder, 'Value': Value }; getTypeName() => "CustomFieldLookupResponse"; TypeContext? context = _ctx; } class CustomFieldQueryResponse implements IConvertible { /** * Custom field id */ // @ApiMember(Description="Custom field id") int? Id; /** * Reference to company that owns the custom field configuration */ // @ApiMember(Description="Reference to company that owns the custom field configuration") String? CompanyId; /** * Group id */ // @ApiMember(Description="Group id") int? GroupId; /** * Field id */ // @ApiMember(Description="Field id") int? FieldId; /** * Configuration name. Example: 'Number of persons'. */ // @ApiMember(Description="Configuration name. Example: 'Number of persons'.") String? Name; /** * Field width. Example: 20 */ // @ApiMember(Description="Field width. Example: 20") int? Width; /** * Column in database where to store the information. Example: 'TextField1' */ // @ApiMember(Description="Column in database where to store the information. Example: 'TextField1'") String? Column; /** * Custom field description. Example: 'For how many persons is this booking?' */ // @ApiMember(Description="Custom field description. Example: 'For how many persons is this booking?'") String? Description; /** * Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' */ // @ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'") String? DataType; /** * Default value of the field. Example: '3' */ // @ApiMember(Description="Default value of the field. Example: '3'") String? DefaultValue; /** * 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") bool? IsMandatory; /** * 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") String? MandatoryErrorMessage; /** * Max lenght of the field */ // @ApiMember(Description="Max lenght of the field") int? MaxLength; /** * If the field should have multiple lines */ // @ApiMember(Description="If the field should have multiple lines") bool? MultipleLineText; /** * Regular expression used for validation of the field */ // @ApiMember(Description="Regular expression used for validation of the field") String? RegEx; /** * Regular expression id for validation of the field */ // @ApiMember(Description="Regular expression id for validation of the field") int? RegExId; /** * Error message shown if the regular expression validation failed */ // @ApiMember(Description="Error message shown if the regular expression validation failed") String? RegExErrorMessage; /** * If the field is visible to the customer */ // @ApiMember(Description="If the field is visible to the customer") bool? IsPublic; /** * If the field should be hidden in lists */ // @ApiMember(Description="If the field should be hidden in lists") bool? IsHidden; /** * Table to which the field belongs */ // @ApiMember(Description="Table to which the field belongs") String? Table; /** * 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") List? Values; /** * The services that is connected to the custom field */ // @ApiMember(Description="The services that is connected to the custom field") List? Services; CustomFieldQueryResponse({this.Id,this.CompanyId,this.GroupId,this.FieldId,this.Name,this.Width,this.Column,this.Description,this.DataType,this.DefaultValue,this.IsMandatory,this.MandatoryErrorMessage,this.MaxLength,this.MultipleLineText,this.RegEx,this.RegExId,this.RegExErrorMessage,this.IsPublic,this.IsHidden,this.Table,this.Values,this.Services}); CustomFieldQueryResponse.fromJson(Map json) { fromMap(json); } fromMap(Map json) { Id = json['Id']; CompanyId = json['CompanyId']; GroupId = json['GroupId']; FieldId = json['FieldId']; Name = json['Name']; Width = json['Width']; Column = json['Column']; Description = json['Description']; DataType = json['DataType']; DefaultValue = json['DefaultValue']; IsMandatory = json['IsMandatory']; MandatoryErrorMessage = json['MandatoryErrorMessage']; MaxLength = json['MaxLength']; MultipleLineText = json['MultipleLineText']; RegEx = json['RegEx']; RegExId = json['RegExId']; RegExErrorMessage = json['RegExErrorMessage']; IsPublic = json['IsPublic']; IsHidden = json['IsHidden']; Table = json['Table']; Values = JsonConverters.fromJson(json['Values'],'List',context!); Services = JsonConverters.fromJson(json['Services'],'List',context!); return this; } Map toJson() => { 'Id': Id, 'CompanyId': CompanyId, 'GroupId': GroupId, 'FieldId': FieldId, 'Name': Name, 'Width': Width, 'Column': Column, 'Description': Description, 'DataType': DataType, 'DefaultValue': DefaultValue, 'IsMandatory': IsMandatory, 'MandatoryErrorMessage': MandatoryErrorMessage, 'MaxLength': MaxLength, 'MultipleLineText': MultipleLineText, 'RegEx': RegEx, 'RegExId': RegExId, 'RegExErrorMessage': RegExErrorMessage, 'IsPublic': IsPublic, 'IsHidden': IsHidden, 'Table': Table, 'Values': JsonConverters.toJson(Values,'List',context!), 'Services': JsonConverters.toJson(Services,'List',context!) }; getTypeName() => "CustomFieldQueryResponse"; TypeContext? context = _ctx; } // @Route("/customfields", "POST") // @ApiResponse(Description="Returned if there is a validation error on the input parameters", StatusCode=400) // @ApiResponse(Description="Returned if the current user is not allowed to perform the action", StatusCode=401) // @ValidateRequest(Validator="IsAuthenticated") class CreateCustomField implements IReturn, ICompany, IConvertible, IPost { /** * 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.") String? CompanyId; /** * Field id */ // @ApiMember(Description="Field id") int? FieldId; /** * Configuration name. Example: 'Number of persons'. */ // @ApiMember(Description="Configuration name. Example: 'Number of persons'.", IsRequired=true) String? Name; /** * Custom field description. Example: 'For how many persons is this booking?' */ // @ApiMember(Description="Custom field description. Example: 'For how many persons is this booking?'", IsRequired=true) String? Description; /** * Custom field icon id. Example: '1 House,2 Calendar,3 Building,4 Cart,5 Find,6 Blue flag,7 Green flag,8 Information,9 Lightning,10 Page edit,11 Pencil,12 Link,13 Star,14 User,15 Tick,16 Wrench,17 Clock' */ // @ApiMember(Description="Custom field icon id. Example: '1 House,2 Calendar,3 Building,4 Cart,5 Find,6 Blue flag,7 Green flag,8 Information,9 Lightning,10 Page edit,11 Pencil,12 Link,13 Star,14 User,15 Tick,16 Wrench,17 Clock'", IsRequired=true) int? IconId; /** * Field width. Example: 20 */ // @ApiMember(Description="Field width. Example: 20") int? Width; /** * Data field of custom field. Valid values are: TextBox, DropDown Example: 'TextBox' */ // @ApiMember(Description="Data field of custom field. Valid values are: TextBox, DropDown Example: 'TextBox'") String? Datatype; /** * Default value of the field. Example: '3' */ // @ApiMember(Description="Default value of the field. Example: '3'") String? DefaultValue; /** * Determines if the field is required to have a value or not. Default is false */ // @ApiMember(Description="Determines if the field is required to have a value or not. Default is false") bool? IsMandatory; /** * 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") String? MandatoryErrorMessage; /** * Max lenght of the field. Default is 500 */ // @ApiMember(Description="Max lenght of the field. Default is 500", IsRequired=true) int? MaxLength; /** * If the field should have multiple lines. Defualt is false */ // @ApiMember(Description="If the field should have multiple lines. Defualt is false") bool? MultipleLineText; /** * Regular expression used for validation of the field */ // @ApiMember(Description="Regular expression used for validation of the field") int? RegExId; /** * Error message shown if the regular expression validation failed */ // @ApiMember(Description="Error message shown if the regular expression validation failed") String? RegExErrorMessage; /** * If the field is visible to the customer. Default is true */ // @ApiMember(Description="If the field is visible to the customer. Default is true") bool? IsPublic; /** * If the field should be hidden in lists. Default is false */ // @ApiMember(Description="If the field should be hidden in lists. Default is false") bool? IsHidden; /** * 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") List? Values; /** * The services that is connected to the custom field. If null it will be connected to all services. */ // @ApiMember(Description="The services that is connected to the custom field. If null it will be connected to all services.") List? Services; CreateCustomField({this.CompanyId,this.FieldId,this.Name,this.Description,this.IconId,this.Width,this.Datatype,this.DefaultValue,this.IsMandatory,this.MandatoryErrorMessage,this.MaxLength,this.MultipleLineText,this.RegExId,this.RegExErrorMessage,this.IsPublic,this.IsHidden,this.Values,this.Services}); CreateCustomField.fromJson(Map json) { fromMap(json); } fromMap(Map json) { CompanyId = json['CompanyId']; FieldId = json['FieldId']; Name = json['Name']; Description = json['Description']; IconId = json['IconId']; Width = json['Width']; Datatype = json['Datatype']; DefaultValue = json['DefaultValue']; IsMandatory = json['IsMandatory']; MandatoryErrorMessage = json['MandatoryErrorMessage']; MaxLength = json['MaxLength']; MultipleLineText = json['MultipleLineText']; RegExId = json['RegExId']; RegExErrorMessage = json['RegExErrorMessage']; IsPublic = json['IsPublic']; IsHidden = json['IsHidden']; Values = JsonConverters.fromJson(json['Values'],'List',context!); Services = JsonConverters.fromJson(json['Services'],'List',context!); return this; } Map toJson() => { 'CompanyId': CompanyId, 'FieldId': FieldId, 'Name': Name, 'Description': Description, 'IconId': IconId, 'Width': Width, 'Datatype': Datatype, 'DefaultValue': DefaultValue, 'IsMandatory': IsMandatory, 'MandatoryErrorMessage': MandatoryErrorMessage, 'MaxLength': MaxLength, 'MultipleLineText': MultipleLineText, 'RegExId': RegExId, 'RegExErrorMessage': RegExErrorMessage, 'IsPublic': IsPublic, 'IsHidden': IsHidden, 'Values': JsonConverters.toJson(Values,'List',context!), 'Services': JsonConverters.toJson(Services,'List',context!) }; createResponse() => CustomFieldQueryResponse(); getResponseTypeName() => "CustomFieldQueryResponse"; getTypeName() => "CreateCustomField"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: { 'ICompany': TypeInfo(TypeOf.Interface), 'CustomFieldGroupValue': TypeInfo(TypeOf.Class, create:() => CustomFieldGroupValue()), 'CustomFieldServices': TypeInfo(TypeOf.Class, create:() => CustomFieldServices()), 'Uri': TypeInfo(TypeOf.Class, create:() => Uri()), 'CustomFieldLookupResponse': TypeInfo(TypeOf.Class, create:() => CustomFieldLookupResponse()), 'CustomFieldQueryResponse': TypeInfo(TypeOf.Class, create:() => CustomFieldQueryResponse()), 'List': TypeInfo(TypeOf.Class, create:() => []), 'List': TypeInfo(TypeOf.Class, create:() => []), 'CreateCustomField': TypeInfo(TypeOf.Class, create:() => CreateCustomField()), 'List': TypeInfo(TypeOf.Class, create:() => []), });