(
lines: string[],
method: RpcMethod,
resolveType: (name: string) => string,
groupExperimental = false,
groupDeprecated = false
)
| 3643 | } |
| 3644 | |
| 3645 | function emitClientSessionHandlerMethod( |
| 3646 | lines: string[], |
| 3647 | method: RpcMethod, |
| 3648 | resolveType: (name: string) => string, |
| 3649 | groupExperimental = false, |
| 3650 | groupDeprecated = false |
| 3651 | ): void { |
| 3652 | const paramsType = resolveType(pythonParamsTypeName(method)); |
| 3653 | const resultSchema = getMethodResultSchema(method); |
| 3654 | const nullableInner = resultSchema ? getNullableInner(resultSchema) : undefined; |
| 3655 | let resultType: string; |
| 3656 | if (nullableInner) { |
| 3657 | resultType = `${resolveType(pythonResultTypeName(method, nullableInner))} | None`; |
| 3658 | } else if (!isVoidSchema(resultSchema)) { |
| 3659 | resultType = resolveType(pythonResultTypeName(method)); |
| 3660 | } else { |
| 3661 | resultType = "None"; |
| 3662 | } |
| 3663 | const methodName = clientSessionHandlerMethodName(method.rpcMethod); |
| 3664 | lines.push(` async def ${methodName}(self, params: ${paramsType}) -> ${resultType}:`); |
| 3665 | pushPyRpcMethodDocstring(lines, " ", method, { |
| 3666 | paramsName: "params", |
| 3667 | paramsDescription: rpcParamsDescription(method, getMethodParamsSchema(method)), |
| 3668 | resultDescription: rpcResultDescription(method, resultSchema), |
| 3669 | deprecated: method.deprecated && !groupDeprecated, |
| 3670 | experimental: method.stability === "experimental" && !groupExperimental, |
| 3671 | }); |
| 3672 | lines.push(` pass`); |
| 3673 | } |
| 3674 | |
| 3675 | function emitClientSessionRegistrationMethod( |
| 3676 | lines: string[], |
no test coverage detected
searching dependent graphs…