xtool.git
Publicgit clone https://git.maproj.org/xtool.gitxtool.git / Sources / XKit / DeveloperServices / Teams / DeveloperServicesTeam.swift
DeveloperServicesTeam.swift37 lines · 969 BRaw
| 1 | // |
| 2 | // DeveloperServicesTeam.swift |
| 3 | // Supercharge |
| 4 | // |
| 5 | // Created by Kabir Oberai on 29/07/19. |
| 6 | // Copyright © 2019 Kabir Oberai. All rights reserved. |
| 7 | // |
| 8 | |
| 9 | import Foundation |
| 10 | |
| 11 | public struct DeveloperServicesTeam: Decodable, Sendable { |
| 12 | public struct ID: RawRepresentable, Decodable, Sendable, Hashable { |
| 13 | public let rawValue: String |
| 14 | public init(rawValue: String) { self.rawValue = rawValue } |
| 15 | } |
| 16 | |
| 17 | public let id: ID |
| 18 | public let status: String |
| 19 | public let name: String |
| 20 | |
| 21 | public struct Membership: Decodable, Sendable { |
| 22 | public let name: String |
| 23 | public let platform: DeveloperServicesPlatform |
| 24 | } |
| 25 | public let memberships: [Membership] |
| 26 | |
| 27 | public var isFree: Bool { |
| 28 | !memberships.contains { $0.platform == .iOS && $0.name.contains("Apple Developer Program") } |
| 29 | } |
| 30 | |
| 31 | private enum CodingKeys: String, CodingKey { |
| 32 | case id = "teamId" |
| 33 | case status |
| 34 | case name |
| 35 | case memberships |
| 36 | } |
| 37 | } |