Skip to content

Commit

Permalink
BetaGroup && BetaTester struct let -> var, remove tester inviteType
Browse files Browse the repository at this point in the history
  • Loading branch information
DechengMa committed Jul 24, 2020
1 parent 5d36cf9 commit 5be708c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ struct TestFlightPushCommand: CommonParsableCommand {
}

try creatingTestersWithStrategy.forEach {

try service.inviteBetaTesterToGroups(
email: $0.tester.email,
groupId: betagroupId,
Expand Down
11 changes: 5 additions & 6 deletions Sources/AppStoreConnectCLI/Services/AppStoreConnectService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ class AppStoreConnectService {
}

func inviteBetaTesterToGroups(
firstName: String?,
lastName: String?,
email: String,
groupId: String
groupId: String,
firstName: String?,
lastName: String?
) throws {
_ = try InviteTesterOperation(
options: .init(
Expand Down Expand Up @@ -973,7 +973,7 @@ class AppStoreConnectService {
.await()
}

func pullTestFlightConfigs() throws -> [TestFlightConfiguration] {
func pullTestFlightConfigurations() throws -> [TestFlightConfiguration] {
let apps = try listApps(bundleIds: [], names: [], skus: [], limit: nil)

return try apps.map {
Expand All @@ -986,8 +986,7 @@ class AppStoreConnectService {
FileSystem.BetaTester(
email: ($0.betaTester.attributes?.email)!,
firstName: $0.betaTester.attributes?.firstName,
lastName: $0.betaTester.attributes?.lastName,
inviteType: $0.betaTester.attributes?.inviteType?.rawValue
lastName: $0.betaTester.attributes?.lastName
)
}

Expand Down
18 changes: 9 additions & 9 deletions Sources/FileSystem/Model/BetaGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ public struct BetaGroup: Codable, Equatable {

public typealias EmailAddress = String

public let id: String?
public let groupName: String
public let isInternal: Bool?
public let publicLink: String?
public let publicLinkEnabled: Bool?
public let publicLinkLimit: Int?
public let publicLinkLimitEnabled: Bool?
public let creationDate: String?
public let testers: [EmailAddress]
public var id: String?
public var groupName: String
public var isInternal: Bool?
public var publicLink: String?
public var publicLinkEnabled: Bool?
public var publicLinkLimit: Int?
public var publicLinkLimitEnabled: Bool?
public var creationDate: String?
public var testers: [EmailAddress]

public init(
id: String?,
Expand Down
16 changes: 6 additions & 10 deletions Sources/FileSystem/Model/BetaTester.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,18 @@ import Foundation
import Model

public struct BetaTester: Codable, Equatable, Hashable {
public let email: String
public let firstName: String
public let lastName: String
public let inviteType: String
public var email: String
public var firstName: String
public var lastName: String

public init(
email: String,
firstName: String?,
lastName: String?,
inviteType: String?
lastName: String?
) {
self.email = email
self.firstName = firstName ?? ""
self.lastName = lastName ?? ""
self.inviteType = inviteType ?? ""
}
}

Expand All @@ -29,7 +26,6 @@ extension BetaTester {
case email = "Email"
case firstName = "First Name"
case lastName = "Last Name"
case inviteType = "Invite Type"
}

}
Expand All @@ -49,10 +45,10 @@ extension CSVRenderable {

extension Array: CSVRenderable where Element == BetaTester {
var headers: [String] {
["Email", "First Name", "Last Name", "Invite Type"]
["Email", "First Name", "Last Name"]
}

var rows: [[String]] {
self.map { [$0.email, $0.firstName, $0.lastName, $0.inviteType] }
self.map { [$0.email, $0.firstName, $0.lastName] }
}
}

0 comments on commit 5be708c

Please sign in to comment.