MethodDefinition

data class MethodDefinition<T> @InternalKrosstalkApi constructor(name: String, endpoint: Endpoint, httpMethod: String, contentType: String?, requiredScopes: Set<Scope>, optionalScopes: Set<Scope>, useExplicitResult: Boolean, includeStacktrace: Boolean, propagateServerExceptions: Boolean, optionalParameters: Set<String>, serverDefaultParameters: Set<String>, objectParameters: Map<String, *>, returnObject: Any?, outerWithHeaders: Boolean, innerWithHeaders: Boolean, requestHeadersParam: String?, serverUrlParam: String?, types: MethodTypes, serialization: MethodSerialization, call: MethodCaller<T>)

All the Krosstalk metadata associated with a krosstalk method.

Constructors

Link copied to clipboard
fun MethodDefinition(name: String, endpoint: Endpoint, httpMethod: String, contentType: String?, requiredScopes: Set<Scope>, optionalScopes: Set<Scope>, useExplicitResult: Boolean, includeStacktrace: Boolean, propagateServerExceptions: Boolean, optionalParameters: Set<String>, serverDefaultParameters: Set<String>, objectParameters: Map<String, *>, returnObject: Any?, outerWithHeaders: Boolean, innerWithHeaders: Boolean, requestHeadersParam: String?, serverUrlParam: String?, types: MethodTypes, serialization: MethodSerialization, call: MethodCaller<T>)

Properties

Link copied to clipboard
val allScopes: Set<Scope>

all scopes used by the method

Link copied to clipboard
val call: MethodCaller<T>

a lambda to call the method

Link copied to clipboard
val contentType: String?

the content type to use for bodies, or null to use the serialization handler's

Link copied to clipboard
val endpoint: Endpoint

the method endpoint

Link copied to clipboard
val httpMethod: String

the http method to use

Link copied to clipboard
val includeStacktrace: Boolean

whether any KrosstalkResult.ServerExceptions should include the exception stack trace

Link copied to clipboard
val innerWithHeaders: Boolean

whether to wrap the initial result (not including KrosstalkResult handling) in WithHeaders

Link copied to clipboard
val name: String

the method name

Link copied to clipboard
val objectParameters: Map<String, *>

parameters that are objects and shouldn't be transfered

Link copied to clipboard
val optionalParameters: Set<String>

scopes optionally used by the method

Link copied to clipboard
val optionalScopes: Set<Scope>
Link copied to clipboard
val outerWithHeaders: Boolean

whether to wrap the final result (including KrosstalkResult handling) in WithHeaders

Link copied to clipboard
val requestHeadersParam: String?

the name of the parameter that contains the request headers, if there is one

Link copied to clipboard
val requiredScopes: Set<Scope>

scopes required by the method

Link copied to clipboard
val returnObject: Any?

the object to use as the return value, if there is one

Link copied to clipboard
Link copied to clipboard
val serverDefaultParameters: Set<String>

parameters using ServerDefault

Link copied to clipboard
val serverUrlParam: String?

the name of the parameter that contains the server url, if there is one

Link copied to clipboard
val types: MethodTypes

the method's parameter and return types

Link copied to clipboard
val useExplicitResult: Boolean

whether the result is wrapped in a KrosstalkResult

Sources

Link copied to clipboard