mirror of
https://github.com/larksuite/cli.git
synced 2026-07-03 14:02:43 +08:00
37 lines
1018 B
Go
37 lines
1018 B
Go
// Copyright (c) 2026 Lark Technologies Pte. Ltd.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package base
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/larksuite/cli/shortcuts/common"
|
|
)
|
|
|
|
var BaseDashboardGet = common.Shortcut{
|
|
Service: "base",
|
|
Command: "+dashboard-get",
|
|
Description: "Get a dashboard by ID",
|
|
Risk: "read",
|
|
Scopes: []string{"base:dashboard:read"},
|
|
AuthTypes: authTypes(),
|
|
HasFormat: true,
|
|
Flags: []common.Flag{
|
|
baseTokenFlag(true),
|
|
dashboardIDFlag(true),
|
|
},
|
|
Tips: []string{
|
|
"Use +dashboard-block-list or +dashboard-block-get when you need block-level details.",
|
|
},
|
|
DryRun: func(ctx context.Context, runtime *common.RuntimeContext) *common.DryRunAPI {
|
|
return common.NewDryRunAPI().
|
|
GET("/open-apis/base/v3/bases/:base_token/dashboards/:dashboard_id").
|
|
Set("base_token", runtime.Str("base-token")).
|
|
Set("dashboard_id", runtime.Str("dashboard-id"))
|
|
},
|
|
Execute: func(ctx context.Context, runtime *common.RuntimeContext) error {
|
|
return executeDashboardGet(runtime)
|
|
},
|
|
}
|