• Get cached service response by path and method

    Returns the response data cached by

    Type Parameters

    • T = any

    Parameters

    • model: IKosDataModel

      The KOS model instance

    • path: string

      The API path constant

    • method: HttpMethod = "get"

      The HTTP method (defaults to 'get')

    Returns T | undefined

    The cached response data, or undefined if not found/expired

    Kos Service Request

    decorated methods. TypeScript will infer types from your OpenAPI schema when using typed path constants.

    For cross-package scenarios where OpenAPI specs differ, you can optionally provide an explicit type parameter.

    Example: Standard usage (types inferred from OpenAPI)

    const status = getServiceResponse(this, PATH_DEVICE_STATUS, 'get');
    // TypeScript infers the type from PATH_DEVICE_STATUS

    Example: Cross-package usage with explicit type (when OpenAPI schemas differ)

    // Studio models using different OpenAPI than main SDK
    const vms = getServiceResponse<StudioVMResponse>(this, PATH_VMS, 'get');