mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 21:09:11 +00:00
38 lines
663 B
Plaintext
38 lines
663 B
Plaintext
@go.Package { name = "github.com/onsonr/sonr/motr/api" }
|
|
|
|
module api
|
|
|
|
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
|
|
|
class JsonField extends go.Field {
|
|
structTags {
|
|
["json"] = "%{name},omitempty"
|
|
}
|
|
}
|
|
|
|
abstract class Request {
|
|
route: String
|
|
method: String
|
|
headers: Map<String, String>
|
|
origin: String?
|
|
userAgent: String?
|
|
body: Dynamic
|
|
}
|
|
|
|
abstract class Response {
|
|
statusCode: Int
|
|
headers: Map<String, String>
|
|
body: Dynamic
|
|
}
|
|
|
|
class GetAccountsRequest extends Request {
|
|
route = "/accounts"
|
|
method = "GET"
|
|
headers = {
|
|
"Content-Type" = "application/json"
|
|
}
|
|
origin = null
|
|
userAgent = null
|
|
body = null
|
|
}
|