xtool.git
Publicgit clone https://git.maproj.org/xtool.gitxtool.git / Sources / XKit / GrandSlam / Requests / Concrete / GrandSlamAppTokensRequest.swift
GrandSlamAppTokensRequest.swift39 lines · 825 BRaw
| 1 | // |
| 2 | // GrandSlamAppTokensRequest.swift |
| 3 | // XKit |
| 4 | // |
| 5 | // Created by Kabir Oberai on 20/11/19. |
| 6 | // Copyright © 2019 Kabir Oberai. All rights reserved. |
| 7 | // |
| 8 | |
| 9 | import Foundation |
| 10 | |
| 11 | struct GrandSlamAppTokensRequest: GrandSlamOperationRequest { |
| 12 | |
| 13 | typealias Decoder = GrandSlamOperationDecoder<Value> |
| 14 | struct Value: Decodable { |
| 15 | let encryptedToken: Data |
| 16 | |
| 17 | private enum CodingKeys: String, CodingKey { |
| 18 | case encryptedToken = "et" |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | static let operation = "apptokens" |
| 23 | |
| 24 | let username: String |
| 25 | let apps: [AppTokenKey] |
| 26 | let cookie: Data |
| 27 | let idmsToken: String |
| 28 | let checksum: Data |
| 29 | |
| 30 | var parameters: [String: Any] { |
| 31 | [ |
| 32 | "app": apps.map { $0.rawValue }, |
| 33 | "c": cookie, |
| 34 | "t": idmsToken, |
| 35 | "checksum": checksum |
| 36 | ] |
| 37 | } |
| 38 | |
| 39 | } |