Skip to content

Commit

Permalink
Make models public
Browse files Browse the repository at this point in the history
  • Loading branch information
SMillerDev committed Jan 19, 2024
1 parent 5261122 commit 845f413
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 83 deletions.
82 changes: 0 additions & 82 deletions Sources/PentabarfKit/Models.swift

This file was deleted.

27 changes: 27 additions & 0 deletions Sources/PentabarfKit/Models/Conference.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// Models.swift
//
//
// Created by Sean Molenaar on 07/01/2024.
//

import Foundation

public struct Conference {
static let elementname: String = "conference"

public let title: String
public let subtitle: String?

public let venue: String
public let city: String

public let start: Date
public let end: Date

public let dayChange: String
public let timeslotDuration: TimeInterval

public var tracks: [Track] = []
public var days: [ConferenceDay] = []
}
17 changes: 17 additions & 0 deletions Sources/PentabarfKit/Models/ConferenceDay.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// Models.swift
//
//
// Created by Sean Molenaar on 07/01/2024.
//

import Foundation

public struct ConferenceDay {
static let elementname: String = "day"

public let index: Int
public let date: Date
public let rooms: [Room]

}
26 changes: 26 additions & 0 deletions Sources/PentabarfKit/Models/Event.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// Models.swift
//
//
// Created by Sean Molenaar on 07/01/2024.
//

import Foundation

public struct Event {
public let id: Int
public let start: Date
public let duration: TimeInterval
public let room: String
public let slug: String
public let title: String
public let subtitle: String?
public let track: String
public let type: String
public let language: Locale
public let abstract: String
public let description: String
public let authors: [Person]
public let attachments: [Attachment]
public let links: [Link]
}
13 changes: 13 additions & 0 deletions Sources/PentabarfKit/Models/Person.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Models.swift
//
//
// Created by Sean Molenaar on 07/01/2024.
//

import Foundation

public struct Person {
public let id: Int
public let name: String
}
19 changes: 19 additions & 0 deletions Sources/PentabarfKit/Models/References.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Models.swift
//
//
// Created by Sean Molenaar on 07/01/2024.
//

import Foundation

public struct Attachment {
public let title: String
public let url: URL
public let type: String
}

public struct Link {
public let title: String
public let url: URL
}
13 changes: 13 additions & 0 deletions Sources/PentabarfKit/Models/Room.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Models.swift
//
//
// Created by Sean Molenaar on 07/01/2024.
//

import Foundation

public struct Room {
public let name: String
public let events: [Event]
}
15 changes: 15 additions & 0 deletions Sources/PentabarfKit/Models/Track.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Models.swift
//
//
// Created by Sean Molenaar on 07/01/2024.
//

import Foundation

public struct Track {
static let elementname: String = "tracks"

public let name: String
public let metadata: [String: Any]
}
2 changes: 1 addition & 1 deletion Sources/PentabarfKit/PentabarfKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

class PentabarfKit {
static func loadConference(_ url: URL) async throws -> Conference? {
public static func loadConference(_ url: URL) async throws -> Conference? {
print("📲 Getting schedule: \(url)")
let urlRequest = URLRequest(url: url)
let (data, response) = try await URLSession.shared.data(for: urlRequest)
Expand Down

0 comments on commit 845f413

Please sign in to comment.