/* Options:
Date: 2026-04-16 09:28:42
SwiftVersion: 6.0
Version: 8.53
Tip: To override a DTO option, remove "//" prefix before updating
BaseUrl: https://chinook.netcore.io

//BaseClass: 
//AddModelExtensions: True
//AddServiceStackTypes: True
//MakePropertiesOptional: True
//IncludeTypes: 
//ExcludeTypes: 
//ExcludeGenericBaseTypes: False
//AddResponseStatus: False
//AddImplicitVersion: 
//AddDescriptionAsComments: True
//InitializeCollections: False
//TreatTypesAsStrings: 
//DefaultImports: Foundation,ServiceStack
*/

import Foundation
import ServiceStack

// @Route("/hello")
// @Route("/hello/{Name}")
public class Hello : IReturn, Codable
{
    public typealias Return = HelloResponse

    public var name:String?

    required public init(){}
}

// @Route("/albums", "GET")
// @Route("/albums/{AlbumId}", "GET")
public class QueryAlbums : QueryDb<Albums>, IReturn, IGet
{
    public typealias Return = QueryResponse<Albums>

    public var albumId:Int?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case albumId
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        albumId = try container.decodeIfPresent(Int.self, forKey: .albumId)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if albumId != nil { try container.encode(albumId, forKey: .albumId) }
    }
}

// @Route("/artists", "GET")
// @Route("/artists/{ArtistId}", "GET")
public class QueryArtists : QueryDb<Artists>, IReturn, IGet
{
    public typealias Return = QueryResponse<Artists>

    public var artistId:Int?
    public var artistIdBetween:[Int]?
    public var nameStartsWith:String?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case artistId
        case artistIdBetween
        case nameStartsWith
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        artistId = try container.decodeIfPresent(Int.self, forKey: .artistId)
        artistIdBetween = try container.decodeIfPresent([Int].self, forKey: .artistIdBetween) ?? []
        nameStartsWith = try container.decodeIfPresent(String.self, forKey: .nameStartsWith)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if artistId != nil { try container.encode(artistId, forKey: .artistId) }
        if artistIdBetween != nil { try container.encode(artistIdBetween, forKey: .artistIdBetween) }
        if nameStartsWith != nil { try container.encode(nameStartsWith, forKey: .nameStartsWith) }
    }
}

// @Route("/genres", "GET")
// @Route("/genres/{GenreId}", "GET")
public class QueryGenres : QueryDb<Genres>, IReturn, IGet
{
    public typealias Return = QueryResponse<Genres>

    public var genreId:Int?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case genreId
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        genreId = try container.decodeIfPresent(Int.self, forKey: .genreId)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if genreId != nil { try container.encode(genreId, forKey: .genreId) }
    }
}

// @Route("/mediatypes", "GET")
// @Route("/mediatypes/{MediaTypeId}", "GET")
public class QueryMediaTypes : QueryDb<MediaTypes>, IReturn, IGet
{
    public typealias Return = QueryResponse<MediaTypes>

    public var mediaTypeId:Int?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case mediaTypeId
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        mediaTypeId = try container.decodeIfPresent(Int.self, forKey: .mediaTypeId)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if mediaTypeId != nil { try container.encode(mediaTypeId, forKey: .mediaTypeId) }
    }
}

// @Route("/playlists", "GET")
// @Route("/playlists/{PlaylistId}", "GET")
public class QueryPlaylists : QueryDb<Playlists>, IReturn, IGet
{
    public typealias Return = QueryResponse<Playlists>

    public var playlistId:Int?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case playlistId
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        playlistId = try container.decodeIfPresent(Int.self, forKey: .playlistId)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if playlistId != nil { try container.encode(playlistId, forKey: .playlistId) }
    }
}

// @Route("/tracks", "GET")
// @Route("/tracks/{TrackId}", "GET")
public class QueryTracks : QueryDb<Tracks>, IReturn, IGet
{
    public typealias Return = QueryResponse<Tracks>

    public var trackId:Int?
    public var nameContains:String?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case trackId
        case nameContains
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        trackId = try container.decodeIfPresent(Int.self, forKey: .trackId)
        nameContains = try container.decodeIfPresent(String.self, forKey: .nameContains)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if trackId != nil { try container.encode(trackId, forKey: .trackId) }
        if nameContains != nil { try container.encode(nameContains, forKey: .nameContains) }
    }
}

// @Route("/customers", "GET")
// @Route("/customers/{CustomerId}", "GET")
public class QueryCustomers : QueryDb<Customers>, IReturn, IGet
{
    public typealias Return = QueryResponse<Customers>

    public var customerId:Int?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case customerId
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        customerId = try container.decodeIfPresent(Int.self, forKey: .customerId)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if customerId != nil { try container.encode(customerId, forKey: .customerId) }
    }
}

// @Route("/employees", "GET")
// @Route("/employees/{EmployeeId}", "GET")
public class QueryEmployees : QueryDb<Employees>, IReturn, IGet
{
    public typealias Return = QueryResponse<Employees>

    public var employeeId:Int?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case employeeId
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        employeeId = try container.decodeIfPresent(Int.self, forKey: .employeeId)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if employeeId != nil { try container.encode(employeeId, forKey: .employeeId) }
    }
}

// @Route("/invoiceitems", "GET")
// @Route("/invoiceitems/{InvoiceLineId}", "GET")
public class QueryInvoiceItems : QueryDb<InvoiceItems>, IReturn, IGet
{
    public typealias Return = QueryResponse<InvoiceItems>

    public var invoiceLineId:Int?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case invoiceLineId
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        invoiceLineId = try container.decodeIfPresent(Int.self, forKey: .invoiceLineId)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if invoiceLineId != nil { try container.encode(invoiceLineId, forKey: .invoiceLineId) }
    }
}

// @Route("/invoices", "GET")
// @Route("/invoices/{InvoiceId}", "GET")
public class QueryInvoices : QueryDb<Invoices>, IReturn, IGet
{
    public typealias Return = QueryResponse<Invoices>

    public var invoiceId:Int?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case invoiceId
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        invoiceId = try container.decodeIfPresent(Int.self, forKey: .invoiceId)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if invoiceId != nil { try container.encode(invoiceId, forKey: .invoiceId) }
    }
}

// @Route("/albums", "POST")
public class CreateAlbums : IReturn, IPost, Codable
{
    public typealias Return = IdResponse

    // @Validate(Validator="NotEmpty")
    public var title:String?

    // @Validate(Validator="GreaterThan(0)")
    public var artistId:Int?

    required public init(){}
}

// @Route("/artists", "POST")
public class CreateArtists : IReturn, IPost, Codable
{
    public typealias Return = IdResponse

    public var name:String?

    required public init(){}
}

// @Route("/genres", "POST")
public class CreateGenres : IReturn, IPost, Codable
{
    public typealias Return = IdResponse

    public var name:String?

    required public init(){}
}

// @Route("/mediatypes", "POST")
public class CreateMediaTypes : IReturn, IPost, Codable
{
    public typealias Return = IdResponse

    public var name:String?

    required public init(){}
}

// @Route("/playlists", "POST")
public class CreatePlaylists : IReturn, IPost, Codable
{
    public typealias Return = IdResponse

    public var name:String?

    required public init(){}
}

// @Route("/tracks", "POST")
public class CreateTracks : IReturn, IPost, Codable
{
    public typealias Return = IdResponse

    public var name:String?
    public var albumId:Int?
    public var mediaTypeId:Int?
    public var genreId:Int?
    public var composer:String?
    public var milliseconds:Int?
    public var bytes:Int?
    public var unitPrice:Double?

    required public init(){}
}

// @Route("/albums/{AlbumId}", "DELETE")
public class DeleteAlbums : IReturn, IDelete, Codable
{
    public typealias Return = IdResponse

    public var albumId:Int?

    required public init(){}
}

// @Route("/artists/{ArtistId}", "DELETE")
public class DeleteArtists : IReturn, IDelete, Codable
{
    public typealias Return = IdResponse

    public var artistId:Int?

    required public init(){}
}

// @Route("/genres/{GenreId}", "DELETE")
public class DeleteGenres : IReturn, IDelete, Codable
{
    public typealias Return = IdResponse

    public var genreId:Int?

    required public init(){}
}

// @Route("/mediatypes/{MediaTypeId}", "DELETE")
public class DeleteMediaTypes : IReturn, IDelete, Codable
{
    public typealias Return = IdResponse

    public var mediaTypeId:Int?

    required public init(){}
}

// @Route("/playlists/{PlaylistId}", "DELETE")
public class DeletePlaylists : IReturn, IDelete, Codable
{
    public typealias Return = IdResponse

    public var playlistId:Int?

    required public init(){}
}

// @Route("/tracks/{TrackId}", "DELETE")
public class DeleteTracks : IReturn, IDelete, Codable
{
    public typealias Return = IdResponse

    public var trackId:Int?

    required public init(){}
}

// @Route("/albums/{AlbumId}", "PATCH")
public class PatchAlbums : IReturn, IPatch, Codable
{
    public typealias Return = IdResponse

    public var albumId:Int?
    public var title:String?
    public var artistId:Int?

    required public init(){}
}

// @Route("/artists/{ArtistId}", "PATCH")
public class PatchArtists : IReturn, IPatch, Codable
{
    public typealias Return = IdResponse

    public var artistId:Int?
    public var name:String?

    required public init(){}
}

// @Route("/genres/{GenreId}", "PATCH")
public class PatchGenres : IReturn, IPatch, Codable
{
    public typealias Return = IdResponse

    public var genreId:Int?
    public var name:String?

    required public init(){}
}

// @Route("/mediatypes/{MediaTypeId}", "PATCH")
public class PatchMediaTypes : IReturn, IPatch, Codable
{
    public typealias Return = IdResponse

    public var mediaTypeId:Int?
    public var name:String?

    required public init(){}
}

// @Route("/playlists/{PlaylistId}", "PATCH")
public class PatchPlaylists : IReturn, IPatch, Codable
{
    public typealias Return = IdResponse

    public var playlistId:Int?
    public var name:String?

    required public init(){}
}

// @Route("/tracks/{TrackId}", "PATCH")
public class PatchTracks : IReturn, IPatch, Codable
{
    public typealias Return = IdResponse

    public var trackId:Int?
    public var name:String?
    public var albumId:Int?
    public var mediaTypeId:Int?
    public var genreId:Int?
    public var composer:String?
    public var milliseconds:Int?
    public var bytes:Int?
    public var unitPrice:Double?

    required public init(){}
}

// @Route("/albums/{AlbumId}", "PUT")
public class UpdateAlbums : IReturn, IPut, Codable
{
    public typealias Return = IdResponse

    public var albumId:Int?
    public var title:String?
    public var artistId:Int?

    required public init(){}
}

// @Route("/artists/{ArtistId}", "PUT")
public class UpdateArtists : IReturn, IPut, Codable
{
    public typealias Return = IdResponse

    public var artistId:Int?
    public var name:String?

    required public init(){}
}

// @Route("/genres/{GenreId}", "PUT")
public class UpdateGenres : IReturn, IPut, Codable
{
    public typealias Return = IdResponse

    public var genreId:Int?
    public var name:String?

    required public init(){}
}

// @Route("/mediatypes/{MediaTypeId}", "PUT")
public class UpdateMediaTypes : IReturn, IPut, Codable
{
    public typealias Return = IdResponse

    public var mediaTypeId:Int?
    public var name:String?

    required public init(){}
}

// @Route("/playlists/{PlaylistId}", "PUT")
public class UpdatePlaylists : IReturn, IPut, Codable
{
    public typealias Return = IdResponse

    public var playlistId:Int?
    public var name:String?

    required public init(){}
}

// @Route("/tracks/{TrackId}", "PUT")
public class UpdateTracks : IReturn, IPut, Codable
{
    public typealias Return = IdResponse

    public var trackId:Int?
    public var name:String?
    public var albumId:Int?
    public var mediaTypeId:Int?
    public var genreId:Int?
    public var composer:String?
    public var milliseconds:Int?
    public var bytes:Int?
    public var unitPrice:Double?

    required public init(){}
}

// @Route("/customers", "POST")
public class CreateCustomers : IReturn, IPost, Codable
{
    public typealias Return = IdResponse

    public var firstName:String?
    public var lastName:String?
    public var company:String?
    public var address:String?
    public var city:String?
    public var state:String?
    public var country:String?
    public var postalCode:String?
    public var phone:String?
    public var fax:String?
    public var email:String?
    public var supportRepId:Int?

    required public init(){}
}

// @Route("/employees", "POST")
public class CreateEmployees : IReturn, IPost, Codable
{
    public typealias Return = IdResponse

    public var lastName:String?
    public var firstName:String?
    public var title:String?
    public var reportsTo:Int?
    public var birthDate:Date?
    public var hireDate:Date?
    public var address:String?
    public var city:String?
    public var state:String?
    public var country:String?
    public var postalCode:String?
    public var phone:String?
    public var fax:String?
    public var email:String?

    required public init(){}
}

// @Route("/invoiceitems", "POST")
public class CreateInvoiceItems : IReturn, IPost, Codable
{
    public typealias Return = IdResponse

    public var invoiceId:Int?
    public var trackId:Int?
    public var unitPrice:Double?
    public var quantity:Int?

    required public init(){}
}

// @Route("/invoices", "POST")
public class CreateInvoices : IReturn, IPost, Codable
{
    public typealias Return = IdResponse

    public var customerId:Int?
    public var invoiceDate:Date?
    public var billingAddress:String?
    public var billingCity:String?
    public var billingState:String?
    public var billingCountry:String?
    public var billingPostalCode:String?
    public var total:Double?

    required public init(){}
}

// @Route("/customers/{CustomerId}", "DELETE")
public class DeleteCustomers : IReturn, IDelete, Codable
{
    public typealias Return = IdResponse

    public var customerId:Int?

    required public init(){}
}

// @Route("/employees/{EmployeeId}", "DELETE")
public class DeleteEmployees : IReturn, IDelete, Codable
{
    public typealias Return = IdResponse

    public var employeeId:Int?

    required public init(){}
}

// @Route("/invoiceitems/{InvoiceLineId}", "DELETE")
public class DeleteInvoiceItems : IReturn, IDelete, Codable
{
    public typealias Return = IdResponse

    public var invoiceLineId:Int?

    required public init(){}
}

// @Route("/invoices/{InvoiceId}", "DELETE")
public class DeleteInvoices : IReturn, IDelete, Codable
{
    public typealias Return = IdResponse

    public var invoiceId:Int?

    required public init(){}
}

// @Route("/customers/{CustomerId}", "PATCH")
public class PatchCustomers : IReturn, IPatch, Codable
{
    public typealias Return = IdResponse

    public var customerId:Int?
    public var firstName:String?
    public var lastName:String?
    public var company:String?
    public var address:String?
    public var city:String?
    public var state:String?
    public var country:String?
    public var postalCode:String?
    public var phone:String?
    public var fax:String?
    public var email:String?
    public var supportRepId:Int?

    required public init(){}
}

// @Route("/employees/{EmployeeId}", "PATCH")
public class PatchEmployees : IReturn, IPatch, Codable
{
    public typealias Return = IdResponse

    public var employeeId:Int?
    public var lastName:String?
    public var firstName:String?
    public var title:String?
    public var reportsTo:Int?
    public var birthDate:Date?
    public var hireDate:Date?
    public var address:String?
    public var city:String?
    public var state:String?
    public var country:String?
    public var postalCode:String?
    public var phone:String?
    public var fax:String?
    public var email:String?

    required public init(){}
}

// @Route("/invoiceitems/{InvoiceLineId}", "PATCH")
public class PatchInvoiceItems : IReturn, IPatch, Codable
{
    public typealias Return = IdResponse

    public var invoiceLineId:Int?
    public var invoiceId:Int?
    public var trackId:Int?
    public var unitPrice:Double?
    public var quantity:Int?

    required public init(){}
}

// @Route("/invoices/{InvoiceId}", "PATCH")
public class PatchInvoices : IReturn, IPatch, Codable
{
    public typealias Return = IdResponse

    public var invoiceId:Int?
    public var customerId:Int?
    public var invoiceDate:Date?
    public var billingAddress:String?
    public var billingCity:String?
    public var billingState:String?
    public var billingCountry:String?
    public var billingPostalCode:String?
    public var total:Double?

    required public init(){}
}

// @Route("/customers/{CustomerId}", "PUT")
public class UpdateCustomers : IReturn, IPut, Codable
{
    public typealias Return = IdResponse

    public var customerId:Int?
    public var firstName:String?
    public var lastName:String?
    public var company:String?
    public var address:String?
    public var city:String?
    public var state:String?
    public var country:String?
    public var postalCode:String?
    public var phone:String?
    public var fax:String?
    public var email:String?
    public var supportRepId:Int?

    required public init(){}
}

// @Route("/employees/{EmployeeId}", "PUT")
public class UpdateEmployees : IReturn, IPut, Codable
{
    public typealias Return = IdResponse

    public var employeeId:Int?
    public var lastName:String?
    public var firstName:String?
    public var title:String?
    public var reportsTo:Int?
    public var birthDate:Date?
    public var hireDate:Date?
    public var address:String?
    public var city:String?
    public var state:String?
    public var country:String?
    public var postalCode:String?
    public var phone:String?
    public var fax:String?
    public var email:String?

    required public init(){}
}

// @Route("/invoiceitems/{InvoiceLineId}", "PUT")
public class UpdateInvoiceItems : IReturn, IPut, Codable
{
    public typealias Return = IdResponse

    public var invoiceLineId:Int?
    public var invoiceId:Int?
    public var trackId:Int?
    public var unitPrice:Double?
    public var quantity:Int?

    required public init(){}
}

// @Route("/invoices/{InvoiceId}", "PUT")
public class UpdateInvoices : IReturn, IPut, Codable
{
    public typealias Return = IdResponse

    public var invoiceId:Int?
    public var customerId:Int?
    public var invoiceDate:Date?
    public var billingAddress:String?
    public var billingCity:String?
    public var billingState:String?
    public var billingCountry:String?
    public var billingPostalCode:String?
    public var total:Double?

    required public init(){}
}

public class HelloResponse : Codable
{
    public var result:String?

    required public init(){}
}

// @DataContract
public class IdResponse : Codable
{
    // @DataMember(Order=1)
    public var id:String?

    // @DataMember(Order=2)
    public var responseStatus:ResponseStatus?

    required public init(){}
}

public class Albums : Codable
{
    public var albumId:Int?
    // @Required()
    public var title:String?

    public var artistId:Int?

    required public init(){}
}

public class Artists : Codable
{
    public var artistId:Int?
    public var name:String?

    required public init(){}
}

public class Genres : Codable
{
    public var genreId:Int?
    public var name:String?

    required public init(){}
}

public class MediaTypes : Codable
{
    public var mediaTypeId:Int?
    public var name:String?

    required public init(){}
}

public class Playlists : Codable
{
    public var playlistId:Int?
    public var name:String?

    required public init(){}
}

public class Tracks : Codable
{
    public var trackId:Int?
    // @Required()
    public var name:String?

    // @References(typeof(Albums))
    public var albumId:Int?

    // @References(typeof(MediaTypes))
    public var mediaTypeId:Int?

    // @References(typeof(Genres))
    public var genreId:Int?

    public var composer:String?
    public var milliseconds:Int?
    public var bytes:Int?
    public var unitPrice:Double?
    public var album:Albums?
    public var mediaType:MediaTypes?
    public var genre:Genres?

    required public init(){}
}

public class Customers : Codable
{
    public var customerId:Int?
    // @Computed()
    public var displayName:String?

    // @Required()
    public var firstName:String?

    // @Required()
    public var lastName:String?

    public var supportRepId:Int?
    public var company:String?
    public var address:String?
    public var city:String?
    public var state:String?
    public var country:String?
    public var postalCode:String?
    public var phone:String?
    public var fax:String?
    // @Required()
    public var email:String?

    required public init(){}
}

public class Employees : Codable
{
    public var employeeId:Int?
    // @Required()
    public var lastName:String?

    // @Required()
    public var firstName:String?

    public var title:String?
    public var reportsTo:Int?
    public var birthDate:Date?
    public var hireDate:Date?
    public var address:String?
    public var city:String?
    public var state:String?
    public var country:String?
    public var postalCode:String?
    public var phone:String?
    public var fax:String?
    public var email:String?

    required public init(){}
}

public class InvoiceItems : Codable
{
    public var invoiceLineId:Int?
    public var invoiceId:Int?
    public var trackId:Int?
    public var unitPrice:Double?
    public var quantity:Int?

    required public init(){}
}

public class Invoices : Codable
{
    public var invoiceId:Int?
    public var customerId:Int?
    public var invoiceDate:Date?
    public var total:Double?
    public var billingAddress:String?
    public var billingCity:String?
    public var billingState:String?
    public var billingCountry:String?
    public var billingPostalCode:String?

    required public init(){}
}


