@@ -126,6 +126,7 @@ internal struct CreateProvisioningProfileCommand: ParsableCommand {
126
126
case certificateSigningRequestSubject = " certificateSigningRequestSubject "
127
127
case profileName = " profileName "
128
128
case autoRegenerate = " autoRegenerate "
129
+ case enterprise = " enterprise "
129
130
}
130
131
131
132
@Option ( help: " The key identifier of the private key (https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests) " )
@@ -189,6 +190,9 @@ internal struct CreateProvisioningProfileCommand: ParsableCommand {
189
190
@Flag ( help: " Defines if the profile should be regenerated in case it already exists (optional) " )
190
191
internal var autoRegenerate = false
191
192
193
+ @Flag ( help: " Controls if the enterprise API should be used. " )
194
+ internal var enterprise : Bool = false
195
+
192
196
private let files : Files
193
197
private let log : Log
194
198
private let shell : Shell
@@ -206,10 +210,7 @@ internal struct CreateProvisioningProfileCommand: ParsableCommand {
206
210
shell = shellImp
207
211
uuid = UUIDImp ( )
208
212
iTunesConnectService = iTunesConnectServiceImp (
209
- network: NetworkImp ( ) ,
210
- files: filesImp,
211
- shell: shellImp,
212
- clock: clockImp
213
+ enterprise: false
213
214
)
214
215
}
215
216
@@ -236,7 +237,8 @@ internal struct CreateProvisioningProfileCommand: ParsableCommand {
236
237
bundleIdentifierName: String ? ,
237
238
platform: String ,
238
239
profileName: String ? ,
239
- autoRegenerate: Bool
240
+ autoRegenerate: Bool ,
241
+ enterprise: Bool
240
242
) {
241
243
self . files = files
242
244
self . log = log
@@ -261,24 +263,23 @@ internal struct CreateProvisioningProfileCommand: ParsableCommand {
261
263
self . platform = platform
262
264
self . profileName = profileName
263
265
self . autoRegenerate = autoRegenerate
266
+ self . enterprise = enterprise
264
267
}
265
268
266
269
internal init ( from decoder: Decoder ) throws {
267
270
let filesImp : Files = FilesImp ( )
268
271
let clockImp : Clock = ClockImp ( )
269
272
let shellImp : Shell = ShellImp ( )
270
273
let container : KeyedDecodingContainer < CodingKeys > = try decoder. container ( keyedBy: CodingKeys . self)
274
+ let enterprise : Bool = try container. decode ( Bool . self, forKey: . enterprise)
271
275
self . init (
272
276
files: filesImp,
273
277
log: LogImp ( ) ,
274
278
jsonWebTokenService: JSONWebTokenServiceImp ( clock: clockImp) ,
275
279
shell: shellImp,
276
280
uuid: UUIDImp ( ) ,
277
281
iTunesConnectService: iTunesConnectServiceImp (
278
- network: NetworkImp ( ) ,
279
- files: filesImp,
280
- shell: shellImp,
281
- clock: clockImp
282
+ enterprise: enterprise
282
283
) ,
283
284
keyIdentifier: try container. decode ( String . self, forKey: . keyIdentifier) ,
284
285
issuerID: try container. decode ( String . self, forKey: . issuerID) ,
@@ -296,7 +297,8 @@ internal struct CreateProvisioningProfileCommand: ParsableCommand {
296
297
bundleIdentifierName: try container. decodeIfPresent ( String . self, forKey: . bundleIdentifierName) ,
297
298
platform: try container. decode ( String . self, forKey: . platform) ,
298
299
profileName: try container. decodeIfPresent ( String . self, forKey: . profileName) ,
299
- autoRegenerate: try container. decode ( Bool . self, forKey: . autoRegenerate)
300
+ autoRegenerate: try container. decode ( Bool . self, forKey: . autoRegenerate) ,
301
+ enterprise: enterprise
300
302
)
301
303
}
302
304
0 commit comments