Skip to content

Commit

Permalink
Add request box descriptions (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlocke committed Aug 27, 2024
1 parent 04b37cf commit bfe220e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions stone/backends/swift_rsrc/SwiftRequestBox.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@
import Foundation

/// Allows for heterogenous collections of typed requests
public enum {{ class_name }} {
public enum {{ class_name }}: CustomStringConvertible {
{% for route in background_compatible_routes %}
case {{ fmt_func(route.name, route.version) }}({{ request_type_signature(route) }})
{% endfor %}
}

public var description: String {
switch self {
{% for route in background_compatible_routes %}
case .{{ fmt_func(route.name, route.version) }}(_):
return "{{ fmt_func(route.name, route.version) }}"
{% endfor %}
}
}
}

0 comments on commit bfe220e

Please sign in to comment.