()
| 21 | } |
| 22 | |
| 23 | func newRecordingsCommand() *recordingsCommand { |
| 24 | recordingsCommand := &recordingsCommand{} |
| 25 | recordingsCommand.cmd = &cobra.Command{ |
| 26 | Use: "recordings <calendar-id>", |
| 27 | Short: "List recordings (events, todos, etc.) for a calendar", |
| 28 | Annotations: map[string]string{ |
| 29 | "agent_notes": "Returns recordings grouped by type for a calendar. Defaults to today + 30 days.", |
| 30 | }, |
| 31 | Example: ` hey recordings 123 |
| 32 | hey recordings 123 --starts-on 2024-01-01 --ends-on 2024-01-31 |
| 33 | hey recordings 123 --limit 5 --json`, |
| 34 | RunE: recordingsCommand.run, |
| 35 | Args: usageExactOneArg(), |
| 36 | } |
| 37 | |
| 38 | recordingsCommand.cmd.Flags().StringVar(&recordingsCommand.startsOn, "starts-on", "", "Start date (YYYY-MM-DD, defaults to today)") |
| 39 | recordingsCommand.cmd.Flags().StringVar(&recordingsCommand.endsOn, "ends-on", "", "End date (YYYY-MM-DD, defaults to 30 days from starts-on)") |
| 40 | recordingsCommand.cmd.Flags().IntVar(&recordingsCommand.limit, "limit", 0, "Maximum number of recordings per type to show") |
| 41 | recordingsCommand.cmd.Flags().BoolVar(&recordingsCommand.all, "all", false, "Fetch all results (override --limit)") |
| 42 | |
| 43 | return recordingsCommand |
| 44 | } |
| 45 | |
| 46 | func (c *recordingsCommand) run(cmd *cobra.Command, args []string) error { |
| 47 | if err := requireAuth(); err != nil { |
no test coverage detected