TurnServer.swift 787 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  3. // SPDX-License-Identifier: GPL-3.0-or-later
  4. //
  5. import Foundation
  6. @objcMembers public class TurnServer: NSObject {
  7. public var urls: [String]?
  8. public var username: String?
  9. public var credential: String?
  10. init(dictionary: [String: Any]) {
  11. super.init()
  12. if let turnUrl = dictionary["url"] as? String {
  13. urls = [turnUrl]
  14. } else if let turnUrls = dictionary["urls"] as? [String] {
  15. urls = turnUrls
  16. }
  17. if let turnUsername = dictionary["username"] as? String {
  18. username = turnUsername
  19. }
  20. if let turnCredential = dictionary["credential"] as? String {
  21. credential = turnCredential
  22. }
  23. }
  24. }