as(_:)
Casts the value to the given type.
Declaration
func `as`<IntentType>(_ type: IntentType) throws -> IntentType.Instance where IntentType : AppIntentTypeDefinitionDiscussion
If the value’s type doesn’t match, this method throws an error.
let CoffeeEntity = definitions.entities["CoffeeEntity"]
let coffee: AnyAppEntity = try result.value.as(CoffeeEntity)