-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from omarzl/task/regenerate-profile
[Feature] Automatic profile regeneration
- Loading branch information
Showing
23 changed files
with
734 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// GetProfilesResponse.swift | ||
// Models | ||
// | ||
// Created by Omar Zuniga on 29/05/24. | ||
// | ||
|
||
import Foundation | ||
|
||
internal struct GetProfilesResponse: Codable { | ||
var data: [ProfileResponseData] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// CreateProfileResponse.swift | ||
// Models | ||
// | ||
// Created by Omar Zuniga on 29/05/24. | ||
// | ||
|
||
import Foundation | ||
|
||
struct ProfileResponseData: Codable { | ||
struct Attributes: Codable { | ||
var profileContent: String | ||
var uuid: String | ||
var name: String | ||
var platform: String | ||
var createdDate: Date | ||
var profileState: String | ||
var profileType: String | ||
var expirationDate: Date | ||
} | ||
struct Relationships: Codable { | ||
struct Devices: Codable { | ||
struct Data: Codable { | ||
var id: String | ||
var type: String | ||
} | ||
|
||
var data: [Data] | ||
} | ||
var devices: Devices | ||
} | ||
var id: String | ||
var type: String | ||
var attributes: Attributes | ||
var relationships: Relationships | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// ProfileType.swift | ||
// Models | ||
// | ||
// Created by Omar Zuniga on 29/05/24. | ||
// | ||
|
||
import Foundation | ||
|
||
enum ProfileType { | ||
case development | ||
case adHoc | ||
case appStore | ||
case inHouse | ||
case direct | ||
case unknown | ||
|
||
init(rawValue: String) { | ||
switch rawValue { | ||
case let str where str.hasSuffix("_APP_DEVELOPMENT"): self = .development | ||
case let str where str.hasSuffix("_APP_ADHOC"): self = .adHoc | ||
case let str where str.hasSuffix("_APP_STORE"): self = .appStore | ||
case let str where str.hasSuffix("_APP_INHOUSE"): self = .inHouse | ||
case let str where str.hasSuffix("_APP_DIRECT"): self = .direct | ||
default: self = .unknown | ||
} | ||
} | ||
|
||
var usesDevices: Bool { | ||
switch self { | ||
case .appStore: return false | ||
default: return true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.