(deps commandDeps, workspaceRef *string)
| 941 | } |
| 942 | |
| 943 | func newNetworkInboxCommand(deps commandDeps, workspaceRef *string) *cobra.Command { |
| 944 | var sessionID string |
| 945 | |
| 946 | cmd := &cobra.Command{ |
| 947 | Use: "inbox", |
| 948 | Short: "Show queued inbound messages for one session", |
| 949 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 950 | client, err := clientFromDeps(deps) |
| 951 | if err != nil { |
| 952 | return err |
| 953 | } |
| 954 | workspace, err := resolveNetworkWorkspaceRef(cmd, deps, client, workspaceRef) |
| 955 | if err != nil { |
| 956 | return err |
| 957 | } |
| 958 | |
| 959 | messages, err := client.NetworkInbox(cmd.Context(), workspace, strings.TrimSpace(sessionID)) |
| 960 | if err != nil { |
| 961 | return err |
| 962 | } |
| 963 | return writeCommandOutput(cmd, networkInboxBundle(messages)) |
| 964 | }, |
| 965 | } |
| 966 | |
| 967 | cmd.Flags().StringVar(&sessionID, "session", "", "Target session id") |
| 968 | mustMarkFlagRequired(cmd, "session") |
| 969 | return cmd |
| 970 | } |
| 971 | |
| 972 | type networkSubscriptionFlags struct { |
| 973 | channel string |
no test coverage detected