/* Options: Date: 2024-11-21 12:01:21 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: CustomerQuery.* //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="/customers", Verbs="GET") @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401) @ValidateRequest(Validator="IsAuthenticated") open class CustomerQuery : QueryDb(), IReturn> { /** * Enter the company and id you want to see the information for a customer, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown */ @ApiMember(Description="Enter the company and id you want to see the information for a customer, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown ", IsRequired=true, ParameterType="query") var CompanyId:UUID? = null /** * Enter the customer id you want to see the information for a customer. Only admins are allowed to see all customers on their company, users can only see their own customer info. */ @ApiMember(Description="Enter the customer id you want to see the information for a customer. Only admins are allowed to see all customers on their company, users can only see their own customer info.", ParameterType="query") var CustomerId:UUID? = null /** * Enter the user id you want to see the information for a customer. Only admins are allowed to see all customers on their company, users can only see their own customer info. User Id is the userprofile */ @ApiMember(Description="Enter the user id you want to see the information for a customer. Only admins are allowed to see all customers on their company, users can only see their own customer info. User Id is the userprofile", ParameterType="query") var UserId:UUID? = null /** * Will search by any customer name,phone or email that contains the searchstring provided. */ @ApiMember(Description="Will search by any customer name,phone or email that contains the searchstring provided.", ParameterType="query") var Search:String? = null /** * If you want to filter on visible customers. */ @ApiMember(Description="If you want to filter on visible customers.", ParameterType="query") var Visible:Boolean? = null /** * If you want to include the connected custom fields */ @ApiMember(DataType="boolean", Description="If you want to include the connected custom fields", ParameterType="query") var IncludeCustomFieldValues:Boolean? = null /** * If you want to include the connected custom fields */ @ApiMember(DataType="boolean", Description="If you want to include the connected custom fields", ParameterType="query") var IncludeCustomFields:Boolean? = null /** * If you want to include the comments on the customer */ @ApiMember(DataType="boolean", Description="If you want to include the comments on the customer", ParameterType="query") var IncludeComments:Boolean? = null /** * If you want to include the accesskeys */ @ApiMember(Description="If you want to include the accesskeys") var IncludeAccessKeys:Boolean? = null /** * If you want to include invoice address */ @ApiMember(Description="If you want to include invoice address") var IncludeInvoiceAddress:Boolean? = null companion object { private val responseType = object : TypeToken>(){}.type } override fun getResponseType(): Any? = CustomerQuery.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 class Customer : BaseModel(), IUser, ICustomFieldTable { var IdentityId:Int? = null var Id:UUID? = null @Ignore() var CustomerId:UUID? = null @Ignore() var AccessKeys:IList? = null var Email:String? = null @Ignore() var ExternalReferences:IList? = null @Ignore() var Company:Company? = null @Ignore() var CustomFieldsConfig:IList? = null @Ignore() var CustomFieldsData:IList? = null @Ignore() var Comments:IList? = null @Ignore() var RebateCodes:IList? = null var Firstname:String? = null @Ignore() var ImageUrl:String? = null @Required() var Active:Boolean? = null var FacebookUsername:String? = null @Required() var Updated:Date? = null @Required() var Created:Date? = null var IpAddress:String? = null var ModifiedDate:Date? = null var TextField1:String? = null var TextField2:String? = null var TextField3:String? = null var TextField4:String? = null var TextField5:String? = null var TextField6:String? = null var TextField7:String? = null var TextField8:String? = null var TextField9:String? = null var TextField10:String? = null var TextField11:String? = null var TextField12:String? = null var TextField13:String? = null var TextField14:String? = null var TextField15:String? = null var TextField16:String? = null var TextField17:String? = null var TextField18:String? = null var TextField19:String? = null var TextField20:String? = null var UserId:UUID? = null var Lastname:String? = null var Phone:String? = null var CorporateIdentityNumber:String? = null var InvoiceAddress1:String? = null var InvoiceAddress2:String? = null var InvoiceCity:String? = null var InvoicePostalCode:String? = null var InvoiceCountryCode:String? = null @Required() var CompanyId:UUID? = null var SubscribedToNewsletter:Boolean? = null } open class InvoiceAddress { var CorporateIdentityNumber:String? = null var InvoiceAddress1:String? = null var InvoiceAddress2:String? = null var InvoiceCity:String? = null var InvoicePostalCode:String? = null var InvoiceCountryCode:String? = null } open class CustomFieldConfigData { /** * Custom field id */ @ApiMember(Description="Custom field id") var Id:Int? = null /** * Configuration name. Example: 'Number of persons'. */ @ApiMember(Description="Configuration name. Example: 'Number of persons'.") var Name: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 /** * Field width. Example: 20 for 20px */ @ApiMember(Description="Field width. Example: 20 for 20px") var Width:Int? = 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 /** * Error message shown if the regular expression validation failed */ @ApiMember(Description="Error message shown if the regular expression validation failed") var RegExErrorMessage: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() } open class CustomFieldDataResponse { var Id:Int? = null var Column:String? = null var Name:String? = null var Description:String? = null var Value: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 } open class UserAccessKeys : BaseModel() { @Required() var CompanyId:UUID? = null @Required() var AccessKeyTypeId:Int? = null @Required() var Value:String? = null @Required() var CustomerId:UUID? = null var Description:String? = null @Required() var Id:UUID? = 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 CustomFieldValueResponse { var Value:String? = null } open class Customer { var City:String? = null var CountryCode:String? = null var IdentityNumber:String? = null var Email:String? = null var FirstName:String? = null var LastName:String? = null var Phone:String? = null var PostalCode:String? = null var Street:String? = null var Reference:String? = null var Type:CustomerType? = null } open class CustomerQueryResponse { var Id:UUID? = null var Firstname:String? = null var Lastname:String? = null var Email:String? = null var Phone:String? = null var ImageUrl:String? = null var CustomFields:ArrayList = ArrayList() var CustomFieldValues:ArrayList = ArrayList() var Comments:ArrayList = ArrayList() var AccessKeys:ArrayList = ArrayList() var Updated:Date? = null var Created:Date? = null var ResponseStatus:Object? = null var SubscribedToNewsletter:Boolean? = null var InvoiceAddress:InvoiceAddress? = null } open class CustomerCommentsResponse { var Id:Int? = null var CustomerId:UUID? = null var Comments:String? = null var Updated:Date? = null var Created:Date? = null var ImageUrl:Uri? = null }