Skip to content

Add outlook calendargroup get command. Closes #7111#7166

Open
AlejandroGispert wants to merge 3 commits intopnp:mainfrom
AlejandroGispert:feature/outlook-calendargroup-get
Open

Add outlook calendargroup get command. Closes #7111#7166
AlejandroGispert wants to merge 3 commits intopnp:mainfrom
AlejandroGispert:feature/outlook-calendargroup-get

Conversation

@AlejandroGispert
Copy link
Copy Markdown
Contributor

@AlejandroGispert AlejandroGispert commented Mar 20, 2026

Closes #7111

Summary
Adds the missing m365 outlook calendargroup get command to retrieve a specific calendar group for a user, supporting lookup by either --id or --name (with --name resolving to an id via OData filtering).

Details
Implements m365 outlook calendargroup get with delegated vs app-only permission handling.
Enforces mutually exclusive --id/--name and --userId/--userName.
Adds unit tests and a docs page, and wires the command into the docs sidebar.

@AlejandroGispert AlejandroGispert force-pushed the feature/outlook-calendargroup-get branch from 46032d6 to 3da5852 Compare March 20, 2026 14:51
@AlejandroGispert AlejandroGispert marked this pull request as draft March 20, 2026 15:05
@AlejandroGispert AlejandroGispert force-pushed the feature/outlook-calendargroup-get branch from e63aaba to d002fb8 Compare March 20, 2026 15:57
@AlejandroGispert AlejandroGispert marked this pull request as ready for review March 20, 2026 16:01
@AlejandroGispert
Copy link
Copy Markdown
Contributor Author

Hi @milanholemans @MartinM85 , Can you check my PR?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the missing m365 outlook calendargroup get command to the CLI for Microsoft 365 to retrieve a specific Outlook calendar group for a user, supporting lookup by either --id or --name, and documenting/validating delegated vs app-only behavior.

Changes:

  • Introduces outlook calendargroup get command implementation with Zod validation and Graph calls
  • Adds unit tests covering key permission/lookup scenarios
  • Adds documentation page and wires it into the Docusaurus sidebar

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/m365/outlook/commands/calendargroup/calendargroup-get.ts Implements the new calendargroup get command, including permission handling and name-to-id resolution
src/m365/outlook/commands/calendargroup/calendargroup-get.spec.ts Adds unit tests for the new command (id/name, delegated/app-only, shared-scope handling)
src/m365/outlook/commands.ts Registers the new command name constant
docs/src/config/sidebars.ts Adds the new command docs page to the Outlook sidebar group
docs/docs/cmd/outlook/calendargroup/calendargroup-get.mdx Adds reference documentation for outlook calendargroup get

Comment thread src/m365/outlook/commands/calendargroup/calendargroup-get.ts Outdated
Comment thread src/m365/outlook/commands/calendargroup/calendargroup-get.ts Outdated
@AlejandroGispert
Copy link
Copy Markdown
Contributor Author

Hi @milanholemans @MartinM85 , Can you check my PR?

@MartinM85 MartinM85 self-assigned this Apr 2, 2026
Copy link
Copy Markdown
Contributor

@MartinM85 MartinM85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @AlejandroGispert, great start 👍.

I have a couple of comments, nothing major.

Comment thread docs/docs/cmd/outlook/calendargroup/calendargroup-get.mdx Outdated
Comment thread docs/docs/cmd/outlook/calendargroup/calendargroup-get.mdx Outdated
Comment thread docs/docs/cmd/outlook/calendargroup/calendargroup-get.mdx Outdated
Comment thread docs/docs/cmd/outlook/calendargroup/calendargroup-get.mdx Outdated
Comment thread src/m365/outlook/commands/calendargroup/calendargroup-get.ts Outdated
Comment thread src/m365/outlook/commands/calendargroup/calendargroup-get.ts Outdated
@MartinM85 MartinM85 marked this pull request as draft April 2, 2026 17:31
@AlejandroGispert
Copy link
Copy Markdown
Contributor Author

thanks for the corrections. i am on it

…rs for API requests

- Updated the command to encode user identifiers before constructing API URLs.
- Adjusted test cases to reflect changes in user identifier handling.
@AlejandroGispert AlejandroGispert force-pushed the feature/outlook-calendargroup-get branch 2 times, most recently from 47f50d4 to c4f8bfe Compare April 17, 2026 03:09
- Revised examples in the documentation to include actual calendar group data.
- Refactored the `OutlookCalendarGroupGetCommand` to improve handling of calendar group retrieval by name.
- Removed the default properties method and streamlined the command action for better clarity and functionality.

Add `CALENDARGROUP_GET` command and update tests

- Introduced the `CALENDARGROUP_GET` command to retrieve calendar groups.
- Updated test cases to reflect changes in API request handling and removed unnecessary resolved calendar group ID references.
- Simplified expected API URLs in tests for better clarity.

Add test for retrieving calendar group by name with verbose output

- Implemented a new test case to verify the retrieval of a calendar group by name for the signed-in user when verbose output is enabled.
- Enhanced logging assertions to ensure correct output during the command execution.
- Stubbed API request to simulate expected behavior for the test scenario.
@AlejandroGispert AlejandroGispert force-pushed the feature/outlook-calendargroup-get branch from bdfc1a9 to e2943d1 Compare April 17, 2026 03:35
@AlejandroGispert
Copy link
Copy Markdown
Contributor Author

Hi @MartinM85 :
I Removed defaultProperties from calendargroup get,
Optimized --name flow to return filtered result without second GET,
Ensured encoded user identifier usage for users('...'),
Updated docs response samples with realistic values + formatting,
Updated/added tests (including verbose --name) to restore full coverage.

@AlejandroGispert AlejandroGispert marked this pull request as ready for review April 17, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New command: outlook calendargroup get

3 participants