-
-
Save nukedbit/7d6316f85e1aed2a5f4d2dc95209f76d to your computer and use it in GitHub Desktop.
ServiceStack Codable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Options: | |
Date: 2021-02-21 11:17:42 | |
SwiftVersion: 5.0 | |
Version: 5.105 | |
Tip: To override a DTO option, remove "//" prefix before updating | |
BaseUrl: https://local.servicestack.com:5001 | |
//BaseClass: | |
//AddModelExtensions: True | |
//AddServiceStackTypes: True | |
//IncludeTypes: | |
//ExcludeTypes: | |
//ExcludeGenericBaseTypes: False | |
//AddResponseStatus: False | |
//AddImplicitVersion: | |
//AddDescriptionAsComments: True | |
//InitializeCollections: True | |
//TreatTypesAsStrings: | |
//DefaultImports: Foundation,ServiceStack | |
*/ | |
import Foundation | |
import ServiceStack | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Condition="HasRole('Admin') or HasRole('Contributor')") | |
public class GetAppConfig : IReturn, Codable | |
{ | |
public typealias Return = AppConfigResponse | |
public var key:String? | |
required public init(){} | |
} | |
public class SearchListing : QueryDb<Listing>, IReturn | |
{ | |
public typealias Return = QueryResponse<Listing> | |
public var searchText:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case searchText | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
searchText = try container.decodeIfPresent(String.self, forKey: .searchText) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if searchText != nil { try container.encode(searchText, forKey: .searchText) } | |
} | |
} | |
public class GetLastListings : IReturn, Codable | |
{ | |
public typealias Return = LastListingsResponse | |
public var take:Int? | |
public var offset:Int? | |
required public init(){} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Condition="HasRole('Admin') or HasRole('Contributor')") | |
public class FileUpload : IReturn, IPost, IFileUploadAdditionalMetadata, Codable | |
{ | |
public typealias Return = FileUploadResponse | |
public var folder:String? | |
public var referencedBy:String? | |
// @Validate(Validator="GreaterThan(0)") | |
public var applicationId:Int? | |
public var extraAttribute1:String? | |
public var extraAttribute2:String? | |
public var extraAttribute3:String? | |
public var extraAttribute4:String? | |
required public init(){} | |
} | |
// @Route("/api/files/redirect") | |
public class GoToFileUrl : IGet, Codable | |
{ | |
public var fileId:Int? | |
required public init(){} | |
} | |
public class GetFileUrl : IReturn, IGet, Codable | |
{ | |
public typealias Return = GetFileUrlResponse | |
public var fileId:Int? | |
required public init(){} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
public class GetFileContent : IReturn, Codable | |
{ | |
public typealias Return = GetFileContentResponse | |
public var id:Int? | |
required public init(){} | |
} | |
public class CompareFileHash : IReturn, Codable | |
{ | |
public typealias Return = CompareFileHasResponse | |
public var hash:String? | |
public var fileId:Int? | |
required public init(){} | |
} | |
// @Route("/auth") | |
// @Route("/auth/{provider}") | |
// @DataContract | |
public class Authenticate : IReturn, IPost, Codable | |
{ | |
public typealias Return = AuthenticateResponse | |
// @DataMember(Order=1) | |
public var provider:String? | |
// @DataMember(Order=2) | |
public var state:String? | |
// @DataMember(Order=3) | |
public var oauth_token:String? | |
// @DataMember(Order=4) | |
public var oauth_verifier:String? | |
// @DataMember(Order=5) | |
public var userName:String? | |
// @DataMember(Order=6) | |
public var password:String? | |
// @DataMember(Order=7) | |
public var rememberMe:Bool? | |
// @DataMember(Order=9) | |
public var errorView:String? | |
// @DataMember(Order=10) | |
public var nonce:String? | |
// @DataMember(Order=11) | |
public var uri:String? | |
// @DataMember(Order=12) | |
public var response:String? | |
// @DataMember(Order=13) | |
public var qop:String? | |
// @DataMember(Order=14) | |
public var nc:String? | |
// @DataMember(Order=15) | |
public var cnonce:String? | |
// @DataMember(Order=16) | |
public var useTokenCookie:Bool? | |
// @DataMember(Order=17) | |
public var accessToken:String? | |
// @DataMember(Order=18) | |
public var accessTokenSecret:String? | |
// @DataMember(Order=19) | |
public var scope:String? | |
// @DataMember(Order=20) | |
public var meta:[String:String] = [:] | |
required public init(){} | |
} | |
// @Route("/assignroles") | |
// @DataContract | |
public class AssignRoles : IReturn, IPost, Codable | |
{ | |
public typealias Return = AssignRolesResponse | |
// @DataMember(Order=1) | |
public var userName:String? | |
// @DataMember(Order=2) | |
public var permissions:[String] = [] | |
// @DataMember(Order=3) | |
public var roles:[String] = [] | |
// @DataMember(Order=4) | |
public var meta:[String:String] = [:] | |
required public init(){} | |
} | |
// @Route("/unassignroles") | |
// @DataContract | |
public class UnAssignRoles : IReturn, IPost, Codable | |
{ | |
public typealias Return = UnAssignRolesResponse | |
// @DataMember(Order=1) | |
public var userName:String? | |
// @DataMember(Order=2) | |
public var permissions:[String] = [] | |
// @DataMember(Order=3) | |
public var roles:[String] = [] | |
// @DataMember(Order=4) | |
public var meta:[String:String] = [:] | |
required public init(){} | |
} | |
// @Route("/session-to-token") | |
// @DataContract | |
public class ConvertSessionToToken : IReturn, IPost, Codable | |
{ | |
public typealias Return = ConvertSessionToTokenResponse | |
// @DataMember(Order=1) | |
public var preserveSession:Bool? | |
// @DataMember(Order=2) | |
public var meta:[String:String] = [:] | |
required public init(){} | |
} | |
// @Route("/access-token") | |
// @DataContract | |
public class GetAccessToken : IReturn, IPost, Codable | |
{ | |
public typealias Return = GetAccessTokenResponse | |
// @DataMember(Order=1) | |
public var refreshToken:String? | |
// @DataMember(Order=2) | |
public var useTokenCookie:Bool? | |
// @DataMember(Order=3) | |
public var meta:[String:String] = [:] | |
required public init(){} | |
} | |
// @Route("/register") | |
// @DataContract | |
public class Register : IReturn, IPost, Codable | |
{ | |
public typealias Return = RegisterResponse | |
// @DataMember(Order=1) | |
public var userName:String? | |
// @DataMember(Order=2) | |
public var firstName:String? | |
// @DataMember(Order=3) | |
public var lastName:String? | |
// @DataMember(Order=4) | |
public var displayName:String? | |
// @DataMember(Order=5) | |
public var email:String? | |
// @DataMember(Order=6) | |
public var password:String? | |
// @DataMember(Order=7) | |
public var confirmPassword:String? | |
// @DataMember(Order=8) | |
public var autoLogin:Bool? | |
// @DataMember(Order=10) | |
public var errorView:String? | |
// @DataMember(Order=11) | |
public var meta:[String:String] = [:] | |
required public init(){} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
public class QueryListings : QueryDb<Listing>, IReturn | |
{ | |
public typealias Return = QueryResponse<Listing> | |
public var id:Int? | |
public var ids:[Int] = [] | |
public var nameContains:String? | |
public var city:String? | |
public var cityStartsWith:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case ids | |
case nameContains | |
case city | |
case cityStartsWith | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
ids = try container.decodeIfPresent([Int].self, forKey: .ids) ?? [] | |
nameContains = try container.decodeIfPresent(String.self, forKey: .nameContains) | |
city = try container.decodeIfPresent(String.self, forKey: .city) | |
cityStartsWith = try container.decodeIfPresent(String.self, forKey: .cityStartsWith) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if ids.count > 0 { try container.encode(ids, forKey: .ids) } | |
if nameContains != nil { try container.encode(nameContains, forKey: .nameContains) } | |
if city != nil { try container.encode(city, forKey: .city) } | |
if cityStartsWith != nil { try container.encode(cityStartsWith, forKey: .cityStartsWith) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`ApplicationRead`)") | |
public class QueryApplications : QueryDb<Application>, IReturn | |
{ | |
public typealias Return = QueryResponse<Application> | |
public var id:Int? | |
public var name:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case name | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if name != nil { try container.encode(name, forKey: .name) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`ApplicationRead`)") | |
public class QueryDeletedApplications : QueryDb<Application>, IReturn | |
{ | |
public typealias Return = QueryResponse<Application> | |
public var id:Int? | |
public var name:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case name | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if name != nil { try container.encode(name, forKey: .name) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`ApplicationRead`)") | |
public class QueryAllApplications : QueryDb<Application>, IReturn | |
{ | |
public typealias Return = QueryResponse<Application> | |
public var id:Int? | |
public var name:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case name | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if name != nil { try container.encode(name, forKey: .name) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="IsAdmin") | |
public class QueryAllDevices : QueryDb<Device>, IReturn | |
{ | |
public typealias Return = QueryResponse<Device> | |
public var id:Int? | |
public var deviceId:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case deviceId | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
deviceId = try container.decodeIfPresent(String.self, forKey: .deviceId) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if deviceId != nil { try container.encode(deviceId, forKey: .deviceId) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Condition="HasRole('Admin') or HasRole('Contributor')") | |
public class QueryFiles : QueryDb<File>, IReturn | |
{ | |
public typealias Return = QueryResponse<File> | |
public var ids:[Int] = [] | |
public var extraAttribute1:String? | |
public var extraAttribute2:String? | |
public var extraAttribute3:String? | |
public var extraAttribute4:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case ids | |
case extraAttribute1 | |
case extraAttribute2 | |
case extraAttribute3 | |
case extraAttribute4 | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
ids = try container.decodeIfPresent([Int].self, forKey: .ids) ?? [] | |
extraAttribute1 = try container.decodeIfPresent(String.self, forKey: .extraAttribute1) | |
extraAttribute2 = try container.decodeIfPresent(String.self, forKey: .extraAttribute2) | |
extraAttribute3 = try container.decodeIfPresent(String.self, forKey: .extraAttribute3) | |
extraAttribute4 = try container.decodeIfPresent(String.self, forKey: .extraAttribute4) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if ids.count > 0 { try container.encode(ids, forKey: .ids) } | |
if extraAttribute1 != nil { try container.encode(extraAttribute1, forKey: .extraAttribute1) } | |
if extraAttribute2 != nil { try container.encode(extraAttribute2, forKey: .extraAttribute2) } | |
if extraAttribute3 != nil { try container.encode(extraAttribute3, forKey: .extraAttribute3) } | |
if extraAttribute4 != nil { try container.encode(extraAttribute4, forKey: .extraAttribute4) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Condition="HasRole('Admin') or HasRole('Contributor')") | |
public class QueryDeletedFiles : QueryDb<File>, IReturn | |
{ | |
public typealias Return = QueryResponse<File> | |
public var ids:[Int] = [] | |
public var extraAttribute1:String? | |
public var extraAttribute2:String? | |
public var extraAttribute3:String? | |
public var extraAttribute4:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case ids | |
case extraAttribute1 | |
case extraAttribute2 | |
case extraAttribute3 | |
case extraAttribute4 | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
ids = try container.decodeIfPresent([Int].self, forKey: .ids) ?? [] | |
extraAttribute1 = try container.decodeIfPresent(String.self, forKey: .extraAttribute1) | |
extraAttribute2 = try container.decodeIfPresent(String.self, forKey: .extraAttribute2) | |
extraAttribute3 = try container.decodeIfPresent(String.self, forKey: .extraAttribute3) | |
extraAttribute4 = try container.decodeIfPresent(String.self, forKey: .extraAttribute4) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if ids.count > 0 { try container.encode(ids, forKey: .ids) } | |
if extraAttribute1 != nil { try container.encode(extraAttribute1, forKey: .extraAttribute1) } | |
if extraAttribute2 != nil { try container.encode(extraAttribute2, forKey: .extraAttribute2) } | |
if extraAttribute3 != nil { try container.encode(extraAttribute3, forKey: .extraAttribute3) } | |
if extraAttribute4 != nil { try container.encode(extraAttribute4, forKey: .extraAttribute4) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Condition="HasRole('Admin') or HasRole('Contributor')") | |
public class QueryAllFiles : QueryDb<File>, IReturn | |
{ | |
public typealias Return = QueryResponse<File> | |
public var ids:[Int] = [] | |
public var extraAttribute1:String? | |
public var extraAttribute2:String? | |
public var extraAttribute3:String? | |
public var extraAttribute4:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case ids | |
case extraAttribute1 | |
case extraAttribute2 | |
case extraAttribute3 | |
case extraAttribute4 | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
ids = try container.decodeIfPresent([Int].self, forKey: .ids) ?? [] | |
extraAttribute1 = try container.decodeIfPresent(String.self, forKey: .extraAttribute1) | |
extraAttribute2 = try container.decodeIfPresent(String.self, forKey: .extraAttribute2) | |
extraAttribute3 = try container.decodeIfPresent(String.self, forKey: .extraAttribute3) | |
extraAttribute4 = try container.decodeIfPresent(String.self, forKey: .extraAttribute4) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if ids.count > 0 { try container.encode(ids, forKey: .ids) } | |
if extraAttribute1 != nil { try container.encode(extraAttribute1, forKey: .extraAttribute1) } | |
if extraAttribute2 != nil { try container.encode(extraAttribute2, forKey: .extraAttribute2) } | |
if extraAttribute3 != nil { try container.encode(extraAttribute3, forKey: .extraAttribute3) } | |
if extraAttribute4 != nil { try container.encode(extraAttribute4, forKey: .extraAttribute4) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`LanguageRead`)") | |
public class QueryAllLanguages : QueryDb<Language>, IReturn | |
{ | |
public typealias Return = QueryResponse<Language> | |
public var id:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`LanguageRead`)") | |
public class QueryDeletedLanguages : QueryDb<Language>, IReturn | |
{ | |
public typealias Return = QueryResponse<Language> | |
public var id:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`TaxonomyRead`)") | |
public class QueryTaxonomies : QueryDb<Taxonomy>, IReturn, IGet | |
{ | |
public typealias Return = QueryResponse<Taxonomy> | |
public var id:Int? | |
public var parentId:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case parentId | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
parentId = try container.decodeIfPresent(Int.self, forKey: .parentId) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if parentId != nil { try container.encode(parentId, forKey: .parentId) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`TaxonomyRead`)") | |
public class QueryDeletedTaxonomies : QueryDb<Taxonomy>, IReturn, IGet | |
{ | |
public typealias Return = QueryResponse<Taxonomy> | |
public var id:Int? | |
public var parentId:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case parentId | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
parentId = try container.decodeIfPresent(Int.self, forKey: .parentId) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if parentId != nil { try container.encode(parentId, forKey: .parentId) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`TaxonomyRead`)") | |
public class QueryAllTaxonomies : QueryDb<Taxonomy>, IReturn, IGet | |
{ | |
public typealias Return = QueryResponse<Taxonomy> | |
public var id:Int? | |
public var parentId:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case parentId | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
parentId = try container.decodeIfPresent(Int.self, forKey: .parentId) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if parentId != nil { try container.encode(parentId, forKey: .parentId) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`TranslationRead`)") | |
public class QueryDeletedTranslations : QueryDb<Translation>, IReturn | |
{ | |
public typealias Return = QueryResponse<Translation> | |
public var id:Int? | |
public var key:String? | |
public var languageId:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case key | |
case languageId | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
key = try container.decodeIfPresent(String.self, forKey: .key) | |
languageId = try container.decodeIfPresent(Int.self, forKey: .languageId) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if key != nil { try container.encode(key, forKey: .key) } | |
if languageId != nil { try container.encode(languageId, forKey: .languageId) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`TranslationRead`)") | |
public class QueryAllTranslations : QueryDb<Translation>, IReturn | |
{ | |
public typealias Return = QueryResponse<Translation> | |
public var id:Int? | |
public var key:String? | |
public var languageId:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case key | |
case languageId | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
key = try container.decodeIfPresent(String.self, forKey: .key) | |
languageId = try container.decodeIfPresent(Int.self, forKey: .languageId) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if key != nil { try container.encode(key, forKey: .key) } | |
if languageId != nil { try container.encode(languageId, forKey: .languageId) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Condition="HasRole('Admin') or HasRole('Contributor')") | |
public class CreateListing : CreateAuditBase<Listing, ListingResponse>, IReturn | |
{ | |
public typealias Return = ListingResponse | |
public var name:String? | |
public var fullAddress:String? | |
public var city:String? | |
public var district:String? | |
public var region:String? | |
public var postalCode:String? | |
public var streetNumber:String? | |
public var route:String? | |
public var country:String? | |
public var phone:String? | |
public var mobilePhone:String? | |
public var Description:String? | |
public var email:String? | |
public var webSite:String? | |
public var userId:Int? | |
public var taxonomyId:Int? | |
public var visibility:ListingVisibility? | |
public var addressPosition:GeoPosition? | |
public var listingNotes:[ListingNote] = [] | |
public var mainPictureId:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case name | |
case fullAddress | |
case city | |
case district | |
case region | |
case postalCode | |
case streetNumber | |
case route | |
case country | |
case phone | |
case mobilePhone | |
case Description | |
case email | |
case webSite | |
case userId | |
case taxonomyId | |
case visibility | |
case addressPosition | |
case listingNotes | |
case mainPictureId | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
fullAddress = try container.decodeIfPresent(String.self, forKey: .fullAddress) | |
city = try container.decodeIfPresent(String.self, forKey: .city) | |
district = try container.decodeIfPresent(String.self, forKey: .district) | |
region = try container.decodeIfPresent(String.self, forKey: .region) | |
postalCode = try container.decodeIfPresent(String.self, forKey: .postalCode) | |
streetNumber = try container.decodeIfPresent(String.self, forKey: .streetNumber) | |
route = try container.decodeIfPresent(String.self, forKey: .route) | |
country = try container.decodeIfPresent(String.self, forKey: .country) | |
phone = try container.decodeIfPresent(String.self, forKey: .phone) | |
mobilePhone = try container.decodeIfPresent(String.self, forKey: .mobilePhone) | |
Description = try container.decodeIfPresent(String.self, forKey: .Description) | |
email = try container.decodeIfPresent(String.self, forKey: .email) | |
webSite = try container.decodeIfPresent(String.self, forKey: .webSite) | |
userId = try container.decodeIfPresent(Int.self, forKey: .userId) | |
taxonomyId = try container.decodeIfPresent(Int.self, forKey: .taxonomyId) | |
visibility = try container.decodeIfPresent(ListingVisibility.self, forKey: .visibility) | |
addressPosition = try container.decodeIfPresent(GeoPosition.self, forKey: .addressPosition) | |
listingNotes = try container.decodeIfPresent([ListingNote].self, forKey: .listingNotes) ?? [] | |
mainPictureId = try container.decodeIfPresent(Int.self, forKey: .mainPictureId) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if name != nil { try container.encode(name, forKey: .name) } | |
if fullAddress != nil { try container.encode(fullAddress, forKey: .fullAddress) } | |
if city != nil { try container.encode(city, forKey: .city) } | |
if district != nil { try container.encode(district, forKey: .district) } | |
if region != nil { try container.encode(region, forKey: .region) } | |
if postalCode != nil { try container.encode(postalCode, forKey: .postalCode) } | |
if streetNumber != nil { try container.encode(streetNumber, forKey: .streetNumber) } | |
if route != nil { try container.encode(route, forKey: .route) } | |
if country != nil { try container.encode(country, forKey: .country) } | |
if phone != nil { try container.encode(phone, forKey: .phone) } | |
if mobilePhone != nil { try container.encode(mobilePhone, forKey: .mobilePhone) } | |
if Description != nil { try container.encode(Description, forKey: .Description) } | |
if email != nil { try container.encode(email, forKey: .email) } | |
if webSite != nil { try container.encode(webSite, forKey: .webSite) } | |
if userId != nil { try container.encode(userId, forKey: .userId) } | |
if taxonomyId != nil { try container.encode(taxonomyId, forKey: .taxonomyId) } | |
if visibility != nil { try container.encode(visibility, forKey: .visibility) } | |
if addressPosition != nil { try container.encode(addressPosition, forKey: .addressPosition) } | |
if listingNotes.count > 0 { try container.encode(listingNotes, forKey: .listingNotes) } | |
if mainPictureId != nil { try container.encode(mainPictureId, forKey: .mainPictureId) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Condition="HasRole('Admin') or HasRole('Contributor')") | |
public class DeleteListing : SoftDeleteAuditBase<Listing, ListingResponse>, IReturn | |
{ | |
public typealias Return = ListingResponse | |
public var id:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Condition="HasRole('Admin') or HasRole('Contributor')") | |
public class UpdateListing : UpdateAuditBase<Listing, ListingResponse>, IReturn | |
{ | |
public typealias Return = ListingResponse | |
public var id:Int? | |
public var name:String? | |
public var Description:String? | |
public var fullAddress:String? | |
public var city:String? | |
public var district:String? | |
public var region:String? | |
public var postalCode:String? | |
public var streetNumber:String? | |
public var route:String? | |
public var country:String? | |
public var phone:String? | |
public var mobilePhone:String? | |
public var email:String? | |
public var webSite:String? | |
public var taxonomyId:Int? | |
public var visibility:ListingVisibility? | |
public var addressPosition:GeoPosition? | |
public var listingNotes:[ListingNote] = [] | |
public var mainPictureId:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case name | |
case Description | |
case fullAddress | |
case city | |
case district | |
case region | |
case postalCode | |
case streetNumber | |
case route | |
case country | |
case phone | |
case mobilePhone | |
case email | |
case webSite | |
case taxonomyId | |
case visibility | |
case addressPosition | |
case listingNotes | |
case mainPictureId | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
Description = try container.decodeIfPresent(String.self, forKey: .Description) | |
fullAddress = try container.decodeIfPresent(String.self, forKey: .fullAddress) | |
city = try container.decodeIfPresent(String.self, forKey: .city) | |
district = try container.decodeIfPresent(String.self, forKey: .district) | |
region = try container.decodeIfPresent(String.self, forKey: .region) | |
postalCode = try container.decodeIfPresent(String.self, forKey: .postalCode) | |
streetNumber = try container.decodeIfPresent(String.self, forKey: .streetNumber) | |
route = try container.decodeIfPresent(String.self, forKey: .route) | |
country = try container.decodeIfPresent(String.self, forKey: .country) | |
phone = try container.decodeIfPresent(String.self, forKey: .phone) | |
mobilePhone = try container.decodeIfPresent(String.self, forKey: .mobilePhone) | |
email = try container.decodeIfPresent(String.self, forKey: .email) | |
webSite = try container.decodeIfPresent(String.self, forKey: .webSite) | |
taxonomyId = try container.decodeIfPresent(Int.self, forKey: .taxonomyId) | |
visibility = try container.decodeIfPresent(ListingVisibility.self, forKey: .visibility) | |
addressPosition = try container.decodeIfPresent(GeoPosition.self, forKey: .addressPosition) | |
listingNotes = try container.decodeIfPresent([ListingNote].self, forKey: .listingNotes) ?? [] | |
mainPictureId = try container.decodeIfPresent(Int.self, forKey: .mainPictureId) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if name != nil { try container.encode(name, forKey: .name) } | |
if Description != nil { try container.encode(Description, forKey: .Description) } | |
if fullAddress != nil { try container.encode(fullAddress, forKey: .fullAddress) } | |
if city != nil { try container.encode(city, forKey: .city) } | |
if district != nil { try container.encode(district, forKey: .district) } | |
if region != nil { try container.encode(region, forKey: .region) } | |
if postalCode != nil { try container.encode(postalCode, forKey: .postalCode) } | |
if streetNumber != nil { try container.encode(streetNumber, forKey: .streetNumber) } | |
if route != nil { try container.encode(route, forKey: .route) } | |
if country != nil { try container.encode(country, forKey: .country) } | |
if phone != nil { try container.encode(phone, forKey: .phone) } | |
if mobilePhone != nil { try container.encode(mobilePhone, forKey: .mobilePhone) } | |
if email != nil { try container.encode(email, forKey: .email) } | |
if webSite != nil { try container.encode(webSite, forKey: .webSite) } | |
if taxonomyId != nil { try container.encode(taxonomyId, forKey: .taxonomyId) } | |
if visibility != nil { try container.encode(visibility, forKey: .visibility) } | |
if addressPosition != nil { try container.encode(addressPosition, forKey: .addressPosition) } | |
if listingNotes.count > 0 { try container.encode(listingNotes, forKey: .listingNotes) } | |
if mainPictureId != nil { try container.encode(mainPictureId, forKey: .mainPictureId) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`ApplicationCreate`)") | |
public class CreateApplication : CreateAuditBase<Application, ApplicationResponse>, IReturn | |
{ | |
public typealias Return = ApplicationResponse | |
// @Validate(Validator="NotEmpty") | |
public var name:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case name | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if name != nil { try container.encode(name, forKey: .name) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
public class CreateMissingTranslation : CreateAuditBase<Translation, TranslationResponse>, IReturn | |
{ | |
public typealias Return = TranslationResponse | |
// @Validate(Validator="GreaterThan(0)") | |
public var applicationId:Int? | |
// @Validate(Validator="NotEmpty") | |
public var key:String? | |
// @Validate(Validator="GreaterThan(0)") | |
public var languageId:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case applicationId | |
case key | |
case languageId | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
applicationId = try container.decodeIfPresent(Int.self, forKey: .applicationId) | |
key = try container.decodeIfPresent(String.self, forKey: .key) | |
languageId = try container.decodeIfPresent(Int.self, forKey: .languageId) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if applicationId != nil { try container.encode(applicationId, forKey: .applicationId) } | |
if key != nil { try container.encode(key, forKey: .key) } | |
if languageId != nil { try container.encode(languageId, forKey: .languageId) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`TaxonomyCreate`)") | |
public class CreateTaxonomy : CreateAuditBase<Taxonomy, TaxonomyResponse>, IReturn | |
{ | |
public typealias Return = TaxonomyResponse | |
// @Validate(Validator="NotEmpty") | |
public var name:String? | |
public var Description:String? | |
// @Validate(Validator="GreaterThan(0)") | |
public var applicationId:Int? | |
// @Validate(Validator="GreaterThan(0)") | |
public var parentId:Int? | |
public var meta:[String:String] = [:] | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case name | |
case Description | |
case applicationId | |
case parentId | |
case meta | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
Description = try container.decodeIfPresent(String.self, forKey: .Description) | |
applicationId = try container.decodeIfPresent(Int.self, forKey: .applicationId) | |
parentId = try container.decodeIfPresent(Int.self, forKey: .parentId) | |
meta = try container.decodeIfPresent([String:String].self, forKey: .meta) ?? [:] | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if name != nil { try container.encode(name, forKey: .name) } | |
if Description != nil { try container.encode(Description, forKey: .Description) } | |
if applicationId != nil { try container.encode(applicationId, forKey: .applicationId) } | |
if parentId != nil { try container.encode(parentId, forKey: .parentId) } | |
if meta.count > 0 { try container.encode(meta, forKey: .meta) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`ApplicationDelete`)") | |
public class DeleteApplication : SoftDeleteAuditBase<Application, ApplicationResponse>, IReturn | |
{ | |
public typealias Return = ApplicationResponse | |
// @Validate(Validator="GreaterThan(0)") | |
public var id:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`TaxonomyDelete`)") | |
public class DeleteTaxonomy : SoftDeleteAuditBase<Taxonomy, TaxonomyResponse>, IReturn | |
{ | |
public typealias Return = TaxonomyResponse | |
// @Validate(Validator="GreaterThan(0)") | |
public var id:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`ApplicationUpdate`)") | |
public class RestoreApplication : RemoveSoftDeleteAuditBase<Application, ApplicationResponse>, IReturn | |
{ | |
public typealias Return = ApplicationResponse | |
// @Validate(Validator="GreaterThan(0)") | |
public var id:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`LanguageUpdate`)") | |
public class RestoreLanguage : RemoveSoftDeleteAuditBase<Language, LanguageResponse>, IReturn | |
{ | |
public typealias Return = LanguageResponse | |
// @Validate(Validator="GreaterThan(0)") | |
public var id:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`TaxonomyUpdate`)") | |
public class RestoreTaxonomy : RemoveSoftDeleteAuditBase<Taxonomy, TaxonomyResponse>, IReturn | |
{ | |
public typealias Return = TaxonomyResponse | |
// @Validate(Validator="GreaterThan(0)") | |
public var id:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`TranslationUpdate`)") | |
public class RestoreTranslation : RemoveSoftDeleteAuditBase<Translation, TranslationResponse>, IReturn | |
{ | |
public typealias Return = TranslationResponse | |
// @Validate(Validator="GreaterThan(0)") | |
public var id:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`ApplicationUpdate`)") | |
public class UpdateApplication : UpdateAuditBase<Application, ApplicationResponse>, IReturn | |
{ | |
public typealias Return = ApplicationResponse | |
// @Validate(Validator="GreaterThan(0)") | |
public var id:Int? | |
// @Validate(Validator="NotEmpty") | |
public var name:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case name | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if name != nil { try container.encode(name, forKey: .name) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Condition="HasRole('Admin') or HasRole('Contributor')") | |
public class UpdateFile : UpdateAuditBase<File, FileUploadResponse>, IReturn, IPut | |
{ | |
public typealias Return = FileUploadResponse | |
public var id:Int? | |
public var fileName:String? | |
public var contentType:String? | |
public var fileHash:String? | |
public var referencedBy:String? | |
public var extraAttribute1:String? | |
public var extraAttribute2:String? | |
public var extraAttribute3:String? | |
public var extraAttribute4:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case fileName | |
case contentType | |
case fileHash | |
case referencedBy | |
case extraAttribute1 | |
case extraAttribute2 | |
case extraAttribute3 | |
case extraAttribute4 | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
fileName = try container.decodeIfPresent(String.self, forKey: .fileName) | |
contentType = try container.decodeIfPresent(String.self, forKey: .contentType) | |
fileHash = try container.decodeIfPresent(String.self, forKey: .fileHash) | |
referencedBy = try container.decodeIfPresent(String.self, forKey: .referencedBy) | |
extraAttribute1 = try container.decodeIfPresent(String.self, forKey: .extraAttribute1) | |
extraAttribute2 = try container.decodeIfPresent(String.self, forKey: .extraAttribute2) | |
extraAttribute3 = try container.decodeIfPresent(String.self, forKey: .extraAttribute3) | |
extraAttribute4 = try container.decodeIfPresent(String.self, forKey: .extraAttribute4) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if fileName != nil { try container.encode(fileName, forKey: .fileName) } | |
if contentType != nil { try container.encode(contentType, forKey: .contentType) } | |
if fileHash != nil { try container.encode(fileHash, forKey: .fileHash) } | |
if referencedBy != nil { try container.encode(referencedBy, forKey: .referencedBy) } | |
if extraAttribute1 != nil { try container.encode(extraAttribute1, forKey: .extraAttribute1) } | |
if extraAttribute2 != nil { try container.encode(extraAttribute2, forKey: .extraAttribute2) } | |
if extraAttribute3 != nil { try container.encode(extraAttribute3, forKey: .extraAttribute3) } | |
if extraAttribute4 != nil { try container.encode(extraAttribute4, forKey: .extraAttribute4) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Condition="HasRole('Admin') or HasRole('Contributor')") | |
public class UpdateFileReferencedBy : UpdateAuditBase<File, FileUploadResponse>, IReturn, IPut | |
{ | |
public typealias Return = FileUploadResponse | |
public var id:Int? | |
public var referencedBy:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case referencedBy | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
referencedBy = try container.decodeIfPresent(String.self, forKey: .referencedBy) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if referencedBy != nil { try container.encode(referencedBy, forKey: .referencedBy) } | |
} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
// @ValidateRequest(Validator="HasPermission(`TaxonomyUpdate`)") | |
public class UpdateTaxonomy : UpdateAuditBase<Taxonomy, TaxonomyResponse>, IReturn | |
{ | |
public typealias Return = TaxonomyResponse | |
// @Validate(Validator="GreaterThan(0)") | |
public var id:Int? | |
// @Validate(Validator="NotEmpty") | |
public var name:String? | |
public var Description:String? | |
// @Validate(Validator="GreaterThan(0)") | |
public var applicationId:Int? | |
// @Validate(Validator="GreaterThan(0)") | |
public var parentId:Int? | |
public var meta:[String:String] = [:] | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case name | |
case Description | |
case applicationId | |
case parentId | |
case meta | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
Description = try container.decodeIfPresent(String.self, forKey: .Description) | |
applicationId = try container.decodeIfPresent(Int.self, forKey: .applicationId) | |
parentId = try container.decodeIfPresent(Int.self, forKey: .parentId) | |
meta = try container.decodeIfPresent([String:String].self, forKey: .meta) ?? [:] | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if name != nil { try container.encode(name, forKey: .name) } | |
if Description != nil { try container.encode(Description, forKey: .Description) } | |
if applicationId != nil { try container.encode(applicationId, forKey: .applicationId) } | |
if parentId != nil { try container.encode(parentId, forKey: .parentId) } | |
if meta.count > 0 { try container.encode(meta, forKey: .meta) } | |
} | |
} | |
public class AppConfigResponse : Codable | |
{ | |
public var value:String? | |
public var responseStatus:ResponseStatus? | |
required public init(){} | |
} | |
// @DataContract | |
public class QueryResponse<T : Codable> : Codable | |
{ | |
// @DataMember(Order=1) | |
public var offset:Int? | |
// @DataMember(Order=2) | |
public var total:Int? | |
// @DataMember(Order=3) | |
public var results:[T] = [] | |
// @DataMember(Order=4) | |
public var meta:[String:String] = [:] | |
// @DataMember(Order=5) | |
public var responseStatus:ResponseStatus? | |
required public init(){} | |
} | |
public class LastListingsResponse : Codable | |
{ | |
public var total:Int? | |
public var offset:Int? | |
public var listings:[LatestListingDto] = [] | |
public var responseStatus:ResponseStatus? | |
required public init(){} | |
} | |
public class FileUploadResponse : Codable | |
{ | |
public var ids:[Int] = [] | |
public var results:[File] = [] | |
public var responseStatus:ResponseStatus? | |
required public init(){} | |
} | |
public class GetFileUrlResponse : Codable | |
{ | |
public var url:String? | |
required public init(){} | |
} | |
public class GetFileContentResponse : Codable | |
{ | |
public var content:[Int8] = [] | |
public var contentType:String? | |
required public init(){} | |
} | |
public class CompareFileHasResponse : Codable | |
{ | |
public var areEqual:Bool? | |
public var responseStatus:ResponseStatus? | |
required public init(){} | |
} | |
// @DataContract | |
public class AuthenticateResponse : IHasSessionId, IHasBearerToken, Codable | |
{ | |
// @DataMember(Order=1) | |
public var userId:String? | |
// @DataMember(Order=2) | |
public var sessionId:String? | |
// @DataMember(Order=3) | |
public var userName:String? | |
// @DataMember(Order=4) | |
public var displayName:String? | |
// @DataMember(Order=5) | |
public var referrerUrl:String? | |
// @DataMember(Order=6) | |
public var bearerToken:String? | |
// @DataMember(Order=7) | |
public var refreshToken:String? | |
// @DataMember(Order=8) | |
public var profileUrl:String? | |
// @DataMember(Order=9) | |
public var roles:[String] = [] | |
// @DataMember(Order=10) | |
public var permissions:[String] = [] | |
// @DataMember(Order=11) | |
public var responseStatus:ResponseStatus? | |
// @DataMember(Order=12) | |
public var meta:[String:String] = [:] | |
required public init(){} | |
} | |
// @DataContract | |
public class AssignRolesResponse : Codable | |
{ | |
// @DataMember(Order=1) | |
public var allRoles:[String] = [] | |
// @DataMember(Order=2) | |
public var allPermissions:[String] = [] | |
// @DataMember(Order=3) | |
public var meta:[String:String] = [:] | |
// @DataMember(Order=4) | |
public var responseStatus:ResponseStatus? | |
required public init(){} | |
} | |
// @DataContract | |
public class UnAssignRolesResponse : Codable | |
{ | |
// @DataMember(Order=1) | |
public var allRoles:[String] = [] | |
// @DataMember(Order=2) | |
public var allPermissions:[String] = [] | |
// @DataMember(Order=3) | |
public var meta:[String:String] = [:] | |
// @DataMember(Order=4) | |
public var responseStatus:ResponseStatus? | |
required public init(){} | |
} | |
// @DataContract | |
public class ConvertSessionToTokenResponse : Codable | |
{ | |
// @DataMember(Order=1) | |
public var meta:[String:String] = [:] | |
// @DataMember(Order=2) | |
public var accessToken:String? | |
// @DataMember(Order=3) | |
public var refreshToken:String? | |
// @DataMember(Order=4) | |
public var responseStatus:ResponseStatus? | |
required public init(){} | |
} | |
// @DataContract | |
public class GetAccessTokenResponse : Codable | |
{ | |
// @DataMember(Order=1) | |
public var accessToken:String? | |
// @DataMember(Order=2) | |
public var meta:[String:String] = [:] | |
// @DataMember(Order=3) | |
public var responseStatus:ResponseStatus? | |
required public init(){} | |
} | |
// @DataContract | |
public class RegisterResponse : Codable | |
{ | |
// @DataMember(Order=1) | |
public var userId:String? | |
// @DataMember(Order=2) | |
public var sessionId:String? | |
// @DataMember(Order=3) | |
public var userName:String? | |
// @DataMember(Order=4) | |
public var referrerUrl:String? | |
// @DataMember(Order=5) | |
public var bearerToken:String? | |
// @DataMember(Order=6) | |
public var refreshToken:String? | |
// @DataMember(Order=7) | |
public var responseStatus:ResponseStatus? | |
// @DataMember(Order=8) | |
public var meta:[String:String] = [:] | |
required public init(){} | |
} | |
public class ListingResponse : Codable | |
{ | |
public var responseStatus:ResponseStatus? | |
public var result:Listing? | |
required public init(){} | |
} | |
public class ApplicationResponse : Codable | |
{ | |
public var id:Int? | |
public var result:Application? | |
required public init(){} | |
} | |
public class TranslationResponse : Codable | |
{ | |
public var id:Int? | |
public var result:Translation? | |
public var responseStatus:ResponseStatus? | |
required public init(){} | |
} | |
public class TaxonomyResponse : Codable | |
{ | |
public var id:Int? | |
public var result:Taxonomy? | |
public var responseStatus:ResponseStatus? | |
required public init(){} | |
} | |
public class LanguageResponse : Codable | |
{ | |
public var id:Int? | |
public var result:Language? | |
public var responseStatus:ResponseStatus? | |
required public init(){} | |
} | |
public class QueryDb<T : Codable> : QueryBase | |
{ | |
required public init(){ super.init() } | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
} | |
} | |
public class Listing : AuditBase | |
{ | |
public var id:Int? | |
// @Required() | |
public var name:String? | |
public var fullAddress:String? | |
public var addressPosition:GeoPosition? | |
public var city:String? | |
public var district:String? | |
public var region:String? | |
public var postalCode:String? | |
public var streetNumber:String? | |
public var route:String? | |
public var country:String? | |
public var phone:String? | |
public var mobilePhone:String? | |
public var email:String? | |
public var webSite:String? | |
public var userId:Int? | |
public var taxonomyId:Int? | |
// @References(typeof(File)) | |
public var mainPictureId:Int? | |
public var mainPicture:File? | |
public var taxonomy:Taxonomy? | |
public var listingNotes:[ListingNote] = [] | |
public var visibility:ListingVisibility? | |
public var Description:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case name | |
case fullAddress | |
case addressPosition | |
case city | |
case district | |
case region | |
case postalCode | |
case streetNumber | |
case route | |
case country | |
case phone | |
case mobilePhone | |
case email | |
case webSite | |
case userId | |
case taxonomyId | |
case mainPictureId | |
case mainPicture | |
case taxonomy | |
case listingNotes | |
case visibility | |
case Description | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
fullAddress = try container.decodeIfPresent(String.self, forKey: .fullAddress) | |
addressPosition = try container.decodeIfPresent(GeoPosition.self, forKey: .addressPosition) | |
city = try container.decodeIfPresent(String.self, forKey: .city) | |
district = try container.decodeIfPresent(String.self, forKey: .district) | |
region = try container.decodeIfPresent(String.self, forKey: .region) | |
postalCode = try container.decodeIfPresent(String.self, forKey: .postalCode) | |
streetNumber = try container.decodeIfPresent(String.self, forKey: .streetNumber) | |
route = try container.decodeIfPresent(String.self, forKey: .route) | |
country = try container.decodeIfPresent(String.self, forKey: .country) | |
phone = try container.decodeIfPresent(String.self, forKey: .phone) | |
mobilePhone = try container.decodeIfPresent(String.self, forKey: .mobilePhone) | |
email = try container.decodeIfPresent(String.self, forKey: .email) | |
webSite = try container.decodeIfPresent(String.self, forKey: .webSite) | |
userId = try container.decodeIfPresent(Int.self, forKey: .userId) | |
taxonomyId = try container.decodeIfPresent(Int.self, forKey: .taxonomyId) | |
mainPictureId = try container.decodeIfPresent(Int.self, forKey: .mainPictureId) | |
mainPicture = try container.decodeIfPresent(File.self, forKey: .mainPicture) | |
taxonomy = try container.decodeIfPresent(Taxonomy.self, forKey: .taxonomy) | |
listingNotes = try container.decodeIfPresent([ListingNote].self, forKey: .listingNotes) ?? [] | |
visibility = try container.decodeIfPresent(ListingVisibility.self, forKey: .visibility) | |
Description = try container.decodeIfPresent(String.self, forKey: .Description) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if name != nil { try container.encode(name, forKey: .name) } | |
if fullAddress != nil { try container.encode(fullAddress, forKey: .fullAddress) } | |
if addressPosition != nil { try container.encode(addressPosition, forKey: .addressPosition) } | |
if city != nil { try container.encode(city, forKey: .city) } | |
if district != nil { try container.encode(district, forKey: .district) } | |
if region != nil { try container.encode(region, forKey: .region) } | |
if postalCode != nil { try container.encode(postalCode, forKey: .postalCode) } | |
if streetNumber != nil { try container.encode(streetNumber, forKey: .streetNumber) } | |
if route != nil { try container.encode(route, forKey: .route) } | |
if country != nil { try container.encode(country, forKey: .country) } | |
if phone != nil { try container.encode(phone, forKey: .phone) } | |
if mobilePhone != nil { try container.encode(mobilePhone, forKey: .mobilePhone) } | |
if email != nil { try container.encode(email, forKey: .email) } | |
if webSite != nil { try container.encode(webSite, forKey: .webSite) } | |
if userId != nil { try container.encode(userId, forKey: .userId) } | |
if taxonomyId != nil { try container.encode(taxonomyId, forKey: .taxonomyId) } | |
if mainPictureId != nil { try container.encode(mainPictureId, forKey: .mainPictureId) } | |
if mainPicture != nil { try container.encode(mainPicture, forKey: .mainPicture) } | |
if taxonomy != nil { try container.encode(taxonomy, forKey: .taxonomy) } | |
if listingNotes.count > 0 { try container.encode(listingNotes, forKey: .listingNotes) } | |
if visibility != nil { try container.encode(visibility, forKey: .visibility) } | |
if Description != nil { try container.encode(Description, forKey: .Description) } | |
} | |
} | |
public class LatestListingDto : Codable | |
{ | |
public var id:Int? | |
public var name:String? | |
public var categoryName:String? | |
public var fullAddress:String? | |
public var pictureUrl:String? | |
required public init(){} | |
} | |
public protocol IFileUploadAdditionalMetadata | |
{ | |
var folder:String? { get set } | |
var referencedBy:String? { get set } | |
var applicationId:Int? { get set } | |
var extraAttribute1:String? { get set } | |
var extraAttribute2:String? { get set } | |
var extraAttribute3:String? { get set } | |
var extraAttribute4:String? { get set } | |
} | |
public class File : AuditBase | |
{ | |
public var id:Int? | |
public var fileName:String? | |
public var contentType:String? | |
public var fileHash:String? | |
public var referencedBy:String? | |
public var applicationId:Int? | |
public var extraAttribute1:String? | |
public var extraAttribute2:String? | |
public var extraAttribute3:String? | |
public var extraAttribute4:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case fileName | |
case contentType | |
case fileHash | |
case referencedBy | |
case applicationId | |
case extraAttribute1 | |
case extraAttribute2 | |
case extraAttribute3 | |
case extraAttribute4 | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
fileName = try container.decodeIfPresent(String.self, forKey: .fileName) | |
contentType = try container.decodeIfPresent(String.self, forKey: .contentType) | |
fileHash = try container.decodeIfPresent(String.self, forKey: .fileHash) | |
referencedBy = try container.decodeIfPresent(String.self, forKey: .referencedBy) | |
applicationId = try container.decodeIfPresent(Int.self, forKey: .applicationId) | |
extraAttribute1 = try container.decodeIfPresent(String.self, forKey: .extraAttribute1) | |
extraAttribute2 = try container.decodeIfPresent(String.self, forKey: .extraAttribute2) | |
extraAttribute3 = try container.decodeIfPresent(String.self, forKey: .extraAttribute3) | |
extraAttribute4 = try container.decodeIfPresent(String.self, forKey: .extraAttribute4) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if fileName != nil { try container.encode(fileName, forKey: .fileName) } | |
if contentType != nil { try container.encode(contentType, forKey: .contentType) } | |
if fileHash != nil { try container.encode(fileHash, forKey: .fileHash) } | |
if referencedBy != nil { try container.encode(referencedBy, forKey: .referencedBy) } | |
if applicationId != nil { try container.encode(applicationId, forKey: .applicationId) } | |
if extraAttribute1 != nil { try container.encode(extraAttribute1, forKey: .extraAttribute1) } | |
if extraAttribute2 != nil { try container.encode(extraAttribute2, forKey: .extraAttribute2) } | |
if extraAttribute3 != nil { try container.encode(extraAttribute3, forKey: .extraAttribute3) } | |
if extraAttribute4 != nil { try container.encode(extraAttribute4, forKey: .extraAttribute4) } | |
} | |
} | |
public class Application : AuditBase | |
{ | |
public var id:Int? | |
public var name:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case name | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if name != nil { try container.encode(name, forKey: .name) } | |
} | |
} | |
public class Device : AuditBase | |
{ | |
public var id:Int? | |
// @StringLength(100) | |
public var Description:String? | |
// @StringLength(100) | |
public var deviceId:String? | |
public var userAuthId:String? | |
public var lastActiveDate:Date? | |
public var lastActiveBy:String? | |
public var meta:[String:String] = [:] | |
// @References(typeof(DeviceKind)) | |
public var deviceKindId:Int? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case Description | |
case deviceId | |
case userAuthId | |
case lastActiveDate | |
case lastActiveBy | |
case meta | |
case deviceKindId | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
Description = try container.decodeIfPresent(String.self, forKey: .Description) | |
deviceId = try container.decodeIfPresent(String.self, forKey: .deviceId) | |
userAuthId = try container.decodeIfPresent(String.self, forKey: .userAuthId) | |
lastActiveDate = try container.decodeIfPresent(Date.self, forKey: .lastActiveDate) | |
lastActiveBy = try container.decodeIfPresent(String.self, forKey: .lastActiveBy) | |
meta = try container.decodeIfPresent([String:String].self, forKey: .meta) ?? [:] | |
deviceKindId = try container.decodeIfPresent(Int.self, forKey: .deviceKindId) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if Description != nil { try container.encode(Description, forKey: .Description) } | |
if deviceId != nil { try container.encode(deviceId, forKey: .deviceId) } | |
if userAuthId != nil { try container.encode(userAuthId, forKey: .userAuthId) } | |
if lastActiveDate != nil { try container.encode(lastActiveDate, forKey: .lastActiveDate) } | |
if lastActiveBy != nil { try container.encode(lastActiveBy, forKey: .lastActiveBy) } | |
if meta.count > 0 { try container.encode(meta, forKey: .meta) } | |
if deviceKindId != nil { try container.encode(deviceKindId, forKey: .deviceKindId) } | |
} | |
} | |
public class Language : AuditBase | |
{ | |
public var id:Int? | |
public var name:String? | |
public var isDefault:Bool? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case name | |
case isDefault | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
isDefault = try container.decodeIfPresent(Bool.self, forKey: .isDefault) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if name != nil { try container.encode(name, forKey: .name) } | |
if isDefault != nil { try container.encode(isDefault, forKey: .isDefault) } | |
} | |
} | |
public class Taxonomy : AuditBase | |
{ | |
public var id:Int? | |
public var application:Application? | |
public var applicationId:Int? | |
public var name:String? | |
public var slug:String? | |
public var Description:String? | |
public var parentId:Int? | |
public var meta:[String:String] = [:] | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case application | |
case applicationId | |
case name | |
case slug | |
case Description | |
case parentId | |
case meta | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
application = try container.decodeIfPresent(Application.self, forKey: .application) | |
applicationId = try container.decodeIfPresent(Int.self, forKey: .applicationId) | |
name = try container.decodeIfPresent(String.self, forKey: .name) | |
slug = try container.decodeIfPresent(String.self, forKey: .slug) | |
Description = try container.decodeIfPresent(String.self, forKey: .Description) | |
parentId = try container.decodeIfPresent(Int.self, forKey: .parentId) | |
meta = try container.decodeIfPresent([String:String].self, forKey: .meta) ?? [:] | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if application != nil { try container.encode(application, forKey: .application) } | |
if applicationId != nil { try container.encode(applicationId, forKey: .applicationId) } | |
if name != nil { try container.encode(name, forKey: .name) } | |
if slug != nil { try container.encode(slug, forKey: .slug) } | |
if Description != nil { try container.encode(Description, forKey: .Description) } | |
if parentId != nil { try container.encode(parentId, forKey: .parentId) } | |
if meta.count > 0 { try container.encode(meta, forKey: .meta) } | |
} | |
} | |
public class Translation : AuditBase | |
{ | |
public var id:Int? | |
public var application:Application? | |
public var applicationId:Int? | |
public var key:String? | |
public var language:Language? | |
public var languageId:Int? | |
public var value:String? | |
required public init(){ super.init() } | |
private enum CodingKeys : String, CodingKey { | |
case id | |
case application | |
case applicationId | |
case key | |
case language | |
case languageId | |
case value | |
} | |
required public init(from decoder: Decoder) throws { | |
try super.init(from: decoder) | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
id = try container.decodeIfPresent(Int.self, forKey: .id) | |
application = try container.decodeIfPresent(Application.self, forKey: .application) | |
applicationId = try container.decodeIfPresent(Int.self, forKey: .applicationId) | |
key = try container.decodeIfPresent(String.self, forKey: .key) | |
language = try container.decodeIfPresent(Language.self, forKey: .language) | |
languageId = try container.decodeIfPresent(Int.self, forKey: .languageId) | |
value = try container.decodeIfPresent(String.self, forKey: .value) | |
} | |
public override func encode(to encoder: Encoder) throws { | |
try super.encode(to: encoder) | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
if id != nil { try container.encode(id, forKey: .id) } | |
if application != nil { try container.encode(application, forKey: .application) } | |
if applicationId != nil { try container.encode(applicationId, forKey: .applicationId) } | |
if key != nil { try container.encode(key, forKey: .key) } | |
if language != nil { try container.encode(language, forKey: .language) } | |
if languageId != nil { try container.encode(languageId, forKey: .languageId) } | |
if value != nil { try container.encode(value, forKey: .value) } | |
} | |
} | |
public enum ListingVisibility : Int, Codable | |
{ | |
case Club = 0 | |
case Public = 1 | |
case Hidden = 2 | |
} | |
public class GeoPosition : Codable | |
{ | |
public var lng:Double? | |
public var lat:Double? | |
required public init(){} | |
} | |
public class ListingNote : Codable | |
{ | |
public var id:String? | |
public var index:Int? | |
public var name:String? | |
public var content:String? | |
required public init(){} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
public class CreateAuditBase<Table : Codable, TResponse : Codable> : Codable | |
{ | |
required public init(){} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
public class SoftDeleteAuditBase<Table : Codable, TResponse : Codable> : Codable | |
{ | |
required public init(){} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
public class UpdateAuditBase<Table : Codable, TResponse : Codable> : Codable | |
{ | |
required public init(){} | |
} | |
// @ValidateRequest(Validator="IsAuthenticated") | |
public class RemoveSoftDeleteAuditBase<Table : Codable, TResponse : Codable> : Codable | |
{ | |
required public init(){} | |
} | |
// @DataContract | |
public class QueryBase : Codable | |
{ | |
// @DataMember(Order=1) | |
public var skip:Int? | |
// @DataMember(Order=2) | |
public var take:Int? | |
// @DataMember(Order=3) | |
public var orderBy:String? | |
// @DataMember(Order=4) | |
public var orderByDesc:String? | |
// @DataMember(Order=5) | |
public var include:String? | |
// @DataMember(Order=6) | |
public var fields:String? | |
// @DataMember(Order=7) | |
public var meta:[String:String] = [:] | |
required public init(){} | |
} | |
// @DataContract | |
public class AuditBase : Codable | |
{ | |
// @DataMember(Order=1) | |
public var createdDate:Date? | |
// @DataMember(Order=2) | |
// @Required() | |
public var createdBy:String? | |
// @DataMember(Order=3) | |
public var modifiedDate:Date? | |
// @DataMember(Order=4) | |
// @Required() | |
public var modifiedBy:String? | |
// @DataMember(Order=5) | |
public var deletedDate:Date? | |
// @DataMember(Order=6) | |
public var deletedBy:String? | |
required public init(){} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment