Skip to content

Commit be36f09

Browse files
committed
create func inviteBetaTesterToGroups and removeTesterFromGroups
1 parent 6df2bcc commit be36f09

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Sources/AppStoreConnectCLI/Services/AppStoreConnectService.swift

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,46 @@ class AppStoreConnectService {
8181
return BetaTester(output)
8282
}
8383

84+
func inviteBetaTesterToGroups(
85+
firstName: String?,
86+
lastName: String?,
87+
email: String,
88+
groupIds: [String]
89+
) throws {
90+
_ = try InviteTesterOperation(options: .init(
91+
firstName: firstName,
92+
lastName: lastName,
93+
email: email,
94+
identifers: .resourceId(groupIds))
95+
)
96+
.execute(with: requestor)
97+
.await()
98+
}
99+
100+
func removeTesterFromGroups(
101+
email: String,
102+
groupIds: [String]
103+
) throws {
104+
let testerId = try GetBetaTesterOperation(
105+
options: .init(identifier: .email(email))
106+
)
107+
.execute(with: requestor)
108+
.await()
109+
.betaTester
110+
.id
111+
112+
try RemoveTesterOperation(
113+
options: .init(
114+
removeStrategy: .removeTesterFromGroups(
115+
testerId: testerId,
116+
groupIds: groupIds
117+
)
118+
)
119+
)
120+
.execute(with: requestor)
121+
.await()
122+
}
123+
84124
func addTestersToGroup(
85125
bundleId: String,
86126
groupName: String,

0 commit comments

Comments
 (0)