Skip to content

Commit

Permalink
[keyvault] fix include_pending param and 2016-10-01 compatibility (Az…
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft authored and rakshith91 committed Sep 4, 2020
1 parent c2cbad0 commit 81a6cc1
Show file tree
Hide file tree
Showing 35 changed files with 1,339 additions and 826 deletions.
1 change: 1 addition & 0 deletions sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 4.2.1 (Unreleased)
### Fixed
- Correct typing for paging methods
- Fixed incompatibility issues with API version 2016-10-01


## 4.2.0 (2020-08-11)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,11 @@ def list_deleted_certificates(self, **kwargs):
"""
max_page_size = kwargs.pop("max_page_size", None)

if self.api_version == "2016-10-01" and kwargs.get("include_pending"):
raise NotImplementedError(
"The 'include_pending' parameter to `list_deleted_certificates` "
"is only available for API versions v7.0 and up"
)
return self._client.get_deleted_certificates(
vault_base_url=self._vault_url,
maxresults=max_page_size,
Expand Down Expand Up @@ -589,6 +594,12 @@ def list_properties_of_certificates(self, **kwargs):
"""
max_page_size = kwargs.pop("max_page_size", None)

if self.api_version == "2016-10-01" and kwargs.get("include_pending"):
raise NotImplementedError(
"The 'include_pending' parameter to `list_properties_of_certificates` "
"is only available for API versions v7.0 and up"
)

return self._client.get_certificates(
vault_base_url=self._vault_url,
maxresults=max_page_size,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,65 +37,13 @@ class KeyVaultClient(KeyVaultClientOperationsMixin, MultiApiClientMixin, _SDKCli
missing in profile.
:param profile: A profile definition, from KnownProfiles to dict.
:type profile: azure.profiles.KnownProfiles
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '7.1'
DEFAULT_API_VERSION = '2016-10-01'
_PROFILE_TAG = "azure.keyvault.KeyVaultClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
'backup_key': '7.0',
'backup_secret': '7.0',
'backup_storage_account': '7.0',
'create_key': '7.0',
'decrypt': '7.0',
'delete_key': '7.0',
'delete_sas_definition': '7.0',
'delete_secret': '7.0',
'delete_storage_account': '7.0',
'encrypt': '7.0',
'get_deleted_key': '7.0',
'get_deleted_keys': '7.0',
'get_deleted_sas_definition': '7.0',
'get_deleted_sas_definitions': '7.0',
'get_deleted_secret': '7.0',
'get_deleted_secrets': '7.0',
'get_deleted_storage_account': '7.0',
'get_deleted_storage_accounts': '7.0',
'get_key': '7.0',
'get_key_versions': '7.0',
'get_keys': '7.0',
'get_sas_definition': '7.0',
'get_sas_definitions': '7.0',
'get_secret': '7.0',
'get_secret_versions': '7.0',
'get_secrets': '7.0',
'get_storage_account': '7.0',
'get_storage_accounts': '7.0',
'import_key': '7.0',
'purge_deleted_key': '7.0',
'purge_deleted_secret': '7.0',
'purge_deleted_storage_account': '7.0',
'recover_deleted_key': '7.0',
'recover_deleted_sas_definition': '7.0',
'recover_deleted_secret': '7.0',
'recover_deleted_storage_account': '7.0',
'regenerate_storage_account_key': '7.0',
'restore_key': '7.0',
'restore_secret': '7.0',
'restore_storage_account': '7.0',
'set_sas_definition': '7.0',
'set_secret': '7.0',
'set_storage_account': '7.0',
'sign': '7.0',
'unwrap_key': '7.0',
'update_key': '7.0',
'update_sas_definition': '7.0',
'update_secret': '7.0',
'update_storage_account': '7.0',
'verify': '7.0',
'wrap_key': '7.0',
}},
_PROFILE_TAG + " latest"
)
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -37,65 +37,13 @@ class KeyVaultClient(KeyVaultClientOperationsMixin, MultiApiClientMixin, _SDKCli
missing in profile.
:param profile: A profile definition, from KnownProfiles to dict.
:type profile: azure.profiles.KnownProfiles
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '7.1'
DEFAULT_API_VERSION = '2016-10-01'
_PROFILE_TAG = "azure.keyvault.KeyVaultClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
'backup_key': '7.0',
'backup_secret': '7.0',
'backup_storage_account': '7.0',
'create_key': '7.0',
'decrypt': '7.0',
'delete_key': '7.0',
'delete_sas_definition': '7.0',
'delete_secret': '7.0',
'delete_storage_account': '7.0',
'encrypt': '7.0',
'get_deleted_key': '7.0',
'get_deleted_keys': '7.0',
'get_deleted_sas_definition': '7.0',
'get_deleted_sas_definitions': '7.0',
'get_deleted_secret': '7.0',
'get_deleted_secrets': '7.0',
'get_deleted_storage_account': '7.0',
'get_deleted_storage_accounts': '7.0',
'get_key': '7.0',
'get_key_versions': '7.0',
'get_keys': '7.0',
'get_sas_definition': '7.0',
'get_sas_definitions': '7.0',
'get_secret': '7.0',
'get_secret_versions': '7.0',
'get_secrets': '7.0',
'get_storage_account': '7.0',
'get_storage_accounts': '7.0',
'import_key': '7.0',
'purge_deleted_key': '7.0',
'purge_deleted_secret': '7.0',
'purge_deleted_storage_account': '7.0',
'recover_deleted_key': '7.0',
'recover_deleted_sas_definition': '7.0',
'recover_deleted_secret': '7.0',
'recover_deleted_storage_account': '7.0',
'regenerate_storage_account_key': '7.0',
'restore_key': '7.0',
'restore_secret': '7.0',
'restore_storage_account': '7.0',
'set_sas_definition': '7.0',
'set_secret': '7.0',
'set_storage_account': '7.0',
'sign': '7.0',
'unwrap_key': '7.0',
'update_key': '7.0',
'update_sas_definition': '7.0',
'update_secret': '7.0',
'update_storage_account': '7.0',
'verify': '7.0',
'wrap_key': '7.0',
}},
_PROFILE_TAG + " latest"
)
Expand Down
Loading

0 comments on commit 81a6cc1

Please sign in to comment.