Clean up some entitlements code (#165)

- We already do the `isFree` declarations in
`DeveloperServiceCapability.swift`. Don't need to duplicate it on the
entitlement types.
- Add support for creating capabilities with raw names
This commit is contained in:
Kabir Oberai
2025-09-28 19:04:28 -04:00
committed by GitHub
parent 430cbd144b
commit f29f6ba601
2 changed files with 10 additions and 19 deletions

View File

@@ -23,6 +23,16 @@ public struct DeveloperServicesCapability: Sendable, Hashable {
self.isFree = isFree
self.settings = settings
}
public init(
rawName: String,
isFree: Bool,
settings: [Components.Schemas.CapabilitySetting]? = nil
) {
self.capabilityType = .init(value2: rawName)
self.isFree = isFree
self.settings = settings
}
}
protocol EntitlementWithCapability: Entitlement {