[Key Vault] Add docstring examples for KeyVaultAccessControlClient and KeyVaultSettingsClient #42196
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #34790
This PR adds comprehensive docstring examples for all public methods in
KeyVaultAccessControlClient
andKeyVaultSettingsClient
, following the same pattern established byKeyVaultBackupClient
.Changes Made
Added Example Tests
test_examples_administration.py
: Added 3 new test methods with example code blocks for sync clientstest_examples_administration_async.py
: Added 3 new test methods with example code blocks for async clientsUpdated Docstrings with Examples
KeyVaultAccessControlClient (8 methods):
create_role_assignment
- Create a role assignment for a principaldelete_role_assignment
- Delete an existing role assignmentget_role_assignment
- Retrieve a specific role assignmentlist_role_assignments
- List all role assignments for a scopeset_role_definition
- Create or update a custom role definitionget_role_definition
- Retrieve a specific role definitiondelete_role_definition
- Delete a custom role definitionlist_role_definitions
- List all available role definitionsKeyVaultSettingsClient (3 methods):
get_setting
- Get a specific Managed HSM settinglist_settings
- List all Managed HSM settingsupdate_setting
- Update a Managed HSM setting valueExample Usage
The added examples demonstrate practical usage patterns:
All examples use the Sphinx
literalinclude
directive to reference actual test code, ensuring the documentation examples remain accurate and executable.Validation
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.