2017-07-02 02:22:19 +02:00
|
|
|
//
|
|
|
|
// Attachment.swift
|
|
|
|
// DataModel
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 7/1/17.
|
|
|
|
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
public struct Attachment: Equatable {
|
|
|
|
|
2017-07-08 02:49:16 +02:00
|
|
|
public let url: String
|
2017-07-02 02:22:19 +02:00
|
|
|
public let mimeType: String?
|
|
|
|
public let title: String?
|
|
|
|
public let sizeInBytes: Int?
|
|
|
|
public let durationInSeconds: Int?
|
|
|
|
|
2017-07-12 22:25:10 +02:00
|
|
|
public init(url: String, mimeType: String?, title: String?, sizeInBytes: Int?, durationInSeconds: Int?) {
|
2017-07-02 02:22:19 +02:00
|
|
|
|
|
|
|
self.url = url
|
|
|
|
self.mimeType = mimeType
|
|
|
|
self.title = title
|
|
|
|
self.sizeInBytes = sizeInBytes
|
|
|
|
self.durationInSeconds = durationInSeconds
|
|
|
|
}
|
|
|
|
|
2017-07-03 19:29:44 +02:00
|
|
|
public static func ==(lhs: Attachment, rhs: Attachment) -> Bool {
|
2017-07-02 02:22:19 +02:00
|
|
|
|
2017-07-03 19:29:44 +02:00
|
|
|
return lhs.sizeInBytes == rhs.sizeInBytes && lhs.url == rhs.url && lhs.mimeType == rhs.mimeType && lhs.title == rhs.title && lhs.durationInSeconds == rhs.durationInSeconds
|
2017-07-02 02:22:19 +02:00
|
|
|
}
|
|
|
|
}
|